apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
<headius> yes, they do, but they're backed by native threads
<Sou|cutter> headius: this may be a stupid question, but how do you access them?
<Sou|cutter> just using them gives me NameError: uninitialized constant Fiber
<Sou|cutter> require 'fiber' also does not work
<Sou|cutter> actually this is within a spec.. maybe this is yet another rspec issue
<headius> you probably need to pass --1.9
<Sou|cutter> ahh, that would do it
<headius> and if a subprocess is getting launched, you may need JRUBY_OPTS=--1.9 so the subprocess gets it too
<headius> JRuby 1.7 will be in 1.9 mode by default
stephenjudkins has joined #ruby
<Sou|cutter> headius: it would appear that jruby is superior to ruby 1.9.3-p125 with fibers
<headius> well, that's good :)
Clordio has joined #ruby
<headius> I put in a lot of time trying to get them as fast as possible
<Sou|cutter> headius: https://gist.github.com/2324019 <-- this segfaults in 1.9.3-p125 but works with jruby 1.6.7
<headius> ahhh
<Sou|cutter> well, even just correctness in this case
<headius> that's weird...that's so basic
<Sou|cutter> I know, right? Very frustrating experience playing with fibers today
<Sou|cutter> headius: if you take rspec out of the equation, that fiber works though. So something strange is going on there...
<headius> oh, that's interesting
<headius> something about the rspec context then
<Sou|cutter> I'm happy to know it works on jruby, though.. I can carry on with my work until this somehow gets fixed in rubyland. At least jruby will very the correctness of my code
<Sou|cutter> verify, that is
<headius> do let me know if there's something we don't do right :)
<Sou|cutter> I'd say this is a feather in your cap :)
<headius> I'll take it!
ScottNYC has joined #ruby
mdel has joined #ruby
<burgestrand1> Sou|cutter: I ran it on my end and it works well here
<burgestrand> 1.9.3-p125, rspec 2.9.0
<Sou|cutter> really?
rking has joined #ruby
<Sou|cutter> I shall try again
<burgestrand> Yep
<burgestrand> Could be a bug in cruby, or perhaps your installation of cruby is broken somehow (or both!)
<Sou|cutter> ok this IS odd. It works for me in a 'clean' rvm gemset
<Sou|cutter> let me see
<Sou|cutter> oh, I was on rspec 2.8.0 hmm, let me try upgrading that
<burgestrand> I’ll try downgrading
<frontendloader> chat.stackoverflow, amazing that they spent time on that when freenode exists.
<Sou|cutter> burgestrand: that seems to make the difference
<Sou|cutter> burgestrand: are you seeing that same thing (I hope)?
vjacob has joined #ruby
<burgestrand> trying to get rid of rspec, just uninstalling rspec is not enough to remove rspec-core and the likes :p
<Sou|cutter> hah.. rspec and it's modules
<Sou|cutter> pita ;)
<burgestrand> Sou|cutter: rspec 2.8.0 works as well
pu22l3r has joined #ruby
<Sou|cutter> burgestrand: I still have this in my terminal backlog
<Sou|cutter> trying to figure out where I went wrong
<burgestrand> I’d consider pretty much any segfault a bug, probably not you that went wrong :p
<Sou|cutter> actually I think there might be something with rvm here
<headius> gotta love a language runtime that segfaults
<burgestrand> exciting
EvanR has joined #ruby
<Sou|cutter> I had done an 'rvm get head' and then 'rvm reload' and then tried switching to 1.9.3... I'm using a 1.9.3 gemset, but it seems to indicate that it's running on 1.9.2
<headius> ttfn
<frontendloader> does abusing method_missing to do interesting things have negative consequences?
<burgestrand> abusing anything usually does
<Sou|cutter> burgestrand: note that the rvm gemset is 1.9.3-p125 and the runtime is actually 1.9.2-p290 https://gist.github.com/12d9e0506110c0f3ecd2
<Sou|cutter> grrr
<Sou|cutter> Not sure I will trust 'rvm reload' ever again
<burgestrand> Sou|cutter: perhaps you are using 1.9.2 interpreter that is somehow using 1.9.3 extension libraries
<Sou|cutter> burgestrand: thanks for verifying
<burgestrand> rvm has done this thing to me before, when it did I just imploded it and started over
<Sou|cutter> well it works for me in a new shell
<Sou|cutter> so it's all good
<burgestrand> \o/
pu22l3r has joined #ruby
x77686d_ has joined #ruby
<delinquentme> def my_method(*args) << what purpose does the * server here?
shevy has joined #ruby
<Sou|cutter> it's like varargs
adeponte has joined #ruby
denysonique has joined #ruby
andrewhl has joined #ruby
davidcelis has joined #ruby
nif has joined #ruby
Teddy2st_ has joined #ruby
x77686d has joined #ruby
hooper has joined #ruby
PsiliPharm has joined #ruby
Shagane has joined #ruby
CheeToS has joined #ruby
BrianE|mobile has joined #ruby
wroathe has joined #ruby
etaylor has joined #ruby
`brendan has joined #ruby
jcromartie has joined #ruby
etaylor has joined #ruby
strife25 has joined #ruby
phantasm66 has joined #ruby
seanstickle has joined #ruby
kvirani has joined #ruby
nif has joined #ruby
fixl has joined #ruby
manizzle has joined #ruby
Teddy2steper has joined #ruby
blueadept` has quit ["Leaving"]
<frontendloader> if you call my_method(var1, var2, var3) then args will contain an array of those 3 arguments
etaylor has joined #ruby
etaylor has quit [#ruby]
EzeQL has joined #ruby
sectionme has joined #ruby
natemcguire has joined #ruby
Zolrath_ has joined #ruby
Cache_Money has joined #ruby
_null has joined #ruby
nif has joined #ruby
philips has joined #ruby
Transformer has joined #ruby
shtirlic_ has joined #ruby
<bawerd> anyone tried building 1.9.3-p125 on OpenSolaris/Illumos/SmartOS?
hobbyist has joined #ruby
<delinquentme> im reading the prag programmer atm ... and it mentions threads in ruby ...
silverhand has quit [#ruby]
<delinquentme> this is to say you're running multicore type operations in ruby?
rking has joined #ruby
dilas has joined #ruby
adamkittelson has joined #ruby
pu22l3r has joined #ruby
dilas-br has quit [#ruby]
danielvdotcom has joined #ruby
Nisstyre has joined #ruby
nif has joined #ruby
Chryson has joined #ruby
igotnolegs has joined #ruby
gokul has joined #ruby
sacarlson has joined #ruby
nif has joined #ruby
nif has joined #ruby
cachoimechi has joined #ruby
nif has joined #ruby
CheeToS has joined #ruby
nif has joined #ruby
iamjarvo has joined #ruby
odilon has joined #ruby
Bosma has joined #ruby
chessguy has joined #ruby
gen0cide_ has joined #ruby
sonkei has joined #ruby
mbreedlove has joined #ruby
wroathe has joined #ruby
lewis has quit ["Leaving..."]
nari has joined #ruby
n8ji has joined #ruby
ooooooyouuuuu has joined #ruby
<ooooooyouuuuu> huh
<ooooooyouuuuu> what do you mostly use ruby for
flashuni has joined #ruby
quest88 has joined #ruby
williamcotton has joined #ruby
andrewhl has joined #ruby
Apocalypse has joined #ruby
nif has joined #ruby
quest88 has joined #ruby
vandemar has joined #ruby
Haydos has joined #ruby
bryanray has joined #ruby
ElderFain has joined #ruby
<batmanian> Does Ruby have a method for multiplying arrays? e.g. ["Advanced", "Intermediate"] * ["Physics", "Chemistry"] = [ ["Advanced", "Physics"], ["Advanced", "Chemistry"], ["Intermediate", "Physics"], ["Intermediate", "Chemistry"] ]
alanp_ has joined #ruby
kmurph79 has joined #ruby
sonkei has joined #ruby
c9s has joined #ruby
<_ack> batmanian .product
<batmanian> _ack thanks
wilmoore has joined #ruby
nonotza has joined #ruby
dql has joined #ruby
ben225 has joined #ruby
senthil has joined #ruby
sonkei has joined #ruby
zeroeth has joined #ruby
RORgasm has joined #ruby
renanoronfle has joined #ruby
nfluxx has joined #ruby
senthil has joined #ruby
nfluxx_ has joined #ruby
Cache_Money1 has joined #ruby
gbinns has joined #ruby
nfluxx_ has joined #ruby
rippa has joined #ruby
NinoScript has joined #ruby
NinoScript has joined #ruby
pu22l3r has joined #ruby
NinoScript has quit [#ruby]
NinoScript has joined #ruby
NinoScript has joined #ruby
tommyvyo has joined #ruby
rushed has joined #ruby
kenneth has joined #ruby
two- has joined #ruby
rking has joined #ruby
ben225 has joined #ruby
shaggy2dope has joined #ruby
pandu1 has joined #ruby
<pandu1> hello
pandu1 has quit [#ruby]
pandu1 has joined #ruby
pandu1 has quit [#ruby]
ThewyBread has joined #ruby
startlin1 has joined #ruby
davidcelis has joined #ruby
davidcelis has joined #ruby
pu22l3r has joined #ruby
Drewch has joined #ruby
Cache_Money has joined #ruby
lkba has joined #ruby
zetradr has joined #ruby
h4mz1d has joined #ruby
baniseterfiend` has joined #ruby
prometheus has joined #ruby
CoverSli1e has joined #ruby
cobragoat has joined #ruby
yxhuvud has joined #ruby
pu22l3r has joined #ruby
rushed has joined #ruby
Apocalypse has joined #ruby
k3r0 has joined #ruby
andrewh has joined #ruby
wroathe has joined #ruby
Haydos has joined #ruby
pusewicz_ has joined #ruby
neurotech has joined #ruby
MrGando has joined #ruby
nari has joined #ruby
Teddy2steper has joined #ruby
RORgasm has joined #ruby
KL-7 has joined #ruby
wroathe has joined #ruby
gtuckerkellogg has joined #ruby
bluOxigen has joined #ruby
nfluxx has joined #ruby
dfamorato has joined #ruby
Nanuq has joined #ruby
rking has joined #ruby
baniseterfiend` has joined #ruby
tomzx has joined #ruby
jfelchner has joined #ruby
pu22l3r_ has joined #ruby
jfelchner has quit [#ruby]
<wolgo> hi, I am trying to create a static variable/class variable with @@stuff. I can only access this through an instance. Is this correct? I get errors when I try to something like Class.StaticVariable
banisete_ has joined #ruby
<wolgo> it seems kind of confusing to me
<wolgo> but if that is the only way to do it then whatever
scwh has joined #ruby
tar_ has joined #ruby
jfelchner has joined #ruby
sacarlson has joined #ruby
x0F__ has joined #ruby
sonkei has joined #ruby
<mistergibson> wolgo: @@var_name is set for the entire class of instances. You want to use @variable for instance-related storage needs. Also, you can set a constant (ALL_CAPS_VARNAME) at the class or instance level.
angelGao has joined #ruby
pu22l3r has joined #ruby
pu22l3r has joined #ruby
zeroeth has joined #ruby
andrewh has joined #ruby
dfamorato has joined #ruby
alanp has joined #ruby
mxweas_ has joined #ruby
nikhil__ has joined #ruby
pu22l3r_ has joined #ruby
noric has joined #ruby
serpa has joined #ruby
<serpa> hi all, anybody use google charts tools with rails ?
andrewh has joined #ruby
jfelchner has joined #ruby
andrewh has joined #ruby
serpa has quit [#ruby]
CheeToS has joined #ruby
charlenopires has joined #ruby
nikhil__ has joined #ruby
joast has joined #ruby
tewecske has joined #ruby
ephemerian has joined #ruby
JohnBat26 has joined #ruby
baniseterfiend` has joined #ruby
Morkel has joined #ruby
jfelchner has joined #ruby
CrazyPickles has joined #ruby
ixx has joined #ruby
RORgasm has joined #ruby
davidpk has joined #ruby
mdw has joined #ruby
ukwiz has joined #ruby
banjara has joined #ruby
scientes has joined #ruby
shruggar has joined #ruby
gtuckerkellogg has joined #ruby
etehtsea has joined #ruby
JohnAvery has joined #ruby
<JohnAvery> My javascript drop down menus stopped working in development after I "bundle exec rake assets:precomp"
<JohnAvery> Anyone know how to fix this?
Sou|cutter has joined #ruby
Indian has joined #ruby
nemesit has joined #ruby
francisfish has joined #ruby
davidcelis has joined #ruby
tobago has joined #ruby
doomviking has joined #ruby
tobago has quit [#ruby]
musl has joined #ruby
mcwise has joined #ruby
bier has joined #ruby
bluOxigen has joined #ruby
companion_ has joined #ruby
netogallo has joined #ruby
aibo has joined #ruby
tuxaddicted has joined #ruby
edibrac has joined #ruby
bengl has joined #ruby
andyl has joined #ruby
two- has joined #ruby
musl has joined #ruby
timonv has joined #ruby
aibo_ has joined #ruby
dzhulk has joined #ruby
trivol has joined #ruby
blacktulip has joined #ruby
thomasfuston has joined #ruby
netogallo has joined #ruby
thomasfuston has quit [#ruby]
Goni has joined #ruby
musee has joined #ruby
lunchdump has joined #ruby
examancer has joined #ruby
baniseterfiend` has joined #ruby
rohit has joined #ruby
libertyprime has joined #ruby
berserkr has joined #ruby
RORgasm has joined #ruby
lockweel has joined #ruby
chrassidy has joined #ruby
<chrassidy> I have a basic understanding of Ruby, my goal is to write a modular game server. Where should I start?
<baniseterfiend`> chrassidy: learn celluloid or eventmachine
<chrassidy> can I make a commercial android/ios game that connects to a server I make with these libraries?
richardlxc has joined #ruby
<mistergibson> chrassidy: I would suggest you also evaluate em-synchrony (fiber-aware evented coding)
<chrassidy> mistergibson, thanks
<canton7> chrassidy, eventmachine, and i imagine celluloid also, use tcp connections (you define what protocol runs over tcp), so yes
<chrassidy> okay
<mistergibson> chrassidy: for fiber-aware evented custom http server: sychrony-sinatra would be a good place to start
<mistergibson> err... synchrony-sinatra
<mistergibson> very bare bones but effective
<chrassidy> I'm not planning on writing a web app though
<chrassidy> more of a mobile game
akemrir has joined #ruby
rohit has joined #ruby
thecreators has joined #ruby
mikeric has joined #ruby
alol has joined #ruby
burgestrand has joined #ruby
deobald has joined #ruby
nikhil__ has joined #ruby
Foxandxss has joined #ruby
radoen has joined #ruby
<radoen> hi all people
telling has joined #ruby
<radoen> i have a trouble whit a module when lunch them interpreter says me ./beef.rb:116:in `<main>': uninitialized constant BeEF::Core::Websocket (NameError)
<radoen> here the code http://pastebin.com/QsqbksHp
<radoen> where is the problem? line 116 in beef.rb is just BeEF::Core::Websocket.initialize
<radoen> none can help me?
nikhil___ has joined #ruby
kirun has joined #ruby
chrassidy has joined #ruby
<burgestrand> radoen: problem is that beef.rb does not require the file you have pasted
<burgestrand> before line 116
KL-7 has joined #ruby
mdw has joined #ruby
<radoen> so i've to edit config.yalm of beef.rb?
Gekz_ has joined #ruby
Gekz_ has joined #ruby
nikhil__ has joined #ruby
<radoen> ok burgestrand i found the file to load external resorce thank you
c3l has joined #ruby
nikhil___ has joined #ruby
rippa has joined #ruby
td123 has joined #ruby
Eldariof-ru has joined #ruby
nikhil__ has joined #ruby
apeiros_ has joined #ruby
<shevy> that code is so horrible
<shevy> printf("Inside")
<shevy> C hackers should stay away from Ruby
mdw has joined #ruby
k_sze has joined #ruby
<radoen> shevy: debug print make's the code horrible ?
<radoen> and yes i have experience with C but i'm a ruby noob. who are you to say "C hackers should stay away from Ruby"?
snearch has joined #ruby
hirotoshi has joined #ruby
<Mon_Ouie> printf isn't commonly used in Ruby
<Mon_Ouie> We use print or puts instead
<Mon_Ouie> There's no reason to call printf if you're not formatting anything, too
<Mon_Ouie> (or if you're using string interpolation)
mcwise has joined #ruby
p2w has joined #ruby
davidcelis has joined #ruby
fr0gprince_mac has joined #ruby
<shevy> radoen what is being debugged with printf("Inside") ?
Beoran__ has joined #ruby
ales has joined #ruby
<radoen> i'm writting a module for a project I need to know if its loaded or not and print something is faster solution
nikhil__ has joined #ruby
Eldariof59-ru has joined #ruby
indeterminate has joined #ruby
KL-7 has joined #ruby
fangwen has joined #ruby
rohit has joined #ruby
nikhil__ has joined #ruby
fjfish has joined #ruby
RORgasm has joined #ruby
KL-7 has joined #ruby
Morkel has joined #ruby
dql has joined #ruby
fr0gprince_ has joined #ruby
akemrir has joined #ruby
doug11 has joined #ruby
doug11 has quit [#ruby]
Gesh has joined #ruby
alem0lars has joined #ruby
KL-7 has joined #ruby
Deele has joined #ruby
Apocalypse has joined #ruby
jbw has joined #ruby
vandemar has joined #ruby
davidpk has joined #ruby
fr0gprince_mac has joined #ruby
strife25 has joined #ruby
_ramo has joined #ruby
<_ramo> hi
burgestrand has joined #ruby
<_ramo> i've tried to run a command that's shown here: http://capifony.org/ and got the following error messages: https://gist.github.com/f106b5e07fa6c94caca2 capistrano is installed. cap -V gives "Capistrano 2.11.2"
jcromartie has joined #ruby
<shevy> hmm anyone know if there is a solution for ruby + torrent, when the torrent are magnet-links?
helichopter has joined #ruby
IPGlider has joined #ruby
linoj has joined #ruby
Indian has joined #ruby
uatecuk has joined #ruby
frishi has joined #ruby
uatecuk has quit [#ruby]
<matti> shevy: No, but you can be the first to do FFI with librtorrent :)
mcwise has joined #ruby
abstrusenick has joined #ruby
<shevy> hmm
<shevy> I know a bit ruby
<shevy> but not C
<shevy> :(
<shevy> but it really begins to go on my nerves that there are only python clients
<shevy> bittorrent ... deluge ...
<shevy> then of course some C++ (YOU NEED BOOST!!!) or unmaintained C solutions (ctorrent)
<shevy> --enable-python-binding
<shevy> waaaah
<shevy> in libtorrent
<shevy> everyone is a pythonista :(
<shevy> hmm let's see
<matti> I don't think that this one is recent enough for magnet links.
<matti> shevy: Go with the flow then, install rtorrent and move on.
<shevy> rtorrent depends on libtorrent
<shevy> I am trying to get it to compile right now :P
<matti> Its real easy.
<matti> ;p
<matti> Do the Unix mantra.
<matti> ./configure ; make ; make install
<matti> ;p
<shevy> that's what you think!
<matti> But better grab package.
<shevy> that's what I can't!
<matti> shevy: I did it two days ago.
<matti> shevy: To get magnet links going.
<shevy> matti what distribution are you running?
<matti> shevy: And I had to edit source to lie about version, as many private trackers disallow recent version.
<matti> shevy: Debian and Ubuntu (well, something that used to be it) on desktop.
<matti> shevy: Squeeze
<shevy> hmm odd
<shevy> I compiled libtorrent 0.14.x something but the latest version seems to be 0.13.x
<shevy> *** very confused ***
<matti> Have you pulled it form git?
<shevy> hmm no, from an old .tar.bz2 I had here
<shevy> :)))
<shevy> I think part of my system is from the future
<matti> Well then, you are obviously a time traveller ;p
<shevy> yeah
<shevy> but I killed it now
mrwalker has joined #ruby
<shevy> and 0.13.1 works! rtorrent finally found it
<matti> Haha
<matti> shevy: Owned by time-space distortion.
<matti> ;d
<shevy> I cant even extract that, it seems
<shevy> tells me:
<shevy> gzip: stdin: invalid compressed data--format violated
<shevy> libtorrent-ruby-0.1.0/ext/libtorrent/alert.i
<shevy> tar: Unexpected EOF in archive
<shevy> tar: Unexpected EOF in archive
<matti> shevy: Put it in the browser.
<shevy> slowly I begin to think that rubyforge.org is dead ...
<matti> And you will see why.
Asher has joined #ruby
<matti> Oh.
<matti> My bad. Its not sourceforge.
* matti misread.
katie has joined #ruby
<shevy> no, don't worry
<shevy> I think it is a general trend with rubyforge
<shevy> packages are ancient, links don't work or I don't manage to extract, news updates slowish ...
* shevy sobs silently.
sbanwart has joined #ruby
<shevy> the world is a changing, I don't recognize it anymore
<shevy> where is napster oldschool! :(
<matti> shevy: *there* *there*
<shevy> always when they tried to download my songs, I immediately downloaded them back
<shevy> damn thieves
<matti> shevy: Get yourself a Mac and join other hipsters. You will be freed from all earthly turmoils.
<matti> ;d
<shevy> you dont use a mac!!!
<matti> No.
<matti> I hate Apple.
<shevy> at one point I wanted to go back to windows
<shevy> but these days, I only see suckage, and rarely beauty :(
<shevy> I can't stand the iPropaganda
<matti> Indeed.
<shevy> finally... rtorrent is installed. I am almost happy now.
<matti> But whatever, whatever works for folks ;]
<shevy> if the "r" would only stand for ruby ...
<matti> shevy: \o/
<shevy> matti, I dont nor have a mac, but I follow things on #machomebrew :)
<matti> shevy: You are asking for too much... lower your expectations.
<matti> ;/
<shevy> just because that one is written in ruby
<shevy> and I also have a look at all their formulas and steal things when they seem useful
<matti> ;]
wroathe has joined #ruby
<shevy> magnet URLs aren't beautiful either ...
<matti> LOL
* matti slaps shevy
<frontendloader> hrm can't you splat an array going in to an each block?
<matti> Shake out of this whiny moo
<matti> mood*
sohocoke has joined #ruby
<shevy> what do you want to have
waxjar has joined #ruby
<matti> I want....
<matti> Hmm...
<matti> I could lend your time machine ;s
<shevy> not you
<shevy> the frontendloader dude
<matti> Not me?!
<matti> :<
* matti cries
<shevy> hey wants to use * there but I am not sure what for
philips has joined #ruby
<matti> Because * are coller than +
<matti> cooler*
<shevy> can arrays even be splatted at all?
pu22l3r has joined #ruby
yaroslav has joined #ruby
td123 has joined #ruby
<shevy> I always see splat used in things like
<shevy> def foo(*input)
<shevy> and then...
<shevy> foo(1,2,3,4,5,6)
<shevy> rtorrent works matti !
<shevy> no more shall I use graphical clients ...
ScottNYC has joined #ruby
<matti> shevy: In his case flatten would do.
rushed has joined #ruby
<matti> * on the right side on its own will trigger parser wrror.
<matti> error*
<shevy> I am still not sure what he actually wants to do, but yeah, .flatten seems to be what he wants
<shevy> we'll never hear from him again though
<shevy> frontendloader do you like pizza?
pu22l3r has joined #ruby
<matti> shevy: What frontendloader is trying to achieve calls for ...
<matti> shevy: NaNNaNNaNNaNNaN Batman ...
<matti> shevy: Moment
seanstickle has joined #ruby
jcromartie has joined #ruby
nixnub has joined #ruby
freeayu has joined #ruby
<nixnub> hi, am trying to load my ruby application with passenger module over apache
<nixnub> I have installed all the required gems, though I am still having this error
<nixnub> no such file to load -- bundler/setup
<nixnub> google didn't help tho =/
<nixnub> any hints ?
irmbrady has joined #ruby
Nisstyre has joined #ruby
Eldariof27-ru has joined #ruby
RORgasm has joined #ruby
<burgestrand> nixnub: install bundler on the ruby version you are using for passenger
<frontendloader> shevy: not sure what that question has to do with anything
kaneda has joined #ruby
<nixnub> frontendloader, root@li443-123:/home/oneyad/oneyad# gem list -d bundler
<nixnub> *** LOCAL GEMS ***
<nixnub> bundler (1.1.3, 1.1.0)
<nixnub> burgestrand, # gem list -d bundler
<nixnub> *** LOCAL GEMS ***
<nixnub> bundler (1.1.3, 1.1.0)
<frontendloader> http://bpaste.net/show/26667/ the idea was I wanted to remove the need for an i and just unpack going straight into the block
cap10morgan has joined #ruby
pu22l3r_ has joined #ruby
jmeeuwen has joined #ruby
BeLucid has joined #ruby
Morkel has joined #ruby
akemrir has joined #ruby
Eldariof-ru has joined #ruby
artm has joined #ruby
nikhil__ has joined #ruby
fukushima has joined #ruby
Indian has joined #ruby
<shevy> frontendloader the problem is, talking to you is like talking to a wall, there is just no feedback. you ignored all the other things above man
Indian has joined #ruby
<frontendloader> yes, arrays can be splatted
<frontendloader> that code I just pasted achieves that
<frontendloader> given a being an array of the form [[1,2],[3,4]]
iocor has joined #ruby
<Mon_Ouie> |j, k|
<shevy> :)
kaneda__ has joined #ruby
<shevy> he just prefers to splat
odinswand has joined #ruby
VegetableSpoon has joined #ruby
savage- has joined #ruby
irvken has joined #ruby
<irvken> http://en.wikipedia.org/wiki/Ruby_%28programming_language%29#Interaction when I enter 0> 1+2 it just returns false
<gogiel> irvken: LOL :D
<gogiel> irvken: 0> is a prompt...
<gogiel> he entered 1+2
<irvken> heh
pu22l3r has joined #ruby
<Mon_Ouie> Kind of like why it doesn't work when you type $ before a command in a shell
<gogiel> irvken: not sure if trolling or that stupid :D
<irvken> shouldn't be trying this drunk obviously
odinswan1 has joined #ruby
<shevy> hmm
<shevy> odd prompt
<shevy> my IRB prompt is ""
<gogiel> irb(main):001:0>
<gogiel> [1] pry(main)>
SeySayux has joined #ruby
donpi has joined #ruby
NinoScript has joined #ruby
brngardner has joined #ruby
fbernier has joined #ruby
<shevy> gogiel yeah I always found the line number to be useless in irb
trivol has joined #ruby
akemrir has joined #ruby
<Mon_Ouie> I find it useful in Pry — so I can get the output from the nth line back
robdodson has joined #ruby
rippa has joined #ruby
mechanicles has joined #ruby
kah_ has joined #ruby
aibo__ has joined #ruby
wefawa has joined #ruby
sonkei has joined #ruby
KL-7 has joined #ruby
apok has joined #ruby
akemrir has joined #ruby
bglusman has joined #ruby
hirotoshi has joined #ruby
hirotosh_ has joined #ruby
maletor has joined #ruby
Drewch has joined #ruby
sbanwart has joined #ruby
cpruitt has joined #ruby
Shagane has joined #ruby
species has joined #ruby
<species> hey, im trying to get my head around unshift
<species> is it really just the same as push_front for c++ containers?
<species> the name suggests its not so simple
<species> (doing the koans and experiencing a few wtf-ruby's)
Shagane has joined #ruby
<species> as an aside i think the mr miagi meme is getting old in programming tutorials now
VegetableSpoon has quit ["Leaving"]
Bofu2U has joined #ruby
Sailias has joined #ruby
nif has joined #ruby
<seanstickle> What Mr Miagi theme?
<species> have you done the koans?
<robdodson> species: I'm not a c++ expert but I think the answer is yes. it just puts values into the front of your array
<species> it hsi this whole kung fu master thing going
<species> it keeps giving me advice about enlightenment and it just drew me a mountain
<species> (in ascii art)
<robdodson> hah
<seanstickle> Ah, no.
<species> if I want to climb a mountain I know somebody who has a pilot licence
<seanstickle> I just read the syntax and started programming.
<seanstickle> What are these koans?
<species> the internet
<species> you must DL them obviously
<robdodson> the koans are basically unit tests that you write in the browser
<species> in summary they teach ruby standard library and syntax stuff using unit tests
<robdodson> there's also rubymonk.com
<seanstickle> Huh
<species> im not using the browser version, im using the console version, but its the same thing
iamjarvo has joined #ruby
<seanstickle> Yeah, I don't get the whole ninja/monk/samurai/kung-fu master theme in young people programming these days.
<robdodson> i don't feel those tools are as effective as just trying to solve a problem yourself
<species> maybe thats the problem - im not a young people
<robdodson> i feel like it's unfocused teaching
<robdodson> maybe ;)
<seanstickle> Some sort of romantic sense of the past, or something.
Shagane has joined #ruby
<species> also ive never watched the full karate kid films start to finish
<seanstickle> I like that I am manipulating a complex number crunching machine
<seanstickle> I don't want to do fucking kung fu.
<robdodson> i think most of it stems from this: http://en.wikipedia.org/wiki/Hacker_koan
<seanstickle> And programming is not a secret discipline passed from master to student
<robdodson> the whole programmer koan thing goes way back
<robdodson> my old boss use to love these
<seanstickle> Ah, the 60s
<seanstickle> When the worst pop-Eastern philosophy came into the West
<seanstickle> Fortunately, I'm not a hippy, so I don't have to pretend to like pop-Eastern mysticism mixed with my programming.
<seanstickle> Feudal atavism.
<species> what is this ascii art actually a picture of? http://pastebin.com/cABHLa35
<rking> species: A flame, I figure.
<species> i thought that too but it has too much going on at the top
<seanstickle> A sumi-e circle
kevinbond has joined #ruby
mikeycgto has joined #ruby
davidpk has joined #ruby
fr0gprince_mac has joined #ruby
d34th4ck3r has joined #ruby
natemcguire has joined #ruby
natemcguire has joined #ruby
CannedCorn has joined #ruby
<d34th4ck3r> how to exit from ruby script ? stopping further ruby execution ?
iamjarvo1 has joined #ruby
<species> you say "exit"
<Sou|cutter> exit exitcode
RORgasm has joined #ruby
nlc has joined #ruby
Targen_ has joined #ruby
chico has joined #ruby
sirdeiu has joined #ruby
andrewhl has joined #ruby
<d34th4ck3r> thanks
nemesit|osx has joined #ruby
hobbyist has quit ["Leaving..."]
NinoScript has joined #ruby
paradoja has joined #ruby
m_3 has joined #ruby
kawa_xxx has joined #ruby
m_3 has joined #ruby
h4mz1d has joined #ruby
cmasseraf has joined #ruby
nixnub has joined #ruby
ZachBeta has joined #ruby
serpa has joined #ruby
zeroeth has joined #ruby
<serpa> could anybody help me with google charts and rails ?
sirdeiu has joined #ruby
nixnub has joined #ruby
shaggy2dope has joined #ruby
waxjar has joined #ruby
ceej has joined #ruby
rorymckinley has joined #ruby
MrGando has joined #ruby
iamjarvo has joined #ruby
fayimora has joined #ruby
<apeiros_> serpa: #rubyonrails
dwon has joined #ruby
<serpa> <apeiros_> #rubyonrails Cannot join channel (+r) - you need to be identified with services. What does mean ?
banjara has joined #ruby
Shagane has joined #ruby
Shagane has quit [#ruby]
Shagane has joined #ruby
Clordio has joined #ruby
wallerdev has joined #ruby
sbanwart has joined #ruby
<Seppman> serpa: it means that you have to identify with a service (like nickserv)
waxjar has joined #ruby
otters has joined #ruby
CheeToS has joined #ruby
<serpa> Seppman: thanks !
kevinbond has joined #ruby
<Seppman> you're welcome. Greetings from the republic of austria
odilon has joined #ruby
wilmoore has joined #ruby
Eldariof59-ru has joined #ruby
sonkei has joined #ruby
<apeiros_> the sepp man! :D netter nick
mxweas_ has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
Cache_Money has joined #ruby
nfluxx has joined #ruby
* Kovensky wonders if ther are any plans to add dynamic scoping to ruby, or D-like "on scope exit" blocks
<Kovensky> just happened to see http://pastie.org/3745443, and it's not thread safe and if it raises the ArgumentError it'll have unintentionally overwritten STDOUT.sync
<Kovensky> if it had dynamic scoping though, just doing "local STDOUT.sync = true" would take care of it (borrowing the 'local' keyword from perl)
<Kovensky> (would be thread safe and not affect anything called from outside benchmark's scope)
<apeiros_> Kovensky: pure curiosity here - do you have any link to docs/info on D-like "on scope exit"?
Teddy2steper has joined #ruby
<apeiros_> you might want to look at ensure, though
fowl has joined #ruby
<apeiros_> i.e., line 14 of your pastie should into an ensure block
<Kovensky> "on scope exit" is because I forgot the actual syntax, but lemme look up on dlang.org :v
<apeiros_> and I think you should do argument checking first, i.e. line 7 `raise ArgumentError, "no block" unless` should be the first line of the method
<apeiros_> but TIL iterator? is an alias of block_given?
<Kovensky> apeiros_: that's actually in 1.9.3's standard library (benchmark.rb)
<apeiros_> Kovensky: wow
<apeiros_> that's bad…
<apeiros_> that code isn't exactly great code :-S
Shagane has joined #ruby
__class__ has joined #ruby
<Kovensky> indeed :s
* apeiros_ wonders why there isn't a common error class for NoBlock
<apeiros_> i.e. NoBlockGiven < ArgumentError, then you can just `raise NoBlockGiven`
<Kovensky> seems ensure is equivalent to scope(exit)
<apeiros_> the ensure?
<apeiros_> ah, I should read properly
<apeiros_> yes, but you can't just put it anywhere
Shagane has joined #ruby
<Kovensky> oh, right
mxweas_ has joined #ruby
<apeiros_> at least you can put it in the toplevel of a method
<apeiros_> (def/end is an implicit begin/end)
<apeiros_> i.e.: def foo; dostuff; ensure; ensurestuff; end
<Kovensky> so, def method; ...; rescue; ...; end
<apeiros_> that works too, yes
<Kovensky> er, ensure
<Kovensky> rescue would eat the exception =p
<Kovensky> (reminds me of a rant I read a few days ago of how ruby doesn't use the standard try/catch/finally keywords)
<apeiros_> standard… by whom?
<apeiros_> there aren't cross-language standards… so whoever wrote it, earns a moron-stamp by me :-p
<Kovensky> C-like languages
<apeiros_> well, C itself doesn't have any exception handling at all, so the most-C-like language doesn't follow that "standard" either :)
<Kovensky> though I guess since ruby is mostly rooted on perl begin/rescue/ensure is still better than unless (eval {...}) {...}
<Kovensky> apeiros_: microsoft SEH uses __try / __catch / __finally :D
<apeiros_> you seem to have come around a couple of languages… professionally?
<apeiros_> Kovensky: eeeeeew
<apeiros_> __ usually means "damit, I just didn't have a better idea"
<Kovensky> and I haven't coded professionally yet, but I better do it sooner rather than later =p
exchgr has joined #ruby
tatsuya_o has joined #ruby
jacktrick has joined #ruby
<apeiros_> so how long have you coded as a hobbyist?
mdw has joined #ruby
ca_bud has joined #ruby
<Kovensky> ~10 years, on and off (more off than on, started reading about coding back in middle school)
<ca_bud> Are && and || valid operators in ruby? vs. "and" and "or" operators?
<otters> yes
<apeiros_> what do you mean by "valid"?
<Kovensky> if it's like perl, "and" and "or" have low precedence
<otters> well it is like perl
<apeiros_> and, or, //, && are all operators
<apeiros_> and yes, it's similar to perl wrt precedence
<Kovensky> ic
<Kovensky> does ruby have a // btw or was that typo of || :p
<Kovensky> +a
<apeiros_> meh, // was a typo
<apeiros_> should have been ||
<ca_bud> I'm using an if statement and using the && operator, but it does not give the expected result.
<apeiros_> it's on the same key here, just a different modifier…
<Kovensky> though I guess ruby's || works like perl's //
Drewch has joined #ruby
<apeiros_> ca_bud: pastie.org
<apeiros_> code, input, expected output, actual output
<ca_bud> I was googling and found a page that stated && was not a valid operator, which I thought was weird
<fowl> && isnt an operator
<fowl> + - / % these are operators
<d34th4ck3r> is there some nice and easy to auto-indent ruby in vim?
<apeiros_> fowl: you have the opposite definition of things than I then
<Kovensky> (in perl, "a // b" = "if a is not undef then a; otherwise b")
<apeiros_> + - / % aren't operators but methods in ruby
<d34th4ck3r> *nice and easy way
<fowl> they are still operators in ruby apeiros_
<apeiros_> whereas && etc. are operators (i.e., not methods but a language construct)
<apeiros_> fowl: following what definition?
<fowl> an operator can only take 1 argument
<apeiros_> ca_bud: you probably are having a precedence issue. use () to make it clear
<Kovensky> unrelated rant: the simple-rss gem isn't unicode-safe :(
<apeiros_> fowl: oh wow, you got that quite wrong
<apeiros_> fowl: take the ternary *operator*, it can take even 3 operands
sonkei has joined #ruby
<Kovensky> ended up using the builtin rss which is, but took a bit more effort to copy to my own data structures
<apeiros_> (which is why it is named ternary, after all…)
<fowl> ternary isn't an operator, its a language construct :p
<fowl> i'm here to split hairs
<apeiros_> fowl: yes, it is a language construct, and an operator
<apeiros_> you're splitting the hairs wrong, though :-p
<apeiros_> you could argue that + - etc. are operators, IMO they're not
<apeiros_> there's absolutely no argument however that &&, ?: etc. are operators
<otters> they're methods
<apeiros_> otters: correct, which is why I tend to not see them as operators in ruby.
<otters> are they operators in other languages?
<apeiros_> otters: sure
<otters> okay
<Kovensky> + and - are priviledged methods
<Kovensky> with their own precedence rules and other evil non-method-y things :E
<otters> syntactic sugar!
<Kovensky> (alternatively, force everyone to write in polish notation \o/)
<otters> which ruby is 30% of
ZachBeta has joined #ruby
<otters> there's magic everywheeeere
<ca_bud> now i'm getting undefined method `[]' for nil:NilClass. I'm assuming my model[table][f][:values].present? is returning nil and I can't call present on it. does this sound right? if so what is the fix?
<Kovensky> anything there could be nil
<Kovensky> model could be nil, model[table] could be nil, model[table][f] could be nil...
Morkel has joined #ruby
<fowl> you're 3 levels in and lost your way
<otters> you are in a maze of twisty index lookups, all alike.
<Asher> syntactic sugar = all language is
_|christian|_ has joined #ruby
<shevy> nice boobs = all what a man ever needs
<otters> possibly off topic
jgrevich has joined #ruby
<bounce> here, have some moobs
<ca_bud> what is the best way to handle the lookup? model[table] and model[table][f] should both be good. I know that values will sometimes be in the hash and sometimes not. I would like to test for that.
natemcguire has joined #ruby
<bounce> the best way is to check your assumptions
wroathe has joined #ruby
<ca_bud> I'll verify now
Russell^^ has joined #ruby
<shevy> what
<shevy> that code is flip-flopping
drake10 has joined #ruby
<shevy> like the schroedinger cat
<shevy> that beast can not decide whether it is dead or alive
Drewch has joined #ruby
<bounce> too many video games, I tells ya
drake10 has quit [#ruby]
<ca_bud> verified, model[table] and model[table][f] are both present
<shevy> bounce I miss the 1990s... I liked the video games back then more than today
<bounce> I haven't played a video game in ages. bsd-tris on a terminal was a favourite though.
<shevy> bounce did the modern days also lose you as gamer?
<ca_bud> that leaves the question of why model[table] and model[table][f] [:values].present? is not working. am I using the wrong test to test nil?
<shevy> fowl still plays games... he was lost to skyrim for some months
<shevy> ca_bud, that is really kinda ugly ... model[table][f] [:values].present?
RubyRedGirl has joined #ruby
<bounce> well, alright, there's this stupid little game on my secondary phone that is good for passing the time on the loo, but otherwise. supposedly written in java, so.
indeterminate has joined #ruby
<otters> ca_bud: when I'm having chained [] nil problems, I usually replace [] with fetch
io_syl has joined #ruby
serpa has quit [#ruby]
<ca_bud> fetch? i'll look it up now.
* bounce needs a new computer. maybe then there'll be games.
<shevy> bounce :(
<shevy> I gave up hope.
MrGando has joined #ruby
<otters> ca_bud: it's [], but raises an exception when it fails, and tells you what key it wanted
<fowl> lol shevy
<shevy> the tablet games are all super trivial and really just to pass ... 10-20 minutes
<shevy> but it's cool that you can turn it, and things respond to it being turned
<shevy> it's like a joystick with a big LCD screen :P
<bounce> could do something as quaint as install chess or go on it
<ca_bud> fetch is interesting, but it does not look like you can chain them.
<ca_bud> never mind.
<otters> it's a method
<otters> of course you can chain them
<shevy> haha I sometimes play online chess... but so far I always lost against human players. so now I beat artifical intelligence on the easiest levels
<ca_bud> I realized that last second. thanks
<shevy> you can chain pretty much... except for the foo! methods with those bang
<shevy> I still did not understand .tap though
<bounce> blame mr T
<shevy> it reminds me of magic the card game...
<otters> tap just calls the block and then returns the object
<shevy> hmm
<apeiros_> yupp, tap is basically: def tap; yield; self; end
<shevy> oh
<shevy> odd, that explanation I understand a lot better than the sentence :)
mdw has joined #ruby
<apeiros_> actually, I think it's: def tap; yield(self); self; end
kevinbond has joined #ruby
<apeiros_> would have to check that, though
mengu_ has joined #ruby
CannedCorn has joined #ruby
<shevy> ok that one confuses me a bit more again
<shevy> I dont think I've seen yield(self) so far either
<bounce> huh, two-and-a-half years dead channel, still around. fun.
<shevy> what is that
cpruitt has joined #ruby
<bounce> #jobs
RubyRedGirl has quit [#ruby]
wallerdev has joined #ruby
RubyRedGirl has joined #ruby
__class__ has joined #ruby
RubyRedGirl has quit [#ruby]
RubyRedGirl has joined #ruby
RORgasm has joined #ruby
JohnBat26 has joined #ruby
bglusman has joined #ruby
JohnBat26 has joined #ruby
<Kovensky> the yaml module's documentation is... underwhelming ._.
tommyvyo has joined #ruby
<shevy> Kovensky it is quite nice compared to
<shevy> IRB documentation
<shevy> !!!!!!
<shevy> but if you ask me, if I were matz, I would make a new rule
wroathe has joined #ruby
<shevy> there must be new standards for documentation. EVERY module that does not qualify, will be thrown OUT of std ruby distribution
fbernier has joined #ruby
<Kovensky> dbm's documentation is also underwhelming :v
<shevy> out with it!
<Kovensky> and all the documentation I found in the yaml module is that YAML::DBM has the same interface as DBM
<shevy> all out!
<shevy> ruby must stop being so lazy
<Kovensky> another annoying thing: you can't get ri to inline all the documentation
<Kovensky> you either have to use ri to query one method at a time, or have to use rdoc and a browser
<shevy> ah ri I dont mind
<shevy> I look at the online docu
<bounce> (this is where something like nroff wins)
<Kovensky> I thought ri was a perldoc equivalent but it's much, much more annoying :(
<Kovensky> perldoc loses in that it has no indexing inside documentation, but it's still less annoying than having to query method by method in ri
<bounce> "everybody has a browser anyway; browsers are the future" -- you just need to conform, you unconforming silly person, you
sbanwart has joined #ruby
<fowl> Kovensky, ri is gay
<fowl> it just is
cpruitt has joined #ruby
<fowl> use pry (http://pry.github.com/) and pry-doc
ZachBeta has joined #ruby
n1x has joined #ruby
greenarrow has joined #ruby
<Kovensky> I guess I can work with http://rubydoc.info/gems/yamlconfig/0.2.2/frames :v
<Kovensky> it'd be nice if the builtin yaml was usable at all though <_<
<rking> Kovensky: What's wrong with it?
<Kovensky> it has 0 documentation
<shevy> it is so good that it does not need any documentation
tar_ has joined #ruby
al3xnull has joined #ruby
<rking> Kovensky: Are you trying to do more with it than dump/load?
<Kovensky> I want to load and use it as a hash
<Kovensky> if loading fail, I want to dump a hash to a file
<Kovensky> just a simple config file
<Kovensky> +s
IPGlider has joined #ruby
Gesh has joined #ruby
<Kovensky> sth equivalent to the ugly perl in https://github.com/Kovensky/KADR/blob/master/kadr.pl#L37 (lines 37 to 73)
tomzx has joined #ruby
<rking> Kovensky: There's YAML.load_file and YAML.dump(obj, io_obj)
kevinbond has joined #ruby
<tar_> I've been naively casting []byte to string and it finally bit me when I started slicing the strings… what's the correct way to do that? I don't see anything in strings or unicode/utf8
cachoimechi has joined #ruby
RubyRedGirl has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
<apeiros_> tar_: I don't quite get what you were doing
<apeiros_> paste some code?
<tar_> hm
maletor has joined #ruby
<apeiros_> I assume you have an array of bytes, but bytes in what representation? integers in 0..255? single character strings?
<apeiros_> also, you didn't specify *how* and *what* bit you
<tar_> actually, sorry, I used to handle the []bytes directly. Now I'm unmarshaling JSON into a struct with a string field.
<tar_> slicing like str[4:5] doesn't seem to account for multi-byte characters
cpruitt_ has joined #ruby
h4mz1d has joined #ruby
<apeiros_> tar_: []bytes is not really a terminology used in ruby
<tar_> holy cow, this is totally the wrong window
<apeiros_> tar_: you sure you're in the right channel?
<tar_> mua ha ha, I missed a hotkey
<apeiros_> str[4:5] isn't ruby either
<tar_> sorry about that
<apeiros_> python?
<tar_> Go :)
<apeiros_> aha
<tar_> well, in case anyone is curious, I needed a cast to []rune: http://play.golang.org/p/lptxq5FCnw
harryk has joined #ruby
Drewch has joined #ruby
simao has joined #ruby
yoklov has joined #ruby
tomzx has joined #ruby
<shevy> hey is that chinese
savage- has joined #ruby
berserkr has joined #ruby
<shevy> hey matti ... rtorrent confuses me
johndbritton has joined #ruby
<shevy> how do I quit?
<shevy> oh... strg+q
EvanR has joined #ruby
tomzx has joined #ruby
<fowl> strg+q let me guess strg is short for straussbegaussen?
<shevy> fowl hehehe not sure
<shevy> I think it is the control key
<shevy> "Steuerung" Strg
<fowl> ich bin ein verdammter idiot
<bounce> na klar
<harryk> is this channel of Ruby language or German language? )
<shevy> fowl is learning a new language
<shevy> I want Mon_Ouie to teach me french
<fowl> shevy, my favorite german word is einige
<shevy> hmm
<shevy> that's "several" ... or "a few" ...
<Mon_Ouie> Qu’oie-je ?
jarred has joined #ruby
<harryk> mine is schwein ))
<bounce> should do a thorough german localisation of ruby
<ca_bud> I have a string for a model name and I would like to use that string to create a record. e.g. "mymodelname".create(:name=>1234). is there a way to do this?
<ca_bud> meta-programming.
<harryk> ca_bud: 'create' should be a method of String class - in this case your code is right i think
<ca_bud> harryk: so your saying that Mymodel.create is equal to "Mymodel".create?
<ca_bud> I don't think that is right
<fowl> you said "mymodelname".create
<ca_bud> harryk: this might be a better example Mymodel.first vs "Mymodel".first, I need some method to convert my string into a model
<fowl> wtf is a model, this is a rails question?
<shevy> a model is a young, beautiful woman who is always on the verge of dying from hunger
<ca_bud> oops! sorry, I thought I was in the rubyonrails IRV
<ca_bud> IRC
<ca_bud> my mistake
<bounce> expert in the art of dying beautifully from hunger
<species> ive actually had sex with a model and she wasnt actually that good
<Kovensky> can a hash's each / each_key / each_value modify the hash in-place?
<species> being skinny can be problematic, to a point
<bounce> ca_bud: term of art is "channel"
<ca_bud> thanks, gtk
<harryk> species: plump girls rule :))
<species> not necessarily "plump" but I like a bit of meat on those bones
Synthead has joined #ruby
<shevy> yeah
<shevy> land whales
<fowl> Kovensky, did you try it? I got no warnings
<Kovensky> fowl: thinking about it a bit showed that I can't do what I thought about doing with it :X
<harryk> when i hear a word 'meat', i imagine a peace of bloody beef ))))
<Kovensky> (to_sym all the keys)
<fowl> Kovensky, hash = Hash[hash.map { |k,v| [k.to_sym, v] }]
<Kovensky> yeah, but recursive
nemesit has joined #ruby
<Kovensky> I already wrote it though; just wiring it into the code so I can test
<fowl> def symbolify(h) Hash[h.map { |k,v| [k.to_s, v.is_a?(Hash) ? symbolify(v) : v] }] end
EvanR has joined #ruby
<Kovensky> it was pretty much that too :P
CannedCorn has joined #ruby
<fowl> you shouldnt internalize a bunch of strings if they come from user input though
<Kovensky> but with to_sym instead of to_s
<fowl> yea that was my fowl (haha)
_ramo has joined #ruby
<Kovensky> well, it's the yaml file I was reading to begin with :>
proxie has joined #ruby
<Kovensky> need the keys in order to do processing in it
<Kovensky> (have to find keys with certain names, compile regexps, etc)
<Kovensky> (it's the user's fault if he has duplicates in the same scope!)
<fowl> its not about duplicate keys
<fowl> symbols are never garbage collected, so if i see you interning strings from users im going to flood it with gibberish until it runs out of memory
<Kovensky> lol
<fowl> then im going to sit back and drink a nice cup of hot chocolate
<Kovensky> it's a config file, if it has enough content to OOM the computer it has enough contet to... inconvenience the user =p
Bosma has joined #ruby
<Kovensky> a proper config file also doesn't have many unique strings
<fowl> try this btw YAML.load"hi: a\nhi: b\nhi: c"
<Kovensky> I count... 9 in the current format (assuming well-formed)
tobago has joined #ruby
<Kovensky> fowl: sounds evil :P
<Kovensky> assuming YAML reads strings as strings though you'll get three "unique keys" "hi"
<fowl> why would you assume that crazy behaviour lol
<Kovensky> hm, I also have hashes inside arrays inside hashes :S
* Kovensky expads symbolify
<Kovensky> +n
Foxandxss has joined #ruby
<fowl> {'hi' => 'a', 'hi' => 'b', 'hi' => 'c'} just leaves you with {'hi' => 'c'}
tommyvyo has joined #ruby
bluOxigen has joined #ruby
<Kovensky> it grew a little but: http://pastie.org/3746191
Kireji has joined #ruby
<fowl> you should keep it 1 linue
<Kireji> is there a place where I can post a bounty for a script I want written? it's simple, I just don't have time to do it
<fowl> limen*
<fowl> LINE*
<Kovensky> fowl: nah, not playing ruby golf :P
<Kovensky> not yet at least
<Kovensky> also, I keep writing "done" after "do" blocks ._.
<fowl> lol
<fowl> if you use 'then' you dont have to use semicolons, this is valid: if false then :a elsif poo then :b else if somethingelse then :c else :d end end if true
<fowl> note the postfix if, for posterity
Eldariof27-ru has joined #ruby
noyb has joined #ruby
<Kovensky> oh, so it supports that syntax?
<canton7> puts "Yes, it does" if true
<Kovensky> puts "cool" until false
josefig has joined #ruby
josefig has joined #ruby
weszlem has joined #ruby
ryanf has joined #ruby
<weszlem> Hi, i want to start reading ruby source code. Are there any articles like quake 2 source code review (http://fabiensanglard.net/quake2/index.php) that can help begginers?
jfelchner has joined #ruby
<weszlem> *beginners
Pavel has joined #ruby
Teddy2steper has joined #ruby
<josefig> weszlem: I don't think so
<weszlem> josefig: maybe you know then, how can i start reading the code? i mean - where to start?
francisfish has joined #ruby
RORgasm has joined #ruby
<josefig> weszlem: that's a very abstract question, what I did when I started was, open the ruby docs on one side and the code on the other side, so I was reading and when I didn't know anything, I went to the ruby docs and understand first the syntax and everything , so I continued reading ;>
<josefig> But really, is up to you.
<weszlem> josefig: thank, i'll try that. maybe it will be easier to start with rubinius source code..
sacarlson has joined #ruby
joaoh82 has joined #ruby
<josefig> weszlem: well, you can try that ;)
<banseljaj> weszlem: You can try finding stuff on github
mxweas_ has joined #ruby
dfamorato has joined #ruby
Drewch has joined #ruby
strife25 has joined #ruby
ca_bud has quit [#ruby]
looopy has joined #ruby
baniseterfiend` has joined #ruby
nif has joined #ruby
fayimora has joined #ruby
timonv has joined #ruby
fayimora_ has joined #ruby
headius has joined #ruby
rking has joined #ruby
rking has joined #ruby
fayimora has joined #ruby
Synthead has joined #ruby
Zolrath has joined #ruby
zmoazeni has joined #ruby
fbernier has joined #ruby
_ramo has quit [#ruby]
emmanuelux has joined #ruby
igotnolegs has joined #ruby
ZachBeta has joined #ruby
Clordio has joined #ruby
morelikefmb has joined #ruby
rking has joined #ruby
rking has joined #ruby
morelikefmb has quit [#ruby]
looopy has joined #ruby
phinfonet has joined #ruby
mbriggs has joined #ruby
d2dchat has joined #ruby
Teddy2steper has joined #ruby
davidd___ has joined #ruby
species has joined #ruby
Teddy2steper has joined #ruby
baniseterfiend` has joined #ruby
nif has joined #ruby
yelvert has joined #ruby
kevinbond has joined #ruby
looopy has joined #ruby
davidcelis has joined #ruby
phinfonet has joined #ruby
phinfonet has joined #ruby
rckts has joined #ruby
jfelchner has joined #ruby
Teddy2steper has joined #ruby
pedrohenrique has joined #ruby
CannedCorn has joined #ruby
timonv has joined #ruby
phinfonet has joined #ruby
d34th4ck3r has joined #ruby
phinfonet has joined #ruby
phinfonet has joined #ruby
phinfonet has joined #ruby
phinfonet has joined #ruby
NinoScript has joined #ruby
maletor has joined #ruby
phinfonet has joined #ruby
kawa_xxx has joined #ruby
NinoScript has joined #ruby
seanstickle has joined #ruby
wilmoore has joined #ruby
zeroeth has joined #ruby
moshee has joined #ruby
hooper has joined #ruby
zemanel has joined #ruby
mythmon has joined #ruby
kevinbond has joined #ruby
kevinbond_ has joined #ruby
dfamorato_ has joined #ruby
* Kovensky shakes fist at MatchData raising exceptions on #[String] if the requested named capture doesn't exist
<Kovensky> kinda annoying to deal with when the regexps are user-controlled :S
<shevy> I hate users
<shevy> they are like a hungry horde of hippos
cachoimechi has joined #ruby
mikeric has joined #ruby
tentimes has joined #ruby
thone has joined #ruby
<apeiros_> Kovensky: Regexp#named_captures is your friend
<tentimes> Hi folks - does anyone know what the state of affairs is with WxWidgets on Ruby? I see the last version of WxRuby is 2009 and am wondering is it worth using?
drake10 has joined #ruby
<Kovensky> apeiros_: I'm using names
<apeiros_> Kovensky: ah, sure, that works too
<apeiros_> even better, if all you need is the names
<shevy> tentimes, I think it is dead
<shevy> most ruby toolkits are dead
<Kovensky> but yeah, I have to do match.names.any?{|x| x == key} checking for every access...
looopy has joined #ruby
<apeiros_> Kovensky: meet Array#include?
<apeiros_> also, if I knew what you do I could probably show you even more elegant solutions
<apeiros_> e.g. Array's set methods might be of interest to you (&, |, -)
<Kovensky> < apeiros_> Kovensky: meet Array#include? <-- true, lol
<Kovensky> still needs checking :v
<tentimes> How come most Ruby toolkits are dead? That's worrying?
mikeric has joined #ruby
<apeiros_> tentimes: Errno::ETOOLITTLECONTEXT
frishi has joined #ruby
<shevy> tentimes I think that has several reasons
<shevy> the www is a big one
<shevy> then there are not that many users out there :(
<shevy> also, some, like fxruby were a one-man project
<Kovensky> apeiros_: well, I just put all the named captures I expect in a %w and put the check inside that each loop
<shevy> most one-man projects will eventually fade into death
<shevy> see _why
cachoimechi has joined #ruby
<apeiros_> shevy: feeling like jonah?
<shevy> what is a jonah? is that the one who caught the fish in the bible?
<apeiros_> Kovensky: you definitively should check the set methods then
<apeiros_> check = regex.names & expected
<shevy> tentimes, I used ruby-gtk a lot ~3 years ago. I am still using it now and then, but I am no longer ... enthusiastic about it
<shevy> I blame the www
<shevy> just look at the rise of javascript
<shevy> I am gonna say it... it'll surpass php in a few months
<Kovensky> apeiros_: so (%w{...} & match.names).each { |w| ... } without worrying inside the each? =p
<apeiros_> Kovensky: yes
<apeiros_> for code clarity, I wouldn't put the literal there, though. use a constant or whatever.
d2dchat has joined #ruby
shaggy2dope has joined #ruby
kmurph79 has joined #ruby
neersighted|AFK has joined #ruby
<Kovensky> hm, you know code is gtting dense when you have ]]]]
<Kovensky> getting*
<shevy> hmm
<shevy> that's a lot of ]
adamkittelson has joined #ruby
zeroeth has joined #ruby
yoklov has joined #ruby
<apeiros_> Kovensky: writing all code on a single line is not compulsory in ruby…
<apeiros_> local variables are a nice thing
<Kovensky> apeiros_: it's more like nested hashes
<tentimes> Surely Ruby is on the up-and-up though? I would much rather write something in Ruby, but I suppose javascript is good for web stuff
phinfonet has joined #ruby
RORgasm has joined #ruby
<shevy> tentimes well... ruby could still gain some folks, but javascript that is instantly available for ALL who go to the www
<Kovensky> apeiros_: and the hash's index is given by another hash access and so on
<apeiros_> Kovensky: deeply nested primitive datastructures too are a code smell
<shevy> I mean you only have to look at how crappy PHP yet it is more popular than ruby still
<apeiros_> proper classes ftw.
<tentimes> wel Rails (am I allowed to say Rails in here? ;) is catching up on PHP
<tentimes> I am writing my new server side stuff in rails having made a last minute change from deciding to use PHP
<tentimes> Hence me learning Ruby
<tentimes> Ruby is addictive though
<Kovensky> apeiros_: this is actually a throwaway structure used for sorting and discarding of suboptimal elements ._.
<tentimes> I had to spend some time today going through Kernel stuff in C and then the wrappers in C++, and omg is Ruby so much nicer to work in...
<Kovensky> though in truth I'm just making up this filtering method as I go :P
<apeiros_> shevy: I don't know, I looked at TIOBE for a long time… but… an index where logo (ffs, that's not used anywhere but introduction of total noobs) is in front of actually used pervasively used languages like ActionScript (flash)
h4mz1d has joined #ruby
ckrailo has joined #ruby
<shevy> hmm
<apeiros_> Kovensky: "this is just…" is how most fundamentally broken software starts :-p
<shevy> odd... going to find out about logo
<apeiros_> (all too often the second part reads: "…a rough prototype")
<Kovensky> apeiros_: well, quick overview of what I want to do:
<Kovensky> I have a name, a version and a revision
<apeiros_> Kovensky: oh, hey, hey, it's your code
<apeiros_> I'm just blabbering old knowledge :-)
jfelchner has joined #ruby
<Kovensky> I want to keep all name+versions I have, but only keep the name+version pairs that have the highest revision
<Kovensky> nah, it's just that there's probably a better way to do this :P
brngardner has joined #ruby
<apeiros_> Kovensky: code and sample in & output is better for that than explaining
<apeiros_> I can read code much better than peoples explanations :-p
eam has joined #ruby
brngardner has joined #ruby
poorlilrichboy has joined #ruby
flaggy has joined #ruby
Kireji has joined #ruby
PsiliPharm has joined #ruby
derpmcherp has joined #ruby
<Kovensky> :p
<Kovensky> I need to make a sample set...1
davidpk has joined #ruby
derpmcherp has quit ["Leaving"]
RangerMauve has joined #ruby
williamcotton has joined #ruby
<RangerMauve> Hey, does anyone know if WEBrick can use ERB files?
<ryanf> RangerMauve: webrick is just the web server, it doesn't know anything about where the content comes from
<RangerMauve> Er, let me rephrase then. Can it process erb files?
<ryanf> if you want to make a simple app with templates, sinatra is probably your best bet
<RangerMauve> Well I already have something going with making WEBrick servlets, but I want to simplify it more
max_ has joined #ruby
delinquentme has joined #ruby
nixnub has joined #ruby
<Kovensky> apeiros_: http://pastie.org/private/wqvsnx7eb6q3vqxxcsawa <-- the challenges are: not everything has an ep, and not everything has a ver
<delinquentme> in flow control statements in ruby ... ONLY the first conditional which matches a statement is matched
<delinquentme> correct?
<Kovensky> apeiros_: oh, and the output hashes are expected to be the same instances as the input hashes :X
<Kovensky> ...Enumerator#max_by sounds useful
* Kovensky goes do some refactoring
shadoi has joined #ruby
aj910martin has joined #ruby
looopy has joined #ruby
aj910martin has quit [#ruby]
natemcguire has joined #ruby
phinfonet has joined #ruby
kmurph79 has joined #ruby
kidoz has joined #ruby
<apeiros_> Kovensky: is it just me or did you forget to paste the code?
* Kovensky wonders if `hash[key] ||= value_if_key_does_not_exist` is idiomatic
<apeiros_> it is
<Kovensky> apeiros_: true, said code is also unfinished ._.
<apeiros_> though technically it assigns also if hash[key] exists but has a value of nil or false
<Kovensky> http://pastie.org/private/7x29j6swxgihr8j4emg5q <-- is what I still have there (the refactor I'm doing is first on the code that calls sanitize)
yoklov has joined #ruby
<ryanf> %{:ep :endep :ver} == ":ep :endup :ver"
<ryanf> *endep
nif has joined #ruby
Floydzy has joined #ruby
pu22l3r has joined #ruby
<Kovensky> indeed, bad typo...
adhominem has joined #ruby
<Kovensky> (I didn't actually test that code)
<Kovensky> it should've been obvious on the syntax highlight too <_<
<adhominem> with TCPServer.accept I can get new sessions, test their IP, and then possibly close them
pu22l3r has joined #ruby
<adhominem> I'm looking for a way to avoid accepting certain IPs in the first place
<canton7> adhominem, your firewall?
<tentimes> There is a c module for that that I had to include in nginx to do with GeoIP
<adhominem> sorry; a way to do it in ruby
<tentimes> If you can get the IP, the GeoIP module and the database it uses, it might help
<adhominem> like TCPServer.blacklist .. but I don't see that method
<tentimes> I doubt there is a direct way
<adhominem> yeah
<adhominem> looking for an indirect way still in ruby
<adhominem> lol
<apeiros_> Kovensky: when you don't use the return value of .map, then you really want .each, not .map
<tentimes> Unless you can find a portal that will give you the GeoIP location from an IP?
<tentimes> IT's not totally straightforward
<tentimes> An IP does not map easily to a location
<adhominem> like say i just want to never accept connections from 155.155.155.155
<adhominem> yeah that's okay
pu22l3r_ has joined #ruby
<tentimes> ahh sorry
<adhominem> i just want to avoid accepting connections from a random IP at all in ruby
<tentimes> I'm sure there is a way to mask the IP
td123 has joined #ruby
Sailias has joined #ruby
<Kovensky> (geoip blocks are evil and you should feel ashamed for teaching other people how to do it)
<tentimes> but sorry, I have not done that yet in Ruby
<apeiros_> Kovensky: so the first list of input-hashes aren't really hashes but match-data objects?
* Kovensky runs
<tentimes> I block out all of Russia, China and a lot of other countries automatically from my website. Reduced DDOS and Spam 97%
<Kovensky> apeiros_: the list is an array of objects that have already been approved by regexps, and the regexp's MatchData is stored in the match accessor
adhominem was kicked from #ruby by apeiros_ [don't cross-post]
<tentimes> DOn't cross post? lol
<Kovensky> in this refactor though I have already changed the code to do the MatchData parsing in the regexp code itself (where it belonged in the first place) and stuff the available names in a hash
Synthead has joined #ruby
<apeiros_> tentimes: yes. I'm sick of assholes who think it's ok to waste peoples time.
<Kovensky> and also to initialize the integer elements with -1 if nil
<tentimes> ah - I obviously didnt see what else he had done
<apeiros_> tentimes: cross-posted. as the kick-reason says.
mengu_ has joined #ruby
<tentimes> What's the data structure?
<tentimes> I mean, is it all ints?
<tentimes> (sorry that was @Kovensky)
<tentimes> I used to program in assembler. If you imagine how the datastructure is eventually going to be accessed (and how well that compiles down) I find that makes as much sense as the method sometimes
<Kovensky> no, some of them are strings; but out of them only :name is relevant (the idea is to sort by :name, sort that list internally by :ep, then sort that list internally by :ver and only keep the one with the highest :ver)
<Spaceghostc2c> I know some assembly on the x86 architecture!
<tentimes> And is it in memory or in a database?
<flaggy> yay!
fbernier has joined #ruby
keymone_ has joined #ruby
keymone has joined #ruby
<Kovensky> tentimes: in memory
<Kovensky> anyway, rephrasing that in my mind helped come by with a different approach
<Kovensky> I have [:name, :ep] pairs that must be unique; in case of duplicates, they are deduplicated by keeping only the one with the highest :ver
<Kovensky> keeping the one with the highest :ver is made easier by Enumerator#max_by
<apeiros_> Kovensky: using a proper class would help with that
<apeiros_> you could use it as a hash key
<apeiros_> makes it easy to check whether a name/ep pair already exists
<apeiros_> you could also implement <=> properly, so figuring the newest would be easy as well
<Kovensky> ...indeed
<Kovensky> (wrt using that pair as hash key)
<apeiros_> (<=> + Comparable)
<Kovensky> I keep forgetting Hash can use any object, not just string
codezombie has joined #ruby
<Kovensky> apeiros_: the class that encapsulates that data actually includes Comparable, but uses <=> for a different purpose
<Kovensky> (sorting by :id)
<apeiros_> also it'd help you with properly arranging code. i.e. make a class method to parse the input string and create an instance from it
<apeiros_> so: valid_versions = strings.map { |string| VersionThingy.from_string(string) }.compact
<apeiros_> by_name_and_ep = valid_versions.group_by { |version_thingy| version_thingy.name_and_ep }
Jimchaos has joined #ruby
<Kovensky> hmm
<apeiros_> then map it to get only the newest ones: by_name_and_ep.each_value.map { |versions| versions.max }
<apeiros_> voilà
<apeiros_> proper classes ftw.
derpmcherp has joined #ruby
ScottNYC has joined #ruby
<irmbrady> Any Jekyll users about?
danielvdotcom has joined #ruby
<Kovensky> I'll just ad a new class that < Hash that I can use for the match data (instead of dumping them on a Hash)
<Kovensky> and then include Comparable and do the <=> impl
<apeiros_> o0
<apeiros_> keys don't need to inherit from Hash
<apeiros_> they must implement #hash and #eql? properly
<Kovensky> oh, not keys
<Kovensky> the container itself
<apeiros_> I don't see what that'd give you
<Kovensky> (or, rather the values)
Synthead has joined #ruby
gregorg has joined #ruby
gregorg has joined #ruby
ben225 has joined #ruby
strife25 has joined #ruby
derpmcherp has joined #ruby
derpmcherp has quit ["Leaving"]
ceej has joined #ruby
gloomer has joined #ruby
ca_bud has joined #ruby
Drewch has joined #ruby
tatsuya_o has joined #ruby
chico has joined #ruby
<ca_bud> Can someone help me with the code to insert a block of text into an existing text file? I don't want to append, I actually want to insert the text after the 3rd line and move all other text down.
prometheus has joined #ruby
<burgestrand> ca_bud: you rewrite all of the file from that line you want to change
Squarepy has joined #ruby
<ca_bud> burgestrand: can you recommend any reference material to show to do it?
<burgestrand> ca_bud: no, sorry
Squarepy has joined #ruby
<ca_bud> thanks, I will give it a read along with more googling.
_ack has joined #ruby
x77686d has joined #ruby
nixnub has joined #ruby
wefawa has quit [#ruby]
STP has quit [#ruby]
<Kovensky> apeiros_: by making e.info an instance of an Info < Hash class that implements hash as [self[:name], self[:ep]].hash and an appropriate <=>, I made sanitize() be:
gurugeek_ has joined #ruby
<Kovensky> name_and_ep = {}
<Kovensky> map{|e| e.info}.compact.each {|i| (name_and_ep[i] ||= []) << i}
<Kovensky> name_and_ep.values.map{|x| x.max_by {|i| i[:ver]}}.compact.sort
<Kovensky> ...though that max_by probably can be just a max, and that last compact is unecessary...
<gurugeek_> hello is anyone here doing some freelancing interested in a paid project ?
<apeiros_> Kovensky: hm, ok, not what I'd do, but well. don't forget to implement eql? accordingly.
<Kovensky> apeiros_: I made eql? just [self[:name], self[:ep]] == [other[:name], other[:ep]]
<Kovensky> (IIUC eql?'s contract correctly)
SeySayux has joined #ruby
lewis has joined #ruby
<lewis> for those who do not use ruby for ror, what else do you use it for
<canton7> sinatra, general shell scripting, anything other people use python/perl/bash for
<chico> ^ dis
<chico> plus, sysadmins use chef/puppet
<lewis> canton7: : general shell scripting, for example?
strife25 has joined #ruby
<Kovensky> the most "ror" I've written in my life has been a dvorak typo of "lol" ._.
<lewis> So not many people use it to build finish product
<canton7> lewis, bits and bobs on my server, monitoring stuff mainly
<lewis> products* , or with macruby
<Kovensky> ('r' is exactly to the left of 'l' in dvorak)
<canton7> lewis, also written a rather nice backup program in ruby, which I use
<lewis> canton7: i meant a program of the dimension of what people write with c, c++, java...
<canton7> and other little projects, which have ended up with a finished product
<canton7> oh, no
<lewis> yet ruby is fully capable to do so, no? is it a lack of libraries?
<canton7> like python, or other scripting languages, I don't think it would work too well with an application of that size. Mainly because of performance and lack of static typing
derpmcherp has joined #ruby
<lewis> canton7: ruby is more than a scripting language
<canton7> I guess there's JRuby -- I've no idea whether anyone's used it for anything enterprisy
<Kovensky> aww, Enumerable methods return standard Arrays instead of my extended objects :(
derpmcherp has quit [#ruby]
<lewis> canton7: what's static typing
<lewis> canton7: what about macruby..
<canton7> lewis, http://en.wikipedia.org/wiki/Type_system#Static_typing . In essence, data types are defined at compile-time. Methods return one sort of data type; variables can't change between data types, etc
derpmcherp has joined #ruby
strife25 has joined #ruby
sohocoke has joined #ruby
andrewhl has joined #ruby
tatsuya_o has joined #ruby
natemcguire has joined #ruby
<Kovensky> apeiros_: after fixing my blatant error (I wasn't conserving the e in e.info but instead returning the "e.info"s), it works :3
<Kovensky> I fixed the "Enumerable methods always return Array despite my class extending it" thing by using the copy constructor
RORgasm has joined #ruby
<gurugeek_> RORgasm?
<gurugeek_> WTF ?
<shevy> Propaganda.
<canton7> fanboyism
<shevy> lewis I use ruby for every computer related problem I have since almost 8 years
* gurugeek_ shakes head
<_ack> I use Ruby (irb) at least one a week to calculate how much everyone in the office has to pay for the sushi delivery.
<_ack> once*
<shevy> hmm
<shevy> you didn't write a class yet?
<shevy> class Sushi ... or class SushiDelivery ...
josefig has joined #ruby
josefig has joined #ruby
<shevy> and are your calculations always correct? ;)
fixl has joined #ruby
Axsuul has joined #ruby
<matti> ;]
weregh0st has joined #ruby
d2dchat has joined #ruby
weregh0st has quit [#ruby]
<delinquentme> quick way to generate an array of a-z?
<davidcelis> ('a'..'z').to_a
<delinquentme> @_@
<delinquentme> damn.
<davidcelis> yep
<davidcelis> Range, motherfucker