ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
<erikh> it's nice. sunny here.
<erikh> I work with raggi these days
<freedrull> zenspider: thanks
<zenspider> did that work?
burns180_ has joined #ruby-lang
<freedrull> zenspider: ahh uhh
<freedrull> no i don't really know where to look for the method names in the massive output '-v' gives me
<zenspider> each line output is a method name
<zenspider> so you can see how shoulda is munging the method names so that you can figure out what to feed to -n
<zenspider> gotta run. good luck freedrull
<freedrull> yeah i should see the original method name right, before it transforms it into "test: blahblah should
<freedrull> oh ok
eggman2002 has joined #ruby-lang
eggman2002 has quit [#ruby-lang]
eggman2002 has joined #ruby-lang
eggman2002 has quit [#ruby-lang]
SuperTaz_work has joined #ruby-lang
gsav has joined #ruby-lang
virunga has joined #ruby-lang
<imperator> quiet people, i'm trying to watch battle beyond the stars
Joeysomo has joined #ruby-lang
looopy has joined #ruby-lang
brownies has joined #ruby-lang
thone has joined #ruby-lang
xjonc has joined #ruby-lang
brushbox has joined #ruby-lang
Stalkr_ has joined #ruby-lang
brushbox1 has joined #ruby-lang
Boohbah has joined #ruby-lang
ascarter has joined #ruby-lang
takaokouji has joined #ruby-lang
justinxreese has joined #ruby-lang
Sailias_ has joined #ruby-lang
Giddeon has joined #ruby-lang
jacktrick has joined #ruby-lang
<shevy> breaaaathe slowly
Joeysomo has joined #ruby-lang
<shevy> taaaaake your time
Keva161 has joined #ruby-lang
burns180 has joined #ruby-lang
rohit has joined #ruby-lang
<andrewvos> shevy: Do you not sleep?
<shevy> andrewvos cyborgs dont need sleep
<shevy> ask imperator
<shevy> when he gets back
<shevy> that lazy bum
<andrewvos> How old are you?
<shevy> you wont believe me
<andrewvos> I will
<shevy> now I dont believe you
<erikh> hey guys i'm at the bar getting drunk
<andrewvos> erikh: It's like 5pm there?
<erikh> yes
<shevy> cool
<andrewvos> I left the bar like two hours ago. There aren't any open anymore :/
<deryldoucette> i was going to go, but decided to stay home. besides its about -10C out. I like my beer cold, rather than me.
<shevy> drink one for me too erikh!
<erikh> I am drinking delirium tremens
<andrewvos> shevy: You're 38?
<drbrain> erikh: well, you can't use your ogre slaying knife
<shevy> andrewvos man you have to drink more
<andrewvos> shevy: 27?
<erikh> drbrain: I am confused
<shevy> hmm I should get drunk too
<shevy> but it's too late already
<erikh> it's just starting to get cold here
<erikh> been ~75 all day
<andrewvos> 23 celcius = meh
<erikh> pretty nice day when you've lived in portland and philly all your life
<erikh> well, most of it at this point
<erikh> heh, i'm outside at a loud bar
<erikh> I'll have to watch later.
<drbrain> erikh: I know you're outside by the bar
looopy has joined #ruby-lang
<andrewvos> erikh: What's happening are you all at some ruby convention or some shit?
<erikh> god no
<andrewvos> shevy: Tell me how old you are.
<erikh> i'm just bored and it's 5:30pm on a friday
<shevy> you are drunk
<shevy> I'll tell you when you sober up again
<andrewvos> Someone committed this to fuckingawesomesongs.com :/ http://www.youtube.com/watch?v=2rlYPb2plaY
<andrewvos> shevy: I don't drink
<erikh> what's wrong with you
<andrewvos> Who me?
<erikh> no the other guy
<andrewvos> shevy: You're 32
<erikh> why does it matter?
<andrewvos> Not sure. Would just like to know.
looopy has joined #ruby-lang
hagabaka has joined #ruby-lang
shtirlic has joined #ruby-lang
chessguy has joined #ruby-lang
burns180_ has joined #ruby-lang
<andrewvos> Damn https://github.com/AndrewVos/fuckingawesomesongs.com has got some cool shit on there
t4nk101 has joined #ruby-lang
<erikh> can I fill up up with delicious metal?
<andrewvos> erikh <-- is that your github account?
<erikh> yes
<andrewvos> erikh: yep
<erikh> yay
<erikh> get ready for a lot of opeth
<andrewvos> :)
<t4nk101> Just to let you guys know, after a fresh install of OSX lion & XCode 4.3, trying to install Ruby 1.9.3 and Rails is a pain in the ass! WTF
<andrewvos> cool story bro
<t4nk101> i spent nearly 4 hours googling shyt and trying to figure it out
<t4nk101> what a relief!!!!!
<erikh> it's called shit
<t4nk101> really
<andrewvos> t4nk101: Were you using rvm
<erikh> shyt is something JRR Tolkien would use to appease his children
<andrewvos> ?
<t4nk101> @andrewvos yes
<andrewvos> oh :( :(
<t4nk101> yep!
<t4nk101> Xcode 4.3 is not what 4.2 was
<erikh> hmm
<erikh> i'm going to miss the train
<t4nk101> it's not a bug
<t4nk101> it's just that 4.3 is missing some tools
<t4nk101> doesn't install command line tools by default
<t4nk101> and even after it does...autoreconf. is missing
<t4nk101> good luck with shit
<t4nk101> anywho...just wanted to come here and vent!
<t4nk101> have a great weekend peeps
<t4nk101> adios
<erikh> you too
<t4nk101> exit
<t4nk101> lol
<andrewvos> heh
<andrewvos> fg
<erikh> try it with a leading /
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
gnufied has joined #ruby-lang
krz has joined #ruby-lang
Spooner has joined #ruby-lang
dr0id has joined #ruby-lang
burns180 has joined #ruby-lang
looopy has joined #ruby-lang
fayimora has joined #ruby-lang
dfr|mac has joined #ruby-lang
dfr|mac_ has joined #ruby-lang
iande has joined #ruby-lang
nofxx has joined #ruby-lang
etrever has joined #ruby-lang
nguerin has joined #ruby-lang
etrever_ has joined #ruby-lang
Sailias_ has joined #ruby-lang
dv310p3r has joined #ruby-lang
burns180_ has joined #ruby-lang
gsav has joined #ruby-lang
burns180 has joined #ruby-lang
burns180 has joined #ruby-lang
Phrogz has joined #ruby-lang
<Phrogz> Anyone in here use RMagick? Is the best way to create a Magic::Image from a file Magick::ImageList.new(path)[0] ?
New2Ruby has joined #ruby-lang
<New2Ruby> How do I check for valid vars and defs loaded into an irb session?
<rue> What's the operative word there?
<rue> Valid? Loaded? Irb?
<New2Ruby> loaded
<erikh> valid
<erikh> I win
<erikh> I am right.
<New2Ruby> in python its dir()
etrever has joined #ruby-lang
<rue> Sounds odd
<New2Ruby> valid == constructed, initialized,
<rue> Maybe #local_variables, #constants, $LOADED_FEATURES ?
<New2Ruby> if I want irb to run a script and keep its methods available are there any special flags
<Phrogz> New2Ruby: You're trying to find out what variables and methods exist?
<erikh> hrm
<New2Ruby> Phrogz: Only the ones from the scripts I am trying to run
<erikh> you might be better off with ruby-debug
<rue> If you require or load a file, anything public in it will be available
<rue> If you run a file, via system or something, then no.
<rue> By and large, we rely on documentation to find out what a file does
<nofxx> just use pry
<nofxx> 'ls' might be what you are looking for
<New2Ruby> In linux the methods from my scripts seemed to stay in the interpreter
<nofxx> and you can walk in and out classes and modules with 'cd' New2Ruby
<New2Ruby> On windows IRB runs the script and then forgets that any of the methods or vars existed
<Phrogz> New2Ruby: [citation needed]
<rue> Weird. The irb session stays open?
<New2Ruby> How else do you work with a script interactively?
<rue> If that happens on Windows, it's a bug.
<rue> So, the short answer to your question is that you use irb, or pry.
<New2Ruby> irb, what is pry
<New2Ruby> ?
<erikh> ruby-debug
<erikh> sheesh.
jxie has joined #ruby-lang
<rue> I don't think a debugger is an appropriate tool for this
<erikh> pry's nice but you're asking for features of a debugger
<erikh> well I think it's obvious at this point we disagree
<erikh> :P
<nofxx> New2Ruby: dual boot or install linux in some VM mate, you'll way more happier. ruby and all the good stuff
<New2Ruby> Ok, iwas trying to avoid that but it is what it is
<rue> I assume the problem here stems only from irb on Windows (or more likely, this particular installation) not working correctly
<shevy> hmmmm
<erikh> luis could probably fix that if he had a bug report
<erikh> esp. because he's like the nicest guy in open source, ever.
<rue> I'm pretty sure it'd be fixed if it were a common issue
<nofxx> New2Ruby: what keeps you on windows?
<rue> New2Ruby: How did you install your environment? RubyInstaller?
igotnolegs has joined #ruby-lang
<rue> Or, rather, it would already have been fixed.
Karmaon has joined #ruby-lang
<New2Ruby> Legacy laptop that was around before wireless drivers were available for linux systems without alot of magic
burns180_ has joined #ruby-lang
<rue> They are available now…
wallerdev has joined #ruby-lang
etrever has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
igaiga has joined #ruby-lang
whatasunnyday has joined #ruby-lang
burns180 has joined #ruby-lang
imperator has joined #ruby-lang
Sailias has joined #ruby-lang
nguerin has joined #ruby-lang
chimkan_ has joined #ruby-lang
chimkan_ has joined #ruby-lang
TheMoonMaster has joined #ruby-lang
<imperator> hm, why does libreoffice texteditor look pretty nice, but the OOO texteditor on osx looks like poo?
WillMarshall has joined #ruby-lang
rippa has joined #ruby-lang
burns180_ has joined #ruby-lang
andkerosine has joined #ruby-lang
<andkerosine> eval `curl -s http://i.imgur.com/fTuHW.png`[46..106]
<andkerosine> ^_^
achiu1 has joined #ruby-lang
yugui_zzz has joined #ruby-lang
nguerin has joined #ruby-lang
<imperator> eval'ing external data - what could go wrong?
<andkerosine> I knew nobody would run it straight, of course.
<andkerosine> Easy enough to change eval to puts.
<wallerdev> no sensible-browser for me
<andkerosine> Why ever not?
lchi has joined #ruby-lang
imperator has quit ["Leaving"]
curtism has joined #ruby-lang
rippa has joined #ruby-lang
<wallerdev> on a mac
moemen has joined #ruby-lang
wyhaines has joined #ruby-lang
igotnolegs has joined #ruby-lang
ryanf has joined #ruby-lang
<cout> imperator: nothing that a good rm -rf and an excursion to the bahamas wouldn't solve
Banistergalaxy has joined #ruby-lang
burns180 has joined #ruby-lang
nguerin has joined #ruby-lang
Phrogz has joined #ruby-lang
ryez has joined #ruby-lang
srbaker has joined #ruby-lang
cdnz has joined #ruby-lang
seanstickle has joined #ruby-lang
x0F__ has joined #ruby-lang
gianlucadv has joined #ruby-lang
burns180_ has joined #ruby-lang
twittard has joined #ruby-lang
frem has joined #ruby-lang
banisterfiend has joined #ruby-lang
<banisterfiend> yo oy yo
srbaker has joined #ruby-lang
Avanine has joined #ruby-lang
Avanine has joined #ruby-lang
xjonc has joined #ruby-lang
burns180 has joined #ruby-lang
Tick-Tock has joined #ruby-lang
A124 has joined #ruby-lang
aza_kibou has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
febeling has joined #ruby-lang
febeling has quit [#ruby-lang]
burns180 has joined #ruby-lang
dine_ has joined #ruby-lang
<dine_> Hi, All, I have pasted one array on http://pastie.org/3562545, need to find all excep first, can anybody has any idea
<seanstickle> Array#shift
<ryanf> dine_: arr.drop(1)
<dine_> ryanf: oh great..Thanks
<ryanf> also I'm not sure "efflorescent" is the word you want
<ryanf> but that's not ruby
canton7 has joined #ruby-lang
PhilCK has joined #ruby-lang
gsav has joined #ruby-lang
indeterminate has joined #ruby-lang
Giddeon has joined #ruby-lang
<andkerosine> "efflorescent" made my day.
<andkerosine> Thank you, dine_.
<dine_> andkerosine: I was trying to write efficient, but mistakenly written "efflorescent" :)
<andkerosine> dine_: Yep, gathered that. It's still a great word, fictive or not.
burns180 has joined #ruby-lang
frem has joined #ruby-lang
Guest68355 has joined #ruby-lang
burns180_ has joined #ruby-lang
tekin has joined #ruby-lang
sandbags has joined #ruby-lang
nofxx has joined #ruby-lang
Gray has joined #ruby-lang
havenn has joined #ruby-lang
dr0id has joined #ruby-lang
postmodern_ has joined #ruby-lang
ramonmaruko has joined #ruby-lang
gsav has joined #ruby-lang
adambeynon has joined #ruby-lang
burns180 has joined #ruby-lang
nofxx has joined #ruby-lang
workmad3 has joined #ruby-lang
Zolrath has joined #ruby-lang
nofxx has joined #ruby-lang
Gray has joined #ruby-lang
ramonmaruko has joined #ruby-lang
justinmcp has joined #ruby-lang
dreinull has joined #ruby-lang
<erikh> drbrain: I'm casting "magic missile"
<drbrain> :D
<erikh> it's been a while since I've seen this
<erikh> drbrain: CAN I GET A MOUNTAIN DEW
apeiros_ has joined #ruby-lang
banister_ has joined #ruby-lang
<banister_> hiyas
<rue> HI
burns180_ has joined #ruby-lang
DarkGray has joined #ruby-lang
<DarkGray> Hello, guys!
<DarkGray> i read this book: http://pine.fm/LearnToProgram/?Chapter=08
PhilCK has joined #ruby-lang
<DarkGray> and don't understand what do this code: http://pastie.org/3563163
<DarkGray> always will be #=> 0
<apeiros_> no, it's integer division, it won't be 0 if you have something bigger than 100
frangiz has joined #ruby-lang
<apeiros_> also it looks like a poor-man's modulus…
<apeiros_> yeah, poor man's divmod…
<apeiros_> it's sad, learntoprogram is good but it teaches bad ruby :-/
<apeiros_> e.g. with 1297, you'll get write == 12 and left == 97
<apeiros_> can be done easier as: write, left = 1297.divmod(100)
<DarkGray> any help?
<apeiros_> DarkGray: ^
<erikh> apeiros_: teaching the underlying implementation isn't necessarily bad
<banistergalaxy> about to drive home pretty stoned
<banistergalaxy> this will be fun
<apeiros_> banistergalaxy: :-S
<apeiros_> erikh: agreed. but if the aim is to teach programming and not maths, then it's unnecessary and misses the opportunity to show a concise method
<erikh> oh, it all depends on if they're teaching "now that you've learned how this works, check out this awesome divmod method" later
<apeiros_> afair, it doesn't :-/
<erikh> it's one of things I really like about zedas's books
<erikh> "here's a bunch of shit I taught you. here's how you can do it in one line."
<apeiros_> also, it teaches a style that deviates from the convention, uses things like `while not cond` and never tells "oh, and that can also be written as `until cond` etc.
<erikh> ah
<erikh> well, nobody's perfect I guess.
<apeiros_> of course
<apeiros_> and as said, besides those things, it's IMO a good resource
<apeiros_> so… just let people learn through it and then have another step learning the conventions and more concise constructs
WillMarshall has joined #ruby-lang
xjonc has joined #ruby-lang
cyri_ has joined #ruby-lang
dejongge has joined #ruby-lang
Keva161 has joined #ruby-lang
Nss has joined #ruby-lang
burns180 has joined #ruby-lang
burns180 has joined #ruby-lang
voker57_ has joined #ruby-lang
mssola has joined #ruby-lang
Kedare has joined #ruby-lang
iande_ has joined #ruby-lang
burns180_ has joined #ruby-lang
iande has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
postmodern has joined #ruby-lang
igaiga has joined #ruby-lang
sysbeast has joined #ruby-lang
verto|sleep has joined #ruby-lang
benanne has joined #ruby-lang
burns180 has joined #ruby-lang
m3nd3s has joined #ruby-lang
justinmcp has joined #ruby-lang
mytrile has joined #ruby-lang
gnufied has joined #ruby-lang
sym- has joined #ruby-lang
riffraff has joined #ruby-lang
SiliconDon has joined #ruby-lang
Silicon|Don has joined #ruby-lang
SiliconDon has joined #ruby-lang
<Defusal> anyone know how to kill a process started with EM.popen?
<Defusal> ah theres a #get_pid so i guess you have to do it manually
burns180_ has joined #ruby-lang
verto has joined #ruby-lang
DarkGray has joined #ruby-lang
virunga has joined #ruby-lang
<DarkGray> Aaaaa http://pine.fm/LearnToProgram/?Chapter=08 i don't understand last big example. But i understand methods, parameters, local variables, return values.
<DarkGray> my understanding of the algorithms - very bad
wyhaines has joined #ruby-lang
enebo has joined #ruby-lang
wyhaines_ has joined #ruby-lang
toretore has joined #ruby-lang
Spooner has joined #ruby-lang
verto has joined #ruby-lang
Guest30611 has joined #ruby-lang
verto_ has joined #ruby-lang
jcru has joined #ruby-lang
burns180 has joined #ruby-lang
burns180 has joined #ruby-lang
wyhaines has joined #ruby-lang
tomzx has joined #ruby-lang
stderr- has joined #ruby-lang
aef_ has joined #ruby-lang
cronin101 has joined #ruby-lang
ReinH has joined #ruby-lang
epitron has joined #ruby-lang
epitron has joined #ruby-lang
tommyblue has joined #ruby-lang
jico has joined #ruby-lang
jico has joined #ruby-lang
a3li has joined #ruby-lang
masterkorp has joined #ruby-lang
LanceHaig has joined #ruby-lang
Joeysomo has joined #ruby-lang
eban has joined #ruby-lang
zmack has joined #ruby-lang
TheDracle has joined #ruby-lang
erikh has joined #ruby-lang
soahccc` has joined #ruby-lang
Utkarsh has joined #ruby-lang
jwollert has joined #ruby-lang
gnufied has joined #ruby-lang
dhruvasagar has joined #ruby-lang
Faris has joined #ruby-lang
tobiasvl has joined #ruby-lang
lupine_85 has joined #ruby-lang
rippa has joined #ruby-lang
seanstickle has joined #ruby-lang
ankurgel has joined #ruby-lang
ankurgel has quit [#ruby-lang]
ankurgel has joined #ruby-lang
<Defusal> bleh
fahadsadah has joined #ruby-lang
<Defusal> im trying to come up with a decent DSL for inter-module events
tris has joined #ruby-lang
<Defusal> i wanted to use module ModuleOne; ModuleTwo.on :event_name do end end, but then the callbacks are stored in ModuleTwo, which means theres no way to know they were registered from ModuleOne, which will create orphaned callbacks when ModuleOne is reloaded... does anyone have a better idea than having to use something like: module ModuleOne; on ModuleTwo, :event_name do end end
<Defusal> unfortuantly theres no way to get he caller binding, so i guess options are rather limited, but maybe someone has a clever idea...
<Defusal> the*
workmad3 has joined #ruby-lang
zmack has joined #ruby-lang
DarkGray has joined #ruby-lang
<cout> defusal: when you pass a block via do/end, you implicitly get the caller's binding
<cout> that is, a Proc can act as a Binding
<DarkGray> i was disconntected, someony reply on my message?
<DarkGray> also where i can get log of chat?
<Defusal> cout, ohh, you're right, it's been so long since i've really worked on DSLs, i completely forgot that
<Defusal> thanks
burns180_ has joined #ruby-lang
<Defusal> do bindings still only have an #eval method?
<Defusal> ie. no way to execute code without using a string
imperator has joined #ruby-lang
<imperator> good morning my evil little ruby minions
<imperator> what shall we do today?
* Defusal remembers a time when he was able to ask himself such questions and even be able to take days off
<cout> defusal: use b.eval("proc { ... }") to get a Proc object that you can call (that way it's precompiled)
<erikh> elasticsearch is pretty freakin' neat
<Defusal> cout, i guess that isnt too bad
zmack has joined #ruby-lang
<ankurgel> to enable ri and rdoc in rvm; must use : rvm generate docs ?
<ankurgel> or there was something else apart from 'docs' there.
<imperator> does 1.9.3 build on solaris? i couldn't get it to build
<cout> imperator: I don't know why it wouldn't
<cout> what error do you get?
<imperator> cout, one sec, firing up the vm
<imperator> basically, after running configure, i run make and it...runs configure again
<cout> I've seen that happen before
<cout> it's okay as long as it runs configure with the same arguments or as long as it's running configure in a subdirectory
<cout> (i.e. I've seen that happen in some of my projects)
Phrogz has joined #ruby-lang
dhruvasagar has joined #ruby-lang
<cout> imperator: is it working now?
<imperator> cout, i'm compiling, i think i see what i did
<imperator> i have two toolchains on the solaris vm, the sun studio stuff and the gnu stuff
<imperator> i think i was mixing and matching toolchain bits
<cout> ah
<imperator> yep, using gmake instead of make worked :)
burns180 has joined #ruby-lang
Spooner has joined #ruby-lang
S0lign0c has joined #ruby-lang
tr-808 has joined #ruby-lang
<imperator> hm, doesn't look like rake-compiler is honoring gmake vs make
<imperator> couldn't install ffi until i temporarily symlinked make to gmake
wyhaines has joined #ruby-lang
reitelles has joined #ruby-lang
tekin has joined #ruby-lang
chimkan_ has joined #ruby-lang
<imperator> ArgumentError(<The given fd is not accessible because RubyVM reserves it>)
<imperator> don't see that one every day
adminigotic has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has joined #ruby-lang
<cout> imperator: rake has many such holes :(
<imperator> cout, yeah, i get some weird rake behavior sometimes as far as which env it picks up
<imperator> oh, now, this is some interesting behavior
gsav has joined #ruby-lang
burns180_ has joined #ruby-lang
<cout> I'm positive I could build something better than rake
<cout> but then I'm afraid people would use it :(
<imperator> lol
<cout> happened to me before, wrote something as proof of concept and then I find out people are using it in production because it work
<imperator> maybe it's time to revive, uh, that rake competitor
<cout> s
<imperator> runt?
* imperator looks
<imperator> hm, can't think of it, we started using it at work just before i left
<imperator> thor, that's it
adminigotic has joined #ruby-lang
<imperator> cout, ever use thor?
<cout> what's runt?
<cout> no, what's thor?
<imperator> runt must be something else, nm that
<cout> ROMP?
<imperator> not sure, i thought there was something else besides rake a long time ago, but i think it died off
<cout> oh
<cout> not sure what that would be
<cout> my biggest gripe with rake (maybe it's been fixed?) is it doesn't do C dependencies well
<imperator> rant, that's it
<cout> yeah, rant
<imperator> anyway, maybe one of those two would suit you better, without having to write your own :)
apeiros_ has joined #ruby-lang
<imperator> interesting behavior mentioned earlier: IO.fdwalk(0){ } raises that fd error, but IO.fdwalk(0){ |f| f.fileno } does not
Sailias has joined #ruby-lang
<rue> I don't think rant's been touched in ~5 years?
<cout> imperator: weird
<cout> imperator: my first guess is that it has something to do with the return value of the block
lchi has joined #ruby-lang
<imperator> i'll create a short ffi version (it happens with C, too) and paste it in a minute
xjonc has joined #ruby-lang
pxjorge has joined #ruby-lang
<imperator> rue, yeah, looks that way
cdnz has joined #ruby-lang
burns180 has joined #ruby-lang
publicvoid_ has joined #ruby-lang
pemeon has joined #ruby-lang
m3nd3s has joined #ruby-lang
tekin has joined #ruby-lang
apeiros_ has joined #ruby-lang
looopy has joined #ruby-lang
AlHafoudh has joined #ruby-lang
DarkGray has joined #ruby-lang
dhruvasagar has joined #ruby-lang
curtism has joined #ruby-lang
curtism has joined #ruby-lang
dhruvasagar has joined #ruby-lang
fayimora has joined #ruby-lang
io_syl has joined #ruby-lang
burns180_ has joined #ruby-lang
ankurgel has quit [#ruby-lang]
darkf has joined #ruby-lang
srbaker has joined #ruby-lang
reitelles has quit [#ruby-lang]
robbyoconnor has joined #ruby-lang
PhilCK has joined #ruby-lang
seanstickle has joined #ruby-lang
DarkGray has joined #ruby-lang
iande has joined #ruby-lang
Heimidal has joined #ruby-lang
adambeynon has joined #ruby-lang
<DarkGray> seems.. understand how works each line of code from book and do same code - not easy...
<shevy> DarkGray bad book? :)
<rue> First, understand what the whole does
<rue> It's always easier to drill down to specifics than to try extrapolate what they amount to
jxie has joined #ruby-lang
nguerin has joined #ruby-lang
S1kx has joined #ruby-lang
S1kx has joined #ruby-lang
jacoby has joined #ruby-lang
burns180 has joined #ruby-lang
S1kx has joined #ruby-lang
Gray has joined #ruby-lang
Heimidal has joined #ruby-lang
virunga has joined #ruby-lang
Sailias has joined #ruby-lang
Tearan has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
Luxx_ has joined #ruby-lang
SkramX has joined #ruby-lang
xjonc has joined #ruby-lang
phlipper has joined #ruby-lang
nofxx has joined #ruby-lang
achiu1 has joined #ruby-lang
sandbags has joined #ruby-lang
workmad3 has joined #ruby-lang
wallerdev has joined #ruby-lang
looopy has joined #ruby-lang
Avanine has joined #ruby-lang
burns180_ has joined #ruby-lang
gjaldon has joined #ruby-lang
mark- has joined #ruby-lang
bglusman has joined #ruby-lang
looopy has joined #ruby-lang
spuk has joined #ruby-lang
solars has joined #ruby-lang
deryldoucette has joined #ruby-lang
Gray has joined #ruby-lang
ericmuyser has joined #ruby-lang
<Gray> guys, please help me understand recursion
nofxx has joined #ruby-lang
ankurgel has joined #ruby-lang
i-blis has joined #ruby-lang
<andrewvos> guys, please help me understand recursion
i-blis has joined #ruby-lang
<shevy> girls, please help me understand recursion
<deryldoucette> transvestites plese help me understand recursion
<shevy> hehehe
<shevy> I would think that the distribution here is
<shevy> 98.5% guys 1.0% girls and andrewvos holds the 0.5% for the last
<deryldoucette> doh!
<imperator> Gray, do you have a specific question?
CCD has joined #ruby-lang
CCD has quit [#ruby-lang]
lester_c has joined #ruby-lang
brownies has joined #ruby-lang
<lester_c> wats the deal
DarkGray has joined #ruby-lang
<shevy> hey wait
<shevy> DarkGray, are you also Gray?
i-blis has quit [#ruby-lang]
<DarkGray> yes
<DarkGray> i was disconnected
<DarkGray> and i don't know how to look chat histrory here
nofxx has joined #ruby-lang
<DarkGray> shevy: DarkGray - set as alternate nickname in my IRC clinet
<shevy> hmmm
<shevy> you should use xchat as client :P
<DarkGray> shevy: i 'am windows user :\ xchat - for linux?
<DarkGray> aslo: You may use XChat for Windows for free for 30 days. If, after this time, you would like to continue using the product, you are required to register. Registration is a one time fee of $19.99 USD (US Dollars) which can be paid using the PayPal service below.
<DarkGray> shevy: from here: http://xchat.org/windows/
Faris2 has joined #ruby-lang
<DarkGray> shevy: so, could you help me with recursion?)
burns180 has joined #ruby-lang
<theconartist> DarkGray: have you seen the movie inception
<theconartist> it's kind of like that
<chris2> DarkGray: def factorial(n); if n <= 1; n; else n*factorial(n-1); end
<chris2> DarkGray: evaluate factorial(3) in your head
wallerdev has joined #ruby-lang
Heimidal has joined #ruby-lang
davpoind has joined #ruby-lang
enebo has joined #ruby-lang
workmad3 has joined #ruby-lang
S2kx has joined #ruby-lang
<DarkGray> chris2 thanks
<DarkGray> theconartist: no, i don't seen inception
dhruvasagar has joined #ruby-lang
<DarkGray> chris2: what does mean ; n; ?
<DarkGray> this is for return value?
<chris2> yes
gix has joined #ruby-lang
rippa has joined #ruby-lang
Avanine has joined #ruby-lang
S1kx has joined #ruby-lang
S1kx has joined #ruby-lang
dhruvasagar has joined #ruby-lang
Avanine has joined #ruby-lang
<DarkGray> chris2: i don't understand sequence. What will be done first ? second ? n*factorial(n-1)
Zolrath has joined #ruby-lang
<chris2> its an if
<DarkGray> chris2: first n-1; second call new method
PhilCK has joined #ruby-lang
<chris2> well yes
<dreinull-> I'm refactoring my minitest suite and I'm wondering where to define instance vars that are valid for all tests.
<DarkGray> chris2: i'm sorry i don't understand how works code...
<DarkGray> chris2: i try execute it and get result i 3628800
<chris2> type it in yourself and indent it properly
<DarkGray> chris2: already
<chris2> do you know what factorial is?
<DarkGray> chris2: i don't understand only this: n*factorial(n-1);
<DarkGray> chris2: nope :\
burns180 has joined #ruby-lang
<shevy> DarkGray try the silverex build for windows
<chris2> DarkGray: factorial(5) = 1*2*3*4*5
<chris2> DarkGray: factorial(7) = 1*2*3*4*5*6*7
<chris2> the function computes it by recursion
<shevy> DarkGray, it is no longer actively maintained BUT it still works, and is much better than mIRC for instance http://www.silverex.org/download/
<shevy> oops
<shevy> chris2 showed that already
<kyrylo> shevy, what's wrong with mIRC?
<shevy> :(
<shevy> kyrylo it is ugly!
<chris2> can it do utf8 finally? :)
<kyrylo> shevy, ugly by the looks?
<DarkGray> i use KVIrc now...
<DarkGray> 4.0.4
<shevy> kyrylo yeah!
<DarkGray> so, as you recommend silverex.org - i try it.
<shevy> kyrylo and xchat is nicer to use
<shevy> sadly, xchat is also kinda dead these days :(
<kyrylo> How come? :)
<shevy> I dont want to go the irssi route...
iande has joined #ruby-lang
<DarkGray> chris2: i understand about factorial
<shevy> kyrylo it's hard to say! I used mIRC for many years when I was on windows.
<shevy> the whole "feel" of xchat is a lot nicer, as user, than it was in mIRC
<shevy> except that in mIRC you had those nice quick colour shortcuts in some list...was it that?
<shevy> yeah!
<shevy> that kinda sucks in xchat
<shevy> though itworks
<DarkGray> chris2: why we can't use loop?
<chris2> DarkGray: of course you can use a loop, but you can also use recursion
<shevy> hehe
<DarkGray> chris2: :( this is crazy hard for me
<andrewvos> shevy: How did you do colour there ??
<chris2> write the step in between when you do factorial(5)
<shevy> andrewvos there is some keycode possible, in mIRC you get the full listing, in xchat not. Here, in xchat it works for me if I press, for instance:
<shevy> strg +k, then a number
<shevy> (I think strg is control left)
<shevy> hi
<shevy> how are you
<chris2> time to colorban the channel
<shevy> lol
<iande> heh
<shevy> please I like colours!
<shevy> hmm
<andrewvos> string+k1
<andrewvos> err
<shevy> well some colours should be banned
<rippa> Beware of the Turing tar-pit in which everything is possible but nothing of interest is easy.
<shevy> andrewvos, for me I have to press ctrl_left+k, then a number. xchat inserts some "special" symbol when I do... but somehow mIRC was a lot easier in this regards
<shevy> this is one
<shevy> this is two
<shevy> this is three
<shevy> oh dear...
<uniqanomaly> is there shortcut for ponies or perhaps unicorns?
<shevy> hmm
<shevy> perhaps some client on osx
<shevy> or how do you insert fancy unicode characters?
<andrewvos> the fuck. it doesn't work in irssi
<lianj> blinking text is what most useful
<shevy> hmm no idea about irssi
<shevy> blinkblinkblinkblinkblink
<shevy> hmmmmmm
<dominikh> jesus effin christ. allow colours in an IRC channel and you can spot the idiots miles away.
<andrewvos> Calm down man. It's not like we're kicking babies in here.
* Avanine kicks babies.
<andrewvos> Well, not all of us.
adambeynon has joined #ruby-lang
<rippa> POLICE LINE
<dominikh> I wouldn't care about baby-kicking
<iande> but colors do cross the line
<shevy> rippa that's kinda cool
* muzone is now playing: http://home.no/dwaynie/dof.mp3
<rippa> inorite
<shevy> rippa, how do you do that? with your client?
<Avanine> my irc client filters out all of the coloring / formatting except for italics
<rippa> ctrl+k
<andrewvos> Avanine: _cool story bro_
<shevy> better than filtering babies
<rippa> and enter color
<dominikh> my irc client filters out the people instead.
<shevy> andrewvos guess you made it on his ignore now :(
<andrewvos> :( :( :(
<rippa> _______
<shevy> hmmm
<shevy> how is that even possible?
<rippa> taste the rainbow
<shevy> ah
<shevy> it's green text on green background etc..?
<rippa> white text
<rippa> underscore
<shevy> wha
<rippa> _______
<rippa> here's single-color variant
<heftig> why not spaces?
<rippa> spaces sometimes get trimmed
<lianj> annoyance progress bar?
<shevy> rippa, hmm I dont see any difference, unless that is how it's for you too http://www.pictureupload.de/originals/pictures/100312212631_UPLOAD.png
<rippa> you have white background
<shevy> whoa, colour attack
<cout> ew
<DarkGray> for stupid me, could some one describe iteration process what will be done? http://pastie.org/3566356
<shevy> manveru: is that weechat?
<manveru> shevy: yeah
<manveru> with my own theme though
burns180_ has joined #ruby-lang
<shevy> hehe
<shevy> DarkGray, minor thing at n*factorial(n-1); <--- why you have the ; there ?
<manveru> 5*(4*(3*(2*(1))))
<DarkGray> shevy: sorry
<shevy> DarkGray you must follow what the method does with the given input
<shevy> DarkGray, what is the input to that method?
<DarkGray> shevy: 5
<DarkGray> is input
<shevy> DarkGray yes
<shevy> what happens at the if n part? will it enter this part when the input is 5?
<shevy> if n <= 1
<shevy> if 5 <= 1
<DarkGray> shevy: i understand if.
<shevy> well, manveru gave the early solution already
<chris2> manveru: the pedagogical part comes when you do it stepwise
<DarkGray> if 5 <= 1 #=> else n*factorial(n-1)
<manveru> sorry, i suck as a teacher :(
<shevy> in a few years manveru's son will hack us into the ground with ruby code
<chris2> shevy: challenge accepted :P
<manveru> lol
<shevy> DarkGray well you copy pasted :D
<manveru> i'll make him a literal code genius so we can take out knuth
<shevy> DarkGray but yeah, the if part is not true, so we enter the else part
<shevy> and the else part calls the method again with a by-one decreased input
<manveru> def factorial(n) n.downto(1).reduce(:*) end
* manveru hides
<iande> hehe, I like that
<iande> I tend to prefer the map/inject solutions
<shevy> DarkGray, this works too http://pastie.org/3566399
<manveru> yeah, writing scheme in ruby is kinda missing the point
<shevy> hmm
<shevy> i like .downto
<shevy> not sure about the :*
<manveru> i still don't know wtf you even need factorials for
<shevy> :[] surprised me the most, I always see a smiley first
<chris2> manveru: it was just a simple example of how to use recursion
<manveru> aren't there nicer ways of learning recursion?
<chris2> i couldnt think of any that fitted in a line :P
<chris2> something with directory traversal perhaps
<manveru> dunno :|
<chris2> fib is silly too
<iande> the naive recursive fib isn't just silly, it's incredibly wasteful
<chris2> yeah
<DarkGray> shevy: i don't understand in recursion next: when n * factorial(n-1)
<iande> plus it's more complicated as a starter example
<shevy> DarkGray well, replace with the input number
<chris2> DarkGray: well, what is factorial(n-1)?
<chris2> what is n even
<shevy> :)
<shevy> DarkGray, what is n!!!
<shevy> ruby should be taught in school
<DarkGray> may be i need some sleep... thanks again
<shevy> to reach a distant goal one should make many baby steps
<chris2> DarkGray: it is really easy. just write down the steps
<shevy> I think he is doubting himself now
<shevy> being a teacher can be frustrating
<DarkGray> i don't understand moment when function return value.
<DarkGray> if we call function in function again and again
<chris2> yes
<chris2> what happens to n?
<shevy> yeah that is what we do
<shevy> yeah what happens to n! just insert the number DarkGray !!!!!
gregf has joined #ruby-lang
<shevy> write it down on paper if you have to
<shevy> manveru already gave the solution ... :(
<shevy> 5 * ( 4 * ( 3 * ( 2 * ( 1 ) ) ) )
<shevy> there, even with spaces now!
<shevy> hmmmm if I were a teacher, I would be very violent
havenn has joined #ruby-lang
<DarkGray> shevy: i understand
* manveru hands shevy a cluestick
<DarkGray> seems
<chris2> DarkGray: so, why is there no infinite loop?
<shevy> hehe
<DarkGray> because we have if
<DarkGray> if n == 1
<chris2> right!
<chris2> and there is no recursive call there
<chris2> and what happens to n on each call?
<DarkGray> we subtract 1 and pass it as parametr to the same method
<chris2> it gets smaller
<chris2> yes
<chris2> thats all you need for recursion
<chris2> call the function itself with an argument that is somehow "smaller", and make sure you stop calling if its small enough
<chris2> DarkGray: now look at this: http://sprunge.us/jZfF
<lianj> and try fact(20_000)
wyhaines has joined #ruby-lang
<DarkGray> chris2: give me a minute please
<chris2> take all the time you need
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
<DarkGray> chris2: returns only files or folders too ?
<chris2> both, yes
wallerdev has joined #ruby-lang
burns180 has joined #ruby-lang
<DarkGray> chris what does next?
<DarkGray> chris2: |file| next if
<chris2> it skip the loop for that value if the condition is true
<DarkGray> chris2: ok, thx
<DarkGray> chris2: it's don't stop loop, just skip it if condition is true?
<chris2> yes
<chris2> this just ensures that file is not . or .. later (why?)
<DarkGray> so, this code goes from root down to folders/files
<DarkGray> because we if we have no files and trying read.. will be a problems
<chris2> mmh
<chris2> you can try removing the next and see what happens
Sailias has joined #ruby-lang
pemeon has joined #ruby-lang
jacktrick has joined #ruby-lang
<DarkGray> chris2: '.' - current folder? '..' - partent folder?
twittard has joined #ruby-lang
nuclearsandwich has joined #ruby-lang
<DarkGray> chris2: so,seems i understand this code.
<DarkGray> chris2, shevy thank you for your time and patience
gregf has joined #ruby-lang
<shevy> yay, we train the rubyista of tomorrow!
<DarkGray> shevy: so, now i should try solve exercise from book
<DarkGray> shevy: see you tomorrow?)
lsegal has joined #ruby-lang
verto has joined #ruby-lang
<shevy> well
<shevy> I idle to power
<shevy> whether it is tomorrow or in 100000 years
virunga has joined #ruby-lang
igotnolegs has joined #ruby-lang
burns180_ has joined #ruby-lang
dagobah_ has joined #ruby-lang
towski has joined #ruby-lang
wallerdev has joined #ruby-lang
Guest68355 has joined #ruby-lang
chimkan_ has joined #ruby-lang
DEac- has joined #ruby-lang
burns180 has joined #ruby-lang
seanstickle has joined #ruby-lang
pemeon has quit [#ruby-lang]
postmodern has joined #ruby-lang
woollyams has joined #ruby-lang
fayimora has joined #ruby-lang
twittard has joined #ruby-lang
burns180_ has joined #ruby-lang
havenn has joined #ruby-lang
lsegal has joined #ruby-lang
lchi has joined #ruby-lang
petercooper has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
Hakon|mbp has joined #ruby-lang
<andrewvos> what should I watch after matrix 3?
<bougyman> Second Hand Lions
<andrewvos> bougyman: Let's keep to the same kind of genre
<bougyman> boring
<seanstickle> andrewvos: DArk City
<cout> andrewvos: how about Miss Congeniality?
<andrewvos> hmmm
achiu1 has joined #ruby-lang
<bougyman> Gattaca
<andrewvos> Ohhh ok
<andrewvos> Dark City is good, but I saw it very recently
<andrewvos> Gattaca is a bit boring
<seanstickle> andrewvos: Memento
<cout> btw by "same genre" you mean "really really bad movies", right?
<andrewvos> Yeah
<cout> or "long and drawn out so you can't feel your toes anymore"
<seanstickle> Ah, I thought the genre was the "social construction of reality"
<andrewvos> heh
<dominikh> the genre is "trips some people up and causes them to spend their life calling it shit"
<andrewvos> Maybe genre isn't the word
<andrewvos> hahah
<andrewvos> Event Horizon maybe
<andrewvos> Matrix was fucking cool though.
burns180 has joined #ruby-lang
<bougyman> matrix was shit
<bougyman> been done so many times before
<cout> the first one was good
<bougyman> and with better characters than keanu can pull off.
<cout> bougyman: that's true of any movie.
<bougyman> i just laugh at him.
<cout> bougyman: but in the case of the matrix, it had never been done before like that.
<bougyman> and i don't think it was meant to be a comedy
<bougyman> cout: it hadn't?
<andrewvos> Matrix was cool as fuck. Stop being haters.
<dominikh> +1
<cout> it's the only movie I've ever seen where keanu reeves actually fit the character perfectly
<bougyman> everything in the matrix is a ripoff
<dominikh> you guys must hate Inception even more then
<andrewvos> So he's a bad actor. Who gives a fuck. I don't watch movies to see stellar performances. I watch for the story and some entertainment.
<seanstickle> A well-executed, well-designed ripoff
<cout> bougyman: FUD
<seanstickle> That's sort of a wrong use-case for the word FUD
<seanstickle> Perhaps you meant "LIES"
<bougyman> cout: see "All the movies the matrix ripped off" on google.
<cout> bougyman: who cares if it was straight out of neuromancer? neuromancer was crap.
<cout> bougyman: again, you can apply similar logic to any movie
<cout> bougyman: there is no such thing as a completely original movie
<bougyman> yes but they have better acting than keanu
<cout> bougyman: because all good movies make references to prior art
<bougyman> are there worse actors?
<cout> OF COURSE
<bougyman> debatable
<cout> how about the kid who played anakin skywalker?
<bougyman> had more character than keanu
<cout> that's why keanu was perfect for the part
<cout> bland, lifeless, soulless
<cout> describes "Neo" to a tee
<shevy> hehe
<shevy> never saw or read neuromancer
<shevy> matrix II and III sucked immensely
<cout> shevy: neuomancer had a matrix and it had a colony called zion where all the rastafarians go to party
<andrewvos> You Sir, are incorrect.
<shevy> really?
<shevy> then the matrix makers really were thieves
<cout> shevy: I wouldn't say thieves
<andrewvos> Oh really? That makes me retrospectively enjoy the movie much leess.
<andrewvos> Oh wait, no it doesn't
<dominikh> cout: shock: Zion is older than Neuromancer, too...
<shevy> thieves! I shout that out! just as "The Magnificent Seven" was the theft of seven samurai! and "for a fistful dollars" a theft of yojimbo
<cout> shevy: they took a really bad book (IMO), changed a few things around, and made it into a palatable box-office hit
<shevy> but truthfully, I think I heard of neuromancer only once in total
<cout> dominikh: well yeah, but within cyberpunk?
<muzone> neuromancer the virus guy?
<shevy> wat
<shevy> muzone, go back to sleep!
<dominikh> cout: it's not about cyberpunk, it's about the religious analogy. And because one cyberpunk novel already used it, noone else is allowed to anymore?
<muzone> i actually talked to him once
<shevy> theft is theft!
<muzone> *the* neuromancer
<muzone> i remember he designed some virus i tried to get my hands on
<shevy> muzone please, go to bed
<muzone> had a passion for asm source code back then
<muzone> "code that could do great harm"
<shevy> the bed is such a nice place
<muzone> as opposed to now, "code that can do great good"
<shevy> aeeeeh
<muzone> alright shevy i'll leave you to it
<muzone> was just browsing by and saw the name so
<shevy> moral code :)
<cout> dominikh: I never said that
<andrewvos> Anyway, we're arguing something that's entirely subjective. You're just all stupid so you don't like the Matrix. That's perfectly fine.
<cout> andrewvos: that's the only kind of argument worth having!
<andrewvos> :)
<andrewvos> Seriously though, what's a cool space movie to watch?
<cout> Space Mutiny
<andrewvos> This is really important
<cout> wait, good cool or bad cool?
<andrewvos> cout: I don't know what the difference is.
<andrewvos> cout: 1.9 on imdb. Nice pick bro
<cout> Space Mutiny is cool but is the sort of movie you'd see on MST3K
<muzone> definitely good cool!
<dreinull-> what needs be done in a case of this (minitest): Expected: "Wörterbuch" Actual: "ًWörterbuch"
<shevy> andrewvos there are not that many cool space movies
<dreinull-> oh, there is indeed a difference..
<shevy> it's also kinda sad that I once liked something like serenity, but after I watched it ~10 times in total, I'd say it is only about 6 out of 10 now
<dreinull-> somehow I added some Arabic
<cout> I didn't like Serenity as much as I liked Firefly
<andrewvos> Yeah me neither
<cout> the end of the movie kinda ruined it for me
<cout> but it was the only ending worth having
<shevy> Firefly I have not seen
<shevy> but I am spoiled. I demand from science fiction movies to be as good as blade runner these days
<cout> andrewvos: how about the new Tron movie?
<andrewvos> cout: meh
<cout> shevy: I still haven't seen that (I read the book)
<cout> andrewvos: the new planet of the apes?
<andrewvos> mehhhh
<andrewvos> meh+1
<shevy> cout I read the book too! but the movie is very different from the book
<shevy> the book is kinda depressing
burns180_ has joined #ruby-lang
heppy has joined #ruby-lang
<cout> shevy: yeah it was
<cout> how about "Man with the Screaming Brain" starring Bruce Campbell?
<andrewvos> the fuck?
<cout> I didn't like Bruce Campbell's Elvis movie, but I usually like his stuff
<cout> I think andrewvos is one suggestion away from concluding with great statistical confidence that his taste in movies and mine are almost completely disjoint.
<andrewvos> cout: I prefer to label your taste in movies "broken".
<cout> lol
<cout> andrewvos: let me know what you end up selecting
<cout> I might want to watch it myself
<andrewvos> It may be too late to watch anything :(
<cout> no!
<andrewvos> Really want a sci-fi though
<cout> did you look at the list on wikipedia?
<andrewvos> Maybe that one when the dude wakes up on a ship and it's been like 1000 years and all the ship crew have evolved
<cout> Red Dwarf?
<andrewvos> nahh
<andrewvos> There's dying in this one
<cout> oh
<andrewvos> First result :|
<andrewvos> That's amazign
shevy2 has joined #ruby-lang
<cout> too new for me to have heard of it :(
<andrewvos> hehe look at this 404 page? http://www.imdb.com/title/tt1188729/related
<andrewvos> Not seen that before
<cout> different every time
<cout> Rocket Man is a good movie
<shevy2> havent seen that one
<cout> a friend of mine tells me I need to see Idiocracy
wallerdev has joined #ruby-lang
<andrewvos> Ok I'm watching existenz
<andrewvos> Not seen it
<cout> not something I could watch with my parents :(
<cout> it's got Chris Eccleston, so that's a good sign
mikeric has joined #ruby-lang
<cout> oh, and Ian Holm!
<andrewvos> cout: Why wouldn't you watch it with your parents?
<cout> they don't do horror movies
<cout> they are more the cute and cuddly sci-fi type
<cout> like Ewoks
<andrewvos> ahh ok
igaiga has joined #ruby-lang
chimkan_ has joined #ruby-lang