<Authenticator>
I mistyped above though, ... if it's blockeD, reading (.pop), as the last one [producer] dies ...
iPhone6128 has quit [Client Quit]
skj3gg has quit [Quit: ZZZzzz…]
<Authenticator>
I made it work originally by rescuing Exception on the q.pop, which seemed ugly, and only worked once per runtime?!?
tmk1108 has joined #ruby
Pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Authenticator>
Now I've got the producers set to push a semaphore value onto the queue as they die, which is much less hacky, but still doesn't seem clean.
ta_ has joined #ruby
Sakens has quit [Ping timeout: 265 seconds]
cobragoat has quit [Read error: Connection reset by peer]
bruno- has joined #ruby
<splud>
sounds more like you’re collecting toe tags from the threads.
fgo has joined #ruby
Number2 has joined #ruby
<zenspider>
I can't make heads or tails out of BS code
ellisTAA has joined #ruby
<Authenticator>
splud: I've heard it called that, in retrospect. I'm currently going out of my way to collect one when they're all dead, but if I collected one each and just counted them that might be easier.
mloveless has quit [Remote host closed the connection]
<weaksauce>
ellisTAA that provides practice... it's not a book
<weaksauce>
it's interactive
jerius has joined #ruby
<ellisTAA>
ill check it out as soon as i get these problems done
ninjazach has joined #ruby
ivanskie has joined #ruby
ninjazach is now known as Guest57534
nuck has quit [Quit: Computer has gone to sleep.]
tylersmith has quit [Remote host closed the connection]
<weaksauce>
i'd suggest you check it out now. you really don't have a great grasp on the concepts and it would help you immensely. if you do know the language as well as you think you do it shouldn't take much time at all to breeze through it.
fgo has quit [Ping timeout: 276 seconds]
nii236|irssi has joined #ruby
oo_ has joined #ruby
tmk1108 has joined #ruby
DadoCe has joined #ruby
dfinninger has quit [Remote host closed the connection]
FooMunki_ has joined #ruby
ki0 has joined #ruby
djbkd has quit [Remote host closed the connection]
nanoyak has quit [Quit: Computer has gone to sleep.]
Aova has quit [Read error: Connection reset by peer]
<zenspider>
nil checks are almost always a code smell
<zenspider>
btw... codeschool is apparently free for the next 3 days
<weaksauce>
is that better than codeacademy?
nuck has joined #ruby
djbkd has joined #ruby
Parker0 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<weaksauce>
codeacademy is free
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jerematic has quit [Remote host closed the connection]
<zenspider>
dunno. I don't use either of them
maletor has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jerematic has joined #ruby
ivanskie has joined #ruby
Parker0 has joined #ruby
dspangenberg has joined #ruby
<sevenseacat>
codeschool is good for the basics and for lots of hand-holding
ki0 has quit [Ping timeout: 256 seconds]
klmlfl has joined #ruby
<sevenseacat>
and its ruby course was pretty meh
Deele has quit [Ping timeout: 245 seconds]
Codemule42 has joined #ruby
Parker0 has quit [Client Quit]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Aova has joined #ruby
<pipework>
I like learning ruby by using TWGR, then picking up a pickaxe for reference, and then getting metaprogramming ruby and only reading the first half.
<pipework>
After that, you're kinda set to go learn anything.
ta_ has quit [Ping timeout: 276 seconds]
deol has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nuck has quit [Ping timeout: 264 seconds]
<nii236|irssi>
sevenseacat: What do you suggest for a pathway from ruby to rails then?
nuck has joined #ruby
dspangenberg has quit [Ping timeout: 265 seconds]
Codemule42 has quit [Remote host closed the connection]
<ellisTAA>
i’m currently using .assoc(obj) on a hash to return a key and value that match my argument, but it is formatting it like this [“key name”, “value name”]. Anyone know a method that will do the same thing and return it in this format [“key name” => “value name”]?
djbkd has quit [Remote host closed the connection]
reinaldob has quit [Remote host closed the connection]
djbkd has joined #ruby
dseitz has joined #ruby
<centrx>
ellisTAA, interpolate a string that looks how you want it to look
<ellisTAA>
ahh .. ok thanks
jgrevich_ has joined #ruby
jgrevich has quit [Ping timeout: 245 seconds]
jgrevich_ is now known as jgrevich
wallerdev has joined #ruby
<zenspider>
ellisTAA: you mean, it is doing exactly what the doco says it'll do
haasn has quit [Quit: haasn]
<zenspider>
ellisTAA: why are you worried whether the result is an array or a hash?
<ellisTAA>
yep
parduse has joined #ruby
<ellisTAA>
i dont care, it’s the test that i’m working on, i didnt write it
<zenspider>
and [“key name” => “value name”] is nonsensical. that's an array with a hash syntax
<ellisTAA>
well that’s how assoc outputs it...
meinside has joined #ruby
<zenspider>
no it isn't
jerematic has quit [Remote host closed the connection]
<zenspider>
["key" => "val"] doesn't exist
nanoyak has joined #ruby
<centrx>
assoc outputs an array, but he wants this specific format to satisfy a test problem he is doing
<centrx>
apparently
Joufflu has joined #ruby
<zenspider>
that's great. what he's asking for is nonsensical
michael_mbp has quit [Excess Flood]
<ellisTAA>
centrx: could u help me out with creating a string for my output? right now i’m not really controlling the format so i’m not sure how to turn it into a string with interpolation. https://gist.github.com/ellisTAA/0a8c4da823b3851e7685 line 66 is the current output
michael_mbp has joined #ruby
<weaksauce>
pipework eloquent ruby is really good.
<pipework>
weaksauce: Yeah, it totally is! I don't know how I feel about handing that to a beginner though.
<pipework>
I feel like they need to skin their knees a bit on ineloquent ruby for a while.
<weaksauce>
that's more of an "ok, I know the syntax and how to do things... how do I make it better"
<crocket>
Buh
pdoherty has joined #ruby
Channel6 has joined #ruby
Lexun has quit [Remote host closed the connection]
tkuchiki has joined #ruby
<pipework>
I could see that as a good way to bring up people who do it the right way from the start, but I worry about them being unable to do much more than just parrot his opinions on why being eloquent is better. Sometimes having no previous experience to compare against could shake the foundation that eloquence brought them
nanoyak has quit [Ping timeout: 256 seconds]
<ellisTAA>
r u guys talking about advi grimm’s book?
haasn has joined #ruby
<zenspider>
gah that's a mess
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ellisTAA>
what’s a mess?
<zenspider>
I... I can't even finish reading that
<zenspider>
your code
<ellisTAA>
lol
<zenspider>
your logic and your code
<ellisTAA>
i welcome feedback
<zenspider>
1) use your text editor and reformat your code to be idiomatic and readable
TinkerTyper has quit [Ping timeout: 265 seconds]
<ellisTAA>
zenspider: ok ill do that
mrmargolis has joined #ruby
ta_ has quit [Ping timeout: 264 seconds]
pdoherty has quit [Ping timeout: 245 seconds]
TinkerTyper has joined #ruby
pdoherty has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
ezioa has quit [Quit: Leaving]
brian_ has quit [Ping timeout: 256 seconds]
it0a has joined #ruby
fgo has joined #ruby
test33626 has joined #ruby
test33626 has left #ruby [#ruby]
test33626 has joined #ruby
test33626 has left #ruby [#ruby]
test33626 has joined #ruby
test33626 has left #ruby [#ruby]
crocket has left #ruby ["Leaving"]
amclain has joined #ruby
eka has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
josephndenton has joined #ruby
shime has quit [Ping timeout: 245 seconds]
djbkd has quit [Quit: My people need me...]
ta_ has joined #ruby
valkyrka has quit [Ping timeout: 245 seconds]
longfeet has joined #ruby
djbkd has joined #ruby
bricker has quit [Ping timeout: 252 seconds]
maletor has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
brandon_ has quit [Ping timeout: 272 seconds]
robustus has quit [Ping timeout: 264 seconds]
ta_ has quit [Ping timeout: 276 seconds]
athan has joined #ruby
sent1nel has quit [Remote host closed the connection]
djbkd has quit [Ping timeout: 255 seconds]
tier has quit [Remote host closed the connection]
deric_skibotn has quit [Ping timeout: 276 seconds]
robustus|Off has joined #ruby
tmk1108 has quit [Remote host closed the connection]
robustus|Off is now known as robustus
poikon has quit []
ta_ has joined #ruby
openscript has joined #ruby
jonr22 has joined #ruby
brandon_ has joined #ruby
nuck has quit [Quit: Computer has gone to sleep.]
centrx has quit [Quit: Science is organized knowledge, wisdom is organized life.]
arescorpio has joined #ruby
Megtastique has joined #ruby
tier has joined #ruby
Hobogrammer has joined #ruby
vaneda has joined #ruby
jonr22 has quit [Ping timeout: 255 seconds]
ta_ has quit [Ping timeout: 264 seconds]
FooMunki_ has quit [Quit: FooMunki_]
failshell has joined #ruby
klmlfl has quit [Remote host closed the connection]
eka has joined #ruby
hrs has joined #ruby
openscript has quit [Quit: Page closed]
slyv has joined #ruby
ellisTAA has quit [Quit: ellisTAA]
failshell has quit [Ping timeout: 272 seconds]
leonshalimov has joined #ruby
vaneda has quit []
zachrab has quit [Remote host closed the connection]
DadoCe has quit [Remote host closed the connection]
EvanFreeman has joined #ruby
<ponga>
hey shevy
<ponga>
are you there
hrs has left #ruby [#ruby]
nuck has joined #ruby
DadoCe has joined #ruby
Aova has quit [Read error: Connection reset by peer]
bthesorceror has quit [Quit: bthesorceror]
pdoherty has quit [Remote host closed the connection]
Hijiri has joined #ruby
paulfm has joined #ruby
leonshalimov has quit [Ping timeout: 245 seconds]
ta_ has joined #ruby
Dude007 has quit [Ping timeout: 264 seconds]
josephndenton has quit [Ping timeout: 244 seconds]
zachrab has joined #ruby
Number2 has quit [Remote host closed the connection]
Aova has joined #ruby
deol has joined #ruby
ta_ has quit [Ping timeout: 276 seconds]
beef-wellington has quit [Ping timeout: 265 seconds]
suy has quit [Ping timeout: 245 seconds]
hamakn has joined #ruby
DadoCe has quit [Remote host closed the connection]
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ta_ has joined #ruby
DadoCe has joined #ruby
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
eka has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fandi has quit [Remote host closed the connection]
psy_ has quit [Quit: Leaving]
nateberkopec has joined #ruby
vaneda has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
luriv has quit [Ping timeout: 255 seconds]
russt_ has joined #ruby
jenrzzz has quit [Ping timeout: 256 seconds]
ferr has quit [Quit: Lost terminal]
bthesorceror has joined #ruby
pdoherty has joined #ruby
suy has joined #ruby
triple_b has joined #ruby
DadoCe has quit [Ping timeout: 265 seconds]
jenrzzz has joined #ruby
josephndenton has joined #ruby
martin_work has quit [Ping timeout: 244 seconds]
pika_pika has quit [Ping timeout: 265 seconds]
zachrab has quit [Remote host closed the connection]
mloveless has joined #ruby
zachrab has joined #ruby
aspiers has quit [Ping timeout: 245 seconds]
ramfjord has quit [Ping timeout: 252 seconds]
hackeron has quit [Ping timeout: 252 seconds]
ta_ has quit [Ping timeout: 252 seconds]
bronson has joined #ruby
eka has joined #ruby
dspangenberg has joined #ruby
jshultz has quit [Quit: Connection closed for inactivity]
hackeron has joined #ruby
josephndenton has quit [Ping timeout: 252 seconds]
happyface has quit [Quit: Connection closed for inactivity]
jottr has quit [Ping timeout: 264 seconds]
krz has joined #ruby
zachrab has quit [Ping timeout: 256 seconds]
vaneda has quit [Ping timeout: 255 seconds]
Junaos has joined #ruby
bronson has quit [Ping timeout: 252 seconds]
tyfighter has quit [Quit: tyfighter]
dspangenberg has quit [Ping timeout: 264 seconds]
JDiPierro has joined #ruby
aspiers has joined #ruby
hrs has joined #ruby
hrs has quit [Client Quit]
paulfm has quit [Quit: Goodbye]
senayar has joined #ruby
snath has joined #ruby
JDiPierro has quit [Ping timeout: 264 seconds]
timanema has quit [Ping timeout: 264 seconds]
failshell has joined #ruby
patric100e99 has joined #ruby
<Cat_1>
Pretty empty in here
wallerdev has quit [Quit: wallerdev]
yeticry has quit [Read error: Connection reset by peer]
senayar has quit [Ping timeout: 240 seconds]
vaneda has joined #ruby
bronson has joined #ruby
crazymykl has joined #ruby
razieliyo has quit [Ping timeout: 252 seconds]
bronson has quit [Remote host closed the connection]
tier has quit [Remote host closed the connection]
bronson has joined #ruby
arup_r has joined #ruby
kapil__ has joined #ruby
bronson has quit [Remote host closed the connection]
tyfighter has joined #ruby
davidhq has quit [Ping timeout: 264 seconds]
mikemac has quit [Ping timeout: 256 seconds]
martin_work has joined #ruby
yeticry has joined #ruby
mikemac has joined #ruby
thumpba has quit [Remote host closed the connection]
thumpba has joined #ruby
CpuID2 has joined #ruby
CpuID2 has joined #ruby
sankaber has joined #ruby
jgrevich_ has joined #ruby
crazymykl has quit [Ping timeout: 244 seconds]
symbol_ has joined #ruby
jgrevich_ has quit [Client Quit]
shazaum has quit [Quit: This computer has gone to sleep]
failshell has quit [Remote host closed the connection]
jgrevich has quit [Ping timeout: 264 seconds]
Jetchisel has joined #ruby
jerius has quit []
klmlfl has joined #ruby
nateberkopec has quit [Quit: Leaving...]
maximski has joined #ruby
maximski has quit [Max SendQ exceeded]
tylersmith has joined #ruby
ta_ has joined #ruby
maximski has joined #ruby
postmodern has quit [Quit: Leaving]
CpuID2 has quit [Quit: This computer has gone to sleep]
mikemac has quit [Remote host closed the connection]
mikemac has joined #ruby
maximski has quit [Ping timeout: 255 seconds]
Takle has joined #ruby
n008f4g_ has quit [Ping timeout: 256 seconds]
vt102 has quit [Ping timeout: 265 seconds]
klmlfl has quit [Remote host closed the connection]
krz has quit [Read error: Connection reset by peer]
josephndenton has quit [Ping timeout: 276 seconds]
dc_ has quit [Remote host closed the connection]
<sevenseacat>
xcesariox: don't cross-post.
jottr has quit [Ping timeout: 264 seconds]
<sevenseacat>
especially if what you're cross-posting is offtopic in one of the channels.
Endoze has quit [Quit: WeeChat 1.1.1]
<ericwood>
yeah hadoop is strictly forbidden here
Dude007 has joined #ruby
kenneth has joined #ruby
Endoze has joined #ruby
roolo has quit [Ping timeout: 265 seconds]
krz has joined #ruby
<chipotle>
helllo ruby
crazymykl has joined #ruby
radic has quit [Ping timeout: 245 seconds]
Dude007 has quit [Ping timeout: 276 seconds]
radic has joined #ruby
mikemac has quit [Ping timeout: 240 seconds]
kenneth has quit [Quit: Bye.]
EvanFreeman has quit [Remote host closed the connection]
Endoze has quit [Quit: WeeChat 1.1.1]
Suit_Of_Sables has quit [Quit: WeeChat 0.4.0]
EvanFreeman has joined #ruby
<gr33n7007h>
can someone tell my why when I add `unless @queue.pop.nil?` it only pops half of half but when I remove `unless @queue.pop.nil?` it pops all off #=> https://gist.github.com/anonymous/6b0c5c33bf2e32feafa7 (line 79)
<gr33n7007h>
my brain ain't working thank you muchly
jonr22 has joined #ruby
<sevenseacat>
you're welcome
dc_ has joined #ruby
<gr33n7007h>
and it's late :(
nux443 has joined #ruby
EvanFreeman has quit [Ping timeout: 244 seconds]
bronson has joined #ruby
mrmargolis has quit [Remote host closed the connection]
kenneth has joined #ruby
adriancb has joined #ruby
jonr22 has quit [Ping timeout: 256 seconds]
TripTastic is now known as JBreit
ponga has quit [Ping timeout: 240 seconds]
kenneth has quit [Client Quit]
ponga has joined #ruby
timanema has joined #ruby
josephndenton has joined #ruby
bronson has quit [Ping timeout: 264 seconds]
hgl has quit [Ping timeout: 256 seconds]
tus has quit []
<epitron>
gr33n7007h: dude
<epitron>
queue.pop is destructive
failshell has joined #ruby
<epitron>
that's like saying, "puts string if string.erase"
kenneth has joined #ruby
<epitron>
it should be: "target = @queue.pop unless @queue.empty?"
<epitron>
no wait
<epitron>
lol
<epitron>
that loop should be:
adriancb has quit [Ping timeout: 252 seconds]
<epitron>
while target = @queue.pop
<epitron>
...
<epitron>
end
<epitron>
i think you need some sleep gr33n7007h
hgl has joined #ruby
<gr33n7007h>
yes, fuck it going bed
* gr33n7007h
YAWN
jenrzzz has joined #ruby
leonshalimov has joined #ruby
<gr33n7007h>
anyways cheers epitron i'' change it in the morning
psy_ has joined #ruby
psy_ has quit [Max SendQ exceeded]
psy_ has joined #ruby
failshell has quit [Ping timeout: 265 seconds]
<epitron>
\o/
<epitron>
good ascii art btw
Koshian has quit [Quit: Tiarra 0.1+svn-39209: SIGTERM received; exit]
longfeet has quit [Ping timeout: 252 seconds]
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
timanema has quit [Ping timeout: 265 seconds]
greenbagels has quit [Quit: Leaving]
braincrash has quit [Quit: bye bye]
<gr33n7007h>
epitron: just changed it to while target = @queue.pop ... end it finished right at the I get a fierce.rb:77:in `join': deadlock detected (fatal)
martin_work has joined #ruby
leonshalimov has quit [Ping timeout: 245 seconds]
josephndenton has quit [Ping timeout: 256 seconds]
porfa has joined #ruby
<gr33n7007h>
goodnight god bless
d10n-work has quit [Quit: Connection closed for inactivity]
<epitron>
awwyeah
<epitron>
deadlock bedtime
Neomex has quit [Ping timeout: 265 seconds]
jhass is now known as jhass_
jhass_ is now known as jhass
braincrash has joined #ruby
AlexRussia has quit [Ping timeout: 245 seconds]
AlexRussia has joined #ruby
nanoyak has joined #ruby
Aova has quit [Read error: Connection reset by peer]
yellowgh0st has quit [Quit: yellowgh0st]
arup_r has quit [Quit: Leaving.]
troubadour has joined #ruby
Koshian has joined #ruby
<nii236|irssi>
Argh crap I'm up to regex topic in koan nooo
cantonic has quit [Quit: cantonic]
Koshian is now known as Koshian
kyb3r_ has joined #ruby
Aova has joined #ruby
Nilium has quit [Quit: <kristin> Cower is like... I dunno. sometimes he seems senile and other times he seems like a middle schooler.]
sankaber has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ursooperduper has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
skj3gg has joined #ruby
dspangenberg has joined #ruby
EasyCo has joined #ruby
cantonic has joined #ruby
<EasyCo>
Hey guys, general tool question... what tools, if any, do you guys use for planning out an application. i.e. mapping features, user stories and so on...
<mozzarella>
just a regular text editor
dspangenberg has quit [Ping timeout: 252 seconds]
cantonic has quit [Read error: Connection reset by peer]
Nilium has joined #ruby
cantonic has joined #ruby
<EasyCo>
mozzarella: Thanks, we just use whiteboards and word as well. Just wondering if there was a nice tool out there that kind of brought them all together.
bluOxigen has joined #ruby
timanema has joined #ruby
oo_ has quit [Remote host closed the connection]
jerematic has joined #ruby
symbol_ has quit [Ping timeout: 244 seconds]
jerematic has quit [Read error: Connection reset by peer]
craigp has quit [Remote host closed the connection]
davedev24_ has quit [Ping timeout: 255 seconds]
jimmyhoughjr has joined #ruby
davedev24_ has joined #ruby
bricker has joined #ruby
timanema has quit [Ping timeout: 264 seconds]
thumpba_ has joined #ruby
krz has quit [Read error: Connection reset by peer]
frem has quit [Quit: Connection closed for inactivity]
towski_ has joined #ruby
Nilium has quit [Quit: <kristin> Cower is like... I dunno. sometimes he seems senile and other times he seems like a middle schooler.]
Parker0 has joined #ruby
snath has quit [Ping timeout: 246 seconds]
towski_ has quit [Remote host closed the connection]
vaneda has quit [Quit: Computer has gone to sleep.]
Nilium has joined #ruby
thumpba has quit [Ping timeout: 276 seconds]
skj3gg has quit [Quit: ZZZzzz…]
hgl has quit [Ping timeout: 245 seconds]
bricker has quit [Quit: leaving]
agjacome has quit [Quit: leaving]
Parker0 has quit [Client Quit]
krz has joined #ruby
hgl has joined #ruby
triple_b has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mloveless has quit [Remote host closed the connection]
arescorpio has quit [Excess Flood]
skj3gg has joined #ruby
senayar has joined #ruby
sivoais has quit [Ping timeout: 264 seconds]
Mon_Ouie has quit [Quit: WeeChat 1.1]
sivoais has joined #ruby
Sakens has joined #ruby
bthesorceror has quit [Quit: bthesorceror]
senayar has quit [Ping timeout: 245 seconds]
snath has joined #ruby
troubadour has quit [Quit: troubadour]
ponga has quit [Remote host closed the connection]
Pharaoh2 has joined #ruby
chrishough has joined #ruby
Takle has joined #ruby
zumbi has quit [Read error: Connection reset by peer]
kapil__ has quit [Quit: Connection closed for inactivity]
ferr has joined #ruby
ivanskie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<weaksauce>
nii236|irssi why aw crap?
<weaksauce>
regex is useful
ivanskie has joined #ruby
thumpba_ has quit [Remote host closed the connection]
thumpba has joined #ruby
bthesorceror has joined #ruby
jaequery has joined #ruby
Takle has quit [Ping timeout: 256 seconds]
DadoCe has joined #ruby
thumpba has quit [Remote host closed the connection]
thumpba has quit [Remote host closed the connection]
<epitron>
these are good :)
<Nilium>
I just use a notebook with graph paper.
<Nilium>
I'm lazy about this stuff.
<epitron>
yep
<epitron>
it has to be something you'll actually use
<epitron>
that's the problem with those bit complex atlassian webapps
<epitron>
*big
<Nilium>
Trouble with software for it is I can't drag the software with me when I go to call someone an idiot
hgl has quit [Ping timeout: 245 seconds]
<TheNet>
has anyone here tried opal and if so were you impressed?
<epitron>
"hold on!! let me pull it up on my phone!!!"
<epitron>
*looks down and pokes at phone for 5 minutes*
Aova has quit [Ping timeout: 245 seconds]
<epitron>
opal isn't bad
<Nilium>
'Cause I'm very big on just getting up from my desk and walking over to the person who I want to talk to (or is currently on my shit-list)
<epitron>
the js it produces is pretty hard to read though
<epitron>
i was impressed with how much of ruby was suppored
<Nilium>
I think Opal produces source maps, so there's maybe that.
<TheNet>
I don't really care about readability, how did you find the performance though?
CpuID2 has joined #ruby
CpuID2 has joined #ruby
<Nilium>
I'd honestly never use it though.
<epitron>
i didn't use it much
hgl has joined #ruby
<epitron>
i just played around with it for a few minutes
<Nilium>
Unless a to-javascript language has static typing or reduces the amount of code I have to write drastically, I don't care. It's a pain to debug.
<epitron>
it was very fast at 10 line ruby code!
yfeldblu_ has joined #ruby
<epitron>
pain to debug is more of a browser problem than the language
<TheNet>
Nilium: I just perfer the ruby syntax much more than javascript. I'm trying to decide between it and coffee script
<Nilium>
It's bad enough that debugging anything in JS is already horrible, I don't like having to also keep a compiler in my head.
<epitron>
sourcemaps should make that easy
<epitron>
but no :)
<epitron>
browsers \o/
djbkd has quit [Ping timeout: 244 seconds]
skj3gg has joined #ruby
Aova has joined #ruby
yfeldblum has quit [Ping timeout: 255 seconds]
<mozzarella>
I have the same opinion as Nilium
<epitron>
i actually liked using coffeescript
<epitron>
do any browsers support ES6 yet?
kapil__ has joined #ruby
<mozzarella>
coffeescript is easier to transform I think
posixpascal has joined #ruby
CpuID2 has quit [Quit: This computer has gone to sleep]
parduse has quit []
<epitron>
yeah
<epitron>
the JS it generates is readable
deuti has joined #ruby
crazymykl has quit [Read error: Connection reset by peer]
<epitron>
programming is definitely generating a tower of babel kind of situation
<mozzarella>
yeah, it's closer to javascript than ruby, it's really just a different syntax for the same thing, with a few addons
parduse has joined #ruby
<epitron>
so many people trying to make programming better by adding yet another language
<Nilium>
I use LiveScript for most things, much to the chagrin of every other human being on the planet
<mozzarella>
I don't write enough javascript to bother using something else
<nii236|irssi>
weaksauce: regex hurts my brain
<epitron>
i think we need to unify our efforts so we can have a cross-language standard library (that's not written in C)
<epitron>
then, "yet another language" will be useful from its birth
<mozzarella>
eeeww
<Nilium>
I'd probably use Dart if I thought I cared, but I don't
<Nilium>
Getting any sort of change or improvement to browsers in is the slowest process on the planet and requires one browser to be self-updating and the only thing in use ever.
<epitron>
it used to be the slowest thing ever
<epitron>
it's pretty fast now though
<epitron>
chrome is zipping along
marcdel has joined #ruby
<epitron>
and everyone has to catch up to them to remain relevant
<Nilium>
Not really.
<epitron>
which part is not real?
<mozzarella>
they're trying to improve JS instead of replacing it
<epitron>
the real problem with replacing JS is that upgrading human brains is a lot harder
<Nilium>
Chrome can't do anything to force any other browser maker's hand.
<epitron>
ES6 is just javascripty enough that people will go with it
<epitron>
Nilium: right, but there are really only 2 browser makers left: Chrome-based, and Firefox
<Nilium>
If Chrome does something, then you have to say "this is only for Chrome" and the people who can't use it will probably just ignore it because it's too much of a pain to install Chrome and then run it.
<Nilium>
Lest we forget iOS is still relevant, and Safari as a result.
aagdbl has joined #ruby
siso has joined #ruby
<mozzarella>
chrome is trying to push dart and it's not working
<epitron>
true, mobile is a different issue
<epitron>
most mobile browsers are webkit-based though
<mozzarella>
they should make browsers read bytecode, and we could use any language and make it output bytecode instead
<epitron>
mozzarella: if you read their original memo, they actually predicted that the web might beat Dart, because it was moving so fast
<Nilium>
And who controls Webkit?
<mozzarella>
instead of javascript
<Nilium>
Right, Apple does! :D
<Nilium>
So we're boned.
<epitron>
well, chrome forked it
<epitron>
chrome is the leader really
<Nilium>
Which isn't really important. Webkit isn't what we're talking about.
<mozzarella>
it's not like you can't obfuscate javascript, so I don't see why not
<Nilium>
JavascriptCore, V8, etc. are the things we're concerned with
<epitron>
mozzarella: heh.. yeah, people were messing with the bytecode idea for a while... ASM.js and NaCl came out of that
<Nilium>
The bytecode issue has come up a few times before and the opinion is that having bytecode means you can't optimize JS as well because reasons.
<epitron>
mozzarella: eventually they realized that it's good enough to just emit JS
<Nilium>
Even though it should be easier to find patterns in bytecode than in JS source.
<epitron>
i guess they figured it's not worth the effort standardizing
<mozzarella>
if you can optimize java bytecode, why not some other kind of bytecode? lol
FScottFitzgerald has joined #ruby
<epitron>
bytecode would be ideal
diegoviola has quit [Quit: WeeChat 1.1.1]
<epitron>
but everyone just compiles to JS, so they were like, "meh, fuck it"
<mozzarella>
meh, it's really just standards, you gotta follow the standards
<mozzarella>
you can't do it your way or people will complain
<epitron>
we're dancing around the real performance issue though -- THE DOM :)
FScottFitzgerald has quit [Client Quit]
<epitron>
no matter what language you use, the DOM is still terrible
krz has quit [Ping timeout: 255 seconds]
<aagdbl>
has anyone started rescue workers inside another process? i.e. without a rake task?
oo_ has joined #ruby
posixpascal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jonmorehouse has quit [Ping timeout: 264 seconds]
<epitron>
aagdbl: is that a rails thing?
<epitron>
(resque?)
ARCADIVS has joined #ruby
<aagdbl>
no
<epitron>
well, i have no idea what you're talking about :)
<Nilium>
I think browsers in general might be the things that have changed the least in terms of capabilities over the last 20 years.
<splud>
we run a watchgog thread from an installer process,
<Nilium>
Everyone will go "but they have CSS 3 and HTML5 now" but they're all such small things
<splud>
the last _20_ years? Browsers have changed a lot.
<epitron>
Nilium: their ability to use all your ram has definitely improved
<Nilium>
Is that an improvement?
<epitron>
yeah, you should try netscape 4 again :)
<splud>
heh, true.
<epitron>
no, it was a joke Nilium
<splud>
NCSA Mosaic.
<Nilium>
They still just display formatted text.
<Nilium>
And images.
<Nilium>
That's kind of it.
<epitron>
i use chrome with js/plugins disabled
<splud>
Or for a blast from the past, use the Gopher protocol.
<epitron>
s/chrome/opera
<Nilium>
Ha, Opera.
<epitron>
opera 12 still works on a lot of the web
<epitron>
google is really good with degradability
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<epitron>
uses no ram, it's lightning fast
<epitron>
opera 12's caching is great -- not influenced by advertisers :)
arup_r has joined #ruby
<splud>
Opera used to be so cool. And firefox too. Then, WTF?
<Nilium>
I use Safari because it doesn't crash as much as Chrome and Firefox.
<epitron>
and if i want, i have a proxy that can rewrite cache-control headers
swgillespie has joined #ruby
<Nilium>
I value the ability to survive my idiocy.
pdoherty has joined #ruby
<epitron>
splud: in the case of opera, the technical/creative genius who made opera what it was left
<epitron>
splud: i think that was around 2007
<Nilium>
Was Opera ever open source?
<epitron>
he's the guy who first introduced tabs and gestures
josephndenton has joined #ruby
<Nilium>
I mean aside from when they switched to being a fork of Chrome.
<Nilium>
Not sure if that's open-source either.
<epitron>
no
michael_mbp has quit [Excess Flood]
<epitron>
they were always closed
<epitron>
they had an SDK you could license (see: Wii browser)
<epitron>
a lot of people want opera 12 opensourced
<Nilium>
Kind of a shame. Seeing the old Opera (pre-Chrome) source would be nice.
<splud>
I wish to shoot the chap here who continues to have outdated platforms being built in our kernel build process, and they’re built before the platforms which ARE current.
<epitron>
opera claims that it can't because the codebase is too messy or something :)
<splud>
Must suffer through so much churn...
<Nilium>
Opera was kind of the testing ground for new CSS crap, so it was neat.
<epitron>
their HTML renderer is so awesome too
<epitron>
it's like greased lightning
jonr22 has joined #ruby
TheNet has quit [Remote host closed the connection]
pontiki has joined #ruby
<epitron>
the Javascript engine was garbage though
<epitron>
if they opensourced it, i bet you could just drop V8 in there
psmolen has quit [Ping timeout: 272 seconds]
<epitron>
opera's problem was that they never found a good business model
<splud>
and then a bunch of developers would start cramming all sorts of useless crap in there...
<epitron>
they couldn't charge people for the browser, so they started selling out to advertisers
TheNet has joined #ruby
<epitron>
i think that's what drove away the original innovative dude
<Nilium>
Opera's business model was (rightly) accusing Microsoft of having a monopoly and hoping that would work.
<Nilium>
It didn't work.
<epitron>
lol wat
<splud>
I’d pay for a browser that didn’t consume all my memory, and wasn;t coming out with an urgent update several times a week.
michael_mbp has joined #ruby
<epitron>
splud: at this point, definitely :)
<epitron>
7 years ago i wouldn't have though
<splud>
I applies, what 35.0 from Firefox after waiting a couple of days, and I kid you not, no sooner had I restarted the effin thing, than there was a dialog telling me I need to upgrade to 35,1...
pdoherty has quit [Ping timeout: 245 seconds]
<epitron>
hah
Kn|t3_ has joined #ruby
<epitron>
it only checks for updates on startup ;)
<splud>
epitron: finances different, or your perceived value of a good tool?
commmmodo has joined #ruby
<epitron>
well, opera in 2008 was awesome
<epitron>
and it was free
<epitron>
so, i didn't care :)
russt_ has quit [Ping timeout: 265 seconds]
<epitron>
and i guess my finances have improved as well
<epitron>
i wonder if people would pay $2/month for a browser
<epitron>
ugh, there's so much friction to getting people to pay
<epitron>
create account, validate email, input credit card info, check that money went through...
<splud>
I pay for a TiVo subscription - allows me and my kids to skip commercials, and watch what we want when we’re interested.
<epitron>
there needs to be a magic button that just sends someone $1 when you click it
<splud>
Time has value.
<splud>
I see a button which will be exploited.
<epitron>
hahah
<epitron>
ok, a coin slot on your computer
<epitron>
and you can just put coins in it, and they get sent over the internet
<splud>
in fact it’s probably already been exploited in MSIE.
<epitron>
and a dirty guy comes into your house once a week to empty the coin box
lolmaus has quit [Quit: Konversation terminated!]
jonr22 has quit [Ping timeout: 276 seconds]
psmolen has joined #ruby
<splud>
smokin a stogie, hasn’t showered in weeks, coarse beard, coarse attitude, filthy clothes.
<epitron>
haha
<epitron>
covered in grease
<epitron>
he shoves a crowbar into your computer
Musashi007 has joined #ruby
<epitron>
pops open the coin drawer
ellisTAA has left #ruby [#ruby]
<epitron>
coughs phlegmily
* Nilium
looks at heroku to figure out why anyone in their right mind pays for this.
<epitron>
(phlegmatically?)
<splud>
and hacks a bit onto your desk and monitor...
<sevenseacat>
Nilium: because its easy
<splud>
oooh, he;s a trained phlegmatist.
<Nilium>
Easy is scp'ing a binary to my server and restarting it
<Nilium>
This looks complicated
<sevenseacat>
people like me absolutely hate doing anything devopsy
<Nilium>
I use Go precisely because I'm lazy as hell
<sevenseacat>
deployment is just a git push
<sevenseacat>
for heroku
porfa has quit [Quit: porfa]
<epitron>
splud: Coinpal sounds like it might make an amusing youtube video :)
<Nilium>
I don't want deployment tied to my SCM. That sounds bad.
<splud>
I’m rather irritated with Go actually.
failshell has joined #ruby
<sevenseacat>
Nilium: it does?
<epitron>
splud: it's got a tim & eric feel
<splud>
Had to do a LOT of work to work around it’s seeing inability to handle branches.
<Nilium>
Go and branches?
ki0 has joined #ruby
<epitron>
splud: are there syntactic sugar languages on top of go yet?
<Nilium>
There was one.
<Nilium>
It got shouted down into oblivion for being a stupid idea.
<epitron>
GoingGoingGone
<splud>
Go is a continuous build environment. Just because it builds something doesn’t mean it is deployed to the field.
<epitron>
Nilium: weird
AlexRussia has quit [Ping timeout: 264 seconds]
<Nilium>
I feel like splud is referring to a very different Go.
<epitron>
Go is definitely fast at building :)
<splud>
We use it to verify code commits and push code to devices for daily regression.
The_Phoenix has joined #ruby
<Nilium>
splud: Ok, seriously, what go are you referring to?
<Nilium>
The programming language?
<epitron>
continuous build environment: "while true; do go build; sleep 1; done"
<Nilium>
epitron: I use it with entr, but similar otherwise.
<Nilium>
Handy tool for rebuilding stuff only when the file has been changed rather than just doing it every second (though Go certainly makes that doable)
AlexRussia has joined #ruby
<splud>
go fires off our make scripts when the monitored repositories have changed.
<epitron>
Nilium: neat
<Nilium>
splud: Go, the programming language?
<Nilium>
Anyway, the only complaints I hear about Go are from people who want generics, usually. Admittedly not on my radar because I don't have much of a use for them.
<splud>
go, the continuous integration tool.
<epitron>
Nilium: sooo.. "ls *.blah | entr" means.. if you add a new .blah file, it won't see it?
<Nilium>
splud: Not the go we're referring to.
failshell has quit [Ping timeout: 272 seconds]
<Nilium>
epitron: It won't, so you do while sleep 1 ; do find . -iname '*.go' | entr -d go build root/... ; done
<epitron>
lol
<Nilium>
-d tells entr to die when the directory structure changes
bronson has joined #ruby
<epitron>
oic
<Nilium>
So then it loops back, finds all new files, and monitors those for changes
<epitron>
this is pretty ghetto
<epitron>
i like the concept
<epitron>
maybe if it took "find" arguments i'd like it more
<epitron>
entr -iname '*.blah' <command>
<Nilium>
Makes more sense to just pipe the results of find to entr.
<Nilium>
That way it keeps entr's use focused.
<epitron>
but the while loop!
<epitron>
-iname is just a single option
ponga has joined #ruby
CpuID2 has joined #ruby
CpuID2 has joined #ruby
<Nilium>
It is, but it's also an additional thing in the code that needs to be maintained, tested, etc.
<epitron>
wrapping things in while loops makes visually parsing your command annoying
<Nilium>
Why add it if something already does it?
<epitron>
and typing is annoying
krz has joined #ruby
leonshalimov has quit [Ping timeout: 264 seconds]
<Nilium>
You're going to be running it once when you start, who cares?
<epitron>
i can see that the maintainer experience is more important to you than the user experience :)
<Nilium>
You sound like the sort of person who writes a 20,000 line function that does everything..
lampd1 has joined #ruby
<epitron>
nope
<epitron>
i like simple things too
<epitron>
but usability is important
<Nilium>
Usability does not mean cramming all tools into one tool
Darryl___ has joined #ruby
<epitron>
it's one command
<epitron>
also
amclain has quit [Quit: Leaving]
astrobun_ has quit [Remote host closed the connection]
<epitron>
if you pipe in filenames, entr is already maintaining a list of files to watch
mkaesz has joined #ruby
<Nilium>
Yes, a list of files you explicitly specified.
<epitron>
being able to get them from STDIN or a GLOB function is hardly a big complexity increase
<Nilium>
No, that's a pretty big complexity increase.
<epitron>
what :)
<epitron>
i guess you do have to add a "watch for all added files" and match the glob against them
<Nilium>
You should appreciate exactly how much of a hellhole dealing with the filesystem is
<epitron>
hahah
<epitron>
inotify is more annoying than the FS
bronson has quit [Ping timeout: 264 seconds]
Channel6 has quit [Quit: Leaving]
<Nilium>
I don't envy anyone who has to deal with directories in C.
ponga has quit [Ping timeout: 256 seconds]
troubadour has quit [Quit: troubadour]
<epitron>
lol, entr is 500 lines of code
<epitron>
* Determine if the user is specifying FIFO mode by supplying a pathname
porfa has joined #ruby
<epitron>
* prefixed with '+' and set the global mode flag accordingly
<epitron>
i wonder if that's how you're supposed to do live updates
<epitron>
iterating lists of things in C is pretty ugly
<epitron>
that's a big source of complexity
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Nilium>
If you could get a list. Directory streams are unpleasant.
<Nilium>
Not awful, but unpleasant.
<epitron>
i'd probably write this in C++, so i can get lots of wrappers around this stuff
<epitron>
you're right -- this is some ugly code
<Nilium>
Well, the C++ stdlib has nothing for working with directories, so that's not much use.
<epitron>
i'm sure there's some C++ lib for it
<Nilium>
Boost. Probably other things.
<Nilium>
Boost is basically my nightmare, so I just stay away for as long as possible.
<splud>
I had some intel ones too. And some other brands. Still have a binload of them out in the barn in fact, not that I’m in a big rush to use 100mbit (tossed the 10bT ones long ago).
<splud>
I run gigabit everywhere now.
klmlfl has quit [Ping timeout: 265 seconds]
Megtastique has quit []
michael_mbp has quit [Excess Flood]
Aova has quit [Read error: Connection reset by peer]
thumpba has joined #ruby
michael_mbp has joined #ruby
cantonic has quit [Quit: cantonic]
dspangenberg has quit [Ping timeout: 264 seconds]
jobewan has quit [Ping timeout: 276 seconds]
apeiros_ has joined #ruby
ellisTAA has joined #ruby
<splud>
g’nite folks. 13 hours at work yesterday and 20 hours today.
<splud>
(not the norm, but I’ve got stuff that needs resolvin’)
TheNet has quit [Remote host closed the connection]
Aova has joined #ruby
astrobun_ has joined #ruby
TheNet has joined #ruby
siso has quit [Quit: siso]
ferr has quit [Ping timeout: 255 seconds]
tyfighter has quit [Quit: tyfighter]
ferr has joined #ruby
russt has joined #ruby
willgorman has quit [Remote host closed the connection]
btcxpert has joined #ruby
apeiros_ has quit [Remote host closed the connection]
tjohnson has quit [Quit: Connection closed for inactivity]
tyfighter has joined #ruby
apeiros_ has joined #ruby
yeticry has quit [Ping timeout: 246 seconds]
speaking1ode has joined #ruby
yeticry has joined #ruby
riotjones has quit [Quit: Leaving...]
apeiros_ has quit [Ping timeout: 276 seconds]
jobewan has joined #ruby
agrinb has quit [Remote host closed the connection]
spider-mario has quit [Remote host closed the connection]
yfeldblu_ has quit [Remote host closed the connection]
concertino has joined #ruby
<concertino>
If I do .each on some array, inside a method, and one of them returns something
yfeldblum has joined #ruby
<concertino>
will each continue to operate on the remaining elements?
bricker has joined #ruby
codeurge has joined #ruby
tagrudev has joined #ruby
josephndenton has quit [Ping timeout: 265 seconds]
MasterPiece has joined #ruby
surs has joined #ruby
codeurge has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
timanema has joined #ruby
hvxgr has quit [Ping timeout: 245 seconds]
Takle has joined #ruby
russt has quit [Quit: russt]
lukeholder has joined #ruby
GGMethos has joined #ruby
codeurge has joined #ruby
lukeholder has quit [Max SendQ exceeded]
lukeholder has joined #ruby
timanema has quit [Ping timeout: 256 seconds]
krz has quit [Read error: Connection reset by peer]
Takle has quit [Ping timeout: 265 seconds]
thumpba has quit [Remote host closed the connection]
ki0 has quit [Remote host closed the connection]
riotjones has joined #ruby
posixpascal has joined #ruby
thumpba has joined #ruby
Dude007 has joined #ruby
ellisTAA has left #ruby [#ruby]
dualbus has quit [Quit: WeeChat 1.1]
ferr has quit [Ping timeout: 252 seconds]
ohaibbq has joined #ruby
athan has quit [Quit: No Ping reply in 180 seconds.]
Dude007_ has joined #ruby
bronson has joined #ruby
<concertino>
sorry i'm just learning but, how can I use .select on an array and pass the block the index of each item as well as the item?
<apeiros__>
concertino: there's no single method. use tap + delete_at
TheNet has quit [Remote host closed the connection]
<apeiros__>
or use more than one statement
<apeiros__>
(I think I actually prefer the latter)
<concertino>
eh... that makes this a bit difficult
<concertino>
if I must i must
TheNet has joined #ruby
yellowgh0st has joined #ruby
<apeiros__>
I don't see how that can possibly make anything more difficult
<concertino>
I'm trying to find it
jonr22 has quit [Ping timeout: 244 seconds]
<concertino>
given an array and number i'm trying to return a NEW array containing all numbers that sum with another number in the original array to make n
agrinb has quit [Ping timeout: 272 seconds]
<sevenseacat>
i'd use more than one - not a huge fan of tap
<sevenseacat>
people tend to use it for silly things
<apeiros__>
indeed
<concertino>
I was going to do this: nums.select.with_index {|item, index| nums.without(index).include?(n - item)}
<apeiros__>
*MUST WRITE THIS IN ONE STATEMENT!!! OTHERWISE PROGRAMMING GODS WILL KILL KITTENS!!!***
<apeiros__>
concertino: what precisely is more difficult there with more than one statement?
TheNet has quit [Remote host closed the connection]
ferr has joined #ruby
yellowgh0st has quit [Client Quit]
<concertino>
Cope: if nums = [0, 2, 3, 4, 5, 6] and n = 6, then the returned array would look like [0, 2, 4, 6]
TheNet has joined #ruby
failshell has joined #ruby
<concertino>
0 is passed through since it can be summed with 6 to make n, 2 can be summed with 4, etc etc
<Cope>
aha ok
<Cope>
I've been doing this sort of thing in racket :)
<concertino>
apeiros__: Sorry i misspoke, the program isn't more difficult just felt that the line using "without" is mroe difficult
ohaibbq has quit [Quit: Leaving...]
<concertino>
more*
<apeiros__>
yeah, I don't see that being more difficult either :)
roolo has joined #ruby
pdoherty has joined #ruby
wallerdev has quit [Quit: wallerdev]
<mozzarella>
just use tap
leonshalimov has joined #ruby
<mozzarella>
also, you know that you don't need an index to delete an item from an array? you can delete something by value, which might remove more than one item
<concertino>
exactly why I chose not to use that, since I don't want to delete more than one item
SixiS has joined #ruby
failshell has quit [Ping timeout: 272 seconds]
nanoyak has joined #ruby
rbrs has joined #ruby
pdoherty has quit [Ping timeout: 245 seconds]
nanoyak has quit [Remote host closed the connection]
roolo has quit [Ping timeout: 264 seconds]
nanoyak has joined #ruby
yfeldblum has quit [Ping timeout: 244 seconds]
yellowgh0st has joined #ruby
leonshalimov has quit [Ping timeout: 264 seconds]
wallerdev has joined #ruby
Takle has joined #ruby
martin_work has joined #ruby
alkoma has joined #ruby
andikr has joined #ruby
siso has joined #ruby
<mozzarella>
tough life
<concertino>
ha
<concertino>
is it possible to exclude an element using keep_if?
<apeiros__>
concertino: gtg, but I'm somewhat certain this could be done in O(n) instead of O(n^2) as yours does
Takle has quit [Ping timeout: 246 seconds]
<concertino>
apeiros__: I'll consider that, ty
<mozzarella>
concertino: it would exclude all of them
ki0 has joined #ruby
<mozzarella>
not only the first one
<concertino>
keep_if where the condition is index != index_to_exclude
<concertino>
is along the lines I was thinking
patric100e99 has joined #ruby
<mozzarella>
why would you do that, though? that's just retarded
ki0 has quit [Read error: No route to host]
<mozzarella>
just use tap and be done with it
ki0 has joined #ruby
martin_work has quit [Quit: martin_work]
<concertino>
Not certain how to use tap. Let me read up then
quimrstorres has quit [Remote host closed the connection]
ponga has joined #ruby
<knut>
hello, I'm having trouble with a serial connection. I send a command to a microcontroller, which answers within 30ms, and with an oscilloscope I can confirm that, but on the serial port i can read the data just about 0.5s later. when I send, wait a bit, and read my methods work fast, but when i send and directly read my methods block 0.5s until the data can be read. I'm using the serialport gem on an Odroid U3. Maybe I could have for
<knut>
gotten to set a flag, or where can I start searching?
red_horned_rihno has quit [Quit: Leaving]
Spami has joined #ruby
roshanavand has joined #ruby
leafybasil has joined #ruby
btcxpert has joined #ruby
havenwood has quit [Remote host closed the connection]
ponga has quit [Ping timeout: 245 seconds]
Spami has quit [Client Quit]
Morkel has quit [Quit: Morkel]
ta_ has joined #ruby
MasterPiece has quit [Quit: Leaving]
kl has joined #ruby
troubadour has joined #ruby
leafybasil has quit [Ping timeout: 240 seconds]
Spami has joined #ruby
krz has quit [Read error: Connection reset by peer]
krz has joined #ruby
ta_ has quit [Ping timeout: 245 seconds]
psy_ has joined #ruby
jenrzzz has joined #ruby
kl has quit [Ping timeout: 272 seconds]
kl has joined #ruby
agrinb has joined #ruby
OrbitalKitten has joined #ruby
Mia has quit [Read error: Connection reset by peer]
Mia has joined #ruby
Mia has joined #ruby
thiagovsk has joined #ruby
banister has joined #ruby
leafybasil has joined #ruby
rodfersou has joined #ruby
last_staff has joined #ruby
agrinb has quit [Ping timeout: 272 seconds]
kl has quit [Quit: leaving]
quimrstorres has joined #ruby
Aova has quit [Read error: Connection reset by peer]
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
nuck has joined #ruby
deuti has quit [Quit: zzZZZzzz..]
Mon_Ouie has quit [Client Quit]
Aova has joined #ruby
timanema has joined #ruby
astrobun_ has quit [Remote host closed the connection]
astrobun_ has joined #ruby
ta_ has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
bronson has joined #ruby
sogard has joined #ruby
drawingthesun has joined #ruby
shredding has joined #ruby
AlexRussia has quit [Ping timeout: 264 seconds]
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drawingthesun has quit [Read error: Connection reset by peer]
timanema has quit [Ping timeout: 264 seconds]
AlexRussia has joined #ruby
drawingthesun has joined #ruby
astrobun_ has quit [Ping timeout: 252 seconds]
drawingthesun has quit [Read error: Connection reset by peer]
ta_ has quit [Ping timeout: 276 seconds]
jmdade has joined #ruby
bronson has quit [Ping timeout: 255 seconds]
chrishough has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pandaant has quit [Remote host closed the connection]
rocknrollmarc has joined #ruby
n008f4g_ has joined #ruby
timonv has joined #ruby
rocknrollmarc has quit [Remote host closed the connection]
iamninja has quit [Remote host closed the connection]
roshanavand has quit [Ping timeout: 240 seconds]
rocknrol_ has joined #ruby
ferr has quit [Ping timeout: 256 seconds]
timonv_ has joined #ruby
kalleth_ is now known as kalleth
rocknrollmarc has quit [Read error: Connection reset by peer]
ferr has joined #ruby
rocknrol_ has quit [Client Quit]
iamninja has joined #ruby
dspangenberg has joined #ruby
btcxpert has joined #ruby
Fusl has quit [Remote host closed the connection]
Fusl has joined #ruby
Pharaoh2_ has joined #ruby
dspangenberg has quit [Ping timeout: 252 seconds]
Pharaoh2 has quit [Ping timeout: 256 seconds]
ponga has joined #ruby
tokik has joined #ruby
ponga has quit [Ping timeout: 244 seconds]
colli5ion has quit []
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Kn|t3_ has joined #ruby
agrinb has joined #ruby
jonr22 has joined #ruby
commmmodo has quit [Quit: commmmodo]
agrinb_ has joined #ruby
Morkel has joined #ruby
agrinb has quit [Ping timeout: 272 seconds]
ta_ has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
krz has quit [Ping timeout: 245 seconds]
agrinb_ has quit [Ping timeout: 276 seconds]
jonr22 has quit [Ping timeout: 276 seconds]
sandelius has joined #ruby
nkparadox has joined #ruby
failshell has joined #ruby
krz has joined #ruby
Aova has quit [Read error: Connection reset by peer]
leonshalimov has joined #ruby
yeticry has quit [Remote host closed the connection]
ponga has joined #ruby
AFKGeek has quit [Quit: Fades into the shadows]
yeticry has joined #ruby
failshell has quit [Ping timeout: 265 seconds]
troubadour has joined #ruby
ta_ has quit [Ping timeout: 276 seconds]
sent1nel has joined #ruby
leonshalimov has quit [Ping timeout: 244 seconds]
Aova has joined #ruby
ponga has quit [Ping timeout: 240 seconds]
lxsameer has quit [Ping timeout: 264 seconds]
colli5ion has joined #ruby
AFKGeek has joined #ruby
sent1nel has quit [Ping timeout: 265 seconds]
btcxpert has quit [Quit: btcxpert]
jschoolcraft has quit [Quit: peace]
lxsameer has joined #ruby
yeticry has quit [Ping timeout: 256 seconds]
AlexRussia has quit [Ping timeout: 265 seconds]
MasterPiece has joined #ruby
YamakasY has joined #ruby
yeticry has joined #ruby
<sogard>
Book looks interesting.
<sogard>
I took a look over it and I'm thinking about getting one.
ponga has joined #ruby
roshanavand has joined #ruby
<sogard>
It's a tad expensive, though, especially since it doesn't offer so much for the people who are actually used to writing Ruby.
sandelius has quit [Remote host closed the connection]
codeurge has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<sogard>
A plus to it is the fact that it's up to date.
michael_mbp has quit [Excess Flood]
codeurge has joined #ruby
codeurge has quit [Client Quit]
FrankenDaemon has joined #ruby
seal has joined #ruby
valkyrka has quit [Ping timeout: 244 seconds]
michael_mbp has joined #ruby
blizzy has joined #ruby
ferr has quit [Ping timeout: 255 seconds]
<sogard>
I can't believe the Ruby IRC is so bored today.
AlexRussia has joined #ruby
<certainty>
believe it :)
hs366 has joined #ruby
pdoherty has joined #ruby
aagdbl has joined #ruby
yeticry has quit [Ping timeout: 255 seconds]
blizzy has quit [Ping timeout: 264 seconds]
yeticry has joined #ruby
codeurge has joined #ruby
ta_ has joined #ruby
shime has joined #ruby
pdoherty has quit [Ping timeout: 244 seconds]
<YamakasY>
hi guys, is there a way in the following example when group1 is like group.1 and group2 like group.2 that I replace the dot with a underscore in the same sort_by line ? http://pastie.org/9847304#14
plashchynski has joined #ruby
<YamakasY>
I try to avoid to do an extra gsub
timonv_ has quit [Quit: Leaving...]
Morkel has quit [Quit: Morkel]
ta_ has quit [Ping timeout: 240 seconds]
seal has quit [Quit: Ex-Chat]
Takle has quit [Remote host closed the connection]
ghormoon has joined #ruby
FooMunki_ has joined #ruby
troubadour has quit [Quit: troubadour]
ferr has joined #ruby
posixpascal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<YamakasY>
anyone ?
<sogard>
Why not use gsub?
<sogard>
Told you everyone is really bored today.
<YamakasY>
sogard: in the same line ?
<YamakasY>
sogard: oh I se now indeed
<sogard>
Maybe you can map it?
<YamakasY>
yes I looked into that, but I'm not sure
krz has quit [Quit: WeeChat 1.0.1]
<sogard>
You know how the map method works?
<YamakasY>
not 100%
<sogard>
Are you using irb?
joonty has joined #ruby
<YamakasY>
not that I know of
<sogard>
What OS are you on?
agrinb has joined #ruby
<YamakasY>
sogard: just linux, I use it in puppet
<YamakasY>
puppet templates
btcxpert has joined #ruby
codeurge has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<sogard>
Awesome.
<sogard>
irb is an interactive Ruby interpreter.
<sogard>
You can run it from your terminal.
<sogard>
It can help you a lot with these small issues.
<sogard>
Run irb in a terminal ans then input: ["group.1", "group.2"].map {|g| g.gsub /\./, "_"}
<YamakasY>
ah nice
<sogard>
and*
<YamakasY>
yes ok, but what I wonder is how to do it in the same line
Anarch has joined #ruby
<YamakasY>
now I would generate such map line under the sort_by, but I think it can be combined
<waxjar>
you shouldn't, because your sort will be wacky
Nameo0_ has joined #ruby
<YamakasY>
waxjar: ok, that is what I needed to know, so no performance issue either ?
agrinb has quit [Ping timeout: 272 seconds]
roshanavand has quit [Ping timeout: 272 seconds]
<waxjar>
you're sorting < 10 elements arrays. don't worry about performance :P
roshanavand has joined #ruby
Takle has joined #ruby
Nameo0 has quit [Ping timeout: 245 seconds]
Nameo0_ has quit [Ping timeout: 240 seconds]
<sogard>
You cannot combine the sorting with a map.
<sogard>
mapping*
<YamakasY>
okidoki :)
<YamakasY>
nice
patric100e99 has quit [Ping timeout: 246 seconds]
sandelius has joined #ruby
timonv has joined #ruby
sandelius has quit [Max SendQ exceeded]
sandelius has joined #ruby
iLike has joined #ruby
<sogard>
YamakasY: You can first do the map and then the sort: array.map {}.sort_by {}
learner has quit [Ping timeout: 252 seconds]
tkuchiki has quit [Remote host closed the connection]
roshanavand has quit [Ping timeout: 264 seconds]
learner has joined #ruby
bronson has joined #ruby
Aova has quit [Read error: Connection reset by peer]
MasterPiece has quit [Quit: Leaving]
Dude007 has quit [Read error: Connection reset by peer]
Dude007 has joined #ruby
<YamakasY>
sogard: yap
albert_ has joined #ruby
roshanavand has joined #ruby
bronson has quit [Ping timeout: 265 seconds]
Takle has quit [Remote host closed the connection]
sent1nel has joined #ruby
Aova has joined #ruby
dspangenberg has joined #ruby
ejnahc has quit [Remote host closed the connection]
ejnahc has joined #ruby
giuseppesolinas has quit [Quit: This computer has gone to sleep]
ta_ has joined #ruby
sent1nel has quit [Ping timeout: 265 seconds]
AlexRussia has quit [Ping timeout: 252 seconds]
kamilc__ has joined #ruby
dspangenberg has quit [Ping timeout: 256 seconds]
djbkd has joined #ruby
livathin_ has joined #ruby
oo_ has quit [Remote host closed the connection]
ta_ has quit [Ping timeout: 265 seconds]
nfk has joined #ruby
livathinos has quit [Ping timeout: 244 seconds]
troulouliou_dev has quit [Quit: Leaving]
sogard has quit [Quit: Page closed]
siso has quit [Quit: siso]
djbkd has quit [Ping timeout: 256 seconds]
blackmesa has quit [Ping timeout: 240 seconds]
shredding has quit [Quit: shredding]
yeticry has quit [Ping timeout: 244 seconds]
yeticry has joined #ruby
ta_ has joined #ruby
charliesome has joined #ruby
yeticry has quit [Ping timeout: 244 seconds]
georgesmith has quit [Quit: georgesmith]
yeticry has joined #ruby
metadave has joined #ruby
FooMunki_ has quit [Quit: FooMunki_]
AlexRussia has joined #ruby
FooMunki has joined #ruby
ta_ has quit [Ping timeout: 265 seconds]
vt102 has joined #ruby
FooMunki_ has joined #ruby
leonshalimov has joined #ruby
C1V0 has quit [Ping timeout: 240 seconds]
roshanavand has quit [Ping timeout: 272 seconds]
workmad3 has joined #ruby
cpt_yossarian has quit [Ping timeout: 252 seconds]
blackmesa has joined #ruby
georgesmith has joined #ruby
rafadc has joined #ruby
livathin_ has quit [Remote host closed the connection]
hamakn has quit [Remote host closed the connection]
agrinb has quit [Ping timeout: 265 seconds]
Kn|t3_ has quit [Quit: Kn|t3_]
yfeldblum has quit [Remote host closed the connection]
pika_pika has joined #ruby
jonr22 has quit [Ping timeout: 264 seconds]
charliesome has quit [Quit: zzz]
jottr has joined #ruby
failshell has joined #ruby
valkyrka has joined #ruby
atomical has joined #ruby
ta_ has joined #ruby
snakebridge has quit [Quit: leaving]
failshell has quit [Ping timeout: 265 seconds]
rafadc has quit [Remote host closed the connection]
gr33n7007h has quit [Remote host closed the connection]
az7ar_away has quit [Ping timeout: 272 seconds]
gr33n7007h has joined #ruby
L8 has joined #ruby
aclearman037 has joined #ruby
L8 has quit [Changing host]
L8 has joined #ruby
valkyrka has quit [Ping timeout: 256 seconds]
plashchynski has quit [Quit: plashchynski]
Kn|t3_ has joined #ruby
aclearman037 has quit [Client Quit]
timanema has joined #ruby
ta_ has quit [Ping timeout: 276 seconds]
mbeasley has joined #ruby
EvanFreeman has joined #ruby
<avril14th>
How can one do a string.gsub{ |match, index| } where index represents the offset in the string where the match occured?
sambao21 has joined #ruby
EvanFreeman has quit [Remote host closed the connection]
spyderman4g63 has joined #ruby
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
spyderma_ has joined #ruby
Aova has quit [Read error: Connection reset by peer]
dblessing has joined #ruby
AlSquire has joined #ruby
<avril14th>
or actually, get the post_match
Kn|t3_ has quit [Quit: Kn|t3_]
bddh has joined #ruby
roshanavand has quit [Ping timeout: 272 seconds]
YamakasY has quit [Quit: Page closed]
<avril14th>
got it, thx :)
plashchynski has joined #ruby
raphaelss has joined #ruby
spyderman4g63 has quit [Ping timeout: 255 seconds]
hmsimha has quit [Ping timeout: 252 seconds]
blackmesa has quit [Ping timeout: 276 seconds]
albert_ has quit [Read error: Connection reset by peer]
Takle has joined #ruby
beef-wellington has joined #ruby
timanema has quit [Ping timeout: 240 seconds]
troubadour has joined #ruby
bmn_ has quit [Ping timeout: 256 seconds]
joonty has quit [Quit: joonty]
Aova has joined #ruby
sent1nel has joined #ruby
oo_ has joined #ruby
dspangenberg has joined #ruby
roshanavand has joined #ruby
brb3 has joined #ruby
russt has joined #ruby
sent1nel has quit [Ping timeout: 252 seconds]
troubadour has quit [Quit: troubadour]
sankaber has joined #ruby
az7ar_away has joined #ruby
nkparadox has quit [Quit: WeeChat 1.1.1]
dspangenberg has quit [Ping timeout: 252 seconds]
Raven20 has joined #ruby
aclearman037 has joined #ruby
<Raven20>
When working with an API, I'm getting data passed to me as JSON and I'd like to actually get the object instead. I don't think parsing the object id from the json and doing ```Object.find json[:object_id]``` makes sense, right? Am I missing something obvious?
<ddv>
Raven20: to_json?
<apeiros_>
errr, an API will never contain a ruby object_id
<workmad3>
Raven20: if you're getting JSON, you need to parse it... if you want to load an object up from the db based on an ID in that json, that's what you want to do...
<apeiros_>
as that makes absolutely no sense whatsoever
<workmad3>
apeiros_: I assumed he meant something more like 'post_id' and badly generalized the term ;)
<Raven20>
aperos: i have two rails app, one acting as the API and the other client side
<apeiros_>
lets hope so
<apeiros_>
I'm not aperos. use tab completion if you can't spell.
<workmad3>
or even if you can, as it's still faster generally :)
<Raven20>
sorry
<workmad3>
Raven20: but yeah... I think the obvious bit you're missing is that you have a string of json and you need to parse that and load data based on its contents, and you for some reason don't think that makes sense
<workmad3>
Raven20: so I'm personally curious about what would make sense... ;)
<waxjar>
Raven20: what does "get the object" mean, what do you expect to happen?
kiddoboy has joined #ruby
banister has joined #ruby
<apeiros_>
ok, I guess 3 ppl are enough, gladly leaving this one to you folks :)
pdoherty has joined #ruby
<Raven20>
a previous version of the API wasn't passing json... instead, it was passing objects. I could do something like: @person = get "persons/index" and then just pass the persons around. Now I'm getting json, so I have to go through each one and do a Person.find #
<kiddoboy>
In methods we can do: def foo(bar=nil); return unless bar; "bar is: #{bar}"; end
<workmad3>
Raven20: how was it passing objects?
* apeiros_
suspects a confusion of internal & external API
<workmad3>
^^
claw_ has quit [Remote host closed the connection]
claw_ has joined #ruby
<kiddoboy>
How can we do the same thing with map?
Raven20 has quit [Quit: leaving]
nateberkopec has joined #ruby
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<kiddoboy>
(1..3).map { |e| return e if e < 2; 'bigger then 1' }
<kiddoboy>
What is the command I should replace return with?
<workmad3>
kiddoboy: sounds like you want select, not map
<kiddoboy>
I want map
<workmad3>
kiddoboy: so you want it to be either 'e' or 'bigger than 1' for all items?
<kiddoboy>
yes
<workmad3>
kiddoboy: ok... then 'e < 2 ? e : 'bigger than 1'
<kiddoboy>
It's just an example
<workmad3>
kiddoboy: no return
<kiddoboy>
But imagine that I have 7 lines of code there
Takle has quit [Remote host closed the connection]
<workmad3>
kiddoboy: return in that block will not do what you want
<kiddoboy>
How can I return from the second line for instance?
<waxjar>
with next
<kiddoboy>
How can I return the value to map
<apeiros_>
still with next :)
<workmad3>
waxjar: does 'next' have a return value for map?
<apeiros_>
next, break & return all take a value. without one given, they default to nil.
* workmad3
didn't know about that use-case for next
jimms has quit [Remote host closed the connection]
<certainty>
so go on with the next use-case
<apeiros_>
kiddoboy: note that next is considered spaghetti
tkuchiki has joined #ruby
<certainty>
hmm pasta
<workmad3>
I have stew tonight, not pasta
<waxjar>
probably better to get the code in the block to be smaller
Takle has joined #ruby
pushpak has joined #ruby
arup_r has quit [Remote host closed the connection]
fabrice31 has joined #ruby
jerematic has joined #ruby
<kiddoboy>
In this situation it is ok to use next
borel has joined #ruby
OrbitalKitten has joined #ruby
kp666 has quit [Quit: Leaving]
kaspertidemann has joined #ruby
kobain has joined #ruby
Azure has quit [Read error: Connection reset by peer]
kobain has quit [Max SendQ exceeded]
rafadc has joined #ruby
joonty has joined #ruby
Azure has joined #ruby
rafadc has quit [Read error: Connection reset by peer]
rafadc_ has joined #ruby
knut has quit [Ping timeout: 264 seconds]
tokik has quit [Ping timeout: 245 seconds]
lkba has joined #ruby
<kiddoboy>
It is the situation where you drop the ternary operator and just do: next a if condition; b instead of condition ? a : b when condition, a and b are bigger espressions
DarthGandalf has quit [Ping timeout: 264 seconds]
lxsameer has quit [Quit: Leaving]
kobain has joined #ruby
kobain has quit [Changing host]
kobain has joined #ruby
agrinb has joined #ruby
JohnBat26 has joined #ruby
<kiddoboy>
A best practice to drop if statements
kobain has quit [Max SendQ exceeded]
psy_ has quit [Ping timeout: 272 seconds]
pdoherty has quit [Remote host closed the connection]
arya_ching has joined #ruby
<waxjar>
returning early and if-else expressions are really the same thing though.
<waxjar>
there's still two paths your code can take
lzx has joined #ruby
<certainty>
still if-else is explicitly to do branching
<certainty>
+there
jerius has joined #ruby
lessless has joined #ruby
agrinb has quit [Ping timeout: 265 seconds]
<certainty>
i'm unsure about their equivalence, though they achieve the same effect
L8 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<workmad3>
kiddoboy: also, you've not removed the if statement there... you're just using a suffix version
troubadour has quit [Client Quit]
<certainty>
which i only ever use if the expression before is short
phoo1234567 has quit [Max SendQ exceeded]
<certainty>
but that's a different thing
mkaesz has joined #ruby
phoo1234567 has joined #ruby
quimrstorres has quit [Remote host closed the connection]
anarang has quit [Ping timeout: 244 seconds]
<apeiros_>
refactor big expressions to methods. use ternary with those.
patric100e99 has quit [Ping timeout: 255 seconds]
L8 has joined #ruby
yfeldblum has joined #ruby
btcxpert has quit [Quit: btcxpert]
dstarh has joined #ruby
tier has joined #ruby
anarang_ has quit [Ping timeout: 244 seconds]
<certainty>
the ternary appears to be problematic to me as well. even with short branches and condition. Very often the condition is a predicate ending an a ? which seems to clash with the ? from the ternary
paulfm has joined #ruby
<certainty>
may only be a matter of taste though
lzx has quit []
leonshalimov has joined #ruby
arup_r has joined #ruby
Dude007_ has joined #ruby
Dude007 has quit [Read error: Connection reset by peer]
plashchynski has joined #ruby
fryguy9 has joined #ruby
bronson has joined #ruby
<workmad3>
certainty: yeah, I'm not too fond of that either... but I prefer that to a multi-line conditional in a block to replace it, or an inline 'if <condition> then <method1> else <method2> end'
yfeldblum has quit [Ping timeout: 252 seconds]
Parker0 has joined #ruby
_5kg has quit [Ping timeout: 255 seconds]
Parker0 has quit [Client Quit]
<apeiros_>
meh
<apeiros_>
I have no issue with `condition? ? foo : bar`
_5kg has joined #ruby
ychaker has joined #ruby
<apeiros_>
but as workmad3 said - if your company styleguide says that this is a no-no, just replace it with `if condition? then foo else bar end`
ychaker is now known as Guest43311
<workmad3>
apeiros_: the double-? is a slight ugliness, IMO... but not enough to really warrent more than a minor bitch here when certainty brings it up :)
JDiPierro has joined #ruby
AlexRussia has quit [Ping timeout: 276 seconds]
quimrstorres has joined #ruby
bal has joined #ruby
go|dfish has quit [Quit: SIGQUIT]
leonshalimov has quit [Ping timeout: 245 seconds]
tjohnson has joined #ruby
mwlang has joined #ruby
knut has joined #ruby
* certainty
nods
bronson has quit [Ping timeout: 264 seconds]
Guest482 has quit [Changing host]
Guest482 has joined #ruby
Guest482 is now known as daynaskully
<ddv>
the ugliness is in your head, workmad3
<certainty>
and in mine
juanpablo_ has joined #ruby
jimms has joined #ruby
Guest43311 is now known as help
Darryl___ has joined #ruby
<workmad3>
ddv: that can be said of any ugliness or beauty
help is now known as Guest94296
<workmad3>
ddv: but I'm not in the mood for that sort of philosophical discussion today :P
<mwlang>
I usually use Array(some_variable) to guarantee I have an array. For example => Array(“hello”) => [“hello”]; Array([“hello”, “world”]) => [“hello”, “world”]. However, to my surprise (and first time I’m doing this with hashes => Array({:hello => :world}) => [[:hello, :world]] instead of [{:hello => :world}]
<mwlang>
So, what’s the easiest way to ensure an array of hashes?
lukeholder has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nfk has quit [Quit: yawn]
mitchellhenke has joined #ruby
jmcharnes has joined #ruby
<apeiros_>
Array(var) IMO means you failed to normalize in the right place
<mwlang>
I’m feeding into a #map block and the usage pattern I typically use is Array(some_variable).map{|m| do_something(m)}
_ixti_ is now known as ixti
<apeiros_>
yes. why is it possible that some_variable is not an Enumerable?
lukeholder has joined #ruby
AlexRussia has joined #ruby
anarang_ has joined #ruby
AlexRussia has quit [Changing host]
AlexRussia has joined #ruby
<mwlang>
apeiros: in this case, I’m parsing an XML document. Sometimes I get just one section, in which case its just a hash…other times, the section is repeated and I get an Array.
lukeholder has quit [Read error: Connection reset by peer]
dorei has joined #ruby
aswen has quit [Ping timeout: 245 seconds]
lukeholder has joined #ruby
<apeiros_>
and why does your parser not translate those cases to the same structure? (that's what normalization means)
it0a has joined #ruby
<apeiros_>
it makes even less sense. parser has to branch on whether to return array or not, all consumers of the parsers have to branch again depending on whether they got an array or not
hiyosi has joined #ruby
<apeiros_>
just remove both branchings.
Aova has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
<mwlang>
apeiros_ no idea why the author did it that way. Its actually the nori gem, FWIW, which parses XML docs into hashes.
tier has quit [Read error: Connection reset by peer]
<mwlang>
(inherited this project, too)
lukeholder has quit [Max SendQ exceeded]
<apeiros_>
ok. so you're working around the mess others created. well then.
tier has joined #ruby
<apeiros_>
good luck :)
<mwlang>
apeiros_: aren’t we all? :-o
<Nilium>
It's always the mess others created (╯°□°)╯︵ ┻━┻
<Nilium>
Especially the node.js users, who have done nothing but messes (ノಠ益ಠ)ノ彡┻━┻
lukeholder has joined #ruby
<apeiros_>
Nilium: IME often "others" means "my old self" :-p
<mwlang>
I’m basically attempting to normalize efficiently within my scope of work.
<Nilium>
apeiros_: I have that too, but at work, I haven't been there long enough for it to be my old self
<apeiros_>
and I've seen shitty unnecessary array normalization all over the place in all kinds of code.
failshell has joined #ruby
tier has quit [Read error: Connection reset by peer]
tier has joined #ruby
<apeiros_>
most common case: `def foo(arg); Array(arg).whatever…`. proper solution: `def foo(*args); args.whatever`. let the caller normalize.
lukeholder has quit [Max SendQ exceeded]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
triple_b has joined #ruby
djbkd has quit [Ping timeout: 245 seconds]
lukeholder has joined #ruby
az7ar_away has quit [Ping timeout: 245 seconds]
psy_ has joined #ruby
Aova has joined #ruby
<mwlang>
I prefer Array(items).map{|item| do_something(item)} to this: items.is_a?(Array) ? items.map{|item do_something(item)} : do_something(items)
tier has quit [Read error: Connection reset by peer]
az7ar_away has joined #ruby
jherbst has joined #ruby
tier has joined #ruby
<workmad3>
mwlang: apeiros_'s point is that it should just be 'items.map{|item| do_something(item)}' and the caller is responsible for making sure it passes an array
<mwlang>
workmad3: Ah, yes, I totally agree there.
jherbst has quit [Client Quit]
bal has quit [Quit: bal]
ursooperduper has joined #ruby
lukeholder has quit [Max SendQ exceeded]
<mwlang>
mostly, I was just surprised by the behavior of Array() on a Hash object.
failshell has quit [Ping timeout: 272 seconds]
bal has joined #ruby
lukeholder has joined #ruby
<workmad3>
mwlang: it's the result of Hash#to_a
Xeago has joined #ruby
zenith_ has joined #ruby
metrix has joined #ruby
<workmad3>
mwlang: it seems weirdly reasonable for Array(arg) to call arg.to_a if it's present :)
tier has quit [Read error: Connection reset by peer]
arup_r has quit [Remote host closed the connection]
tier has joined #ruby
<metrix>
I would like to run a block for every element in two hashes. Hash.merge only runs a block on the hashes that are duplicates... Any suggestions?
whoisjake has joined #ruby
<metrix>
err.. Hash.merge only runs a block on the KEYS that are duplicates
jottr has quit [Quit: WeeChat 1.1]
<apeiros_>
we still don't have Enumerator#+, aight?
mitchellhenke has quit [Quit: Computer has gone to sleep.]
<apeiros_>
metrix: "errr" again? because I think you mean: runs the block only *once* on duplicate keys
Channel6 has joined #ruby
<apeiros_>
(it does run on all keys)
<apeiros_>
ah, or did you pass the block directly to merge, not to a chained .each?
bal1 has joined #ruby
<metrix>
Directly to merge
shime has quit [Read error: Connection reset by peer]
rdark has quit [Ping timeout: 265 seconds]
shime has joined #ruby
mbeasley has quit [Read error: Connection reset by peer]
towncrierr has quit [Remote host closed the connection]
fabrice31 has joined #ruby
mbeasley has joined #ruby
towncrierr has joined #ruby
tier has quit [Remote host closed the connection]
<jlebrech>
apeiros_: i was just wondering why there weren't more visual code editors that let you select a method to edit rather than whole files. say for a touch screen
mkaesz has quit [Remote host closed the connection]
mkaesz has joined #ruby
athan has joined #ruby
fabrice31 has quit [Ping timeout: 276 seconds]
CustosL1men has joined #ruby
* hanmac1
does hide classes as constants in singleton classes of objects ;P
freerobby has joined #ruby
<workmad3>
GreatSUN: hmm... your code there actually seems to work fine for me without jumping through hoops
Aova has quit [Read error: Connection reset by peer]
Megtastique has joined #ruby
<workmad3>
GreatSUN: with one modification... 'include Module1' inside Module2
Ankhers has joined #ruby
dspangenberg has quit [Ping timeout: 246 seconds]
<GreatSUN>
workmad3: also good solution
<GreatSUN>
thanks a lot :-)
rafadc has quit []
shime has quit [Read error: Connection reset by peer]
shime has joined #ruby
<workmad3>
GreatSUN: not that I know what use-case you're really dealing with there, tbh
<GreatSUN>
workmad3: updated gist right away with the second solution
antgel has quit [Ping timeout: 256 seconds]
dspangenberg has joined #ruby
<GreatSUN>
workmad3: just trying to figure out what would be the best solution to get this working hence we want to have smaller modules and though want to divide modules into multiple ones
<workmad3>
GreatSUN: yeah... just trying to figure out why you're splitting up actions around a class variable across multiple modules
antgel has joined #ruby
aagdbl has quit [Quit: This computer has gone to sleep]
<workmad3>
GreatSUN: and why Module1 doesn't provide class and instance level readers for the var... and why you're using a class variable rather than a module-ivar... etc :)
MaciejCzyzewski has joined #ruby
<MaciejCzyzewski>
Hi folks!
<GreatSUN>
workmad3: if you have modules counting more than 900 lines of code, you should start splitting
<workmad3>
GreatSUN: agreed... but where you split is an important consideration ;)
Aova has joined #ruby
<workmad3>
GreatSUN: and I'm not sure I'd agree that splitting the management of a class-variable is good
<GreatSUN>
workmad3: the point is that they are all just connected to one topic, so we have basic things that nearly all methods share with each other
<GreatSUN>
and other things that are not shared
<workmad3>
GreatSUN: ok... so why not have a basic interface to access defined in that one module and then rely on the interface, rather than accessing the storage directly?
<workmad3>
GreatSUN: i.e. create class and instance level readers for the class-var ;)
skj3gg has joined #ruby
<banister>
workmad3 where do you put modules that you mix into your models/controllers?
Pupeno has joined #ruby
<workmad3>
banister: frequently in lib/
<GreatSUN>
workmad3: yeah, I was thinking about that already and just wanted to see the other ways how things might work out to be able to decide for the best way
<banister>
workmad3 isn't lib/ just a junk drawer for putting things where you don't know where to put them...? :) I thought the new standard was models/concerns/ or controllers/concerns/ depending on if it's for models or controllers
<GreatSUN>
but in general I think, you are right
<GreatSUN>
the base module would be the best solution
<workmad3>
banister: depends on if you bring structure to lib/ or not :P
<banister>
workmad3 you don't like models/concerns/ ?
tus has joined #ruby
<workmad3>
banister: not particularly
noop has quit [Ping timeout: 272 seconds]
tagrudev has quit [Remote host closed the connection]
towncrierr has quit [Remote host closed the connection]
<waxjar>
anything "reusable" goes into /lib :p
shazaum has joined #ruby
craigp has quit [Ping timeout: 265 seconds]
mbeasley has quit [Quit: WeeChat 0.4.2]
Uranio has joined #ruby
LouisRoR has joined #ruby
bddh` has joined #ruby
bddh has quit [Read error: Connection reset by peer]
skj3gg has quit [Quit: ZZZzzz…]
sandelius has joined #ruby
<banister>
waxjar aren't all objects reusable?
<workmad3>
banister: some are more re-usable than others :P
knut has quit [Ping timeout: 252 seconds]
<workmad3>
you should know that ;)
<banister>
workmad3 seems like a pretty vague test for what should go in lib/ :)
<avril14th>
I don't understand MatchData#begin, is that the offset in the original string?
fabrice31_ has quit [Remote host closed the connection]
<workmad3>
banister: yeah... but it's about as vague as what should go under a concerns/ folder... and what about stuff like extensions to AR::Base that add in new class-macros... or something that spans controllers and models with utility methods... or a whole host of other things that are useful but don't fit under the term 'concern'? ;)
fabrice31 has joined #ruby
nateberkopec has quit [Quit: Leaving...]
towncrierr has joined #ruby
momomomomo has joined #ruby
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby
skj3gg has joined #ruby
nateberkopec has joined #ruby
sent1nel has quit [Remote host closed the connection]
Aova has quit [Ping timeout: 245 seconds]
<waxjar>
"potentially" reusable in two or more apps? idk, really :p
<chinmay_dd>
How do you capture CTRL + D in Ruby? Suppose my program is waiting for input and on CTRL + D I want it to exit smoothly without giving any traces. I am able to capture CTRL + C using 'rescue Interrupt' but can't seem to do the same for CTRL + D. Thanks!
kbp has joined #ruby
Matadoer has quit [Ping timeout: 245 seconds]
Matadoer has joined #ruby
cantonic has joined #ruby
djbkd has joined #ruby
Matadoer has quit [Max SendQ exceeded]
dfinninger has joined #ruby
Matadoer has joined #ruby
plashchynski has joined #ruby
fabrice31_ has quit [Remote host closed the connection]
momomomomo has joined #ruby
cantonic has quit [Read error: Connection reset by peer]
fabrice31 has joined #ruby
lampd1 has quit [Remote host closed the connection]
Pharaoh2_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
MaciejCzyzewski has joined #ruby
<DefV_>
chinmay_dd: ctrl-d is end-of-file
cantonic has joined #ruby
sent1nel has joined #ruby
Pharaoh2 has joined #ruby
kostitas has joined #ruby
<DefV_>
or SIGQUIT
<DefV_>
depends
<chinmay_dd>
DefV_:
fabrice31_ has joined #ruby
<DefV_>
you can capture that whit Signal.trap
fabrice31 has quit [Read error: Connection reset by peer]
<oddover>
actually, I would accept the other version in that new one as well
go|dfish has joined #ruby
paulfm has quit [Remote host closed the connection]
<odigity>
Is the stdlib compiled directly into the ruby binary in the debian/ubuntu package? I just did dpkg -L ruby1.9.1, and the list of files is less than a page long. Just docs and binaries.
paulfm has joined #ruby
joonty has quit [Quit: joonty]
multi_io has joined #ruby
spookplumpen has joined #ruby
fryguy91 has joined #ruby
wallerdev has joined #ruby
fgo has joined #ruby
andikr has quit [Remote host closed the connection]
Ankhers` has joined #ruby
Hijiri has quit [Quit: aaa]
enebo has joined #ruby
Ankhers has quit [Ping timeout: 250 seconds]
fryguy9 has quit [Ping timeout: 276 seconds]
gheegh has joined #ruby
nanoyak has quit [Quit: Computer has gone to sleep.]
nfk has joined #ruby
multi_io_ has quit [Ping timeout: 256 seconds]
Lexun has quit [Remote host closed the connection]
sent1nel has joined #ruby
Spami has quit [Quit: Leaving]
athan has quit [Ping timeout: 245 seconds]
deol has joined #ruby
<odigity>
found it
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
asmodlol has joined #ruby
werelivinginthef has joined #ruby
The_Phoenix1 has joined #ruby
joonty has joined #ruby
Kn|t3_ has quit [Quit: Kn|t3_]
The_Phoenix has quit [Ping timeout: 252 seconds]
ta_ has joined #ruby
shime has quit [Read error: Connection reset by peer]
shime has joined #ruby
bronson has joined #ruby
fgo has quit [Ping timeout: 255 seconds]
chrishough has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
MaciejCzyzewski has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
joonty has quit [Quit: joonty]
Spami has joined #ruby
gsd has joined #ruby
ta_ has quit [Ping timeout: 265 seconds]
btcxpert has quit [Quit: btcxpert]
ta_ has joined #ruby
shredding has quit [Quit: shredding]
leonshalimov has joined #ruby
Lexun has joined #ruby
bronson has quit [Ping timeout: 256 seconds]
chrishough has joined #ruby
marcoamo1 has joined #ruby
bricker has joined #ruby
spyderman4g63 has joined #ruby
Aova has quit [Read error: Connection reset by peer]
marcoamorales has quit [Ping timeout: 245 seconds]
ta_ has quit [Ping timeout: 246 seconds]
arup_r has joined #ruby
tier has quit [Remote host closed the connection]
parametaortho has quit [Quit: zzzZZZzzzzZZZzzzzZZZZzzzZZZzz]
Lexun has quit [Remote host closed the connection]
randiman has joined #ruby
tyfighter has joined #ruby
Aova has joined #ruby
jottr has quit [Ping timeout: 264 seconds]
Lexun has joined #ruby
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
triple_b has joined #ruby
martinium has joined #ruby
martinium has joined #ruby
mikecmpbll has quit [Quit: ciao.]
tylersmith has quit [Remote host closed the connection]
Morkel has quit [Quit: Morkel]
brb3 has quit [Quit: ZZZzzz…]
Megtastique has joined #ruby
martinium has quit [Remote host closed the connection]
momomomomo has joined #ruby
JDiPierro has quit [Remote host closed the connection]
swgillespie has joined #ruby
tkuchiki has quit [Ping timeout: 264 seconds]
swgillespie has quit [Client Quit]
Lexun has quit [Remote host closed the connection]
<knut>
hello, I'm having trouble with a serial connection. I send a command to a microcontroller, which answers within 30ms, and with an oscilloscope I can confirm that, but on the serial port i can read the data just about 0.5s later. when I send, wait a bit, and read my methods work fast, but when i send and directly read my methods block 0.5s until the data can be read. I'm using the serialport gem on an Odroid U3. Maybe I could have for
<knut>
gotten to set a flag, or where can I start searching?
sent1nel has quit [Remote host closed the connection]
<knut>
After SerialPort#write SerialPort#readpartial blocks for about 0.5s until data arrives.
centrx has joined #ruby
martin_work has joined #ruby
randiman has quit [Remote host closed the connection]
Lexun has joined #ruby
randiman has joined #ruby
jimms has joined #ruby
Takle has quit [Remote host closed the connection]
lodgenbd has quit [Quit: Leaving]
sent1nel has joined #ruby
aswen has joined #ruby
<mwlang>
knut you may need to user a profiler to track that one down.
pdoherty has quit [Remote host closed the connection]
<adnauseaum>
i like codecademy
antgel has quit [Ping timeout: 245 seconds]
<adnauseaum>
i forgot they had a ruby lesson
<adnauseaum>
i did python on there
<godd2>
Python and Ruby are similar
wald0 has joined #ruby
fgo has joined #ruby
lolmaus has joined #ruby
kostitas has quit [Quit: Leaving]
oo_ has joined #ruby
skj3gg has joined #ruby
olivier_bK has quit [Ping timeout: 240 seconds]
Takle has quit [Remote host closed the connection]
goodenough has joined #ruby
<havenwood>
godd2: It's not just a refactor if you fix a bug. Sometimes code relies on bugs to work. You can refactor your bugs but fixing them is a bug-fix.
roolo has quit [Ping timeout: 264 seconds]
kaspertidemann has joined #ruby
<adnauseaum>
is rails easier to use than django? because i couldn't figure out django to save my life
<godd2>
havenwood so would you say that a bug is part of "external behavior" and that fixing a bug is disqualified from being a refactoring for that reason?
leafybasil has quit [Remote host closed the connection]
martin_work has joined #ruby
<ddv>
adnauseaum, django is always trying to be like rails but fails horribly
<godd2>
adnauseaum a framework is usually easy if you're familiar with the underlying language. That said, Rails is probably easier to learn
pontiki_ has joined #ruby
hiyosi has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood>
godd2: Yeah, assuming the bug is behavior, changing it means it's not just a refactor since refactoring preserves behavior.
pontiki has quit [Read error: Connection reset by peer]
<godd2>
ddv but "behavior" is defined in a way to mean external to the code you're modifying
<ddv>
ah okay
Takle has joined #ruby
<godd2>
so like if you have a square root function, then "behavior" would be the mapping of any input to some output, and if you change the internals without changing what the function spits out, you've refactored
<havenwood>
behavior in the Behavior Driven Development sense
<ddv>
yep
<adnauseaum>
ruby would be recommended more for web applications that something like python right?
skj3gg has quit [Quit: ZZZzzz…]
<havenwood>
adnauseaum: In #ruby, yes.
pontiki_ is now known as pontiki
<adnauseaum>
haha
ptrrr has quit [Quit: ptrrr]
<adnauseaum>
well in general
<godd2>
adnauseaum Ruby is used for lots of things, not just web apps
asmodlol has joined #ruby
<adnauseaum>
web apps are my goal
<godd2>
as for choosing ruby over python, that's not a decision someone can make for you
<adnauseaum>
and i can't figure out django to save my life
<havenwood>
adnauseaum: What are you trying to make?
<godd2>
Twitter 7.0
Takle has quit [Remote host closed the connection]
<ddv>
adnauseaum, django has good docs..
<adnauseaum>
i'm a web designer with html/css knowledge and i want to expand into web development
skj3gg has joined #ruby
franzip has joined #ruby
Aova has quit [Read error: Connection reset by peer]
<godd2>
adnauseaum I have a feeling that your trouble learning Django will be similar to trouble you have learning Rails, and that your intuition is correct that you should step back and become reasonably familiar with a language before learning a framework in it
<havenwood>
adnauseaum: But yeah, Ruby has a bunch of great stuff for the web. Learn Ruby, it's lovely.
<godd2>
(even a year or two's worth of study)
<ddv>
adnauseaum, you're doing it all backwards
franzip has quit [Max SendQ exceeded]
GreatSUN has quit [Ping timeout: 246 seconds]
Timgauthier is now known as timgauthier_away
<adnauseaum>
?
timgauthier_away has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kenneth has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Sakens has joined #ruby
<havenwood>
adnauseaum: Learn Ruby then make beautiful apps with Volt. Go forth and code!
plashchynski has joined #ruby
<knut>
havenwood: i've tried to use IO#read_nonblock with IO#select instead of IO#readpartial, but turns out to be the same
<godd2>
adnauseaum make learning Ruby a priority, and Rails will come with it
djbkd has joined #ruby
<adnauseaum>
i did that with python and django doesnt make any sense
<havenwood>
godd2: Or you'll learn that what you're doing isn't similar enough to Basecamp for Rails to make sense. Spare yourself the rails!
<havenwood>
Or it's perfect, either way.
<havenwood>
Depends on what you're doing I think.
18VAB3FYB has quit [Quit: Be back later ...]
<workmad3>
havenwood: sames true with any framework... if what you're doing hits its sweet-spot, it's awesome
<workmad3>
if it doesn't, you'll feel like you're pulling teeth
<workmad3>
if you're really good with a framework, you can make pretty much any problem seem to fit it though...
ta_ has quit [Ping timeout: 265 seconds]
franzip has joined #ruby
<godd2>
adnauseaum learn ruby until you feel like rails isn't doing black magic. then you will be ready
<havenwood>
workmad3: The moment of "Oh gosh, someone's already solved ALL THE PROBLEMS! \o/" is nice.
<workmad3>
especially if you're only good with the framework and nothing outside of it...
dumdedum has quit [Quit: foo]
maximski has quit []
Takle has joined #ruby
* workmad3
still gets people looking askance at him when they say "I want to make a real-time chat app" in #rubyonrails and I say 'Use meteor'
Aova has joined #ruby
jonr22 has joined #ruby
posixpascal has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<knut>
the problem is not writing or reading from buffer, because when there is data it is super fast.. but for the data to reach the buffer it takes quiet some time
skj3gg has quit [Quit: ZZZzzz…]
<knut>
even so on the oscilloscope all the communication is done within 50ms
skj3gg has joined #ruby
jonr22 has quit [Ping timeout: 272 seconds]
EvanFree_ has quit [Remote host closed the connection]
Pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
agjacome has quit [Ping timeout: 255 seconds]
bthesorceror has quit [Client Quit]
Takle has quit [Remote host closed the connection]
codeurge has quit [Client Quit]
kenneth has quit [Client Quit]
Takle has joined #ruby
pdoherty has joined #ruby
failshell has quit []
codeurge has joined #ruby
codeurge has quit [Client Quit]
codeurge has joined #ruby
tylersmith has joined #ruby
max96at|off is now known as max96at
kaspertidemann has quit []
brb3 has joined #ruby
_honning_ has joined #ruby
chrishough has joined #ruby
reset has joined #ruby
kenneth has joined #ruby
codeurge has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Takle has quit [Remote host closed the connection]
centrx has quit [Quit: Science is organized knowledge, wisdom is organized life.]
freerobby has joined #ruby
gr33n7007h has quit [Remote host closed the connection]
Pharaoh2 has joined #ruby
gr33n7007h has joined #ruby
<avril14th>
what would be the regex to match the last two words of a string?
fryguy91 has quit [Quit: Leaving.]
<wallerdev>
looks like it's just one of those scripts that crawls the net and tries to submit common exploits
pu22l3r has joined #ruby
<wallerdev>
doesnt look like an issue with your site at all
withnale_ has quit [Ping timeout: 244 seconds]
n008f4g_ has joined #ruby
chipotle has quit [Quit: cheerio]
ta_ has quit [Ping timeout: 276 seconds]
blackmes1 has joined #ruby
<wallerdev>
/(\w+)\s+(\w+)$/
<wallerdev>
depends on the kind of strings you have though
<wallerdev>
like if you're using foreign letters or punctuation things get a bit more complicated
<avril14th>
thx wallerdev
<arup_r>
wallerdev: Can I pm you ?
<wallerdev>
if you want
<wallerdev>
haha
Soda has joined #ruby
quimrstorres has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 272 seconds]
gr33n7007h has quit [Remote host closed the connection]
giuseppesolinas has quit [Quit: This computer has gone to sleep]
gr33n7007h has joined #ruby
djbkd has joined #ruby
giuseppesolinas has joined #ruby
ta_ has joined #ruby
giuseppesolinas has left #ruby [#ruby]
m8 has joined #ruby
cantonic has quit [Quit: cantonic]
whoisjake has quit [Remote host closed the connection]
fgo has joined #ruby
gsd has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
quimrstorres has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 264 seconds]
jmcharnes has joined #ruby
blackmes1 has quit [Ping timeout: 240 seconds]
fgo has quit [Ping timeout: 264 seconds]
dfinninger has quit [Remote host closed the connection]
chipotle has joined #ruby
dfinninger has joined #ruby
momomomomo has joined #ruby
reinaldob has joined #ruby
Aova has quit [Read error: Connection reset by peer]
duncannz has joined #ruby
skj3gg has joined #ruby
einarj has joined #ruby
cjim has joined #ruby
ta_ has quit [Ping timeout: 272 seconds]
bthesorceror has joined #ruby
skj3gg has quit [Client Quit]
beef-wellington has quit [Ping timeout: 252 seconds]
nanoyak has quit [Quit: Computer has gone to sleep.]
Megtastique has quit []
rvchangue has joined #ruby
workmad3 has quit [Ping timeout: 244 seconds]
gr33n7007h has quit [Remote host closed the connection]
gr33n7007h has joined #ruby
zB0hs has joined #ruby
reinaldob has quit [Ping timeout: 246 seconds]
tier_ has joined #ruby
_honning_ has quit [Ping timeout: 244 seconds]
einarj has quit [Ping timeout: 246 seconds]
brb3 has quit [Quit: ZZZzzz…]
Shidash has quit [Remote host closed the connection]
tier has quit [Ping timeout: 265 seconds]
Aova has joined #ruby
rsavage has joined #ruby
<rsavage>
quick question
<rsavage>
can you have multiple elsif 's? in an if statement?
<wallerdev>
yup
<rsavage>
ok thanks
antgel has joined #ruby
mbeasley has quit [Ping timeout: 246 seconds]
x77686d has quit [Quit: x77686d]
tier has joined #ruby
Megtastique has joined #ruby
yfeldblum has joined #ruby
freerobby has quit [Quit: Leaving.]
kstuart_ has quit [Ping timeout: 265 seconds]
tier_ has quit [Ping timeout: 256 seconds]
kstuart_ has joined #ruby
skj3gg has joined #ruby
kobain has quit [Ping timeout: 255 seconds]
brb3 has joined #ruby
m8 has quit [Quit: Sto andando via]
m8 has joined #ruby
chrishough has quit [Ping timeout: 246 seconds]
plashchynski has quit [Quit: plashchynski]
chrishough has joined #ruby
nanoyak has joined #ruby
yfeldblum has quit [Ping timeout: 252 seconds]
plashchynski has joined #ruby
triple_b_ has joined #ruby
ferr has quit [Remote host closed the connection]
beef-wellington has joined #ruby
nb_bez___ has quit [Quit: Connection closed for inactivity]
triple_b has quit [Ping timeout: 264 seconds]
<ellisTAA>
i have to search a hash for a non-identical given value( e.g. i’m given “fi” and if something like “fight” is in the hash i should return the key and value), so in order to do this i’m trying to convert hash to a string so that i can search it for a regex. this is the best way that i can think of. any thoughts on this? am i wrong, right?
<apeiros_>
ellisTAA: use Enumerable#find
<ellisTAA>
so hash.find?
<apeiros_>
yes
craigp has quit [Remote host closed the connection]
<apeiros_>
>> {key: "fight"}.find { |k,v| v =~ /\Afi/ }
Pharaoh2 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
kobain has quit [Max SendQ exceeded]
<ellisTAA>
apeiros_: thanks, that worked
kobain has joined #ruby
go|dfish has joined #ruby
wald0_ has joined #ruby
jespada has quit [Quit: Leaving]
<apeiros_>
yw
Pharaoh2 has joined #ruby
davedev24_ has quit [Ping timeout: 264 seconds]
<ddv>
apeiros_: what editor do you use?
<apeiros_>
sublime
<ddv>
ah ok
bronson has joined #ruby
gsd has joined #ruby
freerobby has joined #ruby
fabrice31 has quit [Ping timeout: 244 seconds]
tyfighter has quit [Quit: tyfighter]
<electrical>
Hi all. the to_yaml function seems to have changed between ruby 2.0 and 2.1 causing a weird issue.. where it initially generated ":datadir: /var/lib/hiera\n" it does now ":datadir: \"/var/lib/hiera\"\n" for a part of the yaml string. Any idea's how i can solve / change it?
davedev24_ has joined #ruby
danjordan has joined #ruby
Pupeno has joined #ruby
Pupeno has joined #ruby
triple_b_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros_>
electrical: way. too. vague.
bthesorceror has quit [Quit: bthesorceror]
<ellisTAA>
i have a method find that takes an argument (something) and i have some code that searches a hash for the argument (something) using a regex … but for some reason the regex doesn’t regard the argument (something) an argument but a string …. why?
craigp has joined #ruby
triple_b has joined #ruby
<apeiros_>
electrical: I mean I can give an equally unspecific answer, but I doubt that'll make you happy.
adamjleonard has joined #ruby
tyfighter has joined #ruby
<electrical>
apeiros_: sorry. let me try to be more specific :-) creating a gist now
Pupeno_ has quit [Ping timeout: 265 seconds]
jottr has joined #ruby
wald0 has quit [Quit: Lost terminal]
<apeiros_>
ellisTAA: gist, along with example in-/output + expected output (output probably == return value in this case)
shime has quit [Read error: Connection reset by peer]
metadave has quit [Read error: Connection reset by peer]
byprdct has joined #ruby
senayar_ has quit [Remote host closed the connection]
zachrab has joined #ruby
momomomomo has joined #ruby
eck has joined #ruby
eck has left #ruby [#ruby]
naftilos76 has quit [Remote host closed the connection]
lele has quit [Excess Flood]
suy has quit [Remote host closed the connection]
djbkd has joined #ruby
Hijiri has quit [Ping timeout: 265 seconds]
elaptics is now known as elaptics`away
agjacome has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
zenith_ has quit [Ping timeout: 246 seconds]
senayar has joined #ruby
athan has quit [Quit: No Ping reply in 180 seconds.]
djbkd has quit [Ping timeout: 256 seconds]
Notte has quit []
suy has joined #ruby
athan has joined #ruby
roshanavand has quit [Ping timeout: 265 seconds]
asmodlol has quit [Ping timeout: 255 seconds]
Hijiri has joined #ruby
funburn has quit [Quit: funburn]
lukeholder has joined #ruby
asmodlol has joined #ruby
timanema_ has quit [Ping timeout: 264 seconds]
centrx has joined #ruby
aclearma_ has quit [Quit: I'm out!]
senayar has quit [Ping timeout: 256 seconds]
tyfighter has quit [Ping timeout: 265 seconds]
ddv_ has joined #ruby
bddh` has quit [Remote host closed the connection]
agjacome has quit [Quit: leaving]
jonr22 has joined #ruby
Curs0r has joined #ruby
nuck has quit [Quit: Computer has gone to sleep.]
Megtastique has quit []
BurningChrome_ has quit [Ping timeout: 272 seconds]
<Curs0r>
Hello all. I have pretty much no ruby experience, I'm just relaying a question for a friend. Is there a simple way to convert a Latin1 character to octal in a string? Such as: replacing é with \351?
gr33n7007h has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
testcore has quit [Ping timeout: 250 seconds]
asmodlol has quit [Ping timeout: 244 seconds]
gr33n7007h has joined #ruby
zB0hs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros_>
Curs0r: .chr.to_s(8)
nanoyak has quit [Quit: Computer has gone to sleep.]
<Curs0r>
thank you :)
<wallerdev>
octal
nuck has joined #ruby
<wallerdev>
why would someone want octal
codecop has quit [Remote host closed the connection]
<apeiros_>
wallerdev: never understood that either
mikecmpbll has joined #ruby
jonr22 has quit [Ping timeout: 265 seconds]
<GaryOak_>
unicode man, to the rescue
asmodlol has joined #ruby
<Curs0r>
because postscript is being a pain about Latin1 special characters in a bash script apparently, and seems to work if they're octal escaped
nanoyak has joined #ruby
ych4k3r has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
testcore has joined #ruby
Rayford has joined #ruby
brb3 has quit [Quit: <.<]
da3m0n22 has joined #ruby
BurningChrome_ has joined #ruby
ta_ has joined #ruby
apeiros_ has quit [Remote host closed the connection]
uri_ has joined #ruby
<da3m0n22>
hey guys, something strange, gem list rake shows "rake (10.4.2, 10.1.0, 0.9.2.2)", however bundle exec rake install show "Could not find rake-0.9.2.2 in any of the sources"
jamto11 has quit [Remote host closed the connection]
fantazo has quit [Quit: Verlassend]
tonyhb has quit [Quit: peace]
_honning_ has quit [Ping timeout: 272 seconds]
iamjarvo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Olipro has quit [Ping timeout: 252 seconds]
cjim has quit [Quit: (null)]
crueber has quit [Quit: Leaving.]
zenith_ has joined #ruby
momomomomo has quit [Quit: momomomomo]
Soda has quit [Remote host closed the connection]
mloveless has quit []
devdazed has quit [Quit: Computer has gone to sleep.]
craigp has joined #ruby
mengu has quit []
uri_ has quit [Ping timeout: 255 seconds]
zenith_ has quit [Remote host closed the connection]
it0a has quit [Ping timeout: 252 seconds]
tvw has joined #ruby
yokel has quit [Ping timeout: 272 seconds]
ki0 has quit [Remote host closed the connection]
quimrstorres has joined #ruby
<ellisTAA>
can someone help me pass this test. i’m trying to convert a hash into a string with a specific format. the method i’m working on is called printable & the problems i’m having can bee seen in the failed_tests.rb section https://gist.github.com/ellisTAA/0a8c4da823b3851e7685
olivier_bK has joined #ruby
bhaak has quit [Ping timeout: 245 seconds]
dfinninger has quit [Remote host closed the connection]
yokel has joined #ruby
josephndenton has quit [Ping timeout: 265 seconds]
<havenwood>
ellisTAA: looks like you're needlessly assigning local variables to your return value in a few places. don't do that.
nik_-_ has quit [Quit: nik_-_]
<ellisTAA>
havewood: ty, what is Rigmarole
fgo has quit [Ping timeout: 264 seconds]
<havenwood>
ellisTAA: a word i had to google to spell correctly
<havenwood>
then pasted instead of the gist link i meant to
kaspertidemann has joined #ruby
<havenwood>
so... nvm >.>
riotjone_ has joined #ruby
<zenspider>
haha
<zenspider>
I thought it was "riga..."
Rollabunna has quit [Quit: Leaving...]
ta_ has joined #ruby
<havenwood>
ditto
<ellisTAA>
lol
_yinzer has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
snath has joined #ruby
riotjones has quit [Ping timeout: 244 seconds]
da3m0n22 has left #ruby [#ruby]
jamto11 has joined #ruby
Aova has joined #ruby
juanpablo__ has joined #ruby
juanpablo_ has quit [Ping timeout: 244 seconds]
ta_ has quit [Ping timeout: 276 seconds]
fabrice31 has joined #ruby
cpt_yossarian has joined #ruby
<electrical>
Hi all. still having this issue. https://gist.github.com/electrical/0d8b3b0edd797a197669 a certain string gets quoted and escaped with ruby 2.1 and up. but not with ruby 2.0 and lower.. is there a way that i can achieve the same what ruby 2.1 does but then with lower ruby versions?
<electrical>
I've tried to stringify the variable by "#{var}" but had no luck either.
pika_pika has quit [Ping timeout: 265 seconds]
<electrical>
adding quotes doesn't seem to work either
pdoherty has quit [Remote host closed the connection]
<godd2>
electrical one obvious solution is to only use one version of ruby in production
<electrical>
godd2: hehe true :-)
ZoanthusR has joined #ruby
<godd2>
but that doesn't help much
<electrical>
we test against multiple versions and that's why i ran into this
<godd2>
ah I see. where are you getting .to_yaml from?
<godd2>
since it may be version sensitive
<electrical>
stdlib from ruby
enebo has quit [Quit: enebo]
<electrical>
just doing a require 'yaml'
Jarboe has joined #ruby
fabrice31 has quit [Ping timeout: 276 seconds]
<godd2>
oh derr
<godd2>
I don't know enough about the yaml spec to know if having quotes around directories is a no-no
<godd2>
because that's the only difference between the strings, no?
<electrical>
apeiros: said earlier that its fine.
<electrical>
yeah. indeed.
djbkd has quit [Remote host closed the connection]
ghr has quit [Ping timeout: 265 seconds]
<godd2>
so what's the issue then?
thumpba has joined #ruby
adriancb has quit [Remote host closed the connection]
<godd2>
you just don't like how it looks?
djbkd has joined #ruby
<godd2>
I mean, that's a valid reason
cpt_yossarian has quit [Quit: And then he took off.]
dspangenberg has joined #ruby
cpt_yossarian has joined #ruby
<electrical>
well i do validation if i get back what i expect. ( rspec tests ) and we test against different ruby versions
thumpba has quit [Remote host closed the connection]
<electrical>
so depending on which ruby version i'm testing it may pass or fail
<electrical>
slightly annoying
<godd2>
electrical if the output is valid yaml, then my suggestion is to change your spec to account for the validity
Curs0r has left #ruby ["Leaving"]
<godd2>
that is, make your test a little more general
thumpba_ has quit [Ping timeout: 265 seconds]
checkit has joined #ruby
thumpba has joined #ruby
symbol_ has quit [Quit: WeeChat 1.1]
leonshalimov has quit [Ping timeout: 240 seconds]
<godd2>
electrical you can also try doing hiera_config.inspect.to_yaml
<godd2>
it may force the quotes you're looking for
thumpba has quit [Remote host closed the connection]