apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
snip_it has joined #ruby
PragCypher has joined #ruby
stephenjudkins has joined #ruby
Ronnie has joined #ruby
S2kx has joined #ruby
eywu1 has joined #ruby
eywu1 has joined #ruby
bwlang has joined #ruby
fbernier has joined #ruby
freeayu has joined #ruby
classix has joined #ruby
csexton has joined #ruby
cloke_ has joined #ruby
replore_ has joined #ruby
nT4BR has joined #ruby
nT4BR has quit ["Saindo"]
savage-_ has joined #ruby
sei has joined #ruby
emmanuelux has joined #ruby
tomzx has joined #ruby
davidd___ has joined #ruby
chad_ has joined #ruby
ryan_dev70 has joined #ruby
<eam> how do I dup stderr to stdout in ruby?
fliang has joined #ruby
apok_ has joined #ruby
davidd___ has quit [#ruby]
chad_ has joined #ruby
fliang has quit [#ruby]
axl_ has joined #ruby
foo-bar- has joined #ruby
looopy has joined #ruby
Haydos has joined #ruby
wmoxam has joined #ruby
<fbernier> Any difference in using obj.send("my_method") or obj.method("my_method").call
<fbernier> ?
<foo-bar-> I don't believe so
<foo-bar-> you might be able to send a private method that you otherwise wouldn't be able to call
<foo-bar-> but you might have to instance_eval or class_eval for that
manizzle has joined #ruby
<shadoi> the difference is it's 2 method calls vs. 1. :)
<fbernier> the first is 2 method call and the second is one?
CheeToS has joined #ruby
<fbernier> opposite I guess
shevy has joined #ruby
jfelchner has joined #ruby
seanstickle has joined #ruby
kevinbond has joined #ruby
TheIronWolf has joined #ruby
nvez has joined #ruby
nvez has joined #ruby
Nisstyre has joined #ruby
bigkm has joined #ruby
mdhopkins has joined #ruby
tomzx has joined #ruby
brianpWins_ has joined #ruby
josephwilk has joined #ruby
josefig has joined #ruby
josefig has joined #ruby
etag_ has joined #ruby
<etag_> Hi all, I appreciate if some can help us
redgetan has joined #ruby
<etag_> require 'openssl' pkcs12 = OpenSSL::PKCS12.new('cert.p12', '1qaz2wsx3edc4rfv')
Axsuul has joined #ruby
<etag_> this line of code is working in linux but not in windows and there is not much information whats going wrong
<etag_> and this is the error: `initialize': PKCS12_parse: mac verify failure (OpenSSL::PKCS12::PKCS12Error)
<nvez> http://translate.google.ca/translate?hl=en&sl=ja&u=http://blog.livedoor.jp/k_urushima/archives/1108374.html&ei=NhSOT5XoKMPf0QGZuqiVDw&sa=X&oi=translate&ct=result&resnum=1&ved=0CCQQ7gEwAA&prev=/search%3Fq%3DPKCS12_parse:%2Bmac%2Bverify%2Bfailure%2B%2522ruby%2522%26hl%3Den%26biw%3D1271%26bih%3D728%26prmd%3Dimvns
<nvez> if you can make out the transalation, seems to be related
<etag_> I did translate but it just says it is the problem and it works in ubuntu
baroquebobcat has joined #ruby
nikhil_ has joined #ruby
andantino has joined #ruby
andantino has joined #ruby
EzeQL has joined #ruby
pu22l3r has joined #ruby
albemuth has joined #ruby
pu22l3r has joined #ruby
snip_it has joined #ruby
cbuxton has joined #ruby
liluo has joined #ruby
<etag_> again bump
<etag_> require 'openssl' pkcs12 = OpenSSL::PKCS12.new('cert.p12', 'pass') and this is the error: `initialize': PKCS12_parse: mac verify failure (OpenSSL::PKCS12::PKCS12Error) this works in centos but in windows
<etag_> but not in windows*
emmanuelux has joined #ruby
dwon has joined #ruby
Sailias has joined #ruby
adamkittelson has joined #ruby
jaywastaken has joined #ruby
wefawa has joined #ruby
Haydos has quit ["Leaving"]
emmanuelux has joined #ruby
yoklov has joined #ruby
otters has joined #ruby
bglusman has joined #ruby
linoj has joined #ruby
brngardner has joined #ruby
ryanf has joined #ruby
mikeg has joined #ruby
emmanuelux has joined #ruby
chimkan has joined #ruby
jaysig has joined #ruby
adeponte has joined #ruby
mikepack has joined #ruby
kevinbond has joined #ruby
hrs_ has joined #ruby
tommyvyo has joined #ruby
td123 has joined #ruby
igotnolegs has joined #ruby
dwon has joined #ruby
savage- has joined #ruby
blueadept has joined #ruby
dbgster has joined #ruby
Nisstyre has joined #ruby
jfelchner has joined #ruby
sporkbomb has joined #ruby
kish has joined #ruby
pastjean has joined #ruby
wmoxam has joined #ruby
abra has joined #ruby
jgrevich_ has joined #ruby
looopy has joined #ruby
sroy2 has joined #ruby
jaysig has quit ["Leaving"]
banisterfiend has joined #ruby
slartibartfast_ has joined #ruby
<slartibartfast_> Hey
<slartibartfast_> I've got a question, something weird I noticed while playing around in an IRB
<slartibartfast_> And doing Project Euler problems
<fowl__> IRB is your first problem
<fowl__> IRB is obsolete
scwh has joined #ruby
<slartibartfast_> Ah? What's replaced it?
<slartibartfast_> Anyway, I'm making a pastebing with the interesting question.
<slartibartfast_> And, err, my IRB has linux shell commands, syntax highlighting, autocompletion, etc.
<slartibartfast_> Because I've installed gems to make it do so.
<slartibartfast_> Although it still sucks. Why doesn't the ruby site talk much about Pry?
<fowl__> cool, well if thats all you got from that page then keep your janky irb
<fowl__> :p
<slartibartfast_> Notice the sentence I got in above your condescending one.
<fowl__> not being condescending bud, dont get butthurt just yet
iamjarvo has joined #ruby
<slartibartfast_> Not getting butthurt, guy who calls me bud. Ah, issues of conveying tone in text-based communication. I'm new to Ruby, and experimenting in it, and I noticed something weird that I'm about to ask about.
emmanuelux has joined #ruby
<banisterfiend> slartibartfast_: cool, got a pastebin yet? im curious :)
<slartibartfast_> Redoing the steps so I can copy-paste the results.
<banisterfiend> slartibartfast_: fowl__ is american, i think 'bud' is quite common slang there for buddy/friend/mate
redgetan has joined #ruby
emmanuelux has joined #ruby
radic_ has joined #ruby
<shevy> fowl__ uses funny words
<shevy> "janky irb" I never read the word janky before :(
<shevy> and I used to think I am ok with english
williamcotton has joined #ruby
<banisterfiend> shevy: we're both foreigners, though you're slightly more exotic than me. We still have a lot to learn about the dominant culture
<slartibartfast_> Made the pastebin.
<fowl__> we'll all be speaking mandarin soon
<slartibartfast_> And thanks bannister
<shevy> banisterfiend man it is easy. who started the world wars? there you go about dominant!
hrs_ has joined #ruby
<shevy> though of course the answer also includes those who lost it :\
<banisterfiend> shevy: this is why german is such a scary sounding language
<slartibartfast_> So: I want to know why the first array x is set to has size 387
<banisterfiend> ;)
<slartibartfast_> when, running the same loop on it, I get the correct array of length five.
<shevy> what are you talking about slartibartfast_
<shevy> ah
<shevy> moment
<slartibartfast_> Sure.
<shevy> whoa man
<slartibartfast_> Basically, the stuff I do from lines 33 to 42, after having solved the project euler problem.
<slartibartfast_> Which, for reference, is http://projecteuler.net/problem=8
<shevy> that is the longest number-string I ever saw
<slartibartfast_> Yeah, that was the point of the problem.
<shevy> I dunno even what this means, banisterfiend needs to solve this, he gots the bigger brain
<shevy> self[n-4]*self[n-3]*self[n-2]*self[n-1]*self[n] <-- confuses me horribly
<slartibartfast_> Oh. I've got to multiply consecutive digits together, per the problem I just linked to.
<slartibartfast_> So I turn the digits into an array, and multiply five consecutive array cells at a time
<slartibartfast_> Ending at index n
<slartibartfast_> And I do this iterating over the indices of the array.
chson has joined #ruby
<banisterfiend> slartibartfast_: seems kind of nerdy
<fowl__> on the moon, nerds get their pants pulled down and they are spanked with moon rocks.
Harenson has joined #ruby
<slartibartfast_> That it is, fiend. Any idea why 33-36 gets a different result than 39 to 41?
<banisterfiend> hehe
<banisterfiend> nice image
Harenson has quit [#ruby]
stefanp_ has joined #ruby
<slartibartfast_> fowl__, we're in an IRC channel for a programming/scripting language. I think we'd all be sore if we lived on the moon.
<slartibartfast_> :D
<fowl__> haha
<shevy> slartibartfast_ the thing is, the whole code confuses me
<shevy> some method is added to Array and it is calling self several times
<shevy> that alone killed 80% of my brain
<axisys> http://dpaste.com/733456/ <-- this splits all foo:bar like entries .. but how do I add a comment after bar ?
<fowl__> slartibartfast_, you do realize you're modifying the array x in each iteration where n.five_prod(i) == 40824
<fowl__> shevy, wtf are you talking about?
<shevy> fowl__ look! self[n-4]*self[n-4]*self[n-3]*self[n-2]*self[n-1]*self[n] self[n-4]*self[n-3]*self[n-2]*self[n-1]*self[n][n-3]*self[n-2]*self[n-1]*self[n]
<shevy> that's what I am seeing
Araxia_ has joined #ruby
<axisys> print u, ' ', e, ' - comment' <-- this did not work
lobak has joined #ruby
<fowl__> shevy, you have dyslexia or something then
<shevy> axisys what is the content of that file?
<shevy> '/tmp/input'
<axisys> lots of entries like foo:bar
<axisys> so foo1:bar2 foo3:bar1 .. so lots of colon seprated files
<shevy> well
<shevy> if one line is "foo:bar"
<axisys> foo is essentially the username and bar is essentially email address
<shevy> then:
<shevy> u , e = m.split(':')
<shevy> u contains foo and e contains bar
<slartibartfast_> fowl__, I am aware of that. I still wonder why x ends up more than five long, since every time I reassign it to a five-digit array
<fowl__> slartibartfast_, so x is only going to be kept on the last iteration that condition passes for, is that what you want?
<shevy> and this here works: print u, ' ', e
<fowl__> ahh
<shevy> axisys so something in your problem description is not complete, or your file has wrong data
<slartibartfast_> Yeah, I'm fine with that. I'm just wondering about the behavior in general producing something unexpected.
<slartibartfast_> As I said, it wasn't part of the problem I was solving. It was just experimentation.
<axisys> shevy: right.. now I like add a comment end at the end of the each print
<shevy> axisys you can also use File.readlines('/tmp/input').each btw
<shevy> puts u+' '+e+' This is my comment!'
<axisys> shevy: i am a noob
<axisys> shevy: thanks
<fowl__> axisys, also you never close the file you open
<shevy> you could also use "" instead of the '' then you can interpolate with #{} which calls #to_s on your object
<axisys> fowl__: oops
<axisys> shevy: ok
<axisys> puts u+' '+e+' This is my comment' printed the comment on next line
<dbgster> so with rake, if I put my tasks in .rake folder, then any subfolder of my project will pickup those tasks?
<dbgster> i.e. I can run rake from a subfolder, as long as I put the -g flag, it will fid it?
<slartibartfast_> fowl or banister, any idea why the loop does not behave as expected?
<axisys> shevy: latest http://dpaste.com/733458/
<fowl__> axisys, that is because e have a newline on it
<axisys> fowl__: how do I strip it?
<axisys> chomp?
<axisys> wait that's perl
<fowl__> File.readlines() will do it for you
<fowl__> there's also string#chomp
<axisys> fowl__: i am already using it now
<fowl__> slartibartfast_, no, sorry :/
<axisys> fowl__: http://dpaste.com/733458/
<axisys> still comment on next line
<fowl__> axisys, yeah i just tried File.readlines() and it kept the newlines, sorry for the bad info
<axisys> e.chomp worked
<axisys> http://dpaste.com/733461/ <-- worked
mikepack has joined #ruby
<axisys> is there a way to clean up the newline sooner ?
<axisys> btw, how do I read the man pages online .. like I want to see how else File can be used..
<shevy> axisys readlines will read in the line
<shevy> and the line includes a \n at the most right part
sebastorama has joined #ruby
<fowl__> File.readlines('file').map(&:chomp).each ..
<axisys> so I should use open instead?
<axisys> ok
<shevy> I really dont think it matters axisys, it's just a newline, it won't break your machine
<axisys> ok
fbernier has joined #ruby
wmoxam has joined #ruby
<axisys> ok Files.methods shows all the methods.. how about usage?
<axisys> Files.help not valid
<axisys> File rather
seivan has joined #ruby
<fowl__> usage?
<fowl__> you want docs
<slartibartfast_> fowl__, I just tried having it break after it finds the first x
ehc has joined #ruby
<slartibartfast_> it still grabs an array of length 387
startling has joined #ruby
<shevy> axisys lol that was the best idea I read
<shevy> File.help
<shevy> :D :D :D
<ehc> is there a clean simple way to do (s.to_i || 5) but where s is a string or nil, and if s is nil, it returns 5, not 0 ?
<fowl__> ehc, that looks perfect
niku4i_ has joined #ruby
<fowl__> except that 0 is true in ruby
skrewler has joined #ruby
soveran has joined #ruby
<ehc> fowl__: this is a the short long version: s.nil? ? 5 : s.to_i
<axisys> fowl__: there is no usage in command line? like perldoc
<axisys> shevy: :=)
<fowl__> soooooooooooooooooooooooooooooooooooooooooooooooooo s = s.to_i; s == 0 && s = 5
<ehc> fowl__: the short short version would use s only once.
<shevy> axisys should work via "ri"
<fowl__> ehc, unfortunately you'll have to test for 0
<shevy> though perhaps perldoc does more
<shevy> but if you know perl, you should have no problem with ruby :D
<fowl__> s = s.to_i == 0 ? 5 : s.to_i
<fowl__> axisys, yeah there is `ri`
<axisys> http://dpaste.com/733465/ <-- ri File says I need to install rdoc ?
<shevy> then you should do that!
<shevy> :P
<shevy> on debian it is perhaps called... rdoc
<shevy> or perhaps not
<shevy> you never know!
<axisys> in ubuntu
<shevy> lies!
<shevy> I dunno why nothing shows up there
<shevy> my gut feeling tells me that ubuntu is run by a bunch of idiots
noprompt has joined #ruby
<shevy> axisys, when I do the same command I get this:
MrGando has joined #ruby
<ehc> ok, thanks fowl__
<axisys> hehe
<fowl__> axisys, i get blank on File too, so you probably gotta run somethin dumb to generate the docs
<fowl__> personally i never use ri but you should be able to google it
<shevy> haha yeah
<shevy> I also dont use ri :D
<shevy> axisys, here is online docu for File http://www.ruby-doc.org/core-1.9.3/File.html
<noprompt> whats wrong with ri?
<shevy> It's ugly
<noprompt> assuming there is anything wrong with it :P
<noprompt> ugly?
<shevy> yeah man
<fowl__> id rather read docs from a browser
<shevy> look at the beautiful arrangement in http://www.ruby-doc.org/core-1.9.3/File.html
<noprompt> i have mixed feelings
<shevy> try to have that with ri
<shevy> you can even "Add New Comment"
<shevy> how cool is that!
<noprompt> sometimes ri is good enough
<noprompt> but i agree the browser is nice
<shevy> "5 people liked this"
<fowl__> noprompt, you should tell this man how to generate the std lib docs for ri
<shevy> and you get social feedback instantly!!!
<noprompt> hehe
ed_hz_ has joined #ruby
<shevy> and google ads
<shevy> see how limited ri is? :)
<fowl__> LOL shevy i never scrolled all the way to the bottom before
<noprompt> i'm obessed with the keyboard, maybe its a phase :P
<fowl__> Ruby-doc.org is a service of James Britt and Neurogami, an avant garage application development company in Scottsdale, AZ. -_-
albemuth has joined #ruby
startling has quit [#ruby]
<shevy> usualy, at least on ruby 1.8.x the rdoc docu was installed via "make install-doc" but I guess axisys did not compile from source
<shevy> *usually
<etag_> again asking: require 'openssl' pkcs12 = OpenSSL::PKCS12.new('cert.p12', 'pass') produces error: `initialize': PKCS12_parse: mac verify failure (OpenSSL::PKCS12::PKCS12Error) this works in centos but not in windows
anildigital has joined #ruby
<anildigital> What is the difference between
savage- has joined #ruby
<anildigital> module Less
<anildigital> class Error < ::StandardError
<anildigital> and
<anildigital> module Less
<anildigital> class Error < StandardError
<fowl__> :: tells it to skip all the bullshit and look immediately at the top level
<fowl__> as opposed to looking for StandardError in the Less module before going up
<noprompt> "skip all the bullshit" lmao
<noprompt> that's awesome
<fowl__> lol
<noprompt> alright i'm gonna ask a question, here i go
<anildigital> fowl__: I did not get it... which lines tells "skip all the bullshit"
<noprompt> haha
<shevy> noprompt yeah fowl__ finds the proper words
<shevy> I am going to remember the :: as the "skip all bullshit" operator from now on
<fowl__> anildigital, ::StandardError refers to StandardError, but from inside Less, it will look for Less::StandardError, and go up until it finds it
<anildigital> fowl__: hmm
<shevy> anildigital that was an epic question
<anildigital> shevy: may be.
<noprompt> ok so say i have something like this in a class
<noprompt> somehash.each_pair { |key, value| send(:"#{ key }=", value) }
<noprompt> err in a method
<noprompt> and the whateve= method doesn't exist
<shevy> ewww
<noprompt> ok that's what i wanted to here
<noprompt> i'm guessing that's an antipattern?
<fowl__> class X; ::Y <- will look for just Y class X; Y <- looks for X::Y, then Y, class Z; class X; Y <-- looks for Z::X::Y, then Z::Y, then Y
<noprompt> shevy, what's a better route?
<fowl__> noprompt, no need to symbolify that, you can send a string
<shevy> noprompt I dunno but I hate metamagic
freeayu_ has joined #ruby
<fowl__> 4.send 'to_s'
sluggy has joined #ruby
<noprompt> there's a reason i wanna symbolify in this case
<noprompt> cause it's a something that will probably get called a bunch
<noprompt> so shevy, you just hate magic?
<anildigital> does that snippet explains use of StandardError ?
<noprompt> so i'm guessing i should just use a real hash in that case eh?
<anildigital> fowl__: it never prints "BAD BAD BAD" even I remove :: from StandardError
<shevy> noprompt no, I hate only metamagic :)
<noprompt> yeah i'm working on an update to a small library i wrote
<shevy> for me the metamagic includes: all forms of eval, all forms of method_missing and sometimes .send too
<noprompt> and i wanna "skip all the bullshit" metaprogramming
<shevy> lol
<noprompt> iow i've been reading a lot
<anildigital> fowl__: there?
<noprompt> but hypothetically
<noprompt> i have somehash.each_pair { |key, value| send(:"#{ key }=", value) }
<noprompt> i wanna rescue NoMethodError and raise the error for the particular key
<noprompt> is that weird?
<noprompt> rescue raise?
<noprompt> lol
<fowl__> anildigital, yeah
<shevy> hmmmm
baroquebobcat has joined #ruby
<fowl__> anildigital, you have to define your standard error before you can define a class that inherits from it
<shevy> noprompt, the reason I hate metaprogramming is because it wants to force me to think before I can understand the code
<fowl__> try moving your standarderror above Less::Error
<shevy> and my most important rule is to write only code where I never have to think
<anildigital> fowl__: so even if I remove :: or keep it .. result is same.... I don't get "BAD BAD BAD"
<anildigital> fowl__: ok
<fowl__> anildigital, because Less::Error is inheriting from ::StandardError either way
mailtruck_ has joined #ruby
<fowl__> in the paste at least
<noprompt> hmm, i like that
<anildigital> fowl__: hmm... the order matters
savage- has joined #ruby
<fowl__> anildigital, think about this: myfunmethod("Sup yall"); def myfunmethod(arg)... end
davidcelis has joined #ruby
<fowl__> myfunmethod() wont exist at that point
<anildigital> so when we have class Error < ::StandardError .. it always uses Ruby's default StandardError
<noprompt> i just feel weird when i start to reach for rescue and raise
<noprompt> because it makes me wonder if there is a design flaw
<fowl__> anildigital, NO
<fowl__> you arent listening
<anildigital> not the one which is overriden by you
<anildigital> okay.. reading
<fowl__> like i said, define your StandardError before you try to make a class (Error) that inherits from it
<noprompt> i'm kinda trying to ripoff an update_attributes type of thing
<fowl__> otherwise, when you define Error you are always going to get ruby's StandardError, yours does not exist yet
<fowl__> ruby runs top-down that's why require statements are always at the top, then method definitions, then main code
<etag_> again asking: require 'openssl' pkcs12 = OpenSSL::PKCS12.new('cert.p12', 'pass') produces error: `initialize': PKCS12_parse: mac verify failure (OpenSSL::PKCS12::PKCS12Error) this works in centos but not in windows
<anildigital> fowl__: the gist you pasted doesn't print "BAD BAD BAD"
<fowl__> SIGH
<fowl__> class Error < ::StandardError
<fowl__> take out the :: like you were before
<fowl__> try it both ways
<fowl__> like you did before >:(
<anildigital> fowl__: yeah.. removing :: prints "BAD BAD BAD"... that what i am saying .. when you have :: it will make sure it will use the original StandardError class
<fowl__> yep
fowl__ has quit ["Leaving"]
<anildigital> when you don't have :: it will use the class overridden
JivaD has joined #ruby
savage- has joined #ruby
<noprompt> shevy, here's the class http://pastebin.com/1hd66584
<noprompt> line 12
snip_it has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
<noprompt> basically i'm rewriting this library from the ground up https://github.com/noprompt/vic/blob/master/lib/vic/colorscheme/highlight.rb
ctwiz has joined #ruby
maletor has joined #ruby
baroquebobcat has joined #ruby
mmokrysz has joined #ruby
dql has joined #ruby
<noprompt> meh, i dunno, maybe it's like dhh said, you just need a shitty thing to get the job done
<davidcelis> dhh is a dick
<noprompt> yeah but that doesn't mean he's wrong or right
<axisys> File.readlines('/tmp/input').each how do I add the filename as an argument ?
<noprompt> def read_lines_from_file(file)
<noprompt> File.read_lines(file)
<noprompt> end
<noprompt> ?
<axisys> noprompt: i want to do it more like a sysadmin.. like script.rb filename
<axisys> is that ARGV[0] ?
<noprompt> so like script.rb filename?
<axisys> noprompt: yes
<kalleth> davidcelid: hmm what gem did you write that i use? *thinks*
<kalleth> davidcelis
<davidcelis> Hi
<davidcelis> recommendable
<kalleth> stupid phone without tab key
<davidcelis> I know you
<noprompt> axisys just check it
<noprompt> puts ARGV[0]
<kalleth> hmm, any others? dont think i used that
<davidcelis> No
<kalleth> i could just check github
<davidcelis> thought i saw you on the issues for it
<kalleth> hmm, doubt it
<kalleth> #ror probably
<davidcelis> huh
<davidcelis> you should use recommendable
<davidcelis> i may be biased, but it is the best gem ever made in foreverever
<axisys> File.readlines("ARGV[0]").each <-- did not work
<kalleth> lol, when i have skmething that needs recommending i will do so
<axisys> `readlines': No such file or directory - ARGV[0] (Errno::ENOENT)
<kalleth> which considering i have more free time now is likely to be soon :(
<noprompt> what did you run on the cl?
<noprompt> ARGV[0] should be the first arg
<noprompt> so ruby script.rb foo
<noprompt> ARGV[0] == 'foo'
<kalleth> ita not like bash where arg 0 is the name od the script, right?
<axisys> noprompt: that is how I ran
<kalleth> its, of
<noprompt> kalleth yeah
<noprompt> i just ran `script.rb foo` with the contents of script.rb as puts ARGV[0]
<noprompt> and it printed foo
<kalleth> kk :) just checking
<noprompt> i get the mixed up too
scwh has joined #ruby
<noprompt> cause sometimes is bash is what you want
<axisys> whats the contect of ARGV[0] ? "$#ARGV[0]" ?
<kalleth> not in any use case ive had so far :p
<axisys> File.readlines("ARGV[0]") is not working
<noprompt> hehe
<kalleth> lol
<kalleth> erm
<kalleth> File.readlines(ARGV[0])
<kalleth> no quotes
<noprompt> oh haha
<noprompt> i didn't notice that
<kalleth> i typed thst on a phone fyi
<axisys> kalleth: thanks .. that worked
<kalleth> finding [] is hard
<kalleth> np axi
<noprompt> man i really need some design advice here
<davidcelis> noprompt: avoid semicolons, do-end for multiple lines, omit parens when possible
<kalleth> helpung someone when youre newly single in irc coding chan on phone
<kalleth> my raison d etre
<noprompt> HAAH!
<noprompt> omfg awesome!
<noprompt> i'm in a predicament
<kalleth> noprompt always, always use recursion
<kalleth> alsays
<noprompt> certainly not in an impertive language
<davidcelis> what?
<davidcelis> why not?
<noprompt> that'll destroy the stack!!
<noprompt> lol
<davidcelis> ...
<davidcelis> no
<noprompt> use haskell!
<davidcelis> use recursion
<noprompt> lol
shadoi has joined #ruby
<noprompt> ok so here's a weird question
rippa has joined #ruby
<kalleth> rhen you can become that shit hot coder whos code you can never decipher
ckrailo has joined #ruby
<noprompt> when do you wanna use a hash to store an objects attributes?
<kalleth> ....usually never
<noprompt> ok so check this
<noprompt> my worry is line 12
Drewch has joined #ruby
<kalleth> sec
iamjarvo has joined #ruby
<kalleth> thismay take a while phone
<davidcelis> ew pastebin
<noprompt> i can use gist :P
<iamjarvo> Hi all I am trying to install ree-1.8.7-2010.02 on lion but not having much luck. looks like it fails around here make: *** [.rbconfig.time] Abort trap: 6
<iamjarvo> gcc version 4.2.1
<noprompt> man i'm just grossing everyone out today
<kalleth> ah gprs we meet again
<noprompt> gprs?
<kalleth> slow kobile phone bet
<kalleth> net
<kalleth> think 3g but 2 generations earlier
ctwiz has joined #ruby
<noprompt> lmao
<kalleth> why is that differebt frkm jjust returning attributes, btw?
<kalleth> or is attributes an array
<noprompt> attributes is a hash
<noprompt> and it sends the keys as key= to the object
<kalleth> oh, oj
<kalleth> ok
<kalleth> makes more sense now
mailtruck_ has joined #ruby
<kalleth> in my book, i just ak 'does it work'
<noprompt> it works up until you give it a key that causes a NoMethodError
<noprompt> i could rescue the error
<noprompt> but i'd still need to raise something ya know
<kalleth> if bject respinds to key=? i guess then toure asking for permission rathrr than forgiveness
<kalleth> responds to
<kalleth> its early i should go to sleep :p
<noprompt> so your saying just check if it responds, then run it
<noprompt> otherwise fuck it
<noprompt> ?
<noprompt> lol
<kalleth> im saying dont ask a guy on irc at 5am whos newly sibgle for architectural advice :p
<any-key> anyone here familiar with curses?
<noprompt> man i can't wait to be single
<noprompt> lol
<kalleth> anykey: fuck blsst damn
<kalleth> more?
<kalleth> yep im getting obnoxious
<noprompt> man, ask a rubyist for a straight answer lol
<kalleth> bedtime :p n
<any-key> when I clear the screen it just scrolls the terminal buffer down, I'm trying to figure out a way to not do that
<any-key> so you don't have your scrollbar getting smaller each time you redraw the screen :P
<kalleth> nah, im no ruby master, noprompt, i just hack it till it works
<noprompt> lmfao
<noprompt> sometimes i read these books and listen to these podcasts
<kalleth> anywsy, gl, nn, etc
<noprompt> and ya know, i feel brainwashed
<kalleth> lol
<noprompt> i sit there and think, hmm i wonder if this is OO
<noprompt> or somethign like that
<noprompt> haha
<kalleth> Make It Fscking Work is my motyo :p
<noprompt> no shit right?
<noprompt> haha
<kalleth> anyway nn
<noprompt> any-key: i wish i new more about curse
ken_barber has joined #ruby
<noprompt> s/(curse)/\1s
<kalleth> nerd
<noprompt> i'll have regex on my headstone when i'm dead
<noprompt> and something that says "He use Vim in life, and he was happy."
<noprompt> lmfoa
<shevy> ok
<shevy> I will die next to you
<shevy> with an arrow saying
<shevy> ----------> loser
<shevy> and pointing at your grave man
<noprompt> oh that's awesome
<shevy> or
<noprompt> i'd be proud
<shevy> emacs >
<shevy> just kidding
<noprompt> haha
<shevy> I dont think I'll ever have a grave
KL-7 has joined #ruby
<noprompt> dude as long as its not visual studio
<shevy> The problem is
<shevy> I dont believe in dying
<noprompt> all good, i don't either
<noprompt> buy shevy, can you give me a straight opinion on that code?
hukl has joined #ruby
krusty_ar has joined #ruby
hukl has joined #ruby
dfamorato has joined #ruby
<noprompt> btw my mind was blown today by ctrl+w, ctrl-a, ctrl-e, in the terminal
<any-key> how do you live without those?
<noprompt> i dont anymore!
<shevy> attributes.each_pair { |key, value| send(:"#{ key }=", value) }
<shevy> I really feel this is an abuse
<shevy> you are trying to set some values right?
<shevy> why not simply set them directly
<noprompt> affirmative
lkba has joined #ruby
<iamjarvo> are ree-1.8.7-2010.02 and ree-1.8.7-2011.03 basically the same? just 2011 has more patched?
<shevy> iamjarvo hopefully so
<shevy> 1.8.7 will die in two months though
tomsthumb has joined #ruby
<iamjarvo> shevy: so what are the differences?
<noprompt> well here's the reason
<iamjarvo> if someone specified ree-1.8.7-2010.02 i cna use 2011 and still be ok right?
<noprompt> the objects attributes aren't set directly
<iamjarvo> seems silly they would specify it down to that and not do ree-1.8.7
<noprompt> you go through another object `my_colorscheme.highlight :group_name, :gui => 'foo', :guibg => "blah"
<noprompt> i mean i guess i could do a return of self
<iamjarvo> shevy: ^
<noprompt> `my_colorscheme.highlight(:group).gui()...
<noprompt> but that feels, meh
<shevy> iamjarvo remove ree-1.8.7-2010.02
<shevy> noprompt and your send code works?
<noprompt> it works as long as you don't give it a key for a method= that doesn't exist
<noprompt> then obviously it raises a NoMethodError
<iamjarvo> shevy: thanks. but im trying to figure out how ruby versioning works
<shevy> iamjarvo there is only one real site to look at which is the official ruby source -> ftp://ftp.ruby-lang.org/pub/ruby/
<noprompt> i could rescue the error and then do some hackery to raise an ArgumentError or something
<shevy> noprompt you could query via a .respond_to?
<noprompt> i could, and then i guess say, if it doesn't, skip it
<shevy> Your code uses send. In my book that is already a huge hack so you can build on top of that hack for another hack to make the BIGGEST hack ;)
<iamjarvo> shevy: im not looking for line by line diffs. i guess what i want to know is ree-1.8.7.2010.02 is just ree-1.8.7.2012.01 with patches and bug fixes
<iamjarvo> like is the pattern of what happens
<noprompt> what's funny is that i hardly ever reach for something like send
<shevy> iamjarvo yeah but you know that this is not official source right?
<noprompt> it feels somewhat wrong, but afterall it's ruby
<noprompt> the garden of forbidden pleasures
<shevy> so whoever made the ree- versions either had a homepage or he put in the diff changes he made within those two archives
<noprompt> the garden of "skip all the bullshit" this is my program
<noprompt> oh man, i tell you, whenever i have to do c++ for school i'm just in tears
<shevy> with ruby it is like this:
<iamjarvo> shevy: but there is someone official that makes the rees right? so i cant make a ree
<shevy> if you go the classical OOP way then things work fine
<shevy> once you try to be clever and use metaprogramming, or deviate into modules, things tend to just suck
<shevy> iamjarvo yeah who makes those ree releases?
<shevy> that seems to be REE
<iamjarvo> yea
<wefawa> shevy: metaprogramming is the future!
<shevy> sad if you have to use it man ;)
<iamjarvo> shevy: so you have never used ree?
<shevy> nah
<noprompt> well it's my first full year this month using ruby and OO so i still have some ground to cover
<shevy> I use plain ruby compiled from the sources
<shevy> I'll never use anything bundled together by other people, because then I would have to understand what they di first
<iamjarvo> true
<shevy> *did
<iamjarvo> guess i have to read up on the differences
<iamjarvo> thanks man, i need to get sleep
<shevy> many years ago I used the lampstack from apachefriends
<noprompt> i'd like to check out smalltalk this summer and read the beck book
<shevy> these days I compile php mysql apache etc... all from source and use my own config files for them all
wmoxam has joined #ruby
<iamjarvo> noprompt: just read an article saying all ruby devs should learn small talk
<shevy> it is more work but also less confusing for me in the long run
<noprompt> i did read that
<iamjarvo> shevy: sounds exciting
<shevy> well, minus the extra work
<iamjarvo> probably learn more from the process
<noprompt> i install gnu small talk and messed around
<noprompt> two languages i'm interested in are smalltalk and haskell
<noprompt> so this summer should be fun
<noprompt> one thing i will say is how awful c++ is
deobald has joined #ruby
<noprompt> i never want to program in that language for a living no matter what the price
apeiros_ has joined #ruby
yxhuvud has joined #ruby
<noprompt> so shevy heres the deal
<noprompt> the library provides a way of building vim colorschemes
<noprompt> if i wanna go the route where i do something like `colorscheme.highlight :group, :attr => 'va'
<noprompt> should i just have the highlight object contain a hash of it's attribs and raise a key error instead?
<noprompt> versus going the send rout
SolarisBoy has joined #ruby
replore has joined #ruby
<noprompt> eh fuck it, i'm not gonna get hung up on this one feature
scwh has joined #ruby
artm has joined #ruby
ph^ has joined #ruby
<noprompt> self.respond_to?(:"#{ key }=") && send(:"#{ key }=", value)
snip_it has joined #ruby
thomasfedb has joined #ruby
jakky has joined #ruby
pubis has joined #ruby
CheeToS has joined #ruby
nemesit has joined #ruby
tyman_ has joined #ruby
tyman_ has quit [#ruby]
Apocalypse has joined #ruby
<any-key> *sigh* tetris in the terminal is not turning out like I had hoped: http://i.imgur.com/XcOAd.png
<any-key> there's no way to get around the fact that characters are not square
<any-key> so everything looks warped as fuck
Morkel has joined #ruby
dax has joined #ruby
maahes has joined #ruby
maahes has joined #ruby
srnty has joined #ruby
nilg` has joined #ruby
banjara has joined #ruby
mischief has joined #ruby
alem0lars has joined #ruby
<noprompt> man that's cool
<any-key> here's the fixed version: http://pastebin.com/f2KGEDET
<any-key> shit
<any-key> wrong link
<any-key> but that's the source for the half-implemented version :P
<any-key> that's the new screenshot
AlbireoX has joined #ruby
banjara has quit [#ruby]
<noprompt> holy cow that's so cool
<any-key> it's not /that/ cool
maletor has joined #ruby
<noprompt> i guess i think it's cool because i don't know much about game programming
<any-key> neither do I, tetris is really simple though
<any-key> mostly I just wanted to screw around with curses
<noprompt> i've kinda wanted to do the same thing
<any-key> have at it, it's not very difficult
deobald_ has joined #ruby
<noprompt> yeah, there's tons of stuff i wanna do
<noprompt> i'm just putting some of it to the side untill the semester is over
<noprompt> it's funny, i thought i'd like majoring in csci, but so far i really don't
<noprompt> i enjoyed math way more, as weird as that sounds
<any-key> CS is just applied math
<any-key> what year are you?
mischief has joined #ruby
<noprompt> second year in csci
<noprompt> i work full time
<any-key> you ain't seen nuthin yet
<noprompt> done with all my ge shit
<noprompt> but i do a lot of reading on my own time
<any-key> upper-level classes are when the truly applied math hits
<noprompt> and have a job as a developer
<noprompt> personally i just wanna be happy
<noprompt> i liked math way more
<noprompt> number theory in particular
<noprompt> yeah i think i'm gonna drop out at some point
<any-key> you do realize there's tons of CS stuff that uses that, right?
<any-key> and that you can get a job doing that?
<noprompt> for me it's something i enjoy, i'm not looking for a job
<any-key> why would you not want to do something you enjoy as a job?
<noprompt> but no i didn't know that
<noprompt> i enjoy programming and art
<any-key> put them together
<any-key> study graphics
<any-key> that shit has some serious math :P
<noprompt> this is gonna sound weird
<noprompt> but it's the language thing i dig
<any-key> tons of stuff in that
<any-key> you like haskell, don't you? :P
<noprompt> it's interesting but it's not human
<noprompt> matz has the right idea
<any-key> he does
<noprompt> and i think the haskell guys are on to someething too
<noprompt> somewhere there is a happy medium
<any-key> pure functional is a great exercise, but extremely annoying in reality
<noprompt> totally
<any-key> I think ruby is close to a happy medium
<any-key> but I hear good things about scala
<noprompt> it is because you can create "slang" in ruby if you want
<noprompt> perl6 actually has something on the road map that i think is interesting
<noprompt> where you can define operators as infix, postfix, prefix
<any-key> hmmmm
<any-key> still perl, though
<noprompt> obviously that would lead to chaos but isn't language like that?
<any-key> perl is like that
<any-key> doesn't make it okay :P
<noprompt> i'm just saying, it's a interesting concept
<any-key> I agree
<noprompt> programming doesn't have to be all serious all the time
<any-key> perhaps you should try clojure...all of my math friends are eating it up right now
<noprompt> i mean sure if you have an oil tanker
<any-key> noprompt: I just wrote a pointless tetris game with curses, I know all about "not serious" :P
<noprompt> i may, it's on the radr
cezar has joined #ruby
<any-key> you can actually use Java libraries, so it's inherently more useful than any lisp before it :P
<noprompt> i mean i'm trying to build a web-app that lets you build editor nuetral colroschems
<any-key> that sounds awesome
<noprompt> that's like whatever, but it's something i think is worth doing
<any-key> I've pondered such a thing before
<noprompt> it's a pita and i should just throw it up on git hub and say fuck it
<noprompt> just anyone that can make it better help
<any-key> heh considering the differences between color definitions in something like textmate vs vim, it's tricky
<noprompt> oh man all my vim colorschemes are built with it
<any-key> <3 vim
<noprompt> actually it's not that bad
<noprompt> i used coderay as the base
<noprompt> and then just write adapters that convert from the coderay value
Eldariof-ru has joined #ruby
<noprompt> so code ray may have a 'keyword'
<noprompt> i can map that to hi Keyword in vim
<noprompt> or 'instance-variable' i can map to 'hi rubyInstanceVariable'
<noprompt> etc
<any-key> ah
<noprompt> so in about 3 weeks i'm gonna take what i have, clean it up and push it up
<noprompt> and let people help if they want
<noprompt> it's a pita
<noprompt> on the frontend and the backend
<noprompt> i suck at js
<any-key> heh
<noprompt> do you code for a living?
<any-key> yep
<noprompt> ruby?
<any-key> I do web dev stuff, right now I have a job/internship doing rails work
<noprompt> for who?
<any-key> I graduate next semester
<any-key> Spiceworks
<noprompt> gotcha
xiaotian has joined #ruby
<any-key> dunno if it's in bad taste to mention company names in chanels like this :\
<noprompt> i wound up getting a job as web-dev doing rails but it sucks cause it's just me
<any-key> heh
<noprompt> i don't care
srnty has joined #ruby
<noprompt> i work for a newspaper which sucks because it's hard to do tdd
<noprompt> they're always rushing
<any-key> rushing sucks
<noprompt> did you take compilers?
<any-key> I'm actually taking it next semester since I had no other options :\
<any-key> compilers aren't really my thing
<noprompt> aww man, i'm looking forward to that
<any-key> heh I'm not really a math person, I'm not going to lie
<noprompt> hehe
<noprompt> i just wanna learn more about how language stuff works
<any-key> my brain has trouble with that sort of thing...I can do it, but it takes me longer to process it and feels unnatural
JohnBat26 has joined #ruby
<any-key> my classmates who are really into math tend to like the language side of things
<noprompt> yeah no one i know wants to take that lcass
<any-key> secretly they do
<noprompt> they just don't wanna get crushed
<noprompt> but whats funny is that's what i loved about math
<noprompt> just getting crushed by the sheer intensity of the subject
djdb has joined #ruby
<noprompt> mathematicians are sadists haha
<any-key> it's true
<any-key> hang in there, and don't drop CS just yet
<noprompt> i probably won't
<any-key> wait until you get into the upper level classes
<noprompt> that's what my prof said
* any-key heads off to sleep
<noprompt> he said yeah just know trees and your good
<noprompt> poof
srnty has joined #ruby
lobolars has joined #ruby
demian`_ has joined #ruby
krz has joined #ruby
brucehsu has joined #ruby
ryanf has joined #ruby
x0F_ has joined #ruby
spencerward has joined #ruby
mborromeo has joined #ruby
luckyruby has joined #ruby
shruggar has joined #ruby
adeponte has joined #ruby
schovi has joined #ruby
maesbn has joined #ruby
adeponte has joined #ruby
thecreators has joined #ruby
KL-7 has joined #ruby
netogallo has joined #ruby
pjn_oz has joined #ruby
zommi has joined #ruby
CheeToS has joined #ruby
workmad3 has joined #ruby
CoverSlide has joined #ruby
ianbrandt has joined #ruby
maletor has joined #ruby
Advocation has joined #ruby
HashNuke has joined #ruby
sohocoke has joined #ruby
agilobable has joined #ruby
kernelhcy has joined #ruby
spencerward has joined #ruby
codezombie has joined #ruby
bluOxigen has joined #ruby
zemanel has joined #ruby
kernelhcy has quit [#ruby]
adeponte has joined #ruby
sohocoke has joined #ruby
Gonzih has joined #ruby
SPYGAME has joined #ruby
paradisaeidae has joined #ruby
rippa has joined #ruby
ABK has joined #ruby
TheIronWolf has joined #ruby
shruggar has joined #ruby
robbyoconnor has joined #ruby
pabloh has joined #ruby
Helius has joined #ruby
spencerward has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
shiroginne has joined #ruby
SolarisBoy has joined #ruby
Morkel has joined #ruby
jeffmess has joined #ruby
heftig has joined #ruby
stepnem has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
deobald_ has joined #ruby
bluenemo has joined #ruby
ickmund has joined #ruby
ph^ has joined #ruby
peterhil` has joined #ruby
stepnem has joined #ruby
jeekl has joined #ruby
jeekl has joined #ruby
L-----D has joined #ruby
mengu has joined #ruby
heftig has joined #ruby
bawer has joined #ruby
QaDeS has joined #ruby
shruggar has joined #ruby
rippa has joined #ruby
agilobable has joined #ruby
Advocation has joined #ruby
stepnem has joined #ruby
<sgronblom> Is there some special magic incantation required to make a https post using net/http in 1.8.7?
<sgronblom> I find I'm getting a EOFError from somewhere
nikhil_ has joined #ruby
Squarism has joined #ruby
KJF has joined #ruby
sohocoke has joined #ruby
berkes has joined #ruby
stepnem has joined #ruby
ephemerian has joined #ruby
ephemerian1 has joined #ruby
becom33 has joined #ruby
alup has joined #ruby
timonv has joined #ruby
<becom33> I have string "Check-::new::-loka" I wanna check if the "new" is in the string . how can I check that ?
<shevy> becom33 bla.include? 'new'
kpshek has joined #ruby
simao has joined #ruby
HashNuke has joined #ruby
eka has joined #ruby
<becom33> shevy: is there anyway somthing like "~=" coz I think I have seen somthing like that before
<becom33> there a way *
<Sp4rKy> str =~ /new/ ?
Guest61069 has joined #ruby
<shevy> becom33 yes you can use a regex too via =~
<shevy> but what for
<shevy> your question asked whether a string includes "new" or not
<shevy> the method .include? does precisely that
<shevy> if you must use a regex (which is slower too) it is =~ /new/
<becom33> shevy: lets say if I have multiple words to check ?
<shevy> you can use several .include?
<shevy> or
<shevy> you do this:
manizzle has joined #ruby
<shevy> array_all_your_words = %w( new old becom33 and so on )
<shevy> your_string = "Check-::new::-loka becom33 lalala cat dog"
<shevy> hmm
<shevy> just noticed my array is too stringent
<shevy> array_all_your_words = %w( new becom33 )
<becom33> shevy: what I gave you is a example . I think its work correct what I gave . lets say its a huge paragraph and I wanan check some senteces it has
<shevy> my suggestion is to write a method and pass the paragraph into it
<becom33> it doesnt *
vectorshelve has joined #ruby
<becom33> shevy: let me show you a code
<banisterfiend> becom33: shevy is a gentle giant
<becom33> banisterfiend: I know :) hes a very good guy :)
freeayu has joined #ruby
roolo has joined #ruby
dknight has joined #ruby
<dknight> is any sass package necessary for rails 3.2?
<shevy> the people on #rubyonrails might know
<Squarism> is there anything wierd with unary negation operator "!" in ruby
<shevy> Squarism dunno, do you use () parens in your example?
<Squarism> yep
<shevy> hmm
<shevy> then I would say there can be nothing weird with it
<banisterfiend> shevy: did u blush when we said those nice things about you
<shevy> banisterfiend: you should know me by now. I felt like coming over to your place and make schaschlik out of you
<dknight> shevy: okay let me ask them
dknight has quit [#ruby]
<becom33> I know what I have done there is wrong . but atleast u'll get the idea what I want
<banisterfiend> shevy: dont u think it would be more romantic to bring a bottle of wine and a CD of classical music
<shevy> cool... in english the word is "shashlik" - here is how it looks http://www.areschenko.ru/photo/images/shashlik.jpg
<shevy> CD??? who still has CDs man :)
<shevy> ok becom33
<shevy> why do you use '' in your regex
symb0l has joined #ruby
<becom33> I know I shouldnt have . but I didnt have a way to explain I wanna go trought multiple options
<shevy> lol
josephwi_ has joined #ruby
<shevy> that's a funny explanation though ;)
<shevy> try
<shevy> /error path|mysql error|file not found/
<shevy> by the way you can test regexes online at http://rubular.com/
<shevy> banisterfiend, I would bring mozart liquer
<shevy> damn I can't spell
<becom33> shevy: btw Im getting a namespace errror
<shevy> http://www.mozartchocolate.net/images/mozartoriginal.jpg this is how it looks, it is chocolate + alcohol
<shevy> becom33 what with and how
<shevy> man
<shevy> I told you
<shevy> YOU NEED NEW GLASSES MAN
<shevy> class Tets
<shevy> Test.new
<becom33> damn :(
<shevy> DO YOU SEE WHAT IS WRONG
<shevy> ;)
<becom33> yep saw :P
<shevy> happened to me too by the way
<shevy> def intialize
<shevy> (with some arguments)
<shevy> and it took me like 20 minutes to find out why it did not work
jimeh has joined #ruby
<shevy> after some time with ruby, the error messages really give a lot of hints
<becom33> yep :)
sn0lan has joined #ruby
tvw has joined #ruby
spuz has joined #ruby
tatsuya_o has joined #ruby
nemesit has joined #ruby
symb0l has joined #ruby
qos has joined #ruby
DuoSRX has joined #ruby
knopkodav has joined #ruby
tatsuya_o has joined #ruby
tatsuya_o has joined #ruby
knopkodav has joined #ruby
workmad3_ has joined #ruby
agilobable has joined #ruby
bier|tp has joined #ruby
bier has joined #ruby
<Squarism> WTf.. shouldnt URI::encoude(...) url encode stuff?
sohocoke has joined #ruby
francisfish has joined #ruby
<heftig> Squarism: use encode_www_form_component
seivan has joined #ruby
deobald_ has joined #ruby
ukwiz has joined #ruby
<Squarism> i hate ruby with such passion
<hemanth> passion/fashion?
asno has joined #ruby
<rippa> >encoude
niklasb has joined #ruby
<shevy> Squarism what is encoude
davidw has joined #ruby
freeayu_ has joined #ruby
<Squarism> oh i misspelled a world... horrible
<Squarism> not as horrible as ruby though
asno has quit ["Leaving"]
nilg` has joined #ruby
<sgronblom> Let it all out man!
soveran has joined #ruby
DMKE has joined #ruby
lampe2 has joined #ruby
TheIronWolf has joined #ruby
ksk has joined #ruby
<ksk> hey #ruby
ukd1 has joined #ruby
<sgronblom> Squarism: Why do you hate Ruby so much?
<ksk> i have some files i need to check stuff against mulitple times (eg, get all lines that contain "error:foo" then, look for something that was in that line in all other lines etc pp)
<ksk> im wondering if theres a more performant way then just opening this files every time, eg putting thir content into a variable or something? (im new to ruby)
<ksk> any cool ideas about this?
senny has joined #ruby
<rippa> ksk: var = File.read(file)
visof has joined #ruby
visof has joined #ruby
<ksk> i didnt asked how to get files into ruby ;) but thx
<rippa> you asked how to put content into a var
<rippa> that's how
<ksk> mhmmm. you may be right.. thanks
deobald_ has joined #ruby
<Squarism> my regexp : /href="(.*)"/.match(fallback_html) obviously doesnt do what it should.. as it eagerly eats any " because of the . character class/set
<Squarism> can i modify that to be non greedy in someway
<rippa> Squarism: .*?
<rippa> or [^"}
<sgronblom> or [^"]* instead of .*
<rippa> *]
<Squarism> thanx
bawer has joined #ruby
etehtsea has joined #ruby
bnm008 has joined #ruby
kaiwren has joined #ruby
ab9 has joined #ruby
<ksk> may i asked how to use the "ri" bundled with debian in here?
<ksk> "No ri documentation found in:"
justinmcp has joined #ruby
sohocoke has joined #ruby
ab9 has joined #ruby
gucki has joined #ruby
<gucki> hi there
<gucki> i'm using latest ruby 1.9.3 and got a yaml (psych) parse error
<gucki> Psych::SyntaxError: (<unknown>): couldn't parse YAML at line 1 column 1059
<gucki> the error is exactly where the key (yes it's 1059 chars long) ends....so i wonder if there's a max key length limit and how i can workaround it?
nu7hatch has joined #ruby
mengu_ has joined #ruby
<gucki> yaml is here: http://pastie.org/3809637
<gucki> Psych::SyntaxError: (<unknown>): couldn't parse YAML at line 165 column 1027
mengu__ has joined #ruby
<gucki> deleting one more char (so having a key with 1026) and the yaml parses...
<gucki> crap :-(
<banisterfiend> anyone here use pry?
<hemanth> banisterfiend, lately
<banisterfiend> hemanth: how is it?
<hemanth> banisterfiend, liked it very much
<banisterfiend> hemanth: cool, what features do you like most?
<hemanth> banisterfiend, first of all color, then the pretty print and tab completions
<banisterfiend> hemanth: oh ok, what about show-method and show-doc ?
seoaqua has joined #ruby
<hemanth> banisterfiend, had seen that in the demo video, havn't used it much; but yes it shall be very useful
<banisterfiend> hemanth: cool :)
<hemanth> banisterfiend, try ls :)
<banisterfiend> hemanth: hehe ;)
latrommi has joined #ruby
<banisterfiend> hemanth: in the version just released (5 mins ago) you can view all monkey patches of a class, and do a recursive search for methods that contain certain code
<hemanth> banisterfiend, m serious! :) ls -> Show the list of vars and methods in the current scope.
<banisterfiend> like a ruby grep :)
<banisterfiend> hemanth: cool
<banisterfiend> glad u like it
ph^_ has joined #ruby
<hemanth> banisterfiend, you are one of the devs! :)?
<banisterfiend> hemanth: yeah, it's my project ;)
<hemanth> banisterfiend, zomg! glad to meet you
<banisterfiend> hemanth: thx :)
<hemanth> :)
mengu__ has joined #ruby
<hemanth> banisterfiend, the above lines are going to bashorg
<hemanth> ;)
<banisterfiend> hemanth: cute :) nice site too thx for the link
<banisterfiend> bbs
Muz has joined #ruby
<hemanth> Ok :)
<hemanth> Quote #951028 is pending moderation. Hmmm
nikhil_ has joined #ruby
bnm008 has quit [#ruby]
nilg` has joined #ruby
mengu has joined #ruby
artm has joined #ruby
Foxandxss has joined #ruby
mengu has joined #ruby
foo-bar- has joined #ruby
banjara has joined #ruby
falena has joined #ruby
nu7hatch has quit [#ruby]
wargasm has joined #ruby
<wargasm> anyone use johnson much?
mengu_ has joined #ruby
sohocoke has joined #ruby
zemanel has joined #ruby
arturaz has joined #ruby
rohit has joined #ruby
iocor has joined #ruby
Guedes0 has joined #ruby
Guedes has joined #ruby
Guedes has joined #ruby
Guedes has joined #ruby
Foxandxss has joined #ruby
elliot98 has joined #ruby
proffalken has joined #ruby
<proffalken> hi all
<proffalken> I need to convert a range to an array and retain the formatting
<proffalken> r = (00..60).to_a returns 1,2,3,4,etc
<proffalken> I'd like it to return 00,01,02 etc
<proffalken> is this possible?
knirhs has joined #ruby
<banisterfiend> proffalken: that's a matter of display
<banisterfiend> proffalken: after they're converted to strings
<banisterfiend> nothing to do with the raw data itself, which is always just stored as fixnums, which do not have the preceding 0
<proffalken> banisterfiend: ok, so I just check if it's less than 10 and add a "0" to the front if that matches?
soveran has joined #ruby
bwlang has joined #ruby
<banisterfiend> proffalken: sure, though im sure printf also has a formatter for that
<banisterfiend> though i dont know what it is
<proffalken> ok thanks
<drizz> proffalken:
<drizz> >> 60.to_s.rjust 4, '0'
<drizz> => "0060"
apeiros_ has joined #ruby
<proffalken> drizz: thanks, but I only want to add the leading 0 if the value is under 10
<proffalken> not to the whole strinbg
A5c97fdb9 has joined #ruby
<proffalken> my current logig is as follows
<proffalken> r = (0..60)
<proffalken> if r.to_i < 10
<proffalken> r = "0#{r}"
<proffalken> end
<proffalken> it's not pretty, but it seems to work... ;)
<apeiros_> r = "%02d" % r
<apeiros_> though, the `r = (0..60)` part in the sample makes little sense…
Mon_Ouie has joined #ruby
<apeiros_> (there's no Range#to_i)
davidcelis has joined #ruby
<banisterfiend> apeiros_: released pry 0.9.9 :P i'll be interested what u think of show-source and find-method :) https://github.com/pry/pry/blob/master/CHANGELOG
<apeiros_> banisterfiend: hey, good you caught me - leaving for my flight in half an hour :)
* apeiros_ updates pry
proffalken has quit [#ruby]
<apeiros_> hmmm, that'd be a good thing to do during the flight - port my stupid irbrc to pry
<apeiros_> banisterfiend: I assume pry uses ~/.pryrc ?
iamjarvo has joined #ruby
elliot98 has joined #ruby
<banisterfiend> apeiros_: yep ~/.pryrc. It also loads a ./.pryrc for your current project (if it exists). what are some cool features you have in your irbrc ? maybe we can steal them and fold them in
<apeiros_> uuuh… $ gem update pry \ Updating installed gems \ Nothing to update
<banisterfiend> apeiros_: hmm weird, i just released 0.9.9 about an hour ago, a couple of other people have successfully updated. Maybe some weird caching issue?
<apeiros_> ooooh
<apeiros_> wrong ruby version, no pry installed - therefore nothing to update :D
<banisterfiend> ah
<apeiros_> srsly, rubygems could be more clear about that…
<banisterfiend> Yeah
* apeiros_ pinged drbrain abou tit
<apeiros_> *about it
<banisterfiend> apeiros_: when u get it going, type $ String -a
<apeiros_> banisterfiend: my irbrc is online, I'll link you
<banisterfiend> apeiros_: thanks
<apeiros_> https://gist.github.com/923616 - the things I use regularly from it are `mbench`, `password`, __mx and __imx
<banisterfiend> apeiros_: then try: find-method -c highlight Pry
<banisterfiend> cool
<banisterfiend> ill check it out
<apeiros_> hrmpf, password there is an older version. it should use a custom class PasswordString < String, which has an inspect returning "[PASSWORD]"
<apeiros_> banisterfiend: will do
<apeiros_> any suggested read for configuring pry?
<banisterfiend> apeiros_: your history stuff looks interesting
<apeiros_> banisterfiend: yeah, but it's not stable enough yet
<apeiros_> but you can steal the ideas behind it :)
frishi has joined #ruby
WhereIsMySpoon has joined #ruby
<apeiros_> banisterfiend: great
elliot_ has joined #ruby
<banisterfiend> there's a whole bunch more that can be configured but it's not yet documented
<banisterfiend> there's a few hooks for example
<WhereIsMySpoon> Hey guys, what would be a good 2d game library for ruby?
<WhereIsMySpoon> Leaning more towards simple and ease of use than customisation
<banisterfiend> WhereIsMySpoon: gosu or ray
<banisterfiend> WhereIsMySpoon: they're both fantastic
<rohit> I thought ray was a graphics opengl based graphics lib
<banisterfiend> rohit: it's for game dev
jonathanwallace has joined #ruby
<WhereIsMySpoon> banisterfiend, which out of the two would you use and why?
<rohit> WhereIsMySpoon, Take a look at both the libs readme and see which appeals to you :)
<WhereIsMySpoon> oki
pureluck has joined #ruby
<banisterfiend> WhereIsMySpoon: ray is written by a genius (Mon_Ouie), but i dont think he's maintaining it so well. It has very good and highlevel abstractions that make it easy to use. Gosu on the other hand is a little bit more lowlevel, but still very usable, and is actively maintained with a large community: http://libgosu.org
<banisterfiend> WhereIsMySpoon: #gosu and #ray
<WhereIsMySpoon> thanks a lot banisterfiend
<WhereIsMySpoon> im looking into doing ludum dare
<WhereIsMySpoon> and id like to do it using ruby
<rohit> WhereIsMySpoon, I can suggest something crazy. Use JRuby and take advantage of Java libs through ruby. :D
tatsuya_o has joined #ruby
<banisterfiend> WhereIsMySpoon: hmm probably gosu for ludum dare, as you'd get more support on #gosu which is a reasonably large channel and there's a number of people doing it too, so there's be a kind of a community
<WhereIsMySpoon> oki
<banisterfiend> WhereIsMySpoon: but ray is a very good library, and i'd look into it for future development after ludum dare
elliot_ has joined #ruby
nikhil_ has joined #ruby
<banisterfiend> rohit: gosu and ray are C++ and C
<banisterfiend> rohit: they're lightning fast, faster than java libs i'd say
emmanuelux has joined #ruby
rohit_ has joined #ruby
<WhereIsMySpoon> this ray tutorial here is very nice
<banisterfiend> WhereIsMySpoon: yep
<WhereIsMySpoon> this actually looks quite awesome
<banisterfiend> WhereIsMySpoon: let me show u a game i wrote in gosu
<WhereIsMySpoon> sure
<apeiros_> banisterfiend: oh, right, with rails, I often use `cm` (short for 'counter-measure') too - to avoid classes who cheat
<banisterfiend> apeiros_: what does it do?
<apeiros_> cm some_obj, :class # calls Object.instance_method(:class).bind(some_obj).call
<apeiros_> useful with rails trickery, where things pretend to be Arrays and whatnot
elalande has joined #ruby
<banisterfiend> WhereIsMySpoon: slowdown is due to screencasting software, not gosu
<banisterfiend> apeiros_: cool
<WhereIsMySpoon> okay
<apeiros_> odd… I thought I had pasted the newest irbrc on gist, but this seems to have a couple of outdated definitions…
<apeiros_> I'll clean that up on my way to krakow
<WhereIsMySpoon> omg ray looks so simple o.o
<apeiros_> hm, rubyray.com obviously isn't what you're talking about, eh? :D
<WhereIsMySpoon> banisterfiend, thats awesome
<WhereIsMySpoon> banisterfiend, how long did it take to maek that
<WhereIsMySpoon> *make
rohit has joined #ruby
<banisterfiend> WhereIsMySpoon: couple of weeks
ph^ has joined #ruby
fr0gprince_mac has joined #ruby
<WhereIsMySpoon> thats pretty cool :)
<banisterfiend> WhereIsMySpoon: but i also wrote the library to manipulate images (the background is fully destructive), i wrote that in 6, which took me about 2 months :P
seanstickle has joined #ruby
<banisterfiend> it's very powerful
<WhereIsMySpoon> 6?
<WhereIsMySpoon> 6 what
<rohit> weeks
<WhereIsMySpoon> oh
<WhereIsMySpoon> sorry
<WhereIsMySpoon> xD
<banisterfiend> WhereIsMySpoon: in C
<WhereIsMySpoon> cool :)
<rohit> :D
<WhereIsMySpoon> banisterfiend, why would you say use gosu for ludum and ray for proper dev?
<banisterfiend> haha
<banisterfiend> i got texplay supporting 28 drawing modes
<banisterfiend> i was a crazy motherfucker
<WhereIsMySpoon> ...?
<banisterfiend> i even included photoshop modes like colorburn and colordodge
<banisterfiend> WhereIsMySpoon: because you have more support in gosu
<banisterfiend> i told u that already
<banisterfiend> it has a bigger channel
<banisterfiend> and more people using it
<WhereIsMySpoon> oh, yea, ok
<banisterfiend> and more people using it to do ludum dare
<banisterfiend> so you can confer with them and ask for advice
<WhereIsMySpoon> oki :)
<WhereIsMySpoon> its just
<WhereIsMySpoon> ray looks so delicious
<WhereIsMySpoon> :p
<banisterfiend> then use it
<banisterfiend> but you'll have less support
<banisterfiend> and when u only have 48 hours to write a game
<banisterfiend> support is everything
nikhil_ has joined #ruby
<WhereIsMySpoon> anim = translation(:of => [30, 40], :duration => 3)
<WhereIsMySpoon> this
<WhereIsMySpoon> is awesome
<WhereIsMySpoon> what does the ruby keyword 'always' do
<SPYGAME> WhereIsMySpoon, where is your spoon ?
<WhereIsMySpoon> i cant seem to find it with a google
<WhereIsMySpoon> dead
<rohit> It's not a ruby keyword
<WhereIsMySpoon> oh
<WhereIsMySpoon> always do
<WhereIsMySpoon> anim.update
<WhereIsMySpoon> end
<becom33> string ":and:1=1" how can i replace : and make it "/**/and/**/1=1"
<WhereIsMySpoon> i assumed it was a keyword here
<rippa> it's a method
<rohit> WhereIsMySpoon, always is a method and that's a block passed to it.
<banisterfiend> WhereIsMySpoon: ruby is an awesome language, methods can look like/behave like keywords
<WhereIsMySpoon> banisterfiend, is that a ray method?
<becom33> unm anyone ?
<WhereIsMySpoon> or a ruby method
<rohit> WhereIsMySpoon, http://rubymonk.com learn some ruby in your browser
<rippa> it's not built-in
mengu_ has joined #ruby
knirhs has joined #ruby
nanderoo has joined #ruby
<WhereIsMySpoon> this is amusing, rohit
Squarepy has joined #ruby
Squarepy has joined #ruby
elliot__ has joined #ruby
<WhereIsMySpoon> banisterfiend, does either gosu or ray do sound stuff too?
<WhereIsMySpoon> or would i need another lib for that
<banisterfiend> WhereIsMySpoon: yes
<banisterfiend> WhereIsMySpoon: they both do music and sound effects
<WhereIsMySpoon> cool
<ksk> how do i just get matching pattern from a regex? i managed to compare a "line" with a regex, and just print it if regex matches. but how to if i just wanted a part of the line (the matchin part)?
<WhereIsMySpoon> banisterfiend, https://gist.github.com/2413046 :(
<banisterfiend> WhereIsMySpoon: that's just documentation
<WhereIsMySpoon> yea but its nice to have it
<banisterfiend> WhereIsMySpoon: who cares about docs? you find those online anyway :)
<WhereIsMySpoon> i guess
<WhereIsMySpoon> :)
rohit_ has joined #ruby
elliot98 has joined #ruby
<WhereIsMySpoon> banisterfiend, `require': no such file to load -- gosu (LoadError) :S
<WhereIsMySpoon> i installed the gem
<WhereIsMySpoon> and the dependencies
<matti> WhereIsMySpoon: Try adding: require 'rubygems' before 'gosu'
<banisterfiend> WhereIsMySpoon: what ruby version are you on?
<WhereIsMySpoon> 1.9.3
<WhereIsMySpoon> adding require 'rubygems' added a whole load more errors
<banisterfiend> WhereIsMySpoon: what OS are u on?
Vert has joined #ruby
<WhereIsMySpoon> linux, ubuntu
<banisterfiend> WhereIsMySpoon: u need to install a bunch of precursor libraries
exploita1le has joined #ruby
<WhereIsMySpoon> banisterfiend, i did
<banisterfiend> WhereIsMySpoon: ok then join #gosu
<banisterfiend> and ask the friendly folk
<WhereIsMySpoon> did all that
<WhereIsMySpoon> ill try the install stuff here as well
<WhereIsMySpoon> nope still a load of errors
Faris has joined #ruby
<banisterfiend> WhereIsMySpoon: join #gosu
<WhereIsMySpoon> banisterfiend, when i do "sudo gem install gosu" i get this: https://gist.github.com/2413096 although I dont know why its trying to use 1.8 :S
<WhereIsMySpoon> ok then
<banisterfiend> WhereIsMySpoon: dont use sudo
<banisterfiend> WhereIsMySpoon: are you on rvm?
<WhereIsMySpoon> yes
<banisterfiend> then dont use sudo
<banisterfiend> just use gem install
elliot_ has joined #ruby
pastjean has joined #ruby
rohit has joined #ruby
<WhereIsMySpoon> banisterfiend, i tried that too, im on #gosu now anyways
elliot__ has joined #ruby
facefox3 has joined #ruby
L-----D has joined #ruby
keymone has joined #ruby
`brendan has joined #ruby
moos3 has joined #ruby
<`brendan> morning folks
elliot__ has joined #ruby
Sailias has joined #ruby
tatsuya_o has joined #ruby
tommyvyo has joined #ruby
_ack has joined #ruby
liluo has joined #ruby
josefig has joined #ruby
nikhil_ has joined #ruby
knirhs has joined #ruby
ryannielson has joined #ruby
jitesh_shetty has joined #ruby
matti has joined #ruby
matti has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
Hoornet has joined #ruby
facefox has joined #ruby
fr0gprince_mac has joined #ruby
nilg` has joined #ruby
Synthead has joined #ruby
pastjean has joined #ruby
elalande has joined #ruby
lobolars has joined #ruby
justinmcp has joined #ruby
tommyvyo has joined #ruby
jrist-mtgs has joined #ruby
ChampS666 has joined #ruby
mstratman has joined #ruby
iamjarvo has joined #ruby
Gesh has joined #ruby
Foxandxss has joined #ruby
Gesh has quit [#ruby]
jrist-mtgs has joined #ruby
jonathanwallace has joined #ruby
waxjar has joined #ruby
Jackneill has joined #ruby
Kruppe has joined #ruby
chimkan has joined #ruby
sbanwart has joined #ruby
wmoxam has joined #ruby
bashdy has joined #ruby
fbernier has joined #ruby
tayy has joined #ruby
foo-bar- has joined #ruby
platzhirsch has joined #ruby
<platzhirsch> When I want to plot data with Ruby I guess Ruby gnuplot is my best chance, isn't it?
nlc has joined #ruby
bwlang has joined #ruby
ukd1_ has joined #ruby
jimeh has joined #ruby
pu22l3r has joined #ruby
pu22l3r has joined #ruby
Drewch has joined #ruby
ABK has joined #ruby
ab9 has quit [#ruby]
jlebrech has joined #ruby
chimkan has quit [#ruby]
seanstickle has joined #ruby
provideal has joined #ruby
bwlang_ has joined #ruby
lorandi has joined #ruby
chad_ has joined #ruby
kpshek has joined #ruby
Shrink has joined #ruby
geekbri has joined #ruby
mattyoho has joined #ruby
mattyoho has joined #ruby
platzhirsch has quit [#ruby]
WhereIsMySpoon has quit ["Leaving"]
DMKE has joined #ruby
dv310p3r has joined #ruby
waxjar has joined #ruby
heftig has joined #ruby
steg132 has joined #ruby
td123 has joined #ruby
asobrasil has joined #ruby
bglusman has joined #ruby
lenochka has joined #ruby
<Sp4rKy> is there a way to print all environment contained in a "binding" object ?
mdhopkins has joined #ruby
<lenochka> hi, what is the purpose of p method? is it different from puts?
<banisterfiend> Sp4rKy: what do u mean by environment
<banisterfiend> lenochka: yes, it displays the #inspect of an object rather than its to_s, so it contains more info useful for debugging
<banisterfiend> it also has a return value that is the object itself
<lenochka> OK.. like what type of useful info?
<banisterfiend> lenochka: ivars, usually
<Sp4rKy> banisterfiend: the list of variable contained inside the binding environment
<banisterfiend> Sp4rKy: just invoke local_variables
s1n4 has joined #ruby
<banisterfiend> Sp4rKy: that_binding.eval("local_variables")
dustybrains has joined #ruby
s1n4 has quit [#ruby]
<Sp4rKy> mhhh, it is supposed to contain a "resource" variable, but it is not inside
<lenochka> hmm.. i see no difference between p 'something' and puts 'something', besides the returned value
ph^ has joined #ruby
<banisterfiend> lenochka: it depends on what you're putsing/psing
<banisterfiend> lenochka: some objects have an identical to_s/inspect
jgarvey has joined #ruby
<banisterfiend> other objects have a lot more info in their inspect
csexton has joined #ruby
bglusman has joined #ruby
<banisterfiend> lenochka: see the 'p' output contains info on @x ivar
<banisterfiend> but 'puts' does not
bglusman has joined #ruby
theRoUS has joined #ruby
<lenochka> banisterfiend: OK, I see that there's more info there
<banisterfiend> lenochka: good girl
<lenochka> banisterfiend: thanks
<banisterfiend> np
<lenochka> banisterfiend: :P
dipnlik has joined #ruby
<dipnlik> hi. is Design Patterns in Ruby a good book? are there better alternatives? http://www.amazon.com/dp/0321490452
lenochka has quit [#ruby]
Sailias has joined #ruby
<banisterfiend> dipnlik: it's very good
bluenemo has joined #ruby
mattyoho has joined #ruby
apeiros_ has joined #ruby
philcrissman_ has joined #ruby
bglusman has joined #ruby
grekko has joined #ruby
<dipnlik> banisterfiend: great, thanks
carlyle has joined #ruby
uris has joined #ruby
phantasm66 has joined #ruby
thecreators has joined #ruby
PaciFisT has joined #ruby
carlyle has joined #ruby
niklasb has joined #ruby
apeiros has joined #ruby
bwlang has joined #ruby
bwlang has joined #ruby
supernova has joined #ruby
<supernova> hello everyone
bwlang_ has joined #ruby
_guns_ has joined #ruby
<shiroginne> hi
<steg132> Hi there!
<jimeh> hey
jlogsdon has joined #ruby
mengu_ has joined #ruby
josefig has joined #ruby
josefig has joined #ruby
dbgster has joined #ruby
crankycoder has joined #ruby
lateau has joined #ruby
pollo_feroce has joined #ruby
wefawa has quit [#ruby]
elliot98 has joined #ruby
bbttxu has joined #ruby
dql has joined #ruby
lorandi has joined #ruby
PaciFisT1 has joined #ruby
keyword has joined #ruby
divout has joined #ruby
thone has joined #ruby
<keyword> hi guys anyone knows some parser for ruby for parse a html with js
ephemerian has joined #ruby
<apeiros> keyword: nokogiri will parse the html
<apeiros> search for <script> nodes and pass it to a js parser to parse the js
<ksk> is a hash limited to be 2dimensional? are there other "variable-types" I could store mulitple information in? like one entry is "jim,20,china,bla" - hope you get what i want to ask...
<keyword> apeiros: I'm using nokogiri but the html use a js for add the content there, so if I jsut use nokogiri it doenst get the data cause it is load from js
<keyword> apeiros: so I need that the parser support js so it can get the source with the content generated by js
<apeiros> ksk: no. a hash is only limited to consist of key/value pairs. but both, the key and the value can be (almost) any object. meaning you can use a collection as value to get "more dimensions"
<apeiros> keyword: you mean dynamically modified html? use capybara.
<ksk> apeiros: i see, thanks
<apeiros> ksk: for example with the webkit driver (headless)
<keyword> apeiros: capybara need qt for use webkit
<keyword> apeiros: I need run it in a server without X
<apeiros> afaik, we run it on a server without x too
<apeiros> might be that we use some additional software to pretend an x server, though
kevinbond has joined #ruby
ephemerian has joined #ruby
mango_ has joined #ruby
ephemerian1 has joined #ruby
v0n has joined #ruby
artm has joined #ruby
elliot98 has joined #ruby
linoj has joined #ruby
mango_ has quit [#ruby]
yorzi has joined #ruby
jeebster has joined #ruby
KL-7 has joined #ruby
mikepack has joined #ruby
keyword has quit [#ruby]
snip_it has joined #ruby
Teomari has joined #ruby
netrealm has joined #ruby
pastjean has joined #ruby
artm has joined #ruby
maasha has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
albemuth has joined #ruby
ohergal has joined #ruby
eph3meral has joined #ruby
JonSchuff has joined #ruby
albemuth has joined #ruby
<maasha> I would like to build a list of sorted intervals. I was thinking of binary search for the insertion of new intervals in the sorted list. A bit tricky or what?
pen has joined #ruby
brngardner has joined #ruby
vectorshelve has joined #ruby
williamcotton has joined #ruby
Sieben has joined #ruby
Sieben has quit [#ruby]
Karlo has joined #ruby
<Karlo> bonjour \o/
<eph3meral> maasha, no need
<eph3meral> maasha, foo = [1,2,3,5]; a = 4; rhs = foo.index{|i| i > a}; lhs = foo.index(foo.select{|i| i < a}.last)
fearoffish has joined #ruby
<vectorshelve> have a simple doubt -> http://pastie.org/3810998
<maasha> eph3meral: where are my intervals :o) ?
<maasha> include. *typo*
<fearoffish> vectorshelve: why not just collect! them and downcase them all first?
<eph3meral> maasha, ?
<shevy> vectorshelve you can modify where #include? is defined
<eph3meral> maasha, you'll have to provide a bit more information about your dataset - pastebin comes to mind
<maasha> eph3meral: [begin, end]
<vectorshelve> shevy: didnt get u
<vectorshelve> fearoffish: how ?
<shevy> in your example perhaps via class Array; alias old_include? include?; def include?(i); old_include?(i.downcase)
<fearoffish> myarray.collect! {|a| a.downcase }.include? ...
<eph3meral> maasha, i understand - as I said, you still need to provide significantly more information - pastebin an example
<maasha> thats an interval. I would to build a list of those sorted so I using a binary search can check if a new interval is within an existing one.
<fearoffish> I'd use the ! if I was doing it by itself, in this case it's unnecessary
<maasha> if a new interval is not within an existing - it should be inserted into the list in the right spot.
bwlang_ has joined #ruby
Floydzy has joined #ruby
<fearoffish> I'd say redefining '#include?' is not the right way to go
rippa has joined #ruby
<fearoffish> with great power….
cousine has joined #ruby
<vectorshelve> shevy: fearoffish thanks... :)
<eph3meral> maasha, perhaps you are hard of hearing (or reading in this case)... pastebin
<vectorshelve> shevy: fearoffish this would be good one myarray.collect! {|a| a.downcase }.include? right
catphish has joined #ruby
<fearoffish> vectorshelve: that would work, but you don't need the ! in this case
jbw has joined #ruby
<fearoffish> if you're using it on that one line, inline
<Karlo> I would like to use a javascript library in a ruby application, do you know any way to do that ? please :/
<catphish> if i have an existing ORM and want to add a controller/view based webapp on top, what would be the most sensible framework?
<vectorshelve> fearoffish: yes... I dont want it to be saved... will use it accrodingly
<vectorshelve> fearoffish: thanks :) shevy thanks to you too... always there to help
<fearoffish> catphish: probably sinatra
<catphish> Karlo: have a look at https://github.com/cowboyd/therubyracer
<maasha> eph3meral: well, something like this: http://pastie.org/3811049 - but I suspect it will fail at all sorts of edge cases with overlapping intervals.
<vectorshelve> Karlo: will this help -> http://www.infoq.com/news/2008/10/johnson-javascript-on-ruby not sure
__class__ has joined #ruby
kaiwren has joined #ruby
<eph3meral> maasha, yes that was part of the point of pastebin, to see your data set
<eph3meral> maasha, if you have overlapping intervals then you need to decide on some more criteria for when a value (or sub interval) goes in to an interval if it could go in to two intervals
looopy has joined #ruby
<eph3meral> maasha, you need to do some more thinking on specifications - first go determine what the behavior should be, then we can talk about how to solve your problem
<maasha> eph3meral: yeah, I guess that it is the deciding here that is the problem more than coding it ... :o/ - my brain is not big enuf.
emmanuelux has joined #ruby
<eph3meral> maasha, also, it would help if we knew why you are doing this? what problem are you solving? what goal are you trying to achieve? what does this data actually represent in the real world?
<catphish> fearoffish: thanks, sinatra looks more powerful than i first thought
carlyle has joined #ruby
<maasha> eph3meral: my question is if a given interval is completely embedded in another interval.
krusty_ar_ has joined #ruby
CheeToS has joined #ruby
<maasha> eph3meral: I want to locate all matching intervals between two similar strings.
<maasha> The interval check is to speed things up.
<shevy> not sure there is an inbuilt way for that
<maasha> shevy: there might in bioruby, but it is too slow :o) - this is DNA stuff on a large scale.
Synthead has joined #ruby
<maasha> anyway. consider this a fun little interval exercise!
rainytooo has joined #ruby
<eph3meral> maahes, if interval_in[0] > interval_containing[0] && interval_in[1] < interval_containing[1]
<eph3meral> maahes, that's pretty simple
andrebras has joined #ruby
<eph3meral> maahes, if you're just talking two intervals
<Synthead> if I install a gem, is there a de-facto way to figure out what "require" line I should be using (without googling for it)?
<eph3meral> maahes, you'll have to adapt that to your "binary tree" thing or whatever structure you store them in
glosoli has joined #ruby
<eph3meral> maahes, and you may need or want >= and <= respectively instead of > and <
glosoli has quit [#ruby]
<eph3meral> maahes, i guess it depends on your definition of "completely contained within"
soveran has joined #ruby
LiquidInsect has joined #ruby
<eph3meral> maahes, or the slightly more human readable version: if interval_in.min > interval_containing.min && interval_in.max < interval_containing.max
<maasha> well, I am not going for a tree, but rather a list that is queried binary.
<eph3meral> maahes, either way, you'll have to tell us more about the criteria/purpose/reason/application/problem-domain
mikos_ has joined #ruby
ckrailo has joined #ruby
<eph3meral> maahes, simply figuring out if one interval contains another is easy - the rest is up to you
becom33 has joined #ruby
<becom33> how can I change somthing like ":and:1=1" into "+and+1=1" ? repace anyone in :
baroquebobcat has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
<maasha> becom33: gsub
oooPaul has joined #ruby
mikos has joined #ruby
<maasha> becom33: or tr
lkba has joined #ruby
KarlFreeman has joined #ruby
<rippa> tr is faster
<KarlFreeman> I'm currently working out a Ruby API but have hit a wall with ACL. Does anyone have any good resources for ACL's for REST API's?
richardlxc has joined #ruby
richardlxc has joined #ruby
adeponte has joined #ruby
bashdy has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
niku4i_ has joined #ruby
MrGando has joined #ruby
johnmilton has joined #ruby
<eph3meral> KarlFreeman, cancan perhaps?
<KarlFreeman> eph3meral, used CanCan before but would need ACL to be in the DB ( looks possible https://github.com/ryanb/cancan/wiki/Abilities-in-Database )
kenperkins has joined #ruby
<KarlFreeman> however I need to provide ACL for more then current_user ( eg to other objects ). Thanks though
<eph3meral> KarlFreeman, I would disagree on whether you've used cancan before
<eph3meral> KarlFreeman, since you would know that cancan in no way precludes you from storing ACL info in the DB
albemuth has joined #ruby
<KarlFreeman> Well i've used it in the 'creating global role abilities'
<KarlFreeman> eph3meral, will look in to it more :)
waryof has joined #ruby
waryof has quit [#ruby]
fr0gprince_ has joined #ruby
elliot98 has joined #ruby
<eph3meral> KarlFreeman, all cancan does is give you the ability to set either "allow" or "deny" - how you determine whether to allow or deny is up to you - it's one of the FIRST things he says in his docs
<Karlo> thank you very much catphish :)
philcrissman_ has joined #ruby
davidcelis has joined #ruby
ChampS666 has joined #ruby
KL-7 has joined #ruby
berserkr has joined #ruby
<ksk> hi again
<ksk> is it possible to use .include? method from array with a variable? im not able to get it working... :x
<ksk> "array.include?(var)" 'does not work', but if i putt ("var-content") with """ in there it works
<ksk> any helpful idea?
<oooPaul> ksk: There's nothing stopping that from working. What do you mean by "does not work"?
<oooPaul> ary = [:foo, bar]; biff = :foo; ary.include?(biff) => true
<ksk> let me nopaste it, sec
voodoofish430 has joined #ruby
<ksk> ah, i actually do something else.. my variable comes from "while (line = file.gets)" - this seems to behave somehow different
<ksk> your example works great..
<oooPaul> Yeah, it sounds like what you THINK is in your variable is NOT what is actually there.
<oooPaul> Dump the var with "puts var.inspect" and see what is actually in that var.
<supernova> can anyone suggest me some online materials for learning Ruby
Akuma has joined #ruby
<oooPaul> If you're pulling from a file, I'm betting you have a carriage return in your string that you aren't expecting.
<oooPaul> supernova: ruby-lang.org
ABK has joined #ruby
<ksk> true that oooPaul :) thanks a lot!
mailtruck_ has joined #ruby
tercenya has joined #ruby
<axisys> how do I do a nice exit if ARGV[0] is not provided. I need a nicer output than line 13 here http://dpaste.com/733759/
maletor has joined #ruby
eywu has joined #ruby
<oooPaul> axisys: exit(0) ?
emmanuelux has joined #ruby
Bofu2U has joined #ruby
mikeliss has joined #ruby
<oooPaul> Or exit(1)...
<oooPaul> Or just don't run the loop if ARGV[0] is nil?
jgrevich has joined #ruby
jgrevich has joined #ruby
<axisys> so add if ARGV[0]? == nil ?
<axisys> or true
<oooPaul> "exit(1) if ARGV[0].nil?
<axisys> oooPaul: ok
<oooPaul> or "if ARGV[0].nil? ; puts "No filename provided"; exit(1); end"
<axisys> oooPaul: even better.. thanks
<axisys> oooPaul: works like a charm.. thanks a lot
<axisys> man.. ruby is fun.. i am hoping to continue to sysadmin stuff with ruby .. going forward
<axisys> much easier to follow than doing it with awk
<oooPaul> Yep. I've had more fun writing Ruby code than any other language...
<axisys> oooPaul: i should start finding local meetups of rubyst (?)
<oooPaul> Can if you want. There are plenty out there.
<axisys> so puts '\'' is the right way to print `` ' '' ?
<axisys> or may be "'" ?
sabooky has joined #ruby
benkevan has joined #ruby
mailtruck__ has joined #ruby
<benkevan> I'm using Puppet::Provider::ParsedFile however, when I have a value that has spaces, every time I run puppet it says it changes. However, if I change the seperation to a tab, it works as expected.. how can I fix this?
heftig has joined #ruby
<benkevan> record_line :parsed, :fields => %w{name val}, :joiner => ' = ', :separator => /\s*=\s*/ < is my record line, and I get the same results with /\s+=/\s+ also
<oooPaul> axisys: Both work. The differences are minor.
<axisys> "'" worked
cousine has joined #ruby
<oooPaul> axisys: If you use double quotes, the contents are parsed for substitutions. If you use single quotes, they are not.
ABK has joined #ruby
<oooPaul> So: x = 'foo'; puts '#{x}' => "#{x}"; puts "#{x}" => "foo"
artm has joined #ruby
looopy has joined #ruby
btaitelb has joined #ruby
<Synthead> if I install a gem, is there a de-facto way to figure out what "require" line I should be using (without googling for it)?
Karlo_ has joined #ruby
<sabooky> Is this considered "clean" code? lines.map {|line| (match = line.match(/Include (.*)/)[1] ? parse_inclue(match) : line)}
<sabooky> basically, if a line has an "Include" statement, I want to read the file and substitute the line with the contents of the file
banseljaj has joined #ruby
SegFaultAX|work has joined #ruby
joaoh82 has joined #ruby
<benkevan> anyone?
<eph3meral> sabooky, I wouldn't consider it dirty, but I personally would prefer to see it written with do end and if else instead of {} and a ternary all on one line
cwang has joined #ruby
<eph3meral> sabooky, another alternative would be includes = lines.select { |l| l.match(...) }; includes.map { |i| parse_include(i) }
two- has joined #ruby
<eph3meral> sabooky, includes = lines.select { |l| l.match(...) }; includes.each { |i| parse_include(i) }; would work just as well
<eph3meral> sabooky, for practical purposes .each and .map can be considered the same
ABK has joined #ruby
akem has quit ["Forget progress by proxy. Land on your own moon."]
<sabooky> eph3meral: replacing them inline, so the "Include" line would need to be substituted, having two arrays I think would require them to be merged later on
<sabooky> each would work though
<eph3meral> sabooky, hmm, ok so on second thought, nm, cuz you need the backreference
<eph3meral> so I guess select won't work
akem has joined #ruby
savage- has joined #ruby
cloke has joined #ruby
cbuxton has joined #ruby
cloke has joined #ruby
<eph3meral> sabooky, oh, i see, you want to replace inline
<sabooky> hmm.. got an undefined method for nil class, since some lines dont match the regex
<axisys> oooPaul: gotcha
<sabooky> maybe this is better for me to just spell it out rather than attempt a one-liner
bwlang has joined #ruby
<eph3meral> sabooky, I think your code is fine, just write it in a more readable format (not all on one line)
philcrissman_ has joined #ruby
<sabooky> ok, so second question
linoj_ has joined #ruby
<sabooky> is there a shortcut for
rainytooo has joined #ruby
seme has joined #ruby
<sabooky> foo = match[1] if match = my_string.match(/someregex with (group)/)
adeponte has joined #ruby
<eph3meral> sabooky, not that I know of
<sabooky> oh, nvm, found it
<workmad3_> sabooky: if my_string =~ /someregex (group)/; some_method($1)
<sabooky> my_string[/regex (group), 1]
<eph3meral> hmm, $1 eh?
<sabooky> err.. my_string[/regex (group)/, 1]
<eph3meral> ahh, both very interesting
<sabooky> thanks both of you for your help
<workmad3_> eph3meral: yeah, $1 - $9 correspond to capture groups after a regex
<eph3meral> workmad3_, cool, good to know
LMolr has joined #ruby
<workmad3_> they're sort of like globals, but I think they have some interesting behaviour with nesting... but it's generally safest to use them very quickly after a match :)
tercenya has quit [#ruby]
blueadept has joined #ruby
linoj has joined #ruby
<eph3meral> sabooky, http://pastie.org/private/s79aur3wy4g2augxojdxw is "cleaner" as it were
<eph3meral> sabooky, clean mostly meaning "readable"... in general, one liners are not readable unless they're only a single operation
<eph3meral> sabooky, we don't live in 1992 anymore - most people run a screen resolution of larger than 640x480
<workmad3_> eph3meral: 'if matches' would (IMO) be a lot better than 'if !matches.nil?'
<eph3meral> workmad3, hmm, ok I suppose that's fair
<workmad3_> eph3meral: even 'unless matches.nil?' would be more readable.... I dislike 'if !foo.nil?' :)
<eph3meral> workmad3_, agreed
<LMolr> why String#prepend doesn't have trailing "!" ? It looked natural, to me
<workmad3_> (hell, I dislike if !condition in general)
<eph3meral> workmad3_, also agreed
<workmad3_> LMolr: because there's only one version of it
Araxia_ has joined #ruby
Ronnie_ has joined #ruby
<Synthead> if I install a gem, is there a de-facto way to figure out what "require" line I should be using (without googling for it)? nobody knows?
<eph3meral> LMolr, and if you want the non altering version, there's foo = "blerp" + foo
<davidcelis> Synthead: If it's not the name of the library, then the gem's README should say
<workmad3_> LMolr: or foo = "#{foo} blerp"
pi3r has joined #ruby
<eph3meral> workmad3_, that would be append, not prepend :P
<LMolr> workmad3_, eph3meral: ok thanks. The lack of "!" got me wrong
ABK has joined #ruby
<EvanR> if a method takes a block, can i use a proc or lambda instead somehow?
<pi3r> hi guys
<eph3meral> EvanR, yes
<workmad3_> eph3meral: good point :) I'd use interpolation either way though
<eph3meral> EvanR, TIAS
<pi3r> i have a question about a ruby idiom
<workmad3_> eph3meral: 1 less string object get's created ;)
<pi3r> what does <<-ANYTEXT means?
<eph3meral> pi3r, heredoc
<workmad3_> pi3r: it's basically a multiline string
<eph3meral> workmad3_, indeed, I have heard that interpolation is actually faster than concatenation in ruby
<eph3meral> (in contrast to PHP for example)
<workmad3_> pi3r: that's ended with the token ANYTEXT at the start of a line
<LMolr> workmad3_, eph3meral: do you think i can beautify this? : out_ext.prepend('.') if out_ext == ''
<EvanR> eph3meral: ok
<pi3r> heredoc? let me google that :D
<pi3r> workmad3_: eph3meral thanks ! :D
<workmad3_> eph3meral: depends on the interpreter, but yeah it frequently is (I believe mostly because as I said, it creates fewer string objects that then need GC)
schovi has joined #ruby
<EvanR> eph3meral: failed miserably
<eph3meral> EvanR, works for me
<EvanR> [1,2,3,4,5].select{|x| x>2} works
<pi3r> workmad3_: eph3meral does string interpolation works with heredoc?
<Synthead> davidcelis: right on, thank you
<workmad3_> pi3r: can't quite remember... you could try it in IRB though ;)
<EvanR> p = lambda {|x| x>2}; [1,2,3,4,5].select p fails
<EvanR> p is not a block, so fails
<eph3meral> EvanR, get_foo = lambda { |x| x[:foo] }; [{:foo => "hello"}].map(&get_foo);
theRoUS has joined #ruby
<EvanR> & eh
* EvanR tries
<workmad3_> EvanR: & passes the argument in as a proc
<EvanR> ok
<pi3r> workmad3_: yep :) will do
<pi3r> thanks again :D
<workmad3_> EvanR: important to note that it does also change a lambda to a proc if you do that btw :)
bwlang_ has joined #ruby
sluggy has joined #ruby
Advocation has joined #ruby
<EvanR> how about a higher order lambda
<EvanR> &(f(x)) ?
binaryplease has joined #ruby
ianbrandt has joined #ruby
<EvanR> ill try it
<workmad3_> EvanR: if f() returns a lambda, it'll work fine
atmosx has joined #ruby
<EvanR> lots of parentheses
<workmad3_> EvanR: or even if it returns a proc
Kevin- has joined #ruby
<workmad3_> EvanR: you could drop the outer pair there though
apok has joined #ruby
<workmad3_> EvanR: .map(&f(x))
bluOxigen has joined #ruby
<binaryplease> hey im starting to learn ruby, found like 1000 books and howtos on the internet, can someone recommend a good one for a beginner?
<EvanR> .select &f(x)
<workmad3_> EvanR: or that, yeah
<EvanR> ok
<workmad3_> binaryplease: learning ruby from another language, or just learning to program with ruby?
<workmad3_> binaryplease: if you're just starting programming, I'd suggest: http://pine.fm/LearnToProgram/
JivaD has joined #ruby
<binaryplease> workmad3_: i know java and a bit of c++ but not professional
<binaryplease> i also need to learn how to work with ruby on rails
<EvanR> im coming to ruby from haskell
<davidcelis> binaryplease: The Ruby Programming Language, or The Well Grounded Rubyist
<workmad3_> binaryplease: right... others may have other suggestions, but you probably won't go far wrong with Programming Ruby (a.k.a. the Pickax book) or something like _why's poignant guide or the little book of ruby
<davidcelis> Pickaxe is a great reference, but I wouldn't recommend it as a learning guide
<workmad3_> binaryplease: and for rails, 'Rails 3 in Action' is pretty good
<davidcelis> _why's Poignant Guide is great literature, but I wouldn't recommend that as a learning guide either
jergason has joined #ruby
<workmad3_> davidcelis: yeah, your suggestions are probably better :)
<davidcelis> everybody should read the poignant guide though
<EvanR> workmad3_: actually it turns out to be .select &f.(x)
williamcotton has joined #ruby
<workmad3_> EvanR: oh, I thought f was a method already... what is it? another lambda? if so, f.call(x) is probably nicer on the eyes of most rubyists :)
ecksit has joined #ruby
<workmad3_> (I had a bit of a brain-derp seeing f.() :) )
<EvanR> yeah
<EvanR> lambda
<EvanR> so it can closure
<ecksit> Hi, I need a ruby script to spit out the disk space remaining. Anyone got some resources? (I don't want to use gems)
<workmad3_> EvanR: you taught me a new trick to calling lambdas today though :) thanks
<EvanR> workmad3_: agree all this syntax is rather harsh
<shevy> ecksit not sure there is a direct way. on linux, you can use "fdisk -l" from within a ruby script
<workmad3_> EvanR: and yeah... ruby can do functional programming to a certain extent, but the syntax is neater for OO programming with method calls that you pass blocks to
Careott has joined #ruby
<lectrick> Can anyone explain why ObjectSpace._id2ref n where n is an odd number is the n-2 instance of Fixnum?
<shevy> or some other command than fdisk -l
<workmad3_> lectrick: because those are the object ids of fixnums
JivaD has joined #ruby
<workmad3_> lectrick: did you not do the ruby koans? :)
<lectrick> workmad3_: Why do fixnums have object id's? workmad3_ Apparently I have to lol
<ksk> is there something like bashs "-x" commandline option, to see what happens internally for ruby?
<workmad3_> lectrick: well, a fixnum is an object... why wouldn't it have an object id?
<any-key> if it exists, it is an object
<lectrick> workmad3_: stop making sense. :) Do floats have object id's?
<lectrick> Because that could get complicated
<workmad3_> lectrick: yes, but they don't follow a pattern
<lectrick> workmad3_: So every float value that is ever the result of any calculation gets assigned an object ID?
<lectrick> Isn't that a memory problem?
medik has joined #ruby
<binaryplease> davidcelis: workmad3_ thanks ill look into taht
<shevy> hmm
<shevy> Floats have the same object id all the time, I think
<lectrick> shevy: I just tried. Nope.
<workmad3_> lectrick: if you ever grab the float, it will act like an object... it's entirely possible that the interpreter will optimise away intermediate floats that are only temporary, but semantically they are objects and so would have object ids (it's sort of quantum... if you ever observe it, certain things will happen, otherwise not)
<shevy> hmmmm strange
<EvanR> workmad3_: i see that, but i end up with a lot of blocks which repeat code
<lectrick> >> (0.6).object_id #=> 70161423884860 >> (0.6).object_id #=> 70161423879300
<EvanR> no first class blocks, so
Advocation has joined #ruby
<workmad3_> EvanR: proc {} is a 'first class' block
<EvanR> yes
ABK has joined #ruby
<EvanR> and this is the syntax ;)
<lectrick> workmad3_: There is a strange beauty to that
<workmad3_> lectrick: it's the difference between a mental model (it's an object, so it has an object id) and an optimisation (we'll only actually make an object if you ever treat it like an object)
c0rn has joined #ruby
DMKE has joined #ruby
Oog_ has joined #ruby
<Oog_> there is a function run_process in module Delayed::class Command that is in the delayed_job gem. I need to override this function... how? after i require 'delayed/command.rb' if i reopen the module/class and define the function will my version take precedence or must i do something else?
<lectrick> 0.6.object_id == 0.6.object_id #=> false
<workmad3_> lectrick: I'd also need to check interpreter code to see if that is actually the case too... I know the interpreter does that sort of thing with blocks and procs and it would make sense for calculations but I don't *know* it's true
<lectrick> >> 6.object_id == 6.object_id #=> true
<workmad3_> lectrick: as already stated, fixnums are special :)
<lectrick> workmad3_: yes. just demonstrating :)
<shevy> stupid stinking fixnums
<workmad3_> lectrick: if you get into Bignum territory, it acts the same as floats (different object ids all the time)
<shevy> stupid stinking bignums
<workmad3_> lectrick: and seeing as you can have bignum literals in ruby, that can get interesting :)
<lectrick> >> 5.freeze; 5.frozen? #=> true >> 6.0.freeze; 6.0.frozen? #=> false
<shevy> yep
<shevy> they stink
<shevy> but .freeze also stinks :)
atmosx has joined #ruby
<workmad3_> lectrick: each float literal creates a new object
<shevy> ruby cheats
<lectrick> shevy: I was just using it to demonstrate hidden attributes on individual fixnums :)
<shevy> they are not so individual!
<EvanR> please tell me floats, ints, bignums, etc are immutable ;)
<workmad3_> EvanR: I wouldn't trust them to not be immutable, but I realise that's not the same thing :)
ed_hz_ has joined #ruby
<shevy> they are not even real objects :(
<shevy> x = 5.5; def x.hi; puts "hi"; end
<shevy> TypeError: can't define singleton method "hi" for Float
<workmad3_> shevy: they are... they're just special objects :)
<workmad3_> (aren't they value objects or something?)
<shevy> they are like the most archaic prototypic objects
<shevy> they think "one day we grow big and strong!"
<shevy> but they only disappoint :(
imsplitbit has joined #ruby
apok has joined #ruby
<waxjar> what's best practice in defined class methods (i do it the class << self way). place them at the end of the class or at the beginning?
<waxjar> *defining
<any-key> think about it, floats are handled by ALU magic
<workmad3_> shevy: they only disappoint if you try to abuse them :P
<shevy> workmad3 I try to treat them like the best object ever!
<shevy> but they just say no :(
<any-key> waxjar: I tend to prefer doing self.method instead of class << self
<any-key> I'd say at the top
<shevy> I too!
KJF has joined #ruby
<workmad3_> top
<shevy> def Foo.foo sucks because it's tied to the name
<any-key> def self.foo makes a lot more sense
<workmad3_> and yeah, def self.method, unless I need to do class << self to do an attr_accessor or something and so already have it
kuzushi has joined #ruby
<shevy> you can change the name at a later point too and it will still work
<supernova> hello everyone
<shevy> die supernova!
<shevy> oops
<shevy> hi supernova!
<waxjar> y do some attr_readers indeed, so i chose for class << self
<waxjar> *I
<EvanR> ok
<EvanR> to sort, i need to compare stuff
<EvanR> so subtract
<any-key> <=>
<EvanR> ok
<EvanR> <=>
<workmad3_> EvanR: spaceships are your friend :)
<seme> I must be dense can anyone help me to understand the synxtax of the some_array.sort { |x,y| y <=> x }... I get that it sorts the items descending but whats going on there...
<EvanR> first question, i want to compare values which might be nil
<EvanR> numbers | nil
<any-key> seme: it might help to read up on the "diamond" operator (the <=> thing)
<EvanR> number - nil is an error (good)
<seme> thanks... let me take a look.
<supernova> some one tell me some sites where i can in depth knowledge on ruby
<supernova> i tried some of the official .org pages
<workmad3_> EvanR: any chance you can remove the nils first? .compact.sort would make it trivial ;)
<workmad3_> any-key: <=> is the spaceship operator :)
stkowski has joined #ruby
<any-key> bah! it's a diamond!
<any-key> => is a rocket ship
<EvanR> workmad3_: the nils are in the data, and should be. when they appear in the sort function, they should be 'less than any number' or whatever
<EvanR> no number is like that
steg132 has joined #ruby
<workmad3_> EvanR: ah, fair enough
berserkr has joined #ruby
<workmad3_> EvanR: was just checking :)
<EvanR> (assuming you wanted me to treat nil as a number)
maloik has joined #ruby
<workmad3_> EvanR: no, I was just suggesting you get rid of them
<EvanR> no they are part of the record and need to be pushed all the way down or up
<EvanR> alright skip that question, how do i conveniently sort of more than one aspect of the record, like first field :a then :b
<EvanR> sort on*
havenn has joined #ruby
<workmad3_> EvanR: do it in your comparison block
<EvanR> right
brngardner has joined #ruby
<EvanR> its gonna be complex :(
jitesh_shetty has joined #ruby
<workmad3_> EvanR: feel free to call out to other methods in your comparison block ;)
<EvanR> and not too obvious
<EvanR> well its not gonna be methods because the methods i need arent defined yet on the relevant classes
<EvanR> lambdas maybe
<workmad3_> EvanR: hmm, I'd do it all inline and pull it out into methods later tbh
adamkittelson has joined #ruby
<EvanR> pull it out into methods? youre suggesting i actually make new methods for nil and number and stuff?
<EvanR> :S
rbanffy has joined #ruby
<shevy> change the world man, change the world
<shevy> take a broom and start nearby!
<EvanR> >_>
<any-key> monkey patching is like violence
zakwilson has joined #ruby
<any-key> well, it is violent
<shevy> I prefer to call it god patching
<any-key> but you need more of it
<EvanR> i prefer local changes
<shevy> it shows that there are monkeys who can't handle it
<any-key> programming ruby is like playing games with god mode on
ABK has joined #ruby
<shevy> well yeah
<shevy> I want to be able to constrain god patching to certain projects too
<shevy> perhaps we are monkey-gods
<EvanR> spooky action at a distance
<msch> anyone here using goliath.io?
<shevy> io??? the Io language?
<shevy> is it still alive? :P
Advocation has joined #ruby
<any-key> languages don't die
Bofu2U_ has joined #ruby
tommyvyo has joined #ruby
micah has quit [#ruby]
<shevy> they do!
<lectrick> io was so cute
<shevy> it just takes a long time for most
<shevy> my main indicator is for where all the young programmers go for
<shevy> (Java) :(
<any-key> Java isn't a horrible way to learn
<any-key> you have to be very specific with it
jonathanwallace has joined #ruby
<EvanR> 7 - nil, error
ringotwo has joined #ruby
<EvanR> 7 == nil, not an error
<EvanR> >_<
<any-key> then you get tired of it and things like attr_accessor make you feel relieved
<any-key> EvanR: the - operator is defined on fixnum, it requires another fixnum object
<any-key> nil is not a fixnum
<any-key> comparison, however, can work with nil
supergiantrobot_ has joined #ruby
<EvanR> this is equals
<shevy> hmm
<EvanR> just annoying
<shevy> EvanR, you would expect the first to return 7 right?
<any-key> it requires a numeric
<EvanR> shevy: no
<EvanR> error is good
<EvanR> 7 <=> nil, nil
<EvanR> nil <=> nil, 0
<EvanR> >_<
prometheus has joined #ruby
<EvanR> 7 <=> nil, nil
<EvanR> nil <=> 7, nil
* EvanR hmms
<any-key> nil is the same as nil, it makes sense that it would return 0
<any-key> BUT, you cannot compare a fixnum with nil
<lectrick> looked at io again. don't like it that much. meh
<shevy> lectrick it sure had more momentum 5 years ago
<EvanR> you cant say that a given comparison always makes sense if were talking about the set of numbers union nil
<shevy> I did not like that they used := for assignment and = for update slots
<lectrick> shevy: The webpage looks like it hasn't been updated since
<shevy> yeah
<any-key> EvanR: nil isn't a number, stop using it as one ;)
<shevy> I failed to compile Io from source for 3 years
<lectrick> shevy: yeah that sort of thing seems like exposing too much implementation at the language level
<shevy> only since ~2 years can I compile it from source again
<EvanR> any-key: your numbers arent good enough
<lectrick> i mean, tinkering with new languages is what got me hooked on Ruby in like... was it 2004? 2005? I forget :)
<any-key> it's ruby, make your own :D
<EvanR> i did
<EvanR> number | nil
<shevy> same here lectrick
<shevy> one language that could be interesting for you, if you did not look at it yet, could be #nimrod
<EvanR> i just cant sort it
dv310p3r has joined #ruby
<lectrick> I wish I could overload any operator in ruby tho... and make new ones arbitrarily. looks like Io does have that
<shevy> ruby is 90% perfect!
<EvanR> a default ordering would be nice...
<any-key> you can overload any operator in ruby
<EvanR> cough haskell
<shevy> haskell has the monad barrier
<shevy> either you understand monads or you don't
<EvanR> i dont know wtf barrier youre talking about, but were just talking about sorting values here
<any-key> I understand them enough to do this project :P
<any-key> although I won't be pursuing it further
<shevy> hehe
<EvanR> only problem with monads is theres this weird culture of 'they are impossible to understand' surrounding it
bwlang_ has joined #ruby
<any-key> haskell made me good at recursion and using copious folds and maps, that's all I need to carry on to other languages :P
<shevy> EvanR because you can't explain them in one sentence
<any-key> EvanR: they aren't easy to understand, but yeah I agree
<EvanR> shevy: because theres nothing to explain
<lectrick> nimrod looks interesting, at least performance wise
krusty_ar has joined #ruby
<shevy> EvanR cool philosophy
<EvanR> its like trying to explain 'to_s' in one sentence
linoj has joined #ruby
<shevy> to_s is a method just like any other method on objects performing a substitution into a string
<lectrick> any-key: there's a few operators you can't overload in ruby... http://stackoverflow.com/questions/92862/why-does-ruby-only-permit-certain-operator-overloading
<any-key> the whole concept of no side effects and shifting the world state is interesting
<EvanR> shevy: its different for every object
<any-key> lectrick: that's a shame :(
<EvanR> world state is a red herring dont listen to that stuff
<any-key> too late!!!
<lectrick> i like the no side effects thing, which is why I started using object.freeze in my ruby code, but now people here keep telling me not to lol
nemesit has joined #ruby
<any-key> it makes sense though, I think it helped me
<shevy> of course it is different for different objects as different objects contain different data
<lectrick> So instead, now I simulate frozen-ness by duping incoming values and only allowing them to be set once
<any-key> I'm currently picking apart JVM bytecode in haskell, it's getting tedious :(
<shevy> it's like trying to throw an elephant into a blender and ask "will it blend" and then be surprised if it does not blend as easily as a mouse :(
<EvanR> shevy: its a method that returns a string, exactly what that means is not defined
<shevy> a string is a string
<any-key> EvanR: the IO monad does that
<lectrick> TIL haskell is yet another language that runs on the jvm
<any-key> lectrick: no
<EvanR> any-key: no
<shevy> I don't understand how you can say a string is not well defined
<niklasb> lectrick: what?
<any-key> lectrick: it's for a school project
<lectrick> oh nvm sorry... misread what any-key said
moshef has joined #ruby
<EvanR> shevy: 'string' is, but what 'to_s' does exactly is not defined
<lectrick> shevy: Probably... encoding
<EvanR> the >>= method for monads has an obvious signature, but what it means it not defined
<EvanR> so people get confused
<lectrick> EvanR: You define your to_s. :)
<EvanR> just think of to_s
mrsolo has joined #ruby
<shevy> what is a monad?
<EvanR> ... class with >>= method
<niklasb> shevy: it's unbelievably cool and mind-bending
<EvanR> alright im done
<niklasb> EvanR: and return and monad laws
Sailias has joined #ruby
<shevy> niklasb that I heard!
ABK has joined #ruby
<EvanR> niklasb: yes, im trying to analogize with to_s here
<shevy> I am not quite sure why it is so cool and mind-bending but one day I will find out
<niklasb> EvanR: sry, didn't follow the discussion
<EvanR> should be equally mind blowing
<any-key> it takes a thing, and that thing tells you how to make a string out of it
<any-key> then you get a string
<niklasb> also fail to see how that has anything to do with monads ? oO
* any-key kicks haskell in the monads
<EvanR> any-key: you take a monad, >>= with a function, and you get another monad (monadic value)
<EvanR> end of
<any-key> EvanR: correctamundo
<EvanR> not mind blowing
<niklasb> EvanR: no, >>= combines *functions*
<EvanR> its x >>= f
<EvanR> not f >>= g
<any-key> monads aren't limited to the IO monad
<niklasb> oh.. right
<niklasb> stupid me
<any-key> I like the do syntax, I hardly ever write >>= for my code :P
<niklasb> any-key: it's often more readable though
ctwiz has joined #ruby
<EvanR> yeah >>= really only used for not IO
<any-key> do is more readable
<EvanR> depends
<any-key> true
<EvanR> do in Maybe is pretty nice
<niklasb> anyways, this is not #haskell :)
<EvanR> i miss that in a lot of systems
<any-key> okay I should get back to hacking away at JVM bytecode
<any-key> it's been fun
<niklasb> have fun
<any-key> :'(
<EvanR> </rant about comparison of number|nil in ruby>
stephenjudkins has joined #ruby
greenarrow has joined #ruby
ABK has joined #ruby
SegFaultAX|work has joined #ruby
enherit has joined #ruby
Notimik has joined #ruby
Zolrath has joined #ruby
scwh has joined #ruby
bwlang has joined #ruby
kuzushi has joined #ruby
kirun has joined #ruby
|RicharD| has joined #ruby
<|RicharD|> hello anyone can tell me why if i do the cycle(.each on view) it show a "debug" array structure ? https://gist.github.com/2415413
rippa has joined #ruby
<|RicharD|> shit wrong channel
<|RicharD|> :S
<|RicharD|> sorry
<foo-bar-> |RicharD|: it's because <%= %> outputs the return value of the expression to the view
BeLucid has joined #ruby
<foo-bar-> use <% %> instead for the .each
<|RicharD|> thx man
Azure has joined #ruby
Sailias has joined #ruby
bwlang_ has joined #ruby
tewecske has joined #ruby
sonkei has joined #ruby
becom33 has joined #ruby
alienvenom has joined #ruby
ABK has joined #ruby
TheIronWolf has joined #ruby
cespare has joined #ruby
Norrin has joined #ruby
shobhitg has joined #ruby
shobhitg has joined #ruby
Floydzy has joined #ruby
shobhitg has joined #ruby
Eldariof-ru has joined #ruby
sabooky has joined #ruby
Norrin has quit [#ruby]
shobhitg has joined #ruby
BeLucid has joined #ruby
shobhitg has joined #ruby
ephemerian has joined #ruby
shobhitg has joined #ruby
cjs226 has joined #ruby
cola_zero has joined #ruby
Bosma has joined #ruby
ABK has joined #ruby
shobhitg has joined #ruby
niku4i_ has joined #ruby
krz has joined #ruby
apok_ has joined #ruby
jaysern has joined #ruby
abionic has joined #ruby
chson has joined #ruby
ChampS666 has joined #ruby
mikepack has joined #ruby
Faris has joined #ruby
tyman has joined #ruby
shobhitg has joined #ruby
sgronblom has joined #ruby
francisfish has joined #ruby
shobhitg has joined #ruby
<lindenle> Hi what code review tools do people use?
<oooPaul> My eyeballs. :)
<yxhuvud> diff + email.
shobhitg has joined #ruby
nobitanobi has joined #ruby
shobhitg has joined #ruby
ceej has joined #ruby
<oooPaul> Oh yeah, and "svn blame"
shobhitg has joined #ruby
shobhitg has joined #ruby
shobhitg has joined #ruby
shobhitg has joined #ruby
lampe2 has joined #ruby
nfluxx has joined #ruby
bwlang_ has joined #ruby
mdw has joined #ruby
Jakee` has joined #ruby
facefox3 has joined #ruby
Shoobdidoo has joined #ruby
dbgster_ has joined #ruby
jonatha__ has joined #ruby
facefox3 has joined #ruby
dbgster_ has quit [#ruby]
cha1tanya has joined #ruby
becom33 has joined #ruby
brngardner has joined #ruby
allanm has joined #ruby
pastjean_ has joined #ruby
aszurom has joined #ruby
qos has joined #ruby
includex has joined #ruby
symb0l has joined #ruby
ceej has joined #ruby
dbgster has joined #ruby
d3c has joined #ruby
havenn_ has joined #ruby
IPGlider has joined #ruby
DDAZZA has joined #ruby
wmoxam has joined #ruby
shadoi has joined #ruby
frontendloader has quit ["Leaving"]
jchauncey has joined #ruby
ken_barber has joined #ruby
mattyoho has joined #ruby
Advocation has joined #ruby
SQLStud has joined #ruby
jimeh has joined #ruby
A67a3150e has joined #ruby
SQLStud has joined #ruby
looopy has joined #ruby
tvw has joined #ruby
micha_ has joined #ruby
fungoat_ has joined #ruby
<jaysern> I'm getting a [BUG] Bus Error when I do a bundle install on my OS X 10.5 machine. Any suggestions? /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:799: [BUG] Bus Error
becom33 has joined #ruby
fungoat_ has joined #ruby
snip_it has joined #ruby
lampe2 has joined #ruby
jergason has joined #ruby
<shadoi> rvm install 1.9.3 --with-gcc=gcc-4.2
SQLStud has joined #ruby
<shadoi> jaysern: ^^
<shadoi> you'll probably need to use homebrew to install it
<shadoi> (gcc 4.2 that is)
kvirani has joined #ruby
mdw has joined #ruby
<lampe2> hey i wanne save meta tags in a a db and a refrence to a file on the file system and a reference to a parent file oder to child files is there mongodb a good database for ?
fungoat_ has joined #ruby
A50352cf2 has joined #ruby
<jaysern> shadoi: doing that now. sudo rvm reinstall 1.9.3 --with-gcc=gcc-4.2
savage-_ has joined #ruby
francisfish has joined #ruby
DDAZZA has joined #ruby
bwlang has joined #ruby
timonv has joined #ruby
mattyoho has joined #ruby
stephenjudkins has joined #ruby
<shadoi> lampe2: any database will work fine for that.
<shadoi> lampe2: you need more requirements to narrow it down.
<lampe2> shadoi, okay it should be a noSQL db and the thing is that hmm how to explain it
Careott has joined #ruby
n3m has joined #ruby
<lampe2> shadoi, there is like a wrapper object with the meta data and the things in the object should have meta tags too
<shadoi> lampe2: why noSQL? What's the need that makes that a requirement?
<lampe2> shadoi, this is not my requirement
bawer has joined #ruby
<jaysern> shadoi: darn, it choked. Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension........ Make sure that `gem install libarchive -v '0.1.2'` succeeds before bundling.
<shadoi> jaysern: if you read the error it gives you a clue why…. archive.h not found.
KL-7 has joined #ruby
Axsuul has joined #ruby
<shadoi> lampe2: I would never recommend mongodb, but it will likely work fine for you.
<lampe2> okay shadoi what would you recommend ? if it could be a SQL db ?
sabooky has joined #ruby
<jaysern> shadoi: i'm sorry, but how do i proceed when it can't find archive.h ?
<shadoi> I'd start with Sequel and sqlite3, if that won't cut it, move to mysql or postgresql, if you really can't use SQL cleanly, then go for redis.
<shadoi> jaysern: install the system dependency that provides it (I don't know what that is, I've never installed that gem)
td123 has joined #ruby
<lampe2> shadoi, i was going to use postgresql because we need to use multiserver db so that the server can sync or speak with other servers
<jaysern> do you know about libarchive? that's when i get the error. sudo gem install libarchive -v '0.1.2'
<shadoi> jaysern: homebrew says libarchive is installed by default, do you have Xcode installed?
<jaysern> i'm on os x 10.5, using xcode 3.1.4
<shadoi> lampe2: postgresql is a good choice (it also has a new K/V store option)
<shadoi> jaysern: no idea, sorry.
<lampe2> shadoi, i must find some clever arguments for postgresql ;)
shinobi_one has joined #ruby
<shadoi> lampe2: I have a feeling your problems stem from the fact that you have to come up with clever arguments for it.
apok has joined #ruby
shinobi_one has joined #ruby
jergason has joined #ruby
<lampe2> shadoi, i wanted it the easy way. just store it in a big DB but then the others in the team wanted NoSQL ...
peterhil has joined #ruby
<lampe2> cause its fancy and new and .....
<shadoi> ask them why.
<shadoi> get real reasons.
<jaysern> lampe2: thanks - i will install this
<shadoi> lampe2: it really depends on the data, if it will be relational at all, then relational databases make good sense.
<shadoi> If it will always be single-document data, then a k/v simplifies things a lot.
<shadoi> lampe2: if they just want to try something cool and new out, use kyotocabinet + kyototycoon
<lampe2> the thing is every object in a document should have some meta tages.... example: you got a text document(object with reference to the sub objects) this contains 1 text(more meta tags and more sub objects) and 1 picture(more meta tags and more sub objects) and now lets say the text hase chapter 1 to 4 so this are all objects and so one i hope you get it ?
<jaysern> lampe2: i can't gem install libarchive-ruby. checking for main() in -larchive... *** extconf.rb failed *** /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)You have to install development tools first.
<shadoi> lampe2: would the sub-objects ever be shared between documents?
<lampe2> yes shadoi this is the clue
<shadoi> jayne: 10.5 may just not be compatible.
<shadoi> jaysern: ^^
<lampe2> jaysern, You have to install development tools first
<shadoi> lampe2: if so, you want a relational DB, or at least something with linking semantics (Riak does this)
<jaysern> sorry for the noob question .. what development tools?
<lampe2> jaysern, in the rake file is this: s.required_ruby_version = ">=1.8.7"
skrewler has joined #ruby
<shadoi> jaysern: Xcode has the development tools, but it sounds like they are too old for 1.9.3
<shadoi> jaysern: there are tons of people reporting issues on stackoverflow for 1.9.3 on 10.5
jonathanwallace has joined #ruby
<lampe2> shadoi, linking semeantics with riak ?
<shadoi> lampe2: Riak has support for linking documents builtin
<lampe2> oh thats cool
<lampe2> thats a real good argument
ringotwo has joined #ruby
<jaysern> so there's no way to basically install ruby 1.9.3 on 10.5 ?
<shadoi> The only downside to Riak is that if you need advanced customization, you have to learn Erlang.
QKO has joined #ruby
<jaysern> i'm doing a search on my machine, i see 2 archive.h's: /Developer/SDKs/MacOSX10.5.sdk/usr/include/wx-2.8/wx/archive.h and /opt/local/include/archive.h
<shadoi> jaysern: I'm sure it's possible, but you need to fight with it, and go through all those stackoverflow pages to find solutions.
<lampe2> urgh osx...
<shadoi> jaysern: add /opt/local/include to your compile options (use -I)
<lampe2> hmm i will give riak a try thx shadoi
justinmcp has joined #ruby
<shadoi> lampe2: Riak can handle large/binary files as well (it has a separate storage back-end for it)
<jaysern> so use --with-gcc=clang (not gcc-4.2 ?)
<shadoi> jaysern: looks like some have made it work. I don't know.
<jaysern> k
<lampe2> jaysern, i dont know :) iam useing a linux machine ;)
<shevy> \o/
ephemerian has joined #ruby
<lampe2> o/ \o\o
savage-_ has joined #ruby
demian`_ has joined #ruby
frogstarr78 has joined #ruby
<shevy> long live the RubyOS!
<shadoi> -_-
<lampe2> whats the rubyos ? o0
savage- has joined #ruby
<lampe2> shadoi, are there good db driver for ruby out ? i just found ripple
<shadoi> lampe2: that's the one. It's written by a Basho employee, so I'd trust it.
bbttxu has joined #ruby
dfamorato has joined #ruby
<lampe2> kk thx shadoi
emmanuelux has joined #ruby
SQLStud has joined #ruby
jonathanwallace has joined #ruby
emmanuelux has joined #ruby
<lampe2> its getting better :) padrino with haml sass jquerry and ripple :)
Boohbah has joined #ruby
BrokenCog has joined #ruby
<shevy> lampe2 a new OS based on as much ruby as is possible
<lampe2> what do you prefer cucumber or rspec ?
jonatha__ has joined #ruby
<lampe2> okay shevy funny ^^
<lampe2> something like kidsruby?
Squarism has joined #ruby
<shevy> kidsruby?
<shevy> kids write in java man
<lampe2> its a funny project: http://kidsruby.com/
_john has joined #ruby
<shevy> ewwww
<shevy> teletubby in ruby :(
Sailias has joined #ruby
<burgestrand> lampe2: cucumber and rspec are not exclusive, you can use both together
zyzz has joined #ruby
<lampe2> burgestrand, yeah i know
<zyzz> hey
<lampe2> burgestrand, but to keep it simple ;)
catphish has joined #ruby
<any-key> I thought the "KISS" principal was "Keep It Sleazy, Stupid"
havenn has joined #ruby
jonathanwallace has joined #ruby
<catphish> i realise this is a little offtopic but does anyone know if a request can be prematurely ended by a before filter in sinatra for authentication?
<aszurom> if they dropped the Kids off kidsruby and maybe called it N00bR00b it would be applicable to me
<lampe2> its funy iam debuging a project that is writen in java and the coder codet like a c++ coder so the code is realy bullshit :D
chad_ has joined #ruby
<burgestrand> catphish: yes, use halt
<catphish> burgestrand: thanks! spent ages trying to work that out, should have rtfm in full
Corren has joined #ruby
<burgestrand> catphish: the sinatra README is good to read once you skip the boring wall of different templating options :)
<catphish> well i read the filters sestion several times, but no reference to halt :)
cloke_ has joined #ruby
yeggeps has joined #ruby
zakwilson has joined #ruby
davidw has joined #ruby
atmosx has joined #ruby
<catphish> thanks again :)
Jakee` has joined #ruby
<zyzz> i'm a newb but i started visual baisc two weeks ago
<zyzz> i am trying to learn thru youtube
<lampe2> zyzz, ???? but this is ruby ?
francisfish has joined #ruby
<_john> anyone work with DM? #datamapper is a bit quiet
sayakb has joined #ruby
<lampe2> _john, just ask your question...
Bofu2U has joined #ruby
<_john> https://gist.github.com/2416154 stack overflow on User.create in rails console
chad_ has joined #ruby
C0deMaver1ck has quit ["Leaving..."]
<zyzz> is ruby similar to vb
<_john> no
<lampe2> zyzz, ruby is ruby and vb is vb :)
<_john> i don't see any nested references to self or anything, but then again i'm not familiar with the associations yet
<lampe2> have you tryed it without the "has n" ?
<shadoi> _john: very likely that "relationships" is a name/class used by DM
jonatha__ has joined #ruby
headius has joined #ruby
<_john> lampe2: looks like i duck-punched myself in the face, changing "relationship" to "friendship" worked
<zyzz> they have tutorials on youtube
MrGando has joined #ruby
<zyzz> same projects just different
<lampe2> _john yeah the this looks better ;)
<_john> missed that one..
zakwilson has joined #ruby
<lampe2> zyzz, ruby is diffrent from VB yes :)
<lampe2> _john, i like the new name better :D "friendship" haha
jeebster1 has joined #ruby
<lampe2> and zyzz with just whatching youtube you cant learn any language ;) read a book and code ;)
pangur has joined #ruby
<lampe2> and zyzz look at code from strangers LEARN TO READ THE SOURCE LUKE ;)
jonathanwallace has joined #ruby
<pangur> [2012-04-18 21:12:05] WARN TCPServer Error: Address already in use - bind(2)
<pangur> /home/calum/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/webrick/utils.rb:85:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE) I have tried ps aux | grep webrick. Any suggestions for how to recover the address in use, please?
<lampe2> pangur, OS ?
<pangur> ubuntu
<lampe2> i see ps aux :D
<lampe2> and with | grep ruby ?
<pangur> thanks lampe2 - that was it :)
<pangur> Thanks very much!
<lampe2> no problem pangur
jonatha__ has joined #ruby
<lampe2> good night good fight to you all !
<pangur> goodnight
SQLStud has joined #ruby
poincare101 has joined #ruby
s0ber has joined #ruby
ctwiz has joined #ruby
cbuxton has joined #ruby
davidw has joined #ruby
bpg has joined #ruby
eywu has joined #ruby
Azure|netbook has joined #ruby
Sailias has joined #ruby
kaiwren has joined #ruby
SQLStud has joined #ruby
SQLStud has joined #ruby
sabooky has joined #ruby
SQLStud has joined #ruby
netrealm has joined #ruby
rondale_sc has joined #ruby
krusty_ar has joined #ruby
n8ji has joined #ruby
apeiros_ has joined #ruby
cloke has joined #ruby
yoklov has joined #ruby
<dbgster> when you require a file, but never use the methods, is it lazy loaded?
<oooPaul> Not if you specifically require it, AFAIK.
<oooPaul> The file has to be parsed to know what methods/classes/modules it defines.
atmosx has joined #ruby
robbyoconnor has joined #ruby
mengu has joined #ruby
jonathanwallace has joined #ruby
<dbgster> oooPaul: ok good to know thanks
jax_ has joined #ruby
<oooPaul> One way to show that is to stick the line 'puts "I'm in you."' into a file you require, and see that it gets output at the point of the require.
<oooPaul> There are ways to lazy-load things -- Rails has done that by monkeypatching some of the "constant not found" code so that it goes looking for a file named similarly to the constant, requires it at that point, then retries.
<oooPaul> But that's not a Ruby standard.
<apeiros_> Module#const_missing
<oooPaul> That's the one.
<apeiros_> also there's autoload
<apeiros_> but both are bad practices
<oooPaul> Meh.
<oooPaul> :)
<jax_> new ruby dev on os x: textmate, netbeans, or rubymine?
<oooPaul> vim
<apeiros_> bbedit!
<jax_> i can use vim too but i'd rather have something that helps me out a little
<oooPaul> Textmate, then.
<apeiros_> rubymine or sublime then
<apeiros_> rubymine helps a lot, but it's slow as molasses…
<oooPaul> Depends on your definition of "helps me out a little". I turn syntax highlighting on in vim and that helps me all I need. ;)
<josefig> jax_, TextMate or Sublime, just remember no more than 80 columns and you're safe ;)
<lectrick> Sublime Text 2 is so fucking awesome. Someone finally out-Textmated Textmate.
<lectrick> jax_: ^
<jax_> thank you.
<jax_> :)
zakwilson_ has joined #ruby
ken_barber has joined #ruby
<lectrick> jax_: Run, do not walk, to http://www.sublimetext.com/
<jax_> thank you Sirs
brianpWins has joined #ruby
<jax_> hey, sublimetext looks snazzy
<lectrick> trust me, it is
<dbgster> i'm in my Rakefile, and there is a subfolder named 'ar' that has a file named 'models', how can I require it?
queenlua has joined #ruby
<dbgster> i tried: require 'ar/models'
<dbgster> says no such file
<lectrick> it's somehow both nerdier and more textmate-y than textmate itself... it will even use textmate bundles as-is
<jimeh> dbgster: Ruby 1.9.x I assume?
<dbgster> 1.9.3-p0
friskd has joined #ruby
<dbgster> but my server might be 1.8.7
<jimeh> yeah, pre-1.9 the current path was automatically added to Ruby's load path, so with 1.9 you'll have to add this to the top of the Rakefile:
<jimeh> $LOAD_PATH.unshift File.expand_path('..', __FILE__)
nobitanobi has quit [#ruby]
<dbgster> jimeh: so is that compatible with both versions?
<jimeh> should work, I haven't had that issue with a Rakefile specifically, but I'd imagine it works like regular Ruby files :)
philcrissman has joined #ruby
<jimeh> yeah, it won't effect 1.8.x :)
Gonzih has joined #ruby
<jimeh> however, if your server is running 1.8.7, you should really be running that locally too...
yannis has joined #ruby
<dbgster> jimeh: seems to have worked. so what does it do? (besides format my c dirve)
SphericalCow has joined #ruby
<dbgster> jimeh: its a test box, hope to update it
atmosx has joined #ruby
<zyzz> is there a way to search channels list
artm has joined #ruby
lewis has joined #ruby
Ethan has joined #ruby
shruggar has joined #ruby
<zyzz> i wanna find a visual basic channel
<jimeh> dbgster: $LOAD_PATH is an array of paths/folders that Ruby looks through whenever you call `require`, that code adds the directory the current file (the Rakefile) is in to the beginning of that array
jonathanwallace has joined #ruby
stephenjudkins has joined #ruby
tatsuya_o has joined #ruby
Squarepy has joined #ruby
<apeiros_> jimeh: actually what was added to $LOAD_PATH in 1.8 was '.', which is not the same as $LOAD_PATH.unshift File.expand_path('..', __FILE__)
zyzz has joined #ruby
Squarepy has joined #ruby
<jimeh> apeiros_: true, bad wording on my behalf :)
<jimeh> with "current path" I meant the directory you're cd'd into, which is "." :)
rondale_sc has joined #ruby
turdbiscuit has joined #ruby
<turdbiscuit> hi
rondale_sc has quit [#ruby]
flagg0204 has joined #ruby
rondale_sc has joined #ruby
turdbiscuit has quit [#ruby]
looopy has joined #ruby
ChampS666 has joined #ruby
maesbn has joined #ruby
_class_ has joined #ruby
jonathanwallace has joined #ruby
matt312 has joined #ruby
havenn has joined #ruby
pangur has joined #ruby
asobrasil has quit [#ruby]
MrGando has joined #ruby
<pangur> Where should I ask questions about setting up aptana to let me see ruby 1.9.3 output to browser?
rondale_sc has quit [#ruby]
<oooPaul> Not sure I grok what you mean by "ruby output to browser"?
<pangur> Basically, rather than have to http://localhost:9292 in an external browser, I want to be able to do it in an aptana window.
<pangur> Currently, the default that I have it set up to is python, in which I also dabble.
gilead_ has joined #ruby
<pangur> Normally, I just press a run button and I can see console output and browser output.
<oooPaul> No clue. Is this a Rails app?
<pangur> No, it is a sinatra app
<pangur> Maybe I should ask there.
Jakee` has joined #ruby
<pangur> Aptana does not seem to have a freenode room
<pangur> Eclipse has not responded - although I think that maybe if I had not mentioned aptana, the eclispe answer would have done :)
libertyprime has joined #ruby
fr0gprince_mac has joined #ruby
nif has joined #ruby
gilead has joined #ruby
<oooPaul> pangur: Yeah, sorry, I'm Rails & vim. ;)
<pangur> That's ok, oooPaul - that fact that somebody actually spoke to me is encouraging in itself :)
<oooPaul> :D
libertyp1ime has joined #ruby
savage- has joined #ruby
Vert has joined #ruby
_class_ has joined #ruby
tommyvyo has joined #ruby
Mohan has joined #ruby
Mohan has joined #ruby
Gonzih has joined #ruby
elliot98 has joined #ruby
SphericalCow has joined #ruby
SphericalCow has joined #ruby
scwh has joined #ruby
jonathanwallace has joined #ruby
<arturaz> ConcurrencyError: Detected invalid hash contents due to unsynchronized modifications with concurrent users
<arturaz> org/jruby/RubyHash.java:1356:in `keys'
<arturaz> /home/spacegame/nebula-server/20120417134816/vendor/bundle/jruby/1.9/gems/activerecord-3.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `release'
<arturaz> this is always fun :(
<headius> indeed
<headius> it's not our fault though! :)
<headius> bad code is bad code
<lectrick> Is there an encoding (denser than base64) that uses the entire ASCII character set other than special characters?
bwlang has joined #ruby
<arturaz> headius, I should probably report a bug to AR team, right? :)
<headius> arturaz: indeed you should
<headius> there are a few possible ways JRuby could be at fault, but generally such errors are bad concurrent code
luckyruby has joined #ruby
<arturaz> the code is interesting though
<arturaz> its in monitor
<headius> ruby code
jgrevich_ has joined #ruby
jgrevich_ has joined #ruby
<headius> I don't have that version of AR handy
<headius> one problem folks have with concurrency is that you almost always have to mutex both reads *and* writes
<headius> rails might only mutex writes
Gonzih has joined #ruby
friskd has joined #ruby
Gonzih has joined #ruby
pangur has joined #ruby
<pangur> oooPaul, got my aptana browser going - thanks for being interested in helping.
<oooPaul> Woot. :)
adeponte has joined #ruby
<pangur> It turns out to be a rails app after all even though I have it running on what looks like a sinatra configuration.
fridim_ has joined #ruby
eywu has joined #ruby
lorandi has joined #ruby
<pangur> Hence the 9292
<pangur> Anyway, all is working.
<oooPaul> Huzzah!
btaitelb has joined #ruby
TheIronWolf has joined #ruby
demian`_ has joined #ruby
gglitch has joined #ruby
gglitch has quit [#ruby]
<headius> arturaz: that could be a JRuby problem
<headius> in the past our bad-concurrency detection caught too many errors, but I thought I'd fixed that
<headius> there could be remaining cases
<arturaz> Was any of those fixed in 1.6.6 -> 1.6.7?
<arturaz> We're still using 1.6.6
<headius> I don't think so
<headius> you can pass -Xbacktrace.style=raw to get a full Java backtrace
<arturaz> JRUBY_OPTS?
<headius> yeah
viaov has joined #ruby
viaov has quit [#ruby]
MrGando has joined #ruby
<arturaz> ok, lets try that next time server crashes :)
<arturaz> headius, will that still include ruby backtrace?
<headius> it will not unless the ruby code has compiled
<headius> which you can force with -X+C
<headius> we have the ruby trace though
<arturaz> yeah, but if my other code crashes it would be nice to know where the problem is :)
ZachBeta has joined #ruby
<luckyruby> Trying to write a ruby tcp server using socket lib. Can someone show me how to read from a client until buffered data contains the string "foo"?
<arturaz> headius, -X+C shouldn't break anything, right?
Careott has joined #ruby
<Boohbah> can anyone recommend a good indenter/formatter/beautifier?
<headius> arturaz: ideally not :)
<arturaz> headius, btw, can I catch java exceptions?
<arturaz> like rescue Java::java.lang.NullPointerException
<headius> it should work
<arturaz> headius, will -X+C up my ram usage?
pastjean has joined #ruby
Ethan has joined #ruby
Ethan has joined #ruby
<headius> probably your base usage, yeah
banisterfiend has joined #ruby
<headius> but I don't know how much
seitensei has joined #ruby
<arturaz> ok, lets try that
<arturaz> *hopes it works*
KL-7 has joined #ruby
<arturaz> I should probably rewrite EM part to netty tommorow...
<arturaz> celluloid-io is unusable due to fact that Fibers are threads on JRuby.
Floydzy has joined #ruby
libertyprime has joined #ruby
<arturaz> headius, [2012-04-19 01:11:33.005|worker-world_0|worker-world_0|error] <callback-73018: spawn on SsObject (7784) @ 2012-04-19 01:11:32 (ruleset: default)> failed: Exception: wrong number of arguments (1 for 2) (ArgumentError)
<arturaz> seems that breaks stuff
<arturaz> or wait, perhaps its my stuff
<headius> hmm
piotr_ has joined #ruby
mborromeo has joined #ruby
ken_barber has joined #ruby
Careott has joined #ruby
sabooky has joined #ruby
<arturaz> i hate it when I'm not sure what breaks what anymore :(
<arturaz> but it seems
td123 has joined #ruby
<arturaz> ok, i'm not sure
<arturaz> but somehow it breaks error raising :(
mattyoho has joined #ruby
<arturaz> lets try it again
<arturaz> hm, its working fine now
<arturaz> perhaps its my bug
<arturaz> anyway, headius, if I encounter that AR crash, i'll ping you on jira
<headius> ok
<headius> I need to sign off now
<headius> talks tomorrow
<arturaz> busy times
<arturaz> need more cloning
carlyle has joined #ruby
Careott has joined #ruby
Ethan2 has joined #ruby
zakwilson has joined #ruby
jeebster1 has quit [#ruby]
Apocalypse has joined #ruby
Apocalypse has joined #ruby
dfamorato has joined #ruby
Bosma has joined #ruby
baroquebobcat has joined #ruby
zakwilson_ has joined #ruby
jonathanwallace has joined #ruby
queenlua has joined #ruby
friskd has joined #ruby
friskd has joined #ruby
Squarism has joined #ruby
liluo has joined #ruby
two- has joined #ruby
carloshpf has joined #ruby
Ethan2 has joined #ruby
brngardner has joined #ruby
<eph3meral> are there any decent UIs for interactive/step-through debugging in ruby 1.9?
<gogiel> eph3meral: rubymine
<eph3meral> gogiel, k thanks I'll look in to it
justinmcp has joined #ruby
<eph3meral> gogiel, hmm... anything free?
dankest has joined #ruby
<eph3meral> gogiel, they do have a free trial, etc, but there's way more in there than I need - I don't need or want an IDE
<eph3meral> just a UI for step through debugging
<eph3meral> a variables panel, a breakpoints panel, a stack panel, and that's about it
<eph3meral> btw, is ruby-debug19 still totally fucked on 1.9.3?
BSaboia has joined #ruby
netrealm has joined #ruby
wolfgangw has joined #ruby
zakwilson has joined #ruby
mikeg has joined #ruby
shobhitg has joined #ruby
TheIronWolf has joined #ruby
shobhitg has joined #ruby
carlyle has joined #ruby
<eph3meral> omg, railscasts is charging money now?
<eph3meral> what a douche
<luckyruby> eph3meral: ?
<luckyruby> the cost is pretty reasonable for what you get
<davidcelis> eph3meral: you serious?
<eph3meral> what you get is shit
<eph3meral> so, no it's not very reasonable
<eph3meral> it just so happens he has a *single* item that could potentially be useful to me
<davidcelis> he still has casts that are free
<eph3meral> i can't stand video casts... ascii casts are aight
<eph3meral> davidcelis, the original ascii cast for ruby-debug is gone
<eph3meral> and the ascii-cast for pro also costs $$$
<eph3meral> anyway, this isn't a rails channel so it doesn't matter, but still
<davidcelis> so fork over the money or stop bitching
<davidcelis> not that hard
mailtruck_ has joined #ruby
MrGando has joined #ruby
<eph3meral> nah, I'll do neither, but thanks for the suggestion
fbernier has joined #ruby
keymone has joined #ruby
SQLStud has joined #ruby
<lectrick> If I can do File.read(filepath,data) and ensure it's closed, why can't I do File.write(filepath, data) ?
zakwilson has joined #ruby
brngardner has joined #ruby
<lectrick> Oh, greeeat... http://bugs.ruby-lang.org/issues/1081
SQLStud has joined #ruby
<oooPaul> I would never do File.read() anyway.
<lectrick> That is certainly a bizarre omission considering there is a File.read
<lectrick> Why not? That's the most often used case. Slurp up a file and close it
<oooPaul> Yeah, but it's not obvious from the syntax that the file handle is actually released.
<oooPaul> Shouldn't it be "data = File.read(filepath)" anyway?
sroy2 has joined #ruby
jeedey_ has joined #ruby
zigidias has joined #ruby
<oooPaul> Looks like they finally added it in 1.9.3...
brngardner has joined #ruby
CoverSli1e has joined #ruby
<banisterfiend> lectrick: it was written by a 14 year old ;)
jlogsdon_ has joined #ruby
<lectrick> For real?
<lectrick> oooPaul: crap. i'm not on 1.9.3 yet.
<banisterfiend> lectrick: shota is 14 yeah
<oooPaul> lectrick: Yeah, scroll down to the bottom of that link you found, they have a patchset that adds it.
michaelmartinez has joined #ruby
grin has joined #ruby
<oooPaul> Okay, I'm outta here. Ciao y'all.
jitesh_shetty has joined #ruby
pu22l3r has joined #ruby
jbpros_ has joined #ruby
eywu has joined #ruby
sayakb_ has joined #ruby
xsdg_ has joined #ruby
akhkharu_ has joined #ruby
srydberg has joined #ruby
starburs1 has joined #ruby
wereHams1er has joined #ruby
mrmist_ has joined #ruby
Muz_ has joined #ruby
MrGando has joined #ruby
mpereira has joined #ruby
stephenjudkins has joined #ruby
libertyprime has joined #ruby
zakwilson_ has joined #ruby
bgupta_ has joined #ruby
krz has joined #ruby
dipnlik has joined #ruby
scwh has joined #ruby
sonkei has joined #ruby
mutewinter has joined #ruby
<rking> I'm brand new to rake, but am making a project that will work well as a sort of task library. Is there an established practice for this kind of thing, or is it simply a matter of making a foo.rb and users will "require 'foo'" from their Rakefile?
xrl has joined #ruby
MetaCosm has joined #ruby
tomzx has joined #ruby
libertyprime has joined #ruby
catphish has joined #ruby
axl_ has joined #ruby
cephalobod has joined #ruby
jmeeuwen has joined #ruby
madhatter has joined #ruby
m_3 has joined #ruby
jshsu has joined #ruby
yeltzooo7 has joined #ruby
ewag has joined #ruby
sj26 has joined #ruby
cinaski has joined #ruby
tdmackey has joined #ruby
danheberden has joined #ruby
benwoody has joined #ruby
rcs has joined #ruby
regedarek has joined #ruby
russfrank has joined #ruby
preller has joined #ruby
brngardner has joined #ruby
stephenjudkins has joined #ruby
carlyle has joined #ruby
jgrevich_ has joined #ruby
jgrevich_ has joined #ruby
nyrb has joined #ruby
Ethan2 has joined #ruby
mitchty has joined #ruby
Cyrus has joined #ruby
M- has joined #ruby
<lectrick> Is there any way to Marshal.dump a complex object and just skip anything that is not serializable?
TheIronWolf has joined #ruby
SolarisBoy1 has joined #ruby
Indian has joined #ruby
grin has joined #ruby
eywu has joined #ruby
netogallo has joined #ruby
zakwilson has joined #ruby
snip_it has joined #ruby