fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
_whitelogger has joined #ruby
grillo has joined #ruby
perryh has joined #ruby
<Phlogistique> havenn: I don't get this guy's problem
<havenn> Phlogistique: His questionable ethics!
Apocalypse has joined #ruby
<Phlogistique> he's basically saying "OMG IO::Popen runs a SHELL when I ask it to!!!"
gmci has quit [Quit: Computer has gone to sleep.]
<Phlogistique> and then I can't kill it in a completely roundabout and wrong way! ZOMG!
schwap has joined #ruby
_whitelogger has joined #ruby
<Phlogistique> havenn: now Open3.capture2 indeed does exactly what I want
<Phlogistique> (its name is terrible though)
jimeh has quit [Ping timeout: 246 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
u_u has quit [Ping timeout: 248 seconds]
manizzle has quit [Ping timeout: 252 seconds]
nobitanobi has quit [Read error: Connection reset by peer]
brianpWins has joined #ruby
beakerman has joined #ruby
nobitanobi has joined #ruby
sepp2k has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
baroquebobcat has joined #ruby
mparodi has quit [Quit: Leaving]
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
bluOxigen_ has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
bluOxigen has quit [Ping timeout: 268 seconds]
RegEchse has quit [Quit: <3 WeeChat (v0.3.9-dev)]
iamjarvo has quit [Quit: Computer has gone to sleep.]
beakerman has quit [Ping timeout: 276 seconds]
Zespre has quit [Remote host closed the connection]
blahnick2 has joined #ruby
havenn has quit [Remote host closed the connection]
bintut has quit [Quit: Leaving]
beakerman has joined #ruby
poga has joined #ruby
RudyValencia- has joined #ruby
RudyValencia has joined #ruby
RudyValencia- has quit [Read error: Connection reset by peer]
u_u has joined #ruby
jimeh has joined #ruby
manizzle has joined #ruby
blahnick2 has quit [Ping timeout: 244 seconds]
niklasb has quit [Ping timeout: 272 seconds]
beakerman has quit [Ping timeout: 276 seconds]
velikasha1 has joined #ruby
velikasha1 has left #ruby [#ruby]
manizzle has quit [Ping timeout: 248 seconds]
beakerman has joined #ruby
yasushi has joined #ruby
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
poga has quit [Remote host closed the connection]
TorpedoSkyline has joined #ruby
yasushi has quit [Remote host closed the connection]
mfridh has quit [Ping timeout: 268 seconds]
bluOxigen_ has quit [Ping timeout: 248 seconds]
yasushi has joined #ruby
beakerma_ has joined #ruby
dev_ryan70 has quit [Remote host closed the connection]
beakerman has quit [Ping timeout: 276 seconds]
allyraza has joined #ruby
yasushi has quit [Ping timeout: 240 seconds]
butblack has joined #ruby
brianpWins has quit [Quit: brianpWins]
brianpWins has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
jwang has quit [Quit: Leaving]
beakerma_ has quit [Read error: Connection reset by peer]
beakerman has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
zelo has quit [Ping timeout: 245 seconds]
guns has quit [Quit: guns]
ysyk has joined #ruby
VegetableSpoon has quit [Remote host closed the connection]
LiquidInsect has quit [Ping timeout: 252 seconds]
LiquidInsect has joined #ruby
manizzle has joined #ruby
richo has left #ruby [#ruby]
manizzle has quit [Read error: Connection reset by peer]
IrishGringo has quit [Ping timeout: 244 seconds]
cakehero has joined #ruby
baphled has quit [Ping timeout: 245 seconds]
banisterfiend has quit [Ping timeout: 245 seconds]
manizzle has joined #ruby
mirTapir has quit [Ping timeout: 272 seconds]
mirTapir has joined #ruby
cakehero has quit [Client Quit]
gmci has joined #ruby
banisterfiend has joined #ruby
havenn has joined #ruby
darren has quit [Remote host closed the connection]
Spooner has quit [Ping timeout: 240 seconds]
darren has joined #ruby
u_u has quit [Ping timeout: 248 seconds]
DanBoy has joined #ruby
pingfloyd has joined #ruby
dev_ryan70 has joined #ruby
mucker has quit [Remote host closed the connection]
Hanmac1 has joined #ruby
nobitanobi has quit [Read error: Connection reset by peer]
savage- has joined #ruby
nobitanobi has joined #ruby
dev_ryan70 has quit [Ping timeout: 276 seconds]
ipoval has joined #ruby
Hanmac has quit [Ping timeout: 252 seconds]
<Paradox> im having some problems with rails and sass. I have a folder of sass partials, starting with underscores as the names, but sprockets is rendering them to css
sgronblom has joined #ruby
<Paradox> any simple way to suppress this?
nobitanobi has quit [Read error: Connection reset by peer]
jonathanwallace has quit [Read error: Connection reset by peer]
JarJar has quit [Quit: This computer has gone to sleep]
nobitanobi has joined #ruby
nobitanobi has quit [Client Quit]
jonathanwallace has joined #ruby
nedbat has quit [Ping timeout: 245 seconds]
justsee is now known as justsee|away
u_u has joined #ruby
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
sailingcai has joined #ruby
cakehero has joined #ruby
nedbat has joined #ruby
sailingcai has left #ruby [#ruby]
fixl has joined #ruby
havenn has quit [Remote host closed the connection]
pingfloyd has quit [Ping timeout: 246 seconds]
blazed has quit []
u_u has quit [Ping timeout: 248 seconds]
tommyvyo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
sazboom has joined #ruby
insecurlex has quit [Remote host closed the connection]
IrishGringo has joined #ruby
justsee|away is now known as justsee
scientes has quit [Ping timeout: 272 seconds]
<sazboom> exit
sazboom has quit [Quit: EPIC5-1.1.4[1667] - amnesiac : I really dispise you internet know-it-alls]
jimeh2 has joined #ruby
iamjarvo has joined #ruby
jimeh has quit [Ping timeout: 240 seconds]
kyktommy has joined #ruby
u_u has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
chessguy_ has quit [Remote host closed the connection]
nedbat has quit [Ping timeout: 244 seconds]
beneggett has joined #ruby
stephenjudkins has joined #ruby
r0bby_ has joined #ruby
justsee is now known as justsee|away
gregfu has quit [Quit: gregfu]
r0bby_ is now known as robbyoconnor
r0bby has quit [Ping timeout: 244 seconds]
gregfu has joined #ruby
sgronblom has quit [Quit: leaving]
Targen has quit [Ping timeout: 248 seconds]
Targen_ has joined #ruby
Eplemosen has quit [Quit: Leaving]
Araxia has quit [Quit: Araxia]
gregfu has quit [Client Quit]
pu22l3r has joined #ruby
vitor-br has joined #ruby
sazboom has joined #ruby
adelcampo has quit [Quit: Leaving...]
havenn has joined #ruby
r0bby has joined #ruby
patient has quit [Quit: R-R-R-RAGEQUIT!]
jonathanwallace has quit [Remote host closed the connection]
robbyoconnor has quit [Ping timeout: 265 seconds]
bluenemo has quit [Remote host closed the connection]
jasonLas has joined #ruby
digitalcakestudi has joined #ruby
r0bby_ has joined #ruby
dev_ryan70 has joined #ruby
eataix has joined #ruby
techsurvivor has joined #ruby
nari has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
soooga has joined #ruby
r0bby has quit [Ping timeout: 276 seconds]
jarred has quit [Quit: jarred]
ysyk has quit [Ping timeout: 252 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
dev_ryan70 has quit [Ping timeout: 276 seconds]
pingfloyd has joined #ruby
jasonLas has quit [Ping timeout: 276 seconds]
gmci has quit [Quit: Computer has gone to sleep.]
emmanuelux has quit [Ping timeout: 268 seconds]
iamjarvo has quit [Quit: Computer has gone to sleep.]
r0bby_ is now known as robbyoconnor
leoncamel has joined #ruby
perryh is now known as perryh_away
Mokiwai has joined #ruby
kyktommy has quit [Quit: kyktommy]
n_blownapart has joined #ruby
waxjar has quit [Ping timeout: 252 seconds]
waxjar has joined #ruby
ipoval has quit [Quit: ipoval]
<n_blownapart> very basic noob question, if you have time. I had a hard time with this operator even before I forgot ruby. basically, this means either an empty array or the instance variable referring to an array, right? Thanks: = []
<n_blownapart> @stack || ^^
<n_blownapart> correction @stack || = []
Markvilla1 has quit [Quit: Leaving.]
<heftig> ||= is one operator
<n_blownapart> heftig: oh yeah, so no space right?
<heftig> yes
<heftig> a ||= b is basically a shortcut for a || (a = b)
<heftig> that is, if a is nil or false, assign b to a
<heftig> reading unset instance variables returns nil, so @stack ||= [] would make @stack an empty array if it's unset
<n_blownapart> so heftig ... hold on one sec..
<n_blownapart> so technically the unset instance var. is false? heftig
<heftig> is nil
TorpedoSkyline has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
havenn has quit [Remote host closed the connection]
Mokiwai has left #ruby ["Ik ga weg"]
freeayu has joined #ruby
<n_blownapart> heftig: so in your example, if a is false or nil, you assign b to a. what does assigning b to a do...ie what is then the value of b?
<n_blownapart> heftig: logically why does b "cover" for a?
<heftig> b doesn't change
<heftig> a changes to the value of b
ysyk has joined #ruby
ysyk has quit [Max SendQ exceeded]
centipedefarmer has joined #ruby
<n_blownapart> heftig: sorry, is that just a rule, because b is on the right of the operator or something?
<heftig> you do know what a = b does, right?
<butblack> is there a way to convert a model datetime in symbol format to a date? for example I have a date_end column which has a symbol :date_end I would like to make it just a date :date_end.to_date doesn't work… suggestions?
<heftig> butblack: symbols and dates are apples and oranges
<heftig> converting between them is nonsense
ysyk has joined #ruby
<n_blownapart> heftig: well, one thing is that b would then refer to the same obj. as a does
ysyk has quit [Max SendQ exceeded]
<davidcelis> omg
<butblack> heftig: what would you suggest?
<n_blownapart> sorry
<heftig> butblack: i can barely make sense of your question
<n_blownapart> heftig: I understand a = b in the context of object reference. is that what you are asking me?
maletor has joined #ruby
<heftig> n_blownapart: i'm using a and b just as placeholders for whatever variables or expressions you want
<heftig> (obviously, a variable must be to the left of an assignment)
<butblack> heftig: ok, let's try this… I have a variable that equals this @brooms.group_by(&:date_end) .. :date_end is a datetime, however I need to group it by date, how could I do that?
drago757 has quit [Quit: drago757]
<butblack> by date, no time*
adelcampo has joined #ruby
<heftig> @brooms.group_by { |x| x.date_end.to_date }
mockra has joined #ruby
digitalcakestudi has quit [Ping timeout: 272 seconds]
<butblack> heftig: great, thanks
drago757 has joined #ruby
ysyk has joined #ruby
ysyk has quit [Max SendQ exceeded]
yoklov has quit [Quit: computer sleeping]
Dreamer3 has quit [Ping timeout: 240 seconds]
liluo has joined #ruby
<n_blownapart> heftig: this is what my book says: array || = [] is shorthand for: if array has a boolean value of true (its neither false nor nil) then don't do anything; but if it doesn't, initialize it to a new array. So if its true, that means the array already has contents, right?
<heftig> no
<heftig> it just means the variable "array" is not false or nil
<heftig> an empty array is true
<heftig> a string is true
sazboom has quit [Quit: EPIC5-1.1.4[1667] - amnesiac : I'm outta here...]
<heftig> and, of course, a filled array is true as well
<heftig> 0 is true, too :p
<n_blownapart> so if its empty, its fine. but in the case @stack || = [] , how could @stack, which is just a instance var. within a method definition, be false then?
stephenjudkins has quit [Quit: stephenjudkins]
stephenjudkins has joined #ruby
Dreamer3 has joined #ruby
<heftig> n_blownapart: nil is falsey as well
<heftig> and instance variables that were never written have the content nil
<heftig> just try it in irb
<heftig> >> @foo
<al2o3cr> (NilClass) nil
<heftig> >> @stack
<al2o3cr> (NilClass) nil
<heftig> >> @stack ||= []; @stack
<al2o3cr> (Array) []
<heftig> >> @stack ||= []; @stack << 3; @stack
<al2o3cr> (Array) [3]
pu22l3r has quit [Remote host closed the connection]
<heftig> >> @stack = 0; @stack ||= []; @stack
<al2o3cr> (Fixnum) 0
<heftig> >> @stack = flase; @stack ||= []; @stack
<al2o3cr> exit status: 1
<al2o3cr> stderr was too long, I PMed it to you
<heftig> >> @stack = false; @stack ||= []; @stack
<al2o3cr> (Array) []
<n_blownapart> heftig: ok thank you....got my work cut out for me.
scriabin has joined #ruby
<banisterfiend> >> BEGIN { $a = callcc { |cc| $a = cc } }; END { $a.call }
<al2o3cr> stderr was too long, I PMed it to you
<al2o3cr> exit status: 1
otters has quit [Quit: WeeChat 0.3.8]
otters has joined #ruby
justsee|away is now known as justsee
<savage-> >> Process.pid
<al2o3cr> (Fixnum) 5913
savage- has quit [Remote host closed the connection]
havenn has joined #ruby
<n_blownapart> al2o3cr: sorry, were you answering heftig's irb examples earlier?
<heftig> n_blownapart: it's a bot
<n_blownapart> heftig: no shit?
<heftig> just send message starting with >> to the channel, and it will try to run it in ruby
freeayu__ has joined #ruby
<n_blownapart> heftig: that is cool thanks.
<heftig> and give you the value of the whole thing as an answer
<heftig> >> 2 + 2
<al2o3cr> (Fixnum) 4
<n_blownapart> heftig: that is excellent
dev_ryan70 has joined #ruby
liluo has quit [Remote host closed the connection]
<banisterfiend> n_blownapart: haha u really thought al2o3cr was just some dude voluntarily executing all our code and telling us teh result? :P
<n_blownapart> banisterfiend: I'm a babe in the woods but I enjoy this stuff a lot
freeayu has quit [Ping timeout: 260 seconds]
<banisterfiend> :))
<n_blownapart> I thought some dude was eager to answer heftig 's stuff
MonsterWithin has joined #ruby
freeayu__ has quit [Ping timeout: 272 seconds]
dev_ryan70 has quit [Ping timeout: 276 seconds]
<n_blownapart> heftig: banisterfiend why did heftig put @stack after the semiColon in this example: @stack ||= []; @stack ?
<heftig> technically not needed
<heftig> i just wanted to emphasize that the answer of al2o3cr is the value of @stack
twock has quit [Ping timeout: 268 seconds]
<n_blownapart> ok thanks heftig
Synthead has quit [Quit: sqooq]
jonathanwallace has joined #ruby
nwest has quit [Quit: Computer has gone to sleep.]
<jrajav> al2o3cr will print out the result of putting the entire line in eval(), which itself returns the result of the last statement
yoklov has joined #ruby
gmci has joined #ruby
<banisterfiend> >> Enumerator.new { |y| y << "jrajav".chars.shuffle.join }.next
<al2o3cr> stderr was too long, I PMed it to you
<al2o3cr> exit status: 1
<heftig> it's not specific to eval. if you have a list of expressions separated by ; or linebreaks, the value of the whole list is the value of the last expression
<banisterfiend> >> Enumerator.new { |y| y << "jrajav".chars.to_a.shuffle.join }.next
<al2o3cr> (String) "raajvj"
freeayu__ has joined #ruby
<banisterfiend> >> Enumerator.new { |y| y << "jrajav".chars.to_a.shuffle.join }.next.next.next.next.next.next
<al2o3cr> (String) "jjavaw"
<jrajav> What have you done to my name.
<jrajav> jJAVAw
<jrajav> I will never forgive you
b0nn has quit [Quit: leaving]
<heftig> >> "jrajav".chars.to_a.permutation.to_a.map(&:join)
<al2o3cr> stdout was too long, I PMed it to you
<heftig> zomg, spam
jasonLas has joined #ruby
<heftig> >> "jrajav".chars.to_a.permutation.to_a.map(&:join).sample
<al2o3cr> (String) "vaajrj"
jonathanwallace has quit [Ping timeout: 245 seconds]
freeayu3 has joined #ruby
<heftig> >> "xraxav".chars.to_a.permutation.to_a.map(&:join).count
<al2o3cr> (Fixnum) 720
<heftig> >> "xraxav".chars.to_a.permutation.to_a.map(&:join).uniq.count
<al2o3cr> (Fixnum) 180
charliesome has joined #ruby
<heftig> >> Dir.glob("/tmp/*")
<al2o3cr> (Array) []
<heftig> >> File.stat "/"
<al2o3cr> (File::Stat) #<File::Stat dev=0x803, ino=2, mode=040755, nlink=8, uid=1000, gid=100, rdev=0x0, size=1847296, blksize=4096, blocks=3624, atime=2012-08-10 12:58:56 +0000, mtime=2012-08-10 13:26:22 +0000, ctime=2012-08-10 13:26:22 +0000>
freeayu__ has quit [Ping timeout: 252 seconds]
<heftig> >> Process.uid
<al2o3cr> (Fixnum) 1000
<heftig> um
n_blownapart has quit [Remote host closed the connection]
<heftig> >> File.stat "/usr/bin/ruby"
<al2o3cr> (File::Stat) #<File::Stat dev=0x803, ino=52, mode=0100755, nlink=1, uid=0, gid=0, rdev=0x0, size=6288, blksize=4096, blocks=16, atime=2012-08-12 00:18:40 +0000, mtime=2012-08-06 13:51:27 +0000, ctime=2012-08-08 13:46:18 +0000>
<heftig> >> File.stat "/usr"
<al2o3cr> (File::Stat) #<File::Stat dev=0x803, ino=7780, mode=040755, nlink=5, uid=0, gid=0, rdev=0x0, size=4096, blksize=4096, blocks=8, atime=2012-08-08 13:46:43 +0000, mtime=2012-08-06 19:13:43 +0000, ctime=2012-08-06 19:13:43 +0000>
centipedefarmer has quit [Quit: This computer has gone to sleep]
iamjarvo has joined #ruby
<heftig> >> File.write("/omg", "writable")
<al2o3cr> (Fixnum) 8
<heftig> Dir.glob("/*")
<allyraza> i have a method fetching data from a web service how would i make sure it does not return error
<heftig> >> Dir.glob("/*")
<al2o3cr> (Array) ["/open-uri20120810-5036-1wj6hu1", "/usr", "/bot.rb", "/open-uri20120810-5042-1j10n16", "/root", "/omg", "/bin", "/lib", "/etc", "/foo", "/lost+found"]
dev_ryan70 has joined #ruby
<heftig> >> File.read "/bot.rb"
<al2o3cr> stderr was too long, I PMed it to you
<al2o3cr> exit status: 1
beneggett has joined #ruby
centipedefarmer has joined #ruby
<heftig> >> File.chmod 0755, "/bot.rb"
<al2o3cr> exit status: 1
<al2o3cr> stderr was too long, I PMed it to you
<jrajav> allyraza: I guess that's between you and the web service :P
<jrajav> allyraza: Do you mean how do you CHECK for error?
<heftig> jrajav: were you the one who runs the bot?
<allyraza> jrajav: yes
<jrajav> heftig: Yes
<allyraza> what is the best practice
<heftig> I think I could do File.unlink "/bot.rb"
dev_ryan70 has quit [Remote host closed the connection]
<heftig> >> File.unlink "/omg"
<al2o3cr> (Fixnum) 1
<heftig> >> File.read "/foo"
<jrajav> allyraza: You're being spectacularly vague, but if you're referring to a REST HTTP web service, it should be returning the appropraite HTTP status code on an error
<al2o3cr> stderr:
<al2o3cr> from -e:1:in `<main>'
<al2o3cr> -e:1:in `inspect': failed to allocate memory (NoMemoryError)
<al2o3cr> exit status: 1
<heftig> >> File.stat "/foo"
<al2o3cr> (File::Stat) #<File::Stat dev=0x803, ino=14, mode=0100644, nlink=1, uid=1000, gid=100, rdev=0x0, size=100000000, blksize=4096, blocks=195320, atime=2012-08-12 04:03:29 +0000, mtime=2012-08-08 20:48:40 +0000, ctime=2012-08-08 20:48:40 +0000>
<jrajav> allyraza: For any web service method that is documented to return *any* errors, you should handle *all* of them
<heftig> um
<heftig> 100MB file there
<jrajav> heftig: Probably someone playing around before
<heftig> >> File.unlink "/foo"
<al2o3cr> (Fixnum) 1
<jrajav> heftig: You sure you deleted bot.rb?
<heftig> no, i haven't
<heftig> i didn't run that
<heftig> jrajav: should / really be writable?
<jrajav> Yeah that would be pretty amazing
<jrajav> heftig: / refers to the root directory of the chroot, not the system
<heftig> i know
<heftig> still
<jrajav> So, yes, it should :P
<allyraza> jrajav: ok lets say for instance i am reading a url what would be the best way to check it does not throw error
<heftig> no
<heftig> give ruby another directory to use for temporary files
<jrajav> What problem do you see with it being writable?
<heftig> i can delete bot.rb?
<jrajav> No, you can't. The scripts are run as the user 'jrajav'
<jrajav> bot.rb is owned by root
<heftig> jrajav: do you have a backup?
<jrajav> Yes
<heftig> >> File.unlink "/bot.rb"
<al2o3cr> (Fixnum) 1
<heftig> >> 3
<al2o3cr> (Fixnum) 3
<heftig> >> File.unlink "/bot.rb"
<al2o3cr> stderr was too long, I PMed it to you
<al2o3cr> exit status: 1
davidcelis is now known as EddardStark
<heftig> whoops
<heftig> there it went
<jrajav> Well, even if you did successfuly delete it
<jrajav> The bot wouldn't just stop
<jrajav> :P
EddardStark is now known as davidcelis
<heftig> jrajav: directory permissions matter for deletion, not file permissions
<heftig> unless the directory has the sticky bit
butblack has quit [Quit: butblack]
<jrajav> But the directory is owned by root too :/
<heftig> no, jrajav
<heftig> >> File.stat "/"
<al2o3cr> (File::Stat) #<File::Stat dev=0x803, ino=2, mode=040755, nlink=8, uid=1000, gid=100, rdev=0x0, size=1847296, blksize=4096, blocks=3624, atime=2012-08-12 04:00:29 +0000, mtime=2012-08-12 04:06:10 +0000, ctime=2012-08-12 04:06:10 +0000>
<heftig> see that uid=1000?
<jrajav> D'oh
<jrajav> Yeah that's jrajav's
<jrajav> Wow. Silly oversight
<jrajav> I knew that about directory permissions
<jrajav> Well, I hope no one kills the bot until I get back to work on Monday
<heftig> heh
<heftig> jrajav: bot itself doesn't run as jrajav?
<jrajav> No.
<jrajav> As root
<heftig> a bit dangerous if someone finds an exploit
<heftig> i'd probably have it run as a regular user, with access to a setuid chroot helper
<jrajav> Yeah but that would require more effort
beneggett has quit [Quit: Computer has gone to sleep.]
allyraza has quit [Ping timeout: 276 seconds]
macmartine has joined #ruby
fixl has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
maletor has quit [Quit: Computer has gone to sleep.]
tommyvyo has joined #ruby
MonsterWithin is now known as tiripamwe
scientes has joined #ruby
allyraza has joined #ruby
aezop has joined #ruby
eataix has quit [Quit: ZNC - http://znc.in]
scientes has quit [Ping timeout: 245 seconds]
savage- has joined #ruby
Guest74974 has joined #ruby
macmartine has quit [Ping timeout: 248 seconds]
igotnolegs has joined #ruby
andrewhl_ has quit [Remote host closed the connection]
dev_ryan70 has joined #ruby
scientes has joined #ruby
dev_ryan70 has quit [Ping timeout: 276 seconds]
RichieEvan has joined #ruby
jfarmer has joined #ruby
gmci has quit [Quit: Computer has gone to sleep.]
drago757 has quit [Quit: drago757]
ipoval has joined #ruby
ianbrandt has quit [Quit: ianbrandt]
digitalcakestudi has joined #ruby
mockra has quit [Remote host closed the connection]
r0bby has joined #ruby
<jfarmer> Anyone here? Oddly silent.
havenn has quit [Remote host closed the connection]
robbyoconnor has quit [Ping timeout: 276 seconds]
drago757 has joined #ruby
classix has quit [Ping timeout: 245 seconds]
jonahR has joined #ruby
<savage-> >> Kernel === Kernel
<al2o3cr> (TrueClass) true
<jonahR> >> p "ROFL" * 50
<al2o3cr> (String) "ROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFL"
<al2o3cr> "ROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFLROFL"
<jonahR> >> p RUBY_VERSION
<al2o3cr> (String) "1.9.3"
<al2o3cr> "1.9.3"
<jonahR> >> p "Ruby is Kawaii"
<al2o3cr> "Ruby is Kawaii"
<al2o3cr> (String) "Ruby is Kawaii"
savage- has quit [Remote host closed the connection]
jonahR has quit [Client Quit]
Juul has joined #ruby
meoblast001 has quit [Quit: Leaving]
pskosinski has joined #ruby
yoklov has quit [Quit: computer sleeping]
techsurvivor has quit [Quit: WeeChat 0.3.8]
queequeg1 has joined #ruby
queequeg1 has quit [Client Quit]
__future__ has joined #ruby
Araxia has joined #ruby
kuzushi has joined #ruby
noyb has joined #ruby
justsee is now known as justsee|away
geggam has joined #ruby
noyb_ has quit [Ping timeout: 272 seconds]
jarred has joined #ruby
jeff_sebring has joined #ruby
<scientes> >> p 101 ~ /^1?$|^(11+?)\1+$/
<al2o3cr> stderr was too long, I PMed it to you
<al2o3cr> exit status: 1
<scientes> >> p 101 =~ /^1?$|^(11+?)\1+$/
<al2o3cr> (NilClass) nil
<al2o3cr> nil
<scientes> >> p 11 =~ /^1?$|^(11+?)\1+$/
<al2o3cr> (NilClass) nil
<al2o3cr> nil
jeff_sebring has quit [Client Quit]
<scientes> >> 11 =~ /^1?$|^(11+?)\1+$/
<al2o3cr> (NilClass) nil
jarred_ has joined #ruby
opus has joined #ruby
Inoperable has joined #ruby
jasonLas has quit [Remote host closed the connection]
jarred has quit [Ping timeout: 276 seconds]
jarred_ is now known as jarred
s1n4 has joined #ruby
aezop is now known as aez|zzz
bwright has joined #ruby
classix has joined #ruby
joekarma has joined #ruby
joekarma has left #ruby [#ruby]
tiripamwe has quit [Ping timeout: 268 seconds]
scientes has quit [Ping timeout: 240 seconds]
kuzushi has quit [Ping timeout: 245 seconds]
tiripamwe has joined #ruby
kuzushi has joined #ruby
n_blownapart has joined #ruby
<jumpingcloud> Finished it! it works!
<banisterfiend> jumpingcloud: finished wat
dev_ryan70 has joined #ruby
<jumpingcloud> This assignment, https://github.com/jumpingcloud/Mars-Rover
<n_blownapart> hi .. why is this said in such a round-a-bout way? : "an object, upon being sent a message, looks for and finds (or fails to find) a method to execute whose name matches the message.
<jumpingcloud> Would someone mind tearing me apart and telling me why my code sucks before I submit it? I'm trying to get an internship =)
<jrajav> n_blownapart: I'm confused. Are you asking why people write poorly?
<jrajav> I'm afraid that's an intractable question
ipoval has quit [Quit: ipoval]
jarred has quit [Quit: jarred]
justsee|away is now known as justsee
dev_ryan70 has quit [Ping timeout: 276 seconds]
<n_blownapart> jrajav: well, I did my best to find a good book: well-grounded rubyist. I like the book and the author has been using this type of description re: method calls.
<n_blownapart> I like the book *but the author... ^
scientes has joined #ruby
<jrajav> I've never read that book, but it sounds like you're having a little trouble with it
<banisterfiend> jumpingcloud: jesus
<jrajav> I'd suggest diversifying your portfolio :P
<banisterfiend> jumpingcloud: it doesnt look like ruby code at all
<banisterfiend> jumpingcloud: that's my first reaction :)
<jumpingcloud> banisterfiend: yes yes give me more!! =)
<banisterfiend> jumpingcloud: i would use case/when rather than if/elsif
<jumpingcloud> yeah, i was thinking that.
<banisterfiend> jumpingcloud: also, use 2 space indent
<banisterfiend> jumpingcloud: also consider raising an exceptoin rather than just 'puts something is wrong'
ananthakumaran has joined #ruby
<banisterfiend> im not 100% on your code, but error conditions are often better managed with exceptions
Shamgar has quit [Ping timeout: 248 seconds]
gmci has joined #ruby
<banisterfiend> jumpingcloud: also, consider using: File.readlines("transmission.txt")
<jumpingcloud> banisterfiend: thanks, i actually should take those out entirely, 2 space indent is a good suggestion.
<jrajav> Why is every other Rubyist so hung up on freakin' 2 spaces....
<banisterfiend> jrajav: cos it's idiomatic :)
<jrajav> Makes you wonder if they're just used to things of small size
<jrajav> ;D
<banisterfiend> hehe
<jrajav> jumpingcloud: 4 is fine IMO
<jrajav> Too few and it starts to get harder to follow
<jumpingcloud> banisterfiend: so have i broken every rubyism in the book or what?
Morkel has joined #ruby
geggam has quit [Remote host closed the connection]
<banisterfiend> jrajav: 4 is ok i guess, but he's using 8
<jumpingcloud> jrajav: i see where your coming from. would you mind giving my code a look before i submit it?
<jrajav> banisterfiend: Yeah I saw
<banisterfiend> jumpingcloud: it just looks like noob code :)
<jumpingcloud> haha i didn't realize, it's sublimes default
moshee has quit [Ping timeout: 256 seconds]
moshee has joined #ruby
<jumpingcloud> banisterfiend: that it is ;)
<banisterfiend> jumpingcloud: also consider using more methods
iamjarvo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<banisterfiend> whenever you have a complex chunk of code that looks like it needs further explanation, stick it in a method IMO
<banisterfiend> jumpingcloud: im sure u could get a method out of this: https://github.com/jumpingcloud/Mars-Rover/blob/master/rover.rb#L86-92
<jumpingcloud> awesome
__future__ has quit [Quit: Leaving.]
rippa has joined #ruby
<jumpingcloud> Your right, I was actually thinking of making that a setup_rovers method, but... I'm surprised i actually finished it in the first place =D
digitalcakestudi has quit [Ping timeout: 244 seconds]
r0bby_ has joined #ruby
r0bby_ is now known as robbyoconnor
richardcreme has quit [Ping timeout: 244 seconds]
scientes has quit [Ping timeout: 252 seconds]
r0bby has quit [Ping timeout: 276 seconds]
<banisterfiend> jumpingcloud: cool
<banisterfiend> jumpingcloud: 1. get it working 2. refactor :)
<banisterfiend> jumpingcloud: are you using git?
Juul has quit [Ping timeout: 246 seconds]
<jumpingcloud> banisterfiend: i am using git
<banisterfiend> jumpingcloud: cool, then you can refactor without worrying about messing it up
<jumpingcloud> banisterfiend: it works though, did you try it?
<banisterfiend> jumpingcloud: nope
<jumpingcloud> okay, cool, yeah it works. you scared me ;)
<banisterfiend> i was just commenting on the code style
<jumpingcloud> I'll try to refactor. I'm new so we'll see.
<banisterfiend> jumpingcloud: you want to aim for this: DRY and small methods
<jumpingcloud> i changed the indent ;)
<jumpingcloud> banisterfiend: awesome thanks for your help, I really appreciate it.
MarGarina has joined #ruby
Banistergalaxy has joined #ruby
banisterfiend has quit [Ping timeout: 276 seconds]
mockra has joined #ruby
lusory has quit [Read error: Connection reset by peer]
mockra has quit [Ping timeout: 240 seconds]
darren has quit [Remote host closed the connection]
n_blownapart has quit [Remote host closed the connection]
jarred has joined #ruby
Banistergalaxy has quit [Ping timeout: 252 seconds]
scientes has joined #ruby
yxhuvud has joined #ruby
banisterfiend has joined #ruby
tiripamwe has quit [Ping timeout: 252 seconds]
scientes has quit [Ping timeout: 256 seconds]
justsee has quit [Quit: Leaving...]
jumpingcloud has quit [Ping timeout: 252 seconds]
scientes has joined #ruby
mohits has joined #ruby
tommyvyo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mockra has joined #ruby
uris has quit [Quit: leaving]
karneisada has joined #ruby
justinmcp has joined #ruby
liluo has joined #ruby
perryh_away is now known as perryh
mockra has quit [Remote host closed the connection]
waxjar has quit [Ping timeout: 240 seconds]
Targen_ is now known as Targen
dev_ryan70 has joined #ruby
scientes has quit [Ping timeout: 272 seconds]
<karneisada> I'm new to ruby
<karneisada> I did not expect this many people in the IRC chat
iori has joined #ruby
freeayu3 has quit [Read error: Connection reset by peer]
moshee has quit [Ping timeout: 248 seconds]
dev_ryan70 has quit [Ping timeout: 276 seconds]
gmci has quit [Quit: Computer has gone to sleep.]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
freeayu has joined #ruby
nari has quit [Ping timeout: 244 seconds]
<davidcelis> why
<Axsuul> Is there proper way to extend class methods from a module still to define a ClassMethods module within and then def self.included(base); base.extend(ClassMethods); end ?
scientes has joined #ruby
mike4_ has quit [Ping timeout: 276 seconds]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
charliesome has joined #ruby
<ryanf> that's pretty standard. if you're using rails you can use ActiveSupport::Concern instead
rippa has quit [Ping timeout: 272 seconds]
<Axsuul> ryanf: great, thanks
banisterfiend` has joined #ruby
banisterfiend has quit [Ping timeout: 276 seconds]
Divinite has joined #ruby
RichieEvan has quit [Quit: RichieEvan]
drago757 has quit [Quit: drago757]
freeayu has quit [Ping timeout: 276 seconds]
mahmoudimus has joined #ruby
thomas is now known as gingersnap
cj3kim has joined #ruby
cj3kim has left #ruby [#ruby]
krai has joined #ruby
Illiux has quit [Read error: Connection reset by peer]
gingersnap is now known as thomas
freeayu has joined #ruby
iori has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
freeayu__ has joined #ruby
scientes has quit [Ping timeout: 268 seconds]
spg has joined #ruby
<spg> hi
spg has left #ruby [#ruby]
spg has joined #ruby
freeayu has quit [Ping timeout: 268 seconds]
spg has left #ruby [#ruby]
freeayu__ has quit [Ping timeout: 265 seconds]
mohits has quit [Read error: Connection reset by peer]
indian has quit [Ping timeout: 276 seconds]
jrajav has quit [Quit: The best darkness is strange and surprising]
JStoker has quit [Excess Flood]
freeayu has joined #ruby
thone has joined #ruby
quest88 has quit [Quit: quest88]
ph^ has joined #ruby
thone_ has quit [Ping timeout: 245 seconds]
blacktulip has joined #ruby
tndrbt has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
jeff_sebring has joined #ruby
dev_ryan70 has joined #ruby
dev_ryan70 has quit [Ping timeout: 260 seconds]
mockra has joined #ruby
ryanf has quit [Quit: leaving]
gmci has joined #ruby
JStoker has joined #ruby
banisterfiend` has quit [Ping timeout: 256 seconds]
mockra has quit [Ping timeout: 256 seconds]
banisterfiend has joined #ruby
MonsterWithin has joined #ruby
lusory has joined #ruby
mohits has joined #ruby
ph^ has quit [Remote host closed the connection]
MonsterWithin has quit [Ping timeout: 245 seconds]
MonsterWithin has joined #ruby
freeayu has quit [Ping timeout: 252 seconds]
mohits has quit [Remote host closed the connection]
eikko has quit [Ping timeout: 256 seconds]
freeayu has joined #ruby
Divinite has quit [Ping timeout: 240 seconds]
krai has quit [Ping timeout: 244 seconds]
Divinite has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
kamaradclimber has joined #ruby
n1x has joined #ruby
allyraza has quit [Read error: Connection reset by peer]
kamaradclimber has left #ruby [#ruby]
richardcreme has joined #ruby
workmad3 has joined #ruby
MonsterWithin has quit [Ping timeout: 245 seconds]
MonsterWithin has joined #ruby
dpk has joined #ruby
<shevy> GOOD MORNING RUBYNAM
MarGarina has quit [Ping timeout: 276 seconds]
<shevy> karneisada we used to be close to 700 here
<shevy> karneisada python has more than 1000, debian more than 1200
<shevy> karneisada there also is #ruby-lang but it has only around 300, give or take +50
banisterfiend has quit [Ping timeout: 268 seconds]
justinmcp has quit [Remote host closed the connection]
Araxia has quit [Quit: Araxia]
MarGarina has joined #ruby
rakunHo has quit [Remote host closed the connection]
banisterfiend has joined #ruby
dpk has quit [Quit: Asleep at the keyboard.]
jeff_sebring has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 260 seconds]
imami|afk is now known as banseljaj
dev_ryan70 has joined #ruby
tndrbt has left #ruby [#ruby]
lapinferoce has joined #ruby
Hanmac1 has quit [Quit: Leaving.]
mafi has left #ruby [#ruby]
kaen has quit [Ping timeout: 276 seconds]
yasushi has joined #ruby
dev_ryan70 has quit [Ping timeout: 276 seconds]
jarred has quit [Quit: jarred]
qwerxy has joined #ruby
yasushi has quit [Ping timeout: 240 seconds]
gmci has quit [Quit: Computer has gone to sleep.]
krai has joined #ruby
<Inoperable> hi everyone
<Inoperable> im starting learning ruby
nari_ has joined #ruby
<Inoperable> i got some text and i like to iterate through it characters
<Inoperable> and count occurancies of each characters
freeayu__ has joined #ruby
br4ndon has joined #ruby
<Inoperable> how would you do it? with hashes?
Guest74974 is now known as Jackneill
Jackneill has quit [Changing host]
Jackneill has joined #ruby
<Inoperable> text.each_char do | character |
freeayu has quit [Ping timeout: 240 seconds]
mmokrysz has joined #ruby
bwright has quit [Ping timeout: 272 seconds]
mmokrysz has left #ruby [#ruby]
ly_gs has joined #ruby
MarGarina has quit [Ping timeout: 276 seconds]
baphled has joined #ruby
<Paradox> Inoperable, yeah
<Paradox> chars = {}; string.each_char { |c| chars[c] += 1 }
freeayu__ has quit [Ping timeout: 240 seconds]
MarGarina has joined #ruby
<Inoperable> Paradox: thanks ;)
<Inoperable> Paradox: chars[c] inserts a key with the name of c?
<Inoperable> Paradox: i thought i do that with chars.keys.insert
<Paradox> in hash #[]= creates or updates a key
burgestrand has joined #ruby
azm has joined #ruby
richardcreme has quit [Ping timeout: 244 seconds]
blacktulip has quit [Remote host closed the connection]
graspee has joined #ruby
<apeiros_> Paradox: that'll raise
Divinite has quit [Ping timeout: 240 seconds]
<apeiros_> since you'll do nil+1
<apeiros_> chars = Hash.new(0)
<Paradox> yeah
<Paradox> "This is a string".each_char { |x| chars[x]+= 1 }
<Paradox> there you go
<Paradox> if you run those 2 you get what you need
<Paradox> Hash.new(0) creates a new hash with 0 as the default value
strnx has quit [Ping timeout: 276 seconds]
freeayu has joined #ruby
dtribble has quit [Ping timeout: 240 seconds]
<shevy> otters why are you so silent!
yhyubub has joined #ruby
subbyyy has quit [Quit: Leaving.]
justsee has joined #ruby
richardcreme has joined #ruby
lapinferoce has quit [Remote host closed the connection]
pingfloyd has quit [Ping timeout: 252 seconds]
nokimochi has joined #ruby
<nokimochi> hi all
gmci has joined #ruby
adelcampo has quit [Quit: Linkinus - http://linkinus.com]
nokimochi has left #ruby [#ruby]
fantazo has quit [Remote host closed the connection]
strnx has joined #ruby
RudyValencia has quit [Quit: My IRC client doesn't advertise in /quit messages.]
jfarmer has quit [Quit: jfarmer]
fastred has joined #ruby
monkegjinni has joined #ruby
Criztian has joined #ruby
elaptics`away is now known as elaptics
mohits has joined #ruby
Targen has quit [Ping timeout: 248 seconds]
yasushi has joined #ruby
dev_ryan70 has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
burgestrand has quit [Quit: Leaving.]
Targen has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
mohits has quit [Remote host closed the connection]
banisterfiend has joined #ruby
Astral_ has quit [Read error: Connection reset by peer]
Astral_ has joined #ruby
dev_ryan70 has quit [Ping timeout: 260 seconds]
yasushi has quit [Remote host closed the connection]
jillsmitt_ has joined #ruby
yasushi has joined #ruby
d3vic3 has joined #ruby
xbayrockx has joined #ruby
jillsmitt has quit [Ping timeout: 265 seconds]
azm has quit [Quit: Leaving]
yasushi has quit [Ping timeout: 252 seconds]
n1x has quit [Quit: Ex-Chat]
elaptics is now known as elaptics`away
joephelius has quit [Ping timeout: 244 seconds]
heftig has joined #ruby
elaptics`away is now known as elaptics
<Inoperable> chars.values.sort.reverse.each do |value|
<Inoperable> puts chars.key(value)
<Inoperable> end
<Inoperable> it does what it suppose to do, how do i get the key name that pairs with the value?
yasushi has joined #ruby
<apeiros_> chars.sort_by(&:last).each do |key, value| …
<apeiros_> sort_by(&:last) actually returns an array instead of a hash, but that shouldn't matter for this purpose
<Inoperable> cool
chussenot has joined #ruby
<Inoperable> apeiros_: but this sorts the keys right?
chussenot has quit [Client Quit]
<Inoperable> apeiros_: i wanted to sort the values
<apeiros_> this sorts by value
<Inoperable> ok
<Inoperable> great
<apeiros_> oh, but I omitted the reverse
<Inoperable> exectly what i'd like to do
<apeiros_> chars.sort_by(&:last).reverse_each do |key, value| …
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
<apeiros_> chars.sort_by { |key, value| value } --> chars.sort_by { |key_and_value| key_and_value.last } --> chars.sort_by(&:last)
<Inoperable> ok, got it!
vagab0nd has joined #ruby
<vagab0nd> hi :)
joephelius has joined #ruby
wallerdev has quit [Quit: wallerdev]
burgestrand has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
Foxandxss has joined #ruby
yasushi has quit [Remote host closed the connection]
yasushi has joined #ruby
mfridh has joined #ruby
yasushi has quit [Ping timeout: 240 seconds]
MonsterWithin has quit [Ping timeout: 260 seconds]
zelo has joined #ruby
gmci has quit [Quit: Computer has gone to sleep.]
haxrbyte has joined #ruby
krai has quit [Ping timeout: 245 seconds]
opus has quit [Quit:]
krai has joined #ruby
dev_ryan70 has joined #ruby
s1n4 has quit [Quit: peace out]
MonsterWithin has joined #ruby
k_89 has joined #ruby
dev_ryan70 has quit [Ping timeout: 260 seconds]
specialGuest has joined #ruby
specialGuest has quit [Changing host]
specialGuest has joined #ruby
d3vic3 has quit [Quit: leaving]
qwerxy has quit [Quit: offski]
yxhuvud has quit [Ping timeout: 246 seconds]
Targen has quit [Ping timeout: 268 seconds]
Spaceghostc2c has quit [Remote host closed the connection]
MetaCosm has quit [Remote host closed the connection]
SeanTAllen has quit [Read error: Connection reset by peer]
moeSeth has quit [Remote host closed the connection]
_marvin has quit [Remote host closed the connection]
relix has quit [Remote host closed the connection]
anildigital_work has quit [Remote host closed the connection]
[diecast] has quit [Remote host closed the connection]
Dr4g has quit [Remote host closed the connection]
kaichanvong has quit [Remote host closed the connection]
cool has quit [Remote host closed the connection]
denysonique has quit [Remote host closed the connection]
lectrick has quit [Remote host closed the connection]
dotemacs has quit [Remote host closed the connection]
octarine has quit [Remote host closed the connection]
randym has quit [Remote host closed the connection]
aquaranto has quit [Remote host closed the connection]
franckverrot has quit [Remote host closed the connection]
notbrent has quit [Write error: Connection reset by peer]
patricksroberts has quit [Remote host closed the connection]
MoMo has quit [Read error: Connection reset by peer]
philcrissman has quit [Remote host closed the connection]
pvh has quit [Remote host closed the connection]
mroth has quit [Remote host closed the connection]
NimeshNeema has quit [Remote host closed the connection]
ladder4 has quit [Remote host closed the connection]
fcoury has quit [Remote host closed the connection]
orend has quit [Remote host closed the connection]
dnyy_ has quit [Remote host closed the connection]
kapowaz has quit [Remote host closed the connection]
fowl has joined #ruby
kirun has joined #ruby
vagab0nd has quit [Quit: leaving]
Targen has joined #ruby
Spaceghostc2c has joined #ruby
JarJar has joined #ruby
[diecast] has joined #ruby
<Inoperable> chars.sort_by { |key, value| value }
<Inoperable> the second value argument
<Inoperable> ?
<apeiros_> what about it?
<Inoperable> i don't get it
octarine has joined #ruby
<apeiros_> sort_by is based on #each, #each yields(key, value)
<Inoperable> ok
<apeiros_> and you return a value from sort_by, by which you want to sort (hence the name). since you want to sort by value, you return the value
mroth has joined #ruby
<Inoperable> ohh ok
<Inoperable> apeiros_: so every method in ruby inherits from some parent method?
<apeiros_> no
<apeiros_> but many methods for collections are implemented in the Enumerable module
<apeiros_> and that only needs the #each method to work
<fowl> each yields [key, value]
<apeiros_> fowl: yeah, correct. it yields an array, not two distinct values.
<apeiros_> (and do |key, value| gets that array auto-splatted)
<Inoperable> auto-splatted?
<apeiros_> fowl: your turn to explain, that was the reason I didn't mention that detail :-p
aquaranto has joined #ruby
cousine has joined #ruby
aez|zzz has quit [Ping timeout: 240 seconds]
<Inoperable> hehe
MetaCosm has joined #ruby
monkegjinni has quit [Remote host closed the connection]
<Inoperable> can google it, thanks for dropping the bone
karneisada has quit [Ping timeout: 245 seconds]
burgestrand has quit [Quit: Leaving.]
anildigital_work has joined #ruby
randym has joined #ruby
<fowl> apeiros_: i dont understand why its auto-splatted, it doesnt make much sense when you can also do |(a, b)| to expand an array if needed
Russell^^ has joined #ruby
<fowl> Inoperable: i guess its comparable to doing a = [1, 2] which is fine, you'll get [1, 2], but if you throw another var in there like a, b = [1, 2] then a is 1 and b is 2
dnyy_ has joined #ruby
<Inoperable> fowl: didnt knew the a,b = [1, 2] expression is even possible
aezop has joined #ruby
<Inoperable> but i started like 12h ago
<Inoperable> so there is a lot i dont know
Divinite has joined #ruby
monkegjinni has joined #ruby
<Inoperable> but im already falling in love
monkegjinni has quit [Remote host closed the connection]
insecurlex has joined #ruby
blacktulip has joined #ruby
Dr4g has joined #ruby
moeSeth has joined #ruby
MoMo has joined #ruby
lectrick has joined #ruby
pvh has joined #ruby
<Divinite> Inoperable: With ruby.
MonsterWithin has quit [Ping timeout: 245 seconds]
<Inoperable> Divinite: yeah
<Divinite> Awh, that's so sweet. How old is she?
<Inoperable> Divinite: 13 hehe
MonsterWithin has joined #ruby
<Inoperable> Divinite: but she looks like 17
k_89 has quit [Ping timeout: 272 seconds]
Criztian has quit [Remote host closed the connection]
<Divinite> Inoperable: Fair enough.
philcrissman has joined #ruby
heftig has quit [Ping timeout: 240 seconds]
Hanmac has joined #ruby
notbrent has joined #ruby
franckverrot has joined #ruby
relix has joined #ruby
jimeh2 has quit [Ping timeout: 252 seconds]
Divinite has quit [Remote host closed the connection]
Markvilla has joined #ruby
jimeh2 has joined #ruby
krai has quit [Ping timeout: 248 seconds]
<shevy> I still dont get it
<shevy> array.each {|(a, b)|}
<shevy> why are the () used there again?
gmci has joined #ruby
<shevy> it's harder and harder for my brain to learn anything new
<fowl> shevy: a, (b, c) = [1, [2, 3]]
<Hanmac> shevy its needed when you has hash.each_with_index{|(k,v),idx| ... } or something similar
myth17 has joined #ruby
savage- has joined #ruby
carloshh has joined #ruby
myth17 has quit [Changing host]
myth17 has joined #ruby
qko has quit [Read error: Connection reset by peer]
kapowaz has joined #ruby
qko has joined #ruby
<Inoperable> is there a built-in method to get the word count from a string?
<otters> shevy: 5 AM
Morkel has quit [Quit: Morkel]
<apeiros_> what's a word? :)
<shevy> Inoperable you can write such a method
<apeiros_> str.scan(/\b.{3,}\b/).length # a possible way
<shevy> class String; def word_count; hash = Hash.new(0); downcase.scan(/\w+\??/) { |word| hash[word] += 1 }; return hash; end; end;
<shevy> x = %{ Dogs cat? cat? cat dog dog dog cat dog eagle dog dogs }.word_count
burgestrand has joined #ruby
<shevy> => { "cat"=>2, "dogs"=>2, "eagle"=>1, "dog"=>5, "cat?"=>2 }
<Inoperable> apeiros_: don't give me the solution!
<Inoperable> ;]
Eplemosen has joined #ruby
<Inoperable> the .scan method is really nice!
<Inoperable> does it eat normal regexp?
dotemacs has joined #ruby
dev_ryan70 has joined #ruby
arietis has joined #ruby
_marvin has joined #ruby
ly_gs has quit [Remote host closed the connection]
<shevy> fowl, Hanmac: hmm I see
<weeb1e_> If I use lsof to list add FDs that my application has opened, how can I find out while pipes are which?
Stalkr_ has joined #ruby
<weeb1e_> s/list add/list all
<weeb1e_> s/while/which :|
carloshh has quit []
dev_ryan70 has quit [Ping timeout: 276 seconds]
<fowl> Inoperable: if you need to play with regexen check out http://rubular.com
carloshh has joined #ruby
jimeh2 has quit [Ping timeout: 276 seconds]
korczis has joined #ruby
kaichanvong has joined #ruby
burgestrand has quit [Quit: Leaving.]
fcoury has joined #ruby
savage- has quit [Remote host closed the connection]
burgestrand has joined #ruby
yasushi has joined #ruby
arvidkahl has quit [Read error: Connection reset by peer]
arvidkahl has joined #ruby
qko has quit [Changing host]
qko has joined #ruby
carloshh has quit []
haxrbyte has quit [Remote host closed the connection]
<shevy> weeb1e_ good question... hmmm
<shevy> weeb1e_ isn't there a unix command for that?
heftig has joined #ruby
nu7hatch has joined #ruby
myth17 has quit [Quit: Leaving]
jonathanwallace has joined #ruby
patricksroberts has joined #ruby
<weeb1e_> shevy: I didn't see any option for such info in the lsof usage, but I may have missed something
patient has joined #ruby
NimeshNeema has joined #ruby
ly_gs has joined #ruby
freeayu has quit [Ping timeout: 240 seconds]
jillsmitt_ has quit [Remote host closed the connection]
u_u has quit [Ping timeout: 245 seconds]
carloshh has joined #ruby
adelcampo has joined #ruby
bluOxigen has joined #ruby
yasushi has quit [Remote host closed the connection]
burgestrand has quit [Quit: Leaving.]
vlad_starkov has joined #ruby
yasushi has joined #ruby
burgestrand has joined #ruby
freeayu has joined #ruby
SeanTAllen has joined #ruby
denysonique has joined #ruby
bigkevmcd has quit [Remote host closed the connection]
yasushi has quit [Ping timeout: 240 seconds]
charliesome has quit [Remote host closed the connection]
charliesome has joined #ruby
resure has joined #ruby
u_u has joined #ruby
Spooner has joined #ruby
dev_ryan70 has joined #ruby
krai has joined #ruby
dev_ryan70 has quit [Remote host closed the connection]
yasushi has joined #ruby
vectorshelve has joined #ruby
QKO_ has joined #ruby
bluOxigen_ has joined #ruby
yasushi has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 240 seconds]
yasushi has joined #ruby
insecurlex has quit [Ping timeout: 276 seconds]
qko has quit [Ping timeout: 248 seconds]
QKO_ has quit [Changing host]
QKO_ has joined #ruby
fayimora has joined #ruby
ly_gs has quit [Remote host closed the connection]
blazed has joined #ruby
carloshh has quit []
QKO_ has quit [Read error: Connection reset by peer]
qko has joined #ruby
adelcampo has quit [Quit: Leaving...]
yasushi has quit [Ping timeout: 245 seconds]
IrishGringo has quit [Remote host closed the connection]
bluOxigen has joined #ruby
bluOxigen_ has quit [Ping timeout: 244 seconds]
specialGuest has quit [Ping timeout: 252 seconds]
Husel has joined #ruby
nedbat has joined #ruby
RegEchse has joined #ruby
Eldariof-ru has joined #ruby
cousine_ has joined #ruby
ladder4 has joined #ruby
cousine has quit [Ping timeout: 260 seconds]
Eplemosen has quit [Quit: NOPE]
atmosx has joined #ruby
niklasb has joined #ruby
krai has quit [Quit: Leaving]
s1n4 has joined #ruby
ly_gs has joined #ruby
s1n4 has left #ruby [#ruby]
resure has quit [Ping timeout: 276 seconds]
kyktommy has joined #ruby
jrajav has joined #ruby
resure has joined #ruby
freeayu has quit [Read error: Connection reset by peer]
cousine_ has quit [Remote host closed the connection]
freeayu has joined #ruby
fayimora has quit [Read error: Connection reset by peer]
fayimora_ has joined #ruby
qwerxy has joined #ruby
<shevy> "abc".last
<shevy> does not exist?
<atmosx> nope
<atmosx> not in string class
<atmosx> NoMethodError: undefined method `last' for "abc":String
Gurpartap has joined #ruby
<Gurpartap> hi rubies
<atmosx> hi Gurpartap, fancy nickname you have there
cousine has joined #ruby
<atmosx> Why on earth when I wanna do something… I don't know how… when I figure out how, I'm so bored implementing it.
<Gurpartap> haha, thanks atmosx
<Gurpartap> atmosx: What are you trying?
<atmosx> nothing too fancy now, I'm writing a cli setup script which will take some values and dump them into an SQLite3 parent-table
<atmosx> I'm too bored writing all the error handling staff, i.e. if the URL is not valid http url, etc...
<atmosx> Gurpartap: u?
ph^ has joined #ruby
<Gurpartap> atmosx: is this program going to be deployed in an enterprise?
<Gurpartap> i wouldn't validate that much, unless it's going to destroy a database
<Gurpartap> (expecting the users to read docs/readme)
<shevy> atmosx ok
<Gurpartap> atmosx: I'm trying to get my head around Actor model
<shevy> I made so many changes to ruby core classes
<atmosx> Gurpartap: nah, I'm an amateur programmer, I do things for fan :-)
<shevy> I am slowly reducing these
<Gurpartap> hi shevy
<vectorshelve> Gurpartap: hai remember me ? :) How you ?
xorox90 has joined #ruby
<shevy> atmosx, there are ways to work around this
<Gurpartap> hey vectorshelve
<shevy> for instance, I maintain tutorials for my larger ruby projects
<Gurpartap> i remember you :)
<shevy> every some weeks, I read through them, improve them, look at the quality of the code etc..
<vectorshelve> Gurpartap: sushil kumar just won India a Gold :)
envygeeks has joined #ruby
<shevy> in what discipline
<Gurpartap> hah, nice
<shevy> olympic hacking?
<vectorshelve> shevy: is this you ? https://github.com/shevy
specialGuest has joined #ruby
<Gurpartap> meta programming olympics
yasushi has joined #ruby
<shevy> vectorshelve, yeah but I am kinda inactive there still. I am more active on rubygems https://rubygems.org/profiles/58718
<envygeeks> can anyone explain this? https://gist.github.com/3331803 << that hash was created by a simple replace of the hash with a symbolized hash
<atmosx> I was looking at 'pragmatic books' today, metaprogramming apparently made a book of its own
<Gurpartap> shevy: "kinda" inactive
<atmosx> well git has a book also, which makes no sense to me but okay
<shevy> vectorshelve, my largest 3 projects are not on rubygems yet though :(
<vectorshelve> shevy: nice collection of gems ;)
<shevy> yeah, I started with small gems, and slowly will work my way up to my main projects
<shevy> vectorshelve, I hated gems ~2 years ago
<shevy> takes some time to get rid of the hate
<shevy> atmosx, metaprogramming... I hate metaprogramming. It always confuses me
<Gurpartap> barrier
<Gurpartap> barrier
<envygeeks> you would still hate rubygems if you looked at their source
<shevy> overcome
<shevy> barrier
<shevy> envygeeks hehehehe
ly_gs has quit [Remote host closed the connection]
uris has joined #ruby
<vectorshelve> shevy: Gurpartap I want to pass a string to a method which would be a keyword for search in a site and I want to fetch the search results as array of strings. which is the best way to go abt it ? I thought if I use nokogiri it will have some element of UI html parsing which will make the whole thing inconsistent
<shevy> I should collect this epic quote :)
<Gurpartap> envygeeks++
<shevy> vectorshelve, ok so you have a method, and give input to this method via a string, which is your keyword
<vectorshelve> shevy: yes
<shevy> vectorshelve, what is "search result"... array? string?
<shevy> vectorshelve, you could try via .scan
<shevy> no idea about nokogiri, perhaps it has something convenient
<vectorshelve> shevy: suppose I pass "google" to the method.. it will search for google in a site and fetch the results as array
<shevy> ah ok
<atmosx> vectorshelve: entire website?
<shevy> so you have one huge string
ly_gs has joined #ruby
<shevy> the entire website == your huge string
m_3 has quit [Quit: leaving]
nari_ has quit [Ping timeout: 248 seconds]
<atmosx> vectorshelve: like scrapping or just the 1st page/result
<envygeeks> since Google semantically labels their results you could just do a root xpath search vectorshelve
<atmosx> vectorshelve: if you need entire website you might wanna check out 'anemone'
<atmosx> xpath with google will work but then you depend on google alone...
cousine_ has joined #ruby
<Gurpartap> envygeeks: "simple replace of the hash with a symbolized hash" is there a gist for that?
<vectorshelve> atmosx: envygeeks shevy I am planning to make a gem so this string that I pass will go search it on a site and fetch the results.. this is the use case
<Gurpartap> of how you did that
<vectorshelve> atmosx: 1st page result
<shevy> vectorshelve yes, I would just download the page locally via ruby into a string, then use .scan on it
MonsterWithin has quit [Ping timeout: 244 seconds]
<Gurpartap> vectorshelve: sorry, nokogiri/xpath noob here
<vectorshelve> Gurpartap: ok
<atmosx> vectorshelve: I don't clearly understand the use and how the results will be displayed in a human-readable-way on cli
<shevy> vectorshelve, "abc\nabc\abc".scan(/c/) # => ["c", "c", "c"]
<atmosx> oh sorry, you didn't mention cli
<vectorshelve> shevy:u mean downloading the page or downloading the text ... the result I need would be text and nothing else
<shevy> "abc\nabc\abc".scan(/.+\n*/) # => ["abc\n", "abc\abc"]
<shevy> oops
<vectorshelve> atmosx: shevy I wanna build a gem which will go get a words synonyms and antonyms from web :)
<envygeeks> vectorshelve: why not use the Google API, the Yahoo API and the Bing API? They all have raw JSON API's you could tap into much better
<shevy> "abc\nabc\nabc".scan(/.+\n/) # => ["abc\n", "abc\n"]
<shevy> vectorshelve, well first write the script, then make it a gem
<vectorshelve> shevy: yes
<atmosx> vectorshelve: hmm, I'm planning to write a similar script for my 'moralytics' tool, but I'll use online dictionaries, not google
<vectorshelve> shevy: so what would be the best way to do it ?
andrewhl has joined #ruby
<atmosx> vectorshelve: dictionaries have a standard 'search url' like http://blah.bluh<keyword>=?bogus_search=id
<vectorshelve> atmosx: I wont use google.. may be some site for similar purpose.. but will that be a forgery over the contents of the site ? #SOPA #PIPA :)
cousine has quit [Ping timeout: 240 seconds]
<shevy> vectorshelve openuri
specialGuest has quit [Ping timeout: 260 seconds]
<vectorshelve> atmosx: ok so given my use case.. what do you suggest would be the best way of implementing it ?
<vectorshelve> shevy: ok
beneggett has joined #ruby
<shevy> require 'open-uri'
<shevy> open("http://www.ruby-lang.org/") {|f|
<shevy> if you have a method, do something like
<vectorshelve> shevy: so the page would be a file
<shevy> def search_in_webpage(keyword, url = MAIN_URL)
<Gurpartap> could you use javascript based selectors? i guess performance takes a hit
<envygeeks> you had to bring open-uri into this instead of Faraday with EM-HTTP :(
<shevy> open(url) {|f|
<vectorshelve> shevy: hmm openuri would make things simple.. :)
<shevy> and the constant MAIN_URL, default to the main site you use
<shevy> in the above example:
<shevy> MAIN_URL = "http://www.ruby-lang.org/"
ly_gs has quit [Remote host closed the connection]
<shevy> envygeeks, never heard of faraday or EM-BOOBS
<vectorshelve> shevy: getting a good idea.. thanks
<Gurpartap> LOL
<vectorshelve> envygeeks: why sad smiley ?
<shevy> vectorshelve, always try to think in terms of "what your object can do"
<shevy> and objects love methods
<shevy> cat.meow
<vectorshelve> shevy: :)
<shevy> cat.run_to :seattle
<vectorshelve> shevy: ruby.code :)
<envygeeks> shevy: async http requests, so you don't block like you do with open-uri, I guess for a linear script like his it doesn't matter but meh
<shevy> vectorshelve, there is a .code method for Coderay
<shevy> it is nice, Coderay
<vectorshelve> shevy: :)
<atmosx> vectorshelve: here is a script I wrote some time ago, which among other things uses nokogiri to grep content from blogs http://codepad.org/WKiGXN0B
<Gurpartap> EM EVERYTHING
<shevy> I use it to colourize ruby code on the commandline
<vectorshelve> shevy: how ?
<shevy> cat foo.rb | ruby_colourize # <--- happy coloured ruby output
<shevy> let me look
<vectorshelve> shevy: could you explain to me these two methods def update each(&:update) end def each(&block) @cells.each(&block) end
<shevy> gem install coderay; cat foo.rb | coderay -ruby
m_3 has joined #ruby
<shevy> vectorshelve, the & confuse me
<atmosx> vectorshelve: you might an idea, however there are plenty of gems that you can use… I'd go for a list of online dictionaries with standard page structure and use x.path per page to gather the results I want.
<shevy> first one should be this:
<shevy> each(&:update)
<shevy> each {|x| x.update }
<shevy> you see?
<shevy> (I think)
<Gurpartap> yeah that
<shevy> the second one .... hmmm
<Gurpartap> it's the same
<shevy> I think you pass a proc to this method
<shevy> oh ok
<Gurpartap> except it passes a block too
<shevy> Gurpartap is expert vectorshelve, learn from him :)
<Gurpartap> lol
freeayu has quit [Read error: Connection reset by peer]
<atmosx> vectorshelve: that's a standard from which you scrap out everything http://oxforddictionaries.com/definition/english/ruby?q=ruby
<vectorshelve> shevy: yes I know.. the indian ruby hero :) Gurpartap
<shevy> hehe
<vectorshelve> atmosx: nice
<shevy> how's the work in the computer area in india? noone uses ruby right?
<vectorshelve> shevy: second method ? Gurpartap &block ?
<envygeeks> isn't PHP the biggest language there? That company that makes PHP based support software just banked millions and built a new office in one of the most expensive offices there
cloud|droid has joined #ruby
waxjar has joined #ruby
<atmosx> the url should be something like oxford_dictionary_search='http://oxforddictionaries.com/definition/english/' + word + '?q=' + word
freeayu has joined #ruby
<atmosx> vectorshelve: this one contains synomys also (quite a bunch of them)
<shevy> envygeeks cool
<shevy> perhaps I should go back to PHP
<shevy> but I hate PHP
<atmosx> I hate PHP too, but since I don't make money out of code I don't a shit about it anyway
<vectorshelve> atmosx: thanks mate
<atmosx> vectorshelve: ;-)
<vectorshelve> atmosx: will try to use that site
<shevy> atmosx hehe
<vectorshelve> shevy: India is catching up on ruby on rails.. me too :P
<atmosx> yeah, didn't check out the code, if you can scrap the synonyms using xpath (nokogiri) it would be veeeery easy to get the synomycs
<atmosx> vectorshelve: you're from india?
<vectorshelve> atmosx: what if the site updates html ;D
<vectorshelve> atmosx: yes
<shevy> vectorshelve I always found it hard to get into ruby on rails myself
<atmosx> vectorshelve: I don't know, you will worked it out alone :-P
<vectorshelve> shevy: sorry ruby.. forgot I am not supposed to name rails here :D
<shevy> it would be easier if one could learn individual ror components
<vectorshelve> shevy: I work in it.. but sadly I hate it at times.. I want to work on something stand alone... system programming sought of stuff
<envygeeks> well figured out my problem, it's because Hashie is a piece of shit
* atmosx is listening to Franz Ferdinand - This Boy, from the album You Could Have It So Much Better [2:21 mins] [192 kbps MPEG audio file] [3.28 MB] [played missing value times]
<Gurpartap> vectorshelve: is this what you're trying? https://gist.github.com/f9381fb2a163837d77b3
freeayu has quit [Ping timeout: 268 seconds]
<xorox90> are there any one who have complain about ruby's encoding?
<vectorshelve> Gurpartap: sought of but not completely
<Gurpartap> vectorshelve: your earlier code didnt actually make sense. so i tried to infer what you're aiming for
arturaz has joined #ruby
nedbat has quit [Disconnected by services]
<vectorshelve> Gurpartap: yes I got it now.. thanks :)
nedbat_ has joined #ruby
blacktulip has quit [Remote host closed the connection]
<Gurpartap> vectorshelve: &:foo has nothing to do with &block
<vectorshelve> Gurpartap: hmmm
<shevy> xorox90, yeah. The Encoding addition was the biggest piece of crap in Ruby's history. But it's futile to complain about it, it'll stay.
justsee is now known as justsee|away
<matled> shevy: the default values just suck, otherwise it's fine
<Gurpartap> encodings are like timezones
nedbat_ is now known as nedbat
freeayu has joined #ruby
<xorox90> I got it shevy thx..
<shevy> matled code that worked perfectly well in 1.8.x no longer worked in 1.9.x. for those who use UTF it's not a problem, but I wanna stay in ISO*. For me, I solve it by using # Encoding: ASCII-8BIT in every .rb file, so it is ok nowadays. but it still annoys me
ph^ has quit [Remote host closed the connection]
beneggett has quit [Quit: Computer has gone to sleep.]
Eldariof-ru has quit [Ping timeout: 244 seconds]
Eldariof59-ru has joined #ruby
<matled> shevy: exactly, they should have just used binary as default and all scripts would be compatible
<matled> it's so annoying to get shell scripts right if the locale indicates utf-8
<shevy> yeah
<matled> pathnames/environment variables/arguments may all contain characters not valid in utf-8 encoding
Eldariof27-ru has joined #ruby
iori has joined #ruby
envygeeks has left #ruby [#ruby]
<xorox90> what kind of ruby ide do you prefer? I use ruby mine but there big problem.. if I click some empty space in ruby mine, it dosen't stick to properly.. I'm sorry for my bad english...
<atmosx> xorox90: vim -> http://www.vim.org/
<jrajav> Sublime Text isn't half bad either
<atmosx> it's expensive
<atmosx> I already paid for TextMate two years ago. I believe ™ is awsome but I never 'evaluated' the money so...
<jrajav> It has an unlimited trial, and it's worth it anyway
<atmosx> I won't pay for another editor until I need one
<atmosx> unlimited trial? :-P via brokestones?
<atmosx> I've seen it a couple of days ago, there are dozens of awesome editors for macosx anyway
<jrajav> ST blows them all away
<jrajav> Bar vim
Eldariof59-ru has quit [Ping timeout: 246 seconds]
<jrajav> Trust me, I've been through this on my own :P
<atmosx> Okay, I'll check it out
<atmosx> what the heck...
<jrajav> I love vim too btw
<atmosx> yeah, copy/paste sucks on vim but that apart I'm pretty happy with it
<atmosx> and you can find plugins for about everything
fastred has quit [Ping timeout: 248 seconds]
bluenemo has joined #ruby
<xorox90> is vim also good for ror(ruby on rail)?
manizzle has quit [Remote host closed the connection]
arturaz has quit [Ping timeout: 276 seconds]
<xorox90> thx atmosx.. I would test it!
<atmosx> ok
<atmosx> xorox90: since you're planning losing time with VIM, install pathogen plugin asap
Shamgar has joined #ruby
<xorox90> ok, thx!
chichou has quit [Remote host closed the connection]
burgestrand has quit [Quit: Leaving.]
yasushi has quit [Remote host closed the connection]
<jrajav> xorox90: Full disclosure: Vim has an appreciable learning curve
<jrajav> It is, by all accounts, worth it
yasushi has joined #ruby
<jrajav> But if you don't have time or don't want to split your efforts, you might want to hold off
nedbat has quit [Ping timeout: 245 seconds]
cakehero has joined #ruby
perryh is now known as perryh_away
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
yasushi has quit [Ping timeout: 240 seconds]
twock has joined #ruby
qwerxy has quit [Quit: offski]
sazboom has joined #ruby
timonv has joined #ruby
br4ndon has joined #ruby
<shevy> long live GUI editors!
<shevy> xorox90 I wonder if we could write a ruby editor written in ruby
bluenemo has quit [Remote host closed the connection]
<xorox90> hmm sorry, I'm newbie at programming develop ...
digitalcakestudi has joined #ruby
bluenemo has joined #ruby
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
butblack has joined #ruby
<atmosx> xorox90: r u on linux windows or mac?
<xorox90> atmosx: i'm using ubuntu 12.10 main..
<atmosx> xchat on ubuntu, I gets linux...
<atmosx> okay
qwerxy has joined #ruby
<atmosx> xorox90: GNOME right?
MonsterWithin has joined #ruby
<xorox90> atmosx : yes i use!
madscientist_ has joined #ruby
br4ndon has joined #ruby
<xorox90> few month ago, i used windows, I change, ubuntu is cool for `develop` purpose..
<atmosx> gedit + ruby
<xorox90> aha.. really thx!
u_u has quit [Quit: u_u]
sazboom has quit [Quit: EPIC5-1.1.4[1667] - amnesiac : Guns make holes in people. Weed makes people giggle and eat cake.]
<shevy> gedit is weird
<shevy> I never got comfortable with it
<atmosx> shevy: since you're on linux you might wanna give a hint to our friend xorox90
madscientist_ has quit [Client Quit]
<shevy> xorox90 bluefish!!!
arturaz has joined #ruby
<shevy> but only version 1.x
<shevy> they changed so many things in 2.x
<vectorshelve> shevy: how can I make this to one line ? http://pastie.org/4460900
<atmosx> http://bluefish.openoffice.nl/screenshots.html <--- xorox90 that's good also for ruby
<atmosx> I'm off
<atmosx> vectorshelve: using require_all
yasushi has joined #ruby
<shevy> vectorshelve, %w( grid grid_creator printer tick ).each {|file| require_relative('lib/'+file+'.rb') }
<atmosx> shevy's way is much more hackerish though, I dig it
<vectorshelve> atmosx: so would it be like require_all 'lib/'
<vectorshelve> atmosx: ?
<shevy> atmosx haha. well ... it's a bit ugly
nedbat has joined #ruby
<shevy> I dont know why require_relativ does not accept an array
<atmosx> require_all 'lib/**/*.rb' <--- or ->>> require_all 'lib'
<atmosx> vectorshelve: it's a gem, https://github.com/jarmo/require_all
<vectorshelve> atmosx: thanks :)
<shevy> if anyone knows why require* only wants one string and not an array... tell me!
<vectorshelve> atmosx: I dont want to add gem to my gem file.. :)
<vectorshelve> atmosx: any better way shevy something simple than above ?
<fowl> shevy: files.map &method(:require)
<atmosx> vectorshelve: nope
<Spooner> shevy: %w<x y z>.each &method(:require_relative)
<atmosx> bb
<shevy> argh
<Spooner> fowl Map is odd in that situation.
atmosx has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<shevy> this code makes me want to kill someone
<vectorshelve> Spooner: yes
Asher has quit [Ping timeout: 248 seconds]
<fowl> Spooner: well #each is always odd.. so..
<Spooner> And require_all is a bit messy. It causes minor problems, I've found, if you run any class code or have unusual things like constants :D
Asher has joined #ruby
<Spooner> Much better to explicitly list your dependent files in an order they need to be loaded in.
cousine_ has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
Progster has joined #ruby
fowl is now known as fowlzzzzzzzzzzzz
uris has quit [Read error: Connection reset by peer]
A124 has joined #ruby
A124 has left #ruby [#ruby]
yoklov has joined #ruby
uris has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
xorox90 has quit [Quit: 전 이만 갑니다.]
resure has quit [Remote host closed the connection]
fayimora_ has quit [Quit: Busy…..zzzzz]
Criztian has joined #ruby
Axsuul has quit [Ping timeout: 256 seconds]
savage- has joined #ruby
xorox90 has joined #ruby
Progster has quit []
<vectorshelve> line 10 17 24 are repeating and the test fails when I try to put these lines inside the before block why so ? http://pastie.org/4460944
alup has quit [Read error: Connection reset by peer]
<vectorshelve> works when I make it an instance variable :)
Criztian has quit [Remote host closed the connection]
syamajala has joined #ruby
<canton7> that's why. local variables are only local to the before blocks' scope
xorox90 has quit [Remote host closed the connection]
freeayu__ has joined #ruby
xorox90 has joined #ruby
Asher has quit [Ping timeout: 244 seconds]
yasushi has quit [Remote host closed the connection]
scriabin has quit [Remote host closed the connection]
IrishGringo has joined #ruby
freeayu has quit [Ping timeout: 245 seconds]
yasushi has joined #ruby
cloud|droid has quit [Ping timeout: 248 seconds]
<vectorshelve> shevy: how to write a Rakefile for running rspec ?
yasushi has quit [Ping timeout: 245 seconds]
freeayu__ has quit [Quit: 离开]
Asher has joined #ruby
arturaz_ has joined #ruby
iori has quit [Remote host closed the connection]
<canton7> require 'rspec/core/rake_task'; RSpec::Core::RakeTask.new(:test)
arturaz has quit [Read error: Connection reset by peer]
er1c__ has joined #ruby
Asher has quit [Ping timeout: 240 seconds]
mockra has joined #ruby
er1c__ has quit [Client Quit]
subbyyy has joined #ruby
digitalcakestudi has quit [Ping timeout: 244 seconds]
Markvilla has quit [Quit: Leaving.]
waxjar has quit [Ping timeout: 252 seconds]
gener1c has joined #ruby
gener1c has joined #ruby
gener1c has quit [Changing host]
<gener1c> if i want to crawl a single site
<gener1c> is there a library for that?
<gener1c> i saw alot of scraping libs but no crawlers
jorum has joined #ruby
<canton7> spidr might do what you want
havenn has joined #ruby
nedbat has quit [Ping timeout: 244 seconds]
<gener1c> wow this is a one sexy site
bluOxigen has quit [Ping timeout: 240 seconds]
<gener1c> i love what they did with the place
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
waxjar has joined #ruby
qwerxy has quit [Quit: offski]
soooga has quit [Quit: 离开]
bier has quit [Read error: Connection reset by peer]
nedbat has joined #ruby
bier has joined #ruby
xorox90 has quit [Remote host closed the connection]
qwerxy has joined #ruby
pen has joined #ruby
heftig has quit [Ping timeout: 240 seconds]
kaen has joined #ruby
cousine has joined #ruby
k_89 has joined #ruby
Husel has quit [Quit: Page closed]
Russell^^ has quit [Quit: Russell^^]
moshee has quit [Ping timeout: 244 seconds]
moshee has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
quest88 has joined #ruby
mockra has quit [Remote host closed the connection]
nateberkopec has joined #ruby
jorum has quit [Quit: Leaving...]
cousine has quit [Remote host closed the connection]
d3vic3 has joined #ruby
cousine has joined #ruby
otters has quit [Quit: WeeChat 0.3.8]
tk_ has joined #ruby
sazboom has joined #ruby
shevy has quit [Ping timeout: 252 seconds]
fayimora has joined #ruby
<k_89> just curious ... but are any of you guys using for something not even remotely related to web dev?
<banseljaj> k_89: rephrase the question please?
fowlzzzzzzzzzzzz is now known as fowl
darren has joined #ruby
<k_89> banseljaj, i'm curious about fields where ruby is used which are not related to web-dev
<banseljaj> k_89: Ah. There I can't help you much. Although I *am* trying to developa desktop application for personal use. If only I can make stupid gtk work
<fowl> k_89: ruby is a scripting language, rails is not ruby. whoever is spreading these nefarious lies will pay for it in the afterlife.
<k_89> fowl, i 'despise' rails
<fowl> same here
<banseljaj> fowl: sinatra? merb?
<banseljaj> cucumber?
<banseljaj> rspec?
<banseljaj> PUPPET!
<banseljaj> how the fuck could i forget puppet.
<fowl> banseljaj: whats your point? just naming things?
<vectorshelve> how can I highlight code in README.rd file in github
<banseljaj> k_89: look up puppet. an enterprise level solution for setting up OSs the correct way.
<k_89> checking it out already :P
<banseljaj> fowl: meant to ask, do you also hate sinatra/merb?
<banseljaj> and the other two were for k_89. Cucumber and rspec are not exclusively related to web dev
<ddv> Not sure why it would matter if someone hates something
xorox90 has joined #ruby
<k_89> the debates though are fun to watch
<fowl> banseljaj: sinatra is alright but if i really need to host a website it will be for some debugging/controlling/reporting or something mundane like that and id rather use webrick
<banseljaj> <ddv> Not sure why it would matter if someone hates something -- +1
<k_89> i use php
<k_89> :P
<k_89> now hate me
<banseljaj> k_89: I hate you.
<k_89> haha
* banseljaj is secretly a WP dev.
<banseljaj> sometimes*
<ddv> Whatever pays the bills
<banseljaj> fowl: Ah. I understand. wasn't meaning to debate. just wanted to know. :)
<banseljaj> ddv: Indeed
Asher has joined #ruby
<banseljaj> Guys, ruby-libnotify is not installing. I have no idea why. Stupid gem. :(
<Gurpartap> karma
<banseljaj> Also, is ruby-gtk2 abandoned?
<banseljaj> Gurpartap: how? o.O
<Gurpartap> you're a php developer secretly
<fowl> banseljaj: i think its called ruby-gnome2 or something like that
<Gurpartap> your karma doesn't let you install the ruby-libnotify gem now
shevy has joined #ruby
<banseljaj> Gurpartap: Are you saying that karma didn't know about it before? :P
havenn has quit [Remote host closed the connection]
<k_89> Gurpartap, any chance you from delhi ?
<banseljaj> fowl: No gem named like that. and the library itself is not available either. their deb repo gives 404
<Gurpartap> k_89: Nop. No chance.
<k_89> heh
<fowl> banseljaj: what is a deb repo
<banseljaj> fowl: debian repository.
<banseljaj> Gurpartap: any certainty?
<fowl> banseljaj: please tell me you arent installing gems through that..
qwerxy has quit [Quit: offski]
<banseljaj> fowl: No, I'm not. I am also, not on debian. I'm on ubuntu.
<k_89> ubuntu = debian
<k_89> built on debian
<Gurpartap> banseljaj: karma is a seed, not god.
<Gurpartap> or God
<Gurpartap> or demigod
<fowl> lol .. why did you bring up debian then if it doesnt apply to you? (even though it does)
<k_89> i dont think there is anything like karma ... its all random ..
<banseljaj> k_89: Indeed. Except Ubuntu is fast forward from debian. debian still has 2 year old packages in its repo.
<k_89> or rather chaotic
<k_89> banseljaj, yeah true
<banseljaj> fowl: I was just commenting about how ruby-gnome2 has disappeared mostly
<Gurpartap> no one's debating about karma's existence :)
<Gurpartap> it's common sense, whether or not you call it karma :)
qwerxy has joined #ruby
<banseljaj> No gem named ruby-gnome2. It was apparently superseded by the gtk2 gem.
<fowl> banseljaj: http://rubygems.org/gems/gtk2 refers to itself as ruby-gnome2 project, last updated july this year, so yes still maintained..
<Gurpartap> you reap what you sow (could or could not be in the karma syllabus, k_89)
<Gurpartap> (in simpler words, you don't get random fruits if you sow a mango seed)
<Gurpartap> peace.
chichou has joined #ruby
<banseljaj> <Gurpartap> (in simpler words, you don't get random fruits if you sow a mango seed) -- If you could, that would be awesome. :D
<banseljaj> seed = MangoSeed.new; seed.plant; seed.grow;puts seed.fruit #=> Orange
<banseljaj> :D
<k_89> Gurpartap, many times things are 'sown' around by so many others .. its chaotic ... true what you do has some effect on what becomes of you .. but you cant be sure of that
vectorshelve has quit [Quit: Page closed]
<banseljaj> fowl: well, installing gtk2, I still can't install libnotify because apparently "ERROR: no gtk2.rb found, please install Ruby/Gtk2"
<Gurpartap> k_89: no way of tracking which seed resulting in which fruit != saying fruits and seeds are unrelated, to escape the difficulty of imagining a simple phenomenon :)
sazboom has quit [Quit: EPIC5-1.1.4[1667] - amnesiac : The fatter they are, the fatter they fall]
<k_89> Gurpartap, thats why i am using the word chaotic .. not random ... there's a difference between the two, big difference ;)
<Gurpartap> k_89: shunning university syllabus in 10th class takes us no where.
Zespre has joined #ruby
<banseljaj> k_89: Randomly Chaotic? :D
qwerxy has quit [Client Quit]
<Gurpartap> k_89: <k_89> "i dont think there is anything like karma"
* Gurpartap doesn't want to argue.
<Gurpartap> peace.
<k_89> ok
heftig has joined #ruby
kn330 has quit [Ping timeout: 240 seconds]
<shevy> am I too dumb to require a string?
<Gurpartap> what's to require a string
Criztian has joined #ruby
<banseljaj> shevy: require 'String'?
<shevy> well
<shevy> let me show you something...
eph3meral has joined #ruby
otters has joined #ruby
redpanda has joined #ruby
mike4_ has joined #ruby
<shevy> then I input something like this:
<shevy> sinatra
<shevy> and it tells me:
<shevy> foobar.rb:3:in `require': no such file to load -- sinatra (LoadError)
<shevy> however
<shevy> if I do
<shevy> require 'sinatra'
<shevy> it works
<shevy> HMMMMM.
<banseljaj> shevy: require '#{x}'?
<Gurpartap> shevy: x = timeout; require x => true
<Gurpartap> banseljaj: that's no different than just x, since it's already a string
<k_89> shevy, create a Gemfile
<shevy> what
<k_89> yes
<banseljaj> Gurpartap: I know. But I am kinda superstitious about it.
<shevy> x = timeout does not work for me
<k_89> shevy, create a Gemfile with gem 'sinatra' in it
<Gurpartap> shevy: quote (sorry)
<Gurpartap> quotes
<shevy> yeah
<shevy> with quotes it works
<Gurpartap> shevy: do as k_89 wants you to
<Gurpartap> :P
<shevy> why do I have to create a gemfile
<k_89> i dunno really ..
<Gurpartap> shevy: sinatra error is probably because sinatra isn't around
<Gurpartap> there's no fault with require method
<shevy> require 'sinatra' works
<k_89> yeah it'd in your script
spg has joined #ruby
<Gurpartap> shevy: try passing 'timeout' ?
<banseljaj> shevy: why are you doing this anyways?
jorum has joined #ruby
<fowl> banseljaj: what are you talking about? it says you need ruby/gtk2 so install gtk2
<banseljaj> shevy: try string interpolation once.
okapi has joined #ruby
<shevy> banseljaj to require ruby libraries via $stdin.gets
<k_89> it all started when i gave up rails and tried playing with sinatra .. i made a Rakefile to setup migrations and no gem would be required properly
<fowl> banseljaj: i just installed libnotify and gtk2 and both compiled without issue..
sysrmr has quit [Quit: Konversation terminated!]
<banseljaj> fowl: I did install gtk2. It was the first thing i did. But it still won't compie.
<k_89> shevy, then i created a gemfile .. and stuff worked
<banseljaj> fowl: you did?
<shevy> I just noticed something
<shevy> when I input:
<shevy> pp
<k_89> basically the path where gems are installed isn't included into $PATHS in ruby
<shevy> it works
<shevy> yeah.... hmmmmmm
<fowl> banseljaj: you keep saying things like "wont compile"
<shevy> now I see what you mean k_89
<shevy> damn :(
<fowl> banseljaj: does gems say "sorry i dont feel like compiling :(" or does it give an error or what
<fowl> segfault? anything more than "wont compile"
<banseljaj> fowl: well, installing gtk2, I still can't install libnotify because apparently "ERROR: no gtk2.rb found, please install Ruby/Gtk2"
<banseljaj> I have gtk2 installed.
spg has left #ruby [#ruby]
<fowl> banseljaj: nvm, figure it out yourself
<banseljaj> even then I have the above error.
<k_89> shevy, if by any chance you find out why this shit happens .. please share :P
<banseljaj> fowl: the above error keeps popping up.
<Gurpartap> k_89: we thought you knew the solution.
<Gurpartap> that you proposed :p
<fowl> banseljaj: do `ruby -e "require 'gtk2'"
<shevy> k_89 I think you are right ... there seems to be different load paths or something used
<banseljaj> fowl: did you install ruby-libnotify or libnotify?
<k_89> Gurpartap, i knew what worked .. i wasn't lying when i said i use php :P
<fowl> banseljaj: i told you earlier Do Not Install Gems Through Your Package Manager
azm has joined #ruby
<banseljaj> fowl: I am *not*. there is a GEM named ruby-libnotify.
<shevy> :)
<fowl> banseljaj: http://rubygems.org/search?utf8=%E2%9C%93&query=notify the ones with more downloads are probably more trustworthy
azm has quit [Client Quit]
<Gurpartap> lol utf8
<fowl> i installed the one called libnotify
<banseljaj> fowl: Yeah. I figured it out. Thanks for the help and I apologize if i seemed frustrating.
<banseljaj> I just installed libnotify too, and it worked.
shell0x has joined #ruby
<fowl> banseljaj: i didnt realize there was a ruby-libnotify, assumed it was the debian version
<banseljaj> fowl: I *never* use a package manager for things like gems.
<Gurpartap> rubygems is a package manager
<banseljaj> I may be crazy, but I sure ain't stupid.
<Gurpartap> that's the first sign
<Gurpartap> lol
<banseljaj> Gurpartap: A System packkage manager. :P
jonathanwallace has quit [Remote host closed the connection]
guest-4578 has joined #ruby
MonsterWithin has quit [Ping timeout: 268 seconds]
Niamkik has joined #ruby
Criztian has quit [Remote host closed the connection]
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
indian has joined #ruby
cousine has quit [Remote host closed the connection]
cousine has joined #ruby
rippa has joined #ruby
specialGuest has joined #ruby
bglusman has joined #ruby
indian has quit [Ping timeout: 265 seconds]
Astral_ has quit [Read error: Connection reset by peer]
Astral_ has joined #ruby
dpk has joined #ruby
specialGuest has joined #ruby
specialGuest has quit [Changing host]
pu22l3r has joined #ruby
d3vic3 has quit [Quit: leaving]
iori has joined #ruby
Astral has joined #ruby
baphled has quit [Quit: Lost terminal]
kn330 has joined #ruby
Astral_ has quit [Ping timeout: 248 seconds]
baphled has joined #ruby
karneisada has joined #ruby
baphled has quit [Client Quit]
baphled has joined #ruby
banseljaj is now known as imami|afk
mockra has joined #ruby
nedbat has quit [Ping timeout: 276 seconds]
fastred has joined #ruby
karneisada has quit [Ping timeout: 246 seconds]
Stalkr_ has quit [Quit: Linkinus - http://linkinus.com]
mockra has quit [Ping timeout: 252 seconds]
banisterfiend has quit [Remote host closed the connection]
kyktommy has quit [Quit: kyktommy]
Ethan has quit [Ping timeout: 240 seconds]
kyktommy has joined #ruby
bier has quit [Ping timeout: 244 seconds]
Criztian has joined #ruby
timonv has quit [Remote host closed the connection]
mrdodo has joined #ruby
igotnolegs has joined #ruby
Criztian has quit [Remote host closed the connection]
kidoz has joined #ruby
jorum has quit [Quit: Leaving...]
pelao has joined #ruby
darren has quit [Remote host closed the connection]
whicling has joined #ruby
cousine has quit [Remote host closed the connection]
mike4_ has quit [Ping timeout: 276 seconds]
pu22l3r has quit [Remote host closed the connection]
savage- has quit [Remote host closed the connection]
fantazo has joined #ruby
wallerdev has joined #ruby
bier has joined #ruby
MarGarina has quit [Ping timeout: 252 seconds]
jorum has joined #ruby
fastred has quit [Ping timeout: 240 seconds]
khakimov has joined #ruby
arietis has quit [Quit: Computer has gone to sleep.]
maxmmurphy has quit [Quit: maxmmurphy]
maxmmurphy has joined #ruby
brdude has joined #ruby
k_89 has quit [Ping timeout: 240 seconds]
arietis has joined #ruby
fastred has joined #ruby
Eplemosen has joined #ruby
redpanda has quit [Remote host closed the connection]
dtribble has joined #ruby
Gurpartap has quit [Quit: Page closed]
whicling is now known as mike4_
Guest41133 has quit [Read error: Connection reset by peer]
Guest41133 has joined #ruby
Guest41133 has quit [Read error: Connection reset by peer]
burgestrand has joined #ruby
hemanth has joined #ruby
butblack has quit [Quit: butblack]
mockra has joined #ruby
ringotwo has joined #ruby
timonv has joined #ruby
burgestrand has quit [Quit: Leaving.]
bglusman has quit [Remote host closed the connection]
Morkel has joined #ruby
brdude has quit [Ping timeout: 268 seconds]
jimeh2 has joined #ruby
guest-4578 has left #ruby ["Leaving"]
burgestrand has joined #ruby
butblack has joined #ruby
xorox90 has quit [Remote host closed the connection]
qwerxy has joined #ruby
centipedefarmer has quit [Quit: This computer has gone to sleep]
yxhuvud has joined #ruby
kyktommy has quit [Quit: kyktommy]
Criztian has joined #ruby
tk_ has quit [Quit: ばいばい]
dpk has quit [Quit: Asleep at the keyboard.]
jbw has quit [Ping timeout: 276 seconds]
fastred has quit [Ping timeout: 260 seconds]
Criztian has quit [Remote host closed the connection]
mrdodo has quit [Remote host closed the connection]
DarthGandalf has quit [Read error: Operation timed out]
adelcampo has joined #ruby
burgestrand has quit [Quit: Leaving.]
lkba has quit [Ping timeout: 240 seconds]
MouseTheLuckyDog has joined #ruby
MouseTheLuckyDog has left #ruby ["Leaving"]
fastred has joined #ruby
flak has joined #ruby
flak is now known as Guest11049
David_Miller has quit [Quit: Changing server]
mockra has quit [Remote host closed the connection]
gmci has quit [Quit: Computer has gone to sleep.]
mockra has joined #ruby
Araxia has joined #ruby
drago757 has joined #ruby
iori has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 252 seconds]
darren has joined #ruby
imami|afk is now known as banseljaj
jbw has joined #ruby
ChampS666 has joined #ruby
burgestrand has joined #ruby
ProT-0-TypE has joined #ruby
darren has quit [Remote host closed the connection]
elaptics is now known as elaptics`away
elaptics`away is now known as elaptics
mirTapir has quit [Excess Flood]
adelcampo has quit [Quit: Leaving...]
mirTapir has joined #ruby
mockra has quit [Ping timeout: 246 seconds]
cousine has joined #ruby
mfridh has quit [Ping timeout: 268 seconds]
syamajala has quit [Remote host closed the connection]
randomautomator has joined #ruby
randomau_ has joined #ruby
v0n has joined #ruby
kidoz has quit [Quit: Ухожу я от вас]
maletor has joined #ruby
yoklov has quit [Quit: computer sleeping]
brianpWins has quit [Quit: brianpWins]
timonv has quit [Remote host closed the connection]
mfridh has joined #ruby
randomautomator has quit [Ping timeout: 245 seconds]
zelo has left #ruby ["Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is"]
ProT-0-TypE has quit [Quit: Leaving]
katherinem13 has quit [Quit: Might IS right.]
katherinem13 has joined #ruby
cousine has quit [Remote host closed the connection]
baphled has quit [Read error: Connection reset by peer]
rubious has joined #ruby
chichou has quit [Remote host closed the connection]
Markvilla has joined #ruby
subbyyy has quit [Ping timeout: 248 seconds]
javos has joined #ruby
subbyyy has joined #ruby
subbyyy has quit [Max SendQ exceeded]
elaptics is now known as elaptics`away
subbyyy has joined #ruby
drago757 has quit [Quit: drago757]
dv_ has quit [Quit: mooh]
randomau_ has quit [Read error: Connection reset by peer]
BrokenCog has joined #ruby
BrokenCog has joined #ruby
BrokenCog has quit [Changing host]
dv_ has joined #ruby
baphled has joined #ruby
jorum has quit [Quit: Linkinus - http://linkinus.com]
cantonic_ has joined #ruby
baphled has quit [Client Quit]
workmad3 has joined #ruby
darren has joined #ruby
<Aenigma> i have a directory of 88,000 files or so. (they're jpeg images downloaded from a live camerea). i wanted to deduplicate it using ruby so i made it populate a hash keyed with md5 checksums with values being the file paths. i ran out of ram doing this. i'm not sure why. what's the right way to do this?
cantonic has quit [Ping timeout: 245 seconds]
cantonic_ is now known as cantonic
alexwh has quit [Ping timeout: 252 seconds]
snearch has joined #ruby
javos has quit [Quit: Linkinus - http://linkinus.com]
Rochefort has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
<apeiros_> Aenigma: sounds like you leaked memory
atmosx has joined #ruby
Stalkr_ has joined #ruby
<apeiros_> after all, an md5 is 16bytes, lets assume your average file path is 112bytes then that's 128bytes per file. 88k*128B =~ 11MB
<jrajav> >> 88000 * 128 / 1024
<al2o3cr> (Fixnum) 11000
<jrajav> ;)
<fowl> >> 88000 * 128.0 / 1024
<al2o3cr> (Float) 11000.0
<apeiros_> >> require 'units'
<al2o3cr> stderr was too long, I PMed it to you
<al2o3cr> exit status: 1
khakimov has quit [Quit: Computer has gone to sleep.]
DarthGandalf has joined #ruby
Criztian has joined #ruby
indian has joined #ruby
<atmosx> hello
adelcampo has joined #ruby
<Aenigma> apeiros_: blahh. how do i fix memory leaks? the only thing that would leak enough would be the actual files and i opened those using File.open block
<apeiros_> Aenigma: feel free to share the code ;-)
ly_gs has joined #ruby
<apeiros_> other than that, in the older days I used bleakhouse. don't know if it's been updated for 1.9, though
<apeiros_> on osx, you might be able to use dprobes
<atmosx> begin / rescue/ <bold>ensure</bold> File.close ?
workmad3 has quit [Ping timeout: 272 seconds]
<apeiros_> atmosx: File.open with a block does that better.
maletor has quit [Quit: Computer has gone to sleep.]
<atmosx> apeiros_: okay
baphled has joined #ruby
ianbrandt has joined #ruby
maletor has joined #ruby
yakko has joined #ruby
mockra has joined #ruby
baphled has quit [Client Quit]
baphled has joined #ruby
<jrajav> Forgive me if I'm derping
<jrajav> But isn't 88k * 128b actually 11k MB?
<jrajav> i.e. ~ 11 GB?
omry has joined #ruby
dangsos has joined #ruby
eph3meral has left #ruby ["Leaving"]
<dangsos> anyone have any experience with the refinery cms gem?
<fowl> Aenigma: why are you using File.open to md5? you can Digest::MD5.file()
<jrajav> There's still the problem of storing the hash
<jrajav> Wait. I *am* derping
<jrajav> Don't mind me
baphled has quit [Client Quit]
baphled has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
lkba has joined #ruby
mockra has quit [Ping timeout: 244 seconds]
mengu has joined #ruby
mrdodo has joined #ruby
yakko has quit [Quit: No Ping reply in 180 seconds.]
specialGuest has quit [Ping timeout: 268 seconds]
yakko has joined #ruby
dangsos has quit [Quit: Page closed]
mrdodo has quit [Ping timeout: 248 seconds]
fayimora has quit [Quit: Busy…..zzzzz]
brianpWins has joined #ruby
atmosx has quit [Ping timeout: 244 seconds]
ly_gs has quit [Remote host closed the connection]
timonv has joined #ruby
alexwh has joined #ruby
butblack has quit [Quit: butblack]
macer_ has joined #ruby
macer_ is now known as macer1
<macer1> hey
<macer1> anyone here is using bindata?
yakko_ has joined #ruby
h8R has joined #ruby
yakko has quit [Ping timeout: 260 seconds]
Guest11049 is now known as rippa
lledet has joined #ruby
<lledet> anyone know of a good json-rpc client gem?
<Aenigma> fowl: blah. why are the ruby-docs for md5 stuff so crappy? i don't Digest::MD5 even documented at all
gmci has joined #ruby
fayimora has joined #ruby
specialGuest has joined #ruby
specialGuest has quit [Changing host]
specialGuest has joined #ruby
<fowl> Aenigma: get pry, its useful: http://pastie.org/4462078
baroquebobcat has joined #ruby
arturaz_ has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
<Aenigma> fowl: very cool
inteq has joined #ruby
joast has quit [Ping timeout: 250 seconds]
atmosx has joined #ruby
MarGarina has joined #ruby
yakko_ has quit [Quit: No Ping reply in 180 seconds.]
yakko has joined #ruby
qwerxy has quit [Quit: offski]
yakko has quit [Client Quit]
Niamkik has quit [Quit: leaving]
yakko has joined #ruby
<apeiros_> jrajav: um, yes, you're derping :)
<apeiros_> 88000*128Bytes = 11264000Bytes -> 11000KBytes -> 10.74MBytes
<apeiros_> no idea how you get to 11GB
yakko has quit [Client Quit]
monkegjinni has joined #ruby
yakko has joined #ruby
kuzushi has quit [Ping timeout: 240 seconds]
himsin has joined #ruby
axl_ has joined #ruby
<apeiros_> fowl: actually MD5.file just opens the file too :) but I'd use that one too. depending on how Aenigma did it, that shouldn't be the problem, though.
Quadrant has joined #ruby
snearch has quit [Quit: Verlassend]
snearch has joined #ruby
atmosx has quit [Ping timeout: 252 seconds]
<fowl> apeiros_: but it opens in binary and reads it in parts and all that which you probably wouldnt do if you just used File.open()
<apeiros_> fowl: as I said - depending on how he did it. we don't know.
<jrajav> I magically forgot about kilobytes as a concept
<jrajav> It was pretty trippy
snearch has quit [Client Quit]
axl_ has quit [Ping timeout: 248 seconds]
<jrajav> I think tomorrow I'll forget about the number 36
<jrajav> See how that works out
Jackneill has quit [Ping timeout: 260 seconds]
yoklov has joined #ruby
peterhellberg has joined #ruby
kylesnav has joined #ruby
kylesnav has left #ruby [#ruby]
yoklov has quit [Max SendQ exceeded]
<peterhellberg> And I’m back online :)
rubious has left #ruby ["Linkinus - http://linkinus.com"]
<banseljaj> Hey guys, is there a way to interface directly to a USB device from ruby?
qwerxy has joined #ruby
kuzushi has joined #ruby
<peterhellberg> banseljaj: https://rubygems.org/gems/libusb
yoklov has joined #ruby
Eldariof27-ru has quit []
<peterhellberg> banseljaj: What came up after a quick google search… not sure how well it works
<banseljaj> Hmm.
banisterfiend has joined #ruby
yoklov has quit [Max SendQ exceeded]
<banseljaj> I basically am making an Inventory Management system, using ruby/GTK
yoklov has joined #ruby
<banseljaj> The barcode scanner outputs an image from USB.
qwerxy has quit [Client Quit]
perryh_away is now known as perryh
<banseljaj> there is a barcode reader gem. If I could readit directly from the USB, it'd be awesome and cut unnecessary C/C++ dev from the loop.
<peterhellberg> Ok, but does it store the image "locally" or is it the driver that is completely responsible for saving the image to the computer?
<peterhellberg> Also, what model and make is the barcode reader
Astral_ has joined #ruby
<peterhellberg> '?
<regedarek> Hello @other_pins = Pin2Owner.where(ssid: "+#{params[:id]}", user_id: !@user.id)
<banseljaj> peterhellberg: I don't know about the first question. not yet. for the second: http://www.barcodesinc.com/honeywell/part-1900hhd-0usb.htm
dtribble has quit [Ping timeout: 248 seconds]
<regedarek> how to use in where user_id wihout @user.id??
yxhuvud has quit [Ping timeout: 252 seconds]
yoklov has quit [Quit: computer sleeping]
<davidcelis> regedarek: #rubyonrails
Astral has quit [Ping timeout: 240 seconds]
<peterhellberg> banseljaj: The specs list it as having the following interfaces: USB, Keyboard Wedge, RS232, IBM 46xx (RS485)
timonv has quit [Remote host closed the connection]
<peterhellberg> banseljaj: That sounds like it does the decoding internally and then just sending the final data over the wire?
<banseljaj> peterhellberg: Yes. I assume that USB would be easier?
bbloom has joined #ruby
<banseljaj> peterhellberg: So it seems. I am not sure.
<peterhellberg> banseljaj: Yes, probably
<peterhellberg> banseljaj: But you can probably just read the serial data arriving from the device
<banseljaj> peterhellberg: string.unpack?
sepp2k has joined #ruby
<peterhellberg> I have no idea, just guessing here :)
mengu has quit [Remote host closed the connection]
<banseljaj> :)
<banseljaj> Thanks anyways.
yakko has quit [Quit: No Ping reply in 180 seconds.]
<peterhellberg> banseljaj: Didn’t the device come with drivers/software?
<banseljaj> the libusb thing will also come in handy.
yakko has joined #ruby
<banseljaj> peterhellberg: Unfortunately, it's not here yet, so I'm shooting blind.
<banseljaj> I am preparing for any/all possibilities atm.
<banseljaj> And since the client's paying for it happily, I have no problem with it either. :)
<peterhellberg> banseljaj: “A modern USB scanner acts like a keyboard”
ly_gs has joined #ruby
<peterhellberg> So it will pretty much output the decoded string
<banseljaj> A decoded string in binary. even cooler, and less work for me.
<peterhellberg> You’ll just have to figure out a way to read it :)
<banseljaj> Meh. All the more fun. :)
Rochefort has quit [Read error: Connection reset by peer]
Axsuul has joined #ruby
banseljaj is now known as imami|afk
Rochefort has joined #ruby
Rochefort has quit [Read error: Connection reset by peer]
Beoran_ has quit [Ping timeout: 276 seconds]
pingfloyd has joined #ruby
Rochefort has joined #ruby
<peterhellberg> imami|afk: It does seem like an Area Imager has _many_ more features than just decoding 1D barcodes.
v0n has quit [Ping timeout: 252 seconds]
imami|afk is now known as banseljaj
<banseljaj> peterhellberg: wat
<peterhellberg> Like for example; Image capture: VGA, 838x640
<peterhellberg> banseljaj: So it probably need some configuration/host drivers
gmci has quit [Quit: Computer has gone to sleep.]
<banseljaj> And my server will be running linux, and the drivers will be for windows.
<banseljaj> :(
<peterhellberg> But they have a Linux (Java?) version of their POS software available for download on their site.
<peterhellberg> So the server is physically connected to the Xenon 1900?
<banseljaj> It's supposed to
Rochefort has quit [Read error: Connection reset by peer]
<peterhellberg> Ok
<banseljaj> Although. I can put the server in the back and have it interface with a windows PC.
<banseljaj> the PC gets the data, transmits it to the server and that does its magic.
<peterhellberg> Oh, and you can download the "HSM JPOS Suite for Linux" from http://www.honeywellaidc.com/en-US/Pages/Product.aspx?category=Area%20Imager&cat=HSM&pid=1900
Rochefort has joined #ruby
<banseljaj> Wait, You're the "Pinch" guy.
gmci has joined #ruby
Rochefort has quit [Read error: Connection reset by peer]
<peterhellberg> That is I ;)
ly_gs has quit [Remote host closed the connection]
Rochefort has joined #ruby
Beoran_ has joined #ruby
<banseljaj> Ooh. Nice. Pleased to meet you. :)
<banseljaj> I have to go now. :(
<peterhellberg> How so?
<peterhellberg> Ok
<banseljaj> But I lurk here all day.
Rochefort has quit [Read error: Connection reset by peer]
<peterhellberg> I’m on a train…
Rajesh has joined #ruby
<banseljaj> peterhellberg: Pleased to meet you, cuz you were super helpful. And are a generally helpful part of the ruby community. :)
<peterhellberg> So I might _not_ be here all day due to my flaky 3G connection
banseljaj is now known as imami|afk
Rajesh is now known as Guest94817
Rochefort has joined #ruby
mike4_ has quit [Ping timeout: 276 seconds]
cantonic has quit [Quit: cantonic]
drewbug02 has joined #ruby
brianpWins has joined #ruby
itnomad has joined #ruby
cantonic has joined #ruby
yakko has quit [Remote host closed the connection]
mike4_ has joined #ruby
specialGuest1 has joined #ruby
specialGuest has quit [Ping timeout: 252 seconds]
atmosx has joined #ruby
banghouse has joined #ruby
specialGuest1 has quit [Quit: WeeChat 0.3.8]
chichou has joined #ruby
banghouse has quit [Remote host closed the connection]
joekarma has joined #ruby
<joekarma> /join ruby-lang
centipedefarmer has joined #ruby
<joekarma> sorry
d3vic3 has joined #ruby
Hanmac has quit [Ping timeout: 248 seconds]
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
specialGuest has joined #ruby
adelcampo has quit [Quit: Leaving...]
dtribble has joined #ruby
drewbug02 has quit [Quit: drewbug02]
joast has joined #ruby
falieson has joined #ruby
<falieson> How can I make this program faster? right now it looks like it will take 700 minutes....
Rochefort has quit [Read error: Connection reset by peer]
khakimov has joined #ruby
Rochefort has joined #ruby
butblack has joined #ruby
peterhellberg has quit [Read error: Connection reset by peer]
<apeiros_> add a Timeout.timeout(1) do … end - makes it end after 1s, guaranteed!
<jrajav> falieson: First of all, upgrade your prime check a bit
<jrajav> (First one)
Rochefort has quit [Read error: Connection reset by peer]
darren has quit [Remote host closed the connection]
<falieson> jrajav, cleveR! haha
Rochefort has joined #ruby
<falieson> jrajav, but the prime isn't what's taking a long time. the figuring out a factor is
welterde has quit [Ping timeout: 246 seconds]
<jrajav> falieson: Yup, as for that part, I'll just give you a hint, because that's the interesting problem
<jrajav> You should first find all the PRIME factors of a number
<jrajav> And you can then use those to get all factors
<falieson> hmmm
<falieson> I get it
<falieson> so check if the number is prime first before checking if its a factor
qwerxy has joined #ruby
chichou has quit [Remote host closed the connection]
mirTapir has quit [Ping timeout: 272 seconds]
adelcampo has joined #ruby
resure has joined #ruby
<jrajav> If you give up, spoilers (Javascript): http://www.btinternet.com/~se16/js/factor.htm
Z_Mass has joined #ruby
imami|afk is now known as banseljaj
<jrajav> falieson: No, the point is that it's easier computationally to get prime factors
beakerma_ has joined #ruby
<falieson> right
bluOxigen has joined #ruby
tommyvyo has joined #ruby
falieson has quit [Read error: Connection reset by peer]
beakerman has quit [Ping timeout: 276 seconds]
specialGuest has quit [Changing host]
specialGuest has joined #ruby
timonv has joined #ruby
Hanmac has joined #ruby
nobitanobi has joined #ruby
er1c_ has quit [Quit: WeeChat 0.3.4]
<nobitanobi> afternoon
carloshh has joined #ruby
Markvilla has quit [Quit: Leaving.]
monkegjinni has quit [Remote host closed the connection]
<nobitanobi> When I do in irb: Class.class => Class . So, my question is. How the Class object got instantiated??
Markvilla has joined #ruby
<nobitanobi> it is an instance of itself?
timonv has quit [Ping timeout: 245 seconds]
<apeiros_> yes
<apeiros_> so is Object
<apeiros_> since Object.is_a?(Object)
<apeiros_> and Object is a Class, but Class is an Object
<nobitanobi> wow
<nobitanobi> paradox
<apeiros_> enjoy the circularity there and don't let your mind be blown too much ;-)
jimeh2 has quit [Ping timeout: 256 seconds]
<nobitanobi> right... Thanks apeiros_
Astral_ has quit [Ping timeout: 252 seconds]
* Hanmac wispers about singletonclass of singletonclass
* nobitanobi hides
d3vic3 has quit [Quit: leaving]
jimeh2 has joined #ruby
icy` has joined #ruby
icy` has quit [Changing host]
icy` has joined #ruby
macer1 has quit [Ping timeout: 240 seconds]
nobitanobi has quit [Read error: Connection reset by peer]
linoj has joined #ruby
nobitanobi has joined #ruby
cantonic has quit [Quit: cantonic]
Rochefort has quit [Read error: Connection reset by peer]
punknology has joined #ruby
Rochefort has joined #ruby
nedbat has joined #ruby
adelcampo has quit [Quit: Leaving...]
Markvilla has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
punknology has quit [Client Quit]
sysrmr has joined #ruby
Markvilla has joined #ruby
Araxia has quit [Quit: Araxia]
carloshh has quit []
nobitanobi has quit [Read error: Connection reset by peer]
drago757 has joined #ruby
nobitanobi has joined #ruby
R40UL has joined #ruby
butblack has quit [Quit: butblack]
<R40UL> is there a way to check if this string "8" is numeric?
butblack has joined #ruby
<shevy> R40UL via regex
insecurlex has joined #ruby
<R40UL> let me take a look at that, regex is a very dirty way to do it i think
<shevy> "aaa8" =~ /\d+/ # => 3
<shevy> "8" =~ /\d+/ # => 0
<shevy> you see a position number returned
<shevy> if you use a non number like
<shevy> "a" =~ /\d+/ # => nil
<shevy> you see nil returned
<shevy> you can make use of this information to find out if it is a number or not
<shevy> I think there are more ways too, without regex probably
<R40UL> So 0 means probably int
<shevy> "0"
<shevy> yeah
<shevy> :)
<Azure> I wonder how many integer commification solutions have been made at this point.
<Hanmac> /^\d+$/
<R40UL> php has ctype_digit
awarner has joined #ruby
<Hanmac> this /^[[:digit:]]+$/ is more cool then /^\d+$/
cantonic has joined #ruby
fastred has quit [Quit: fastred]
adelcampo has joined #ruby
<R40UL> I now have this if statement
nobitanobi has quit [Read error: Connection reset by peer]
<R40UL> 'if /^\d+$/.match(responsePostValue) # numeric'
<R40UL> is it correct?
<Hanmac> use =~ if you are not interested in the matched data
r0bby_ has joined #ruby
nobitanobi has joined #ruby
<R40UL> no, because then I need a way to fix the '== 0' in the if statement Hanmac
<Hanmac> R40UL you are in ruby, not C
<matled> R40UL: I'd rather use \A and \z, which match beginning and end of string, not beginning/end of line
robbyoconnor has quit [Ping timeout: 276 seconds]
<R40UL> other than that, I get an error while converting 'undefined method `to_int' for "1":String (NoMethodError)'
<R40UL> responsePartValue = responsePartValue.to_int
<joekarma> probably a terrible way to do it... but I suppose you could try s.to_f.to_s == s or s.to_d.to_s == s
cj3kim has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
<joekarma> er to_i
<joekarma> not to_d
robbyoconnor has joined #ruby
<Mon_Ouie> to_int is when the object actually can be treated as an integer. It works on numerics, but not on a string.
<R40UL> to_d is double right?
<Mon_Ouie> See #to_i
syamajala has joined #ruby
<joekarma> R40UL: to_d is not a method, that was a mistake on my part
Guest94817 has quit [Quit: Leaving to Quit]
r0bby_ has quit [Ping timeout: 248 seconds]
<Mon_Ouie> joekarma: In that case, you might as well check if % 1.0 == 0
<Hanmac> R4OUL: to_int: treat as integer (only for Numeric childs): to_i: "convert" to integer : to_d: "convert" to bigdecimal
linoj has quit [Quit: linoj]
hkhalid has joined #ruby
<hkhalid> hi
<Mon_Ouie> Also notice the convention in Ruby is to use snake_case over camelCase for variable and method names
<R40UL> oh
<R40UL> thanks !
<R40UL> will change it, i'm used to php u know ;p
cantonic has quit [Read error: Connection reset by peer]
waxjar has quit [Ping timeout: 276 seconds]
cantonic has joined #ruby
<joekarma> the question is, is "3e6" numeric?
<Hanmac> yeah we notic the smell on php on your body
<joekarma> it certainly is if you key it into a repl without quotes
<R40UL> Hanmac I'm currently converting, so sorry :<
cantonic has quit [Client Quit]
<RubyPanther> R40UL: if (Integer(val) rescue nil) ...
<Hanmac> >> "3e4".to_f
<al2o3cr> (Float) 30000.0
<RubyPanther> or (Float(val) rescue nil) if you want 1.0 or 3e6 to pass
cantonic has joined #ruby
rippa has quit [Ping timeout: 256 seconds]
<otters> >> Float("foo")
<al2o3cr> exit status: 1
<al2o3cr> stderr was too long, I PMed it to you
<RubyPanther> That is why it is (Float("foo") rescue nil) :)
burgestrand has quit [Quit: Leaving.]
<otters> so they say
* Hanmac not like rescue nil ... because it rescue EVERYthing ...
<joekarma> def is_numeric(s) Float(s) rescue nil or Integer(val) rescue nil end
<joekarma> I like it
<RubyPanther> Hanmac: that is a different issue, this is the statement postfix form it rescues everything always and nil is just the return value, you can also say rescue false
<joekarma> not much can go wrong in that single statement
<otters> yeah, so like, in what case will Float(...) throw an error that you aren't expecting
<RubyPanther> add a couple parents are you're golden
<RubyPanther> parens
<Hanmac> RubyPanther my problem is that it even rescue "fatal" wich is bad imo
nobitanobi has quit [Read error: Connection reset by peer]
havenn has joined #ruby
waxjar has joined #ruby
<otters> how can float parsing throw a fatal error
<joekarma> "<input type crash>"
<RubyPanther> it isn't going to rescue anything other than the call to Float()
<Hanmac> the fatal could come somewhere from the inside of ruby
hkhalid has quit [Quit: Leaving]
yakko has joined #ruby
<apeiros_> otters: it won't. that doesn't mean nothing else can while that code is being executed.
<otters> oh
<joekarma> can it really rescue code from a different thread though?
<apeiros_> Hanmac: inline rescue uses StandardError - are you sure it'd rescue fatal?
awarner has quit [Remote host closed the connection]
<Hanmac> >> fatal rescue nil
<al2o3cr> (NilClass) nil
<Mon_Ouie> NameError: undefined local variable or method `fatal' for main:Object
<joekarma> anyhow, I suppose if you're really paranoid you could wrap all that in a begin end and rescue ArgumentError explicitly.. but that kind of seems like Javaification to me
waxjar has quit [Ping timeout: 245 seconds]
Chryson has quit [Quit: Leaving]
moshee has quit [Ping timeout: 265 seconds]
<apeiros_> Hanmac: there's no fatal method…
moshee has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
<apeiros_> and NameError < StandardError
<joekarma> >> abort rescue 3
<al2o3cr> exit status: 1
<joekarma> >> (quit) ; lisp style
<al2o3cr> exit status: 1
<al2o3cr> stderr was too long, I PMed it to you
<atmosx> I'd like to scan for twitter username. I came up with this: if word.scan(/^@\w+/) but the regexp for some reason doesn't work
<atmosx> rubular shows it as if it's correct
waxjar has joined #ruby
<atmosx> but no matter what 'word' is, it gets accepted
timonv has joined #ruby
<Mon_Ouie> accepted?
<apeiros_> atmosx: dude, you're on irc long enough to know that "doesn't work" is a horrible problem description
croz has joined #ruby
croz has quit [Max SendQ exceeded]
baroquebobcat has quit [Quit: baroquebobcat]
<atmosx> apeiros_: true, sorry I'm tired
<Mon_Ouie> String#scan return an Array, not a boolean
croz has joined #ruby
croz has quit [Max SendQ exceeded]
<joekarma> probably because you're trying to scan for usernames that appear only at the beggining of a string
<joekarma> you might be looking for \b
<apeiros_> joekarma: @ is not a word boundary
<joekarma> s/beggining/beginning/
croz has joined #ruby
<joekarma> apeiros_: good point
<atmosx> apeiros_: I'm just trying to grab whatever word begins with '@' here. But it accepts strings that start without '@'.
croz has quit [Max SendQ exceeded]
<apeiros_> and I doubt he'd want foo@bar to match…
croz has joined #ruby
croz has quit [Max SendQ exceeded]
<Mon_Ouie> It sounds to me like you want =~
<atmosx> =~ hmm
croz has joined #ruby
croz has quit [Max SendQ exceeded]
<Mon_Ouie> If you use scan(…) in a condition, it will always be true, because it will always be an array
Morkel has quit [Quit: Morkel]
croz has joined #ruby
croz has quit [Max SendQ exceeded]
<joekarma> atmosx: you could split on whitespace first then use select
<Hanmac> hm there is an rb_fatal method but i think its hidden from the plain side
croz has joined #ruby
croz has quit [Max SendQ exceeded]
nat2610 has joined #ruby
<atmosx> Mon_Ouie: aha, didn't knew
<joekarma> >> "the words in this @paragraph".split(/\s+/).select { |w| w[0] == ?@ }
<al2o3cr> (Array) ["@paragraph"]
<Mon_Ouie> Since he named his variable word, I guess he already split the text somehow
croz has joined #ruby
croz has quit [Max SendQ exceeded]
blah123 has joined #ruby
croz has joined #ruby
croz has quit [Max SendQ exceeded]
fantazo has quit [Remote host closed the connection]
croz has joined #ruby
croz has quit [Max SendQ exceeded]
<joekarma> Mon_Ouie: yes, his problem was probably just the use of scan
<joekarma> as you mentioned
perryh is now known as perryh_away
croz has joined #ruby
croz has quit [Max SendQ exceeded]
blah123 has quit [Client Quit]
<atmosx> Mon_Ouie: thanks a lot, works and it's easy to read using =~
croz has joined #ruby
croz has quit [Max SendQ exceeded]
blah123 has joined #ruby
croz has joined #ruby
croz has quit [Max SendQ exceeded]
croz has joined #ruby
croz has quit [Max SendQ exceeded]
croz has joined #ruby
resure has quit [Remote host closed the connection]
Z_Mass has quit [Quit: Leaving]
<maletor> Anybody know what might cause this: https://gist.github.com/9ca7907a5b17a6bc662f
Araxia has joined #ruby
waxjar has quit [Ping timeout: 246 seconds]
blah123 has quit [Client Quit]
drewbug02 has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
baphled has quit [Ping timeout: 244 seconds]
drewbug02 has quit [Client Quit]
blah123 has joined #ruby
blah123 has quit [Client Quit]
waxjar has joined #ruby
timonv has quit [Remote host closed the connection]
blah123 has joined #ruby
<apeiros_> maletor: you calling each_byte on nil might cause this
<apeiros_> actually not just might. definitively does.
blah123 has quit [Client Quit]
<apeiros_> and all you have to do is follow the backtrace in reverse-order.
bluenemo has quit [Read error: Connection reset by peer]
<joekarma> to be fair, it doesn't look like he's calling it
<joekarma> it's uri that's calling it
ly_gs has joined #ruby
<maletor> lol
balki has joined #ruby
alanp_ has joined #ruby
<joekarma> so, my guess is that the problem is in outbound_fax_create, the source of which we're not privy to
<maletor> to be fiar, here's where it is called from: https://gist.github.com/80cd3aaae656127da876
<apeiros_> joekarma: yeah, that's him by proxy
<joekarma> probably a missing param in a url or something. probably
<apeiros_> so, still him
waxjar has quit [Ping timeout: 240 seconds]
<atmosx> good night all
<atmosx> I'm off to bed
Spooner_ has joined #ruby
<maletor> weird
sazboom has joined #ruby
<maletor> getting rid of all options and body => makes it work. upgrading from 18 to 19 broke this.
alanp has quit [Ping timeout: 245 seconds]
balki_ has quit [Ping timeout: 245 seconds]
cj3kim has quit [Quit: This computer has gone to sleep]
* joekarma is betting a little experimentation will show that getting rid of *one* of the options will fix this
blah123 has joined #ruby
<maletor> nope
<vandemar> maletor: after the } on :query => {... } try .reject{|k,v| $stderr.puts "#{k.to_s} is null"; v==nil}
<apeiros_> "is null" - awesome :)
Spooner has quit [Ping timeout: 244 seconds]
<apeiros_> java coder? :D
waxjar has joined #ruby
mmokrysz has joined #ruby
* apeiros_ has a friend who still calls the NoMethodError a NullPointerException
mmokrysz has left #ruby [#ruby]
banseljaj is now known as imami|afk
<R40UL> but really, ruby is like so much faster in compiling then java
<vandemar> apeiros_: no. why?
cj3kim has joined #ruby
<joekarma> most languages call it null.. just lisp and ruby are the outliers
<Hanmac> maletor: "== nil" is bad ... use ".nil?"
MarGarina has quit [Ping timeout: 246 seconds]
dekronin1 has joined #ruby
<vandemar> maletor: also try putting something in the body
<maletor> so what is the value of the key is nil? ?no_value=&value=asdf
<bperry> or "if not var" :)
<maletor> is valid
<maletor> but not for ruby?
jimeh3 has joined #ruby
leoncame` has joined #ruby
<R40UL> if !var
<R40UL> ?
<apeiros_> joekarma: yeah, but IME, java coders suffer the most long term damage :-p
<apeiros_> vandemar: btw., #{} calls to_s already. no need to do it yourself.
<vandemar> maletor: what does that have to do with ruby? it's the gem/library that might not be filtering out nils, that's the point of trying to diagnose it that way
gentz has joined #ruby
<patient> can someone point me to a project with nice rspec tests i can inspire myself on?
johnduhart2 has joined #ruby
atmosx has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<centipedefarmer> hahahahaha
joukokar has quit [Ping timeout: 268 seconds]
<shevy> apeiros_ likes java coders
playmuc_ has joined #ruby
raddazong has joined #ruby
brianpWins has quit [Quit: brianpWins]
blah123 has quit [Ping timeout: 240 seconds]
gentz_ has quit [Read error: Connection reset by peer]
jimeh2 has quit [Read error: Connection reset by peer]
fayimora has quit [Ping timeout: 240 seconds]
leoncamel has quit [Ping timeout: 240 seconds]
madhatter has quit [Ping timeout: 240 seconds]
playmuc has quit [Ping timeout: 240 seconds]
dv_ has quit [Ping timeout: 240 seconds]
NimeshNeema has quit [Excess Flood]
johnduhart has quit [Ping timeout: 240 seconds]
dekroning has quit [Ping timeout: 240 seconds]
<shevy> R40UL if ruby could just be as fast as C
<shevy> then it would win!
<vandemar> the sad thing is I know all those three things, just not well enough engrained to apply them when writing a little snippet like that
NimeshNeema_ has joined #ruby
dv_ has joined #ruby
<joekarma> R40UL: that's actually subtly different - rather than testing for nil, that's testing for truthiness
richardcreme has quit [Read error: Connection reset by peer]
<vandemar> maletor: so there are a ton of nils ?
richardcreme has joined #ruby
Spooner_ is now known as Spooner
<joekarma> vandemar: I use JavaScript a lot so am probably liable to make the same mistake
<joekarma> don't feel bad
<joekarma> we are legion
<maletor> best way to get rid of the nils?
<vandemar> joekarma: my first language was C. for quite a while, so...
Fretta has joined #ruby
jonnn has joined #ruby
<maletor> This has gotta be a bug in URI. Queries cannot exist with nil values?
<vandemar> maletor: what I wrote with the adjustments recommended. .reject{|k,v| $stederr.puts "#{k} is nil"; v.nil?} after the } for :query => { ... } and then add something trivial to :body in case the gem/library is trying to take the first element of that hash (nil) and call each_byte on it
<vandemar> maletor: without the stdederr typo
<Hanmac> vandemar information: like in C in ruby exist one thing that cant be compared with "==" ... its the special float NaN
<apeiros_> Float::NAN == 1 # => false
<apeiros_> or you mean which is != itself?
<yakko> [facebook question] hey, what's the easiest way to put the posts of a FB PAGE into a website?
resure has joined #ruby
mike4_ has quit [Ping timeout: 276 seconds]
drewbug03 has joined #ruby
<Hanmac> >> Float::NAN == Float::NAN
<al2o3cr> (FalseClass) false
noyb has quit [Ping timeout: 246 seconds]
ChampS666 has quit [Ping timeout: 245 seconds]
<vandemar> maletor: I hope not... there's a typo that would break the code.
vlad_starkov has quit [Remote host closed the connection]
<joekarma> Hanmac: that's a good thing I suppose
drewbug03 has quit [Client Quit]
<vandemar> maletor: and, what happened to :body => {} ? set :body to something, that may be where the problem is
<joekarma> since NAN is usually a mask for a lot of complex information
blah123 has joined #ruby
<Hanmac> joekarma its like the standard says ... i only mean that it need to be noticed when using ==
<joekarma> ah
<joekarma> sorry missed the scrollback
yakko has quit [Quit: No Ping reply in 180 seconds.]
blah123 has quit [Client Quit]
yakko has joined #ruby
mike4_ has joined #ruby
blah123 has joined #ruby
blah123 has quit [Client Quit]
<maletor> gotta be this: :DocumentId=>[nil, nil]}
blah123 has joined #ruby
pelao has quit [Ping timeout: 246 seconds]
blah123 has quit [Client Quit]
<joekarma> maletor: the link I posted above was for you
blah123 has joined #ruby
joast has quit [Quit: Leaving.]
cj3kim has quit [Quit: This computer has gone to sleep]
blah123 has quit [Quit: blah123]
blah123 has joined #ruby
ksksal has joined #ruby
cj3kim has joined #ruby
moshee has quit [Ping timeout: 268 seconds]
ksksal has quit [Killed (idoru (Spam is off topic on freenode.))]
moshee has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
blah123 has quit [Client Quit]
<maletor> definitely the recipient_fax line
blah123 has joined #ruby
<maletor> to_str fixes it
<maletor> shit that bug sucks
R40UL has quit []
justinmcp has joined #ruby
blah123 has quit [Client Quit]
justinmcp has quit [Remote host closed the connection]
resure has quit [Remote host closed the connection]
JarJar has quit [Quit: Leaving]
infinitiguy has joined #ruby
justsee|away is now known as justsee
cj3kim has quit [Read error: Connection reset by peer]
noyb has joined #ruby
cj3kim has joined #ruby
y2k is now known as unixf00l
syamajala has quit [Remote host closed the connection]
seanstickle has joined #ruby
ly_gs has quit [Remote host closed the connection]
infinitiguy has quit [Quit: Leaving.]
apeiros_ has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
wereHamster has quit [Quit: Lost terminal]
blazed has quit []
noyb has quit [Ping timeout: 244 seconds]
Stalkr_ has quit [Quit: Leaving...]
justsee is now known as justsee|away
justsee|away is now known as justsee
lledet has quit [Quit: lledet]
v0n has joined #ruby
jarred has joined #ruby
aezop has quit [Read error: Operation timed out]
mockra has joined #ruby
yakko has quit [Remote host closed the connection]
Speed has left #ruby ["Leaving channel."]
lledet has joined #ruby
lledet has quit [Client Quit]
maletor has quit [Quit: Computer has gone to sleep.]
kirun has quit [Quit: Client exiting]
twock has quit [Quit: leaving]
Criztian has quit [Remote host closed the connection]
aezop has joined #ruby
therealfakemoot has joined #ruby
<therealfakemoot> http://www.rubyinside.com/how-to-create-a-ruby-extension-in-c-in-under-5-minutes-100.html So I'm following this guide, and I'm curious about why there's two definitions of Init_mytest().
<therealfakemoot> I don't C much, so maybe I'm missing something
coderguy has joined #ruby
<jrajav> There aren't two definitions
<jrajav> The first is a function declaration
coderguy has left #ruby [#ruby]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<jrajav> In such a tiny file, it isn't really needed, but it's considered best practice in C to declare all your functions at the top of the file
pingfloyd has quit [Quit: pingfloyd]
<Paradox> header files!
<therealfakemoot> jrajav: I guess I just wasn't sure how the two statements weren't redundant.
<therealfakemoot> Well, I'm still not sure
<jrajav> Partly as self-documenting code and partly so that you can call a function from another function that's defined earlier
<therealfakemoot> Should it mirror the function signature?
<jrajav> They aren't redundant -- they're doing two different things. A function declaration provides the prototype of a function, giving its name, return type, and arguments -- all the information needed to call it
<therealfakemoot> The example is sparse.
<jrajav> The function definition gives the implementation
<jrajav> And yes, a function declaration and definition have to match
<therealfakemoot> Sorry, I've never written serious C before
<therealfakemoot> Or dealt with Ruby in my entire life
<jrajav> So why are you trying to create a Ruby extension in C?
[Neurotic] has joined #ruby
<therealfakemoot> jrajav: Part of a larger project for which I will be paid handsomely.
insecurlex has quit [Remote host closed the connection]
<therealfakemoot> I'm not writing the C
pingfloyd has joined #ruby
<therealfakemoot> I'm just trying to wrap it with the Ruby C extension wrappers
joekarma has quit [Quit: joekarma]
gqlewis has joined #ruby
joekarma has joined #ruby
pskosinski has quit [Ping timeout: 276 seconds]
jonathanwallace has joined #ruby
havenn has joined #ruby
pskosinski has joined #ruby
RegEchse has quit [Quit: <3 WeeChat (v0.3.9-dev)]
jjang has joined #ruby
daniel_hinojosa has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
pskosinski has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
chichou has joined #ruby
bbloom has quit [Ping timeout: 268 seconds]
locriani has quit [Remote host closed the connection]
Eplemosen has quit [Quit: NOPE]
Chryson has joined #ruby
Eplemosen has joined #ruby
savage- has joined #ruby
MarioEIU has joined #ruby
adeponte has joined #ruby
maletor has joined #ruby
havenn has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 252 seconds]
havenn has joined #ruby
havenn has quit [Remote host closed the connection]
cj3kim has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
specialGuest has quit [Ping timeout: 260 seconds]
havenn has joined #ruby
darren has joined #ruby