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
c0rn has joined #ruby
cj3kim has joined #ruby
cantonic has quit [Quit: cantonic]
minijupe has quit [Quit: minijupe]
c0rn has quit [Ping timeout: 252 seconds]
c0rn has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
dhaskew has joined #ruby
jayrulez_ has quit [Remote host closed the connection]
niklasb has joined #ruby
<delinquentme> http://pastie.org/3937773 << any ideas on how I might build this?
<delinquentme> it looks like it could be an array of hashes? but I need to build something like this .. and end up with that format in js
<offby1> So: how is "throw" different from "raise"? My hunch is that they're pretty much the same, except a) Raise takes any object, and lets you catch by specifying a class; b) throw is somehow cheaper.
<offby1> Discuss
Solnse has joined #ruby
<offby1> delinquentme: looks like an array of hashes to me, all right
<offby1> delinquentme: I just pasted that into my REPL, and (apart from having to add "0" before each decimal point), it "just worked".
Natch| has quit [Ping timeout: 245 seconds]
<offby1> [{x: 0, y: 0.1}, {x: 0, y: 0.9}, {x: 2, y: 0.5}, {x: 2, y: 0.9}] to spell it all out.
ArtificialEX has quit [Read error: Connection reset by peer]
c0rn has quit [Ping timeout: 265 seconds]
c0rn has joined #ruby
nfk has quit [Quit: yawn]
yankov has quit [Read error: Connection reset by peer]
yankov_ has joined #ruby
iamjarvo has quit [Ping timeout: 244 seconds]
RegEchse has quit [Quit: <3 WeeChat (v0.3.8-dev)]
c0rn has quit [Ping timeout: 252 seconds]
c0rn has joined #ruby
techhelp has quit [Quit: This computer has gone to sleep]
pdtpatrick has joined #ruby
<delinquentme> offby1, i had no idea you can define hash keys without quotes?
<deryl> that syntax he's using is 1.9 syntax
<offby1> delinquentme: quotes are for strings; they have nothing to do with hashes.
perryh_away is now known as perryh
<offby1> in older syntax, it'd be
<offby1> [{:x => 0, :y => 0.1}, ... etc etc ]
<offby1> pretty much the same thing; just put the colons at the front of the symbol's name, and put a => between each symbol and its associated value
<offby1> no quotes anywhere to be seen.
minijupe has joined #ruby
digitalcakestudi has joined #ruby
kirun_ has quit [Quit: Client exiting]
AlbireoX is now known as AlbireoX`Away
Foxandxss has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
QaDeS_ has joined #ruby
Zolrath has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
savage- has quit [Remote host closed the connection]
ipoval has left #ruby [#ruby]
Natch| has joined #ruby
Zolrath has joined #ruby
td123 has joined #ruby
QaDeS has quit [Ping timeout: 245 seconds]
iocor has quit [Quit: Computer has gone to sleep.]
cousine has quit [Remote host closed the connection]
c0rn has quit [Ping timeout: 252 seconds]
techhelp has joined #ruby
nlc has quit [Quit: Leaving]
c0rn has joined #ruby
novodinia has joined #ruby
hadronzoo has quit [Quit: hadronzoo]
novodinia has quit [Changing host]
novodinia has joined #ruby
odinswand has joined #ruby
techhelp has quit [Quit: This computer has gone to sleep]
davidpk has quit [Quit: Computer has gone to sleep.]
rh1n0 has joined #ruby
sohocoke has quit [Quit: sohocoke]
vitoravelino`afk is now known as vitoravelino
SeySayux has quit [Read error: Operation timed out]
DJZuzu is now known as Azure
mahmoudimus has joined #ruby
hamfz_ has quit [Read error: Operation timed out]
Hanmac has quit [Ping timeout: 240 seconds]
QaDeS_ has quit [Quit: Ex-Chat]
Criztian has joined #ruby
Criztian has quit [Remote host closed the connection]
wmoxam has joined #ruby
Icehawk78 has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
<Icehawk78> Is there a way in my aprc or irbrc to tell awesome_print not to find and collect every single instance variable that exists on an object when it displays it?
kenperkins has joined #ruby
<Icehawk78> I'm trying to do some stuff with mechanize in irb, and the output is entirely unreadable, but I'd prefer not to entirely disable ap
techhelp has joined #ruby
* offby1 stares blankly
<banisterfiend> Icehawk78: i always thought ap was broken
<Icehawk78> banisterfiend: I recently found out that the version I'd been using was over 1-2 years old, so this is "new to me" behavior, lol
<banisterfiend> Icehawk78: u could just explicitly require the old version you're used to ;)
odinswand has quit [Quit:]
c0rn has quit [Ping timeout: 248 seconds]
ConstantineXVI has quit [Remote host closed the connection]
jpcody has joined #ruby
wmoxam has quit [Ping timeout: 256 seconds]
c0rn has joined #ruby
jpcody has quit [Read error: Connection reset by peer]
ivar has quit [Remote host closed the connection]
<Icehawk78> banisterfiend: Might have to, but before I did that I figured I'd see if there was any existing manner to disable that and/or specify for custom objects I'm using/creating how to ap them
troessner_ has quit [Ping timeout: 245 seconds]
<banisterfiend> Icehawk78: for your custom objects, just ovverride the #ai method iirc
<banisterfiend> or awesome_inspect method
<banisterfiend> i forget which
jpcody has joined #ruby
yugui is now known as yugui_zzz
<Icehawk78> Oh, did not know that. Though I guess that won't help for something like mechanize.
elake has joined #ruby
<Icehawk78> But for some of this stuff, that's good to know.
<banisterfiend> Icehawk78: ruby's pretty_inspect / pretty_print stuff is great, i just use that
jpcody has quit [Read error: Connection reset by peer]
<banisterfiend> that's what we use for pry and are pretty happy with it
jpcody has joined #ruby
sohocoke has joined #ruby
Hanmac has joined #ruby
etank has quit [Ping timeout: 272 seconds]
sohocoke has quit [Remote host closed the connection]
jpcody has quit [Read error: Connection reset by peer]
jpcody has joined #ruby
ivar has joined #ruby
jpcody has quit [Client Quit]
khakimov has joined #ruby
ConstantineXVI has joined #ruby
kaneda_ has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
bluenemo has quit [Remote host closed the connection]
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
c0rn has quit []
niku4i has joined #ruby
ivar has quit [Remote host closed the connection]
niku4i has quit [Remote host closed the connection]
kenperkins has quit [Quit: Computer has gone to sleep.]
wmoxam has joined #ruby
krz has quit [Quit: krz]
koobs has joined #ruby
Soul_Est has joined #ruby
<koobs> Afternoon all, im looking for a variable or configure arg I can use when configure/compiling ruby to explicitly disable OpenSSL, any hints? (Ive looked for --{disable|without}--openssl ane HAVE_OSSL defines thus far)
flip_digits has joined #ruby
griffindy has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
xhh has joined #ruby
Progster has joined #ruby
L3top has joined #ruby
rh1n0 has quit [Quit: Leaving...]
moshee has quit [Ping timeout: 252 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
jayrulez has joined #ruby
techhelp has quit [Quit: This computer has gone to sleep]
AlbireoX`Away is now known as AlbireoX
mikepack has joined #ruby
ConstantineXVI has quit [Remote host closed the connection]
tewecske has quit [Quit: Leaving.]
BrianE has quit [Read error: Connection reset by peer]
bluOxigen has quit [Ping timeout: 276 seconds]
BrianE has joined #ruby
hadronzoo has joined #ruby
tchebb has quit [Quit: Leaving.]
hadronzoo_ has joined #ruby
jpcody has joined #ruby
indian has quit [Read error: Operation timed out]
jpcody_ has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
hadronzoo has quit [Ping timeout: 246 seconds]
hadronzoo_ is now known as hadronzoo
jpcody_ has quit [Client Quit]
khakimov has quit [Quit: Computer has gone to sleep.]
Beakr has joined #ruby
<Beakr> uninitialized constant EventMachine::HttpRequest. Is this deprecated?
jpcody_ has joined #ruby
jpcody has quit [Ping timeout: 250 seconds]
inteq has quit []
jpcody_ has quit [Read error: Connection reset by peer]
tchebb has joined #ruby
<Beakr> Wait, nevermind
flip_digits has quit [Quit: Computer has gone to sleep.]
tchebb has quit [Client Quit]
seanstickle has quit [Quit: Nihil sub sole novum]
phipes has joined #ruby
tchebb has joined #ruby
phipes has quit [Client Quit]
jpcody has joined #ruby
xclite has joined #ruby
jpcody has quit [Quit: Linkinus - http://linkinus.com]
jpcody has joined #ruby
<jpcody> hey all, sorry i got kicked offline earlier. I'm having lots of trouble getting a gem built correctly for local development. as of now, I've created it with bundler, started writing it, and am trying to require it in pry. it shows up in `gem list`, but in pry/irb, i get "no such file to load" -- any idea what could cause this?
kenperkins has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
cordoval has joined #ruby
bubz has quit [Ping timeout: 245 seconds]
kenperkins has quit [Client Quit]
ermines has joined #ruby
digitalcakestudi has quit [Quit: Leaving.]
weasels has quit [Read error: Connection reset by peer]
elkng has joined #ruby
<xhh> jpcody: maybe try "bundle exec irb"?
krz has joined #ruby
rboyd has joined #ruby
<jpcody> unfortunately, the same thing. because the gem is only local, is it because my GEM_PATH doesn't know where to find it?
dhaskew has quit [Ping timeout: 246 seconds]
yugui_zzz is now known as yugui
<xhh> jpcody: no idea then, you can use "gem list" and "gem content" to check where it is installed
eka has quit [Quit: Leaving]
kenperkins has joined #ruby
ConstantineXVI has joined #ruby
Constant_ has joined #ruby
savage- has joined #ruby
ConstantineXVI has quit [Read error: Connection reset by peer]
delinquentme has quit [Quit: Leaving]
remmy444 has joined #ruby
quesada__ has quit [Ping timeout: 246 seconds]
quesada__ has joined #ruby
sam113101 has quit [Remote host closed the connection]
luke3321 has joined #ruby
BrianE has quit [Quit: Linkinus - http://linkinus.com]
yugui is now known as yugui_zzz
nfluxx_ has joined #ruby
kenperkins has quit [Quit: Computer has gone to sleep.]
<jpcody> ah, grumble, it does appear to be in the correct place that it should be found
<jpcody> didn't know about gem content. thanks for that :)
mxweas has quit [Ping timeout: 276 seconds]
rh1n0 has joined #ruby
nfluxx has quit [Ping timeout: 246 seconds]
Gavilan has left #ruby [#ruby]
yugui_zzz is now known as yugui
nfluxx_ has quit [Ping timeout: 245 seconds]
dhaskew has joined #ruby
oponder has quit [Remote host closed the connection]
mxweas has joined #ruby
radic has quit [Disconnected by services]
radic_ has joined #ruby
radic_ is now known as radic
luke3321 has quit [Quit: leaving]
cordoval has quit [Quit: The fear of the Lord is the beggining of wisdom]
Constant_ has quit [Remote host closed the connection]
indian has joined #ruby
Ontolog has joined #ruby
Soul_Est has quit [Quit: WeeChat 0.3.7]
Soul_Est has joined #ruby
willyum has joined #ruby
niklasb has quit [Ping timeout: 245 seconds]
kenperkins has joined #ruby
berserkr has quit [Quit: Leaving.]
ivar has joined #ruby
sam113101 has joined #ruby
flip_digits has joined #ruby
Gavilan has joined #ruby
cordoval has joined #ruby
frishi has quit [Quit: Leaving...]
khakimov has joined #ruby
Soul_Est has quit [Quit: WeeChat 0.3.7]
Soul_Est has joined #ruby
jpcody has quit [Quit: Linkinus - http://linkinus.com]
yugui is now known as yugui_zzz
m0dmd has joined #ruby
td123 has quit [Quit: WeeChat 0.3.7]
yugui_zzz is now known as yugui
cordoval has quit [Quit: The fear of the Lord is the beggining of wisdom]
Vert has quit [Remote host closed the connection]
nfluxx has joined #ruby
mpereira has quit [Ping timeout: 252 seconds]
flip_digits has quit [Quit: Computer has gone to sleep.]
novodinia has quit [Ping timeout: 250 seconds]
ivar has quit [Remote host closed the connection]
rh1n0 is now known as rh1n0|away
L3top has left #ruby ["http://quassel-irc.org - Chat comfortably. Anywhere."]
wallerdev has joined #ruby
yugui is now known as yugui_zzz
wilmoore has quit [Remote host closed the connection]
elake has quit [Ping timeout: 246 seconds]
yoklov has quit [Quit: computer sleeping]
rh1n0|away is now known as rh1n0
TheHunter_1039 has quit [Quit: TheHunter_1039]
TheHunter_1039 has joined #ruby
ivar has joined #ruby
TheHunter_1039 has quit [Client Quit]
TheHunter_1039 has joined #ruby
TheHunter_1039 has quit [Client Quit]
nfluxx has quit [Quit: nfluxx]
Solnse has quit []
LiquidInsect has quit [Ping timeout: 245 seconds]
rh1n0 has quit [Quit: Linkinus - http://linkinus.com]
elake has joined #ruby
yugui_zzz is now known as yugui
techhelp has joined #ruby
rboyd has quit [Quit: rboyd]
kevinbond has joined #ruby
sprung has joined #ruby
hadees has quit [Quit: hadees]
savage- has quit [Remote host closed the connection]
techhelp has quit [Quit: This computer has gone to sleep]
test34 has quit [Ping timeout: 245 seconds]
LiquidInsect has joined #ruby
hadees has joined #ruby
fukushima has joined #ruby
ivar has quit [Remote host closed the connection]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
deobald__ has joined #ruby
savage- has joined #ruby
xclite has quit [Remote host closed the connection]
<Icehawk78> Is there any way to somehow tell Nokogiri that a specific site/page that I'm loading uses '<=' and '<' in text nodes, rather than '&lt;'? I don't really know how I'd do that, and I'm not even sure of what I'd be looking for to know what to search for online.
ConstantineXVI has joined #ruby
kevinbond has quit [Quit: kevinbond]
fbernier has joined #ruby
yugui is now known as yugui_zzz
defendguin has joined #ruby
techhelp has joined #ruby
ConstantineXVI has quit [Ping timeout: 246 seconds]
rippa has joined #ruby
baroquebobcat has joined #ruby
zeromodu_ is now known as zeromodulus
techhelp has quit [Ping timeout: 252 seconds]
kenperkins has quit [Quit: Computer has gone to sleep.]
macmartine has quit [Quit: macmartine]
amalvagomes has quit [Quit: amalvagomes]
macmartine has joined #ruby
Solnse has joined #ruby
Cache_Money has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
willyum has quit [Read error: Operation timed out]
davidpk has joined #ruby
amalvagomes has joined #ruby
Mon_Ouie has quit [Ping timeout: 276 seconds]
<ryanf> Icehawk78: what happens when you try to parse it right now?
defendguin has quit [Quit: Leaving.]
Mon_Ouie has joined #ruby
<ryanf> I think nokogiri lets you configure the parsing strategy to some extent, not sure if it would help though
kevinbond has joined #ruby
fbernier has quit [Ping timeout: 252 seconds]
wmoxam has quit [Ping timeout: 256 seconds]
Guedes_out has quit [Read error: Operation timed out]
lkba has quit [Ping timeout: 244 seconds]
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
baroquebobcat has joined #ruby
robdodson has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
mahmoudimus has joined #ruby
Cache_Money has left #ruby ["Leaving"]
austinbv has joined #ruby
lkba has joined #ruby
<austinbv> wtf happened to the ruby docs
baroquebobcat has quit [Quit: baroquebobcat]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
rboyd has joined #ruby
hadronzoo has quit [Ping timeout: 276 seconds]
kevinbond has quit [Quit: kevinbond]
Targen_ has joined #ruby
Targen has quit [Ping timeout: 244 seconds]
araujo has quit [Ping timeout: 240 seconds]
amalvagomes_ has joined #ruby
noganex has quit [Ping timeout: 246 seconds]
ciopte7__ has quit [Quit: ciopte7__]
noganex has joined #ruby
<Icehawk78> ryanf: After a bit of fiddling, I was able to just do a gsub on the mechanize.page.content to fix the offending characters (luckily, they're always directly next to an open parentheses) because anytime nokogiri actually parsed the document, it essentially chopped everything from the <= to the > of whatever the next tag was, as well as removing the closing /> tag of what got eaten, while throwing up several exceptions.
amalvagomes has quit [Ping timeout: 244 seconds]
amalvagomes_ is now known as amalvagomes
<ryanf> Icehawk78: were you parsing with Nokogiri() ?
<ryanf> you might try Nokogiri::HTML()
<ryanf> but I guess you've fixed it now
emmanuelux has quit [Read error: Connection reset by peer]
<Icehawk78> ryanf: Eventually that's what I had to do - before I was just using the nokogiri hooks built into Mechanize, rather than explicitly calling to Nokogiri
<ryanf> oh huh.
<Icehawk78> But I had to Nokogiri::HTML() after the gsub pat
<Icehawk78> *part
austinbv has quit [Quit: austinbv]
macmartine has quit [Quit: macmartine]
mahmoudimus has joined #ruby
<Icehawk78> Otherwise it'd to the aforemention chomping and spewing of exceptions (as I'd likely expect, given that they presumably don't want to hardcode html tags into the parser)
Progster has quit [Ping timeout: 260 seconds]
deobald__ has quit [Ping timeout: 260 seconds]
macmartine has joined #ruby
araujo has joined #ruby
macmartine has quit [Client Quit]
strnx has quit [Ping timeout: 245 seconds]
Rickmasta has quit [Quit: Bye]
SeySayux has joined #ruby
kil0byte has quit [Remote host closed the connection]
xhh has quit [Quit: xhh]
ananthakumaran has joined #ruby
xhh has joined #ruby
strnx has joined #ruby
Rickmasta has joined #ruby
ciopte7_ has joined #ruby
shevy has quit [Ping timeout: 248 seconds]
techhelp has joined #ruby
Solnse has quit []
deobald__ has joined #ruby
austinbv has joined #ruby
austinbv has quit [Client Quit]
indian has quit [Remote host closed the connection]
kevinbond has joined #ruby
Karmaon is now known as Karmaon2
Karmaon2 is now known as Karmaon
araujo has quit [Quit: Leaving]
amalvagomes has quit [Quit: amalvagomes]
flak has joined #ruby
kevinbond has quit [Client Quit]
flak is now known as Guest58654
shevy has joined #ruby
robdodson has quit [Quit: robdodson]
rippa has quit [Ping timeout: 244 seconds]
cj3kim has quit [Quit: This computer has gone to sleep]
kevinbond has joined #ruby
wallerdev has quit [Quit: wallerdev]
Guest58654 has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
rippa has joined #ruby
quest88 has quit [Quit: quest88]
BadAtom has joined #ruby
mucker has joined #ruby
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
Ryan_V-01 has joined #ruby
austinbv has joined #ruby
<Ryan_V-01> hi all. is there some best practice for when to use (or if ever to use) a 'for' block instead of an each block?
<bnagy> never use for
<bnagy> (tat's opinion)
banisterfiend has quit [Remote host closed the connection]
<bnagy> for is there for recovering perl / python programmers, it's ruby methadone
<Ryan_V-01> haha ok thats kind of what i was looking for. i remember when i first started out i saw someone doing it in some tutorial, but then someone told me not to so i hadn't done it since, but i was just wondering if it was because there was certain times when it was appropriate to use it (and maybe that wasn't one of them)
<Ryan_V-01> bnagy i don't know if you remember before you were helping me out with reporting stuff
techhelp has quit [Quit: This computer has gone to sleep]
austinbv has quit [Quit: austinbv]
vitoravelino is now known as vitoravelino`afk
igotnolegs has quit [Quit: Computer has gone to sleep.]
<Ryan_V-01> guess not? well, I ended up putting together something we talked about. in the end, I'm not going down this route but it was fun anyways. https://gist.github.com/2754853
austinbv has joined #ruby
yxhuvud has joined #ruby
austinbv has quit [Quit: austinbv]
andrewhl has quit [Quit: andrewhl]
defendguin has joined #ruby
banisterfiend has joined #ruby
Solnse has joined #ruby
andrewhl has joined #ruby
sparrovv has joined #ruby
<bnagy> sry, internet is messed up here, I dropped out
<Ryan_V-01> did u get those last messages?
<bnagy> ah, that's nicer
<bnagy> date_range logic looks a little twisty though
CheeToS has joined #ruby
<Ryan_V-01> yeah, i was trying to not break the existing short term, then prob just do a rewrite once all the tests are solid
<Ryan_V-01> …existing *code…
krz has quit [Quit: krz]
ermines has quit [Read error: Connection reset by peer]
m0dmd has quit [Quit: m0dmd]
altiouz has joined #ruby
otters has joined #ruby
deobald__ has quit [Ping timeout: 260 seconds]
adeponte has joined #ruby
austinbv has joined #ruby
kil0byte has joined #ruby
mucker has quit [Ping timeout: 250 seconds]
nirakara has joined #ruby
mucker has joined #ruby
nirakara has quit [Read error: Connection reset by peer]
looopy has joined #ruby
kevinbond has quit [Quit: kevinbond]
sparrovv has quit [Ping timeout: 252 seconds]
nirakara has joined #ruby
adeponte has quit [Remote host closed the connection]
austinbv has quit [Quit: austinbv]
defendguin has quit [Quit: Leaving.]
Alantas has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
vertroa has joined #ruby
mahmoudimus has joined #ruby
kil0byte has quit [Read error: Connection timed out]
kil0byte has joined #ruby
fowl has quit [Read error: Connection reset by peer]
ddv has joined #ruby
fowl has joined #ruby
Eldariof-ru has joined #ruby
SmoothSage has joined #ruby
Ryan_V-01 has quit [Quit: Ryan_V-01]
andrewhl has quit [Quit: andrewhl]
Morkel has joined #ruby
kevinbond has joined #ruby
jackiechan0 has joined #ruby
<jackiechan0> hi there
banisterfiend has quit [Remote host closed the connection]
jackiechan0 has quit [Client Quit]
kil0byte has quit [Remote host closed the connection]
banisterfiend has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
nirakara has quit [Quit: This computer has gone to sleep]
kevinbond has quit [Quit: kevinbond]
nirakara has joined #ruby
sparrovv has joined #ruby
dhaskew has quit [Ping timeout: 246 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
<bnagy> nice. Jruby 1.7 with jre1.7u6 is 3x faster than mri 1.9.3p194 on some set cover stuff I'm doing
<bnagy> that's... quite a lot
<shevy> speed lover!
prtksxna has joined #ruby
<bnagy> well, when it's free* yeah
<bnagy> mri, without parallel 120s, jruby + parallel 9.79s
<bnagy> not a bad afternoon's work
yankov_ has quit [Quit: yankov_]
<bnagy> I want to test this on one of the 48 core boxes :D
kevinbond has joined #ruby
<bnagy> also, I installed rbenv, finally. So shweeeet.
tomzx has quit [Ping timeout: 246 seconds]
eka has joined #ruby
jackiechan0 has joined #ruby
<jackiechan0> hello
<jackiechan0> anyone there?
mikepack has quit [Remote host closed the connection]
nikhil_ has joined #ruby
<jackiechan0> nikhil_> hi
nirakara has quit [Ping timeout: 250 seconds]
<shevy> jackiechan0 ciao
<jackiechan0> shevy> hi there
<jackiechan0> shevy> u busy?
<bnagy> jackiechan0: if you've a question, just ask, you don't need to do a roll call first
<jackiechan0> shevy> do u speak italian ?
<bnagy> unless it's about metasploit ;)
<shevy> jackiechan0 other than ciao no :(
<jackiechan0> bnagy> shevy ok i'm learning the use of else
<shevy> good
<shevy> if foo
<jackiechan0> (very basis sigh!)
<shevy> do_thing
<shevy> else
<shevy> do_something_else
<shevy> there you go!
<bnagy> yeah, certain types of control flow can be really tricky without it
mohits has joined #ruby
<rking> shevy: No "end"?? I suspect you're a Python spy in disguise. >=|
shruggar has joined #ruby
mohits has quit [Quit: Leaving.]
<shevy> rking I wanna see end gone as an optional feature to the first shebang line
nikhil_ has quit [Ping timeout: 244 seconds]
<rking> shevy: Me, too. =\
<shevy> it's one of the few things I like in python
<rking> shevy: There's a gem for it.
nirakara has joined #ruby
<shevy> except that you must use :
<rking> Me, too.
<shevy> def foobar():
<shevy> I still dont understand why they demand a :
<rking> I don't know what that : is for in Python.
<rking> Me, too.
<shevy> yeah. I thought there is enough information from the indent level alone
kevinbond has quit [Quit: kevinbond]
<shevy> I think I tried the gem a few years ago, but something didn't quite seem to work at that time for me
<rking> But please don't ever ask me to defend Python's design decisions. I'm more likely to accept execution by rusty fork than do so.
<shevy> hehe
<jackiechan0> shevy> how can i use 2 if and 1 else ?
nirakara has quit [Client Quit]
<shevy> jackiechan0 for the same query logic?
<shevy> if foo
<shevy> elsif bla
<shevy> else
<shevy> or do you mean
<shevy> if foo
<shevy> if bla
<shevy> else
<jackiechan0> shevy> example here https://www.privatepaste.com/2e86b86048
<shevy> jackiechan0 why dont you indent?
<shevy> also I would advice to use a newline before the first if
<jackiechan0> shevy> ident what?
<shevy> your code
<shevy> if x
<shevy> do_this
<shevy> that is indent
<jackiechan0> shevy> i dunno what do you mean ident
<bnagy> jackiechan0: I'd use a case statement there
<shevy> see the ' '
<shevy> indent. it means move to the ---> right
<shevy> here this is indented
<shevy> here this is indented
<shevy> you see?
<jackiechan0> shevy> ok that's new for me
<shevy> jackiechan0 you forgot one "end" btw
<shevy> with indent, it would have been instantly obvious
<jackiechan0> shevy> i'm at the chapter 6 of that tutorial and i took the book that is bigger
<shevy> the book that is bigger? :)
<shevy> do you want to take the book that is biggest!!!
<shevy> hehehe
<bnagy> jackiechan0: you could use if elsif else in that example, but if you ever find yourself using more than one elsif then switch to a case statement
<jackiechan0> shevy> yeah is there a complete version of Chris Pine learn to program that is more complete
moshef has joined #ruby
<shevy> ah I see
<shevy> interesting way to publish
tk___ has joined #ruby
<jackiechan0> shevy> now it works but not correctly https://www.privatepaste.com/2fd68a66b9
Eldariof59-ru has joined #ruby
<shevy> rking, what would this do in python: array[::2]
Eldariof-ru has quit [Ping timeout: 246 seconds]
prtksxna has quit [Read error: Connection reset by peer]
prtksxna has joined #ruby
<shevy> pls jackiechan0
<banisterfiend> shevy: shevboy
minijupe has quit [Quit: minijupe]
<shevy> indent your code!!!
nicoulaj has joined #ruby
<jackiechan0> shevy> i'm still trying to understand how to ident it correctly, you mean that if and end have to been on the same column ?
<shevy> also your end is wrong
<shevy> yes jackiechan0
<shevy> and the content, between them
<shevy> two levels to the --> right
<shevy> if bla
<shevy> ' '<---write here
<shevy> example
<shevy> if bla
<shevy> call_this()
<shevy> else
<thomasfedb> shevy, it would slice your array. can't; rember exactly what slice. look it up
<shevy> call_that()
<shevy> end
<shevy> yeah thomasfedb
<shevy> sorry
<shevy> i wanted to find out whether rking knows heheheh
<thomasfedb> oh, cool.
<shevy> When I saw it, it confused me a lot
<jackiechan0> shevy> anyway how can i fix that to works correctly ? then i'll learn to ident that i think that something more for reading
<shevy> and I was thinking "hmm... what is the same way in ruby?"
<shevy> jackiechan0, you used an early "end"
<moshef> how do I protect against TypeError: nil can't be coerced into Float ?
<shevy> jackiechan0 look at the first end
<shevy> it closes your first if
nirakara has joined #ruby
<thomasfedb> jackiechan0, if you can't indent then don't even think about hoping that you code might even have a chance of working at all.
<jackiechan0> shevy> yeah
<moshef> got a variable contain 4 float values, some of which might be zero
<rking> shevy: Heh, interesting. a[::2] does do something.
batmanian has joined #ruby
kevinbond has joined #ruby
<thomasfedb> moshef, an array?
<moshef> is it possible to protect it without checking each value if it's zero before adding ?
<moshef> nope, just something like moshe = a.to_f + b.to_f etc
<bnagy> jackiechan0: http://codepad.org/3XBWt6ca
<jackiechan0> shevy> if i remove the first end the code will not work at all
<jackiechan0> bnagy> tnx sorry for bothering
<thomasfedb> moshef, what you do mean by protect?
<batmanian> How can I profile 'rake -T'? It takes about 5 seconds for me (20 seconds for the initial run!) and I want to know why...
<shevy> jackiechan0 btw what does not work?
<thomasfedb> moshef, addition of zero is safe
<rking> shevy: Seems to splice out the 1th..-3th elements?
<moshef> when I'm doing = a.to_f + b.to_f + c.to_f
<shevy> rather than say "does not work" please say what specific error
<moshef> if a is nil, I'm getting TypeError: nil can't be coerced into Float
<bnagy> jackiechan0: that's when / splat magic. Very advanced. Don't tell anyone.
<moshef> so it will be (a.to_f if !a.zero?) + (b.to_f if !b.zero?) etc ?
<thomasfedb> moshef, ah. Where do a, b and c come from?
<jackiechan0> shevy> as you saw i was trying to get 3 output one for name Louis other for name Michael and other for someone else
<shevy> rking, hmm almost... "array = [1,2,3,4,5] >>> array[::2] # iterate over the whole list in 2-increments"
kevinbond has quit [Client Quit]
<shevy> [1,3,5]
<moshef> methods
<thomasfedb> moshef, (a || 0).to_f + (b || 0).to_f + ...
<moshef> nice, cool
<moshef> forgot about it
<thomasfedb> moshef, need more info to help and further.
<moshef> thanks
<moshef> think this will do
ph^ has joined #ruby
<jackiechan0> shevy> when i prompt Michael (the first name) i god 2 output instead of 1 the Michael output and the else output
<Hanmac> [a,b,c].compat.inject(:+)
<shevy> jackiechan0 ah I see
<rking> shevy: Oh, yes, I was reading it wrong/sloppy.
phipes has joined #ruby
bier_ has quit [Ping timeout: 245 seconds]
<Hanmac> moshef my line may be better
<shevy> jackiechan0 that is because your code does precisely that
<shevy> jackiechan0 look at your code again and think what happens when you input Michael
<jackiechan0> shevy> *i got
<shevy> it enters the first if, then it goes to the second if
<bnagy> moshef: what version? nil.to_f returns 0.0 for me
<bnagy> which it should imho
<jackiechan0> shevy> when i imput michael i got these two output
<jackiechan0> if name == 'Michael'
<jackiechan0> puts 'Hey '+name+' how long we don\'t see each other'
<jackiechan0> else
<jackiechan0> puts 'I\'m sorry mr '+name+' i don\'t think we know each other'
stanigator has joined #ruby
<moshef> bnagy: true adding nil.to_f with 1.to_f
<shevy> jackiechan0 didn't I explain it already
<moshef> try*
<bnagy> nil.to_f + 1.to_f => 1.0
<jackiechan0> shevy> sorry sorry it's for Louis, not for Michael. Michael works fine
<shevy> jackiechan0 yes, look at your code man
<jackiechan0> shevy> if you don't mind could you simply correct my code and i will understand by myself thanks
<shevy> jackiechan0 your current code does precisely do this
<bnagy> moshef: use Hanmac's line though, if you're on a current ruby
<thomasfedb> jackiechan0, that's hardly a useful way to learn.
<bnagy> there's no need to coerce to floats for addition anyway :)
<shevy> jackiechan0, well, I would use a case menu
<thomasfedb> jackiechan0, first write you code with proper indentation.
<stanigator> has anyone here had trouble installing libwebsocket gem?
<moshef> bnagy: let me try his line
<shevy> jackiechan0, or use what bnagy showed http://codepad.org/3XBWt6ca
hadronzoo has joined #ruby
<jackiechan0> thomasfedb> ok the Chris Pine until now never talked about identation anyway i'll do that
rippa has quit [Ping timeout: 260 seconds]
<jackiechan0> shevy> ok
<bnagy> shevy: sssh that's secret whensplat magic!
<moshef> Hanmac: what makes it better?
CheeToS has quit [Ping timeout: 250 seconds]
<shevy> if you want it simpler jackiechan0 use http://pastie.org/3938895
<bnagy> it's prettier and it deals with nil by throwing them away instead of converting them
<jackiechan0> bnagy> shevy another question then i'll stop to bother: How can i add hashes # to multiple strings without prompting # for each ? i'm using gedit on ubuntu
<bnagy> moshef: but it won't coerce the result to float
<shevy> wait what
<shevy> add a hash to ... what?
<moshef> bnagy: so I need to to_f it?
nirakara has quit [Quit: This computer has gone to sleep]
<shevy> "multiple strings"? add a hash to a string??
<moshef> its very important to be precise, I can't have it convered 1.5 to 1 etc
<shevy> this_is_a_string = "hi there"
<bnagy> if you want to guarantee the result is a float
<jackiechan0> shevy> # to string that i want to ignore, i don't want to put # for every all the time
<bnagy> moshef: that can't happen, for addition
<shevy> this_is_a_hash = { :a => "b" }
stanigator has quit [Client Quit]
<shevy> sorry
<bnagy> (1 + 1.5).class => Float
<shevy> I have no idea what you want :)
<moshef> bnagy: what can't happen? guarantee of float?
<jackiechan0> shevy> ho do u call this '#' in english ?
moshef has quit [Quit: moshef]
<bnagy> moshef: only time you need to convert to float beforehand is division
<shevy> hmm I dont even know the german name right now O_O
<thomasfedb> jackiechan0, we call that a hash, or a weave, or a mesh
<shevy> Hanmac, help me out
<shevy> op
<shevy> "hashmark"
<shevy> lol.... in german "das Doppelkreuz"
<bnagy> don't they call it 'pound' in the US sometimes?
<thomasfedb> yeah
liluo has joined #ruby
<thomasfedb> they do that
phipes has quit [Quit: phipes]
<bnagy> well at least Dopplekreuz makes sense
<shevy> the german word is hilarious. double cross.
<jackiechan0> shevy> anyway when i add # at the beginning of a string, the code will be ignored right?? if i have to add # to many strings i have to do it manually string by string, is there a way to select various string and add # to every one? did i make myself clear?
<Mon_Ouie> Also sharp (as in C#)
<shevy> jackiechan0 yes. ruby ignores what comes after a #
<bnagy> jackiechan0: use an editor that is not retarded
<thomasfedb> jackiechan0, a line of code is not a "string" it is a "line"
<jackiechan0> thomasfedb> ok sorry i mean 'line o code'
<shevy> jackiechan0, well yes you have to manually to that. but there is another way too
<shevy> I think it is =begin
<jackiechan0> shevy> which one
<shevy> or something. I dont use it myself actually
<shevy> I use # even on multiple lines
<bnagy> yeah =begin on a line by itself, close with =end
<jackiechan0> shevy> nad u add # manualli to every line ?
<shevy> there you go jackiechan0 ^^^
diegok has quit [Remote host closed the connection]
<shevy> yes jackiechan0
<bnagy> good for rapidly commenting out large chunks
<shevy> it is usually only 6-10 lines at max with #
pdtpatrick has quit [Quit: pdtpatrick]
<jackiechan0> bnagy> shevy ok guys thanks for helping, keep studying i really like ruby!!! chris pine book it's great for n00b!!! thanks again
<shevy> hmm
<shevy> jackiechan0, do you know the poignant guide?
<jackiechan0> shevy> no ? what's that
<shevy> hey strange
<shevy> it kinda changed.... hmmm
<shevy> I dont remember that layout from years ago
<shevy> did _why draw all those things on his own?
nirakara has joined #ruby
liluo has quit [Remote host closed the connection]
<jackiechan0> shevy> seems a joke i prefer Chris Pine, do you know the extended Chris Pine book version ?
<shevy> dont know the extended version, but I heard from it before here on #ruby some weeks ago
<bnagy> if you can get over the fact that he's a total fricking lunatic, the poignant guide is VERY good
<bnagy> the stuff on metaprogramming and introspection is great
bier_ has joined #ruby
<bnagy> but it's a bit advanced if you can't really program at all
<jackiechan0> bnagy> really?? seems a joke
mucker has quit [Ping timeout: 252 seconds]
Solnse has quit [Read error: No route to host]
ukwiz has joined #ruby
kaspernj has joined #ruby
<bnagy> jackiechan0: get through learn to program first :>
<bnagy> poignant guide is definitely not for everyone
nirakara has quit [Quit: This computer has gone to sleep]
musee is now known as LAME
<shevy> yeah
<shevy> when I came to ruby, it confused me
<jackiechan0> bnagy> yeah i don't want to make a mess the book i'm studying is enough until now
<shevy> when I was young, handsome and didn't know ruby
mucker has joined #ruby
<shevy> but I can agree that it was some kind of art
<shevy> I still dont understand why he jumped off
moshef has joined #ruby
<bnagy> ok... the jvm has some magic in its hat
<bnagy> 26, 38, 79, 160 (execution times for an algorithm, in seconds)
<bnagy> 119, 304, 962
Ontolog has quit [Remote host closed the connection]
<bnagy> same algorithm, with MRI - it's not just that jruby is faster, it's that the execution times follow a different curve :/
LAME is now known as WAT
WAT is now known as lae
lae is now known as Juni
Juni is now known as melan
<shevy> MRI is a real snail
<shevy> but she is old and wise
<shevy> be nice to her!
melan is now known as Osaka
<shevy> damn you IRC
daniel_hinojosa has quit [Ping timeout: 244 seconds]
<bnagy> sorry MRI
cantonic has joined #ruby
samsonjs has quit [Ping timeout: 245 seconds]
arturaz has joined #ruby
flip_digits has joined #ruby
troessner_ has joined #ruby
fgwaegeawgfwa has joined #ruby
tomb_ has quit [Quit: Computer has gone to sleep.]
imami|afk is now known as banseljaj
Morkel has quit [Quit: Morkel]
Gavilan has quit [Ping timeout: 250 seconds]
skogis has joined #ruby
Codif has joined #ruby
Tuxist has joined #ruby
rushed has joined #ruby
moshef has quit [Quit: moshef]
codebeaker has joined #ruby
d3c has joined #ruby
xhh has quit [Remote host closed the connection]
xhh has joined #ruby
greyEAX has quit [Remote host closed the connection]
otters has quit [Read error: Connection reset by peer]
otters has joined #ruby
asuka_ has quit [Read error: Connection reset by peer]
Criztian has joined #ruby
xhh has quit [Remote host closed the connection]
xhh has joined #ruby
adambeynon has joined #ruby
asuka_ has joined #ruby
xhh has quit [Quit: xhh]
exchgr has quit [Quit: exchgr]
ananthakumaran1 has joined #ruby
ananthakumaran has quit [Ping timeout: 240 seconds]
<batmanian> Is this legal in Ruby? delegate :image?, :to => :media (symbol with question mark)
<Hanmac> batmanian yeah thats legal
<shevy> batmanian you always have to understand code
<Hanmac> you can use symbol with ? but not in a attr_* function
<shevy> ah
<batmanian> what that block is totally broken! :my_boolean_attribute? = false
<shevy> batmanian, you want an attr_* with a question mark ?
<batmanian> no
<shevy> well :my_boolean_attribute? is still a symbol
<batmanian> I want to know if I name a method image? then if I can call it in a map using &:image?
schovi has joined #ruby
moshee has quit [Ping timeout: 252 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
<shevy> hmm
<shevy> dont think I have seen it used before with a ?
ssand has joined #ruby
<shevy> ok i just tried
<shevy> batmanian, it works
<shevy> class String; def reverse?; '42'; end; end; %w( abc def ghi ).map(&:reverse?) # => ["42", "42", "42"]
<batmanian> shevy thanks, it was working for me too, but I had read somewhere that it is invalid, I thought maybe Ruby is not validating the syntax or if the article that I've read is wrong?
<shevy> I dunno the article, but we now can be absolutely sure that (&:reverse?) is valid syntax and works too
<shevy> I dont see many symbols with a "?" mark though
<shevy> I find it a bit strange to use the ? there
<shevy> it is as if someone is trying to use symbols in conditional logic :)
<shevy> we could even write perhaps ... "puts 'Yup!' if delegate :image?"
yugui_zzz is now known as yugui
yugui is now known as yugui_zzz
rboyd has quit [Quit: rboyd]
asuka_ has quit [Ping timeout: 252 seconds]
asuka_ has joined #ruby
gtuckerkellogg has joined #ruby
dhaskew has joined #ruby
codebeaker has quit [Ping timeout: 246 seconds]
ryanf has quit [Quit: leaving]
mucker has quit [Read error: Connection reset by peer]
weasels has joined #ruby
otters has quit [Read error: Connection reset by peer]
weasels has quit [Changing host]
weasels has joined #ruby
ciopte7_ has quit [Quit: ciopte7_]
flip_digits has quit [Quit: Computer has gone to sleep.]
becom33 has joined #ruby
<becom33> https://gist.github.com/2757492 in this I'm getting a ./lib/commands/help.rb:20:in `help': uninitialized constant Help::Helpset (NameError)
* becom33 anyone ?
<Hanmac> becom33 read your line again, and then your error again ... do you notic something?
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
oponder has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ has joined #ruby
troessner_ has quit [Read error: Connection reset by peer]
greyEAX has joined #ruby
dhaskew_ has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
thecreators has joined #ruby
jbw has quit [Ping timeout: 246 seconds]
sparrovv has quit [Ping timeout: 240 seconds]
Tuxist has quit [Read error: Connection reset by peer]
azm has joined #ruby
<becom33> Hanmac, no I don't get it :/
Tuxist has joined #ruby
Morkel has joined #ruby
oponder has quit [Remote host closed the connection]
<shevy> becom33 it tells you THE CONSTANT DOES NOT EXIST
<shevy> :)
<shevy> becom33 Help::Helpset <-- at least one of these does not exist
<shevy> or is not known. did you (a) include these and (b) do they really exist?
<shevy> the logical answer to at least one question must be no
hadronzoo has quit [Quit: hadronzoo]
jbw has joined #ruby
<becom33> shevy, wait
<Hanmac> becom33 Helpset and HelpSet are NOT the same
<becom33> DAMN IT !
<shevy> hehe
<jackiechan0> shevy> pdf complete version's chris Pine Learn to Program http://www.it-ebooks.info/book/36/
diegoviola has quit [Quit: leaving]
ctp has joined #ruby
icrazyhack has joined #ruby
iocor has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
dangerousdave has joined #ruby
ctp has quit [Quit: Leaving...]
<dangerousdave> I have rescue block, how do i skip the rest of the loop iteration from with it? In c++ i would use continue, that didnt work
jimeh2 has quit [Ping timeout: 252 seconds]
tresk has joined #ruby
macer1 has joined #ruby
macer1 has quit [Changing host]
macer1 has joined #ruby
sparrovv has joined #ruby
Codif has quit [Remote host closed the connection]
deobald__ has joined #ruby
bluOxigen has joined #ruby
codebeaker has joined #ruby
nicoulaj has quit [Remote host closed the connection]
<banisterfiend> dangerousdave: next
<dangerousdave> cheers
ctp has joined #ruby
ctp has quit [Read error: Connection reset by peer]
nfk has joined #ruby
jimeh2 has joined #ruby
lateau has joined #ruby
jimeh2 has quit [Ping timeout: 276 seconds]
ronniy has joined #ruby
lateau has quit [Ping timeout: 245 seconds]
weasels has quit [Read error: Connection reset by peer]
ermines has joined #ruby
ermines has quit [Changing host]
ermines has joined #ruby
bluOxigen has quit [Ping timeout: 252 seconds]
netogallo has quit [Ping timeout: 260 seconds]
zastaph has joined #ruby
nirakara has joined #ruby
fridim_ has joined #ruby
dax has quit [Ping timeout: 619 seconds]
lateau has joined #ruby
dax has joined #ruby
Murr_ has joined #ruby
Murr_ has quit [Remote host closed the connection]
cha1tanya has joined #ruby
<jackiechan0> hey there what means command=''
<Tasser> jackiechan0, assign empty string to the variable command
<jackiechan0> i have problem to undersatnd loops, i should do the 99 bottle exercize
<jackiechan0> Tasser> tnx
<Tasser> jackiechan0, which is quite obvious, I'd say
<jackiechan0> Tasser> sorry i'm noob
telos has joined #ruby
<telos> hi, i have built ruby from source (both directly and using rvm) and either way I am unable to use the digest/md5 library: digest/md5.so: undefined symbol: rb_Digest_MD5_Init
<telos> any ideas?
<Tasser> jackiechan0, doesn't inhibit you from thinking yourself
<jackiechan0> Tasser> i have difficulty to understand this loop http://codepad.org/eYnwhfYU
<telos> (by the way, the openssl libcrypto is installed and has the MD5 symbols)
netogallo has joined #ruby
<jackiechan0> Tasser> if command = '' then command=gets.chomp !?
Boohbah has quit [Ping timeout: 276 seconds]
<Tasser> ask someone else
lateau has quit [Ping timeout: 245 seconds]
<jackiechan0> Tasser> tnx anyway, i don't want to see the result of exercize i would like hint to reach by myself
bluOxigen has joined #ruby
lxsameer has joined #ruby
<shevy> jackiechan0 here is one problem
<shevy> jackiechan0 = is an assignment
<jackiechan0> shevy> hey shevy
<shevy> jackiechan0 == is a comparison
<shevy> so if you d:
<shevy> so if you do:
<jackiechan0> shevy> ok i got the difference
<shevy> if command = ''
<shevy> then you do not compare per se
<shevy> you assign to the variable called command
lxsameer has quit [Max SendQ exceeded]
<shevy> if command == ''
<jackiechan0> shevy> but your are telling that 'command' is egual to ''
<shevy> now you compare
lxsameer has joined #ruby
<shevy> you assigned '' to command variable
<jackiechan0> shevy> in case of == you are asking is command egual to ?
<shevy> is equal to right value, yes
<shevy> if you want to ask a string whether it is empty, you can use this however:
<shevy> if command.empty?
<jackiechan0> shevy> so for solving the 99 bottle exercize i have to use == ?
telos has quit [Quit: leaving]
<shevy> jackiechan0 there are million ways to solve this exercise. use a way that works for you it is not hard
<shevy> split the problem into smaller subproblems
<jackiechan0> shevy> 'split the problem into smaller subproblems' that's it i know that the solution has to be quite obvious
<jackiechan0> shevy> tnx, did u take a look to the complete Chris Pine book ? it's a legit website where the pdf is
<shevy> hmm not yet
<shevy> jackiechan0 I think for me the book is not that useful
<shevy> I know quite a bit about ruby already
<jackiechan0> shevy> i know it's just for your curiosity
<jackiechan0> shevy> :)
<shevy> ok
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ has joined #ruby
<shevy> I see I see
lxsameer has quit [Client Quit]
<jackiechan0> maybe the wrong one
<shevy> you watch youtube rather than work on your ruby ;)
<shevy> nice boobs
<jackiechan0> shevy> pause, yeah keep going on ruby!!
<jackiechan0> shevy> :)
<shevy> jackiechan0 yeah, I write a mini IRC "client" right now
<shevy> in ruby
<jackiechan0> shevy> ? the new MIrc ?
<shevy> I wanna finish it today... but I feel so lazy :(
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
<shevy> no, not as feature rich
<shevy> I purposely want to keep it VERY simple
<jackiechan0> shevy> how long it takes to write it ?
<shevy> dunno. it goes very quickly when I know what I have to do
<shevy> it takes longer when I have to find out what to do
<jackiechan0> shevy> 1 day? 1 week? 1 month ?
<shevy> for instance, yesterday I did not know that I have to respond with PONG when the IRC server gives me a PING
<shevy> jackiechan0, nah, only days
<jackiechan0> shevy> ok
<shevy> I hope 2 days maximum
<shevy> after that, only maintainence work
<jackiechan0> shevy> a kernel could be wrote in ruby? i think no, right?
<shevy> not directly
<shevy> perhaps if you also use C additionally then yes
<jackiechan0> shevy> kernel = C
<jackiechan0> shevy> ok
<shevy> but even the linux kernel uses assembler code jackiechan0
<jackiechan0> shevy> ruby it's an interpreted script language
<shevy> we need to have a language that is able to replace C
<jackiechan0> shevy> a new C version is going out i heard
<jackiechan0> shevy> maybe you told me
<shevy> According to TIOBE, C is the most popular language http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
<shevy> I did not tell you
<shevy> I would not know. I dont really spend much time with C
<shevy> :)
<jackiechan0> shevy> ok i was wrong
orealis has joined #ruby
<shevy> but C is more fun than java for sure
<orealis> SO.... I haven't touched programming since assembly back on amiga in the late 80's.... would ruby be a good thing to try and learn? I basically have been reset to n00b..
timonv has joined #ruby
<jackiechan0> shevy> but the C that i could use now is the same from the K&R =
<jackiechan0> ?
<orealis> or shoul I go all C#y?
<apeiros_> orealis: we can't answer you which language you should learn - that depends on your context
<apeiros_> but ruby is certainly a great language to learn
<orealis> I'm bored and I need something to use my brain on...
<jackiechan0> orealis> i'm learning it and i'm enjoying and i'm n00b to
<orealis> the little thats left of it anyway
<jackiechan0> orealis> take a look to this book it's great and very friendly http://www.it-ebooks.info/book/36/
* orealis admits to liking graphics and isnt sure how suitable ruby is for that..
<orealis> mysql error on that page
<orealis> guess its down..
<shevy> jackiechan0, kind of
<shevy> orealis depends on your use case
<shevy> orealis what you want to do with a programming language
<shevy> for me, ruby works very well for everything
<orealis> I have no idea atm..I'm fluent in 7 languages, none of them are programming ones.. need a change..
<orealis> lets just make an idea
<orealis> that..
<orealis> i want to make a small basic fractal frame renderer
<shevy> I write things down in todo lists. while I never get to finish anything, it helps create projects
<orealis> would ruby work for that at all?
<shevy> well, see. yeah it would. but a renderer sounds as if you are concerned about speed
<shevy> anyone who cares for speed should use languages like C
<orealis> waz afraid of that..
<orealis> i mean I used to write it in pure asm.. back when I was a kid
<orealis> but then I passed 30
<bnagy> well you can inline the fractal bits
<orealis> and most of my brainpower vanished
<shevy> orealis my brainpower goes away too
<orealis> so I was sorta dingling between C# and Ruby
<shevy> i make up for that by writing only simple code
nirakara has quit [Quit: This computer has gone to sleep]
lateau has joined #ruby
<orealis> so basically.. ruby is capable but slow?
<bnagy> C# is kind of OK if you want to marray microsoft
<orealis> kinda dont.. thats the problem
<bnagy> *marry
<shevy> orealis ruby is great. I use it since almost 8 years. if you need speed though, dont use ruby.
<orealis> so its great but slow..
<bnagy> or use C libs under the hood :)
<shevy> do you need the speed?
<orealis> not for learning of course
<shevy> hehe
<orealis> but if I ever become competent at ruby
<orealis> thenI might wanna do stuff that needs speed..
<shevy> well ruby is fairly easy to learn, once it makes "click" for you
<orealis> or.. wishes for speed at least..
<shevy> to grok ruby you have to understand the thinking philosophy
jcromartie has joined #ruby
<shevy> it is like a simplified, instructive and creative kind of english
<orealis> KISS?
<shevy> I dont use that term
<orealis> but you know what it means?
<shevy> but simplicity is a good thing
<shevy> yeah
<orealis> ya...
<shevy> ruby is also terse and succint
sbanwart has joined #ruby
<shevy> that can be confusing when you look at other people's code
<shevy> I still find it hard to understand other people's ruby code
nirakara has joined #ruby
<jackiechan0> shevy> maybe i'm not that brilliant but this 99 bottle exercize makes me crazy, could i have a hint ?
<bnagy> jackiechan0: what do you have so far?
<jackiechan0> bnagy> i'm studying the Chris Pine book and i'm stuck to the 99 bottles exercize, i know that i can find tos of solutions over internet but i would like and hint to reach the solution by myself
<bnagy> orealis: don't get the idea that ruby isn't a 'real' language, btw. With careful use of other code it's 'fast enough' for just about anything
<bnagy> jackiechan0: yeah, and I asked what code you had written so far. Also I have no idea what the exercise is, but I can guess. :)
schaerli has joined #ruby
<shevy> jackiechan0, use pastie.org upload your current code
mengu has quit [Remote host closed the connection]
<jackiechan0> bnagy> ok ok tnx shevy
<orealis> ya.. and it's not as if I expect I'll ever get any good at it.. just figured id check up ahead..
<bnagy> orealis: but for rapid graphics stuff, you kind of picked on the weak point of most of the interpreted languages
<orealis> ya.. you kinda need to write it at the bottom level for it to be truly fast
<shevy> orealis, if brilliance does not work for you, hard work or writing [insert language here] code every day still brings everyone forward steadily. slowly perhaps, but steadily :)
lateau has quit [Ping timeout: 245 seconds]
<shevy> you could hack on menuetOS if you still wanna write assembler code
<shevy> and port ruby to it :P
<orealis> I mean.. I "remember the good old days" of making vector tables and rasterbars and other crap in asm on amiga.. but that was the good old days..
<orealis> back when I had a functioning head
<orealis> and could sit up all night
<orealis> I still sit up all night.. tho
<jackiechan0> shevy> bnagy http://codepad.org/RuHIpqxq
<jackiechan0> shevy> sorry for italian but makes the program much familiar to me bnagy
<shevy> orealis I can barely sit up all night
<shevy> these days when my body says it is tired, I go to bed
weasels has joined #ruby
<orealis> I'm 36 and sick so I'm at home most of the time.. hence I sleep when I want to.. and stay up all night if I want to
<shevy> jackiechan0 you dont use any conditional checks in that code
<jackiechan0> i know that i have to set a loop but i dunno why
<becom33> why only the last value pp from array ? https://gist.github.com/2757747 is it beacuse it creates a array everytime I call the method ?
<bnagy> jackiechan0: yeah you're gonna want a loop of some kind :)
ermines has quit [Read error: Connection reset by peer]
<shevy> orealis, k sickness is a problem, luckily I am not really sick. though I am nowhere near as close to the physical condition I was at ~18 either :(
<orealis> so.. I use windows (yes you can b00 at me now)... should I just use that Ruby Installer thing then?
<shevy> jackiechan0 the problem is, it is not only that you are missing a loop
<shevy> jackiechan0, the problem is you are missing EVERYTHING that makes a programming language here ;)
<orealis> shevy, i take a lot of meds that doesnt promote sleeping so.. yay..
kapowaz has joined #ruby
<apeiros_> becom33: pp prints the whole array. and yes, because you reset it to an empty array everytime on input
<jackiechan0> shevy> I should set a loop for having this text https://www.privatepaste.com/dac91b457a
<shevy> jackiechan0, a loop in ruby can be done via loop {}
<jackiechan0> shevy> !!!:)
<becom33> apeiros_, how can I fix it ?
<bnagy> becom33: you clear the cmd array every time you call input
<shevy> orealis the ruby installer should work ok
<apeiros_> becom33: initialize is an instance method, but input/output are class methods. those are different objects
<jackiechan0> shevy> i'm at the chapter 7 of the Chris Pine book and he didn't told that
<bnagy> woops, my internet is too slow :)
<shevy> orealis windows is a bit annoying and has some quirks when it comes to ruby. but if you manage to make irb run, then all should work fine
<orealis> guess ill hafta check if that installer does eclipse as well
<apeiros_> becom33: and hence have different instance variables. that's why your initialize didn't work.
<shevy> ewwww
<apeiros_> becom33: why do you have input/output as class methods
<shevy> eclipse man
<orealis> oh.. whats bettar?
<shevy> orealis, that is part of the problem. in ruby you dont need any IDE. you only need 5% of your brain
nari has joined #ruby
<orealis> but some syntax highlight would be nice at least..
<becom33> apeiros_, how would i have them them then >
<shevy> orealis I use bluefish 1.0.7 it has no specific ruby feature at all. I only use it because of the default syntax highlighting :)
pullphing has left #ruby [#ruby]
<shevy> they changed it in 2.2.x though, and changed a few widgets. I hate the new bluefish...
<orealis> I feel like I should learn java now..
<shevy> eww
<shevy> if verbosity is your thing, sure
<apeiros_> becom33: as instance methods
<shevy> you can combine ruby with java though. JRuby
<shevy> jackiechan0 well
<shevy> jackiechan0 I skipped the exercise when I read that book
<shevy> :)
<apeiros_> becom33: http://pastie.org/3939541 as an example
<jackiechan0> shevy> it was too easy for you ?
<orealis> its like a problem because my two .. "helplines" are opposed.... one is an awesome java programmer who loves ruby.. the other one is an awesome VC programmer who loves Java..
<shevy> jackiechan0 the FIRST thing you have to do is - "How can I split this problem into smaller problems"
<shevy> jackiechan0, no. I was way too lazy to do exercises when I cant see the solution to them ever
<jackiechan0> shevy> i know that using what is wrote on the next chapter i'll be able to do that, but i want to do that with what i have got from the first 7 chapter of the book
<jackiechan0> shevy> split
<jackiechan0> shevy> ok
<shevy> jackiechan0, yeah. smaller problems.
<jackiechan0> shevy> as you saw i splitted the problem in 2 adding much variable
<shevy> jackiechan0, what problem do you have to solve next with the 99 bottles
<shevy> ok good
<jackiechan0> shevy> but of course writing all the lines of the song isn't th solution
<shevy> so you have two variables
<jackiechan0> shevy> ok
<shevy> var1= 99 and var2= 1
<jackiechan0> shevy> 2 variable , yes i decided that two variables
<jackiechan0> shevy> i have the third that is the var1 - va2
<shevy> one solution . 99.downto(1)
<shevy> var1.downto(var2)
<jackiechan0> shevy> never heard .downto until this chapter
<shevy> 99.downto(1).each {|x| puts x }
<shevy> jackiechan0, well then he put a silly exercise up
<jackiechan0> shevy> too advanced, wait i'll watch the solution on the Chris Pine book
<shevy> I told you, I skipped the exercise
<shevy> it is not that advanced
<shevy> it is almost pure english
<shevy> like a COUNTDOWN
<shevy> do you know what a countdown is!
<shevy> when the rocket is launched
<shevy> 10
<shevy> 9
<shevy> 8
<shevy> !!!!
<shevy> and when we reached 0
<shevy> it all explodes
<shevy> :(
<orealis> red rocket red rocket..
<bnagy> jackiechan0: loops are covered in chapter 6, it seems
<shevy> ohhh
<bnagy> looks like you need to pay more attention
<jackiechan0> bnagy> yeah
<shevy> so he skipped chapter 6
<shevy> bad jackiechan0 bad
<shevy> no more youtube watching for your brain
<jackiechan0> shevy> bnagy no no i'm studying Chapter 6, the exercize is from chapter 6
<shevy> btw is Chris Pine still coding in ruby?
<jackiechan0> here is the solution https://www.privatepaste.com/e353610508
<bnagy> yeah, which is after he explains loops :)
<shevy> there is a section called "Looping"
<shevy> while command != 'bye'
<bnagy> that's a horrible solution
<shevy> although i find it ugly
<jackiechan0> shevy> i'm right there
<shevy> at least it is a loop, so you must have seen it or?
<jackiechan0> shevy> i had some problem to understand it
jimeh2 has joined #ruby
<jackiechan0> shevy> that's the reason cos i wasn't able to do the exercize, so now i'll try to understand from the exercize solution
<shevy> while [CONDITION_HERE]
<shevy> but as I wrote, loop {} looks much nicer to the eyes
<shevy> it's not equivalent to while, you have to maintain your own logic inside
<shevy> but I really like it more
<bnagy> yeah, for some reason I mostly write loop with an internal break
<shevy> oh jackiechan0 bnagy is right, the solution also shows that you still have one problem
<shevy> you don't seem to indent!
<bnagy> but this problem literally cries out for downto
<shevy> jackiechan0, we train this now. your next task must be: indent
xhh has joined #ruby
<jackiechan0> shevy> ok
lxsameer has quit [Quit: Leaving]
<shevy> then you will also notice missing ends
codebeaker has quit [Quit: codebeaker]
<shevy> jackiechan0 ruby requires to close your conditionals properly
<shevy> if foo
<shevy> end
<jackiechan0> shevy> of can i enable on Gedit auto end ?? for example when i write if or while ?
<shevy> while bla
<shevy> end
<shevy> dunno gedit
<jackiechan0> shevy> what do u use to write ruby?
<shevy> bluefish 1.0.7 still. but eventually I need to find something else
cha1tanya has quit [Quit: Leaving]
<shevy> everyone will be on gtk3 :(
<banisterfiend> shevy: wtf is bluefish
<shevy> banisterfiend a HTML editor!
<bnagy> one of shevy's little eccentricities
<shevy> :)
<banisterfiend> shevy: u write ruby code in an html editor?
<bnagy> like compiling from source
adambeynon has quit [Quit: adambeynon]
<shevy> yeah banisterfiend
<shevy> sometimes in vim too
<banisterfiend> shevy: you're a strange dude, im going to call the cops and have u hauled away
Morkel has quit [Quit: Morkel]
<shevy> I hate gvim though
jimeh2 has quit [Ping timeout: 246 seconds]
<shevy> well, if bluefish is kinda dead, I will probably try to use sublime
<shevy> the default highlighting is ok
<banisterfiend> bnagy: did u see the pry post on hackernews got to 110 points
jwbuurlage has joined #ruby
<shevy> geany has default shit highlighting for ruby :(
<banisterfiend> bnagy: are you proud of me, naggy
<tresk> HI I installed ruby 1.9.2 but when I start "bundle install" I only find the old 1.9.1 folder installed
<bnagy> banisterfiend: don't read hackernews
<tresk> Any Idea what went wrong?
<shevy> gems are kinda excessive... http://pastie.org/3939576
<shevy> tresk dunno. can you get rid of the old folder?
<shevy> it may store that old information somewhere... is that on windows?
fflush has joined #ruby
nari has quit [Ping timeout: 252 seconds]
<tresk> shevy: yes. should I also uninstallthe deb pacvkages of the old 1.9.1, too?
<shevy> ah debian?
<shevy> I think both may actually use 1.9.1/ directory
<shevy> it's not easy to make debian play together nicely with ruby
<tresk> shevy: oh, I thought debian may the best os for that... but anyway I can't change it now
<Hanmac> my ubuntu has no problem with that
berserkr has joined #ruby
<shevy> tresk yeah listen to Hanmac, he knows those things well
<shevy> is "bundle" from "bundler"?
<deryldoucette> the gem is called bundler. the command is actually bundle
<tresk> Hanmac: I have to install it on a vpc environment I can't change the OS, unfortuately
<Hanmac> tresk debian and ubuntu use 1.9.1 folder for 1.9.2 and 1.9.3 too
lateau has joined #ruby
<shevy> deryldoucette ah I see
<deryldoucette> they all use 1.9.1 directories
<deryldoucette> its to indicate abi compatibility versioning from what i was told in here before
<deryldoucette> thats why you see like lib/ruby/1.9.1/ ect
<tresk> Hanmac: Just to make my situation clear: I installed the 1.9.1 version via apt and installed the 1.9.2 via wget. Al went well so far.
moshee has quit [Ping timeout: 265 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
<deryldoucette> you're going to cause such problems for yourself letting non-packages overwrite packages.
<deryldoucette> really wish people understood how their package managers worked before doing things like this.
<tresk> deryldoucette: That's the reason why I explain it, bcause I think that was fundamentally wrong
<deryldoucette> just a single core same-named lib gets deleted, then BOTH installs are fucked
<Hanmac> tresk whats the version shown with "dpkg -s ruby1.9.1" ?
kil0byte has joined #ruby
<tresk> Hanmac: Hmm, the package seams not to beinstalled?°!
dnyy has quit [Remote host closed the connection]
<deryldoucette> tresk: if you want multiple versions sanely (and not have to package manage) then use rvm to manage multiple ruby installs. not to mention that debian, ubuntu, and a slew of others chop ruby up needlessly into upteen packages for no real gain except in complexity unless you'r win an embedded environment.
<Hanmac> debian can manage multipble versions installed too, but only they own installed
<deryldoucette> ruby, ri, rdoc, rib, etc.. its insane how many packages they make out of it
<banisterfiend> deryldoucette: what's rib
<shevy> Hanmac, how do they manage multiple versions?
<deryldoucette> s/rib/irb/
<Hanmac> update-alternatives
<shevy> specifically of libraries
dhaskew_ has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
<deryldoucette> banisterfiend: my spellchecker trying to be 'helpful'
<banisterfiend> deryldoucette: haha ok
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
<banisterfiend> deryldoucette: cos there is actually an irb-alternative called 'rib'
<deryldoucette> Hanmac: and they chop ruby up into little pieces galore and their do it be installing ruby1.8 ruby1.9 and then symlinking, and you can't easily switch between versions
<deryldoucette> banisterfiend: ahh didn't know that actually!
<deryldoucette> s/their do it be/they do it by/
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
<Hanmac> deryldoucette: you can with update-alternatives --config ruby
<tresk> I'm confused as I browse through my aptitude
<shevy> tresk, the thing is that the debian guys need to know how users are supposed to install that
<tresk> I can find a 1.9.3 package now?!
<Hanmac> tresk whats your debian version ?
<shevy> they designed these programs, they need to tell people how to use it
<tresk> and 1.9.1 isn't installed... Oh,I guess, I have a mess or going to have one
<tresk> Squeeze
<shevy> surely you can use dpkg to remove old versions before installing a new version
lateau has quit [Ping timeout: 245 seconds]
<deryldoucette> Hanmac: I was a debian package maintainer. I'm familiar with the steps. and thats only half the steps involved. Doing rvm use 1.9.3-p125 or rvm use 1.9.2 is much easier and faster than the entirety of update-alternatives
<Hanmac> tresk: so what does " apt-show-versions ruby1.9.1-full" shows you?
<tresk> OK, step by step, shoudl I remove the manually installed version somehow?
<shevy> I would remove all of ruby actually, then start anew
<deryldoucette> tresk: you're going to find the 1.9.1 directory as i said because the directory is still used to denote version compatability
nari has joined #ruby
<deryldoucette> as for the manual version, see in the Makefile if it has a make uninstall
<deryldoucette> some do some don't
quesada__ is now known as urlwolf
<deryldoucette> if it doesn't then you would have to rerun the make install and track what files it installs and where
<Hanmac> tresk if you want ruby1.9.3 as package you need wheezy or sid
<deryldoucette> then manually delete them yourselves
<tresk> ok I begin withuninstalling the manuall thingy first
<deryldoucette> nothing like telling someone to mix unstable packages into their stable packages tree (which is really the only reason you run Debian in the first place)
<deryldoucette> otherwise you;'d be running ubuntu or debian testing
<tresk> btw aptitude shows me an installed version ruby1.9.2 and rubygems1.9.1 ... maybe rubygems has to be version 1.9.2 too?
azm has quit [Ping timeout: 250 seconds]
<shevy> debian squeeze does not allow ruby 1.9.3?
<shevy> what kind of crap is that...
<shevy> tresk, the debian guys are idiots.
<Hanmac> squeeze has only 1.9.2.0-2 as package
berserkr has quit [Quit: Leaving.]
<shevy> latest ruby .tar.bz2 release has version 1.8.23
<shevy> if debian comes up with "rubygems1.9.1" then it perhaps is the rubygems version bundled into default ruby 1.9.1
<shevy> dunno what that version is, but it's quite old
jcromartie has quit [Quit: jcromartie]
ananthakumaran has joined #ruby
<shevy> tresk you can do "gem --version" though
<shevy> hmm
<shevy> or do they name rubygems1.9.1 even when one has installed ruby1.9.2 ???
<tresk> that shows me a 1.3.7 .... argh, what a mess here :(
<shevy> ok that is very old
<deryldoucette> tresk: the best way for both box stability and your sanity is to either install the ruby you require, manually, under /usr/local using --prefix when you build it, or using rvm or rbenv and installing either under /usr/local as well or into $HOME and managing the ruby installs yourself. Debian makes a complete fucking mess of ruby as shevy has been trying to make you aware
<tresk> but in aptitude it shows me rubygems package of 1.8 and 1.9.1 as installed... I have to revert evreything
<shevy> yeah debian is making things more complicated than it ought to be
<banisterfiend> deryldoucette: is this your church? http://en.wikipedia.org/wiki/St._Priapus_Church
cousine has joined #ruby
<deryldoucette> basically just go back and uninstall all ruby*, rib*, rubygems*, rdoc*, and ri-* packages and then work with one of the community's ruby managers
ananthakumaran1 has quit [Ping timeout: 252 seconds]
<deryldoucette> banisterfiend: I'm not a christian so the answer would be no
<shevy> Hanmac probably knows how to install a fresh ruby from zero on debian
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
<deryldoucette> banisterfiend: I believe in Science, not some unseeable vengeful believe-in-me-or-die I-have-all-power-but-wont-use-them-to-end-suffering deity
<shevy> :)
<shevy> at least science tries to actively find answers that can be checked
<deryldoucette> or a more aptly put, I don't believe win a zombie, want to eat his flesh, or beg his forgiveness for my sins which only HE says are sins
<shevy> (usually)
<banisterfiend> deryldoucette: i dont think u read the page :P read it
amalvagomes has joined #ruby
<deryldoucette> s/win/in/
<deryldoucette> banisterfiend: since I'm not homosexual, also, the answer would STILL be no
<banisterfiend> deryldoucette: hehe
<shevy> it usually works only once or twice
<shevy> then people get scared of banister's links
jimeh2 has joined #ruby
<deryldoucette> i see why
<shevy> hehehe
<shevy> banisterfiend, did you scare RubyPanther too with links?
<banisterfiend> shevy: i dont think so
<deryldoucette> oh i think we did that enough to him in #rubyonrails :)
<shevy> he hasnt said anything in like 5 weeks...
<deryldoucette> banister would just had been the icing on the cake
<shevy> been fun there on #ruby-lang
<deryldoucette> he's pissed enough of us off we ganged up on him, everything from linkage to commentaries :)
<shevy> but people who get banned, cant talk back anymore, so it gets boring again :(
<shevy> hehehe
<deryldoucette> oh he's not banned. least not in #rubyonrails
<deryldoucette> can't talk for #ruby-lang
<shevy> yeah but on #ruby-lang
<shevy> #ruby is like 50% banned there ... :P
human_bot is now known as upasna
<shevy> I am considering going the same route simply out of solidarity with them
<deryldoucette> ahh. see i like on free node that you can perm quiet someone rather than ban. then at least they can still get some education from the channel even if they can't be pedantic assholes to the channel :)
<tresk> ok no un/deinstall scripts available, so I install it again an show where it puts all the files
<deryldoucette> s/free node/freenode/ thank you again spellchecker for helping me. NOT
ZachBeta has joined #ruby
nari has quit [Ping timeout: 244 seconds]
<deryldoucette> tresk: yeah. though i'm truly surprised that ruby doesn't have a make uninstall portion to their Makefile
<shevy> tresk it really should be trivial
<tresk> deryldoucette: maybe they detect it's Debian and rm it first *g
<deryldoucette> didn't notice that myself since i use RVM to manage my installs
schaerli has quit [Read error: Operation timed out]
<deryldoucette> tresk: hehehe
<shevy> tresk if you used --prefix then you know where it was installed. otherwise, it defaults to /usr/local so have a look there
<deryldoucette> shevy: it *does*? i thought it defaulted to /usr tree
<shevy> deryldoucette when he does compile from source without any specific prefix, than it will default to /usr/local always. it's part of the FHS too, in that /usr prefix is reserved for "system install", or whatever word they used
<deryldoucette> shevy: Right. I know FHS2.x specifies that. and that debian and most distributions follow that. I didn't realize that ruby honoured the FHS since its a cross platform
<deryldoucette> and OS boundary i think is what they call it (OS vs userland)
banisterfiend is now known as banisterfiend`
<shevy> hmm there is a FHS2?
<deryldoucette> has been for quite some time
<deryldoucette> think its at version 2.3
tar_ has joined #ruby
<deryldoucette> hehe yeah
<deryldoucette> sorry, was off googling the link. i see you got there before i did lol
<shevy> the FHS is kinda fuzzy
<deryldoucette> supposed to be
<shevy> "Large software packages must not use a direct subdirectory under the /usr hierarchy."
<shevy> from reading this, can you tell me what qualifies as a "large software package" and what does not?
<deryldoucette> right
<deryldoucette> KDE, emacs, rubymine, etc
<shevy> deryldoucette yeah, I googled for 2.x because I was curious if the FHS would bring in new ideas
<shevy> but it's kinda still the same strange thing...
lateau has joined #ruby
<deryldoucette> and I have problems with that wording as well because it intimates that non-OS packages that are small can be installed under /usr which is dead wrong
<shevy> one of the coolest things is... here is the standard, follow it.
<shevy> and then:
<shevy> "An exception is made for the X Window System because of considerable precedent and widely-accepted practice."
<shevy> and then we name exceptions! ;)
<shevy> that's like saying "if people dont follow it anyone, do whatever you want..."
<shevy> *anyway
<deryldoucette> ahh yeah, now that I'm ok with. they NAME the exceptions! :) rather than leaving it open to interpretation
<shevy> hehe
<shevy> hmm
<shevy> could RVM be used for every software?
<deryldoucette> well, because this isn't an RFC, its a standards definition. they don't HAVe to follow it, however, not doing so can result in serious breakage. But then again not following conventions has been known to cause serious breakage even in the ruby and rails communities
<shevy> like ... install several libcurl versions with RVM
<deryldoucette> yes
<shevy> cool
<deryldoucette> you'd have to adapt the core of course, but yes, it could
<deryldoucette> i've been toying with that in my head for the last year :)
<shevy> kinda cool. one could almost turn this into a package manager of some sorts
<shevy> hmm I think I am going to install RVM
<deryldoucette> yep. except for the fact that it doesn't really do security management, and I'm really not willing to put in security aspects beyond the md5sum checks, the .rvmrc md5 creation/management etc.
macer1 has quit [Ping timeout: 265 seconds]
<shevy> yeah
<tresk> hmm make install the 1.9.2 seams to install itself in the 1.9.1 as said before: http://paste.ubuntu.com/997287/
<shevy> well, perhaps it could be optional plugins eventually. I'll just need to go about that slowly, my brain gets confused when it has to learn too many new things quickly
<deryldoucette> i already have a problem with mpapis adding the .ruby-version, .versions.conf file additions because they bypass the security system in rvm (unless .rvmrc exists as well. .rvmrc *always* trumps and *always* triggers the security system) but I also understand the compatibility reasoning behind his move.
<shevy> tresk that is an odd path
<shevy> tresk I would usually assume that debian ruby will use /usr/lib instead
<shevy> tresk, are you 100% sure that you only have /usr/local/lib/ruby/ and not /usr/lib/ruby/ as well?
<deryldoucette> well, don't pick rvm1 apart too much, rvm2 will be based on wayne's SMF (https://smf.sh/) which will make RVM truly modular
nari has joined #ruby
cousine_ has joined #ruby
<deryldoucette> yeah debian's ruby packages install under /usr/ not /usr/local
<shevy> deryldoucette hmm. I think initially, I am just going to slowly test commands with RVM, and write these things down slowly in a local page
<deryldoucette> they do honour the splitting
<shevy> and once I done that, would I consider looking at the internals... but not before
<deryldoucette> shevy: test what commands?
<shevy> I really *am* slow :)
<shevy> deryldoucette, all RVM related commands
<shevy> rvm use ...
<shevy> rvm ... hmm
<shevy> that's about the only thing I know hehe
<deryldoucette> see my rvm-test which is now part of rvm. its our testing framework. comment based testing (for now, until I finish testrunner)
<deryldoucette> github.com/wayneeseguin/rvm-test
<shevy> this tests all of the RVM commands?
<tresk> shevy: yes youare right this folder exists too :(
<deryldoucette> his repo is the definitive. i trashed my personal repo, bequeathed all rights to it to him, and am working on testrunner to make full suites of tests.
<deryldoucette> shevy: its used TO test them yes
lateau has quit [Ping timeout: 248 seconds]
<deryldoucette> we use rvm-test to test rvm with via travis before everything is pushed out
cousine has quit [Ping timeout: 246 seconds]
<shevy> tresk well that is actually good, because now you know that whatever you installed, will be under /usr/local
<shevy> tresk, so you could get rid of that with good old rm
<shevy> :)
<tresk> hehe, I go through it now ,)
fflush has quit [Ping timeout: 265 seconds]
<deryldoucette> bbiaf. need a cig
<tresk> firstI uninstall it via aptitde and then rm ,)
<shevy> the /usr/local/lib/ruby/ should be killed and also /usr/local/bin/ruby* (and irb there too)
<shevy> or
<shevy> if you dont need /usr/local
<shevy> you could remove it simply hehe
<shevy> if a new program is compiled into /usr/local prefix, that directory will be created again
schaerli has joined #ruby
<shevy> since /usr/local is local to the local superuser (or whoever else gets permissions to work in /usr/local hierarchy), the whole system will always work
<shevy> as nothing system critical is installed there by default
<shevy> the most important things usually end up in /bin and /sbin, then /usr/bin
ZachBeta has quit [Read error: Connection reset by peer]
arturaz has quit [Remote host closed the connection]
ZachBeta has joined #ruby
moshee has quit [Ping timeout: 248 seconds]
moshee has joined #ruby
nirakara has quit [Quit: This computer has gone to sleep]
ZachBeta has quit [Read error: Connection reset by peer]
arturaz has joined #ruby
ZachBeta has joined #ruby
schaerli has quit [Remote host closed the connection]
ananthakumaran has quit [Ping timeout: 244 seconds]
techhelp has joined #ruby
ananthakumaran has joined #ruby
seanstickle has joined #ruby
wvms has left #ruby [#ruby]
rushed has quit [Quit: rushed]
Eldariof27-ru has joined #ruby
schaerli has joined #ruby
heftig_ has joined #ruby
lateau has joined #ruby
macer1 has joined #ruby
<tresk> so I purged evrything I could find related to ruby via aptitude. NOw yourecommend I install rvm and install ruby that way?
<seanstickle> Yes
Eldariof59-ru has quit [Read error: Operation timed out]
kil0byte_ has joined #ruby
lkba has quit [Ping timeout: 252 seconds]
heftig has quit [Ping timeout: 265 seconds]
drmegahertz has quit [Ping timeout: 240 seconds]
kil0byte has quit [Ping timeout: 248 seconds]
TheHunter_1039 has joined #ruby
lateau has quit [Ping timeout: 245 seconds]
ermines has joined #ruby
jackiechan0 has quit [Quit: Sto andando via]
pen has joined #ruby
cousine_ has quit [Remote host closed the connection]
weasels has quit [Read error: Connection reset by peer]
adambeynon has joined #ruby
mcwise has joined #ruby
Kwpolska_ is now known as Kwpolska
D3V1Lx has joined #ruby
<tresk> takes some time to compile rvm ,)
<tresk> It's installing the latest ruby deps by default? nice...
nari_ has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<tresk> and as I understand it I can switch between different installed ruby versions by using rvm, that's very helpfull, I like it ,)
<deryldoucette> just make absolutely sure you read all of the sub-menus under rvm.io/rvm/ BEFORE you attempt the install
<deryldoucette> there are prerequisites, and things you need to do after the install as well. (BE SURE to read 'rvm requirements' once its installed and working BEFORE you install any rubies)
<tresk> I read the doc which is shown while the rvm install process and I installed the missing libs
nari has quit [Ping timeout: 245 seconds]
* deryldoucette drives me nuts when people half ass the installs and don't read the site and/or the help system.
altiouz has quit [Ping timeout: 256 seconds]
<deryldoucette> bit.ly/rvm-help-intro
cousine has joined #ruby
looopy has quit [Remote host closed the connection]
niklasb has joined #ruby
pen has quit [Remote host closed the connection]
<deryldoucette> ok, time to walk the pooch :)
macer1 has quit [Read error: No route to host]
ayumin has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
koobs has left #ruby [#ruby]
xhh has quit [Quit: xhh]
ZachBeta has joined #ruby
<tresk> deryldoucette: It's a bit wired if they have a doc while the install process and they don't refer to the webpage again, just in casse you miss something. but thanks I'm on it
lateau has joined #ruby
keanehsiao has joined #ruby
keanehsiao_ has joined #ruby
<keanehsiao_> hihi.
<keanehsiao_> anybody use eventmachine?
<keanehsiao_> if yes… any suggestion with : Assertion failed: (nbytes > 0), function _WriteOutboundData, file ed.cpp, line 1007.
<keanehsiao_> Abort trap: 6
batmanian has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
sie has joined #ruby
<sie> Any idea why one would frown upon class << self; def in favor of def self.?
fr0gprince_mac has joined #ruby
<banisterfiend`> sie: def self. can look cleaner
<shevy> sie I think def self.foo is easier to read
<sie> But if my class has singleton methods only?
<banisterfiend`> sie: i only resort to class << self when i need to
sbanwart has quit [Ping timeout: 240 seconds]
<banisterfiend`> sie: then you could use class << self, there's really no hard and fast rules on this.
<shevy> sie well, if you have like some hundred methods then you would have to type less via class << self
<Hanmac> sie then you should use moduele
<sie> Hanmac, hmm, right.
wmoxam has joined #ruby
<Hanmac> sie, if you use module, then module_function could suid you
mcwise has left #ruby ["I quit"]
<keanehsiao_> anybody use event machine ? if yes… any suggestion with : Assertion failed: (nbytes > 0), function _WriteOutboundData, file ed.cpp, line 1007. Abort trap: 6
jackiechan0 has joined #ruby
<jackiechan0> hey there
<jackiechan0> could someone give me an help about variables reassignment at the end of this chapter http://pine.fm/LearnToProgram/?Chapter=03
lateau has quit [Ping timeout: 272 seconds]
<Hanmac> jackiechan0 what is your problem?
<Hanmac> ruby does not have an assignment operator, so you changed the variable with the reassignment
<sie> How do I call def f from module A?
<jackiechan0> Hanmac> i don't understand why var2 at the end of the chapter that i paste is always pointing to number 8
<jackiechan0> Hanmac> sorry it's my 2nd day studying rub
<jackiechan0> y
ananthakumaran has left #ruby [#ruby]
<Hanmac> var1 = 8; var2 = var1; #>>> both variables point to the same object(reference)
gtuckerkellogg has joined #ruby
<Hanmac> var1 = 'eight' # the var1 is changed, but var2 still points to the same objectreference as before
schaerli has quit [Remote host closed the connection]
cousine has quit [Remote host closed the connection]
<Hanmac> jackiechan0 look at the text under the code lines and you will see
<jackiechan0> Hanmac> Yes i go this, this means that once var2 is pointing to a string or a number (as in that case) also indirectly, it will point alway to that aswell it's not specified to point to another string or number? (anyway i'm trying some experiments=)
<jackiechan0> hackeron> *I got
deobald__ has quit [Ping timeout: 260 seconds]
icrazyhack has quit [Quit: http://www.cnblogs.com/crazyhack]
kirun has joined #ruby
<shevy> jackiechan0 numbers are implemented differently
<shevy> jackiechan0, see:
<shevy> "foo".object_id # => 70320365068120
<shevy> "foo".object_id # => 70320365062760
<shevy> 5.object_id # => 11
<shevy> 5.object_id # => 11
digitalcakestudi has joined #ruby
<jackiechan0> shevy> about what i saw in my experience a variable that is pointing to another variable still point to the first variable assigmente until is not specified to point to another string or number
<shevy> but yeah, when you assign from variable to variable
altiouz has joined #ruby
<jackiechan0> shevy> is that correct ?
<banisterfiend`> jackiechan0: can u say shevy: instead of shevy>
<banisterfiend`> jackiechan0: the > is kind of jarring
<shevy> jackiechan0 the : is cooler than the >
<shevy> jackiechan0, what IRC client do you use?
<jackiechan0> banisterfiend` sorry i will change > with : in my xchat options
<shevy> wheee
<shevy> xchat! I use xchat too
<jackiechan0> shevy i did change : to >
<shevy> jackiechan0 for strings yes
<jackiechan0> shevy my error
<jackiechan0> shevy: :)
<shevy> jackiechan0 x = "foo" # => "foo"; y = x # => "foo"; x = "bar" # => "bar"; y # => "foo"
<shevy> I think I managed to confuse myself
<jackiechan0> shevy: i'm confused too
<shevy> yeah
<shevy> I need to get out here for a while, it's getting too hot
elkng has quit [Ping timeout: 240 seconds]
<jackiechan0> shevy: are u working if i can ask
kyktommy has joined #ruby
virunga has joined #ruby
<keanehsiao_> anybody use event machine ? if yes… any suggestion with : Assertion failed: (nbytes > 0), function _WriteOutboundData, file ed.cpp, line 1007. Abort trap: 6
jwbuurlage has quit [Quit: jwbuurlage]
relix has joined #ruby
vitoravelino`afk is now known as vitoravelino
elkng has joined #ruby
cordoval has joined #ruby
ayumin has quit [Remote host closed the connection]
Morkel has joined #ruby
jrist-afk has quit [Ping timeout: 245 seconds]
yannis has joined #ruby
D3V1Lx has quit [Quit: Few women admit their age. Few men act theirs.]
lateau has joined #ruby
kil0byte_ has quit [Read error: Operation timed out]
Shoobdidoo has joined #ruby
jwbuurlage has joined #ruby
kil0byte has joined #ruby
tomb_ has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
Shoobdidoo has quit [Client Quit]
td123 has joined #ruby
cousine has joined #ruby
cousine has quit [Remote host closed the connection]
lateau has quit [Ping timeout: 245 seconds]
Morkel has quit [Quit: Morkel]
cousine has joined #ruby
jrist-afk has joined #ruby
arturaz has quit [Ping timeout: 244 seconds]
gtuckerkellogg has joined #ruby
niku4i has joined #ruby
thone_ has quit [Read error: Connection reset by peer]
thone has joined #ruby
hadronzoo has joined #ruby
Jake232 has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
heftig_ has quit [Quit: leaving]
cousine_ has joined #ruby
Axsuul has quit [Ping timeout: 245 seconds]
heftig has joined #ruby
mneorr has quit [Remote host closed the connection]
schaerli has joined #ruby
ZachBeta has joined #ruby
<tresk> Hmm I installed Ruby 1.9.3 now but do I need to use 'bundle install' anymore or should I install this via rvm?
tomb_ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<tresk> because if I use bundle it only installs version 1.9.1 folder
<apeiros_> bundler and rvm serve entirely different purposes
<apeiros_> (with the only intersection of gemsets)
cousine has quit [Ping timeout: 246 seconds]
Targen_ has quit [Ping timeout: 276 seconds]
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
Chryson has joined #ruby
kil0byte has quit [Remote host closed the connection]
<tresk> and the gemsets are the problem I have
berserkr has joined #ruby
remmy444 has quit [Ping timeout: 244 seconds]
jmaister has quit [Quit: Lost terminal]
batmanian has joined #ruby
batmanian has quit [Client Quit]
<tresk> I try to install gitlab https://github.com/gitlabhq/gitlabhq/blob/stable/doc/installation.md and I'm struck at 'Install gems' and I always get this http://paste.ubuntu.com/997467/ ... ruby -v shows me that ruby 1.9.3 is installed but it seems to me that 'Install gems' only downloads the 1.9.1 gems ...
tk___ has quit [Quit: ばいばい]
<tresk> I'm lost. I don't know what's going wrong here :(
lateau has joined #ruby
ZachBeta has quit [Read error: Connection reset by peer]
indian has joined #ruby
indian has quit [Changing host]
indian has joined #ruby
ZachBeta has joined #ruby
_2easy has joined #ruby
<eam> anyone here familiar with ffi?
Jrz has joined #ruby
yannis has quit [Quit: yannis]
<eam> my FFI::MemoryPointer objects are returning invalid pointers from get_pointer(0)
<tresk> Do I have to use rvm to install the gems there or is there another eeason why I get this warning
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<burgestrand> eam: you’ll need to provide more context.
<burgestrand> Either that, or your pointers actually point to invalid pointers.
cousine_ has quit [Remote host closed the connection]
<eam> here's the entire script, ignore the boilerplate at the top https://gist.github.com/2758371
berserkr has quit [Quit: Leaving.]
lateau has quit [Ping timeout: 248 seconds]
<eam> from what I understand, pollfds should be a contiguous array of size struct pollfd[3]
<eam> and get_pointer(0) should return its start address
<tresk> ok I'm afk for a while
nari_ has quit [Ping timeout: 256 seconds]
<eam> burgestrand: when I run it, before I do anything at all I get: pointer is: #<FFI::Pointer address=(nil)>
emmanuelux has joined #ruby
<burgestrand> eam: for MemoryPointer.new, the first argument is the size and the second is the count, so you should not need to multiply the count by the size of the struct
<burgestrand> Should not be the cause of that weird pointer retrieval though
<eam> got it, thx -- but that shouldn't matter, it'd just allocate a bit more memory
<eam> yeah
<eam> (fixed btw)
<eam> I'm a little unclear on the syntax for addressing an array of structs with ffi -- found some assorted examples on lists
<eam> but the thing that confuses me most is that pollfds is nil right off the bat
<burgestrand> Well, I believe FFI clears the allocated memory, but that it shows nil instead of 0 confuses me
rippa has joined #ruby
<eam> well, I'm asking for the pointer, not the memory pointed to
<eam> that ought to be a valid addresss
<burgestrand> You’re assuming the contents of the memory at offset 0 is a pointer, while it’s a struct that’s currently zeroed out AFAIk
<burgestrand> Sorry, not assuming, getting :)
<eam> ah, maybe I'm not understanding the utility of get_pointer
mpereira has joined #ruby
cordoval has quit [Quit: The fear of the Lord is the beggining of wisdom]
<eam> how do I get a pointer to the memory structure?
<eam> I'm trying to model the struct pollfd fds[] for poll(2)
<burgestrand> eam: well, pollfds *is* a pointer to memory that can fit three structs, not three pointers to each struct
<eam> right
<eam> well, pollfds is a ruby VALUE
<eam> does ffi accept it directly for arguments that are type :pointer ?
<burgestrand> Yeah, but it has an address and as far as FFI goes it’s a pointer when passed as an argument
<burgestrand> Yes :)
<eam> oh great
<eam> easy!
yankov has joined #ruby
<burgestrand> So if you print it, you’ll see which address it points to
lateau has joined #ruby
<burgestrand> eam: get_pointer(N) is mostly useful when you have an array of pointers and extract them individually
<eam> burgestrand: yeah that was it -- ret = PollThing.poll(pollfds, pollfd_len, 4)
<eam> is all I needed
<burgestrand> Great \o/
<eam> I found get_pointer(0) in an example of arrays of structs, looks like that was misleading
<eam> thanks!
wmoxam has quit [Ping timeout: 248 seconds]
<eam> burgestrand: btw, maybe you know this -- does ruby's IO layer really not expose poll()
<eam> I dug around and could only find IO.select and eventmachine (which doesn't provide notifications, only an event framework)
<burgestrand> eam: no idea, sorry
<eam> I'm kinda wondering if I've overlooked something obvious
<eam> ok
<burgestrand> not that I know of, at least
<eam> thanks again!
<burgestrand> \o.
ZachBeta has quit [Quit: Computer has gone to sleep.]
andrewhl has joined #ruby
<fowl> burgestrand, if you read a file like x = open('...').read
lateau has quit [Ping timeout: 260 seconds]
<fowl> doesnt it stay open
<eam> fowl: oh, I know this one - it does
<fowl> that is what i figured
<fowl> i usually do open('...', &:read)
seanstickle has quit [Quit: Nihil sub sole novum]
<eam> if you attach a block it'll call close after the yield
Karmaon has quit [Quit: WeeChat 0.3.8-dev]
jayrulez has quit [Ping timeout: 248 seconds]
kenperkins has joined #ruby
Ontolog has joined #ruby
Karmaon has joined #ruby
<eam> that behavior surprised the heck out of me, coming from Perl -- got really used to deterministic reference counted gc
<burgestrand> Just use File.read instead, assuming you’re playing around with files
<fowl> open-uri actually
<burgestrand> Opening URIs should not need to be closed. It returns a StringIO, no?
<burgestrand> Hm, I also wonder what happens to open file handles on GC. I’d expect ruby to close them, but maybe not…
<burgestrand> (doesn’t hurt closing a StringIO if you want to be sure, btw)
bluenemo has quit [Remote host closed the connection]
alexim has joined #ruby
<fowl> no burgestrand you get Tempfiles
<burgestrand> Oh, sweet
<fowl> [13] pry(main)> open('http://google.com')
<fowl> => #<File:C:/Users/fowl/AppData/Local/Temp/open-uri20120520-3096-1r6dz70>
<fowl> i think you should still close them, or pass &:read
<burgestrand> fowl: Yeah, always good practice to close either way. I know tempfiles are properly disposed of on GC, but I’m not sure about regular files (although I would assume so).
prtksxna has quit [Ping timeout: 260 seconds]
lateau has joined #ruby
macmartine has joined #ruby
<burgestrand> Ah. They have an #autoclose? that can be toggled on or off.
<burgestrand> (and it defaults to true)
<fowl> ah interesting
<fowl> no matter how much u know about ruby you'll still learn new things about it all the time
jwbuurlage has quit [Quit: jwbuurlage]
novodinia has joined #ruby
novodinia has quit [Client Quit]
Tolnaiz has joined #ruby
<burgestrand> I wonder what the usecase for autoclose is…
<Mon_Ouie> #unlink is the method that actually removes the tempfile (as opposed to just closing the IO object)
<burgestrand> Anyway, always close your files explicitly even if they are closed on GC. You might run out of FDs before Ruby runs out of memory and clear the FDs for you.
<shevy> I just realized something ...
<shevy> wikis usually dont seem to have todo pages
mikeycgto has joined #ruby
jayrulez has joined #ruby
<shevy> I search for the wiki of the trinity project page (this one tries to keep KDE 3 alive), to find out whether they have an IRC channel or not. the wiki shows no search result, so I must assume they dont have an IRC channel... would be nice if I could quickly report that, then move on
Eldariof-ru has joined #ruby
<shevy> everyone should move to github. the issue tracker is really cool :P
<keanehsiao_> anybody use event machine ? if yes… any suggestion with : Assertion failed: (nbytes > 0), function _WriteOutboundData, file ed.cpp, line 1007. Abort trap: 6
mneorr has joined #ruby
lateau has quit [Quit: Leaving.]
LBRapid has quit [Quit: Computer has gone to sleep.]
Eldariof27-ru has quit [Ping timeout: 252 seconds]
tommyvyo has joined #ruby
jrgifford has joined #ruby
tommyvyo has quit [Client Quit]
berserkr has joined #ruby
mneorr has quit [Remote host closed the connection]
stepnem has quit [Quit: ZNC - http://znc.sourceforge.net]
S1kx has joined #ruby
S1kx has quit [Changing host]
S1kx has joined #ruby
stepnem has joined #ruby
indian has quit [Ping timeout: 245 seconds]
kaspernj has quit [Ping timeout: 246 seconds]
S2kx has quit [Ping timeout: 265 seconds]
Ontolog has quit [Remote host closed the connection]
Ontolog has joined #ruby
chson has joined #ruby
becom33 has quit [Ping timeout: 244 seconds]
<Mon_Ouie> I don't use event machine, but it's hard to tell what's wrong in your code without seeing it
vertroa has quit [Read error: No route to host]
Alantas has quit [Quit: The sum of the universe is zero.]
<apeiros_> keanehsiao_: sounds like you tried to write an empty string and EM doesn't like it. no idea beyond that.
<keanehsiao_> apeiros_ : I look up web, and it seems like buffer issue or too much tcp connections
Ontolog has quit [Ping timeout: 248 seconds]
<keanehsiao_> and in my case, I indeed open so much tcp at once.. perhaps too much??? so I now limited the max tcp connections and problems gone...
<keanehsiao_> but it doesn't solve the issue from eventmachine
mdw has joined #ruby
Jrz has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
mneorr has joined #ruby
Tolnaiz has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
robdodson has joined #ruby
ikaros has joined #ruby
becom33 has joined #ruby
petercs has joined #ruby
kyktommy has quit [Ping timeout: 265 seconds]
hmans has joined #ruby
lkba has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
rboyd has joined #ruby
mneorr has quit [Remote host closed the connection]
Osaka is now known as accually-kbar
accually-kbar is now known as accually-cool
accually-cool is now known as unlike-yy
unlike-yy is now known as k
k is now known as Guest55997
Guest55997 is now known as yy-pls
ZachBeta has joined #ruby
mneorr has joined #ruby
yy-pls is now known as Osaka
mahmoudimus has quit [Quit: Computer has gone to sleep.]
Quintus_q has joined #ruby
Karmaon has quit [Read error: Connection reset by peer]
andrewhl has quit [Quit: andrewhl]
arcresu has joined #ruby
jwbuurlage has joined #ruby
arcresu has left #ruby [#ruby]
Jooles has joined #ruby
carloslopes has joined #ruby
<Jooles> Hey everyone. I'm having an odd problem with ruby and Qt (I've also asked this in #Qt but I think it's more the ruby that's causing me grief) and was wondering if anyone could help. I had a class that worked fine and I've now split it into two; one which manages a set of the second which does not use anything from Qt and the second which inherits from Qt::Object because it uses signals and slots. The problem is that the second class behaves as though it
<Jooles> can't find the Qt functions.
deryl has quit [Quit: Leaving]
<Jooles> Here's the class that doesn't work - http://pastebin.com/hLci4Jta
matti has joined #ruby
<Jooles> I get the error "RPCConnection.rb:18:in `initialize': unresolved constructor call MsfRPCConnection (ArgumentError)"
ayumin has joined #ruby
<Jooles> line 18 is line 7 in the paste
jwbuurlage has quit [Client Quit]
<offby1> is there a shortcut to writing "def initialize(a, b, c, d) ; @a = a; @b = b; @c = c; @d = d; end" ?
<canton7> offby1, @a, @b, @c, @d = a, b, c, d is used quite a lot
defendguin has joined #ruby
<offby1> Jooles: no idea sorry
<offby1> canton7: that is something of an improvement; thanks
khakimov has joined #ruby
<canton7> Jooles, I don't know Qt at all, but does Qt::Object have a constructor? Does it take the arguments which your constructor takes?
<offby1> I seem to recall in Python you could pretty much say "take my argument list and shove it into my dictionary" in one fell swoop.
<canton7> offby1, it's not perfect I know, but it's the best I've seen
willyum has joined #ruby
<Hanmac> canton7 an other way could be: "def initialize(*args) ; @a,@b,@c,@d = args; end"
mahmoudimus has joined #ruby
PragCypher has joined #ruby
<Jooles> offby1: Thanks anyway. It's just wierd. canton7 yes and no in that order. Changing super to super() (ie with no arguments instead of just passing up the arguments for my constructor) changes the error to one about the call to connect having the wrong number of arguments (4 for 0)
<canton7> Hanmac, that's true -- I hadn't seen that
jwbuurlage has joined #ruby
mahmoudimus has quit [Client Quit]
deryl has joined #ruby
<canton7> Jooles, well calling just 'super' will pass the same arguments as were passed to your method, as you found out. super() explicitey passes no arguments
<canton7> Jooles, and your connect method doesn't take any arguments, and you're passing it some, as Ruby pointed out
S2kx has joined #ruby
<Jooles> Oh, bollocks it's so obvious. Thanks canton7. I so need to get more sleep
<canton7> Jooles, haha! YeahI know that feeling
<offby1> Hanmac: that's getting there!
deryl has quit [Read error: Connection reset by peer]
deryl has joined #ruby
keanehsiao has quit [Quit: Leaving...]
<offby1> Random question: why is "square root" not a method on numbers? Instead it's a library function. i.e., I expected to be able to type "3.sqrt" but it turns out that I have to type "Math.sqrt(3)"
S1kx has quit [Ping timeout: 265 seconds]
<apeiros_> a parser for ruby literals: https://github.com/apeiros/literal_parser - feedback welcome
sebastorama has joined #ruby
Eldariof59-ru has joined #ruby
deryl has quit [Read error: Connection reset by peer]
Eldariof-ru has quit [Ping timeout: 240 seconds]
tomzx has joined #ruby
deryl has joined #ruby
Jake232 has quit [Quit: Computer has gone to sleep.]
ayumin has quit [Remote host closed the connection]
<canton7> offby1, out of interest: http://bugs.ruby-lang.org/issues/5825
deryl has quit [Client Quit]
keanehsiao_ has quit [Ping timeout: 240 seconds]
gokul has joined #ruby
digitalcakestudi has quit [Read error: Operation timed out]
<shevy> canton7 for a simple use case, it would indeed be shorter
<offby1> canton7: thanks. I have actually been using Structs in some other contexts; they're handy.
<shevy> canton7 what I wonder though... the parser would have to be changed for this I suppose. is this even possible to do?
<offby1> (Actually, I suspect I've been using them simply because I don't really think in classes, and Structs are a way to avoid learning how :-)
khakimov has quit [Quit: Computer has gone to sleep.]
<offby1> canton7: the last comment on that page is apt.
<canton7> shevy, I have absolutely no idea. I hadn't even considered this until 10 minutes ago
Kiall has quit [Ping timeout: 272 seconds]
<shevy> canton7 kk
<shevy> :)
yannis has joined #ruby
* shevy begins to whip canton7
<shevy> think faster!
<canton7> haha!
<canton7> I'm thinking, I'm thinking
deryl has joined #ruby
deryl has quit [Client Quit]
<canton7> personally I'd be in favour of something like this, but make it very clean and fairly limited. So anything remote complex gets handled the "traditional" way, and the new syntax is *just* used for straightforward simple assignments
Ontolog has joined #ruby
PragCypher has quit [Quit: Leaving]
Sou|cutter has quit [Quit: WeeChat 0.3.0]
<offby1> maybe a new method on Object: set_attributes
<offby1> although you'd still have to spell out their names
<canton7> I was wondering about that. Is there a way to list the arguments passed to a method?
<offby1> a leetle introspection maybe
<shevy> sounds reasonable canton7
<shevy> canton7 hmm... there is .arity ... I think in ruby 1.9.x something new or something changed there... not sure if it is possible to list all arguments to a method per se...
Karmaon has joined #ruby
<canton7> apparently it's possible with ParseTree...
Ontolog has quit [Ping timeout: 244 seconds]
CheeToS has joined #ruby
ivar has joined #ruby
<shevy> cool
<fowl> canton7, def foo(a,b,c) end; p method(:foo).parameters
advorak has quit [Quit: This computer has gone to sleep]
<Hanmac> PS: parameters does not so good work on C-functions
nlc has joined #ruby
<Mon_Ouie> apeiros_: Something that could be useful would be restricting the parser to a specific type of literal (although you can just raise if the resulting object doesn't meet your requirement)
khakimov has joined #ruby
<apeiros_> Mon_Ouie: pondered that too. I'll put it into the todos
<canton7> fowl, thanks!
ZachBeta has quit [Quit: Computer has gone to sleep.]
ukwiz has quit [Quit: Leaving]
sejo has quit [Read error: Operation timed out]
<apeiros_> hm, just noticed that it doesn't accept trailing comas in hashes/arrays
sejo has joined #ruby
Ontolog has joined #ruby
gokul has quit [Quit: Leaving]
<fowl> didnt ruby 1.8 let you do def method(@var, @var,..)
telos has joined #ruby
<Mon_Ouie> no, but it lets you do that with block arguments
robdodson has quit [Quit: robdodson]
tomb_ has joined #ruby
prtksxna has joined #ruby
advorak has joined #ruby
mneorr has quit [Remote host closed the connection]
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
Aziz_ has joined #ruby
<shevy> I find that a bit ugly actually
altiouz has quit [Ping timeout: 244 seconds]
<shevy> {|@foo,@bar|}
<shevy> I dont like that
dhaskew has quit [Read error: Connection reset by peer]
vitor-br has quit [Ping timeout: 246 seconds]
dhaskew has joined #ruby
LBRapid has joined #ruby
<apeiros_> stdout_setter = proc { |$stdout|}; stdout_setter.call(some_io) :)
<telos> hi all, i've compiled ruby from source and i get this error when i try to use digest/md5: digest/md5.so: undefined symbol: rb_Digest_MD5_Init . i have libcrypto installed... any ideas how to troubleshoot this?
<telos> i know that this symbol is available in libcrypto.so, so i'm at a loss as to why it is not being correctly linked into md5.so
altiouz has joined #ruby
telos is now known as t3los
<shevy> apeiros_ whoa... that is some odd syntax... never saw |$foo| before
<shevy> t3los pls dont change your nick after asking
<shevy> t3los I already thought you quitted
<apeiros_> shevy: you can put in anything there that's assignable - in 1.8, that is
<apeiros_> iirc even proc { |obj.foo| } would work, if obj responts to foo=
azm has quit [Ping timeout: 250 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
<shevy> t3los did you try to go into ext/openssl ?
tommyvyo has joined #ruby
<t3los> shevy, sorry, i'm trying to join #rvm but i've got issues with the server
<shevy> ah
<shevy> so you use RVM
<t3los> shevy, i tried using the ordinary source too . same prob
<t3los> shevy, , i can go into ext/digest, sure
<shevy> oh
<shevy> it is part of digest?
<t3los> yeah, it's digest/md5 (and sha1 and sha2)
<shevy> yeah I see it now
<shevy> it has directories like md5/
<t3los> yeah
Aziz_ has quit [Remote host closed the connection]
<t3los> and they link to openssl's libcrypto
<shevy> yeah openssl gives me problems too sometimes
<shevy> do you know what openssl version you have?
<offby1> t3los: my guess is that ruby's "configure" script didn't realize that you had openssl
advorak has quit [Read error: Connection reset by peer]
<offby1> or perhaps you don't have the openssl -development- fies
<offby1> files
advorak has joined #ruby
khakimov has joined #ruby
<t3los> shevy, offby1 i have them and i've properly set C_INCLUDE_PATH, etc
Aziz_ has joined #ruby
<offby1> t3los: if you paste your config.log that _might_ be useful
<t3los> i have the latest version of openssl libraries and include files
<offby1> (I'm assuming that ruby uses autoconf; I don't actually know)
Ontolog has quit [Remote host closed the connection]
<t3los> i only have a confing.log for yaml, not for ruby
<offby1> nuts
Aziz_ is now known as capsule
<t3los> i have configure.log, though
<shevy> t3los ok so you have openssl-1.0.1b ?
<shevy> I have more openssl versions it seems :\
<shevy> libssl.so.0.9.8 libssl.so.1.0.0
<shevy> I am glad ruby found the right one for me though ;)
<t3los> i have 1.0.0
matti has quit [Quit: 8-X]
<offby1> t3los: might's well paste it. No guarantees, but sometimes it helps diagnosing this sort of thing
<t3los> the latest stable version straight form openssl
Beakr has quit [Quit: Beakr]
mdw has quit [Remote host closed the connection]
fbernier has joined #ruby
<shevy> ok then I am not sure what is up
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<shevy> t3los, when I have openssl installed, ruby compiles openssl just fine usually
<shevy> I show you how it goes for me
kevinbond has joined #ruby
mikeg has quit [Ping timeout: 276 seconds]
capsule has left #ruby [#ruby]
yankov has quit [Quit: yankov]
<shevy> in /Depot/Temp/ruby-1.8.7p358/ext/digest/md5/ I do: ruby extconf.rb;make;make install
<shevy> and the output of this is ...
matti has joined #ruby
<shevy> you can try this on your machine and look what kind of error it shows. that would be quite useful
khakimov has quit [Client Quit]
jgrevich has joined #ruby
timonv has quit [Remote host closed the connection]
<t3los> shevy, i just ran that and i got no error
<t3los> shevy, but i didn't get as much output as you
<shevy> but you did not go into ext/ right?
niku4i has quit [Remote host closed the connection]
<shevy> you seemed to run the base configure script
<t3los> shevy, just http://pastie.org/3940775
<shevy> aha let me try something
<t3los> i have a log file, md5/mkmf.log
<shevy> yeah
<shevy> that seems to be fine
<t3los> shevy it finds everything.. e.g. have_library: checking for main() in -lcrypto... -------------------- yes
<matti> shevy: ;]
tayy has joined #ruby
<t3los> shevy, running your commands didn't produce a new md5.so though
<shevy> t3los you tried "make" yet?
mdw has joined #ruby
<shevy> compiling md5init.c
<shevy> compiling md5ossl.c
<shevy> linking shared-object digest/md5.so
<shevy> that is what I get when I do make
<shevy> it creates a md5.so file
<t3los> inside digest/md5, yeah?
<t3los> yes, ok i got that
<t3los> but where is the md5.so
<offby1> t3los: your "configure" doesn't even seem to be looking for openssl. Perhaps you need to explicitly tell it to do so, with a command-line switch. Perhaps try "./configure --help" and see if there's an option like "--with-openssl".
kevinbond has quit [Quit: kevinbond]
nlc has quit [Ping timeout: 246 seconds]
<t3los> offby1, i think it's because it's only for an extension
<t3los> offby1, so it doesn't appear in the base configure log
<t3los> shevy, ok i got a new md5.so this time ( i had to make clean )
<t3los> shevy, problem is, if I run nm ./src/ruby-1.9.3-p194/.ext/x86_64-linux/digest/md5.so | grep MD5
<t3los> i find that the rb_Digest_MD5_Init etc symbols are unavailable (they have a U)
matti has quit [Quit: 8-X]
hmans has quit [Quit: Linkinus - http://linkinus.com]
<shevy> U MD5_Final
<shevy> 00000000000009a0 T MD5_Finish
<offby1> t3los: I see that the Debian package passes --with-bundled-md5
<t3los> shevy, i get http://pastie.org/3940799
<shevy> we are like detectives here :)
<t3los> offby1, i'm using rvm though, and my own openssl library compiled from source0
<shevy> t3los strange I kinda have that too
<t3los> shevy, you don't have the http://pastie.org/3940799 symbols ?
<t3los> sorry, i mean, rb_Digest_MD5_* symbols
defendguin has quit [Quit: Leaving.]
pangur has joined #ruby
<t3los> shevy OK and i you run "require digest/md5" with your own compiled version of ruby you're fine?
<shevy> require "digest/md5" # => true
<shevy> yeah t3los
* offby1 envisions a new PBS show: Software Detectives
<shevy> i compiled from source though
<t3los> shevy, i get http://pastie.org/3940807
<pangur> I know that items[-1] gives me the last item of an array. I want the rest of the array except the last item. How do I get that, please?
austinbv has joined #ruby
<t3los> shevy if you find the actual md5.so that you are using (not the one you just created) are the MD5 symbols also unavailable?
<shevy> t3los I paste what nm shows
ZachBeta has joined #ruby
mcwise has joined #ruby
sbooch has joined #ruby
hadees has quit [Quit: hadees]
Solnse has joined #ruby
mneorr has joined #ruby
<t3los> shevy that's odd, you don't have the rb_ prefix
<t3los> shevy, is this ruby 1.9.3 ?
<shevy> t3los yeah
<shevy> ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
<shevy> /Depot/Temp/ruby-1.9.3p194/ext/digest/md5/
mcwise has quit [Client Quit]
<t3los> this is very perplexing
<pangur> nm, I have worked it out.
strnx has quit [Excess Flood]
strnx has joined #ruby
pangur has quit [Remote host closed the connection]
<canton7> offby1, this is my best attempt so far, without doing hackyish stuff like set_trace_func: http://pastie.org/3940862
nlc has joined #ruby
<offby1> interesting.
<offby1> That's just above my pay grade, but I can get a sense of what you're doing
fbernier has quit [Ping timeout: 252 seconds]
austinbv has quit [Quit: austinbv]
foofoobar has joined #ruby
<shevy> looks very hackish
<shevy> what is it doing?
<canton7> it is very hackish
<t3los> shevy, in md5.h you see the definition of the rb_ macros only if RUBY is defined.. i wonder if this has something to do with it
<shevy> t3los perhaps RVM
<shevy> well, you could try a dry configure of a ruby
<shevy> using --prefix
<shevy> like
<shevy> ./configure --prefix=/opt/ruby
<canton7> You define <some_method>_default. It defines method_missing, which checks whether <method_name>_default exists. If so, it grabs that methods argument names and uses them to assign class variables before calling that method
<shevy> then make then make install and look if that ruby works with digest
<Mon_Ouie> canton7: In method missing, you should use super, as opposed to aliasing
petercs has quit [Quit: Leaving.]
<canton7> Mon_Ouie, good point
mlevin_ has quit [Quit: Computer has gone to sleep.]
<t3los> shevy i tried that too and got the same result
adambeynon has quit [Quit: adambeynon]
* offby1 would be afraid to use that in production, given that he doesn't quite understand it
<shevy> t3los hmm ok
ivar has quit [Remote host closed the connection]
<canton7> offby1, yeah I wouldn't recommend it. It's just a bit of fun
Jooles has left #ruby ["Leaving"]
<offby1> I could probably swing that kinda thing in perl or python, but my ruby-fu isn't (yet) up to that
ivar has joined #ruby
<shevy> offby1, I dont understand that ruby code either
ivancv has joined #ruby
<offby1> are there "obfuscated ruby" contests? If not, that's probably a good statement about the language :)
<ivancv> ¿Alguien de aquí habla español?
<canton7> offby1, there's golf.. that's pretty close at times
wvms has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
ivar has quit [Remote host closed the connection]
<shevy> ivancv no, habemos ingles!!!
<shevy> that word is wrong... hablar ... hablo hables habl... gah, I think it is irregular
LBRapid has quit [Read error: Connection reset by peer]
<Mon_Ouie> canton7: btw, this is how I would implement it: https://gist.github.com/2758930
<Mon_Ouie> (doesn't account for method visibility though)
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
LBRapid has joined #ruby
<canton7> Mon_Ouie, I'm actually working on a solution which does something similar to that
<canton7> basically a hackier version of yours, but using method_added to allow line 23 to go above line 20
ThatDudeGuy_ has joined #ruby
mdw has quit [Remote host closed the connection]
<Mon_Ouie> I don't like the way this works, it looks a bit magic when you think about it
<canton7> yeah, I'm none too keen on the approach either. I'm just procrastinaing
<canton7> *procrastinating
<Mon_Ouie> method_default do … end would work and not require hacks that check if the class gets closed/reopened
advorak has quit [Ping timeout: 244 seconds]
advorak has joined #ruby
mlevin_ has joined #ruby
adeponte has joined #ruby
rboyd has quit [Quit: rboyd]
mdw has joined #ruby
Progster has joined #ruby
vandemar has quit [Ping timeout: 245 seconds]
ivar has joined #ruby
ivar has quit [Remote host closed the connection]
bluenemo has quit [Remote host closed the connection]
<Veejay> Which is faster, foo * 2 or foo << 1?
<Veejay> Or is it the same in the end
<offby1> please for the love of God just write foo * 2
<offby1> don't be clever
austinbv has joined #ruby
<Veejay> Right
<tresk> Mmm, ruby 1.9.3 is running,but when I do a bundle install, I get only the ./vendor/bundle/ruby/1.9.1/... installed. How can I get the 1.9.3 version installed?
<apeiros_> Veejay: theoretically << 1, but since method-call overhead is huge in ruby, you'll probably not be able to measure a significant difference
<Veejay> You wouldn't want to be clever about anything anyway
Ontolog has joined #ruby
<Veejay> apeiros_: Thanks
<Fraeon> foo * 2 is just boring
<offby1> Fraeon: boring is good, up to a point
<Fraeon> I'm here to write high art, not make readable code
<offby1> the "I instantly understand this code by just glancing at it" kind of boring is good.
<offby1> but the "this code is so repetitive that I've fallen asleep while reading it" kind is bad.
* offby1 applies for a NEA grant for Fraeon
<offby1> Fraeon: we'll have your code right in front of City HalL!
<offby1> by the bus shelter
<offby1> it'll engage the community and start a robust dialog
<canton7> Mon_Ouie, hacky as anything, but my next attempt: http://pastie.org/3940862
<canton7> and with that, I'm going to get some food
* offby1 wonders why canton7 is so argumentative
jwbuurlage has quit [Quit: jwbuurlage]
<canton7> cos he's shit at naming things...
griffindy has joined #ruby
<ThatDudeGuy_> Am I the only one who had no idea that the << operator doubled a number?
griffindy has quit [Client Quit]
<td123> ThatDudeGuy_: that's bitwise shift to the left
<Veejay> ThatDudeGuy_: >> halves it too
<ThatDudeGuy_> lol
<Veejay> It shifts shit
<ThatDudeGuy_> that makes more sense
<offby1> ThatDudeGuy_: I didn't either; I assumed << was like Array.push
snearch has joined #ruby
jcromartie has joined #ruby
<offby1> << is shift-left in Perl and C, which is probably why Ruby does it
Quintus_q has left #ruby ["Valete!"]
<Veejay> offby1: That's why sometimes to learn about stuff you need to try to be clever through trial and error
<Veejay> If you catch my shift
<rippa> ([]<<1)[0]<<1
<rippa> hell yeah
griffindy has joined #ruby
<offby1> *shudder*
<offby1> I hate "operator overloading", even though you might argue that's not what's going on here.
<Veejay> It's not even arguing
<Veejay> It's absolutely not what's going on
<Veejay> Now I would never use << to multiply
<Veejay> But it's a good thing to play with
davidpk has joined #ruby
<Veejay> Implementing multiplications with + and <<
ciopte7_ has joined #ruby
sbooch has quit [Quit: sbooch]
cpruitt has joined #ruby
griffindy has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
griffindy has joined #ruby
<RubyPanther> You still have to be very careful choosing a math operator in Ruby.
<RubyPanther> Yay! mRuby!!
sepp2k has joined #ruby
LBRapid has quit [Read error: Connection reset by peer]
timonv has joined #ruby
jackiechan0 has quit [Quit: Sto andando via]
foofoobar has quit [Quit: bb]
LBRapid has joined #ruby
<shevy> RubyPanther I thought you are dead
<shevy> RubyPanther you didnt write anything in like 5 weeks
alexim has quit [Ping timeout: 265 seconds]
<Hanmac> offby1 to scare you more in ruby there is a difference between - 1 and -1
<shevy> offby1 were you the assembler guy?
griffindy has quit [Quit: Computer has gone to sleep.]
<t3los> shevy, well i ended up copying the md5.so and sha2.so intalled on the server (for ruby 1.8.7) to my local folder (for 1.9.3) and it seems to work...
austinbv has quit [Quit: austinbv]
<shevy> t3los whoa!
<shevy> you outsmarted ruby 1.9.3 !!!
<t3los> shevy, i guess if i encounter a problem i can ask you to share your .so's with me :)
ThatDudeGuy_ has quit [Quit: ThatDudeGuy_]
<shevy> t3los hehe sure
ThatDudeGuy_ has joined #ruby
<t3los> i'm getting Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. yet i have execjs and therubyracer installed
<t3los> any ideas?
sparrovv has quit [Ping timeout: 276 seconds]
tewecske has joined #ruby
<ThatDudeGuy_> t3los: can you post the specific error message and your os?
Soda has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
adeponte has quit [Remote host closed the connection]
<t3los> ThatDudeGuy_, it's linux. http://pastebin.com/M2GRcswX
riyonuk has joined #ruby
<riyonuk> Can I use ruby to interface with mysql and php? I've got to use WordPress at work, and I'd like to write ruby scripts to replace files, update them, run sql, etc.
<td123> riyonuk: how would you interface with php?
<riyonuk> Just file replacement really.
<riyonuk> Guess they could be text files, for all the script cares.
adambeynon has joined #ruby
<ThatDudeGuy_> t3los: I've never run into that specific issue on linux, but as a sanity check can you run this under rib to make sure therubyracer is available: https://gist.github.com/2759143
<ThatDudeGuy_> t3los: *irb
<td123> riyonuk: you can run commands with php, so you can do run 'ruby ./script.rb files'
<td123> riyonuk: you can also certainly interact with a sqldb from within ruby
<deryldoucette> checkout railsforphp.com - its aimed at rails, but lots of whats there are usable with straight ruby as well.
<t3los> ThatDudeGuy_, works
<rking> So Debian's scripts are Perl-based, Gentoo's are Python-based. ____'s are Ruby-based?
griffindy has joined #ruby
<deryldoucette> like you can use ActiveRecord with straight ruby, ActiveModel, ActiveSupport, mongodb etc etc
<shevy> rking there was a distribution once called rubyX, later renamed to heretix, which was written in ruby but it died
<ThatDudeGuy_> t3los: Hrm… so execjs really doesn't locate therubyracer. Could it be a set of incompatible versions?
<deryldoucette> that site is for taking your php knowledge and mapping it to rails, but a lot of whats done in rails is really just straight ruby. unfortunately, many users don't realize that
<td123> rking: what scripts are you talking about?
jgrevich has quit [Read error: No route to host]
<rking> shevy: =(
CheeToS has quit [Ping timeout: 265 seconds]
<shevy> rking, my old plan was to write a package manager in ruby for gobolinux
<rking> td123: All the distro stuff. E.g. dpkg is Perly and portage is Pythonly.
<t3los> ThatDudeGuy_, i'd be surprised, i just installed them using gem...
ermines is now known as otters
<shevy> but sadly the main guys who drove gobolinux forward, started to work full time (they were students years ago) and no longer had much time, so it all kinda died
<t3los> ThatDudeGuy_, i'm gonna try Node.js
<yxhuvud> shevy: can't you rewrite gems to be more suited for distributing nonruby stuff instead? :)
cordoval has joined #ruby
<shevy> yxhuvud, hmm
<ThatDudeGuy_> t3los: lol, that should work too
<rking> Oh yeah, we already have a distro tool: gem.
schaerli has quit [Ping timeout: 240 seconds]
<shevy> gem works quite nice for ruby addons
<rking> We just need to make a kernel, init, etc. gems.
<shevy> yeah, but together it sounds like a lot of work
<rking> Oh, a huge amount of work, and probably not worth it. I was only wondering if there was already something doing it.
<shevy> you kinda need to start hacking, without thinking how long it may take
<rking> Hehe
<t3los> ThatDudeGuy_, it's incredible, i've spent 2 days trying to make a spree installation.. i haven't played with RoR since circa 2005. i'm amazed things are still so unpolished
<shevy> yxhuvud, it may be easier to port machomebrew to linux
<offby1> shevy: assembler? Not I
vandemar has joined #ruby
<shevy> they have thousand of recipes available already
<shevy> offby1 ok, there was some other guy here who wanted to learn ruby and said he wrote assembler code many years ago
looopy has joined #ruby
<ThatDudeGuy_> t3los: I'm also coming back to rails for the first time in a long while, and the ecosystem has gotten *much* larger, but there are also a lot of rough edges that come along with that
rboyd has joined #ruby
jgrevich has joined #ruby
niklasb has quit [Ping timeout: 276 seconds]
<ThatDudeGuy_> t3los: out of curiosity, what linux disco are you using? I've only recently built apps on ubuntu and mint and uncommenting 'gem "therubyracer"' in my Gemfile didn't cause any issues. I'd like to know what to watch out for
<ThatDudeGuy_> *distro
<offby1> shevy: scraping my logs: [Sun May 20 2012] <orealis> SO.... I haven't touched programming since assembly back on amiga in the late 80's.... would ruby be a good thing to try and learn? I basically have been reset to n00b..
ddv has quit [Quit: *poof*]
<shevy> offby1 oh yeah
<shevy> two guys with nicks starting with 'o'
<t3los> ThatDudeGuy_, Debian 4.3.2-1.1
<shevy> hard to separate who is who :)
<t3los> ThatDudeGuy_, i dont' have admin rights though, so i'm doing it all myself in my home directory
<shevy> ThatDudeGuy_, I am using Linux Disco 1.0 !!!
<shevy> everyday I'm shuffling it
<t3los> ThatDudeGuy_, and of course, node.js failed to compile... can't find SSL_select_next_proto, surely something wrong with my openssl install, even though it's the latest stable version
[Tritium] has joined #ruby
fr0gprince_ has quit [Ping timeout: 252 seconds]
<ThatDudeGuy_> shevy: I so hope there's a distro named Linux Disco. Totally useless, but lots of flashing tiles
<shevy> ThatDudeGuy_ LOL
<shevy> ThatDudeGuy_ the <marquee> distribution!
<ThatDudeGuy_> shevy: lol
<rking> I was pretty impressed to find out that Firefox still honors <blink>
<ThatDudeGuy_> t3los: that's a bummer. unfortunately I usually have bull-in-a-china-shop rights on my linux distros, so I'm not sure what issues crop up there
<[Tritium]> it depends on the dtd
<rking> [Tritium]: Aaha, that makes sense.
SmoothSage has quit [Ping timeout: 248 seconds]
<[Tritium]> and if there is no dtd... any tag that ever existed is allowd...allowed?... or at least that is how it used to be.
techhelp has quit [Quit: This computer has gone to sleep]
carloslopes has quit [Quit: Leaving]
LBRapid has quit [Read error: Connection reset by peer]
fr0gprince_ has joined #ruby
yoklov has joined #ruby
indian has joined #ruby
deobald__ has joined #ruby
<t3los> ThatDudeGuy_, incredible, doesn't even find mustang
schaerli has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ has joined #ruby
dhaskew_ is now known as dhaskew
<ThatDudeGuy_> t3los: sorry, i'm not familiar with mustang. is that a java runtime?
dhaskew has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
netogallo has quit [Ping timeout: 245 seconds]
<t3los> ThatDudeGuy_, yeah, once that's meant to be supported by execjs
nars has joined #ruby
willyum has quit [Ping timeout: 244 seconds]
snearch has quit [Quit: Verlassend]
kenperkins has quit [Quit: Computer has gone to sleep.]
kaspernj has joined #ruby
maletor has joined #ruby
<ThatDudeGuy_> t3los: ahh, gotcha. it's still weird that execjs doesn't find therubyracer if you have no trouble loading it via "require 'therubyracer'". That's how execjs should be detecting it. Is there some way to debug execjs to see why it's failing?
<RubyPanther> shevy: I was here, but mostly I was busy coding
kenperkins has joined #ruby
<t3los> ThatDudeGuy_, it's line 50 in execjs/runtimes.rb .. the autodetect function
<RubyPanther> but mRuby will change everything, this is going to be huge
<t3los> ThatDudeGuy_, sorry it's been a while since i coded in ruby.. how can i call the autodetect function from within ruby?
schaerli has quit [Remote host closed the connection]
<t3los> ThatDudeGuy_, it's a function of the Runtimes module which is nested in the ExecJS module
<ThatDudeGuy_> t3los: I'm not sure… playing around with it now :)
cpruitt has quit [Quit: cpruitt]
mdw_ has joined #ruby
yannis has quit [Read error: Connection timed out]
mrbrdo has joined #ruby
<ThatDudeGuy_> t3los: On my OSX machine, I was able to instantiate xr = ExecJS.::RubyRacerRuntime.new and call xr.available?
<ThatDudeGuy_> t3los: which returned true in my case
<ThatDudeGuy_> t3los: (after require 'execjs')
<t3los> same here
griffindy has quit [Quit: Computer has gone to sleep.]
<mrbrdo> ruby 1.9.3 isn't CoW friendly yet right?
mdw has quit [Ping timeout: 245 seconds]
<ThatDudeGuy_> t3los: hmm… getting closer
netogallo has joined #ruby
mneorr has quit [Remote host closed the connection]
Elfix has quit [Ping timeout: 260 seconds]
<ThatDudeGuy_> t3los: what about ExecJS::Runtimes.best_available
<t3los> ThatDudeGuy_, i get #<ExecJS::RubyRacerRuntime:0x00000000f5bc70>
cpruitt has joined #ruby
savage- has quit [Remote host closed the connection]
banisterfiend` has quit [Read error: Connection reset by peer]
<ThatDudeGuy_> t3los: Interesting. So execjs on its own can find an available runtime… what was your original error when running the app?
<t3los> ThatDudeGuy_, ib/execjs/runtimes.rb:50:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
<ThatDudeGuy_> t3los: If ExecJS::Runtimes::auto detect returns a RubyRacerRuntime, then we can at least eliminate execjs as the issue
banisterfiend` has joined #ruby
<ThatDudeGuy_> "ExecJS::Runtimes::auto_detect"
<ThatDudeGuy_> t3los: My autocorrect is having issues… ExecJS::Runtimes.autodetect
<t3los> ThatDudeGuy_, hmm i seem to have two versions of execjs. 1.4.0 and 1.3.2
jgrevich has quit [Ping timeout: 248 seconds]
<shevy> RubyPanther you really think so about mRuby?
<ThatDudeGuy_> t3los: If you modify your Gemfile to use a specific version, does that make a difference: gem "execjs", "~> 1.4.0"
ikaros has quit [Remote host closed the connection]
<RubyPanther> shevy: I don't think it will become a new consumer phone platform, for example, but I think it could become the new platform for everything from consumer GPS units to federation tricorders. Oh yeah, and robots.
<ThatDudeGuy_> RubyPanther: mRuby + sqlite seems like a powerful combination of ultra-portable, embeddable C libraries
bnagy has quit [Ping timeout: 252 seconds]
<shevy> cool
<RubyPanther> yeah, too big for arduino but perfect for raspberry pi
adeponte has joined #ruby
bnagy has joined #ruby
<RubyPanther> if you want to build your RubyOS now is the time to start, you can have an mRuby kernel
jgrevich has joined #ruby
<t3los> ThatDudeGuy_, i'm running spree install .. not sure exactly where the execjs requirements are specified
cdepue has quit [Remote host closed the connection]
Araxia_ has joined #ruby
<mrbrdo> what's the point of mruby?
<t3los> ThatDudeGuy_, but in any case, with 1.3.2 ExecJS::Runtimes.best_available works fine
<t3los> ThatDudeGuy_, here, ExecJS::Runtimes.autodetect works fine too
niklasb has joined #ruby
<becom33> on this Im getting a error http://pastie.org/3941422 .help.rb:25: warning: already initialized constant Debhelp
<ThatDudeGuy_> t3los: Cool. So your system is working fine. I'm going to install spree to see how their system works. BRB
Elfix has joined #ruby
<shevy> RubyPanther, I'll do the RubyOS in a reversed way. I'll improve the general toolset first
<shevy> RubyPanther, since today in my pseudo shell, I can do "irc ruby" and it will connect me to ruby! all using ruby
<shevy> I mean, #ruby here
<becom33> shevy, can you give a second to look at my paste :/
<ThatDudeGuy_> shevy: I like it. The bottom-up OS project. Start with the shell and work down to scheduling :)
<RubyPanther> Well, that is the user environment not the operating environment. Both are important, to be sure.
<shevy> https://github.com/mruby/mruby wheeeee matz committed code 3 hours ago
<RubyPanther> yeah that's what I was freaking out about
<shevy> becom33 that is just a warning, you probably included a file twice
<becom33> shevy, I see
<becom33> thanks
<shevy> becom33 also make a pause, and see if you already required a file or not
<shevy> if you dont do that, you may end up like me
<shevy> I wrote a large project and included the same files several times
<shevy> and I no longer understood what I did there and why
<shevy> I rebuilt the project from scratch eventually :\
<shevy> ThatDudeGuy_ yeah
adambeynon has quit [Quit: adambeynon]
<shevy> ThatDudeGuy_ it's also to see how feasible that would even be
bdnelson has joined #ruby
<shevy> it would be feasible if hundred people came together on github :P
jcromartie has quit [Quit: jcromartie]
Ontolog has quit [Remote host closed the connection]
davidpk has quit [Quit: Computer has gone to sleep.]
xclite has joined #ruby
ddv has joined #ruby
<becom33> shevy, its checking automatically on dir using DIR . well it doesnt have a another file . but I'll show you a git
<ThatDudeGuy_> t3los: It looks like spree piggy-backs on a regular rails install. Do you have a Gemfile in your project root?
looopy has quit [Remote host closed the connection]
<t3los> ThatDudeGuy_, i do
ph^ has quit [Remote host closed the connection]
<ThatDudeGuy_> t3los: try uncommenting the line "# gem 'therubyracer', :platform => :ruby"
ronniy has quit [Remote host closed the connection]
<ThatDudeGuy_> t3los: and running `bundle install`
<t3los> ThatDudeGuy_, there wasn't a line like that but i added some requires and now it woroks
techhelp has joined #ruby
<t3los> ThatDudeGuy_, i added execjs, therubyracer and mustang.. not sure which one sorted it out , but it's sorted!
<ThatDudeGuy_> t3los: Rock on! Good luck with the app!
<t3los> ThatDudeGuy_, cheers, thanks for your help
<ThatDudeGuy_> t3los: no problemo
ViperMaul has quit [Ping timeout: 244 seconds]
mpereira has quit [Ping timeout: 252 seconds]
<Hanmac> shevy the mruby c interface looks interesting :P
mikepack has joined #ruby
rippa has quit [Ping timeout: 245 seconds]
virunga has quit [Quit: Sto andando via]
seanstickle has joined #ruby
ViperMaul has joined #ruby
Chryson has quit [Ping timeout: 276 seconds]
tomb_ has quit [Quit: Computer has gone to sleep.]
Eldariof59-ru has quit []
maletor has quit [Quit: Computer has gone to sleep.]
Chryson has joined #ruby
<becom33> shevy, http://pastie.org/3941422 in this paste . if I require this file in some other files . it will initialize everytime this file require right ?
looopy has joined #ruby
mikeycgto has quit [Ping timeout: 246 seconds]
<ThatDudeGuy_> becom33: It will, assuming the $LOAD_PATH is the same between all of your other files.
<becom33> ThatDudeGuy_, with out initializing the file in path I cant require this file to other module to do what I've in line 30
austinbv has joined #ruby
looopy has quit [Remote host closed the connection]
<becom33> so everytime I read other file it initialize and it gives a warning
<becom33> what can I do to fix that ?
sepp2k has quit [Remote host closed the connection]
moshee has quit [Ping timeout: 244 seconds]
quest88 has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
davidpk has joined #ruby
tewecske has quit [Read error: Connection timed out]
<ThatDudeGuy_> becom33: Can you post an example of the way it's used in another file and the warning it give?
<ThatDudeGuy_> *gives?
<becom33> ThatDudeGuy_, sure
griffindy has joined #ruby
kaspernj has quit [Remote host closed the connection]
mneorr has joined #ruby
<shevy> becom33, yes. require './lib/command_execution' <-- it will pull in all that is inside file command_execution.rb
<shevy> btw becom33
<shevy> rather than:
<becom33> ThatDudeGuy_, https://gist.github.com/2759442
<shevy> Debhelp = HelpSet.new()
ella has joined #ruby
<shevy> I would do
<shevy> debhelp = HelpSet.new()
<shevy> because if you capitalize this, it will be treated like a constant
flip_digits has joined #ruby
<shevy> I see that you require this constant in your module
<becom33> shevy, i tried it . but if I do debhelp . i'm going to have to initialize the class inside every module .
<shevy> but I really think this is bad how you design it
<becom33> shevy, gimme a option without initializing file
<shevy> becom33 you know that I dont like modules :-)
<becom33> yes I do . but in this case I don't have a option :/
<shevy> ewww
amalvagomes has quit [Quit: amalvagomes]
<shevy> why dont you initialize it within your module though?
CannedCorn has joined #ruby
<becom33> shevy, but then it won't store the same values in @command and @discription
jwbuurlage has joined #ruby
<canton7> singleton maybe?
cantonic has quit [Quit: cantonic]
<becom33> singleton ?
<canton7> class with only one instance ever. Instead of instantiating a new instance of it, you just retrieve the existing instance
<canton7> ruby has a Singleton mixin which makes things super-easy
Vendethiel has joined #ruby
<canton7> then, if you want to keep your current syntax, define a module Debhelp which wraps HelpSet.instance
mikeycgto has joined #ruby
nars has quit [Remote host closed the connection]
<ThatDudeGuy_> canton7: I have to ask… hero of canton reference?
<canton7> I'm afraid not. I'm not from canton either... It's loosely connected to my name, but that's it
sprung has quit [Ping timeout: 260 seconds]
Targen has joined #ruby
timonv has quit [Remote host closed the connection]
<shevy> hong kong!
<shevy> say something funny in cantonese!
timonv has joined #ruby
<canton7> 没有
<canton7> (yay google translate)
<ThatDudeGuy_> canton7: gotcha. just a huge firefly fan :)
<becom33> canton7, its confusing
<canton7> it's a firefly reference as well? Nice
igotnolegs has joined #ruby
ZachBeta has joined #ruby
adeponte has quit [Read error: Connection reset by peer]
austinbv has quit [Quit: austinbv]
adeponte has joined #ruby
xclite has quit [Remote host closed the connection]
_adeponte has joined #ruby
adeponte has quit [Read error: Connection reset by peer]
moosya has joined #ruby
Vainoharhainen has joined #ruby
<canton7> becom33, simple, slightly verbose example: http://pastie.org/3941645
<becom33> k
<becom33> lemme see
ConstantineXVI has joined #ruby
<canton7> (unless I've missed some part of your spec, which is reasonably likely)
looopy has joined #ruby
elkng has quit [Ping timeout: 252 seconds]
<apeiros_> oy, discription -> description
ivar has joined #ruby
<canton7> that was copy-pased from becom33 's gist *innocence*
kil0byte has joined #ruby
looopy has quit [Remote host closed the connection]
<ivancv> Anyone know a how about configuring apache/nginx with passenger for better performance?
mdw has joined #ruby
* canton7 experience with passenger is poking various config options before realising that there's no way to stop the poor server from screaming for more ram, and shifting it to heroku
* apeiros_ switched to php
LBRapid has joined #ruby
<mrbrdo> apeiros_ lol
mdw_ has quit [Ping timeout: 246 seconds]
sparrovv has joined #ruby
ddv has quit [Quit: *poof*]
ivar has quit [Ping timeout: 246 seconds]
austinbv has joined #ruby
ivar has joined #ruby
<becom33> canton7, thanks I got the idea . it works
heisenmink has joined #ruby
<heisenmink> How come you can run code outside of method definitions in classes?
Vendethiel has quit [Quit: je ne suis plus là, tqvu]
austinbv has quit [Client Quit]
cousine has joined #ruby
ivar has quit [Read error: Connection reset by peer]
<apeiros_> heisenmink: that's how ruby works
<Hanmac> heisenmink, because ruby is procedual too (or looks like that)
austinbv has joined #ruby
<apeiros_> your class definition itself *is* code
austinbv has quit [Client Quit]
cousine has quit [Remote host closed the connection]
<heisenmink> What's it called?
virunga has joined #ruby
<apeiros_> I don't think there's a specific term for that
<heisenmink> It is really a nice thing, but I just want to eliminate the mystery
digitalcakestudi has joined #ruby
ssand has quit [Quit: Leaving]
looopy has joined #ruby
<CannedCorn> is it possible that rb_enc_get is the same as calling .encoding on a string yeah?
<CannedCorn> I'm getting less specific results this way
<heisenmink> how can I do 3.minutes and similar if the integer if the class doesn't contain those methods? or are they a part of ruby?
piotr_ has joined #ruby
ivar has joined #ruby
TandemAdam has joined #ruby
TandemAdam has quit [Read error: Connection reset by peer]
ella has quit [Ping timeout: 252 seconds]
<burgestrand> heisenmink: you reopen the target class and add the methods. 3.minutes in particular is not part of ruby itself.
yxhuvud has quit [Ping timeout: 246 seconds]
looopy has quit [Remote host closed the connection]
andrewhl has joined #ruby
<heisenmink> burgestrand, thanks. How is that done though? Integer.add_method :minutes, do .. end ?
<otters> no
<otters> class Integer; def minutes; … end; end
<heisenmink> ah
<heisenmink> thanks
<burgestrand> heisenmink: http://19pad.charlie.bz/1415
stewart_ has joined #ruby
<mrbrdo> or Integer.define_method or Integer.class_eval do ; def ...
<burgestrand> But if you want to follow good form you should do it in a module and include it.
tommyvyo has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
<burgestrand> Like so: http://19pad.charlie.bz/1416
ella has joined #ruby
cpruitt has quit [Quit: cpruitt]
ella has quit [Client Quit]
LBRapid has quit [Quit: Farewell...]
jgrevich_ has joined #ruby
<heisenmink> is wrapping a class in a module declaration equivalent to defining it with a namespae like: class Namespaec::Banana ?
timonv has quit [Remote host closed the connection]
<burgestrand> The final constant is named the same, but there are some differences. If you write class Namespace::Banana, it will raise an error if Namespace is not already defined.
fukushim_ has joined #ruby
jgrevich has quit [Ping timeout: 245 seconds]
jgrevich_ is now known as jgrevich
ivar has quit [Ping timeout: 265 seconds]
cordoval has left #ruby [#ruby]
fukushima has quit [Ping timeout: 276 seconds]
<mrbrdo> I don't think Ruby has namespaces, it only has Modules
<Hanmac> module are better then namespaces
<mrbrdo> sure :)
<apeiros_> modules are rubys namespaces.
<apeiros_> (and classes are modules, and thus namespaces too)
techhelp has quit [Quit: This computer has gone to sleep]
<apeiros_> s/classes are modules/Class inherits from Module/
<Hanmac> and module are mixins too
jgrevich has quit [Quit: jgrevich]
sparrovv has quit [Ping timeout: 240 seconds]
mneorr has quit [Remote host closed the connection]
perlsyntax has joined #ruby
looopy has joined #ruby
looopy has quit [Remote host closed the connection]
skogis has quit [Ping timeout: 248 seconds]
willyum has joined #ruby
Vert has joined #ruby
banseljaj is now known as imami|afk
niklasb has quit [Ping timeout: 248 seconds]
visof has joined #ruby
perlsyntax has quit [Remote host closed the connection]
harukomoto has joined #ruby
dnyy has joined #ruby
jwbuurlage has quit [Quit: jwbuurlage]
d3c has quit [Quit: Sleep]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
ChampS666 has joined #ruby
looopy has joined #ruby
mikepack has quit [Remote host closed the connection]
mrwalker has joined #ruby
t3los has quit [Quit: leaving]
looopy has quit [Remote host closed the connection]
heisenmink has quit [Ping timeout: 248 seconds]
hadees has joined #ruby
tommyvyo has joined #ruby
Axsuul has joined #ruby
<macmartine> How might I DRY this up? Notice the only difference is one gets event "in_future" while the other get those "in_past" https://gist.github.com/2759628
<seanstickle> What is that single pipe doing? |
<seanstickle> arr = arr | account.events.in_future(account.now).where(:client_id => self.id)
<seanstickle> Shouldn't that be arr ||= account.events.in_future(account.now).where(:client_id => self.id)
<canton7> seanstickle, bit-wise OR
<apeiros_> array-union?
<canton7> ^^ that's more likely
<seanstickle> Ah, array union, makes sense
<apeiros_> was just gonna say that bit-wise was unlikely :)
<apeiros_> but arr |= expr still works
Urth|Away is now known as Urthwhyte
<seanstickle> map would make even more sense
<apeiros_> Array.new --> []
<apeiros_> (Array.new considered bad style)
<apeiros_> also, why iterate? let the db find all in one query. there's no need to do multiple queries.
<seanstickle> macmartine: https://gist.github.com/2759665
<apeiros_> then you don't have to manually sort either
<seanstickle> Yeah, even better
<apeiros_> seanstickle: you miss a .uniq
<seanstickle> Oops, good point
<apeiros_> and prime example why I use {} for return value. `end.foo` looks silly
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<canton7> the odd variable won't hurt you :)
<seanstickle> Opinions differ :P
Tuxist has quit [Read error: Connection reset by peer]
<macmartine> Thanks guys. Oh, I need a ,uniq?
niklasb has joined #ruby
<apeiros_> Events.in_future(account.now).where(:account_id => accounts.map(&:id), :client_id => accounts.map(&:client_id)) # I *think* this should be correct
<apeiros_> meh, s/Events/Event/
<apeiros_> oh
<apeiros_> each account has its own "now"?
<fowl> u meant account_id: .., client_id: .. right?
<apeiros_> how odd…
<fowl> f that 1.8 stuff
<macmartine> apeiros_: yeah, different time zones
<apeiros_> macmartine: um, timezones don't change now…
<apeiros_> they only change the representation
<seanstickle> macmartine: updated https://gist.github.com/2759665
<macmartine> apeiros_: my account.now method : ActiveSupport::TimeZone.find_tzinfo(self.time_zone).now
<fowl> define_method :'^_^' do puts '^_^;'*234892830 end
<apeiros_> macmartine: for a query that's irrelevant
<apeiros_> the future is the future no matter what timezone you are…
<apeiros_> unless you have a weird (and IMO broken) way to store your time information.
ivar has joined #ruby
<heftig> macmartine: https://gist.github.com/2759658
nlc has quit [Quit: Leaving]
<macmartine> heftig: What is the .uniq for? I know what it does, but why is it needed here?
<heftig> flat_map concatenates
wallerdev has joined #ruby
<heftig> arr1 | arr2 also concatenates, then removes duplicates
<heftig> uniq removes duplicates.
<macmartine> ah. thanks, all
<apeiros_> heftig: actually it removes duplicates while concatenating :-p
<apeiros_> </nitpick>
<heftig> wah wah wah
<apeiros_> | doesn't ensure order either
<apeiros_> (it will be in order due to the way it is implemented)
<heftig> it's a union, but without the awesomeness that is Set
jimeh2 has quit [Quit: bye]
pangur has joined #ruby
netogallo has quit [Ping timeout: 248 seconds]
<CannedCorn> guys where can i learn to make an external iterator in ruby
fukushim_ has quit [Ping timeout: 244 seconds]
<apeiros_> so, literal_parser gem released.
visof has quit [Ping timeout: 246 seconds]
fukushima has joined #ruby
<pangur> a=names.sort; a.each do |n| puts n displays rows of names. If I do a.each do |n| puts n[0] instead, it gives me rows of what look like ascii values. What I really want to do is to split a on a comma but it does not let me do that.
ZachBeta has quit [Quit: Computer has gone to sleep.]
<heftig> first of all, eww 1.8 :( . use 1.9
* apeiros_ wonders how ruby should know that by n[0] pangur means "split by comma"
<heftig> anyway, n.split(",")
<pangur> Ah, it is n that I split rather than a.
<apeiros_> and probably not "puts", unless by saying "split by comma" you meant "the part before the first comma"
<pangur> THanks heftig :)
<apeiros_> and if you meant that, then .split is incomplete.
<pangur> I want to do split (', '), which is a comma and a space.
<heftig> split(/,\s*/)
<pangur> Is that what you mean?
jimeh has joined #ruby
<apeiros_> pangur: no, I mean that you'll not get a string back from split
<apeiros_> you'll get an array back
<apeiros_> and while puts can deal with an array as argument, it's quite possibly not doing what you want
<heftig> if you're not interested in what's after the comma, n[/^[^,]+/]
<pangur> I am interested in what is after the comma - It is stuff like "MacLeod, Calum", so what you are saying is very useful to me.
<macmartine> heftig: So, I only need that .uniq if multiple accounts can be associated with the same events, correct?
<heftig> yes
pro has joined #ruby
<pro> hello
<heftig> macmartine: but given sane time handling, apeiros_' way is probably the best
<pro> matchwinners += rps_game_winner(game[$i][0]) should increase matchwinner.size by 1 but it increases it by 2 because rps_game_winner returns 2 parts, how can i save them in one
<heftig> <<
<heftig> instead of +=
* pangur is grateful for the help that he has received.
<pangur> Thanks
mdw has quit [Remote host closed the connection]
<pro> thanks
notjohn has joined #ruby
schovi has quit [Remote host closed the connection]
TheFuzzball has quit [Write error: Connection reset by peer]
ZachBeta has joined #ruby
TheFuzzball has joined #ruby
mengu has joined #ruby
<apeiros_> pro: btw., the use of globals is not very pro.
mrwalker has quit [Remote host closed the connection]
* Hanmac not use globals in any of his own stuff
piotr_ has quit [Remote host closed the connection]
<CannedCorn> what is the best way to check if an object is enumerable?
<pangur> http://fpaste.org/j6RJ/ is my attempt to sort by surname. There must be a neater/shorter way.
<pangur> It works but it looks like a lot of effort for something very simple.
<burgestrand> CannedCorn: you often don’t. You check for the existence of methods instead using respond_to?
wvms has left #ruby [#ruby]
<CannedCorn> so, each might be a good one
<fowl> pangur, i would break them into names like [ [Fred, Smith], [Burger, Stand] ] and sort by x[1]
<kinesis> Hey how do i fix this (trying to generated random hex colors into an array) : http://pastebin.com/Wd67TcyC
<Hanmac> CannedCorn: the C way would be object.is_a?(Enumerable), the ruby way would be object.respond_to?(:each)
* pangur is considering what fowl has said.
kaneda has joined #ruby
<heftig> pangur: people.sort_by { |x| x.split.last }
kaneda is now known as Guest2137
looopy has joined #ruby
* pangur likes the look of heftig's suggestion.
kirun has left #ruby ["Client exiting"]
fr0gprince_mac has quit [Quit: Leaving...]
<Hanmac> pangur: there is an CSV lib in ruby stdlib
<fowl> pangur, names.sort_by { |n| n.match(/\s(\S+)$/)[1] }
* pangur is noting these suggestions. Like that one too, fowl.
griffindy has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<apeiros_> fowl: meet String#[] :-p
<CannedCorn> Hanmac ok cool
<pangur> Hanmac, I know about the csv module but wanted to learn how to do it "manually" too as it were :)
<CannedCorn> burgestrand thanks
<fowl> apeiros_, always forget about that
<apeiros_> kinesis: got an answer?
<fowl> names.sort_by { |n| n[/\S+$/] } looks a lot nicer
<pangur> Thanks fowl
<apeiros_> kinesis: Array#+ expects an Array as value (line 6)
<apeiros_> use <<, or go with colors = Array.new(16) { …color… } directly
<pangur> It just seemed to me to be so verbose - what I was doing - even though it worked. Thanks folks. Tomorrow, I shall try out these suggestions. It is heading towards midnight here in Paisley.
<apeiros_> also that way of generating the number has a heavy bias against 0xffffff (%0x rounds down)
<apeiros_> you should use rand(0x1000000) instead
pygospa has joined #ruby
pangur has quit [Remote host closed the connection]
cj3kim has joined #ruby
emet has joined #ruby
zastaph has quit []
dangerousdave has quit [Quit: Leaving...]
tommyvyo has joined #ruby
tommyvyo has quit [Client Quit]
Foxandxss has joined #ruby
nfk has quit [Quit: yawn]
ZachBeta has quit [Quit: Computer has gone to sleep.]
nilg has quit [Ping timeout: 245 seconds]
looopy has quit [Remote host closed the connection]
andrewhl has quit [Quit: andrewhl]
dsimon has joined #ruby
seanstickle has quit [Quit: seanstickle]
Solnse has quit [Read error: No route to host]
virunga has quit [Quit: Sto andando via]
ChampS666 has quit [Ping timeout: 244 seconds]
riyonuk has quit [Read error: Connection reset by peer]
wvms has joined #ruby
riyonuk has joined #ruby
Ontolog has joined #ruby
ChampS666 has joined #ruby
ChampS666 has quit [Client Quit]
indian has quit [Read error: Connection reset by peer]
tomb_ has joined #ruby
pdtpatr1ck has joined #ruby
niklasb has quit [Ping timeout: 252 seconds]
niklasb has joined #ruby
tayy has quit [Remote host closed the connection]
shruggar has quit [Quit: Leaving.]
phipes has joined #ruby
nej has joined #ruby
ZachBeta has joined #ruby
neilcarvalho has joined #ruby
<CannedCorn> is there a better way to do this: http://pastie.org/3942196
mpereira has joined #ruby
Beoran__ has quit [Ping timeout: 246 seconds]
Vert has quit [Remote host closed the connection]
altiouz has quit [Ping timeout: 244 seconds]
riyonuk has quit [Read error: Connection reset by peer]
becom33 has quit [Quit: Leaving]
<dsimon> CannedCorn, only thing i can think of is that you can shave off one line by doing (hash[key] ||= []) << value
<dsimon> i'm not sure if that's "better" though, just shorter
nari_ has joined #ruby
phipes has quit [Quit: phipes]
riyonuk has joined #ruby
Solnse has joined #ruby
indian has joined #ruby
indian has quit [Changing host]
indian has joined #ruby
telos has joined #ruby
<telos> hi, when i run dispatch.fcgi for RoR from the terminal, i get a load error for 'fcgi', traced back to rack-1.4.1/lib/rack/handler/fastcgi.rb . but i have fcgi installed.. any ideas on how to debug this?
stanigator has joined #ruby
<stanigator> does this error message mean spork is not installed? https://gist.github.com/c84b74d9b20f75ca8a20
nari__ has joined #ruby
flip_digits has quit [Quit: Computer has gone to sleep.]
xiaotian has joined #ruby
<dsimon> stanigator, more like it's just not properly installed
nari_ has quit [Ping timeout: 252 seconds]
<dsimon> hard to say what's wrong with it though; maybe broken GEMHOME?
MetaCosm has joined #ruby
<stanigator> dsimon: hmm...seems more like it, as i installed spork already
liluo has joined #ruby
<stanigator> dsimon: gemhome? or gemfile?
<dsimon> does that file it's talking about exist?
<dsimon> $GEMHOME, which is an environment variable that indicates where to find gem files
Beoran__ has joined #ruby
<stanigator> dsimon: the file exists
<dsimon> how strange!
<stanigator> dsimon: do i need to open the .bashrc?
<dsimon> can you read it as the user that the program is running as?
<dsimon> also, try "bundle show spork" to make sure bundle knows where it is
<stanigator> dsimon: what do you mean "can you read it as the user that the program is running as?"?
nari_ has joined #ruby
<dsimon> stanigator, i mean, the file exists, but there may be a permissions issue
<dsimon> so try running less on the file to make sure you can actually read it
iocor has quit [Quit: Computer has gone to sleep.]
nari__ has quit [Ping timeout: 245 seconds]
ryanf has joined #ruby
<stanigator> dsimon: looks like bundle is looking for the wrong version of cucumber when i executed spork: https://gist.github.com/9d51a16dc4c2f09b7194
techhelp has joined #ruby
looopy has joined #ruby
looopy has quit [Remote host closed the connection]
riyonuk has quit [Read error: Connection reset by peer]
riyonuk has joined #ruby