00:01
gix has quit [Ping timeout: 272 seconds]
00:04
involans has joined #ruby
00:05
queip has joined #ruby
00:06
skryking_ has joined #ruby
00:08
skryking has quit [Ping timeout: 245 seconds]
00:10
envex has joined #ruby
00:11
jcalla has quit [Ping timeout: 276 seconds]
00:13
psilly0 has quit [Ping timeout: 245 seconds]
00:17
lepepe has joined #ruby
00:18
lepepe_ has joined #ruby
00:20
Dr_MDMA_MD has quit []
00:22
lepepe has quit [Ping timeout: 268 seconds]
00:24
involans has quit [Quit: involans]
00:28
Dr_MDMA_MD has joined #ruby
00:34
involans has joined #ruby
00:37
cornfeedhobo has quit [Ping timeout: 245 seconds]
00:40
xco has joined #ruby
00:41
stan has quit [Ping timeout: 245 seconds]
00:45
Fernando-Basso has quit [Remote host closed the connection]
00:46
AJA4351 has joined #ruby
00:48
AJA4350 has quit [Ping timeout: 272 seconds]
00:48
AJA4351 is now known as AJA4350
00:53
Thenekofell has quit [Ping timeout: 245 seconds]
00:57
RyanMcCoskrie has quit [Remote host closed the connection]
00:58
jenrzzz has quit [Ping timeout: 272 seconds]
00:59
skryking_ has quit [Quit: Leaving]
01:01
cornfeedhobo has joined #ruby
01:06
xco has quit [Quit: xco]
01:18
involans has quit [Quit: involans]
01:19
involans has joined #ruby
01:19
davor_ has joined #ruby
01:20
davor has quit [Ping timeout: 248 seconds]
01:20
davor_ is now known as davor
01:30
Thenekofell has joined #ruby
01:31
colechristensen has joined #ruby
01:32
colechristensen has quit [Read error: Connection reset by peer]
01:34
colechr60 has quit [Ping timeout: 246 seconds]
01:37
xco has joined #ruby
01:41
AJA4350 has quit [Quit: AJA4350]
01:41
colechristensen has joined #ruby
01:42
caduguedess has quit [Ping timeout: 245 seconds]
01:43
Thenekofell has quit [Ping timeout: 248 seconds]
01:50
jenrzzz has joined #ruby
01:54
Fusl has quit [Max SendQ exceeded]
01:54
Fusl has joined #ruby
01:57
xco has quit [Quit: xco]
01:58
Thenekofell has joined #ruby
02:04
cornfeedhobo has quit [Ping timeout: 245 seconds]
02:07
dviola has joined #ruby
02:10
involans has quit [Quit: involans]
02:11
lepepe_ has quit [Remote host closed the connection]
02:12
lepepe has joined #ruby
02:16
lepepe has quit [Ping timeout: 248 seconds]
02:21
ElFerna has joined #ruby
02:21
Swyper has joined #ruby
02:27
DaRock has joined #ruby
02:35
lepepe_ has joined #ruby
02:37
cornfeedhobo has joined #ruby
02:37
aither has quit [Ping timeout: 272 seconds]
02:44
chalkmonster has quit [Quit: WeeChat 2.5]
02:46
lepepe has joined #ruby
02:48
lepepe_ has quit [Ping timeout: 248 seconds]
02:54
Swyper has quit [Remote host closed the connection]
02:55
chalkmonster has joined #ruby
03:00
chalkmonster has quit [Ping timeout: 272 seconds]
03:02
s3nd1v0g1us has joined #ruby
03:03
xco has joined #ruby
03:12
Swyper has joined #ruby
03:15
Swyper has quit [Remote host closed the connection]
03:16
dbugger has joined #ruby
03:16
jenrzzz has quit [Ping timeout: 246 seconds]
03:18
xfbs has quit [Read error: Connection reset by peer]
03:19
jenrzzz has joined #ruby
03:21
lepepe has quit [Remote host closed the connection]
03:22
lepepe has joined #ruby
03:23
jenrzzz has quit [Ping timeout: 245 seconds]
03:26
lepepe has quit [Ping timeout: 245 seconds]
03:30
xfbs has joined #ruby
03:30
jenrzzz has joined #ruby
03:35
jenrzzz has quit [Ping timeout: 268 seconds]
03:45
ElFerna has quit [Ping timeout: 272 seconds]
03:46
s3nd1v0g1us has quit [Ping timeout: 246 seconds]
03:48
s3nd1v0g1us has joined #ruby
03:48
fr3tz0r has quit [Quit: Leaving]
03:50
peterson has joined #ruby
03:54
peterson has quit [Remote host closed the connection]
03:58
colechristensen has quit [Ping timeout: 248 seconds]
04:03
peterson has joined #ruby
04:06
Nicmavr has quit [Read error: Connection reset by peer]
04:08
Nicmavr has joined #ruby
04:11
donofrio has quit [Remote host closed the connection]
04:13
s3nd1v0g1us has quit [Ping timeout: 245 seconds]
04:18
DTZUZO has joined #ruby
04:26
evdubs has quit [Remote host closed the connection]
04:26
evdubs has joined #ruby
04:30
jcalla has joined #ruby
04:31
teclator has quit [Ping timeout: 268 seconds]
04:34
jenrzzz has joined #ruby
04:36
houhoulis has joined #ruby
04:36
chalkmonster has joined #ruby
04:36
jenrzzz has quit [Read error: Connection reset by peer]
04:39
jenrzzz has joined #ruby
04:44
peterson has quit [Remote host closed the connection]
04:46
dellavg_ has joined #ruby
05:03
chalkmonster has quit [Quit: WeeChat 2.5]
05:04
jmcgnh has quit [Ping timeout: 258 seconds]
05:06
jmcgnh has joined #ruby
05:12
chalkmonster has joined #ruby
05:12
t3hyoshi has joined #ruby
05:13
marvin__ has joined #ruby
05:13
marvin__ has left #ruby [#ruby]
05:30
conta has joined #ruby
05:32
absolutejam has joined #ruby
05:36
Autolycus has joined #ruby
05:37
jenrzzz has quit [Ping timeout: 248 seconds]
05:37
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
05:37
jenrzzz has joined #ruby
05:42
kyrylo has joined #ruby
05:42
chalkmonster has quit [Quit: WeeChat 2.5]
05:44
conta has quit [Ping timeout: 246 seconds]
05:45
conta has joined #ruby
05:47
kyrylo has quit [Client Quit]
05:49
ivanskie has joined #ruby
05:50
<
ivanskie >
is anyone using ElastiCache Redis on aws with encryption at rest and in transit turned on?
05:50
<
ivanskie >
hmm i guess this is more of a rails question
05:54
Autolycus has quit []
05:55
aither has joined #ruby
06:01
tdy has joined #ruby
06:02
johnny56 has quit [Ping timeout: 272 seconds]
06:03
johnny56 has joined #ruby
06:05
Thenekofell has quit [Ping timeout: 246 seconds]
06:09
DTZUZO has quit [Ping timeout: 258 seconds]
06:10
jenrzzz has quit [Ping timeout: 246 seconds]
06:16
DTZUZO has joined #ruby
06:17
SeepingN has joined #ruby
06:19
queip has quit [Ping timeout: 272 seconds]
06:20
chalkmonster has joined #ruby
06:20
houhoulis has quit [Remote host closed the connection]
06:23
schne1der has joined #ruby
06:24
andikr has joined #ruby
06:27
queip has joined #ruby
06:27
kyrylo has joined #ruby
06:30
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
06:31
silviu has quit [Remote host closed the connection]
06:31
silviu has joined #ruby
06:33
jenrzzz has joined #ruby
06:36
jenrzzz has quit [Read error: Connection reset by peer]
06:37
absolutejam has quit [Ping timeout: 245 seconds]
06:38
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
06:38
jenrzzz has joined #ruby
06:39
Guest62509 has quit [Quit: All for nothing]
06:40
olspookishmagus has joined #ruby
06:46
conta has quit [Ping timeout: 245 seconds]
06:46
emptyflask has quit [Ping timeout: 252 seconds]
06:47
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
06:49
conta has joined #ruby
06:52
aupadhye has joined #ruby
06:53
snickers has joined #ruby
07:03
vondruch has joined #ruby
07:07
queip has quit [Ping timeout: 248 seconds]
07:14
queip has joined #ruby
07:15
lxsameer has joined #ruby
07:18
Thenekofell has joined #ruby
07:18
Dr_MDMA_MD has quit [Quit: Connection closed for inactivity]
07:19
code_zombie has quit [Quit: Leaving]
07:20
absolutejam has joined #ruby
07:21
ascarter has joined #ruby
07:22
TomyWork has joined #ruby
07:24
m04ftKK has joined #ruby
07:25
<
m04ftKK >
Why this doesn't works ruby -e '3.times { |n| exec("echo #{n}") }
07:27
<
rubydoc >
I found 2 entries matching method exec. Use &list exec if you would like to see a list
07:27
<
phaul >
ri Kernel#exec
07:27
<
phaul >
&ri Kernel#exec
07:27
<
ytti >
because exec works same as in shells
07:27
<
ytti >
it replaces the current running process
07:28
<
ytti >
if you do that in your bash or zsh or whatever, same thing happens
07:28
<
ytti >
use-case is some wrapper which is meant to do something and lauch some program with some arguments
07:28
<
m04ftKK >
This works ruby -e '3.times { |n| fork { exec("echo #{n}") }}'
07:29
<
ytti >
because it replaced the forked pid
07:29
<
ytti >
not the ruby pid
07:29
<
ytti >
you may want
07:30
<
ytti >
%x("command here")
07:30
<
ytti >
or system("command here")
07:30
<
ytti >
however, personally, I would always use popen3
07:30
<
ytti >
because shell interpretation usually is undesirable and dangerous
07:30
<
ytti >
and with popen3 you can pass name of executable and its arguments separately
07:31
m04ftKK has quit [Quit: This computer has gone to sleep]
07:31
<
phaul >
altough echo in this example is probably built in
07:31
m04ftKK has joined #ruby
07:31
<
ytti >
i think programmign languages like ruby, should make shell expansion the special case
07:32
<
ytti >
and system(bin, args) the common case
07:32
<
ytti >
so that it would be easy to code safe
07:32
<
ytti >
and hard to code unsafe
07:32
<
ytti >
now it's the converse, people code unsafe shell execution, because the safe way is bit more trouble and they are not aware of the implications
07:33
queip has quit [Ping timeout: 268 seconds]
07:34
<
phaul >
I rarely use ruby as a shell script replacement so I almost never need to call external programs. Even when there is functionality I prefer a lib
07:34
<
m04ftKK >
ruby -e '3.times { |n| %x("echo #{n}") }'
07:34
<
m04ftKK >
sh: echo 0: command not found
07:34
<
m04ftKK >
sh: echo 1: command not found
07:34
<
m04ftKK >
sh: echo 2: command not found
07:38
m04ftKK has quit [Quit: This computer has gone to sleep]
07:40
queip has joined #ruby
07:41
reber has joined #ruby
07:42
m04ftKK has joined #ruby
07:42
<
phaul >
ruby -e '3.times { |n| puts %x("echo" "#{n}") }' # works
07:43
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
07:44
m04ftKK has quit [Client Quit]
07:46
nitza has joined #ruby
07:46
deepredsky has joined #ruby
08:08
absolutejam has quit [Ping timeout: 246 seconds]
08:10
teclator has joined #ruby
08:12
deepredsky has quit [Ping timeout: 245 seconds]
08:16
conta has quit [Remote host closed the connection]
08:16
conta has joined #ruby
08:18
jenrzzz has quit [Ping timeout: 272 seconds]
08:20
BH23 has joined #ruby
08:26
BH23 has quit [Ping timeout: 252 seconds]
08:29
jenrzzz has joined #ruby
08:30
claudiuinberlin has joined #ruby
08:38
jenrzzz has quit [Ping timeout: 268 seconds]
08:40
deepredsky has joined #ruby
08:47
chalkmonster has quit [Read error: Connection reset by peer]
08:47
jenrzzz has joined #ruby
08:51
jenrzzz has quit [Ping timeout: 246 seconds]
08:57
jenrzzz has joined #ruby
09:02
chalkmonster has joined #ruby
09:04
c0ncealed4 has joined #ruby
09:06
jenrzzz has quit [Ping timeout: 246 seconds]
09:06
ivanskie has joined #ruby
09:08
ellcs has joined #ruby
09:08
chalkmonster has quit [Quit: WeeChat 2.5]
09:09
jenrzzz has joined #ruby
09:17
chalkmonster has joined #ruby
09:18
tdy has quit [Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac]
09:20
dviola has quit [Ping timeout: 245 seconds]
09:21
tdy has joined #ruby
09:21
m04ftKK has joined #ruby
09:24
m04ftKK has quit [Client Quit]
09:24
chalkmonster has quit [Quit: WeeChat 2.5]
09:26
Thenekofell has quit [Ping timeout: 250 seconds]
09:27
m04ftKK has joined #ruby
09:27
tdy has quit [Ping timeout: 245 seconds]
09:29
m04ftKK has quit [Client Quit]
09:29
NL3limin4t0r_afk is now known as NL3limin4t0r
09:29
tdy has joined #ruby
09:33
<
manveru >
%x still needs escaping, while `"" ""` may look like two separate strings, they actually become one
09:33
<
manveru >
> "a" "b"
09:34
<
manveru >
>> "a" "b"
09:34
<
ruby[bot] >
manveru: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
09:35
tdy has quit [Ping timeout: 245 seconds]
09:36
<
NL3limin4t0r >
&>> "a" "b"
09:37
<
manveru >
thanks :)
09:37
<
manveru >
guess that's not documented
09:38
<
NL3limin4t0r >
rubybot got recently some new sytax. I still have to figure out how to let rubybot point to documentation.
09:39
m04ftKK has joined #ruby
09:40
<
NL3limin4t0r >
The only thing that I don't understand is why use: puts %x("echo" "#{n}") instead of: puts %x(echo #{n})
09:40
m04ftKK has quit [Client Quit]
09:40
<
NL3limin4t0r >
%x is comparable with %q
09:41
<
NL3limin4t0r >
&>> %("echo" "#{0}") # might not be a valid shell command
09:41
m04ftKK has joined #ruby
09:42
<
NL3limin4t0r >
&>> %(echo #{0}) # is valid
09:43
m04ftKK has quit [Client Quit]
09:44
conta has quit [Ping timeout: 245 seconds]
09:45
* NL3limin4t0r
needs to restart his PC to finish up some system updates
09:45
NL3limin4t0r has quit [Quit: WeeChat 1.9.1]
09:49
m04ftKK has joined #ruby
09:51
m04ftKK has quit [Client Quit]
09:53
jenrzzz has quit [Ping timeout: 248 seconds]
09:53
<
manveru >
&>> %x(echo $3.50)
09:54
conta has joined #ruby
10:01
Thenekofell has joined #ruby
10:02
NL3limin4t0r has joined #ruby
10:02
m04ftKK has joined #ruby
10:04
m04ftKK has quit [Client Quit]
10:08
drnerdius has joined #ruby
10:08
dviola has joined #ruby
10:09
dviola has quit [Changing host]
10:09
dviola has joined #ruby
10:09
m04ftKK has joined #ruby
10:14
m04ftKK has quit [Quit: This computer has gone to sleep]
10:15
m04ftKK has joined #ruby
10:18
<
drnerdius >
Hello, everyone! My friend recommended to ask this question here. So, I was trying to programmatically fill a 3×3 2D array with numbers from 1 to 9, but for some reason, it fills in all 3 subarrays with last three numbers. Here's the code: ```a = Array.new(3, Array.new(3, 0)); a.each_with_index {|val, i| val.each_with_index {|_val, j| a[i][j] = 3 * i + j}}```. Then I tried to use a global variable to see what was really going on and print the variable
10:18
<
drnerdius >
values as it ran, but I got even more confused, because it prints everything as it shouls, but the resulting array is still wrong. Code: ```a = Array.new(3, Array.new(3, 0)); $n = 0; a.each_with_index {|_val, i| a[i].each_with_index {|_val, j| $n += 1; a[i][j] = $n; p "#{i}, #{j} - #{$n}"}}``` Is there a reason why this is happening? And what's the right way of doing this?
10:20
m04ftKK has quit [Quit: This computer has gone to sleep]
10:23
jenrzzz has joined #ruby
10:27
queip has quit [Ping timeout: 268 seconds]
10:28
m04ftKK has joined #ruby
10:31
r3m has quit [Quit: WeeChat 2.6-dev]
10:31
r3m has joined #ruby
10:32
d^sh has quit [Ping timeout: 245 seconds]
10:32
<
dionysus69 >
>> 1 + 2
10:33
<
ruby[bot] >
dionysus69: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
10:33
<
dionysus69 >
<< 1 + 2
10:33
<
dionysus69 >
< 1 + 2
10:33
<
dionysus69 >
<< ruby 1 + 2
10:33
<
dionysus69 >
<< 1 + 2
10:33
<
al2o3-cr >
&>> (1..9).each_slice(3).to_a
10:33
<
dionysus69 >
&>> "lol"
10:33
conta has quit [Ping timeout: 268 seconds]
10:33
<
dionysus69 >
drnerdius says thanks al2o3-cr
10:34
d^sh has joined #ruby
10:35
queip has joined #ruby
10:38
<
manveru >
&>> Array.new(3){|x| Array.new(3){|y| (x+1) * (y+1) }}
10:38
<
manveru >
but not sure if that's what you expect as result... :)
10:40
chalkmonster has joined #ruby
10:42
akem-lnvo has joined #ruby
10:49
jenrzzz has quit [Ping timeout: 272 seconds]
10:51
<
drnerdius >
al2o3-cr, manveru, thanks! A lot better, but any ideas what's wrong with my approach? Why is Ruby evaluating it like this?
10:51
conta has joined #ruby
10:52
<
drnerdius >
&>> a = Array.new(3, Array.new(3, 0)); a.each_with_index {|_val, i| a[i].each_with_index {|_val, j| a[i][j] = 3 * i + j}}
10:52
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
10:52
<
al2o3-cr >
drnerdius: use the block form of Array.new
10:52
dviola has quit [Quit: WeeChat 2.5]
10:53
<
al2o3-cr >
&>> a = Array.new(3) { Array.new(3, 0) }; a.each_with_index {|_val, i| a[i].each_with_index {|_val, j| a[i][j] = 3 * i + j}}
10:53
<
drnerdius >
al2o3-cr, I understand; I was just asking about the behaviour.
10:54
jenrzzz has joined #ruby
10:54
AJA4350 has joined #ruby
10:54
<
al2o3-cr >
drnerdius: well, it uses the same references
10:54
chalkmonster has quit [Quit: WeeChat 2.5]
10:55
<
al2o3-cr >
with the block form you're creating individual objects
10:58
jenrzzz has quit [Ping timeout: 245 seconds]
11:00
<
al2o3-cr >
&>> a = Array.new(3, Array.new(3, 'x')); a[0][0] = 'y'; a
11:00
<
al2o3-cr >
&>> a = Array.new(3) { Array.new(3) { 'x' } }; a[0][0] = 'y'; a
11:05
<
al2o3-cr >
if that makes sense drnerdius
11:09
<
drnerdius >
al2o3-cr, thanks a lot! Also, what's the best way to transose and mutate that array? There's no transpose! method AFAIK. This is not the onlyexample; in many cases, there are no mutating counterparts to methods.
11:09
<
drnerdius >
transpose*
11:10
ElFerna has joined #ruby
11:10
<
al2o3-cr >
there is a transpose method and just save it to a another variable
11:11
<
al2o3-cr >
&>> [[1,2,3], [4,5,6], [7,8,9]].transpose
11:12
<
drnerdius >
Yep, but I'm asking wether or not you can avoid that in case you don't want to allocatea memory for that.
11:12
<
al2o3-cr >
oh, sorry yeah, there is not counter-part mutating method
11:12
<
drnerdius >
Can I prepend it with something to mutate the array instead of re-assigning the value?
11:13
paraxial has quit [Ping timeout: 272 seconds]
11:13
paraxial2 has joined #ruby
11:13
<
al2o3-cr >
drnerdius: i'm not sure i understand what you mean?
11:15
m04ftKK has quit [Quit: This computer has gone to sleep]
11:16
queip has quit [Ping timeout: 245 seconds]
11:16
<
drnerdius >
Like calling with map! or something to change the array dirrectly rather than do ```a = a.transpose```
11:16
<
drnerdius >
If that makes sense
11:18
m04ftKK has joined #ruby
11:18
<
al2o3-cr >
drnerdius: ah!
11:19
<
al2o3-cr >
you'd have to write your own method though.
11:21
phaul has quit [Ping timeout: 272 seconds]
11:21
<
drnerdius >
al2o3-cr, I though so. Thanks a lot again.
11:21
<
al2o3-cr >
drnerdius: sure, np.
11:23
queip has joined #ruby
11:23
phaul has joined #ruby
11:28
jenrzzz has joined #ruby
11:30
chalkmonster has joined #ruby
11:31
Thenekofell has quit [Ping timeout: 252 seconds]
11:32
phaul has quit [Ping timeout: 248 seconds]
11:32
phaul has joined #ruby
11:36
conta has quit [Ping timeout: 272 seconds]
11:37
queip has quit [Ping timeout: 244 seconds]
11:39
deepredsky has quit [Ping timeout: 244 seconds]
11:40
absolutejam has joined #ruby
11:43
queip has joined #ruby
11:49
conta1 has joined #ruby
11:57
jenrzzz has quit [Ping timeout: 268 seconds]
12:01
snickers has joined #ruby
12:03
<
al2o3-cr >
NL3limin4t0r: nifty :)
12:03
<
NL3limin4t0r >
You can make your own method more memory efficient. But this is an simple example
12:03
<
livcd >
Anyone tried Sorbet?
12:05
absolutejam has quit [Ping timeout: 258 seconds]
12:05
<
drnerdius >
NL3limin4t0r, that's awesome, but I wonder why mutating methods need to be implemented as new ones. Can't Ruby developers make it a part of the syntax?
12:06
kyrylo has joined #ruby
12:08
RiPuk has joined #ruby
12:09
<
al2o3-cr >
i suppose some methods don't warrant mutation.
12:09
<
al2o3-cr >
&>> Array.instance_methods(false).grep /!/
12:09
<
rubydoc >
# => [:rotate!, :sort!, :sort_by!, :collect!, :map!, :select!, :filter!, :reject!, :uniq!, :flatten!,... check link for more (
https://carc.in/#/r/77w8 )
12:10
<
NL3limin4t0r >
Also, not all mutating methods end with an exclamation mark.
12:11
<
al2o3-cr >
NL3limin4t0r: true, like concat
12:11
<
al2o3-cr >
and clear :)
12:11
<
NL3limin4t0r >
In my code snippet I use Array#clear and Array#concat with are both mutating methods.
12:12
<
NL3limin4t0r >
Some muting methods have also have quite another syntax than there non-mutating counterpart.
12:13
<
NL3limin4t0r >
string_var += "new string"
12:13
<
NL3limin4t0r >
string_var << "new string"
12:13
<
al2o3-cr >
but ones an operator the other a method
12:15
m04ftKK has quit [Quit: This computer has gone to sleep]
12:16
solars has joined #ruby
12:18
Inline has joined #ruby
12:18
lepepe has joined #ruby
12:19
lepepe has quit [Read error: Connection reset by peer]
12:19
lepepe has joined #ruby
12:19
chalkmonster has quit [Quit: WeeChat 2.5]
12:24
lepepe has quit [Ping timeout: 268 seconds]
12:26
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
12:26
absolutejam has joined #ruby
12:30
jenrzzz has joined #ruby
12:34
claudiuinberlin has joined #ruby
12:37
m04ftKK has joined #ruby
12:37
<
drnerdius >
Thanks to both of you. :-)
12:37
akem-lnvo has quit [Ping timeout: 248 seconds]
12:38
bvdw has quit [Read error: Connection reset by peer]
12:44
alan_w has joined #ruby
12:47
conta1 has quit [Ping timeout: 258 seconds]
12:50
involans has joined #ruby
12:50
deepredsky has joined #ruby
12:51
RiPuk has quit [Ping timeout: 245 seconds]
12:53
lepepe has joined #ruby
12:54
lepepe has quit [Remote host closed the connection]
12:55
lepepe has joined #ruby
12:58
involans has quit [Quit: involans]
12:58
involans has joined #ruby
12:58
ljarvis__ has joined #ruby
12:59
unreal_ has joined #ruby
13:00
JasonO has quit [Excess Flood]
13:00
jtdowney has quit [Quit: Ping timeout (120 seconds)]
13:00
jtdowney has joined #ruby
13:01
deepredsky has quit [Ping timeout: 246 seconds]
13:01
ljarvis_ has quit [Ping timeout: 245 seconds]
13:02
unreal has quit [Ping timeout: 245 seconds]
13:02
JasonO has joined #ruby
13:03
absolutejam has quit [Ping timeout: 268 seconds]
13:04
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:04
caduguedess has joined #ruby
13:04
GodFather has joined #ruby
13:07
deepredsky has joined #ruby
13:08
lepepe_ has joined #ruby
13:08
AndreYuhai has joined #ruby
13:08
lepepe has quit [Ping timeout: 248 seconds]
13:09
<
AndreYuhai >
Hi there, how do I loop through months instead of all all the days withing the two months?
13:09
<
AndreYuhai >
for example : 2019, 05 -> 2019, 07 I want to loop through 2019, 05 / 2019, 06 / 2019, 07
13:10
<
AndreYuhai >
date.downto or upto loops through all the days
13:12
Dr_MDMA_MD has joined #ruby
13:13
conta1 has joined #ruby
13:17
teclator has quit [Ping timeout: 246 seconds]
13:17
chalkmonster has joined #ruby
13:17
teclator has joined #ruby
13:18
RiPuk has joined #ruby
13:18
deepredsky has quit [Ping timeout: 245 seconds]
13:21
jottr has joined #ruby
13:22
Inline__ has joined #ruby
13:25
Inline has quit [Ping timeout: 264 seconds]
13:25
alan_w has quit [Quit: WeeChat 2.4]
13:26
snickers has joined #ruby
13:26
ghostlines has joined #ruby
13:27
<
AndreYuhai >
al2o3-cr: Thank you.
13:27
teclator has quit [Ping timeout: 246 seconds]
13:27
snickers has quit [Client Quit]
13:27
tf2ftw has joined #ruby
13:27
<
al2o3-cr >
AndreYuhai: np. :)
13:27
teclator has joined #ruby
13:33
lucasb has joined #ruby
13:33
cyclonis has joined #ruby
13:33
cyclonis has quit [Excess Flood]
13:33
deepredsky has joined #ruby
13:34
cyclonis has joined #ruby
13:36
augcesar has quit [Quit: Connection closed for inactivity]
13:43
deepredsky has quit [Ping timeout: 245 seconds]
13:52
skryking has joined #ruby
13:56
ElFerna has quit [Ping timeout: 258 seconds]
14:06
lepepe_ has quit [Read error: Connection reset by peer]
14:06
lepepe has joined #ruby
14:13
lepepe has quit [Read error: Connection reset by peer]
14:13
emptyflask has joined #ruby
14:13
lepepe has joined #ruby
14:17
caduguedess has quit [Quit: Leaving.]
14:19
caduguedess has joined #ruby
14:21
fuzzface has joined #ruby
14:23
green- has quit [Remote host closed the connection]
14:23
tdy has joined #ruby
14:27
conta1 has quit [Read error: Connection reset by peer]
14:27
conta1 has joined #ruby
14:30
lepepe has quit [Remote host closed the connection]
14:31
lepepe has joined #ruby
14:32
RiPuk has quit [Ping timeout: 245 seconds]
14:34
lepepe_ has joined #ruby
14:34
Esa_ has joined #ruby
14:35
RiPuk has joined #ruby
14:35
lepepe has quit [Ping timeout: 244 seconds]
14:36
rippa has joined #ruby
14:36
tf2ftw has quit [Quit: This computer has gone to sleep]
14:37
yalue has joined #ruby
14:37
lepepe has joined #ruby
14:38
jenrzzz has quit [Ping timeout: 244 seconds]
14:38
lepepe_ has quit [Ping timeout: 245 seconds]
14:41
lepepe_ has joined #ruby
14:42
lepepe has quit [Ping timeout: 245 seconds]
14:42
ElFerna has joined #ruby
14:43
chalkmonster has quit [Quit: WeeChat 2.5]
14:46
Nicmavr has quit [Read error: Connection reset by peer]
14:46
lepepe has joined #ruby
14:47
lepepe_ has quit [Ping timeout: 248 seconds]
14:48
<
drnerdius >
Can you also get an index of each iteration with `Array.new(3) { <block> }`?
14:48
Nicmavr has joined #ruby
14:48
lepepe_ has joined #ruby
14:48
<
drnerdius >
Obviously it's doing some kind of loop
14:49
<
drnerdius >
&>> Array.new(3) { p :test }
14:50
<
drnerdius >
&>> Array.new(3) { Array.new(3, 0); p :test }
14:51
<
drnerdius >
&>> Array.new(3) { Array.new(3, 0); p 5 }
14:52
<
al2o3-cr >
Array.new(3) { |index| ...
14:52
lepepe has quit [Ping timeout: 245 seconds]
14:52
ellcs has quit [Ping timeout: 245 seconds]
14:52
emptyflask has quit [Ping timeout: 264 seconds]
14:53
<
drnerdius >
Haha, that was stupidly easy
14:53
<
drnerdius >
&>> Array.new(3) {|index| Array.new(3, 0); p index }
14:53
<
drnerdius >
(DOesn't work here, but it does in IRB)
14:55
chalkmonster has joined #ruby
15:01
ElFerna has quit [Ping timeout: 268 seconds]
15:02
RiPuk has quit [Ping timeout: 245 seconds]
15:03
drnerdius has quit [Ping timeout: 245 seconds]
15:07
RiPuk has joined #ruby
15:07
teclator_ has joined #ruby
15:07
tf2ftw has joined #ruby
15:07
teclator has quit [Ping timeout: 272 seconds]
15:08
retromode has joined #ruby
15:08
tf2ftw has quit [Client Quit]
15:08
lepepe_ has quit [Ping timeout: 246 seconds]
15:09
<
retromode >
is there a method on collections like 'each_with_index' but that stops mapping once we've reached a certain index?
15:09
lepepe_ has joined #ruby
15:10
SeepingN has joined #ruby
15:10
<
havenwood >
retromode: take(index + 1).each_with_index
15:10
akem-lnvo has joined #ruby
15:11
RiPuk_ has joined #ruby
15:11
RiPuk has quit [Ping timeout: 246 seconds]
15:11
<
retromode >
havenwood that works, thanks!
15:11
<
havenwood >
retromode: or you can `break` once you reach the index you're looking for!
15:12
<
retromode >
yeah, i was doing that but was hoping there were something more elegant :)
15:13
xco has quit [Quit: xco]
15:16
teclator_ has quit [Ping timeout: 258 seconds]
15:17
teclator has joined #ruby
15:17
RiPuk_ has quit [Ping timeout: 245 seconds]
15:18
tf2ftw has joined #ruby
15:18
RiPuk has joined #ruby
15:22
lepepe has joined #ruby
15:23
lepepe_ has quit [Ping timeout: 246 seconds]
15:23
yokel has quit [Remote host closed the connection]
15:29
yokel has joined #ruby
15:34
retromode has quit [Remote host closed the connection]
15:34
aupadhye has quit [Quit: Leaving]
15:35
tdy has quit [Ping timeout: 272 seconds]
15:36
lepepe has quit [Ping timeout: 248 seconds]
15:36
lepepe has joined #ruby
15:37
ivanskie has joined #ruby
15:37
caduguedess has quit [Remote host closed the connection]
15:39
chalkmonster has quit [Quit: WeeChat 2.5]
15:40
queip has quit [Ping timeout: 245 seconds]
15:46
TomyWork has quit [Remote host closed the connection]
15:48
queip has joined #ruby
15:49
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
15:50
fphilipe_ has quit [Read error: Connection reset by peer]
15:51
akem-lnvo has quit [Ping timeout: 268 seconds]
15:52
conta1 has quit [Read error: Connection reset by peer]
15:54
megamos has joined #ruby
15:54
m04ftKK has quit [Quit: Leaving]
15:56
iffraff has joined #ruby
15:58
ivanskie has joined #ruby
16:01
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
16:04
lepepe has quit [Read error: Connection reset by peer]
16:04
lepepe has joined #ruby
16:05
chalkmonster has joined #ruby
16:05
chalkmonster has quit [Client Quit]
16:08
andikr has quit [Remote host closed the connection]
16:11
jottr has quit [Ping timeout: 258 seconds]
16:11
queip has quit [Ping timeout: 245 seconds]
16:12
ElFerna has joined #ruby
16:12
ElFerna has quit [Client Quit]
16:13
DTZUZO has quit [Ping timeout: 268 seconds]
16:15
lepepe has quit [Remote host closed the connection]
16:16
lepepe has joined #ruby
16:17
Bounga has joined #ruby
16:18
queip has joined #ruby
16:19
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
16:20
DaRock has quit [Ping timeout: 258 seconds]
16:20
lepepe has quit [Ping timeout: 244 seconds]
16:23
ivanskie has joined #ruby
16:25
moei has joined #ruby
16:26
lepepe has joined #ruby
16:28
lepepe has quit [Remote host closed the connection]
16:29
lepepe has joined #ruby
16:30
paraxial2 has joined #ruby
16:30
orbyt_ has joined #ruby
16:31
tdy has joined #ruby
16:34
iffraff has quit [Ping timeout: 245 seconds]
16:35
jenrzzz has joined #ruby
16:35
paraxial2 has quit [Ping timeout: 268 seconds]
16:36
paraxial2 has joined #ruby
16:39
lepepe has quit [Ping timeout: 245 seconds]
16:40
lepepe has joined #ruby
16:42
psilly0 has joined #ruby
16:50
RiPuk has quit [Ping timeout: 246 seconds]
16:50
claudiuinberlin has joined #ruby
16:51
lepepe has quit [Read error: Connection reset by peer]
16:51
lepepe has joined #ruby
16:52
miskatonic has joined #ruby
16:56
miskatonic has quit [Client Quit]
16:58
tf2ftw has quit [Quit: This computer has gone to sleep]
16:59
tf2ftw has joined #ruby
17:00
RiPuk has joined #ruby
17:06
tf2ftw has quit [Quit: This computer has gone to sleep]
17:08
lepepe_ has joined #ruby
17:08
lepepe has quit [Read error: Connection reset by peer]
17:09
jenrzzz has quit [Ping timeout: 246 seconds]
17:10
lxsameer has quit [Quit: out]
17:10
RiPuk has quit [Ping timeout: 244 seconds]
17:19
budonyc has quit [Ping timeout: 272 seconds]
17:19
Swyper has joined #ruby
17:20
lepepe_ has quit [Read error: Connection reset by peer]
17:20
RiPuk has joined #ruby
17:20
lepepe has joined #ruby
17:22
gell5 has joined #ruby
17:23
cyclonis has quit [Ping timeout: 248 seconds]
17:25
cyclonis_ has joined #ruby
17:27
cyclonis_ has quit [Read error: Connection reset by peer]
17:29
Swyper has quit [Remote host closed the connection]
17:30
gix has joined #ruby
17:30
jenrzzz has joined #ruby
17:30
Swyper has joined #ruby
17:31
cyclonis has joined #ruby
17:31
cyclonis has quit [Excess Flood]
17:32
lepepe has quit [Ping timeout: 245 seconds]
17:34
lepepe has joined #ruby
17:35
Swyper has quit [Remote host closed the connection]
17:37
cyclonis has joined #ruby
17:37
cyclonis has quit [Excess Flood]
17:39
Swyper has joined #ruby
17:43
cyclonis has joined #ruby
17:43
cyclonis has quit [Excess Flood]
17:43
AndreYuhai has quit [Remote host closed the connection]
17:43
AndreYuhai has joined #ruby
17:44
tdy has quit [Ping timeout: 268 seconds]
17:49
AndreYuhai has quit [Remote host closed the connection]
17:49
AndreYuhai has joined #ruby
17:49
cyclonis has joined #ruby
17:49
cyclonis has quit [Excess Flood]
17:51
bga57 has quit [Ping timeout: 246 seconds]
17:52
tf2ftw has joined #ruby
17:53
tf2ftw has quit [Client Quit]
17:55
cyclonis has joined #ruby
17:55
cyclonis has quit [Excess Flood]
17:57
bga57 has joined #ruby
17:59
<
baweaver >
havenwood / retromode: why not just use slices?
17:59
yalue has quit [Quit: Leaving]
18:00
<
baweaver >
list[0..(index + 1)].each_with_index ...
18:00
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:00
Inline__ has quit [Quit: Leaving]
18:01
cyclonis has joined #ruby
18:01
cyclonis has quit [Excess Flood]
18:02
Inline has joined #ruby
18:03
bga57 has quit [Ping timeout: 245 seconds]
18:06
<
baweaver >
or first, or several other bits
18:06
Swyper has quit [Remote host closed the connection]
18:06
<
baweaver >
Ah, also havenwood, TIL: [1,2].first(1)
18:06
lepepe has quit [Read error: Connection reset by peer]
18:06
<
baweaver >
&>> [1,2].first(1)
18:07
lepepe has joined #ruby
18:07
cyclonis has joined #ruby
18:07
Swyper has joined #ruby
18:09
bga57 has joined #ruby
18:11
Bounga has quit [Ping timeout: 252 seconds]
18:18
lepepe_ has joined #ruby
18:21
lepepe has quit [Ping timeout: 258 seconds]
18:25
tf2ftw has joined #ruby
18:27
lepepe_ has quit [Ping timeout: 245 seconds]
18:27
NL3limin4t0r has quit [Quit: WeeChat 1.9.1]
18:27
tf2ftw has quit [Client Quit]
18:29
Sauvin has quit [Ping timeout: 248 seconds]
18:32
lepepe has joined #ruby
18:32
TomyLobo has joined #ruby
18:32
lxsameer has joined #ruby
18:33
jenrzzz has quit [Ping timeout: 245 seconds]
18:40
jenrzzz has joined #ruby
18:43
cyclonis_ has joined #ruby
18:44
cyclonis has quit [Ping timeout: 258 seconds]
18:45
jenrzzz has quit [Ping timeout: 272 seconds]
18:48
xco has joined #ruby
18:48
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
18:49
cyclonis_ has quit [Quit: -a- Connection Timed Out]
18:55
cyclonis has joined #ruby
18:55
cyclonis has quit [Excess Flood]
18:58
AJA4351 has joined #ruby
18:59
AJA4350 has quit [Ping timeout: 245 seconds]
18:59
AJA4351 is now known as AJA4350
19:02
cyclonis has joined #ruby
19:02
cyclonis has quit [Excess Flood]
19:02
cyclonis has joined #ruby
19:03
cyclonis has quit [Excess Flood]
19:03
cyclonis has joined #ruby
19:03
cyclonis has quit [Excess Flood]
19:03
sezuan has quit [Quit: ____]
19:09
drnerdius has joined #ruby
19:11
jenrzzz has joined #ruby
19:14
lepepe has quit [Ping timeout: 268 seconds]
19:15
lepepe_ has joined #ruby
19:23
tomaw has quit [Quit: Quitting]
19:27
tomaw has joined #ruby
19:28
ivanskie has joined #ruby
19:28
kyrylo has joined #ruby
19:31
houhoulis has joined #ruby
19:38
jenrzzz has quit [Ping timeout: 245 seconds]
19:39
jenrzzz has joined #ruby
19:43
zapata has joined #ruby
19:46
absolutejam has joined #ruby
19:48
BloopMonster has joined #ruby
19:49
jenrzzz has quit [Ping timeout: 268 seconds]
19:52
zapata has quit [Quit: WeeChat 2.5]
19:54
redlegion has joined #ruby
19:55
Thenekofell has joined #ruby
19:56
psilly0 has quit [Ping timeout: 272 seconds]
19:57
BloopMonster has quit [Quit: WeeChat 1.9.1]
19:58
jenrzzz has joined #ruby
19:59
Swyper has quit [Remote host closed the connection]
20:02
BloopMonster has joined #ruby
20:04
dellavg_ has quit [Remote host closed the connection]
20:12
Swyper has joined #ruby
20:16
Swyper has quit [Ping timeout: 244 seconds]
20:23
Swyper has joined #ruby
20:26
Swyper has quit [Read error: Connection reset by peer]
20:26
Swyper has joined #ruby
20:27
fuzzface has quit [Quit: Leaving]
20:31
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:33
tdy has joined #ruby
20:33
Snowy has joined #ruby
20:37
Swyper has quit [Remote host closed the connection]
20:39
kyrylo has joined #ruby
20:49
tdy has quit [Ping timeout: 245 seconds]
20:49
jenrzzz has quit [Ping timeout: 272 seconds]
20:50
absolutejam2 has joined #ruby
20:51
lepepe_ has quit [Ping timeout: 244 seconds]
20:52
absolutejam has quit [Ping timeout: 244 seconds]
20:52
lepepe has joined #ruby
20:57
jenrzzz has joined #ruby
21:00
ElFerna has joined #ruby
21:02
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:06
involans has quit [Quit: involans]
21:06
absolutejam3 has joined #ruby
21:08
absolutejam2 has quit [Ping timeout: 245 seconds]
21:12
pygmypuppy has joined #ruby
21:13
Thenekofell has quit [Ping timeout: 250 seconds]
21:19
Fernando-Basso has joined #ruby
21:20
lepepe_ has joined #ruby
21:24
lepepe has quit [Ping timeout: 272 seconds]
21:26
bsdbandit has quit [Remote host closed the connection]
21:30
fphilipe_ has joined #ruby
21:33
lepepe_ has quit [Remote host closed the connection]
21:34
lepepe has joined #ruby
21:35
AJA4351 has joined #ruby
21:35
AJA4350 has quit [Ping timeout: 245 seconds]
21:35
AJA4351 is now known as AJA4350
21:36
fphilipe_ has quit [Ping timeout: 276 seconds]
21:38
lepepe has quit [Ping timeout: 244 seconds]
21:39
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:44
Snowy has quit [Read error: Connection reset by peer]
21:45
queip has quit [Ping timeout: 244 seconds]
21:46
Thenekofell has joined #ruby
21:46
Snowy has joined #ruby
21:46
Thenekofell has quit [Remote host closed the connection]
21:46
Snowy has quit [Client Quit]
21:47
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
21:49
drnerdius has quit [Ping timeout: 245 seconds]
21:53
queip has joined #ruby
21:53
c0ncealed4 has quit [Remote host closed the connection]
21:54
claudiuinberlin has joined #ruby
21:57
matheusmoreira has joined #ruby
21:57
lxsameer has quit [Ping timeout: 268 seconds]
21:58
fphilipe_ has joined #ruby
21:59
jenrzzz_ has joined #ruby
22:00
jenrzzz has quit [Read error: Connection reset by peer]
22:03
cammellos has quit [Ping timeout: 245 seconds]
22:08
emptyflask has joined #ruby
22:10
xco has quit [Quit: xco]
22:16
code_zombie has joined #ruby
22:16
lepepe has joined #ruby
22:21
lepepe has quit [Ping timeout: 245 seconds]
22:22
Dr_MDMA_MD has quit [Quit: Connection closed for inactivity]
22:25
budonyc has joined #ruby
22:28
Inline has quit [Quit: Leaving]
22:30
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
22:32
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
22:36
ghostlines has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
22:46
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
22:47
houhoulis has quit [Remote host closed the connection]
22:53
cyclonis has joined #ruby
22:53
cyclonis has quit [Excess Flood]
22:54
cyclonis has joined #ruby
22:59
involans has joined #ruby
23:02
SanguineAnomaly has quit [Ping timeout: 246 seconds]
23:02
reber has quit [Read error: Connection reset by peer]
23:03
schne1der has quit [Ping timeout: 245 seconds]
23:04
claudiuinberlin has joined #ruby
23:05
Dr_MDMA_MD has joined #ruby
23:07
involans has quit [Quit: involans]
23:08
DTZUZO has joined #ruby
23:09
Swyper has joined #ruby
23:13
SanguineAnomaly has joined #ruby
23:18
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
23:23
absolutejam3 has quit [Ping timeout: 272 seconds]
23:23
Swyper has quit [Remote host closed the connection]
23:30
Swyper has joined #ruby
23:34
Swyper has quit [Remote host closed the connection]
23:36
dbugger has quit [Quit: Leaving]
23:37
DTZUZO has quit [Ping timeout: 245 seconds]
23:54
AJA4351 has joined #ruby
23:55
AJA4350 has quit [Ping timeout: 246 seconds]
23:55
AJA4351 is now known as AJA4350
23:57
lucasb has quit [Quit: Connection closed for inactivity]
23:58
fphilipe_ has quit [Ping timeout: 252 seconds]
23:59
AJA4351 has joined #ruby
23:59
AJA4350 has quit [Ping timeout: 245 seconds]
23:59
AJA4351 is now known as AJA4350