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
<shevy> man
<shevy> there are a lot of ` characters here
looopy has joined #ruby
llaskin has quit [#ruby]
chico`` has joined #ruby
moshee has joined #ruby
zakwilson has joined #ruby
strife25 has joined #ruby
mikepack has joined #ruby
ctwiz has joined #ruby
QaDeS_ has joined #ruby
banisterfiend has joined #ruby
bitsquad has joined #ruby
snip_it has joined #ruby
brngardner has joined #ruby
UsmanA has joined #ruby
snip_it has joined #ruby
zakwilson_ has joined #ruby
shevy has joined #ruby
igotnolegs has joined #ruby
pedm has joined #ruby
pdtpatr1ck has joined #ruby
hSATAC has joined #ruby
banisterfiend has joined #ruby
bawer has joined #ruby
looopy has joined #ruby
nif has joined #ruby
garyDemilo_afk has joined #ruby
banisterfiend has joined #ruby
pygmael has joined #ruby
jwang has joined #ruby
GitNick has joined #ruby
__main__ has joined #ruby
mbriggs has joined #ruby
alexonthemoon has joined #ruby
tommyvyo has joined #ruby
<alexonthemoon> hey guys, I'm trying to run a pretty simple script: http://pastebin.com/fdUZD8QR ; problem is, in between line 41 & 45, it just randomly submits the form. Was wondering if anyone has had this problem
<alexonthemoon> in general
rramsden has joined #ruby
<alexonthemoon> any help, guys? :(
<banisterfiend> alexonthemoon: rails?
<alexonthemoon> banisterfiend: nope, just a ruby script
Boohbah has joined #ruby
BrianE has joined #ruby
<alexonthemoon> banisterfiend: I'm trying to print out the keyword, council, question to a form & click submit myself
<alexonthemoon> banisterfiend: only problem is, it's submitting the question itself right after it enters in the question, keyword & council in steps 40-43
v4n_ has joined #ruby
prometheus has joined #ruby
<GitNick> Iam trying to build a native extension for windows. I have it working on mac, but for some reason I can't get the extconf.rb find_library call to recoganize the lib. Heres a gist: https://gist.github.com/2440705
adamkittelson has joined #ruby
mistergibson has joined #ruby
<banisterfiend> GitNick: afaik you dont like against .dll files
<banisterfiend> link
nif has joined #ruby
<mistergibson> Question: with respect to file modes: is it ultimately a question of either text or binary mode? if binary is not specified, is it automagically going for a text mode variation?
Clordio has joined #ruby
<banisterfiend> GitNick: the dll file is there to dynamically load at runtime, but iirc, you dont link against it during teh compilation process on windows
<GitNick> banisterfiend: hmm
mrwalker has joined #ruby
<banisterfiend> GitNick: unlike linux, it's not just a single .so that you both link against and load at runtime, there's like a two pronged approach on windows where you link against one library (i think it's a .lib but im not sure) and then at runtime you also need the .dll
<banisterfiend> GitNick: also, i would be using $CFLAGS and $LDFLAGS to setup the load path
<GitNick> banisterfiend: ok, that may help. I do see that in the same place as the dll, i have a .lib as well
uris has joined #ruby
<GitNick> (you can probably tell this is my first ruby ext) :)
<banisterfiend> GitNick: windows is a pain
<banisterfiend> GitNick: but if u can it's best to distribute precompiled binaries as some windows users dont have devkits installed
<GitNick> I was trying to to cross-compilation on my mac with rake-compile, but I couldn't get past compiling a windows ruby, rake-compile cross-ruby.
<banisterfiend> GitNick: persist with that approach
<banisterfiend> building on windows is even more of a pain
<GitNick> banisterfiend: you really think cross compilation would be better? I wouldn't mind because then I could keep all my development on my dev machine
savage- has joined #ruby
kil0byte has joined #ruby
<banisterfiend> GitNick: Yeah, much better. If your'e having problems with rake-compiler consider filing issues on the git repo
<banisterfiend> or i think there's a mailing list
adamkittelson has joined #ruby
<GitNick> banisterfiend: The compiler error I got looked like a bug in gcc
<GitNick> banisterfiend: ok, thanks
marknyc has joined #ruby
nif has joined #ruby
fbernier has joined #ruby
banister_ has joined #ruby
pygmael has joined #ruby
SolarisBoy has quit [#ruby]
rdjenk has joined #ruby
rdjenk has quit [#ruby]
thams has joined #ruby
banister_ has joined #ruby
quest88 has joined #ruby
zakwilson has joined #ruby
sroy2_ has joined #ruby
__class__ has joined #ruby
thams has joined #ruby
radic_ has joined #ruby
<mistergibson> Question: with respect to file modes: is it ultimately a question of either text or binary mode? if binary is not specified, is it automagically going for a text mode variation?
<banister_> mistergibson: file modes are abstract concepts they dont really need or appreciate any respect you want to show them
ryan_dev70 has joined #ruby
<mistergibson> banister_: it is not all that -- I want to determine the *exact* way ruby deals with it w/o inspecting the ruby source code ...
<mistergibson> laziness mostly
<banister_> mistergibson: what about reading ruby docs
sifue has joined #ruby
<mistergibson> oh, right -- like I never think of that. Reading ruby docs often turns out to be like playing poker with a chinaman that can drink you under the table and never piss. YES -- it really is that vague or limited sometimes.
<mistergibson> that is where I find the community collected wisdom or knowledge is far more comprehensive than the rather inadequate docs
<mistergibson> I've read the docs, the class rdocs, etc ... it has information but it does not characterize certain things
ben_alman has joined #ruby
zakwilson has joined #ruby
brngardner has joined #ruby
pygmael has joined #ruby
nif has joined #ruby
elliot__ has joined #ruby
sifue has joined #ruby
rexbutler has joined #ruby
zakwilson_ has joined #ruby
ananthakumaran has joined #ruby
<mistergibson> shevy: thanks
<shevy> I think 90% of the time folks will use only w, w+, a or a+
<shevy> hmm
<shevy> perhaps even the + versions 90%. I cant remember when I last used the non + variants
<mistergibson> shevy: I wonder then, what is the diff between 'r' on linux, and 'br' on winderz?
youdonotexist has joined #ruby
<mistergibson> the appear to be the same
<shevy> No idea. I don't really use it. You want to read in a file? I usually just call File.readlines('bla.txt')
ctwiz has joined #ruby
<heftig> you should really use "b" when writing or reading binary data
<heftig> since ruby 1.9 it also sets the encoding to binary
<mistergibson> heftig: even on linux?
<heftig> yes.
<mistergibson> heftig: ok, that actually makes me feel better
<mistergibson> shevy, heftig: thanks for your help on clarification -- I got it now :)
zakwilson has joined #ruby
pygmael has joined #ruby
Crazyglue has joined #ruby
<shevy> heftig is the 300 pounds ruby gorilla
<shevy> when it comes to ruby, he breaks it and knows it
<mistergibson> nice
<shevy> even zenspiders shuts up when heftig talks
<heftig> i'm not that good :p
<mistergibson> heftig: if no 'b' is specified, will the 'r' also silently imply or use 't' ?
<heftig> no b means text mode
<mistergibson> heftig: I understand
<shevy> mistergibson, I am surprised file modes keep you fascinated for so long ;)
<mistergibson> shevy: I'm odd that way
<mistergibson> shevy: I started in computers when a seller's manual actually included the phase latch specs in the docs ... I've been like that ever since.
ctwiz has joined #ruby
Crazyglue has quit [#ruby]
kaneda has joined #ruby
rushed has joined #ruby
dv310p3r has joined #ruby
looopy has joined #ruby
TheIronWolf has joined #ruby
luckyruby has joined #ruby
andrewhl has joined #ruby
ringotwo has joined #ruby
<shevy> I only want to create cool things and if I can get away knowing only the absolute minimum in order to achieve that then I'll never learn more than exactly that
EllPP has joined #ruby
EllPP has quit [#ruby]
davidpk has joined #ruby
thecreators has joined #ruby
sh1nji has joined #ruby
<alindeman> shevy: From a really wise dude, and I agree with him
fixl has joined #ruby
MadSweeney has joined #ruby
GitNick has joined #ruby
<GitNick> any one have any luck installing cross-ruby 1.9.3 on lion?
fayimora has joined #ruby
Cache_Money has joined #ruby
Clordio has joined #ruby
robbyoconnor has joined #ruby
Mohan has joined #ruby
Mohan has joined #ruby
drake10 has joined #ruby
guns has joined #ruby
Drewch has joined #ruby
<guns> Is there a better way to drain the $stdin buffer besides doing nonblocking reads until an exception is raised?
tomzx has joined #ruby
TheIronWolf has joined #ruby
dql has joined #ruby
<shevy> alindeman not sure. I often keep my classes in way so that it is easy to change them at a later time
jjp has joined #ruby
sifue has joined #ruby
TheIronWolf has joined #ruby
<mistergibson> Question: with respect to FMODE_WSPLIT and FMODE_WSPLIT_INITIALIZE (io.c) : is this for EOL<->CRLF conversions?
ctwiz has joined #ruby
<Sou|cutter> When I try to paste a unicode character in irb for some reason I get something that looks like \U+0123 (or whatever the code point is)
<Sou|cutter> this is on osx, in a terminal window... if I paste the exact same character in other programs (such as vi) I get the proper character
<Sou|cutter> any thoughts as to how to fix this for irb?
otters has joined #ruby
<mistergibson> Sou|cutter: it might be a default encoding in irb to unix-rest-of-the-world utf8 vs. UTF8-Mac
<mistergibson> there are some 'normalization' differences between what MacOS uses and linux for sure
<mistergibson> as an experiment, set the script to assign UTF8_MAC as the default encoding and see if there is any behavior difference
<Sou|cutter> I think I just figured it out actually
<Sou|cutter> I don't understand the solution at all, but...
<Sou|cutter> http://hints.macworld.com/article.php?story=20060825071728278 <-- dumped all of the "set meta-flag on" "set input-meta on" etc stuff into my dotfile
sifue has joined #ruby
rushed has joined #ruby
c0rn has joined #ruby
snip_it has joined #ruby
fattastic has joined #ruby
fayimora has joined #ruby
lkba has joined #ruby
savage- has joined #ruby
sifue has joined #ruby
mensa180 has joined #ruby
<mensa180> Hello, what would be a good gui for creating a sudoku game in ruby?
<mensa180> Something where it would display a grid, don't care if I have to photoshop the board or whatever, and can just type in their numbers in each cell.
<banisterfiend> mensa180: gosu
<mensa180> thanks I will look at that.
<mensa180> curious: would something like shoe or rubygame work?
moshee has joined #ruby
moshee has joined #ruby
<mistergibson> banisterfiend: how does gosu compare to wxwidgets? ever compare the two?
<banisterfiend> mistergibson: gosu is not a GUI toolkit, it's a game programming library
<banisterfiend> it's a layer or two above opengl
<mistergibson> banisterfiend: ok, thanks -- pretty cool
andersen has joined #ruby
pygmael has joined #ruby
<rking> Hrm. What's the Ruby equivalent of perldoc perlre?
<rking> I've been using random Google searches, and that works to some extent, but I'm sure there is some official doc thing on the CLI.
<rking> Hrm. Maybe there's a gem or something I need to install. (BTW, I don't only mean the docs on Ruby REs, that's only an example. Basically I'm wondering if there's a doc system on the language itself.)
deobald has joined #ruby
johnste has joined #ruby
tk___ has joined #ruby
<banisterfiend> rking: i like to use pry, personally :) it shows me both docs and source code :D
<rking> banisterfiend: Yes, but like.. I was wondering how to backref named captures. I found it easily enough on a Stackoverflow post after a Google search, but what it means is there is more regex syntax I don't know.
<rking> banisterfiend: A guy can spend a week in perldoc perlre. I want to be spending a week on Ruby stuffs. =(
* rking does <3 pry.
<banisterfiend> rking: oh, there is a website for learning regex in ruby
<Sou|cutter> banisterfiend: I have an irbrc helper that prints docs for me
<Sou|cutter> but yeah, pry is awesome
<banisterfiend> rking: rubular.com i think
<rking> banisterfiend: Ok, hrm. Well, I'd like that site, but this is a general pattern. Another one was using & to procify - I saw an example that did arr.map &:to_s and I realized I had forgotten that syntax.
<rking> Basically, I am getting better at navigating the class docs, but the language stuff is still a disorganized mess of Google searching for me.
<banisterfiend> rking: are you saying the stdlib/core docs are incomplete?
<rking> banisterfiend: Yeah, I like rubular.com. I actually am making a Vim script to be like that but inside vim.
<banisterfiend> cos they are really
<banisterfiend> rking: i recommend getting a book
<banisterfiend> rking: "the ruby programming language" is pretty great
<rking> banisterfiend: OK, that's fair enough.
<banisterfiend> Sou|cutter: how does your irbrc helper work ? (curious)
<eam> how do I call Kernel.exec and guarantee I bypass the shell? I may have a command without arguments
<rking> banisterfiend: The O'Reilly one?
<banisterfiend> rking: yeah
<Sou|cutter> banisterfiend: one sec, I will gist it
<rking> k, thanks.
<rking> eam: I'm pretty sure exec always bypasses the shell.. what are you trying to do?
<eam> Kernel.exec is like the perl CORE::exec in that it runs a shell if given one arg (and does not if given >1)
<Sou|cutter> banisterfiend: https://gist.github.com/2458278
<rking> BTW if you want a puzzler do: gem search --remote my_string # (The answer is that someone used "my_string_extend" as an example in a blog post of how to make gems.
<rking> )
<Sou|cutter> ignore the local_methods method
<eam> but I can't find a way to bypass this behavior for a single-arg command
<Sou|cutter> banisterfiend: as you can see it just calls 'ri'
<rking> eam: Oh, yes, you're totally right. Hrm.
<banisterfiend> Sou|cutter: ah ok. problem with 'ri' is you need to always generate docs when gems install, or generate them later, which takes ages and is kinda annoying IMO
<Sou|cutter> yup
<Sou|cutter> that is an issue
<Sou|cutter> pry is better than irb 100%
<eam> in perl I can exec { "argv0" } @argv
<eam> but I don't see a way to get that behavior from ruby
<banisterfiend> Sou|cutter: we finally added support for show-doc to show class docs (and show-source to show class code too). So hopefully it's just as powerul (but a lot faster) than ri now
<rking> eam: Is sanitizing the string an option?
<rking> eam: Or.. passing a dummy arg? =\
<eam> I'd really rather not, there are corner cases with things like bash functions that can't be avoided
<eam> and I don't know which programs will be run, this is a generic pass-through thing
<eam> do I need to implement my own version of exec()?
<rking> eam: I doubt it.
<rking> eam: This is a common sounding problem.
<Sou|cutter> banisterfiend: you work on pry?
<banisterfiend> Sou|cutter: i started the project :)
<Sou|cutter> oh, forgive my ignorance :) it's a great project!
<banisterfiend> Sou|cutter: im John Mair here --> https://github.com/pry/pry/blob/master/CONTRIBUTORS
<eam> taking a peek at the source
<Sou|cutter> banisterfiend: you're the man :)
<Sou|cutter> but don't get cocky! *grin*
<banisterfiend> ;
<Sou|cutter> you put my humble sax parsing gem to shame :P
<rking> banisterfiend: Is there any way to follow the C code down? E.g., if I do $ exec I see that it calls rb_exec_arg_addopt(), at that point do I need to use vim on a source tree?
Hsparks has joined #ruby
<eam> rking: how do you see that?
<rking> eam: pry
<rking> eam: gem install pry then you can do "? something" to see the docs, like "? [].sort" to see Array#sort docs, or "$ something" to see the source. If you also "gem install pry-doc" it goes into the C.
<rking> eam: But I think you have to follow-on with "vim -t"
<eam> rad thanks
<rking> ...which actually would be a decent .pryrc thing. Make it "cd ~/wherever/ruby/is/; vim -t #{the_func}"
<rking> haha, yeah!! It's awesome!
<rking> Then: $ exec
<rking> Then: c 'rb_exec_arg_addopt'
<rking> And you're in, like the Matrix and stuff.
Azure|netbook has joined #ruby
<rking> (^ Oh yeah, this assumes you have the Ruby source tree unpacked into ~/pkg/ruby/, and that you've run 'ctags -R' from the top level)
* rking awards self 3 points.
<rking> [To save you all the trouble.]
<eam> I've done none of this (and I use emacs :), but I'm taking a peek at pry right now
<rking> Emacs has tags support.
looopy has joined #ruby
<rking> banisterfiend: Any thoughts on ^.
tenchimuyo has joined #ruby
<eam> found it
<rking> eam: What is it? I was about to suggest preprending '/bin/sh'
<rking> s/prend/pend/
<eam> Kernel.exec(["/bin/true", "/bin/true"], *optargs)
<rking> Wait. I'll have to look up what that's doing.
<eam> ruby does the same thing perl does in the potential-shell-mode, scan the input cmd for shell metachars and avoid the shell if none exist
<eam> but that form bypasses that logic
<eam> this syntax seems to be the equiv of perl's system {"/bin/true"} "/bin/true", @optargs
<rking> eam: It... isn't simply amounting to: /bin/true arg ?
<rking> eam: I really don't see what this is accomplishing. It makes me think I've misunderstood your goal all along.
<eam> $ strace -v -eexecve ruby -e'Kernel.exec(["/bin/true *", "/bin/true *"], 1, 2)' results in
<eam> er, pretend 1/2 are quoted
<eam> execve("/bin/true *", ["/bin/true *"..., "1"..., "2"...]
<eam> rking: goal is to guarantee the shell is not invoked, does not alter the input string to exec
<eam> important for security / reliability
<rking> eam: OK, wait.. "1" and "2" are the inputs?
<eam> "what if some crazy user makes a script named ~/bin/* "
<rking> Inputii? The inpeet?
<rking> eam: Please bear with me. I'm pretty curious at this point.
<eam> rking: it executes /bin/true (argv[0]) with an argv[1] of "1" and argv[2] of "2"
<eam> but I can also call it without the "1", "2"
<rking> eam: Yes, I see that. Which seems useless.
x0F_ has joined #ruby
<eam> rking: well it's a test example
<eam> sorry I was unclear
<rking> eam: Why would you want to call /bin/true with any args, or at all in this case?
<rking> OHO!
<rking> OK OK
<eam> just verifying that I understand the particular semantics of system in ruby
<rking> eam: OK, so all 3 args are user input?
<eam> yeah, this is part of a larger command line utility
<rking> OK.
<eam> (which used to be perl)
tenchimuyo has quit ["..."]
pygmael has joined #ruby
<banisterfiend> rking: i've been thinking of a plugin to let u drill further down through the c
<rking> banisterfiend: Are you thinking of it in terms of generating the rest of the foo.dat's for the remainder of the C stuff?
<rking> Personally, I'm happy with that .pryrc "def c".
<rking> Though I wonder if there is a way to get rid of the quoting.
<banisterfiend> rking: what do u mean .pryrc def c
<rking> (assumes you have the Ruby source tree unpacked into ~/pkg/ruby/, and that you've run 'ctags -R' from the top level)
<banisterfiend> rking: not bad, but not everyone wants to use vim. But yeah our solution would use CTAGS 4 sure
<rking> banisterfiend: I think something that resolves along the lines of ${VISUAL:-${EDITOR:-vim}} is good, though then you'll have to figure out the args for the result (vim is -t, and I didn't see an easy command-line way with emacs, but it's probably like -e "(etags-fooey '$1')")
drake10 has joined #ruby
<rking> So yeah, maybe it's better to keep it all inside the pry CLI.
madsgraphics has joined #ruby
drake10 has quit ["Linkinus - http://linkinus.com"]
drake10 has joined #ruby
drake10 has quit [#ruby]
moshee has joined #ruby
CheeToS has joined #ruby
tomsthumb has joined #ruby
ryanf has joined #ruby
<pdtpatr1ck> Could you guys please recommend some good quality Ruby tutorial videos/screencasts. Paid or unpaid - i just care about quality. Thanks
fukushima has joined #ruby
<mensa180> Hi guys, I'm having trouble finding good ruby tk documentation. http://codepad.org/98WgbiUx -- How would I make it so that entering a value into any of those entry widgets procs a command? Goal: enter a number and a label updates telling whether or not you won/ had a correct value (tbd), the game is sudoku. also is there a better method of setting up the grid?
GitNick has joined #ruby
<GitNick> has anyone recently compiled a cross ruby (post 1.9) for windows on mac 10.7 using rake-compiler?
<mensa180> Hi guys, I'm having trouble finding good ruby tk documentation. http://codepad.org/98WgbiUx -- How would I make it so that entering a value into any of those entry widgets procs a command? Goal: enter a number and a label updates telling whether or not you won/ had a correct value (tbd), the game is sudoku. also is there a better method of setting up the grid?
<matled> rking, banisterfiend: vim and emacs work with $EDITOR +12 some-file to start editing in line 12
<rking> matled: So... do the tags file lookup externally somehow?
<matled> rking: I dunno, I don't even understand what you were talking about, I just thought you were looking for a way to start an editor at a certain position independent of the editor
<rking> ...which wouldn't be 100% trivial, since a tags file is actually a list of patterns to match, not a list of line numbers.
cwill747 has joined #ruby
<rking> matled: Close, but no. At a certain tag. Emacs has "etags" IIRC.
apeiros_ has joined #ruby
ohcibi has joined #ruby
vandemar has joined #ruby
jakky has joined #ruby
blast_hardcheese has joined #ruby
changedNicks has joined #ruby
michaelmartinez has quit [#ruby]
ctwiz has joined #ruby
workmad3_ has joined #ruby
Gesh has joined #ruby
ukwiz has joined #ruby
Gesh has quit [#ruby]
SirFunk has joined #ruby
Ttech2 has joined #ruby
davidw has joined #ruby
harukomoto has joined #ruby
Aristata has joined #ruby
<Aristata> Can anyone tell me why this code isn't working? http://pastie.org/3832370
<banisterfiend> Aristata: i would, but i've forgotten who i am
<Aristata> I don't know what that means but I like it
<Aristata> :)
sifue has joined #ruby
dv_ has joined #ruby
platzhirsch1 has joined #ruby
<platzhirsch1> Is it common to write a main routine and just call the main routine?
<banisterfiend> platzhirsch1: NEVERRRRR!!!!!!
pedm has joined #ruby
<banisterfiend> platzhirsch1: if u write a main function u will get beat
<platzhirsch1> banisterfiend: and if I write a main method?
<banisterfiend> platzhirsch1: you'll get beat
<platzhirsch1> banisterfiend: you don't seem sane
<banisterfiend> platzhirsch1: nothing wrong with dat
<platzhirsch> You seriously should drink a coffee
eka has joined #ruby
tewecske has joined #ruby
<platzhirsch> I am not sure, but File.open(file).first does not open and close again, does it?
<banisterfiend> platzhirsch: use a block
<banisterfiend> platzhirsch: File.open(file) { |f| .. }
<platzhirsch> hmpf, ok
mborromeo has joined #ruby
tobago has joined #ruby
<mensa180> Hi guys, I'm having trouble finding good ruby tk documentation. http://codepad.org/98WgbiUx -- How would I make it so that entering a value into any of those entry widgets procs a command? Goal: enter a number and a label updates telling whether or not you won/ had a correct value (tbd), the game is sudoku. also is there a better method of setting up the grid?
<mensa180> And if there is a better toolkit or gui to use with ruby than tk for my project please point me towards it, because this is miserable.
<Aristata> mensa180: I have no idea, but I can tell you that code could be about 1/8th the size if you did a loop
platzhirsch has quit [#ruby]
platzhirsch has joined #ruby
<mensa180> I would be incredibly grateful if you told me how precisely, I don't know how to define multiple variables in looping process.
pygmael has joined #ruby
<Aristata> mensa180: http://pastie.org/3832500
<Aristata> mensa180: I messed one thing up
alem0lars has joined #ruby
<Aristata> mensa180: http://pastie.org/3832504 that should do it, you will have to run it though
replore has joined #ruby
<mensa180> I will try this, thanks
nikhil_ has joined #ruby
LMolr has joined #ruby
banseljaj has quit ["co'o ro do"]
heldopslippers has joined #ruby
darthdeus has joined #ruby
seivan has joined #ruby
mdw has joined #ruby
agilobable has joined #ruby
arturaz has joined #ruby
machine1 has joined #ruby
pygmael has joined #ruby
shruggar has joined #ruby
francisfish has joined #ruby
bier has joined #ruby
bier|tp has joined #ruby
Shamgar has joined #ruby
Shoobdidoo has joined #ruby
pygmael has joined #ruby
alup_ has joined #ruby
yxhuvud has joined #ruby
batmanian has joined #ruby
r0bby has joined #ruby
pygmael has joined #ruby
pygmael has quit [#ruby]
RegEchse has joined #ruby
mdw has joined #ruby
nikhil_ has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
n1x has joined #ruby
Jackneill has joined #ruby
Freelancer has joined #ruby
ananthakumaran has joined #ruby
mengu has joined #ruby
nikhil_ has joined #ruby
madsgraphics has joined #ruby
niku4i_ has joined #ruby
ken_barber has joined #ruby
moshef has joined #ruby
beilabs has joined #ruby
agilobable has joined #ruby
tijmencc has joined #ruby
iocor has joined #ruby
tijmencc has quit [#ruby]
mcwise has joined #ruby
Jakee` has joined #ruby
tvw has joined #ruby
greenarrow has joined #ruby
justinmcp has joined #ruby
moshef has joined #ruby
GitNick has joined #ruby
vatzec has joined #ruby
<vatzec> Hi. :) I have a website in Ruby and it uses bcrypt passwords (I think). How do I generate a bcrypt password hash outside of Ruby?
<vatzec> ... so that I can put it in a mysql db?
<vatzec> (I'm not a Ruby programmer and I'm modifying somebody else's script)
<GitNick> trying to compile a windows binary. But I keep getting errors saying "error: expected ‘;’, ‘,’ or ‘)’ before ‘-’ token" from in the ruby.h. They started appearing after my last attempt to compile against a .def/.dll
<GitNick> Heres a gist: https://gist.github.com/2463410
ctwiz has joined #ruby
tijmencc has joined #ruby
tijmencc has quit [#ruby]
geers_ has joined #ruby
<MarcWeber> How can I dynamically create a class Module.Classname ? something like Module["Classname"].new ?
<banisterfiend> MarcWeber: what does Module.Classnam mean
<banisterfiend> MarcWeber: you mean MyModule::MyClass ?
<banisterfiend> MarcWeber: like this: MyModule.const_set :MyClass, Class.new { def hello; end }
<GitNick> banisterfiend: I got a cross-ruby installed on my mac, but now I get errors from inside ruby.h. I tried adding a $CFLAGS line with --def and -I flags, no cigar.
<MarcWeber> yes I meant ::
<MarcWeber> I'll assign the class instance to the option, not its name. Then it'll work as well.
Gadgetoid has joined #ruby
driftcrow has joined #ruby
bawer has joined #ruby
Indian has joined #ruby
ukd1 has joined #ruby
ukd1_ has joined #ruby
gmci has joined #ruby
ukd1 has joined #ruby
Mon_Ouie has joined #ruby
changedNicks has joined #ruby
Beoran__ has joined #ruby
ChampS666 has joined #ruby
ananthakumaran1 has joined #ruby
mrwalker has joined #ruby
KL-7 has joined #ruby
LMolr has joined #ruby
ephemerian has joined #ruby
replore_ has joined #ruby
schovi has joined #ruby
mdw has joined #ruby
russel_brand has joined #ruby
<Kovensky> hmm
visof has joined #ruby
ahmd has joined #ruby
<Kovensky> what exactly is an iterator in ruby
<Kovensky> for instance, String#chars docs say that it either yields each character to an associated block or "returns an iterator" if there is none
<Kovensky> err
<Kovensky> enumerator
justinmcp has joined #ruby
nikhil_ has joined #ruby
<burgestrand> Kovensky: it’s just a regular object
echosystm has joined #ruby
<echosystm> how can i run a command and use a string as stdin ?
<echosystm> is this somehow possible with backticks?
<burgestrand> echosystm: you’d probably have to use IO#popen: http://www.ruby-doc.org/core-1.9.3/IO.html#method-c-popen
<Kovensky> burgestrand: hmm, nice
<echosystm> thanks
jamiemill has joined #ruby
x255 has joined #ruby
filemon_CZ has joined #ruby
ahmdrefat has joined #ruby
etehtsea has joined #ruby
dql has joined #ruby
kirun has joined #ruby
ahmdrefat has joined #ruby
GitNick has joined #ruby
niku4i_ has joined #ruby
mrwalker has joined #ruby
strife25 has joined #ruby
<echosystm> ok, so to run a command and send a string through as stdin...
<echosystm> IO.popen('mycommand') { |io| io.write 'something'; ??? }
<echosystm> what do i put in ???
<echosystm> ie. how does the command know when there is no more to read
<echosystm> io.write_close ?
<shevy> echosystm yeah
<echosystm> cool
<echosystm> thanks
<shevy> echosystm what external command are you trying to use via popen?
<echosystm> um
<echosystm> xxd -r | gzip >> somefile
<echosystm> it seems to work
ahmdrefat has joined #ruby
Asher has joined #ruby
Asher has joined #ruby
nethad has joined #ruby
brngardner has joined #ruby
Progster has joined #ruby
gmci has joined #ruby
kvirani has joined #ruby
IPGlider has joined #ruby
replore has joined #ruby
ananthakumaran has joined #ruby
ahmdrefat has joined #ruby
nikhil_ has joined #ruby
imami|afk has joined #ruby
alem0lars has joined #ruby
rellon has joined #ruby
<fr0gprince_> hi, why doesnt this -> /^[\.|!][yt|youtube] (.+)$/
<fr0gprince_> match .yt
ramblex has joined #ruby
ananthakumaran has joined #ruby
<alindeman> frogstarr78: You want ( ) for grouping like that, not []
brngardner has joined #ruby
niklasb_ has joined #ruby
fukushima has joined #ruby
<fr0gprince_> but that captures it : (
Mchl has joined #ruby
<alindeman> You can prefix it with ?: so it doesn't capture
<alindeman> I'll rubular it up in a sec
<fr0gprince_> ah cool
<alindeman> fr0gprince_: http://rubular.com/r/EoxJh9qy8z
sc0 has joined #ruby
<fr0gprince_> alindeman: perfect:) thanks
<fr0gprince_> never seen the "?:" before
twinturbo has joined #ruby
<alindeman> It's a "non-capturing group"
otters has joined #ruby
ahmdrefat has joined #ruby
schovi has joined #ruby
keymone has joined #ruby
sonkei has joined #ruby
jitesh_shetty has joined #ruby
HashNuke has joined #ruby
nu7hatch has joined #ruby
schovi has joined #ruby
giftfrosch has joined #ruby
HashNuke_ has joined #ruby
waxjar has joined #ruby
bashdy has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
ahmdrefat has joined #ruby
gmci has joined #ruby
ukwiz has joined #ruby
<fr0gprince_> i learned something today:)
<nyuszika7h> Hi, could someone help me?
<niklasb_> nyuszika7h: don't ask to ask ;)
<nyuszika7h> Err, never mind
<nyuszika7h> I solved my own problem
<niklasb_> neat
<nyuszika7h> When I tried to pastebin the file, I realized it had a different name
dv310p3r has joined #ruby
pac1 has joined #ruby
Clordio has joined #ruby
<nyuszika7h> I wanted to make a program that calculates the factorial of a number and ended up in making one that calculates the Fibonacci value, and of course the library file was saved as factorial.rb :P
<niklasb_> nyuszika7h: :D
abra has joined #ruby
<nyuszika7h> And I did require 'fibonacci.rb' which didn't exist
emmanuelux has joined #ruby
polishguy94 has joined #ruby
td123 has joined #ruby
<polishguy94> http://pastebin.com/Et5BTNpF - what's wrong with my code that ajax post requests doesn't work
Faris has joined #ruby
yoklov has joined #ruby
mpereira has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
mmajchrzak has joined #ruby
<mmajchrzak> Hi . How to create an array with numbers from 1 to for example 1000 ? I need the fastest and the shortest way. Thank you
<Mon_Ouie> (1..1000) returns a range — you can use that unless you really need an array
<niklasb_> and if you do, .to_a to the rescue
fbernier has joined #ruby
ahmdrefat has joined #ruby
nilg has joined #ruby
maxs has joined #ruby
cryptovariable has joined #ruby
canton7 has joined #ruby
wargasm has joined #ruby
<shevy> mmajchrzak the fastest way? this is ruby man, slowness is everywhere ;)
thone_ has joined #ruby
Squarepy has joined #ruby
<mmajchrzak> shevy in the newest benchmarks ruby is faster then python and perl :D . So it isnt so slow. Do you know the answer ?
<shevy> mmajchrzak which benchmarks?
Squarepy has joined #ruby
<niklasb_> mmajchrzak: never trust a benchmark
<niklasb_> ".php"
<banseljaj> lol niklasb_
<banseljaj> mmajchrzak: x = (1..1000)
<shevy> hmm
<banseljaj> hi shevy
<banseljaj> I found this amazing book about ruby. cleared some concepts, and helped me with coding mistakes. :)
<shevy> banseljaj which one?
mdw has joined #ruby
<shevy> "how to become an expert in JAVA in 30 days" ? :)
<banseljaj> :D
<banseljaj> Manning The Well Grounded Rubyist
<banseljaj> :D
<banseljaj> those 30 days books never work for me
<niklasb> those experts never work for me..
<banseljaj> niklasb: Why would they? Are you their boss? :P
<niklasb> shevy: I like how those books always spell it like JAVA :D
<niklasb> banseljaj: no, that was just a random comment
<shevy> hmm
<shevy> my boss also never works for me :(
<banseljaj> poor shevy
<banseljaj> :P
<banseljaj> niklasb: as opposed to a pseudorandom comment? :)
<banseljaj> For a long while I thought "JAVA" stood for something
<banseljaj> In the dark ages, the days before Wikipedia!
Clordio has joined #ruby
<niklasb> banseljaj: the V stands for verbose :)
<shevy> lol
<shevy> I always thought of coffee
<banseljaj> lol
<shevy> Java coffee from indonesia or?
mdw_ has joined #ruby
<banseljaj> :D
davidpk has joined #ruby
<banseljaj> Hmm.
<shevy> but well that was years ago
<banseljaj> Okay, can you guys tell me about this "gem" controversy?
<niklasb> banseljaj: hm?
<shevy> gem is an integrated part of ruby these days
<banseljaj> Apparently gem as a package management is being bashed by debian guys
<shevy> because they are selfish
<shevy> they dont allow competition to apt-get and aptitude
<polishguy94> Can you check my code, please?
visof has joined #ruby
<banseljaj> Debian guys tend to be wuite stuck up.
<banseljaj> polishguy94: sure
<niklasb> banseljaj: it's the same for other distros as well
<shevy> I always tell people that they must decide on their own
<polishguy94> i am having problems with ajax post requests
<shevy> either they use [insert distribution here], or they don't. but if they use the distribution, they must solve distribution-specific packages on their own
<polishguy94> there are pasted only relevant pieces of code
<banseljaj> "The Power is Yours"
<shevy> *problems, not packages
<canton7> polishguy94, it lokos like a datamapper issue, not an ajax one
<banseljaj> I like managing ruby with rvm
<polishguy94> so there's is no mistake of mine?
<waxjar> rbenv :3
<banseljaj> cuz distro specific gems and libraries are too old
<niklasb> banseljaj: then you're out of the reach of the package manager anyway
<banseljaj> Which is how i want everything to stay.
<banseljaj> I was just wondering why there are gem haters
<banseljaj> Maybe they should bundle rvm with next ruby release. :D
<shevy> no
<shevy> I dont want to be forced to use rvm
<shevy> I use ruby from the sources always
<niklasb> shevy: "bundle" would mean to add a single shell script
<niklasb> I don't think that's too intrusive
<shevy> I hate shell scripts
<banseljaj> rvm compiles from sources
<shevy> banseljaj and i do too!
<niklasb> shevy: ah ha.
<polishguy94> Any users of OpenShift?
<waxjar> doesn't rvm do some nasty stuff to cd or something?
mpereira has joined #ruby
<banseljaj> shevy: did shell scripts ever touch you in a place that made you uncomfortable?
<shevy> all my rubies go into /Programs/Ruby/VERSION_HERE
<shevy> banseljaj not anymore, I kill them when I see them :)
<banseljaj> :D
<niklasb> polishguy94: I tried it once
<shevy> but most of the time when I spend my time trying to understand shell scripts written by others
<banseljaj> shevy: that is a good solution, if inelegant
<shevy> I find shell scripts to be a true abomination
<polishguy94> niklasb: what do you think?
<shevy> the more ruby I can use, the better
* banseljaj thinks he shouldn't mention writing shell scripts
<niklasb> polishguy94: it's nice
<shevy> what is the default compile --prefix target for rvm? into $HOME?
darthdeus has joined #ruby
<banseljaj> shevy: $HOME/.rvm
<niklasb> shevy: i think it shuffles everything into ~/.rvm
<shevy> ok
<polishguy94> so why you aren't using it now?
<shevy> never heard of OpenShift
<niklasb> polishguy94: because I have no app I could deploy :)
<niklasb> shevy: free web app hosting
<banseljaj> niklasb: what do they support?
<polishguy94> everything
<polishguy94> you are given a shell access
<banseljaj> I only knew about Heroku and EnYa
<niklasb> banseljaj: you oculd.. visit their website :)
<polishguy94> but no superuser
<banseljaj> I am. I wanted a faster answer. :P
<polishguy94> It means you can deploy even Meteor apps
<niklasb> banseljaj: the most popular stuff
<niklasb> no haskell, unfortunately :(
<banseljaj> A friend of mine is trying to create a Haskell app hosting thingie
nerdy has joined #ruby
<banseljaj> I am pushing him to use ruby to create it :3
<banseljaj> <------Scumbag banseljaj
HashNuke has joined #ruby
<niklasb> banseljaj: that doesn't sound sensible.
<polishguy94> i've got a rvm on my account :>
<shevy> haskell is scary
<banseljaj> shevy: in start, yes.
<waxjar> haskell seems like a really cool language
<polishguy94> it's as scary as erlang :D
<niklasb> oh no, we had that before
<banseljaj> But I'm trying to get into it
<shevy> I always ask haskell guys to explain why a monad is needed in one sentence
<banseljaj> My third try
Drewch has joined #ruby
<banseljaj> shevy: I think that's unreasonable
<niklasb> shevy: it's only "needed" if you don't have side effects
<niklasb> which isn't the case anywhere else
<banseljaj> FP is very different from OOP
<polishguy94> no shit :D
<banseljaj> So you can't hold them to the same standards
<polishguy94> what was your first programming language?
<shevy> BASIC
dql has joined #ruby
<niklasb> Visual Basic
<waxjar> php :(
<polishguy94> javascript
<banseljaj> BASIC
* banseljaj shuns waxjar
<banseljaj> You are not one of us!
<banseljaj> :P
<polishguy94> when i was 11 i asked my mother to buy me a PHP book and she did
ikaros has joined #ruby
<polishguy94> luckily It wasn't appealing to me enough to start coding
<banseljaj> I have sworn off php
thams has joined #ruby
<banseljaj> And now i have a project for WP. :(
<shevy> I came from PHP too
<banseljaj> PHP sucks.
<banseljaj> :(
<banseljaj> Makes me cry
<shevy> yeah but you can get results in your browser
<shevy> that somehow helps
<shevy> rails always felt so much more complicated
<shevy> that alone I have to understand all those terms used... what is a controller, why do I need it
<shevy> and this embedded ruby thingy... erb or what's its name, is so ugly
<waxjar> ruby has a steep learning curve compared to php
<shevy> yeah
<niklasb> shevy: rails *is* complicated compared to other web frameworks
<niklasb> not only PHP ones
<banseljaj> I prefer a steep learning curve to uniform complexity
<polishguy94> there's so much magic behind the rails
<banseljaj> Also, use sinatra
<banseljaj> if you don't like rails
<polishguy94> sinatra inhertis the compliacation of Rack
<banseljaj> or django. :P
<waxjar> cuba seems like a really interesting alternative to sinatra
<waxjar> really tiny, apparently really fast too
<banseljaj> polishguy94: Sinatra has a big rack, you mean to say?
bluOxigen has joined #ruby
<banseljaj> Don't you have to worry about fidel, in cuba?
<banseljaj> :P
<polishguy94> http://cuba.is/ this cuba?
<waxjar> yes
mangohuice has joined #ruby
<polishguy94> yuck, cuba looks so javascriptish
<banseljaj> When's Ruby 2.0 coming out btw?
tommyvyo has joined #ruby
flingbob has joined #ruby
flingbob has quit [#ruby]
<waxjar> feb 2013
<shevy> man
<shevy> those names ....
<shevy> "cuba"
* banseljaj can't wait
<shevy> "sinatra"
<shevy> what comes next... a web framework called "argentina"?
<polishguy94> poland.rb
<banseljaj> I can make a framework named "pakistan" :D
<waxjar> what about "ruby" itself? :p
<banseljaj> gem install ruby
<banseljaj> ^LOL
<polishguy94> are you satisfied with curren popularity of ruby/RoR/Sinatra?
<polishguy94> current *
<shevy> GRRR
<shevy> who suggested a gem called "ruby"
<banseljaj> I am.
<shevy> how about a gem called gem
<banseljaj> shevy: waxjar
<shevy> gem install gem
<banseljaj> a gem called ruby-gem?
<waxjar> i meant that the name ruby is a weird one too :p
<banseljaj> gem install ruby-gem
<banseljaj> gem install gem-install
<banseljaj> :D
<polishguy94> how about gem called install
<shevy> omg
<polishguy94> gem install install
<waxjar> gem install uninstall
<banseljaj> polishguy94: Beat you to it
<shevy> waxjar, yeah kinda... but it stems from perl
<shevy> the next language will be:
<shevy> diamond
<waxjar> haha
<banseljaj> can we expect a language named "stalactite" soon? D:
<shevy> dunno
<shevy> it's a bit long perhaps
<waxjar> i want one called boobies
<shevy> names like... "perl... C ... python ... php ... ruby ... lua ..."
<banseljaj> waxjar: fork ruby
<shevy> and java
strife25 has joined #ruby
<waxjar> haha
<banseljaj> waxjar: use ruby's kernel, and make the language boobies
<banseljaj> boobies on rails. :D
<waxjar> lol
<shevy> would probably be forbidden in certain environments
<shevy> corporate environments "we dont like boobies here"
<banseljaj> shevy: languages generall have monosyllabic names
<shevy> yeah, I think that is better
<shevy> short is beautiful
<banseljaj> And Apple will ban it fomr Mac
<shevy> "smalltalk" <-- too long I think
<banseljaj> clojure?
<shevy> hmm
<banseljaj> haskell. :D
<waxjar> coffeescript
<shevy> almost too much
jbw has joined #ruby
<waxjar> i like Lisp as a name
<banseljaj> waxjar: you mean lithp?
<waxjar> haha
<shevy> lisp, sounds like a speaking defect
<shevy> to lisp
<banseljaj> Logo
<shevy> Logo is a nice name
<shevy> it implies a logical language
<shevy> :)
<shevy> and reminds me of childhood lego
<banseljaj> shevy: it is. :P
<banseljaj> I use NetLogo for simulations. <3 its IDE
<banseljaj> In Other news, I am proud of achieveing a milestone in my Ruby Dev thingie
lateau has joined #ruby
<banseljaj> I had to get some random data. In less than one hour. I whipped out a ruby script to generate everything and write to a file. :D
Faris has joined #ruby
Jake232 has joined #ruby
<banseljaj> 20 miutes, And I'ma hero.
<banseljaj> :D
<shevy> yeah
<banseljaj> I know it is lame from the perspective of experienced devs, but it felt great to me. :)
<shevy> now you cherish still
<shevy> but in 2 years, after having done so a few thousand times, it gets boring
<shevy> and then you look out for new things to do
<banseljaj> I don't mind
<shevy> yup, but that feeling passes banseljaj
<banseljaj> I've always chased the rush. I never stop looking for new things to do
<shevy> imagine when you are at a point you dont wanna code anything anymore
dwon has joined #ruby
<banseljaj> I'll probably be treating patients in a hospital then. :D
<banseljaj> <------ Doctor
johnste has joined #ruby
kallisti has quit [#ruby]
<shevy> yeah
<shevy> that's better
meskyanichi has joined #ruby
<banseljaj> And when I get bored of that, I'll come back to coding. :)
grin has joined #ruby
<polishguy94> I've uploaded my broken application on git, can you have a look at it whole and tell me what lines I should improve?
waxjar has joined #ruby
steg132 has joined #ruby
<banseljaj> hey waxjar, welcome back
<banseljaj> :)
<waxjar> hey
steg132 has quit [#ruby]
andrewhl has joined #ruby
aquarius1973 has joined #ruby
steg132 has joined #ruby
zakwilson has joined #ruby
seoaqua has joined #ruby
falena has joined #ruby
Clordio has joined #ruby
Gekz has joined #ruby
Gekz has joined #ruby
mdw has joined #ruby
HashNuke has joined #ruby
SegFaultAX|work has joined #ruby
dql has joined #ruby
johnloy_ has joined #ruby
schaerli has joined #ruby
davidpk has joined #ruby
zakwilson_ has joined #ruby
_|christian|_ has joined #ruby
uris has joined #ruby
d3c has joined #ruby
schovi_ has joined #ruby
HashNuke has joined #ruby
johnloy_ has quit [#ruby]
Russell^^ has joined #ruby
youdonotexist has joined #ruby
virunga has joined #ruby
dbgster has joined #ruby
thecreators has joined #ruby
luckyruby has joined #ruby
<shevy> die waxjar
<shevy> oops
<shevy> hi waxjar
Frippe has joined #ruby
Eldariof-ru has joined #ruby
grin_ has joined #ruby
jimeh has joined #ruby
<mmajchrzak> Ruby have something like Pythons numpy ?
kevinbond has joined #ruby
shruggar has joined #ruby
grin has joined #ruby
luckyruby has joined #ruby
davidcelis has joined #ruby
maletor has joined #ruby
<td123> I don't know for sure, but I haven't heard of any that come close
ringotwo has joined #ruby
<td123> when writing a website, I use ruby for the frontend code, and python for the number crunching :P
SirRamonGabriel has joined #ruby
ukwiz has quit ["Leaving"]
jimeh has joined #ruby
tommyvyo has joined #ruby
arturaz has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
brngardner has joined #ruby
mdw has joined #ruby
ukd1 has joined #ruby
johnloy has joined #ruby
davidpk has joined #ruby
rippa has joined #ruby
johnloy has joined #ruby
grin has joined #ruby
<any-key> yeah python is much better for such things, unfortunately
<any-key> it's okay, though, because us ruby folk have things like metasploit :D
flak has joined #ruby
fr0gprince_ has joined #ruby
v4n_ has joined #ruby
n00by has joined #ruby
<n00by> I wanna loop through hash, and change value only if it satisfies condition
<shevy> a lot of this is because japanese authors dont know the english language
<shevy> n00by, hash.dup.each_pair {|key, value| do_stuff_here if bla }
voodoofish has joined #ruby
<banseljaj> shevy: Y U STEAL MY THUNDER
<banseljaj> :P
<n00by> shevy, thanx
<any-key> wait, can you not map a hash?
<any-key> the values, that is
<banseljaj> ohwait. my message wasn't sent.
<banseljaj> sorry. :)
<arturaz> any-key, what kind of things?
phipes has joined #ruby
<any-key> arturaz: well, pretty much anything numpy does
<any-key> linear algebra, in particular
rippa has joined #ruby
<any-key> I don't do much in the way of computations other than that on occasion, so I'm not super familiar with other stuff
<n00by> okay, shevy, I can use map for this, but I'd like to return edited hash, and I'd like to alter only the values that meet certain condition
ukd1 has joined #ruby
<n00by> any ideas?
<davidcelis> n00by: a conditional statement in your .map block
<n00by> but I'd like only to return original hash with edited value(s), if I do h.map { |k, v| v == 'foo' if v.nil? }
<n00by> it will return array
<n00by> I'd like to get key => value pair
<n00by> I guess it's terribly simple
<n00by> I just don't get how can I get altered hash from this conditional
<davidcelis> v == 'foo
<davidcelis> that would always just give you false
<davidcelis> did you mean = ?
shiroginne has joined #ruby
<n00by> davidcelis, yeah, sry...
<davidcelis> n00by: Anyway, you should be able to wrap the whole thing in Hash[]
<davidcelis> Hash[array, array, array, array] will create a Hash out of two-element arrays (each will be a key-value pair)
<davidcelis> any-key: it sounds like he still wants the other values as well
<n00by> davidboy, aaah... thanx
<n00by> davidcelis, yeah, just a sec, I'll put smth on pastie
nif has joined #ruby
<n00by> nah, screw pastie, this is utterly simple
<n00by> e.g. I have this foo = { a: 6, b: 35, c: 'foo' }
<n00by> and I want to get this foo = { a: 6, b: 35, c: 0 }
ephemerian has joined #ruby
<any-key> map
<n00by> any-key, I'm already using map
grin has joined #ruby
<any-key> then what's the issue?
andrewhl has joined #ruby
<n00by> aaah, okay, I wasn't wrapping it in Hash
<n00by> =)
<n00by> thanx davidcelis, any-key
bondar has joined #ruby
<arturaz> n00by, or you could use #each_with_object
<Mon_Ouie> Or you could just use #[]=
<Mon_Ouie> There's no reason to explicitly iterate over the whole array
<Mon_Ouie> hash*
sorin has joined #ruby
<sorin> Hi.
<sorin> Does RVM screw up the Zsh $PROMPT for anyone else?
v4n_ has joined #ruby
johnloy_ has joined #ruby
Vainoharhainen has joined #ruby
Vainoharhainen has joined #ruby
Poapfel has joined #ruby
Poapfel has joined #ruby
francisfish has joined #ruby
<Mon_Ouie> How does it "screw it up"?
Bosma has joined #ruby
bluenemo has joined #ruby
looopy has joined #ruby
ryan0x2 has joined #ruby
luckyruby has joined #ruby
ananthakumaran has joined #ruby
<shevy> sorin no idea. I always compile from source, everything, with ruby scripts (in case of bootstrapping ruby, it's a shell script). I'd not want to spend time to understand in what ways RVM messes up my system, I'd simply not use it.
<sorin> shevy: I don't use it either. I use rbenv when needed. But, I would like to fix https://github.com/sorin-ionescu/oh-my-zsh/issues/151 Oh My Zsh Next bug.
schovi has joined #ruby
mutexkid has joined #ruby
quest88 has joined #ruby
khakimov has joined #ruby
IPGlider has joined #ruby
_|christian|_ has joined #ruby
ananthakumaran has quit [#ruby]
chico has joined #ruby
<mmajchrzak> How I can make Math.sqrt on a really big number ?
Jake232 has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
<rippa> mmajchrzak: огые вщ ше
<rippa> *just do it
waxjar has joined #ruby
kjellski_ has joined #ruby
__main__ has joined #ruby
madsgraphics has joined #ruby
John_P has joined #ruby
sorin has quit [#ruby]
mucker_ has joined #ruby
Azure has joined #ruby
<shevy> cool
<shevy> I tried to get a huge number into it
<shevy> (irb):7: warning: Bignum out of Float range # => Infinity
<shevy> I reached Infinity
<shevy> twice :)
<Mon_Ouie> BigDecimal#sqrt allows to get the square root of arbitrarily large (or small) numbers
ukd1 has joined #ruby
Ttech2 has joined #ruby
<mmajchrzak> Using bigDecimal on a small numbers makes ruby slower?
mucker_ has joined #ruby
<shevy> mmajchrzak very slow
<shevy> so slow that you can't use it anymore
<shevy> enter C
<shevy> bye mmajchrzak!
<Mon_Ouie> BigDecimal will definitely be slower than floats, but sometimes you need such precision
mucker_ has joined #ruby
mucker has joined #ruby
ctwiz has joined #ruby
emsilva has joined #ruby
nemesit has joined #ruby
monokrome has joined #ruby
Azure_ has joined #ruby
affix has joined #ruby
Valkyrie^ has joined #ruby
mdw has joined #ruby
btaitelb has joined #ruby
Clordio has joined #ruby
pen has joined #ruby
Indian has joined #ruby
pdtpatr1ck has joined #ruby
mucker has joined #ruby
mcwise has joined #ruby
Russell^^ has joined #ruby
alem0lars has joined #ruby
tommyvyo has joined #ruby
zakwilson has joined #ruby
Progster has joined #ruby
mborromeo has joined #ruby
mucker has joined #ruby
jmcphers_ has joined #ruby
Bauer1 has joined #ruby
agilobab1e has joined #ruby
dbgster_ has joined #ruby
tdubellz has joined #ruby
tdubz has joined #ruby
somnium has joined #ruby
exoa has joined #ruby
ukd1_ has joined #ruby
ex0a has joined #ruby
cb_ has joined #ruby
Evixion` has joined #ruby
classix_ has joined #ruby
dubellz has joined #ruby
multi_io_ has joined #ruby
warebec|1at has joined #ruby
phreax_ has joined #ruby
filier has joined #ruby
tomb_ has joined #ruby
zmoazeni_ has joined #ruby
__null has joined #ruby
Xylo1 has joined #ruby
wwkeyboard has joined #ruby
__null has joined #ruby
fr0gprince_mac has joined #ruby
Russell^^_ has joined #ruby
araujo_ has joined #ruby
__null has joined #ruby
daveecee has joined #ruby
__null has joined #ruby
_main_ has joined #ruby
Russell^^_ has joined #ruby
starburst has joined #ruby
__null has joined #ruby
__null has joined #ruby
davidcelis has joined #ruby
mucker has joined #ruby
peterhil has joined #ruby
moted has joined #ruby
pdtpatr1ck has joined #ruby
Mon_Ouie has joined #ruby
mucker has joined #ruby
d3c has joined #ruby
machine1 has joined #ruby
dubellz has joined #ruby
rramsden has joined #ruby
DarthGandalf has joined #ruby
ezra has joined #ruby
twinturbo has joined #ruby
peterhil` has joined #ruby
machine2 has joined #ruby
Synthead has joined #ruby
k_89 has joined #ruby
kanzure has quit [#ruby]
FACEFOX-DOT-COM has joined #ruby
<k_89> hey ... a noob question whats :: in ruby??
Notimik has joined #ruby
<shevy> k_89 scope operator
<shevy> module Foo; class Bar; end; end; x = Foo::Bar.new
<k_89> ok , thanks a lot
<shevy> you see that Bar resides within module
<k_89> yeah
dubellz has joined #ruby
<k_89> i tried something like this in irb module A; def fn: 1+1; end end
<k_89> i wasn't able to access fn like A::fn
<k_89> i had to include A and then call fn
<k_89> to get that
<k_89> 2
eph3meral has joined #ruby
snip_it has joined #ruby
<rippa> k_89: def self.fn
<k_89> oh
dubellz has joined #ruby
<k_89> so that means because of what i had done, i had defined a function which exists in the scope of that module, but is not really a part of that module, right??
xpot-mobile has joined #ruby
n1x has joined #ruby
seungers has joined #ruby
<k_89> cool, reopen classes and modules
giftfrosch has joined #ruby
<rippa> k_89: you defined instance method
luckyruby has joined #ruby
<k_89> a module also has an instance??
<k_89> rippa, can you explain a little more
<rippa> if you include a module in a class
jimeh has joined #ruby
FACEFOX has joined #ruby
<rippa> module's instance methods become classes'
<k_89> ok,
snearch has joined #ruby
<k_89> trying out a few more stuff in irb to get this whole module thing
kidoz has joined #ruby
nilg has joined #ruby
<k_89> whats an instance of a module ... does including a module means creating its instance ??
jhunter has joined #ruby
<k_89> also ... can i call an instance method of a module from a module's method?
loyboy has joined #ruby
dubellz has joined #ruby
<shevy> you cant instantiate a module
<shevy> they are like crippled classes
sguy has joined #ruby
nerdy has joined #ruby
<davidpk> i have an alist and i want to change it to a hash. how do I do that?
<shevy> what is an alist?
<davidpk> association list
<davidpk> eg
<davidpk> [[key1, val1], [key2, val2]]
<davidpk> which should become {key1 => val1, key2 => val2}
companion has joined #ruby
<shevy> hash = Hash[* [["key1", "val1"], ["key2", "val2"]] ] # => {["key1", "val1"]=>["key2", "val2"]}
<k_89> shevy, is the concept of modules similar to the concept of abstract classes in other langs??
<yxhuvud> Hash[*alist.flatten(1)]
<k_89> it seems a lot like that
Cache_Money has joined #ruby
<shevy> k_89 I have no idea what abstract classes are. for me, modules are crippled classes
affix has joined #ruby
<davidpk> yxhuvud: thanks!
<k_89> shevy, abstract classes in java and php are classes which cannot be instantiated, however can have static methods/properties and can be inherited by other non-abstract or abstract classes
mucker has joined #ruby
<shevy> somewhat similar
<shevy> you cant inherit from a module however
<shevy> you can mixin its functionality
<k_89> yeah .. the mixin thing is unique to ruby i think
<sguy> Can someone point me to a tut that tells how to write ruby wrappers for perl code ?
<shevy> ewww
dubellz has joined #ruby
kevinbond has joined #ruby
khakimov has joined #ruby
mistergibson has joined #ruby
<Tasser> sguy, huh?
nobitanobi has joined #ruby
nobitanobi has joined #ruby
<sguy> I have a perl library that I'd like to use with ruby
octobrainz has joined #ruby
justinmcp has joined #ruby
giftfrosch has joined #ruby
giftfrosch has joined #ruby
giftfrosch has joined #ruby
<banseljaj> sguy: o.o
<banseljaj> ewwww
tijmencc has joined #ruby
nobitanobi has joined #ruby
<sguy> haha, I didn't write it and I intend to port it but right now I don't have the time
Carlito__ has joined #ruby
Carlito__ has quit [#ruby]
<banseljaj> shevy: what would be a great way to squash two arrays into a hash?
Paradox2000 has joined #ruby
Paradox2000 has joined #ruby
<banseljaj> making one array the key ans the other value?
nielsk has joined #ruby
<nielsk> hi
<nielsk> I'm using only the xcode-command line tools on OS X (no xcode installed) and when I want to install some gems I get the error-message that no xcode-folder is set. What can I do?
igotnolegs has joined #ruby
adamkittelson has joined #ruby
<Tasser> banseljaj, #zip
<banseljaj> Tasser: that returns an Array of Arrays
<banseljaj> Actually, that works. Thanks. :)
mercyroa has joined #ruby
zakwilson has joined #ruby
cmpf has joined #ruby
<shevy> hehe
<shevy> banseljaj on his way to ruby guru :)
* banseljaj is embarrassed
baroquebobcat has joined #ruby
<nielsk> problem solved
<nielsk> exit
nielsk has quit ["Linkinus - http://linkinus.com"]
cwill747 has joined #ruby
nobitanobi has joined #ruby
maletor has joined #ruby
kemet has joined #ruby
deobald has joined #ruby
dubellz has joined #ruby
shadoi has joined #ruby
hormigas has joined #ruby
xpot-mobile has joined #ruby
dubellz has joined #ruby
<shevy> lol
shruggar has joined #ruby
xpot-station has joined #ruby
nobitanobi has joined #ruby
xpot-station has joined #ruby
<shadoi> mensa180: look at QT
<shadoi> or GTK… or… pretty much anything that isn't Tk.
xpot-station has joined #ruby
hormigas has joined #ruby
tayy has joined #ruby
Morkel has joined #ruby
xpot-station has joined #ruby
_root_ has joined #ruby
nobitanobi has joined #ruby
polishguy94 has joined #ruby
<polishguy94> How can I use erb in javascripts?
xpot-station has joined #ruby
rosslazer has joined #ruby
<rosslazer> I need to compare every element of a String array to every element of another String array and parse the matches any ideas?
xpot-station has joined #ruby
pen has joined #ruby
xpot-station has joined #ruby
<virunga> rosslazer, give a look at the rassoc method of the Array class
<virunga> maybe can help
madsgraphics has joined #ruby
<rosslazer> thanks
nobitanobi has joined #ruby
<virunga> after a better look it seems not much helping
<Paradox2000> Anybody knows about GTK bindings for Ruby?
<shevy> Paradox2000 they work
Sailias has joined #ruby
<Paradox2000> Can you point me to one?
<shevy> not sure what you mean
darkf has joined #ruby
<Paradox2000> Just leave it ha
<shevy> the official bindings can be obtained from: http://ruby-gnome2.sourceforge.jp/?News_20120408_1
<shevy> they come bundled with a few hundred ruby-gtk .rb scripts
<Paradox2000> Yeah. That's what I was looking for.
<shevy> look at the "demo" part
timonv has joined #ruby
<virunga> rosslazer, ary1 & ar2 returns a new array containing elements common to the two arrays
looopy has joined #ruby
nobitanobi has joined #ruby
keyword has joined #ruby
blast_hardcheese has joined #ruby
<keyword> anyone knows how to check proxies with ruby?
<Paradox2000> keyword: What exactly do you want to do?
nobitanobi has joined #ruby
nobitanobi has quit [#ruby]
<keyword> Paradox2000: I have a list of proxy I want to check if these are working
medik has joined #ruby
<Paradox2000> Hmm. I have no idea.
y3di has joined #ruby
<y3di> how can I convert my postgreSQL select result to json?
<keyword> virunga: yeap I made one checker with ping but I want to test if with this proxy I can browse
rckericklan has joined #ruby
<Paradox2000> keyword: I think the only way to do that would be to actually connect through the proxy.
darthdeu has joined #ruby
<y3di> how can I convert my postgreSQL select result to json?
keyword has quit [#ruby]
khakimov has joined #ruby
ramblex_ has joined #ruby
<darkf> y3di: same way you convert anything else to jsom.
<darkf> *json
platzhirsch has joined #ruby
<platzhirsch> I want to compute the sum of an array, but before square each element, what would be the shortest way to implement that?
nitram_macair_ has joined #ruby
mosheee has joined #ruby
mosheee has joined #ruby
hadees has joined #ruby
<darkf> platzhirsch: reduce
eregon_ has joined #ruby
<musee> http://pastie.org/3835598 how can I get smallerfoo() here to see foo()?
pzol_ has joined #ruby
<platzhirsch> darkf: perfect, thanks
ohcibi_ has joined #ruby
<musee> (or is that just a bad idea?)
<darkf> musee: of coursei t's a bad idea
Mch1 has joined #ruby
Freijo has joined #ruby
joppe_ has joined #ruby
<musee> xD
masterhumper has joined #ruby
elspeth_ has joined #ruby
any-key_ has joined #ruby
<shevy> [1,2,3].inject(0) {|product, element| product += element * element} # => 14
jjp_ has joined #ruby
ramblex has joined #ruby
mbreit_ has joined #ruby
nwkr has joined #ruby
<platzhirsch> darkf: though not sure how to do it with reduce, with inject I could do: arr.inject { |sum, n| sum + n ** 2 } but how to add the the square?
EddieS has joined #ruby
<y3di> darkf: I'm completely new to json? how do you convert stuff to json? i got the json gem, is it just json.generate(data)> #this is what I'm going to try
QKO has joined #ruby
wereHams1er has joined #ruby
mpereira1 has joined #ruby
<y3di> also, i'm getting a weird undefined method '-' error
<shevy> platzhirsch take the .inject example I gave, but I think, reduce is an alias to injekt
<shevy> *inject
<y3di> does ruby not have subtract...?
<shevy> y3di, pls dont be silly :P
<y3di> oh nvm i have to convert the int from a string lol =p
_main_ has joined #ruby
<waxjar> isn't it just data.to_json ?
<shevy> musee that does not work because the method that you call resides in another class
<shevy> what you could do is def self.foo
<shevy> and BigClass.foo
<shevy> rather than foo()
<musee> can I just call BigClass.foo?
<shevy> if you did self.foo
<shevy> if not, then you must go via .new and call .foo on your object
tommyblu` has joined #ruby
PhilK_ has joined #ruby
jonathanwallace has joined #ruby
l3ck has joined #ruby
<rosslazer> Any mongo people out there?
kah_ has joined #ruby
ryanf has joined #ruby
<y3di> waxjar: to_json dones't work it returns "#<PG::Result:0x9a7a464>"
<y3di> json.generate() errored out
<burgestrand> y3di: convert it to a regular ruby type before you to_json it
<burgestrand> y3di: perhaps .to_a.to_json, or .all.to_json or whatever the call might be
<y3di> word to_a.to_json worked
<y3di> thanks burgestrand
<musee> shevy: technically this is what I really want to do: http://pastie.org/3835676
canton7 has joined #ruby
<musee> since I have to write several classes with the same named functions
<waxjar> should the *methods all behave the same in every class?
<shevy> if you subclass then you can do this musee
<shevy> in initialize of your child class, call super() in def initialize
<shevy> and then foo in that subclass method (as alias to the method in the parent)
<musee> I get a NameError when I try to subclass in a module - I'm thinking that it's not possible?
lindenle has joined #ruby
<shevy> paste the code that makes the error pls
<musee> h/o
ikaros has joined #ruby
<waxjar> classes can only inherit from classes
FACEFOX-DOT-COM has joined #ruby
Whoop has joined #ruby
end3r- has joined #ruby
emmanuelux has joined #ruby
machine1 has joined #ruby
cigana has joined #ruby
sbanwart has joined #ruby
<musee> oh, their being in different files is causing this -_-
cigana has quit [#ruby]
eeadc has joined #ruby
cfein has joined #ruby
meskyanichi has joined #ruby
<musee> /home/liliff/zabbixmonitortest/test2.rb:2:in `<module:Zabbix>': uninitialized constant Zabbix::API (NameError)
FACEFOX has joined #ruby
<musee> would be the error
_|christian|_ has joined #ruby
<burgestrand> musee: you are loading the test2 file before Zabbix::API is defined
<Paradox2000> musee: Try require_relative 'test' in test2.rb
<musee> burgestrand: that makes sense
<musee> Paradox2000: i think that'd cause a loop in requires xD
<Paradox2000> musee: remove reuire from test.rb
<Paradox2000> *require
<burgestrand> musee: it’s okay, ruby protects you from that
welterde has joined #ruby
<Paradox2000> musee: Does this work: http://pastie.org/3835754 ?
<musee> burgestrand: works :)
<musee> moving the require after defining the class that is
SirFunk has joined #ruby
<musee> Paradox2000: I'm going to be only calling test.rb so test2.rb would never load like that
<Paradox2000> OH I see.
<musee> but, moving the require works like a charm
ed_hz_ has joined #ruby
giftfrosch has joined #ruby
<Paradox2000> musee: Good :)
Squarepy has joined #ruby
Squarepy has joined #ruby
<musee> i think.
sterNiX has joined #ruby
sterNiX has joined #ruby
dominikh has joined #ruby
<tommylommykins> me is trying to experiment with rdoc
<musee> ah yeah it does. I just forgot I totally broke every piece of other code I already had written.
<musee> lol
<tommylommykins> but on 1.9.3, I'm getting
<tommylommykins> require 'rdoc' ===> true
<tommylommykins> RDoc::Markup::ToHtml.new ===> unitialized constant RDoc::Markup
<tommylommykins> Any hints on what I did wrong?
c0rn has joined #ruby
mischief has joined #ruby
mikepack has joined #ruby
robdodson has joined #ruby
mercyroa has quit [#ruby]
<Squarepy> tommylommykins, you have to require 'rdoc/markup'
machine1 has joined #ruby
zakwilson has joined #ruby
<tommylommykins> ohh
<Squarepy> tommylommykins, you have to require 'rdoc/markup/to_html'
<Squarepy> both of them
<tommylommykins> :D
<Squarepy> :p
<robdodson> i'm reading the ruby pickaxe book and I'm on to the section about fibers and threads. Are threads used a lot or is it more of a language feature that I might only run into every once in a while? trying to figure out how much of this chapter I should be really committing to memory
<tommylommykins> hmm, is there a shortcut for this? require 'rdoc/*' or 'rdoc/all' or anything like that?
baroquebobcat has joined #ruby
<Squarepy> robdodson, running paralllel stuff is not needed in general, IMHO
<ramblex> tommylommykins: require 'rdoc/markup/to_html'
davidpk has joined #ruby
academic has joined #ruby
workmad3 has joined #ruby
meskyanichi has joined #ruby
ramblex has joined #ruby
cantonic has joined #ruby
fr0gprince_ has joined #ruby
banisterfiend has joined #ruby
<musee> lol
<musee> er
seanstickle has joined #ruby
dwon has joined #ruby
brngardner has joined #ruby
jgrevich_ has joined #ruby
machuga has joined #ruby
tomzx has joined #ruby
y3di has quit [#ruby]
eph3meral has joined #ruby
prometheus has joined #ruby
robert_ has joined #ruby
thecreators has joined #ruby
<tommylommykins> btw, is there any plan to make the docs for the English module a bit less degenerate?
<tommylommykins> lookl a bit crap..
<tommylommykins> *looks
iocor has joined #ruby
cobragoat has joined #ruby
Gesh has joined #ruby
c0rn has joined #ruby
<banisterfiend> tommylommykins: you mean the website itself?
prometheus has joined #ruby
beilabs has joined #ruby
<tommylommykins> I don't know exactly what's wrong
<tommylommykins> But I think it's undeniable that something hasn't worked
<tommylommykins> Because the english module is enoooormous
<tommylommykins> but the official docs has absolutely no documentation on it
araujo has joined #ruby
<banisterfiend> tommylommykins: you realize the website uses frames and your link didnt link to it right?
<tommylommykins> poo
<tommylommykins> but yeah, the documentation for English
<banisterfiend> tommylommykins: i dont use that website anyway
<banisterfiend> tommylommykins: http://rdoc.info/stdlib
Prometheu5 has joined #ruby
VegetableSpoon has joined #ruby
<tommylommykins> hmm, it's the same issue there
<tommylommykins> actually, English is only a list of aliases
<tommylommykins> but there is still no documentation for it
<banisterfiend> tommylommykins: probably because it contains no methods classes
<banisterfiend> tommylommykins: it just defines some global variables
<banisterfiend> so it's impossible to document normally (except by a long boring readme)
caiges has joined #ruby
prometheus has joined #ruby
mistergibson has joined #ruby
brngardner has joined #ruby
zakwilson has joined #ruby
Prometheu5 has joined #ruby
Sou|cutter has joined #ruby
Drewch has joined #ruby
netrealm has joined #ruby
atmosx has joined #ruby
Boohbah has joined #ruby
<mensa180> dumb question: I have a variable, I want to define a second variable to have the same value as the first, but not change when the first does, how can I do this?
<mensa180> e.g. I have @grid, I tried @orig_grid = @grid, but @orig_grid changes with @grid.
<mensa180> I want to keep @grid 's original value.
havenn has joined #ruby
<banisterfiend> mensa180: @grip = @orig_grid.dup
two- has joined #ruby
thams has joined #ruby
<mensa180> banisterfiend: @orig_grid = @grid.dup ?
<mensa180> (didn't work)
<banisterfiend> mensa180: what kind of object is @orig_grid?
<mensa180> banisterfiend: grid is a list containing 9 lists, representing the rows of a sudoku board.
<banisterfiend> mensa180: then u need to implement your own deep_copy method
krz has joined #ruby
<banisterfiend> mensa180: or read about the Marshal.dump / Marshal.load trick
<mensa180> Thanks, reading up now.
elake has joined #ruby
<mensa180> banisterfiend: Marshalling worked, thanks again.
zakwilson has joined #ruby
wookiehangover has joined #ruby
thams has joined #ruby
Cache_Money has joined #ruby
pun has joined #ruby
jrgifford has joined #ruby
pen has joined #ruby
AlbireoX has joined #ruby
Vert has joined #ruby
brngardner has joined #ruby
berserkr has joined #ruby
wookiehangover has joined #ruby
ringotwo has joined #ruby
atmosx has joined #ruby
mickn has joined #ruby
codezombie has joined #ruby
libertyprime has joined #ruby
mischief has quit [#ruby]
machuga has quit [#ruby]
atmosx has joined #ruby
Xylo has joined #ruby
Rambozo has joined #ruby
Ethan has joined #ruby
atmosx has joined #ruby
broadcast has joined #ruby
_main_ has joined #ruby
sam113101 has joined #ruby
redgetan has joined #ruby
visof has joined #ruby
visof has joined #ruby
mikos has joined #ruby
luckyruby has joined #ruby
kevinbond has joined #ruby
pen has joined #ruby
mdw_ has joined #ruby
<mensa180> could someone help me figure out why my label isn't placing correctly? http://pastie.org/3836437 -- line 48
Shoobdidoo has joined #ruby
kevinbond has joined #ruby
kevinbond has joined #ruby
dbgster has joined #ruby
TheIronWolf has joined #ruby
cableray has joined #ruby
Kichael has joined #ruby
Ontolog has joined #ruby
Mon_Ouie has joined #ruby
jimeh has joined #ruby
caiges has joined #ruby
xsdg has joined #ruby
atmosx has joined #ruby