wallace__ has quit [Remote host closed the connection]
oncall-pokemon has quit [Quit: Connection closed for inactivity]
fig-le-deunch has joined #ruby
<adam12>
Anybody using hanami-controller / hanami-router outside of a Hanami project?
davidw has quit [Ping timeout: 265 seconds]
dviola has quit [Quit: WeeChat 2.7]
stryek has quit [Quit: Connection closed for inactivity]
wallace_mu has joined #ruby
jenrzzz has joined #ruby
akemhp_ has joined #ruby
akemhp has quit [Ping timeout: 265 seconds]
davidw has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
drincruz has joined #ruby
wallace_mu has quit [Remote host closed the connection]
wallace_mu has joined #ruby
davidw has quit [Ping timeout: 265 seconds]
wallace_mu has quit [Read error: Connection reset by peer]
wallace_mu has joined #ruby
fphilipe has joined #ruby
chalkmonster has joined #ruby
sergioro has quit [Quit: leaving]
drincruz has quit [Ping timeout: 276 seconds]
fphilipe has quit [Ping timeout: 250 seconds]
ElFerna has joined #ruby
ElFerna has quit [Quit: ElFerna]
ElFerna has joined #ruby
Fernando-Basso has quit [Quit: Leaving]
ogres has joined #ruby
ElFerna has quit [Client Quit]
wallace_mu has quit [Remote host closed the connection]
davidw has joined #ruby
davidw has quit [Changing host]
davidw has joined #ruby
fig-le-deunch has quit [Quit: Konversation terminated!]
jenrzzz has joined #ruby
fig-le-deunch has joined #ruby
wallace_mu has joined #ruby
drincruz has joined #ruby
akemhp_ has quit [Ping timeout: 240 seconds]
fig-le-deunch has quit [Ping timeout: 268 seconds]
mokha has quit [Quit: .]
akemhp has joined #ruby
akemhp has quit [Remote host closed the connection]
davidw has quit [Ping timeout: 265 seconds]
akemhp has joined #ruby
wildtrees has quit [Quit: Leaving]
cthulchu has quit [Ping timeout: 268 seconds]
kapil_ has quit [Quit: Connection closed for inactivity]
sarink has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
sarink has quit [Ping timeout: 250 seconds]
william1 has quit [Ping timeout: 265 seconds]
iMadper|` has quit [Remote host closed the connection]
drnerdius has joined #ruby
gix has quit [Ping timeout: 240 seconds]
<drnerdius>
Is there a way to get an inner product of an array to produce all the combinations? The syntax is array1.product(array2, array3, ...), but what about an array of arrays? I can hack a little bit and do this: array[0].product(array[1..-1]), but there has to be a cleaner way.
<drnerdius>
sorry, missed the asterisk; it's actually: array[0].product(*array[1..-1])
<drnerdius>
I also tried this: [].product(*array), but it returns an empty array...
TCZ has quit [Quit: Bye Bye]
RyanMcCoskrie has joined #ruby
fig-le-deunch has joined #ruby
<havenwood>
drnerdius: One way is: array.reduce(&:product).map(&:flatten)
<drnerdius>
Thanks havenwood. I found another: Array:product.to_proc.(*array) :)
<xall>
is there a way to chain into zip without using temp vars here? L1 `fst, snd = str.split.map(&:chars)`, L2 `fst.zip(snd).each_slice(2).map { |e| e.join.chars.map(&HASH) }`
howdoi has quit [Quit: Connection closed for inactivity]
<havenwood>
xall: I'd suggest moving your CUPS_PER_ROW and PLANTS constants inside your class. It's nice to namespace them rather than have them be global.
<havenwood>
xall: Consider using keyword arguments beyond the first, obvious positional argument. So maybe: def initialize(diagram, students: STUDENTS)
_phaul has quit [Ping timeout: 245 seconds]
<havenwood>
xall: Your @plants instance variable is unused, so you might consider not setting it.
<havenwood>
xall: You could just drop: @plants ||=
<havenwood>
(still works)
<havenwood>
xall: I like the use of #fetch.
<havenwood>
xall: Maybe #downcase STUDENTS when you create the constant, rather than in the method.
<havenwood>
xall: STUDENTS = [...].map(&:downcase).freeze
<havenwood>
xall: nifty class—congrats on the code
_phaul has joined #ruby
<xall>
havenwood: thanks for the useful feedback. My STUDENTS constant is an array of symbols but the given test cases pass in an array of strings - I don't think calling downcase on symbols is going to do anything, eh?
<havenwood>
xall: Symbol does respond to #downcase, but if they're already lower, no need.
_phaul has quit [Ping timeout: 276 seconds]
<xall>
havenwood: Roger. I think I'd typically put the constants in the class. Not sure if I was hit with comic ray bombardment or just too much javascript lately.
<xall>
and probably better to get the KeyError with fetch than use the fancy hash to_proc, eh
<havenwood>
xall: Yeah, nice to avoid nils.
duderonomy has joined #ruby
<havenwood>
xall: maybe do a #tr at a string stage?
<femtogram>
hey guys, so i want to use slim for some templating of a bunch of xml files using the command line, so i'm trying to use slimrb. i'm new to slim, and i'm trying to use partials. do i need to define an include header? is this even the right tool to be using? i was drawn to ruby because of the ease of calling bash commands (using backticks), and slim because of how clean the syntax is but is there a tool that is better suited to what i'm
<femtogram>
trying to do (use as a commandline utility instead of as part of a webapp)
xall has quit [Read error: Connection reset by peer]
dionysus69 has quit [Ping timeout: 276 seconds]
_phaul has joined #ruby
_phaul has quit [Ping timeout: 250 seconds]
_phaul has joined #ruby
romanblanco has joined #ruby
reber has joined #ruby
_phaul has quit [Ping timeout: 240 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_phaul has joined #ruby
dionysus69 has joined #ruby
fphilipe has joined #ruby
_phaul has quit [Ping timeout: 240 seconds]
_phaul has joined #ruby
dionysus69 has quit [Ping timeout: 265 seconds]
hiroaki has quit [Ping timeout: 276 seconds]
_phaul has quit [Ping timeout: 250 seconds]
suukim has joined #ruby
_phaul has joined #ruby
dionysus69 has joined #ruby
_phaul has quit [Ping timeout: 265 seconds]
_phaul has joined #ruby
_phaul has quit [Ping timeout: 240 seconds]
Fernando-Basso has joined #ruby
JJonah_ has quit [Quit: Connection closed for inactivity]
_phaul has joined #ruby
fphilipe has quit [Ping timeout: 276 seconds]
_phaul has quit [Ping timeout: 240 seconds]
sameerynho has joined #ruby
_phaul has joined #ruby
nowhereman has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
_phaul has quit [Ping timeout: 265 seconds]
bvdw has joined #ruby
_phaul has joined #ruby
_phaul has quit [Ping timeout: 245 seconds]
_phaul has joined #ruby
zapata has quit [Ping timeout: 250 seconds]
_phaul has quit [Ping timeout: 265 seconds]
TCZ has joined #ruby
sergioro has left #ruby [#ruby]
_phaul has joined #ruby
_phaul has quit [Ping timeout: 245 seconds]
_phaul has joined #ruby
lbrandon has joined #ruby
_phaul has quit [Ping timeout: 265 seconds]
sarink has joined #ruby
_phaul has joined #ruby
sarink has quit [Ping timeout: 265 seconds]
_phaul has quit [Ping timeout: 240 seconds]
akemhp has joined #ruby
akemhp_ has quit [Read error: Connection reset by peer]
_phaul has joined #ruby
_phaul has quit [Ping timeout: 246 seconds]
akemhp has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
_phaul has joined #ruby
NODE has quit [Quit: changing servers]
NODE has joined #ruby
NODE has quit [Client Quit]
_phaul has quit [Ping timeout: 268 seconds]
NODE has joined #ruby
NODE has left #ruby [#ruby]
reber_ has joined #ruby
NODE has joined #ruby
NODE has quit [Client Quit]
reber has quit [Ping timeout: 240 seconds]
_phaul has joined #ruby
NODE has joined #ruby
_phaul has quit [Ping timeout: 276 seconds]
_phaul has joined #ruby
NODE has quit [Quit: changing servers]
gearnode1 has joined #ruby
schne1der has joined #ruby
gearnode has quit [Ping timeout: 252 seconds]
femtogram has quit [Remote host closed the connection]
<Abhijit>
havenwood, i mean dynamically. you are hardcoding .to_i
<havenwood>
Abhijit: Dynamically doing what? Knowing that the #gets return value is an integer?
<Abhijit>
right now i am keeping gets as it is and using .send() and passing 'to_i' 'to_s' etc as argument. but can i directly pass the whole gets.to_i and run it?
<havenwood>
Abhijit: I don't understand what you mean?
<havenwood>
Abhijit: Show the code you have?
woodruffw has quit [Ping timeout: 265 seconds]
phaul has joined #ruby
<havenwood>
Abhijit: What's the dynamic part and what does it depend onn?
<stimpy__>
@havenwood lets say i want to implement a feature that blocks a user and after 24 hours the user is unblocked, how do i get the distance between the blocked_at timestamp and the end_time(blocked_at + 24 hours) timestamp
<stimpy__>
i cant get it to work, i think its a thought issue
<Abhijit>
havenwood, no. in current code we need to pass 'to_i' as argument for input_type. instead of that i want to rename input_type to run_this_method_to_get_input and pass 'gets.to_i' as argument!
<Abhijit>
e.g. my_ui('get me input', 'gets.to_i')
<stimpy__>
to get the distance it should be (end_time - Time.now)
<Abhijit>
can I do that?
<havenwood>
stimpy__: The problem with Time.now is it can change between the measurements since it's not monotonic.
<havenwood>
stimpy__: Think like daylight savings time, etc.
<stimpy__>
@havenwood, then im thinking wrong on the calculation?
<havenwood>
stimpy__: Milliseconds, for example: Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
<leftylink>
Abhijit: perhaps if the caller were required to pass it as a block, my_ui can yield to the block. or if the caller were required to pass it as a lambda, my_ui can call the lambda
<Abhijit>
leftylink, ok. will check with block and lambda.
<Abhijit>
havenwood, yes something like that but without hardcoding line = getss on line numbber 11
<Abhijit>
havenwood, ok nevermind actually thats very much what i wanted.
<Abhijit>
havenwood, leftylink Thanks.
<Abhijit>
havenwood, yes will try to get safe list
Mia has quit [Ping timeout: 250 seconds]
phaul has joined #ruby
Fernando-Basso has quit [Remote host closed the connection]
NODE has joined #ruby
NODE has quit [Client Quit]
william1 has quit [Quit: WeeChat 1.9.1]
william1 has joined #ruby
NODE has joined #ruby
phaul has quit [Ping timeout: 240 seconds]
Swyper has joined #ruby
phaul has joined #ruby
DaRock has quit [Ping timeout: 268 seconds]
Abhijit has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
william1 has quit [Ping timeout: 240 seconds]
Inline has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
buckworst has joined #ruby
stimpy_ has quit [Quit: Leaving]
stimpy__ has quit [Quit: Leaving]
ivanskie has joined #ruby
vondruch has quit [Quit: vondruch]
al2o3-cr has quit [Quit: WeeChat 2.6]
suukim has quit [Quit: Konversation terminated!]
akemhp has joined #ruby
al2o3-cr has joined #ruby
akemhp has quit [Ping timeout: 265 seconds]
buckworst has quit [Quit: WeeChat 2.3]
dasher00 has quit [Ping timeout: 268 seconds]
Tikku has joined #ruby
buckworst has joined #ruby
akemhp has joined #ruby
Tikku has quit [Client Quit]
fphilipe has joined #ruby
romanblanco has joined #ruby
dasher00 has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
vondruch has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wildtrees has joined #ruby
wildtrees has quit [Max SendQ exceeded]
wildtrees has joined #ruby
hotpancakes has joined #ruby
tens0r has joined #ruby
tens0r has quit [Client Quit]
Abhijit has joined #ruby
NODE has quit [Quit: changing servers]
NODE has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
Macrobiotic has joined #ruby
buckworst has quit [Quit: WeeChat 2.3]
hotpancakes has quit [Remote host closed the connection]
hotpancakes has joined #ruby
akemhp_ has joined #ruby
akemhp_ has quit [Remote host closed the connection]
akemhp has quit [Ping timeout: 240 seconds]
akemhp has joined #ruby
hotpancakes has quit [Ping timeout: 250 seconds]
reber_ has joined #ruby
reber has quit [Ping timeout: 240 seconds]
jinie has joined #ruby
jinie has quit [Client Quit]
CalimeroTeknik has quit [Ping timeout: 240 seconds]
hotpancakes has joined #ruby
CalimeroTeknik has joined #ruby
Abhijit has quit [Quit: Leaving]
hotpancakes has quit [Client Quit]
drincruz has joined #ruby
drincruz has quit [Read error: Connection reset by peer]
drincruz has joined #ruby
NODE has quit [Quit: changing servers]
NODE has joined #ruby
NODE has left #ruby [#ruby]
NODE has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
fanta1 has joined #ruby
hiroaki has joined #ruby
sagax has quit [Quit: Konversation terminated!]
jenrzzz has joined #ruby
al2o3-cr has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 268 seconds]
al2o3-cr has joined #ruby
sergioro has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
drincruz has joined #ruby
Xiti has quit [Quit: Xiti]
fanta1 has quit [Quit: fanta1]
ivanskie has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
morozovm has joined #ruby
morozovm has quit [Read error: Connection reset by peer]
Xiti has joined #ruby
_whitelogger has joined #ruby
yann-kaelig has quit [Quit: yann-kaelig]
<akemhp>
Hey, i got an issue, when i have one script with just: s = gets; puts "s: #{s}"; in my script, if run the script with a command line argument (i want to use it later in the script) i got an error: ./test_argv_gets.rb:3:in `gets': No such file or directory @ rb_sysopen - e (Errno::ENOENT)
<akemhp>
Ok, solved with STDIN.gets instead. Nm.
romanblanco has quit [Read error: Connection reset by peer]
romanblanco has joined #ruby
drincruz has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drincruz has quit [Ping timeout: 252 seconds]
akem__ has joined #ruby
akemhp has quit [Ping timeout: 268 seconds]
romanblanco has quit [Ping timeout: 250 seconds]
akem__ has quit [Ping timeout: 252 seconds]
jinie has joined #ruby
akemhp has joined #ruby
orbyt_ has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
akemhp has quit [Ping timeout: 250 seconds]
sagax has joined #ruby
dionysus69 has joined #ruby
romanblanco has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
reber__ has joined #ruby
reber_ has quit [Ping timeout: 250 seconds]
romanblanco has quit [Ping timeout: 250 seconds]
NODE has quit [Quit: changing servers]
NODE has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
NODE has quit [Client Quit]
NODE has joined #ruby
mn3m has joined #ruby
NL3limin4t0r_afk has quit [Ping timeout: 265 seconds]
NL3limin4t0r_afk has joined #ruby
jenrzzz has joined #ruby
drincruz has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
kaleido has quit [Remote host closed the connection]
kaleido has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
drincruz has quit [Ping timeout: 250 seconds]
wildtrees has quit [Remote host closed the connection]
akemhp has joined #ruby
NODE has quit [Quit: changing servers]
wildtrees has joined #ruby
romanblanco has joined #ruby
wildtrees has quit [Remote host closed the connection]
NODE has joined #ruby
wildtrees has joined #ruby
jenrzzz has joined #ruby
dviola has quit [Quit: WeeChat 2.7]
NODE has quit [Client Quit]
NODE has joined #ruby
NODE has quit [Client Quit]
jenrzzz has quit [Ping timeout: 276 seconds]
NODE has joined #ruby
Esa_ has quit [Ping timeout: 246 seconds]
lbrandon has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Emmanuel_Chanel has quit [Quit: Leaving]
Emmanuel_Chanel has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
mn3m has quit [Ping timeout: 268 seconds]
kaleido has quit [Quit: out]
kaleido has joined #ruby
mn3m has joined #ruby
SeepingN has quit [Ping timeout: 240 seconds]
Macrobiotic has quit [Quit: Connection closed for inactivity]