banisterfiend has quit [Ping timeout: 245 seconds]
BigO has quit [Remote host closed the connection]
bigmcq77 has joined #ruby
headius has joined #ruby
juarlex has quit [Ping timeout: 244 seconds]
jds has quit [Remote host closed the connection]
voodoofish has joined #ruby
generalissimo has quit [Remote host closed the connection]
aharris6 has quit [Remote host closed the connection]
jds has joined #ruby
chrisja has quit [Quit: leaving]
slainer68 has quit [Remote host closed the connection]
bradhe has quit [Remote host closed the connection]
Goles has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
friskd has quit [Ping timeout: 264 seconds]
jlwestsr has joined #ruby
<waxjar>
aces1up, look at Symbols, they're excellent for hash keys
jds has quit [Ping timeout: 265 seconds]
yshh has joined #ruby
bradhe has joined #ruby
beilabs has quit [Ping timeout: 256 seconds]
bradhe has quit [Remote host closed the connection]
beilabs has joined #ruby
danneu has joined #ruby
dmerrick has quit [Quit: dmerrick]
joeycarmello has quit [Remote host closed the connection]
bradhe has joined #ruby
Nisstyre-laptop has quit [Ping timeout: 244 seconds]
koshii has quit [Ping timeout: 248 seconds]
generalissimo has joined #ruby
koshii has joined #ruby
werdnativ has quit [Ping timeout: 245 seconds]
Drekonus has quit [Quit: Leaving.]
jbw has quit [Ping timeout: 245 seconds]
levabalkin has quit []
_alejandro has joined #ruby
whitedawg has quit [Quit: Leaving.]
chimkan has quit [Quit: chimkan]
googya has joined #ruby
chaosis has quit [Ping timeout: 260 seconds]
jarred has quit [Quit: jarred]
kapowaz has quit [Remote host closed the connection]
kapowaz has joined #ruby
kanzure has quit [Ping timeout: 246 seconds]
kanzure has joined #ruby
tyfighter has quit [Quit: tyfighter]
Choobie has left #ruby ["End"]
marr has quit [Ping timeout: 265 seconds]
nat26101 has left #ruby [#ruby]
bradhe has quit [Remote host closed the connection]
<ddd>
be wary about using symbols for hash keys though because the GC doesn't collect them, so if you have a bunch of hashes with differing keys each takes up non-reclaimable memory
Slivka has joined #ruby
moted has quit [Remote host closed the connection]
headius has quit [Quit: headius]
<Spaceghostc2c>
Except, you can GC them.
<ddd>
Spaceghostc2c: Uhh, no, you can not GC symbols
<waxjar>
isn't that exactly why they're so useful as hash keys?
<ddd>
a symbol is a symbol is a symbol. the GC ignores symbols
LouisGB has quit [Ping timeout: 256 seconds]
nateberkopec has joined #ruby
<ddd>
waxjar: depends as I said. are you reusing the same set of symbols for the keys? do you have many hashes each of which is using different sets of key names (as symbols)?
ikaros has quit [Quit: Ex-Chat]
<jrajav>
The reason you might use symbols in hash is to avoid hash computation
<ddd>
strings as keys get reclaimed (the memory freed). symbols do not
samphippen has quit [Quit: Computer has gone to sleep.]
x82_nicole has quit [Quit: Computer has gone to sleep.]
blazes816 has quit [Quit: blazes816]
JayneCobb is now known as Lemtzas
jds has joined #ruby
<waxjar>
hmm, that's a good point ddd.
Goles has quit [Remote host closed the connection]
headius has joined #ruby
<jrajav>
It's unlikely to be a real problem in practice
jonahR has joined #ruby
<jrajav>
Because symbols are almost always made as in-place literals
EPIK has quit []
<Spaceghostc2c>
ddd: I'm pretty sure that ruby can. I remember davidcelis linking to something about it.
<ddd>
nope, not if you're controlling symbol creation it shouldn't be. but if you're doing something like allowing users to upload files and converting the guts to hash representations (say uploading CSV files and converting them to hashes) then you could come into problems.
slainer68 has joined #ruby
<Spaceghostc2c>
I'll wait for david to get back online.
<jrajav>
Symbols are added to the symbol hash table and never removed
<ddd>
Spaceghostc2c: no, the GC does not reclaim symbols. it specifically ignores them.
mahmoudimus has quit [Quit: Computer has gone to sleep.]
xyzodiac has joined #ruby
<ddd>
if you're talking about the other night, he was joking. he presented a fake method just for laughs
manizzle has quit [Ping timeout: 248 seconds]
<Spaceghostc2c>
Mkay, still going to wait for david and ask for his link on this subject. He mentioned it last week.
<Spaceghostc2c>
Oh, I didn't read it.
<ddd>
hehe yeah, you missed the key to that entire thing then. he was troll-joking
<Spaceghostc2c>
I try not to read his links unless they sound interesting.
EPIK has joined #ruby
<Spaceghostc2c>
I agree on the whole indifferent access hash being ugh, and programmatically converting strings to symbols being ugh as well.
chimkan has joined #ruby
jojosiao has joined #ruby
wookiehangover has quit [Ping timeout: 264 seconds]
mrsolo has quit [Quit: This computer has gone to sleep]
savage- has quit [Remote host closed the connection]
jds has quit [Ping timeout: 260 seconds]
rafacv has left #ruby [#ruby]
perun_ has quit [Ping timeout: 260 seconds]
wookiehangover has joined #ruby
chimkan has quit [Quit: chimkan]
xyzodiac has joined #ruby
slainer68 has quit [Ping timeout: 252 seconds]
syamajala has joined #ruby
u89 has quit [Remote host closed the connection]
jlwestsr has quit [Quit: Ex-Chat]
dagnachew has quit [Quit: Leaving]
chimkan_ has joined #ruby
dagnachew has joined #ruby
pu22l3r has joined #ruby
Nisstyre-laptop has joined #ruby
bigmcq77 has quit [Quit: Computer has gone to sleep.]
jekotia has joined #ruby
jbw has joined #ruby
kil0byte has joined #ruby
anna_ has quit [Ping timeout: 244 seconds]
manizzle has joined #ruby
generalissimo has quit [Remote host closed the connection]
dmiller has quit [Remote host closed the connection]
Guest62032 has quit [Ping timeout: 264 seconds]
perun_ has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
anna_ has joined #ruby
wookiehangover has quit [Ping timeout: 248 seconds]
bradhe has joined #ruby
daniel_- has quit [Ping timeout: 245 seconds]
bricker_ has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
ttt has joined #ruby
bricker has quit [Quit: leaving]
Chat0910 has joined #ruby
bricker_ is now known as bricker
baroquebobcat has joined #ruby
bradhe has quit [Remote host closed the connection]
<Chat0910>
>.>
joshman_ has quit [Quit: Computer has gone to sleep.]
bradhe has joined #ruby
ghosTM55 has joined #ruby
Chat0910 has quit [Client Quit]
Liothen has joined #ruby
c0rn has quit [Quit: Computer has gone to sleep.]
wookiehangover has joined #ruby
leonardorb has quit [Remote host closed the connection]
gyre007 has joined #ruby
ghosTM55 has quit [Quit: leaving]
h4mz1d has joined #ruby
bambanx has joined #ruby
<bambanx>
sup
dmiller has joined #ruby
<bambanx>
guys how i can get the list of files and folders from a path ? i am using this but i forget how all_files = Dir.glob('C:/Users/madcat/Documents/ruby/')
pu22l3r has quit [Remote host closed the connection]
jrunning has quit [Read error: Connection reset by peer]
jds has joined #ruby
hackerdude has quit [Remote host closed the connection]
Farrel has joined #ruby
jrist-afk is now known as jrist
robbyoconnor has joined #ruby
jrajav has quit [Quit: I tend to be neutral about apples]
anna_ has quit []
sn0wb1rd has quit [Quit: sn0wb1rd]
Farrel has quit [Remote host closed the connection]
<shevy2>
bambanx rememeber to use * too
<shevy2>
Dir['C:/Users/madcat/Documents/ruby/*']
shevy2 is now known as shevy
<bambanx>
ok shevy2
areil has joined #ruby
aetcore has quit [Ping timeout: 260 seconds]
<bambanx>
now works thanks shevy2 and eka
<eka>
np
bricker has quit [Quit: Lost terminal]
jds has quit [Ping timeout: 256 seconds]
bricker has joined #ruby
twopoint718 has joined #ruby
twopoint718 has quit [Changing host]
twopoint718 has joined #ruby
aetcore has joined #ruby
ryanf has joined #ruby
dagnachew has quit [Remote host closed the connection]
rakl has quit [Quit: sleeping]
bradhe has quit [Remote host closed the connection]
nateberkopec has quit [Quit: Leaving...]
dankest has quit [Quit: Leaving...]
mjolk has joined #ruby
gridaphobe has quit [Ping timeout: 260 seconds]
joeycarmello has joined #ruby
bambanx has quit [Ping timeout: 260 seconds]
Drekonus has joined #ruby
BoomCow has quit [Quit: Leaving]
voodoofish430 has quit [Quit: Leaving.]
bambanx has joined #ruby
mmitchell has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
syamajal_ has joined #ruby
syamajala has quit [Read error: Connection reset by peer]
joeycarmello has quit [Ping timeout: 260 seconds]
bricker_ has joined #ruby
mybrainis404 has quit [Ping timeout: 245 seconds]
drago757 has joined #ruby
baroquebobcat has joined #ruby
bricker has quit [Quit: Lost terminal]
ryanf has quit [Ping timeout: 255 seconds]
sn0wb1rd has joined #ruby
danneu has quit [Quit: WeeChat 0.3.8]
chimkan_ has quit [Quit: chimkan_]
ryanf has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
bricker_ is now known as bricker
mrbrdo has quit [Read error: Connection reset by peer]
nat2610 has joined #ruby
Bry8Star has joined #ruby
mrbrdo has joined #ruby
syamajal_ has quit [Remote host closed the connection]
J-_-L has joined #ruby
g-ram has quit [Quit: Computer has gone to sleep.]
baroquebobcat has quit [Quit: baroquebobcat]
slainer68 has joined #ruby
Spaceghostc2c has quit [Excess Flood]
nat2610 has quit [Client Quit]
niklasb has quit [Read error: Operation timed out]
Spaceghostc2c has joined #ruby
froy has quit [Quit: kablam!]
niklasb has joined #ruby
xpen has joined #ruby
lenovodroid has quit [Read error: Connection reset by peer]
slainer68 has quit [Ping timeout: 260 seconds]
lenovodroid has joined #ruby
havenn has joined #ruby
jharris has quit [Quit: WeeChat 0.3.8]
eka has quit [Remote host closed the connection]
bradhe has joined #ruby
aetcore has quit [Ping timeout: 252 seconds]
twopoint718 has quit [Ping timeout: 244 seconds]
bradhe has quit [Remote host closed the connection]
eka has joined #ruby
alta has quit [Ping timeout: 244 seconds]
_nitti has joined #ruby
adeponte has quit [Remote host closed the connection]
GowGuy47 has joined #ruby
eka has quit [Remote host closed the connection]
ossareh has quit [Ping timeout: 250 seconds]
Hanmac1 has joined #ruby
aetcore has joined #ruby
<GowGuy47>
Can somebody tell me whats wrong with this simple video renaming script: https://gist.github.com/4200114 ?? I can't seem to get the mv command to work. I am working with filenames like this: "Louie.S03E12.Late.Show.Pt.3.480p.WEB-DL.x264-mSD.mkv"
Hanmac has quit [Ping timeout: 264 seconds]
alta has joined #ruby
ner0x has joined #ruby
_nitti has quit [Ping timeout: 256 seconds]
nateberkopec has joined #ruby
yshh has quit [Read error: Connection reset by peer]
<reactormonk>
GowGuy47, use Dir.entries instead of %x(ls)
yshh has joined #ruby
chessguy has joined #ruby
L1 has quit [Quit: Quitter]
bricker has quit [Quit: Lost terminal]
<GowGuy47>
reactormonk Ok, I can do that. But is that a problem?
sorbo_ has joined #ruby
<reactormonk>
GowGuy47, it may be, if your filenames contain strange characters
jeffreybaird has joined #ruby
<reactormonk>
GowGuy47, and you can just use FileUtils.mv
<reactormonk>
no need to shell out
<GowGuy47>
hm cool.
<GowGuy47>
I'll look into the ruby kernel methods more, which I am guessing is what those are?
jeffreybaird has quit [Client Quit]
advorak has joined #ruby
Drekonus has quit [Quit: Leaving.]
pipopopo has quit [Read error: Operation timed out]
Drekonus has joined #ruby
mahmoudimus has joined #ruby
Tref has joined #ruby
aef has joined #ruby
pipopopo has joined #ruby
DanDaMan1200 has joined #ruby
<DanDaMan1200>
Hello anyone here?
<sorbo_>
nope, just 704 chat bots, a dead hooker, and you
<DanDaMan1200>
in that case I didn't do it... lol
<chessguy>
grand jury's gonna love that...
<DanDaMan1200>
ok Im having an issue with my htc amaze
<DanDaMan1200>
I unlocked the bootloader (htc dev) Im not rooted, I had supersu.zip downloaded but I have no idea how to flash the file since my phone is not rooted
<chessguy>
have you talked to your doctor about that?
<DanDaMan1200>
it won't allow me to give su permissions to rom manager , and it won't let me boot from sd card yet because Im not rooted
* GowGuy47
is amazed
joeycarmello has joined #ruby
<GowGuy47>
DanDaMan1200 Where you think you are right now budday?
joeycarmello has quit [Remote host closed the connection]
<chessguy>
DanDaMan1200: this channel is for the ruby programming language :)
<chessguy>
not for the htc ruby
<DanDaMan1200>
ohhhhhhhhhh lol
J-_-L has quit [Quit: Leaving.]
<DanDaMan1200>
dang lol
<GowGuy47>
try #android
<DanDaMan1200>
ty
Drekonus has left #ruby [#ruby]
aef has quit [Remote host closed the connection]
joeycarmello has joined #ruby
swarley| has joined #ruby
aef has joined #ruby
swarley- has quit [Read error: Connection reset by peer]
mascool has quit [Ping timeout: 252 seconds]
elkclone has joined #ruby
gbchaosmaster has quit [Quit: leaving]
DanDaMan1200 has quit [Quit: DanDaMan1200]
swarley- has joined #ruby
aef has quit [Remote host closed the connection]
aef has joined #ruby
ffranz1 has joined #ruby
cousine has joined #ruby
aef has quit [Remote host closed the connection]
aef has joined #ruby
swarley| has quit [Ping timeout: 246 seconds]
leonardorb has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
dmiller has quit [Ping timeout: 260 seconds]
jds has joined #ruby
swarley- has quit [Ping timeout: 246 seconds]
jeremywrowe has joined #ruby
ffranz has quit [Ping timeout: 260 seconds]
v0n has joined #ruby
dmiller has joined #ruby
leonardorb has quit [Ping timeout: 245 seconds]
jds has quit [Ping timeout: 260 seconds]
headius has quit [Quit: headius]
yshh has quit [Read error: Connection reset by peer]
xyzodiac has joined #ruby
yshh has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
mahmoudimus has joined #ruby
slash_nick has joined #ruby
busybox42 has quit [Ping timeout: 248 seconds]
ssspiff has joined #ruby
jojosiao has quit [Ping timeout: 252 seconds]
Synthead has quit [Ping timeout: 245 seconds]
danshultz has joined #ruby
sspiff has quit [Ping timeout: 252 seconds]
jenrzzz has joined #ruby
<slash_nick>
attraccessor/mattraccessor, does it matter?
tommyvyo has quit [Quit: Computer has gone to sleep.]
tommyvyo_ is now known as tommyvyo
freakazoid0223 has quit [Quit: Leaving]
amaya_the has joined #ruby
<slash_nick>
seems like the latter is a rails thing
nwertman has quit [Remote host closed the connection]
<sorbo_>
yeah
<sorbo_>
the latter is a rails thing, it provides getter/setter methods at the module level
bradhe has joined #ruby
<sorbo_>
attr_accessor is for instances
<slash_nick>
instances of, say, a module?
<sorbo_>
mattr_accessor is a rails thing for modules
<slash_nick>
I'm getting rid of it, was just wondering why it wouldn't complain to me... I do have active_support going though :) don't see where mattr_accessor is in that.
<Spaceghostc2c>
I'm impressed each time someone thinks I have any idea that I know what I'm saying.
roadt_ has joined #ruby
headius has quit [Quit: headius]
<hemanth>
Spaceghostc2c, lol
<Spaceghostc2c>
Put a space between << and self?
<Spaceghostc2c>
Otherwise, I don't know shit.
<hemanth>
Spaceghostc2c, that does not matter, anyway with your skills you can crack an interview easily
<Spaceghostc2c>
:D
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
<Spaceghostc2c>
I kick ass at interviews.
yacks has joined #ruby
xyzodiac has joined #ruby
generalissimo has joined #ruby
amaya_the has joined #ruby
CreativeEmbassy has joined #ruby
<hemanth>
Spaceghostc2c, I spoil most of the time, cos i make the interviewer feel he doesn't know a $hit :\
h4mz1d has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
rakunHo has joined #ruby
fir_ed has joined #ruby
i_s has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
baroquebobcat has joined #ruby
jarred_ has joined #ruby
<BoomCow>
I shotgun interviews
<BoomCow>
at least for my first job
<RubyPanther>
hemanth: doesn't know shit, like what the error you actual got was?
<BoomCow>
went for quantity
zaki has quit [Ping timeout: 255 seconds]
<RubyPanther>
interviews are for the weak
<RubyPanther>
stonewall until they fax an offer
<BoomCow>
what's stone wall
<Spaceghostc2c>
It works!
wallerdev has joined #ruby
<Spaceghostc2c>
RubyPanther: By the way, an interview isn't an opportunity for me to get a job, it's an opportunity for them to get me.
JohnBat26 has joined #ruby
slainer68 has joined #ruby
sorbo_ has quit [Quit: sorbo_]
<hemanth>
RubyPanther, heh heh, nah...https://gist.github.com/4ffa1f0c197d4ef572b0 trying that with ruby 1.9.X but getting error : 'Undefined method attach for Class (NameError)"
<RubyPanther>
Spaceghostc2c: And they haven't proven themselves worthy of that time until they've sent the offer!
dankest has joined #ruby
<Spaceghostc2c>
RubyPanther: :D
<hemanth>
interviews are crap, useless, waste of time!
<RubyPanther>
Why did I load that gist _again_ when it still didn't have the error?
<Spaceghostc2c>
They let me know how they treat new people.
<hemanth>
'Undefined method attach for Class (NameError)' RubyPanther
<RubyPanther>
If that is the way the interview went, the interviewer might not have actually been feeling like they don't know shit, they might just be getting sarcastic and be dead-panning it
roadt_ has quit [Ping timeout: 246 seconds]
xsbeats has quit [Quit: leaving]
<hemanth>
RubyPanther, hmm, well it's all relative
roadt_ has joined #ruby
mneorr has quit [Remote host closed the connection]
<RubyPanther>
I once had an aggressive interviewer telling me that I should be selling myself and that there were x number of sysadmin layoffs the past year, and when his face turned red I bursted out laughing... he got so mad, "Are you laughing at me???!?" At least I got some entertainment out of the train ride though
slainer68 has quit [Ping timeout: 260 seconds]
_nitti has joined #ruby
malkomalko has quit [Remote host closed the connection]
jrist is now known as jrist-afk
<havenn>
I like to light up a joint if the interview isn't going well.
<Spaceghostc2c>
LOL
ryanf has quit [Quit: leaving]
<Spaceghostc2c>
My favorite interview was when they wanted me to whiteboard real code. I just drew funny pictures and asked them if the toilets were backed up, because it was such a shitty place.
<Spaceghostc2c>
They didn't get the joke.
<Spaceghostc2c>
I bet my drawings stayed up there a while though.
jenrzzz has joined #ruby
browndawg has joined #ruby
fir_ed has quit [Ping timeout: 264 seconds]
WaGE has joined #ruby
<Spaceghostc2c>
I'm no artist though, they might've thought it some arcane invocation.
havenn has quit [Remote host closed the connection]
_nitti has quit [Ping timeout: 256 seconds]
<Spaceghostc2c>
I owe radar a funny one though. I have ot remember it.
krz has joined #ruby
WaGE has left #ruby [#ruby]
zaki has joined #ruby
FifthWall has joined #ruby
tomsthumb has quit [Ping timeout: 244 seconds]
cj3kim has joined #ruby
havenn has joined #ruby
i_s has quit [Quit: i_s]
ananthakumaran has quit [Quit: Leaving.]
burgestrand has joined #ruby
mneorr has joined #ruby
Targen has joined #ruby
mmitchell has joined #ruby
Targen has quit [Remote host closed the connection]
tomsthumb has joined #ruby
mmitchell has quit [Ping timeout: 260 seconds]
bradhe has joined #ruby
tomsthumb1 has joined #ruby
joeycarmello has quit [Remote host closed the connection]
Shrink has joined #ruby
tomsthumb has quit [Ping timeout: 256 seconds]
h4mz1d has quit [Ping timeout: 260 seconds]
ner0x has quit [Quit: Leaving]
centipedefarmer has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
tomsthumb1 has quit [Ping timeout: 264 seconds]
Bosma has joined #ruby
tPl0ch has joined #ruby
g-ram has joined #ruby
JStoker has quit [Excess Flood]
werdnativ has joined #ruby
chessguy has quit [Remote host closed the connection]
Shrink has quit [Quit: ta]
bradhe has quit [Remote host closed the connection]
virtualentity has quit []
mikepack has quit [Remote host closed the connection]
tomsthumb has joined #ruby
JStoker has joined #ruby
virtualentity has joined #ruby
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
xyzodiac has quit [Quit: Computer has gone to sleep.]
h4mz1d has joined #ruby
tomsthumb1 has joined #ruby
Seventoes has quit [Ping timeout: 256 seconds]
chimkan has quit [Quit: chimkan]
burgestrand has quit [Quit: Leaving.]
v0n has quit [Ping timeout: 250 seconds]
segv- has joined #ruby
h4mz1d has quit [Ping timeout: 260 seconds]
JStoker has quit [Excess Flood]
tomsthumb has quit [Ping timeout: 244 seconds]
mneorr has quit [Remote host closed the connection]
tomsthumb has joined #ruby
tomsthumb1 has quit [Read error: Connection reset by peer]
Niamkik has quit [Quit: Disconnecting from stoned server.]
Niamkik has joined #ruby
MissionCritical has quit [Ping timeout: 248 seconds]
ananthakumaran has joined #ruby
JStoker has joined #ruby
JStoker has quit [Excess Flood]
mneorr has joined #ruby
havenn has quit [Ping timeout: 265 seconds]
cj3kim has quit [Quit: This computer has gone to sleep]
jrajav has quit [Quit: I tend to be neutral about apples]
cj3kim has joined #ruby
bricker has joined #ruby
drago757 has quit [Quit: drago757]
joeycarmello has joined #ruby
margle has joined #ruby
Mission-Critical has joined #ruby
SPYGAME has joined #ruby
slainer68 has joined #ruby
rohit has quit [Quit: Leaving]
bricker has quit [Quit: Lost terminal]
h4mz1d has joined #ruby
JStoker has joined #ruby
reset has quit [Ping timeout: 245 seconds]
slainer68 has quit [Ping timeout: 264 seconds]
Mission-Critical is now known as MissionCritical
kil0byte has quit [Remote host closed the connection]
havenn has joined #ruby
havenn has quit [Remote host closed the connection]
L1 has joined #ruby
L1 has quit [Changing host]
L1 has joined #ruby
tjbiddle has joined #ruby
i_s has joined #ruby
fyolnish has joined #ruby
poisonarms has joined #ruby
jekotia has quit [Quit: raaaaaage sleeeeeeeeep]
h4mz1d has quit [Ping timeout: 246 seconds]
rippa has joined #ruby
jojosiao has quit [Ping timeout: 248 seconds]
tjbiddle has quit [Quit: tjbiddle]
arabi has joined #ruby
gabrielrotbart has quit [Remote host closed the connection]
malkomalko has joined #ruby
CreativeEmbassy has joined #ruby
jenrzzz has quit [Ping timeout: 265 seconds]
swex_ has joined #ruby
friskd has joined #ruby
malkomalko has quit [Ping timeout: 252 seconds]
swex has quit [Read error: Operation timed out]
ryanf has joined #ruby
<pen>
I'm using sinatra, and I have included a gem that it requires me to include a file from its vendor directory, but I don't know how to access it from sinatra app
<pen>
anyone know how?
Leo has joined #ruby
bradhe has joined #ruby
jojosiao has joined #ruby
Bosma has quit [Quit: leaving]
bradhe has quit [Remote host closed the connection]
luckyruby has quit [Remote host closed the connection]
x82_nicole has quit [Quit: Computer has gone to sleep.]
osvico has quit [Read error: Connection reset by peer]
Leo has quit []
dpg has quit [Quit: dpg]
cantonic_ has joined #ruby
burgestrand has joined #ruby
dhruvasagar has quit [Ping timeout: 260 seconds]
cantonic has quit [Ping timeout: 252 seconds]
cantonic_ is now known as cantonic
freeayu_ has quit [Remote host closed the connection]
djdb has joined #ruby
freeayu has joined #ruby
osvico has joined #ruby
Vert has quit [Read error: Connection reset by peer]
Takehiro has quit [Remote host closed the connection]
vasile has quit [Read error: Operation timed out]
dhruvasagar has joined #ruby
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
mercwithamouth has joined #ruby
pcarrier has quit []
fyolnish has quit [Remote host closed the connection]
tagrudev has joined #ruby
havenn has joined #ruby
dhruvasagar has quit [Ping timeout: 244 seconds]
slash_nick has quit [Ping timeout: 245 seconds]
<poisonarms>
Can anyone tell me the "why" behind the use of symbols or can anyone point me to a resource that discusses the use of symbols? Are symbols just glorified constants?
bigmcq77 has joined #ruby
tommyvyo has joined #ruby
dhruvasagar has joined #ruby
rohit has joined #ruby
CreativeEmbassy has joined #ruby
error_code has quit [Read error: Connection reset by peer]
error_code_ has joined #ruby
i_s has quit [Quit: i_s]
dhruvasagar has quit [Ping timeout: 255 seconds]
dmiller has quit [Remote host closed the connection]
jackdanger has joined #ruby
i_s has joined #ruby
BoomCow has quit [Quit: This computer has gone to sleep]
ryanlecompte has joined #ruby
Takehiro has joined #ruby
BoomCow has joined #ruby
keith_hanson has joined #ruby
keyvan has joined #ruby
keyvan has joined #ruby
keyvan has quit [Changing host]
ninp0 has quit [Ping timeout: 245 seconds]
starship has quit [Quit: WeeChat 0.4.0-dev]
_nitti has joined #ruby
BoomCow has quit [Ping timeout: 260 seconds]
Tearan has quit [Quit: Sleepy Badger....]
keith_hanson has left #ruby [#ruby]
<reactormonk>
anyone knows a meme generator that a) doesn't use flash b) lets you download the image in an acceptable resolution?
_nitti has quit [Ping timeout: 260 seconds]
baphled has joined #ruby
zommi has joined #ruby
elsifaka has joined #ruby
mercwithamouth has quit [Ping timeout: 255 seconds]
apeiros_ has quit [Remote host closed the connection]
tPl0ch has quit [Quit: Verlassend]
<burgestrand>
poisonarms: symbols are an optimization.
<burgestrand>
poisonarms: whenever you type out a string, no matter how, it’s always a new string, a new object for that string.
<burgestrand>
poisonarms: so "hello".object_id != "hello".object_id
bradhe has joined #ruby
<burgestrand>
poisonarms: since ruby can’t look at the object identity, during comparison ruby must look through the entire string if testing for e.g. equality.
Monie has joined #ruby
arabi has quit [Ping timeout: 260 seconds]
phelps has joined #ruby
<burgestrand>
poisonarms: "hello" == "hello" must, in other words, be tested character for character.
<burgestrand>
poisonarms: now, in some cases you don’t care much about this, you just need an identifier, but you don’t want to just use a numeric ID because it’s very confusing to litter your code with magic numbers that mean different things.
<burgestrand>
poisonarms: one example could be keys in a hash, { "name" => "Carl" }.
Hanmac has joined #ruby
<burgestrand>
poisonarms: you could make the lookup very fast (no need for lengthy comparison) by using a number, since a number is always the same as the same number (5 is always 5, they can never be different), you could write the hash: NAME_ID = 5; { NAME_ID => "Carl" }
* Hanmac
prefers symbols for that
<burgestrand>
poisonarms: eventually this becomes troublesome because of several reasons: NAME_ID could be just about any value, doesn’t matter which, it could collide with other constants (LAST_NAME_ID = 5, and you have trouble on your hands) and whatnot.
maesbn has joined #ruby
Monie has quit [Client Quit]
<burgestrand>
poisonarms: so instead of doing this, you could instead use a symbol, symbols are like numbers, in that way they are always the same object. :hello.object_id == :hello.object_id, so comparison is incredibly fast.
iamjarvo has quit [Quit: Leaving.]
<Hanmac>
rubys symbol are like enums in C/C++ ... only more cool
<burgestrand>
poisonarms: but unlike numbers, symbols have some meaning because they *are* their names, you don’t need to assign a value to a symbol because the value is the symbol. Now you can write { :name => "Carl" } and the lookup of hash[:name] is fast.
<burgestrand>
poisonarms: in addition, :name will never collide with :last_name, :name != :last_name, while NAME_ID might be equal to LAST_NAME_ID.
<poisonarms>
I see
<burgestrand>
poisonarms: the one thing to look out for with symbols is creating them dynamically. Ruby never garbage collects symbols (which is why :hello.object_id == :hello.object_id), so if you create thousands, millions, you will have many symbols in your program that are just taking up space.
<burgestrand>
poisonarms: but when used right, this is a nice quality, since using symbols will not slow down ruby when ruby needs to clean out the garbage.
Seventoes has joined #ruby
<poisonarms>
Gotcha. Thanks for taking the time.
ABK has joined #ruby
* burgestrand
bows
Juul has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
tommyvyo has joined #ruby
a_a_g has joined #ruby
<Hanmac>
i create hundrets of symbols but i think it should be okay because i know what i do :P
<maasha>
I need some code organization going on. If I add a match method to this module of mine, then rake test breaks: /opt/local/lib/ruby1.9/1.9.1/optparse.rb:332:in `initialize': unhandled exception
lkba has quit [Ping timeout: 260 seconds]
<maasha>
I suspect I am redefining a match method somewhere?
dhruvasagar has joined #ruby
nilg has joined #ruby
<maasha>
So, how to track this down?
m4rtijn has joined #ruby
<m4rtijn>
hi
cascalheira has joined #ruby
atno has joined #ruby
jdripper has joined #ruby
<maasha>
what has optparse to do with this anyway. I am not even using it?
<banisterfiend>
maasha: stick a binding.pry in there and look around
nomenkun has quit [Read error: Connection reset by peer]
xpen has joined #ruby
nomenkun has joined #ruby
<maasha>
banisterfiend: so the issues arises when I include this module containing a def match; end;. Removing the match the problem goes away. Smells of name space collision? What to pry?
SPYGAME has quit [Quit: Leaving]
<Hanmac>
maasha show us your code
<Xeago>
before your definition of match you could put a binding.pry
<Xeago>
so you can repl around at that moment
withnale has quit [Excess Flood]
<maasha>
Xeago: problem happens when including the module.
withnale has joined #ruby
withnale has quit [Remote host closed the connection]
nomenkun has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
<Xeago>
if you include it, the code gets evaluated, and so will binding.pry which stops evaluation and puts you in a repl
<Xeago>
and then you can repl around just before match gets defined, and figure out what match does
zf_ has joined #ruby
vlad_sta_ has joined #ruby
nomenkun has joined #ruby
ebouchut_ has quit [Quit: Quitte]
withnale has joined #ruby
robbyoconnor has quit [Ping timeout: 255 seconds]
faoiseamh has quit [Read error: Connection reset by peer]
estan_ has joined #ruby
Shamgar has quit [Read error: Operation timed out]
jrist-afk has quit [Read error: Operation timed out]
faoiseamh has joined #ruby
withnale has quit [Client Quit]
a215 has quit [Read error: Operation timed out]
vlad_starkov has quit [Ping timeout: 256 seconds]
estan has quit [Ping timeout: 256 seconds]
xargoon has quit [Ping timeout: 256 seconds]
jsilver has quit [Read error: Operation timed out]
awarner has quit [Remote host closed the connection]
<altious>
json_pure-1.6.7
machty has joined #ruby
<altious>
oh, wait
<altious>
VERSION = '1.5.4'
<altious>
Ж(
jeffreybaird has quit [Quit: jeffreybaird]
sepp2k1 has quit [Remote host closed the connection]
ner0x has joined #ruby
tjbiddle has joined #ruby
tjbiddle has quit [Client Quit]
Criztian has joined #ruby
Jasko has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
Virunga has joined #ruby
grzywacz has joined #ruby
moshee has quit [Ping timeout: 265 seconds]
moshee has joined #ruby
hsbt_away is now known as hsbt
Criztian has quit [Ping timeout: 246 seconds]
freeayu has joined #ruby
geekbri has joined #ruby
s1n4 has quit [Quit: leaving]
Vert has joined #ruby
mfridh has quit [Read error: Operation timed out]
daniel_- has joined #ruby
browndawg has joined #ruby
krz has joined #ruby
altious has quit [Ping timeout: 246 seconds]
babinho has joined #ruby
marr has quit [Ping timeout: 264 seconds]
hamed_r has quit [Quit: Leaving]
amaya_the has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
tommyvyo has joined #ruby
jrist-afk is now known as jrist
amaya_the_ has quit [Ping timeout: 244 seconds]
kil0byte_ has joined #ruby
browndawg has left #ruby [#ruby]
v0n has joined #ruby
_nitti has joined #ruby
jlwestsr has joined #ruby
kil0byte has quit [Ping timeout: 264 seconds]
leonardorb has quit [Remote host closed the connection]
KevinSjoberg has joined #ruby
dr_bob has quit [Quit: Leaving.]
sailias has joined #ruby
_nitti has quit [Ping timeout: 260 seconds]
samphippen has joined #ruby
zzyybb has joined #ruby
elaptics has quit [Quit: Coyote finally caught me]
undersc0re97 has quit [Read error: Connection reset by peer]
elaptics has joined #ruby
zzyybb has quit [Client Quit]
dr_bob has joined #ruby
jameshyde_ has joined #ruby
aquaranto has joined #ruby
bonemind has joined #ruby
kil0byte has joined #ruby
RudyValencia has quit [Quit: Hacked By Chinese!]
Guest30882 has joined #ruby
iamjarvo has joined #ruby
mikepack has joined #ruby
kil0byte_ has quit [Ping timeout: 256 seconds]
beiter_ has joined #ruby
undersc0re97 has joined #ruby
kf8a has joined #ruby
beiter has quit [Ping timeout: 260 seconds]
beiter_ is now known as beiter
cakehero has joined #ruby
danshult_ has joined #ruby
radic_ has quit [Excess Flood]
danshult_ has quit [Remote host closed the connection]
danshultz has joined #ruby
radic has joined #ruby
maasha has quit [Quit: Page closed]
tjbiddle has joined #ruby
<m4rtijn>
I just had a discussion with a collegue, We have a project where we work a lot with hashes.. the objects are instantiated with json hash, and saved as bson hash in mongodb
<m4rtijn>
I just started creating classic ruby classes with attr_reader and initializer and such
niklasb has joined #ruby
<m4rtijn>
he proposed using openstruct instead..
<m4rtijn>
i googled a bit.. seems there's no real disadvantage in using structs here..
pu22l3r has joined #ruby
<Xeago>
m4rtijn: is it struct vs openstruct or class vs struct vs openstruct?
a_a_g has joined #ruby
GuestGuestGuest has joined #ruby
<m4rtijn>
Xeago, class vs struct/openstruct
<Xeago>
in any case, I think there is little difference
<m4rtijn>
anything I could propose which could defend my neat way, I just enjoy classes more.. tbh.
<Xeago>
m4rtijn: unneeded inheritance complexity
<m4rtijn>
its feals cleaner
<m4rtijn>
feels*
<Xeago>
m4rtijn: I think ruby is single inheritance right?
<Xeago>
possibility to provide your own base class instead of struct
<m4rtijn>
it is
froy has quit [Remote host closed the connection]
<workmad3>
m4rtijn: struct is different to openstruct btw
Spaceboy has quit [Remote host closed the connection]
<m4rtijn>
hi workmad3 ;)
<m4rtijn>
yes, but principally the same
<shevy>
it is all a bit confusing because the design features are orthogonal
<shevy>
do you want to write a class Sword, which is a subclass from Weapon
<shevy>
or do you want to rather assemble it like in components via modules
<shevy>
or do you want to do:
<shevy>
Sword = Struct.new(:length, :weight)
<shevy>
sword = Sword.new(120, 4.5)
<m4rtijn>
shevy, modules.. no subclasses really
<shevy>
:)
<shevy>
how often do you people use private btw?
jharris1 has joined #ruby
<workmad3>
or maybe you compose it from classes? so you'd have a hilt class and a blade class, and a sword class that composes them together
<workmad3>
lots of ways of organising your code... which one makes the most sense? :)
<m4rtijn>
we have a thread class
<m4rtijn>
with participants and messages
cousine has quit [Remote host closed the connection]
<workmad3>
m4rtijn: I hope that you've namespaced that
<m4rtijn>
in mogodb.. messages and participants are just embedded docs in thread
<m4rtijn>
workmad3, yes ofcourse
<workmad3>
and yes, a thread is a good example of composition
<shevy>
workmad3 cleanest, shortest and most elegant way should always win :)
Banistergalaxy has joined #ruby
ksk has quit [Ping timeout: 256 seconds]
chussenot has quit [Quit: chussenot]
<m4rtijn>
so , i believe I have no good ammunition to fire against structs...
<m4rtijn>
damnit :)
GoGoGarrett has joined #ruby
<workmad3>
m4rtijn: if all you need is a container for some data, a struct is a good choice actually ;)
AndChat| has quit [Ping timeout: 245 seconds]
<m4rtijn>
hehe
<m4rtijn>
okay.. thanks a lot guys
twopoint718 has joined #ruby
twopoint718 has quit [Changing host]
twopoint718 has joined #ruby
<shevy>
well
<workmad3>
m4rtijn: it's reasonably clear what you're doing, and it's very easy to switch out for a class later if you need to
<shevy>
I want to try if it is possible to write a MUD based on structs
vlad_starkov has joined #ruby
malkomalko has quit [Remote host closed the connection]
lolcathost has joined #ruby
v0n has quit [Ping timeout: 252 seconds]
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
tagrudev has quit [Remote host closed the connection]
mmitchell has joined #ruby
carloslopes has quit [Remote host closed the connection]
g-ram has joined #ruby
timonv has quit [Remote host closed the connection]
geekbri has quit [Remote host closed the connection]
krz has quit [Quit: krz]
macabre has joined #ruby
schaary has joined #ruby
gyre007 has quit [Read error: Connection reset by peer]
gyre007 has joined #ruby
malkomalko has joined #ruby
nemesit has quit [Ping timeout: 264 seconds]
otters has quit [Ping timeout: 264 seconds]
a_a_g has quit [Quit: Leaving.]
schaary has quit [Excess Flood]
schaary has joined #ruby
schaary has quit [Excess Flood]
schaary has joined #ruby
xyzodiac has joined #ruby
jlwestsr has quit [Ping timeout: 246 seconds]
centipedefarmer has joined #ruby
daniel_- has quit [Ping timeout: 246 seconds]
jonahR has joined #ruby
Goles_ has joined #ruby
Goles has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Ping timeout: 265 seconds]
BigO has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
Banistergalaxy has quit [Ping timeout: 244 seconds]
timonv has joined #ruby
Banistergalaxy has joined #ruby
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
stopbit has joined #ruby
jgarvey has joined #ruby
binaryplease has joined #ruby
jsaak_ has quit [Ping timeout: 248 seconds]
_bart has joined #ruby
geekbri has joined #ruby
ksk has joined #ruby
TechZombie has joined #ruby
geekbri has quit [Remote host closed the connection]
skcin7 has quit [Ping timeout: 246 seconds]
mmitchel_ has joined #ruby
polymar has joined #ruby
radic has joined #ruby
nurbs999 has joined #ruby
<nurbs999>
hello
<nurbs999>
i have a problem with ruby
jlwestsr has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
twopoint718 has quit [Ping timeout: 248 seconds]
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
ewag has joined #ruby
xyzodiac has quit [Ping timeout: 252 seconds]
Takehiro has joined #ruby
geekbri has joined #ruby
vlad_starkov has joined #ruby
<nurbs999>
i'm running a ruby script that watches a website, it fetches it and checks for a regex. is the site changes (meaning the regex fails) i get a push notification on my ipad. so far, so good. but after 3 or 4 days of running, the ruby process simply stops without any exception
schaary has quit [Quit: Leaving.]
<nurbs999>
i'm running 1.9.3-p194 on linux-3.0.35
<hoelzro>
nurbs999: is the OS killing it?
samphippen has joined #ruby
mmitchell has quit [Ping timeout: 265 seconds]
<nurbs999>
i dont think so, rails is running for several month now
eldariof has quit [Ping timeout: 256 seconds]
<nurbs999>
and system load is under 10%
iamjarvo has quit [Quit: Leaving.]
Takehiro has quit [Remote host closed the connection]
<csmrfx>
memory, lost
<hoelzro>
well, if your script is used a *lot* of memory after a few days, the kernel may kill it
<csmrfx>
have the OS run it from cron
<hoelzro>
I would write a little monitor program to catch your script's exit code and see if it was sent a signal
jsaak has joined #ruby
<nurbs999>
memory load is also low, and as far as i know, ruby has a garbage collector
<Xeago>
garbage can still be accumulated..
<csmrfx>
well, to me it sounds like a classic memory leak bug
<hoelzro>
just because a language is GC'd doesn't mean it doesn't have memory leaks
<nurbs999>
@hoelzro, how would you do that?
<csmrfx>
could be anything else, too
kil0byte_ has joined #ruby
<Xeago>
a="a"; a=a+a while true
xyzodiac has joined #ruby
<nurbs999>
would the code help?
<csmrfx>
which ruby
<nurbs999>
1.9.3-p193
<nurbs999>
p194
xyzodiac has quit [Client Quit]
<csmrfx>
if you checked the code and couldn't find anything, I suggest restarting the process daily
<Hanmac>
"cmrfx: my debian known nothing about god" so your debian is atheist?
alejandro_ has quit [Remote host closed the connection]
leonardorb has joined #ruby
<csmrfx>
Hanmac: aha!
larissa has quit [Quit: Leaving]
<nurbs999>
but fasten your seatbelt, its quick and dirty ;)
<hoelzro>
Hanmac: well, it just doesn't know. I suppose it's an implicit atheist?
bbttxu has quit [Client Quit]
<hoelzro>
nurbs999: line 6; I don't think super will work there
<csmrfx>
Hanmac: I think it is agnostic. It says absolutely nothing to "apropos god" - if it was atheist it would respond "null" or "not found" or something
bbttxu has joined #ruby
seanyo has joined #ruby
Neomex has joined #ruby
dr_bob has quit [Quit: Leaving.]
<JonnieCache>
even agnosticism implies a viewpoint
<JonnieCache>
debian is wholly ignorant of spirituality, dont think theres even a word for that
adac has joined #ruby
<Hanmac>
oO my ubuntu does know oO "The program 'god' can be found in the following packages: * god, * ruby-god" oO
<adac>
is there a difference if I do "return {:id => 1, :url => 'test'}" Vs "return :id => 1, :url => 'test'" or is both a hash?
<csmrfx>
apt-cache search god did find it
Neomex has quit [Client Quit]
<csmrfx>
~Fully configurable process monitoring
<csmrfx>
I guess debian considers god as an all seeing but neutral eye
leonard__ has joined #ruby
browndawg has joined #ruby
Takehiro has joined #ruby
leonardorb has quit [Read error: Connection reset by peer]
<Hanmac>
adac the second one is only syntax sugar for the first
<adac>
Hanmac, thank you!
kloeri has quit [Ping timeout: 608 seconds]
xyzodiac has joined #ruby
<nurbs999>
@hoelzro why not?
dnstbr has joined #ruby
<hoelzro>
nurbs999: super invokes the superclass' version of a method
<hoelzro>
you're overriding Object#puts entirely
yewton has quit [Excess Flood]
<hoelzro>
and I'm not sure, but I don't think that super will invoke Kernel#puts for you here
baroquebobcat has joined #ruby
mneorr has quit [Ping timeout: 244 seconds]
tk___ has quit [Quit: ばいばい]
<nurbs999>
what would be the right way to flush stdout?
yewton has joined #ruby
<csmrfx>
ri stdout.flush
<banisterfiend>
hoelzro: it will invoke Kernel#puts
danshultz has quit [Remote host closed the connection]
<csmrfx>
not sure if "the right way"
<hoelzro>
banisterfiend: oh, so super does consider mixins?
nomenkun has quit [Read error: Connection reset by peer]
Takehiro has quit [Remote host closed the connection]
nomenkun has joined #ruby
machty has joined #ruby
mercwithamouth has joined #ruby
kil0byte has joined #ruby
vlad_starkov has joined #ruby
philcrissman has joined #ruby
xyzodiac has quit [Ping timeout: 264 seconds]
Banistergalaxy has quit [Remote host closed the connection]
chimkan_ has joined #ruby
tomsthumb has quit [Quit: Leaving.]
<nurbs999>
so its not my code, that causes ruby to stop running?
kil0byte_ has quit [Ping timeout: 260 seconds]
busybox42 has joined #ruby
<hoelzro>
nurbs999: if I had to guess, I would guess that Ruby eventually sucks up too much RAM
BigO has quit [Remote host closed the connection]
yacks has joined #ruby
SCommette has joined #ruby
<nurbs999>
ok, i watch the memory usage, once more. thanks
<GeekOnCoffee>
Ruby itself is pretty careful with its RAM, if it starts it should keep running assuming your code isn't doing something poorly
havenn has joined #ruby
schaary has joined #ruby
joeycarmello has quit [Remote host closed the connection]
joeycarmello has joined #ruby
rhys has quit [Ping timeout: 245 seconds]
chimkan_ has quit [Ping timeout: 250 seconds]
chussenot has quit [Quit: chussenot]
J-_-L has joined #ruby
xyzodiac has joined #ruby
yewton has quit [Excess Flood]
dmerrick has joined #ruby
<nurbs999>
its a while true loop with a random sleep every loop
amaya_the has quit [Quit: ChatZilla 0.9.88.2 [Firefox 17.0.1/20121128204232]]
<banisterfiend>
nurbs999: every iteration* ;)
<nurbs999>
:)
yewton has joined #ruby
malkomal_ has joined #ruby
<lectrick>
In 1.9.3, does 'require' store the full path to the file, so I don't have to do things anymore like: $LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) unless $LOAD_PATH.include?(File.expand_path(File.dirname(__FILE__)))
malkomalko has quit [Read error: Connection reset by peer]
chussenot has joined #ruby
<banisterfiend>
lectrick: a local variable would go a long way there ;)
Roa has quit [Read error: Operation timed out]
ttt has quit [Remote host closed the connection]
osvico has quit [Ping timeout: 246 seconds]
<lectrick>
banisterfiend: yeah no kidding, but you get the point
Banistergalaxy has joined #ruby
<lectrick>
I wish there was a method on File that did File.expand_path(File.dirname(__FILE__)) without all that verbosity
<lectrick>
although __FILE__ only has meaning semantically, so that has to be passed in somehow
nateberkopec has joined #ruby
segv- has quit [Quit: segv-]
xyzodiac has quit [Ping timeout: 252 seconds]
Roa has joined #ruby
Roa has quit [Changing host]
Roa has joined #ruby
jeffreybaird has joined #ruby
ananthakumaran has joined #ruby
jlocklear_ubunny has joined #ruby
schaary has quit [Ping timeout: 264 seconds]
carloslopes has joined #ruby
* Hanmac
prefers require_relative
mark_locklear has quit [Read error: Connection reset by peer]
Takehiro has joined #ruby
Takehiro has quit [Read error: Connection reset by peer]
carloslopes has quit [Remote host closed the connection]
banisterfiend has quit [Ping timeout: 244 seconds]
<lectrick>
workmad3: ah!
iamjarvo has joined #ruby
<lectrick>
Hanmac: I noticed that some people REALLY hate require_relative. What I'd say about it is that it pours concrete into knowledge of the file structure while scattering that knowledge (which has to live somewhere) across a lot of files potentially
_alejandro has joined #ruby
BigO has joined #ruby
rippa has joined #ruby
rhys has joined #ruby
<lectrick>
To me it would be best if that knowledge lived somewhere near the top of a repo and that that was the only file that is allowed to be require_relative'd so that (for example) test files can run completely on their own
RudyValencia has joined #ruby
BigO_ has joined #ruby
x82_nicole has joined #ruby
jlast has joined #ruby
<lectrick>
That way if you do move that file you just have to change its own reference to the "master" path configurator file. Although if you move an entire directory you're still SOL. Or, you can just make sure that your path configurator file is in one of the stock $LOAD_PATH directories.
<Hanmac>
they only hate it because they are pre-1.9 liners
<lectrick>
And then just require 'my_setup' or whatever
lolmaus has quit []
elsifaka has quit [Quit: Veloma e!]
baroquebobcat has quit [Quit: baroquebobcat]
v0n has joined #ruby
nurbs999 has quit [Quit: Page closed]
iTitou has joined #ruby
BigO has quit [Ping timeout: 255 seconds]
gyre007 has quit [Read error: Connection reset by peer]
<Hanmac>
they only hate because it does not work on 1.8, and then they whine about that
gyre007 has joined #ruby
iTitou has left #ruby [#ruby]
kil0byte_ has joined #ruby
<waxjar>
people are still on 1.8? :(
Xeago has quit [Read error: Connection reset by peer]
Xeago has joined #ruby
swex_ has quit [Ping timeout: 264 seconds]
Takehiro has joined #ruby
<tjbiddle>
if i want to match /projects/:name instead of /projects/:id in rails for show() - what do i need to change?
<Hanmac>
yeah that makes me sad ... bee happy that most of them are using 1.8.7 and not 1.8.6 and older
Takehiro has quit [Read error: Connection reset by peer]
generalissimo has quit [Remote host closed the connection]
<tjbiddle>
thank ya
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
<lectrick>
Hanmac: Which doesn't work on 1.8.x?
<tjbiddle>
went to #rails at first :p but was fairly empty
kil0byte has quit [Ping timeout: 264 seconds]
<Hanmac>
lectrick require_relative does not work on 1.8.*
<lectrick>
Hanmac: oh yeah. true.
<lectrick>
Hanmac: But also, don't you think it hardcodes file path knowledge across a bunch of files?
<lectrick>
Which is kind of ugly?
IrishGringo has joined #ruby
<Hanmac>
PS: 1.8.7 and 1.8.6 have totaly different C-Apis ...
BigO_ has quit [Remote host closed the connection]
headius has joined #ruby
bradhe has joined #ruby
Vert has quit [Ping timeout: 252 seconds]
Uranio has joined #ruby
banisterfiend has joined #ruby
Phoop has quit [Quit: Phoop]
Uranio has quit [Client Quit]
lupine has quit [Read error: Connection reset by peer]
lupine has joined #ruby
<ner0x>
After reading through string I still don't see how to do a simple replace on a text.
<ner0x>
text =~ s/"/'/g ?
<workmad3>
ner0x: look up gsub
Takehiro has quit [Ping timeout: 248 seconds]
<ner0x>
workmad3: I saw that but it doesn't do it inline?
Virunga has quit [Remote host closed the connection]
<workmad3>
ner0x: look up gsub!
advorak_ has joined #ruby
<ner0x>
And winner.
<ner0x>
I'm not used to having ! and ? in my methods.
advorak has quit [Ping timeout: 252 seconds]
<shevy>
ner0x they can only be at the end
<shevy>
def foo!
<shevy>
def foo?
apeiros_ has quit [Remote host closed the connection]
<ner0x>
I was just commenting on how odd it feels.
<shevy>
the ! I agree with
<shevy>
the ? not, because it makes for an interesting style
geggam has joined #ruby
<shevy>
if cat.is_hungry?
<shevy>
cat.eat :mouse
<shevy>
end
BigO has joined #ruby
beiter_ has joined #ruby
<ner0x>
Right, so linguistic rather than syntactic.
<shevy>
or inline... cat.eat :mouse if cat.is_hungry?
* ner0x
isn't used to that.
<shevy>
well, ruby can be a lot like poetry
<shevy>
not always :) sometimes you just want to be terse and succint
<shevy>
I don't like the ternary operator much, but it really makes code shorter
<shevy>
unfortunately I also think ruby is too complex a language :\
beiter has quit [Ping timeout: 264 seconds]
beiter_ is now known as beiter
Rizzle has joined #ruby
advorak has joined #ruby
advorak_ has quit [Ping timeout: 248 seconds]
Uranio has joined #ruby
CreativeEmbassy has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
BigO_ has joined #ruby
BigO has quit [Ping timeout: 255 seconds]
schaary has joined #ruby
<ner0x>
I'm trying to figure out how to open a file, edit the text, and then save.
<ner0x>
So far I can only see opening it, reading the text, editing, and saving to a new file.
chimkan has joined #ruby
<ner0x>
Maybe I'm missing something.
a_a_g has joined #ruby
tomsthumb has joined #ruby
<ddd>
once you write to it just call .close on the filehandle
Hanmac has quit [Ping timeout: 245 seconds]
<ner0x>
ddd: I'm trying to open it, replace all " with ' and then save.
<ddd>
ok, so what does that have to do with closing it?
<ner0x>
ddd: it would be a rewrite rather than an append is what I'm saying.
frem has joined #ruby
<ddd>
so? call gsub on each line and replace what you want, then close it
mneorr has quit [Remote host closed the connection]
<ddd>
and I had that backwards. its File.open(blah.txt, rw)
bradhe has quit [Remote host closed the connection]
a_a_g has quit [Client Quit]
<ner0x>
ddd: Oh, it's that easy huh. That works.
s1n4 has joined #ruby
a_a_g has joined #ruby
<ner0x>
ddd: Thank you sir.
danneu has quit [Quit: WeeChat 0.3.8]
Guest62032 has joined #ruby
RudyValencia has quit [Quit: Hacked By Chinese!]
robert___ has joined #ruby
mneorr has joined #ruby
advorak_ has joined #ruby
jrajav has joined #ruby
xclite has joined #ruby
advorak has quit [Ping timeout: 265 seconds]
baroquebobcat has joined #ruby
akemrir has quit [Ping timeout: 264 seconds]
robert___ has quit [Ping timeout: 260 seconds]
hackerdude has joined #ruby
schaary has quit [Quit: Leaving.]
binaryplease has quit [Quit: WeeChat 0.3.9.2]
robbyoconnor has joined #ruby
Xeago_ has joined #ruby
adac has quit [Ping timeout: 244 seconds]
Xeago_ has quit [Remote host closed the connection]
daniel_hinojosa has joined #ruby
<ner0x>
File.open( name, 'r+' ) do |f| # do some stuff end # does end auto-close and save the work?
Xeago has quit [Ping timeout: 264 seconds]
davidcelis has quit [Quit: K-Lined.]
otters has joined #ruby
nemesit has joined #ruby
<GeekOnCoffee>
ner0x: what exactly are you asking?
Takehiro has joined #ruby
<ner0x>
GeekOnCoffee: I wish to open, edit, and save. Just wondering if you use it in block context will the "end" call save for you.
<GeekOnCoffee>
If the optional code block is given, it will be passed the opened file as an argument, and the File object will automatically be closed when the block terminates.
browndawg has quit [Read error: Connection reset by peer]
geggam has joined #ruby
adeponte has joined #ruby
csaunders has joined #ruby
tvw has quit [Remote host closed the connection]
geggam has quit [Remote host closed the connection]
kil0byte has quit [Remote host closed the connection]
kidoz has quit [Quit: Ухожу я от вас]
Zai00 has quit [Quit: Zai00]
kil0byte has joined #ruby
<lejonet>
Is there anyway to tell ruby to use a different base for some calculations? Currently I'm doing a math assignment where we are supposed to take 121 in different bases and take the sqrt of it in that different base and see if it is a integer square or not in that base
chussenot_ has joined #ruby
nwertman has joined #ruby
davidcelis has joined #ruby
havenn has quit [Read error: Connection reset by peer]
<lejonet>
it works nicely for those bases where 121 is represented with just numbers, like base 11 where it's 100 or base 9 in which it's 144
bradhe has quit [Remote host closed the connection]
<lejonet>
but it breaks severly due to only converting the actual integer parts in some other bases like 12 or 25-27
uris has joined #ruby
<apeiros_>
lejonet: for calculation, the base does not matter
csaunders has quit [Client Quit]
<apeiros_>
2+2 is always 4, no matter how you represent it
bradhe has joined #ruby
phantasm66 has joined #ruby
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
_solomon has quit [Quit: _solomon]
answer_42 has joined #ruby
<apeiros_>
0b10+0b10 == 0b100
_solomon has joined #ruby
<apeiros_>
you can use to_s(base) to see the result in a different base
machty has quit [Ping timeout: 248 seconds]
bradhe has quit [Remote host closed the connection]
<lejonet>
apeiros_: I know, and probably the answer to this question is that seeing as it's a integer square in decimal, it will be in all bases
<apeiros_>
and you can use String#to_i(base) to get input in different bases.
matrixise has quit [Ping timeout: 252 seconds]
<lejonet>
But I kindof need to prove it programmaticly too :/
<apeiros_>
o0
Vainoharhainen has quit [Quit: Leaving...]
Xeago has joined #ruby
Xeago has quit [Remote host closed the connection]
<lejonet>
or atleast prove it somehow, like proving why the integer square in decimal means it will be a integer square in other bases?
chussenot has quit [Ping timeout: 250 seconds]
chussenot_ is now known as chussenot
<lejonet>
I know that the decimal value will always be the same, or else it wouldn't really have been a conversion
dankest is now known as dankest|away
kil0byte has quit [Ping timeout: 260 seconds]
friskd has quit [Quit: friskd]
mneorr has quit [Remote host closed the connection]
<lejonet>
yeah, it's a weird question but this teacher is a bit special :P
hotovson has quit [Remote host closed the connection]
<apeiros_>
it sounds like your teacher wanted you to understand that, and why, the base is not relevant for calculation
huoxito has joined #ruby
mahmoudimus has joined #ruby
xyzodiac has joined #ruby
<lejonet>
Because the task is worded like this "In which bases b is the number 121_b a integer square?" and _b means a index b
brianpWins has joined #ruby
hotovson has joined #ruby
<lejonet>
and the task is simple to do, just convert 121 to the different bases, do a square root and see if you get any decimals
nomenkun has quit [Remote host closed the connection]
philcrissman has quit [Remote host closed the connection]
BoomCow has joined #ruby
<apeiros_>
have fun solving it :)
wallerdev has joined #ruby
<lejonet>
hehe yeah
<apeiros_>
as said, String#to_i(base) and Integer#to_s(base) can be used to convert bases
geggam has joined #ruby
<lejonet>
I think it'd be okay to do just up to 16, but 12 is giving me troubles by being a1
<lejonet>
apeiros_: yeah, I'm doing a 2.upto 36 do |value| r = Math.sqrt 121.to_s(value).to_i end for testing
<apeiros_>
o0
<jeffsmykil>
thank you jrajav must have glossed over that one
nat2610 has quit [Read error: Connection reset by peer]
<apeiros_>
ok, maybe I misunderstood the question of your teacher. but if I haven't, then this isn't doing what he asked.
nat2610 has joined #ruby
<apeiros_>
(and 121 could never be binary - no digit "2" in it)
carloslopes has joined #ruby
yshh has joined #ruby
<lejonet>
Yeah I have thought about it meaning that I should assume 121 is konstant over all the bases
digifiv5e has quit [Quit: quit]
<lejonet>
I don't really understand what he actually wants tho
vlad_starkov has joined #ruby
generali_ is now known as generalissimo
vlad_starkov has quit [Read error: Connection reset by peer]
akemrir has quit [Ping timeout: 255 seconds]
<lejonet>
because if it means that I should assume 121 in each of the base, the answer is going to be any base over binary
<lejonet>
because 121 == 11**2
vlad_starkov has joined #ruby
<apeiros_>
if it means 121_16 == 0x121 == 289, then you'll have a bit of work to do
Mon_Ouie has quit [Ping timeout: 246 seconds]
<apeiros_>
if it means that 121_16 == 0x79 == 121, then the answer is simply "in all bases"
<apeiros_>
I'd assume it's the former
<apeiros_>
so: have fun :D
<workmad3>
I'd assume the former too :)
<apeiros_>
if it is the former, I'd go via the base transformation algorithm
<apeiros_>
that should give away which ones will remain squared
<apeiros_>
*squares
<lejonet>
I'll just assume the former and throw something at him if it is the latter
<workmad3>
I'd just do 3.upto(36) {|base| "121".to_i(base); check if perfect square}
<lejonet>
Mhm
<apeiros_>
a logarithmic table? :D
slash_nick has joined #ruby
<lejonet>
That is the other solution I had for the problem
<lejonet>
something like 3.upto(36) {|base| puts "#{base} is a perfect square still" if Math.sqrt("121".to_i(base)).denominator == 1 }
wallerdev has quit [Quit: wallerdev]
vlad_starkov has quit [Remote host closed the connection]
ChampS666 has joined #ruby
dankest|away has quit [Quit: Leaving...]
dmiller has joined #ruby
maetthew has quit [Ping timeout: 245 seconds]
verto|off is now known as verto
verto is now known as verto|off
timonv has quit [Remote host closed the connection]
evantravers has quit [Ping timeout: 255 seconds]
<lejonet>
as I thought, doing that proves that for all bases but binary, 121 will be a perfect square
<jrajav>
No, it proves it for bases 3 to 36 :P
Virunga has joined #ruby
<lejonet>
jrajav: yeah, I could go on and on, but I think the value would be the same ^^
carlyle has quit [Remote host closed the connection]
<lejonet>
because 121 == 11**2, and regardless how you decide to represent 121, it will be true
maetthew has joined #ruby
Ziioynx has joined #ruby
Mon_Ouie has joined #ruby
wallerdev has joined #ruby
igro has quit [Ping timeout: 260 seconds]
rramsden has joined #ruby
<workmad3>
lejonet: you need to be careful with logic like that
jackbrownhf has joined #ruby
jackbrownhf has quit [Changing host]
jackbrownhf has joined #ruby
<workmad3>
lejonet: 2.upto(36) {|base| puts "#{base} is a perfect square still" if Math.sqrt("11".to_i(base)).denominator == 1 }
<lejonet>
workmad3: but that tests 11 in different bases?
<lejonet>
so I should just test the square in the different bases and not the result of the square?
slainer68 has quit [Remote host closed the connection]
<workmad3>
lejonet: '11' in base 3 is '4' in base 10
<workmad3>
lejonet: '11' in base 8 is '9' in base 10
chussenot has quit [Quit: chussenot]
<workmad3>
lejonet: don't conflate similar representations with identical values and characteristics
<lejonet>
workmad3: but doesn't the 121_b notation just mean the value of what 121 represents in that base?
jekotia has joined #ruby
ndboost has joined #ruby
<workmad3>
lejonet: correct
yacks has joined #ruby
<lejonet>
and shouldn't "121".to_i(base) give that?
<workmad3>
lejonet: it does
ndboost has left #ruby [#ruby]
<lejonet>
and isn't that what we want to test then?
<workmad3>
lejonet: so what you have demonstrated is that, for bases 3 to 36, 121 is a perfect square
<workmad3>
lejonet: however, your logic of '121 == 11**2' is not guaranteed
<workmad3>
lejonet: so your logic behind why it occurs is faulty
seanyo has quit [Read error: Connection reset by peer]
<lejonet>
workmad3: ah, that was probably I that forgot to explicitly state thate I meant that proof in decimal base
<workmad3>
lejonet: in base 3, 121 is 16
<workmad3>
lejonet: and 11 is 4
Virunga has quit [Remote host closed the connection]
<lejonet>
because yes, 121 != 11**2 in any base but decimal, but because 121 == 11**2 in decimal, converting the representation of 121 to another base will keep the perfect square property due to 121 == 11**2 in decimal
<workmad3>
I doubt that
<lejonet>
121 != 11**2 in any base but decimal probably
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
<lejonet>
That was the logic I meant with what I said above :)
<workmad3>
because why would it work for decimal, but not other bases?
r0bby has joined #ruby
<lejonet>
watcha mean with work?
<workmad3>
after all, 11 is a perfect square in base 3, so why isn't the same representation a perfect square in other bases?
mneorr has joined #ruby
<workmad3>
perfect square in base 3, prime in base 10...
<lejonet>
ah you mean like that, yeah that is true
fmcgeough has joined #ruby
dankest has joined #ruby
pothibo has joined #ruby
mneorr has quit [Remote host closed the connection]
<workmad3>
lejonet: and 25 is only a square in base 10 and 22 in the ranges 6 - 36
mneorr has joined #ruby
nga4 has joined #ruby
<workmad3>
lejonet: so I find your rationale behind the observed characteristic flawed :)
kil0byte has joined #ruby
<lejonet>
you mean that the representation confers nothing of the value of it, there for you cannot say that a "proof" against a value in another base is a proof for all the bases you can convert that representation to
robbyoconnor has quit [Ping timeout: 256 seconds]
machty has joined #ruby
<lejonet>
therefor*
chrismcg is now known as zz_chrismcg
<workmad3>
lejonet: if I'm following that correctly, that sounds about right
jlwestsr has quit [Quit: Ex-Chat]
elaptics is now known as elaptics`away
maverick has quit [Ping timeout: 246 seconds]
jackbrownhf has quit [Ping timeout: 252 seconds]
<lejonet>
workmad3: Well I agree with you then, if there is something I should get used to better is that absolute proofs need a lot more than 1 line of code :P
jdripper has quit [Quit: Leaving.]
<workmad3>
lejonet: and more than one example ;)
banisterfiend has quit [Ping timeout: 265 seconds]
CreativeEmbassy has joined #ruby
<lejonet>
yeah, a lot more than 1 example :)
mrsolo has joined #ruby
mathie has joined #ruby
jxriddle has joined #ruby
<workmad3>
lejonet: in fact, it's generally not possible to prove something with just examples
moted has joined #ruby
<workmad3>
lejonet: all examples can do is disprove
<lejonet>
Just like that 153 is a very special number when you cube the invidual numbers you get 153
<lejonet>
workmad3: you got a good point there :)
<lejonet>
that tho doesn't mean any number that has 1 and 5 and 3 in it follows that property, like 531 or 315
<workmad3>
lejonet: well, unless what you want to prove is the existence of a single example I guess :)
KevinSjoberg has joined #ruby
<workmad3>
lejonet: which would be the same as disproving the non-existance of any examples...
c0rn has joined #ruby
c0rn has quit [Client Quit]
emma-dev has quit [Quit: WeeChat 0.3.9]
Elhu has quit [Quit: Computer has gone to sleep.]
<lejonet>
workmad3: yeah, you'd need to come up with a proof for a general formulae to be able to say the proof is valid for more than that example
<workmad3>
lejonet: 153 would prove 'there exists a number xyz where x^3 + y^3 + z^3 = xyz'
<lejonet>
Mhm
apeiros_ has quit [Ping timeout: 250 seconds]
<workmad3>
lejonet: and would disprove 'there does not exist a number ...'
<lejonet>
It doesn't prove that a number that has 1, 5 and 3 confer that property
m4rtijn has quit [Remote host closed the connection]
c0rn has joined #ruby
apeiros_ has joined #ruby
<workmad3>
lejonet: no, but it proves that some numbers do have that property
<lejonet>
Mhm
<workmad3>
lejonet: just not that all numbers do :)
<lejonet>
I think I found 3 of those in the decimal span of 100-999
<lejonet>
it's easy to find those numbers :)
<lejonet>
atleast programmaticly
evantravers has joined #ruby
<workmad3>
lejonet: right... now prove 'for all n, there exists a number abc...n such that a^3 + b^3 + ... + n^3 = abc...n'
<lejonet>
workmad3: that isn't much more code for the actual testing, but dunno if it holds true :P
<workmad3>
lejonet: you'd need to run to infinite
<workmad3>
*infinity
<lejonet>
Well if we can have a fixnum representation of infinity, let's go! xD
<workmad3>
lejonet: yeah, it's not something you can prove programatically
<workmad3>
lejonet: but it is something you can disprove programmatically
<lejonet>
Yeah, because the number space is -inf to +inf
<lejonet>
with all the different types of numbers
<workmad3>
lejonet: however, if it turns out to be true, then an attempt to disprove it programatically would run forever
DrShoggoth has joined #ruby
<lejonet>
workmad3: it can run, but it cannot hide :)
<workmad3>
lejonet: which is the problem with proof and disproof in programmatic fashions
<lejonet>
Mhm
<lejonet>
Like a discussion I had with a cousin a while ago, our problem with infinity is not that it is infinity, but the tools that we'd use to represent it is bound by a finite range, so any attempt would just be a approximation until we find a tool that isn't bound by a finite space
<workmad3>
no, the problem with infinity is that it is provably non-computable
areil has quit [Remote host closed the connection]
<workmad3>
you can't count to infinity
<lejonet>
yeah exactly, we cannot grasp it with our limited vocabulary
<workmad3>
that doesn't mean we can't do stuff with it
<lejonet>
Mhm
<workmad3>
take calculus for example
<lejonet>
We just need a label that we know how to handle, like nothing
alexim has joined #ruby
<workmad3>
or the methods for dealing with infinite sums
malkomal_ has quit [Remote host closed the connection]
<lejonet>
(hence they qoutes)
<lejonet>
the*
<lejonet>
man my spelling really sucks today
carlyle has joined #ruby
<workmad3>
it took quite a while for robust foundations to emerge for how calculus works though... I quite like how you can build calculus really easily from the hyperreals :)
<lejonet>
hyperreals? *grabs popcorn and chair* care to explain?
* lejonet
really likes math
<workmad3>
it's just an extension to the real number system
<workmad3>
that introduces infinite and infinitesimal values in a consistent and workable manner
<lejonet>
but I've had too little time to actually fiddle around more with the fun stuff like calculus in one variable or higher
carlyle has quit [Read error: Connection reset by peer]
carlyle has joined #ruby
apeiros_ has quit [Remote host closed the connection]
mascool has joined #ruby
<workmad3>
I'm sure wikipedia has more information about them than I could provide :)
<lejonet>
It has been very interesting to explore stuff like sets, logic and such type of math (dunno if the name discrete math means the same in english as in swedish) with ruby
<lejonet>
I'll note that down to look up ^^
<lejonet>
I have heard the name before
tenmilestereo has joined #ruby
wargasm has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
obryan has joined #ruby
ananthakumaran has quit [Ping timeout: 252 seconds]
arya_ has joined #ruby
r0bby_ has joined #ruby
advorak_ is now known as advorak
malkomalko has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
tomask has joined #ruby
geggam has quit [Remote host closed the connection]
r0bby has quit [Ping timeout: 260 seconds]
banseljaj is now known as imami|afk
robbyoconnor has joined #ruby
imami|afk is now known as banseljaj
tPl0ch has joined #ruby
banseljaj is now known as imami|afk
<shevy>
lejonet why do you like math?
xyzodiac has joined #ruby
vlad_starkov has joined #ruby
EyesIsMine has joined #ruby
<lejonet>
shevy: well because you can do a lot of cool things with it, and that it's very easy to check your solutions if they are correct. That there can be more than 1 approach that yield the same result, but they must all be proven by the same thesis (like pq method and abc method, they use the same assumptions, but in 2 different ways and result in the same result)
r0bby_ has quit [Ping timeout: 264 seconds]
philcrissman has joined #ruby
xyzodiac has quit [Client Quit]
ananthakumaran has joined #ruby
bricker has joined #ruby
lindenle has joined #ruby
voodoofish430 has joined #ruby
KevinSjoberg has quit [Quit: Computer has gone to sleep.]
nat2610 has quit [Ping timeout: 255 seconds]
arya_ has quit []
rdark has quit [Quit: leaving]
mathie has quit [Quit: Sleeping...]
arturaz has quit [Ping timeout: 256 seconds]
aetcore has quit [Ping timeout: 265 seconds]
danshultz has joined #ruby
BoomCow has left #ruby ["Leaving"]
mafmwafv has joined #ruby
Hanmac1 is now known as Hanmac
jxriddle has quit [Quit: jxriddle]
<lectrick>
Why is the Ruby source not on GitHub?
<waxjar>
there is a mirror on github :)
Edwan has joined #ruby
<lectrick>
Is it one people can submit pull requests to and expect it to be looked at by core?
mathie has joined #ruby
digifiv5e has joined #ruby
<lectrick>
if not, then it's not really on github
<lectrick>
it's just a reference
<waxjar>
nope, that all live somewhere else
<waxjar>
*lives
darthdeus has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
theRoUS has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
fred909 has joined #ruby
baphled has joined #ruby
banisterfiend has joined #ruby
Edwan has quit [Remote host closed the connection]
Edwan has joined #ruby
nat2610 has joined #ruby
Gu_______ has joined #ruby
Gu_______ is now known as iCelebrity
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
banisterfiend has quit [Ping timeout: 255 seconds]
x82_nicole has quit [Quit: Computer has gone to sleep.]
CreativeEmbassy has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
robotmay has quit [Remote host closed the connection]
joeycarmello has joined #ruby
generali_ has joined #ruby
Rizzle is now known as Guest32217
<waxjar>
really ddd? i thought ruby ran their own
phelps has joined #ruby
generali_ is now known as generalissimo_
theRoUS has quit [Read error: Connection reset by peer]
generalissimo has quit [Ping timeout: 246 seconds]
<shevy>
hmm
<shevy>
I think mruby definitely runs on github though
<shevy>
and since it is the future ...
<shevy>
:)
<shevy>
FASTER THAN LIGHTNING AND LUA COMBINED!!!
tjbiddle_ has joined #ruby
<waxjar>
lol
ananthakumaran has quit [Quit: Leaving.]
<otters>
what are the drawbacks of mruby
<davidcelis>
one extra character
<waxjar>
dunno, i still don't really get what it is :p as i understand it it's a lightweight ruby version?
<lejonet>
davidcelis: was just about to write that :P "Takes 5 bytes to represent it instead of 4"
<otters>
heh
<otters>
what does "lightweight" mean
<shevy>
otters you can not use require() or load() right now
<otters>
oh
Eplemosen has joined #ruby
<lectrick>
ddd: I did not know that
<shevy>
which makes mruby quite useless :(
<otters>
I guess other than that it's good though right
<shevy>
dunno... I think its years away before done...
rjmt___ has quit [Ping timeout: 252 seconds]
tjbiddle has quit [Ping timeout: 265 seconds]
tjbiddle_ is now known as tjbiddle
nat2610 has quit [Quit: Leaving.]
<Edwan>
"undefined method `each' for "6154385000":String (NoMethodError)" -- I'm working with a CSV file, am I suppose to be converting the line to a string?
Morkel has joined #ruby
<Edwan>
Starting with original.each do |each|
<spike|spiegel>
string is no longer enumerable
monkegjinni has quit [Remote host closed the connection]
digifiv5e_ has joined #ruby
notVert has quit [Read error: Connection reset by peer]
lolcathost has quit [Read error: Connection reset by peer]
havenn has quit [Remote host closed the connection]
h4mz1d has joined #ruby
havenn has joined #ruby
reset has joined #ruby
FredLe1 has quit [Ping timeout: 260 seconds]
igro has quit [Read error: Connection reset by peer]
hotovson has quit [Remote host closed the connection]
buibex has quit [Remote host closed the connection]
havenn has quit [Ping timeout: 265 seconds]
u89 has joined #ruby
braoru has joined #ruby
nga4 has quit [Ping timeout: 248 seconds]
igro has joined #ruby
x82_nicole has joined #ruby
igro has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Remote host closed the connection]
jenrzzz has joined #ruby
tvw has joined #ruby
nat2610 has joined #ruby
moshee has quit [Ping timeout: 260 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
shevy has quit [Ping timeout: 245 seconds]
igro has joined #ruby
havenn has joined #ruby
blaxter has quit [Quit: foo]
g-ram has joined #ruby
freakazoid0223 has joined #ruby
tomask has quit [Ping timeout: 264 seconds]
<lejonet>
oh, you guys that are way better on ruby (and probably threading too :P) than me, is there any way to make ruby load more than 1 core except fork?
<lejonet>
Even with threads it keeps on 1 core for me, and that is the problem of interprented languages I guess, and fork creates a new process that logically should be able to land on a different core than the one the interprenter is running on
igro has quit [Read error: Connection reset by peer]
cassianoleal has quit [Quit: Leaving.]
samphippen has quit [Quit: Computer has gone to sleep.]
<lejonet>
ah yeah I know how to do IPC and such, what I wanted to know is how to be able to load-balance a ruby program on more than 1 core (or more correctly, utilize all cores instead of being stuck with 1)
<lejonet>
I'll look up those things tho :)
klj613 has joined #ruby
Monie has joined #ruby
<canton7>
lejonet, I got disconnected, but if no-one else answered then yes
<canton7>
search for something called the Global INterpreter Lock, or GIL
<lejonet>
canton7: so basically what you mean is that No, fork is the only way to parallelize ruby code due to GIL, just as for python and such?
pothibo has quit [Quit: pothibo]
<canton7>
that's the last I heard, yup
<canton7>
but if you're doing processor-intensive stuff in ruby, that's probably your mistake
<lejonet>
ah okay :) Then I understand your answer :P
<ner0x>
canton7: isn't "line" live ?
s1n4 has quit [Quit: bye]
<canton7>
"live"? I doubt it, depending on what exactly you mean by that
<ner0x>
canton7: As in, when I inline write, it saves the changes to the file upon the end scope.
shevy has joined #ruby
Morkel has quit [Ping timeout: 264 seconds]
<canton7>
no...
oxyn has quit [Client Quit]
<lejonet>
canton7: I saw a talk on FSCONS this year about using transactional memory to route around the GIL, that some dude is implementing in pypy :P
<canton7>
ooh, funky
peneconleche has joined #ruby
<canton7>
ner0x, no file handler in any language that I know of works that way
<ner0x>
canton7: There is no way to open a file, make changes, and save the file...? That's absurd.
igro has quit [Read error: Connection reset by peer]
TechZombie has quit [Ping timeout: 260 seconds]
<canton7>
for obvious reasons: if you're reading a file, you've got a file pointer saying up to what point you're read... that's going to go to hell if you start modifying the stuff before the point you've read to
nomenkun has joined #ruby
<lejonet>
canton7: yeah, the idea looked sane. As with transactional memory you can run stuff that are atomic in parallell without any risk of thrashing, dead-locks or such, due to the atomicity so seems like a sane way to go
mneorr has quit [Remote host closed the connection]
<ner0x>
canton7: So what is the typical way to save it to a new fiel?
<Hanmac>
canton7 yeah it feels better, but the result will be the same
babonk has joined #ruby
rakl has joined #ruby
<babonk>
Whats the simplest way to get an average of a given hash field across an array? Suppose you wanted the average of the field name ['a'] across of a list of hashes, for example
margle has quit [Quit: Computer has gone to sleep.]
FredLe1 has joined #ruby
FredLe has quit [Read error: Connection reset by peer]
<babonk>
so if you had first['a'] == 1, second['a'] == 3, you'd get 2, from the input of [first, second]
<canton7>
Hanmac, the last one doesn't allow '13.'?
axl__ has joined #ruby
leonard__ is now known as leonardorb
Synthead has joined #ruby
itchyouch has joined #ruby
dbeest has quit [Quit: Konversation terminated!]
vlad_starkov has joined #ruby
<havenn>
f, c = "high 1.3C/34F".gsub(/[a-zA-Z]/, '').strip.split('/').map &:to_f
<voodoofish430>
thanks cantony and Hanmac, looks like I need to read up on the scan method and regex for this.
Tearan has joined #ruby
mathie has joined #ruby
<voodoofish430>
thanks havenn as well. so regardless of how I break up the strings it looks like some regex is involved.
vlad_starkov has quit [Ping timeout: 260 seconds]
cmarques_ has quit [Ping timeout: 256 seconds]
<havenn>
voodoofish430: Solution with no regex: "high 1.3C/34F".split.last.strip.split('/').map &:to_f
<lejonet>
babonk: something like sum = 0; count = 0; array.each do {|hash| sum += hash['a']; count += 1} avg = sum / count
<babonk>
yeah, that's what i did. was wondering if there was something simplere
Adget1 has joined #ruby
<babonk>
btw you dont need count
<babonk>
.length would do
PhilK_ has joined #ruby
carlyle has joined #ruby
<lejonet>
well you could do collect instead of each but that doesn't really change anything
jds has joined #ruby
<lejonet>
babonk: true, forgot bout that :)
answer_42 has quit [Ping timeout: 246 seconds]
<lejonet>
sum = 0; array.collect {|hash| sum += hash['a']}; avg = sum / array.length
phantasm66 has joined #ruby
jlocklear_ubunny has quit [Remote host closed the connection]
vhsmaia has quit [Remote host closed the connection]
prettymuchbryce has joined #ruby
freakazoid0223 has joined #ruby
_alejandro has quit [Remote host closed the connection]
<prettymuchbryce>
Hello. I am working with event machine to build a web socket server in ruby. For some reason when I am declaring variables outside of event machine they are not being recognized by event handlers in the event machine.
ctwiz has joined #ruby
tPl0ch has quit [Quit: Verlassend]
GoGoGarrett has quit [Remote host closed the connection]
DrShoggoth has quit [Quit: Leaving]
J-_-L has joined #ruby
havenn has quit [Remote host closed the connection]
GitNick has quit [Quit: Leaving...]
<banisterfiend>
J-_-L: sup
ksaw123 has joined #ruby
elcapo has joined #ruby
mmitchell has quit [Ping timeout: 260 seconds]
elcapo has left #ruby [#ruby]
<ksaw123>
hey guys, trying to match two strings but only two character lenghts. http://pastie.org/5481228 program works but still matches single characters I need string_match('abc', 'abc') → 2 instead I get string_match('abc', 'abc') → 3
Virunga has quit [Remote host closed the connection]
CreativeEmbassy has quit [Quit: Computer has gone to sleep.]
<ksaw123>
any ideas?
byennen has quit [Remote host closed the connection]
_nitti has joined #ruby
sepp2k has joined #ruby
<eka>
ksaw123: example of the string?
<eka>
ksaw123: did you try /(\w){2}/.match(mystring) ?
<ksaw123>
string 1) abc string 2) abc.. should count ab and bc. instead I get ab, bc, and c. I only want to count with two chracters.
alanp has quit [Read error: Connection reset by peer]
<ksaw123>
not sure how to use that, that is regex yes?
macabre has quit [Remote host closed the connection]
ikaros has quit [Quit: Ex-Chat]
alanp has joined #ruby
alanp has quit [Read error: Connection reset by peer]
g-ram has quit [Quit: Computer has gone to sleep.]
alanp has joined #ruby
ddd has quit [Ping timeout: 245 seconds]
evantravers has quit [Quit: leaving]
_nitti has quit [Ping timeout: 244 seconds]
mathie has joined #ruby
lkba has joined #ruby
<banisterfiend>
ksaw123: no pvt messages pls
<ksaw123>
sry
<ksaw123>
Could you help me on where to implement that with my code? would I replace the if statement all together?
tar_ has quit [Quit: tar_]
BigO has quit [Remote host closed the connection]
wedtm|away is now known as wedtm
froy has quit [Quit: kablam!]
pavilionXP has joined #ruby
jsilver has joined #ruby
philcrissman has quit [Remote host closed the connection]
machty has quit [Quit: machty]
tenmilestereo has quit [Quit: Leaving]
mathie has quit [Ping timeout: 255 seconds]
<banisterfiend>
ksaw123: just decompose both strings the way i showed you, then count how many elements tehy have in common
d2dchat has quit [Remote host closed the connection]
jharris1 has quit [Quit: WeeChat 0.3.8]
BigO has joined #ruby
twopoint718 has quit [Ping timeout: 264 seconds]
<apeiros_>
hrm
<apeiros_>
why doesn't that work with \G?
<apeiros_>
"hello world".scan(/.\G./) # => []
BigO has quit [Remote host closed the connection]
CreativeEmbassy has joined #ruby
ikaros has joined #ruby
cascalheira has quit [Quit: Leaving...]
s0ber has quit [Remote host closed the connection]
s0ber has joined #ruby
froy has joined #ruby
reset has quit [Read error: Connection reset by peer]
Poapfel has joined #ruby
pyreal has joined #ruby
FlyingFoXy has quit [Quit: No Ping reply in 180 seconds.]
FlyingFoX has joined #ruby
<lejonet>
Hanmac: Just looked up the enumerable docs and each_slice seems to be a awesome thing for chopping a working set into smaller pieces and sending into forks :D
jackbrownhf has quit [Quit: Sto andando via]
<banisterfiend>
ksaw123: hint: &
baphled has quit [Ping timeout: 248 seconds]
<kapowaz>
can anyone suggest a better pattern for testing the presence of a key two levels deep in a hash, than two have two nested ifs?