<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)
<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.
<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.
<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
<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