apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
simao has quit [Ping timeout: 245 seconds]
looopy has quit [Remote host closed the connection]
jimeh2 has quit [Ping timeout: 245 seconds]
nik_-_ has quit [Quit: nik_-_]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
matti has joined #ruby
minijupe has quit [Quit: minijupe]
akem has joined #ruby
ephesius has left #ruby [#ruby]
adeponte has quit [Remote host closed the connection]
luxurymode has joined #ruby
andrewhl has quit [Quit: andrewhl]
billiamii has joined #ruby
dnyy has joined #ruby
eywu has quit [Quit: Leaving.]
eywu has joined #ruby
liluo has joined #ruby
luxurymode has quit [Client Quit]
nari has quit [Ping timeout: 248 seconds]
iocor has quit [Quit: Computer has gone to sleep.]
minijupe has joined #ruby
mrsolo has quit [Quit: Leaving]
ivar has quit [Ping timeout: 260 seconds]
liluo has quit [Remote host closed the connection]
ezn-01 has quit [Remote host closed the connection]
yoklov has joined #ruby
austinbv has joined #ruby
kenperkins has quit [Read error: Operation timed out]
minijupe has quit [Quit: minijupe]
locriani_ has quit [Ping timeout: 250 seconds]
netogallo has quit [Ping timeout: 256 seconds]
macmartine has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
libertyprime has quit [Quit: Lost terminal]
`brendan has joined #ruby
cbuxton1 has quit [Ping timeout: 245 seconds]
luckman212 has joined #ruby
kenichi has quit [Remote host closed the connection]
sam113101 has quit [Remote host closed the connection]
artOfWar has joined #ruby
digitalcakestudi has joined #ruby
sam113101 has joined #ruby
luxurymode has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
ckrailo has quit [Quit: Computer has gone to sleep.]
ZachBeta has quit [Quit: Computer has gone to sleep.]
fowl has quit [Changing host]
fowl has joined #ruby
khakimov has joined #ruby
scb has joined #ruby
scb has quit [Read error: Connection reset by peer]
mattonrails has quit [Remote host closed the connection]
t0mmyvyo has quit [Quit: http://twitter.com/tommyvyo]
artOfWar has quit [Remote host closed the connection]
chazbo has quit [Ping timeout: 245 seconds]
looopy has joined #ruby
albemuth has joined #ruby
shadoi1 has quit [Ping timeout: 245 seconds]
vitoravelino`afk is now known as vitoravelino
andrewhl has joined #ruby
savage- has quit [Remote host closed the connection]
liluo has joined #ruby
Guest45554 is now known as cryptfu
mfridh_ has quit [Changing host]
mfridh_ has joined #ruby
mfridh_ is now known as mfridh
notwen has quit [Changing host]
notwen has joined #ruby
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
alexim has joined #ruby
jimmybaker has quit [Remote host closed the connection]
Kiall_ has joined #ruby
Andrevan has joined #ruby
Andrevan has quit [Changing host]
Andrevan has joined #ruby
mattonrails has joined #ruby
perryh_away is now known as perryh
mattonrails has quit [Remote host closed the connection]
kevinbond has joined #ruby
yankov has quit [Quit: yankov]
jgrevich_ has joined #ruby
jgrevich_ has quit [Client Quit]
kevinbond has quit [Client Quit]
akl has quit [Ping timeout: 244 seconds]
harukomoto has joined #ruby
jgrevich has quit [Ping timeout: 276 seconds]
wmoxam has joined #ruby
saltnvinegar has joined #ruby
gregorg_taf has joined #ruby
Solnse has joined #ruby
s0ber_ has joined #ruby
Hanmac has quit [Ping timeout: 246 seconds]
artOfWar has joined #ruby
locriani has joined #ruby
albemuth has quit [Quit: Computer has gone to sleep.]
saltnvinegar has quit [Client Quit]
Targen has joined #ruby
ciopte7 has quit [Quit: ciopte7]
flori_ has joined #ruby
replore has joined #ruby
mahmoudimus has joined #ruby
rtl_ has joined #ruby
airhorns has quit [Quit: Linkinus - http://linkinus.com]
joukokar_ has joined #ruby
kevinbond has joined #ruby
Kiall_ is now known as Kiall
khakimov has quit [Quit: Computer has gone to sleep.]
mahmoudimus has quit [Read error: Connection reset by peer]
kevinbond has left #ruby [#ruby]
wookiehangover_ has joined #ruby
harukomoto has quit [*.net *.split]
friskd has quit [*.net *.split]
mneorr has quit [*.net *.split]
jrgifford has quit [*.net *.split]
davidpk has quit [*.net *.split]
closedbracket has quit [*.net *.split]
fr0gprince_ has quit [*.net *.split]
c0rn has quit [*.net *.split]
davidboy has quit [*.net *.split]
randym has quit [*.net *.split]
lectrick has quit [*.net *.split]
Spaceghostc2c has quit [*.net *.split]
Shrink has quit [*.net *.split]
WalterN has quit [*.net *.split]
s0ber has quit [*.net *.split]
kinesis has quit [*.net *.split]
flagg0204 has quit [*.net *.split]
straind has quit [*.net *.split]
nimred has quit [*.net *.split]
wookiehangover has quit [*.net *.split]
busybox42 has quit [*.net *.split]
Poapfel has quit [*.net *.split]
Kartagis has quit [*.net *.split]
joukokar has quit [*.net *.split]
crodas has quit [*.net *.split]
aetaric has quit [*.net *.split]
gregorg has quit [*.net *.split]
rtl has quit [*.net *.split]
huismon has quit [*.net *.split]
flori has quit [*.net *.split]
zaiste has quit [*.net *.split]
ByteCrunch has quit [*.net *.split]
irk3z has quit [*.net *.split]
marienz has quit [*.net *.split]
wereHamster has quit [*.net *.split]
s0ber_ is now known as s0ber
itnomad has joined #ruby
looopy has quit [Remote host closed the connection]
sam113101 has quit [Remote host closed the connection]
ConstantineXVI has quit [Remote host closed the connection]
straind` has joined #ruby
harukomoto has joined #ruby
friskd has joined #ruby
mneorr has joined #ruby
closedbracket has joined #ruby
jrgifford has joined #ruby
WalterN has joined #ruby
c0rn has joined #ruby
davidpk has joined #ruby
davidboy has joined #ruby
fr0gprince_ has joined #ruby
randym has joined #ruby
lectrick has joined #ruby
Spaceghostc2c has joined #ruby
Shrink has joined #ruby
kinesis has joined #ruby
flagg0204 has joined #ruby
nimred has joined #ruby
Poapfel has joined #ruby
busybox42 has joined #ruby
crodas has joined #ruby
Kartagis has joined #ruby
aetaric has joined #ruby
zaiste has joined #ruby
ByteCrunch has joined #ruby
irk3z has joined #ruby
marienz has joined #ruby
wereHamster has joined #ruby
nimred has quit [Max SendQ exceeded]
nimred has joined #ruby
Facefox has quit [Ping timeout: 260 seconds]
arkx has quit [Ping timeout: 248 seconds]
straind` has quit [*.net *.split]
harukomoto has quit [*.net *.split]
friskd has quit [*.net *.split]
mneorr has quit [*.net *.split]
davidpk has quit [*.net *.split]
jrgifford has quit [*.net *.split]
closedbracket has quit [*.net *.split]
fr0gprince_ has quit [*.net *.split]
c0rn has quit [*.net *.split]
davidboy has quit [*.net *.split]
randym has quit [*.net *.split]
lectrick has quit [*.net *.split]
Spaceghostc2c has quit [*.net *.split]
Shrink has quit [*.net *.split]
WalterN has quit [*.net *.split]
kinesis has quit [*.net *.split]
flagg0204 has quit [*.net *.split]
busybox42 has quit [*.net *.split]
Poapfel has quit [*.net *.split]
Kartagis has quit [*.net *.split]
crodas has quit [*.net *.split]
aetaric has quit [*.net *.split]
marienz has quit [*.net *.split]
irk3z has quit [*.net *.split]
zaiste has quit [*.net *.split]
ByteCrunch has quit [*.net *.split]
wereHamster has quit [*.net *.split]
eywu has quit [Quit: Leaving.]
Hanmac has joined #ruby
friskd has joined #ruby
StoSun has quit []
Facefox has joined #ruby
JStoker has quit [Quit: JStoker is gone :(]
<razer123> It would be so cool if iphone supported MacRuby.
mengu_ has quit [Remote host closed the connection]
fr0gprince_mac has quit [Ping timeout: 276 seconds]
razer123 has left #ruby ["Whoop Whoop, zoidberg"]
straind` has joined #ruby
harukomoto has joined #ruby
mneorr has joined #ruby
jrgifford has joined #ruby
WalterN has joined #ruby
closedbracket has joined #ruby
fr0gprince_ has joined #ruby
c0rn has joined #ruby
davidboy has joined #ruby
randym has joined #ruby
lectrick has joined #ruby
Spaceghostc2c has joined #ruby
kinesis has joined #ruby
flagg0204 has joined #ruby
Poapfel has joined #ruby
aetaric has joined #ruby
busybox42 has joined #ruby
Kartagis has joined #ruby
zaiste has joined #ruby
ByteCrunch has joined #ruby
crodas has joined #ruby
irk3z has joined #ruby
marienz has joined #ruby
wereHamster has joined #ruby
L-----D has joined #ruby
arkx has joined #ruby
artOfWar has quit [Remote host closed the connection]
Haydos has joined #ruby
<graspee> ruby could be made for the iphone
<graspee> there is a python for iphone and a scheme
marienz has quit [Ping timeout: 606 seconds]
Shrink has joined #ruby
sam113101 has joined #ruby
Facefox has quit [Ping timeout: 260 seconds]
<stewart_> RubyMotion?
arkx has quit [Ping timeout: 244 seconds]
ciopte7 has joined #ruby
arkx has joined #ruby
marienz has joined #ruby
Facefox has joined #ruby
PragCypher has joined #ruby
fearoffish has quit [Quit: Computer has gone to sleep.]
yankov has joined #ruby
<graspee> it's not real
looopy has joined #ruby
<stewart_> what RubyMotion?
<graspee> well. what i mean is it's not ruby on the iphone
<graspee> it's a development environment for the mac i believe which uses ruby and targets the ihpone
<graspee> but it's not a repl for ruby on iphone that you can play with
ank has quit [Quit: ank]
<stewart_> you want to develop ruby on your iphone?
<graspee> of course
<stewart_> haha… why?
<graspee> if you have to ask you wouldn't understand
<graspee> but anyway, because it's cool
<graspee> and because it's fun
<stewart_> well yea… thats why i asked
arkx has quit [Ping timeout: 244 seconds]
<stewart_> i would not ask if did undrstand
<graspee> sorry
JStoker has joined #ruby
<stewart_> hey if its cool then its cool
<graspee> it just surprises me that not everyone thinks the way i do
niklasb has quit [Ping timeout: 248 seconds]
<stewart_> hahah
<stewart_> yep me too :)
arkx has joined #ruby
<stewart_> personally I could not think of anything worse. I can barely tolerate browsing on my phone little only coding
<graspee> i write stuff in scheme on my ipod touch
<graspee> it's a good way to pass the time if you are stuck somewhere
<stewart_> keyboard?
<graspee> just the on screen keyboard
<stewart_> do you have an external keyboard
<graspee> no
<stewart_> ha… well ipad is different i suppose....
<graspee> ipOd
<stewart_> ah right
<stewart_> well i still think your crazy then ;)
cordoval has joined #ruby
<graspee> it's easy
<stewart_> its bliding
kylemcgill has quit [Remote host closed the connection]
<stewart_> plus i am too used to vim now
<stewart_> cant live with out it
<stewart_> i keep putting random v's in my code :)
<stewart_> with out it
<graspee> i use dvorak kbd layout so vim is a little bit annoying
mikepack has joined #ruby
simao has joined #ruby
<stewart_> ahhh right
<stewart_> what do you use when your not coding on mobile ?
<graspee> how do you mean?
<graspee> i use my laptop
<stewart_> what editor?
<graspee> or did you mean editor?
<stewart_> yea editor
<graspee> i use vim
<graspee> it just annoys me
<stewart_> ha…. you need a new editor then
<stewart_> sublime maybe
<graspee> i tend to use gvim so i can select stuff with the mouse
arkx has quit [Ping timeout: 276 seconds]
<graspee> i might be more inclined to keep my hands on the keyboard if i used qwerty
JStoker has quit [Excess Flood]
arkx has joined #ruby
<graspee> i'll google sublime
<stewart_> just another text editor but it's quite extendable
<stewart_> if vim did not exist i would use that
<stewart_> good ruby support too from memory
<graspee> the minimap at the side reminds me of another ide that came out recently or was announced. the one that looks like a game interface
<stewart_> I dont like it
<graspee> hmm sublime is payware though
itnomad has quit [Quit: Leaving]
CheeToS has joined #ruby
simao has quit [Ping timeout: 245 seconds]
<stewart_> yea i know… sucks because its just a nice skin for vim really but not as powerful
<graspee> is it using vim ?
<stewart_> that said if software is good i have no issue paying for it
<stewart_> i dont think so but they have taken some design ideas from vim/unix world such as configuration via text files
<graspee> $59!
<stewart_> also they offically developed some vim handles to simulate vim key strokes
kpshek has joined #ruby
<graspee> also "an upgrade fee will be required for sublime text 3"
<graspee> it's not even lifetime upgrades
<stewart_> well again if the software is good and is going to help me then I dont mind paying
<graspee> there's so much free software though
<stewart_> but I can understand why you would not like that
<stewart_> yep
JStoker has joined #ruby
<graspee> it just annoys me a bit when people use free software to build software that they then charge for
<Icehawk78> Is there a good starting point for creating custom classes that can implement something akin to a before_filter/after_filter like Rails has support for?
Solnse has quit [Quit: Leaving.]
kpshek has quit []
crankyco_ has joined #ruby
libertyprime has joined #ruby
fulmato has quit [Remote host closed the connection]
chson has quit [Remote host closed the connection]
crankycoder has quit [Ping timeout: 248 seconds]
ZachBeta has joined #ruby
davidpk has joined #ruby
krusty_ar has quit [Ping timeout: 252 seconds]
TheHunter_1039 has joined #ruby
austinbv has quit [Quit: austinbv]
yoklov has quit [Quit: computer sleeping]
stkowski has quit [Quit: stkowski]
stkowski has joined #ruby
yoklov has joined #ruby
TorpedoSkyline has quit [Quit: Leaving]
dnyy_ has joined #ruby
dbgster has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
replore has quit [Remote host closed the connection]
nfluxx_ has joined #ruby
Kiirani has joined #ruby
nfluxx has quit [Ping timeout: 240 seconds]
dnyy has quit [Ping timeout: 244 seconds]
CheeToS has quit [Ping timeout: 245 seconds]
voodoofish430 has quit [Quit: Leaving.]
pu22l3r has joined #ruby
nfluxx_ has quit [Ping timeout: 244 seconds]
digitalcakestudi has quit [Remote host closed the connection]
Dreamer3 has quit [Quit: Leaving...]
araujo has quit [Quit: Leaving]
khakimov has joined #ruby
uris has joined #ruby
seanstickle has joined #ruby
pu22l3r has quit [Ping timeout: 250 seconds]
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
looopy has quit [Remote host closed the connection]
c0rn has quit [Quit: Computer has gone to sleep.]
noodletraveler has joined #ruby
noodletraveler has quit [Client Quit]
nu7hatch has quit [Ping timeout: 250 seconds]
Araxia_ has quit [Quit: Araxia_]
Tref has joined #ruby
mrwalker has joined #ruby
brianpWins has quit [Quit: brianpWins]
noodletraveler has joined #ruby
looopy has joined #ruby
rodent` has joined #ruby
closedbracket has quit [Remote host closed the connection]
ZachBeta has quit [Quit: Computer has gone to sleep.]
prtksxna has joined #ruby
closedbracket has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
zinjacoder has quit [Read error: Connection reset by peer]
keanehsiao has joined #ruby
fbernier has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
Bartholomeae has joined #ruby
randym_ has joined #ruby
nlc has quit [Quit: Leaving]
zaiste_ has joined #ruby
jrgifford_ has joined #ruby
stkowski has quit [*.net *.split]
straind` has quit [*.net *.split]
jrgifford has quit [*.net *.split]
mneorr has quit [*.net *.split]
harukomoto has quit [*.net *.split]
fr0gprince_ has quit [*.net *.split]
davidboy has quit [*.net *.split]
lectrick has quit [*.net *.split]
Spaceghostc2c has quit [*.net *.split]
randym has quit [*.net *.split]
WalterN has quit [*.net *.split]
kinesis has quit [*.net *.split]
flagg0204 has quit [*.net *.split]
busybox42 has quit [*.net *.split]
Poapfel has quit [*.net *.split]
Kartagis has quit [*.net *.split]
crodas has quit [*.net *.split]
aetaric has quit [*.net *.split]
zaiste has quit [*.net *.split]
ByteCrunch has quit [*.net *.split]
irk3z has quit [*.net *.split]
wereHamster has quit [*.net *.split]
jrgifford_ is now known as jrgifford
randym_ is now known as randym
cordoval has left #ruby [#ruby]
friskd has quit [Quit: friskd]
Spaceghostc2c has joined #ruby
L-----D has quit [Quit: Leaving]
wargasm is now known as bnm
Facefox has quit [Ping timeout: 260 seconds]
lindenle_ has quit [Remote host closed the connection]
looopy has quit [Remote host closed the connection]
radic has quit [Disconnected by services]
radic_ has joined #ruby
radic_ is now known as radic
Poapfel has joined #ruby
stkowski has joined #ruby
straind` has joined #ruby
mneorr has joined #ruby
harukomoto has joined #ruby
busybox42 has joined #ruby
WalterN has joined #ruby
Kartagis has joined #ruby
flagg0204 has joined #ruby
kinesis has joined #ruby
aetaric has joined #ruby
crodas has joined #ruby
ByteCrunch has joined #ruby
irk3z has joined #ruby
wereHamster has joined #ruby
Kiirani has left #ruby [#ruby]
Facefox has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
berserkr has quit [Quit: Leaving.]
lectrick has joined #ruby
crankycoder has joined #ruby
LBRapid has joined #ruby
davidboy has joined #ruby
albemuth has joined #ruby
mikepack has quit [Remote host closed the connection]
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
crankyco_ has quit [Ping timeout: 265 seconds]
stefanp_ has quit [Ping timeout: 265 seconds]
mvangala has quit [Remote host closed the connection]
sbanwart has quit [Ping timeout: 248 seconds]
queequeg1 has joined #ruby
<queequeg1> [1, 2, 3, 4, 5].grep(/./)
<queequeg1> I'm having trouble with the fact that that returns an empty array.
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<queequeg1> Can anyone explain to me why that happens?
fbernier has quit [Ping timeout: 276 seconds]
mrwalker has quit [Remote host closed the connection]
khakimov has joined #ruby
Tref has quit [Quit: Tref]
looopy has joined #ruby
savage- has joined #ruby
pkondzior has quit [Excess Flood]
pkondzior has joined #ruby
mikepack has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
<graspee> because they are numbers?
mikepack has quit [Remote host closed the connection]
<queequeg1> but shouldn't be caught by a dot? I thought . matches everything.
<graspee> i'm a noob at these things, but looking at the documentation what you are doing there is trying to apply a regexp to numbers
<graspee> if you surround the numbers with quotes it will return all of them
<graspee> you can grep numbers but not with regexps i don't think
<graspee> e.g. [1,2,3,40,100].grep(1..10)
<queequeg1> I guess I hadn't really thought about regexes only being useful against strings.
albemuth has quit [Quit: Computer has gone to sleep.]
digitalcakestudi has joined #ruby
azm has joined #ruby
albemuth has joined #ruby
emmanuelux has quit [Ping timeout: 264 seconds]
simao has joined #ruby
AlbireoX is now known as AlbireoX`Away
imami|afk is now known as banseljaj
CheeToS has joined #ruby
simao has quit [Ping timeout: 245 seconds]
<graspee> what are you writing anyway, queequeg1 ? or are you just experimenting?
c0rn has joined #ruby
harukomoto has quit [Ping timeout: 256 seconds]
kil0byte has quit [Read error: Connection reset by peer]
<queequeg1> I'm working on the challenges at http://rubeque.com
<graspee> oh! i'll take a look at them!
<queequeg1> I'm on this one: http://rubeque.com/problems/select-map
jonathanwallace has quit [Remote host closed the connection]
<graspee> how are you finding them, difficulty wise?
<graspee> i'm a bit of a noob so maybe i'll struggle
<queequeg1> Mostly fairly easy, but they are really showing me where I'm weak.
<graspee> hehe
<graspee> you need an old chinese man who will force you to balance jugs of water and stand for a long time
<graspee> then tap you with a stick and insult you
<queequeg1> exactly.
<queequeg1> Maybe Japanese.
<queequeg1> either way.
<graspee> "Your regular expressions are weak! How will we ever fight the dragon clan!?"
<graspee> with my skill however, i'd be washing the dishes
<queequeg1> "You code like a baboon with two club feet!"
looopy has quit [Remote host closed the connection]
Solnse has joined #ruby
<queequeg1> So since you helped me a moment ago here is another: [1, 2, 3, 4, 5].grep(___, &:succ)
<queequeg1> If grep only takes one argument, why are they putting two in there?
<graspee> hmm.
<graspee> let me consult the wisdom of the ether
<queequeg1> heh
looopy has joined #ruby
<graspee> what version of ruby are you using, and do you know what they are basing theirs on?
<queequeg1> 1.9.3
harukomoto has joined #ruby
<wmoxam> queequeg1: grep can take a block
<graspee> the pickaxe is not much help on the grep
oestrich has joined #ruby
phantasm66 has joined #ruby
phantasm66 has quit [Client Quit]
<graspee> well it is
<graspee> but it's not a long description
<wmoxam> &:succ is shorthand for {|i| i.succ }
<graspee> ah!
<graspee> i'm making a note here
<queequeg1> ah
<queequeg1> I'm still getting used to that shorthand.
nfluxx has joined #ruby
<queequeg1> I'm not sure why I'm having such a hard time with it.
<graspee> i could see that it could take a block but it didn't explain to me why in queequeg1 snippet it had 2 params
azm has quit [Ping timeout: 250 seconds]
dbgster has quit [Quit: dbgster]
<graspee> i'm a noob really. i shouldn't be let out of my cage
oestrich has quit [Client Quit]
<wmoxam> a block is really just an argument
albemuth has quit [Quit: Computer has gone to sleep.]
<wmoxam> ruby just supports syntax that makes it not seem that way
<queequeg1> I see.
<queequeg1> My kungfu is still weak.
<graspee> you know how you see people who are so stupid you wonder how they can talk? and yet they do? that's like me and ruby. HOW am I managing it while knowing so little?!
<queequeg1> I will have to setup some practice time to work on &:magic.
<graspee> I think my trouble is I use some feature of ruby and then i forget it. I need to practice more so things become second nature
<queequeg1> graspee, don't say that. If you are stupid and you just helped me, what does that make me? :-(
<graspee> and this site could help me practice
<graspee> well i just googled it and then ran it through my knowledge of languages generally
<wmoxam> everyone starts out as a noob
<wmoxam> I've been learning Ruby for a decade :p
<graspee> wow
<wmoxam> I should probably learn a new language
<graspee> i started learning it with the 1e of the pickaxe then i wandered away into C and common lisp and also a bad bad desert time when i didn't program for ten years
<wmoxam> but Ruby is just so darn fun
<queequeg1> I'm working on it.
<graspee> i'm determined to grow in knowledge!
<graspee> i love you, ruby! we will succeed!
<graspee> <dramatic music swells>
ipoval has joined #ruby
<wmoxam> Get knowledgable or have a brain hemmorage trying!
kenneth has quit [Quit: kenneth]
wookiehangover_ is now known as wookiehangover
<queequeg1> Hey wmoxam, can you help me with a hint? http://rubeque.com/problems/select-map The problem I'm having is that I need a pattern that will match both against digits /\d/ and against integers. Im perplexed.
<queequeg1> I just need a pointer, I'm spinning my wheels. I'm happy to work for the answer, but I'm just not getting anywhere.
ciopte7 has quit [Quit: ciopte7]
rodent` has quit [Ping timeout: 245 seconds]
looopy has quit [Remote host closed the connection]
igotnolegs has joined #ruby
<wmoxam> queequeg1: so the same pattern goes in both?
<queequeg1> yeah
<wmoxam> both blank spots
<wmoxam> ok
<wmoxam> so you need the odd numbers
<wmoxam> hrmm
looopy has joined #ruby
t0mmyvyo has joined #ruby
PragCypher has quit [Ping timeout: 245 seconds]
rodent` has joined #ruby
PragCypher has joined #ruby
Tref has joined #ruby
mk03 has quit [Remote host closed the connection]
<queequeg1> graspee: do you know about ruby koans?
rodent` has quit [Ping timeout: 265 seconds]
t0mmyvyo has quit [Quit: http://twitter.com/tommyvyo]
<graspee> oho thanks
<queequeg1> I found the online one a little buggy at times, you can also clone the repo with all the tests in it.
<graspee> i'm having trouble getting assert_equal to work
<queequeg1> You have to import something, let me find the link for you.
<graspee> i require "test/unit"
<graspee> but it still says unknown method
<queequeg1> are you using irb?
<graspee> no, pry
<graspee> but i tried it in a file too
Tref has quit [Quit: Tref]
Chryson has quit [Quit: Leaving]
<queequeg1> extend Test::Unit::Assertions
<queequeg1> after require 'test/unit'
<graspee> ok
<graspee> thanks
<queequeg1> np :-)
<graspee> i'm still having a problem with my first rubeque thing though
<banisterfiend> graspee: wtf is pry, sounds like a python tool
ciopte7 has joined #ruby
<graspee> you don't know pry?
<graspee> you're missing out if you are using irb instead of pry, in my opinion
<queequeg1> I do, I love it.
<queequeg1> I guess I just assume people are using irb.
kenneth has joined #ruby
<graspee> i was answering banisterfiend, queequeg1
<banisterfiend> graspee: probably just for noobs
yonggu_ has joined #ruby
<bnagy> that whole site is broken for me
<graspee> i assume you have him blocked or something?
<bnagy> whom?
<graspee> banisterfiend:
<queequeg1> no
<graspee> oh.
<queequeg1> I just messed up :-)
<graspee> k!
<queequeg1> Time for bed, enough banging head into wall.
<davidcelis> banisterfiend: u trollin bro
<graspee> i googled pry to show him
<graspee> ...
<graspee> the thing is, there are really people like that
<graspee> so i don't feel bad for being fooled
luxurymode has quit [Quit: Computer has gone to sleep.]
khakimov has joined #ruby
<queequeg1> night graspee
<graspee> night
<banisterfiend> davidcelis: Yeah.
WalterN has quit [Read error: Operation timed out]
<davidcelis> graspee: he's a regular in here
<bnagy> regular troll
<graspee> was the first link i came to
<banisterfiend> graspee: thx for the link
<banisterfiend> i'll read about it now
<graspee> is there a name for continuing to joke when the person has realised they were being fooled?
<davidcelis> graspee: llolol
<davidcelis> graspee: i'd say it still falls under the umbrella of trolling
yonggu has quit [Ping timeout: 276 seconds]
akl has joined #ruby
bnm has quit [Read error: Connection reset by peer]
wargasm has joined #ruby
rippa has joined #ruby
Tref has joined #ruby
<graspee> on this page, I entered a solution
<graspee> but I got a syntax error. is the page broken?
<bnagy> it's broken for me
<graspee> and is the difference between "and" and "&&" something that was changed in 1.9?
<bnagy> I can't even get the first problem to work
<bnagy> no, not afaik, they've always been different
<graspee> "blue" && "red" gives the same result as "blue" and "red" for me
<bnagy> yeah it's a bit more subtle than that :)
digitalcakestudi has quit [Quit: Leaving.]
<graspee> and the only difference mentioned by pickaxe is precedence
<graspee> which has no effect in the example on the puzzle page
<looopy> does ruby have anything on par with pythons twisted?
<looopy> eventmachine??
<banisterfiend> looopy: eventmachine is cool, we also have celluloid, but that's newer
<banisterfiend> and more ambitious, afaict
<bnagy> graspee: did you actually check?
<graspee> check in what sense?
<graspee> i ran it in pry
<bnagy> in irb
<bnagy> did you look at violets after you had assigned it?
<graspee> hmm. no
<graspee> wait. yes
chico has quit [Ping timeout: 276 seconds]
<graspee> no
<graspee> YOU MADE ME CONFUZZLED. i get it now though
deryl has joined #ruby
<graspee> i was just looking at the return value
<graspee> thanks
<looopy> banisterfiend: ok, i'll admit my knowledge is rather limited when it comes to dealing with asynchronous issues..i've read a bit about eventmachine...some people say it's awesome..others say it's not...i'll take a look at celluloid as well
<banisterfiend> looopy: what do the people who say it's not awesome say
<wmoxam> gah, that rubeque site doesn't even accept the correct answers
<bnagy> celluloid and EM are different patterns
<looopy> banisterfiend: good question =P it was in rubyonrails and i unfortunately had to leave while they were discussing it.
amolpujari has quit [Read error: Connection reset by peer]
<bnagy> although I'm not sure what 'on par with twisted' means, I don't think we have anything that confusing :)
amolpujari has joined #ruby
<looopy> ahh! now that i'm looking at celluloid..was this inspired by akka by chance? I see they're using the actor model
<looopy> i do toy with scala so this may be 'right at home' for me
WalterN has joined #ruby
c0rn has quit []
<bnagy> what are you thinking of writing?
<bnagy> only real issue with EM for me is that callback driven stuff rapidly becomes hard to maintain once the overall 'system' gets complex
mikepack has joined #ruby
<bnagy> cascading callbacks
lkba has quit [Ping timeout: 260 seconds]
yxhuvud has joined #ruby
<banisterfiend> bnagy: have you seen em-synchrony?
yxhuvud has quit [Read error: Connection reset by peer]
<bnagy> banisterfiend: I think you've asked me this before :) No, I haven't worked with EM for 2 years+
<banisterfiend> bnagy: also there's some nice libs that that wrap the deferrable api if that's what you're referring to
vitor-br has joined #ruby
yxhuvud has joined #ruby
<bnagy> ahh is this what they built goliath on?
<bnagy> that looks pretty sweet
<looopy> bnagy: lol. at some point i was to to guarantee real time notifications and possibly...*this may be dumb* connect users similarities on the fly
<bnagy> yeah, I have seen it then
<looopy> really i just decided to play with python for amonth and worked through the tornado book...now i'm back to playing with ruby...i don't have any real solid ideas at the moment but i'm looking to toy around and familiarize myself with real time development
kil0byte has joined #ruby
<banisterfiend> looopy: why didnt you stick with python out of interest?
<bnagy> realtime and reactors make me nervous
pzol has quit [Ping timeout: 252 seconds]
lkba has joined #ruby
<looopy> banisterfiend: to be honest i'm not sure I won't =) i didn't enjoy it when i tried it a few years ago though this past period of playing around i liked it a lot. i do like gems more than fighting with pip...
deryl has quit [Quit: weird that running /redraw makes text update right but irssi STILL is overwriting the last line]
jarjar_prime has joined #ruby
<looopy> to be honest i can go either way but I'm more familiar with ruby.
xkx has quit [Ping timeout: 252 seconds]
pzol has joined #ruby
xkx has joined #ruby
Choobie has quit [Ping timeout: 252 seconds]
tomzx has quit [Ping timeout: 245 seconds]
ryanf has joined #ruby
<davidcelis> looopy: eventmachine + ruby on rails == stack level too deep
<looopy> davidcelis: ahh so it's more so that mixing those two *within the same project* is just a no no
davidcelis has quit [Quit: K-Lined]
wargasm has quit [Read error: Connection reset by peer]
tomzx has joined #ruby
lkba has quit [Ping timeout: 265 seconds]
Tref has quit [Quit: Tref]
c0rn has joined #ruby
andrewhl has quit [Quit: andrewhl]
thecreators has joined #ruby
Andrevan has quit []
avandenhoven has joined #ruby
wmoxam has quit [Ping timeout: 245 seconds]
deryl has joined #ruby
deryl has quit [Client Quit]
akem has quit [Ping timeout: 245 seconds]
uris has quit [Quit: leaving]
philcrissman_ has quit [Remote host closed the connection]
harukomoto has quit [Ping timeout: 245 seconds]
gtuckerkellogg has joined #ruby
<shevy> looopy stick with python. once you can do all the bad things that ruby allows you to do (alias, omit (), avoid passing of implicit self), you'd feel constrained by python as a language
<shevy> oh and mandatory whitespace indent
<looopy> shevy: lol, that's what ran me away before though i can see the good in it as well nowadays.
defendguin has joined #ruby
<looopy> shevy: very true...i worked partially through metaprogramming ruby and...eesh, "cool" but..it just seems like a lot of what they teach would make large projects confusing.
xnm has joined #ruby
<looopy> i feel ruby has better testing tools..though i may be completely wrong?
ryanf has quit [Quit: broken pipes |||]
<banisterfiend> looopy: probalby right, rubyists are obsessed with testing
noganex has quit [Ping timeout: 252 seconds]
<bnagy> *some rubyists
<bnagy> the sissy ones :P
Asher has quit [Remote host closed the connection]
<graspee> my idea of testing is run it. does it work once? good enough for me! \o/
Asher has joined #ruby
<looopy> bnagy: thank you for saying that...i actually went for a job interview as a junior dev and while at the time i'd written a few rspec and cucumber tests they ultimately wanted someone well versed and obsessed with testing. i figured it was something i simply missed out on being self taught.
deryl has joined #ruby
noganex has joined #ruby
mikeycgto has quit [Remote host closed the connection]
<bnagy> I test stuff all the time, I just don't use these testy frameworks, cause afaict you can't say assert 'must run for 24 hours in a tight loop without leaking memory'
<shevy> looopy hey I did not say anything about metaprogramming :) there are a few who think this is cool, so they praise it again and again in the ruby community. I usually end up telling the metaprogrammists that they are idiots
<bnagy> metaprogramming is for nerds, or for when you need it :)
<Gavilan> bnagy: actually, you kinda can....
<Gavilan> shevy: I'm a metaprogrammist!
<Hanmac> bnagy : attr_accessor is metaprogramming too
<shevy> Gavilan can I see your code
<shevy> nah
<shevy> attr_accessor is not metaprogramming at all
<Gavilan> shevy: what for?
<bnagy> Hanmac: no it's not, the _implementation" is ;)
Targen has quit [Ping timeout: 245 seconds]
<shevy> Gavilan I will only believe it if your project includes metaprogramming
simao has joined #ruby
<Gavilan> shevy: it does... But I don't do Ruby...
emdub has quit [Read error: Operation timed out]
<shevy> lol :)
ZifreCL has quit [Remote host closed the connection]
<shevy> the first sign of metaprogramming is the use of *eval*
ping-pong has quit [Ping timeout: 252 seconds]
emdub has joined #ruby
timonv has joined #ruby
<bnagy> not sure I can agree with that
<shevy> Gavilan you really don't use ruby? :(
<Hanmac> shevy you can do metaprograming with send too
* Hanmac does meta programming with C
<shevy> Hanmac, exactly! but .send and .method_missing is on the lower level... eval is very high on my list of signs of metaprogramming
<Hanmac> eval is on MY list of no-go's
<shevy> hehe
yonggu has joined #ruby
<shevy> I need to find a project that combines eval send and method_missing
<bnagy> \o/ I got one!
<Hanmac> in 99% of the cases where eval is used an send would be better
<Gavilan> shevy: I really don't use ruby, and I don't know anyone who likes metaprogramming as much as I do...
<bnagy> shevy: I have a debugger wrapper which uses mm and send to wrap huge COM vtables, and I need to configure the debugger with analysis modules that it will run, but they have to be sent across the network
<Hanmac> Gavilan: look at this code : https://github.com/Hanmac/rwx/tree/master/ext
yonggu_ has quit [Ping timeout: 250 seconds]
timonv has quit [Read error: Connection reset by peer]
avandenhoven has quit [Quit: avandenhoven]
timonv has joined #ruby
simao has quit [Ping timeout: 256 seconds]
<bnagy> shevy: method_missing, send AND eval. wooo
<shevy> waaaaaah
<Gavilan> Hanmac: what about that?
<shevy> Gavilan does not even program :(
<Hanmac> its one of my c++ bindings for ruby ... look at the main.hpp
Prometheu5 has joined #ruby
<Gavilan> Hanmac: what about that?
senny has joined #ruby
<shevy> Gavilan do something useful, go learn ruby man
<Hanmac> like my macros "macro_attr" it generates functions
<Gavilan> Hanmac: so?
khakimov has quit [Quit: Computer has gone to sleep.]
<Gavilan> shevy: why should I?
TheHunter_1039 has quit [Quit: TheHunter_1039]
ph^ has joined #ruby
<shevy> Gavilan so that you can do something else other than ... do nothing
<Gavilan> shevy: I do things other than ... do nothing...
Prometheu5 is now known as Prometheus
<Gavilan> shevy: Just not in ruby :)
Prometheus has quit [Client Quit]
Prometheus has joined #ruby
<graspee> why are you in #ruby then? speed dating?!
ananthakumaran has joined #ruby
<shevy> and you never mentioned it so what language are you using
tonini has joined #ruby
<graspee> my name is graspee i like spciy foods and recursion
<shevy> Dream-Language 2.0?
<Hanmac> let me guess ... Gavilan you are an PHP guy right?
<shevy> \o/
<shevy> long live PHP!
<shevy> I used it 6 years ago too
<Hanmac> shevy yeah chained in prision
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
<shevy> like rails :)))
<shevy> though the other web frameworks in ruby feel a bit too lightweight
<shevy> it would be nice to write one codebase, for example in ruby, a game
wvms has quit [Read error: Connection reset by peer]
<shevy> and then "translate" this both into something like (a) use gosu for it (locally for the user) and (b) use a webframework (for a browsergame)
wvms has joined #ruby
<Gavilan> Hanmac: http://pastebin.com/spqWPH7F this is more like it (I actually had a version that didn't repeated the types, but it as impossible to update/debug, so i simplified it a little)
<Hanmac> shevy one of my teams we develop an GameEditor ... as client-server engine :P
ping-pong has joined #ruby
<Gavilan> graspee: Just for the kicks....
<Gavilan> shevy: I currently do C# and C++... I used to do Smalltalk...
<graspee> a fine language
<Hanmac> C++ is cool, but C# looks too much after an java with an C cloak
<Gavilan> Hanmac: C++ sux...
<Hanmac> not allways ... i think i tamed my bindings well ...
<Gavilan> Hanmac: Can you create a full functional window without creating a single class?
<deryl> like thats the definition of whether a language sucks or not
<Gavilan> deryl: That's the definition of wheter it's a black box or white box framework... and white box frameworks usually sux :)
<deryl> uh huh
<Hanmac> Gavilan what class did you mean? in ruby i can, yeah because of my binding
<Gavilan> hackeron: I mean that most GUI frameworks need you to subclass something to define events, or customize some things...
<Gavilan> hackeron: and a good framework shouldn't need to do that, given that the GUI domain is pretty well defined/known, etc...
<Hanmac> my wx ruby binding you need not, you can subClass it, but its only optional
<Gavilan> Hanmac: good for you then :). Subclassing is evil... (Mixing even more evil)
davidcelis_ has quit [Quit: Leaving]
<Hanmac> what i hate about C# is #region ... something that is only usefull in a edior shouldnt go into a language
<Gavilan> Hanmac: I strongly disagre...
robacarp_ has joined #ruby
mdhopkins has joined #ruby
<Hanmac> i dont disagre an option to group your code, but not as an "#" compiler directive
<Gavilan> Hanmac: Who says # is always a compiler directive?
yoklov has quit [Quit: computer sleeping]
<Gavilan> Hanmac: Have you ever used smalltalk by any chance?
td123 has quit [Read error: Connection reset by peer]
<Hanmac> nope
cdepue has joined #ruby
td123 has joined #ruby
ryanf has joined #ruby
<Hanmac> >> al.cpp:3:2: error: invalid preprocessing directive #xyz << it says somthing about directives
seanstickle has quit [Quit: Nihil sub sole novum]
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
greyEAX has joined #ruby
Haydos has quit [Quit: Leaving]
<Hanmac> Gavilan: PS: nothing against mixins !! Enumerable is cool
robacarp_ has quit [Ping timeout: 244 seconds]
ananthakumaran has quit [Ping timeout: 244 seconds]
<Gavilan> Hanmac: One of the few good things about C++, is that the stl separates algorithms & data structures...
<Hanmac> (1..10).each_with_object(2).map(&:to_s).join(":")
<Hanmac> can you do that in C++ in fewer lines?
vectorshelve has joined #ruby
<Gavilan> Hanmac: Yes, if we don't count the #includes....
shevy has quit [Ping timeout: 244 seconds]
stewart_ has quit [Quit: Leaving.]
LBRapid has quit [Quit: Farewell...]
<Hanmac> in ruby i only need one line and <50 chars ... show me what its takes less in c++
brianpWins has joined #ruby
youdontmeanmuch has joined #ruby
<WalterN> heh
<WalterN> can you manipulate pointers directly in ruby?
<WalterN> :P
robacarp_ has joined #ruby
ananthakumaran has joined #ruby
robacarp_ is now known as Guest90717
<Gavilan> Hanmac: in boost + stl you have all those functions
<Hanmac> WalterN why should i do this? i can manipulate all objects directly in ruby, how cares about pointers? (ruby does not have pointers)
linus95014 has joined #ruby
<Gavilan> Hanmac: Can you make a game with graphics as good as the witcher 2, that runs as fast as the witcher 2, in ruby? (in the same hardware that the witcher 2 runs now?)? Can you even get half of the FPS?
<Gavilan> (in ruby)
<bnagy> actually ruby does have pointers
<bnagy> you get get a string pointer out of pack, for example, if you really want to
<bnagy> although FFI is probably a better choice
Guest90717 has quit [Client Quit]
schovi has joined #ruby
Progster has quit [Ping timeout: 260 seconds]
<Hanmac> ruby is not designed to be fast, but you get dynamic (you can use c++ parts to accelerate ruby)
<Gavilan> Hanmac: C++ is designed to be fast...
<bnagy> C++ was designed? I thought it grew under a rotten log
<WalterN> HA
jhunter has quit [Ping timeout: 252 seconds]
timonv has quit [Remote host closed the connection]
<Hanmac> ruby has method_missing and other cool stuff like send i dont think this works on C++
<Hanmac> and in ruby classes and interegers are objects too
<test34-> in 10 years Ruby will be fast enough for most tasks (because hardware will be faster)
linus95014 has left #ruby [#ruby]
<Gavilan> test34-: no, it won't....
<graspee> with games though it's different
<bnagy> if the jvm guys have their way it won't take that long
kil0byte_ has joined #ruby
<WalterN> duck typing... C++ does not support
<graspee> because what's acceptable in games is always what you can do closer to the hardware with c or c++
jhunter has joined #ruby
<graspee> you can make games in ruby now that are as good as games you used to be able to make in c++ on older hardware
<bnagy> yeah except that's crap
<Gavilan> Objective-C has all the things you are mentioning, and it's also a lot faster than ruby...
<WalterN> ObjC is a nice language too
<bnagy> you don't need to write in C to get speed
<Gavilan> bnagy: no, but you need manual memory management...
cdepue has quit [Ping timeout: 265 seconds]
phipes has joined #ruby
<bnagy> yeah that's crap as well
shevy has joined #ruby
stkowski has quit [Quit: stkowski]
<Gavilan> bnagy: no GCed language can compete with C++...
<Gavilan> g2g, bye!
<Hanmac> module MyModule; def xyz; p 'haha';end;end; true.extend(MyModule); true.xyz .... do something like this in ObjC
kil0byte has quit [Ping timeout: 260 seconds]
<banisterfiend> Hanmac: you can do that in objc
<Gavilan> Hanmac: 0wned!!! bye
Gavilan has left #ruby [#ruby]
<banisterfiend> Hanmac: objc has 'class categories' that are exactly equivalent to monkeypatches
<banisterfiend> bnagy: can u paste my comment, cos Hanmac is blocking me i think but he needs to know he's wrong
<banisterfiend> :P
* Hanmac wins ... and gets exp from that
akem has joined #ruby
akem has joined #ruby
<bnagy> banisterfiend: sorry, I lost interest when it got stupid
sallybaby has joined #ruby
<sallybaby> Hanmac: "module MyModule; def xyz; p 'haha';end;end; true.extend(MyModule); true.xyz .... do something like this in ObjC" < ---- you can do this in objc
cdepue has joined #ruby
<sallybaby> Hanmac: objc has class categories that are more or less the same as monkeypatches
schovi has quit [Remote host closed the connection]
<graspee> i think if someone blocks someone you should respect their decision rather than relaying messages
linus95014 has joined #ruby
djdb has joined #ruby
<sallybaby> graspee: when the comment is relevant to teh conversation, and clearly not related to the subject of the block, then relaying messages only adds and does not detract from the discussion
pting has quit [Quit: Ex-Chat]
trung has quit [Excess Flood]
<Hanmac> sallybaby does this works on ObjC too ? Object.instance_method(:to_s).bind([]).call
trung has joined #ruby
<graspee> all this language rivalry stuff was just stirred up by Gavilan
macmartine has quit [Quit: macmartine]
<sallybaby> Hanmac: can i call a superclass method on a subclass (which has that method overridden) ? Yeah.
<sallybaby> savage-: that's the only use of the instance_method(blah).bind(instance).call pattern
<sallybaby> Hanmac: *
maesbn has joined #ruby
cdepue_ has joined #ruby
cdepue has quit [Read error: Connection reset by peer]
<Hanmac> maybe if i have a an inherit chain C < B < A .... can i call the method in A directy from C without going over B?
<Hanmac> in ObjC
maesbn has quit [Remote host closed the connection]
<sallybaby> Hanmac: [[self superclass] superclass] method]
banseljaj is now known as imami|afk
KL-7 has joined #ruby
<bnagy> these are all good points, sallybaby, but ObjC is butt ugly
<bnagy> which I think we can all aree is the most important criterion
fivetwentysix has joined #ruby
<sallybaby> hehe yeah
<vectorshelve> banisterfiend: Hanmac Hai :)
<vectorshelve> bnagy: Hai
<vectorshelve> where is shevy ?
nfluxx_ has joined #ruby
linus95014 has quit [Quit: linus95014]
<bnagy> vectorshelve: you're aware that I don't like you, right?
dhaskew has quit [Quit: dhaskew]
<vectorshelve> bnagy: NO
nfluxx has quit [Ping timeout: 244 seconds]
nfluxx_ is now known as nfluxx
KL-7 has quit [Client Quit]
bosphorus has joined #ruby
keanehsiao has quit [Quit: keanehsiao]
<hemanth> vectorshelve, gem install wikiquote; wikiquote :D
schovi has joined #ruby
<vectorshelve> hemanth: 3 gems in 3 days
Morkel has joined #ruby
<hemanth> vectorshelve, 4th one on it's way
test34- has quit [Ping timeout: 245 seconds]
<vectorshelve> hemanth: cadbury gems :D
<hemanth> vectorshelve, lol good one
maesbn has joined #ruby
fivetwentysix has quit [Quit: fivetwentysix]
fivetwentysix has joined #ruby
jimeh2 has joined #ruby
<vectorshelve> hemanth: fork this -> https://github.com/mithunsasidharan/algorithms
mucker has joined #ruby
<hemanth> vectorshelve, nice
<vectorshelve> hemanth: use this -> http://mitpress.mit.edu/algorithms/
jprovazn_away is now known as jprovazn
ph^ has quit [Remote host closed the connection]
<hemanth> vectorshelve, i have used that long back ;)
Eldariof-ru has joined #ruby
jimeh2 has quit [Ping timeout: 252 seconds]
zommi has joined #ruby
fivetwentysix has quit [Quit: fivetwentysix]
Prometheus has quit [Quit: leaving]
cwill747 has joined #ruby
ipoval has quit [Quit: ipoval]
Eldariof-ru has quit [Client Quit]
sparrovv has joined #ruby
kil0byte has joined #ruby
<kenneth> if i have a class in a variable, can i check that it is a subclass of Something::Something?
<kenneth> controller_class = Object.const_get(controller.to_s.to_camelcase+'Controller'); controller = controller_class.new
<kenneth> except i want to ensure that it's a subclass of Kenji::Controller, and return false otherwise
avandenhoven has joined #ruby
kaneda has joined #ruby
Eldariof-ru has joined #ruby
Seabass has quit [Read error: Connection reset by peer]
kaneda is now known as Guest98480
kil0byte_ has quit [Ping timeout: 252 seconds]
Seabass has joined #ruby
<bnagy> kenneth: in general, Don't Do That
<bnagy> as in test based on behaviour via respond_to? etc
<bnagy> however, you might be looking for kind_of?
<kenneth> hmm, i can't that's a fair point
<kenneth> i guess that's*
Seabass has quit [Read error: Connection reset by peer]
c0rn has quit []
emmanuelux has joined #ruby
Guest98480 has quit [Read error: Connection reset by peer]
Seabass has joined #ruby
<bnagy> like if someone extended your thing and made a different controller architecture etc etc (might never happen, but it's the philosophy that counts)
keanehsiao has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
<avandenhoven> I have two separat
poppiez has joined #ruby
<bnagy> %w( frob wiggle reverse_polarity ).all? {|m| some_obj.respond_to? m}
<avandenhoven> I have two separate machines running 1.9.3 that have the same problem. net/http is giving trying to run to_sym on nil.
<avandenhoven> in HTTP.start
davidpk has joined #ruby
schovi has quit [Remote host closed the connection]
laen_ has quit [Ping timeout: 265 seconds]
<bnagy> avandenhoven: I guess we'd probably need to see an example of the faulting user code, the exact error, and the source of the faulting method
<avandenhoven> jas
netogallo has joined #ruby
<kenneth> bnagy: return nil unless controller_class.responds_to?(:call) && controller_class.instance_method(:call).arity == 2 # ensure protocol compliance
<kenneth> that's more idiomatic, right?
JohnBat26 has joined #ruby
<bnagy> I think it's respond_to? not responds, and why are you returning nil? But yes. :)
laen_ has joined #ruby
piotr_ has joined #ruby
<bnagy> avandenhoven: ok... now can you paste the start methods around those linenumbers? I don't know if we're running the exact same net/http
<avandenhoven> ah sure.
<bnagy> although I think I do have a 1.9.3-head somewhere
igotnolegs has quit [Quit: Computer has gone to sleep.]
nfluxx has quit [Quit: nfluxx]
emmanuelux has quit [Read error: Connection reset by peer]
<avandenhoven> I just updated the gist.
davidpk has quit [Quit: Computer has gone to sleep.]
petercs has joined #ruby
emmanuelux has joined #ruby
<avandenhoven> Also its happening on a server that's _not_ using RVM so I think its not just a RVM thing
<avandenhoven> it also happened with -p0
<bnagy> well that's definitely potentially buggy
<bnagy> like if there is no method that hits that grouping then $1 will be unset
<deryl> its not an rvm issue. its a ruby issue, if there is one at all. rvm does nothing but automate the compile+install, and then set the env vars needed for that particular ruby
test34 has joined #ruby
<deryl> and throw in some dirs for/if you use gemsets
tomzx has quit [Ping timeout: 276 seconds]
<bnagy> avandenhoven: quick fix is to do key = $1.to_sym rescue next
simao has joined #ruby
<bnagy> but I have no idea what is causing the bug...you could inspect http.methods before the call to grep
<avandenhoven> bnagy: sure but its standard lib.. and it no different than 1.9.2
<avandenhoven> it feels… creepy… to monkey patch it.
test34- has joined #ruby
test34- has quit [Changing host]
test34- has joined #ruby
<bnagy> well I dunno what changed from .2 -> .3 that would affect that code, but it would be nice to understand the bug :)
<avandenhoven> bnagy: whats stranger is that the loop should never be entered, if grep doesn't find anything.
ph^ has joined #ruby
davidpk has joined #ruby
test34 has quit [Ping timeout: 272 seconds]
simao has quit [Ping timeout: 245 seconds]
davidpk has quit [Client Quit]
aakashvd has joined #ruby
aakashvd has left #ruby [#ruby]
<bnagy> avandenhoven: yeah but it can match without matching the grouping
davidpk has joined #ruby
<bnagy> oh shit wait...no it's + not *
<avandenhoven> I think its something else.
<avandenhoven> I did this in IRB:
<avandenhoven> 1.9.3p226 :001 > x = "test"
<avandenhoven> => "test"
<bnagy> I think the behaviour of $1 changed
<avandenhoven> 1.9.3p226 :004 > pp $1
<avandenhoven> 1.9.3p226 :005?> pp meth
<avandenhoven> 1.9.3p226 :006?> end
<avandenhoven> => []
InBar has joined #ruby
InBar is now known as Prz_^
<avandenhoven> no brain fart. I should have seen something.
beneggett has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<avandenhoven> I think that methods changed.
anekos has quit [Quit: Tiarra 0.1+svn-39036: SIGTERM received; exit]
<bnagy> %w(foo bar baz).grep(/f(\w+)/).each {|w| p $1}
<bnagy> nil
<avandenhoven> hmm.
anekos has joined #ruby
davidpk has quit [Ping timeout: 245 seconds]
<avandenhoven> ahh. that _is_ odd.
<bnagy> anyone got an old ruby to test? Same behaviour on 1.9.2p290
Karmaon has quit [Ping timeout: 276 seconds]
<bnagy> if you use select with a match it works
defendguin has left #ruby [#ruby]
blacktulip has joined #ruby
<bnagy> weird though, you'd think someone would have noticed
<Hanmac> bnagy i knew whats wrong :P
skogis has joined #ruby
<Hanmac> try this: %w(foo bar baz).grep(/f(\w+)/) {|w| p $1}
cdepue_ has quit [Remote host closed the connection]
<bnagy> ah ok, bad test :)
<avandenhoven> What's very odd is that the HTTP.start works in 1.9.2p180
<bnagy> avandenhoven: ok I think you need to inspect meth and $1 inside that grep block
<avandenhoven> I don't think that code is going to work _regardless_ unless net/http defines its own method method.
<avandenhoven> ("foo").methods.grep(/\A(\w+)=\z/){ |w| p $1 }
<avandenhoven> doesn't do anything either
ABK has joined #ruby
<Hanmac> avandenhoven ... "foo" does not have any = method so nothing is printed!
<bnagy> avandenhoven: well it clearly enters the block, I wanna know why :)
etehtsea has joined #ruby
<avandenhoven> Ah poope.
<avandenhoven> shouldn't compare immutable behaviours with mutable
<kenneth> will this not work?
<kenneth> controller_class = Object.const_get(controller_name.to_s.to_camelcase+'Controller')
<kenneth> return unless controller_class.respond_to?(:call) && controller_class.instance_method(:call).arity == 2 # ensure protocol compliance
<Hanmac> kenneth no does not work
looopy has quit [Remote host closed the connection]
<kenneth> oh, hmm. how would i do this, then?
<Hanmac> because respond_to need be called on the instance, not the class
<kenneth> ah
<Hanmac> controller_class.method_defined?(:call)
<bnagy> wth is to_camelcase?
<kenneth> aha
<kenneth> bnagy: something i mixed into string
CheeToS has quit [Ping timeout: 256 seconds]
Guest54524 has joined #ruby
<kenneth> to convert between between CamelCase and underscore_separation
emmanuelux has quit [Ping timeout: 264 seconds]
<Hanmac> bnagy its maybe rails thing :P
<bnagy> method_defined? doesn't distinguish between class and instance methods?
<kenneth> i don't use rails, luckily for my sanity
wilmoore has quit [Remote host closed the connection]
<bnagy> kenneth: if I were maintaining that coe I would be mad at you
<kenneth> i probably should refactor it
<bnagy> for to_camelcase :P
gregorg_taf has quit [Changing host]
gregorg_taf has joined #ruby
<bnagy> it's just split('_').map(&:capitalize).join, right?
gregorg_taf is now known as gregorg
<bnagy> I mean how often are you typing it? :)
wilmoore has joined #ruby
<kenneth> bnagy: actually that's exactly what it is
apeiros_ has joined #ruby
looopy has joined #ruby
<kenneth> except i've never seen this syntax before (&:capitalize)
<kenneth> oh, other question, does attr_accessor not work on children? my superclass has attr_accessor :kenji, but on the subclass i'm getting undefined local variable or method `kenji' for KudosController:Class
<bnagy> succint format for stuff where you're running a simple method on blockvars
<apeiros_> kenneth: you're calling it on the class, not an instance of it
<apeiros_> attr_accessor defines instance methods
<avandenhoven> bnagy. this is f'd up. On a whim, I recreated the behaviour of HTTP.Start in rib… and $1 is what you'd expect
<avandenhoven> Net::HTTP.new('http://www.google.com', 80).methods.grep(/\A(\w+)=\z/){ |w| p $1 }
jcromartie has quit [Read error: Connection reset by peer]
<bnagy> avandenhoven: patch the existing code, already! :)
jcromartie has joined #ruby
<Hanmac> kenneth: then do this: controller_class.instance_methods.include?(:call)
brianpWins has left #ruby [#ruby]
<apeiros_> s/instance_methods.include?/method_defined?/
jcromartie has quit [Read error: Connection reset by peer]
<bnagy> avandenhoven: I demand inspect-based debugging info!
<bnagy> 15:24 < bnagy> method_defined? doesn't distinguish between class and instance methods?
<Hanmac> avandenhoven: your line works for me ...
<apeiros_> bnagy: method_defined? is for instance methods
<apeiros_> if you want class methods, it's respond_to?
<robert_> apeiros_: hey hey. :D
<robert_> how's it goign?
elliot98 has quit [Changing host]
elliot98 has joined #ruby
<avandenhoven> Hanmac: I know… that's the bizarre part, its functionally identical to what HTTP.start would do.
<apeiros_> robert_: fine, n you?
francisfish has joined #ruby
<bnagy> apeiros_: ahhh I tested with File.oin, but it's also an instance method
<bnagy> which seems to be misdocumented :/
Prz_^ has quit [Quit: Leaving]
<bnagy> it's probably on IO or something...
<apeiros_> File.oin? o0
Prz has joined #ruby
<bnagy> nope... hrmm
<robert_> good, too.
<apeiros_> Method#owner tells you where it comes from
<robert_> working on an add-in pattern.
<apeiros_> also source_location, if it isn't native
<apeiros_> but I never heard of File.oin, doesn't seem to be a core method…
<bnagy> apeiros_: join :)
<apeiros_> aaaaaaah!
<apeiros_> File.join is a class-method only
<apeiros_> and accordingly: ruby-1.9.3-p194:016:0>> File.method_defined?(:join) # => false
<apeiros_> whereas: ruby-1.9.3-p194:017:0>> File.respond_to?(:join) # => true
<bnagy> File.instance_methods.include? :join => true
<apeiros_> you have messed up your ruby
<apeiros_> that's # => false here
chienpo has joined #ruby
<bnagy> :) that's why I was confused
<apeiros_> File.instance_method(:join).source_location
<apeiros_> and/or .owner
jjp has quit [Quit: Lost terminal]
<bnagy> File.new('foo').method(:join).owner => Enumerable
timonv has joined #ruby
<bnagy> trippy
<apeiros_> o0
<apeiros_> sounds like you've added that to Enumerable (or something that you load did)
<bnagy> jruby maagic
<bnagy> well, that was fun :)
kil0byte_ has joined #ruby
lolmaus has joined #ruby
xnm has quit [Ping timeout: 276 seconds]
<Hanmac> Enumerable.instance_methods.include?(:join) #=>false
<apeiros_> gah!
<apeiros_> use method_defined?
<apeiros_> there's no need to do a linear lookup when you can do a direct one
schovi has joined #ruby
odinswand has joined #ruby
<lolmaus> If arithmetic opeartors are method calls, does Ruby have some sort of special case for deciding on the order of arithmetic operations?
<apeiros_> lolmaus: yes. if you use the syntax sugared way of calling the methods, ruby uses precedence rules
<apeiros_> i.e., * before + etc.
brianpWins has joined #ruby
<Hanmac> bnagy: File.new('foo').method(:join).owner #=> NameError: undefined method `join' for class `File'
asdfqwer has joined #ruby
<lolmaus> apeiros_, but if i use the bulky syntax, it would use normal method call order?
<asdfqwer> working through koans atm
<apeiros_> lolmaus: yes
<bnagy> 3.+(4)./(2) => 3
<asdfqwer> why does this array array = [:peanut, :butter, :and, :jelly]
<apeiros_> 3 + 5 * 4 != 3.+(5).*(4)
kil0byte has quit [Ping timeout: 260 seconds]
<asdfqwer> evaluate as [:and, :jelly] for array[2,2]
<bnagy> Hanmac: yeah we already established all this :) It's jruby something
codespectator has quit [Quit: Computer has gone to sleep.]
<apeiros_> asdfqwer: why should it not? what did you expect?
<lolmaus> apeiros_, bnagy: thx
<bnagy> asdfqwer: what did you expect?
<asdfqwer> :and
<bnagy> that [2..2]
<asdfqwer> oh wait
<bnagy> *that's
<asdfqwer> i expected nil
<apeiros_> asdfqwer: reading the docs would have helped… it's array[offset, length]
<asdfqwer> oh
<asdfqwer> thanks
<bnagy> ok if you expected nil then I really can't help you at all :)
<apeiros_> you ask for 2 elements starting from the 3rd. 3rd element is :and.
<asdfqwer> didn't know there were parameters
<apeiros_> o0
mdw has joined #ruby
<rippa> maybe he expected array[2][2]
<rippa> as in, multidimensional array
<bnagy> yeah but that should be nomethoderror
tobym has quit [Remote host closed the connection]
<apeiros_> I'll never get why people don't read the docs when a method doesn't do what they expect
<avandenhoven> bnagy I found something… interesting
<apeiros_> seems like the logical next step
<asdfqwer> i was treating it like ranges
<bnagy> asdfqwer: why did you expect nil?
<asdfqwer> because i tought they were like index ranges
<bnagy> asdfqwer: ok but [2..2] should still be :and, right?
<asdfqwer> which derp happens to be the next koan
<asdfqwer> yes
<kenneth> okay, so i'm pretty much done rewriting my mvc framework from scratch
<avandenhoven> bnagy: I added http.methods.grep(/\A(\w+)=\z/){ |m|
<avandenhoven> puts "*"*80
<avandenhoven> puts m
<kenneth> halved the lines of code :)
<avandenhoven> p $1
<avandenhoven> p $1.to_sym
<avandenhoven> }
<avandenhoven> to my monkey patch and its choking on open_timeout=
<bnagy> asdfqwer: by the way, when you discover that a[4,1]==[] and a[5,1]==nil, IT IS NORMAL
<bnagy> avandenhoven: ok weird
<avandenhoven> yes
<cjk101010> hm… I'm running a slow query with Rails 3.2 on postgresql. this results in a query EXPLAIN SHOW max_identifier_length which leads to a syntax error
<cjk101010> how can I prevent AR on running this query?
<cjk101010> *from
<bnagy> cjk101010: you might want #rubyonrails
<cjk101010> ok, thanks :)
JohnBat26 has quit [Remote host closed the connection]
chienpo has left #ruby [#ruby]
<bnagy> avandenhoven: so when you inspect meth it's open_timeout= and $1 is nil, or what?
<avandenhoven> yeah
krz has quit [Quit: krz]
<bnagy> wtf
<bnagy> can you inspect http.methods before the block as well, and add the output to that gist?
<bnagy> this is bizarre :)
bluenemo has joined #ruby
bluenemo has joined #ruby
ukwiz has joined #ruby
codespectator has joined #ruby
nilg has joined #ruby
_br_ has joined #ruby
jimeh2 has joined #ruby
KL-7 has joined #ruby
gilead has joined #ruby
<Seabass> my first ruby =) http://pastebin.com/biLbGVNg
BiHi has joined #ruby
<bnagy> player2['hp'] = player2['hp'] - (player1['atk'] - player2['def']).abs is buggy :)
<Seabass> why?
<Hanmac> imo: player2['hp'] -= player1['atk'] - player2['def'] if player1['atk'] > player2['def']
<bnagy> cause if atk==def then 0 hp lost, but if def > atk you lose hp
<Seabass> ooooh
<Seabass> i see
<bnagy> Hanmac: you shouldn't just SOLVE it for him, he's LEARNING ;)
<Seabass> other than that, not bad for first script huh? =)
roolo has joined #ruby
<bnagy> I've seen a lot worse
<Hanmac> bnagy ... sorry i am like a calcuator in SOLVER mode .P
zz_chrismcg is now known as chrismcg
<bnagy> Seabass: but it's still horrible, objectively ;)
gentz has quit [Read error: Operation timed out]
<Hanmac> for the very first time its not SO bad
gentz has joined #ruby
<bnagy> oh it's good for a first script
<kenneth> hey guys, i'm curious what y'all think, if you could critique my first ruby open-source project: https://github.com/kballenegger/kenji
<kenneth> this is mostly something i've been working on for myself. i'm using it as the backend to some personal projects and for my blog
<apeiros_> kenneth: I think the premise is spot-on (split architecture client/server)
<fowl> Seabass, now put some graphics to it: http://libgosu.org
<Hanmac> fowl nice adverticing .P
odinswand has quit [Quit: Computer has gone to sleep]
Vainoharhainen has joined #ruby
thecreators has quit [Quit: thecreators]
<Seabass> anyone here like me learning Ruby so they can try to begin to start to think about trying to make Final Fantasy Tactics type game with RPG Maker?
bluOxigen has joined #ruby
<arturaz> jruby/scala collections wrapper if anybody is interested: https://github.com/arturaz/jruby-scala-collections
simao has joined #ruby
<fowl> Seabass, rpg maker is whack
<fowl> use gosu, make games in ruby
<Seabass> why do you say that fowl?
<fowl> all those tools will do is hold you back, you will gain a lot from writing the game yourself
<Seabass> fowl, it is true I would like to have full use of my own engine
<apeiros_> iirc rpg maker has some serious limitations on how you can use ruby. which is sad.
<robert_> http://codepad.org/mkx3P4tx <-- why is GenericAddin still having it's methods called from FooAddin?
mneorr has quit [Remote host closed the connection]
yonggu has quit [Remote host closed the connection]
emmanuelux has joined #ruby
yonggu has joined #ruby
<robert_> banisterfiend: hai
<robert_> shevy: still here? :p
<banisterfiend> robert_: sup
<robert_> nada. wondering why my code doesn't appear to call the derived methods.
<Seabass> shevy was on earlier
<robert_> yeah
mucker has quit [Ping timeout: 276 seconds]
mucker has joined #ruby
chson has joined #ruby
bluenemo has quit [Read error: Operation timed out]
<kenneth> apeiros_: yeah, one of the things that drove me to write this. i wish more people emphasized that approach
<apeiros_> kenneth: working on something similar. not very seriously, though
<apeiros_> currently mostly on the client side and the issue of decentralized data generation
pdelgallego has joined #ruby
hoelzro|away is now known as hoelzro
<apeiros_> (offline mode)
macer1 has joined #ruby
<avandenhoven> bnagy: I'm going to have to call it a night soon (its 0130 over here) I'll update the gist as I find interesting things (and very little seems interesting, at this point).
<robert_> anybody?
<bnagy> avandenhoven: cool
macer1 has quit [Changing host]
macer1 has joined #ruby
brianpWins has quit [Quit: brianpWins]
<kenneth> yeah. i'm more focused on the back-end side, since i'm more of an architect. the idea is making good architecture one kenji-init away
MissionCritical has quit [Ping timeout: 272 seconds]
<robert_> I'm not at all sure why my class hierarchy doesn't appear to work.
<apeiros_> kenneth: so how do you deal with the offline-mode aspect?
<kenneth> it takes surprisingly little code to make kenji work actually. something like 200 lines or so
<kenneth> right now, i don't. i leave it up to the user to find a client-side architecture that will deal with the problem, written by people smarter than i am
<apeiros_> hm, ok. I think it'd be crucial for such a framework, to offer that kind of functionality
<kenneth> yeah probably
<apeiros_> kenneth: btw., why inheritance?
<apeiros_> why not use a module based approach with extend/include?
<kenneth> not sure, didn't really occur to me. i guess it would have worked practically the same way?
<apeiros_> yes, but opening up more possibilities :)
Edijus has joined #ruby
Luisa has joined #ruby
nkbuff has joined #ruby
<avandenhoven> bnagy: I've updated the gist with the results (btw, adding rescue next just moves the error some place else)
<avandenhoven> I'm off.
nkbuff has quit [Client Quit]
avandenhoven has left #ruby [#ruby]
<Edijus> Hello. I am writing program for building construction company (they mainly do decoration/small work) for my school project. I need my program to have database, because it is requirement. Any ideas what to store in the DB? Don't offer book-keeping stuff, since I did it last time. Thanks
<kenneth> apeiros_: like what? (i'm curious, not that intimately familiar with ruby. i wrote mostly php and objective-c for work)
tatsuya_o has joined #ruby
<apeiros_> arbitrary base-classes
<kenneth> ah yes
<kenneth> that makes sense
<kenneth> well, should be easy enough to refactor, i think
<bnagy> Edijus: was that a ruby question, or a 'what kind of things can I put in a DB' question?
<Hanmac> apeiros_ with rubys module based system its possible that one ruby objects is multible c++ objects at the same time :P
<Edijus> bnagy: Second one. I do not know where to search for help.
<phipes> i have a modular sinatra app, which has a config.ru and a separate file that contains: puts …, i want to see the output in the terminal but i don't know how
<bnagy> Edijus: ok do an inventory system or something, then, they're pretty easy
Mission-Critical has joined #ruby
workmad3 has joined #ruby
greyEAX has quit [Read error: Connection reset by peer]
bluenemo has joined #ruby
ryanf has quit [Quit: leaving]
mucker has quit [Read error: Connection reset by peer]
greyEAX has joined #ruby
Mission-Critical is now known as MissionCritical
bluOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
vjt has quit [Ping timeout: 272 seconds]
zv has joined #ruby
nilg has quit [Remote host closed the connection]
ciopte7 has quit [Quit: ciopte7]
netogallo has quit [Ping timeout: 245 seconds]
dzhulk has quit [Quit: Leaving.]
<shevy> robert_ heya, was at university, just got back
Luisa has left #ruby ["Sto andando via"]
<robert_> aha. :D
<robert_> shevy: http://codepad.org/mkx3P4tx <-- any idea why GenericAddin is still having it's methods called instead of FooAddin's re-definitions? :/
<shevy> hmm
<shevy> I am surprised you define @ivars in a module!
<robert_> yeah I borrowed some of it
<robert_> and now I'm making it my own, heh
<shevy> lemme first try to understand what's going on...
<robert_> alrighty.
<Seabass> wb shevy, got my first script done http://pastebin.com/biLbGVNg
<Seabass> had help on a bug tho
<shevy> cool Seabass
zv has quit [Quit: Page closed]
<shevy> Seabass (a) you should however indent properly and (b) pls use pastie.org, it has colours
PragCypher has quit [Read error: Connection reset by peer]
kawa_xxx has joined #ruby
PragCypher has joined #ruby
<shevy> I show you how pretty it looks on pastie.org
<Seabass> shevy ok I'll use pastie.org
<robert_> pastebin sucks
<robert_> :p
<Seabass> yeah, down with pastebin!
<shevy> Seabass, http://pastie.org/3954574
<shevy> Seabass, btw... you can also see that your first class is ok
kichawa is now known as aaaaaKichawa
<shevy> because it is short and succint
<shevy> the second class crams quite a lot of information into initialize
<shevy> Seabass for instance, I would put the while loop into a method, and call that method from within initialize
<shevy> ewww
<shevy> I made one indent mistake myself :P
<shevy> round = round + 1 should be two ' ' to the right
<shevy> but see, you can instantly see that on pastie.org! on pastebin not so much
<shevy> ok robert_ now to you hehehehe
<graspee> isn't round += 1 nicer?
wookiehangover has quit [Ping timeout: 260 seconds]
<robert_> :p
<shevy> yeah that too
aaaaaKichawa is now known as kichawa
<shevy> robacarp, so you use @addins ... which is a hash, storing other hashes
<robert_> yeah
<robert_> it stores categories of add-ins
<shevy> robert_ the first thing that confuses me
<shevy> if you use @ivars in a module, they are not available in a class, or?
<robert_> well here's where I got it. I was looking for a nice plugin pattern
Edijus has left #ruby [#ruby]
<shevy> @addins[Addin][:instance] = eval("#{object}.new")
<shevy> I think I did something like that once as well
<shevy> :)
<shevy> but I found eval to be somehow annoying
<Hanmac> shevy: why do you use eval?
<shevy> robert_ did you write this code?
<shevy> Hanmac not my code! i copy pasted into irc
<shevy> Hanmac, I am not sure why I once used it
<shevy> ohhhh
<shevy> I still use one instance of eval in my code
<shevy> diamond_shell/base/menu.rb: self.instance_variable_set(i_var.to_sym, eval(second_var))
<shevy> to somehow set instance variables or whatever, dont remember
netogallo has joined #ruby
gilead has quit [Ping timeout: 244 seconds]
<Seabass> shevy attempting to put while loop in method to be called from within initialize
<Seabass> shevy will report back when finished
emmanuelux has quit [Ping timeout: 264 seconds]
bluOxigen has quit [Read error: Connection reset by peer]
blueOxigen has joined #ruby
<Hanmac> Seabass: @addins[Addin][:instance] = @addins[Addin][:class].new
<Hanmac> oh sorry it was not your code
<shevy> Hanmac I think this is robert_ 's code
<Seabass> Hanmac: ?
<Seabass> yeah not meh code
<shevy> hehe
<robert_> shevy: I based it on something I found. :p
<banisterfiend> shevy: hello :P
<shevy> robert_ hmm
<shevy> looks very railsy
<robert_> hmm
<robert_> is there a better pattern I could use?
ukwiz has quit [Quit: Leaving]
<Hanmac> robert_ its not soo bad, only the eval is crap
<shevy> Hanmac is nice, I find this all hard to understand
JohnBat26 has joined #ruby
<robert_> hm?
<hoelzro> does anyone else find it funny that that URL ends in .php?
<shevy> robert_ the plugin structure, I find it really complicated
<shevy> hoelzro, well, not funny, more sad. if I were matz, I'd make ruby the language to dethrone php on the www, but now he is busy with mRuby...
netogallo has quit [Read error: Connection reset by peer]
<shevy> and I mean ruby... not just one pattern like rails
netogallo has joined #ruby
<robert_> shevy: if you've got a better pattern, then I'll use it. How would you implement dynamically-registerable add-ins that can choose register as a part of one (or more) categories?
etehtsea has quit [Ping timeout: 240 seconds]
<shevy> robert_ dunno. I dont even understand the question :) I would probably keep one @ivar in my class to deal with these add-ins. I think it would be easier to see how such a plugin would look like
piotr__ has joined #ruby
<shevy> and what it wants to add or modify where
piotr_ has quit [Ping timeout: 276 seconds]
<robert_> okay, but isn't that what the module (again, I lifted his idea.. not sure if I like it yet) is supposed to work?
<robert_> the issue is that when I .new my object instance, I get basically a copy of the base plug-in interface
bglusman_ has joined #ruby
bglusman has quit [Read error: Connection reset by peer]
codespectator has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
netogallo has quit [Ping timeout: 248 seconds]
<shevy> yeah
<shevy> I did something similar once
gilead has joined #ruby
kawa_xxx has quit [Remote host closed the connection]
<robert_> I see. how'd that work?
francisfish has quit [Remote host closed the connection]
<robert_> (how well, rather)
<shevy> I registered an array similar to ... ["file-location/comes/here/bla.rb"] and then used that name, as class name
<shevy> so bla.rb would be Bla.new
francisfish has joined #ruby
<robert_> I see.
<robert_> basically, I don't know what the names of the plug-ins are; only that they have one orm ore categories.
<robert_> or more*
fjfish has joined #ruby
<shevy> hmm can we specify it better. let's say, there is a plugin called "house"
<shevy> this house has three categories: rich, luxurious, shiny
<robert_> alright.
<shevy> hmm
<shevy> now we register it
pdelgallego has quit [Remote host closed the connection]
<shevy> robert_, we would register the name of that plugin, and the categories I suppose
pdelgallego has joined #ruby
<Seabass> it should have an 'opulent' house too!
<shevy> but we could ask the plugin for its categories, like via .categories
<robert_> Yeah, as I was attempting to do
tonini has quit [Remote host closed the connection]
<shevy> and the name could be the filename -> class_name
<robert_> yeah
<robert_> which would get all included and such
<shevy> hmm
<shevy> included where to?
<robert_> oh
<robert_> right
<robert_> nevermind
eurek has joined #ruby
<shevy> no I mean
<robert_> I was thinking of something else, lol
<shevy> perhaps there is a purpose for that, I dont know yet
nilg has joined #ruby
francisfish has quit [Ping timeout: 260 seconds]
<shevy> now we need to be able to instantiate it, I suppose
<shevy> (if it is a class)
<robert_> yes.
<shevy> this is done via eval here
<shevy> Hanmac, know of another way?
<shevy> @addins[Addin][:instance] = @addins[Addin][:class].new
<shevy> ahhhh
<shevy> I know, I think
<shevy> const_get should work
<Seabass> i need a better IDE than windows notepad, something that has colors like pastie.org
<robert_> alrighty.
<shevy> robert, something like ... house = Object.const_get("house".upcase)
<shevy> sorry
<shevy> house = Object.const_get("house".upcase).new
<shevy> I think that should work
<shevy> if you store this in an array, or a hash, you wont need the "house" variable name
<Hanmac> Seabass under windows you could use notpad++ for coloring
<shevy> your_array_or_hash << Object.const_get("house".upcase).new
<shevy> well
<shevy> not quite what I wanted to say hehe
<robert_> heh
<shevy> hash["house".upcase] = Object.const_get("house".upcase).new
<shevy> something like that
closedbracket has quit [Remote host closed the connection]
<Seabass> ty Hanmac
closedbracket has joined #ruby
<robert_> yeah
<shevy> but I think the main point is that eval() can be avoided, and I think that is good
macer1 has quit [Read error: Connection reset by peer]
<shevy> remember, eval() makes Hanmac sad
<shevy> he has to stop coding and tears run down his face for a whole minute
<shevy> Seabass you could try notepad++
<kalleth> wait, eval() ?
<shevy> I am not sure about the colours. as an editor, on windows, it is quite ok though
<kalleth> surely eval() is just the worst, ever
<kalleth> and use vim
<kalleth> not notepad++
<shevy> kalleth people read those articles and learn from them :(
<kalleth> that's ok
<kalleth> i've got some horrifying stuff on my blog too, i'm sure
<kalleth> Seabass: www.vim.org
<Seabass> shevy already installing =)
<kalleth> ;)
<shevy> kalleth dunno, some blogs are quite nice
<Seabass> notepad++
<shevy> I liked petercooper's one
<kalleth> shevy: <pimp> www.trdev.co.uk </pimp>
<shevy> also imperator for ruby on windows
<kalleth> its wordpress on a shitty vps, so it will go down frequently if too many people access it (fuck wordpress)
Prz is now known as celm
<shevy> but especially among the rails-guys, there seems to be more quantity than quality
<Hanmac> if someone you eval on an online server i try to use "system('rm / -rf')" as name
sgronblom has joined #ruby
<kalleth> hahahha, Hanmac
apeiros_ has quit [Remote host closed the connection]
<kalleth> partyvan time
<kalleth> wait, what
<kalleth> what is that dude trying to do
<kalleth> allow users/coders to write plugins that will work with his system?
<sgronblom> Can I run a statement in rdebug? Or do you just p it?
<shevy> kalleth from that blog article http://www.devco.net/archives/2009/12/01/ruby_plugin_architectures.php the guy uses eval "NameOfClassHere.new"
<shevy> where the name is somehow dynamic
<Tasser> fail
moosya has quit [Quit: moosya]
jbw has quit [Ping timeout: 252 seconds]
<shevy> rescue
<shevy> but yeah
<kalleth> puts $!.backtrace.join("\n")
<shevy> it's a big fail, too big to rescue
nsg has joined #ruby
<Tasser> it's derived from Exception ;-)
<kalleth> sorry, i thought we were doing some kind of join
wookiehangover has joined #ruby
<Tasser> ... not from standarderror ;-)
ramblex has joined #ruby
<shevy> kalleth we can always join together with banisterfiend at the beach
<Tasser> had some code once that did rescue Exception
<robert_> kalleth; something like that. I just can't anticipate what I may need from an add-in later on.
<banisterfiend> shevy: i'm at the beach right now.
<shevy> robert_ is coding in the future :)
<robert_> yeah :p
<kalleth> robert_: then erm, you code it in when you need it?
<kalleth> YAGNI
<kalleth> etc
<shevy> "We may have to visit other solar systems one day, so lets use an array that holds all our planets"
<kalleth> shevy: no, no, no, you don't do that
<robert_> haha :p
<kalleth> use a hash that has :sol => [earth, venus, mars], so we can have other identifiers!
<shevy> banisterfiend I know... but I am trying to trick kalleth into thinking I go with him, instead he'll go alone AND THEN MEET YOU AT THE BEACH!!!
netogallo has joined #ruby
<kalleth> and extend it up to :milkyway => {:sol => []}!
<kalleth> FUTUREPROOF
<shevy> hehe
<banisterfiend> shevy: i'm topless sunbathing
<kalleth> oh, and it has to send email too
looopy has quit [Remote host closed the connection]
<kalleth> banisterfiend: there are lots of swearwords that I want to call you right now
<shevy> I'm going to use that as advertizing... I can claim that "I write futureproof code."
<kalleth> just sayin'
<shevy> banisterfiend when you announce those things, noone is going to fall for that and come
pdelgallego has quit [Read error: Connection reset by peer]
<banisterfiend> kalleth: choose 1
<kalleth> i'm inside a boxlike air conditioned office, you cockslut ;(
pdelgallego has joined #ruby
<shevy> lol
<Hanmac> kalleth your world will be much nicer if you banish the fiend
pdelgallego has quit [Read error: Connection reset by peer]
<shevy> it's really air conditioned?
<kalleth> yep
pdelgallego has joined #ruby
<kalleth> except the aircon sometimes works, sometimes doesn't
<shevy> cool... I have to open the window so it does not get too hot here :(
<Seabass> kalleth Vim looks like leet hacker console stuff
<kalleth> Seabass: thanks :)
Zoxc has quit []
gilead has quit [Quit: Leaving]
<kalleth> it does have a pretty vertical learning curve, but you should try to get used to it at some point, it's so so so good
<kalleth> but not if you have a project with a deadline
<kalleth> use notepad++ for that
<kalleth> :p
<shevy> Seabass, you could also try other editors, but if you only need colour highlighting, then I think most editors will suffice
<kalleth> or even :spit: emacs
jonathanwallace has joined #ruby
<shevy> I used http://www.crimsoneditor.com/ 10 years ago on windows :)))
<kalleth> C-a C-z C-p S-a C-xCA-a *goes to A&E to fix broken claw hands*
<Tasser> kalleth, let's say, ruby-mode on emacs sucks compared to ruby in vim :-/
pdelgallego has quit [Client Quit]
<kalleth> Tasser: i've never used it, i'm being facetious
jackiechan0 has joined #ruby
<Seabass> shevy well I hope the color will help me figure out how to make my program run like it did after making that while loop a method
<shevy> gvim is semi-ok, my biggest problem with vim is that a new user has to learn so much
<kalleth> yeah, shevy, i hate that
<shevy> Seabass 100% it will!
<kalleth> it means I can't seriously suggest people use vim :(
gilead has joined #ruby
<kalleth> Seabass: when your code is all green, that means you missed a "
<kalleth> just sayin'
<Tasser> kalleth, evil is fine, org-mode is awesome :-)
<kalleth> Tasser: *shrug* VimOutliner
<Seabass> i want more colour contrast on notepad++ to show more
<shevy> Seabass btw another editor is geany. while they still are not really top-quality, they are quite active, also on IRC #geany and they always help. it has a few "missing features" though, but it is for sure better than simple notepad alone - here is how it looks on windows http://www.geany.org/uploads/Gallery/geany_win32.png
<Seabass> more syntax or elements
<shevy> it looks better on linux, one of the few that does ... :P
<Tasser> kalleth, are the export options as fancy as for emacs?
<shevy> another editor that looks nice visually is sublime
<robert_> I actually do need it. I remembered I'm working on a project that I need to deploy add-ins for and I don't want to mess up the design, lol. (sorry, I'm out of it right now)
<shevy> and redcar is an editor written in ruby (but requires java)
<kalleth> Tasser: *shrug*
<kalleth> i use it for checklists
<kalleth> thats pretty much it
<Tasser> I use it for presentations, that's why
<kalleth> wait, what
<shevy> cool
<shevy> presentations in vim?
<Tasser> shevy, nah, emacs -> beamer -> okular
<shevy> ah
fermion has joined #ruby
<shevy> I see I see
<Seabass> lol, newcomer asks for advice, IDE flamewars begin
<Tasser> Seabass, I wouldn't say vim/emacs is an ide
<kalleth> i properly don't give a flying
<kalleth> yeah
<shevy> Seabass, the thing to remember about vim vs. emacs is that in the end both suck
<Tasser> kalleth, but I have to fully agree with anyone who says the editor in emacs sucks :-)
<Seabass> rofl, you guys crack me up
noodletraveler has quit [Ping timeout: 260 seconds]
<shevy> emacs is a good OS
<kalleth> if i desperately wanted an IDE with step-through debugging i'd look at rubymine or netbeans (possibly)
<Tasser> it's an application framework
<kalleth> if i wanted to edit text files, i'd use vim
<kalleth> and if i didn't use vim, i'd use sublime
kawa_xxx has joined #ruby
<Seabass> i got notepad++, used to use it for HTML, and now i remembered it, so it was the first thing I grabbed
<shevy> not emacs kalleth ?
<kalleth> shevy: :p
<graspee> sublime is $59
<kalleth> we had 1 dev on our 5 person team
<kalleth> who used emacs
<kalleth> everyone else was vim
<kalleth> removing the 'apt-get install emacs' from the dev mode build scripts was awesome when he left
<shevy> Seabass, well... I think the most important feature about an editor is to not be annoying... and the second most important feature is proper syntax highlighting
<kalleth> interestingly, it freed up about 170 meg on the built image ;)
<shevy> then some more features I want to have are... - tabs ... - ability to search (and replace) easily
<Tasser> kalleth, dev mode build scripts? TRAMP?
<shevy> - ideally being able to redefine keybindings in any way I see fit
<Seabass> shevy, i feel the same way, and notepad under windows accessories wasn't cutting it
<kalleth> http://www.sublimetext.com/2 it's free for eval, but you should buy a license if you like it
<kalleth> Tasser: i'm going to have to look that up, sec
<shevy> sublime looks nice visually
Solnse has quit [Read error: No route to host]
<kalleth> TRAMP: "Transparent Remote (file) Access, Multiple Protocol", a software package allowing remote file-editing in an Emacs-style environment
<kalleth> that what you mean, Tasser ?
<shevy> it confused me a little though when I tried it, dont know why. my workflow in ruby is really strange... even vim confuses me
berserkr has joined #ruby
<kalleth> my workflow in ruby is ggVG=wq
<Seabass> i wish pastie had a editor to download
<Seabass> I really like the highlighting there
<shevy> yeah kalleth ... vim is in your brain
<Tasser> kalleth, gg=G ?
noodletraveler has joined #ruby
<kalleth> Tasser: that works too
<shevy> for me, vim is not yet in the brain, it is somewhere else
<Seabass> I get the feeling gg=G is a local meme/inside joke here
jbw has joined #ruby
<kalleth> no, vim commands, Seabass
<shevy> Seabass, vim kinda uses keys as instructions... I dont know what this does but I think it selects-all or something like that
<kalleth> gg is 'top of file'
<shevy> Seabass, dd10 for instance deletes 10 rows in vim
<Tasser> Seabass, move to the beginning of the file, reindent the next move, move to end of file
<kalleth> =G is autoindent to the end of the file
<graspee> is there a way of getting sublime to match parens in a different way than just underlining them?
<shevy> yeah, I can never remember all those keybindings
SPYGAME has joined #ruby
<Tasser> shevy, mussle memory
<kalleth> ggVG is go to top of file, shift-V is visual select, G is to end of file, then = is highlight selected
<kalleth> muscle memory being why i use ggVG= rather than gg=G
<shevy> Tasser hehe I think I am too old now :( it was easier when I switched to linux
<Tasser> shevy, you're never too old ;-)
<kalleth> i wouldn't say that
<shevy> :)
<shevy> I've become much more conservative
<Seabass> =( shevy Fight.battlecalc(player1, player2) won't work either. I'm just trail and erroring different combinations of class.method or method.new.class lol
<Tasser> needs less energy?
<shevy> I try to learn only a little bit, and rather spend more time improving the little things I already know
PragCypher has quit [Read error: Connection reset by peer]
<kalleth> i was coding round my father the other day and he was all like
<shevy> yeah Tasser that too, but also because often enough things can be frustrating
trivol has joined #ruby
<kalleth> 'what are you doing, hacking the planet?'
<shevy> lol
PragCypher has joined #ruby
<shevy> Seabass, that sounds as if you try to use a class method
<shevy> if you want to use a class method, you could do:
<shevy> class Foo
<shevy> def self.test
<kalleth> BOSS MODE
<shevy> puts 'doing something here'
<shevy> end
<shevy> end
<shevy> Foo.test
d3c has joined #ruby
<graspee> coding round my father sounds like an updated version of voyages round my father or whatever that was called
<kalleth> c-c-c-combo breaker
<shevy> you see Seabass ?
<bnagy> kalleth: I have a list of vim stuff that is old habits (like $a.. instead of A...) so I just make myself redo the edit when I notice
<bnagy> otherwise you never improve
dzhulk has joined #ruby
<shevy> Seabass ah I see what you mean
<shevy> Seabass typically you store data in instance variables
tresk has joined #ruby
<shevy> in your example, @player1 = player1 could work
<kalleth> bnagy: i'm at about 105% of my productivity in an alternate editor, and i find it flows easier atm
<shevy> I show you that part quickly
dzhulk has quit [Client Quit]
<kalleth> bnagy: so i improve slowly, maybe 1 new cmd per week or 2 weeks
<graspee> most of the big editors are not keyboard layout agnostic though so on dvorak i have various useability issues
sparrovv has quit [Ping timeout: 248 seconds]
<Seabass> shevy so my code is working just not relaying any info back because it executes and doesn't save it anywhere?
ramblex has quit [Quit: ramblex]
<bnagy> kalleth: HERESY!
<graspee> e.g. to take a basic example- vims movement keys, not so nice on dvorak layout
<shevy> Seabass, this should work (I did not test it, hopefully no error though): http://pastie.org/3954769
<bnagy> graspee: that's what the arrow keys are for :D
<graspee> another example, to exit emacs is ctrl x ctrl c. quite easy on qwerty, nasty on dvorak
<shevy> Seabass yeah, when you call the second method, it won't know those variables
<bnagy> btu I guess if you're using dvorak you're not so keen on moving your hand over there :/
<graspee> using the arrow keys defeats the object of The Vim Way
<shevy> Seabass one thing though
<shevy> Seabass, in def initialize, just add "battlecalc" as last part
<kalleth> bnagy: :P
<kalleth> bnagy: ARROW KEYS?
<kalleth> hjkl
<kalleth> tyvm
jackiechan0 has quit [Ping timeout: 248 seconds]
<graspee> that's the point
<bnagy> yeah oddly, I use them playing nethack, and I am completely fluent, but I use arrow keys when editing
<Seabass> nethack the roguelike bnagy?
<kalleth> actually
<kalleth> yes
<kalleth> i use arrow keys too
<kalleth> =[
<bnagy> hahaha
<kalleth> i was being sarky
<kalleth> i'm not 3l33t (haha, hackers) enough to use hjkl
<shevy> Seabass, for instance http://pastie.org/3954777
<kalleth> talking of hackers, /me queues on sabnzbd so he can watch tonight
<bnagy> Seabass: yes. What other nethack is there? ;)
<graspee> billions
kil0byte has joined #ruby
<shevy> Seabass you probably won't need the arguments in battlecalc though. I mostly suggested a method, so that the logic is easier to see
<graspee> oh you meant other programs called nethack nvm then. i mean there are lots of variants of nethack
<shevy> is there a ruby version of nethack?
<bnagy> this afternoon's "make stuff work" spree is going to cost me hours of refactoring :(
<graspee> no
<shevy> :(
<graspee> there are roguelike games written in ruby
<Seabass> shevy it is good for me to have this exercise and see more program stucture so it will click in mah brain
<graspee> but not nethack
<shevy> hmm
<shevy> more roguelike games?
<Seabass> I like roguelikes
<shevy> I too but I want them to be in ruby
<graspee> there are hundreds of roguelike games
<shevy> I really dont feel like going into C
<graspee> just this year in the 7 day roguelike competition there were 63 entries i think
kil0byte_ has quit [Ping timeout: 240 seconds]
<shevy> coooool
<Seabass> My stepdad made me play Kroz and Zork and Hack original version 1.0.3 or somethin
<bnagy> zork!=roguelike
<Seabass> and I played a pretty big Lord of the Rings one too. it was pretty massive
<graspee> moria?
<Seabass> Yeah that's it
<workmad3> Seabass: roguelike is not the same as text-based adventure
<workmad3> both are fun though :)
<Seabass> textbased adventure is called a mud right?
<bnagy> nethack is good for the soul
<workmad3> no
<graspee> only multiuser ones
<graspee> mud stands for multi user dungeon
<bnagy> tiny error or lapse in concentration -> INSTANT HORRIBLE DEATH
<workmad3> multiuser text-based rpgs are MUDs
<workmad3> text-based adventures are... text-based adventures :)
<shevy> good old days of MUDs
<Seabass> I didn't that like that one "You stand at the precipice of a great cliff, what do you do next?"
<shevy> most written in C or C variant, none really in ruby
<shevy> :(
<graspee> the answer is of course "toss myself off"
<shevy> Seabass, "I scratch my ass and wonder about the world."
<workmad3> shevy: mostly because they were written before ruby was released :P
<Seabass> shevy maybe I'll help fix that shevy
<bnagy> shevy: woo LPC, like C but fucked-er
<shevy> yeah bnagy
<workmad3> at least, all the famous ones were
<Seabass> seems like I've started on a basic text-based adventure already shevy
<workmad3> (it's hard to get a famous text adventure nowadays)
<graspee> vim is a text adventure
<Mon_Ouie> Hanmac: Here's an example of transliterating: Iconv.iconv("ASCII//TRANSLIT", "UTF-8", "été") # => ["ete"]
<shevy> though LPC was kinda nice in that you could call methods on objects in some way... clone("/std/humanoid/orc")->move("/village/pub")->command("kill human");
<Seabass> i remember that word from french class
petercs has quit [Ping timeout: 276 seconds]
mlevin_ has joined #ruby
<shevy> Seabass, ged (from #ruby-lang) wanted to start faerie-mud years ago, they had a really cool concept and wanted to use ruby
<shevy> but it kinda died more or less too
<shevy> oops
<bnagy> shevy: write a mu* in celluloid :)
<shevy> he is here too!
nfk has joined #ruby
<shevy> on #ruby
<shevy> :)
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
nilg has quit [Remote host closed the connection]
<Seabass> ged ?
abionic has joined #ruby
<shevy> yeah ancient ruby guy
<shevy> like bnagy :P
<bnagy> pff I'm not _that_ old
<shevy> bnagy used ruby before matz even wrote it!!!
<shevy> that's how I found the linguistics module btw... from faeriemud
<shevy> "mouse".en.plural # => "mice"
<shevy> Seabass so if you ever need proper english, the Linguistics module should help
Seabass has quit [Read error: Connection reset by peer]
odinswand has joined #ruby
blueOxigen has quit [Read error: Connection reset by peer]
bluOxigen has joined #ruby
Seabass has joined #ruby
<Seabass> lol I tried to /query ged and my XChat froze
ABK has quit [Ping timeout: 252 seconds]
<shevy> hmm
<shevy> the silverex build of xchat on windows was not 100% perfect for me either
<graspee> i'm an irssi man
<shevy> on linux that works, but you can actually hover with your mouse over a name, then press right mouse button, and pick up query from there
<shevy> but dont worry, if ged is around, he'd say something. he probably is sleeping like a fat cat in his bed right now
<graspee> or you could just type /msg ged hello
<shevy> :P
<graspee> maybe that will work if query doesn't
<graspee> who knows
<shevy> poor ged
<shevy> getting bombarded with messages and never will be able to find out why!
<shevy> perhaps if enough /msg are sent, his system would crash :>
<graspee> i doubt if he has it set up so that when someone mentions his name on irc he gets an electric shock in bed
<Seabass> perhaps if enough /msg are sent, and his name is mentioned on irc, he gets a shock enough times...
<shevy> graspee now that would be something!
pdtpatr1ck has quit [Quit: pdtpatr1ck]
<shevy> graspee you know that feeling on IRC when you sometimes feel like reaching out and gently hold the neck of someone else?
tvw has joined #ruby
<graspee> no. is that a pron thing?
<Seabass> graspee lol
<shevy> an idea pioneered there ^^^
<Seabass> shevy lol
<graspee> i feature in that quote
<shevy> whoa
nsg has quit [Quit: leaving]
<shevy> graspee kinda like famous!
<graspee> it was a long time ago
<graspee> it was the olympics but which one? i think 2000
gilead has quit [Quit: Leaving]
<Seabass> ROFL
<shevy> really that long ago??
<graspee> yes
<graspee> see i'm an op in that quote
<graspee> back when i had POWER and INFLUENCE
<shevy> man
<shevy> around that time, 2000... i was on windows, mIRC and galaxynet with Singaporeans
<shevy> and we played classic browsergames!
wataken44 has quit [Remote host closed the connection]
<graspee> that quote is from #honobono the anime channel on aniverse, although we might have been on a different server at that time
<shevy> hehe
wataken44 has joined #ruby
<kalleth> no results for me
<kalleth> =[
<shevy> not everyone makes it to immortality kalleth
<shevy> digital immortality that is
<kalleth> i did
<kalleth> i went to a lan like
<kalleth> ten years ago
<shevy> hehe
jackiechan0 has joined #ruby
<kalleth> i was 16, and then my clanmates started feeding me mucho alcohol
<shevy> why is it that all the legendary tales happened +10 years ago!
<Seabass> shevy my program doesn't work anymore :(
<kalleth> long story short, there are pictures of me lying facedown in mid-projectile on the internet
<kalleth> which are still cockblocking me today
<graspee> it was a time of awesome pc games
<shevy> Seabass can you put the full, current program on pastie.org
<shevy> graspee yeah
<kalleth> Tribes ascend is pretty damn good
<shevy> graspee I failed to transition to the new games of today :(
<kalleth> and NS2 looks good
<kalleth> BF3 is ok for a laugh
<kalleth> but new games nowadays are all about LETS MAKE THE MOST MONEY AND OFFER PROGRESSION AND LEVELUP AND ETC
<shevy> I played up until around 2004-2006 ... Warcraft 3, Diablo II ... but I never went into the world of warcraft hype, around that time I played less and less and less
<Seabass> shevy I think it's really a matter of me not understanding the change you asked me to make
<kalleth> rather than "lets make something that's got insane replay value and is properly fun to play"
<graspee> i think games are great now too
<shevy> Seabass, that is ok, can you put the code online
<bnagy> kalleth: I dunno, nintendo games are still fun
rushed has joined #ruby
<shevy> graspee, I dunno... they all seem to be more and more 3D graphics... and that's it
<bnagy> just that you don't get to kill stuff all that much
<graspee> minecraft, terraria, MW3 (despite what ppl say)
emmanuelux has joined #ruby
<graspee> torchlight
<shevy> though I like the concept of assassin's creed but not enough to want to really play for hours on my own
<graspee> any rpg by spiderweb
<shevy> Seabass, btw... you can change: chosenclass = gets; chosenclass.chomp! to ... chosenclass = gets.chomp
<Seabass> shevy ah right
<ged> Well I *was* sleeping before my computer started beeping insanely. :P
<shevy> heheeh
<shevy> we woke him up! \o/
mucker has joined #ruby
<Seabass> lol
<shevy> now we can hear ancient tales about MUDs from back in the days
<kalleth> avalon
<shevy> Seabass, I see. round is also defined in initialize
<shevy> one solution: round just has to be changed to @round
<shevy> Seabass, this should work now http://pastie.org/3954881
<ged> Well when I was a young whippersnapper...
<Seabass> shevy I moved it to battlecalc round = 1 that is
<shevy> Seabass yeah. that is another solution that works too. you have to decide what is better. I think putting round into the same logic part where the while-loop is, is the better solution, so I agree with you
<shevy> ged yeah! more!
* ged falls back asleep in his rocking-chair.
<shevy> hehehe
<kalleth> ged: when you were a young warthog?
* kalleth moviequotes.sh
<Seabass> shevy simple mistake, simple fix, rofl, had me stumped
<kalleth> Seabass: happens to us all more frequently than any of us would admit
<shevy> Seabass yeah. dont worry, those are simple errors that can be discovered in a few seconds and fixed
<kalleth> or maybe that's just me ¬_¬
<bnagy> Seabass, shevy, imho Fight shouldn't exist as a class, attack( other ) should be a method on Player
<shevy> it gets harder to fix something when looking at it years later
<kalleth> s/harder/impossible
<kalleth> at least with my old PHP code
<bnagy> and roles should probably be modules, I'd say
BiHi has quit [Ping timeout: 245 seconds]
<kalleth> 'i wrote this? fuck that, rewrite entire app in rails in 2nights'
<Seabass> bnagy I don't know what modules are yet
<kalleth> Seabass: like classes but can't be instantiated
<kalleth> so actually they're nothing like classes
<kalleth> namespaces, basically
<Seabass> instantiwhatit?
<shevy> modules are like a bag with a name on them
<kalleth> ...never mind
<shevy> like the bag "I have candy"
<Seabass> I like candy
<shevy> and the bag "I have a cat here"
<Seabass> I like cats
<shevy> although... they dont really contain much
<Seabass> oh...
<shevy> perhaps they are more like "ticket for one candy"
<kalleth> Candy::make_candy("sugar", "flour", "heat")
<shevy> and "ticket for one cat"
jackiechan0 has quit [Quit: Sto andando via]
<bnagy> well, in this case you would have a Player class with basic methods, but then have like a Wizard module which you could mix in that would add mana as a stat and let you cast spells
<shevy> so you can find a candy and use that, when you find it
<shevy> (i.e. you can include a module into your class Seabass)
<bnagy> so you could multiclass by just mixing in more class modules
<shevy> class Foo; include Candy; end
<kalleth> shevy: the only example calls i can think of to a module are factory-pattern-esque, and that's a terrible, terrible example ;(
<kalleth> but inclusion is actually awesome
<shevy> yah well... I like classes more than modules. I can do awesome things with classes!
<Seabass> what shevy said
sspiff has joined #ruby
tresk has left #ruby [#ruby]
<shevy> Seabass, what projects often use is a common module for namespace
<bnagy> Seabass: shevy has at least written enough ruby to have an opinion, even if he's wrong :)
<Seabass> namespace?
<shevy> like, you have a project called "foo", so usually the lowest namespace would be Foo
<kalleth> ModuleFactoryFactory::get_factory(FactoryDeterminationFactory.instance.get_factory_for('myclass').build_with(PopulationStrategyFactory...
<shevy> module Foo; class Bar
<kalleth> ok, i just java'ed myself
<kalleth> brb, killing self
<shevy> Foo::Bar.new # would work
<shevy> Bar.new # would not work as is
Krikke has joined #ruby
<shevy> btw bnagy do you know of a way to regroup a class, into a specific module/namespace?
clockwize has joined #ruby
wvdschel has quit [Ping timeout: 240 seconds]
<bnagy> at runtime?
<shevy> like I have class Foo, but not residing in a module. I want to have it live under module Bar at run time
<shevy> yeah
<Seabass> So Module > Class > method > var
<bnagy> ew
<shevy> if not, no problem. I will bug the mailing list
<bnagy> can you just add it as a constant?
<bnagy> banisterfiend knows all this crap
<shevy> hmm I think so
<Seabass> shevy my program works just fine :)
<Krikke> hey, I'm going to implement a debrief chat feature to our game's web service, can you point me to some chat gems or similar tech (I looked into jschat gem but it was 2 years old and used prototype)
<bnagy> const_set should work?
<ged> Bar.const_set :Foo, klass
<shevy> Seabass, it can be a bit more complicated than that though
<shevy> Seabass, you could also do this here: class Foo; class Bar
<Krikke> 13:46:24 < shevy> yeah
<Krikke> 13:46:28 < Seabass> So Module > Class > method > var
<Krikke> 13:46:34 < bnagy> ew
<Krikke> 13:46:59 < shevy> if not, no problem. I will bug the mailing list
<Krikke> 13:47:01 < bnagy> can you just add it as a constant?
<Krikke> 13:47:12 < bnagy> banisterfiend knows all this crap
<Krikke> oops
<shevy> thank you Krikke ;)
<Krikke> misclicked
<shevy> not sure I know of a chat gem, sorry. perhaps someone else does
<Seabass> bnagy I think it will be a good to try and rearrange the logic of my program to fit what you are saying to help understand the syntax better
<Krikke> ok, thanks
<shevy> anyway Seabass dont let that confuse you for now, just keep it in mind. much simpler to think of modules as a way to namespace, to group things together
<Seabass> bnagy attack ( other ) as method of Player
<shevy> Seabass, for instance, without namespace. if you write "def foo", and someone else writes "def foo" too, then there would be a problem
<Seabass> shevy like a directory foulder?
<shevy> in a way yeah
<shevy> but if you write in module A, and the other guy writes in module B, then these would be two different foo
<bnagy> shevy: my modules idea for this isn't really about namespacing
<shevy> (same with a class)
<bnagy> it's about adding a skillset and possibly unique stats to a base Person class
tresk has joined #ruby
<Seabass> shevy they could all same names for everything but it wouldn't get confused because they are seperated
jonathanwallace has quit [Remote host closed the connection]
<shevy> yeah
<bnagy> so harry=Person.new; harry.extend( Wizard ) # YER A WIZARD, HARRY!
<Seabass> ROFL
<Tasser> bnagy, you sure extend isn't private? ^^
ddv has joined #ruby
<kalleth> bnagy: source for c+p ?
<kalleth> i've read that before
<shevy> hey that reminds me ... harry potter
<ged> Tasser: It's not.
<bnagy> *shrug* made it up
ramblex has joined #ruby
<kalleth> shevy: she's hot, you should do her
mischief has quit [Ping timeout: 250 seconds]
<shevy> <JonJonB> He bent down and pulled his wang out of the troll's nose. It was covered in what looked like lumpy gray glue.
<ged> Include is, but not extend.
Helius has joined #ruby
<kalleth> yeah, but then you just do harry.send(:include, Wizard)
<kalleth> ;)
<kalleth> and, after the ruby gods stop screaming at you
<shevy> hmm
<kalleth> he's still a wizard
<shevy> does this work in 1.9.x too? the .send one
<shevy> why are we talking about harry :(
ddv has quit [Client Quit]
<hemanth> vectorshelve, gem install cadbury; cadbury #eat all the gems :D :P
mischief has joined #ruby
<kalleth> hmm, i guess it doesn't, shevy
<kalleth> i thought you could override with 'yes, really do this'
<kalleth> with an extra arg
<Seabass> I barely know anything about ruby, but I was planning on having a global var that is a hash of hashes that are an index of stats and equipment and the equipment would be hashes also with indexes of stats
KL-7 has quit [Quit: This computer has gone to sleep]
<bnagy> Seabass: stats and equipment are 'attributes' of a Person, right? (loaded term)
<Seabass> and code would tabulate all the stat bonuses form actor or person or character stats and equipment
<bnagy> so they should go in instance variables, because they are specific to that instance of Person
<Seabass> I just figured I'd make a new global var for each person :|
<bnagy> No! Bad Seabass!
<ged> Hehe.
punkrawkR has joined #ruby
<Seabass> lol, well maybe as I learn more ruby I'll have in mind a more efficient and just and right and good and sensible way of doing it
elliot98 has quit [Quit: Konversation terminated!]
<bnagy> Seabass: it's all about objects. Objects objects objects.
<Seabass> bnagy teach me
<ged> Yeah, don't fear the object graph.
<kalleth> hmm, shevy
<shevy> kalleth yeah I think they changed that from 1.8 to 1.9
<kalleth> it was removed, yeah
<shevy> or at least something there
<bnagy> what should this object be able to DO (methods) and what attributes does this object HAVE (@instance vars)
<shevy> and they added .public_send or that
<kalleth> but there's some debate about it being replaced by matz with #funcall, then being replaced with #send!
ZachBeta has joined #ruby
<kalleth> neither of which exist in 1.9.2
<shevy> hehe
* kalleth installs 1.9.3
<shevy> Seabass within a class, you wont need global variables usually
<shevy> Seabass just assign to @ivars
<bnagy> global variables are a bad code smell. They're not _always_ wrong, but they usually are
<kalleth> wget 1.9.3.tar; tar zxvf 1.9.3.tar; ./configure && make && make install will replace my current installation, right?
<kalleth> (this is what i want)
tresk has left #ruby [#ruby]
<kalleth> (i dont use rvm, cba)
<shevy> Seabass the hash of hashes you described can be @hash_of_hashes = { }
<bnagy> kalleth: you probably want a cd in there
<kalleth> obv
<kalleth> ;p
<shevy> kalleth depends. by default, this would use --prefix /usr/local
<kalleth> good time to look at rbenv i think
<shevy> if your ruby is in /usr prefix then that command you showed here wont overwrite it
<bnagy> I like rbenv
nilg has joined #ruby
<Seabass> shevy, I figured like my first hash.hash.new{ charstats => (statsarray),ect}
<Seabass> i know hash.hash.new is too many args prolly
<shevy> Seabass {} is a way to make a new hash. Hash.new is another one
<bnagy> Seabass: so, this is cool - if you have a defense method that calculates your def score based on armor
<shevy> hash = {}
<shevy> hash = Hash.new
<bnagy> you can overload it in the Wizard module to actually decrease defense for heavy armor types
ph^_ has joined #ruby
test34 has joined #ruby
test34 has quit [Changing host]
test34 has joined #ruby
<bnagy> cause wizards can't wear plate :P
<Seabass> bnagy or increase atk vs metal armor types
b4ud has joined #ruby
<bnagy> overloading. It's magic.
SPYGAME has quit [Ping timeout: 256 seconds]
<Seabass> bnagy IT'S SUPEREFFECTIVE!
<bnagy> anyway, the point of all these kinds of exercises is to learn good design, not to hack the first thing that works
<Seabass> no pokemon players?
<shevy> I dont know pokemon
test34- has quit [Ping timeout: 272 seconds]
<shevy> but we used to play pen and paper RPGs!
<Seabass> my step dad made me play dnd 2.0 also
<shevy> the DnD system is among the simplest one can use... :P
noodletraveler has quit [Quit: leaving]
<bnagy> shevy: that sounds really boring, man. Ours had orcs and dragons and stuff
ph^ has quit [Ping timeout: 252 seconds]
<bnagy> "OK...I WRITE ON THE PAPER. <ROLL FOR INK>"
<Seabass> bnagy so I should try not to use global vars
<Seabass> then I played World of Warcraft
<bnagy> Seabass: right. No $globals, no @@classvars
<Seabass> bnagy I see, beginners don't have the authorization to use $globals or @@classvars
<shevy> bnagy, yeah but our group was like ... "(1) why is that dragon in that dungeon and (2) how did it come here anyway?"
<bnagy> Seabass: well actually if I had my way, nobody would have authorization to use @@classvars
<shevy> Seabass you always should ask first whether you need this or not
<kalleth> Seabass: in 2 years of professional ruby dev, i've only had to use @@classvars once, in a gem I wrote (and it was probably the wrong approach), and i've NEVER had to use $globals
<shevy> in the case when you have a class, you really rarely need $globals, and for 99,9% all cases of @@classvars I saw, were not needed either
<shevy> you can use @instance_variables!
<shevy> and local throwaway variables
Guedes has quit [Quit: Saindo]
<shevy> which you actually already had :)
<bnagy> ok I need to go and be Mario now and get stars, screw refactoring
<Seabass> SO BE IT! Hence forth, $globals and @@classvars shall be stricken from mine endevors.
<banisterfiend> bnagy: which mario are you playing?
<banisterfiend> galaxy?
<kalleth> Super Mario Bros
<kalleth> hopefully
<Seabass> I'm gettin tired. But I want to learn to code...
<kalleth> Seabass: the best way to learn a code is to think of a project, then do it
<kalleth> also, ruby koans i found quite useful
<shevy> yeah
tatsuya_o has quit [Remote host closed the connection]
<shevy> do something that is useful for you
<Seabass> 7am here, ty for the encouragement kalleth, ty for the advice bnagy, ty for the help shevy
<shevy> I write a formula calculator right now for chemistry
<kalleth> shevy: i write a gaming team website and a commercial side-project ;p
<kalleth> gg moonlighting
<shevy> cool
<shevy> I need some genius idea here for commercial projects too :P
<kalleth> there's no genius idea
<kalleth> people come to me with boring CRUD business apps
<kalleth> i do them
<kalleth> i charge £x
<shevy> ewwwww
DanBoy has joined #ruby
<kalleth> i can do them quickly, they're simple, and they make bank
<kalleth> :p
<shevy> yeah I can see that
<shevy> but somehow still... ewwwwwww
<kalleth> meh
<kalleth> kinda, kinda not
<kalleth> as 99% of programming is CRUD apps
<kalleth> in bidness
<kalleth> ;p
<kalleth> its quite interesting to figureo ut how to do them better
<kalleth> and more efficiently
arturaz has quit [Remote host closed the connection]
<kalleth> i.e. one thing that foxes me atm is rails association creation at the same time
<kalleth> nested_attributes etc
<kalleth> which i awnt to improve at
arturaz has joined #ruby
<kalleth> so you can create a Client and many of its Addresses in the same POST without having spaghetti based transaction code in the controller
dnyy_ has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
luckman212 has quit [Remote host closed the connection]
maasha has joined #ruby
perryh is now known as perryh_away
<Seabass> well if you clicked the link I provided, that's the long term goal for me, with more nintendo esque graphics
ben_m has joined #ruby
SPYGAME has joined #ruby
<bnagy> well so much for that - power is out again, and the inverter seems to be unable to run the TV :<
<banisterfiend> bnagy: galaxy?
<bnagy> galaxy 2 yeah
<Seabass> so far today I learned how to make a hash, how to puts, how to use @ivars, and how to pass hash/array info to a method for arithmatics
<maasha> on organizing ruby files. I have my code in maasha/lib and and unit tests in maasha/test. Now I was thinking about putting some code in maasha/lib/somedir. Is that kosher? Should I have equivalient maasha/test/somedir?
<maasha> (some things simple aren't in the books)
<maasha> *simply
<Seabass> oh, and I lerned conditional and while loops
<banisterfiend> bnagy: cool! did you ever play sunshine?
<Seabass> ty everyone who help
<Seabass> bnagy, l8r
<Seabass> shevy, l8r
<shevy> http://www.bash.org/?290466 for anyone who likes cats
<maasha> perhaps there is some gem with very neat file organization that I can borrow? (and rake files)
<shevy> <agent_orange> you read sopmewhere to put butter on the cats foreWHAT THE FUCK WERE YOU THINKING
<shevy> hahaha
<Seabass> kalleth, night
<bnagy> cya
kil0byte has quit [Ping timeout: 244 seconds]
<bnagy> banisterfiend: I did. One of the best imo
<banisterfiend> yeah i loved that
<banisterfiend> on my gamecube :)
kil0byte has joined #ruby
<JonnieCache> maasha: try looking at one of the gem skeleton projects that are about
<banisterfiend> bnagy: mariokart double dash, too!
adambeynon has joined #ruby
<bnagy> banisterfiend: my wife only lets me buy nintendo gear and games with no killing in them :)
<banisterfiend> JonnieCache: what's your github a/c name btw?
<JonnieCache> same as my nick
<banisterfiend> bnagy: haha, did u marry a hippy? :)
<JonnieCache> theres not a lot on therre tbh
BiHi has joined #ruby
gilead has joined #ruby
<shevy> what kind of "gear" is that precisely
<JonnieCache> does mario count as killing?
<shevy> he kills turtles
<shevy> damn brutal man
<JonnieCache> exactly
<shevy> I'd not kill them
<shevy> I'd only turn themn upside down :)
PragCypher has quit [Read error: Connection reset by peer]
<bnagy> why magic encoding comment no work?
PragCypher has joined #ruby
<bnagy> I got some stuff that's being roudtripped through a serializer, and it comes out as utf-8 :<
<shevy> encoding improves our life
ph^_ has quit [Remote host closed the connection]
<bnagy> this is crap. I have to force_encoding on this stuff?
<shevy> the only one who may be able to help is Mon_Ouie
<shevy> hmm or rking
<vectorshelve> shevy: hai ;)
<shevy> oh no
<shevy> vectorshelve go write ruby code :P
<shevy> oh man I dont know
<shevy> romania from the infrastructure looks a lot like a third world country
<vectorshelve> shevy: woooooooooooooooooohhhhhhhhhhhhhh Let me book my tickets to Italy :D
<bnagy> shevy: actually san marino is a republic, it's just surrounded by Italy :)
<shevy> or even better, a "castle" that is more like an old villa. miramare in italy near trieste http://www.bestourism.com/img/items/big/1252/Miramare-Castle-in-Trieste-Italy_Aerial-view_4718.jpeg
<shevy> bnagy ok
<shevy> should have been conquered :)
<shevy> vectorshelve I was at miramare! It's nice there, especially the big park behind the castle (hard to see on that picture).
<bnagy> one of my friends in geneva was the 'ambassador'
<bnagy> which involved only getting duty free wine, as far as I could tell
<shevy> trieste is not that great though, the harbour looks damaged, there are industrial buildings which seem to have been abandoned many years ago, so it looks as if everything is rotting near the harbour...
<vectorshelve> shevy: ok.. I am planning a holiday to Europe this year.. confused as to which country to chose
<JonnieCache> OMG just seen the google doodle
<JonnieCache> ITS A MINIMOOG!
<bnagy> it is
<shevy> vectorshelve, I dunno... there are individual cool places... but nothing really where you think "fucking awesome" all the time
<bnagy> and you can play notes with the keyboard
<JonnieCache> no tooltips for the knobs though :(
<shevy> vectorshelve, definitely include some harbours though, my dad travelled to amsterdam and rotterdam only because of the harbours there
<JonnieCache> anyone know which knob is the filter resonance?
KL-7 has joined #ruby
<JonnieCache> maybe you cant model a resonating filter in javascript yet...
<shevy> bnagy, this is so unfair... that they can shop in duty free zones and we common guys can not. same with UNO buildings, they can buy at special places, and also get like free housing (we had some from the UN live around here, the UN paid the rent for like 95% of it or something like that)
<JonnieCache> lame
tresk has joined #ruby
<bnagy> shevy: it's not unfair :) That's the deal we get here! (duty free shop, free housing...)
kpshek has joined #ruby
<bnagy> support your local IO expat :>
<maasha> what does this FileList do: Rake::TestTask.new do |t|; t.test_files = FileList["test/{unit,functional}/**/test_*.rb"]; end?
<bnagy> maasha: it's not a standard class
tresk has left #ruby [#ruby]
<maasha> bnagy: and?
<bnagy> and.. I have no idea unless you have the code for it. :) It's not a standard class, so who knows what it does?
akem has quit [Ping timeout: 256 seconds]
<vectorshelve> shevy: how about sweden ?
<maasha> right. so the /**/ is non-standard as well?
<bnagy> well if it's like Dir.glob then it's recursive directory matches
<bnagy> http://rake.rubyforge.org/classes/Rake/FileList.html looks like it's a Rake thing
ph^ has joined #ruby
<maasha> bnagy: it is.
<shevy> vectorshelve I've been in sweden only once, in goeteborg. It was very foggy. I dunno... perhaps other places in sweden are cool, but if I'd have to go to scandinavia again, I'd pick either norway or finland
<bnagy> basically it should get all files called test_whatever.rb in any subdir or test/unit and test/functional
<maasha> bnagy: and a little test shows that you are correct - its a Dir.glob
<maasha> just what I need. neat
<vectorshelve> shevy: yeah even my friends told me scandinavian countries are the best norway and the other
<bnagy> except in winter, they suck in winter
<shevy> yeah that's what I dont like... cold, wet and snow
eurek has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<bnagy> with no proper mountains to ski on :)
<shevy> hehe
PragCypher has quit [Read error: Connection reset by peer]
mucker has quit [Quit: leaving]
b4ud has quit [Ping timeout: 276 seconds]
pawdro has joined #ruby
kil0byte_ has joined #ruby
codebeaker has joined #ruby
`brendan has joined #ruby
kil0byte has quit [Ping timeout: 260 seconds]
kaspernj has joined #ruby
lxsameer has joined #ruby
Alantas has joined #ruby
odinswand has quit [Quit:]
Morkel has quit [Quit: Morkel]
iocor has joined #ruby
b4ud has joined #ruby
tatsuya_o has joined #ruby
PragCypher has joined #ruby
krusty_ar has joined #ruby
pawdro has quit [Quit: Wychodzi]
asuka_ has quit [Read error: Connection reset by peer]
asuka_ has joined #ruby
t0mmyvyo has joined #ruby
t0mmyvyo has quit [Client Quit]
petercs has joined #ruby
adambeynon has quit [Quit: adambeynon]
vitoravelino is now known as vitoravelino`afk
Foxandxss has joined #ruby
Shahor has joined #ruby
celm has quit [Ping timeout: 276 seconds]
liluo has quit [Remote host closed the connection]
Vendethiel has joined #ruby
thecreators has joined #ruby
geekbri has joined #ruby
twock has joined #ruby
closedbracket has quit [Remote host closed the connection]
bglusman_ has quit [Remote host closed the connection]
bglusman has joined #ruby
RoUS has quit [Ping timeout: 260 seconds]
odinswand has joined #ruby
sbanwart has joined #ruby
bglusman has quit [Ping timeout: 245 seconds]
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
Prz has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
kil0byte has joined #ruby
Poapfel has quit [Quit: Need a new quit message? Why not Zoidberg?"]
alek_b has quit [Remote host closed the connection]
fbernier has joined #ruby
RoUS has joined #ruby
celm has joined #ruby
v0n has quit [Ping timeout: 272 seconds]
kil0byte_ has quit [Ping timeout: 276 seconds]
zinjacoder has joined #ruby
fbernier has quit [Remote host closed the connection]
fbernier has joined #ruby
tobym has joined #ruby
wangr has joined #ruby
Progster has joined #ruby
kawa_xxx has quit [Remote host closed the connection]
Guest54524 is now known as davidw
mdw has quit [Remote host closed the connection]
davidw has quit [Changing host]
davidw has joined #ruby
thecreators has quit [Quit: thecreators]
thecreators has joined #ruby
tomzx has joined #ruby
mvangala has joined #ruby
cha1tanya has joined #ruby
alex88 has joined #ruby
Vendethiel has quit [Quit: je ne suis plus là, tqvu]
<alex88> hello guys, i'm totally new to ruby, i want to download and edit one line in the knife-openstack package and then install on local repository.. how could i do that?
<shevy> alex88 can you show me that knife openstack package
<shevy> one way that probably works is ... download it, extract it, edit the file, repackage it again
<alex88> shevy, the link i have is this https://github.com/opscode/knife-openstack
<shevy> yeah first have that package available locally on your machine
<alex88> done
<shevy> I suppose the file you mentioned is somewhere among the https://github.com/opscode/knife-openstack/tree/master/lib/chef/knife
<shevy> anyway, once you modified it
<alex88> correct
<shevy> you can try these things: rerun rake (the Rakefile at the base)
<shevy> I myself usually do something else though, not sure I can recommend it however
<keanehsiao> anybody use sequel gem?
<alex88> shevy, basically what does rake?
<shevy> I usually have a copy of setup.rb around and use that to install into ruby site lib again
<shevy> alex88, rake invokes the "Rakefile" you see there. it starts at the task "default"
<shevy> alex88, I dont like rake so I dont use it
<alex88> like a makefile so
<shevy> yeah
<keanehsiao> wondering.. how to do master/slave.. I use :servers=> { :read_only=>{}, :defaults=>{}}
<shevy> I usually do "ruby setup.rb config;ruby setup.rb setup;ruby setup.rb install"
lsumnler has joined #ruby
<shevy> actually I just type "r2" :P
<keanehsiao> yet the writing seems go into the ready_only?? or whatever.. but the slave is stay with high cpu.. but write has no any cpu..
<shevy> got it aliased
<alex88> shevy, let me try rake
<shevy> alex88, this is http://proutils.github.com/setup/ setup.rb btw, in case the rake way does not work
<shevy> a third solution would be to make a gem out of that and install that gem via "gem install *.gem"
<alex88> in fact it just failed… "no such file to load -- bundler" -> gem install bundler?
<shevy> (after you modifed the file, and then made a new .gem release that is)
<shevy> dunno, perhaps, you can try
<alex88> i've already edited the file
<shevy> I hate bundler even more so than rake myself :)
<alex88> good :)
<shevy> what setup.rb is basically doing is just recursively copy into RUBY SITE DIR
<shevy> on typical linux system this site dir is at /usr/lib/ruby/site_ruby/1.8/
adambeynon has joined #ruby
<alex88> yup i've that too
<shevy> files and directories that reside there, should work easily via require 'name_of_the_project' then
<alex88> so i should get that setup.rb and place on root dir of what i've just cloned?
lsumnler has quit [Quit: Ex-Chat]
<shevy> hmm
<shevy> I think if you follow the instruction on http://proutils.github.com/setup/
<shevy> if you did "gem install setup"
<shevy> then setup.rb was probably already copied to your ruby bin/ dir
<shevy> perhaps try it first
<shevy> try "setup.rb" now, it should fail
<shevy> then do "gem install setup"
andrewhl has joined #ruby
<shevy> and "setup.rb" should then work
<shevy> lemme know if that works already for you
<alex88> cmd not found, going to install
d3c has quit [Quit: Sleep]
<fowl> good old setup.rb
<shevy> :)
<shevy> in the days when things were simple
hynkle has joined #ruby
benatwork has joined #ruby
<alex88> ok setup.rb now gives error but it's there
<shevy> hehe ok
<shevy> try if it works on that knife-project
<shevy> setup.rb config; setup.rb make
<shevy> setup.rb install
banisterfiend has quit [Read error: Connection reset by peer]
<shevy> at the base lib/ dir of that knife-project that is
<shevy> if you extracted it, you have to cd into that directory before calling setup.rb
<shevy> cd knife-thingy/; setup.rb config
<alex88> wait..error… http://pastebin.com/yDAXLhGM
lorandi has joined #ruby
cordoval has joined #ruby
<shevy> aha
<shevy> very odd
<fowl> omfg
<shevy> seems it ... wants a profile.yml file
<fowl> shevy, the borg have boarded the enterprise and kidnapped picard!
<alex88> lol
sallybaby has quit [Ping timeout: 245 seconds]
<shevy> bin/setup.rb: PROFILE = YAML.load(File.new(DIRECTORY + '/profile.yml'))
<shevy> ok I just checked
<shevy> that guy modified setup.rb
<shevy> in my setup.rb, there is no profile.yml
banisterfiend has joined #ruby
maesbn has quit [Ping timeout: 260 seconds]
<shevy> alex88, perhaps uninstall that gem
<alex88> shevy, setup?
<shevy> gem uninstall setup
<shevy> yeah. that dude changed setup.rb :(
<alex88> done
chrismcg is now known as zz_chrismcg
eurek has joined #ruby
maesbn has joined #ruby
<shevy> somehow I cant link to the old setup.rb file
<shevy> the original author is a japenese, on i.loveruby.net/
C0deMaver1ck has joined #ruby
<shevy> but the page does not wanna load for me
<alex88> should i try to use that rake?
<shevy> perhaps. for me rake never worked though
jrist-afk is now known as jrist
<shevy> alex88, perhaps there is some instruction how to install that knife thing
spleeze has joined #ruby
<shevy> btw
<alex88> shevy, gem install knife-openstack works, but i need the modified code
<shevy> I just did: "gem install knife-openstack"
<shevy> yeah
<fowl> shevy, do you know star trek? i think in your tongue it might be Sprachen Trekken
<shevy> as said, solution 3 is to repackage the gem alex88
<shevy> fowl sure, I loved it around 1990-2000
cha1tanya has quit [Ping timeout: 245 seconds]
linoj has joined #ruby
spleeze has quit [Client Quit]
<shevy> cool
<shevy> alex88, that actually worked???
Sgeo has left #ruby ["Leaving"]
<shevy> did you repackage the gem?
ABK_ has joined #ruby
<alex88> no, i just ran bundle
<alex88> what now?
vectorshelve has quit [Quit: Page closed]
ken_barber has joined #ruby
<shevy> aha
<shevy> to rebuild the gem, do:
<shevy> "gem build *.gemspec"
<alex88> Successfully built RubyGem
<alex88> Name: knife-openstack
<shevy> you could modify the version if you want to
<shevy> so that you know it was patched by you
<shevy> yeah
<shevy> now you should be able to install that new .gem
<shevy> "gem install *.gem"
andrewhl has quit [Quit: andrewhl]
<alex88> oh, here we are
<shevy> it should have put all what was inside lib/ into that .gem file
<shevy> and when you thus install that, your modifications should be copied into ruby site dir too
<shevy> if you modified in that dir, that is :)
bglusman has joined #ruby
<alex88> still installing, give it some seconds :)
<alex88> old repo?
<shevy> you can download that and keep it for local use btw, I find it the simplest way to install something with ruby
<shevy> this is old, yeah... like 5 years or 6 hehehe
<shevy> has some warnings on ruby 1.9
<shevy> hmm
<shevy> # Copyright (c) 2000-2005 Minero Aoki
vitor-br has quit [Quit: Saindo]
<shevy> wonder if he still uses ruby :(
<alex88> i'm not the man to ask for that :) btw, it worked, thank you very much!
abionic has quit [Ping timeout: 276 seconds]
<shevy> cool
<alex88> this code needs some improvements.. do you have some seconds?
<shevy> if you paste into #ruby yes
<shevy> or link into #ruby
<fowl> omg shevy
<fowl> THEY BORGIFIED CAPTAIN PICARD
<shevy> fowl yeah, that was cool
<alex88> i changed server.dns_name to server.private_ip_address because it takes some time to dns to propagate and it was exiting due host not found
<fowl> shevy, im literally on the edge of my seat for this
tomzx has quit [Ping timeout: 245 seconds]
<shevy> alex88, you can link line numbers on github
mdw has joined #ruby
ananthakumaran has quit [Ping timeout: 244 seconds]
<alex88> now, the instance is booting, it should wait for ssh to came up, but exits with "Waiting for sshdERROR: Errno::ENETUNREACH: Network is unreachable - connect(2)"
<shevy> alex88, I dont know who wrote that code but it looks odd. as if a python guy wrote it
<shevy> puts("\n")
<alex88> is there a way to make it don't exits?
<fowl> OH what!
<fowl> to be continued...
<shevy> lol fowl
<fowl> now i wont know what happens for a whole week :(
<shevy> alex88, you could capture it into a begin/rescue/end
kzar has joined #ruby
<shevy> alex88, I dont know much about sshd however
<bnagy> fowl: that's the end of the season, afair
<kzar> I need to collect the results from a for loop into an array, what's an idiomatic way to do that?
<shevy> btw alex88
<shevy> it already has some rescue clauses
<shevy> rescue Errno::ECONNREFUSED; sleep 2
<bnagy> kzar: for loops are not idiomatic
<shevy> perhaps you can add ENETUNREACH somewhere there
<kzar> bnagy: Right but I need one
<alex88> shevy, oh, so i just have to add "rescue Errno::ENETUNREACH" sleep etc
<bnagy> kzar: no you don't :)
<bnagy> kzar: pastie the code
<shevy> kzar you can append to an array. array << "we append a string to our array here"
cordoval has left #ruby [#ruby]
<fowl> kzar, generally use array#map
<alex88> shevy, thank you very much!!
<kzar> bnagy: yes I do, firstly I can't paste the code because it's commercial
<fowl> in place of for
<kzar> bnagy: I'm not working with an array, but a FFI pointer to a C array
<shevy> alex88, I hope so, I really dont know what that code really does, but it seems as if that rescue block looks for network-specific errors, so it would make sense to add ECONNREFUSED somewhere there
mdhopkins has quit [Quit: mdhopkins]
linus95014 has joined #ruby
<alex88> shevy, yup, thank you again!
<bnagy> kzar: still sounds pretty mappable to me
thone has joined #ruby
<shevy> kzar, you could always abstract the code and show that ;) if you can modify the code, however, if you are in control, then you indeed won't need a for loop. ruby provides .each for collection which achieves the same really, without having to keep track for throwaway variables
<bnagy> but you seem to know best, so
<shevy> oh yes or .map!
<shevy> without the "!"
<shevy> :P
thone_ has quit [Read error: Operation timed out]
spleeze has joined #ruby
dhaskew has joined #ruby
<fowl> bnagy, I need to collect the results from a for loop into an array, what's an idiomatic way to do that? also don't throw any of that idiomatic BS at me
liluo has joined #ruby
<kzar> bnagy shevy: The each method doesn't work on a FFI pointer
scav has joined #ruby
<kzar> I would have done it like that if I could
Hanmac has quit [Ping timeout: 250 seconds]
<bnagy> kzar: look, there's no for loop that can't be converted. It's not possible.
<shevy> bnagy, wheee look, I have to learn all about this http://en.wikipedia.org/wiki/Nd:YAG_laser for an exam
<shevy> I am going to skip the boring shit and jump to "Military surplus Nd:YAG laser rangefinder firing." at once, as it is the only interesting thing :P
<shevy> sounds like cthulhu, that ndyag thing
<fowl> kzar, instead of for consider: 0.upto(SizeOfDatArray)
rmascarenhas has joined #ruby
<fowl> datArraySize.times do ... end
<bnagy> (start_addr..end_addr).each.with_object( [] ) ...
bbttxu has joined #ruby
<bnagy> etc etc
wangr_ has joined #ruby
<shevy> let him use for!
<shevy> he'll count to Infinity twice
<shevy> and thus equal chuck norris
jcromartie has joined #ruby
wangr has quit [Read error: Operation timed out]
lorandi has quit [Quit: Leaving]
<kzar> fowl: thanks that did the trick: 0.upto(10).collect {|i| i} for example
<shevy> fowl is the man
chson has quit [Remote host closed the connection]
<bnagy> ...uh
wangr has joined #ruby
<shevy> when he isn't on a weed session, he is a genius
lorandi has joined #ruby
ronniy has joined #ruby
<bnagy> ok I've gone from 200 lines of unreadable shite to 167 lines of merely horrible shite
<bnagy> I guess that's progress :/
minijupe has joined #ruby
<shevy> hehe
lxsameer has quit [Ping timeout: 256 seconds]
wangr_ has quit [Ping timeout: 260 seconds]
TheHunter_1039 has joined #ruby
petercs has quit [Ping timeout: 256 seconds]
Targen has joined #ruby
chomp has joined #ruby
rippa has quit [Quit: derp herp]
Hanmac has joined #ruby
macer1 has joined #ruby
macer1 has left #ruby [#ruby]
seanstickle has joined #ruby
maesbn has quit [Read error: Connection reset by peer]
maesbn has joined #ruby
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
saltnvinegar has joined #ruby
Facefox has quit [Ping timeout: 260 seconds]
maesbn has quit [Read error: Connection reset by peer]
luxurymode has joined #ruby
maesbn has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
mdhopkins has joined #ruby
lxsameer has joined #ruby
lxsameer has quit [Max SendQ exceeded]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
kzar has quit [Ping timeout: 244 seconds]
cdepue has joined #ruby
Facefox has joined #ruby
maesbn_ has joined #ruby
maesbn has quit [Read error: Connection reset by peer]
andrew_ has joined #ruby
andrew_ is now known as awarner
lolmaus has quit []
billiamii has quit [Quit: Leaving]
maesbn_ has quit [Read error: Connection reset by peer]
maesbn has joined #ruby
iamjarvo has joined #ruby
<iamjarvo> if i have a = "a" b = "b" does a && b just give back b?
<iamjarvo> whats going on there
maesbn has quit [Read error: Connection reset by peer]
scav has quit [Quit: leaving]
rbanffy has joined #ruby
<Hanmac> iamjarvo i think you are looking for a || b
<ben_m> iamjarvo, both "a" and "b" evaluate to true, so && returns the last.
<iamjarvo> ben_m: Hanmac thanks
<iamjarvo> im reading a code base and tryign to figure out why its being used where its being used
dv310p3r has joined #ruby
<iamjarvo> doesnt seem needed
ph^ has quit [Ping timeout: 260 seconds]
maesbn_ has joined #ruby
uris has joined #ruby
<ben_m> Can be used like a conditional
joshman_ has quit [Quit: Computer has gone to sleep.]
<ben_m> check_stuff() && do_stuff();
<iamjarvo> but if one fails doesnt it not give anything back?
<hoelzro> iamjarvo: I'd assume it will result in false or nil
<hoelzro> whichever was returned
<Hanmac> value = input || default
digitalcakestudi has joined #ruby
[edu] has joined #ruby
bluenemo has quit [Remote host closed the connection]
booginga has joined #ruby
mengu has joined #ruby
exchgr has joined #ruby
apeiros_ has joined #ruby
<banisterfiend> Hanmac: Und.
<banisterfiend> apeiros_: hello
ananthakumaran has joined #ruby
tobago has joined #ruby
Poapfel has joined #ruby
stefanp has quit [Quit: Linkinus - http://linkinus.com]
Poapfel has quit [Client Quit]
ananthakumaran has quit [Remote host closed the connection]
kil0byte_ has joined #ruby
pdtpatr1ck has joined #ruby
ananthakumaran has joined #ruby
tobago has quit [Client Quit]
tobago has joined #ruby
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
tobago has quit [Client Quit]
tobago has joined #ruby
tobago has quit [Client Quit]
Jackneill has joined #ruby
kil0byte has quit [Ping timeout: 265 seconds]
tobago has joined #ruby
tobago has quit [Client Quit]
tobago has joined #ruby
ukwiz has joined #ruby
tobago has quit [Client Quit]
tobago has joined #ruby
kevinbond has joined #ruby
flip_digits has joined #ruby
ananthakumaran has quit [Ping timeout: 260 seconds]
tobago has quit [Client Quit]
tobago has joined #ruby
tobago has quit [Client Quit]
tobago has joined #ruby
tobago has quit [Client Quit]
tobago has joined #ruby
tobago has quit [Client Quit]
tobago has joined #ruby
pdtpatr1ck has quit [Remote host closed the connection]
statix has quit [Remote host closed the connection]
kil0byte has joined #ruby
statix has joined #ruby
wmoxam has joined #ruby
jackiechan0 has joined #ruby
kil0byte_ has quit [Ping timeout: 265 seconds]
nu7hatch has joined #ruby
fmcgeough has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
theRoUS has quit [Client Quit]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
rushed has quit [Quit: rushed]
carloslopes has joined #ruby
Poapfel has joined #ruby
mindmechanic has joined #ruby
maesbn_ has quit [Read error: Connection reset by peer]
maesbn has joined #ruby
chson has joined #ruby
odinswand has quit [Ping timeout: 244 seconds]
maasha has quit [Ping timeout: 245 seconds]
billiamii has joined #ruby
evangelion has joined #ruby
mindmechanic has quit [Quit: leaving]
<evangelion> hello
<evangelion> how can i convert [ 1,2,3 ] to { :foo1 => 1, :foo2 => 2, :foo3 => 3 } ?
Eiam has quit [Ping timeout: 260 seconds]
<fowl> i sell one-liners
<fowl> $3.99
* evangelion checks
_2easy_ has joined #ruby
davidw has quit [Ping timeout: 245 seconds]
<seanstickle> I'll do it for $2.99 and pass the savings onto you!
<hoelzro> fowl: Enumerable#collect may be of use
<Hanmac> Hash[[1,2,3].each_with_object("foo").map {|k,s| [(s+k.to_s).to_sym,k]}]
<bnagy> [1,2,3].each.with_object({}) {|i,h| h["foo#{i}".to_sym]=i}
<evangelion> oh! to_sym
<evangelion> thank you
<bnagy> Hanmac: have you been huffing glue again?
<bnagy> I can't begin to imagine how tat is the first approach that would spring to mind ;)
<shevy> he writes C++ code daily
<shevy> give him a break man!
<bnagy> ...damn I should have held out for the cash first, shouldn't I?
<seanstickle> [1,2,3].reduce({}){|a,x| a[("foo#{x}").to_sym] = x; a}
<bnagy> seanstickle: BAD, inappropriate use of inject
djdb has quit [Remote host closed the connection]
<seanstickle> Oh?
<bnagy> also calling a hash accumulator 'a' is evil :)
<fowl> s/inappropriate/perfectly file
<fowl> s/file/fine
<fowl> s/everything
<seanstickle> I write one-liners, not Knuth Literate Ruby
<seanstickle> :P
<Hanmac> bnagy: [1,2,3].reduce({}){|h,x| h[:"foo#{x}"] = x; h}
<bnagy> Hanmac: you're right, that's MUCH better than seanstickle's
<bnagy> at least if you're going to use inject then call it inject, when you use the reduce alias people might be in danger of thinking you're reducing something :D
<seanstickle> Hash[[1,2,3].map{|x| ["foo#{x}".to_sym, x]}]
saschagehlich has joined #ruby
<bnagy> \o/
<Hanmac> Hash[[1,2,3].map{|x| [:"foo#{x}", x]}]
<bnagy> hahah twins linked at the brain
<seanstickle> lol
<bnagy> Hanmac: nice, I didn't know you could do :"#{x}"
bbttxu has quit [Read error: Connection reset by peer]
bbttxu has joined #ruby
<Hanmac> its a secret, you need ruby at lvlv 5+ to know it :P
maesbn has quit [Read error: Connection reset by peer]
<bnagy> obviously I haven't killed enough people to level up
maesbn has joined #ruby
chomp has quit [Quit: Leaving]
mohits has joined #ruby
b4ud has left #ruby [#ruby]
zii has quit [Ping timeout: 246 seconds]
<bnagy> Hash[] is awesome for code golf :/
linus95014 has left #ruby [#ruby]
<bnagy> right, dinnertime
zii has joined #ruby
zii is now known as Guest18349
narshlob has left #ruby [#ruby]
keymone has joined #ruby
Tick-Tock has quit [Ping timeout: 245 seconds]
monokrome has quit [Ping timeout: 245 seconds]
tommylommykins has left #ruby [#ruby]
thomasfedb has quit [Ping timeout: 245 seconds]
<keanehsiao> hi
<keanehsiao> is there any possibility to limit the max connections for event machine??
skogis has quit [Ping timeout: 245 seconds]
skogis has joined #ruby
yeggeps has joined #ruby
thomasfedb has joined #ruby
heftig has quit [Quit: leaving]
Tick-Tock has joined #ruby
PaciFisT has left #ruby [#ruby]
Guest18349 has quit [Ping timeout: 244 seconds]
statix has quit [Remote host closed the connection]
iocor has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
statix has joined #ruby
bbttxu has quit [Quit: bbttxu]
Jay_Levitt has joined #ruby
khakimov has joined #ruby
monokrome has joined #ruby
monokrome has quit [Excess Flood]
wvdschel has joined #ruby
wvdschel has quit [Changing host]
wvdschel has joined #ruby
cgag has joined #ruby
zinjacoder has quit [Ping timeout: 276 seconds]
elux has joined #ruby
monokrome has joined #ruby
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
[edu] has left #ruby [#ruby]
llaskin has joined #ruby
<llaskin> how far does "break" take you out of a loop?
iocor has joined #ruby
fangwen has joined #ruby
<llaskin> for example: while something.each{|some| break} end will the break also kick me out of the while loop?
<llaskin> or only out of the each?
<banisterfiend> llaskin: that code is weird as hell
<banisterfiend> llaskin: you have an iteration as the condition for a loop?
<banisterfiend> llaskin: but to answer your question, it just breaks out of the block
<banisterfiend> so just th e{} part
<llaskin> banisterfiend: https://gist.github.com/2775663
<llaskin> is what it actually is
tobago has quit [Ping timeout: 240 seconds]
tobago|away has joined #ruby
<llaskin> there are multiple conditions that have to be true for me to be ok with breaking out...
ABK_ has quit [Ping timeout: 276 seconds]
ipoval has joined #ruby
<workmad3> llaskin: breaking out of multiple levels of looping is never very elegant
kryptek_ has quit [Quit: changing servers]
<llaskin> basically i need to find out if EACH ddown doesn't say "loading"
<llaskin> or that is, if all of them are done loading
maesbn has quit [Ping timeout: 240 seconds]
<llaskin> but the loop i designed won't work now that I look at it
<banisterfiend> llaskin: if u want to break out of multiple levels use throw/catch
<workmad3> llaskin: so what you want is items.all? {|i| i.include? ("Loading")}
booginga has left #ruby ["Leaving"]
<llaskin> ooooh
<llaskin> yes
<workmad3> (except without the braindead ' ' before ("loading")
<llaskin> hrmmmm
Helius has quit [Remote host closed the connection]
<llaskin> but how can I have it keep repeating the items.all? until that returns true
<llaskin> https://gist.github.com/2775663 is what it is down to
<llaskin> basically if either of the ddowns includes? 'Loading', I want it to rerun the loop
ben_alman has quit [Excess Flood]
alek_b has joined #ruby
<workmad3> llaskin: this is capybara, right?
ben_alman has joined #ruby
<llaskin> negative
<llaskin> straight ruby webdriver
<llaskin> i think i got it
CheeToS has joined #ruby
<workmad3> llaskin: ah, ok... but still, just assign the .all? call to loading
albemuth has joined #ruby
uokesita has joined #ruby
<llaskin> workmad3: i'm confused
<llaskin> oooh
chrisbdaemon has joined #ruby
<llaskin> like this?
<chrisbdaemon> if i'm going to contribute to a gem, and my addition needs another gem installed.. how do i go about finding the lowest version of the other gem to be required?
nari has joined #ruby
exchgr has quit [Quit: exchgr]
<llaskin> woah
si14 has joined #ruby
<workmad3> chrisbdaemon: check the gemspec
<llaskin> i sorta understand that
<workmad3> llaskin: it's essentially a do-while loop ;)
<chrisbdaemon> workmad3: its not in the gemspec, i'd be adding a gem to it
khakimov has quit [Quit: Computer has gone to sleep.]
<llaskin> workmad3: yes i see
<workmad3> chrisbdaemon: ah, misread sorry... add the version you used while adding it
<lectrick> So if Ruby uses PCRE for regexen, how can I get this to work? https://gist.github.com/2775709
<llaskin> i've never seen that format/syntax before
<workmad3> chrisbdaemon: unless you fancy stepping down your version and testing
<workmad3> llaskin: I had to look it up :)
<chrisbdaemon> workmad3: alright, just wanted to make sure i wasn't expected to go back to previous versions
zinjacoder has joined #ruby
<shevy> ruby uses PCRE for regex?
<banisterfiend> shevy: Yeah
petercs has joined #ruby
khakimov has joined #ruby
<lectrick> oooh look, i'm educating even the regulars :)
<shevy> yeah ... hmm
<shevy> you shake up my world
<shevy> I don't like change in my world
<shevy> I think I have to not like you much lectrick :(
<lectrick> anyway i was all excited that there is a regex implementation that claims to be recursive
* lectrick is excited by odd things
saltnvinegar has quit [Quit: saltnvinegar]
<lectrick> shevy: it's ok. just let it happen.
<banisterfiend> lectrick: recursive in what sense
fearoffish has joined #ruby
<shevy> btw lectrick banisterfiend is a regex guru
* lectrick suddenly sounds like a rapist
<shevy> he even did an online course
<lectrick> lol
<shevy> for some days he pasted difficult questions
<shevy> noone could answer them here
wilmoore has quit [Remote host closed the connection]
<lectrick> banisterfiend: recursive in the apparently recursive sense
<banisterfiend> no haha, i just learned about htem from a theoretical/mathematical perspective
rippa has joined #ruby
<lectrick> banisterfiend: that is a fine perspective to learn them from, albeit one i avoid because it hurts my head
jrist is now known as jrist-mtg
wilmoore has joined #ruby
uokesita has quit [Ping timeout: 256 seconds]
<seanstickle> It's like the best way to learn programming is to read the Principia Mathematica
<seanstickle> Amirite?
<lectrick> theoretical math is underrated
<shevy> math is a solid area
<seanstickle> I'm not sure there is a thing called "theoretical math"
<shevy> all the haskell hackers know math
netogallo has quit [Ping timeout: 256 seconds]
eurek has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<banisterfiend> i'd like to write a regex implementation
<banisterfiend> not that hard actually
<lectrick> seanstickle: Clearly I am not a mathematician
<banisterfiend> but i guess the complexity comes into trying to make it efficient
<seanstickle> :)
<lectrick> haskell hackers love math
<wmoxam> haskell hackers love telling everyone that they use haskell and than it's the best
<wmoxam> ;)
<seanstickle> Well, at least they're not SML programmers.
<lectrick> wmoxam: I know a programmer who would stick their tongue at you if she heard that
wilmoore has quit [Ping timeout: 248 seconds]
<Fraeon> You know what's best?
<Fraeon> Factor
<lectrick> the best language is the one you love
sh1ps has joined #ruby
<Fraeon> No, if it's not the language I love
<lectrick> because that's the only one you're going to push to the limit
<Tasser> ∀X: X hackers love telling everyone that they use X and that's the best
<sh1ps> hello everyone
<Fraeon> lectrick: is that Paul Engemann I hear in the background?
gokul has joined #ruby
gokul has quit [Client Quit]
<lectrick> so anyway, is there any way to make that regex actually readable by ruby? https://gist.github.com/2775709
<Tasser> sh1ps, SML?
<seanstickle> I'm not so keen on Factor. But Forth is lovely.
<lectrick> before you jump on me about performing any sort of validation via regex, note that I am only interested in this as an educational exercise
<keanehsiao> is there any possibility to limit the max connections for event machine??
<sh1ps> Tasser: err…Should I feel dumb for not knowing what SML means?
<seanstickle> Tasser: Standard ML
heftig has joined #ruby
<Tasser> seanstickle, connected to UML?
<seanstickle> Tasser: Not in any way.
<lectrick> seanstickle: I learned about FORTH soon after I fell in love with RPN calculators. It was pretty timely lol
<lectrick> Forth has a sexy simplicity
<Tasser> fancy
<sh1ps> interesting
<kalleth> lectrick: i read up on RPN and it broke my head
<Tasser> lectrick, friend of mine mentioned that if you get a forth-processor, they're often spaceproof
liluo has quit [Remote host closed the connection]
<kalleth> i do not have a mathematical brain ;(
<seanstickle> Everyone has a mathematical brain. The word "mathematics" itself means "that which can be learned"
<kalleth> psh
<seanstickle> But most math is taught like a bag of rocks being slammed against your skull.
<seanstickle> So people learn to hate it
<kalleth> i like that
* kalleth tweets
<kalleth> do you have a twitter, sean
<seanstickle> kalleth: @seanstickle
<seanstickle> kalleth: :)
<Tasser> seanstickle, nice :-)
codebeaker has quit [Quit: codebeaker]
DrShoggoth has joined #ruby
mengu has quit [Read error: No route to host]
<lectrick> Tasser: Define "spaceproof"?
<lectrick> Tasser: You mean they were used on spacecraft?
<Tasser> seanstickle, I suppose mathematics is of arabic origin?
<Tasser> lectrick, exactly
<lectrick> seanstickle: Never knew that definition of mathematics. Very cool
yannis has joined #ruby
<seanstickle> Tasser: the word? No, it is Greek
<Tasser> right, the were first
<lectrick> Tasser: Did you know there's a Forth interpreter embedded in the Apple computer firmware?
<seanstickle> lectrick: OpenFirmware, sure
<lectrick> yep
<seanstickle> lectrick: delightful!
<seanstickle> The best language for creating a system to work without an OS, IMO
<Tasser> lectrick, the whole EFI stuff?
<lectrick> Tasser: Yep
<lectrick> holy fuck there is a Minecraft mod that will let you build computers that are programmable using Forth, *inside the game*?
<JonnieCache> people have been building microprocessors inside minecraft for a while
<banisterfiend> Tasser: you mean mathematics per se? or just the word? if you mean mathematics per se, then: LOL (smacks u on the head)
<JonnieCache> thats just a mod to make it easier
<lectrick> JonnieCache: Ah, I didn't realize. I think I saw an AND gate once or something. Anyway http://www.eloraam.com/
<sh1ps> Does anyone have any experience using Net HTTP proxy?
<Tasser> banisterfiend, just the word *smacks back*
<banisterfiend> :*
<sh1ps> I'm trying to build a really simple sinatra app that just forwards requests through a proxy and returns the body
jackiechan0 has quit [Quit: Sto andando via]
<kalleth> aaah, middleware.
<sh1ps> which is working, but the problem is none of the external http requests are coming through
<sh1ps> and I don't really even know where to ask since I know it's not a Ruby specific problem
<sh1ps> nor is it a Sinatra problem
<sh1ps> >.<
<kalleth> well
<kalleth> you say 'external http requests'
<lectrick> middleware baby
<kalleth> do you mean sinatra is not recieving requests you make to it
<lectrick> rack
<kalleth> or do you mean sinatra is not sending a request to your proxy
<lectrick> actually i have to write a test for some new rack middleware today and am currently scratching my head
<kalleth> lectrick: i've never written a basic 'rack' app
<sh1ps> Ok so it all works, meaning I make the request and it comes back with the body of the page
<sh1ps> but no images, css, js, etc
looopy has joined #ruby
<kalleth> everything i've done has been either a ruby daemon, or a rails app atm
<sh1ps> any http request on the page doesn't work.
eurek has joined #ruby
<kalleth> sh1ps: so you're trying to use sinatra... as a passthrough proxy?
jprovazn is now known as jprovazn_away
<kalleth> that's probably because some weird shit is happening in the nginx/apache config to remap the requests
<sh1ps> I know it sounds really dumb but they asked me to do this at work as a proof of concept
<kalleth> which you're not letting it do
<lectrick> kalleth: it's pretty easy. it's a class that has to implement the "call" method which takes an env, and returns an array of [response_code, request, response] I think. It's in the Rack docs. Trust me it's pretty simple.
exchgr has joined #ruby
ABK_ has joined #ruby
<kalleth> lectrick: awesome
yeggeps_ has joined #ruby
<kalleth> lectrick: my next task is to figure out something to make with sinatra
<banisterfiend> JonnieCache: did u know brownoski died only a year after finishing the ascent of man?
<lectrick> kalleth: It is as simple as it can be to do what it does, which is ideal
phantasm66 has joined #ruby
<JonnieCache> banisterfiend: no i didnt. he wasnt that old either
<kalleth> lectrick: i'm thinking of making a single-client API
<lectrick> kalleth: if you want to maybe work with me on writing a test for it we can figure it out together
mnaser has quit [Quit: Computer has gone to sleep.]
<lectrick> that way you have your whole test-first done
<shevy> yay, a team!
<shevy> code, hugs and kisses!
bbttxu has joined #ruby
king313 has joined #ruby
<kalleth> lectrick: i.e. a rack app that takes an image as uploaded, then does some awesome stuff to interpret that image, and returns a json array of the data found from that image
<sh1ps> kalleth: but yes, that's the basic gist. I'm essentially just trying to take a URL parameter and pass it to the proxy and then return the result
<JonnieCache> all the greats man, feynman, carl sagan, john peel
<sh1ps> seemed like a simple task initially :|
<lectrick> kalleth: sounds like a plan
<JonnieCache> just one ones i can think of right now
mneorr has joined #ruby
<kalleth> lectrick: http://sitefiles.hexr.co.uk/1/match-screenshots/370/authority_backlot_13-10.jpg <- take that image in the rack app (or similar images), and extract team scores (13 10), player scores (score/kills/assists/deaths) using fuzzy magic stuff, and then return all that as a json array
yeggeps has quit [Ping timeout: 244 seconds]
<kalleth> that's my plan
<kalleth> :)
ABK_ has quit [Read error: Connection reset by peer]
<kalleth> also, match the names and do an strcompare to extract the 'team tag' from the start of peoples names where unique
<kalleth> the complicated part of this is _not_ going to be the rack app ;)
ABK_ has joined #ruby
* kalleth wonders if there's an image recognition library
<lectrick> kalleth: do you have an image parser lined up already that will extract text from images?
<kalleth> nope
<kalleth> i've literally had the idea today
lkba has joined #ruby
<lectrick> ok get on that and I will start forwarding links to you to read lol
<kalleth> :|
<kalleth> awesome
<kalleth> github.com/kalleth
<kalleth> :)
<kalleth> I may start this evening
<lectrick> kalleth: http://rack.rubyforge.org/doc/SPEC.html Don't fear that it's a spec. It's pretty straightforward reading.
<kalleth> *bookmarks*
liluo has joined #ruby
<kalleth> at least initially, i'll probably write the ruby script/code that extracts the text
<kalleth> then i'll be working on wrapping it up as a rack app :)
llaskin has left #ruby [#ruby]
<kalleth> maybe a gem
<kalleth> and the rack app just handles the upload and passes the file path to the gem
<kalleth> which returns a data structure, which the rack app to_jsons
<lectrick> kalleth: Read that, then look at the source for some existing Rack middlewares out there for ideas. There are a bunch on github.
<kalleth> :)
<kalleth> honestly, it depends
<kalleth> not sure it's a good idea to go barebones rack app, might be easiest to just use sinatra or smt.
sh1ps has quit [Quit: sh1ps]
<lectrick> kalleth: yeah i'd use some kind of simple web request handling api if Rails is too heavy for you
<kalleth> oh, rails is far too heavy for a single-client API
<kalleth> the actual code that does the text extraction willbe wrapped up in a gem i think
<lectrick> so go with sinatra then or your choice
heftig has quit [Quit: leaving]
<lectrick> ok i gotta bang my head on work stuff for a bit good luck
<kalleth> :)
<kalleth> ta
senny has quit [Remote host closed the connection]
nari has quit [Ping timeout: 260 seconds]
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
looopy has quit [Remote host closed the connection]
kenperkins has joined #ruby
alexim has quit [Ping timeout: 276 seconds]
ipoval has quit [Quit: ipoval]
Guest18349 has joined #ruby
whap has joined #ruby
chazbo has joined #ruby
whap has left #ruby [#ruby]
PragCypher has quit [Read error: Connection reset by peer]
bartavelle has joined #ruby
bbttxu has quit [Quit: bbttxu]
PragCypher has joined #ruby
bartavelle has left #ruby ["couic"]
Jay_Levitt has quit [Quit: Linkinus - http://linkinus.com]
ABK_ has quit [Read error: Connection reset by peer]
apeiros_ has quit [Remote host closed the connection]
ABK_ has joined #ruby
heftig has joined #ruby
kil0byte_ has joined #ruby
ckrailo has joined #ruby
pygospa has quit [Ping timeout: 240 seconds]
cdepue has quit [Remote host closed the connection]
ABK_ has quit [Read error: Connection reset by peer]
ABK_ has joined #ruby
<JonnieCache> kalleth: if you only have one endpoint sinatra is pointless
pygospa has joined #ruby
<JonnieCache> sinatra is basically just a router, and a way to avoid typing `require 'tilt'`
ABK_ has quit [Read error: Connection reset by peer]
<JonnieCache> just use rack
kil0byte has quit [Ping timeout: 248 seconds]
ABK_ has joined #ruby
exchgr has quit [Quit: exchgr]
MasterIdler has joined #ruby
liluo has quit [Remote host closed the connection]
kil0byte has joined #ruby
ABK_ has quit [Read error: No route to host]
wilmoore has joined #ruby
sbanwart has quit [Ping timeout: 248 seconds]
savage- has quit [Remote host closed the connection]
awarner has quit [Remote host closed the connection]
kil0byte_ has quit [Ping timeout: 265 seconds]
fjfish has quit [Ping timeout: 260 seconds]
niklasb has joined #ruby
gyre007 has joined #ruby
awarner has joined #ruby
<lectrick> I think JonnieCache might be right. But I also think you will start to require more and more functionality as you build out this idea and then you will suddenly need a sinatra or a rails.
<lectrick> In other news I am having trouble looking up the docs for the (?(DEFINE) type keyword in regex, using google.
looopy has joined #ruby
<lectrick> when I use it in Ruby I get "undefined group option" so I suppose I can google "ruby regexp group options"
trivol has quit [Quit: trivol]
trivol has joined #ruby
<JonnieCache> lectrick: making a rack app into a sinatra one is a copy and paste job though, being as the whole rack api is still exposed in sinatra
khakimov has quit [Quit: Computer has gone to sleep.]
asobrasil has joined #ruby
schovi has quit [Remote host closed the connection]
khakimov has joined #ruby
francisfish has joined #ruby
wvms has quit [Quit: wvms]
<JonnieCache> sinatra is so elegant its amazing. look at the code some time its a work of art
<JonnieCache> theres a reason its so often imitated :)
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
awarner has quit [Remote host closed the connection]
exchgr has joined #ruby
trivol has quit [Ping timeout: 250 seconds]
kevinbond has quit [Quit: kevinbond]
<td123> JonnieCache: for simple sites, I agree :)
jackiechan0 has joined #ruby
dekroning has joined #ruby
<dekroning> hi
ananthakumaran has joined #ruby
<banisterfiend> JonnieCache: some of the code is just plain weird though
<JonnieCache> which bit are you thinking of
<banisterfiend> JonnieCache: like using define_method to create a method, then removing the method straight after but keeping a reference to the metho dobject around
<banisterfiend> JonnieCache: that's how get() etc work
walbert has joined #ruby
Eldariof-ru has quit [Ping timeout: 276 seconds]
<banisterfiend> JonnieCache: im sure there's a reason for it tho
<dekroning> I'm trying my best to do things TDD wise, and I got confused when to test... for example I need a Address class, but since it's actually nothing more then a data structure, do I still need to test it ?
<banisterfiend> just at first blush it appears weird
robdodson has joined #ruby
maletor has joined #ruby
tar_ has joined #ruby
<shevy> whoa
<shevy> that is some trick... define the method... remove the method... but a reference is kept
<shevy> what could this be used for?
yoklov has joined #ruby
<banisterfiend> shevy: well it's like instance_exec
<banisterfiend> but with some differences: 1. you get metohd rather than block semantics, 2. you get names in the backtrace
khakimov has quit [Quit: Computer has gone to sleep.]
thone_ has joined #ruby
Shahor has quit [Quit: Linkinus - http://linkinus.com]
deception1 has joined #ruby
evangelion has quit [Ping timeout: 245 seconds]
fabrice31 has quit [Remote host closed the connection]
heftig has quit [Quit: leaving]
celm has quit [Quit: Leaving]
Prz has quit [Remote host closed the connection]
<hoelzro> one thing I like about Ruby so far: its C API is quite nice
looopy has quit [Remote host closed the connection]
carloslopes has quit [Ping timeout: 256 seconds]
eurek has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
thone has quit [Ping timeout: 248 seconds]
apeiros_ has joined #ruby
niku4i has joined #ruby
td123 has quit [Read error: Connection reset by peer]
<seanstickle> Even better than Python?
<hoelzro> I haven't worked with Python's much
<banisterfiend> hoelzro: the ruby C API is too nice :P
_2easy_ has quit [Quit: Lost terminal]
<banisterfiend> it lets you do too much, hehe
looopy has joined #ruby
<hoelzro> as far as I've seen (regarding C APIs):
<banisterfiend> but that's fun
td123 has joined #ruby
<hoelzro> Perl < Ruby < Lua
netogallo has joined #ruby
deception1 has left #ruby [#ruby]
jrist-mtg is now known as jrist-afk
heftig has joined #ruby
<shevy> hoelzro wait for mRuby
<shevy> hoelzro its ambition is to replace lua
<shevy> it's like the ruby of today has become fat
<shevy> with mRuby, it is on diet!
<apeiros_> hi banisterfiend
<hoelzro> heh
<hoelzro> I once thought of implementing Ruby on top of Lua
linoj has quit [Read error: Operation timed out]
<Hanmac> hoelzro: call it lRuby
<seanstickle> Some folks thought about implementing Ruby on top of Parrot, and called it Cardinal.
<hoelzro> I was going to call it either Luby, or Roomba.
<seanstickle> But that project seems to have died. :(
Helius has joined #ruby
linoj has joined #ruby
savage- has joined #ruby
JohnBat26 has quit [Ping timeout: 245 seconds]
gilead has quit [Quit: Leaving]
irrationalfab has joined #ruby
cbuxton has joined #ruby
yoklov has quit [Quit: bye!]
heftig has quit [Ping timeout: 245 seconds]
stephenjudkins has joined #ruby
joshman_ has joined #ruby
locriani has quit [Read error: Connection timed out]
bluOxigen has quit [Ping timeout: 250 seconds]
andrewhl has joined #ruby
locriani has joined #ruby
<lectrick> holy fuck I think I may be on to something: https://gist.github.com/2775709 It will validate a simple json but it's currently failing on deeper JSON's
robdodson has quit [Quit: robdodson]
bashdy has joined #ruby
bier has quit [Ping timeout: 244 seconds]
minijupe has quit [Quit: minijupe]
kaspernj has quit [Ping timeout: 244 seconds]
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cj3kim has joined #ruby
prtksxna has quit [Remote host closed the connection]
<lectrick> well it actually works on deeper JSON's but… there may be corner cases, but those could be fixable by fixing the individual regexen defining the atoms… still, really cool
artOfWar has joined #ruby
<lectrick> for anyone curious i've been re-editing that gist
BrokenCo1 has joined #ruby
eywu has joined #ruby
BrokenCo1 has quit [Client Quit]
<shevy> seanstickle Parrot... dont you require perl 5 to build that?
<seanstickle> shevy: yes
tar_ has quit [Quit: tar_]
zommi has quit [Read error: Connection reset by peer]
hukl has joined #ruby
davidcelis has joined #ruby
jackiechan0 has quit [Ping timeout: 248 seconds]
CheeToS has quit [Ping timeout: 244 seconds]
<workmad3> lectrick: JSON BNF fun? :)
Foxandxss has joined #ruby
<workmad3> oh wait, SGML
<workmad3> why on earth would you do SGML? :P
mohits has quit [Ping timeout: 276 seconds]
<seanstickle> Military contracting maybe
<seanstickle> The Navy LOVES sgml
clockwize has quit [Quit: clockwize]
mohits has joined #ruby
imami|afk is now known as banseljaj
<lectrick> workmad3: yes, it is essentially a BNF isn't it
stephenjudkins has quit [Quit: stephenjudkins]
stkowski has joined #ruby
<workmad3> lectrick: yeah, but more fubared :P
ciopte7 has joined #ruby
<lectrick> workmad3: well, in the sense that regex is a nasty hack haha
<workmad3> :)
francisfish has quit [Remote host closed the connection]
BiHi has quit [Quit: Computer has gone to sleep]
cha1tanya has quit [Quit: Leaving]
heftig has joined #ruby
bier has joined #ruby
seanstickle has quit [Quit: Nihil sub sole novum]
Araxia_ has joined #ruby
irrationalfab has quit [Remote host closed the connection]
awarner has joined #ruby
yankov has quit [Quit: yankov]
stephenjudkins has joined #ruby
theRoUS has quit [Remote host closed the connection]
mattonrails has joined #ruby
mengu has joined #ruby
<shevy> ok
<shevy> it is time for the RubyOS
<shevy> who is with me?
xnm has joined #ruby
<apeiros_> *crickets*
<chrisbdaemon> how do you write an os out of an interpreted language?
jarjar_prime has quit [Quit: Ready? Set? Go!]
<shevy> chrisbdaemon by writing everything in the language
<chrisbdaemon> i wish you the best of luck with that
sick_protoman has joined #ruby
maesbn has joined #ruby
fridim_ has joined #ruby
mando has joined #ruby
irrationalfab has joined #ruby
jrist-afk is now known as jrist
theRoUS has joined #ruby
mdw has quit [Remote host closed the connection]
jimeh3 has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
jimeh2 has quit [Ping timeout: 265 seconds]
<shevy> I can sense a certain general lack of enthusiasm here
hoelzro is now known as hoelzro|away
tatsuya_o has quit [Remote host closed the connection]
exchgr has quit [Quit: exchgr]
<Alantas> I'm greatly enthusiastic about seeing someone else do that work!
<shevy> now that is better
Synthead has joined #ruby
<geekbri> there is no each_pair_with_index for hashes is there :)
ghanima has joined #ruby
sbooch has joined #ruby
<shevy> that would be quite long
sbooch has quit [Client Quit]
<geekbri> hehe sure would
<shevy> ruby core prefers short names
<shevy> one word or two words usually
<shevy> I cant give you an example for a 3 word method name right now in standard ruby
<apeiros_> shevy: while rubys performance is good enough for most computing tasks, and its capability to be extended with native gems makes up for many of the other cases - it won't be good enough for OS level tasks.
<geekbri> well there is a each_with_index, i was hoping for one that would give me the key value pair and an index
<Alantas> And Ruby on Lua might be called "RedMoon" or "Rubi". ("Lua" is the Portuguese word for "moon"; "rubi" for "ruby".)
<apeiros_> geekbri: each_pair.with_index
<Alantas> geekbri: mah_hash.each_pair.with_index{ |(key,value),index| ← I think }
<geekbri> apeiros_: ahh thanks. silly me
<geekbri> i will experiment and see if that works
timonv has quit [Remote host closed the connection]
<Alantas> Worked for me in irb.
exchgr has joined #ruby
bashdy has quit [Ping timeout: 265 seconds]
<apeiros_> well, it requires 1.9, but other than that… ^
ramblex_ has joined #ruby
ramblex_ has quit [Client Quit]
<Alantas> Worked for me in irb in 1.8.7.
<geekbri> yup worked for me too, and im on 1.9.2 so if it doesn't work in lower thats fine
<geekbri> oh even better
<apeiros_> they backported enum returning of the methods? nice… I'm off from 1.8 for too long I guess.
<workmad3> Alantas: really? wow... I thought the () syntax in proc parameters was 1.9+
jackiechan0 has joined #ruby
<geekbri> so im guessing the () syntax is just a grouping so it knows which block variables go with which proc
heftig has quit [Quit: leaving]
nlc has joined #ruby
irrationalfab has quit [Remote host closed the connection]
alexim has joined #ruby
kenichi has joined #ruby
dax has quit [Quit: brb]
<Alantas> Yeah, it's sorta like *these in method argument lists, I think.
<shevy> Hanmac, how would you switch between ruby 1.8 and 1.9 on debian?
heftig has joined #ruby
tatsuya_o has joined #ruby
<workmad3> () is for deconstructing an array
<workmad3> in that situation
<Hanmac> update-alternatives --config ruby
ByteCrunch has quit [Remote host closed the connection]
<shevy> Hanmac, but ... does that toggle between the versions? or select a specific one
<workmad3> but it does work in 1.8.7 for me, awesome :)
heftig has quit [Client Quit]
<workmad3> hmm, maybe it was just block params to blocks that was added
fangwen has quit [Quit: Page closed]
ramblex has quit [Ping timeout: 265 seconds]
KL7 has joined #ruby
<apeiros_> workmad3: also default values
KL-7 has quit [Ping timeout: 248 seconds]
tatsuya_o has quit [Remote host closed the connection]
<shevy> aha
<workmad3> apeiros_: :)
<apeiros_> at least I'm pretty sure proc { |x=nil| is invalid in 1.8
jimeh3 has quit [Read error: Operation timed out]
aantix has joined #ruby
<workmad3> invalid for me
<Hanmac> shevy: There are 2 choices for the alternative ruby (providing /usr/bin/ruby).
<Hanmac> 0 /usr/bin/ruby1.8 50 auto mode
<Hanmac> 1 /usr/bin/ruby1.8 50 manual mode
<Hanmac> * 2 /usr/bin/ruby1.9.1 10 manual mode
<Hanmac> Press enter to keep the current choice[*], or type selection number:
KL7 has quit [Read error: Operation timed out]
<shevy> aha
<shevy> I see
<shevy> a menu
<shevy> :)
dax has joined #ruby
maesbn has quit [Remote host closed the connection]
<Alantas> apeiros_: Yeah, syntax error here.
<shevy> my 1.8 brother, Atlantis!
<shevy> we'll defend it till the end of time itself
linoj has quit [Ping timeout: 245 seconds]
<Hanmac> shevy: this works too: update-alternatives --set ruby /usr/bin/ruby1.9.1
linoj has joined #ruby
S3kx is now known as S1kx
S1kx has quit [Changing host]
S1kx has joined #ruby
<Hanmac> apeiros_ proc{|*args| }
<apeiros_> Hanmac: I know. that was the work-around
<apeiros_> but manually defaultizing is fugly
maesbn has joined #ruby
<Alantas> Probably very Perl-y to pick arguments out of that, let alone default them.
yankov has joined #ruby
<Alantas> a,b,c = *args
<Alantas> my $a,$b,$c = @_; # or whatever it was in Perl
<apeiros_> a = default if args.size < 1; b = default if args.size < 2; …
maesbn has quit [Remote host closed the connection]
Vainoharhainen has quit [Quit: Leaving...]
<Alantas> a,b,c = *args; a ||= "herp"; b ||= "derp"; c ||= 5
c0rn has joined #ruby
<apeiros_> that's incorrect
<apeiros_> prc.call(nil, false) # broken
adamkittelson has joined #ruby
awarner has quit [Remote host closed the connection]
carlyle has joined #ruby
<Hanmac> apeiros_ no works for me
<Alantas> Maybe something like: a,b,c = *(["herp", "derp", 5][0...args.length] = args)
<Alantas> Take defaults, overlay provided args, receive bacon.
Targen has quit [Ping timeout: 244 seconds]
kaspernj has joined #ruby
subr00t has joined #ruby
mdhopkins has quit [Quit: mdhopkins]
<subr00t> hi
<subr00t> can someone please help me with this http://bit.ly/KscI11
lxsameer has quit [Quit: Leaving]
<apeiros_> Hanmac: it works *incorrectly*
<apeiros_> it will override the value you passed. this is not the case with true default values
<apeiros_> compare: def foo(a="hi"); p a; end; foo(nil)
<apeiros_> vs.: def foo(*args); a = args.first || "hi"; p a; end; foo(nil)
<Alantas> Doh, ary1[]=ary2 returns ary2.
ByteCrunch has joined #ruby
awarner has joined #ruby
<apeiros_> Alantas: yes, all <foo>= methods return the rhs, except if you call them using send
petercs has quit [Ping timeout: 244 seconds]
<apeiros_> (then it depends on their implementation)
celm has joined #ruby
<Alantas> proc{|*args| init=["herp","derp","wut"];init[0,args.length]=args; a,b,c = *init; ...}
workmad3 has quit [Ping timeout: 250 seconds]
<Alantas> that.call(nil,false) works as expected.
carloslopes has joined #ruby
petercs has joined #ruby
<Alantas> For only one or two args, kinda overkill, but more are easy to add.
<apeiros_> yes. as I said: defaultizing manually = PITA.
heftig has joined #ruby
apeiros_ has quit [Remote host closed the connection]
itnomad has joined #ruby
n1x has joined #ruby
rtl_ is now known as rtl
sbanwart has joined #ruby
td123 has quit [Read error: Connection reset by peer]
PragCypher has quit [Read error: Connection reset by peer]
mando has quit [Remote host closed the connection]
PragCypher has joined #ruby
td123 has joined #ruby
lopin has quit [Ping timeout: 240 seconds]
andrewhl has quit [Quit: andrewhl]
jackiechan0 has quit [Quit: Sto andando via]
yosinof has joined #ruby
kaspernj has quit [Ping timeout: 276 seconds]
heftig has quit [Ping timeout: 245 seconds]
minijupe has joined #ruby
d3vic3 has quit [Quit: leaving]
n1x has quit [Quit: "X-zam :/"]
heftig has joined #ruby
jayrulez has joined #ruby
narshlob has joined #ruby
fermion has quit [Quit: Computer has gone to sleep.]
cbuxton has quit [Ping timeout: 244 seconds]
nfluxx has joined #ruby
v0n has joined #ruby
statix has quit [Remote host closed the connection]
statix has joined #ruby
kenneth has quit [Quit: kenneth]
erikstraub has joined #ruby
<erikstraub> does anyone know what would cause rspec output like this >> http://d.pr/i/YOG5
KL-7 has joined #ruby
wiwillia has joined #ruby
cbuxton has joined #ruby
lxsameer has joined #ruby
<wiwillia> if anyone is looking for a weekend project, I just designed http://i.imgur.com/uxMT2.jpg (monthly micro-distillery whiskey subscriptions) - advertising it as a father's day gift concept.
td123 has quit [Quit: WeeChat 0.3.7]
linus95014 has joined #ruby
ibash has joined #ruby
<ibash> what does --no-ri do when doing a gem install?
<ibash> -> not in documentation
narshlob has left #ruby [#ruby]
<Alantas> "Another sale line for this whiskey." Well, I'm convinced!
<shevy> it should skip the installing-docu part
timonv has joined #ruby
<wiwillia> Alantas just lorem ipsum (fake text) for now until I work on the actual sales text :P
<wiwillia> BUT
<ibash> holy shit!
<wiwillia> I'm sure the "third selling point" had you
<ibash> I didn't know ri existed...
<ibash> where can I find ruby tool basics and things like that, instead of blindly following videos / tutorials
petercs has quit [Ping timeout: 248 seconds]
<deryl> http://www.ruby-lang.org/en/ read the documentation, follow the Get Started etc
aszurom has joined #ruby
v0n has quit [Ping timeout: 272 seconds]
azm has joined #ruby
christianrojas has joined #ruby
<shevy> ibash best way is to try and compile ruby from source. that way you really learn most
<shevy> ibash, the bindings are typically in the directory ext/
cordoval has joined #ruby
<shevy> like openssl, readline and so forth
kenneth has joined #ruby
nu7hatch has left #ruby [#ruby]
cordoval has left #ruby [#ruby]
<aszurom> it's noob time! What have I done wrong here? http://pastebin.com/5emGW9Dw
<shevy> ibash, also work through "learn to program" by chris pine at least once. then start reading official docu about the powerhorses of ruby - class Array, Hash and String
<shevy> aszurom what error you get
ukwiz has quit [Quit: Leaving]
<shevy> it is not idiomatic though
<shevy> if (val < minz) then { minz = val }
<shevy> change it to
<shevy> minz = val if val < minz
<shevy> also you should indent when making a newline after {
<aszurom> yeah, it's complaining about unexpected }
<shevy> array.each {
<Alantas> orealis: if val < minz then minz = val end
<shevy> continue_here
<shevy> }
<Alantas> * or:
<ibash> thanks!
<shevy> and you should use pastie.org, it has syntax highlighting :)
voodoofish430 has joined #ruby
<Alantas> (For some reason I tab-completed "or"?)
Eldariof-ru has joined #ruby
<Alantas> Or really, just: inputarray.min
<aszurom> I'm having to write my own method to find min of an array for some reason
<Alantas> inputarray.reduce{|minz,val| val < minz ? val : minz}
<aszurom> I'm reading a csv into csv[x][y] type array
<shevy> well should not be a problem
erikstraub has left #ruby [#ruby]
<aszurom> when I say csv[5].max it's returning something that is NOT the max value in the array
<shevy> and how does csv look like
<shevy> with [5] you fetch the sixth entry there
<Alantas> csv[5].max_by(&:to_i)
DRCALKIN has joined #ruby
<Alantas> (If they're arrays of strings, it does string/lexical comparison. The to_i thing makes real numbers out of them and compares them as such.)
<aszurom> here's the whole thing? http://pastie.org/3956732
fridim_ has quit [Ping timeout: 264 seconds]
adambeynon has quit [Quit: adambeynon]
<aszurom> it's a csv containing hourly readings for cpu, ram, disk, wan etc.
<aszurom> so I pop the headers off, then transpose to flip the array so that columns are rows
simao has quit [Ping timeout: 260 seconds]
<aszurom> thinking that if I want to find the max in csv[rows][3] then it becomes csv[3].max
<aszurom> once it's transposed that is
<shevy> I dont think that helps much
<shevy> because I at least stilld ont know what csv contains
<shevy> aszurom, do require 'pp'
<shevy> then pp csv
<Alantas> Try max_by(&:to_i) if you're expecting them to be numbers.
<Alantas> Also, that.
<aszurom> what is pp?
<shevy> pretty print
<shevy> go try it ;)
Morkel has joined #ruby
itnomad has quit [Ping timeout: 245 seconds]
<aszurom> pp is showing me the original document, tilted sideways as I intended
Solnse has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
<shevy> aszurom can you put the output of pp into a pastie.org pls?
<shevy> but
<shevy> if pp shows the right data, then all is fine or?
<aszurom> if it's showing as "123", then it's string not integer type?
<shevy> %w( 1 2 3 4 5 ).max # => "5"
<aszurom> should it be 123,
<shevy> [1,2,3,4,5].max # => 5
<aszurom> what is %w ?
<shevy> notice the difference?
<shevy> a simpler way to make an array
<shevy> but strings
<shevy> the first example has "1","2" etc..
<shevy> and returns a string called "5"
<shevy> the second example has integers and returns 5
<shevy> without quotes
<aszurom> ok, so how can I convert the whole array from being strings to integer?
<aszurom> array.to_i ?
<shevy> are they all numbers?
<aszurom> yep
<Alantas> %w( 100 20 3 ).max # => "3"
<shevy> Atalanta showed the solution %w( 1 2 3 4 5).map(&:to_i)
<Alantas> %w( 100 20 3 ).max_by(&:to_i) # => "100"
ramblex has joined #ruby
Helius has quit [Remote host closed the connection]
<Alantas> Or, yeah, map!(&:to_i) first, then plain .max will work later on.
arturaz has quit [Ping timeout: 276 seconds]
<aszurom> I just don't understand the &:to_i part
<shevy> it is the same as:
<aszurom> what is &
<shevy> %w( 1 2 3 4 5).map {|x| x.to_i }
<shevy> almost the same
<shevy> I think it is slightly slower than the |x|
<Alantas> It's basically a shortcut for that sort of thing.
<shevy> but less characters to type
heftig has joined #ruby
<shevy> aszurom, you can use either way
roams has joined #ruby
heftig is now known as Guest68990
cmarques has joined #ruby
petercs has joined #ruby
awarner has quit [Remote host closed the connection]
abra has joined #ruby
<aszurom> csv.map!{ &:to_i } pops an error "unexpected tAMPER"
Guest18349 has quit [Read error: Connection reset by peer]
Helius has joined #ruby
<rking> aszurom: Get rid of those {}'s.
<aszurom> oh it's ( not {
<Alantas> Also, that won't work on a multidimensional array like that.
<rking> And ()'s aren't necessary.
kenichi has quit [Remote host closed the connection]
Guest18349 has joined #ruby
<Alantas> csv.each{ |a| a.map!(&:to_i) } # assuming you mean every [x][y] to be an integer.
eywu has left #ruby [#ruby]
davidpk has joined #ruby
petercs has quit [Ping timeout: 252 seconds]
<aszurom> groovy, that fixed it
jobicoppola has joined #ruby
cek has joined #ruby
Guest18349 has quit [Read error: Connection reset by peer]
<cek> need help with regexp. a complex one. who wants to help/
<shevy> what is your aim with that regex
chazbo has quit [Remote host closed the connection]
Guest18349 has joined #ruby
ElitestFX_ is now known as ElitestFX
Eiam has joined #ruby
jgrevich_ has joined #ruby
ElitestFX has quit [Quit: Page closed]
andrewhl has joined #ruby
<cek> 1.8.7, please
awarner has joined #ruby
<cek> The idea is to have Target LUNID printed with inclusion of LUN ID's arrays
Guest18349 has quit [Read error: Connection reset by peer]
aaroncm has joined #ruby
Guest18349 has joined #ruby
maesbn has joined #ruby
kenichi has joined #ruby
<RubyPanther> cek: you've got the flags line after the paths line, but you only match up to paths, so it doesn't repeat
<cek> So that I would get: [[120, "iqn.2000-00.blahblah", ["LUN: 0", "Baking store: None"], ["LUN: 10", "Baking store: /dev/fused/test"], ["LUN: 11", "Baking store: /dev/fused/test2"]], [121, "iqn.2000-00.blahblah.srv2", ["LUN: 0", "Baking store: None"], ["LUN: 11", "Baking store: /dev/fused/test3"]]
timonv has quit [Remote host closed the connection]
mattonrails has quit [Remote host closed the connection]
<cek> That is, Array< Array<Fixnum: target id, String: target name, Array<String: LUN id, String: LUN device>+ >+ >
<Alantas> aszurom: I was bored: http://pastie.org/3956849
<cek> Thanks again to rubydocs being unstandardized
chienpo has joined #ruby
Helius has quit [Remote host closed the connection]
kirun has joined #ruby
brianpWins has joined #ruby
bluOxigen has joined #ruby
brianpWins has quit [Client Quit]
brianpWins has joined #ruby
cj3kim has quit [Quit: Leaving]
ryanf has joined #ruby
<Alantas> (Doh, #{fields.sum} not #{fields.total}. <edits>)
petercs has joined #ruby
Guest18349 has quit [Read error: Connection reset by peer]
digitalcakestudi has quit [Ping timeout: 248 seconds]
Guest18349 has joined #ruby
Urth|Away is now known as Urthwhyte
cmarques_ has joined #ruby
AlbireoX`Away is now known as AlbireoX
mdhopkins has joined #ruby
iocor has quit [Quit: Computer has gone to sleep.]
cmarques has quit [Ping timeout: 244 seconds]
cwill747 has quit [Remote host closed the connection]
snearch has joined #ruby
mk03 has joined #ruby
jgrevich has joined #ruby
brg has joined #ruby
jgrevich has quit [Read error: Connection reset by peer]
jgrevich_ has quit [Read error: Connection reset by peer]
<brg> hi
Urthwhyte is now known as Urth|Away
<Alantas> Greetings and salutations.
<brg> any body know gud rails project to start with?
mrlemon has quit [Quit: mrlemon]
SeoxyS has joined #ruby
<Alantas> Perhaps an automatic spellchecker?
delinquentme has joined #ruby
GuidovanPossum has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
<Hanmac> i never heard of a good rails project
thecreators has quit [Quit: thecreators]
<rking> Hanmac: Oh come on now.
<brg> Hanmac: hmm
kenneth has quit [Ping timeout: 240 seconds]
SeoxyS is now known as kenneth
<brg> interesting
<delinquentme> So I'm using ruby to process on some JSON data fo jQuery / JS this is what I have going on: http://pastie.org/3956913
<carloslopes> Hanmac really doesn't like rails :)
* Hanmac can write an http server in C
<delinquentme> basically I've got s vars that I need to evaluate ( x in nodes[x] )
DRCALKIN has quit [Ping timeout: 244 seconds]
test34 has quit [Quit: left]
gyre007 has quit [Quit: Ex-Chat]
<delinquentme> but I'm at a loss for how to evaluate the "value" in the Key-Value pair
<delinquentme> without quotes
<Alantas> delinquentme: Hmm, maybe use a regex to pick out the number, then map it.
tobago has joined #ruby
jackiechan0 has joined #ruby
test34 has joined #ruby
test34 has joined #ruby
test34 has quit [Changing host]
<carloslopes> Hanmac: i agree in part with you, because, it's very good a http server in C or even make a web app in C, but, and your productivity?
maesbn has quit [Remote host closed the connection]
<wmoxam> all teh things in C!
lxsameer has quit [Quit: Leaving]
tobago|away has quit [Ping timeout: 244 seconds]
<delinquentme> Alantas, thats a possible idea
<billiamii> cek, Think youre going to need to capture that data in multiple passes:
<delinquentme> the other interesting this is this is how im building: links << {'source'=> eval_source , 'target'=> eval_main}
<delinquentme> and the source is output without quotes
<delinquentme> lol...
<cek> billiamii, noah, i need an one-liner.
<billiamii> pass one: fetch LUNID, and entire block of lun id arrays. pass 2: break down the lun id arrays.
<delinquentme> i could just process on the entire JSON string and remove all quotes
<cek> that ain't cool. what i'm trying to do is (()+)+
<cek> so to speak
<billiamii> cek, I think its going to be a one liner with two passes.
<billiamii> :)
etank has joined #ruby
bbttxu has joined #ruby
<billiamii> I may be wrong here, but I do not believe you can add the + for a repeat outside of the capturing group, and get multiple captures back.
ronniy has quit [Remote host closed the connection]
<carloslopes> brg: and there are a lot of good projects written with rails
elake has quit [Ping timeout: 252 seconds]
iocor has joined #ruby
SPYGAME has quit [Quit: Leaving]
Guest68990 has quit [Changing host]
Guest68990 has joined #ruby
Guest68990 is now known as heftig
<wmoxam> carloslopes: lies!
<wmoxam> ;)
tobago has quit [Quit: Bye]
<carloslopes> wmoxam: hahaha :)
Eldariof59-ru has joined #ruby
coyo has joined #ruby
tobago has joined #ruby
<wmoxam> carloslopes: there are obviously good rails projects, it's just that they can't scale
<rking> Oh come on now, also.
<wmoxam> which is why we need ppl like Hanmac to re-write them in C
<rking> Scale in what sense? Complexity management or efficiency?
tobago|away has joined #ruby
snearch has quit [Quit: Verlassend]
<carloslopes> wmoxam: you scale a site, not a framework :)
<wmoxam> rking: I am completely serious
irrationalfab has joined #ruby
<rking> And wrong.
* wmoxam deadpans
<rking> That's nonsense.
<rking> OH, OK.
<rking> Sorry.
<coyo> lolol
<wmoxam> trolololol
<coyo> hello rubyists
queequeg1 has quit [Remote host closed the connection]
<deryl> wmoxam, you at it again? ;)
<wmoxam> deryl: always
<deryl> i see youo got a couople hits ont he line hehe
ElitestFX has joined #ruby
<carloslopes> i completely agree with rking
<deryl> wow I'm playing too much on my tablet. I just touched my monitor to change channels :)
<coyo> hehe
mdhopkins has quit [Ping timeout: 252 seconds]
<rking> deryl: Give it 3 years.
<Alantas> "And it *worked*."
<rking> Touch UI + Keyboard is a good combo.
Eldariof-ru has quit [Ping timeout: 248 seconds]
<deryl> Alantas, lol i wish :)
tvw has quit [Read error: Connection reset by peer]
<coyo> elo touchscreens exist. i want one for games.
<subr00t> can someone please help me with this? https://gist.github.com/2776922
<rking> deryl: I have a rvm-on-zsh doc bug for you.
<deryl> rking, yeah that would be killer. I'd love a 22" LCD touchscreen monitor that worked with Linux and OSX :)
<TTilus> deryl: i do that a lot, have been doing for quite number of years, and blame psion 5mx for that
<deryl> rking, file it but cc @mpapis. I frigign HATE zsh and i don't use it at ALL.
<wmoxam> carloslopes: I actually don't see the 'scaling argument' used much anymore. I guess it's because twitter is stable now
mohits has quit [Quit: Leaving]
<rking> deryl: h8r.
tobago has quit [Ping timeout: 244 seconds]
<wmoxam> carloslopes: because, you know, if your web framework can't handle #ROFLTWITTERSCALE then is SUCKS!
<deryl> rking, if its a website bug then submit and i'll fix (or edit through GH's web interface for a pull req and I'll merge)
<wmoxam> *it
<deryl> rking, damn straight :)
<rking> deryl: Oh, good point. I'll pull req.
tobago has joined #ruby
Guest18349 is now known as zii
digitalcakestudi has joined #ruby
zii has quit [Changing host]
zii has joined #ruby
<deryl> rking, cool. if you're doing it now, let me know when you complete it so i don't hav eto wait for the email :)
DRCALKIN has joined #ruby
<rking> deryl: Nah, I'm working now. But I have my ~/.zshrc saying 'echo "Tell deryl about the following…"' so there's 0% chance I'll permantly forget.
<Alantas> subr00t: No idea how to interface with the other things, but, that last line will build up the hash then discard it because you never assign it to anything.
<rking> Well, 0.0x%
<deryl> rking, excellent :)
<Alantas> foo = ec2.instances.inject...
<rking> And s/ntly/nently/
DRCALKIN has quit [Client Quit]
<deryl> hehe dude you see how often i typo.
bosphorus has quit [Remote host closed the connection]
awarner has quit [Remote host closed the connection]
<rking> Some day I'm going to begin Platinum IRC Mode, where from that day forward I correct 100% of my IRC typos.
<subr00t> Alantas: exactly, all what i need is how to store the id/status to the db, the last line isn't needed
digitalcakestudi has quit [Read error: Connection reset by peer]
mneorr_ has joined #ruby
<shevy> rking I like your typos
<deryl> rking, i want a automated typo fixer :)
<wmoxam> I hate IOS autocorrect
<deryl> and language structure fixer (an automated, not a automated)
<carloslopes> wmoxam: like i said before.. i agree with you too, but in part... because, if my site is not like twitter (and i think that is really difficult to find anyone here with a case like twitter).. i don't need to have my web app written in C to respond with 50ms to my client.. my client is satisfied with 300-500ms :)
<coyo> what, like the autocorrect for ios?
<rking> deryl: That's like the last fronteir of AI. It'll never happen in our lifetimes.
<wmoxam> it always screws up my texts
<deryl> rking, hahah unfortunately
<deryl> coyo, well one with better accuracy
davidcelis has quit [Quit: K-Lined]
snearch has joined #ruby
<deryl> one that doesn't turn pen is into penis
<wmoxam> carloslopes: I've been trolling fyi
<coyo> deryl, good luck.
<rking> wmoxam: I really like the way my current Android SMS does it — there's a list of suggestions above the keyboard that you can tap, good for both completion and correction, but nothing's automatically replaced.
<wmoxam> :p
<roolo> How do i raise a value in record in sequel update
<roolo> ?
<coyo> :P
<rking> s/fronteir/frontier/; # btw
<carloslopes> wmoxam: ¬¬ hahaha
<rking> carloslopes: Double-negative?
<roolo> I mean i have column with value a and i want to do UPDATE .... SET number = number +3
<coyo> ruby is fast enough for the vast majority of things.
<rking> Yes! Let's have the efficiency discussion to totally punish wmoxam for trolling about it.
mneorr has quit [Ping timeout: 260 seconds]
<rking> Woohoo.
<coyo> :D
tobago has quit [Quit: Powered by fIRC v1.0.1 (r130) the Android IRC client.]
<rking> You see, dear friends, Premature Optimization is the Root of All Evil.
* coyo sits down like a good kiddie and listens.
<shevy> no
<shevy> I am the Root of All Evil.
<shevy> I take great pride in that
<carloslopes> rking: no, is dull face ;)
<rking> Though a certain language, such as Ruby, might have less efficient function call semantics, this is for a higher-level purpose. At any point you can convert some code to C or even Asm… [stop me when I've countertrolled enough]
* coyo giggles.
<shevy> I'll never stop countertrolling
<shevy> I support you fully rking
<TTilus> *facepalm*
tobago has joined #ruby
<wmoxam> rking: Ruby is ok, just make sure you compile it with -funrollups
<coyo> hello TTilus
<Hanmac> shevy no, eval is the Mother Root of all evil
<shevy> that bitch
<rking> Grr... countercountertrolled. >=\
<shevy> retorttrolled!
<coyo> wmoxam, you mean --fruitrollups?
tatsuya_o has joined #ruby
<deryl> wtf is an apt compiler in relation to jruby? jruby-head build keeps puking due to Error running apt compiler
<rking> You know, I realized I was an old man the day I shotgunned a pack of Fun Dip. If I had a Fruit Rollup in front of me I'd wad & chew it, too.
<deryl> wondering if someone typo'd and meant ant rather than apt
<TTilus> coyo: i think it was --fruityloops
<wmoxam> --omg-optimized
<rking> wmoxam: Thanks for that link. I'm slowly sliding in the Gentoo Ricer direction.
<wmoxam> lolz
<wmoxam> I wasted many hours on Gentoo in 2002-2003
<wmoxam> I've learned my lesson :/
<rking> s/wast/invest/
<wmoxam> no, it was a waste
<rking> s/st//g
<deryl> line its bitching about is deprecation="true" encoding="UTF-8" includeantruntime="true"> happy happy joy joy
<shevy> man
<shevy> compiling
<shevy> the problem is
<shevy> it's no fun the way how linux works!
mbhnyc has joined #ruby
<rking> shevy: Ineveryjesthereissometruth. What's the truth part of that?
* coyo giggles at the site
jonny has joined #ruby
jonny has left #ruby [#ruby]
mbhnyc has quit [Client Quit]
<coyo> gentoo ricer
yeggeps_ has quit [Read error: Connection reset by peer]
kvirani has joined #ruby
<shevy> rking when things dont work together
yeggeps has joined #ruby
<rking> shevy: But like, where does it work better?
mattonrails has joined #ruby
<shevy> it does not work better really :(
<shevy> perhaps on gobolinux
albemuth has quit [Quit: Leaving...]
<rking> I guess I need to look at gobolinux. 2nd time you've mentioned it.
<shevy> but the classical distributions will never abandon the status quo
albemuth has joined #ruby
<shevy> rking, well you could use gobolinux just like any other distribution. cd /usr/bin works. but everything is installed into versioned directories. /Programs/Python/2.5.2
digitalcakestudi has joined #ruby
<shevy> the thing here is that you suddenly no longer depend on a package manager per se
<wmoxam> meh
kil0byte has quit [Remote host closed the connection]
<shevy> you can still use one if you like to. but there is no more need to make a mess like the other distributions do it, up to the point where as a user you dont have any real alternative rather than use the package manager
Eldariof59-ru has quit []
ymasory has joined #ruby
celm has quit [Quit: Leaving]
<rking> shevy: OK, maybe I like that.
brasten has quit [Quit: brasten]
<wmoxam> I've grown to hate yak shaving
<wmoxam> but I guess some enjoy it
<shevy> yak? the animal?
trend has joined #ruby
brg has left #ruby [#ruby]
timonv has joined #ruby
Eldariof-ru has joined #ruby
brasten has joined #ruby
perturbedpanda has joined #ruby
ElitestFX has quit [Ping timeout: 245 seconds]
phantasm66 has quit [Quit: *sleeeeep*]
cmarques_ has left #ruby [#ruby]
yosinof has quit [Quit: Leaving]
<shevy> aha
phantasm66 has joined #ruby
<shevy> after intensively studying that
<shevy> I kinda still wear a wtf expression on my face :(
<wmoxam> you had never heard that term before?
<shevy> nope!
<shevy> I've heard about sheep shaving though
<wmoxam> weird
<shevy> and seen that on TV
mattonrails has quit [Remote host closed the connection]
<TTilus> ive been talking about vacuuming a cat
<TTilus> in that same sense
<TTilus> dunno wheres that from
perturbedpanda has quit [Client Quit]
<shevy> man that sounds not good for the cat
<aszurom> if var = "/home/username/filename.txt" and I want to chop the /filename.txt part off, what's the best way to do it?
mattonrails has joined #ruby
<coyo> wmoxam, i used to think gentoo was this l33t distro that i just wasnt good enough for.
<shevy> aszurom try File.basename and File.dirname
<coyo> now i'm not sure what i want to aim for.
<wmoxam> coyo: heh, nope
<aszurom> coyo: "You can't compile the truth!" - Jack Nicholson
<coyo> lolol
<wmoxam> coyo: I really enjoyed OpenBSD
PragCypher has quit [Read error: Connection reset by peer]
<TTilus> i think it was this http://catvacuuming.com/about/
<shevy> coyo, I got one guy who moved from gentoo to archlinux, then moved back again after a while. he said, gentoo gave him more options to fine tune his compile targets
linus95014 has quit [Quit: linus95014]
<wmoxam> coyo: the great thing about it is it's stellar documentation
schovi has joined #ruby
PragCypher has joined #ruby
<coyo> shevy: arch is too l33t for me.
<shevy> hehe
<TTilus> aszurom: Pathname(var).dirname
<wmoxam> shevy: why the fuck does one want to "fine tune his compile targets"?
<TTilus> aszurom: or File.dirname(var)
<coyo> one does not simply fine tune one's compile targets
Facefox has quit [Remote host closed the connection]
poppiez has quit [Quit: Linkinus - http://linkinus.com]
<aszurom> every time I try to build something by hand, I find out that it was built-in all along
<aszurom> which is fine by me
<shevy> wmoxam I think he wanted to compile and use stuff he wants, rather than get this option presented by other developers (archlinux packagers)
bluOxigen has quit [Ping timeout: 256 seconds]
<phipes> i have a modular sinatra app, which has a config.ru and a separate file that contains: puts …, i want to see the output in the terminal but i don't know how
<shevy> I dont know what CFLAGS archlinux uses by default. dont think it will be O3
<wmoxam> shevy: yeah, but for what purpose?
<wmoxam> "Because I want to" ??
invalidusrname has joined #ruby
<TTilus> phipes: would you possibly be debugging with that puts?
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
<shevy> wmoxam dunno really. for extra speed perhaps, for some other configure options, perhaps for httpd server inbuilt with some extra modules, or to compile something statically (I actually compile the base stuff of linux statically... make, m4, coreutils and a few more programs)
<wmoxam> shevy: sounds like a bunch of horse shit to me
<shevy> wmoxam what distribution do you use?
Facefox has joined #ruby
<wmoxam> shevy: currently OSX (laptop) + Ubuntu (desktop)
<phipes> TTilus: yes, i want to know how to log the output of some ruby files that's outside MyApp < Sinatra::Base
linus95014 has joined #ruby
<wmoxam> I'd run OpenBSD on the desktop, but I decided I wanted to play some SC2 on the desktop
<coyo> supcom2 <3
<TTilus> phipes: how about logger?
<wmoxam> OpenBSD just doesn't have the 3D support. Plus I just didn't want to fuck around configuring an OS
<TTilus> phipes: or if you are debugging, pry
davidcelis has joined #ruby
<wmoxam> shevy: (I've used many distros in the past. Stuck with Arch for a couple of years at one point)
petercs has quit [Ping timeout: 252 seconds]
robdodson has joined #ruby
maxok has joined #ruby
MrGando_ has joined #ruby
ymasory has quit [Ping timeout: 276 seconds]
celm has joined #ruby
<wmoxam> I find that a distro with a mass audience cuts down on Yak Shaving. If you run into a problem there a good chance that someone else has and has blogged/created a ticket/posted to a forum about it.
<coyo> yak shaving?
shadoi has joined #ruby
<Boohbah> More modern use of the term came up in a 1991 Ren & Stimpy cartoon citing "Yak Shaving Day," a Christmas-like Holiday where participants hang diapers instead of stockings, stuff rubber boats with cole slaw, and watch for the shaven yak to float by in his canoe.
<lectrick> Is there a friendlier synonym for this oft used bit of ruby code? if __FILE__==$0
<lectrick> idiomatic I should say
ciopte7 has quit [Quit: ciopte7]
bluOxigen has joined #ruby
<heftig> no
bluOxigen has quit [Changing host]
bluOxigen has joined #ruby
subr00t has quit [Quit: subr00t]
wargasm has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
<Boohbah> lectrick: if __FILE__ == $PROGRAM_NAME
<RubyPanther> it is still cryptic and has to be looked up
jimeh3 has joined #ruby
<lectrick> boo.
<billiamii> Anybody know whether there are bindings for newer versions of Box2D anywhere? Googling is showing me 1.4.3 (~2007) only.
<RubyPanther> You could always just add lots of hearts # <3 <3 <3
<lectrick> also just noticed this from a 7 year old presentation that I never knew until now: "If a variable called SCRIPT_LINES__ is defined to be a Hash, it will be filled with the source of each file it parses (key is file path)"
Bartholomeae has quit [Ping timeout: 245 seconds]
<lectrick> I can't even alias __FILE__ to something else because, well, of how it works
bluOxigen has quit [Ping timeout: 244 seconds]
GuidovanPossum has left #ruby [#ruby]
looopy has quit [Remote host closed the connection]
Foxandxss has joined #ruby
d3c has joined #ruby
Helius has joined #ruby
ymasory has joined #ruby
<heftig> billiamii: problem with box2d is that it has a c++ interface
<heftig> that makes it immediately unappealing to write bindings for
fr0gprince_mac has joined #ruby
<billiamii> Ahh, that makes sense.
fr0gprince_ has joined #ruby
petercs has joined #ruby
krz has joined #ruby
zeromodulus has quit [Remote host closed the connection]
adambeynon has joined #ruby
adambeynon has quit [Client Quit]
adambeynon has joined #ruby
mdw has joined #ruby
becom33 has joined #ruby
jrkotrla has joined #ruby
jrkotrla has left #ruby [#ruby]
<becom33> https://gist.github.com/a52adb2cfc36379cc869 why am I getting a undefind errors at line 17 ?
heftig has quit [Ping timeout: 245 seconds]
<fowl> becom33, into is an instance method
heftig has joined #ruby
francisfish has joined #ruby
jobicoppola has quit [Quit: Computer has gone to sleep.]
<Hanmac> heftig what did you say about c++ and unappealing bindings???
PragCypher has quit [Remote host closed the connection]
francisfish has quit [Read error: Connection reset by peer]
francisfish has joined #ruby
jobicoppola has joined #ruby
geekbri_ has joined #ruby
geekbri_ has quit [Remote host closed the connection]
Zolrath has joined #ruby
heftig has quit [Client Quit]
roolo has quit [Quit: Linkinus - http://linkinus.com]
cek has quit [Quit: жопа диридай диридиридай]
geekbri has quit [Ping timeout: 276 seconds]
<Hanmac> billiamil i may could look at the classes of box2d but it think it should be easy to make ruby bindings for it ... (only ruby1.8 could be problematic)
bosphorus has joined #ruby
jackiechan0 has quit [Quit: Sto andando via]
awarner has joined #ruby
IPGlider has joined #ruby
dnyy has joined #ruby
davidw has joined #ruby
davidw is now known as Guest21949
apeiros_ has joined #ruby
<Hanmac> i mean billiamii
Jackneill has quit [Ping timeout: 260 seconds]
Guedes is now known as Guedes_out
kpshek has quit []
geekbri has joined #ruby
Bosma has joined #ruby
conor_ireland has joined #ruby
<billiamii> Hanmac, that would be awesome. There are some things that chipmunk does not handle (continuous collision detection) that I understand box2d does.
mib_mib has joined #ruby
lorandi has quit [Quit: Leaving]
<mib_mib> hi guys, i'm having trouble getting ruby 1.9.2 to install - the package is supposedly called ruby1.9.1-full but it is only installing ruby1.9.1 ( see this link http://www.ruby-lang.org/en/downloads/ ) - i already did sudo apt-get update to update repos - can someone help?
ciopte7 has joined #ruby
<carloslopes> mib_mib: use rvm or rbenv to install your rubies
<shevy> mib_mib debian, right?
<mib_mib> ubuntu
<carloslopes> mib_mib: it's easier and better :)
<shevy> yeah quite the same, ubuntu just reuses all choices debian makes
<mib_mib> yep
<shevy> mib_mib, the problem is that, basically, debian decided how things shall happen for ruby on debian (and ubuntu and all the other derivatives)
<mib_mib> i would use rvm but i cant really make that choice right now, just need 1.9.2
schovi has quit [Remote host closed the connection]
<shevy> so the proper way, if you decide to stick in the debian scheme, is to ask them how a user is supposed to install that
netogallo has quit [Ping timeout: 260 seconds]
<carloslopes> mib_mib: hmm understood :)
<shevy> mib_mib, Hanmac here is a debian guru
<shevy> he also uses the ruby that comes with debian
<aszurom> when you create an array by saying array2 = array1 and you change elements in array1, it also changes array2. I read about that, but forget how you prevent that
Bosma has quit [Quit: leaving]
heftig has joined #ruby
<shevy> aszurom you could do array1.dup
<chrisbdaemon> mib_mib: install rvm, then use rvm to install ruby 1.9.2
<aszurom> .dup it is
<aszurom> thanks
<wmoxam> mib_mib: what version of debian?
<Hanmac> mib_mib, the package is only called 1.9.1 but its 1.9.2
<wmoxam> mib_mib: because that probably is 1.9.2 or 1.9.3
luxurymode has quit [Quit: Computer has gone to sleep.]
linoj_ has joined #ruby
<shevy> :)
<mib_mib> Hanmac: no, after i installed it i did ruby - v and its 1.9.1
<wmoxam> mib_mib: which version of debian?
<mib_mib> 10.04
<wmoxam> ah, Ubuntu
<Hanmac> yeah your ubuntu is a bit old .P
<mib_mib> yes, ubuntu
<mib_mib> yes =D
<wmoxam> mib_mib: yeah, packaged Ruby pre 11.04 sucks
<mib_mib> lolol
harukomoto has joined #ruby
<mib_mib> is it possible that people just arent updating the package for 10.04?
<fowl> billiamii, hav you played with chipmunk much
kpshek has joined #ruby
<Hanmac> mib_mib: apt-get dist-upgrade
Urth|Away is now known as Urthwhyte
<wmoxam> mib_mib: most people don't use the Ubuntu ruby package pre 11.x
linoj has quit [Ping timeout: 240 seconds]
linoj_ is now known as linoj
<wmoxam> rubygems is the real problem in those older releases :/
<mib_mib> Hanmac: if i upgrade my distro - will it affect my current filesystem?
<Urthwhyte> Most people use rvm though
rippa has quit [Read error: Connection reset by peer]
<wmoxam> Urthwhyte: depends
<Hanmac> nope, your filesystem should be fine
<mib_mib> Hanmac: will it install all the same package for the new distro?
rippa has joined #ruby
<Urthwhyte> Upgrading the distro to upgrade your ruby version is -_-
yankov has quit [Quit: yankov]
ryanf has quit [Ping timeout: 260 seconds]
<billiamii> fowl, I have not
<Tasser> Urthwhyte, that's why I use archlinux :-)
dzhulk has joined #ruby
<Hanmac> Urthwhyte: yeah and you still uses IE6 right?
<wmoxam> Tasser: so you can upgrade your distro all the time?
zeromodulus has joined #ruby
<Urthwhyte> Hanmac: that's a ridiculous line of argument
<Tasser> wmoxam, indeed
<Urthwhyte> if I was going to stick with something that's no longer being supported, roll your own debs
<Tasser> wmoxam, gradual upgrade pain instead of all-at-once ;-)
delinquentme has quit [Ping timeout: 276 seconds]
<Urthwhyte> I prefer OS X
* Hanmac is daily packages not new enough
<Urthwhyte> nothing works exactly as I want it to, and upgrades break stuff with no choice involved!
<wmoxam> lol
C0deMave_ has joined #ruby
<Tasser> Urthwhyte, you forgot the money you've got to pay for it ;-)
mengu has quit [Quit: Konversation terminated!]
<wmoxam> I'm a psyco who requires complete control over everything all the time
<wmoxam> That's why I use Gentoo
xnm has quit [Quit: WeeChat 0.3.7]
<wmoxam> and spit on anyone else
<graspee> gentoooooo
<graspee> EMERGE, MY CREATURES
<wmoxam> ahahahaa
<Urthwhyte> hah
<Tasser> pacman, EAT THEM ALL!
chrisbdaemon has left #ruby [#ruby]
<Urthwhyte> All I want is Xmonad for OS X
schovi has joined #ruby
<Tasser> Urthwhyte, grab some ObjC and start hacking
<wmoxam> Urthwhyte: http://www.tylerwm.com/
<wmoxam> :p
philcrissman_ has joined #ruby
<Tasser> lol, quicktime video
<Urthwhyte> uggh
<Tasser> I thought we rid the universe of that for good
<wmoxam> Tasser: of course
<wmoxam> it's for OSX
<wmoxam> sheesh
<Tasser> ^^
C0deMaver1ck has quit [Ping timeout: 265 seconds]
Helius has quit [Ping timeout: 248 seconds]
asobrasil has left #ruby [#ruby]
<Urthwhyte> hmm, might try that
webusnix has joined #ruby
<Urthwhyte> $10 and no demo
<Urthwhyte> Writing my own will be way cheaper!
fr0gprince_ma has joined #ruby
<wmoxam> lol
webusnix has quit [Read error: Connection reset by peer]
apeiros_ has quit [Remote host closed the connection]
<wmoxam> :p
<Urthwhyte> OSX's window management is seriously terrible
linus95014 has quit [Quit: linus95014]
<Urthwhyte> Looking forward to having a Linux desktop
<Tasser> Urthwhyte, OSX is one-app-at-a-time
<Tasser> ... that's at least what my impression is
<Tasser> and they did that quite well
<wmoxam> We like our apps one-at-a-time just like we do our mouse buttons! And damnit we like it!
<Urthwhyte> solution: screen+iTerm
C0deMave_ has quit [Remote host closed the connection]
<Tasser> Urthwhyte, that's like buying an iphone to use it as a hammer
fr0gprince_mac has quit [Ping timeout: 276 seconds]
<Urthwhyte> how'd you know what I use my iPhone for?
savage-_ has joined #ruby
Solnse has quit []
BrokenCog has quit [Quit: leaving]
<axl_> don't know if this is the place to ask this question,
<axl_> b
<axl_> u
<axl_> t
<axl_> i have a ruby-debug question: is there a command to 'continue' without heeding to any further calls to debugger
<Tasser> axl_, how are you calling the debugger?
BrokenCog has joined #ruby
<Tasser> just overwrite that method ;-)
<axl_> using the command 'debugger'
<Urthwhyte> Shouldn't c work?
<Tasser> likely Kernel.debugger
<Urthwhyte> I never use IRB anymore
<Tasser> Urthwhyte, goes to the next debugger call
<Tasser> Urthwhyte, that's not irb, it's ruby-debug
alex88 has quit [Quit: This computer has gone to sleep]
<Tasser> axl_, def Kernel.debugger; end
<Urthwhyte> I use it so infrequently I have my terminology wrong
maxok has quit [Quit: Linkinus - http://linkinus.com]
<axl_> interesting let me try that
<becom33> https://gist.github.com/a52adb2cfc36379cc869 I want to remove this initialize the array gets reset . can anyone help to remove the initialze ?
iamjarvo has quit [Quit: Leaving.]
brasten has quit [Quit: brasten]
savage- has quit [Ping timeout: 240 seconds]
<axl_> Tasser: i tried executing that line in my debugger cli
<axl_> got a syntax error
<Tasser> module Kernel; def debugger; end; end
brasten has joined #ruby
jeebster has joined #ruby
mattonrails has quit [Remote host closed the connection]
<jeebster> is there an inverse reject method for arrays?
<jeebster> like an exclude?
<becom33> anyyone >
linoj has quit [Quit: linoj]
Urthwhyte is now known as Urth|Away
francisfish has quit [Remote host closed the connection]
<Tasser> jeebster, there's select and reject
<Tasser> what else do you want?
<jeebster> what about keep_if
Eldariof-ru has quit []
<Tasser> select!
<jeebster> ah ok
<becom33> anyone for me ?
<jeebster> basically I'm doing a collection and want to exclude certain values
<jeebster> so I'll try select
mib_mib has quit [Ping timeout: 245 seconds]
banseljaj is now known as imami|afk
kpshek has quit []
LOLZIE has quit [Ping timeout: 245 seconds]
joshman_ has quit [Ping timeout: 260 seconds]
tobago has quit [Remote host closed the connection]
joshman_ has joined #ruby
<becom33> https://gist.github.com/a52adb2cfc36379cc869 I want to remove this initialize the array gets reset . can anyone help to remove the initialze ?
lsone has joined #ruby
linoj has joined #ruby
shadoi has quit [Remote host closed the connection]
<graspee> it must be because i'm new to ruby but i can't understand the question exactly
Solnse has joined #ruby
francisfish has joined #ruby
fayimora has joined #ruby
kpshek has joined #ruby
beneggett has joined #ruby
v0n has joined #ruby
beneggett has quit [Client Quit]
hukl has quit [Quit: Leaving...]
looopy has joined #ruby
<Mon_Ouie> I also tend not to understand your questions
conor_ireland has quit [Quit: slán]
<any-key> lol same
<graspee> the answer can't be as easy as "well delete the initialize method with your text editor"
oooPaul has joined #ruby
Guest21949 has quit [Read error: Operation timed out]
<graspee> could it be that you want the hash to be initialized when you create the object, but somehow the data is not being stored and you think that the initialize method is being called again but actually the problem is something else?
<becom33> graspee, wait lemme show you somthing
<graspee> ok
mdw_ has joined #ruby
francisfish has quit [Remote host closed the connection]
<Hanmac> run as long as you can :P
<graspee> my legs were surgically amputated in 1993
<graspee> so that won't be far
d3c has quit [Quit: Quit]
<Hanmac> then crawl
test34 has quit [Ping timeout: 265 seconds]
<davidcelis> well this escalated quickly
<graspee> i was just kidding
<graspee> but that wasn't the reaction i was expecting!
chienpo has left #ruby [#ruby]
mdw has quit [Ping timeout: 245 seconds]
<becom33> https://gist.github.com/e5922bc7be3bd9ba5159 this is a output of my privious paste and two more files which I'm using to input data into the hash in my privious file .
<any-key> stay class, #ruby
<Hanmac> you are the next victim
<graspee> if my legs had been amputated i'd probably be pretty offended right now
* graspee makes note not to share any real personal information
<becom33> the problem is if you can see after "setindex"=>{:type=>"c", :disc=>"will clean the screen " the hash gets reset . I guess its because of the initialize
aszurom has quit [Quit: Leaving]
Urth|Away is now known as Urthwhyte
<davidcelis> your code is scary
<graspee> give me a sec
<becom33> davidcelis, why is that ?
<davidcelis> well, for one, hard tabs with a size of 8
<davidcelis> odd indentation in general
<davidcelis> not very readable overall
<graspee> it's only short code fragments i can cope
linoj has quit [Quit: linoj]
<any-key> put it in vim, and type ggVG=
<becom33> there is nothing to read
ciopte7 has quit [Quit: ciopte7]
<becom33> only two files of few lines coe
<becom33> code *
philcrissman_ has quit [Remote host closed the connection]
Facefox has quit [Remote host closed the connection]
<Urthwhyte> any-key: gg=G should work actually
<any-key> Urthwhyte: neat!
<graspee> is this for a virus scanner or something?
<any-key> ah duh = takes a modifier
<Urthwhyte> yup
adeponte has joined #ruby
<becom33> umm ??
awarner has quit [Remote host closed the connection]
luxurymode has joined #ruby
Facefox has joined #ruby
yeggeps has quit [Ping timeout: 252 seconds]
<Veejay> Would you guys use each_slice to split an array into two equal halves? something like enum = a.each_slice(a.size / 2); [enum.next, enum.next]
cek has joined #ruby
<graspee> i have tried reading through it, becom33 but i'm not good enough at ruby yet. i don't think i can help you sorry
<Veejay> Any other simpler method is welcome
<Veejay> Maybe slice itself
<cek> Anyone familiar with shoulda? Why is it runing my setup block for each test even if tests are beneath a level of context?
fayimora has quit [Ping timeout: 240 seconds]
<any-key> Veejay: slice on size/2
<Mon_Ouie> davidcelis: Except tabs = 8 spaces is just what you see on the web page, not necessarily what he sees in his editor
<Veejay> Yeah
<Veejay> Seems more sensible
linus95014 has joined #ruby
adambeynon has quit [Quit: adambeynon]
mengu has joined #ruby
yeggeps has joined #ruby
rmascarenhas has quit [Quit: leaving]
tomb_ has joined #ruby
<becom33> https://gist.github.com/e5922bc7be3bd9ba5159 ok the tab issue is fine now
rippa has quit [Ping timeout: 265 seconds]
<becom33> I set to tab space on my IDE for 2
wangr_ has joined #ruby
ciopte7 has joined #ruby
<becom33> Mon_Ouie,
skogis has quit [Ping timeout: 265 seconds]
Facefox has quit [Ping timeout: 250 seconds]
wangr has quit [Ping timeout: 245 seconds]
awarner has joined #ruby
Facefox has joined #ruby
jonathanwallace has quit [Read error: Connection reset by peer]
Facefox has quit [Max SendQ exceeded]
* becom33 um ?
jonathanwallace has joined #ruby
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
<becom33> davidcelis,
looopy has quit [Remote host closed the connection]
mdw_ has quit [Remote host closed the connection]
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
test34 has joined #ruby
krusty_ar has quit [Read error: Connection reset by peer]
tomb_ has quit [Quit: Computer has gone to sleep.]
Facefox has joined #ruby
krusty_ar has joined #ruby
fayimora has joined #ruby
n1x has joined #ruby
Targen has joined #ruby
SeoxyS has joined #ruby
test34- has joined #ruby
test34- has quit [Changing host]
test34- has joined #ruby
kenneth has quit [Disconnected by services]
SeoxyS is now known as kenneth
<becom33> come on now the tabbing are fine
<becom33> tabbings *
<Seabass> how do I turn off join/quit messages in xchat?
test34 has quit [Ping timeout: 252 seconds]
shadoi has joined #ruby
tommyvyo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
ryanf has joined #ruby
carloslopes has quit [Quit: Leaving]
ryanf_ has joined #ruby
hukl has joined #ruby
fayimora has quit [Ping timeout: 264 seconds]
hukl has quit [Client Quit]
mdw has joined #ruby
fbernier has quit [Ping timeout: 276 seconds]
robdodson has quit [Quit: robdodson]
ryanf_ has quit [Client Quit]
kil0byte has joined #ruby
geekbri has quit [Remote host closed the connection]
test2 has joined #ruby
<shevy> Seabass in xchat there is an option
<becom33> I'm getting a undefind method at https://gist.github.com/6c7d3e0e3dbdf781f93a
test2 has quit [Client Quit]
akem has joined #ruby
<Seabass> shevy, lol I just woke up and you are still online lol
<shevy> becom33 why dont you use . rather than :: btw
davidcelis has quit [Quit: K-Lined]
tobago|away has quit [Quit: Bye]
<shevy> Seabass, yeah but I will soon go to bed :)
exchgr has quit [Ping timeout: 276 seconds]
<shevy> have to wake up in 7 hours
hynkle has quit [Quit: hynkle]
<becom33> shevy, okok I'll use ::
<becom33> .
<becom33> insted of ::
ph^ has joined #ruby
<becom33> but can you tell me what might be the problem shevy :(
<shevy> becom33 I dont know, I have not used singleton before
<shevy> I cant even seem to instantiate that shit
<banisterfiend> shevy: hey shettle
<becom33> shevy, the problem is in line 14
<shevy> class Foo; include Singleton; end
<shevy> wow
<shevy> that shit removes .new
<shevy> Foo.new NoMethodError: private method `new' called for Foo:Class
<shevy> what is the grand goal behind this?
hynkle has joined #ruby
hynkle has quit [Client Quit]
<becom33> shevy, can u look up on this https://gist.github.com/e5922bc7be3bd9ba5159
<graspee> the singleton thing is supposed to ensure that only one instance of a class exists or something
td123 has joined #ruby
<becom33> the @info hash seems to be reset after "setindex"=>{:type=>"c", :disc=>"will clean the screen "}}
<shevy> only one
<shevy> but it has removed .new
<shevy> so how can there even be a single instance?
<becom33> I have no idea why that
<shevy> becom33, I dont have either
<becom33> shevy, come on dude
<becom33> i'm seriously stuck
<graspee> it probably makes one instance and that is probably in the .instance variable
<graspee> i have never used it i'm just guessing based on a quick scan of the pickaxe page on the matter
<shevy> becom33 I have no idea. your code looks totally alien to me
<shevy> becom33, you use things like Singleton which I never used in my life so far
<becom33> ok how about in this code https://gist.github.com/6c7d3e0e3dbdf781f93a
looopy has joined #ruby
<shevy> Foo.instance # => #<Foo:0x7f7e3ab66c90>
<becom33> helpset.rb:14:in `set': undefined method `[]=' for nil:NilClass (NoMethodError)
<shevy> cool graspee, seems you are right
<graspee> it's on page 841 of the latest pickaxe if you have it
<shevy> oh
<shevy> you looked it up?
<graspee> well duh
<shevy> :(
<graspee> i'm a beginning rubyist
<shevy> here I thought you are a BRAIN MASTER
<shevy> and knew those things like your underwears
<graspee> but if it helps someone, it helps someone
<shevy> yeah
<shevy> I learned something new
<shevy> I swear I never before saw .instance used
<graspee> maybe you can solve the mystery now
<graspee> armed with this new understanding
<Seabass> or maybe questions will lead to more questions...
<Seabass> like in xfiles
<shevy> ok
<shevy> my first question is
<shevy> becom33, why did you decide to use a singleton?
<shevy> what is your plan
<becom33> shevy, umm I dont know someone in irc said to use :/ I actally don't remember why now
<becom33> i was asking some question he said to use and see . and it worked so I kept it
novodinia has joined #ruby
<novodinia> what's the quickest way to get information about built-ins?
<graspee> the reasoning i think is that this helpset thing is going to be a central thing, only one of it will exist
<graspee> novodinia: ri
<Mon_Ouie> If you mean methods and classes, ri
<Mon_Ouie> If you mean syntax, check the quickref
<graspee> there's even a free ios app that has ruby doc in it
tommyvyo has joined #ruby
kevinbond has joined #ruby
<shevy> becom33 that's baaaaaad dont just paste code other people tell you without you understanding it
Targen_ has joined #ruby
Targen has quit [Ping timeout: 240 seconds]
<becom33> ok shevy I removed the instance and made my HelpSet class methods instance
jayrulez has quit [Read error: Operation timed out]
MrGando_ has quit [Quit: Bye]
<graspee> have you tried running it again?
<graspee> does it a) work b) fail like before c) fail in a new way
<becom33> i thought at the time it will useto make the methods instance without typing self on each method
jayrulez has joined #ruby
<graspee> also what's this Execution.register(self) stuff that is happening in the banner module?
<becom33> error
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
<novodinia> how would you use ri to lookup info on "alias"?
<graspee> ri alias
<becom33> graspee, well self those modules are called in to a one class . so I need do include Module . soo that self is used to do the include automatally all the modules in a dfir
<becom33> dir *
<becom33> now I'm having a error I cant find why
<graspee> what's the error say
<becom33> ./lib/helpset.rb:14:in `set': undefined method `[]=' for nil:NilClass (NoMethodError)
schovi has quit [Remote host closed the connection]
<graspee> you need to call new on the class so it can initialize
Gavilan has joined #ruby
<becom33> i guess thats what Singleton was doing
<graspee> you will need to have um i dunno a global variable maybe? i'm such a noob, that holds an instance of helpset
<rking> gem install should put the doc stuff in a background process.
<becom33> graspee, I was stickly pohibited to use global variable unless its really necessary :/ shevy
etehtsea has joined #ruby
<graspee> ?! who strictly prohibited yoU?
cearls has joined #ruby
davidcelis has joined #ruby
<rking> graspee: He's not ready for it.
<rking> graspee: I wouldn't recommend globals until like month 6
<graspee> i just wondered whether we helping someone do their class assignment or their job
ghanima has left #ruby ["Leaving."]
looopy has quit [Remote host closed the connection]
<rking> Nah.
<rking> Only a #ruby prohibition.
bglusman has quit [Remote host closed the connection]
bglusman has joined #ruby
bglusman has quit [Read error: Connection reset by peer]
<graspee> i wouldn't pay any attention to that then
IPGlider has quit []
schovi has joined #ruby
niklasb has quit [Ping timeout: 252 seconds]
looopy has joined #ruby
<graspee> if the same channel that tells you that you can't use a global variable can't help you with the problem you get from not using it then there's something wrong
<novodinia> ri alias gives
<novodinia> .alias not found, maybe you meant: RVM::Environment#alias_create
kylemcgill has joined #ruby
<novodinia> #alias_list, etc.
<graspee> in my pry it works
<graspee> i don't know what i did different, sorry
<graspee> wait, are you typing ri .alias or ri alias?
visof has joined #ruby
visof has quit [Changing host]
visof has joined #ruby
leonid00 has joined #ruby
<graspee> nvm both work
brianpWins has quit [Quit: brianpWins]
tilde` has joined #ruby
mvangala_ has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
iamjarvo has joined #ruby
leonid00 has left #ruby ["*.net *.split"]
albemuth has quit [Ping timeout: 245 seconds]
thecreators has joined #ruby
dhaskew has joined #ruby
cearls_ has joined #ruby
cearls_ has quit [Client Quit]
kevinbond has quit [Quit: kevinbond]
phantasm66 has quit [Quit: *sleeeeep*]
etehtsea has quit []
albemuth has joined #ruby
cearls has quit [Ping timeout: 252 seconds]
cek has quit [Quit: жопа диридай диридиридай]
wiwillia has quit [Ping timeout: 244 seconds]
nlc has quit [Quit: Leaving]
<Mon_Ouie> novodinia: That's because alias is syntax, not a method
yxhuvud has quit [Ping timeout: 248 seconds]
<Mon_Ouie> (btw, alias_method is a method that has the same effect)
carlyle has quit [Remote host closed the connection]
theRoUS has quit [Ping timeout: 260 seconds]
Urthwhyte is now known as Urth|Away
zaiste_ is now known as zaiste
<Seabass> MF,GDI how do I turn off join/quit notifications in XChat?
davidpk has quit [Quit: Computer has gone to sleep.]
luxurymode has quit [Quit: Computer has gone to sleep.]
wangr_ has quit [Remote host closed the connection]
savage-_ has quit [Remote host closed the connection]
savage- has joined #ruby
eywu has joined #ruby
visof has quit [Ping timeout: 260 seconds]
kil0byte_ has joined #ruby
PragCypher has joined #ruby
hectorjimenez has joined #ruby
davidpk has joined #ruby
hectorjimenez has quit [Client Quit]
kil0byte has quit [Ping timeout: 240 seconds]
Urth|Away is now known as Urthwhyte
jrist is now known as jrist-afk
azm has quit [Read error: Connection reset by peer]
wvms has joined #ruby
looopy has quit [Remote host closed the connection]
schovi has quit [Remote host closed the connection]
kil0byte has joined #ruby
bigkevmcd has quit [Ping timeout: 252 seconds]
<Seabass> graspee, finally! yay, so much cleaner now
fr0gprince_ma has quit [Quit: Leaving...]
<graspee> i'm sorry for being sarky with the website and i'm grateful you didn't take it the wrong way
cableray has joined #ruby
kil0byte_ has quit [Ping timeout: 245 seconds]
<graspee> but i noticed you asked at 10pm and then again 50 min later, and just typing your question into google got an answer on the first hit
andrewhl has quit [Remote host closed the connection]
<graspee> it's a teach a man to fish thing
<graspee> but i'm still a jerk
<Seabass> i was typing it different so my search result was less effective
andrewhl has joined #ruby
<graspee> ah
<Seabass> and only the first search result of yours had the answer and that was behind a link
<graspee> i suppose i've built up a knowledge of how best to search for things over the years
petercs has quit [Quit: Leaving.]
KL-7 has quit [Quit: This computer has gone to sleep]
<graspee> it's like a battle with the internet
<Seabass> you deserve a cig
<graspee> oh no thanks. gave up years ago. wish i'd never started
<wmoxam> no one deserves death sticks
<graspee> some people do, wmoxam
<wmoxam> I quit 7 months ago
<graspee> like my neighbours
<wmoxam> heh
<Seabass> I'm morbidly afraid of death, but I enjoy smoking
avandenhoven has joined #ruby
<graspee> i did patches for 1 week then i did cold turkey. week of living hell
<Seabass> I quit cold turkey for 3months when I found my neighbor dead
ph^ has quit [Remote host closed the connection]
<wmoxam> I quit when my daughter was born
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<graspee> that's awesome wmoxam
<wmoxam> she was the motivation needed
<graspee> my mother smoked around me all the time i was growing up
<graspee> they were different times
<novodinia> why does this not work? https://gist.github.com/2a4eea46ca02e6f1788a
<novodinia> i thought it would break only if a wasn't a string
invalidusrname has quit [Quit: invalidusrname]
<Seabass> grats wmoxam
<Seabass> guess I identify with Tom Waits too much
<avandenhoven> bnagy: I've been thinking about that weird problem with $1 you and I were looking at last night (https://gist.github.com/ac5508c50bd1435174d7). I wonder if there is something in _my_ code that could cause $1 to stop working as expected.
bigkevmcd has joined #ruby
<novodinia> what i'm trying to do is access parameters passed to a function
<graspee> a isn't a string, is it, novodinia ?
<novodinia> how do you do that?
<fowl> Seabass, then i can make an assumption that you are, by association, incredibly awesome. don't let me down (:
<novodinia> graspee: it's a "symbol" supposedly
<Synthead> with Erubis, can I pass binding() (to pass all local variables) and a couple other variables too?
<canton7> novodinia, it is a symbol
<graspee> well you can't plusserize it then afaik
TTilus has quit [Read error: Operation timed out]
<novodinia> i figured it would be a variable of type 'string', or at least that's what i figured ruby would enforce automatically
<canton7> novodinia, call .to_s on it if you want to convert it to a string, or use string interpolation to get rid of all of those +'s
bbttxu has quit [Quit: bbttxu]
chson has quit [Remote host closed the connection]
<Seabass> fowl, maybe awesomely creative. I've only decided that Ruby is my new Legos.
TTilus has joined #ruby
<Mon_Ouie> Does it also hurt when you accidentally step on your rubies bare feet, which happens all the time?
jonathanwallace has quit [Remote host closed the connection]
dv310p3r has quit [Read error: Operation timed out]
mneorr has joined #ruby
<novodinia> thanks
<fowl> lol
aaroncm has quit [Remote host closed the connection]
<Seabass> that was my mothers problem, she was blind LOL
<canton7> novodinia, however the next bit of your gist doesn't make sense... what exactly are you trying to do?
mneorr_ has quit [Read error: Connection reset by peer]
zii has quit [Ping timeout: 248 seconds]
SuperrMann has joined #ruby
kevinbond has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
mdw has quit [Remote host closed the connection]
MasterIdler_ has joined #ruby
MasterIdler_ has quit [Client Quit]
<Seabass> well I'm off for a while to go do this KOAN tutorial thing with all the eastern philosophy references
welterde has quit [Ping timeout: 264 seconds]
TorpedoSkyline has joined #ruby
MasterIdler has quit [Ping timeout: 244 seconds]
Karmaon has joined #ruby
<becom33> i had enough . going to sleep
<becom33> bye
becom33 has quit [Quit: Leaving]
heftig has joined #ruby
Morkel has quit [Quit: Morkel]
flori_ is now known as flori
<Seabass> attempted to make witty remark about virtual feet stepping on rubies, but... failed...
cgag has quit [Ping timeout: 248 seconds]
markjwlee has joined #ruby
<markjwlee> hi all
<Mon_Ouie> Also, rubies are kind of expansive when compared to legos
brianpWins has joined #ruby
TorpedoSkyline_ has joined #ruby
<markjwlee> Can someone tell me what the ideal/conventional location would be in the linux filesystem structure to place ruby web apps?
TorpedoSkyline has quit [Disconnected by services]
DrShoggoth has quit [Quit: Leaving]
kil0byte_ has joined #ruby
kil0byte has quit [Ping timeout: 244 seconds]
<novodinia> canton7: i was just defining a function and trying to access its parameters
<rking> Anyone know how to start a regex match at a position offset? In perl you can assign to pos($str).
welterde has joined #ruby
<Urthwhyte> rking: hackiily, you can just split the string
<Seabass> Ruby gems are inexpensive compared to Legos, and I can keep more of them in a box
<rking> Urthwhyte: Surely that's not the only way.
TorpedoSkyline has joined #ruby
<rking> Urthwhyte: If anything I'd do /(?:.{#{offset})#{real_regex}/
TorpedoSkyline_ has quit [Ping timeout: 240 seconds]
alanp has quit [Remote host closed the connection]
<rking> I'm porting a thing from Perl and I know this is a touchy area of the code (it's part of a parser), if I don't get it just right I'm pretty sure everything will explode everywhere always.
<Urthwhyte> heh
<rking> Oh goodness. There's a 2nd param to .match
kil0byte_ has quit [Ping timeout: 240 seconds]
<rking> 'asdf'.match /./, 2 ⇒ 'd'
wmoxam has quit [Ping timeout: 276 seconds]
ahuman_ has joined #ruby
ciopte7 has quit [Quit: ciopte7]
kpshek has quit []
<eam> why is it that 'ri' documentation never fully documents the calling signature of methods (eg, String#match doesn't mention a second arg)
alanp has joined #ruby
<rking> eam: Maybe because that's hard to parse? E.g. it could be "arg1, *args"
<oooPaul> eam: My copy of it does.
<oooPaul> str.match(pattern) or str.match(pattern, pos)
<eam> Aah, the second arg didn't exist in 1.8 :)
kil0byte has joined #ruby
albemuth has quit [Ping timeout: 245 seconds]
PragCypher has quit [Read error: Connection reset by peer]
PragCypher has joined #ruby
<fowl> time to quit 1.8
<fowl> it being 2012 and all
mvangala_ has quit [Ping timeout: 245 seconds]
albemuth has joined #ruby
Zolrath has quit [Quit: Computer has gone to sleep.]
joshman_ has quit [Quit: Computer has gone to sleep.]
axl_ has quit [Quit: axl_]
n1x has quit [Quit: Ex-Chat]
ken_barber has quit [Remote host closed the connection]
axl_ has joined #ruby
<Seabass> fml I can't even follow a ruby tutorial well enough to learn
saschagehlich has quit [Ping timeout: 248 seconds]
<rking> Seabass: Which one are you using?
<Seabass> rking Ruby Koans Online
<rking> Seabass: Do this one first. http://www.ruby-lang.org/en/documentation/quickstart/
<Seabass> rking: thanks
<rking> Ruby Koans is the 2nd or 3rd thing you should do.
Facefox has quit [Remote host closed the connection]
Foxandxss has joined #ruby
<rking> And I'd do the downloaded version, so you can get used to your editing/dev environment.
<Seabass> rking I got stumped by #6 ruby koan
<rking> Seabass: Got a direct link to #6?
blacktulip has quit [Remote host closed the connection]
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
<Seabass> http://koans.heroku.com/about_nil?input[]=true&input[]=NoMethodError&input[]=some_method_nil_doesnt_know_about&input[]=&input[]=&input[]=
<rking> Hehe
<Seabass> rking I kinda cheated and got the answer by trail and error without really understanding, so I'ma stop there for now
<rking> Seabass: There are thousands of ways to cheat the Koans. Figuring out the ways is probably a valuable exercise in itself, but knowing what they meant by the test is important.
linus95014 has quit [Quit: linus95014]
Facefox has joined #ruby
<rking> Seabass: Which part of that are you confused about?
<Seabass> rking maybe I'm over eager to learn faster than I should be, trying to jump in the deep end of the pool
aantix has quit [Ping timeout: 260 seconds]
<rking> Seabass: The Quickstart can literally be 20min long (only longer if you spend more quality time goofing off in irb).
<Seabass> I don't know what the ex is
<Seabass> I don't know what ex.class means
<Seabass> I don't know how they expect me to now I should type NoMethodError
awarner has quit [Remote host closed the connection]
<Alantas> "foo".class => String 123.class => Integer [1,2,3].class => Array
<rking> Seabass: Aha. It's an Exception. It's like a weird flow control tool. You can be deep in some code somewhere and throw an Exception that starts bubbling back up the call stack until something handles it.
liluo has joined #ruby
<Seabass> like a bubble come up from the deep of the dark ocean
<rking> Seabass: For example, if you try to read from a file that doesn't exist on the disk, you'll get an Errno::ENOENT: No such file or directory exception.
fbernier has joined #ruby
Chryson has joined #ruby
<Sou|cutter> Exceptional Ruby is an interesting book
<Alantas> Exceptions are used for signaling errors. It basically aborts all active function calls up to the point where something says it's willing to handle that type of exception.
<Seabass> hey boss we got a problem; I don't know how to deal with it, let me ask my boss;
linus95014 has joined #ruby
<Seabass> upper management is on it
<rking> Seabass: The nice thing about Exceptions is that each method can opt in or out of the error handling. E.g., the very last method might begin/rescue/end the Errno::ENOENT exception and know what to do if the file didn't exist, such as create it and keep going… or none of the layers could handle it, leaving it up to the default handler, which will print an error message and exit.
<rking> Seabass: That's a good way of putting it.
<Seabass> i c
<Alantas> Exceptions are good. a(); b(); If a() raises an exception on failure, and you get past a(), you can safely assume a() succeeded; you don't need to check return codes or the like.
<rking> Sou|cutter: Ahh, cool. I might follow on with that after Metaprogramming Ruby (which I 100% recommend, btw. It's not only about wizardry/weird stuff)
<rking> Anyone know where the default Exception handling lives?
<Sou|cutter> rking: ooh, I have not read that. Thanks :)
piotr__ has quit [Ping timeout: 276 seconds]
<Seabass> ok I'm going to go do the ruby in 20 min tutorial
novodinia has quit [Quit: leaving]
<Alantas> And when something raises an exception, it could be caught in different places (depending on the current call stack), each of which can handle it in their own way. It's like returning a value from a method (different callers can use your return value in their own ways), except you return PAIN.
<eam> win 1
<Seabass> PAIN?
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
musl has quit [Remote host closed the connection]
rdesfo has joined #ruby
musl has joined #ruby
billiamii has quit []
<Seabass> http://pastie.org/3958168 why with this code does h "Bob" work but h(Bob) doesn't?
<Alantas> "Bob" is a string, Bob is an undeclared constant.
<Alantas> h("Bob")
celm has quit [Remote host closed the connection]
<Alantas> Also, #{name.capitalize}
<Alantas> (You forgot the { on that)
<Seabass> but I thought if you typed h(somename) it automatically passed somename to the variable name, and yeah I fixed {
lkba has quit [Remote host closed the connection]
<Seabass> or did it pass it but couldn't puts it cause it didn't know it was a string?
<Alantas> If there's a variable named 'somename' in calling scope, it'll pass its value to the h().
bosphorus has quit [Remote host closed the connection]
<Alantas> Ruby doesn't have bare words. If you meant a literal string, you have to say so.
jonathanwallace has joined #ruby
brasten has quit [Quit: brasten]
<Alantas> foo = 5; h(foo) # prints "Hello, 5!" h("foo") # prints "Hello, Foo!"
<Seabass> let me try something to see if I understand
QaDeS has joined #ruby
Axsuul has joined #ruby
<Seabass> http://pastie.org/3958200 this is what I tried to do so if I h(somename) it would work, but it didn;t
<Alantas> No, it's just (name = "World")
carloshpf has joined #ruby
<Alantas> Instead: puts "Hello #{name.to_s.capitalize}!"
<Solnse> why the ! ?
tomb_ has joined #ruby
<graspee> because greeting people is exciting
<ben_m> Solnse, part of the string, not the method :)
<Alantas> Solnse: "Hello, World..." is just depressing.
kevinbond has quit [Quit: kevinbond]
Boohbah has quit [Ping timeout: 276 seconds]
<Solnse> ahh, yes, ok, I see now.
<ben_m> "Hello, world ... I guess"
<ben_m> 0.times { smile }
Boohbah has joined #ruby
<Seabass> http://pastie.org/3958212 this doesn't work for h(apersonsname) either
<graspee> you can't use name.to_s like that
<graspee> it's an expression, not a statement
chson has joined #ruby
<graspee> if you want to set something to a string then you could do name=name.to_s i think
<Seabass> let me meditate on that for a second to see if I get a lightbulb
<Alantas> Yeah. You can't convert it in-place, you'd have to assign it like graspee showed.
<graspee> well let's say x is 4
<graspee> x is 4 so it's a number, x.to_s will be "4" a string, but that's an expression- you're not actually changing x
<graspee> if you want to do that you have to use assignment like x=x.to_s
<Alantas> Right.
<Seabass> got it
<Alantas> It's like 1+2, you're not changing the value of 1 or 2, you're getting a new value.
<Seabass> expression is needs to be part of a statement to manipulate variable
<graspee> yes
<graspee> well, in assignment you are setting a variable to the value of an expression
Vainoharhainen has joined #ruby
benatwork has quit [Remote host closed the connection]
<Alantas> It's like taking a picture of the variable. name.to_s takes the picture (it "evaluates to" the string), but what do you do with it?
<graspee> so in x=x.to_s x is a variable, x.to_s is an expression and the whole thing is an assignment statement
<graspee> and = is the assignment operator
<rking> I need to find the official definitions for "expression" and "statement".
<Seabass> so let me see if I can successfully h(somepersonsname) now
<graspee> actually technically, x=x.to_s the whole thing is an expression too
<graspee> because you can do y=x=x.to_s
tobym has quit [Remote host closed the connection]
<rking> An expression is a suitable RHS?
<graspee> but that's a bit confusing right now
<Seabass> your face is an expression
<rking> E.g., something with a value.
<graspee> it is right now!
<Seabass> ROFL
ZachBeta has joined #ruby
<rking> Wikipedia actually goofs it up, saying that "In most languages, statements contrast with expressions in that statements do not return results and are executed solely for their side effects, while expressions always return a result and often do not have side effects at all."
mvangala_ has joined #ruby
<rking> That's clearly not true.
<rking> I'd be interested to find even one language where that holds.
<graspee> basic?
<rking> I donno, does it?
<graspee> in most basic basics statements don't return results
mvangal__ has joined #ruby
<graspee> let x=3, goto porcupine,
<graspee> gosub pangolin
<graspee> return
<graspee> none of those return anything. they are just statements
<rking> Hrm. And then no expressions have side-effects?
<graspee> depends on the basic again
<graspee> if an expression has a function call in it then obviously it has a side effect if you want
<rking> Basically, in a language where expressions cannot have side effects, and statements can't evaluate to a value, you could never have an open().
rodent` has joined #ruby
rodent` has quit [Remote host closed the connection]
<Seabass> http://pastie.org/3958256 can't h(yourname) to print Hello yourname! either
<LiquidInsect> Seabass: you still seem to expect name.to+s to do something to name
<LiquidInsect> er, name.to_s that is
<graspee> you need to call it with a string
<LiquidInsect> graspee: that's not it
<graspee> i think you think that calling the function with like robert is going to turn robert into a string
<graspee> by putting quotes round it
<LiquidInsect> graspee: oh oh oh that may be what's he's doing yeah
<Seabass> I want h to accept h"name" and h(name) and still print "hello name!"
<Mon_Ouie> I always thought #to_s was a confusing name — I see it more like "as_s"
<LiquidInsect> Seabass: that's not possible
<graspee> you need to call your function like h("bobby")
mvangala_ has quit [Ping timeout: 256 seconds]
<graspee> and you don't need the whole .to_s line
<canton7> LiquidInsect it is... but it's hacky
<graspee> just take out line 2
gtuckerkellogg has joined #ruby
<graspee> and make sure you put quotes round the name you pass to the fn and it will be fine
<LiquidInsect> canton7: well. maybe. You'd need to get into the caller's context and find out which local variable was passed in and oh god I'm gone crosseyed
<Alantas> graspee: You don't need to_s for interpolating the bare variable into the string; but you do if you want to call string-specific methods on it, like capitalize().
dtang has joined #ruby
<graspee> oh i didn't know that
<Seabass> so I'm trying to do something I should be trying to do
<graspee> sorry to be confusing then
<LiquidInsect> Alantas: sure, but he really should just chain the methods anyway, name.to_s.capitalize
<Alantas> LiquidInsect: Indeed. I already suggested that.
<LiquidInsect> ah.
<Seabass> mostly I think I am trying to see what the difference between h() and h"" is
<LiquidInsect> I have like no back buffer and I refuse to press pgup.
<canton7> LiquidInsect, there's a trick with using method_missing to support bare strings, but doesnt' seem to be working in 1.9 boo
kirun has quit [Quit: Client exiting]
<graspee> the brackets are not needed but most people like them for style
<Alantas> h() calls it with no argument. h("") calls it with one argument, an empty string.
<LiquidInsect> canton7: oh I know you can do weird things, I did this a while back... let me find it
<Mon_Ouie> Seabass: and h("foo") and h"foo" are the same thing
<graspee> h "bobby" is the same as h("bobby")
<Alantas> In this case, h()'s first argument will default to "World".
<LiquidInsect> I was bored.
<Seabass> I get it parenths are always there wheither I type them or not
<Alantas> So h() will print "Hello World!" while h("") -- which overrides the default -- will print "Hello !"
cableray has quit [Quit: cableray]
Solnse has quit [Read error: No route to host]
<Mon_Ouie> h(foo) calls h with the object referred to be the local variable foo (or the result of calling the foo method if that variable doesn't exist)
<Alantas> Seabass: Yes. But parentheses are not a substitute for the "quote" marks: if you want a literal string, you always need them.
<Mon_Ouie> Ruby methods aren't macros
<indeterminate> (h(foo) || bar) !== (h(foo || bar))
<canton7> LiquidInsect, heh, I like it!
<Alantas> indeterminate: h() doesn't return anything meaningful.
linus95014 has quit [Quit: linus95014]
<indeterminate> If you pretend parens never matter, you're going to run into operator precedence trainwrecks sooner or later.
<Seabass> ty for the advice indeterminate
<graspee> let him get into the train first
<indeterminate> Alantas: Was lazy in my selection of an example function, sorry.
linus95014 has joined #ruby
<Seabass> LOL graspee
cableray has joined #ruby
cdepue has joined #ruby
<Seabass> (h(foo) || bar) !== (h(foo || bar) I don't know what the || mean indeterminate
uris has quit [Quit: leaving]
snearch has quit [Quit: Verlassend]
<indeterminate> || usually means or, but if foo is nil, then it says to use bar instead.
<Seabass> I know !== means is not equal to
SuperrMann has quit [Quit: Computer has gone to sleep.]
<indeterminate> "if a || b" checks whether a, b, or both are neither nil nor false.
<Alantas> !== is based on === which has special meaning for case/when expressions and is generally only used in the background there.
<indeterminate> "a = b || c" sets a to b, unless b is nil, in which case it sets a to c.
<Seabass> interesting
zii has joined #ruby
linus95014 has quit [Client Quit]
<indeterminate> !== is stricter than !=, and isn't really something you'll see in Ruby, but I was assuming general familiarity.
<Mon_Ouie> a !== b is a syntax error here
looopy has joined #ruby
<indeterminate> I could go into it further, but it's not going to be useful at this point, just noise.
zii is now known as Guest21357
tatsuya_o has quit [Remote host closed the connection]
<Alantas> Yeah, !== is syntax-erroring for me too. I guess I assumed it would exist.
rbanffy has quit [Quit: Ex-Chat]
<indeterminate> !== is in Javascript and some other languages. It usually means "the values are not only equivalent, but are of the same type."
<Alantas> As for it being "stricter", no. Fixnum == 5 # false Fixnum === 5 # true
<Alantas> Like I said, it's a variant specifically to be useful in case/when statements. If anything, it's looser, not stricter.
<Alantas> Ruby != PHP.
<Seabass> lots of greek noise ^
<LiquidInsect> thank fsm for that
<graspee> thank god
<indeterminate> Didn't realize PHP used that syntax too.
<indeterminate> In some languages, "1" == 1 is true while "1" === 1 is false.
<LiquidInsect> so it's just sugar for is_a?
<LiquidInsect> bleh
<LiquidInsect> shouldn't use that for case statements either
<Alantas> LiquidInsect: When used with a class on the left side, yes, basically.
<canton7> it's designed to be overridden, see the same method in Object
<Alantas> case foo; when herp; ...; when derp; ...
<LiquidInsect> if you're doing if foo.is_a? Bar then x elsif foo.is_a? Baz then y, you're doing it wrong
<Alantas> This matches on herp===foo or derp===foo respectively.
<LiquidInsect> you implement the behavior in each class and just call the same method
<LiquidInsect> duck typing exists for a reason
<LiquidInsect> well. same named method
<LiquidInsect> which does different things in each class
<Alantas> Class has === for "is-a" relationships, so you can do stuff like: case foo; when Integer; "it's an integer"; when String; "it's a string"; etc
<LiquidInsect> sure. Or you implement whatami in String and Integer to do what you want and just call whatami on the object
<LiquidInsect> whichever type it is it'll do what you want
king313 has quit [Quit: .]
<Alantas> case "foo"; when /^f/ then "starts with f!"; when /^t/ then "starts with t!"; else "what is this i dont even"; end
tomzx has joined #ruby
<Alantas> Regexp#=== does a match operation.
Beoran_ has quit [Ping timeout: 252 seconds]
<LiquidInsect> and its behavior is then defined in the object's class, not some third class that shouldn't need to know what the object is
<Alantas> So, === is not "like == but with adjustments"; it's more like "case_match?".
<David_Mi1ler> good evening folks, can I span a long if clause across multiple lines?
rdesfo has quit [Ping timeout: 245 seconds]
<Alantas> David_Mi1ler: Yep.
<David_Mi1ler> Alantas: I must be doing something wrong then
<Alantas> Wait. By "clause", do you mean the conditional part or the body?
<Alantas> if conditional; body; end
<David_Mi1ler> conditional
<indeterminate> Are you doing something like "if x || y || z # ... ; ...; end"?
jonatha__ has joined #ruby
<LiquidInsect> if your conditional is that long, consider moving it to a separate method
<indeterminate> If so, you can do if x || y ||\nz ; ... ; end
mdhopkins has joined #ruby
fbernier has quit [Ping timeout: 260 seconds]
DanBoy has quit [Remote host closed the connection]
<David_Mi1ler> LiquidInsect: that is good advice and I've already done a little of that
<David_Mi1ler> hmm yeah I am putting the boolean operators on a new line
<David_Mi1ler> maybe they need to be at the end of the old line
christianrojas has quit [Quit: Linkinus - http://linkinus.com]
<indeterminate> Yep.
<Alantas> Yeah. Otherwise it'll be interpreted as end-of-expression.
<indeterminate> You may also be able to use \ at the end of a line to continue it. I forget if Ruby has that.
<canton7> if it's not clear that the statements isn't finished yet, you need to use a \ to tell ruby you're continuing it
<canton7> s/statements/statement
<Alantas> \, or just an operator at the end.
TorpedoSkyline has quit [Read error: Connection timed out]
billiamii has joined #ruby
ragnok has joined #ruby
<David_Mi1ler> excellent, thanks everyone
jonathanwallace has quit [Ping timeout: 260 seconds]
MrGando has joined #ruby
<David_Mi1ler> \ at the end does it
TorpedoSkyline has joined #ruby
<David_Mi1ler> because I think its more readable that way but others may disagree :)
ragnok has left #ruby ["Leaving"]
Asher has quit [Remote host closed the connection]
<Alantas> if (bad_practice || can_be_excused || and_you_do_not_want_to_make_a_function && that_can_be_abused) burma_shave
<indeterminate> haha
Asher has joined #ruby
jayrulez has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
berserkr1 has joined #ruby
cousine has joined #ruby
jonatha__ has quit [Remote host closed the connection]
jayrulez has joined #ruby
UdontKnow has quit [Read error: Operation timed out]
kickroot has quit [Read error: Operation timed out]
berserkr has quit [Ping timeout: 276 seconds]
DarkFoxDK has quit [Read error: Operation timed out]
SirFunk has quit [Ping timeout: 245 seconds]
jshsu has quit [Ping timeout: 250 seconds]
jonathanwallace has joined #ruby
xpot-station has quit [Read error: Connection reset by peer]
nuba has quit [Read error: Operation timed out]
Beoran_ has joined #ruby
elliottcable has quit [Ping timeout: 245 seconds]
mlue has quit [Ping timeout: 252 seconds]
kevinbond has joined #ruby
cid404 has quit [Ping timeout: 250 seconds]
looopy has quit [Remote host closed the connection]
AnswerGu1 has quit [Ping timeout: 240 seconds]
oddraisin has quit [Ping timeout: 244 seconds]
pradeepto has quit [Ping timeout: 244 seconds]
bpgoldsb has quit [Ping timeout: 248 seconds]
hoelzro|away has quit [Ping timeout: 272 seconds]
SecretAgent has quit [Ping timeout: 272 seconds]
warebec|1at has quit [Ping timeout: 265 seconds]
skinny_m has quit [Ping timeout: 276 seconds]
d_roge has quit [Ping timeout: 276 seconds]
wmoxam has joined #ruby
bfrog has quit [Ping timeout: 260 seconds]
wmoxam has quit [Changing host]
wmoxam has joined #ruby
rdesfo has joined #ruby
cdepue has quit [Remote host closed the connection]
fbernier has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
rdesfo has left #ruby [#ruby]
mlue has joined #ruby
iocor has quit [Quit: Computer has gone to sleep.]
Targen_ has quit [Ping timeout: 245 seconds]
Dreamer3 has joined #ruby
nari has joined #ruby
cdepue has joined #ruby
<shadoi> burma_shave?
wilmoore has quit [Remote host closed the connection]
tatsuya_o has quit [Remote host closed the connection]
MrGando has quit [Quit: Bye]
<shadoi> ah, got it.
<shadoi> Interesting.
patrick99e99 has joined #ruby
ramblex has quit [Quit: ramblex]
oooPaul has quit [Quit: Ciao for now!]
<patrick99e99> Hi everyone... I have a question about passing around blocks..... I am trying to DRY up some rspec test code, and I am getting a scope error now.. can anyone give me some suggestions on how I might be able to do this better? https://gist.github.com/2778523
looopy has joined #ruby
nari has quit [Ping timeout: 245 seconds]
medik has quit [Ping timeout: 265 seconds]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
avandenhoven has quit [Quit: avandenhoven]
saschagehlich has joined #ruby
<patrick99e99> hmmmmmm....
<patrick99e99> no one seems to be alive
<rking> Can someone show me where my assumption is failing? str = 'Welcome to Zombocom'; [ str.match(/Welcome /), str.match(/\Gto Zombocom/) ] # This returns [#<MatchData "Welcome ">, nil]
<rking> I expected it to be a pair of matches, not only the first one.