fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
lggr has quit [Ping timeout: 240 seconds]
JonnieCache has quit [Ping timeout: 252 seconds]
apok has quit [Read error: Operation timed out]
apok_ is now known as apok
killfill has joined #ruby
<killfill> hi
<matti> Hi
<davidcelis> hi
dnyy has joined #ruby
patricksroberts has joined #ruby
<killfill> how do i see where does gem install the binaries?
cakehero has joined #ruby
patrickximenes has quit [Client Quit]
<davidcelis> you can use `which` on the binary
maletor has joined #ruby
lggr has joined #ruby
<davidcelis> for example `gem install bundler && which bundle`
anildigital_work has joined #ruby
ph^ has quit [Ping timeout: 240 seconds]
kapowaz has joined #ruby
Guedes has quit [Ping timeout: 260 seconds]
apok has quit [Quit: apok]
peregrine81 has joined #ruby
<killfill> hm..
<davidcelis> unless you're using rbenv, in which that would only show the shi,
daniel_- has joined #ruby
<davidcelis> shim*
<killfill> davidcelis: but for example chef bin is at /Library/Ruby/Gems/1.8/gems/chef-10.14.4/bin, and which doesnt know that..
<davidcelis> then that's not in your $PATH
<killfill> exactly.. :)
<davidcelis> killfill: or your gem install is not installing binaries correctly
<davidcelis> because that should probably have been symlinked to /usr/local/bin or something
<killfill> how do i know where is the bin gem been saved?.. im doing a little script that runs stuff, on different OS's
swarley has joined #ruby
codebrah has quit [Read error: Connection reset by peer]
jgwong has joined #ruby
Takehiro has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
jrist is now known as jrist-afk
lggr has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
c0rn_ has joined #ruby
<killfill> no way to detect this?.. :S
lggr has joined #ruby
Takehiro has quit [Ping timeout: 240 seconds]
dakine has joined #ruby
jimeh4 has joined #ruby
adeponte has quit [Remote host closed the connection]
slicslak has joined #ruby
tyfighter has quit [Quit: tyfighter]
lggr has quit [Ping timeout: 255 seconds]
<jvkTommy> hmmm
* jvkTommy is looking at the docs for each_with_object
chimkan_ has quit [Quit: chimkan_]
<blazes816> how is it?
<bperry> killfill: you can only assume that it may be referenced as 'gem' in the environment, and let the user optionally specify where the gem bin is
jimeh4 has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
<jvkTommy> I assume that it means that if you only supply one argument to the block
<jvkTommy> then memo_obj gets assigned to it?
<jvkTommy> because args is in brackets?
<jvkTommy> oh, or is it the other way round
<blazes816> jvkTommy: yes
<blazes816> to the former
<jvkTommy> try evaluating..
<blazes816> [].each_with_object(:foo){} #=> :foo
<jvkTommy> 5.times.each_with_object {|thing| puts thing}
<jvkTommy> uhh
<jvkTommy> 5.times.each_with_object("abc") {|thing| puts thing}
<jvkTommy> for me, it prints out 1 2 3 4 5
<blazes816> it should
jasonkuhrt has joined #ruby
<blazes816> thing is the current val of the enumerable
<blazes816> 1, then 2, etc
<blazes816> 5.times.each_with_object("abc") {|thing, otherthing| puts otherthing}
<jvkTommy> but memo_obj is a required argument? it has to be supplied?
<jvkTommy> hmm
<jvkTommy> no, that's where I've gone wrong, I think
sr___ has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 246 seconds]
davidcelis has quit [Quit: K-Lined.]
<lurraca> Hi guys, I know this problem should be easy but I'm looking the more rubyist way to solve
<lurraca> Im checking if a string is a domain
<lurraca> def domain_name?(url)
<lurraca> end
<lurraca> domain_regex = /^((http|https):\/\/)[a-z0-9]*(\.?[a-z0-9]+)\.[a-z]{2,5}(:[0-9]{1,5})?(\/.)?$/ix
<lurraca> !domain_regex.match(url).nil?
BrokenCog has joined #ruby
BrokenCog has joined #ruby
BrokenCog has quit [Changing host]
Samanagh has joined #ruby
iamlacroix has quit [Remote host closed the connection]
<lurraca> but what i need is that if is not a domain name, add http:// to the string and check one more time if its a domain_name and return true or false
<lurraca> i mean I can do one more if on it
ph^ has joined #ruby
<lurraca> but doesn't seems like an elegant solution to me
<blazes816> make the http part optional?
<blazes816> domain_regex = /^((http|https):\/\/)?[a-z0-9]*(\.?[a-z0-9]+)\.[a-z]{2,5}(:[0-9]{1,5})?(\/.)?$/ix
<Samanagh> Anyone know how I can call a ruby file from cmd without a .rb extention like so: fileName parameter1 parameter2 parameter3
<blazes816> Samanagh: add a shebang line?
<jvkTommy> shebangs don't work in windows?
<Samanagh> I'm talking windows
lggr has joined #ruby
<Samanagh> Hence 'cmd'
killfill has left #ruby [#ruby]
<jvkTommy> actually
<jvkTommy> oh
<jvkTommy> why do you need to do this?
<lurraca> blazes816: I actually want the string to have http or https on it
<Samanagh> A requirement for an assignment: Has to be run in that syntax :(
<blazes816> lurraca: check for it first, if it's absent add it, then do the check to see if it's a url?
justinmcp has joined #ruby
F1skr has quit [Quit: WeeChat 0.3.8]
<jvkTommy> Samanagh: Sounds like a stupid assignment...
joofsh has quit [Quit: Leaving]
<jvkTommy> :s
<Samanagh> Haha they're not expecting people to do it in ruby methinks
headius has joined #ruby
<lurraca> blazes816: this would work?
<lurraca> def domain_name?(url)
<lurraca> domain_regex = /^((http|https):\/\/)[a-z0-9]*(\.?[a-z0-9]+)\.[a-z]{2,5}(:[0-9]{1,5})?(\/.)?$/ix
<lurraca> true
<lurraca> else
<lurraca> if !domain_regex.match(url).nil?
<lurraca> url = 'http://'+url
<lurraca> false
<lurraca> end
<lurraca> 1.times do {domain_name(url)}
<lurraca> end
Synthead has quit [Remote host closed the connection]
havenn has joined #ruby
jasonkuhrt has quit [Quit: Leaving...]
c0rn_ has quit [Quit: Computer has gone to sleep.]
waxjar has joined #ruby
<blazes816> that will recurse infinitely
lggr has quit [Ping timeout: 245 seconds]
<jvkTommy> something like this http://pastie.org/4858496
<jvkTommy> actually that puts "http://" end the end of the string
<jvkTommy> but it'll work if you put it on the front instead
<jvkTommy> also, that looks too much like perl IMO :(
ph^ has quit [Ping timeout: 245 seconds]
<blazes816> url = "http://#{url} if url !~ /^https?:\/\//
<blazes816> lol
dakine has quit [Quit: Leaving]
<blazes816> <3 perl
* jvkTommy shivers
<blazes816> url = "http://#{url}" if url !~ /^https?:\/\//
dakine has joined #ruby
ncr100_ has joined #ruby
lggr has joined #ruby
peregrine81 has quit [Quit: Computer sleeping.]
jgwong has quit [Ping timeout: 246 seconds]
ncr100 has quit [Ping timeout: 245 seconds]
peregrine81 has joined #ruby
joelsbeard has quit [Ping timeout: 252 seconds]
dakine has left #ruby ["Leaving"]
otters has quit [Ping timeout: 246 seconds]
<jvkTommy> actually, lurraca, what you want is alerady in the standard library http://www.ruby-doc.org/stdlib-1.9.3/libdoc/uri/rdoc/URI.html#method-c-parse
<lurraca> jvkTommy: let me check that
ncr100_ has quit [Ping timeout: 248 seconds]
lggr has quit [Ping timeout: 260 seconds]
tgraham has joined #ruby
peregrine81 has quit [Client Quit]
ffranz1 has joined #ruby
daniel_- has quit [Ping timeout: 255 seconds]
mengu has quit [Remote host closed the connection]
bobbbo has quit [Quit: bobbbo]
blazes816 has quit [Quit: blazes816]
ffranz has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
Agis__ has joined #ruby
saschagehlich has quit [Quit: saschagehlich]
hbpoison has joined #ruby
chimkan_ has joined #ruby
VegetableSpoon has joined #ruby
ando has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
slicslak has quit [Ping timeout: 256 seconds]
justinmcp has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
Hanmac1 has joined #ruby
Markvilla has joined #ruby
moshee has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 255 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
lggr has joined #ruby
yoklov has quit [Quit: computer sleeping]
ipoval has joined #ruby
Hanmac has quit [Ping timeout: 252 seconds]
fixl has joined #ruby
headius has quit [Quit: headius]
ph^ has joined #ruby
ryanlecompte has quit [Remote host closed the connection]
Takehiro has joined #ruby
jerrad has quit [Quit: Linkinus - http://linkinus.com]
lggr has quit [Ping timeout: 248 seconds]
<waxjar> does someone know a trick for making sure a method exists on an object you're including a Module in?
Takehiro has quit [Ping timeout: 240 seconds]
sent-hil has quit [Remote host closed the connection]
<waxjar> this illustrates my problem: https://gist.github.com/3802815. I'd like to be able to put the include statement on top for readability
jgwong has joined #ruby
roadt has joined #ruby
lggr has joined #ruby
rvmeier has joined #ruby
wargasm has joined #ruby
linoj has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
<Spooner> waxjar : No, because the method hasn't been defined by the time the include is called. Why do you need it? Likely there is a better way to deal with it in another way.
vitor-br has joined #ruby
ffranz1 has quit [Quit: Leaving]
<waxjar> i have a helper module that needs to send messages over a socket. the module will be included on a few classes (obviously).
<waxjar> i thought i'd do that using a method each class that includes the helper module implements (as the method to send messages with each of those classes will be different)
tgraham_ has joined #ruby
havenn has quit [Remote host closed the connection]
seoaqua has joined #ruby
dpk has quit [Quit: Asleep at the keyboard.]
lggr has quit [Ping timeout: 244 seconds]
<waxjar> i don't have to check if the method exists per sé, but the helper is written in such a way that other projects could just copy and paste it. i thought it'd be nice to built a little check like that in, but it's only going to cause trouble now
tgraham has quit [Ping timeout: 244 seconds]
pskosinski has quit [Ping timeout: 276 seconds]
<Spooner> Well, a run-time check if the method exists is probably the most sensible, but it will raise an exception when it calls #test anyway, so I wouldn't worry too much.
<waxjar> by run-time check you mean just check in the methods on the helper?
emergion has joined #ruby
yoklov has joined #ruby
<Spooner> Yeah, but if you do that, then all you'd do is raise an exception. Might as well let the user just get the NoMethodError.
friskd has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
<waxjar> yeah, good point
headius has joined #ruby
<Spooner> Perhaps you don't want a module, though, if it is important. Perhaps you want another class that you create with MyClass.new(OriginalClass) or somesuch.
jeffreybaird has joined #ruby
rabidpraxis has joined #ruby
hbpoison has quit [Ping timeout: 240 seconds]
Sunhay is now known as sunhay
cakehero has joined #ruby
Targen has joined #ruby
butblack has joined #ruby
colinbm has quit [Quit: colinbm]
lggr has quit [Ping timeout: 244 seconds]
rabidpraxis has quit [Remote host closed the connection]
lggr has joined #ruby
jasonkuhrt has joined #ruby
yshh has joined #ruby
cakehero has quit [Ping timeout: 260 seconds]
Edward_ has quit [Quit: Leaving]
bricker_ has quit [Ping timeout: 246 seconds]
vitor-br has quit [Quit: Saindo]
glyytchy has quit [Quit: Leaving...]
qos has quit [Quit: Linkinus - http://linkinus.com]
jasonkuhrt has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 260 seconds]
skaczor has quit [Quit: Leaving]
ph^ has joined #ruby
cakehero has joined #ruby
lggr has joined #ruby
seanstickle has joined #ruby
sr___ has quit [Remote host closed the connection]
NimeshNeema has quit [Write error: Connection reset by peer]
nari_ has joined #ruby
LouisGB has quit [Ping timeout: 255 seconds]
otters has joined #ruby
Markvilla has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 246 seconds]
sr___ has joined #ruby
NimeshNeema has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
seoaqua has quit [Ping timeout: 245 seconds]
CaptainJet has quit []
seoaqua has joined #ruby
chimkan_ has quit [Quit: chimkan_]
lggr has joined #ruby
jonathanwallace has joined #ruby
jgwong has quit [Ping timeout: 252 seconds]
dpk has joined #ruby
Know1edge has quit []
chendo_ has quit [Ping timeout: 255 seconds]
cburyta has quit [Remote host closed the connection]
Markvilla has joined #ruby
Spooner has quit [Ping timeout: 240 seconds]
rads has quit [Quit: Computer has gone to sleep.]
JonnieCache has joined #ruby
chendo__ has joined #ruby
linoj has quit [Quit: linoj]
pipopopo has quit [Ping timeout: 246 seconds]
Ruler_Of_Heaven_ has joined #ruby
seoaqua has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 255 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
lggr has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
Ruler_Of_Heaven_ has quit [Ping timeout: 255 seconds]
seanstickle has quit [Quit: seanstickle]
wpaulson has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
wpaulson_ has joined #ruby
pipopopo has joined #ruby
<swarley> ugh
g-ram has joined #ruby
<swarley> so hard to go anywhere and say you program in Ruby
Takehiro has joined #ruby
wpaulson_ has quit [Client Quit]
ando has quit [Remote host closed the connection]
BMF has quit [Remote host closed the connection]
wpaulson has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 240 seconds]
`brendan has joined #ruby
linoj has joined #ruby
elico has quit [Ping timeout: 240 seconds]
jrunning has quit [Ping timeout: 255 seconds]
Takehiro has quit [Ping timeout: 240 seconds]
Markvilla has quit [Quit: Computer has gone to sleep.]
pingfloyd has joined #ruby
jgwong has joined #ruby
colinbm has joined #ruby
Nisstyre-laptop has quit [Remote host closed the connection]
lggr has joined #ruby
jrunning has joined #ruby
seoaqua has joined #ruby
tgraham_ is now known as tgraham
icole has quit [Remote host closed the connection]
maletor has joined #ruby
ph^ has joined #ruby
alvaro_o has quit [Quit: Ex-Chat]
Nisstyre-laptop has joined #ruby
colinbm has quit [Quit: colinbm]
codeFiend has joined #ruby
glyytchy has joined #ruby
voodoofish430 has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 255 seconds]
philcrissman has quit [Remote host closed the connection]
yakitori has joined #ruby
jrajav has quit []
<shevy> man
<shevy> that is so not true
<shevy> just yesterday I was at the subway station and TOLD the people there
<shevy> "Guys, I program in Ruby."
<shevy> and I was looking damn cool swarley
ph^ has quit [Ping timeout: 260 seconds]
<swarley> shevy, lolol
lggr has joined #ruby
<swarley> well in haskell there is this dude that is PISSED
nga4 has quit [Ping timeout: 244 seconds]
<swarley> like i raped his baby
pygmael has joined #ruby
chendo__ has quit [Ping timeout: 245 seconds]
Targen has quit [Ping timeout: 260 seconds]
Agis__ has quit [Quit: Agis__]
havenn has joined #ruby
chendo_ has joined #ruby
elico has joined #ruby
jgwong has quit [Ping timeout: 244 seconds]
jrunning has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 252 seconds]
havenn has quit [Ping timeout: 256 seconds]
philcrissman has joined #ruby
reset has quit [Ping timeout: 256 seconds]
jasonkuhrt has joined #ruby
DebianUT has quit [Ping timeout: 252 seconds]
lggr has joined #ruby
jrajav has joined #ruby
jrajav has quit [Remote host closed the connection]
cakehero has quit [Ping timeout: 252 seconds]
paydro has joined #ruby
jasonkuhrt has quit [Ping timeout: 260 seconds]
radic has quit [Ping timeout: 246 seconds]
rabidpraxis has joined #ruby
VegetableSpoon has quit [Quit: Leaving]
dpk has quit [Quit: Asleep at the keyboard.]
glyytchy has quit [Quit: Leaving...]
lggr has quit [Ping timeout: 260 seconds]
robertotauille has quit [Quit: Leaving...]
LouisGB has joined #ruby
wez has joined #ruby
hbpoison has joined #ruby
rabidpraxis has quit [Ping timeout: 246 seconds]
ipoval has quit [Quit: ipoval]
lggr has joined #ruby
yakitori has quit [Ping timeout: 248 seconds]
LouisGB has quit [Ping timeout: 245 seconds]
ph^ has joined #ruby
radic has joined #ruby
n_blownapart has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
wez has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
yshh_ has joined #ruby
Beoran has quit [Ping timeout: 245 seconds]
ph^ has quit [Ping timeout: 260 seconds]
waxjar has quit [Quit: Textual IRC Client: www.textualapp.com]
aces1up has quit [Read error: Connection reset by peer]
aces1up has joined #ruby
yshh has quit [Read error: Connection reset by peer]
sirecote has quit [Ping timeout: 244 seconds]
Monie has quit [Read error: Connection reset by peer]
methoddk has quit [Ping timeout: 244 seconds]
seoaqua has quit [Quit: 离开]
methoddk has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
sirecote has joined #ruby
lggr has joined #ruby
Takehiro has joined #ruby
glyytchy has joined #ruby
forced_request has quit [Remote host closed the connection]
huy has joined #ruby
Takehiro has quit [Ping timeout: 240 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 245 seconds]
Beoran has joined #ruby
chrishunt has joined #ruby
lggr has joined #ruby
glyytchy has quit [Quit: Leaving...]
bluOxigen has joined #ruby
davidcelis has joined #ruby
emergion has quit [Quit: Computer has gone to sleep.]
n_blownapart has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 245 seconds]
ianblenke1 has joined #ruby
lggr has joined #ruby
ph^ has joined #ruby
nga4 has joined #ruby
jgwong has joined #ruby
dhruvasagar has joined #ruby
mikepack has joined #ruby
hbpoison has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 246 seconds]
cjs226 has quit []
jasonkuhrt has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
cjs226 has joined #ruby
lggr has joined #ruby
jasonkuhrt has quit [Ping timeout: 245 seconds]
philcrissman has quit [Remote host closed the connection]
tgraham has quit [Quit: Leaving...]
joeycarmello has quit [Remote host closed the connection]
qos has joined #ruby
aeontech has joined #ruby
joeycarmello has joined #ruby
joeycarm_ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
codeFiend has quit [Ping timeout: 246 seconds]
joeycarmello has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
jeffreybaird has quit [Quit: jeffreybaird]
joeycar__ has joined #ruby
joeycarm_ has quit [Ping timeout: 246 seconds]
NoNMaDDeN has joined #ruby
joeycar__ has quit [Read error: Connection reset by peer]
joeycarm_ has joined #ruby
originerd has joined #ruby
wpaulson has joined #ruby
joeycarm_ has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
aeontech has quit [Read error: Operation timed out]
emsilva has quit [Ping timeout: 256 seconds]
joeycarmello has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
codeFiend has joined #ruby
wpaulson_ has joined #ruby
joeycarm_ has joined #ruby
wpaulson_ has quit [Client Quit]
lggr has quit [Ping timeout: 248 seconds]
joeycarm_ has quit [Read error: Connection reset by peer]
joeycarm_ has joined #ruby
joeycar__ has joined #ruby
joeycarm_ has quit [Read error: Connection reset by peer]
bluOxigen has quit [Ping timeout: 248 seconds]
joeycar__ has quit [Read error: Connection reset by peer]
joeycarm_ has joined #ruby
wpaulson has quit [Ping timeout: 248 seconds]
joeycarmello has quit [Ping timeout: 246 seconds]
Knodi has joined #ruby
joeycarmello has joined #ruby
lggr has joined #ruby
mvangala has joined #ruby
Knodi has quit [Client Quit]
iori has joined #ruby
linoj has quit [Quit: linoj]
mvangal__ has quit [Read error: Connection reset by peer]
joeycar__ has joined #ruby
joeycarm_ has quit [Ping timeout: 246 seconds]
joeycar__ has quit [Read error: Connection reset by peer]
joeycarm_ has joined #ruby
araujo has quit [Quit: Leaving]
originerd has left #ruby [#ruby]
joeycarm_ has quit [Read error: Connection reset by peer]
joeycarm_ has joined #ruby
joeycarmello has quit [Ping timeout: 260 seconds]
joeycarm_ has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
iori has quit [Ping timeout: 246 seconds]
rabidpraxis has joined #ruby
frogstarr78 has quit [Ping timeout: 245 seconds]
joeycarmello has quit [Read error: Connection reset by peer]
ph^ has joined #ruby
deryl has joined #ruby
joeycarmello has joined #ruby
joeycarm_ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
emsilva has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
TomJ has quit [Quit: TomJ]
joeycarmello has joined #ruby
joeycar__ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
BrokenCog has quit [Quit: leaving]
hbpoison has joined #ruby
Takehiro has joined #ruby
joeycarmello has joined #ruby
maletor has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
joeycarm_ has quit [Ping timeout: 245 seconds]
joeycarm_ has joined #ruby
lggr has joined #ruby
BrokenCog has joined #ruby
BrokenCog has quit [Client Quit]
butblack has quit [Quit: butblack]
joeycarm_ has quit [Read error: Connection reset by peer]
joeycar__ has quit [Ping timeout: 246 seconds]
joeycarm_ has joined #ruby
joeycar__ has joined #ruby
Takehiro has quit [Ping timeout: 244 seconds]
joeycarmello has quit [Ping timeout: 246 seconds]
joeycar__ has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
joeycar__ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
ph^ has quit [Ping timeout: 260 seconds]
NiteRain has joined #ruby
yakitori has joined #ruby
BrokenCog has joined #ruby
BrokenCog has quit [Changing host]
BrokenCog has joined #ruby
joeycarmello has joined #ruby
dhruvasagar has quit [Ping timeout: 244 seconds]
frogstarr78 has joined #ruby
joeycarm_ has quit [Ping timeout: 246 seconds]
joeycarm_ has joined #ruby
joeyca___ has joined #ruby
joeycarm_ has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
ForevernadeAFK is now known as Forevernade
lggr has quit [Ping timeout: 240 seconds]
joeycarm_ has joined #ruby
joeycar__ has quit [Ping timeout: 246 seconds]
joeycarmello has quit [Ping timeout: 246 seconds]
joeycarm_ has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
rakl has joined #ruby
joeyca___ has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
joeycarm_ has joined #ruby
joeycar__ has joined #ruby
joeycarm_ has quit [Read error: Connection reset by peer]
joeycarmello has quit [Ping timeout: 246 seconds]
NoNMaDDeN has quit [Remote host closed the connection]
joeycarmello has joined #ruby
BrokenCog has left #ruby [#ruby]
Rydefalk_ has quit []
Rydefalk has joined #ruby
joeycarm_ has joined #ruby
joeycar__ has quit [Ping timeout: 260 seconds]
libryder has left #ruby [#ruby]
joeycarmello has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 260 seconds]
joeycar__ has joined #ruby
joeycarm_ has quit [Read error: Connection reset by peer]
chendo_ has quit [Ping timeout: 255 seconds]
paydro has quit [Remote host closed the connection]
joeycar__ has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
thinkclay has joined #ruby
chendo_ has joined #ruby
joeycarm_ has joined #ruby
lggr has joined #ruby
joeycar__ has joined #ruby
jgwong has quit [Ping timeout: 245 seconds]
joeycarmello has quit [Ping timeout: 252 seconds]
joeycarmello has joined #ruby
joeycarm_ has quit [Ping timeout: 244 seconds]
jimeh4 has joined #ruby
ph^ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
tommyvyo has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
joeycar__ has quit [Ping timeout: 244 seconds]
lggr has quit [Ping timeout: 260 seconds]
Takehiro has joined #ruby
codeFiend has quit [Quit: codeFiend]
joeycarm_ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
jimeh4 has quit [Ping timeout: 260 seconds]
swarley has quit [Ping timeout: 244 seconds]
joeycarm_ has quit [Read error: Connection reset by peer]
Takehiro has quit [Remote host closed the connection]
joeycarmello has joined #ruby
freeayu has joined #ruby
lggr has joined #ruby
stkowski has quit [Quit: stkowski]
joeycarmello has quit [Read error: Connection reset by peer]
philips_ has quit [Excess Flood]
cirwim has joined #ruby
joeycarmello has joined #ruby
stkowski has joined #ruby
nightfalcon has joined #ruby
philips_ has joined #ruby
drchaos has joined #ruby
<drchaos> I could use some help with the Ruby Koans
joeycarm_ has joined #ruby
<drchaos> http://koans.heroku.com/about_nil?input[]=true&input[]=ex&input[]=&input[]=&input[]=&input[]=
<drchaos> there's my koan
<drchaos> I want to know what the first white box on a red background is supposed to be
rking has quit [Read error: Connection reset by peer]
ph^ has quit [Ping timeout: 245 seconds]
joeycar__ has joined #ruby
Tref has joined #ruby
joeycarmello has quit [Ping timeout: 246 seconds]
uris has quit [Quit: leaving]
xyzodiac has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 245 seconds]
joeycar__ has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
joeycarm_ has quit [Ping timeout: 246 seconds]
lurraca has quit [Ping timeout: 245 seconds]
peregrine81 has joined #ruby
axl_ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
joeycarm_ has joined #ruby
joeycarmello has joined #ruby
joeycarm_ has quit [Read error: Connection reset by peer]
beachandbytes has joined #ruby
lurraca has joined #ruby
Bing has joined #ruby
lggr has joined #ruby
axl_ has quit [Client Quit]
slicslak has joined #ruby
joeycarm_ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
bradhe_ has joined #ruby
joeycarm_ has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
dmiller_ has joined #ruby
qos has quit [Read error: Connection reset by peer]
sent-hil has joined #ruby
qos has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
bradhe has quit [Ping timeout: 255 seconds]
joeycarmello has joined #ruby
wargasm has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 256 seconds]
cjs226 has quit [Ping timeout: 246 seconds]
joeycarmello has quit [Read error: Connection reset by peer]
joeycarmello has joined #ruby
lggr has joined #ruby
joeycarm_ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
yakitori has quit [Ping timeout: 244 seconds]
joeycarmello has joined #ruby
ananthakumaran has joined #ruby
havenn has joined #ruby
joeycar__ has joined #ruby
joeyca___ has joined #ruby
joeycar__ has quit [Read error: Connection reset by peer]
joeycarm_ has quit [Ping timeout: 246 seconds]
joeyca___ has quit [Read error: Connection reset by peer]
joeycarmello has quit [Ping timeout: 245 seconds]
Tref has quit [Quit: Tref]
sent-hil has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 260 seconds]
Hanmac1 has quit [Quit: Leaving.]
JohnBat26 has joined #ruby
nimred_ has quit [Read error: Operation timed out]
ph^ has joined #ruby
Hanmac has joined #ruby
lggr has joined #ruby
AlbireoX has quit [Remote host closed the connection]
Bing has left #ruby [#ruby]
AlbireoX has joined #ruby
mucker has joined #ruby
AlbireoX has quit [Ping timeout: 248 seconds]
dmiller_ has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
ipoval has joined #ruby
xuser has joined #ruby
rking has joined #ruby
answer_42 has joined #ruby
bradhe_ has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 244 seconds]
Guest69952 has joined #ruby
<Guest69952> why would i be getting this error? https://gist.github.com/330aa279a651ef871ff7
<cirwim> Guest69952: you don't have the mysql libraries on your system, apt-get install libmysql-dev at a guess
<davidcelis> drchaos: did you try calling that code in a console
jasonkuhrt has joined #ruby
mohit has joined #ruby
colinbm has joined #ruby
lggr has joined #ruby
<Guest69952> ah cheers cirwin
joeycarmello has joined #ruby
jasonkuhrt has quit [Ping timeout: 245 seconds]
areil has joined #ruby
mohit has quit [Read error: Connection reset by peer]
colinbm has quit [Quit: colinbm]
lggr has quit [Ping timeout: 245 seconds]
<Guest69952> my webserver won't start in my vm :( https://gist.github.com/6fb53bb844397f9aeed2
<moshee> what's your ruby version?
<havenn> Guest69952: Looks like you're using Ruby 1.9 Hash-syntax, but running 1.8.
<moshee> the colon for hash keys is 1.9 yeah
<Guest69952> what is the command to use another version?
rvmeier has quit [Quit: Leaving]
seich has quit [Ping timeout: 264 seconds]
lggr has joined #ruby
spo12 has joined #ruby
rabidpraxis has quit [Remote host closed the connection]
<havenn> Guest69952: sudo apt-get install build-essential git-core curl; curl -L get.rvm.io | bash -s stable --ruby
ph^ has joined #ruby
<havenn> Guest69952: Or you can get an older (1.9.2) Ruby with: sudo apt-get install ruby1.9.1
yigal has quit [Read error: Operation timed out]
Takehiro has joined #ruby
seich- has joined #ruby
rking has quit [Remote host closed the connection]
yigal has joined #ruby
rking has joined #ruby
bradhe has joined #ruby
<Guest69952> ta
mucker has quit [Ping timeout: 248 seconds]
lggr has quit [Ping timeout: 246 seconds]
chendo_ has quit [Ping timeout: 255 seconds]
joofsh has joined #ruby
pygmael has quit [Read error: Connection reset by peer]
pygmael has joined #ruby
chendo__ has joined #ruby
slicslak has quit [Ping timeout: 255 seconds]
fredjean has joined #ruby
icooba has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
ph^ has quit [Ping timeout: 255 seconds]
peregrine81 has quit [Quit: Computer sleeping.]
icooba has joined #ruby
Erfankam has joined #ruby
stephenjudkins has joined #ruby
indian has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
qos has quit [Read error: Connection reset by peer]
lggr has joined #ruby
NoNMaDDeN has joined #ruby
qos has joined #ruby
adeponte has joined #ruby
stkowski has quit [Quit: stkowski]
rakl has quit [Quit: sleeping]
ryanf has joined #ruby
JC_SoCal has quit [Excess Flood]
xuser has left #ruby [#ruby]
JC_SoCal has joined #ruby
xpen has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ruby
ori-l is now known as it
xpen has quit [Remote host closed the connection]
it is now known as Guest45906
daniel_hinojosa1 has quit [Ping timeout: 246 seconds]
Guest45906 is now known as ori-l
stepnem has joined #ruby
adeponte has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
ori-l is now known as three
three is now known as atdt
atdt is now known as ori-l
ph^ has joined #ruby
beachandbytes has quit [Ping timeout: 272 seconds]
lggr has joined #ruby
rakl has joined #ruby
diegoviola has quit [Ping timeout: 246 seconds]
talsamon has joined #ruby
talsamon has left #ruby ["Verlassend"]
lggr has quit [Ping timeout: 240 seconds]
ph^ has quit [Ping timeout: 245 seconds]
mikepack has quit [Remote host closed the connection]
Erfankam has quit [Ping timeout: 245 seconds]
NoNMaDDeN has left #ruby ["Leaving..."]
lggr has joined #ruby
yoklov has quit [Quit: computer sleeping]
luckyruby has joined #ruby
icole has joined #ruby
robustus has joined #ruby
Vinz_ has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
h4mz1d has joined #ruby
margle has joined #ruby
Takehiro has quit [Remote host closed the connection]
justinmcp has joined #ruby
justinmcp has quit [Remote host closed the connection]
chimay has joined #ruby
chendo__ has quit [Changing host]
chendo__ has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
ph^ has joined #ruby
lggr has joined #ruby
nimred has joined #ruby
nimred has quit [Client Quit]
recycle has joined #ruby
und3f has joined #ruby
havenn has quit [Remote host closed the connection]
margle has quit [Quit: Computer has gone to sleep.]
neurotech has joined #ruby
rdsm has joined #ruby
hbpoison has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 255 seconds]
Takehiro has joined #ruby
lggr has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
nimred has joined #ruby
nimred has quit [Changing host]
nimred has joined #ruby
Averna has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 256 seconds]
recycle has quit [Remote host closed the connection]
_bart has joined #ruby
Rydefalk has quit [Read error: Connection reset by peer]
casheew has joined #ruby
Rydefalk_ has joined #ruby
lggr has joined #ruby
casheew has quit [Quit: leaving]
sysadm_ has joined #ruby
rdsm has quit [Ping timeout: 246 seconds]
mengu has joined #ruby
NotproN has joined #ruby
yshh_ has quit [Remote host closed the connection]
mikekelly has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 260 seconds]
jasonkuhrt has joined #ruby
yshh has joined #ruby
yshh_ has joined #ruby
yshh has quit [Read error: Connection reset by peer]
lggr has joined #ruby
williamherry has joined #ruby
jasonkuhrt has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Ping timeout: 240 seconds]
yshh_ has quit [Remote host closed the connection]
triptec has quit [Read error: Connection reset by peer]
Guest69952 has quit [Quit: Gone to sleep.]
triptec has joined #ruby
Hamed-R has joined #ruby
Jacob_ has joined #ruby
Jacob_ is now known as Guest32860
ph^ has joined #ruby
hbpoison has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<williamherry> hi, I am new to ruby and I write a little ruby script and upload it on rubygems, now I can download and install it by gem install tinyssh, it depends on net-ssh, how can i tell the depends so when i install my app, needed package can be install auto
NotproN has left #ruby ["Leaving..."]
SegFaultAX has joined #ruby
<Guest32860> williamherry: you can add it as a dependency
<Vinz_> In gemspec
seoaqua has joined #ruby
<williamherry> Guest32860: Vinz_ thanks, any examples?
<seoaqua> i found all my gems r installed into /root/.gem/ruby/1.9.1/ and when i require a gem with a non-root account , i will catch an exception that it can't require the gem file. any ideas? pls
<Guest32860> i have a video, one sec.
<williamherry> Guest32860: great, thanks
lggr has joined #ruby
<Vinz_> williamherry: Taken from Jekyll gem
<Vinz_> s.add_runtime_dependency('maruku', "~> 0.5")
<Hanmac> seoaqua i think you played with rvm ... right? this is your payback
Axsuul has quit [Remote host closed the connection]
<seoaqua> Hanmac, nope
<williamherry> thanks Guest32860 and Vinz_
<Vinz_> No prob' ;)
<Guest32860> all good
<seoaqua> Hanmac, i installed ruby with archlinux's packman and installed gems with #gem install
<Vinz_> pacman*
Hamed-R has quit [Ping timeout: 245 seconds]
<Guest32860> if you cannot view it williamherry let me know and I will upload it somewhere for you.
ph^ has quit [Ping timeout: 245 seconds]
kermes has joined #ruby
<seoaqua> Vinz_, yes thanks
<williamherry> Guest32860: it need subscription
<Hanmac> seoaqua ... it seems under archlinux you dont install gems as root ...
<Vinz_> williamherry: is your gem code available ?
<Vinz_> Whoops, found it
<williamherry> Vinz_: yes, gem install tinyssh
lggr has quit [Ping timeout: 252 seconds]
<seoaqua> Hanmac, i have 4 users in that linux. can i install the gems as common? do i have to install 4 times with 4 different accounts?
<Vinz_> Hm, http://rubygems.org/gems/net-ssh < Are you using this one ?
sysadm_ is now known as rdsm
<Hanmac> seoaqua ... i never used archlinux :(
<Vinz_> Should be the same as other distros no ?
<seoaqua> Hanmac, i think just linux would be ok :)
<williamherry> Vinz_: I think so, gem install net-ssh can work, add also, not only this one, net-scp and highline also needed
<williamherry> Vinz_: thanks so much
wedtm has joined #ruby
<Vinz_> Err, test it before saying thanks ;)
<Vinz_> Might be that, might not
lggr has joined #ruby
<wedtm> So, I know Ruby threads don't please everyone, but I can't get this simple test to work. Can someone show me the fallacy in my ways?
mikekelly has joined #ruby
<wedtm> When I watch the redis console, I see the blpop come through, and also the rpush, however @message is nil
<wedtm> Ruby 1.9.3, btw.
manizzle has quit [Ping timeout: 240 seconds]
chimay has quit [Ping timeout: 245 seconds]
<Guest32860> williamherry: check your pm
<williamherry> Guest32860: what is pm?
<lurraca> Hi, I'm trying to understand this issue.
<lurraca> URI::InvalidURIError (the scheme http does not accept registry part: www.cldf'peace-bereavement.org (or bad hostname?)):
<Vinz_> private messages
thunderstrike has joined #ruby
<Guest32860> williamherry: a private message. are you using the web client?
<wedtm> lurraca: you have an ' in there.
<Vinz_> Or afternoon, depending on context
<cirwim> lurraca: there's a ' in the hostname
<lurraca> but actually the url I'm passing is www.cldf-bereavement.co.uk
<williamherry> find it, I use weechat
<Guest32860> all good.
<Vinz_> :)
<lurraca> I don't know why its changing - for '
Hamed-R has joined #ruby
Hamed-R has quit [Changing host]
Hamed-R has joined #ruby
<wedtm> what encoding are you using, lurraca?
<Vinz_> lurraca: And it's adding peace ?
<Guest32860> anyone know when nickserv is going to be sorted?
<Vinz_> Nope
<wedtm> lurraca: It would appear you have something else at play, as it's also changing the TLD
<Vinz_> lurraca: You're coming from www.cldf-bereavement.co.uk to www.cldf'peace-bereavement.org
<lurraca> yeah
<Vinz_> There's a big problem here
<lurraca> let me check that
<Vinz_> Adding words and changing TLD
<lurraca> yeah its looks like its a domain redirect
<lurraca> i checked in the browser
<Vinz_> Hm
<Vinz_> Why the ' then ?
<lurraca> Vinz_: no idea
<williamherry> Vinz_: do I have to specify the version of depends?
joeycarmello has quit [Read error: Connection reset by peer]
<Guest32860> williamherry: it is recommended.
lggr has quit [Ping timeout: 246 seconds]
<Vinz_> williamherry: I think, but i've never used gemspec
joeycarm_ has joined #ruby
<Vinz_> But it should be better
<Guest32860> for example, if there is a feature in v1 that is handled different in v2, the gem would behave differently.
lggr has joined #ruby
<wedtm> Hey Vinz_, do you know anything about my issue? (Redis and threads)
<Vinz_> Nope sorry
<Guest32860> you can define a minimum version if i remember correctly.
<lurraca> I'm also trying directly http://cldf-peace-bereavement.org/
<wedtm> No worries, thanks though.
<lurraca> and getting the same issue
<lurraca> the scheme http does not accept registry part: www.cldf'peace-bereavement.org (or bad hostname?)
<Vinz_> lurraca: What chode are you using to open URI ?
<wedtm> lol
<wedtm> chode
<Vinz_> code* x)
<williamherry> ok, how to delete gem on rubygems, there one test gem that I don't want it be there
<Vinz_> Hey, it 10 AM !
sepp2k has joined #ruby
<wedtm> williamherry: gem uninstall <gemname>
<lurraca> Vinz_: I'm using mechanise, let me check that.
<Vinz_> wedtm: I think he want to remove a gem from rubygems.org
<wedtm> Ah, gotcha.
<Vinz_> :)
<williamherry> wedtm: I mean in rubygems.org
<Vinz_> (wedtm: BTW, what is redis ?)
<wedtm> hi performance key-value store
<seoaqua> how to set ruby gem install path? i want to install gems into /usr/lib/ruby/gems/1.9.1/
<Vinz_> Thanks :)
<wedtm> like memcached on steroids
chendo__ has quit [Ping timeout: 255 seconds]
<cirwim> sterds.io
ij has joined #ruby
margle has joined #ruby
<Vinz_> Hop ! G2G !
margle has quit [Client Quit]
lggr has quit [Ping timeout: 244 seconds]
<lurraca> Vinz_: how can I tell which code I'm using to open URI?
<thinkclay> ruby formatting: tabs or spaces and how many? (not trying to start a feud, just new to ruby)
lggr has joined #ruby
<Guest32860> thinkclay: 2, spaces
<thinkclay> Guest32860 thanks
<Hanmac> i still prefer tabs ... it makes more sense
<williamherry> Guest32860: Vinz_: depends now works, after change version use >= thanks
<cirwim> Hanmac: in theory I agree, in practice they don't actually help
manizzle has joined #ruby
ph^ has joined #ruby
<wedtm> lurraca: can you pastebin your code?
<wedtm> Or the section where it's calling open()
<lurraca> yeah
ph^ has quit [Remote host closed the connection]
ph^ has joined #ruby
Erfankam has joined #ruby
<wedtm> Do you know what's stored in your @url variable?
chendo__ has joined #ruby
Rydefalk_ has quit []
Rydefalk has joined #ruby
slainer68 has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
<lurraca> yeah
<lurraca> cldf-bereavement.co.uk
<lurraca> or
<wedtm> I'm not too familiar with Mechanize, but try putting a "puts @url" right before the method that explodes.
<wedtm> See what its' actually calling.
triptec has quit [Ping timeout: 244 seconds]
<lurraca> let me do that
Raimiss has joined #ruby
lggr has joined #ruby
joofsh has quit [Remote host closed the connection]
neurotech has quit [Remote host closed the connection]
hbpoison has quit [Ping timeout: 246 seconds]
<lurraca> I think I got it.
<lurraca> its not actually that url, its one of the links that are present in the page
<lurraca> <a id="ctl00_PageHolder_ContentHolder_Main_ctl00_ucSecondaryLeadElements_rptSecondaryLeads_ctl04_hplImgSecondaryLead" href="http://www.cldf'peace-bereavement.org/form.aspx?id=80">
<seoaqua> i've solved the install path problem by myself
<seoaqua> u need to delete the line "user_install" from /etc/gemrc
<seoaqua> then gems would not be separated into ~/.gem
<wedtm> lurraca: that looks like it!
lggr has quit [Ping timeout: 260 seconds]
<wedtm> lurraca: change your code to include unless (@url =~ URI::regexp).nil?; <YOUR CODE HERE>; end;
<wedtm> That way, it'll only process it if it's a valid URI
daniel_- has joined #ruby
DrShoggoth has quit [Quit: Leaving]
Forevernade has quit [Ping timeout: 255 seconds]
lggr has joined #ruby
Coolhand_ has quit [Ping timeout: 246 seconds]
milestone has joined #ruby
<lurraca> actually this is where the crash is happening
<lurraca> page.links.each do |link|
<lurraca> page.links.each do |link| #For every link in the page
<lurraca> @keywords.each do |keyword| #For every keyword provided
<lurraca> if regexp.match(link.uri.to_s).nil? and regexp.match(link.text).nil?
<lurraca> regexp = str.to_regexp
<lurraca> str = "/"+keyword.to_s+"/" #Turn keyword into regexp
Coolhand has joined #ruby
<A124> lurrace: For code > 4 lines use pastebin or pastie, please.
h4mz1d has quit [Ping timeout: 245 seconds]
<lurraca> A124: sorry about that
AndChat| has joined #ruby
<wedtm> lurraca: try this: http://hastebin.com/hafokiyadu.rb
lkba has quit [Ping timeout: 260 seconds]
skogis has joined #ruby
AndChat| has quit [Ping timeout: 240 seconds]
rcassidy has quit [Ping timeout: 245 seconds]
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
thomas is now known as puppy
lggr has joined #ruby
hbpoison has joined #ruby
hekin has joined #ruby
<lurraca> wedtm: "next if (link =~ URI::regexp).nil?" is not working… apparently all the links are matching URI::regexp
<wedtm> They should match, as long as they're valid.
<lurraca> wedtm, no links are matching URI::regexp
<wedtm> hrm
<wedtm> just a second
<lurraca> I'm gonna try it in irb
wallerdev has quit [Quit: wallerdev]
<wedtm> lurraca: seems to work fine here
<lurraca> 9.3-p194 :002 > ("http://www.google.com" =~ URI::regexp).nil?
<lurraca> => false
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ruby
<wedtm> That's correct.
<wedtm> You asked if it was nil, and it's telling you false, it's not nil.
<wedtm> Meaning that that URI passed.
fixl has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
<wedtm> It's a bit confusing.
<lurraca> i got it
<wedtm> you can always do !("http://www.google.com" =~ URI::regexp).nil?
<wedtm> (prepend with a !)
<lurraca> issue was that link wasn't an URI
<lurraca> i had to do link.uri.to_s
<wedtm> Great!
fantazo has quit [Remote host closed the connection]
<lurraca> hhhmm
<lurraca> i got the same error, because I'm doing link.uri.to_s and that's triggering URI::InvalidURIError
<lurraca> I'm going to inspect the URI object to see what I can do
<lurraca> wedtm: I appreciate the help
<wedtm> lurraca: I imagine you're getting that error because it's looking for a instance of URI, not a String
<wedtm> try URI.parse(link.uri.to_s)
fixl has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
pingfloyd has quit [Quit: pingfloyd]
lggr has joined #ruby
icole has quit [Remote host closed the connection]
bobbbo has joined #ruby
saschagehlich has joined #ruby
<lurraca> wedtm: the first variable is link.text and the 2nd is link.uri
<lurraca> shouldn't I just catch the exception?
<wedtm> But none of those are valid URI's
<wedtm> Are you wanting to process those types of links?
<wedtm> If not, then just skip them
daniel_- has quit [Ping timeout: 255 seconds]
<wedtm> So yes, catch the exception, and 'next' it.
Virunga has joined #ruby
Hamed-R has quit [Ping timeout: 245 seconds]
sent-hil has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
<lurraca> that did it
<thinkclay> what's the alternative to find_by_provider_and_uid when using mongoid?
hbpoison has quit [Ping timeout: 260 seconds]
<lurraca> wedtm: thanks a lot!
<wedtm> No worries!
<wedtm> thinkclay: Model.where(provider: p).and(uid: uid)
<thinkclay> wedtm: thank you!
<wedtm> Yep!
luckyruby has quit [Remote host closed the connection]
<wedtm> Also, finally figured out my other problem.
F1skr has joined #ruby
<wedtm> I need to stop switching between node and ruby so much
<wedtm> was expecting blpop to return to a callback :P
timonv has joined #ruby
Vinz_ has quit [Ping timeout: 248 seconds]
lggr has quit [Ping timeout: 255 seconds]
bradhe has quit [Remote host closed the connection]
jimeh4 has joined #ruby
lggr has joined #ruby
elico has quit [Quit: elico]
nari_ has quit [Ping timeout: 244 seconds]
<nyuszika7h> hi, how can I get an IP address of a client connecting to my TCPSocket?
<nyuszika7h> TCPserver, even
<nyuszika7h> * TCPServer
qos has quit [Quit: Linkinus - http://linkinus.com]
Guest32860 has quit [Quit: Gone to sleep.]
keyvan has joined #ruby
keyvan has quit [Changing host]
keyvan has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
<wedtm> nyuszika7h: TCPServer.addr
<nyuszika7h> thanks
<wedtm> NP
mohits has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
F1skr has quit [Ping timeout: 252 seconds]
<wedtm> ah, nyuszika7h I'm sorry
G has quit [Read error: Connection reset by peer]
<nyuszika7h> what
<wedtm> That will show you the address of the server
<nyuszika7h> oh
<wedtm> port, ip = Socket.unpack_sockaddr_in(socket.getpeername)
vlad_starkov has joined #ruby
<wedtm> Use that for the peer address
<nyuszika7h> thanks
<wedtm> That's for 1.9 btw
hekin_ has joined #ruby
jasonkuhrt has joined #ruby
ryanf has quit [Ping timeout: 260 seconds]
Erfankam has quit [Ping timeout: 252 seconds]
lggr has joined #ruby
Guest64548 has joined #ruby
<lurraca> I have a question not particular to Ruby, but when I'm crawling websites some of them takes long time to load. Any idea what might be the problem?
hekin has quit [Ping timeout: 252 seconds]
<bnagy> 'the internet' ?
<jblack> the gerbils in your dsl modem are hungry and need to be fed.
jasonkuhrt has quit [Ping timeout: 245 seconds]
<nyuszika7h> yep, I have 1.9.3-p194 :)
triptec has joined #ruby
seoaqua has quit [Ping timeout: 248 seconds]
Erfankam has joined #ruby
JarJar has joined #ruby
mohits has quit [Quit: Leaving]
maletor has quit [Quit: Computer has gone to sleep.]
Takehiro has quit [Remote host closed the connection]
tk__ has joined #ruby
<nyuszika7h> ./socket_test.rb:23:in `getpeername': Transport endpoint is not connected - getpeername(2) (Errno::ENOTCONN)
Villadelfia has joined #ruby
Raimiss has quit [K-Lined]
lggr has quit [Ping timeout: 252 seconds]
msch has joined #ruby
arietis has joined #ruby
jenrzzz has joined #ruby
<lurraca> was that for me bnagy and jblack? well I'm running my script on ec2 instace which should have pretty decent bandwidth, might be something its like some specific sites, gets stuck for like 20 secs or so
SeySayux has quit [Read error: Operation timed out]
G has joined #ruby
iCEAGE has joined #ruby
vukini has joined #ruby
Villadelfia has quit [Ping timeout: 246 seconds]
cantonic_ has joined #ruby
lggr has joined #ruby
samphippen has joined #ruby
cantonic has quit [Ping timeout: 245 seconds]
cantonic_ is now known as cantonic
<nyuszika7h> wedtm, client.peeraddr worked
<wedtm> sweet!
<wedtm> Good to know :)
<nyuszika7h> (and client = server.accept)
F1skr has joined #ruby
<wedtm> lurraca, the internet is a vast network, sometimes, websites aren't hosted on the best of hardware/internet connection
<wedtm> They may be overloaded, or have network issues.
<wedtm> It's just the way of the internet, nothing that can really be done about it.
Hamed-R has joined #ruby
Hamed-R has joined #ruby
Hamed-R has quit [Changing host]
Hamed-R has quit [Remote host closed the connection]
chrishunt has quit [Ping timeout: 244 seconds]
Hamed-R has joined #ruby
Villadelfia has joined #ruby
<lurraca> I'm thinking about using sidekiq gem
lggr has quit [Ping timeout: 255 seconds]
iCEAGE has quit [Ping timeout: 245 seconds]
pskosinski has joined #ruby
<lurraca> see if my total running time gets lower, I'm crawling like 20000 website in a single batch
lggr has joined #ruby
Axsuul has joined #ruby
slainer68 has quit [Remote host closed the connection]
Takehiro has joined #ruby
SeySayux has joined #ruby
rdsm has quit [Quit: Leaving]
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
yaroslav has joined #ruby
yshh has joined #ruby
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
vukini has quit [Ping timeout: 252 seconds]
x0F_ is now known as x0F
lggr has quit [Ping timeout: 246 seconds]
<Guest64548> can you help me? i cant install a gem in win7, it síys make is not recognized as a command
Iszak has joined #ruby
AcidWeb has joined #ruby
Guest64548 is now known as Jackneill
Jackneill has quit [Changing host]
Jackneill has joined #ruby
lkba has joined #ruby
hbpoison has joined #ruby
lggr has joined #ruby
jgrevich has quit [Quit: jgrevich]
Eplemosen has joined #ruby
saschagehlich has quit [Ping timeout: 256 seconds]
ph^ has quit [Remote host closed the connection]
hbpoison has quit [Ping timeout: 255 seconds]
saschagehlich has joined #ruby
icole has joined #ruby
adambeynon has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
wedtm is now known as wedtm|away
yshh has quit [Remote host closed the connection]
samuel02 has joined #ruby
chrxn has quit [Ping timeout: 246 seconds]
icole has quit [Ping timeout: 256 seconds]
beachandbytes has joined #ruby
PapaSierra has joined #ruby
bradhe has joined #ruby
lggr has joined #ruby
<AcidWeb> Hello. I got small problem which someone maybe can help me explain. I have rake script that use 5 threads. Entire script is a scraper and even with 5 threads execution time is over 10minutes. In most cases it run flawlessly but sometimes random thread after a random amount of time crash:" Expected X/TP/app/models/item.rb to define Item." Item is used hundreds of times during each thread execution.
<A124> Guest64548: make is compiling helper.. thus you need a Development and compiling tools
<A124> *Jackneill
A124 has quit [Quit: Leaving.]
<AcidWeb> Im using RoR third day and i dont have idea what is this type of error.
<Jackneill> A124: ok thx
A124 has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
bradhe has quit [Ping timeout: 246 seconds]
Iszak has quit [Quit: Computer has gone to sleep.]
VegetableSpoon has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
chimay has joined #ruby
lggr has joined #ruby
rabidpraxis has joined #ruby
etehtsea has joined #ruby
Forevernade has joined #ruby
jasonkuhrt has joined #ruby
AcidWeb has left #ruby [#ruby]
virtualentity has quit [Ping timeout: 248 seconds]
F1skr has quit [Ping timeout: 260 seconds]
slainer68 has joined #ruby
emmanuelux has joined #ruby
jasonkuhrt has quit [Ping timeout: 245 seconds]
hekin_ has quit [Read error: Connection reset by peer]
hekin has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
hiroyuki has quit [Remote host closed the connection]
hsbt_away is now known as hsbt
sent-hil has quit [Remote host closed the connection]
ryanf has joined #ruby
lggr has joined #ruby
yshh has joined #ruby
banseljaj is now known as imami|afk
adambeynon has quit [Quit: Computer has gone to sleep.]
hsbt has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
ryanf has quit [Ping timeout: 240 seconds]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
LouisGB has joined #ruby
F1skr has joined #ruby
hsbt_away has joined #ruby
hsbt_away is now known as hsbt
futilegames has joined #ruby
thinkclay has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ruby
Russell^^ has joined #ruby
daniel_- has joined #ruby
bobbbo has quit [Quit: bobbbo]
hsbt has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 260 seconds]
nari_ has joined #ruby
workmad3 has joined #ruby
Jork1 has joined #ruby
eldariof has joined #ruby
yshh has quit [Read error: Connection reset by peer]
hsbt has joined #ruby
etehtsea has quit [Quit: Computer has gone to sleep.]
lggr has joined #ruby
LouisGB has quit [Ping timeout: 246 seconds]
hbpoison has joined #ruby
hsbt has quit [Ping timeout: 246 seconds]
hsbt_away has joined #ruby
hsbt_away is now known as hsbt
lggr has quit [Ping timeout: 248 seconds]
Morkel has joined #ruby
hbpoison has quit [Ping timeout: 245 seconds]
Virunga has quit [Remote host closed the connection]
adambeynon has joined #ruby
jtdowney has joined #ruby
lggr has joined #ruby
hackeron has quit [Remote host closed the connection]
ltsstar has joined #ruby
quest88 has joined #ruby
daniel_- has quit [Ping timeout: 255 seconds]
<A124> AcidWeb: Did you got it working?
Eplemosen has quit [Quit: NOPE]
<A124> lurraca: What are your speeds now?
futilegames has quit [Quit: futilegames]
cnf has joined #ruby
resure has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
areil has quit [Remote host closed the connection]
lggr has joined #ruby
etehtsea has joined #ruby
JarJar has quit [Quit: Leaving]
slainer68 has quit [Remote host closed the connection]
Virunga has joined #ruby
gani has joined #ruby
axl_ has joined #ruby
resure has quit [Quit: Leaving]
Markvilla has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
workmad3 has quit [Read error: Operation timed out]
<milestone> hi all
<milestone> is this the official ruby help channel?
lggr has joined #ruby
hiroyuki has joined #ruby
Drakx has quit [Ping timeout: 260 seconds]
Jackneill has quit [Read error: Connection reset by peer]
jimeh4 has quit [Ping timeout: 245 seconds]
Jackneill has joined #ruby
<heftig> milestone: no, that'd be #ruby-lang
adambeynon has quit [Quit: Computer has gone to sleep.]
Jackneill is now known as Guest51674
<heftig> that said, this is a ruby channel as well
<milestone> heftig: thx
milestone has left #ruby [#ruby]
etehtsea has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ruby
baphled has joined #ruby
butblack has joined #ruby
Markvilla has quit [Quit: Computer has gone to sleep.]
dangerousdave has joined #ruby
hvq has joined #ruby
roadt has quit [Ping timeout: 255 seconds]
ananthakumaran has quit [Ping timeout: 255 seconds]
kjellski has joined #ruby
butblack has quit [Client Quit]
ananthakumaran has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<nyuszika7h> how can I make it so that output is temporarily blocked until pressing enter if a key is pressed while gets.chomp is running in a separate thread (to avoid blocking output),
huy has quit [Quit: huy]
ianblenke2 has joined #ruby
bradhe has joined #ruby
jtdowney has quit [Remote host closed the connection]
Morkel has quit [Quit: Morkel]
forced_request has joined #ruby
lggr has joined #ruby
Hamed-R has quit [Ping timeout: 255 seconds]
ianblenke1 has quit [Ping timeout: 255 seconds]
<A124> nyuszika7h: mutex = Mutex.new; mutex.synchronize { gets.chomp}
<nyuszika7h> thanks
<A124> nyuszika7h:: Also synchronize the block where the output is
<A124> This way one block will wait for other to finish
bradhe has quit [Ping timeout: 260 seconds]
Xeago has joined #ruby
gani has quit [Quit: leaving..]
<nyuszika7h> irc.rb:23:in `log': undefined local variable or method `mutex' for main:Object (NameError)
<nyuszika7h> from irc.rb:38:in `<main>'
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
nightfalcon has quit [Quit: leaving]
<A124> nyuszika7h: Oh. I'm sorry. require 'thread'
<nyuszika7h> I think I did?
lkba has quit [Ping timeout: 240 seconds]
<nyuszika7h> yes I did, the problem is the mutex I defined after the requires isn't found
<nyuszika7h> 20 mutex = Mutex.new
<nyuszika7h> I didn't refer to "mutex" (lowercase) in the code before that line
niklasb has joined #ruby
hbpoison has joined #ruby
<A124> the mutex has to be created in the main thread
<nyuszika7h> where?
Hamed-R has joined #ruby
Hamed-R has quit [Changing host]
Hamed-R has joined #ruby
bbttxu has joined #ruby
<A124> Anywhere. The thing is it has to be in main scope outside of the threads
<nyuszika7h> it's in the main scope...
<nyuszika7h> did you even read my code?
<A124> Oh. sorry No I did not. Let me check it.
etehtsea has joined #ruby
dpk has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
hbpoison has quit [Ping timeout: 246 seconds]
linoj has joined #ruby
lggr has joined #ruby
jimeh4 has joined #ruby
hvq has quit [Remote host closed the connection]
nari_ has quit [Ping timeout: 248 seconds]
BrianJ has quit [Quit: Computer has gone to sleep.]
cnf has left #ruby ["Linkinus - http://linkinus.com"]
gmci has joined #ruby
roadt has joined #ruby
qos has joined #ruby
Markvilla has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
br4ndon has joined #ruby
ananthakumaran has quit [Ping timeout: 260 seconds]
dmiller has joined #ruby
Erfankam has quit [Quit: Leaving.]
kirun has joined #ruby
ananthakumaran has joined #ruby
daniel_- has joined #ruby
yaroslav has quit [Quit: yaroslav]
lggr has joined #ruby
daniel_- has quit [Ping timeout: 245 seconds]
jasonkuhrt has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
TomJ has joined #ruby
TomJ has quit [Changing host]
TomJ has joined #ruby
etehtsea has quit [Quit: Computer has gone to sleep.]
jasonkuhrt has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 244 seconds]
rakl has quit [Quit: sleeping]
lggr has joined #ruby
hbpoison has joined #ruby
axl_ has quit [Quit: axl_]
xyzodiac has joined #ruby
Spooner has joined #ruby
etehtsea has joined #ruby
gry has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
Markvilla has quit [Quit: Computer has gone to sleep.]
Samanagh has quit []
joeycarmello has joined #ruby
slainer68 has joined #ruby
joeycarm_ has quit [Ping timeout: 246 seconds]
jimeh4 has quit [Ping timeout: 244 seconds]
hbpoison has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
slainer68 has quit [Ping timeout: 246 seconds]
Hamed-R has quit [Ping timeout: 245 seconds]
triptec has quit [Quit: triptec]
workmad3 has joined #ruby
bencaron has joined #ruby
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
lggr has quit [Ping timeout: 246 seconds]
Jellyg00se has quit [Ping timeout: 260 seconds]
virtualentity has joined #ruby
<shevy> hehe
jasonkuhrt has joined #ruby
<A124> nyuszika7h: Sorry I could not attend to it. Do you managed to get it working or you still need a hand?
<A124> nyuszika7h: Seems like you have it right. It should work. Maybe a $ or @ is needed
manizzle has quit [Ping timeout: 240 seconds]
lggr has joined #ruby
bencaron has quit [Quit: bencaron]
linoj has quit [Quit: linoj]
Hamed-R has joined #ruby
Hamed-R has quit [Changing host]
Hamed-R has joined #ruby
<A124> Is it a bug or noone said anything in the past half hour?
Jork1 has quit [Quit: Jork1]
<shevy> THE WORLD IS A BIG PLACE WITH BUGS
<shevy> AND BOOBS BUT MOSTLY BUGS
<A124> Heh.
duracrisis_ has joined #ruby
duracrisis has quit [Ping timeout: 246 seconds]
dmiller has quit [Ping timeout: 260 seconds]
PapaSierra has left #ruby [#ruby]
Hamed-R has quit [Quit: Leaving]
lggr has quit [Ping timeout: 260 seconds]
dmiller has joined #ruby
lggr has joined #ruby
rabidpraxis has quit [Remote host closed the connection]
yshh has joined #ruby
fyolnish has joined #ruby
jasonkuhrt has quit [Quit: Leaving...]
dmiller has quit [Remote host closed the connection]
soulcake has quit [Quit: ZNC - http://znc.in]
lggr has quit [Ping timeout: 246 seconds]
Jellyg00se has joined #ruby
soulcake has joined #ruby
fixl has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
<nyuszika7h> A124, I didn't get it working yet. I'll try $/@
neurotech has joined #ruby
bbttxu has quit [Quit: bbttxu]
waxjar has joined #ruby
lggr has joined #ruby
<nyuszika7h> seems I need to wrap the mutex.synchronize around Thread.new
<nyuszika7h> now it's broken in some other way :/
cyberchibcha has joined #ruby
bencaron has joined #ruby
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
uris has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
F1skr has quit [Ping timeout: 260 seconds]
slainer68 has joined #ruby
freeayu has quit [Remote host closed the connection]
lggr has joined #ruby
hekin has quit [Quit: hekin]
qos has quit [Quit: Linkinus - http://linkinus.com]
Markvilla has joined #ruby
catphish has joined #ruby
yshh has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
kjellski has quit [Quit: This computer has gone to sleep]
keyvan has quit [Remote host closed the connection]
<A124> nyuszika7h: You are missing HOST = config['connect']['host'] PORT = config['connect']['port'] in the code.
fir_ed has joined #ruby
Cache_Money has quit [Read error: Connection reset by peer]
Cache_Money has joined #ruby
Jork1 has joined #ruby
yshh has joined #ruby
_bart has quit [Quit: _bart]
<catphish> bit-struct is cool!
lurraca has quit [Quit: This computer has gone to sleep]
vlad_starkov has joined #ruby
lggr has joined #ruby
Morkel has joined #ruby
hbpoison has joined #ruby
chimay has quit [Ping timeout: 245 seconds]
<A124> nyuszika7h: Can you provide your config.yml ?
<nyuszika7h> sec
<nyuszika7h> connect:
<nyuszika7h> host: irc.freenode.net
<nyuszika7h> port: 6667
vlad_starkov has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby
hbpoison has quit [Ping timeout: 245 seconds]
<nyuszika7h> with http://paste.debian.net/194292/ it just seems to hang
lggr has quit [Ping timeout: 246 seconds]
berkes has joined #ruby
<A124> nyuszika7h: use $mutex intead as a global variable
<A124> But you must Confirm by Enter every line
<nyuszika7h> hmm, maybe I was unclear
Markvilla has quit [Quit: Computer has gone to sleep.]
<nyuszika7h> what I want is, when I start inputting text (a single character), delay the logging until I press Enter
<nyuszika7h> but I don't want to have to press Enter to get new messages every time when I haven't inputted anything
lggr has joined #ruby
<A124> nyuszika7h: Yes, I got that idea a min ago, but I'm not sure if it's possible with gets directly.
<nyuszika7h> anything else that reads from stdin could work for me
<nyuszika7h> I was thinking of readline, as socat uses that for blocking
Jork1 has quit [Quit: Jork1]
<workmad3> nyuszika7h: you need to poll with non-blocking checks for new input and do a busy wait loop
Jork1 has joined #ruby
huy has joined #ruby
<workmad3> nyuszika7h: which means not using gets (which is a blocking check for input)
saschagehlich_ has joined #ruby
williamherry has quit [Quit: WeeChat 0.3.7]
<workmad3> nyuszika7h: you might actually find some use out of the input libraries used for games :)
<nyuszika7h> ok :)
<A124> nyuszika7h: What comes to my mind is a stupid but simple thing with gets.
saschagehlich has quit [Ping timeout: 240 seconds]
saschagehlich_ is now known as saschagehlich
<A124> nyuszika7h: http://pastie.org/4860666
<A124> If you want first to focus on the client and then on the input this will do the job momentarily
<nyuszika7h> I'll try
<A124> It will not block until you press Enter
bencaron has quit [Quit: bencaron]
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
slainer68 has quit [Remote host closed the connection]
JohnBat26 has quit [Ping timeout: 248 seconds]
Markvilla has joined #ruby
lkba has joined #ruby
williamherry has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
thehodge has joined #ruby
nari_ has joined #ruby
average_drifter has quit [Ping timeout: 244 seconds]
lggr has joined #ruby
jeffreybaird has joined #ruby
<thehodge> quick question, if I have a remote CSV file thats 1m+ lines is there an easy of of reading it remotely line by line rather than having to download the whole thing then process it
tgraham has joined #ruby
deryl has quit [Quit: Leaving.]
TomJ has quit [Quit: TomJ]
jgwong has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
jeffreybaird has quit [Quit: jeffreybaird]
awestroke has joined #ruby
deadghost has quit [Ping timeout: 256 seconds]
BMF has joined #ruby
lggr has joined #ruby
indian has quit [Ping timeout: 246 seconds]
br4ndon has joined #ruby
F1skr has joined #ruby
swarley has joined #ruby
thinkclay has joined #ruby
ZubKonst_ has joined #ruby
<workmad3> thehodge: you could wrap a simple service around the CSV file that allows you to specify line-ranges
<thehodge> workmad3: I don't have control of the csv its an external service
frogstarr78 has quit [Remote host closed the connection]
dopamean has joined #ruby
<workmad3> any idea whether the service exposing it supports some form of chunking?
<dopamean> hey ive got a question about qt
<thehodge> workmad3: they do not
VegetableSpoon has quit [Ping timeout: 246 seconds]
<dopamean> i get a no such file to load error on the line "require 'Qt4'"
<workmad3> thehodge: I'm not sure there's an easy way to do what you want then :(
<thehodge> dammit
lggr has quit [Ping timeout: 246 seconds]
samuel02 has quit [Ping timeout: 260 seconds]
ZubKonst has quit [Ping timeout: 252 seconds]
tgraham has quit [Quit: Leaving...]
<workmad3> thehodge: without some form of chunking at the service or http level, you'd need to drop down into getting your hands on the network packets to control the flow of information, afaik
<thehodge> thats a shame.. looks like I'll just have to download it it
<workmad3> thehodge: otherwise the server will be just sending data to you in a stream
qos has joined #ruby
andy has joined #ruby
<workmad3> maybe you can get your hands on something a bit more fine-grained to stream a http response as it comes in, purely client side
<workmad3> but it's how much control you get then
<workmad3> and whether it's good enough :)
qos has quit [Client Quit]
lggr has joined #ruby
andy is now known as rowsdower
cyberchibcha has quit [Quit: Ex-Chat]
awestroke has quit [Remote host closed the connection]
swarley has quit [Ping timeout: 245 seconds]
<rowsdower> I'm writing an engine and would like the user to be able to choose settings before using the engine.
awestroke has joined #ruby
phantasm66 has quit [Quit: *sleeeeep*]
<rowsdower> Right now I'm using a module full of constants, but when the user changes a setting I get a warning (because it's a constant).
<rowsdower> What's the popular way to allow settings? They must be set before the engine starts.
saschagehlich has quit [Quit: saschagehlich]
frogstarr78 has joined #ruby
<workmad3> rowsdower: context? what do you mean by 'engine' here?
saschagehlich has joined #ruby
<rowsdower> A game logic library that other programs use.
<rowsdower> So it's separate from the actual game.
lggr has quit [Ping timeout: 245 seconds]
hbpoison has joined #ruby
VegetableSpoon has joined #ruby
arturaz has joined #ruby
jamjam has joined #ruby
Morkel has quit [Quit: Morkel]
lggr has joined #ruby
phantasm66 has joined #ruby
hbpoison has quit [Ping timeout: 248 seconds]
busybox42 has quit [Ping timeout: 244 seconds]
hakunin has quit [Remote host closed the connection]
<workmad3> rowsdower: ok, so is this an engine you've written or just one you're using?
hakunin has joined #ruby
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
dakine has joined #ruby
phantasm66 has quit [Client Quit]
<rowsdower> One I'm just starting. The only settings so far are speed and screen size. I'm just wondering how to best make these alterable by a user.
dakine has quit [Client Quit]
<workmad3> if you're just starting it, I'd suggest you just pass in the settings when you create the engine
<rowsdower> You mean like "my_engine_settings_init(:fps => 60, :screen_size => 800, 480)" ?
<workmad3> and then you can either have a simple ruby file that a user can edit, or you can load data from a config file of some form (yaml, ini file, xml)
neurotech has quit [Remote host closed the connection]
<workmad3> something like that, but syntactically valid
<workmad3> ;)
hakunin has quit [Ping timeout: 246 seconds]
<rowsdower> Or I could have it automatically search for my_engine_config.rb
<workmad3> probably not worth it yet tbh
lggr has quit [Ping timeout: 252 seconds]
<workmad3> you're at the point where you basically know the least about what your engine is going to look like and how it will work
kiyoura has joined #ruby
jtdowney has joined #ruby
<workmad3> you don't know what config data it needs, what sort of structures it will come in, or how it's actually going to need to change
dakine has joined #ruby
<workmad3> so you want to keep your config flexible and easy to change, and the easiest code to change is simple code
raul782 has joined #ruby
dpk has quit [Quit: Asleep at the keyboard.]
<workmad3> so right now, keep things simple and obvious is my advice
<workmad3> don't try and add magic and automatic searching until you know you need it ;)
`brendan has joined #ruby
<rowsdower> Should something that can be optionally set to something different not be a constant?
<workmad3> probably not
lggr has joined #ruby
<rowsdower> Ex. SCREEN_SIZE is a constant as long as the game is playing, but can be set arbitrarily
<rowsdower> I could just change it to a module-level variable MyEngine::Settings.screen_size
dakine has quit [Remote host closed the connection]
tommyvyo has joined #ruby
drchaos has quit [Quit: WeeChat 0.3.7]
v0n has joined #ruby
jtdowney has quit [Ping timeout: 245 seconds]
<chiel> anyone know if there's a way to compile less files in ruby?
<chiel> or a string of less styles, rather.
seanlee has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
saschagehlich has quit [Quit: saschagehlich]
headius has quit [Quit: headius]
stopbit has joined #ruby
lggr has joined #ruby
und3f has quit [Quit: Leaving.]
williamherry has quit [Quit: WeeChat 0.3.7]
linoj has joined #ruby
dopamean has quit []
VegetableSpoon has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 260 seconds]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
emmanuelux has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
headius has joined #ruby
cjs226 has joined #ruby
workmad3 has quit [Ping timeout: 255 seconds]
thinkclay has quit [Quit: Leaving.]
sebastorama has joined #ruby
recycle has joined #ruby
waxjar has quit [Ping timeout: 245 seconds]
recycle has quit [Remote host closed the connection]
fteem has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
sepp2k has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby
jtdowney has joined #ruby
lggr has joined #ruby
<shevy> wait what
newbism has joined #ruby
<shevy> compile less files? compile how and where
<chiel> shevy: on the fly
<chiel> shevy: i want to add preprocessor support to tinker.io
<shevy> I do not understand at all sorry
<shevy> hmmmm
<chiel> basically they put in "less" code (lesscss.org)
jtdowney has quit [Read error: Connection reset by peer]
tk__ has quit [Quit: ばいばい]
<A124> shevy: less is css style in essence
<shevy> aaaah
<shevy> I thought it is an english word
<chiel> i'm trying to figure out the best way to compile it from ruby
<chiel> hah :)
<chiel> sorry
<chiel> i should've been clearer perhaps
<shevy> or they should have picked another name hehe
<chiel> yeah :p
yakitori has joined #ruby
mengu has quit [Read error: Operation timed out]
<A124> gem install less ?
headius has quit [Quit: headius]
<chiel> hmm
<chiel> still depends on the js bits though :(
<chiel> i was hoping there was some kind of port of it
berkes has quit [Quit: Ex-Chat]
<chiel> otherwise i may as well just execute a command line command
linoj has quit [Quit: linoj]
lggr has quit [Ping timeout: 240 seconds]
Goles has joined #ruby
Z0idberg has quit [Ping timeout: 245 seconds]
Goles has quit [Client Quit]
thehodge has quit [Read error: Connection reset by peer]
seanlee has quit [Remote host closed the connection]
lggr has joined #ruby
kermes has quit [Remote host closed the connection]
ltsstar has quit [Quit: ltsstar]
hbpoison has joined #ruby
t0rc has joined #ruby
rowsdower has left #ruby ["Konversation terminated!"]
BMF has left #ruby [#ruby]
<A124> nyuszika7h: How's it going?
Vinz_ has joined #ruby
<shevy> hey does one of you know
<shevy> if I do something like
lggr has quit [Ping timeout: 252 seconds]
<shevy> pp array
<shevy> is there a way to specify default padding to the left side?
Goles has joined #ruby
<A124> overload pp
<shevy> hmm
awarner has joined #ruby
<A124> pp_old = pp; def pp ...
<A124> But.. I don't see a clear and nice way to do it.
hackeron has joined #ruby
<shevy> :(
Jellyg00se has quit [Ping timeout: 245 seconds]
<Mon_Ouie> Instanciate PP yourself and set the indentation to something else before printing the object
<Mon_Ouie> (The core formatting methods come from the PrettyPrint class)
<A124> Or. That.
<A124> shevy: Look for pp.rb
awarner has quit [Remote host closed the connection]
<shevy> ok wait
<Mon_Ouie> Or just click on the parent class on the page you linked
<Mon_Ouie> Oh, doesn't work; you have to select the prettyprint library before that
<chiel> if you execute a shell command using system() does the program halt while it's being executed, or does it execute asynchronously in the background?
<Mon_Ouie> Or you could use ri
raul782 has quit [Remote host closed the connection]
lggr has joined #ruby
ipoval has quit [Quit: ipoval]
<nyuszika7h> A124, haven't messed with it too much, I'll try later
Z0idberg has joined #ruby
<heftig> chiel: it waits
<A124> nyuszika7h: I have a working client already. Could you let me know when you do? I'm interested in that one.
<nyuszika7h> sure
<chiel> heftig: ah k, cool
<A124> Thanks :)
<chiel> too bad it doesn't seem to be working. :(
raul782 has joined #ruby
sailias has joined #ruby
Alt-255 has joined #ruby
thinkclay has joined #ruby
tommyvyo has quit [Quit: Computer has gone to sleep.]
minver has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
recycle has joined #ruby
lggr has joined #ruby
<chiel> hmm this is really weird.. I am creating a new Tempfile instance, writing some data to it, and then running it through the `cat` tool on the cli to another file
chimay has joined #ruby
<chiel> when I then read from the destination file, it's empty
waxjar has joined #ruby
<chiel> however, if I .read the tempfile before `cat`ing, it works fine..
<chiel> i don't understand... :s
<canton7> flushing issue?
duper has joined #ruby
<canton7> (well, lack of flushing)
<chiel> how do you mean?
<chiel> hmm
<chiel> no idea
<chiel> how would I ensure it?
<chiel> I create two files
<canton7> how do you write data to it? do you close the file after doing so?
<chiel> write some stuff to the source file, cat to the destination file
Vinz_ has quit []
<chiel> destination file is empty
<chiel> ah, no i don't
<chiel> lemme try that.
<canton7> does the source file contain the data before you cat it to the dest file?
<chiel> not unless i do source.read on it first, but source.close seems to fix the problem
<chiel> so i guess it doesn't actually execute the write until some other operation is done on it, or so
<canton7> the data gets written to a buffer, then flushed to file every now and then
lggr has quit [Ping timeout: 244 seconds]
<canton7> so call file.flush, or close the file, or perform some other operation on the file to actually flush the buffer to file
Vinz_ has joined #ruby
<chiel> i see
<chiel> i didn't know that, explains a lot! :)
<chiel> thanks mate
lggr has joined #ruby
<canton7> search for 'flush' and 'buffer' in http://www.ruby-doc.org/core-1.9.3/IO.html -- goes into more depth
<canton7> also 'sync'
<chiel> ah k, thanks :)
BMF has joined #ruby
whowantstolive4 has joined #ruby
<chiel> now that i know it uses buffer, it's all clear. :)
macmartine has joined #ruby
saschagehlich has joined #ruby
sailias has quit [Quit: Leaving.]
wz has joined #ruby
raul782 has quit [Remote host closed the connection]
chimay has quit [Remote host closed the connection]
whowantstolivefo has quit [Disconnected by services]
chimay has joined #ruby
whowantstolive4 has quit [Client Quit]
whowantstolivefo has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
butblack has joined #ruby
lggr has joined #ruby
hbpoison has quit [Ping timeout: 244 seconds]
Guest51674 is now known as Jackneill
Jackneill has quit [Changing host]
Jackneill has joined #ruby
headius has joined #ruby
arubin has joined #ruby
<Jackneill> can you help me? i cant install the json gem because i got that error: make is not recognized as a command
butblack has quit [Quit: butblack]
<Jackneill> and i tried to reinstall the devkit
<cjs226> Can someone help me with https://gist.github.com/3804539?
<Jackneill> thats what i got:
<Jackneill> [INFO] Skipping existing gem override for 'C:/Ruby193'
<Jackneill> [WARN] Skipping existing DevKit helper library for 'C:/Ruby193'
<Jackneill> its win7
<cjs226> How can I retrieve and/or parse out just the actual "result" such as "21.5002941176471"?
<shevy> parse to what
<shevy> also do pp response
<shevy> looks as if you have an array
<shevy> which would then probably be response[1]
<minver> How can I make my method return a more informative message to the user? http://pastie.org/private/qtu1iqsoocvh4vlcalugg
<A124> cjs226: Give me a sec.
roadt has quit [Ping timeout: 245 seconds]
<arturaz> Jackneill, please gist everything that happens from gem install to the error
<Jackneill> arturaz ok sec
lggr has quit [Ping timeout: 255 seconds]
StartFr has joined #ruby
<shevy> minver you must decide first what you want to return
<shevy> pick any way
<shevy> either return error. or output information to the user
<cjs226> shevy: sorry, I'm new. response[1] returns nil
<shevy> cjs226 read all what I wrote. do pp response, this is what I wrote first. you have to do require 'pp' first
<shevy> then look at what response actually contains via pp
<A124> cjs226: Yes. It's array my bad. No need to do it other way, sorry.
<shevy> pp will pretty print the data structure in a readable way for your eyes
<arturaz> minver, in a functional world you would return either a valid voucher or a list of errors. Here just combine errors and raise the exception if voucher cannot be generated
<arturaz> if that's an error
<shevy> voucher sounds kinda french :)
<Virunga> cjs226: sorry, i was searching online a definition of the fog gem, but even on the fog web site, i couldn't find a satisfying one. Could you help me? :)
wallerdev has joined #ruby
<arturaz> or check out ActiveModel::Validation
sterNiX has joined #ruby
lggr has joined #ruby
Xeago has quit [Remote host closed the connection]
<StartFr> hi has anyone used cucumber + mongoid before ? in a not rail project ?
<arturaz> Jackneill, close your terminal and open it again
Goles has quit [Quit: Computer has gone to sleep.]
<Jackneill> it's win7, but ok
<arturaz> although i forgot how devkit actually works
<Jackneill> "start command prompt win ruby" its name
<cjs226> shevy: thx!
<Jackneill> :)
<cjs226> virunga, thx shevy helped me out
busybox42 has joined #ruby
<Virunga> Because i have to make a proposal to my boss, and i can't say to him fog is an interface for the cloud.
<pskosinski> In PHP I can do <?php ?><div>blah blah</div><?php code; Can I do something like this in Ruby? ^^
<Virunga> That's poor informtion. The fact is that i never use it.
<pskosinski> Or maybe I'm asking wrong question...
<Spaceghostc2c> pskosinski: Why would you? The problem is that you don't use anything php-ish in that line.
<Spaceghostc2c> pskosinski: Also, erb.
<Jackneill> pskosinski, you can do <% ... %>html code <% ... %> in rails
chrishunt has joined #ruby
<arturaz> or erb more specifically
<Spaceghostc2c> lahwran: And anywhere else that includes an erby gem.
<Spaceghostc2c> erubis is the win on that front.
vaclavt has joined #ruby
CaptainJet has joined #ruby
<Jackneill> arturaz: should a paste the gem_make.out?
<lahwran> Spaceghostc2c: hi
lggr has quit [Ping timeout: 256 seconds]
<arturaz> Jackneill, is there a make in your path?
<Jackneill> im in c:/users/Jackneill/desktop and i think it's not
<Spaceghostc2c> lahwran: Um, hi?
yekta has joined #ruby
<lahwran> Spaceghostc2c: hi
lggr has joined #ruby
<Spaceghostc2c> lahwran: What's happening, cap'n?
<lahwran> you pinged me
<lahwran> I'm saying hi
<arturaz> Jackneill, echo %PATH%
<arturaz> paste here
<cjs226> sorry, pp did make the output pretty but (sorry I'm new), i still don't know how to retrieve the amount for Average. https://gist.github.com/3804539
<arturaz> Jackneill, if you type make into console, do you get anything?
<Spaceghostc2c> lahwran: Oh. Hm.
<Virunga> cjs226: why do you use fog?
BMF has left #ruby [#ruby]
<Spaceghostc2c> Virunga: Because fog is fucking awesome.
<Jackneill> make is not recognized as a command, program or batch file
<Virunga> cjs226: i mean, what do you use it fot?
<Virunga> for
<Spaceghostc2c> Jackneill: Windows. :(
<Jackneill> thats what i've got
<Jackneill> Spaceghostc2c, yeah:D
<Jackneill> linux rulz..
<Jackneill> gentoo \o/
<Virunga> Spaceghostc2c: i know, i want to know for what he's using it.
<Spaceghostc2c> Jackneill: Use a virtual machine maybe?
<cjs226> I'm using it as while we're currently on AWS, fog allows me to use other providers in the future with less headache
<Spaceghostc2c> Virunga: Cloud services, probably.
<Jackneill> Spaceghostc2c, i dont want to, its too much memory consuption
<Virunga> Spaceghostc2c: really?
<cjs226> virunga, yes, currently using it to interace with AWS
<Spaceghostc2c> Jackneill: You're constrained on memory? Can't use 2gigs for development or whatever?
<Spaceghostc2c> Virunga: Probably, yeah.
<Jackneill> i have 2 GB
<Jackneill> only
<Jackneill> :D
<Virunga> You tell me.
<Spaceghostc2c> Oh.
<arturaz> Jackneill, well, you could get cygwin make
<Spaceghostc2c> Virunga: I am.
<Jackneill> and win with a browser takes about 1,64 of it
<Virunga> You're really smart.
<Jackneill> :D
<arturaz> I remember there was easier way, but we've switched to jruby 2 years ago
<Spaceghostc2c> Virunga: Not really!
<Virunga> No, you are.
<Jackneill> :(
<Spaceghostc2c> Virunga: Stop trying to get into my pants. :(
<Spaceghostc2c> arturaz: I fucking love jruby. 3
<Spaceghostc2c> <3
<Virunga> Just because you asked.
lggr has quit [Ping timeout: 240 seconds]
<arturaz> Spaceghostc2c, it has its own share of bugs...
<arturaz> especially if you use jruby/scala project :)
<arturaz> jruby magic doesn't mix with scala magic nice
<Spaceghostc2c> arturaz: Well, yeah.
<Spaceghostc2c> But all the JVM magic. :(
<headius> too many magics!
<arturaz> magic magic magic
<arturaz> headius, i see 1.7 is running along
<arturaz> perhaps its time to run our tests on it
<headius> indeed!
<arturaz> and break all your assumptions that ir runs correctly
<arturaz> :D
<arturaz> it*
<Spaceghostc2c> headius: Mister sir.
mfridh has quit [Ping timeout: 240 seconds]
<headius> hello there!
<arturaz> although I don't even have the time to move away from some build of 1.6-head to 1.6.8...
<Spaceghostc2c> headius: I got to meet the #torquebox guys!
<Spaceghostc2c> Well, the majority of them.
wz has quit [Quit: Ухожу я от вас]
<shevy> off-topic anyone knows if .jpg files can contain meta information like when the picture was taken? i.e. year 1992? ideally I'd like to query this information then from via a ruby script
BMF has joined #ruby
lggr has joined #ruby
<Spaceghostc2c> shevy: They do. But I don't know how. :(
shevy2 has joined #ruby
<pskosinski> Hm... how can I in easy way insert into a variable
<pskosinski> / blah blah
<pskosinski> /blah blag
<pskosinski> eh, two slashes
<pskosinski> I have a big long text and don' want to escape everything ^^
Nisstyre-laptop has quit [Quit: Leaving]
hbpoison has joined #ruby
vaclavt has quit [Quit: vaclavt]
<pskosinski> I was trying var = <<-blah my text\nblah; puts blah
<pskosinski> puts var
shevy has quit [Ping timeout: 244 seconds]
yshh has quit [Remote host closed the connection]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<Virunga> pskosinski: a multiline string is what you want ?
lggr has quit [Ping timeout: 260 seconds]
<pskosinski> Yes
<pskosinski> Which can contain \t // and it's not interpreted
lggr has joined #ruby
<arturaz> %q{foo\t//bar}
duper has quit [Quit: Lost terminal]
<pskosinski> Ah, it works, ty. :)
nari_ has quit [Ping timeout: 252 seconds]
rabidpraxis has joined #ruby
elico has joined #ruby
brianpWins has joined #ruby
RegEchse has joined #ruby
BMF has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 252 seconds]
d-best has quit [Quit: Reconnecting]
d-snp has joined #ruby
lggr has joined #ruby
jgrevich has joined #ruby
headius has quit [Quit: headius]
jsmonkey has joined #ruby
niklasb has quit [Ping timeout: 245 seconds]
<jsmonkey> Hi, was sometimes I did something other then normally rest routing and such for web apps in ruby. can oneone tell me a good lib or practive etc for writing a an array with json to an json file?
lggr has quit [Ping timeout: 256 seconds]
jsmonkey has quit [Client Quit]
hbpoison has quit [Ping timeout: 255 seconds]
butblack has joined #ruby
A124 has quit [Quit: Leaving.]
_7894 has quit [Quit: Odcházím]
lggr has joined #ruby
Alt-255 has quit [Ping timeout: 246 seconds]
aces1up has quit [Remote host closed the connection]
JonnieCache has quit [Read error: Connection reset by peer]
aces1up has joined #ruby
CaptainJet has quit []
tgraham has joined #ruby
aces1up has quit [Remote host closed the connection]
aces1up has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 246 seconds]
philcrissman has joined #ruby
jblack has quit [Ping timeout: 248 seconds]
lggr has joined #ruby
samphippen has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
fkumro has joined #ruby
v1n3 has joined #ruby
StartFr has quit [Quit: StartFr]
rabidpraxis has quit [Remote host closed the connection]
yekta has quit [Quit: yekta]
workmad3 has joined #ruby
<v1n3> How does an experience rubyist track down a no method error in someone else code? I don't know how to instrument my sinatra+puma app to pin point this error. https://gist.github.com/6e86fb54db828872827a
lggr has quit [Ping timeout: 246 seconds]
<newbism> im trying to gem install gecode but get this:
<newbism> gecode.hh:8:28: fatal error: gecode/kernel.hh: No such file or directory
<newbism> wth?
daniel_hinojosa1 has joined #ruby
samphippen has joined #ruby
wedtm|away is now known as wedtm
samphippen has quit [Client Quit]
niklasb has joined #ruby
<v1n3> newbism: do you have gecode installed?
arietis has joined #ruby
<newbism> v1n3: isnt that what the gem install does?
arturaz has quit [Read error: Connection reset by peer]
<v1n3> I missed that it was included, sorry.
<catphish> does anyone know how to determine a block device size in ruby?
bsilwal1 has joined #ruby
t0rc has quit [Quit: WeeChat 0.3.8]
<bsilwal1> Linked List and Hash are there any difference between these two?
arturaz has joined #ruby
<shevy2> bsilwal1 what is a linked list
lggr has joined #ruby
<shevy2> Hash in ruby is of class Hash
<bsilwal1> oops thinking about it, in linked list every node knows the next node.
<shevy2> hash = {}; hash['cat'] = 'Tom'
<shevy2> hash['cat'] # => "Tom"
<shevy2> aha
jtdowney has joined #ruby
diegoviola has joined #ruby
<bsilwal1> is it ok to term data inside hash as elements?
<shevy2> then a ruby Hash by default does not qualify for a linked list
<bsilwal1> okay
<bsilwal1> because they dont know what comes next.
<arturaz> bsilwal1, there are no linked lists in ruby stdlib
<shevy2> dunno. I suppose so. for arrays I call the elements usually members
samphippen has joined #ruby
<arturaz> there is some library somewhere
<shevy2> or entries
carlyle has joined #ruby
<arturaz> and if you use jruby you can always just java.util.LinkedList.new
<bsilwal1> so I can try creating my own class structure to support the theory behind linked list.
<shevy2> I suppose you can rebuild the hash constantly
<v1n3> catphish: when in doubt `cat /proc/partitions`
<shevy2> when an element is added or removed, you rebuild it
<shevy2> so that it points to the proper entry again
<shevy2> it sounds a bit more like an array though
<shevy2> [1,2,4]
<heftig> IIRC ruby hashes are linked lists combined with a hashmap for lookup
<shevy2> [1] -> [2], [2] -> [4]
Jork1 has quit [Quit: Jork1]
<bsilwal1> but its not possible to define order of hash keys is there?
<catphish> v1n3: seemed like cheating :)
shevy2 is now known as shevy
<heftig> bsilwal1: hashes are ordered by insertion
<shevy> isn't that what linux is all about... cheating your way through life :D
<bsilwal1> ok fine, I think there is no relation between them.
<v1n3> catphish: i've been cheating for years then
<bsilwal1> in linked list nodes are actually objects.
<shevy> in ruby (almost) everything is an object
<shevy> :D
<heftig> only in OOP
<bsilwal1> hash elements are also objects, but probably doesnt have a property to define order.
<heftig> linked lists exist outside of OOP
<v1n3> catphish: then again, I'm struggling to track down a no method error so take my suggestion with a grain of salt
<newbism> I have an array of hashes and im trying to get a difference of hashes selected vs what is left I tried array_hashes.delete_if {|h| array_hashes.include? h[:name]} but all i get is the full array of hashes. I think I messed up and should have just one large hash with keys to the sub hashes?
Bart-_ has joined #ruby
<bsilwal1> ok i am done time to dig!
bsilwal1 has quit [Quit: Leaving.]
<Spooner> newbism : Not sure I get you. Can you paste up an example?
<catphish> v1n3: there's probably no method on the class ;)
frogprince_mac has quit [Ping timeout: 245 seconds]
<v1n3> catphish: speaking of cheating
<catphish> v1n3: i'm trying to programatically determine the size of a file i have open, unfortunately File#size returns 0 if it's a block device
<v1n3> catphish: it is getting thrown in puma of all things, but I'm not sure how to quickly find what is triggering it, as not all calls throw this
<newbism> Spooner: sorry if its really crufty atm :-/
<catphish> and BLKSIZE returns garbage if it's a file
<Spooner> shevy : In Ruby everything acts like an Object (even if it is implemented not quite in that way).
lggr has quit [Ping timeout: 252 seconds]
Jork1 has joined #ruby
<shevy> well there are some evil cheaters... TypeError: cant define singleton method "hi" for Float
<catphish> bah, my mouse just stopped working
<shevy> Float is an evil poser object!
<newbism> Spooner: around lines 92 - 97 is when I load students into the pod but Id like to continue recursion of the reamining students into another pod
<Spooner> newbism : So what are you trying to do with them (in respect to your code).
<catphish> v1n3: just remembered how i solved this last time! seek :)
<newbism> Spooner: knapsack students into pods based on course weight to total weight of pod (knapsack)
LouisGB has joined #ruby
<newbism> cant really find a good scalable ruby example that I eventually want to build a rails app and having trouble understanding the algorithm plus best practices
<Spooner> newbism : Don't use += for arrays used this way (since it is "create a new array from the concatenation of the old and new array). Should use << (append)
philcrissman has quit [Remote host closed the connection]
<v1n3> catphish: would you know how to get more detail than this? https://gist.github.com/6e86fb54db828872827a
peregrine81 has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<v1n3> any tips would be appreciated
peregrine81 has quit [Client Quit]
<catphish> is puma a web server?
<v1n3> yes
<catphish> well i'd read /var/lib/gems/1.9.1/gems/puma-1.6.3/lib/puma/server.rb:492
<Spooner> And a cat and a helicopter.
lggr has joined #ruby
<catphish> and a sports brand
ananthakumaran has quit [Quit: Leaving.]
v0n has quit [Read error: Connection reset by peer]
<catphish> and a future Apple OS?
<v1n3> puma was 10.1
<catphish> ah no, an old one!
<v1n3> lickable acqua buttons
<newbism> Spooner: changing it to << kills the prog.. in [] can't convert Symbol into Integer.. at that point it is a new, empty array
<catphish> oo ugly
<Spooner> newbism : What line?
lazyPower has joined #ruby
macmartine has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<newbism> Spooner: oh 110 .. the final puts
<catphish> v1n3: you'll have to read that line to see what split was being called on
pskosinski has quit [Remote host closed the connection]
<lazyPower> When using ActiveRecord based models, is there a good design pattern to handle extra attributes from a form, for example the acceptance of ToS checkboxes? It creates an extra property during submit and throws the mass assignment error. How could i ignore these extra fields?
<catphish> it may throw some light on what part of the http request is missing
<Spooner> newbism : YEah, you << differently. a += [b] should be a << b
ryanf has joined #ruby
<v1n3> catphish: ya, it is in the header parsing.. turns out I was passing it a non-string
<workmad3> lazyPower: you don't ignore them
<Spooner> newbism : It is complaining that you are trying to reference an array with a symbol, rather than an integer.
<v1n3> catphish: is there a programattic way to retrieve more of the stack trace?
<workmad3> lazyPower: you add them as virtual attributes and make them accessible with attr_accessible
pskosinski has joined #ruby
<workmad3> lazyPower: incidentally, it can be a good idea to explicitly store that someone clicked that checkbox ;)
<lazyPower> so, adding it as attr_accessible would not map it back to the database? I was under the impression that every property added to a rails model would attempt to be serialized back into the database when added to the model.
<v1n3> more of the stack trace before it went wrong, preferably still in my file
<catphish> v1n3: isn't that stack trace complete?
v0n has joined #ruby
<workmad3> lazyPower: you were under the wrong impression
<workmad3> lazyPower: the only things that map back to the database are attributes based off database columns
jgrevich_ has joined #ruby
<workmad3> lazyPower: you need both an attr_accessor to define a virtual attribute and the addition to the attr_accessible line to make it mass assignable though
carlyle has quit [Remote host closed the connection]
<lazyPower> Hmm Interesting. I'll give it a go.
<Spooner> newbism : see PM
<catphish> yay: @disk.seek(0, IO::SEEK_END); @disk.pos
<catphish> better kind of cheating
lggr has quit [Ping timeout: 246 seconds]
jgrevich has quit [Ping timeout: 260 seconds]
jgrevich_ is now known as jgrevich
mikepack has joined #ruby
catphish has quit [Quit: Leaving]
tgraham is now known as tgraham|away
pingfloyd has joined #ruby
maletor has joined #ruby
jbw has quit [Read error: Operation timed out]
jtdowney has quit [Remote host closed the connection]
bsilwal has joined #ruby
lggr has joined #ruby
CaptainJet has joined #ruby
joeycarm_ has joined #ruby
joeycarmello has quit [Read error: Connection reset by peer]
glyytchy has joined #ruby
lurraca has joined #ruby
etehtsea has quit [Quit: Computer has gone to sleep.]
bluOxigen has joined #ruby
<v1n3> catphish:: what does the rest of the code look like? I'm not quite sure how/why you would even open this
jbw has joined #ruby
gvz has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<shevy> with a bazooka
<shevy> that is how I would open it
jimeh4 has joined #ruby
jeffreybaird has joined #ruby
Asher has quit [Remote host closed the connection]
dfmoser has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
BMF has joined #ruby
lggr has joined #ruby
hbpoison has joined #ruby
lurraca has quit [Quit: This computer has gone to sleep]
BlissOfBeing has joined #ruby
<BlissOfBeing> anyone know if there is a way to include another gem's assets in your gem if you add that gem as a dependency?
<minver> What can I use as a param placeholder in my URL? The following is not a valid url: http:/foobar.com?value={placeholder} since curly brackets isn't allowed in urls. What should you use?
Asher has joined #ruby
tgraham|away is now known as tgraham
vaclavt has joined #ruby
Bart-_ has quit [Quit: Leaving...]
beneggett has joined #ruby
hbpoison has quit [Ping timeout: 260 seconds]
seanwash has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
lggr has quit [Ping timeout: 246 seconds]
emmanuelux has joined #ruby
chimay has quit [Quit: WeeChat 0.4.0-dev]
lggr has joined #ruby
mikepack has quit [Remote host closed the connection]
reuf has quit [Ping timeout: 255 seconds]
jimeh4 has quit [Ping timeout: 245 seconds]
Markvilla has quit [Quit: Computer has gone to sleep.]
<TTilus> minver: how about http:/foobar.com?value=placeholder
havenn has joined #ruby
<TTilus> minver: what are you actually tryung to do?
icy` has joined #ruby
icy` has quit [Changing host]
icy` has joined #ruby
<TTilus> BlissOfBeing: "include" as in distribute as part of your gem?
xyzodiac has joined #ruby
manizzle has joined #ruby
seoaqua has joined #ruby
Takehiro has quit [Remote host closed the connection]
brianpWins has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 245 seconds]
manizzle has quit [Client Quit]
bobbbo has joined #ruby
lggr has joined #ruby
glyytchy has quit [Quit: Leaving...]
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
wtee has joined #ruby
mulinux has joined #ruby
<Spooner> BlissOfBeing : You just add the other gem as a dependency in your gem in the gemspec: s.add_dependency "bleh", "=> 0.2.1"
<mulinux> hello
<minver> TTilus: A service where the user inputs a url to example.com/http://anyurl.com?value=placeholder and the service redirects the user to anyurl.com and replaces the placeholder with an important value. So I want to have clear placeholder name and then I thought it would be nice to wrap it with curly brackets
xyzodiac has quit [Quit: Computer has gone to sleep.]
GoHuyGo has joined #ruby
jblack has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<BlissOfBeing> Spooner: Yes, I added the dependency. The part I was missing is I forgot to 'require gem-name' in my gem, so of course it didn't know about it. I added that require and it works fine now.
rakl has joined #ruby
<Spooner> BlissOfBeing : Ah!
lggr has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
starship has joined #ruby
xyzodiac has joined #ruby
beneggett has joined #ruby
VegetableSpoon has joined #ruby
arietis has joined #ruby
xuser has joined #ruby
BMF has quit [Remote host closed the connection]
gani has joined #ruby
GoHuyGo has quit [Quit: Leaving]
jgwong has quit [Ping timeout: 245 seconds]
BlissOfBeing has quit [Quit: This computer has gone to sleep]
colinbm has joined #ruby
ryanf has quit [Ping timeout: 248 seconds]
wallerdev has quit [Quit: wallerdev]
BMF has joined #ruby
jblack has quit [Ping timeout: 245 seconds]
slainer68 has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
lushious has quit [Remote host closed the connection]
lggr has joined #ruby
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
tommyvyo has joined #ruby
rubious has joined #ruby
chimkan has joined #ruby
<havenn> minver: Are you parsing the url with URI? (i'm late, didn't catch the first part...): https://gist.github.com/bb3f0dfd24dcbfbf1348
jimeh4 has joined #ruby
vaclavt has quit [Quit: vaclavt]
eldariof has quit []
colinbm has quit [Quit: colinbm]
<havenn> Would be nice to change the suggested paste-site to gist.github.com imho.
<Spaceghostc2c> Oh hell yeah.
lggr has quit [Ping timeout: 246 seconds]
ipoval has joined #ruby
thunderstrike has quit [Read error: Connection reset by peer]
elico has quit [Quit: elico]
thunderstrike has joined #ruby
burgestrand has quit [Ping timeout: 245 seconds]
seoaqua has quit [Ping timeout: 240 seconds]
wallerdev has joined #ruby
MissionCritical has quit [Ping timeout: 265 seconds]
beneggett has quit [Quit: Computer has gone to sleep.]
lggr has joined #ruby
dakine has joined #ruby
thinkclay has quit [Ping timeout: 256 seconds]
tgraham has quit [Quit: Leaving...]
maletor has quit [Quit: Computer has gone to sleep.]
fantazo has joined #ruby
Takehiro has joined #ruby
daniel_- has joined #ruby
cirwim has left #ruby [#ruby]
chimkan has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
thinkclay has joined #ruby
chimkan_ has joined #ruby
<thinkclay> Any good gems for auto / intelligent syntax highlighting like prettify.js?
pac1 has joined #ruby
daniel_- has quit [Ping timeout: 245 seconds]
fkumro has quit [Ping timeout: 260 seconds]
catphish has joined #ruby
<catphish> is it possible to run a block on each n bytes of a string?
<havenn> If coderay covers the languages you need, that is pure ruby.
<havenn> catphish: yes
lggr has joined #ruby
<catphish> havenn: how?
<thinkclay> looks like I have to explicitly define that language though for both coderay and pygments
MissionCritical has joined #ruby
<thinkclay> prettify is really nice as it does all the work for me.. I can use that, it'll just take more work on the front-end
hbpoison has joined #ruby
<Spaceghostc2c> You know, it can run on the server if you like.
rubious has quit [Quit: Linkinus - http://linkinus.com]
<thinkclay> Spaceghostc2c ya, but that'll probably take more work than going coffee script and doing it all on the client side
<thinkclay> Which has secondary benefits with load and such.. so I think it's the better choice. Was just trying to see if I could go the lazy route with a gem first
asshopo has quit [Read error: Connection reset by peer]
<Spaceghostc2c> thinkclay: One might think, sure. I bet it would.
<thinkclay> gotta jet. Thanks for the feedback guys!
asshopo has joined #ruby
thinkclay has quit [Quit: Leaving.]
butblack has quit [Quit: butblack]
daniel_hinojosa1 has quit [Quit: Leaving.]
lggr has quit [Ping timeout: 245 seconds]
bobbbo has quit [Read error: Connection reset by peer]
saschagehlich has quit [Quit: saschagehlich]
dfmoser has quit [Quit: dfmoser]
bobbbo has joined #ruby
<havenn> catphish: "I'm a string".bytes.to_a.each_slice(3).each { |three_bytes| p three_bytes.pack 'c*' }
ben_alman has quit [Excess Flood]
imami|afk is now known as banseljaj
sebastorama has quit [Quit: Computer has gone to sleep.]
moshef has joined #ruby
<catphish> havenn: thank, will try that
niklasb has quit [Read error: Operation timed out]
JonnieCache has joined #ruby
falieson has joined #ruby
lggr has joined #ruby
gvz has quit [Quit: Leaving]
<falieson> mind if I run some pseudocode by you?
hbpoison has quit [Ping timeout: 255 seconds]
<catphish> havenn: thanks, that's much faster than my method: while(s = slice!(0,3))
<catphish> which is a horrible encoding wise method
butblack has joined #ruby
<moshef> iterating over a hash (say {:key => 'hi', :key2 => 'bye', :key3 => 'moshe'}) and I'd like to build text that looks something like - ":key - hi, :key2 - bye', :key3 - moshe". I use ', ' to combine the keys/values, but I want to remove the last comma.
<moshef> any nice way to do it other than .strip.chop?
<catphish> just use join(', ')
<falieson> is there a better way to do this with ruby?
cakehero has joined #ruby
<catphish> moshef: {:a => :b}.map{|k,v|"#{k} is #{v}"}.join(', ')
mulinux has quit [Quit: mulinux]
jgwong has joined #ruby
<catphish> moshef: puts {:key => 'hi', :key2 => 'bye', :key3 => 'moshe'}.map{|k,v|"#{k.inspect} - #{v.inspect}"}.join(', ')
lggr has quit [Ping timeout: 256 seconds]
<catphish> that needs some brackets to compile:
<catphish> moshef: puts ({:key => 'hi', :key2 => 'bye', :key3 => 'moshe'}.map{|k,v|"#{k.inspect} - #{v.inspect}"}.join(', '))
<catphish> but that :)
<catphish> join is the clever part
<catphish> it turns an array into a string with a separator
LyonJT has joined #ruby
lggr has joined #ruby
<moshef> catphish: ty
<moshef> yeah i know joins, i just had hash instead
<moshef> so I needed to use map, thanks
brianpWins has joined #ruby
<catphish> yes, a hash has various methods that turn it into an array (technically an enum)
<catphish> map is one of them
<moshef> catphish: yeah I know
LyonJT has quit [Client Quit]
<catphish> falieson: i'd try to use SQL in the first instance
fteem has quit [Ping timeout: 245 seconds]
<catphish> 25,000 rows isn't a terribly large database table
ben_alman has joined #ruby
<havenn> falieson: array.sample(array.size.div(3), random: array.size)
<falieson> catphish: true, and i'm not too worried about it since i'm running everything locally
<falieson> catphish: thanks for that, exactly what I was looking for
starship_ has joined #ruby
<falieson> catphish: and I think I should just fill the array with the row IDs
v1n3 has left #ruby [#ruby]
cakehero has quit [Quit: Computer has gone to sleep.]
seanwash has quit [Quit: Computer has gone to sleep.]
starship_ has quit [Changing host]
starship_ has joined #ruby
<catphish> you can loop round each date in ruby, then run something like "SELECT * from table where date = '2012-01-02' ORDER BY rand() LIMIT 100"
<catphish> that will select 100 random entries for that date
starship has quit [Killed (adams.freenode.net (Nickname regained by services))]
starship_ is now known as starship
<falieson> unfortunately the number of entries per date changes
<catphish> you could do a COUNT first to find out what 30% is
<catphish> SELECT COUNT(*) FROM table where date = ...
<falieson> hmm...
<catphish> then work out 30% and select that many rows
lggr has quit [Ping timeout: 255 seconds]
cakehero has joined #ruby
<catphish> it's a little less of a memory hog than loading all the data into ruby
wedtm is now known as wedtm|away
<catphish> much less if you do the select and insert one row at a time
<falieson> yeah, i figured there was a slicker way to do it
<falieson> this might have to run live so the best way is good
<catphish> for for each date, do a count, then work out 30%
colinbm has joined #ruby
<catphish> then do a random select with that number
<catphish> then iterate through the results doing the insert
cakehero has quit [Client Quit]
<falieson> thanks a ton
<catphish> no problem
<catphish> this way you only need to load one item into ruby at a time
<catphish> or even none if you are clever with SQL and do something like this
<catphish> INSERT into one_database.table VALUES (SELECT random data from other_database);
workmad3 has joined #ruby
<catphish> that will let you do the random select and insert at the same time without loading any data into ruby
BMF has quit [Remote host closed the connection]
<catphish> you just need to work out the counts in ruby
<catphish> for each date
lggr has joined #ruby
wedtm|away is now known as wedtm
emmanuelux has quit [Quit: emmanuelux]
Takehiro has quit [Remote host closed the connection]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
jeffreybaird has quit [Quit: jeffreybaird]
colinbm has quit [Quit: colinbm]
cakehero has joined #ruby
sepp2k1 has quit [Remote host closed the connection]
cakehero has quit [Client Quit]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
patrickrb has quit []
kiyoura` has joined #ruby
kiyoura has quit [Ping timeout: 260 seconds]
kiyoura` has quit [Client Quit]
daniel_- has joined #ruby
starship has quit [Ping timeout: 246 seconds]
catphish has quit [Remote host closed the connection]
tgraham has joined #ruby
daniel_- has quit [Ping timeout: 255 seconds]
lggr has quit [Ping timeout: 260 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
v0n has quit [Remote host closed the connection]
Xeago has joined #ruby
lggr has joined #ruby
nightfalcon has joined #ruby
gani has quit [Quit: leaving..]
maletor has joined #ruby
sjuxax has quit [Quit: Leaving.]
robustus has quit [Quit: ZNC - http://znc.in]
Goles has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
saschagehlich has joined #ruby
slainer68 has quit [Remote host closed the connection]
lggr has joined #ruby
emmanuelux has joined #ruby
saschagehlich_ has joined #ruby
wtee has quit [Remote host closed the connection]
saschagehlich has quit [Read error: Connection reset by peer]
saschagehlich_ is now known as saschagehlich
falieson has quit [Quit: falieson]
xyzodiac has quit [Quit: Computer has gone to sleep.]
Takehiro has joined #ruby
whowantstolivefo has quit [Remote host closed the connection]
fyolnish has quit [Remote host closed the connection]
mengu has joined #ruby
AlbireoX has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
pingfloyd has quit [Quit: pingfloyd]
hbpoison has joined #ruby
havenn has quit [Remote host closed the connection]
joofsh has joined #ruby
chrishunt has quit [Quit: WeeChat 0.3.8]
lggr has joined #ruby
rabidpraxis has joined #ruby
moshef has quit [Quit: moshef]
codebrah has joined #ruby
Takehiro has quit [Ping timeout: 260 seconds]
xyzodiac has joined #ruby
bencaron has joined #ruby
Jackneill has quit [Quit: Jackneill]
arturaz has quit [Remote host closed the connection]
hbpoison has quit [Ping timeout: 260 seconds]
jblack has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
wedtm is now known as wedtm|away
canton7 has quit [Ping timeout: 244 seconds]
lggr has joined #ruby
darthdeus has joined #ruby
<darthdeus> hey guys, anyone workin in Sweden? I need a little advice
bencaron has quit [Quit: bencaron]
`brendan has joined #ruby
codebrah has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 245 seconds]
havenn has joined #ruby
diegoviola has quit [Quit: Reconnecting]
whowantstolivefo has joined #ruby
diegoviola has joined #ruby
lggr has joined #ruby
minver has quit [Ping timeout: 245 seconds]
beneggett has joined #ruby
ryanf has joined #ruby
samphippen has joined #ruby
ben_alman has quit [Excess Flood]
rabidpraxis has quit [Remote host closed the connection]
Markvilla has joined #ruby
Markvilla has quit [Client Quit]
brianpWins has quit [Ping timeout: 245 seconds]
Markvilla has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
awarner has joined #ruby
dangerousdave has quit [Ping timeout: 255 seconds]
mytec has joined #ruby
lggr has joined #ruby
awarner has quit [Remote host closed the connection]
tommyvyo has quit [Quit: Computer has gone to sleep.]
Eiam has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
ryanf_ has joined #ruby
ben_alman has joined #ruby
bluOxigen has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 248 seconds]
VegetableSpoon has quit [Ping timeout: 248 seconds]
xorgnak has quit [Remote host closed the connection]
<mytec> I'm building a SQL insert string (insert ..values()..values…) and using + works fine. It's just very slow when there are 1,000 values strings to append. When I change + to << it's works significanly faster but in each insert, there is a missing , between one pair of value strings (1, 2, 3, 4)(2, 3, 4, 5) instead of (1, 2, 3, 4),(2, 3, 4, 5). Just one comma in a different place in each built insert statement. It can occur with as few as 13 concat
<mytec> Is there some side effect I should know about <<?
mikepack has joined #ruby
Jork1 has quit [Quit: Jork1]
tomaw has quit [Read error: Connection reset by peer]
lggr has joined #ruby
tomaw has joined #ruby
<RubyPanther> mytec: you probably have a bug in your loop :o
<Mon_Ouie> String#+ creates a new string, String#<< alters its receiver — meaning every reference to it is affected by the modification
butblack has quit [Quit: butblack]
<mytec> RubyPanther: I've inserted just over 2.3 billion rows using + to generate the insert statements. If there is a bug, I unfortunately don't see it.
wedtm|away is now known as wedtm
<RubyPanther> mytec: + you're creating a new string and then assigning it to the var. << you're appending. Otherwise it is about the same. Trust me padiwan, you have a bug.
<RubyPanther> I can feel the disturbance from here
<mytec> lol
<shevy> mytec << will always be faster than +=
jimeh4 has quit [Ping timeout: 244 seconds]
philcrissman has joined #ruby
<mytec> shevy: yeah, which is why I want to use it
lggr has quit [Ping timeout: 246 seconds]
philcrissman has quit [Remote host closed the connection]
tommyvyo has joined #ruby
lggr has joined #ruby
<havenn> mytec: Did you monkeypatch String#p to add the ','?
<havenn> **String#+
havenn has quit [Remote host closed the connection]
<mytec> havenn: No, I basically do this: "(#{value1}, #{value2})," and just remove the trailing , when the statement has been created
<workmad3> mytec: can you put your code into a gist or a pastie please?
<workmad3> mytec: without looking at it, it's impossible to actually debug
<mytec> Yeah, ended up doing something else so I'm trying to get the code back where it was for posting.
Takehiro has joined #ruby
reuf has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
RegEchse has quit [Quit: <3 WeeChat (v0.3.9-rc2)]
hbpoison has joined #ruby
<bsilwal> what does
<bsilwal> while true
<bsilwal> signifies?
<GeekOnCoffee> bsilwal: it'll loop forever
<bsilwal> thx
<GeekOnCoffee> because true will always be true
lggr has joined #ruby
<bsilwal> aha
<workmad3> or, for the more cynical, it'll loop until a cosmic ray alters the meaning of 'true' on your computer
<workmad3> or until the laws of boolean logic somehow warp
bricker has joined #ruby
<bsilwal> what does this doing ?
Takehiro has quit [Ping timeout: 260 seconds]
<bsilwal> x = method(y)
hbpoison has quit [Ping timeout: 245 seconds]
jblack has quit [Ping timeout: 244 seconds]
<bsilwal> any one? its boggling my mind.
<GeekOnCoffee> bsilwal: what?
<bsilwal> x = method(y)
<GeekOnCoffee> what about it? what's your question?
<bsilwal> erm, actually I was following this
<bsilwal> line 22
<bsilwal> dont quite get it, what is it trying to do?
bricker has quit [Quit: leaving]
lggr has quit [Ping timeout: 260 seconds]
bricker has joined #ruby
<GeekOnCoffee> essentially it's putting that method in a variable, that you then call `.call` on
maletor has quit [Quit: Computer has gone to sleep.]
Goles has quit [Quit: Computer has gone to sleep.]
pskosinski has quit [Ping timeout: 276 seconds]
awestroke has quit [Remote host closed the connection]
<RubyPanther> It is functional programming in Ruby, by exploiting that methods are objects. It is sort of a joke. A simple Ruby MOO.
<RubyPanther> Consider the source ;)
<bsilwal> i still dont get it, tbh.
wez_ has joined #ruby
lggr has joined #ruby
<bsilwal> its passing a variable in a method() method. :S
<RubyPanther> the name of the method you're asking for
<bsilwal> and assigning to another variable. what does method() actually do?
voodoofish has quit [Quit: Leaving]
havenn has joined #ruby
<RubyPanther> you're sending the message "method" to self. With one argument, the name of the method you want. And you get a Method instance. That you can call #call on.
<RubyPanther> It is like saying send(:foo) except you're saying that the method you're going to call is called :foo now, but actually calling it later.
<RubyPanther> In the context of the code in question, that is just a way of writing bad code in order to make a point and expose some features.
<RubyPanther> And to make it harder. Because it is not learncodetheeasyway.
pskosinski has joined #ruby
<bsilwal> :0 is there any good example of understanding this. :D
<RubyPanther> Yeah, a good example of understanding it is never ever ever call #method
glyytchy has joined #ruby
<RubyPanther> It exists but use it. :) Otherwise, understand the finer points of the documentation.
<RubyPanther> ,but don't use it
thone_ has joined #ruby
<bsilwal> ok. I think I will skip that for now.
<bsilwal> but the guy who wrote the blog learncodethehardway is funny guy .. read his advice lol http://ruby.learncodethehardway.org/book/advice.html
zastern has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
falieson has joined #ruby
<falieson> http://pastie.org/4867654 why isn't my select working? (using date and sequel)
thone has quit [Ping timeout: 240 seconds]
lggr has joined #ruby
bricker has quit [Ping timeout: 246 seconds]
Z0idberg has quit [Ping timeout: 260 seconds]
Monie has joined #ruby
Monie has joined #ruby
Monie has quit [Changing host]
RegEchse has joined #ruby
zastern has quit [Remote host closed the connection]
wez_ has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
LouisGB has quit [Ping timeout: 255 seconds]
voodoofish has joined #ruby
<havenn> falieson: Does it work if you change the second like("#{day_select}%") from to?: like(day_select.strftime '%Y-%m-%d%')
answer_42 has quit [Quit: WeeChat 0.3.8]
reuf has quit [Ping timeout: 248 seconds]
lggr has quit [Ping timeout: 245 seconds]
<falieson> source.filter(:t_timestamp.like(day_select.strftime '%Y-%m-%d%')).count => 0
<falieson> =(
napolean has joined #ruby
jenrzzz has joined #ruby
pac1 has quit [Quit: I got it one line of code at a time]
reset has joined #ruby
alanp_ has joined #ruby
Goles has joined #ruby
<havenn> falieson: Just to confirm, with same 12/9/18: day_select = Date.new(2012,9,18); source.filter(:t_timestamp.like(day_select.strftime '%Y-%m-%d%')).count
lggr has joined #ruby
deadghost has joined #ruby
<falieson> nope =(
butblack has joined #ruby
snorkdude has joined #ruby
<falieson> havenn: http://pastie.org/4867654
kirun has quit [Quit: Client exiting]
alanp has quit [Ping timeout: 256 seconds]
<havenn> falieson: In your second one you are checking a different date, is it for sure incorrect?
<workmad3> falieson: is timestamp a date or a datetime in the db?
Z0idberg has joined #ruby
Goles has quit [Client Quit]
<workmad3> falieson: also, what exactly is the issue?
<workmad3> falieson: is it because line 9 and line 11 produce different counts?
<falieson> workmad3: the issue is that using the var my count=0, using the written out date I'm getting a count of around 700
<workmad3> falieson: yeah... that's because (and this is weird), they're *different* :P
<falieson> DateTime :t_timestamp
<havenn> bsilwal: The forest is real, but not evil. Just dark at night. The evil queen is actually a beautiful princess, and she is adopting a new puppy called 'Refinements'.
<workmad3> falieson: line 9 is a date in september, the date you've created is in augest :P
<workmad3> *august
<havenn> 9 != 8
<workmad3> ^^
<falieson> .....
<falieson> *le sigh*
lggr has quit [Ping timeout: 245 seconds]
<falieson> yeah
<falieson> it works
<falieson> thanks workmad3
<falieson> havenn:
<workmad3> np :)
kiyoura has joined #ruby
* falieson hangs head in shame
<workmad3> in fairness, most people have spent hours staring at code, wondering why it's doing different things, without realising they have a 1 char difference :D
<falieson> lollll
lggr has joined #ruby
tgraham is now known as tgraham|away
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
Targen has joined #ruby
Goles has joined #ruby
ElderFain_ has quit [Ping timeout: 272 seconds]
<bsilwal> havenn: interesting will be looking forward to tap the head of this puppy.
LouisGB has joined #ruby
ElderFain has joined #ruby
rakl has quit [Quit: sleeping]
chimkan_ has quit [Quit: chimkan_]
lggr has quit [Ping timeout: 244 seconds]
dpk has joined #ruby
wedtm is now known as wedtm|away
reuf has joined #ruby
ElderFain has quit [Ping timeout: 272 seconds]
lggr has joined #ruby
saschagehlich has quit [Read error: Connection reset by peer]
Takehiro has joined #ruby
saschagehlich has joined #ruby
jamjam has quit [Ping timeout: 245 seconds]
arietis has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
RegEchse has quit [Quit: <3 WeeChat (v0.3.9-rc2)]
jenrzzz has quit [Ping timeout: 246 seconds]
hbpoison has joined #ruby
Takehiro has quit [Ping timeout: 260 seconds]
macmartine has joined #ruby
ElderFain has joined #ruby
<falieson> I can't find the Sequel command for select order random - either of you know this?
lggr has quit [Ping timeout: 245 seconds]
reset has quit [Quit: Leaving...]
<falieson> I know I can send the raw but trying to do it through the ORM
futilegames has joined #ruby
futilegames has quit [Client Quit]
mikepack has quit [Remote host closed the connection]
tgraham|away is now known as tgraham
<kiyoura> this bitch
<kiyoura> said Sequel
hbpoison has quit [Ping timeout: 245 seconds]
<kiyoura> die
kiyoura has quit [Quit: Leaving]
Criztian has joined #ruby
<falieson> haha, nm its just order{rand{}}
lggr has joined #ruby
ohdae has joined #ruby
Markvilla has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
jenrzzz has joined #ruby
TomJ has joined #ruby
Markvilla has joined #ruby
Goles has quit [Ping timeout: 255 seconds]
Jork1 has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
glyytchy has quit [Quit: Leaving...]
banseljaj is now known as imami|afk
lggr has joined #ruby
butblack has quit [Quit: butblack]
ereslibre has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
jblack has joined #ruby
falieson has quit [Ping timeout: 240 seconds]
mxweas has joined #ruby
butblack has joined #ruby
<matti> SO.
<matti> Yes.
<matti> Calculating FizzBuzz from 1 to 1_000_000_000_000 does take time.
<matti> ;d
slicekick has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
<GeekOnCoffee> matti: there's probably a more efficient solution if you're doing it to scale… most ruby solutions are elegant over efficient
butblack has quit [Quit: butblack]
friskd has joined #ruby
wargasm has joined #ruby
snorkdude has quit [Ping timeout: 246 seconds]
<matti> GeekOnCoffee: Well, I wrote it in such a way that you will get Enumerator.
<GeekOnCoffee> gist? :)
Xeago has joined #ruby
<matti> GeekOnCoffee: Imagine .to_a on 1 to 1_000_000_000_000 :) How may TB of RAM do you have? ;]
bier has quit [Ping timeout: 260 seconds]
<matti> GeekOnCoffee: github.com/kwilczynski/fizzbuzz -- support for Bignum was just added by me, I will push in a moment.
<matti> krzysztof@samsung:~$ time ruby -rrubygems -e 'require "fizzbuzz" ; p FB.new(1, 1_000_000_000_000).each {|i| p [i, i.class] }' > fizzbuzz.log
lggr has joined #ruby
<matti> 100% CPU2
<matti> ;d
<matti> GeekOnCoffee: BTW, this entire project is to have some fun ;]
cantonic has quit [Quit: cantonic]
vitor-br has joined #ruby
cantonic has joined #ruby
<GeekOnCoffee> matti: it's a rotating pattern of 15, you might be able to do something efficiency wise with the pattern
jenrzzz has quit [Ping timeout: 245 seconds]
<matti> GeekOnCoffee: I am doing. I use score-based approach.
<matti> GeekOnCoffee: Look at .h
ryanf_ has quit [Quit: leaving]
<matti> GeekOnCoffee: And it works for arbitrary large values.
<matti> GeekOnCoffee: Unless I helve set in chunks and do parallel computation on multiple CPU cores / CPUs. Then it will be rather slow with default Ruby model ;]
lggr has quit [Ping timeout: 240 seconds]
napolean has quit [Quit: Page closed]
<matti> GeekOnCoffee: Hehe, imagine BOINC taks ;p
<matti> GeekOnCoffee: Finding biggest FizzBuzz ;p
* matti is silly
timonv has quit [Remote host closed the connection]
<GeekOnCoffee> finding one fizz buzz value is easy though
<matti> I know ;]
lggr has joined #ruby
<GeekOnCoffee> and fast
slicekick has quit [Remote host closed the connection]
glyytchy has joined #ruby
<matti> GeekOnCoffee: FB#[] does this.
snorkdude has joined #ruby
bobbbo has quit [Quit: bobbbo]
Criztian has quit [Remote host closed the connection]
freeayu has joined #ruby
bier has joined #ruby
lurraca has joined #ruby
<havenn> Tried doing really fast FizzBuzz with EM::Symphony, but it choked. Celluloid on the other hand is flying!: https://gist.github.com/3805403
Markvilla has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<matti> Looking ;]
lggr has quit [Ping timeout: 252 seconds]
ohdae has quit [Quit: leaving]
Markvilla has joined #ruby
<matti> I need to lookup what is Celluloid.
<havenn> matti: You know you're on the right track with FizzBuzz when you're monkeypatching Enumerable to include Celluloid Futures.
<havenn> >.>
<matti> LOL
<matti> havenn: Hehehe
<matti> ;]
timonv has joined #ruby
macmartine has quit [Quit: Computer has gone to sleep.]
timonv has quit [Remote host closed the connection]
mikepack has joined #ruby
tgraham is now known as tgraham|away
lggr has joined #ruby
havenn has quit [Remote host closed the connection]
jblack has quit [Ping timeout: 240 seconds]
manizzle has joined #ruby
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
jblack has joined #ruby
friskd has quit [Ping timeout: 240 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
rabidpraxis has joined #ruby
Takehiro has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
RegEchse has joined #ruby
elico has joined #ruby
havenn has joined #ruby
cantonic has quit [Quit: cantonic]
glyytchy has quit [Quit: Leaving...]
Russell^^ has quit [Quit: Russell^^]
arkham has joined #ruby
hbpoison has joined #ruby
Takehiro has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
thunderstrike has quit [Remote host closed the connection]
<chiel> what's the easiest way to check if a variable is a string? i thought it was `var.is_a? String` but that doesn't seem to do it
<chiel> it says: "TypeError - class or module required:"
jblack has quit [Ping timeout: 245 seconds]
Pochacco has joined #ruby
falieson has joined #ruby
Pochacco has quit [Client Quit]
<falieson> http://pastie.org/4868004 I'm not doing target.insert( correctly =(
Pochacco has joined #ruby
<tommyvyo> chiel: var.class == String ?
<chiel> tommyvyo: oh okay, thank you
<chiel> tommyvyo: I guess that won't work though if the var is nil?
<tommyvyo> nil.class => NilClass
<chiel> ah :)
<chiel> thanks
<tommyvyo> noproblem!
hbpoison has quit [Ping timeout: 246 seconds]
<chiel> splendid, works a charm
mxweas has quit [Quit: Computer has gone to sleep.]
<chiel> trying to secure this bloody api. :p
<tommyvyo> quiet understandable!
<Pochacco> Don't know why but I'm having trouble finding on google documentation for #{ } I don't really understand it...
<tommyvyo> if you wanted to you could add a is_a? method to BasicObject
<tommyvyo> Pochacco care to elaborate?
lggr has quit [Ping timeout: 256 seconds]
<Pochacco> I wrote some code and inside a string i put #{five} five is a integer
<Pochacco> does #{} convert integers into strings or concatenate or both?
<tommyvyo> "#{5}
<tommyvyo> "#{5}" => "5" for me in IRB
<tommyvyo> is the string double or single quoted?
<tommyvyo> #{} only works in double quotes
lggr has joined #ruby
<arkham> I think #{} just evaluates the code and runs to_s, am I correct?
<tommyvyo> indeed
<chiel> yep
<chiel> it's just string interpolation
<Pochacco> ooo okay
<chiel> so it'll never come out as an actual integer number
fixl has joined #ruby
mxweas has joined #ruby
<falieson> http://pastie.org/4868004 I'm not doing datasetinsert() correctly. can someone have a look?
Jacob_ has joined #ruby
Jacob_ is now known as Guest57310
<Pochacco> any benefits of using #{} then just concatenating the string and a integer.to_s?
<bsilwal> in java I could do, getNext().getData()
Xeago has quit [Remote host closed the connection]
<bsilwal> how is it done in ruby?
skogis has quit [Ping timeout: 255 seconds]
<bsilwal> ah it works
darthdeus has quit [Quit: Linkinus - http://linkinus.com]
<arkham> Pochacco: so you don't forget to call to_s and ruby doesn't crash with "cannot concatenate string and fixnums"
Xeago has joined #ruby
<Pochacco> hmmm understandable. Thanks
<falieson> http://pastie.org/4868004 Line:11 here is some sample output -> http://pastie.org/4868048
lggr has quit [Ping timeout: 244 seconds]
eddieolson has joined #ruby
<tommyvyo> Pochacco: same as what arkham said, as well as code readability.
<tommyvyo> "Hello, welcome to my App, #{@user.name}, todays date is: #{DateTime.now"} is a lot easier to read/type than
rakl has joined #ruby
reuf has quit [Ping timeout: 245 seconds]
<tommyvyo> "Hello, welcome to my App, " + @user.name + " todays date is " + DateTime.now.to_s
LouisGB has quit [Ping timeout: 255 seconds]
roadt has joined #ruby
<arkham> yeah, that hurts my eyes
<falieson> ${} is a great thing
elico has quit [Quit: elico]
<Spaceghostc2c> ${} or #{}
<falieson> ol
<falieson> sorry, #{}
<falieson> keyslip, not as bad as a nip slip… unless it takes you hours to find it
<falieson> batteries are about to die, someone please?
lggr has joined #ruby
`brendan has joined #ruby
<arkham> falieson: what is the problem?
<falieson> http://pastie.org/4868004 Line:11 here is some sample output -> http://pastie.org/4868048 . `query': Mysql::Error: Column count doesn't match value count at row 1 (Sequel::DatabaseError)
<arkham> mm I'm not sure you can treat dates like that
<falieson> checkout the output
<arkham> have you tried using date.next_date instead of +1?
Gm4n has quit [Quit: ZNC - http://znc.sourceforge.net]
<arkham> next_day*
tgraham|away is now known as tgraham
<falieson> actually all the queries work
<falieson> except for the insert
<falieson> actuly… code was wrong, I hadn't updated my limit
emmanuelux has quit [Quit: emmanuelux]
Guest57310 is now known as ecksit
mytec has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Virunga has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 260 seconds]