apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p327: http://ruby-lang.org (ruby-2.0.0-preview2) || Paste >3 lines of text on http://gist.github.com
nat2610 has joined #ruby
slainer68 has quit [Remote host closed the connection]
workmad3 has joined #ruby
heftig has joined #ruby
fyolnish has quit [Remote host closed the connection]
egn has joined #ruby
hotovson_ has quit [Remote host closed the connection]
ukd1 has joined #ruby
cousine has quit [Remote host closed the connection]
hotovson has joined #ruby
cakehero has joined #ruby
<ukd1> is there a good way of converting integers to characters? I'm currently using setbyte, but that requires an existing string
cantonic_ has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
elaptics is now known as elaptics`away
cantonic has quit [Read error: Operation timed out]
cantonic_ is now known as cantonic
pen_ has joined #ruby
<gbchaosmaster> ukd1: #to_s
altious has quit [Ping timeout: 250 seconds]
<gbchaosmaster> ukd1: Or, if you meant ASCII values to characters, #chr
mahmoudimus has quit [Quit: Computer has gone to sleep.]
postmodern has joined #ruby
workmad3 has quit [Ping timeout: 276 seconds]
dagnachew has joined #ruby
hotovson has quit [Ping timeout: 240 seconds]
<csmrfx> >> "%02d" % 9
<eval-in> csmrfx: Output: "" (http://eval.in/4445)
<csmrfx> >> p "%02d" % 9
<eval-in> csmrfx: Output: "\"09\"\n" (http://eval.in/4446)
<ukd1> gbchaosmaster, cool - I meant ASCII to chars. I've just tried it and it's outputting unicode. It's probably a good idea, but is there way of getting ASCII?
pencilcheck has quit [Ping timeout: 264 seconds]
DaZ has quit [Ping timeout: 252 seconds]
danneu has joined #ruby
danneu has quit [Client Quit]
JaMesCZs has joined #ruby
Sonmi_001 has quit [Quit: Quitte]
<gbchaosmaster> ukd1: Any particular reason for not wanting Unicode?
<gbchaosmaster> >> 65.chr
<eval-in> gbchaosmaster: Output: "" (http://eval.in/4447)
<gbchaosmaster> >> p 65.chr
<eval-in> gbchaosmaster: Output: "\"A\"\n" (http://eval.in/4448)
cjhanks has joined #ruby
<JaMesCZs> Hello i need help has anyone of you experience with Visual Studio?
<gbchaosmaster> JaMesCZs: Ruby in Visual Studio...?
<havenn> JaMesCZs: This is Ruby.
<JaMesCZs> Oh sorry
<cjhanks> I'm looking for standard documentation guidelines for method/function/class declarations, does such a document exist?
Mon_Ouie has quit [Ping timeout: 240 seconds]
tjbiddle_ has joined #ruby
JaMesCZs has quit [Client Quit]
Mon_Ouie has joined #ruby
<banisterfiend> cjhanks: you mean a style guide?
dawkirst_ has quit [Ping timeout: 255 seconds]
<ukd1> gbchaosmaster, ease of debugging at the moment, will use unicode later :)
dawkirst_2 has joined #ruby
<havenn> cjhanks: Github Ruby Styleguide recommends TomDoc for documentation: http://tomdoc.org/
chrisbolton has quit [Quit: chrisbolton]
<davidcelis> oh wait you meant like generating documentation
<cjhanks> havenn: Thanks, this is standard?
<havenn> cjhanks: No, it isn't standard really. It is slightly on the verbose side but a good doc format.
tjbiddle has quit [Ping timeout: 240 seconds]
<internetishard> I see that you can readline[regex] or readlines[0] - I want to do both. That is, I want to use a regex, but only read the first line - if I do it with just the regex, then I get EOF error
tjbiddle_ is now known as tjbiddle
<havenn> cjhanks: I wouldn't say there is a single standard for documentation for Ruby.
<cjhanks> Ahh, well as long as RubyDev's recognize it easily that's fine with me. It's my first time having to develop Ruby.
joeycarmello has quit [Remote host closed the connection]
<havenn> cjhanks: I think depending on the complexity of the code and aesthetical style, documentation can vary from self-documenting-code to thorough tomdoc style.
DaZ has joined #ruby
davidcelis has quit [Quit: K-Lined.]
<internetishard> csmrfx: so it turns out doing it your way, where I do readline[regex] causes the EOF error while readlines[0] doesn't
<csmrfx> internetishard: I already presented a fix for that
<csmrfx> and, calling that "my way" is giving me, oh about 1000x more credit than I deserve
jim80net has joined #ruby
<csmrfx> internetishard: ignore pasties at your own peril...
<internetishard> sorry for giving you too much credit :P
jim80net has quit [Client Quit]
DrShoggoth has quit [Quit: Leaving]
<csmrfx> also
<csmrfx> like I said
<internetishard> Sorry, I've been killing and booting this VM all day
mrsolo has quit [Quit: Leaving]
davidcelis has joined #ruby
<csmrfx> ri StringIO.readline may be painful, but may also be the only way out of ignorance
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
<internetishard> csmrfx: how do I recover a pastie?
phantasm66 has quit [Quit: *poof*]
<csmrfx> I'm sure the pasties are still there
havenn has quit [Ping timeout: 246 seconds]
dawkirst_ has joined #ruby
dawkirst_2 has quit [Ping timeout: 250 seconds]
foxtrot101 has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
<internetishard> csmrfx: can I just do an 'OK' after |fn| so that "OK" is printed next to every file?
<internetishard> or is that the wrong syntax in ruby
<csmrfx> you want to output that?
foxtrot101 has joined #ruby
<csmrfx> I think, you also need to read ri Array.select
apok_ has joined #ruby
<epwhorl> teleglitch sort of reminds me of Take No Prisoners!
<internetishard> wouldn't it go right here on the first line: puts Dir["**/*"].select{ |fn| << "OK"
<epwhorl> sorry, wrong window
<csmrfx> Optimal solution would be puts "Ok files are:/n" + Dir["*"]....
<internetishard> I'm using Dir["**/*"] btw
<csmrfx> not sure what adding << "OK" there would do
<csmrfx> syntax error, unexpected tLSHFT
jenrzzz has quit [Ping timeout: 276 seconds]
rellin has quit [Ping timeout: 256 seconds]
<internetishard> Yep, I discovered that... Was reading about how to append a string, but it doesn't work that way I assumed
nga4 has quit [Ping timeout: 252 seconds]
mvangala_ has quit [Remote host closed the connection]
<internetishard> csmrfx: I changed the first line to: puts "OK files are:/n" + Dir["**/*"].select{ |fn| and that gives a syntax error too
apok has quit [Ping timeout: 252 seconds]
apok_ is now known as apok
ukd1 has quit [Quit: leaving]
<csmrfx> yeah
miso1337 has joined #ruby
<csmrfx> what does that Dir+select return?
nga4 has joined #ruby
<csmrfx> certainly not a string obj
freakazoid0223 has quit [Quit: Leaving]
<csmrfx> wait what?
<csmrfx> syntax error?
slash_nick has quit [Quit: leaving]
jonathanwallace has joined #ruby
<internetishard> yes
<internetishard> Above I pasted what I changed the first line to
<csmrfx> you have a typo
dukedave has quit [Quit: Leaving.]
<csmrfx> that slash should be leftwards/backslash
mvangala has joined #ruby
<csmrfx> then you are ready for the "correct error"
<internetishard> hehe, you put a forward slash
<csmrfx> haa haa, this is the internet, the recipient has all the responsibility for everything!
<internetishard> convert array to string is the real error?
<csmrfx> TypeError yes
<internetishard> you're trying to tell me I need to use Array.
<csmrfx> more like ri Array.join
thone has joined #ruby
<internetishard> Does that go right after puts?
havenn has joined #ruby
<csmrfx> Well, consider, which expression there returns the problematic Array-instance
foxtrot101 has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
thone_ has quit [Ping timeout: 240 seconds]
<internetishard> csmrfx: self.join is how I see people doing it, I don't see any array.join ones
ephemerian has quit [Quit: Leaving.]
<csmrfx> you could also to_s but the output doesn't look as cool as join("\n") does
bradleyprice has quit [Remote host closed the connection]
<internetishard> Dir["**/*"].select{ |fn| to_s join("\n")
<internetishard> yeah csmrfx: I still don't really get where things go in ruby
tjbiddle_ has joined #ruby
<internetishard> {should start the function} before that Dir is just listing all the files
<internetishard> csmrfx: But Dir isn't a loop, so it's not like I can put stuff 'inside of it'... right?
binaryplease has quit [Ping timeout: 240 seconds]
<csmrfx> internetishard: ok, rewind. 1) Whats Dir[] return? (hint: ri Dir.[])
DaZ has quit [Disconnected by services]
<csmrfx> you can easily test that in irb
tjbiddle has quit [Ping timeout: 240 seconds]
tjbiddle_ is now known as tjbiddle
DaZ has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
dagnachew has quit [Quit: Leaving]
wchun has quit [Ping timeout: 246 seconds]
<internetishard> csmrfx: so if I do irb Dir["*"] I get: No such file or directory - Dir[*]
invisime has quit [Quit: Leaving.]
scruple has joined #ruby
jon_than_ has quit [Ping timeout: 264 seconds]
<csmrfx> internetishard: you go into irb?
<reppard> .
<csmrfx> type only "irb<enter>"
<csmrfx> then try again
fyolnish has joined #ruby
<internetishard> ok, I see what you're saying, test them out individualy in irb
<reppard> >> array = [4,5,6]; hash = Hash[array.map.with_index{|*x| x}]; p hash
<eval-in> reppard: Output: "{4=>0, 5=>1, 6=>2}\n" (http://eval.in/4449)
joshman_ has joined #ruby
<reppard> anyone know how to reverse that so the index is the hash key?
jon_than_ has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
ttt has joined #ruby
<csmrfx> internetishard: no, I am saying test what type of object Dir["*"] returns in irb
jslowe has quit [Ping timeout: 260 seconds]
<csmrfx> or "*/**" if you are patient
icole has quit [Remote host closed the connection]
<reactormonk> reppard, there's hash.reverse or simply x.reverse inside the block
<reactormonk> >> array = [4,5,6]; Hash[array.map.with_index{|*x| x.reverse}]
<eval-in> reactormonk: Output: "" (http://eval.in/4450)
<reactormonk> >> array = [4,5,6]; p Hash[array.map.with_index{|*x| x.reverse}]
<eval-in> reactormonk: Output: "{0=>4, 1=>5, 2=>6}\n" (http://eval.in/4451)
mercwithamouth has quit [Ping timeout: 250 seconds]
freeayu has joined #ruby
<reppard> badass thanks reactormonk
<reactormonk> reppard, maybe more like
ttt has quit [Ping timeout: 276 seconds]
<reactormonk> >> array = [4,5,6]; p Hash[array.map.with_index{|(index,x)| [x, index]}]
<eval-in> reactormonk: Output: "{nil=>6}\n" (http://eval.in/4452)
jonathanwallace has quit [Ping timeout: 276 seconds]
<reactormonk> ... huh?
<reactormonk> >> array = [4,5,6]; p Hash[array.map.with_index{|index,x| [x, index]}]
<eval-in> reactormonk: Output: "{0=>4, 1=>5, 2=>6}\n" (http://eval.in/4453)
<reactormonk> there we go
TitaniumStudioUs has quit [Quit: This computer has gone to sleep]
Jasko has joined #ruby
<reppard> that works too, the reverse in block works as well
<reactormonk> reppard, nah, that's just magic. you don't want to make your code look like magic if possible
yshh has joined #ruby
TitaniumStudioUs has joined #ruby
<reppard> haha indeed i was about to add that index,x is more readable
<reactormonk> >> array = [4,5,6]; p Hash[array.map.with_index];
<eval-in> reactormonk: Output: "/tmp/execpad-f52802091c01/source-f52802091c01:1:in `[]': odd number of arguments for Hash (ArgumentError)\n\tfrom /tmp/execpad-f52802091c01/source-f52802091c01:1:in `<main>'\n" (http://eval.in/4454)
<reactormonk> >> array = [4,5,6]; p Hash[*array.map.with_index];
<eval-in> reactormonk: Output: "/tmp/execpad-d9f9219d80c4/source-d9f9219d80c4:1:in `[]': odd number of arguments for Hash (ArgumentError)\n\tfrom /tmp/execpad-d9f9219d80c4/source-d9f9219d80c4:1:in `<main>'\n" (http://eval.in/4455)
nwertman has quit [Ping timeout: 276 seconds]
cascalheira has quit [Quit: Linkinus - http://linkinus.com]
<reactormonk> >> array = [4,5,6]; p Hash[array.map.with_index.to_a];
<eval-in> reactormonk: Output: "{4=>0, 5=>1, 6=>2}\n" (http://eval.in/4456)
<reactormonk> reppard, btw ^
havenn_ has joined #ruby
<internetishard> csmrfx: it's an array, so I'm trying to figure out how to append a string to each var in an array
<csmrfx> nooo
lolcathost has joined #ruby
<csmrfx> well, of course you could
_veer has joined #ruby
_veer has quit [Changing host]
_veer has joined #ruby
<csmrfx> but first there is select
pen_ has quit [Remote host closed the connection]
<csmrfx> the point here was: whats that select return
havenn has quit [Ping timeout: 276 seconds]
joeycarmello has joined #ruby
david` has quit [Quit: Computer has gone to sleep.]
TitaniumStudioUs has quit [Ping timeout: 264 seconds]
<internetishard> csmrfx: all it says different is Enumerator
<csmrfx> ok I will answer that
<csmrfx> the select returns the result array
<csmrfx> its what you're trying to prove here
<csmrfx> TypeError?
<csmrfx> Cause you are essentially doing:
mahmoudimus has joined #ruby
<csmrfx> >> puts "These are OK:\n" + ["file1.txt", "pornlinks.html", "JennaJameson.jpg"]
<eval-in> csmrfx: Output: "/tmp/execpad-e469f65269b4/source-e469f65269b4:1:in `+': can't convert Array into String (TypeError)\n\tfrom /tmp/execpad-e469f65269b4/source-e469f65269b4:1:in `<main>'\n" (http://eval.in/4457)
art_man1 has quit [Quit: art_man1]
<csmrfx> uh oh I mean
vasile has joined #ruby
<csmrfx> >> puts "These are OK:\n" + ["rubytst.rb", "factorial.rb", "run_rails.rb.sh"]
<eval-in> csmrfx: Output: "/tmp/execpad-9bbdd725d069/source-9bbdd725d069:1:in `+': can't convert Array into String (TypeError)\n\tfrom /tmp/execpad-9bbdd725d069/source-9bbdd725d069:1:in `<main>'\n" (http://eval.in/4458)
<csmrfx> soo then just
<csmrfx> >> puts "These are OK:\n" + ["rubytst.rb", "factorial.rb", "run_rails.rb.sh"].join("\n") + "And its all right."
<eval-in> csmrfx: Output: "These are OK:\nrubytst.rb\nfactorial.rb\nrun_rails.rb.shAnd its all right.\n" (http://eval.in/4459)
<hderms> ruby is fantastic
<havenn_> hderms: agreed.
<internetishard> csmrfx: where that array is I'll have Dir["*"]... That's waht I had already
<csmrfx> I give up
<internetishard> csmrfx: so Dir creates that array, so I put .join before select?
<csmrfx> gnight
locriani has quit [Ping timeout: 248 seconds]
<reactormonk> >> p Dir["*"]
<csmrfx> internetishard: havenn_ and reactormonk and reppard can help you
<eval-in> reactormonk: Output: "[\"output-a1ac453d15a8\", \"source-a1ac453d15a8\", \"input-a1ac453d15a8\"]\n" (http://eval.in/4460)
<reactormonk> internetishard, ^
DanBoy has quit [Ping timeout: 252 seconds]
love_color_text has quit [Remote host closed the connection]
locriani has joined #ruby
glyytchy has joined #ruby
ryanf has quit [Quit: leaving]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<internetishard> reactormonk: I'm trying to append a string to an array, so I say "these are good" and output the array
bigmac has joined #ruby
piotr_ has quit [Ping timeout: 260 seconds]
habstinat has joined #ruby
<havenn_> internetishard: array = []; if 'these are good'; array << 'a string'; end #=> ["a string"]
cdt has joined #ruby
mahmoudimus has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
wpaulson has joined #ruby
wpaulson has quit [Client Quit]
pyx has joined #ruby
dmerrick has quit [Quit: dmerrick]
Virunga has quit [Remote host closed the connection]
davidcelis has quit [Quit: K-Lined.]
wmoxam has quit [Read error: Connection reset by peer]
alee has quit [Ping timeout: 276 seconds]
havenn has joined #ruby
tyfighter has quit [Quit: tyfighter]
cdt has quit [Ping timeout: 276 seconds]
internetishard has quit [Ping timeout: 248 seconds]
chimkan has quit [Quit: chimkan]
dawkirst_ has quit [Quit: Nettalk6 - www.ntalk.de]
sarmiena_ has left #ruby [#ruby]
DanBoy has joined #ruby
emmanuelux has quit [Remote host closed the connection]
nerd has quit [Quit: WeeChat 0.3.9.2]
havenn_ has quit [Ping timeout: 246 seconds]
yaymukund has quit [Ping timeout: 252 seconds]
blazes816 has quit [Quit: blazes816]
x82_nicole has quit [Quit: Computer has gone to sleep.]
bradhe has quit [Remote host closed the connection]
s0ber_ has joined #ruby
ader10 has quit [Read error: Operation timed out]
ader10 has joined #ruby
Gm4n has quit [Ping timeout: 255 seconds]
schwap has quit [Ping timeout: 244 seconds]
levicole has quit [Ping timeout: 244 seconds]
thomasfedb has quit [Ping timeout: 244 seconds]
daniel_hinojosa has quit [Ping timeout: 255 seconds]
s0ber has quit [Ping timeout: 252 seconds]
Gm4n has joined #ruby
s0ber_ is now known as s0ber
jianchen has quit [Remote host closed the connection]
thomasfedb has joined #ruby
schwap has joined #ruby
levicole has joined #ruby
robotmay has quit [Remote host closed the connection]
ratcheer has joined #ruby
Guest____ has quit [Quit: Textual IRC Client: www.textualapp.com]
dotnull has joined #ruby
epwhorl has quit [Ping timeout: 250 seconds]
mercwithamouth has joined #ruby
rondale_sc has joined #ruby
phipes has joined #ruby
dotnull has quit [Remote host closed the connection]
hderms has quit [Changing host]
hderms has joined #ruby
gridaphobe has quit [Ping timeout: 265 seconds]
carlyle has quit [Remote host closed the connection]
apok has quit [Remote host closed the connection]
apok has joined #ruby
carlyle has joined #ruby
nari has joined #ruby
fred909_ has joined #ruby
jenrzzz has joined #ruby
`brendan has joined #ruby
squidBits has quit [Quit: squidBits]
fred909 has quit [Ping timeout: 255 seconds]
carlyle has quit [Remote host closed the connection]
nga4 has quit [Ping timeout: 248 seconds]
daniel_- has quit [Ping timeout: 240 seconds]
fred909_ has quit [Ping timeout: 250 seconds]
TitaniumStudioUs has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
generalissimo has joined #ruby
joeycarmello has quit [Remote host closed the connection]
nwertman has joined #ruby
johnmilton has quit [Quit: Leaving]
ttt has joined #ruby
Spaceghost|cloud has joined #ruby
shakesoda has left #ruby [#ruby]
TitaniumStudioUs has quit [Ping timeout: 276 seconds]
daniel_hinojosa has joined #ruby
cj3kim has joined #ruby
ttt has quit [Ping timeout: 276 seconds]
acrocity has quit [Ping timeout: 260 seconds]
zeen has joined #ruby
brax4444 has joined #ruby
acrocity has joined #ruby
Alaude has quit [Quit: Leaving]
ttt has joined #ruby
xrl has joined #ruby
nwertman has quit [Ping timeout: 264 seconds]
TitaniumStudioUs has joined #ruby
davidcelis has joined #ruby
acrocity has quit [Ping timeout: 240 seconds]
gridaphobe has joined #ruby
glyytchy has quit [Quit: glyytchy]
acrocity has joined #ruby
TitaniumStudioUs has quit [Ping timeout: 255 seconds]
cpruitt has quit [Remote host closed the connection]
alexim has quit [Quit: sleep]
krz has joined #ruby
xnm has quit [Read error: Connection reset by peer]
jonahR has quit [Quit: jonahR]
cakehero has joined #ruby
squidBits has joined #ruby
jenrzzz has joined #ruby
AltGrendel has joined #ruby
zarubin has joined #ruby
nat2610 has quit [Quit: Leaving.]
yaymukund has joined #ruby
bradhe has joined #ruby
bigkm has joined #ruby
hsbt has quit [Read error: Connection reset by peer]
hsbt has joined #ruby
bigmac has quit [Ping timeout: 264 seconds]
kenneth has joined #ruby
TitaniumStudioUs has joined #ruby
ttt has quit [Remote host closed the connection]
punkrawkR has quit [Read error: Connection reset by peer]
ttt has joined #ruby
Norrin has quit [Ping timeout: 240 seconds]
wmoxam has joined #ruby
shiin has quit [Quit: Computer has gone to sleep.]
bradhe has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 252 seconds]
<kenneth> hey guys, question about modules
<kenneth> say i want to have some extensions to base classes (monkey-patching) but let the user selectively activate them
<kenneth> no way to do that without ruby 2.0, right?
TitaniumStudioUs has quit [Ping timeout: 240 seconds]
chaosis has joined #ruby
<kenneth> would it be better to just monkey patch the classes i want (Hash and Object) with non-ambiguous names, or provide a model function that takes the object as first argument
<kenneth> a quick example, say i wanted to implement something like map on array, would it be better to have
<kenneth> module Stuff; def map(hash, &fn); …; end; end
banjara has quit [Quit: Leaving.]
bradhe has joined #ruby
rakm has quit [Quit: sleeping]
<kenneth> or should i just monkey patch Array (if it didn't already have map)
alvaro_o has quit [Quit: Ex-Chat]
brianpWins has joined #ruby
<waxjar> if you're going to alter behaviour, definitely don't start monkey patching pls :P
<waxjar> if you're going to add some methods, i don't see why that would be a problem
acrocity has quit [Ping timeout: 250 seconds]
<kenneth> waxjar: adding methods :)
DanBoy_ has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<waxjar> you should keep in mind that it might clash with other libraries bolting on methods with the same name
DanBoy has quit [Ping timeout: 265 seconds]
brianpWins has quit [Client Quit]
c0rn has quit [Quit: Computer has gone to sleep.]
havenn has quit [Remote host closed the connection]
acrocity has joined #ruby
fred909 has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
nga4 has joined #ruby
Norrin has joined #ruby
bigmac has joined #ruby
epwhorl has joined #ruby
noric has joined #ruby
brax4444 has quit [Ping timeout: 255 seconds]
TitaniumStudioUs has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
mneorr has quit [Remote host closed the connection]
<noric> A module Server has a hundred static utility functions. Each function is available as Server::func1, Server::func2. To keep the code clean, the hundred functions are defined in separate files. What's the right way to do this?
<noric> (sorry if I pasted that twice)
lolcathost has quit [Ping timeout: 244 seconds]
jjbohn has joined #ruby
<waxjar> module; def method; …; end; end in each file (make sure to require them all)
<waxjar> i doubt that will make it any cleaner though, i'd rather scroll than constantly open and close files.
ejholmes has quit [Quit: ejholmes]
love_color_text has joined #ruby
DanBoy_ is now known as DanBoy
<noric> I don't like re-opening the module in separate files. What would the files be named?
voodoofish430 has quit [Quit: Leaving.]
TitaniumStudioUs has quit [Ping timeout: 260 seconds]
<noric> Can I declare a group of functions in a separate module, and mix it into Server?
<waxjar> sure
<noric> So, server.rb mixes in server/blue_functions.rb, and Server::BlueFunctions includes twenty blue functions
agarie has joined #ruby
<noric> how to do that? So that BlueFunctions::foo is available as Server::foo
<noric> I don't think extend or include was intended to be used that way
theRoUS has joined #ruby
Hanmac1 has joined #ruby
binaryplease has joined #ruby
segv-_ has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
carlyle has joined #ruby
love_color_text has quit [Ping timeout: 244 seconds]
Hanmac has quit [Ping timeout: 250 seconds]
<waxjar> why not? Server.extend Server::BlueMethods (ruby has no functions :)) works perfectly well :)
segv- has quit [Ping timeout: 260 seconds]
segv-_ is now known as segv-
TitaniumStudioUs has joined #ruby
<noric> waxjar: Ah thanks, I need to review extend/include semantics :)
epwhorl has quit [Ping timeout: 260 seconds]
cj3kim has joined #ruby
carlyle has quit [Ping timeout: 245 seconds]
Gooder has joined #ruby
jackdanger has joined #ruby
TitaniumStudioUs has quit [Ping timeout: 250 seconds]
adeponte has quit [Remote host closed the connection]
jackdanger1 has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
AltGrendel has left #ruby [#ruby]
niklasb has joined #ruby
NiteRain has quit [Ping timeout: 246 seconds]
jackdanger has quit [Ping timeout: 252 seconds]
ratcheer has left #ruby [#ruby]
dukedave has joined #ruby
Goles has joined #ruby
seanstickle has joined #ruby
mjolk has joined #ruby
squidBits has quit [Quit: squidBits]
joeycarmello has joined #ruby
cableray has quit [Quit: cableray]
TitaniumStudioUs has joined #ruby
brax4444 has joined #ruby
cyong has joined #ruby
epwhorl has joined #ruby
Ruler_Of_Heaven_ has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
pipopopo has quit [Ping timeout: 240 seconds]
joeycarmello has quit [Ping timeout: 256 seconds]
jackdanger1 has quit [Quit: Leaving.]
TitaniumStudioUs has quit [Ping timeout: 264 seconds]
Slivka has joined #ruby
xpen has joined #ruby
quest88 has joined #ruby
jjbohn has quit [Quit: Leaving...]
jjbohn has joined #ruby
atal421 has joined #ruby
cdt has joined #ruby
`brendan has quit [Ping timeout: 244 seconds]
rondale_sc has quit [Quit: rondale_sc]
Goles has quit [Ping timeout: 240 seconds]
jjbohn has quit [Quit: Leaving...]
Goles has joined #ruby
daniel_hinojosa has quit [Ping timeout: 240 seconds]
reppard_ has quit [Ping timeout: 244 seconds]
reppard has quit [Ping timeout: 244 seconds]
adeponte has joined #ruby
maletor has joined #ruby
love_color_text has joined #ruby
glyytchy has joined #ruby
glyytchy has quit [Client Quit]
cdt has quit [Ping timeout: 276 seconds]
daniel_hinojosa has joined #ruby
pu22l3r_ has quit [Remote host closed the connection]
marknyc has joined #ruby
TitaniumStudioUs has joined #ruby
tungd has joined #ruby
binaryplease has quit [Quit: WeeChat 0.3.9.2]
TitaniumStudioUs has quit [Client Quit]
tungd has quit [Client Quit]
joshman_ has quit [Quit: Computer has gone to sleep.]
pu22l3r has joined #ruby
mascool has quit [Ping timeout: 252 seconds]
tungd has joined #ruby
agarie has quit [Remote host closed the connection]
seanstickle has quit [Quit: seanstickle]
cj3kim has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
nat2610 has joined #ruby
apok_ has joined #ruby
apok_ has quit [Client Quit]
lol_ has joined #ruby
apok_ has joined #ruby
apok has quit [Ping timeout: 252 seconds]
apok_ is now known as apok
ner0x has quit [Quit: Leaving]
c0rn has joined #ruby
kenneth has quit [Quit: kenneth]
atal421 has quit [Quit: atal421]
mercwithamouth has quit [Quit: leaving]
ckrailo has joined #ruby
mercwithamouth has joined #ruby
ananthakumaran has joined #ruby
apok has quit [Quit: apok]
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
digitalcakestudi has quit [Quit: Leaving.]
fred909 has quit [Ping timeout: 265 seconds]
quest88 has quit [Quit: quest88]
squidBits has joined #ruby
vasile has quit [Ping timeout: 264 seconds]
bradhe has quit [Remote host closed the connection]
Mon_Ouie has quit [Read error: Connection reset by peer]
Mon_Ouie has joined #ruby
lol_ has quit []
taoru has joined #ruby
jobicoppola has joined #ruby
havenn has joined #ruby
rohit has joined #ruby
kenneth has joined #ruby
niklasb has quit [Read error: Operation timed out]
kil0byte has quit [Remote host closed the connection]
Z_Mass has joined #ruby
kil0byte has joined #ruby
malkomalko has joined #ruby
banisterfiend has quit [Ping timeout: 264 seconds]
banisterfiend has joined #ruby
rinfon has joined #ruby
squidBits has quit [Quit: squidBits]
generalissimo has quit [Remote host closed the connection]
kil0byte has quit [Ping timeout: 255 seconds]
jackdanger has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
iamjarvo has joined #ruby
brax4444 has quit [Quit: brax4444]
squidBits has joined #ruby
cj3kim has joined #ruby
x82_nicole has joined #ruby
jobicoppola has quit [Ping timeout: 252 seconds]
adamramadhan has joined #ruby
luckyruby has quit [Remote host closed the connection]
CamonZ_afk has joined #ruby
gridaphobe has quit [Ping timeout: 244 seconds]
CamonZ has quit [Read error: Connection reset by peer]
nga4 has quit [Read error: Connection reset by peer]
paolooo has joined #ruby
Tref has joined #ruby
atal421 has joined #ruby
rellin has joined #ruby
jackdanger has quit [Quit: Leaving.]
tungd has quit [Quit: leaving]
adamramadhan has quit [Ping timeout: 255 seconds]
banisterfiend has quit [Ping timeout: 276 seconds]
philcrissman has quit [Remote host closed the connection]
love_col_ has joined #ruby
banisterfiend has joined #ruby
cableray has joined #ruby
otherj has joined #ruby
thinkclay has joined #ruby
love_col_ has quit [Ping timeout: 265 seconds]
bradhe has joined #ruby
Takehiro has joined #ruby
<otherj> is there an easy way to compare an object parameter against a hash and if it matches use the hashe's value to, say, set the value of a different object?
<epwhorl> that sounds deceivingly simple
<otherj> it's what is probably a bad solution to another problem i have
<otherj> but i think it might work if i can figure out how. haven't really used hashes in ruby though
phipes has quit [Quit: phipes]
<waxjar> by object parameter do you mean instance variables (@variable)?
<otherj> yep
bradhe has quit [Ping timeout: 264 seconds]
<otherj> sorry, sometimes it's hard to remember the correct terms for this
<waxjar> do you mean something like this then: x = 'whatever' if hash.has_key? @variable ?
paolooo has quit [Quit: Page closed]
<otherj> hm. maybe. i'll have to test it
<otherj> oh, ok. that works only if hash only has one value, right?
<waxjar> a Hash has key-value pairs: { 'key' => 'value', 'another_key' => 'value' }
<epwhorl> nope, that searches the entire hash for that key
<otherj> basically i need to have an array with key/value where i have a string and some integer, and when i'm writing a value i need to compare against that array and write the integer value to an order column
<otherj> and the string can be one of like 6 choices
<waxjar> an Array is just a list of objects: [1,2,3,4,5]
daniel_hinojosa has quit [Ping timeout: 264 seconds]
<otherj> yeah, so that's the wrong term
<otherj> hash is what i really mean right?
<epwhorl> yes
<epwhorl> key/value pairs
cdt has joined #ruby
cjhanks has quit [Quit: Leaving]
<otherj> let me try to make some code to better explain what i mean
<otherj> a moment please
ejholmes has joined #ruby
<epwhorl> use pastebin or gist
<otherj> yep
<otherj> just making sure this actully does what i think in irb
zaki has quit [Ping timeout: 255 seconds]
gridaphobe has joined #ruby
DatumDrop has joined #ruby
<otherj> ok, so let's say I have this hash: https://gist.github.com/a1bab440f14981919033
<otherj> if i have an instance variable @event and @event.name = Survey, how can i set @event.position to = 1 ?
squidBits has quit [Quit: squidBits]
squidBits has joined #ruby
<waxjar> @event.position = hash[@event.name]
<otherj> god, is it really so easy?
squidBits has quit [Client Quit]
<waxjar> yep :p
browndawg has joined #ruby
Takehiro has quit [Ping timeout: 240 seconds]
<otherj> i really love ruby when it actually makes sense to me
<otherj> i don't know if this was the best language to try learning to program, but it's neat
<otherj> thanks waxjar
sandGorgon1 has joined #ruby
sandGorgon1 has quit [Remote host closed the connection]
<otherj> but it would really be h[@event.name] right?
<otherj> since this is what i used for that hash?
sandGorgon has joined #ruby
Z_Mass has quit [Quit: WeeChat 0.3.9.2]
<waxjar> ah, yes
uris has quit [Quit: Leaving]
<epwhorl> ducktyping
<havenn> if it quacks like a duck, grill and eat it
<otherj> i've been eating a lot of duck lately
malkomalko has quit [Remote host closed the connection]
Guest18281 has joined #ruby
<otherj> it's v good
tombar has joined #ruby
<epwhorl> if it quacks like a duck that means it floats, and if it floats that means it's a witch, and if it's a witch BURN IT
squidBits has joined #ruby
sandGorgon has quit [Quit: Leaving]
<otherj> ok, this works!
daniel_hinojosa has joined #ruby
<otherj> epwhorl, waxjar, i like you
sandGorgon has joined #ruby
zaki has joined #ruby
kiyoura has quit [Quit: Leaving]
tombar has quit [Remote host closed the connection]
<epwhorl> like... LIKE like? or just like...?
havenn has quit [Remote host closed the connection]
<otherj> totally platonic
rinfon has quit [Quit: Ex-Chat]
squidBits has quit [Read error: Connection reset by peer]
squidBits has joined #ruby
joofsh has quit [Quit: Leaving]
tjbiddle has quit [Quit: tjbiddle]
cableray has quit [Ping timeout: 264 seconds]
kil0byte has joined #ruby
cableray has joined #ruby
burgestrand has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
cj3kim has quit [Ping timeout: 276 seconds]
L1 has joined #ruby
L1 has quit [Changing host]
L1 has joined #ruby
tjbiddle has joined #ruby
mneorr has joined #ruby
bigmcq77 has quit [Quit: Computer has gone to sleep.]
<epwhorl> otherj, ruby is your first programming experience?
rippa has joined #ruby
omg765 has joined #ruby
tjbiddle has quit [Client Quit]
<otherj> my first real experience. i guess i played poorly with vb in some class in high school
xpen has quit [Ping timeout: 240 seconds]
pu22l3r has quit [Ping timeout: 248 seconds]
quest88 has joined #ruby
yacks has quit [Ping timeout: 252 seconds]
bigmcq77 has joined #ruby
cdt has quit [Ping timeout: 276 seconds]
jenrzzz has joined #ruby
mjolk has quit [Quit: returning some videotapes]
wedtm has joined #ruby
mneorr has quit [Remote host closed the connection]
pu22l3r has joined #ruby
burgestrand has quit [Quit: Leaving.]
malkomalko has joined #ruby
mengu has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
rohit has quit [Quit: Leaving]
reset has joined #ruby
mercwithamouth has quit [Ping timeout: 250 seconds]
jekotia has quit [Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204]]
malkomalko has quit [Ping timeout: 264 seconds]
bradhe has joined #ruby
heftig has quit [Quit: leaving]
ananthakumaran has joined #ruby
tommyvyo has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
epwhorl has quit [Ping timeout: 255 seconds]
bradhe has quit [Ping timeout: 252 seconds]
Fretta has quit [Quit: Fretta]
artm has joined #ruby
Bry8Star has joined #ruby
havenn has joined #ruby
cbosh has joined #ruby
slash_nick has joined #ruby
jackdanger has joined #ruby
michaelmartinez has joined #ruby
xpen has joined #ruby
zarubin has quit []
mahmoudimus has quit [Quit: Computer has gone to sleep.]
rippa has quit [Ping timeout: 248 seconds]
browndawg has quit [Ping timeout: 276 seconds]
epwhorl has joined #ruby
kil0byte has quit [Ping timeout: 248 seconds]
BoomCow has joined #ruby
wallerdev has quit [Quit: wallerdev]
nemesit has joined #ruby
wallerdev has joined #ruby
kil0byte has joined #ruby
nemesit has quit [Client Quit]
squidBits has quit [Quit: squidBits]
love_color_text has quit [Remote host closed the connection]
altious has joined #ruby
mneorr has joined #ruby
jphpsf has quit [Ping timeout: 255 seconds]
squidBits has joined #ruby
jphpsf has joined #ruby
malkomalko has joined #ruby
xpen_ has joined #ruby
browndawg has joined #ruby
xpen has quit [Ping timeout: 240 seconds]
altious has quit [Ping timeout: 256 seconds]
c0rn has quit []
thams has quit [Read error: Connection reset by peer]
thams has joined #ruby
kil0byte_ has joined #ruby
pu22l3r has quit [Remote host closed the connection]
kil0byte has quit [Ping timeout: 252 seconds]
browndawg1 has joined #ruby
browndawg has quit [Ping timeout: 255 seconds]
malkomalko has quit [Ping timeout: 265 seconds]
michaelmartinez has quit [Quit: Check it, Wreck it http://www.caffeineindustries.com/blog]
thinkclay has quit [Quit: Leaving.]
Takehiro has joined #ruby
love_color_text has joined #ruby
mahmoudimus has joined #ruby
Solnse has joined #ruby
Dan- has quit [Ping timeout: 255 seconds]
jonathanwallace has joined #ruby
love_color_text has quit [Ping timeout: 265 seconds]
xpen_ has quit [Read error: Connection timed out]
xbayrockx has joined #ruby
jhchabran has quit [Read error: Operation timed out]
xbayrockx is now known as wf2f
matrixise has quit [Ping timeout: 248 seconds]
xpen has joined #ruby
rohit has joined #ruby
spacebug1 has joined #ruby
Takehiro has quit [Remote host closed the connection]
cantonic_ has joined #ruby
mikekelly has quit [Ping timeout: 265 seconds]
jhchabran has joined #ruby
spacebug has quit [Ping timeout: 265 seconds]
bradhe has joined #ruby
JohnBat26 has joined #ruby
x82_nicole has quit [Ping timeout: 240 seconds]
Hanmac has joined #ruby
mikekelly has joined #ruby
browndawg1 has quit [Quit: Leaving.]
ananthakumaran has quit [Ping timeout: 252 seconds]
cantonic has quit [Ping timeout: 264 seconds]
cantonic_ is now known as cantonic
wf2f has quit [Ping timeout: 256 seconds]
<squidBits> Does anyone have a project that's kind of in the beginning phase that they want help with / do pair programming type stuff on?
<squidBits> I'm kinda newish to ruby and want to expand.
LouisGB has joined #ruby
xAndy is now known as xandy
cyong has quit [Quit: Leaving.]
x82_nicole has joined #ruby
wedtm is now known as wedtm|away
x82_nicole has quit [Read error: Connection reset by peer]
otherj has quit [Quit: otherj]
slash_nick is now known as slash_nick_away
miso1337 has quit [Quit: afk]
burgestrand has joined #ruby
LouisGB has quit [Ping timeout: 248 seconds]
havenn has quit [Remote host closed the connection]
io_syl has quit [Ping timeout: 252 seconds]
havenn has joined #ruby
x82_nicole has joined #ruby
xpen has quit [Read error: Connection timed out]
Takehiro has joined #ruby
xpen has joined #ruby
slash_nick_away has quit [Ping timeout: 265 seconds]
love_color_text has joined #ruby
kil0byte has joined #ruby
havenn has quit [Ping timeout: 255 seconds]
chendo_ has quit [Quit: Leaving...]
malkomalko has joined #ruby
Tref has quit [Quit: Tref]
tagrudev has joined #ruby
<Hanmac> squidBits what do you mean with "Pair Programming" ?
kil0byte_ has quit [Ping timeout: 244 seconds]
DIAPERCOP has quit [Quit: POOP]
<squidBits> Hanmac: a small 2 person project.
<squidBits> Kinda.
pcarrier has quit []
wedtm|away is now known as wedtm
<squidBits> It's basically working on the same code at the same time.
<squidBits> Using screen sharing, or some sort of sharing.
postmodern has quit [Ping timeout: 250 seconds]
<Hanmac> i have some projects i do allone ... but they are not small ...
<squidBits> I guess it doesn't have to be small, but maybe something that you could explain to someone who doesn't fully grasp the bigger concepts of ruby.
kil0byte_ has joined #ruby
<squidBits> I learn quickly :)
jackdanger has quit [Quit: Leaving.]
<BoomCow> you should build a site
<BoomCow> that will allow students to do this
<Hanmac> ... the suff i wrote for ruby is not in ruby ... it is in C++ :P (and because of the time it is still undocumented)
<BoomCow> what are you looking to write squidBits
<squidBits> Well, we could write a rails app to do live pair programming.
<squidBits> hehe
kil0byte has quit [Ping timeout: 252 seconds]
<squidBits> Basically this is what I am currently doing: http://globalnerdy.com/wordpress/wp-content/uploads/2007/11/pair_programming.jpg
<squidBits> But my partner isn't much help :P
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
ananthakumaran has joined #ruby
rohit has quit [Ping timeout: 250 seconds]
Takehiro has quit [Read error: Connection reset by peer]
thams has quit [Read error: Connection reset by peer]
thams has joined #ruby
malkomalko has quit [Ping timeout: 244 seconds]
x82_nicole has quit [Read error: Connection reset by peer]
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
<squidBits> BoomCow: Would you want a site where you program right on the site together? Or like a site to find other people?
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<squidBits> What do you mean by 'allow students to do this'?
<Hanmac> i never did pair programming before ... i only used something like git and irc for that
<BoomCow> you can write something
<BoomCow> that allows people to pair program
<BoomCow> and then pushed directly onto git
areil has joined #ruby
<Hanmac> i planed an RPG-Maker that would support PairProgamming oneday
nat2610 has left #ruby [#ruby]
akemrir has joined #ruby
<BoomCow> I did pair programming once at an interview
<BoomCow> would rather work on my own
x82_nicole has joined #ruby
<BoomCow> :)
<squidBits> lol
x82_nicole has quit [Read error: Connection reset by peer]
BoomCow has quit [Quit: This computer has gone to sleep]
hotovson has joined #ruby
rohit has joined #ruby
samuel02 has joined #ruby
samuel02 has quit [Read error: Connection reset by peer]
mafolz has joined #ruby
samuel02 has joined #ruby
quest88 has quit [Quit: quest88]
answer_42 has joined #ruby
Monie has quit [Ping timeout: 255 seconds]
tonini has joined #ruby
akemrir has quit [Quit: WeeChat 0.3.8]
x82_nicole has joined #ruby
Goles has quit [Ping timeout: 252 seconds]
postmodern has joined #ruby
vlad_starkov has joined #ruby
daniel_hinojosa has quit [Quit: Leaving.]
havenn has joined #ruby
BoomCow has joined #ruby
Goles has joined #ruby
squidBits has quit [Ping timeout: 255 seconds]
charliesome has joined #ruby
witty_fool has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
cableray has quit [Quit: cableray]
<Hanmac> squidbits i could show you one of my projects that is an binding for an 3d-engine but the current code may confuse you :P
mjbamford has joined #ruby
x82_nicole has quit [Ping timeout: 276 seconds]
djdb has joined #ruby
vlad_starkov has joined #ruby
Monie has joined #ruby
x82_nicole has joined #ruby
BigO has joined #ruby
gmci_ has quit [Quit: Computer has gone to sleep.]
BigO has quit [Remote host closed the connection]
cableray has joined #ruby
darthdeus has joined #ruby
witty_fool has quit [Read error: Connection reset by peer]
havenn has quit [Ping timeout: 240 seconds]
kil0byte has joined #ruby
darthdeus has quit [Ping timeout: 248 seconds]
malkomalko has joined #ruby
Phoop has joined #ruby
ChampS666 has joined #ruby
<bricker> Hello, trying to setup a simple script to fetch some stuff from an API (for testing), but the problem is that it's writing all of the formats from the entire loop into every file: https://gist.github.com/4265750 Do I need to "flush" somewhere, or something?
ChampS_ has joined #ruby
BoomCow has left #ruby ["Leaving"]
rohit has quit [Ping timeout: 240 seconds]
kil0byte_ has quit [Ping timeout: 265 seconds]
ChampS666 has quit [Ping timeout: 244 seconds]
<Hanmac> bricker why do you use curl and not some of other ruby stuff like Net::HTTP ?
wf2f has quit []
epwhorl has quit [Ping timeout: 252 seconds]
<bricker> Hanmac: I certainly could, I am mostly just curious about this now :)
dmiller has quit [Remote host closed the connection]
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
a_a_g has joined #ruby
wedtm is now known as wedtm|away
wedtm|away is now known as wedtm
squidBits has joined #ruby
malkomalko has quit [Ping timeout: 255 seconds]
tommyvyo has quit [Quit: Computer has gone to sleep.]
nemesit has joined #ruby
undersc0re97 has quit [Quit: Live from Pyongyang DPRK this is...]
rohit has joined #ruby
lurch_ has left #ruby [#ruby]
paolooo has joined #ruby
cheez0r has quit [Ping timeout: 255 seconds]
undersc0re97 has joined #ruby
undersc0re97 has joined #ruby
undersc0re97 has quit [Changing host]
BoomCow has joined #ruby
cezar has joined #ruby
BoomCow has quit [Client Quit]
danneu has joined #ruby
mneorr has quit [Remote host closed the connection]
io_syl has joined #ruby
gridaphobe has quit [Ping timeout: 264 seconds]
dukedave has quit [Quit: Leaving.]
mneorr has joined #ruby
cheez0r has joined #ruby
mahmoudimus has joined #ruby
havenn has joined #ruby
schaerli has joined #ruby
reset has quit [Quit: Leaving...]
ckrailo has quit [Quit: Computer has gone to sleep.]
Tref has joined #ruby
luckyruby has joined #ruby
rohit has quit [Quit: Leaving]
L1_ has joined #ruby
rakl has joined #ruby
marknyc has quit []
altious has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
havenn has quit [Ping timeout: 244 seconds]
L1 has quit [Ping timeout: 264 seconds]
maesbn has joined #ruby
workmad3 has joined #ruby
zigomir has joined #ruby
matrixise has joined #ruby
mafolz has quit [Read error: No route to host]
headius has joined #ruby
malkomalko has joined #ruby
gregorg_taf has quit [Changing host]
gregorg_taf has joined #ruby
gregorg_taf is now known as gregorg
ChampS_ has quit [Ping timeout: 255 seconds]
mafolz has joined #ruby
yacks has joined #ruby
atal421 has quit [Quit: atal421]
DatumDrop has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
eldariof has joined #ruby
cheez0r has quit [Ping timeout: 255 seconds]
cheez0r has joined #ruby
Morkel has joined #ruby
elsifaka has joined #ruby
malkomalko has quit [Ping timeout: 252 seconds]
mneorr has quit [Remote host closed the connection]
nomenkun has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
timonv has joined #ruby
rakunHo has joined #ruby
ephemerian has joined #ruby
crocket has left #ruby ["Leaving"]
paolooo has quit [Ping timeout: 245 seconds]
schaerli has quit [Remote host closed the connection]
reset has joined #ruby
nomenkun has quit [Ping timeout: 260 seconds]
vlad_starkov has quit [Remote host closed the connection]
Tref has quit [Quit: Tref]
ipalaus_ has quit [Changing host]
ipalaus_ has joined #ruby
rezzack has quit [Quit: Leaving.]
ipalaus_ is now known as ipalaus
robotmay has joined #ruby
postmodern has joined #ruby
timonv has quit [Remote host closed the connection]
dr_bob has joined #ruby
_cheney has quit [Quit: Nettalk6 - www.ntalk.de]
bigkm has quit [Quit: Computer has gone to sleep.]
h4mz1d has joined #ruby
grzywacz has joined #ruby
grzywacz has joined #ruby
grzywacz has quit [Changing host]
timonv has joined #ruby
piotr_ has joined #ruby
_veer has quit [Read error: Connection reset by peer]
igro has joined #ruby
swex has joined #ruby
cheez0r has quit [Ping timeout: 252 seconds]
cheez0r has joined #ruby
timonv has quit [Remote host closed the connection]
sepp2k has joined #ruby
brianpWins has joined #ruby
malkomalko has joined #ruby
adeponte has quit [Read error: Connection reset by peer]
adeponte has joined #ruby
lolmaus has joined #ruby
brianpWins has quit [Quit: brianpWins]
altious2 has joined #ruby
igro has quit [Ping timeout: 250 seconds]
piotr_ has quit [Read error: Connection reset by peer]
cascalheira has joined #ruby
tvw has joined #ruby
Shamgar has quit [Ping timeout: 248 seconds]
dawkirst_ has joined #ruby
LouisGB has joined #ruby
igro has joined #ruby
piotr_ has joined #ruby
malkomalko has quit [Ping timeout: 255 seconds]
Shamgar has joined #ruby
Axsuul has quit [Ping timeout: 244 seconds]
burgestrand has quit [Quit: Leaving.]
rellin has quit [Ping timeout: 264 seconds]
Elhu has joined #ruby
squidBits has quit [Quit: squidBits]
blaxter has joined #ruby
morf has joined #ruby
h4mz1d has quit [Ping timeout: 240 seconds]
ryanf has joined #ruby
igro has quit [Read error: Operation timed out]
wedtm is now known as wedtm|away
jimeh has joined #ruby
rohit has joined #ruby
alex__c2022_ has joined #ruby
jxriddle has quit [Ping timeout: 244 seconds]
igro has joined #ruby
Shamgar has quit [Ping timeout: 244 seconds]
wedtm|away is now known as wedtm
arturaz has joined #ruby
Shamgar has joined #ruby
vlad_starkov has joined #ruby
chussenot has joined #ruby
noric has quit [Read error: Connection reset by peer]
pyx has quit [Quit: WeeChat 0.3.9.2]
codecaster has joined #ruby
scruple has quit [Ping timeout: 252 seconds]
codecaster has quit [Read error: Connection reset by peer]
fyolnish has quit [Remote host closed the connection]
igro has quit [Ping timeout: 252 seconds]
io_syl has quit [Quit: Computer has gone to sleep.]
codecaster has joined #ruby
chussenot has quit [Quit: chussenot]
DatumDrop has joined #ruby
igro has joined #ruby
igro has quit [Read error: Connection reset by peer]
browndawg has joined #ruby
malkomalko has joined #ruby
xpen has quit [Ping timeout: 264 seconds]
moshee has quit [Ping timeout: 260 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
DatumDrop has quit [Ping timeout: 252 seconds]
blacktulip has joined #ruby
igro has joined #ruby
nomenkun has joined #ruby
igro has quit [Read error: Connection reset by peer]
Virunga has joined #ruby
lejonet has quit [Read error: Operation timed out]
rohit has quit [Read error: No buffer space available]
Schmidt has quit [Ping timeout: 255 seconds]
igro has joined #ruby
malkomalko has quit [Ping timeout: 260 seconds]
cheez0r has quit [Read error: Operation timed out]
igro has quit [Read error: Connection reset by peer]
ananthakumaran has quit [Ping timeout: 256 seconds]
cheez0r has joined #ruby
Ruler_Of_Heaven_ is now known as pipopopo
ananthakumaran has joined #ruby
cdt has joined #ruby
elaptics`away is now known as elaptics
igro has joined #ruby
igro has quit [Read error: Connection reset by peer]
kil0byte_ has joined #ruby
Mon_Ouie has quit [Ping timeout: 240 seconds]
JDubs has joined #ruby
<JDubs> Hey guys!!! o/
dEPy has joined #ruby
<JDubs> What is the shortest way to write a method to square something (preferably I'd like it to be inline.
<dEPy> Any1 can explain this snippet to me? http://pastebin.com/SxcATP18
<JDubs> For instance: someothermethod.(whatever) == outputofsomeothermethod squared
<dEPy> What's that: module Something, then class << self
slainer68 has joined #ruby
<JDubs> dEPy it just sends the codeblock up to the class level I think, minus the config part
<JDubs> dEPy: but I could be wrong, I'm a newb
<JDubs> xD
<JDubs> Still learning blocks/procs/lambdas myself
kil0byte has quit [Ping timeout: 256 seconds]
s1n4 has joined #ruby
igro has joined #ruby
Zai00 has joined #ruby
igro has quit [Read error: Connection reset by peer]
cascalheira has quit [Quit: Leaving...]
ananthakumaran has quit [Ping timeout: 244 seconds]
kil0byte has joined #ruby
<lupine> JDubs, number**2
cdt has quit [Ping timeout: 276 seconds]
ananthakumaran has joined #ruby
tobinharris has joined #ruby
grzywacz has quit [Ping timeout: 276 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
igro has joined #ruby
timmow has joined #ruby
kil0byte_ has quit [Ping timeout: 248 seconds]
qb has quit [Read error: Connection reset by peer]
brendan` has quit [Read error: Connection reset by peer]
brendan` has joined #ruby
vlad_starkov has quit [Read error: Connection reset by peer]
Sigma00 has quit [Ping timeout: 245 seconds]
yacks has quit [Ping timeout: 259 seconds]
vlad_starkov has joined #ruby
<Hanmac> depy: class << self opens the singleton class of self (in this case the singleton class of the module PayRoll) eveything defined in class << self is aplyed to the classObject itself, not to the instances (you could call the methods static)
ddd1 has joined #ruby
mahmoudimus has joined #ruby
ddd has quit [Ping timeout: 245 seconds]
djdb has quit [Read error: Connection reset by peer]
Sigma00 has joined #ruby
nari has quit [Ping timeout: 260 seconds]
Guest18281 has quit [Remote host closed the connection]
headius has quit [Quit: headius]
ejnahc has quit [Ping timeout: 240 seconds]
ejnahc has joined #ruby
malkomalko has joined #ruby
Averna has joined #ruby
<JDubs> lupine thanks!, does that work inline?
tps_ has quit [Quit: tps_]
<Hanmac> what do you mean with "inline"?
Gooder has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
wallerdev has quit [Quit: wallerdev]
<JDubs> like .**2.blahblah.blahblah
Skelz0r has quit [Ping timeout: 244 seconds]
Skelz0r has joined #ruby
<DefV> JDubs: (stuff ** 2).foo.bar would work
<apeiros_> or stuff.**(2).foo.bar - I prefer the former, though
timonv has joined #ruby
<apeiros_> stuff**2.foo.bar "works" too, but it's interpreted as: stuff**(2.foo.bar)
igro has quit [Quit: Computer has gone to sleep.]
Xeago has joined #ruby
L1_ has quit [Quit: Quitter]
<JDubs> apeiros: thanks! :)
<JDubs> Apeiros_ think you can help me figure out how to make some code more efficient? I wrote a solution to a eueler problem, but it took my computer over a minute to find the answer!
<JDubs> I want to learn how to write more efficient code
malkomalko has quit [Ping timeout: 248 seconds]
<apeiros_> I can take a look
gyre007 has joined #ruby
<Xeago> I HATE MY COLLLEAGUES
<JDubs> Thanks :)
<JDubs> xeago: it's ok we love you <3
<Xeago> binding.pry in prodction
banjara has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
yshh has quit [Remote host closed the connection]
<Xeago> JDubs: there's a trick involved
thone has quit [Ping timeout: 252 seconds]
<Xeago> you don't have to go till self-1
kil0byte_ has joined #ruby
workmad3 has joined #ruby
<Xeago> as you know for sure that as long as it is bigger than 2: (i-1)(i-1) is bigger than i
malkomalko has joined #ruby
<JDubs> xeago: go on
<Xeago> you only have to go till a number (that you can calculate easily)
<Xeago> you job is to figure that out with some simple math and thinking :)
lkba has quit [Ping timeout: 252 seconds]
<Xeago> s/you/your
kil0byte has quit [Ping timeout: 260 seconds]
<JDubs> hmmm
<lupine> if it doesn't, add brackets until it does
<Xeago> lupine?
<JDubs> Xeago: num/2?
<Xeago> JDubs: have you looked a the sieve of therostheness or whatever he is called
<lupine> re: <JDubs> lupine thanks!, does that work inline?
<Xeago> num/2 I think works
<Xeago> but is not optimal
kil0byte has joined #ruby
<JDubs> Xeago: hmm....
<Xeago> (it actually is optimal for low numbers, but that is not how it is measured)
<Xeago> with num/2 you will cut your operational time with more than half
<JDubs> Xeago: well that lowered my runtime a bit...how else can I improve my code?
cascalheira has joined #ruby
<Xeago> figuring out primes is considered hard, it is used as several bases for crypto :)
<Hanmac> Jdubs & Xeago: n % 2 != 0 && !3.step(n/2,2).find {|i| n % i == 0 }
cableray has quit [Quit: cableray]
<Xeago> Hanmac: I doubt that one is optimal
<Xeago> it cuts out steps by two, but it doesn't use logarithmics
kil0byte_ has quit [Ping timeout: 264 seconds]
<JDubs> xeago: if i need to know logs and such, i probably can't improve my code by much :/
<Hanmac> it could be better but i dont know (i would need to look how the Prime module handles that)
<JDubs> xeago: been over a decade since I took calc
tvw has quit [Remote host closed the connection]
<Xeago> get a logarithmic of the value to get the lowest upper bound, and then sieve
banjara has quit [Quit: Leaving.]
<Xeago> the step stuff that Hanmac did is a very very simple sieve
<apeiros_> Xeago: haha, we have a stub in production to avoid accidentally left in .pry's to cause harm
<apeiros_> JDubs: looking
<apeiros_> JDubs: but from the scrollback, it seems like you already got good advice
<Xeago> apeiros_: we don't, I get called texted mailed for every request failed
<Xeago> and spammed on irc and campfire
<apeiros_> :D
<apeiros_> lotsafun
ikaros has joined #ruby
<JDubs> xeago: I'm going to have to go look up the step method
<JDubs> xeago: what do you mean by sieve?
<Xeago> step method is easy once you get it
yacks has joined #ruby
<Xeago> look it up on wikipedia :)
altious2 has quit [Read error: No buffer space available]
altious2 has joined #ruby
<apeiros_> and the guy is called Eratosthenes ;-)
<apeiros_> I think 1.9.3's Prime lib has become faster too, no?
jellow has quit [Ping timeout: 256 seconds]
<Hanmac> Xeago i dont know if n % 2 != 0 && (n + (n.even? ? 1 : 0)).step(3,-2).any? {|i| n % i != 0 } may be better (it does from the other direction ... )
<apeiros_> yeah, by `ls Prime` it seems like it uses eratosthenes sieve too
<apeiros_> it contains the constants EratosthenesGenerator and EratosthenesSieve
<JDubs> what is eratosthenes? you guys are speaking crazy lol
<apeiros_> JDubs: a greek guy
<Xeago> it is an ancient greek from BC
<Xeago> use the lmddgtfy.net link
<apeiros_> he came up with an algorithm to find prime numbers
<Xeago> and than go to wiki
<Xeago> Hanmac (n.even? ? 1 : 0) will always be 0
thone has joined #ruby
<Hanmac> huch you are right ...
<Xeago> as any number with modulus of 2 not 0 will not be even :)
<Xeago> what you could do is, incremental step
tvw has joined #ruby
<Xeago> but that has quirks <11
<apeiros_> JDubs: 0.15s on my computer: (1..10000).count { |n| Prime.prime?(n) }
* Xeago thank god for crypto course for letting me be smart here :P
<Xeago> apeiros_: is Prime in ruby or in C?
<apeiros_> no idea. but don't use that code pre 1.9.3
wedtm is now known as wedtm|away
heftig has joined #ruby
<Xeago> JDubs: you looked at the gif at wikipedia?
daniel_- has joined #ruby
<JDubs> apeiros_ what is the Prime constant from?
<Xeago> from ruby core iirc
<apeiros_> require 'prime'
<apeiros_> stdlib, not core
<Xeago> standard :O
<Xeago> surprising
<JDubs> xeago: no i havent done any of that yet I'm still looking up methods
<Xeago> look up the sieve first
<JDubs> what's the difference between stdlib and core?
<apeiros_> core is there without require
<JDubs> oic
<apeiros_> stdlib *should* be there with require on any installed ruby
<Xeago> damnit apeiros_ you type faster, hands are still frozen from commute :\
<apeiros_> (should, because some distros are obtuse)
<apeiros_> JDubs: re your loop - you only have to test divisors up to Math.sqrt(self)
tvw has quit [Ping timeout: 240 seconds]
<witchdoc> hi all
<Xeago> apeiros_: sqrt is not optimal, logarythmic takes longer than the loop tho..
<JDubs> witchdoc: o/
<apeiros_> Xeago: in ruby, the cost of sqrt is insignificant compared with the loop
<apeiros_> if we were talking C…
<Xeago> in all languages
bradhe has quit [Remote host closed the connection]
<Xeago> sqrt > log
wikiziner has joined #ruby
<Xeago> except algebra
<Xeago> :)
mengu has joined #ruby
<apeiros_> logarithmic btw.
<JDubs> what do I load to ge tthe sqrt function?
<Xeago> think it is in math
<Xeago> but implement it yourself ;
<JDubs> :/
<JDubs> lol
<JDubs> I wouldn't know how to write a sqrt program :/
<JonnieCache> use jon carmack's super l33t square root algorithm
<JonnieCache> the one from quake. its pretty amazing
daniel_- has quit [Quit: WeeChat 0.3.9.2]
<JonnieCache> it has bit manging and magic numbers
<JonnieCache> *mangling
<apeiros_> Xeago: just tested, sqrt beats div by far
<JonnieCache> oh no heres the proper article about it http://www.beyond3d.com/content/articles/8/ with the full explanation
<Xeago> apeiros_: I never said that sqrt was slower than div?
<Hanmac> 2.upto(n).find{|i| i ** 2 == n}
<apeiros_> Xeago: you said sqrt was suboptimal, so what's the optimal (in ruby) way to find the upper limit of factors to test?
<Xeago> in programming languages: sqrt, in abstract algebra log
adeponte has quit [Remote host closed the connection]
CamonZ has joined #ruby
<apeiros_> o0
<apeiros_> JDubs: a**0.5 or Math.sqrt(a)
wikiziner has quit [Read error: Connection reset by peer]
wikiziner has joined #ruby
Vainoharhainen has joined #ruby
CamonZ_afk has quit [Read error: Connection reset by peer]
<apeiros_> anyway, the result of the test: http://pastie.org/5515277
jaredrhine_ has joined #ruby
jaredrhine has quit [Remote host closed the connection]
<JDubs> apeiros_ this website about finding sqrts is hurting my brain
tonini has quit [Remote host closed the connection]
<JDubs> methinks i need to retake calculus...
nemesit has quit [Quit: Leaving...]
<apeiros_> JDubs: it's usually not necessary to go that deep
poisonarms has left #ruby [#ruby]
<apeiros_> especially since a ruby implementation of carmacks algorithm will be slower than just using Math.sqrt
adeponte has joined #ruby
<JDubs> apeiros_ can you explain this to me i = 0x5f3759df - ( i >> 1 );
<JDubs> I dont understand that line
<Hanmac> apeiros what happens when you use step instead of upto?
<Xeago> JDubs: 0x5f3759df is a cleverly taken constant
<Xeago> i >> 1 drop the least significant byte from i
<Xeago> basically divide by 2 and drop the fraction (round towards 0)
lurch_ has joined #ruby
<JDubs> hmm
<JDubs> meh
<JDubs> blah
<JDubs> too early in the morning for all this complex math... lol
<Xeago> also JonnieCache, it wasn't john :)
odyssey4me has joined #ruby
<JonnieCache> yeah yeah ive hardly had the coffee yet
shiin has joined #ruby
yxhuvud has quit [Read error: Connection reset by peer]
<JonnieCache> but its still some sweet code that cant be denied
<apeiros_> Hanmac: how'd you use step in that?
<Xeago> truly sweet indeed :)
yxhuvud has joined #ruby
WhereIsMySpoon_ has joined #ruby
<JonnieCache> also its inverse square root which is completely different lol
randym has quit [Ping timeout: 245 seconds]
brjannc has quit [Ping timeout: 245 seconds]
mikecmpbll has joined #ruby
arquebus has joined #ruby
sonne has quit [Ping timeout: 245 seconds]
notbrent has quit [Ping timeout: 245 seconds]
<Hanmac> apeiros_ something like self % 2 != 0 && 3.step(Math.sqrt(self).floor,2) do |i|
notbrent has joined #ruby
WhereIsMySpoon has quit [Write error: Broken pipe]
<apeiros_> ah
<Xeago> Hanmac: if we're already building a table (integer array) why not sieve it properly?
ipalaus has quit [Quit: :-)]
<workmad3> Hanmac: self.odd? && ...
<Hanmac> workmad, yeah, odd is better
randym has joined #ruby
lkba has joined #ruby
<Xeago> why?
sonne has joined #ruby
<apeiros_> Hanmac: I'd expect it to roughly double performance of all 3 variants
<apeiros_> lets see
<workmad3> Xeago: (self % 2 != 0) vs self.odd?
<workmad3> Xeago: which would you rather read? :)
g_bleezy has quit [Remote host closed the connection]
<Xeago> I'd rather read bit manging there tbh
<Xeago> but that's just me
<apeiros_> Hanmac: http://pastie.org/5515336
cdt has joined #ruby
<workmad3> Xeago: so (self & 1 != 0) is your preferred reading?
<Hanmac> okay it is a little bit faster ... but i am curios because it looks faster then the Prime stuff?
<Xeago> not for ruby, but for performance critical code yes
<workmad3> Xeago: I can see why you'd like it on a performance angle but not on readability
brjannc has joined #ruby
zommi has joined #ruby
<Xeago> to me (self & 1 != 0) && \n\tetc reads the same
<workmad3> Xeago: and I wouldn't want to push that until I've profiled and verified that the even/odd check is actually bottlenecking
<Xeago> it isn't ;p
<workmad3> Xeago: if it's not a bottleneck, it's not a performance problem
<apeiros_> Hanmac: yes, that got me interested too. I'm checking right now whether Prime has other ways of using it.
<apeiros_> Hanmac: hm, that's bad… Prime.prime? really should be faster than some handwritten (in less than 5min!) ruby code…
arkiver has joined #ruby
<workmad3> Xeago: also, the super-naive timer of 'time ruby -e "1000000.times { 3.odd?}" ' vs 'time ruby -e "1000000.times { 3 & 1 != 0}"' consistently shows that using 'odd?' is faster on my machine
cdt has quit [Quit: Ex-Chat]
cdt has joined #ruby
<apeiros_> workmad3: 2 method calls vs 1
karakedi has joined #ruby
<workmad3> apeiros_: :)
<apeiros_> also, .odd? is implemented as `num & 2` in C
<Xeago> & 2 :O
<Xeago> try even? instead
<Xeago> and 3 & 1 == 0
<apeiros_> same, but reversed return values
Shamgar has quit [Ping timeout: 264 seconds]
<workmad3> Xeago: slightly smaller gap, but still slower than .even?
<Xeago> I attribute that to c code ;)
<workmad3> Xeago: and again, in ruby terms because 3 & 1 == 0 is 2 method calls, .even? is 1
<workmad3> and, thinking about it, 3 & 1 != 0 is 3 method calls, not 2
<Xeago> are ruby method calls that slow?
Shamgar has joined #ruby
<apeiros_> Xeago: yes
<Xeago> never knew..
<apeiros_> much slower than any basic algorithmic function in C anyway
<workmad3> Xeago: it's about 1 hundreth of a second over 1000000 iterations
<apeiros_> algebraic?
<apeiros_> when you optimize ruby code, after you've optimized the algorithm itself, the next step is reducing method calls.
<apeiros_> also, things like extend kill the lookup caches (globally!)
<workmad3> Xeago: so it's hardly 'slow', but it's certainly 'slower' and definitely not 'free'
<Hanmac> apreiros_ i noticd that we both forgot the "2"
<workmad3> Xeago: but also not something to worry about in the majority of circumstances :)
* apeiros_ hands Hanmac a tab key, behold its powers of nick-completion ;-p
pcarrier has joined #ruby
burgestrand has joined #ruby
<apeiros_> Hanmac: what do you mean, forgot the 2?
<Hanmac> i dont trust the tab key in irc ... when it could happen that i annow the wrong user ...
<Xeago> is it Low and behold or Lo and behold?
<Paradox> anything i should watch out for or sanitize out of the public repo of a rails site?
<Hanmac> the prime*? methods in the pastie shows all false for 2
<apeiros_> love and hold!
ipalaus has joined #ruby
<workmad3> Xeago: lo
<workmad3> Xeago: although I'd be highly dubious of any use of the phrase outside of a religious text
<apeiros_> Hanmac: ah, yes
ipalaus has left #ruby [#ruby]
<Xeago> workmad3: my crypto prof often uses it
<lupine> I have seen it used correctly in secular texts
<Xeago> 'and lo and behold, you will find both values are equal'
vlad_starkov has quit [Read error: Connection reset by peer]
Shamgar has quit [Ping timeout: 264 seconds]
<Xeago> or 'lo and behold, the adversary completely breaks the ...'
<workmad3> lupine: oh, it can be used in secular texts, but it still carries over more religious baggage than necessary, IMO
vlad_starkov has joined #ruby
<lupine> such is life
Shamgar has joined #ruby
<workmad3> Xeago: your crypto prof sounds like he's being overly dramatic about these things :P
x0F has quit [Read error: Connection reset by peer]
kil0byte_ has joined #ruby
reset has quit [Quit: Leaving...]
<apeiros_> Hanmac: added `return true if self < 4`, doesn't change much about the numbers.
<Xeago> he always says: It is obvious that completely-not-obvious-and-arcane-thing ...
<Xeago> when asking for it on online forums
<Xeago> he types out a multipage forum reply
x0F has joined #ruby
<Xeago> also JDubs you do use git right?
<workmad3> Xeago: I bet it is obvious... if you have an in-depth background in cryptography and have understood the initial axioms and followed the proofs
<Xeago> I asked the guys in ##crypto, they said it was non obviously obvious
hemanth_ has quit [Quit: Leaving]
kil0byte has quit [Ping timeout: 276 seconds]
burgestrand1 has joined #ruby
<JDubs> Xeago: yeah
wikiziner has quit [Remote host closed the connection]
<Xeago> why not source control your pasties
<JDubs> Ok guys, I think I came up with a pretty efficient solution to eueler 8, tell me what you think: http://pastie.org/5515396
<apeiros_> JDubs: iirc for euler, I had a cache of the first 1e6 primes :)
<JDubs> Xeago: what do you mean?
karakedi has quit [Ping timeout: 240 seconds]
<Xeago> for example gist.github.com
dr_bob has quit [Ping timeout: 240 seconds]
<Xeago> line 7 is redundant
<JDubs> I've never used gist, why is it better than pastie?
burgestrand has quit [Ping timeout: 240 seconds]
dr_bob has joined #ruby
<lupine> versioning
<JDubs> lupine: i see
<Xeago> I'd use gist because I can sourcecontrol and update the gist without using my browse
adeponte has quit [Remote host closed the connection]
<JDubs> xeago: anything else?
<JDubs> xeago: for my code i mean
<apeiros_> JDubs: I think that one I brute forced with each_cons and .inject(:*) (back then with a block…)
<JDubs> is there a better way than an until loop?
<Xeago> what is it supposed to do
Shamgar has quit [Ping timeout: 244 seconds]
InFlames has joined #ruby
<Xeago> and explain line 2 please
<Xeago> it gets absolutely decimated with negative numbers btw :P
<Xeago> but the way you split that can't happen
<JDubs> line 2 is make it where i can split the number by digit
<JDubs> and then make sure it comes out as a number not a string
<JDubs> the purpose is to find the product of every group of 5 digits in the number
<JDubs> and find the highest product
Shamgar has joined #ruby
<Xeago> also you could write 'highest = current if current > highest' 9-11
<JDubs> apeiros_ each_cons?
<apeiros_> JDubs: Enumerable#each_cons
<workmad3> that's what I was about ot suggest :)
arkiver has quit [Quit: Leaving]
<apeiros_> gets you N consecutive items out of the enumerable
<workmad3> JDubs: ary.each_cons(5)
<apeiros_> nums.each_cons(5).map { |ns| ns.inject(:*) }.max
fyolnish has joined #ruby
* Xeago has to work
* Xeago fill in stupid timesheet
burgestrand1 has quit [Read error: Connection reset by peer]
burgestrand has joined #ruby
<workmad3> gotta love project euler problems... so often they can be done in a ruby one-liner if you work hard at it :)
nilg` has quit [Remote host closed the connection]
<JDubs> apeiros_ wow nice
<apeiros_> and to get nums: text.scan(/\d/).map { |n| n.to_i }
<lupine> >< each_cons solves *so many problemss I have*
nemesit has joined #ruby
<apeiros_> because I'm too lazy to convert that by hand :-)
<JDubs> wow I'm learning so many AWESOME coding tricks
<JDubs> I love you guys
<JDubs> xD
<JDubs> *hug*
<workmad3> highest = num.to_s.scan(/\d/).map(&:to_i).each_cons(5).map{|nums| nums.inject(&:*)}.max
nkts has joined #ruby
<workmad3> lupine: if each_cons doesn't solve it, I bet each_slice will ;)
* apeiros_ wonders what the non-brute-force solution would look like
kpshek has joined #ruby
<lupine> ^^
<JDubs> workmad what is &:to_i?
<lupine> things like "given a string, cut it into chunks of X bytes and process"
<workmad3> JDubs: equivalent to doing .map {|n| n.to_i}
<JDubs> so what does &: mean?
<JDubs> current object?
<apeiros_> I guess you could do some kind of rolling check, but hmm
fyolnish has quit [Ping timeout: 252 seconds]
<workmad3> JDubs: no, it's calling to_proc on the symbol :to_i
<lupine> "method(:meth_name)"
<apeiros_> workmad3: &:* --> :*
wikiziner has joined #ruby
arkiver has joined #ruby
<apeiros_> inject accepts symbols by now
<apeiros_> and is probably faster that way
<workmad3> apeiros_: I always prefer to explicitly put the &:* in, and I don't think it's faster
<apeiros_> wanna bet? :)
<JDubs> I dont understand how to &:to_i works still
<Xeago> oh god
<JDubs> &: somehow represents |n|?
arquebus has quit [Remote host closed the connection]
<Xeago> JDubs: no
<Xeago> &:symbol calls symbol on an element
<apeiros_> workmad3: 50% slower in a quick test
<workmad3> apeiros_: because then I just remember to use &:* with enumerable methods all the time, rather than thinking 'if I use inject but don't need to pass an initial value in, then I can use just the symbol on its own)
blacktul_ has joined #ruby
<apeiros_> [72] pry(main)> mbench 100,5,with:->{(1..1000).inject(&:+)},wo:->{(1..1000).inject(:+)}
<apeiros_> with: ø 0.240000ms (20.4%)
<apeiros_> wo: ø 0.160000ms (30.6%)
<apeiros_> wo: 1.0, with: 1.5
<JDubs> xeago: k
<workmad3> apeiros_: ok, I'll remember that :)
<apeiros_> JDubs: foo(&bar) <-- the & tells ruby to convert bar to a block
<apeiros_> ruby does that by calling to_proc on bar if it isn't already a Proc
<workmad3> apeiros_: won't change anything for me, because I prefer to keep my understanding of how to call the enumerables consistent though ;)
<Xeago> apeiros_: doesn't it always call to_proc
<Xeago> even if it is a Proc?
<apeiros_> so if bar == :some_symbol, it does :some_symbol.to_proc
<apeiros_> Xeago: I doubt that (method call overhead)
<apeiros_> Xeago: but you can try, monkey patch Proc and see whether it gets called
blacktulip has quit [Ping timeout: 248 seconds]
<apeiros_> JDubs: and Symbol#to_proc is defined in a way that: range.map(&:to_s) is equivalent to: range.map { |x| x.to_s }
<JDubs> apeiros: i see
<apeiros_> (it's something like: def to_proc; proc { |x, *args| x.__send__(self, *args) }; end)
nazty has quit [Read error: Connection reset by peer]
nazty has joined #ruby
igro has joined #ruby
matthewrobbins has joined #ruby
xandy is now known as xAndy
dr_bob has quit [Ping timeout: 240 seconds]
kpshek has quit []
krz has quit [Quit: krz]
nazty has quit [Read error: Connection reset by peer]
jxriddle has joined #ruby
dr_bob has joined #ruby
bradhe has joined #ruby
nazty has joined #ruby
<JDubs> what is the diff between .send and .__send__
<Hanmac> apeiros_ num.to_s.each_char.map(&:to_i).each_cons(5).map {|a| a.inject(:+)}.max .... bad that i cant get it more nice (i tryed it to make it nice without map)
Phoop has quit [Quit: Phoop]
<lupine> chances of being overridden
<apeiros_> Hanmac: I had newlines in the text, so each_char wouldn't do
<apeiros_> (I copy pasted from the source)
<apeiros_> where the source = project euler
<workmad3> apeiros_: hmm, using your test, .inject(:*) is faster on my machine, but only by about .005s
<workmad3> apeiros_: not 50%
<apeiros_> how long is the complete running time?
<workmad3> 0.140
<workmad3> upped it to 1000 runs each time, .inject(:*) is about 0.05s faster now
atno has quit [Remote host closed the connection]
igro has left #ruby ["Textual IRC Client: www.textualapp.com"]
bradhe has quit [Ping timeout: 248 seconds]
kil0byte has joined #ruby
Godd2 has joined #ruby
hotovson has quit [Remote host closed the connection]
InFlames has quit [Quit: Leaving]
<Godd2> If I set a = 3, and then I call a, it gives me 3. How can I make a class where calling it wihtout a method gives me one of the attributes of the object?
<workmad3> apeiros_: hmm, any ideas why it's 50% on yours but less than 1% on mine? :/
<apeiros_> what's the precise code and ruby version?
Virunga has quit [Remote host closed the connection]
<apeiros_> Godd2: what'
<apeiros_> ?
<Godd2> Ill give an example
kil0byte_ has quit [Ping timeout: 252 seconds]
<Godd2> can I do pastebin here?
bigkevmcd has quit [Ping timeout: 248 seconds]
<workmad3> apeiros_: https://gist.github.com/4267168 <-- code
<workmad3> apeiros_: and ruby 1.9.3 p286
punkrawkR has joined #ruby
bigkevmcd has joined #ruby
<apeiros_> Godd2: see topic, use gist or pastie please
<Godd2> okay
<workmad3> apeiros_: my results end up even closer if I use p327
<apeiros_> Godd2: no, that's not possible
<Godd2> okay thank you :)
<apeiros_> you can let Test act as if it was 2, but you can't make an instance of Test become 2
atno has joined #ruby
ToTo has joined #ruby
<apeiros_> workmad3: odd
<JDubs> Apeiros_ couldn't Godd2 use method_missing to return a default attribute or something?
<apeiros_> JDubs: no, since no method is invoked there
<workmad3> apeiros_: are we going to need to get down into compiler flags? :( :P
<apeiros_> workmad3: I assumed it might be CPU time vs. real time, but both our methods use cpu time
<JDubs> is there a no_method? hehe
<Godd2> is there no method to override when I simply type test
<workmad3> apeiros_: I was reporting user time from using 'time' initially anyway
<workmad3> apeiros_: then constructed the benchmark to double-check
<JDubs> man...my computer sucks or my programming sucks
punkrawkR has quit [Client Quit]
<JDubs> my eueler solutions take forever sometimes
<JDubs> lol
punkjul has joined #ruby
atno has quit [Remote host closed the connection]
<workmad3> Godd2: no
atno has joined #ruby
<Godd2> JDubs: which problem are you working on?
PlaydoBear has joined #ruby
<JDubs> Godd2: 10
<JDubs> looks like it's going to take my computer about 10-15 minutes lol
<Godd2> got it. I just have to override to_s
<workmad3> Godd2: wrong
wikiziner has quit [Remote host closed the connection]
toto_ has joined #ruby
<workmad3> Godd2: that doesn't make test into '2', it just overrides what the string representation is
<workmad3> Godd2: and if you override to_s to return 2, instead of a string, you're doing bad things
ToTo has quit [Ping timeout: 255 seconds]
<Godd2> noted
<Godd2> Ill keep away from having to_s return non strings
<JDubs> Aperios_: My solution to #10 must be horrible lol....I think it might take 20 minutes or longer for my computer to find answer
<Godd2> but if was returning "2", thatd be okay, right?
<apeiros_> workmad3: if I use your Benchmark code, it's ~5% here too. and I checked, the 1000.times within the code is not the reason, that only attributes for <1‰ of the time
<workmad3> Godd2: it still wouldn't be what you want, afaict, but it would be at least fulfilling the contract of 'to_s'
<Godd2> JDubs: If youve already gotten the answer to 10, would you like to see my solution?
<apeiros_> JDubs: project euler questions are often designed in a way that the naive solution takes a lot of time
<workmad3> apeiros_: huh... weird
<JDubs> Godd2: computer is still working through the solution to find out if I have the right answer
<apeiros_> workmad3: yeah, I guess I have to double check my Kernel#mbench method :(
<JDubs> apeiros_ thanks for calling my programming naive :(
<apeiros_> oh, banisterfiend, ping - bug in pry! $ mbench tells me `Error: unexpected $end` :D
wikiziner has joined #ruby
<workmad3> JDubs: not the programming, the solution you're attempting ;)
beiter has joined #ruby
codecaster has quit [Read error: Connection reset by peer]
<JDubs> wow apeiros_ I think it might take over an hour wtf
<JDubs> :/
<apeiros_> JDubs: that's a common term
<workmad3> JDubs: brute-force approaches to project euler are often naive solutions
<apeiros_> JDubs: the "naive" solution is the one which you usually come up first
<apeiros_> and yeah, brute force is almost always "the naive solution"
<workmad3> JDubs: naive as in they don't attempt to do clever optimisations or play on particular insights
red5 has joined #ruby
red5 has left #ruby [#ruby]
<workmad3> JDubs: so they are naive in the purest sense of they encode the least amount of information about the problem in the solution :)
<JDubs> apeiros_ current solution I'm going through https://gist.github.com/4267217
<banisterfiend> apeiros_: interesting, can u give me a repro?
<JDubs> current prime I'm on isn't even over 300000 yet :/
<workmad3> JDubs: for starters, self/2 isn't as good as doing the sqrt and only iterating up to that
<JDubs> I couldn't get sqrt to work
<JDubs> tried to require the math library, but it couldn't find it for some reason
<JDubs> :/
<workmad3> JDubs: not even with (self ** 0.5).ceil ?
<apeiros_> workmad3: ^ contains the mbench code
<JDubs> what is .ceil?
<workmad3> JDubs: rounds a float up to the nearest integer
<Xeago> round upwards
<JDubs> workmad3: wow...I'd say it's over 50-100x faster wtf
<JDubs> lol
pcarrier has quit []
<banisterfiend> apeiros_: and the $ is just a show-source right?
danneu has quit [Ping timeout: 255 seconds]
<apeiros_> banisterfiend: should
<apeiros_> I haven't done anything to change that at least :)
<JDubs> wordmad3: took less than a minute now!! :O
<banisterfiend> cool
<workmad3> JDubs: it massively reduces the number of comparisons you need to make
<apeiros_> same happens when I type 'show-source' out
<JDubs> it took 83 seconds!
<JDubs> crap my answer was wrong lol
<banisterfiend> apeiros_: https://gist.github.com/4267246
<banisterfiend> apeiros_: but ill try on the gem too (that's on HEAD)
a_a_g has quit [Quit: Leaving.]
<workmad3> JDubs: what does 2.is_prime? give you with your code?
<apeiros_> banisterfiend: gem update pry tells me that my pry is newest (not head obviously)
<banisterfiend> yeah
<banisterfiend> ill try to repro on the latest gem now
<JDubs> wordmad3: a true false answer
kil0byte_ has joined #ruby
<banisterfiend> apeiros_: weird, it still seems to work for me
<apeiros_> =(
<banisterfiend> apeiros_: can u do a: cat --ex
<banisterfiend> so generate the exception then do cat --ex a few times
<banisterfiend> then gist that
<apeiros_> banisterfiend: http://pastie.org/5515546
<apeiros_> bad day…
berserkr has joined #ruby
<banisterfiend> yeah..internal thing
<banisterfiend> apeiros_: it only happens on that method right?
<banisterfiend> $ works fine on other methods?
<apeiros_> I don't know whether it only happens for that method, but others work
<banisterfiend> what ruby version?
<banisterfiend> i think it's our syntax checker bugging out
kil0byte has quit [Ping timeout: 265 seconds]
<apeiros_> wtf?
ltsstar has joined #ruby
<apeiros_> method(:mbench).source_location # => ["/Users/stefan/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.10/lib/pry/pry_class.rb", 471]
<apeiros_> that's… not even the one from my pryrc o0
<banisterfiend> haha
<Godd2> workmad3: I believe you can make the prime checker more efficient by instead of checking every integer up to the sqrt of the number in question, you only check every currently known prime
<apeiros_> errr… that source location report is wrong
<apeiros_> that file doesn't even *have* 471 lines…
<workmad3> Godd2: sure, you can do a seive too
<apeiros_> wtf is going on there? o0
<banisterfiend> apeiros_: can u type this: cat /Users/stefan/.rvm/gems/ruby-1.9.3-p327/gems/pry-0.9.10/lib/pry/pry_class.rb:471 -l
<Xeago> workmad3: making a sieve essentially does that
<JDubs> apeiros_ for some reason, I just increased my run-time by about 50% by adding a .step :/
grzywacz has joined #ruby
<JDubs> apeiros_ I thought it would LOWEr my runtime
<apeiros_> banisterfiend: as said, that file doesn't even have 471 lines
a_a_g has joined #ruby
<banisterfiend> apeiros_: oh
<workmad3> Xeago: by 'sieve' there I was naming what Godd2 was describing ;)
<apeiros_> banisterfiend: that .source_location is totally bogus
<workmad3> Xeago: rather than proposing a third approach
haxrbyte has joined #ruby
<Xeago> his approach is different, as he uses a precomputed (or earlier computed/otf) table
<banisterfiend> apeiros_: does $ work on other methods defined ni your .pryrc ?
<Hanmac> apeiros_ it would be funny if source_location works with c-extendions too :D
<Godd2> oh I was suggesting that as you go along, you collect the primes into an array
<apeiros_> banisterfiend: no
vasile has joined #ruby
<apeiros_> banisterfiend: and other methods report that file as source location too
<banisterfiend> apeiros_: so it looks like a but with .pryrc loading
<Godd2> and then only check against the elements of that array
<banisterfiend> let me try
pcarrier has joined #ruby
<apeiros_> banisterfiend: seems like all methods in pryrc report pry_class as source
<JDubs> Apeiros_ any idea why adding a .step would INCREASE my runtime instead of lower it?
<Xeago> JDubs: gist source
<apeiros_> JDubs: if you forgot the step-size
<apeiros_> then it'd be slower
<banisterfiend> apeiros_: yeah, cool, ill try HEAD to see if it's fixed
tps_ has joined #ruby
<banisterfiend> apeiros_: HEAD seems to work ok
<banisterfiend> so whaever weird thing it is, it's fixed :)
<Hanmac> banisterfiend does source_location works with *.so files too? :D
<banisterfiend> Hanmac: no, but we can show source of methods defined in them, many times :)
<banisterfiend> Hanmac: watch this
JohnBat26 has quit [Remote host closed the connection]
<JDubs> Apeiros_ lol all these math problems are pwning my CPU, my fan is going crazy lol
<workmad3> banisterfiend: how long before pry gets pulled into the standard lib to replace IRB? :P
<apeiros_> JDubs: Prime.take_while { |n| n < 2_000_000 }.inject(:+) ~7s on my machine :)
<JDubs> apeiros_ I'm at runtime about 80 seconds now...but my answer is wrong :/
<Xeago> what was the require for prime?
<apeiros_> prime
<apeiros_> trolol ;-p
<Xeago> don't have it :\
<apeiros_> wuzz?
<JDubs> apeiros_ can you help me figure out where my code is bad?
<Xeago> nope, standard osx ruby
<apeiros_> JDubs: gist the latest version?
<workmad3> Xeago: stop using 1.8? :P
<apeiros_> Xeago: standard osx ruby is bad, mkay?
<apeiros_> and it's .18
<apeiros_> 1.8
<banisterfiend> Hanmac: https://gist.github.com/4267326
pcarrier has quit [Ping timeout: 276 seconds]
<banisterfiend> Hanmac: that figures out where *.c files must be stored, and scans them to extract the source of c methods
<apeiros_> JDubs: try `2.is_prime?`
kpshek has joined #ruby
<apeiros_> I bet it returns false for you
<banisterfiend> workmad3: never i think :) we have too many dependencies
<apeiros_> while 2 definitively is a prime :)
<Godd2> JDubs: one reason its taking so long is the putsing
<Hanmac> banisterfiend i need to test if it works for my bindings too ... bacause in 99% i dont have the methods (i generate them via C-Macros)
<banisterfiend> Hanmac: probably not then
<banisterfiend> it's just using a simple C scanner
<apeiros_> oh, and `for i in (3..((self**0.5).ceil)).step(2)` is probably slow indeed. but I have no experience to back that up. just a hunch. I'd try Fixnum#step instead, without the for…in
<Hanmac> (hm my files are *.cpp ... )
<apeiros_> and you can floor the result of **0.5
<apeiros_> (little difference, though)
[Neurotic] has quit [Ping timeout: 252 seconds]
<apeiros_> until current >= 2_000_000 - here you can use for…in with a range instead, should be faster
<apeiros_> ah, or you could adapt your is_prime?, and use .step there. i.e. don't iterate over even numbers and don't test the numbers for being even
<workmad3> hmm, the Prime lib does memoising
<banisterfiend> Hanmac: but it works on libraries like ruby-debug and nokogiri, and so on
<Godd2> apeiros_: shoud he initialize prime_total = 2 ?
<apeiros_> JDubs: anyway, I think your current code omits the lower primes (2, 3)
<Godd2> oh, then prime_total = 5 starting out
JohnBat26 has joined #ruby
<apeiros_> yeah, why not
<apeiros_> saves ~2mio tests
<Hanmac> banisterfiend, my binding may be a bit different then them :P
<JDubs> apeiros_ I don't think it omits 3
<Beoran__> hi apeiros_
<JDubs> is 1 considered a prime?
<apeiros_> hi Beoran__
<workmad3> JDubs: no
<Beoran__> had some fun with Alps?
<Godd2> JDubs: 1 is not prime
<Xeago> some people argue different
<apeiros_> Beoran__: was/am sick, so not much, no :(
<Hanmac> all primes are odd, and 2 is the oddest :P
Banistergalaxy has quit [Ping timeout: 276 seconds]
<Beoran__> Ah, too bad, I hope you're feeling better?
<workmad3> Xeago: it's generally considered to be not prime, because it breaks the uniqueness of prime factorisation
<apeiros_> yes, thanks :) otherwise I wouldn't be here and help solve project euler ;-)
kil0byte has joined #ruby
Solnse has quit []
gbchaosmaster has quit [Ping timeout: 264 seconds]
<JDubs> Apeiros_ my answer is still wrong :/
<apeiros_> JDubs: what's your answer?
<ccooke> Ooh, project euler. Haven't looked at that in ages
Banistergalaxy has joined #ruby
<Godd2> his answer is 142915828923
<JDubs> 142915828925
<apeiros_> hm, that's off by quite a margin
Goles has quit [Quit: Computer has gone to sleep.]
<apeiros_> ah
<apeiros_> that one otoh is only off by 2
haxrbyte has quit [Ping timeout: 252 seconds]
<apeiros_> oh
<apeiros_> wait, no
<Godd2> neither is off by two
<apeiros_> compared the wrong numbers :)
<apeiros_> they're both off by ~2mio
kil0byte_ has quit [Ping timeout: 256 seconds]
<apeiros_> JDubs: oh btw., puts'ing is very slow
<Hanmac> 
dr_bob has quit [Quit: Leaving.]
<JDubs> apeiros_ so my code is adding an extra 2? or not adding a 2 it needs?
tungd has joined #ruby
<apeiros_> JDubs: your code is off by ~2_000_000
<apeiros_> so it's not just the 2
<apeiros_> but 2 things which are wrong with your current code: 1.is_prime? # => true <-- that's wrong
timonv has quit [Remote host closed the connection]
<apeiros_> 2.is_prime? # => false <-- that's wrong too
<Godd2> oh I see why
sepp2k has quit [Quit: Leaving.]
<Godd2> JDubs: would you like to know why its off by 2_000_000?
dr_bob has joined #ruby
<apeiros_> JDubs: what's the last prime your code prints?
timonv has joined #ruby
<apeiros_> I bet you're adding `2_000_003` to the result…
a_a_g has quit [Quit: Leaving.]
<JDubs> 2_000_003
<workmad3> hehe
<apeiros_> you should check your loop condition ;-)
<Godd2> what does the second line of the qeustion on project euler say ? ;)
<apeiros_> JDubs: but you went half way to a pretty clever solution
Ethan2 has joined #ruby
Ethan2 has quit [Changing host]
Ethan2 has joined #ruby
<JDubs> apeiros: how do you mean?
philcrissman has joined #ruby
<apeiros_> JDubs: I'll slightly change your code…
<JDubs> I got the answer right now
<JDubs> time for completion was 41 seconds
undersc0re97 has quit [Ping timeout: 260 seconds]
miso1337 has joined #ruby
sat4x has joined #ruby
<apeiros_> your code slightly altered
<sat4x> is there an easy way of getting the absoluth path of the parent folder in ruby?
<apeiros_> you can further improve it btw. - add memoization. you only have to test a number against prime numbers, not all numbers
<apeiros_> saves you a ton of tests too
<sat4x> say for example i get "/level1/level2/level3/myfile.rb in that file I want /level1/level2
<Godd2> sat4x: which version of Ruby?
<sat4x> Godd2: 1.93
<Hanmac> sat4x: File.dirname(File.dirname("/level1/level2/level3/myfile.rb"))
<sat4x> Hanmac: well that is if I know the path. then I would have never need to use File etc
<Godd2> Hanmac: would File.dirname(File.dirname("../")) not work?
Phoop has joined #ruby
Phoop has quit [Remote host closed the connection]
<Hanmac> yeah he could use __FILE__
<JDubs> apeiros_ add memorization? like run a program to print a cache of primes and then test against that?
<apeiros_> memoization, not memorization ;-)
<Xeago> JDubs: no, save computed primes in a table
<apeiros_> any number you figured to be prime can be added to a list of factors to test against
codecaster has joined #ruby
<apeiros_> all other numbers don't need to be tested
<sat4x> Hanmac: worked, thanks
<sat4x> :)
sat4x has left #ruby [#ruby]
<Xeago> and then you can use those as and the highest prime from that as a lowerbound
<Xeago> remove the first as
<apeiros_> JDubs: in 1..1000, there's only 168 primes. so only 168 tests vs. 1000
<Godd2> JDubs: and then even fewer than 168 if you only check up to the square root
<foucist> apeiros_: so you're saying build an array of primes as you go along
<apeiros_> foucist: correct
<foucist> but memoization means using ||= only afaik
<Xeago> foucist: ||= can be used for memoization
geekbri has joined #ruby
<Xeago> one can also use the approach I said, and use << to append to the array :)
<Xeago> and use ary.last
<apeiros_> foucist: no, memoization is a pattern. ||= is a technique.
<foucist> ah
<apeiros_> you can use hashes, you can use sets
<Xeago> I'd argue that memoization is a technique aswell
grzywacz has quit [Ping timeout: 256 seconds]
<Xeago> and that ||= is an operator
<Xeago> that can be used to for memoization
<apeiros_> not gonna argue about that. but ||= ain't the only way to do memoization, and I think on that we agree.
<Xeago> anyone want to support http://www.kickstarter.com/projects/elliothavok/dash-a-faster-and-smarter-wallet by sending them a dummy EMV card?
<Godd2> apeiros_: I think I implemented that here, but it seems to take longer than JDubs's solution: http://pastie.org/5515697
cascalheira has quit [Quit: Leaving...]
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
vlad_starkov has quit [Remote host closed the connection]
<foucist> JDubs: btw, you can just do "time ruby file.rb" to find out how long it took, instead of the Time.now, if you're running it at the command line
altious has quit [Ping timeout: 252 seconds]
<JDubs> foucist: thanks
<apeiros_> Godd2: it's almost twice as fast for me… pasting up my code…
altious2 has quit [Ping timeout: 265 seconds]
ddd1 is now known as ddd
vlad_starkov has joined #ruby
<JDubs> apeiros_ can you explain the 3.step? Does it mean step starting at 3, until self**.5 rounded down, by steps of 2?
Zai00 has quit [Quit: Zai00]
Slivka has quit [Remote host closed the connection]
berserkr has quit [Quit: Leaving.]
<Godd2> JDubs: step will increment by 1 by default
<Xeago> exactly
<apeiros_> JDubs: exactly
fyolnish has joined #ruby
reppard has joined #ruby
reppard_ has joined #ruby
berserkr has joined #ruby
<JDubs> apeiros_ kk thanks
<apeiros_> with a pristine Prime, `puts Prime.take_while { |n| n < 2_000_000 }.inject(:+)` takes ~11s here btw.
g_bleezy has joined #ruby
mikecmpbll has joined #ruby
schaary has joined #ruby
<apeiros_> (1.3s on a second run)
kil0byte_ has joined #ruby
wikiziner has quit [Ping timeout: 240 seconds]
<foucist> apeiros_: your http://pastie.org/pastes/5515654/text?key=ztt49fsawc8jgnmzvyyqga takes me 15s, running linux in virtualbox on windows, on a 1.8ghz celeron (new but cheapo laptop)
banisterfiend has quit [Remote host closed the connection]
moos3 has quit [Quit: Computer has gone to sleep.]
<apeiros_> foucist: ouch… should be much faster here in that case…
<apeiros_> i7 @ 2.3ghz, no virtualization
Goles has joined #ruby
kil0byt__ has joined #ruby
Xeago has quit [Ping timeout: 250 seconds]
tk__ has joined #ruby
kil0byte has quit [Ping timeout: 255 seconds]
g_bleezy has quit [Ping timeout: 265 seconds]
kirun has joined #ruby
Virunga has joined #ruby
yshh has joined #ruby
<foucist> strange
kil0byte_ has quit [Ping timeout: 255 seconds]
<foucist> apeiros_: falcon patched?
aajjbb has joined #ruby
<apeiros_> no
<apeiros_> falcon causes segfaults here in some cases
<foucist> using rvm head, rvm install 1.9.3 --patch falcon (it's got both falcon & greg price's patch)
<foucist> ah
<apeiros_> also iirc falcon isn't yet ready for p327
<foucist> ah this is on p327 ?
<apeiros_> yes
<foucist> i mean (i have p327)
skaczor has joined #ruby
<foucist> it's p327 falcon patched
<apeiros_> oh
<apeiros_> hm, then it got updated :)
karakedi has joined #ruby
<foucist> yep
<apeiros_> how do I change the name by which rvm installs the ruby?
<apeiros_> i.e., I don't want the falcon patched replace my current 1.9.3
ssspiff has quit [Ping timeout: 264 seconds]
<foucist> no idea, i had p286 before, so it wasn't clobbering a p327 version
dukedave has joined #ruby
sspiff has joined #ruby
yshh has quit [Remote host closed the connection]
SoonerBourne has quit [Read error: Connection reset by peer]
toto_ has quit [Ping timeout: 276 seconds]
aajjbb_ has joined #ruby
`brendan has joined #ruby
SoonerBourne has joined #ruby
acrocity has quit [Ping timeout: 276 seconds]
Neomex has joined #ruby
Neomex has quit [Client Quit]
Zai00 has joined #ruby
acrocity has joined #ruby
pcarrier has joined #ruby
banisterfiend has joined #ruby
codecaster has quit [Quit: Leaving.]
gmci has joined #ruby
gmci is now known as Guest78419
pcarrier has quit [Read error: Operation timed out]
dr_bob has quit [Quit: Leaving.]
moos3 has joined #ruby
_alejandro has quit [Remote host closed the connection]
rakunHo has quit [Remote host closed the connection]
* Hanmac points his finger and laughts about falcon :D
<apeiros_> foucist: did you compile ruby with any special flags? like -O3 or somesuch?
<apeiros_> Hanmac: oh? why's that?
grzywacz has joined #ruby
Banistergalaxy has quit [Ping timeout: 250 seconds]
<Hanmac> falcon does change something about GC right? then it could break my bindings
wikiziner has joined #ruby
s1n4 has quit [Quit: leaving]
<apeiros_> no idea what falcon changes :-/
<foucist> apeiros_: nope, just literally just the 'rvm install 1.9.3 --patch falcon' thing.. um, i'm using the https://github.com/rails/rails-dev-box vagrant recipe, but i doubt that does anything
<foucist> https://gist.github.com/4136373 <- the current falcon patch i believe
pcarrier has joined #ruby
<foucist> Hanmac: there's two options, gc mod and no gc mod
<foucist> er maybe
sepp2k has joined #ruby
Banistergalaxy has joined #ruby
malkomalko has quit [Remote host closed the connection]
mark_locklear has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
WhereIsMySpoon_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<foucist> apparently rvm_configure_env=(CFLAGS="-march=native -O2") is all that's needed with GCC >= 4.3
x0F_ is now known as x0F
WhereIsMySpoon has joined #ruby
WhereIsMySpoon has quit [Changing host]
WhereIsMySpoon has joined #ruby
jenrzzz has joined #ruby
sandGorgon has quit [Read error: Connection reset by peer]
AndChat| has joined #ruby
dr_bob has joined #ruby
Banistergalaxy has quit [Ping timeout: 244 seconds]
sandGorgon has joined #ruby
vasile has quit [Ping timeout: 265 seconds]
<Hanmac> i still dont trust falcon ... if it breaks my binding i would get angry
karakedi has quit [Ping timeout: 240 seconds]
TIBS01 has joined #ruby
krawchyk has joined #ruby
nomenkun has quit [Read error: No buffer space available]
AltGrendel has joined #ruby
<apeiros_> foucist: with falcon, it's 7s here
<apeiros_> will try additional flags
nomenkun has joined #ruby
seanyo has joined #ruby
Xeago has joined #ruby
reppard_ has quit [Ping timeout: 250 seconds]
reppard has quit [Ping timeout: 250 seconds]
<apeiros_> wth? now I get `rvm requires autoreconf to install the selected ruby interpreter however autoreconf was not found in the PATH.`
carloslopes has joined #ruby
<JDubs> euler 11 hurts my brains :/
tps_ has quit [Quit: tps_]
<Godd2> JDubs: have you figured out a pseudocode solution?
nateberkopec has joined #ruby
<apeiros_> I think 11 is bruteforceable too
jeffreybaird has joined #ruby
<apeiros_> Array#transpose can help with one part of the problem ;-)
<apeiros_> also, #each_cons once again
<apeiros_> and then all you're left to find is a good way to get all diagonals
browndawg has quit [Quit: Leaving.]
<brendan`> apeiros_: compiling rvm on OS X?
<Godd2> well Array#transpose will make your code shorter, but will it take less time?
<apeiros_> brendan`: compiling with rvm on osx, yes
<brendan`> install homebrew then: brew install automake
<apeiros_> brendan`: it worked right before
<brendan`> ahh :/
jrajav has joined #ruby
<brendan`> maybe it doesn't like you anymore?
<apeiros_> probably
<apeiros_> all I did was a) install a ruby with falcon patch, b) call `rvm_configure_env=(CFLAGS="-march=nocona -O2 -pipe")`
<apeiros_> I thought b) would only affect the currently open shell, seems I was wrong about that
browndawg has joined #ruby
nwertman has joined #ruby
banisterfiend has quit [Ping timeout: 255 seconds]
TitaniumStudioUs has joined #ruby
zmo_ has joined #ruby
bradhe has joined #ruby
<ddd> apeiros_: .rvmrc gets looked at for evry invocation of rvm
Hanmac1 has quit [Quit: Leaving.]
ffranz has quit [Quit: Leaving]
<apeiros_> ~/.rvmrc? I don't even have that
ferric has joined #ruby
ffranz has joined #ruby
miso1337 has quit [Quit: afk]
Hanmac1 has joined #ruby
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
Shamgar has quit [Ping timeout: 248 seconds]
krz has joined #ruby
<ddd> where are you setting it then that its getting looked at every time? it shojuld only affect the current terminal session if you exported that
bradhe has quit [Ping timeout: 255 seconds]
<apeiros_> In the shell
<ddd> shouldn't affect say, tab 1-N, only tab 4 if thats where you set it
<apeiros_> yes, that was my thought too
<ddd> define 'in the shell'
tommyvyo has joined #ruby
TitaniumStudioUs has quit [Ping timeout: 264 seconds]
<JDubs> Apeiros_ what's wrong with this code? .each_line { |line| num_array << line.split(' ').select{&:to_i }}
Shamgar has joined #ruby
<JDubs> I can't get it to run the to_i
<ddd> its not being set here on mine. If i set export MYTEST='test' then printf | grep MYTEST its doesn't show up
<apeiros_> well, I opened a new shell, type `rvm_configure_env=(CFLAGS="…")` and hit enter. which should set the env var $rvm_configure_env
<JDubs> getting an error on the ampersand
<apeiros_> which it does
<apeiros_> and it does indeed not affect other windows wrt the env var
<apeiros_> *other shells
<ddd> so if you do: export rvm_configure_env=(CFLAGS="-march=nocona -O2 -pipe") then only the specific tab you did that in will pick it up
<ddd> its a shell variable
<ddd> ok
mikecmpbll has quit [Quit: Computer has gone to sleep.]
<apeiros_> JDubs: it would be select(&:to_i)
<apeiros_> but that makes little sense, you want map instead of select maybe?
<ddd> was like errR? because each tab is its own session. would have violated no-leak
<apeiros_> ddd: totally… so the question is now, what fucked up my rvm? o0
wchun has joined #ruby
<JDubs> apeiros_ i can't ever remember which one does which thing...
<ddd> apeiros_: if you want ALL sessions to have it, stick it in ~/.rvmrc of course
<JDubs> :/
<JDubs> apeiros_ how do you rememebr?
<ddd> apeiros_: no clue. define 'fucked up'
<apeiros_> JDubs: remember what?
nga4 has joined #ruby
<Godd2> apeiros_: I think he's asking how you remember every array method
<apeiros_> oh well, their name is quite telling
devians has joined #ruby
<apeiros_> select - select a few items from the list
<apeiros_> reject - reject a few items from the list
<apeiros_> map - map the value of each item to a new value
<Hanmac> find_all - alias for select
<Godd2> JDubs: Youll start remembering them over time. The more you use them the more you'll remember them
<ddd> apeiros_: as for your named ruby install, see https://rvm.io/rubies/named/
<devians> hey, im trying to use puppet on osx. i have 1.8.7 system ruby and 1.9.3 via homebrew. puppet requires the former, vim requires the latter. how can i get these things to co-exist?
<apeiros_> ddd: yeah, did that, didn't like it as it seems
<apeiros_> ddd: use -n falcon
<apeiros_> resulted in just overriding my existing 1.9.3
* apeiros_ not amused
<ddd> could be because its a patch name so conflicted (?)
mjbamford has quit [Quit: Leaving...]
<JDubs> apeiros_ I'm having a bit of trouble...i have an array of arrays
<JDubs> I want to do each with index on both levels of the array
<JDubs> but on the second level, it's saying cant each with index fixnum
<apeiros_> JDubs: paste
tps_ has joined #ruby
<lupine> you've got the arguments the wrong way around
schaary has left #ruby [#ruby]
<lupine> I think the order is |item, i| but I could be wrong
<ddd> apeiros_: you'll have to hit up mpapis for that. not sure whats going on there
carloslopes has quit [Read error: Connection reset by peer]
<apeiros_> ddd: I will, but not now. my head is still achy from that stupid sickness
carloslopes has joined #ruby
<ddd> ouch :/
<ddd> apeiros_: know how you feel. I'm still on antibiotics here.
<apeiros_> :-S
<apeiros_> get well too then
<ddd> you too :)
ananthakumaran has quit [Quit: Leaving.]
altious has joined #ruby
altious2 has joined #ruby
<JDubs> oops nevermind think i see the problem
<lupine> <lupine> you've got the arguments the wrong way around ^^
TitaniumStudioUs has joined #ruby
<Godd2> JDubs: I used 11 as an opportunity to become familiar with how Ruby deals with file I/O ^.^
<lupine> debugging tip: inspect the variables the error refers to
<lupine> it'd've saved you a gist
<apeiros_> JDubs: a different way to get your numbers array: http://pastie.org/5515962
schaerli has joined #ruby
joshman_ has joined #ruby
mikecmpbll has joined #ruby
carlyle has joined #ruby
heftig has quit [Quit: leaving]
aajjbb_ has quit [Remote host closed the connection]
aajjbb has quit [Remote host closed the connection]
miso1337 has joined #ruby
ExxKA has joined #ruby
<apeiros_> oh wow, reading fail… I had an answer and it was way higher than what was in the problem - but I looked at the example number instead of the answer :D
Guest78419 has quit [Ping timeout: 244 seconds]
lkba has quit [Ping timeout: 252 seconds]
rondale_sc has joined #ruby
philips_ has quit [Excess Flood]
fyolnish has quit [Remote host closed the connection]
altious2 has quit [Ping timeout: 255 seconds]
altious has quit [Ping timeout: 265 seconds]
fyolnish has joined #ruby
fyolnish has quit [Read error: Connection reset by peer]
dukedave has left #ruby ["PART #RubyOnRails :QUIT :Leaving."]
mjolk2 has joined #ruby
fyolnish has joined #ruby
ttt has quit [Remote host closed the connection]
philips_ has joined #ruby
carloslopes has quit [Remote host closed the connection]
mercwithamouth has joined #ruby
lolmaus has quit []
joshman_ has quit [Quit: Computer has gone to sleep.]
tps_ has quit [Quit: tps_]
ffranz has quit [Quit: Leaving]
haxrbyte has joined #ruby
GoGoGarrett has joined #ruby
flip_digits has joined #ruby
samphippen has joined #ruby
postmodern has quit [Quit: Leaving]
jtharris has joined #ruby
jim80net has joined #ruby
ffranz has joined #ruby
willob has joined #ruby
aquaranto has joined #ruby
Neomex has joined #ruby
Neomex has quit [Client Quit]
TitaniumStudioUs has quit [Quit: This computer has gone to sleep]
sandGorgon has quit [Ping timeout: 244 seconds]
MissionCritical has quit [Ping timeout: 252 seconds]
digitalcakestudi has joined #ruby
nari has joined #ruby
rakl has quit [Quit: sleeping]
hotovson_ has joined #ruby
bananastalktome has joined #ruby
yonda has joined #ruby
bbttxu has joined #ruby
swex_ has joined #ruby
areil_ has joined #ruby
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ruby
chussenot has joined #ruby
Gooder has joined #ruby
areil has quit [Ping timeout: 252 seconds]
sailias has joined #ruby
atal421 has joined #ruby
bananastalktome has quit [Client Quit]
swex has quit [Ping timeout: 264 seconds]
bananastalktome has joined #ruby
havenn has joined #ruby
bananastalktome has quit [Client Quit]
areil has joined #ruby
havenn has quit [Remote host closed the connection]
cakehero has joined #ruby
d2dchat has joined #ruby
sspiff has quit [Ping timeout: 252 seconds]
jrist-afk is now known as jrist
areil_ has quit [Ping timeout: 264 seconds]
skaczor has quit [Remote host closed the connection]
a_a_g has joined #ruby
NiteRain has joined #ruby
epwhorl has joined #ruby
yonda has left #ruby [#ruby]
ananthakumaran has joined #ruby
<apeiros_> JDubs: btw., euler11 can be solved with a one-liner too ;-) (granted, 190 chars long, but no ; in it)
reppard has joined #ruby
blaxter has quit [Ping timeout: 246 seconds]
sspiff has joined #ruby
reppard_ has joined #ruby
banister_ has joined #ruby
mercwithamouth has quit [Ping timeout: 248 seconds]
ExxKA has quit [Quit: This computer has gone to sleep]
Jck_true has quit [Remote host closed the connection]
areil has quit []
xscc has joined #ruby
xscc has quit [Client Quit]
execute has joined #ruby
<JDubs> apeiros_ my solution so far, although getting wrong number for some reason
execute has quit [Client Quit]
bradhe has joined #ruby
<Godd2> If Im overriding Array, where in my file do I put that? In the class that's using it?
<JDubs> in a class called Array Godd2
reppard_ has quit [Ping timeout: 256 seconds]
reppard has quit [Ping timeout: 256 seconds]
cascalheira has joined #ruby
<Godd2> right, but do I do that inside the other new class or outside of it
<Godd2> ill get a gist, one sec
cakehero has quit [Quit: Computer has gone to sleep.]
lobak has quit [Ping timeout: 240 seconds]
jim80net_ has joined #ruby
<JDubs> depends what scope you want to override it in, I believe
_nitti has joined #ruby
<JDubs> so if you only want it overriden in your current class, make it a subclass I thinki
<JDubs> Apeiros_ ya there bromo
lobak has joined #ruby
jim80net_ has quit [Remote host closed the connection]
theRoUS_ has joined #ruby
jim80net_ has joined #ruby
pavilionXP__ has joined #ruby
jim80net has quit [Read error: Connection reset by peer]
jim80net_ is now known as jim80net
<workmad3> Godd2: first question - is the new_method only really applicable to this particular type of array from Game?
vasile has joined #ruby
<workmad3> Godd2: or is it universally applicable in your app?
bradhe has quit [Ping timeout: 248 seconds]
<Godd2> workmad3: its a tictactoe game and the array is a row of cells and Im checking if all of their contents are the same
dmerrick has joined #ruby
<workmad3> Godd2: right, so the new method is really only applicable to this particular array
<Godd2> oh so I shouldnt go to the trouble of overriding Array?
<workmad3> Godd2: so there are two nicer approaches that don't globally pollute the array with a very specific method... one is to create a new class that wraps up the array and add the new method there
Guest73164 has joined #ruby
Hanmac has quit [Quit: Page closed]
<workmad3> Godd2: the other would be to extend the specific array instance you're using with a module that contains the method(s) you want to add
<JDubs> wordmad3: can you look at this please? https://gist.github.com/4268225
epwhorl has quit [Quit: Leaving]
<JDubs> wordmad3: i'm getting the wrong answer for euler 11
<workmad3> 0o
<workmad3> I've never done that problem...
<JDubs> ok :(
<workmad3> the 0o is more to do with being confronted with that grid btw :)
lowkey has joined #ruby
DaZ has quit [Ping timeout: 265 seconds]
<workmad3> ok, so I know how I'd approach the problem
skaczor has joined #ruby
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
yalue has joined #ruby
phantasm66 has joined #ruby
AlSquire has joined #ruby
AlSquirrel has quit [Read error: Connection reset by peer]
<workmad3> I'd personally approach it from a data-structure centric view... you have a 2d grid, you want to extract from it every set of 4 adjacent, straight line elements
taoru has quit [Remote host closed the connection]
<workmad3> so I'd focus on how to do that first, rather than on both problems
<workmad3> because I know once I've solved that bit, the rest is trivial
ejnahc has quit [Remote host closed the connection]
banister_ has quit [Read error: Connection timed out]
AlSquirrel has joined #ruby
ejnahc has joined #ruby
AlSquire has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
carloslopes has joined #ruby
quest88 has joined #ruby
<lowkey> hello .. is there a way I could tell ruby where "public" images/stylesheets/js are ? something like 'config.action_controller.asset_host' but it's not hosts based .. I just like to "add" another subdir in url where things are .. because I am proxying request via nginx server and I'd like to serve static content with nginx
MissionCritical has joined #ruby
xclite has joined #ruby
<JDubs> @workmad3 I don't really know what you mean...Isn't that what I did?
stopbit has joined #ruby
<Godd2> workmad3: ok thanks, ive gone ahead and created a Row class and Im gonna define uniqueness there
elico has joined #ruby
xhoy has joined #ruby
haxrbyte has quit [Remote host closed the connection]
xeocs has joined #ruby
pu22l3r has joined #ruby
haxrbyte has joined #ruby
haxrbyte_ has joined #ruby
xeocs has left #ruby [#ruby]
haxrbyte has quit [Read error: Connection reset by peer]
quest88 has quit [Quit: quest88]
pu22l3r has quit [Remote host closed the connection]
nobuoka has joined #ruby
iamjarvo has quit [Quit: Leaving.]
entrenador has joined #ruby
<workmad3> JDubs: you've jumbled together all 3 things, the extraction of each 4-tuple, the summation, and the determination of the highest value
nomenkun has quit [Read error: Connection reset by peer]
<workmad3> JDubs: I've suggesting that you split each bit out so that it's more amenable to reasoning
nomenkun has joined #ruby
ner0x has joined #ruby
adamnbowen has joined #ruby
altious has joined #ruby
ananthakumaran has quit [Ping timeout: 252 seconds]
buibex has joined #ruby
joshman_ has joined #ruby
elaptics is now known as elaptics`away
burgestrand has quit [Quit: Leaving.]
tk__ has quit [Quit: ばいばい]
<JDubs> @workmad3 I'm not sure what could be wrong, I've picked a bunch of random products to check for, and they are all in the product list...
<JDubs> @workmad3 so I don't know what could be wrong
nomenkun has quit [Read error: Connection reset by peer]
nwertman has quit [Ping timeout: 255 seconds]
nomenkun has joined #ruby
havenn has joined #ruby
bean has joined #ruby
k610 has joined #ruby
<JDubs> where did everyone go?!
vasile has quit [Read error: Connection reset by peer]
pu22l3r has joined #ruby
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<banisterfiend> JDubs: to the pub
<apeiros_> JDubs: check your 'straight down' part again
pu22l3r has quit [Read error: Connection reset by peer]
atal421 has quit [Quit: atal421]
<JDubs> Apeiros_ doh!!! Can't believe I didn't see that lol
wikiziner has quit [Remote host closed the connection]
pu22l3r has joined #ruby
<apeiros_> but iirc the solution is not in the vertical products
<JDubs> apeiros_ well i Got the answer right now :)
<JDubs> Any suggestions small suggestions to improve my function?
<apeiros_> JDubs: as said, I use each_cons
<apeiros_> for your case, I'd probably just use 0.upto(16) for both row & col
joshman_ has quit [Quit: Computer has gone to sleep.]
miso1337 has quit [Quit: afk]
_nitti_ has joined #ruby
ttt has joined #ruby
Xeago has quit [Ping timeout: 248 seconds]
Xeago has joined #ruby
<JDubs> hmmm
<bean> JDubs: still in here working on ruby, eh?
<bean> :P
<JDubs> bean: yeah
thams has quit [Quit: thams]
<JDubs> apeiros_ how could I have used each_cons? like... num_array[row][column].each_con(4)?
browndawg has left #ruby [#ruby]
<apeiros_> JDubs: num_array[row][column] already gives you a number, each_cons on a number would be pointless
<JDubs> hmmm
schaary has joined #ruby
<JDubs> I don't know how to use it then lol
<apeiros_> more like: table.map { |row| row.each_cons(4).map { …product… }.max }.max
<Godd2> Im not sure how elegant it is, but here was my solution to 11: http://pastie.org/5516216
<apeiros_> that'd get you the max row
MissionCritical has quit [Ping timeout: 248 seconds]
<apeiros_> Godd2: elegance is subjective :)
carloslopes has quit [Ping timeout: 240 seconds]
Slivka has joined #ruby
<Godd2> well I wrote it before I read Clean Code, so you be the judge ;)
stefhen has joined #ruby
Slivka has quit [Max SendQ exceeded]
_nitti has quit [Ping timeout: 260 seconds]
Slivka has joined #ruby
<apeiros_> Godd2, JDubs, my 2 solutions: http://pastie.org/private/0lq5ecg7cvxeajqt7syfq
GoGoGarrett has quit [Remote host closed the connection]
browndawg has joined #ruby
<apeiros_> gah, should be *oneliner
<JDubs> apeiros_ i hate reading your solutions because it makes me realize how bad I am lol
ttt has quit [Ping timeout: 245 seconds]
<apeiros_> and no edit in pastie anymore :(
atal421 has joined #ruby
heftig has joined #ruby
<entrenador> Just a general language question: What does Ruby convention encourage as far as using the return keyword in methods?
<apeiros_> JDubs: why? getting a solution is good
<entrenador> Only when necessary?
<apeiros_> entrenador: convention is not to use it
atal421 has quit [Client Quit]
a_a_g has quit [Quit: Leaving.]
mpd106 has joined #ruby
<Xeago> entrenador: only when necessary, there are use cases to exit a method earlier on for example
<bean> entrenador: this is what github says: https://github.com/styleguide/ruby
<apeiros_> earlier exit often is spaghetti code, though
<bean> Avoid return where not required.
<apeiros_> the most common example of early exit would be handling edge-cases at the very beginning of your method
<Xeago> apeiros_: and those are basically the only ones :)
mpd106 has quit [Remote host closed the connection]
wermel has joined #ruby
odyssey4me has quit []
<apeiros_> Xeago: agreed
<JDubs> apeiros_ wow tranpose is pretty awesome
<entrenador> Thanks apeiros_, bean , Xeago
carloslopes has joined #ruby
<Xeago> wow perfectly alphabetic credits! :D
<entrenador> lol it just worked out that way...not intentional :P
<JDubs> apeiros_ wow the diagonal part is a bit beyond me lol
<Xeago> tss, cut it out :3
<bean> JDubs: what # is this?
GoGoGarrett has joined #ruby
<apeiros_> JDubs: I take 4 lines per iteration
skaczor has quit [Remote host closed the connection]
<apeiros_> JDubs: then I move the 2nd line to the left by 1
<apeiros_> the 3rd line to the left by 2
<JDubs> bean: problem 11
<apeiros_> and 4th by 3. that way I can treat it like vertical column products
<workmad3> JDubs: https://gist.github.com/4268635 <-- that's my solution
<bean> my solution for 11 is not short or elegant
<workmad3> couldn't be bothered to remove the duplication between the left and right diagonals :)
<apeiros_> if I'd solve it *nicely*, I'd probably create a class Table and provide accessors for the tuples
dawkirst_ has quit [Ping timeout: 264 seconds]
<JDubs> workmad3 your code hurts my brain too :/
<JDubs> Hopefully eventually this stuff no longer hurts to look at
<JDubs> :/
<Xeago> that table always hurts
<Xeago> doesn't matter how long you program it will hurt
skaczor has joined #ruby
<workmad3> JDubs: it's just doing what I suggested - instead of trying to calculate everything at once, I instead calculate 4 data structures, one of the rows, one of the columns, one of the 'left diagonals' and one of the 'right diagonals'
<workmad3> JDubs: and yeah, as Xeago said, the embedded 20x20 data table in the code will always hurt :)
<JDubs> @workmad3 you mean parsing the numbers will hurt? not sure what you are saying, sorry.
<workmad3> JDubs: not the parsing, just the mere presence
<workmad3> JDubs: that grid of numbers directly in code... ewww
<JDubs> workmad3 yeah lol
stefhen has left #ruby [#ruby]
xpen has joined #ruby
<JDubs> workmad3: I'm really looking forward to when reading other peoples code, like yours, doesn't hurt my brain to where I'm struggling to even look at it, let alone understand it.
<Xeago> read pretty code :3
<workmad3> JDubs: with project euler solutions, that's not likely to ever happen...
<bean> had ti make sure it worked.
<apeiros_> Godd2: why line 28-31?
BigO has joined #ruby
tagrudev has quit [Remote host closed the connection]
jgarvey has joined #ruby
cj3kim has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
wikiziner has joined #ruby
<apeiros_> Godd2: I like the approach, I think some details could be done nicer (e.g. use .max instead of line 38-41)
wf2f has quit []
<workmad3> JDubs: because the problems are small, so don't need the abstractions you'd introduce by engineering a solution that would make it nicely readable, and the problems also go for clever solutions, which tend to require mental overhead
nomenkun has quit [Remote host closed the connection]
<apeiros_> Godd2: also proper init of product would be 0 ;-)
<Godd2> apeiros_: I think it was to reset the value wach time?
phelps has quit [Ping timeout: 255 seconds]
ananthakumaran has joined #ruby
<apeiros_> Godd2: what for? you assign a new value anyway
<Xeago> workmad3, JDubs: and also often have mathematical complexity
<Godd2> apeiros_: I wouldnt want to set the product to 0, because if I go in and *=, it will still be 0
Goles has quit [Ping timeout: 252 seconds]
C0deMaver1ck has joined #ruby
<apeiros_> Godd2: you don't do product*anything in the code
<workmad3> Xeago: yeah, that too, which tends to lead to a certain amount of complexity
S0da has joined #ruby
<Godd2> I didnt in this case, thats correct
<apeiros_> Godd2: you're using product as the maximum product
nat2610 has joined #ruby
<JDubs> workmad3: True... Bean: nice solution... I feel like I'm the worst coder in this chatroom :P
freeayu has quit [Remote host closed the connection]
<apeiros_> and the for that reason it should be set to the smallest possible product - which is 0
<JDubs> JDubs, I need the hyperbolic time chamber :(
Slivka has quit [Read error: Connection reset by peer]
<JDubs> errr
philcrissman has quit [Remote host closed the connection]
nari has quit [Ping timeout: 240 seconds]
<bean> lol, JDubs. I've been writing ruby for a while. Took some courses in college that I used ruby in, etc.
<apeiros_> Godd2: same for line 28-31 if they were actually needed
<JDubs> Apeiros_, Bean, Xeago, Workmad3, Godd2: I need the hyperbolic time chamber
jpfuentes has joined #ruby
jpfuentes has left #ruby [#ruby]
<apeiros_> JDubs: who doesn't…
rippa has joined #ruby
jackdanger has joined #ruby
<JDubs> Apeiros_ I mean so I can do well in my course...My class starts March
mikepack has joined #ruby
wikiziner has quit [Remote host closed the connection]
<JDubs> Apeiros_ I want to be as overprepared as possible, and be in the top of the class
<JDubs> lol
phelps has joined #ruby
Goles has joined #ruby
<bean> JDubs: what is the course
<Xeago> JDubs: what is the level of the class?
swarley-freenode has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
AlSquirrel has quit [Read error: Connection reset by peer]
AlSquire has joined #ruby
<Xeago> they are good, don't stress, just code :)
<JDubs> Xeago: what do you mean
<bean> so they're going to teach you basic ruby... but you already know basic ruby?
<Xeago> just continue coding, don't stress about becoming the best of the class
<Xeago> or whatever you are stressing about
drfreeze has joined #ruby
<JDubs> Xeago: the better I do in the course, the higher salary I will be likely to get when I get done, so it's pretty important :)
<Xeago> you have the gist of most of it we say and the will to understand
<drfreeze> Anyone here know how to handle file and directory names with special characters on Windows?
<JDubs> Bean: at some point I need to start working on rails I think, and then start learning javascript maybe?
bradhe has joined #ruby
<drfreeze> I have a file name "+FOLDER TEMPLATES"
<JDubs> Xeago: Thanks :)
cakehero has joined #ruby
<drfreeze> Dir.chdir does not like the +, even if I quote the name
<bean> heh, JDubs, I doubt you need to know much about rails beforehand
<Xeago> JDubs: it would be good for you to get used to rails tho
<Xeago> it is completely different
<Xeago> what bean said
<Xeago> :)
<JDubs> I know, but I'm afraid of getting left behind
<Xeago> but that is something you haven't seen before
<JDubs> or getting confused and not finishing etc
<bean> lol
<JDubs> I want to make sure I do well in the course
<bean> It's not nearly as big of a deal as you're making it out to be
<JDubs> This is, in my opinion, my last shot at a good career and not flipping burgers the rest of my life
nemesit has quit [Quit: Leaving...]
<JDubs> bean: big deal to me... :/
<Xeago> JDubs: do you know what heroku is?
<bean> why?
jlast has joined #ruby
<JDubs> Bean: plus I need a good career so I can get married to my fiance and support us
<Xeago> JDubs: if so, host a railsapp there that does all of your euler stuff
<Xeago> :)
wikiziner has joined #ruby
<JDubs> Xeago: no I don't know what a heroku is, is it like a haiku?
jdripper has joined #ruby
tjbiddle has joined #ruby
<Xeago> JDubs: heroku.com
<Xeago> get started :)
altious has quit [Ping timeout: 264 seconds]
x82_nicole has joined #ruby
<Xeago> haiku = verse/poem iirc like a 353 or something?
<Xeago> or 7 11 7
nat2610 has quit [Quit: Leaving.]
<JonnieCache> i think its 7 11 7
<JDubs> 5 7 5
AlSquire has quit [Ping timeout: 265 seconds]
<JDubs> This is a haiku, your mom is so very fat, refrigerator
banisterfiend has quit [Remote host closed the connection]
<JDubs> ^ like that ^
<bean> JDubs: why is this your "last chance"
<JDubs> bean, because I have no degree in anything, I'm almost 30, and I need to get a career going before I'm ancient...
uris has joined #ruby
<bean> Ah.
<Xeago> JDubs: coursera, it is awesome
<Xeago> doing crypto there, the course for algorythms is really fun
<JDubs> I always love computers/IT/programming etc as a teenager, then I went into the Army and forgot about it basically
bradhe has quit [Ping timeout: 256 seconds]
altious has joined #ruby
carloslopes has quit [Remote host closed the connection]
buibex has quit [Remote host closed the connection]
<JonnieCache> JDubs: if youre working through the euler problems then youre doing very well
<JonnieCache> JDubs: youd be shocked at the average ability of programmers in industry
wikiziner has quit [Remote host closed the connection]
<JDubs> JonnieCache: really??? why is that???
_alejandro has joined #ruby
<bean> Most programmers suck.
<apeiros_> sad but true :(
<JonnieCache> most people out there dont have the first clue what theyre doing
<bean> I'm a sysadmin and I can code better than half of them I'd say.
AlSquire has joined #ruby
<Xeago> JDubs: we asked you to do fizzbuzz
<apeiros_> lots of copy coding
<oqa> JDubs: coding is just part of the whole trade, if you're planning on higher salaries invest some time on other skills also
<apeiros_> lots of cargo culting
<Xeago> I know a lot of people that can't do it
<Xeago> googlecoding
eldariof has quit [Ping timeout: 264 seconds]
<virtualentity> i tend to believe it's the businesses who breed those "bad coders" though
<JDubs> Xeago: Fizzbuzz?
joshman_ has joined #ruby
MissionCritical has joined #ruby
<Xeago> yup
<apeiros_> also languages like ruby and java enable people without deeper understanding to code, which is great, but also leads to code which has horrible issues
<JDubs> Oqa: what do you suggest?
<oqa> oqa: the skills that pay the most have little to do with coding
<virtualentity> the business doesn't care about the code. then why hire "expensive" programmers?
<JDubs> Xeago: not sure what you mean man
<oqa> err JDubs
<Xeago> fizzbuzz challenge, google it
<oqa> sleep deprivation is starting to have effect
<apeiros_> like "what's wrong with array.any? { |x| other_array.include?(x) } - it's just one loop, why is it so slow?"
<apeiros_> (because it's two loops and because there are more efficient ways to get the same result)
dmiller has joined #ruby
<apeiros_> oqa: such as? :)
AlSquirrel has joined #ruby
<JDubs> oqa: What skills should I work on besides programming?
<workmad3> JDubs: https://gist.github.com/4268635 <-- I neatened things up a bit
iamjarvo has joined #ruby
<JonnieCache> JDubs: writing clearly
<JonnieCache> JDubs: explaining things in general
buibex has joined #ruby
<JDubs> JonnieCache: You mean comments?
AlSquire has quit [Read error: Connection reset by peer]
<bean> No, not comments necessarily.
<oqa> JDubs: for example to understand what the customer really needs it's useful to have people skills.. http://www.amazon.com/The-Trusted-Advisor-David-Maister/dp/0743212347
<workmad3> oqa: as I've heard said before - 'programming is a social problem'
<bean> Also, learning how to estimate how long something will take is a hard thing to do
<JonnieCache> JDubs: partly comments but its mostly about communicating with people
<JonnieCache> oh yeah what bean said. but thats basically impossible :)
<oqa> JDubs: also it doesn't hurt to understand something about software development processes and tools, like scrum and kanban
ltsstar has quit [Quit: ltsstar]
<JDubs> oqa: any suggested reading materials?
<workmad3> in addition, programming in the small, like with these project euler problems, require a certain amount of cleverness and the ability to think through the problems, but require almost no design
<oqa> JDubs: here's one for a nice overview of all the different tools and approaches that help -> http://www.amazon.co.uk/Continuous-Delivery-Deployment-Automation-Addison-Wesley/dp/0321601912
<Xeago> I second that book
<workmad3> whereas large projects require good amounts of code design, code organisation, etc. across the board
elico has quit [Quit: Elico]
<JDubs> Anything in PDF or HTML format? I can't buy any paper books cause im in Wales atm.
beilabs_ has quit [Ping timeout: 264 seconds]
<oqa> JDubs: google ;)
<workmad3> JDubs: amazon deliver to wales :P
headius has joined #ruby
<Xeago> most of those are for home copying use aswell on certain sites *cough*
mr-rich has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
<oqa> Godd2: agreed
<JDubs> @workmad3 Yeah but I had to cancel my credit card so I only have cash with me until I get home lol
<Xeago> tho, that is a shame
rhweix has joined #ruby
<workmad3> JDubs: ah, that's a different problem, conflated with being in wales ;)
<JDubs> workmad3 yep
<workmad3> JDubs: also, commisserations on having to spend time in wales...
mikepack has quit [Remote host closed the connection]
<workmad3> *commiserations
swarley-freenode has quit [Ping timeout: 260 seconds]
<oqa> Godd2: I'd say clean code is a little advanced though, I don't know if the things it shows open up without experience about the bad issues
<JDubs> wordmad3: I'm here visiting family and my fiancee :)
<JDubs> wordmad3: Sooner I get a decent job, sooner I can get us a place and we can get married.
<JDubs> xD
Gooder has quit [Remote host closed the connection]
<workmad3> JDubs: also, my nick only has one d in it... and it has a k that you're missing out :P (tab-complete ftw!)
<Godd2> oqa: That's fair. also it's easier to read if one is familiar with C-esque code
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<bean> oqa: Godd2: we did a Clean Code book group at work, learned a lot
tvsutton has joined #ruby
<Godd2> alright then it's agreed. tonight's reading material is to read Chapter 1 of Clean Code. There will be a quiz at 2300 hours
generalissimo has joined #ruby
suhi has joined #ruby
<workmad3> Godd2: I'll look forward to it! (although I haven't read clean code for a while now)
<JDubs> @Godd2 I've written in C
EyesIsMine has quit [Ping timeout: 248 seconds]
<oqa> bean: yea, it's nicely thought provoking.. I think most of my 200 colleagues have read it.. we're passionate about coding standards
<Godd2> JDubs: Is Ruby your first Object Oriented language?
<Xeago> *!*!*!* but c is OO :O?
<Xeago> hurrhurrhurr
<JDubs> Godd2: yes
<suhi> hi
<JDubs> suhi hello o/
<workmad3> still... books... TDD By Example, Clean Code, Refactoring, Growing Object Oriented Software, Practical OO Design in Ruby, Patterns of Enterprise Application Architecture, xUnit Test Patterns, Specification By Example, The Agile Samurai, Agile Estimating and Planning, Eloquent Ruby....
rhweix has quit [Remote host closed the connection]
<workmad3> that'll get you started... :P
<bean> Learning Agile is good
<bean> in general
<JDubs> workmad3: :O
<JDubs> workmad3: when will I find the time/money to read all these books?! lol
<Godd2> if you're a video person, you can watch the Lynda.com Ruby tutorials
<Godd2> that's how I learned
<suhi> hi dear
havenn has left #ruby ["Leaving..."]
havenn has joined #ruby
xpen has quit [Remote host closed the connection]
<workmad3> JDubs: well, I managed to wrangle them through work, and I read them over the course of the last few years on my daily commutes ;)
<oqa> JDubs: software development is about continuous improvement, things are moving so fast that if you don't keep up you might be left behind at some point
EyesIsMine has joined #ruby
xpen has joined #ruby
<JDubs> workmad3: very nice, but atm I'm jobless and all my money is going into the course and living expenses while on the course
<JDubs> oqa: Don't get me wrong, I love learning :)
<oqa> JDubs: that's the right attitude :)
nazty has quit [Ping timeout: 264 seconds]
<workmad3> JDubs: oh, I forgot The Mythical Man Month, Pragmatic Programmers and Kanban...
<oqa> hehe
<workmad3> JDubs: that's the pick of our work bookshelf that I'd probably suggest people at least try to read when they have a chance :)
<JDubs> btw, if anyone wants an eager-to-learn entry-level to work for them, let me know xD
<JDubs> heh
cj3kim has joined #ruby
<oqa> it seems that there are a few legendary software development books
<workmad3> JDubs: the rest of the work bookshelf is pretty evenly split between web development and sysadmin stuff :)
arkiver has quit [Ping timeout: 240 seconds]
Virunga has quit [Remote host closed the connection]
<JDubs> One of the books I'm going through atm is Beginning Ruby 2nd edition
<JDubs> among others
<oqa> JDubs: I heard there's a shortage of developers in Berlin
<oqa> ;)
daniel_hinojosa has joined #ruby
xpen_ has joined #ruby
<JDubs> oqa: I'll go wherever if the pay is good lol
tjasko__ has joined #ruby
mr-rich has joined #ruby
cj3kim has quit [Client Quit]
headius has quit [Quit: headius]
<JDubs> although I prefer UK or america
beilabs_ has joined #ruby
headius has joined #ruby
<Xeago> JDubs: videofy.me has an open spot
matrixise has quit [Read error: Connection reset by peer]
<bean> JDubs: unfortuantely you don't know scala, so I can't help you there :P
beiter has left #ruby [#ruby]
<oqa> berlin is such a melting pot that I'd imagine it'd be easy to manage there even without any german skills
<Xeago> tho beware, the codebase is worse than what you write
matrixise has joined #ruby
<workmad3> I keep on hearing that there's a lot of interesting stuff in SF at the moment
<Godd2> As for Berlin. if you need to learn some German fast, go to http://www.duolingo.com
TitaniumStudioUs has joined #ruby
suhi has left #ruby [#ruby]
<workmad3> but they tend to be looking for people with established reputations, I believe, especially if it's someone who'd have to emmigrate to the US
xpen has quit [Ping timeout: 265 seconds]
<JDubs> @workmad3 I'm from the US
swarley-freenode has joined #ruby
<JDubs> @workmad3 and moving to SF in february lol
<workmad3> JDubs: heh
Jasko has quit [Ping timeout: 264 seconds]
<bean> Godd2: duolingo rocks.
<workmad3> JDubs: incidentally, the general feeling I tend to get is that qualifications, course scores, etc. don't particularly matter too much to a lot of the companies you'd actually want to work at
* bean works in the midwest at a company that does bank websites / other financial solutions.
geekbri has quit [Remote host closed the connection]
<bean> workmad3: +++++
<workmad3> JDubs: instead, you need to be able to demonstrate skill through code
<JDubs> bean: I'm from oklahoma, where you from bro?
<bean> JDubs: Iowa.
<JDubs> workmad: That's what I'm attempting to do atm...Build up a large library of stuff I've written :)
<Godd2> bean: I joined early, so my username on there is google :P
<oqa> workmad3: "if you can talk the talk..."
<Godd2> JDubs: Do you have repos up on github?
generalissimo has quit [Ping timeout: 260 seconds]
<workmad3> oqa: if you can talk the talk well enough, they might miss that you can't walk the walk... but generally, you need to demonstrate at least some crawling ;)
<JDubs> Godd2: Yeah but I haven't pushed any of my new code recently, I need to go through and do that :)
<JDubs> workmad3: what do you mean crawling?
generalissimo has joined #ruby
<workmad3> JDubs: I'm just stretching a metaphor, don't worry
<workmad3> JDubs: it appears this one isn't elastic enough and it just snapped on me
<oqa> there are people who can talk the talk, but can't code a working program without google
<shevy> hmm
krz has quit [Quit: krz]
<shevy> is it possible, in a .gsub(), to replace all '.', but to ignore certain '.' if there comes a special word?
<JDubs> oqa: lol
haxrbyte_ has quit [Ping timeout: 244 seconds]
schaerli has quit [Remote host closed the connection]
<workmad3> oqa: I'm thinking it's getting around to fizzbuzz time! :)
<shevy> like "foobar." vs. "foobar.(IGNORE)"
<JDubs> shevy: pretty sure if you write your regex correctly, yes
<shevy> hmm ok
<oqa> unfortunately I'm slipping more and more in to the "without google" crowd.. too many languages to remember any specifics
skaczor has quit [Remote host closed the connection]
<shevy> oqa hehe
<oqa> current work project has java, scala, javascript, jruby
<workmad3> oqa: in fairness, it's the 'programmers' who can't even code *with* google that are the worst :P
ryannielson has joined #ruby
<lurch_> being able to lookup stuff eficiently is a skill too
xpen_ has quit [Remote host closed the connection]
kil0byt__ has quit [Remote host closed the connection]
zmo_ has quit [Quit: Leaving]
<oqa> lurch_: yes, definitely :)
<oqa> workmad3: lol :(
ejholmes has quit [Quit: ejholmes]
pavilionXP__ has quit [Quit: Forget progress by proxy. Land on your own moon.]
davidcelis has quit [Quit: K-Lined.]
<oqa> too close to reality there
<bean> JDubs: having code examples on your github will very much help your chances of becoming gainfully employeed
<workmad3> oqa: and yeah, syntax can get muddled when you're dealing with polyglot languages :)
ejholmes has joined #ruby
pavilionXP__ has joined #ruby
<JDubs> bean: sweet, even euler problems?
<bean> I'd push anything and everything
nyrb has quit [Ping timeout: 255 seconds]
* bean has a git repo for his project euler stuff.
<workmad3> oqa: it doesn't impact on your ability to code though, just on the human brain's inability to context-switch quickly and keep things nicely organised and compartmentalised :)
<oqa> workmad3: yea.. three months of this project and first thing that got messed up was exception handling.. I'm totally confused between java-scala-ruby
<bean> also, if you're ever interested in systems I recommend learning Chef.
<bean> chef = <3
<oqa> try rescue catch ensure finally begin ... why my code doesn't compile
<workmad3> oqa: bleh, and especially when you throw JS into the mix then...
bbttxu has quit [Quit: bbttxu]
<workmad3> oqa: I'm currently dealing with ruby, coffeescript and javascript (coffeescript to write, js to debug :) )
davidcelis has joined #ruby
jackdanger has quit [Quit: Leaving.]
apok has joined #ruby
elsifaka has quit [Quit: Veloma e!]
<oqa> I'm actually trying to axe scala & ruby acceptance tests from the project
<oqa> plain java is better than the polyglot hell
<workmad3> hmm, I can see axing multiple languages in the acceptance tests
johnmilton has joined #ruby
<workmad3> but I don't quite understand why you'd pick java as the language of choice :P
<oqa> scala is used only for the front application (play framework), there are about 8 java applications for the backend
<workmad3> and the teams on those 8 other apps don't do scala?
_cheney has joined #ruby
<Xeago> JDubs: pushing learning stuff to github is really recommended
<Xeago> it shows you are actively learning and willing to learn
Goles has quit [Quit: Computer has gone to sleep.]
cakehero has quit [Quit: Computer has gone to sleep.]
<oqa> workmad3: kind of.. and it seems that play framework leads to too complex code
<JDubs> Xeago: alrighty will do that right now
<workmad3> I've only dabbled with play and scala tbh... wasn't too impressed with play, but I quite liked scala, especially the scala specs library for testing
<bean> We have a CMS written on top of play framework
Spaceboy has quit [Ping timeout: 276 seconds]
<bean> works pretty well.
<bean> we're nearly 100% scala at my work
<oqa> bean: can you summarize the best parts of play?
<workmad3> oqa: and I've heard of some teams that started writing all their tests in scala while still using java for the app code :)
cakehero has joined #ruby
phelps has quit [Quit: Textual IRC Client: www.textualapp.com]
<bean> oqa: I wish I could. I am a sysadmin who is more on the ruby-for-sysadmin side of things.
<oqa> workmad3: yea, that might be an ok combination
<bean> I don't know scala :S even though I have the odersky book on it
<oqa> I prefer ruby's down to earth syntax
<oqa> scala seems to make things a little bit too complex
<oqa> or people developing scala stuff
io_syl has joined #ruby
<workmad3> you could probably do similar, with java app code and jruby running minitest, minitest, rspec, whatever for tests
joeycarmello has joined #ruby
<workmad3> *minispec
<oqa> worst offender I've seen was in scalaz, there was a function that had a name that was the utf-8 star
<Xeago> rofl
<bean> lolllll
<Xeago> what did it do?
<workmad3> oqa: :)
<workmad3> oqa: you can do that in ruby too btw ;)
<bean> oqa: thats a good one -- scalaz is a running joke around here.
bairui has quit [Ping timeout: 255 seconds]
<workmad3> oqa: I quite like throwing people off with ruby code that using the utf-8 non-breaking space as a variable name or in method names ;)
jackdanger has joined #ruby
<bean> There's also the snowman used in rails
malkomalko has joined #ruby
gyre007 has quit [Read error: Connection reset by peer]
<workmad3> however, I don't do it in production...
bairui has joined #ruby
<oqa> there's one, not the star but anyways
<JonnieCache> it adds a checkmark rather than a snowman these days
<JonnieCache> OMG RAILS IS SO CORPORATE IM MOVING TO NODE
luckyruby has quit [Remote host closed the connection]
<Xeago> JonnieCache: there were actual reasons for it
<Xeago> none that were significant tho
<Xeago> mostly user recognition
<bean> JonnieCache: lollll
SCommette has joined #ruby
<oqa> that' be a nice suprise to leave behind in some code base
<JonnieCache> wtf
davidcelis has quit [Quit: K-Lined.]
<oqa> valid utf-8
<oqa> ;)
<JonnieCache> `alias λ proc` ftw
atal421 has joined #ruby
haxrbyte has joined #ruby
ckrailo has joined #ruby
yaymukund has quit [Ping timeout: 252 seconds]
baroquebobcat has joined #ruby
<JDubs> hey guys
kevinykchan has joined #ruby
<bean> hi JDubs
joeycarmello has quit [Remote host closed the connection]
<JDubs> how can I (from linux) from command line, delete all files that end in .rb~ in all subdirectories from where I'm at
<JDubs> ?
jjbohn has joined #ruby
<bean> find . -name "*.rb~" -delete
<bean> you can run it without the -delete to get a list first if you want
jim80net has left #ruby [#ruby]
gyre007 has joined #ruby
maesbn has quit [Remote host closed the connection]
<bean> JDubs:
joeycarmello has joined #ruby
<oqa> btw, does anyone have clue why I would get a error about "FileUtils.remove_entry_secure being private" with 2.0.0-preview2?
philcrissman has joined #ruby
altious has quit [Ping timeout: 245 seconds]
Uranio has joined #ruby
<oqa> I tried looking that source code but I couldn't find ot why it would be private
<bean> oqa: i just looked as well, and also cannot find why it would be private
<oqa> crap
<oqa> yea, just looked at code again.. no private in sight
schaary1 has joined #ruby
schaary has quit [Read error: Connection reset by peer]
<oqa> there seems to be very few references to it in the .rb files
itchyouch has joined #ruby
tps_ has joined #ruby
<Xeago> one more month of time sheet keeping
<Xeago> it is hORRRIBLLLEEEE
bradhe has joined #ruby
tobinharris has quit [Quit: tobinharris]
<bean> lol
bradhe has quit [Remote host closed the connection]
malte_ has joined #ruby
bradhe has joined #ruby
jackdanger has left #ruby [#ruby]
artm has left #ruby [#ruby]
squidBits has joined #ruby
malkomalko has quit [Read error: Connection reset by peer]
apok has quit [Quit: apok]
chussenot has quit [Quit: chussenot]
MissionCritical has quit [Ping timeout: 276 seconds]
malkomalko has joined #ruby
<JDubs> WOW: http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html Most comp sci graduates can't write a program THAT FREAKING SIMPLE?!?!? WHAAAAAT
<JDubs> how?!? why?!?!??! *dies*
tjbiddle_ has joined #ruby
carlyle has quit [Remote host closed the connection]
slash_nick_away has joined #ruby
<shevy> simple is relative!
schaary1 has quit [Ping timeout: 260 seconds]
<JDubs> ummm
<JDubs> you can't get much more simple than this "fizzbuzz" thing
<JDubs> lol
juarlex_ has quit [Ping timeout: 240 seconds]
schaary has joined #ruby
<JDubs> I could have written that program in C after my first week of intro to comp sci lol
<JDubs> how can people graduate with a DEGREE in comp sci and not be able to do that? i honestly don't understand
<apeiros_> JDubs: me neither
sepp2k has quit [Quit: Leaving.]
<apeiros_> I wonder what they've learned during that whole time…
<Xeago> apeiros_: customer requirements
omg765 has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<Xeago> which completely screwed them over
tjbiddle has quit [Ping timeout: 244 seconds]
tjbiddle_ is now known as tjbiddle
<apeiros_> Xeago: customer requirements… in CS studies?
Uranio has quit [Quit: WeeChat 0.3.8]
<Xeago> yep
<Xeago> I have them all the time
<apeiros_> o0
<Xeago> or well
<Xeago> had
<apeiros_> you have one customer - your professor
<Xeago> nah :)
<JDubs> apeiros_ lol
hotovson_ has quit [Remote host closed the connection]
Jasko has joined #ruby
schaary has quit [Ping timeout: 244 seconds]
pu22l3r has quit [Remote host closed the connection]
pu22l3r has joined #ruby
omg765 has joined #ruby
luckyruby has joined #ruby
dtwwf has joined #ruby
jxf has joined #ruby
<JonnieCache> JDubs: i told you man
<JonnieCache> JDubs: wait until you get into industry and actually meet these people
<JonnieCache> its amazing
matthewrobbins has left #ruby [#ruby]
omg765 has quit [Client Quit]
bradhe has quit [Remote host closed the connection]
joeycarmello has quit [Remote host closed the connection]
rellin has joined #ruby
carloslopes has joined #ruby
schaary has joined #ruby
a_a_g1 has joined #ruby
pipopopo has quit [Quit: ZNC - http://znc.sourceforge.net]
philcrissman has quit [Remote host closed the connection]
tjasko__ has quit [Ping timeout: 260 seconds]
<bean> JonnieCache: JDubs: also, when it comes down to it, you VERY do not want to be the smartest person in the room where you work
<bean> I'd die.
Mission-Critical has joined #ruby
matrixise has quit [Ping timeout: 260 seconds]
<JonnieCache> oh god yes
<JonnieCache> never be the smartest person in the room
<JonnieCache> that applies to life in general
schaary has quit [Client Quit]
pu22l3r has quit [Ping timeout: 265 seconds]
bairui has quit [Ping timeout: 244 seconds]
<JDubs> Bean: I know I won't be...I'm not the smarest guy, I just work hard at things
AlSquirikou has joined #ruby
AlSquirrel has quit [Read error: Connection reset by peer]
<JDubs> Bean: Well...I know I was really smart when i was younger, but as I've gotten older, I feel like I lost a lot of intelligence.
<JDubs> I feel pretty stupid nowadays lol
<bean> JDubs: you'd be surprised. I was a guy studying systems who still could code better than half the kids in my class :\
<bean> in a true programming / theory course
c0rn has joined #ruby
<JonnieCache> JDubs: thats just because youve gained perspective though surely?
<JonnieCache> hard work generally beats intelligence anyway
<Xeago> I was awesome at math when I was young
<apeiros_> I'd very much refute that statement
BigO has quit [Remote host closed the connection]
<Xeago> but math got broader and harder
<Xeago> and my skills never got better
Uranio has joined #ruby
<JDubs> JonnieCache: Nah I used to understand things a lot quicker when I was younger...Especially math
<Xeago> so nowadays basic math is easy, and hard math is, well, hard
<bean> heh.
<apeiros_> you can work your arse off for hours vs. an intelligent solution which takes minutes.
<bean> I hate math
<Godd2> Xeago: have you tried out http://www.khanacademy.org ?
<bean> that's why ruby does math for me
BigO has joined #ruby
<Xeago> Godd2: heard of them, but time limited
<JonnieCache> apeiros_: i meant it in terms of people progressing though life
<apeiros_> sadly where I work there's tons and tons of "lets just work until our fingers bleed instead of taking a minute to think about the problem"
morf has quit [Quit: eof]
<Xeago> atm doing crypto 40h/week of internship and 20h/week of applestore genius work
<JonnieCache> apeiros_: obv if the people concerned are right at either corner of the bell curve it doesnt apply
<apeiros_> (not in my department, thankfully)
mikecmpbll has joined #ruby
<Xeago> and I am on irc too much..
<JDubs> Xeago: lol
<Xeago> and hackernews is time consuming :)
<foucist> apeiros_: did you compile ruby with the flags too ? or haven't done that yet due to the rvm path issues?
<bean> lol I had to condition myself to not reddit / news.ycomb while at work
<Xeago> JonnieCache: you read hackernews right?
<JonnieCache> too much
<apeiros_> foucist: haven't done due to rvm issues
<Xeago> h/week ?
<foucist> apeiros_: do you have rvm head?
<JonnieCache> less than i used to though
<apeiros_> foucist: no, stable (today's)
<Xeago> once I found a nice feedreader it jumped from <.1h/week to about 20/week
<Xeago> atleast
<Xeago> never ever measured it
_nitti has joined #ruby
<Xeago> but I can spend 3 working days reading over the weekend news and stuff
<foucist> apeiros_: mpapis told me directly a few days ago "rvm get head; rvm install 1.9.3 --patch falcon" heh
<Xeago> I think it's atleast 2 h/day
<apeiros_> foucist: well, falcon patch isn't the issue
axl_ has joined #ruby
<foucist> apeiros_: yea probably not
<apeiros_> that one works and halved the time
matrixise has joined #ruby
<JonnieCache> Xeago: i couldnt measure it in hours
<JonnieCache> its more like a couple of minutes at a time, many times a day
rboyd has joined #ruby
juarlex has joined #ruby
mafolz has quit [Quit: mafolz]
kpshek has quit []
<bean> i forget, what is falcon patch
<bean> makes shit faster, right?
_nitti_ has quit [Ping timeout: 244 seconds]
itchyouch has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<oqa> I used to think it would be cool to be in a position where you'd be the guru in the project, then I got in to a project where I was the "main guy" for 1.5 years and I was responsible for development of test automation & continuous delivery platform for 1500 people software development organization
<oqa> took a while to realize that being a guru is quite stressful
<Xeago> I am deemed irrelevent
harushimo has joined #ruby
<Xeago> with proper spelling
<harushimo> hey everyone
<Xeago> that aint fun either
<bean> hello harushimo
Virunga has joined #ruby
Mission-Critical has quit [Ping timeout: 260 seconds]
<foucist> bean: yep, makes shit faster.. and for a basic square root finding code earlier for some euler problem, halves the time it takes to solve
<bean> ah, neat.
Fretta has joined #ruby
kpshek has joined #ruby
<harushimo> I'm working on this from a book
<harushimo> 99 % of my out put matches expect the part in flordia
samphippen has quit [Ping timeout: 248 seconds]
<harushimo> flordia should output jackson ville on line 37
<bean> yes it should
tungd has quit [Quit: leaving]
<oqa> harushimo: Flordia vs Florida
<oqa> which one is correct?
<harushimo> no way a spelling error
<bean> ahhhh
itchyouch has joined #ruby
<bean> yep,
<bean> spelling error\
jrabbit has quit [Read error: Operation timed out]
samphippen has joined #ruby
alvaro_o has joined #ruby
jrabbit has joined #ruby
<harushimo> man, how come it see?
<harushimo> Flordia, I mispelled it
<bean> Florida
<bean> vs
<bean> Flordia
<bean> yep
elaptics`away is now known as elaptics
<harushimo> I've been noticing when I'm coding, the smallest thing trips me up. I can't tell the error at all
<GeekOnCoffee> I am yet to meet the veritable army of totally useless non-programming programmers << this person has never had to interview people for jobs
<harushimo> thanks
pavilionXP has quit [Quit: Forget progress by proxy. Land on your own moon.]
mmitchell has joined #ruby
apok has joined #ruby
rakl has joined #ruby
skaczor has joined #ruby
<oqa> harushimo: IDEs with debugging help with that
<GeekOnCoffee> or the average person asking questions on IRC :S
samphippen has quit [Max SendQ exceeded]
davidcelis has joined #ruby
<harushimo> what's good for ruby? I've been using aptana studio
<oqa> I specially love IDEA's debugger runtime evalution
<oqa> put a breakpoint
<GeekOnCoffee> Rubymine's not bad if you're looking for an IDE
<harushimo> is it open source?
<harushimo> I sort can't afford if the software is paid version
<oqa> open up the dialog, run any code in that runtime environment
<DanBoy> sublime sublime sublime
<GeekOnCoffee> no, it's commercial
<harushimo> oh man
<oqa> netbeans 6.9.1 has working ruby debugger
<oqa> and it's free and opensource
<GeekOnCoffee> harushimo: are you a student?
<harushimo> I know aptana studio. I've used it a couple of times
<oqa> I don't know if anyone's released newer netbeans versions with ruby support
* bean uses vim
<DanBoy> sublime text 2 is free at the moment
<harushimo> I use vim too
<harushimo> is that for mac?
<DanBoy> mac and linux
<oqa> harushimo: test driven development is also very good for catching that kind of bugs
<DanBoy> im using it on osx
<Guest73164> sublime text, is for mac linux and win too
<harushimo> like rspec right?
<bean> sort of
beilabs_ has quit [Ping timeout: 248 seconds]
<bean> except write the tests first.
<oqa> develop code in small bits, always do tests and run the tests, if you break existing functionality -> tests fail
<harushimo> RAILS use is heavy on TDD and BDD
nemesit has joined #ruby
<harushimo> I was thinking of rspec
<oqa> those have only superficial differences, slightly different syntax
cr3 has joined #ruby
axl_ has quit [Quit: axl_]
<oqa> anyways, when you have tests, debugger is super useful
MissionCritical has joined #ruby
<bean> wow, falcon patch made some of my shit a lot faster
yaymukund has joined #ruby
samphippen has joined #ruby
<bean> like, from 38 secs to 10 sec
<oqa> stepping through the code one line at a time shows stupid problems very clearly
TitaniumStudioUs has quit [Quit: This computer has gone to sleep]
buibex has quit [Remote host closed the connection]
<yaymukund> can I `gem install` a gem from a private repo on GH? I tried `gem install https://github.com/yaymukund/repo.git` and it says that it 'Could not find a valid gem in any repository'
adeponte has joined #ruby
<cr3> hi folks, I'd really appreciate some help running rake spec on a puppet project but I don't know where to turn to anymore :( the problem is that puppet classes checked in the spec don't seem to be found
<yaymukund> curiously, it works when I add it to my gemfile and run `bundle`
S0da has quit [Remote host closed the connection]
<havenn> yaymukund: There is nothing at: https://github.com/yaymukund/repo
iamjarvo has quit [Quit: Leaving.]
<yaymukund> it's private.
<havenn> yaymukund: Ah, gotcha.
<GeekOnCoffee> yaymukund: it works from a gemfile
<GeekOnCoffee> or you can download it and gem build
blazes816 has joined #ruby
marknyc has joined #ruby
<yaymukund> ah ok, just wanted to know if there was something I was missing
<yaymukund> thanks
<havenn> yaymukund: Or you could change your gem source to githubs.
jslowe has joined #ruby
zommi has quit [Ping timeout: 244 seconds]
<havenn> yaymukund: gem sources -a http://gems.github.com; gem install yaymukund-etc
AltGrendel has left #ruby [#ruby]
brax4444 has joined #ruby
<havenn> gem install username-projectname -s http://gems.github.com
<oqa> cr3: $LOAD_PATH << path_to_file_root
k610 has quit [Quit: Leaving]
<yaymukund> havenn: looks like they stopped hosting gems, so this doesn't work?
<yaymukund> it gives me the "Could not find a valid gem" message
<cr3> oqa: I'll try playing with that variable, thanks for the tip
<bean> yaymukund: even if they did it likely wouldn't work with private gems
<bean> but I believe it did stop
BigO has quit [Remote host closed the connection]
<havenn> yaymukund: Oh, yeah... nevermind me.
apok has quit [Quit: apok]
matrixise has quit [Ping timeout: 252 seconds]
banisterfiend has joined #ruby
osvico has quit [Ping timeout: 264 seconds]
BigO has joined #ruby
sepp2k has joined #ruby
freakazoid0223 has joined #ruby
BigO has quit [Remote host closed the connection]
Fretta_ has joined #ruby
thams has joined #ruby
Fretta has quit [Ping timeout: 244 seconds]
Fretta_ is now known as Fretta
beilabs_ has joined #ruby
brax4444 has quit [Quit: brax4444]
ltsstar has joined #ruby
<jrist> does anyone use gettext with ruby?
TitaniumStudioUs has joined #ruby
<jrist> if I want to extract the string programmatically from _("this thing")
brianpWins has joined #ruby
<jrist> is there some manipulation I can do on that object?
<jrist> to get the string?
<bean> Can't say I've ever used it.
mikecmpbll has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<jrist> sadface
zommi has joined #ruby
haxrbyte has quit [Ping timeout: 248 seconds]
Zai00 has quit [Quit: Zai00]
vd0 has joined #ruby
<jrist> oh I guess I could use ruby_parser
BigO has joined #ruby
maletor has joined #ruby
art_man1 has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
rellin has quit [Ping timeout: 260 seconds]
DrShoggoth has joined #ruby
<bean> jrist: what are you attempting to accomplish
dr_bob has quit [Quit: Leaving.]
<jrist> somewhat hard to explain, but it appears that the _() method actually returns the original string if called within _() :)
<jrist> (confusing, I know)
<bean> lol ok
Weazy has joined #ruby
altious has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
cezar has quit [Ping timeout: 244 seconds]
nat2610 has joined #ruby
ExxKA has joined #ruby
alexim has joined #ruby
baroquebobcat_ has joined #ruby
<shevy> jrist, hmm I found gettext annoying, I dont like to use _() calls :\
<shevy> my solution to internationalization is simple
<jrist> not really my choice, shevy
<shevy> everyone go use english
<jrist> I agree
<shevy> :D
<jrist> I like the t. i18n built into rails
<jrist> *shrug*
Nisstyre has quit [Quit: Leaving]
<jrist> gettext has its advantages
bradhe has joined #ruby
danneu has joined #ruby
baroquebobcat has quit [Ping timeout: 244 seconds]
baroquebobcat_ is now known as baroquebobcat
mahmoudimus has joined #ruby
arietis has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
babykosh has joined #ruby
<jrist> thanks bean, sheerun
<jrist> asldf
<jrist> shevy: thanks
<bean> np
nwertman has joined #ruby
<babykosh> noob question….I need to extract the 'key' associated with the max value in this hash, which is 'alpha'……hash = {{alpha} => 1000, {beta} => -10}….how to do this?
carloslopes has quit [Remote host closed the connection]
osvico has joined #ruby
jdripper has quit [Quit: Leaving.]
<JDubs> Hey guys, trying to build a simple webapp
<JDubs> require 'sinatra'
<JDubs> get '/' do
<JDubs> File.new('/index.html','r')
<JDubs> end
Adget has joined #ruby
altious has quit [Ping timeout: 248 seconds]
<JDubs> But I'm getting "undefined local variable or method `index' for #<Sinatra::Application:0x00000002292c80>"
<JDubs> should probably switch to rails I suppose...
chrstphrhrt has joined #ruby
eldariof has joined #ruby
<jrist> babykosh: you'd have to likely sort
chrstphrhrt has left #ruby [#ruby]
locriani_ has joined #ruby
locriani has quit [Read error: Connection reset by peer]
tobinharris has joined #ruby
<yaymukund> jrist, babykosh: make sure you read the second answer in that SO and not just the one that the asker acceptedd
c0rn has quit []
<jrist> yaymukund: trying to teach fishing :)
_nitti has quit [Remote host closed the connection]
GoGoGarrett has quit [Remote host closed the connection]
<yaymukund> ah, hehe
<Xeago> JDubs: you got a larger trace?
<Xeago> try returning "hello world" first
<Xeago> before doing fancy file reading stuff
carloslopes has joined #ruby
tobinharris has quit [Client Quit]
daniel_- has joined #ruby
c0rn has joined #ruby
browndawg has quit [Quit: Leaving.]
squidBits has quit [Quit: squidBits]
slainer68 has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
GoGoGarrett has joined #ruby
browndawg has joined #ruby
omg765 has joined #ruby
hydrozen has joined #ruby
zigomir has quit [Quit: zigomir]
horrror has joined #ruby
<horrror> is there a speech recognition gem for ruby?
philcrissman has joined #ruby
lurch_ has left #ruby [#ruby]
Nisstyre has joined #ruby
<havenn> babykosh: {:middle=>50, :largest=>500, :smallest=>5}.sort.first.first #=> :largest
Vainoharhainen has quit [Quit: Leaving...]
omg765 has quit [Client Quit]
kpshek has quit []
blaxter has joined #ruby
joeycarmello has joined #ruby
kenneth has quit [Quit: kenneth]
<havenn> babykosh: Or if you want to sort the Hash and keep the new order: Hash[{:middle=>50, :largest=>500, :smallest=>5}.sort]
ExxKA has quit [Quit: This computer has gone to sleep]
PlaydoBear has quit [Ping timeout: 260 seconds]
joeycarm_ has joined #ruby
<C0deMaver1ck> does anybody here have experience with Mechanize?
Godd2 has quit [Quit: Page closed]
joeycarmello has quit [Read error: Connection reset by peer]
darthdeus has joined #ruby
Vert has quit [Read error: Connection reset by peer]
<bean> C0deMaver1ck: do you have a more specific question
apok has joined #ruby
<shevy> hehe
<shevy> C0deMaver1ck I used it a long time ago
<C0deMaver1ck> yes, the problem is that the site returns a 401 status code while still displaying a login page. Mechanize will just throw an exception and die
<shevy> then it switched to nokogiri
<shevy> which did not work for me, so I stopped using mechanize :(
Adget has quit [Quit: Adget]
<bean> well... 401 is "Unauthorized" so I think it's appropriate to throw an exception
pu22l3r has joined #ruby
daniel_- has quit [Ping timeout: 265 seconds]
gyre007 has quit [Remote host closed the connection]
c0rn has quit []
<C0deMaver1ck> I do think it's appropriate but the way this web service works is stupid and so I'm having to work around it
<C0deMaver1ck> I'm trying to find a way to force it to continue parsing the page
<C0deMaver1ck> It seems the Perl version had an autocheck flag that you could set so it wouldn't throw Exceptions on status code errors
c0rn has joined #ruby
<C0deMaver1ck> doesn't look like this one does
timonv has quit [Remote host closed the connection]
TitaniumStudioUs has quit [Quit: Leaving]
timmow has quit [Quit: is having a nap]
nwertman_ has joined #ruby
phelps has joined #ruby
carlyle has joined #ruby
<Xeago> bye everyone, been stressful today :\
ebouchut has joined #ruby
<slash_nick_away> C0deMaver1ck: can you rescue the exception?
nwertman has quit [Ping timeout: 265 seconds]
<C0deMaver1ck> yes
headius has quit [Quit: headius]
<JDubs> cya
DaZ has joined #ruby
<slash_nick_away> Is that what you mean by 'having to work around it'?
cdt has quit [Ping timeout: 240 seconds]
ryanf has quit [Quit: leaving]
headius has joined #ruby
<C0deMaver1ck> yes
c0rn has quit [Ping timeout: 244 seconds]
Bry8Star has quit [Ping timeout: 276 seconds]
freakazoid0223 has quit [Quit: Leaving]
beilabs_ has quit [Read error: Operation timed out]
<havenn> C0deMaver1ck: Something like?: rescue Mechanize::ResponseCodeError => e; e.force_parse
peter_paule has joined #ruby
c0rn has joined #ruby
<havenn> C0deMaver1ck: Oh, UnauthorizedError
keyvan has joined #ruby
keyvan has quit [Changing host]
withnale has quit [Excess Flood]
keyvan has joined #ruby
<C0deMaver1ck> havenn: yeah I had tried that a few minutes ago, undefined method
browndawg has quit [Read error: Connection reset by peer]
withnale has joined #ruby
iamjarvo has joined #ruby
<C0deMaver1ck> I'm going to try posting directly to the url it posts the login data too
<slash_nick_away> That's sort of expected behavior... "die early, die loud" philosophy or something. I've written some things that return a "result object" which itself accumulates exceptions...it's up to the app to call something like @result.errors.map { |e| raise e }, but I think that's frowned upon?
<JDubs> Hey guys, need help with a bundle error, if anyone can help : http://pastie.org/5516999
browndawg has joined #ruby
peter_paule has quit [Quit: WeeChat 0.3.9.2]
PlaydoBear has joined #ruby
keyvan has quit [Remote host closed the connection]
mrsolo has joined #ruby
<havenn> JDubs: Do you have PostgreSQL installed on the system? Other gems with native extensions (like nokogiri) build fine?
<JDubs> I've never had an error installing a gem before, so not really sure what to do
<JDubs> should I gem install PostgreSQL?
nkts has quit [Ping timeout: 264 seconds]
<havenn> JDubs: System install Postgresql. What OS?
workmad3 has quit [Ping timeout: 250 seconds]
<JDubs> lubuntu
<csmrfx> gem with postgres? I doubt it
punkrawkR has joined #ruby
<csmrfx> might have a db adapter tho
<havenn> JDubs: sudo apt-get install postgresql
<havenn> JDubs: gem install pg
nwertman_ has quit [Quit: leaving]
_nitti has joined #ruby
bwlang has joined #ruby
nwertman has joined #ruby
mascool has joined #ruby
withnale has quit [Excess Flood]
<JDubs> havenn: I did the apt-get and it finished...I still get errors when I try to gem install pg
<JDubs> :/
<C0deMaver1ck> got it working guys
withnale has joined #ruby
withnale has quit [Remote host closed the connection]
<C0deMaver1ck> just bypassed the whole login by posting directly to the url the form on that page posts to
<Xeago> everyone
Nykolla has quit [Read error: Connection reset by peer]
browndawg has quit [Quit: Leaving.]
malkomalko has quit [Remote host closed the connection]
<havenn> JDubs: Does this work?: gem install nokogiri
<C0deMaver1ck> Xeago: ROFL
withnale has joined #ruby
<havenn> JDubs: You may need to install some build essentials so you can compile gems: sudo apt-get install -y build-essential zlib1g-dev libyaml-dev libssl-dev libgdbm-dev libreadline-dev libncurses5-dev libffi-dev
<Xeago> neways, off
kenneth has joined #ruby
gbchaosmaster has joined #ruby
<C0deMaver1ck> Xeago: this is so bad my eyes started bleeding
<havenn> Xeago: Wow, l33t hax0r there. Haha.
withnale has quit [Excess Flood]
withnale has joined #ruby
withnale has quit [Remote host closed the connection]
voodoofish430 has joined #ruby
nat2610 has quit [Quit: Leaving.]
pcarrier has quit []
beilabs_ has joined #ruby
withnale has joined #ruby
nat2610 has joined #ruby
pewter_tao has joined #ruby
horrror has quit [Quit: horrror]
withnale has quit [Client Quit]
withnale has joined #ruby
carlyle has quit [Read error: Connection reset by peer]
atal421 has quit [Quit: atal421]
carlyle has joined #ruby
coderhut has joined #ruby
lkba has joined #ruby
mneorr_ has joined #ruby
_nitti has quit [Ping timeout: 265 seconds]
<C0deMaver1ck> JDubs: those are the people PHP is made for, it's sad
<Xeago> JDubs: I am sure that the author was a well taught cs-student :)
s1n4 has joined #ruby
<harushimo> In ruby, when going through a hash, can you get the elements inside a by its index
<harushimo> I mean inside a hash
n1x has joined #ruby
n1x has quit [Read error: Connection reset by peer]
<JDubs> xeago: Poor guy...they really ripping on him :(
Kuifje has joined #ruby
Kuifje has quit [Changing host]
Kuifje has joined #ruby
<Xeago> can't blame them\
<harushimo> if you have a = [ 'a' => 100, 'b' => 200]. Could you refer a[1] and then get the element
hukl has joined #ruby
<JDubs> harushimo: 1 would get the hash in position 1 yes
<harushimo> okay
BeLucid_ has joined #ruby
<JDubs> harushimo: remember, you can test that easily in irb :)
<harushimo> I am too
<JDubs> :)
<harushimo> thank you
<harushimo> I'm trying to look at the concepts more
Russell^^ has joined #ruby
<harushimo> I've seen done in python but never in ruby
Xeago_ has joined #ruby
BeLucid has quit [Read error: Connection reset by peer]
<JDubs> oh ggreat, xeago is back
<harushimo> I was looking at the ruby docs too and I didn't seen an example on it
<JDubs> xeago: GO DO SOME WORK INSTEAD OF IRC LOL
Xeago_ has quit [Remote host closed the connection]
<pewter_tao> http://pastebin.com/Cn9SLkW5 what's wrong with this? It seems to stop going through Dirs before it should...
<pewter_tao> oops, I mean this: http://pastebin.com/gb0EYp37
CodeVision has quit [Ping timeout: 255 seconds]
philcrissman has quit [Remote host closed the connection]
execute has joined #ruby
execute has quit [Client Quit]
carlyle has quit [Ping timeout: 245 seconds]
Xeago has quit [Ping timeout: 244 seconds]
BeLucid has joined #ruby
<JDubs> lol'
BeLucid_ has quit [Read error: No route to host]
<harushimo> when loading a ruby program, is they are for irb in interactive mode for the specific program
<harushimo> I mean is there a way for irb to be in interactive mode for that program
darthdeus has quit [Quit: Linkinus - http://linkinus.com]
<harushimo> irb -i ruby program name
daniel_- has joined #ruby
<waxjar> you can let it take over at a certain point i believe (pry can, at least)
darthdeus has joined #ruby
frogstarr78 has quit [Ping timeout: 264 seconds]
phelps has quit [Quit: Textual IRC Client: www.textualapp.com]
<harushimo> I'm just saying example here: python -i program name. Its load the program. I would figured that ruby has someting similar
ebouchut has quit [Quit: This computer has gone to sleep]
jenrzzz has joined #ruby
love_color_text has quit [Ping timeout: 264 seconds]
<waxjar> ah, you can load a library with the -r flag, set the load path with -I: irb -I lib -r my-library
<pewter_tao> hey guys
<harushimo> thank you
nat2610 has quit [Quit: Leaving.]
<harushimo> perfect
<pewter_tao> If I do: if !!`file "#{fn}"`[/ASCII/] ------ and 'file derp.rb' outputs: Ruby Script, ASCII text
kil0byte has joined #ruby
<waxjar> you can run irb --help for more options on IRB :)
<pewter_tao> then the output of file isn't caught because it's only matching stuff before the comma
<harushimo> I did that
<pewter_tao> How do I match something in any part of the file commands output
<harushimo> I was reading that before you message me
grzywacz has quit [Ping timeout: 240 seconds]
nat2610 has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
timonv has joined #ruby
Bry8Star has joined #ruby
mneorr_ has quit [Remote host closed the connection]
mneorr has joined #ruby
monkegjinni has joined #ruby
BigO has quit [Remote host closed the connection]
BigO has joined #ruby
<waxjar> pewter_tao, if i understand correctly you'd like to check if the syntax in all your ruby files is valid?
havenn has quit [Remote host closed the connection]
<pewter_tao> yeah, sorry, I've reduced the problem now
havenn has joined #ruby
<pewter_tao> waxjar: /ASCII/ matches only before the comma
<waxjar> why don't you simply glob on .rb files only? Dir.glob("**/*.rb")
<pewter_tao> waxjar: how do I get it to match "ASCII" anywhere in the output of file [wahtever]
brax4444 has joined #ruby
freakazoid0223 has joined #ruby
<pewter_tao> waxjar: because I don't want to require them, some have no .rb, but have #!/bin/ruby/ inside
<waxjar> or Dir["**/*.rb"]
havenn has quit [Read error: No route to host]
<pewter_tao> anyway, I'm just trying to make this regex [/ASCII/] match any instance of ASCII
Spaceboy has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
bairui has joined #ruby
<pewter_tao> It does it if file outputs "ASCII text" but does not if it outputs "something something, ASCII Text"
<pewter_tao> waxjar: why does the comma stop it?
frogstarr78 has joined #ruby
<rondale_sc> It shouldn't. You can always run your regex through rubular.com
fred909 has joined #ruby
atal421 has joined #ruby
<pewter_tao> rondale_sc: sry new to ruby
<pewter_tao> how do I get any insatnce of "ASCIII"
BigO has quit [Ping timeout: 244 seconds]
vd0 has quit [Ping timeout: 260 seconds]
<pewter_tao> rondale_sc: rubular finds it if it's after the comma
Ethan2 is now known as Ethan
<pewter_tao> nvm, this isn't the problem
<rondale_sc> pewter_tao: yeah your regex shouldn't be stopped by a comma
emmanuelux has joined #ruby
Neomex has joined #ruby
omg765 has joined #ruby
stkowski has joined #ruby
<pewter_tao> rondale_sc: I'm not sure why this doesn't go through all the files it should
<rondale_sc> pewter_tao: you figure it out?
Neomex has quit [Client Quit]
<pewter_tao> nope
icole has joined #ruby
<rondale_sc> pewter_tao: I'm still not sure if you are looking inside one file on multiple lines or multiple files over multiple lines.
icole has quit [Read error: Connection reset by peer]
icole has joined #ruby
<pewter_tao> see my pastebin?
<pewter_tao> I'm only looking at the first line of every ASCII file
Jasko has quit [Read error: Connection reset by peer]
<pewter_tao> and checking if #!/usr/bin/ruby is there || if the file ends in .rb
a_a_g1 has quit [Quit: Leaving.]
havenn has joined #ruby
jekotia has joined #ruby
becom33 has joined #ruby
apok_ has joined #ruby
andrew has joined #ruby
love_color_text has joined #ruby
grzywacz has joined #ruby
andrew is now known as Guest34772
Jasko has joined #ruby
<pewter_tao> rondale_sc: if I just put "//" will it match nothing?
<pewter_tao> that is, if anything exists it will find it
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Guest34772 is now known as andrewhl
banjara has joined #ruby
apok has quit [Ping timeout: 255 seconds]
apok_ is now known as apok
evilsushi has joined #ruby
evilsushi has quit [Changing host]
evilsushi has joined #ruby
wallerdev has joined #ruby
GlenK has joined #ruby
love_color_text has quit [Remote host closed the connection]
cascalheira has quit [Quit: Leaving...]
<GlenK> hey. so someone pointed me to a guide yesterday on how to install gems to your home directory. anyone have that handy? I follow it and I get stuff thrown into an actual directory called "$HOME".
cascalheira has joined #ruby
cj3kim has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
cascalheira has quit [Client Quit]
love_color_text has joined #ruby
kil0byte has quit [Remote host closed the connection]
kil0byte has joined #ruby
<GlenK> nevermind...I found it.
Goles has joined #ruby
cj3kim has quit [Client Quit]
jlwestsr has joined #ruby
ChampS666 has joined #ruby
<GlenK> bah. doesn't even seem to have a way to provide feedback. nothing.
kil0byte has quit [Ping timeout: 244 seconds]
Munto has joined #ruby
squidBits has joined #ruby
DaZ has quit [Ping timeout: 246 seconds]
timonv has quit [Remote host closed the connection]
apok has quit [Remote host closed the connection]
Vainoharhainen has joined #ruby
apok has joined #ruby
Vainoharhainen has quit [Client Quit]
_nitti has joined #ruby
<pewter_tao> rondale_sc: did you see my pastebin?
<rondale_sc> pewter_tao: Yeah just found it.
GoGoGarrett has quit [Remote host closed the connection]
<rondale_sc> I think this might work. But it's pretty rough. https://gist.github.com/4270686
<rondale_sc> pewter_tao: That'll run through your ruby files (or at least all files with an .rb extension), and next if it doesn't find ASCII in the regex.
<pewter_tao> That leaves out all the importants thins I'm trying to do
samphippen has joined #ruby
vlad_starkov has quit [Ping timeout: 250 seconds]
<pewter_tao> Can you tell why my script is stopping?
<pewter_tao> I can't tell which files cause it
jlwestsr has quit [Quit: Ex-Chat]
<waxjar> pewter_tao: a more ruby-ish version: https://gist.github.com/e52868fa74a46717541a
<waxjar> i'm not sure how to suppress #system's output, but it works well enough :)
Slivka has joined #ruby
<harushimo> thanks everyone for the help. I'll be back on later
vlad_starkov has joined #ruby
harushimo has quit [Quit: Leaving]
<apeiros_> waxjar: you're leaking filehandles
dpk is now known as dqs
<apeiros_> use open with a block
wallerdev has quit [Quit: wallerdev]
<rondale_sc> waxjar: Yeah that's good.
vd0 has joined #ruby
<apeiros_> why'd you check for .binmode? iirc you set it manually in the open-args, no?
<apeiros_> i.e., "rb"
GoGoGarrett has joined #ruby
<rondale_sc> Or File.flush; File.close.
<waxjar> apeiros_, he would like to check all files (including executables)
<waxjar> dunno, i never work with files, really :P
<apeiros_> waxjar: I don't see how that changes anything?
<yaymukund> I don't think it's easy to suppress system's output without, say, piping to a file
Hawklord has joined #ruby
GlenK has quit [Quit: Page closed]
<apeiros_> and you suppress the output of a subprocess by not using system, but e.g. Kernel#spawn
squidBits_ has joined #ruby
squidBits has quit [Ping timeout: 255 seconds]
cakehero has quit [Quit: Computer has gone to sleep.]
<yaymukund> apeiros_: ooo, thanks. I will read. been wondering about the right way to do it
dqs is now known as dpk
benwoody has left #ruby [#ruby]
carloslopes has quit [Remote host closed the connection]
daniel_- has quit [Ping timeout: 244 seconds]
benwoody has joined #ruby
squidBits_ has quit [Read error: Connection reset by peer]
carloslopes has joined #ruby
squidBits has joined #ruby
brax4444 has quit [Quit: brax4444]
cj3kim has joined #ruby
cj3kim has joined #ruby
cj3kim has quit [Changing host]
Hawklord has quit [Client Quit]
ConvergenceRunne has joined #ruby
ConvergenceRunne has quit [Client Quit]
ConvergenceRunne has joined #ruby
elico has joined #ruby
entrenador has quit [Quit: Lost terminal]
DaZ has joined #ruby
<pewter_tao> waxjar: thanks a lot, testing it
<pewter_tao> your code is actually readable!
wallerdev has joined #ruby
<apeiros_> waxjar: btw, Dir["**/*"].each --> Dir.glob"**/*")
<apeiros_> whoops, +(
robotmay has quit [Ping timeout: 240 seconds]
<PlaydoBear> Bonsoir =)
<apeiros_> omg, that nick…
<pewter_tao> apeiros_: what's that?
gbchaosmaster has quit [Ping timeout: 276 seconds]
<apeiros_> pewter_tao: Dir.glob() takes a block directly, no need to chain 2 methods
<apeiros_> (Dir.glob == Dir[])
<pewter_tao> but the code will do the same thing... right?
<waxjar> cool i didn't know that
cakehero has joined #ruby
<pewter_tao> Omg... I don't even know how to make that slanted quote character with my keyboard
jrist is now known as jrist-afk
TheFuzzball has quit [Ping timeout: 264 seconds]
Coolhand has quit [Remote host closed the connection]
DaZ has quit [Ping timeout: 260 seconds]
daniel_- has joined #ruby
love_color_text has quit [Remote host closed the connection]
<pewter_tao> waxjar: I can add this, right? def bash_file?(file2)
reppard_ has joined #ruby
reppard has joined #ruby
<waxjar> sure
omg765 has quit [Quit: Computer has gone to sleep.]
Proshot is now known as statarb3
statarb3 has quit [Changing host]
statarb3 has joined #ruby
PlaydoBear has quit [Quit: Quitte]
PlaydoBear has joined #ruby
PlaydoBear has quit [Remote host closed the connection]
dEPy has quit []
<pewter_tao> waxjar: I need to use file2 and filename2, or can I keep the ones used in the ruby_file defs? (not sure if they'll get confused)
jtharris has quit [Quit: WeeChat 0.3.9.2]
ebouchut has joined #ruby
g_bleezy has joined #ruby
<waxjar> you can just call them file_name, again, the names aren't linked because they're methods :)
DaZ has joined #ruby
<waxjar> i gotta go though, good luck :)
robotmay has joined #ruby
<pewter_tao> thanks!
ebouchut has quit [Client Quit]
devdazed has quit [Ping timeout: 255 seconds]
johndozzz has quit []
epwhorl has joined #ruby
Morkel_ has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
g_bleezy_ has joined #ruby
<pewter_tao> can I put file.textmode instead of file.binmode?
g_bleezy has quit [Remote host closed the connection]
<apeiros_> pewter_tao: are you on windows?
Morkel has quit [Ping timeout: 255 seconds]
Morkel_ is now known as Morkel
<pewter_tao> linux
<pewter_tao> apeiros_: file.binmode works, file.textmode does not
reppard_ has quit [Ping timeout: 252 seconds]
reppard has quit [Ping timeout: 252 seconds]
banisterfiend has quit [Ping timeout: 246 seconds]
hukl has quit [Read error: Connection reset by peer]
hukl has joined #ruby
includex has joined #ruby
<apeiros_> pewter_tao: on linux, bin- vs. textmode shouldn't make a difference
<apeiros_> it's a windows thing
segv- has quit [Quit: segv-]
Spaceboy has quit [Remote host closed the connection]
ebouchut has joined #ruby
<apeiros_> (binmode *might* change the encoding defaults to binary, not sure about that)
Spaceboy has joined #ruby
<pewter_tao> apeiros_: what I'm trying to do is catch all files that are ASCII, not all files that are !bin
<pewter_tao> Make sense?
grzywacz has quit [Ping timeout: 248 seconds]
love_color_text has joined #ruby
berserkr has quit [Read error: Connection reset by peer]
<apeiros_> pewter_tao: it's ambiguous
haxrbyte has joined #ruby
<apeiros_> by ascii, you mean it does not contain any bytes beyond the 0x00-0x7f range?
NobbZ has joined #ruby
<pewter_tao> I should probably ask system to search through with file cmd first
<apeiros_> (the lower 7 bits)
timonv has joined #ruby
<apeiros_> textmode/binmode won't help you with that
wedtm|away is now known as wedtm
nobuoka has quit [Quit: Leaving...]
chrxn_ has joined #ruby
cdt has joined #ruby
cdt has quit [Client Quit]
ryanf has joined #ruby
TheFuzzball has joined #ruby
ikaros has quit [Quit: Ex-Chat]
Bry8Star has quit [Remote host closed the connection]
pwelch has joined #ruby
chrxn has quit [Ping timeout: 260 seconds]
chrxn_ is now known as chrxn
ikaros has joined #ruby
Bry8Star has joined #ruby
andredieb has joined #ruby
arturaz_ has joined #ruby
jonahR has joined #ruby
devdazed has joined #ruby
atal421_ has joined #ruby
atal421 has quit [Read error: Connection reset by peer]
atal421_ is now known as atal421
coderhut has quit [Quit: Page closed]
brax4444 has joined #ruby
chrxn_ has joined #ruby
ConvergenceRunne has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
reppard has joined #ruby
malte_ has quit [Quit: malte_]
Bry8Star has quit [Excess Flood]
cakehero has quit [Quit: Computer has gone to sleep.]
Bry8Star has joined #ruby
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
ConvergenceRunne has joined #ruby
chrxn has quit [Ping timeout: 276 seconds]
chrxn_ is now known as chrxn
jtharris has joined #ruby
skaczor_ has joined #ruby
Bosma has quit [Quit: leaving]
keyvan has quit [Remote host closed the connection]
keyvan has joined #ruby
generalissimo has quit [Read error: No route to host]
love_color_text has quit [Ping timeout: 248 seconds]
generalissimo has joined #ruby
ryanf has quit [Quit: broken pipes |||]
maletor has joined #ruby
wedtm is now known as wedtm|away
eldariof has quit []
keyvan has quit [Remote host closed the connection]
reppard has quit [Ping timeout: 256 seconds]
dmerrick_ has joined #ruby
love_color_text has joined #ruby
dmerrick has quit [Ping timeout: 240 seconds]
AndChat| has quit [Remote host closed the connection]
cj3kim has quit [Quit: This computer has gone to sleep]
blaxter has quit [Quit: foo]
Bry8Star has quit [Remote host closed the connection]
dmerrick_ has quit [Ping timeout: 260 seconds]
Coolhand|laptop has joined #ruby
Bry8Star has joined #ruby
squidBits has quit [Quit: squidBits]
shevy has quit [Ping timeout: 260 seconds]
_nitti has quit [Ping timeout: 276 seconds]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby
haxrbyte_ has joined #ruby
chussenot has joined #ruby
<bricker> What's the least dumb way to merge three hashes? hash1.merge(hash2).merge(hash3) doesn't feel right
fred909 has quit [Ping timeout: 255 seconds]
_nitti has joined #ruby
mengu has quit [Quit: Konversation terminated!]
beilabs_ has quit [Ping timeout: 260 seconds]
haxrbyte has quit [Ping timeout: 248 seconds]
Ethan has quit [Quit: Live from Pyongyang DPRK this is...]
ryanf has joined #ruby
bwlang has left #ruby [#ruby]
havenn has quit [Ping timeout: 276 seconds]
zeen has quit [Quit: Read error: Connection reset by YOURMOM]
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
Shamgar has quit [Read error: Connection reset by peer]
omg765 has joined #ruby
undersc0re97 has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
Shamgar has joined #ruby
cakehero has joined #ruby
timonv has quit [Remote host closed the connection]
banisterfiend has joined #ruby
x82_nicole has joined #ruby
shevy has joined #ruby
rezzack has joined #ruby
epwhorl has quit [Read error: Connection timed out]
carloslopes has quit [Remote host closed the connection]
epwhorl has joined #ruby
jxf has quit [Ping timeout: 246 seconds]
jxf has joined #ruby
nomenkun has joined #ruby
cj3kim has joined #ruby
<wmoxam> bricker: Why doesn't that feel right?
Guest73164 has quit [Quit: Guest73164]
<pewter_tao> first part of this line isn't working right: !!file.readline(0).match(/#!.*ruby/) || File.extname(file.path) == ".rb"
<pewter_tao> It does match .rb files, but not files with ruby in the first line
<bricker> wmoxam: dunno, that's what I ended up doing :P
skaczor_ has quit [Remote host closed the connection]
wermel has quit [Remote host closed the connection]
jxf has quit [Ping timeout: 246 seconds]
CodeVision has joined #ruby
fred909 has joined #ruby
jriddle has joined #ruby
arturaz_ has quit [Ping timeout: 260 seconds]
Beoran_ has joined #ruby
Nykolla has joined #ruby
mjbamford has joined #ruby
malte_ has joined #ruby
jxriddle has quit [Ping timeout: 252 seconds]
statarb3 is now known as Proshot
vd0 has quit [Read error: Connection reset by peer]
altious has joined #ruby
Beoran__ has quit [Ping timeout: 252 seconds]
c0rn has quit [Quit: Computer has gone to sleep.]
jrajav has quit [Quit: I tend to be neutral about apples]
ConvergenceRunne has quit [Remote host closed the connection]
dtwwf has quit [Quit: Page closed]
vd0 has joined #ruby
love_color_text has quit [Read error: Connection reset by peer]
keyvan has joined #ruby
keyvan has joined #ruby
keyvan has quit [Changing host]
Slivka has quit [Ping timeout: 276 seconds]
banisterfiend has quit [Remote host closed the connection]
keyvan has quit [Remote host closed the connection]
ebouchut has quit [Quit: This computer has gone to sleep]
love_color_text has joined #ruby
ConvergenceRunne has joined #ruby
solidresolve has joined #ruby
phelps has joined #ruby
epwhorl has quit [Read error: Connection timed out]
havenn has joined #ruby
epwhorl has joined #ruby
DaZ has quit [Ping timeout: 246 seconds]
moshee has quit [Ping timeout: 240 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
Proshot is now known as statarb3
ryannielson has left #ruby [#ruby]
vlad_starkov has quit [Remote host closed the connection]
love_color_text has quit [Ping timeout: 265 seconds]
ferric has quit [Remote host closed the connection]
elliottcable has quit [Quit: Lost terminal]
gbchaosmaster has joined #ruby
jxriddle has joined #ruby
havenn has quit [Read error: No route to host]
jxriddle has quit [Client Quit]
Banistergalaxy has joined #ruby
sonne has quit [Ping timeout: 250 seconds]
jasonthesensei has joined #ruby
havenn has joined #ruby
<jasonthesensei> i'm new to ruby is there away to read an html tag and create the file if it doesn't exist. Like <script type="text/javascript" src="js/app.js"> and if app.js doesn't exist in the js folder have it create a blank app.js file in the js directory?
foohey has joined #ruby
<yaymukund> jasonthesensei: yes, but that's probably not a good idea :s
jriddle has quit [Ping timeout: 255 seconds]
<yaymukund> jasonthesensei: but if you must, you probably want to read/parse the file, pull the name of the file, and then use FileUtils to create the file if it doesn't exist.
<yaymukund> read/parse the *html, pull the name of the file... etc.
<jasonthesensei> why would it be a bad idea?
umurgedik has joined #ruby
slash_nick_away has quit [Ping timeout: 264 seconds]
<pewter_tao> yaymukund: can you do a short code review for me?
<jasonthesensei> I was think of using it during development.
<yaymukund> jasonthesensei: because you generally want tags to point to files that exist.
atal421_ has joined #ruby
seanyo has quit [Ping timeout: 255 seconds]
havenn has quit [Ping timeout: 260 seconds]
<pewter_tao> http://pastebin.com/iKC0J9EJ it's messed up since I added the bash functionality
Slivka has joined #ruby
<pewter_tao> yaymukund: ideas?
<jasonthesensei> yaymukund: could you pm me?
UdontKnow is now known as e
vd0 has quit [Ping timeout: 244 seconds]
darthdeus has quit [Quit: Leaving...]
squidBits has joined #ruby
Synthead has joined #ruby
<yaymukund> sorry guys, I'm at work :[ you should generally post to the channel and people will pick it up if they're free
atal421 has quit [Read error: Connection reset by peer]
atal421_ is now known as atal421
<pewter_tao> so much less talking vs other language's channesl
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<yaymukund> pewter_tao: what do you mean by "messed up"?
tomsthumb has joined #ruby
<pewter_tao> firstly this line doesn't work: !!file.readline(0).match(/#!.*ruby/) || File.extname(file.path) == ".rb"
cj3kim has quit [Quit: This computer has gone to sleep]
<pewter_tao> yaymukund: it catches .rb files but not the first part of the ||
asarih has joined #ruby
asarih has left #ruby ["["Textual IRC Client: www.textualapp.com"]"]
<yaymukund> pewter_tao: sorry, I should have been explicit. Can you include a stack trace in your pastebin?
robotmay has quit [Remote host closed the connection]
<pewter_tao> no problems running it, it just doesn't return the data I want. Logic error
e is now known as root
mahmoudimus has joined #ruby
<pewter_tao> yaymukund: make sense?
vlad_starkov has joined #ruby
darthdeus has joined #ruby
<yaymukund> sure, but regexes usually jsut take fiddling. I forget what it is, but there's a ruby regexp tester online you can use
DarthGandalf has quit [Ping timeout: 260 seconds]
<bean> rubular.
<bean> and that regex is sound
sepp2k1 has joined #ruby
<bean> is "readline" a method on files?
cantonic has quit [Quit: cantonic]
<pewter_tao> The regex is correct afaik
darthdeus has quit [Read error: Connection reset by peer]
ltsstar has quit [Quit: ltsstar]
sepp2k has quit [Ping timeout: 248 seconds]
<bean> pewter_tao: so what you're wanting to do is, is it *.rb or start with #!.*ruby
<bean> correct?
<pewter_tao> either, hence ||
sjhuang has quit [Ping timeout: 264 seconds]
<pewter_tao> bean: see my pastebin?
sjhuang has joined #ruby
<bean> pewter_tao: i get an error.
<bean> TypeError: can't convert Fixnum into String
<bean> from (irb):2:in `readline'
<bean> from (irb):2:in `ruby_file?'
<bean> I'm not sure where you get File.readline
<pewter_tao> from def ruby_file?(file) ... it runs for me
trumpeter2003 is now known as jankly
<bean> odd.
<bean> what version of ruby
mjbamford has quit [Ping timeout: 248 seconds]
<pewter_tao> ruby 1.9.3p327
epwhorl has quit [Ping timeout: 256 seconds]
<pewter_tao> http://pastebin.com/feXD1FXw bean: repasted
<pewter_tao> maybe there was a mis-paste
cdt has joined #ruby
havenn has joined #ruby
<bean> okay, 1, what does the !! in front of the file do
<bean> I still don't see a "file.readline(int)" method
cj3kim has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
<pewter_tao> bean: I'm new to ruby, I thought I could have the "(file)" thing at the top, and that'd be enough
warb0 has joined #ruby
chussenot has quit [Quit: chussenot]
<pewter_tao> bean: where's this method go?
DarthGandalf has joined #ruby
<bean> one sec, pew
<bean> pewter_tao:
yalue has quit [Read error: Connection reset by peer]
<bricker> Isn't there a better way? https://gist.github.com/4271702 The problem with inheriting directly from Hash is that one of the config options is "sort"
<bean> pewter_tao: http://pastebin.com/YcYeLjBy
itchyouch has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<bricker> I also need to be able to merge these options with other options, so I need a way for it to be a hash.
<havenn> bean: The !! is to return a boolean instead of the #match result it seems.
beilabs has joined #ruby
<bean> yeah, i figured that out, havenn
<pewter_tao> bean: I don't see that you changed anything
<bean> pewter_tao: look closer
williamcotton has quit [Quit: williamcotton]
atmosx has joined #ruby
krawchyk has quit [Remote host closed the connection]
root is now known as KnightWhoSaysNi
williamcotton has joined #ruby
monkegjinni has quit [Remote host closed the connection]
<pewter_tao> it says you added a line that was already there in the diff?
<pewter_tao> oh wow
<pewter_tao> with an s eh
ryanlecompte has joined #ruby
<bean> :p
<bean> yep
<bean> thats what I was trying to say
<bean> the function readline(int) doesn't exist.
umurgedik has quit [Quit: leaving]
aajjbb has joined #ruby
<pewter_tao> bean that broke it
<bean> ...
<bean> ?
<bean> what do you get?
<pewter_tao> invalid limit: 0 for readlines (ArgumentError)
whitenoise has joined #ruby
chimkan has joined #ruby
<whitenoise> hey guys, what's wrong with this
<yaymukund> bricker: doesn't look like there's a better way: http://stackoverflow.com/q/2830368 :s
<whitenoise> i get this: /dnsmadeeasy.rb:30: syntax error, unexpected keyword_else, expecting $end
<whitenoise> and syntax error, unexpected tCONSTANT, expecting keyword_then or ';' or '\n'
jrist-afk is now known as jrist
<bean> pewter_tao: did you copy mine?
<yaymukund> well, nothing significantly different from what you're doing
<davidcelis> that isn't 30 lines bro
answer_42 has quit [Quit: WeeChat 0.3.9.2]
<davidcelis> whitenoise: so how should we know
<bean> pewter_tao: because it should be [0] not (0)
<whitenoise> davidcelis, because I gave you error messages and code?
<davidcelis> whitenoise: you gave us about 10 lines
<davidcelis> whitenoise: your error occurs on line 30
daniel_- has quit [Ping timeout: 260 seconds]
<davidcelis> not enough context
<davidcelis> paste the entire file
adeponte has quit [Read error: Connection reset by peer]
<whitenoise> davidcelis, the 'else' in that if is line 30
<pewter_tao> bean: oh, now I'm trying to do readlines[0] on dirs
adeponte has joined #ruby
<pewter_tao> so I need to sort that I gues
headius has quit [Quit: headius]
s1n4 has quit [Quit: leaving]
timonv has joined #ruby
<bean> likely.
<bean> do you want directories or just files?
<davidcelis> whitenoise: try putting parens on your calls to #match, I guess?
<davidcelis> nothing else (in your pasted bit, at least) looks bad
<whitenoise> here is whole file: http://pastie.org/private/8d5qcxzdm3xssmkokpvdbw
<pewter_tao> bean, just files
<pewter_tao> I tried next if !File.directory? but that didn't work
<havenn> whitenoise: Ambiguity due to no parens? p_regex.match(ARGV[1]) && ip_regex.match(ARGV[2])
<whitenoise> let me try that
<davidcelis> havenn: yep that's what i just suggested
vlad_starkov has quit [Remote host closed the connection]
tvw has joined #ruby
Kruppe has joined #ruby
<havenn> davidcelis: aha, yup :)
vd0 has joined #ruby
<whitenoise> sweet--works like a charm now
<whitenoise> as I understood Ruby, it did not require ()s--in what situations are they required? when you are using an operator to extend an if, as one?
BigO_ has joined #ruby
<davidcelis> when it would otherwise be ambiguous
powerplay has joined #ruby
<pewter_tao> bean: ideas?
workmad3 has joined #ruby
AndChat| has joined #ruby
elliottcable has joined #ruby
Banistergalaxy has quit [Ping timeout: 260 seconds]
pcarrier has joined #ruby
<pewter_tao> bean: oh I think I needed it to be file.directory?(file)
<powerplay> had a quick ruby question, can someone help me with the concept of "sender" of methods
daniel_- has joined #ruby
<yaymukund> powerplay: what's your question?
<yaymukund> I may or may not be able to help, depending on how advanced it is :p
<pewter_tao> undefined method `match' for nil:NilClass for "!!file.readlines[0].match(/#!.*ruby/)"
<bean> pewter_tao: File.directory?(file)
<pewter_tao> bean: yeah figured that out... now I get ^^
<bean> pewter_tao: that means file is nil
<powerplay> yaymukund: if i call a method and its not inside a class wh would be consisdered the sender?
<pewter_tao> man, so I need another check!
<rondale_sc> powerplay: if you aren't inside a class or any other containing body send should be 'main'
<rondale_sc> powerplay: I think
<rondale_sc> powerplay: sender should be*
g_bleezy_ has quit [Remote host closed the connection]
<powerplay> rondale_sc: so the "main" object is the sender right? just wanted to double check
<bean> pewter_tao: no, it means somehow you called ruby_file?(file) where file isn't actually anything
<bean> or is a dir
NobbZ is now known as NobbZ|ZZzz
<powerplay> rondale_sc: thank you for your help
rbennacer has joined #ruby
<rondale_sc> powerplay: np
<pewter_tao> bean: File.directory?(file) should take care of if it's a dir
<pewter_tao> bean: "isn't actually anything" means the file doesn't have a first line, right?
<bean> pewter_tao: paste your code again
<rbennacer> hello, i am trying to run a regex on a large file (20G) but i can't load it into my memory, how should i deal with this problem
<rbennacer> ?
<pewter_tao> bean: http://pastebin.com/ABxeiK2P
daniel_- has quit [Quit: WeeChat 0.3.9.2]
zommi has quit [Quit: Leaving.]
KnightWhoSaysNi is now known as UdontKnow
<bean> pewter_tao: i also don't have a file.binmode?
<davidcelis> rbennacer: i would purchase more memory
<rbennacer> haha
cj3kim has quit [Quit: This computer has gone to sleep]
<rbennacer> David_Miller, i thought about it
<davidcelis> no but seriously, chunk it
<rbennacer> it doesn't scale that well thought
<atmosx> rbennacer: split the file, or buy mor eram :-P
<davidcelis> unfortunately you run the problem of your regex matching across a split
<davidcelis> so you won't get that match
jasonthesensei has quit []
<davidcelis> so you could try chunking at various sizes
<rbennacer> i was thinking about using seek but it uses byte offset
DarthGandalf has quit [Ping timeout: 264 seconds]
<yaymukund> powerplay: bit late, but yes you're right
<yaymukund> had to look it up :p
chimkan has quit [Quit: chimkan]
<aces1up> to me this doesn't look healthy what would be a proper way of doing this? I'm deleting during iteration
<aces1up> execute_timer( @timers.delete(timer) )
<aces1up> end
<aces1up> timers_to_fire.each do |timer|
<aces1up> timers_to_fire references @timers
<powerplay> yaymukund: awesome thanks once again buddy :)
<atmosx> rbennacer: split -bytes=1024 m /phat/to/file
<Paradox> is Mon_Ouie around today?
straind has joined #ruby
workmad3 has quit [Ping timeout: 250 seconds]
<bean> pewter_tao: what OS are you on
<pewter_tao> bean: linux
<bean> cuz I cannot reproduce your problem
<rbennacer> how can i make sure i am not spliting a line atmosx
<pewter_tao> what happens for you?
<pewter_tao> bean, well, I'm hitting a lot of different types of files
<bean> file2.txt: true\nSyntax OK etc
<atmosx> rbennacer: I would first try and see if your implementation of split handles the problem itself.
<rbennacer> i tried
<bean> pewter_tao: ah okay, i got to a file that has not first line
<pewter_tao> bean, I think I need to add this: !!`file "#{fn}"`[/ASCII/]
<rbennacer> it does not respect the line
<atmosx> on hindsight, you could write a ruby program to do the split for you. Calculating the words per kb you could do that.
<bean> no*
cakehero has quit [Quit: Computer has gone to sleep.]
<pewter_tao> how would I add that to the next if line?
<rbennacer> what do you mean, each word has a different size
blacktul_ has quit [Remote host closed the connection]
<bean> pewter_tao: heh, idk, run a wc -l on it?
<bean> :p
<pewter_tao> what about: !File.size?(file)
<pewter_tao> it didn't fix the problem for me though
omg765 has quit [Ping timeout: 265 seconds]
Neomex has joined #ruby
Neomex has quit [Client Quit]
blacktulip has joined #ruby
<atmosx> rbennacer: yeah but you can either count chars or get an average.
<atmosx> If you have newline characters it's easy.
<pewter_tao> bean: how would I add this regex line above to my next if line?
<bean> not sure
iamjarvo has quit [Quit: Leaving.]
<rbennacer> if you use a ruby script , you would still need to load tit in memory in order to parse it and slipt it
timonv has quit [Remote host closed the connection]
otters has quit [Ping timeout: 252 seconds]
darthdeus has joined #ruby
<atmosx> rbennacer: hmm yes probably.
haxrbyte_ has quit [Ping timeout: 260 seconds]
<rbennacer> i want to do everything in ruby
alex__c2022 has joined #ruby
Rym has joined #ruby
omg765 has joined #ruby
alex__c2022 has quit [Remote host closed the connection]
DarthGandalf has joined #ruby
babykosh has left #ruby [#ruby]
maloik has joined #ruby
<maloik> has anyone used the Toto blog engine before? I'm wondering if its even possible to remove the date from the slug
<havenn> pewter_tao: https://gist.github.com/4271921
<yaymukund> aces1up: that's pretty much as simple as it gets, I think. if you want to make the objects smarter, you could implement an api like: self.timers.execute!
powerplay has left #ruby [#ruby]
banisterfiend has joined #ruby
alex__c2022_ has quit [Ping timeout: 240 seconds]
<yaymukund> but it would basically do the same thing your code does
undersc0re97 has quit [Quit: Live from Pyongyang DPRK this is...]
<pewter_tao> havenn: what did you changed?
<pewter_tao> change*
[Neurotic] has joined #ruby
<havenn> pewter_tao: Line 10
pu22l3r has quit [Remote host closed the connection]
bwlang has joined #ruby
<pewter_tao> havenn: it does the same thing
pu22l3r has joined #ruby
<havenn> pewter_tao: And added sane indentation and syntax highlighting for sake of eyes! Doesn't put hard return in where looks like one not intended.
cdt has quit [Ping timeout: 260 seconds]
<havenn> pewter_tao: Or was the system \n intended?
danshultz has joined #ruby
<aces1up> yaymukund but that isn't correct right?
<aces1up> yaymukund the way i have it now?
<aces1up> it might delete the wrong timer?
danshultz has quit [Remote host closed the connection]
Slivka has quit [Read error: Connection reset by peer]
elico has quit [Quit: Elico]
Slivka has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
<pewter_tao> I get `match': invalid byte sequence in US-ASCII (ArgumentError) now
Slivka has joined #ruby
Slivka has quit [Read error: Connection reset by peer]
<pewter_tao> after it hits some unknown file
daniel_hinojosa has quit [Read error: Connection reset by peer]
mark_locklear has quit [Remote host closed the connection]
<rbennacer> atmosx, any other ideas?
<pewter_tao> bean: ^ideas?
<yaymukund> aces1up: huh? as long as you're guaranteeing that timers_to_fire is a subset of @timers, I don't see how it could fail?
Morkel has quit [Quit: Morkel]
alex__c2022 has joined #ruby
<bean> sry, was working pewter_tao
<bean> pewter_tao: No, you need to determine if a file is empty, not use some ASCII regex
pu22l3r has quit [Ping timeout: 244 seconds]
<bean> pewter_tao: File.zero?(file)
itchyouch has joined #ruby
<pewter_tao> I don't think that's the problem, I'm getting some invalid byte sequence error
<pewter_tao> but I'll try that
sailias has quit [Quit: Leaving.]
<bean> pewter_tao: change your regex back to how it was
<pewter_tao> bean: yep I get: undefined method `match' for nil:NilClass, if it hits a zero file, but I get match': invalid byte sequence in US-ASCII (ArgumentError) if it hits a non-ascii file
Schmidt has joined #ruby
havenn has left #ruby ["Leaving..."]
<pewter_tao> so I need some sort of ascii regex
<bean> hmm ok
vlad_starkov has joined #ruby
freakazoid0223 has quit [Quit: Leaving]
spanner has quit [Remote host closed the connection]
jtharris has quit [Quit: WeeChat 0.3.9.2]
<pewter_tao> bean: how would I do that? I wanna use the file cmd for obvious reasons: `file "#{not sure what goes here}"`[/ASCII/]
<bean> pewter_tao: File.open("Install OS X Mountain Lion").read.encoding
seich is now known as Seich
spanner has joined #ruby
<bean> err, file, instead of that string
<bean> I was testing it on that file lol
<pewter_tao> hehe
undersc0re97 has joined #ruby
mercwithamouth has joined #ruby
<bean> pewter_tao: except I don't think that works :) cuz it says an executable is utf8
<pewter_tao> where do I put that?
<pewter_tao> can we use the file cmd and search for"ASCII"?
zastern has joined #ruby
<bean> uh sure
<bean> one sec
<zastern> So, in the ruby documentation for the File class, these methods(?) are described twice, with the same source code, but different functionality. I'm confused. Anybody know what's up? http://cl.ly/image/3F3X3l1K1j07
spanner has quit [Read error: Connection reset by peer]
<pewter_tao> bean: I thought
<pewter_tao> !!`file "#{fn}"`[/ASCII/] would do it
<ddd> I'm running a CLI application under JRuby 1.7.1. I've set the YAML parsing engine to 'psych' with ::YAML::ENGINE.yamler = 'psych'. I've edited my db/database.yml to use eRB to define which adapter to use depending on if its run under MRI or JRuby, but the eRB isnt being processed. https://github.com/ddd/dtf/blob/master/db/config.yml Would someone take a look and see if I've goofed something?
<bean> pewter_tao: it should
<pewter_tao> bean: I mean it does, but I'm not sure how to inject it into my code
<bean> oh, i'd make a function that you pass the filename or file into.
atal421 has quit [Ping timeout: 248 seconds]
havenn has joined #ruby
<ddd> the sqlite3 adapter selection works fine, and depending on RUBY_PLATFORM the correct gems are selected, installed, and used. Its when it tries to parse the erb in the database.yml that it pukes. It *should* be parsing it but its not. It sees the erb as if its straight text.
jlwestsr has joined #ruby
<pewter_tao> bean: this isn't working: next if file.binmode? || File.directory?(file) || File.zero?(file) || !!`file "#{file_name}"`[/ASCII/] || !ruby_file?(file) # || !bash_file?(file)
thams has quit [Quit: thams]
<bean> pewter_tao: can you paste that to pastebin again
<bean> w/ those changes
Kuifje has quit [Ping timeout: 265 seconds]
squidBits has quit [Ping timeout: 255 seconds]
vlad_starkov has quit [Ping timeout: 250 seconds]
<pewter_tao> think, I fixed it, but it may be logically wrong, I used one '!' instead of '!!'
Virunga has quit [Ping timeout: 248 seconds]
bwlang has left #ruby [#ruby]
<pewter_tao> bean: http://pastebin.com/0UT3SgfP
bwlang has joined #ruby
<pewter_tao> bean: okay, so if I remove the comments from teh bash code, then that breaks it
squidBits has joined #ruby
nemesit|osx has joined #ruby
Virunga has joined #ruby
<bean> pewter_tao: you want !! for sure
<pewter_tao> bean: I still get the ASCII error then
<bean> on what sort of file
<bean> (so i can test)
<pewter_tao> .tgz
<pewter_tao> I'm guessing
tommyvyo has quit [Quit: Computer has gone to sleep.]
<bean> ah, it bombs out on me on a .gif.
<bean> im really not sure how to solve this, and I'm out of time today :(
<pewter_tao> :(
ruzu has joined #ruby
<pewter_tao> can you tell me realaly quick why removing the comments on teh bash code breaks it?
<pewter_tao> invalid limit: 0 for readlines (ArgumentError)
nemesit has quit [Ping timeout: 260 seconds]
helpa has joined #ruby
<epochwolf> hi helpa
<helpa> epochwolf:hi
redmaverick has joined #ruby
arturaz_ has joined #ruby
arturaz_ has quit [Remote host closed the connection]
rakl has quit [Quit: sleeping]
helpa has left #ruby [#ruby]
agarie has joined #ruby
wedtm|away has quit [Ping timeout: 240 seconds]
rbennacer has left #ruby ["Leaving"]
banister_ has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
rondale_sc has quit [Quit: rondale_sc]
epwhorl has joined #ruby
redmaverick has left #ruby [#ruby]
rbennacer has joined #ruby
<rbennacer> will File.open(filename).each load the file into memory?
Vert has joined #ruby
<JDubs> What is the command to round a float up?
rakl has joined #ruby
emergion has joined #ruby
ossareh has quit [Remote host closed the connection]
nga4 has quit [Ping timeout: 264 seconds]
<bean> pewter_tao: because look at the difference between your bash method and your ruby method
<bean> [] vs ()
witchdoc has quit [Ping timeout: 264 seconds]
atmosx has quit [Quit: WeeChat 0.4.0-dev]
<pewter_tao> yeah, sry found that
<pewter_tao> I get this now: undefined method `match' for nil:NilClass
<pewter_tao> it's like the bash method cna't skip zero sized files
atal421 has joined #ruby
wereHamster has quit [Ping timeout: 264 seconds]
mosez has quit [Ping timeout: 264 seconds]
reppard has joined #ruby
reppard_ has joined #ruby
<bean> JDubs: .round?
witchdoc has joined #ruby
witchdoc has quit [Changing host]
witchdoc has joined #ruby
ConvergenceRunne has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
mosez has joined #ruby
Muz has quit [Ping timeout: 264 seconds]
failingkid has quit [Ping timeout: 264 seconds]
jtharris has joined #ruby
<JDubs> kk thx
wereHamster has joined #ruby
failingkid has joined #ruby
Muz has joined #ruby
samphippen has quit [Quit: Computer has gone to sleep.]
<pewter_tao> bean: I thought we fixed that error with File.zero?(file)
ossareh has joined #ruby
<bean> pewter_tao: is it really 0 sized?
ryanjh has joined #ruby
x82_nicole has quit [Quit: Computer has gone to sleep.]
itchyouch has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<pewter_tao> probably not, so maybe I should check for if it has a first line
<pewter_tao> or a carrige return?
<bean> yep.
<bean> well
<bean> what you'll want to do is check if file.readlines[0] == nil
bwlang has left #ruby [#ruby]
tommyvyo has joined #ruby
<pewter_tao> actually, the error is: undefined method `match' for nil:NilClass (NoMethodError) so it isn't due to a file
elaptics is now known as elaptics`away
<bean> pewter_tao: i know
<bean> but
<bean> file.readlines[0] will be nil
<bean> if theres nothing on line 0
c0rn has joined #ruby
c0rn_ has joined #ruby
<pewter_tao> it goes away if I get rid of next if !bash_file?(file)
<bean> pewter_tao: what is this supposed to be accomplishing anyways
c0rn_ has quit [Client Quit]
<pewter_tao> I definitely want it :)
Goles has quit [Quit: Computer has gone to sleep.]
<bean> ...
<pewter_tao> adding functionality to syntax checking
<pewter_tao> bash -n and ruby -c don't care what files are checked
<pewter_tao> it's part of some automation
blacktulip has quit [Ping timeout: 248 seconds]
<bean> ok
Coolhand|laptop has quit [Ping timeout: 265 seconds]
<pewter_tao> what's the SOP for readlines if it doesn't have that line?
<pewter_tao> I think it should be able to have a blank first line
emergion has quit [Quit: Computer has gone to sleep.]
<bean> pewter_tao: http://pastebin.com/Cbg2RzWx
cakehero has joined #ruby
<bean> might want to refactor that so the check for || extname == .rb is not inside the if
<bean> or w/e
<bean> but i've really gotta go now
<pewter_tao> bean: grea thnks
<pewter_tao> ohh yeah right
<pewter_tao> :) have a good day
locriani_ has quit [Ping timeout: 252 seconds]
bean has quit [Quit: Textual IRC Client: www.textualapp.com]
reppard_ has quit [Ping timeout: 252 seconds]
reppard has quit [Ping timeout: 252 seconds]
blacktulip has joined #ruby
pkeni has joined #ruby
jxf has joined #ruby
omg765 has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
_nitti has quit [Remote host closed the connection]
ejholmes has quit [Quit: ejholmes]
ejholmes has joined #ruby
jhunter has quit [Ping timeout: 244 seconds]
nomenkun has quit [Ping timeout: 248 seconds]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
BigO_ has quit [Remote host closed the connection]
rondale_sc has joined #ruby
LouisGB has quit [Ping timeout: 252 seconds]
rondale_sc has quit [Remote host closed the connection]
freakazoid0223 has joined #ruby
JodaZ has quit [Remote host closed the connection]
JodaZ has joined #ruby
pwelch_ has joined #ruby
Mon_Ouie has quit [Ping timeout: 260 seconds]
phantasm66 has quit [Quit: *sleeeep….]
pwelch_ has quit [Client Quit]
hukl has quit [Quit: Leaving...]
alex__c2022 has quit [Remote host closed the connection]
emergion has joined #ruby
alex__c2022 has joined #ruby
BigO_ has joined #ruby
BigO_ has quit [Remote host closed the connection]
sailias has joined #ruby
pwelch has quit [Ping timeout: 276 seconds]
burgestrand has joined #ruby
emergion has quit [Ping timeout: 244 seconds]
<JDubs> bean: what you workin on
gyre007 has joined #ruby
kirun has quit [Quit: Client exiting]
atal421 has quit [Quit: atal421]
seanyo has joined #ruby
love_color_text has joined #ruby
<JDubs> ugh...i hate when my eueler programs run forever...
samphippen has joined #ruby
d2dchat has quit [Remote host closed the connection]
<havenn> JDubs: Which Euler # are you on?
love_color_text has quit [Remote host closed the connection]
reppard has joined #ruby
reppard_ has joined #ruby
<JDubs> 12
JodaZ has quit [Remote host closed the connection]
<JDubs> What's a method that will find the first true and return it enumerable?
GoGoGarrett has quit [Remote host closed the connection]
<JDubs> find?
squidBits has quit [Quit: squidBits]
mneorr has quit [Remote host closed the connection]
cableray has joined #ruby
Vert has quit [Read error: Connection reset by peer]
<havenn> JDubs: Yup.
<havenn> JDubs: [*1..10].find { |x| x > 7 } #=> 8
jonahR has quit [Quit: jonahR]
danneu has quit [Quit: WeeChat 0.3.8]
pkeni has quit [Changing host]
pkeni has joined #ruby
seanyo has quit [Ping timeout: 256 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
<JDubs> hey guys, I think i figured out a neato method to reduce runtime on some recursive functions
<JDubs> tell me what you think
elico has joined #ruby
<JDubs> oops
<JDubs> let me fix somethin sec
maletor has joined #ruby
<apeiros_> a
seanyo has joined #ruby
<apeiros_> nav
<apeiros_> gah
<apeiros_> ga
<JDubs> apeiros_ what?
<apeiros_> lol, I fail at typing
nari has joined #ruby
<apeiros_> havenn: no need for the [*] there, (1..10).find is sufficient
cascalheira has joined #ruby
cascalheira has quit [Client Quit]
punkrawkR has quit [Read error: Connection reset by peer]
alex__c2022 has quit [Quit: alex__c2022]
cascalheira has joined #ruby
<havenn> apeiros_: Good point, I was just thinking of an array for some reason - does make example easier to read!
cascalheira has quit [Client Quit]
seanyo_ has joined #ruby
cascalheira has joined #ruby
havenn has quit [Remote host closed the connection]
samuel02 has quit [Remote host closed the connection]
blacktulip has quit [Remote host closed the connection]
cantonic has joined #ruby
seanyo has quit [Ping timeout: 252 seconds]
<JDubs> what's the best way to count to infinite?
sepp2k1 has quit [Remote host closed the connection]
<JDubs> if i want to search infinite numbers until my find works
<JDubs> without doing until
<JDubs> apeiros_ any idea bromo?
malte_ has quit [Quit: malte_]
<kenneth> range to infinity
slainer68 has joined #ruby
<JDubs> how do you make a range go to infinite?
reppard_ has quit [Ping timeout: 248 seconds]
generali_ has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
reppard has quit [Ping timeout: 276 seconds]
<kenneth> (1..1.0/0.0)
<kenneth> it's a little weird
DrShoggoth has quit [Quit: Leaving]
<kenneth> but in ruby if you divide a float by zero you get infinity
<kenneth> if you do it to an int though you get an exception
<JDubs> i see
Guest___ has joined #ruby
banister_ has quit [Ping timeout: 244 seconds]
alanp has quit [Ping timeout: 240 seconds]
ejholmes has quit [Quit: ejholmes]
<JDubs> apeiros_ make my solutions run faster :'(
<pewter_tao> http://pastebin.com/diff.php?i=YcYeLjBy this ends up doing ruby checks on bash files and bash checks on ruby files... How do I keep the defs separate?
andrewhl has quit [Remote host closed the connection]
<pewter_tao> I thought having separate defs for bash and ruby would do it, but I need some extra logic
LouisGB has joined #ruby
evilsushi has quit [Quit: Lost terminal]
joshman_ has quit [Quit: Computer has gone to sleep.]
<foucist> JDubs: :P
seanyo_ has quit [Remote host closed the connection]
hydrozen has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<foucist> JDubs: btw, have you read david black's ruby books? The Well-Grounded Rubyist
generalissimo has quit [Ping timeout: 260 seconds]
jeekl has quit [Ping timeout: 244 seconds]
stopbit has quit [Quit: Leaving]
<JDubs> foucist: haven't heard of that one
<JDubs> man...
<JDubs> my current solution has been running a few minutes
<JDubs> ugh
<JDubs> :(
<foucist> i haven't read it, but i read his first book "Ruby for Rails" and it was a great read.. practically read the whole thing in 2-3 sittings
epwhorl has quit [Ping timeout: 255 seconds]
<foucist> but it's outdated now.. Rails 1.x stuff, the ruby parts are solid though
<foucist> it's like half ruby and half rails
whitenoise has quit [Quit: This computer has gone to sleep]
osvico has quit [Read error: Connection reset by peer]
malte_ has joined #ruby
<JDubs> foucist: tell me what you think of this code please http://pastebin.com/r4QCqrTj
<JDubs> foucist: it's slooooow
<JDubs> foucist :/
<foucist> dang, pastebin loading slow for me
<foucist> or my internet sucks
mercwithamouth has quit [Ping timeout: 276 seconds]
<foucist> JDubs: protip, use pastie.org or gist.github.com preferably gist
<foucist> JDubs: https://github.com/radar/guides/blob/master/using-gist.md (ignore the sarcastic parts)
JodaZ has joined #ruby
<foucist> but it's easier to fork and show how you modified versions and so on
<foucist> and other people can fork it and you can follow what they changed etc
havenn has joined #ruby
theRoUS_ has quit [Ping timeout: 265 seconds]
jeekl has joined #ruby
<foucist> pastebin ain't loading for me.. weird
Guest___ is now known as dweeb
epwhorl has joined #ruby
idzuna has joined #ruby
<pewter_tao> havenn: you around?
<ner0x> Is it possible to split by multiple things?
catphish has joined #ruby
<havenn> pewter_tao: Hey, yup.
<ner0x> Say /:;-\//
<pewter_tao> ah ok, http://pastebin.com/diff.php?i=YcYeLjBy this ends up doing ruby checks on bash files and bash checks on ruby files... How do I keep the defs separate?
<pewter_tao> havenn: make sense?
mjolk2 has quit [Quit: Leaving]
ChampS666 has quit [Ping timeout: 265 seconds]
<dweeb> ner0x: why don't you try?
<havenn> pewter_tao: Sec phone, will look in a min. :)
undersc0re97 has quit [Quit: Live from Pyongyang DPRK this is...]
<ner0x> dweeb: I wouldn't ask here if I didn't :)
<ner0x> dweeb: And I asked to see if there were some sort of tips/tricks to it.
<kenneth> hey
<kenneth> can you make an object be falsy in ruby?
ikaros has quit [Quit: Ex-Chat]
osvico has joined #ruby
<JDubs> Apeiros_ is there something like .find but for a num? to match a block to the num? and if block(using num) matches it returns the num?
nga4 has joined #ruby
SCommette has quit [Quit: SCommette]
<catphish> kenneth: afaik you can't
<foucist> JDubs: isn't it gonna run forever if the range is to infinity btw?
cascalheira has quit [Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )]
agarie has quit [Remote host closed the connection]
havenn has quit [Read error: Connection reset by peer]
<ddd> JDubs: hear tell you're a fellow ex Brother In Arms
cascalheira has joined #ruby
<dweeb> ner0x: just use the or operator. ie split(/:|;|-|\//)
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
<JDubs> ddd: yeah, 6 years US army
<ner0x> dweeb: That easy huh? Odd.
havenn has joined #ruby
<ner0x> dweeb: Thank you sir.
malte_ has quit [Quit: malte_]
<JDubs> ddd: you?
<JDubs> foucist: should run till the .find passes I think?
<ddd> JDubs: 18.5y
<foucist> JDubs: ah right
<JDubs> that's pretty close to 20, you get medical ?
atal421 has joined #ruby
<ddd> spread across 22y. I took some time off during that time
<ddd> yeah
<ddd> out on 80% SC
<JDubs> Hope you didn't lose any limbs :/
<ddd> no. 4 discs, both knees shot, nerve damage, migraines
<ddd> gimme a few. gotta make a jruby+rspec stack trace for this
jxf has quit [Ping timeout: 260 seconds]
fir_ed has joined #ruby
<JDubs> kk
rondale_sc has joined #ruby
<ddd> ok, actually, i'm running rspec ——backtrace spec but I also need as much additional info as I can from the underlying ruby as well. anyone know how to turn on verbosity with the underlying ruby just for that run?
JodaZ has quit [Remote host closed the connection]
rondale_sc has left #ruby [#ruby]
kpshek has joined #ruby
rondale_sc has joined #ruby
<havenn> pewter_tao: Link isn't working for me. Can you Gist it?
catphish has left #ruby ["Leaving"]
ejholmes has joined #ruby
<lectrick> !(A and B) == !A or !B .. What is that called?
<lectrick> /boolean logic fail
rboyd has quit [Ping timeout: 276 seconds]
<havenn> lectrick: precedence?
<pewter_tao> havenn: http://pastebin.com/BHt7EvRm
headius has joined #ruby
dweeb has quit [Quit: Textual IRC Client: www.textualapp.com]
<pewter_tao> havenn: I realized that the logic wasn't kept separate, I'm not sure how to separate it out. Right now ruby is run on bash files and bash on ruby....
foohey has quit [Read error: Connection reset by peer]
<blazes816> lectrick: demorgan's law?
mercwithamouth has joined #ruby
kpshek has quit []
robotmay has joined #ruby
<pewter_tao> havenn: make sense?
<havenn> pewter_tao: Ah, kk. Yup, makes sense. Sec.
Guest___ has joined #ruby
banisterfiend has joined #ruby
Guest___ is now known as dweeb
<apeiros_> JDubs: hu? find works for anything, that's why you've got a block
<apeiros_> or can you make a concrete example?
ner0x has quit [Quit: Leaving]
willob has quit [Quit: Leaving.]
Nisstyre has quit [Ping timeout: 244 seconds]
razibog has joined #ruby
williamcotton has quit [Quit: williamcotton]
<kenneth> is there a way to break out of a map?
<kenneth> say i have
Averna has quit [Quit: Leaving.]
<gbchaosmaster> kenneth: Mhm, use break.
<kenneth> what will that do in a map block?
<kenneth> that'll return the list of mapped elements up till that point?
hakunin has quit [Read error: Connection reset by peer]
<pewter_tao> havenn: still with me?
hakunin has joined #ruby
mmitchell has quit [Ping timeout: 250 seconds]
davidcelis has quit [Quit: K-Lined.]
IceDragon has joined #ruby
<havenn> pewter_tao: Needs refactoring, but: https://gist.github.com/4272719
CaptainJet has joined #ruby
<gbchaosmaster> kenneth: Nope. Depending on what exactly you're doing, your best bet may be to use some soft of filter before you map.
ConvergenceRunne has joined #ruby
jeffreybaird has joined #ruby
itchyouch has joined #ruby
<havenn> pewter_tao: Since you're checking the File.extname(file_name) more than once, I'd set an instance variable for @ext to reuse.
<pewter_tao> havenn: where does the bash -n filename go?
<havenn> pewter_tao: Oh, i didn't notice it was -n for bash, sec.
ConvergenceRunne has quit [Client Quit]
Rym has quit [Quit: Rym]
<kenneth> gbchaosmaster: i want to filter & map at the same time. i guess i can't do that functionally
<havenn> pewter_tao: This work?: https://gist.github.com/4272719
jtharris has quit [Quit: WeeChat 0.3.9.2]
generali_ has quit [Remote host closed the connection]
<havenn> pewter_tao: Might wanna refresh, I'm engaging in variable naming fail.
nemesit|osx has quit [Quit: Leaving...]
dankest has joined #ruby
timonv has joined #ruby
tommyvyo_ has joined #ruby
<havenn> pewter_tao: You probably want to abstract the file attributes out into a class of its own.
apok_ has joined #ruby
piotr_ has quit [Ping timeout: 240 seconds]
Kruppe has quit [Ping timeout: 244 seconds]
<JDubs> WOW
<JDubs> i just left for about 20 minutes: come back, problem still not solved yet wtf
<JDubs> can someone please tell me why my code sucks so hard? https://gist.github.com/4272782
nari has quit [Ping timeout: 276 seconds]
rismoney has joined #ruby
Vert has joined #ruby
<rismoney> can I turn the contents of variable into the name of a new variable?
timonv has quit [Ping timeout: 260 seconds]
apok has quit [Ping timeout: 265 seconds]
apok_ is now known as apok
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
<JDubs> rismoney: yes that's called metaprogramming :)
darthdeus has quit [Quit: Leaving...]
<JDubs> I forget how you do it though :( you can google ruby metaprogramming though
Guest19224 has joined #ruby
itchyouch has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
Guest19224 is now known as andalf
* bricker
* bricker
jeffreybaird has quit [Quit: jeffreybaird]
davidcelis has joined #ruby
<JDubs> havenn: can you help me please? anyone?
apok has quit [Quit: apok]
jgarvey has quit [Quit: Leaving]
<andalf> sup
<havenn> JDubs: What's the expected answer?
x82_nicole has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
<JDubs> I don't know the answer yet...but for instance if you change 500 to 5 you get 28=> an array of factors of 28
<pewter_tao> havenn: I tried this: http://pastebin.com/w1pnF9Y4
<pewter_tao> havenn: now it doesn't find any files :X
<JDubs> havenn: i've been waiting for my answer to 500 to pop out for over half an hour :/
<havenn> JDubs: hehe
<JDubs> havenn: can you help me figure out why my code is so sluggish so i can get my answer? lol
DaZ has joined #ruby
[D]rammer has joined #ruby
<havenn> JDubs: Name the file with an '.rb' so it looks pretty!
<aces1up> hey all i have a timer class i built, i'm not quite sure if its having thread lock issues, could someone take a look at and see if there are any issues they can see?
kiyoura has joined #ruby
<rismoney> blazes816...not sure i fully understand... i have a def prompt (name) ; puts "what {#name}" ; then i want to add a var_name = gets.chomp
<JDubs> havenn: there :P
<bricker> JDubs: Did you try just running "factor" without the loop? Look.... 1_000_000.factor.size #=> 49. And the higher the number gets, the longer it will take to run, because it has to go through every single number between 2 and self/2
<blazes816> rismoney: where does the name of the var come from?
<bricker> JDubs: 1_000_000_000.factor.size is only 100
nat2610 has left #ruby [#ruby]
brianpWins has quit [Quit: brianpWins]
<JDubs> bricker: so how do I make the code more efficient?
reppard has joined #ruby
reppard_ has joined #ruby
<rismoney> I want to create it from "name" string i pass to the def
C0deMaver1ck has quit [Remote host closed the connection]
rellin has joined #ruby
jjbohn has quit [Quit: Leaving...]
<pewter_tao> havenn: I need to have it using the logic that I defined for bash and ruby up top
<blazes816> rismoney: self.instance_variable_set(name, gets.chomp)
<havenn> pewter_tao: Yeah, I didn't mean to omit that part. I was refactoring it out to its own class but not in the gist.
cr3 has quit [Quit: leaving]
cantonic has left #ruby [#ruby]
jlast has quit [Remote host closed the connection]
<pewter_tao> case needs to be ruby_file or bash_file