Topic for #ruby-lang is now Ruby 1.9.3p0: http://ruby-lang.org | Paste >3 Lines of Text on http://pastie.org
towski [towski!~towski@173-13-170-161-sfba.hfc.comcastbusiness.net] has joined #ruby-lang
jaedogg99 [jaedogg99!~jaedogg99@cpe-76-189-158-113.neo.res.rr.com] has joined #ruby-lang
cyri__ [cyri__!~cyri_@jem75-1-87-88-118-80.dsl.sta.abo.bbox.fr] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby-lang
imperator [imperator!~Daniel@63-225-247-192.hlrn.qwest.net] has joined #ruby-lang
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby-lang
looopy [looopy!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
<zenspider> ok... outage starting soon
guns [guns!~guns@c-98-228-72-208.hsd1.il.comcast.net] has joined #ruby-lang
zenspider [zenspider!~user@envy.zenspider.com] has joined #ruby-lang
andrewhl [andrewhl!~andrew@67.230.167.5] has joined #ruby-lang
gix [gix!~gix@e180011232.adsl.alicedsl.de] has joined #ruby-lang
neoesque [neoesque!~neoesque@210.59.147.226] has joined #ruby-lang
yadav [yadav!~quassel@dsl-173-248-230-235.acanac.net] has joined #ruby-lang
apeiros_ [apeiros_!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby-lang
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
MCMayor2 [MCMayor2!~mcmayor@c-71-231-176-238.hsd1.wa.comcast.net] has joined #ruby-lang
skiz [skiz!~skiz@c-69-181-211-4.hsd1.ca.comcast.net] has joined #ruby-lang
<erikh> anyone mind hitting erik.hollensbe.org ?
<erikh> just moved the server; wondering if dns and pals took
<imperator> erikh, hm, got some porn site
<imperator> no, just kidding, works fine
<erikh> heh. awesome, thank you.
<erikh> there's no content to speak of on it but it means the rest of everything is working, too :P
<imperator> something something chef
<erikh> yes
<densebits> howdy all
<imperator> 'sup yo
* densebits nods imperator
* shevy shakes imperator
Austin__ [Austin__!~austin@CPE0016cbc30e9c-CM001ceacff6ba.cpe.net.cable.rogers.com] has joined #ruby-lang
<densebits> shevy, lol why are you shaking imperator
<imperator> maybe he's hoping for loose change
<densebits> Just ask, don't beg.
<densebits> or shake o__O
<densebits> That made no sense haha
<shevy> densebits you nodded him
<densebits> shevy, :[
<shevy> so I thought when you can nod him, I can shake him, and some third person could do something else with him
<densebits> Don't be like me!
<imperator> in other news, FFI::Type::POINTER.size is what I wanted :)
<imperator> works on mri and jruby
<shevy> densebits you got yourself a fan!
<shevy> let's do something fun with imperator!
<shevy> awww
<densebits> imperator, I still haven't decided on if I want to play with JRuby.
<shevy> if a third guy would have helped us...
<shevy> :(
<densebits> JRuby + JBoss + TorqueBox... seems nice... but not sure if I want to just yet.
<shevy> hehe
<imperator> densebits, i like tinkering with it, never used it in actualy production though
<imperator> for a while i was looking at because i thought it might be a better ruby than ruby
<densebits> imperator, What are you impressions of it? I've heard several "mehs" about it. Using it on Android seems like a possible fun route.
<imperator> and it is for certain things
<densebits> your*
<imperator> densebits, depends on your domain
<imperator> if you need to interact with a java library, or you need the google app cloud, absolutely
<imperator> if you're just running a vanilla rails app, meh
<imperator> if you're doing systems programming, no
<densebits> 3rd comment would do it for me
uniqanomaly [uniqanomaly!~ua@dynamic-78-8-93-236.ssp.dialog.net.pl] has joined #ruby-lang
<imperator> game time
ryanf [ryanf!~revfitz@adsl-69-111-194-237.dsl.snfc21.sbcglobal.net] has joined #ruby-lang
tomzx [tomzx!~tomzx@dsl-216-221-32-204.aei.ca] has joined #ruby-lang
diegoviola [diegoviola!~viola@host-1-211.b15.cvc.com.py] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
gregmore_ [gregmore_!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
nari [nari!~nari@p62e324.totrnt01.ap.so-net.ne.jp] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
takaokouji [takaokouji!~takaokouj@nat35.mable.ne.jp] has joined #ruby-lang
skiz [skiz!~skiz@c-69-181-211-4.hsd1.ca.comcast.net] has joined #ruby-lang
<rue> Dum dum duu
gregmoreno [gregmoreno!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
gregmore_ [gregmore_!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
wmoxam_ [wmoxam_!~wmoxam@108.161.116.83] has joined #ruby-lang
WhiteHorse [WhiteHorse!~WhiteHors@201.208.150.8] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
corn_man [corn_man!kvirc@unaffiliated/cornman] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
gregmore_ [gregmore_!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
simon_weber [simon_weber!u4119@gateway/web/irccloud.com/x-grnsmygwexztffps] has joined #ruby-lang
Spooner_ [Spooner_!~Miranda@host-92-23-158-179.as13285.net] has joined #ruby-lang
woollyams [woollyams!~woollyams@124-168-204-21.dyn.iinet.net.au] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-214-73.slkc.qwest.net] has joined #ruby-lang
slaytanic [slaytanic!~slaytanic@host27.190-138-61.telecom.net.ar] has joined #ruby-lang
x0F__ [x0F__!~x0F@unaffiliated/x0f] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
skiz [skiz!~skiz@c-69-181-211-4.hsd1.ca.comcast.net] has joined #ruby-lang
wmoxam_ [wmoxam_!~wmoxam@108.161.116.83] has joined #ruby-lang
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby-lang
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-46-212.washdc.btas.verizon.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
sunredsky [sunredsky!sunredsky@adsl-76-206-24-126.dsl.covlil.sbcglobal.net] has joined #ruby-lang
hahuang65 [hahuang65!~hahuang65@c-24-23-128-23.hsd1.ca.comcast.net] has joined #ruby-lang
igotnole_ [igotnole_!~igotnoleg@174-27-218-195.slkc.qwest.net] has joined #ruby-lang
confounds [confounds!~confounds@CPE78cd8e667600-CM78cd8e6675fd.cpe.net.cable.rogers.com] has joined #ruby-lang
Dreamer3 [Dreamer3!~Dreamer3@74-134-34-116.dhcp.insightbb.com] has joined #ruby-lang
phaedrix [phaedrix!~phaedrix@c-24-22-86-235.hsd1.or.comcast.net] has joined #ruby-lang
JosephRuby [JosephRuby!~joseph@46.33.34.48] has joined #ruby-lang
confounds [confounds!~confounds@CPE78cd8e667600-CM78cd8e6675fd.cpe.net.cable.rogers.com] has joined #ruby-lang
confound_ [confound_!~confounds@CPE78cd8e667600-CM78cd8e6675fd.cpe.net.cable.rogers.com] has joined #ruby-lang
comfreakph [comfreakph!~comfreakp@121.97.111.191] has joined #ruby-lang
<comfreakph> hi
<comfreakph> where can I find a website that is giving free tutorial for ruby on rails?
<comfreakph> thank
<wmoxam_> comfreakph: try the channel: #rubyonrails
codewrangler [codewrangler!~codewrang@pool-108-28-240-83.washdc.fios.verizon.net] has joined #ruby-lang
alois [alois!~alois@188.80.broadband5.iol.cz] has joined #ruby-lang
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
Rakko [Rakko!~rakko@96-42-31-132.dhcp.mdsn.wi.charter.com] has joined #ruby-lang
comboy [comboy!~quassel@static.7.66.9.176.clients.your-server.de] has joined #ruby-lang
sunredsky [sunredsky!sunredsky@adsl-76-206-24-126.dsl.covlil.sbcglobal.net] has joined #ruby-lang
comboy [comboy!~quassel@static.7.66.9.176.clients.your-server.de] has joined #ruby-lang
heppy [heppy!~heppy@75-101-31-55.dsl.dynamic.sonic.net] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
MCMayor [MCMayor!~mcmayor@c-71-231-176-238.hsd1.wa.comcast.net] has joined #ruby-lang
MCMayor [MCMayor!~mcmayor@c-71-231-176-238.hsd1.wa.comcast.net] has quit [#ruby-lang]
naz [naz!~n@70.44.2.190.res-cmts.bus.ptd.net] has joined #ruby-lang
dr0id [dr0id!~andy@unaffiliated/dr0id] has joined #ruby-lang
nuclearsandwich [nuclearsandwich!~nuclearsa@74-93-3-241-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
srbaker [srbaker!~srbaker@184.66.82.213] has joined #ruby-lang
guns [guns!~guns@c-98-228-72-208.hsd1.il.comcast.net] has joined #ruby-lang
krz [krz!~foobar@unaffiliated/krz] has joined #ruby-lang
s33k [s33k!~s33k@223.236.159.75] has joined #ruby-lang
uniqanomaly_ [uniqanomaly_!~ua@dynamic-78-8-81-232.ssp.dialog.net.pl] has joined #ruby-lang
<josh9> i am writing a method that checking for balancing of symbols. for example: '[{}]' should be true and '((]' will be false. one way is using a stack. is there a stack i can use or should i implement one (using array)?
gregmoreno [gregmoreno!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
gregmor__ [gregmor__!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
<rue> josh9: Array#push and #pop are all you need
<josh9> rue: awesome. i'll give it a try.
<josh9> so in ruby we don't need stack. pop is removing the last inserted element.
<rue> It is a stack, more or less.
<TTilus> josh9: do Stack = Array and then parens = Stack.new if that makes you feel more comfortable
<josh9> TTilus: nice
<livinded> josh9: please don't do that
<rue> :P
gregmoreno [gregmoreno!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
<TTilus> omg that was supposed to be a joke
<josh9> TTilus: oh..
QaDeS [QaDeS!~mklaus@frbg-4d0291d2.pool.mediaWays.net] has joined #ruby-lang
<TTilus> josh9: if u need a stack, u use Array, as rue said, it _is_ _the_ stack (in ruby)
<josh9> TTilus: np. will do
<livinded> TTilus: at least you didn't give him crazy code to insert unicode chars to force the output to be vertical rather than horizontal
<livinded> ...I wonder if there's a rotate 90 degrees unicode char
<TTilus> livinded: nice idea, gotta try next time somebody asks for stack =D
<livinded> OH MY GOD! There is!
<livinded> oh wait, wikipedia fail
<TTilus> livinded: well, there _are_ up-to-downlanguages after all
<livinded> TTilus: ya, that's why I thought there might be a rotate because I know there is a flip and reverse
jxie [jxie!~jxie@115.197.80.190] has joined #ruby-lang
<livinded> TTilus: also, don't forget to call #reverse on the array before outputting it
<TTilus> livinded: or just alias #shift and #unshift as #pop and #push :)
<TTilus> livinded: bonus, you break more places
<livinded> lmfao, how slow are you trying to make this
brianpWins [brianpWins!~brianpWin@207.6.118.71] has joined #ruby-lang
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
<TTilus> livinded: i just thought about making it unstable :)
<livinded> in my data structures class my professor made us implement a stack on top of a vector but rather than placing new values on the end, like you should, we had to rebuild the vector on each push and put it at the front
lonny [lonny!~lonny@122.177.178.216] has joined #ruby-lang
<TTilus> was that supposed to ba a kind of "now yousee why you dont do it like this"?
<livinded> no
<TTilus> AAAAAAAAAA!
<livinded> I dropped CS and switched to philosophy in my senior year
<livinded> well, my first senior year
<TTilus> if that was characteristic, you gain way more by reading philosophy and maths
<livinded> I filed so many complaints about the professors in my program, it was a fucking joke
<livinded> and then I tried getting for the software engineering courses for my Summer of Code participation and the department chair denied it
<TTilus> wrong school?
<livinded> getting credit*
<TTilus> doublefail
<livinded> wrong school and bad advisement
<TTilus> so wrong in so many levels
<livinded> the work I did in 3 months for summer of code by myself is more work than groups of students do in two semesters in the software engineering courses
<livinded> maybe if I had made some UML diagrams and used Java they would have accepted it
<TTilus> thought about writing to tdwtf on your experiences, they pretty rarely have good wtf stuff from education sector
<livinded> actually I haven't. I haven't read tdwtf in years
<josh9> here is an iterative implemetation in o(n) of 'balancing symbols' - http://pastebin.com/YxeYycCg any suggestions for cleaning the code or maybe ideas of doing it recursively?
<livinded> why are you making your table a hash?
<livinded> oh
<josh9> livinded: to make it easy to find the closing match.
<josh9> i am sure there is a recursive way of solving it. i need to think..
<livinded> just recursively called the function with the next char to the end of the array and the current opening. Check to ensure that the current opening is the one that's closing. If you reach the end before you come out of the call chain it's not balanced
<livinded> but the method you currently have is going to be more efficient probably
<ryanf> you probably don't want to go out of your way to write things recursively in ruby
<lianj> "{"*10_000 <-
<josh9> livinded: yeah. i need to practise recursives though.
<livinded> does ruby implement tail call recusion?
<livinded> recursion*
<ryanf> no
<livinded> ya, stick to iteration then
<livinded> it'll definitely be more efficient
<josh9> livinded: what's tail call recursion?
<livinded> josh9: basically iteration
<ryanf> tail call optimization is a transformation some languages do that can make certain recursive algorithms run iteratively
<ryanf> more or less
<ryanf> if the recursion is the last thing that happens in the function, there's no need to build up an actual call stack like you do with normal recursion
<ryanf> so it like flattens it out into iteration
<livinded> it does some memory and instruction pointer mangling to avoid having to actually call another function
<ryanf> anyway, since ruby doesn't do that, implementing things recursively is a good way to run out of stack
<ryanf> and be slow, and take a lot of memory
<livinded> but unless a problem specifically lends itself to a recursive solution (eg. traversing a tree) and it wont be more efficient to do it iteratively you should stick to iteration
<josh9> livinded: ok
<livinded> any problem you can solve with recursion you can solve with iteration and vice versa. Certain problems are easier to solve with one or the other and depending on the implementation of the language may be more efficient with one or the other
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
<josh9> speaking of recursion. i found this merga sort. it's working but i don't understand how come i don't need to assign a2=merge_sort(a2) and i only do merge_sort(a2). someone told me it's an in-place sort, but i still don't get it - http://pastebin.com/QH46wghT
hahuang65_ [hahuang65_!~hahuang65@c-24-23-128-23.hsd1.ca.comcast.net] has joined #ruby-lang
gentz_ [gentz_!ilab@ancient.webfoundation.net] has joined #ruby-lang
neilc_ [neilc_!~neilc@216.45.48.18] has joined #ruby-lang
jordan`` [jordan``!~gromit@2001:660:3302:2826:225:90ff:fe20:d9a8] has joined #ruby-lang
Diaoer [Diaoer!~Diaoer@116.227.33.12] has joined #ruby-lang
_br_- [_br_-!~bjoern_fr@221x255x118x242.ap221.ftth.ucom.ne.jp] has joined #ruby-lang
hibariya_ [hibariya_!~quassel@www9204u.sakura.ne.jp] has joined #ruby-lang
devn_ [devn_!~devn@rot13.pbqr.org] has joined #ruby-lang
tdmackey_ [tdmackey_!~tdmackey@booleanhaiku.com] has joined #ruby-lang
imajes_ [imajes_!~imajes@is.imaj.es] has joined #ruby-lang
Manhose_ [Manhose_!~Manhose@a94-132-167-54.cpe.netcabo.pt] has joined #ruby-lang
ReinH_ [ReinH_!~reinh@li14-106.members.linode.com] has joined #ruby-lang
benteaa [benteaa!3726@safir.ifi.uio.no] has joined #ruby-lang
turboladen [turboladen!~kvirc@12.104.148.2] has joined #ruby-lang
nuclearsandwich [nuclearsandwich!~nuclearsa@74-93-3-241-SFBA.hfc.comcastbusiness.net] has joined #ruby-lang
heppy [heppy!~heppy@75-101-31-55.dsl.dynamic.sonic.net] has quit [#ruby-lang]
rippa [rippa!~rippa@87-253-24-136.pppoe.yaroslavl.ru] has joined #ruby-lang
levifig [levifig!~levifig@levifig.com] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
heppy [heppy!~heppy@75-101-31-55.dsl.dynamic.sonic.net] has joined #ruby-lang
woollyams [woollyams!~woollyams@124-168-204-21.dyn.iinet.net.au] has joined #ruby-lang
uniqanomaly [uniqanomaly!~ua@dynamic-78-8-81-232.ssp.dialog.net.pl] has joined #ruby-lang
jxie [jxie!~jxie@115.197.80.190] has joined #ruby-lang
levifig [levifig!~levifig@levifig.com] has joined #ruby-lang
Fullmoon [Fullmoon!~Fullmoon@dsl-stat-43-17.mmc.at] has joined #ruby-lang
ltd- [ltd-!~z@zx.io] has joined #ruby-lang
Mozillion_ [Mozillion_!~paul@81-70-ftth.onsneteindhoven.nl] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-44-227.telstraclear.net] has joined #ruby-lang
<ddfreyne> judofyr: temple is yours?
dRbiG [dRbiG!drbig@unhallowed.pl] has joined #ruby-lang
<ddfreyne> judofyr: in html/prettty.rb, on line 41, I believe the #gsub! should be a #gsub + assignemnt
<ddfreyne> judofyr: content that goes into temple is frozen here, but that causes an exception
yxhuvud [yxhuvud!~jag@static-88.131.62.36.addr.tdcsong.se] has joined #ruby-lang
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
apeiros_ [apeiros_!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby-lang
<rue> josh9: #merge modifies a in-place
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
Carnage\ [Carnage\!~carnage@84-75-168-154.dclient.hispeed.ch] has joined #ruby-lang
youngin [youngin!youngblood@avtomat.probsd.net] has joined #ruby-lang
woollyams [woollyams!~woollyams@124-168-204-21.dyn.iinet.net.au] has joined #ruby-lang
ruskie [ruskie!ruskie@sourcemage/mage/ruskie] has joined #ruby-lang
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
<apeiros_> rue: Hash#merge ? (merge! & update do, no?)
<erikh> I think he was talking about the merge_sort and mistyped
tylergillies [tylergillies!u3033@gateway/web/irccloud.com/x-dmjxygajhegnweam] has joined #ruby-lang
br1an [br1an!u440@gateway/web/irccloud.com/x-zhfnjgvojeynfepl] has joined #ruby-lang
whoops [whoops!u549@gateway/web/irccloud.com/x-uayishckbcbroahl] has joined #ruby-lang
bryanl [bryanl!u1690@gateway/web/irccloud.com/x-gouyncsgjcuuoazh] has joined #ruby-lang
cesario [cesario!u2444@gateway/web/irccloud.com/x-rlbpxnlofvuygcqo] has joined #ruby-lang
dnyy [dnyy!u2106@gateway/web/irccloud.com/x-qkmemhkxlgrzjsja] has joined #ruby-lang
simon_weber [simon_weber!u4119@gateway/web/irccloud.com/x-gjslwnfqyemxpqrv] has joined #ruby-lang
beawesomeinstead [beawesomeinstead!u1643@gateway/web/irccloud.com/x-ilbqehebbdeafmhp] has joined #ruby-lang
locks [locks!u130@gateway/web/irccloud.com/x-bopiarldgwctzldv] has joined #ruby-lang
agib [agib!u781@gateway/web/irccloud.com/x-njruxotcqcarcdei] has joined #ruby-lang
mrchrisadams [mrchrisadams!u1367@gateway/web/irccloud.com/x-kvlnprgmxtmikvpq] has joined #ruby-lang
akahn [akahn!u2243@gateway/web/irccloud.com/x-bhotplsskllohcpc] has joined #ruby-lang
denysonique__ [denysonique__!u484@gateway/web/irccloud.com/x-ycfrpivxdzsrewry] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-44-53.telstraclear.net] has joined #ruby-lang
cldwalker [cldwalker!u2984@gateway/web/irccloud.com/x-oddmpbyolqobyomu] has joined #ruby-lang
frangiz [frangiz!~frangiz@user26.77-105-206.netatonce.net] has joined #ruby-lang
<Mon_Ouie> Or he was talking about the Array#merge defined in the pastebin
<Mon_Ouie> Algo#merge*
Aaaarg [Aaaarg!~Arthur@121-74-40-116.telstraclear.net] has joined #ruby-lang
Asher [Asher!~asher@98.158.127.150] has joined #ruby-lang
apeiros_ [apeiros_!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby-lang
jredville [jredville!u3362@gateway/web/irccloud.com/x-gdfxswfkippgybrs] has joined #ruby-lang
pvh [pvh!u717@gateway/web/irccloud.com/x-bqzfycxwxldajdns] has joined #ruby-lang
empity [empity!~user@host109-156-77-129.range109-156.btcentralplus.com] has joined #ruby-lang
<erikh> testing things that fork is hard.
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
mccraig [mccraig!u574@gateway/web/irccloud.com/x-lgwvtcspuvnnpvsa] has joined #ruby-lang
abuiles [abuiles!u1641@gateway/web/irccloud.com/x-mmwjjdrfyvclmdfk] has joined #ruby-lang
<shevy> spoon me!
yorickpeterse [yorickpeterse!~yorickpet@pdpc/supporter/professional/yorickpeterse] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-43-106.telstraclear.net] has joined #ruby-lang
Wardrop [Wardrop!~tomwardro@86.46.96.58.static.exetel.com.au] has quit [#ruby-lang]
s33k [s33k!~shiva@223.235.33.111] has joined #ruby-lang
lonny [lonny!~lonny@122.177.227.148] has joined #ruby-lang
Mozillion [Mozillion!~paul@target.ipv4.spacelabs.nl] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
tobiassvn [tobiassvn!u4832@gateway/web/irccloud.com/x-kzoabxlyvdsmpwoy] has joined #ruby-lang
nari [nari!~nari@p62e324.totrnt01.ap.so-net.ne.jp] has joined #ruby-lang
heftig [heftig!jan@archlinux/developer/heftig] has joined #ruby-lang
empity [empity!~user@host109-156-77-129.range109-156.btcentralplus.com] has joined #ruby-lang
sunredsky [sunredsky!sunredsky@adsl-76-206-24-126.dsl.covlil.sbcglobal.net] has joined #ruby-lang
|Vargas| [|Vargas|!~luke@pdpc/supporter/profesional/vargas] has joined #ruby-lang
<shevy> hmmm
<shevy> do you use a common pattern when you write classes?
<shevy> something that you (try to) repeat from one class to the other?
toretore [toretore!~toretore@ti0006a380-0599.bb.online.no] has joined #ruby-lang
<burgestrand> yeah, the order of which I define things in
<burgestrand> (for example, I try to always open up the singleton class at the top, and only after that follow with include, extend, attributes, instance methods, protected methods and private methods)
<Mon_Ouie> And define initialize first
<burgestrand> *nods*
<burgestrand> Same with self.extended and self.included.
Defusal [Defusal!DeFi@196-209-55-55.dynamic.isadsl.co.za] has joined #ruby-lang
Defusal [Defusal!DeFi@unaffiliated/ecnerifed] has joined #ruby-lang
setmeaway [setmeaway!setmeaway3@119.201.52.190] has joined #ruby-lang
Spooner [Spooner!~Miranda@host-92-23-158-179.as13285.net] has joined #ruby-lang
necromancer [necromancer!u4538@gateway/web/irccloud.com/x-qfdfubmwzjakuymx] has joined #ruby-lang
tobiassvn [tobiassvn!u4832@gateway/web/irccloud.com/x-rqbplobivfiahzye] has joined #ruby-lang
cldwalker [cldwalker!u2984@gateway/web/irccloud.com/x-scbicrumcmlkeicm] has joined #ruby-lang
beawesomeinstead [beawesomeinstead!u1643@gateway/web/irccloud.com/x-xmhjbxqgqsumhiwb] has joined #ruby-lang
apeiros_ [apeiros_!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby-lang
tylergillies [tylergillies!u3033@gateway/web/irccloud.com/x-fryzgysqjqlzpcpm] has joined #ruby-lang
saLOUt [saLOUt!~rriemann@91-65-223-29-dynip.superkabel.de] has joined #ruby-lang
S2kx [S2kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby-lang
Pupeno- [Pupeno-!~pupeno@pdpc/supporter/active/pupeno] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
retro|cz [retro|cz!~retro@106.142.broadband6.iol.cz] has joined #ruby-lang
ltd- [ltd-!~z@zx.io] has joined #ruby-lang
mccraig [mccraig!u574@gateway/web/irccloud.com/x-onfwuqdofcjwowcb] has joined #ruby-lang
cesario [cesario!u2444@gateway/web/irccloud.com/x-tvrsomxprpfptzlj] has joined #ruby-lang
akahn [akahn!u2243@gateway/web/irccloud.com/x-qtnjggrlrppccxtn] has joined #ruby-lang
bryanl [bryanl!u1690@gateway/web/irccloud.com/x-nthaqvdrqkfhhopq] has joined #ruby-lang
kitallis-cloud [kitallis-cloud!u358@gateway/web/irccloud.com/x-dwbhlcdcqyozyjfn] has joined #ruby-lang
ltd-- [ltd--!~z@zx.io] has joined #ruby-lang
dv310p3r [dv310p3r!~dv310p3r@c-98-203-41-91.hsd1.fl.comcast.net] has joined #ruby-lang
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
<shevy> nice
agib [agib!u781@gateway/web/irccloud.com/x-ngtplqqkcisqkwnu] has joined #ruby-lang
whoops [whoops!u549@gateway/web/irccloud.com/x-wuksgkfcwhhbvqtj] has joined #ruby-lang
dr0id [dr0id!~andy@unaffiliated/dr0id] has joined #ruby-lang
Pip [Pip!~Pip@host-94-156-66-217.spbmts.ru] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
br1an [br1an!u440@gateway/web/irccloud.com/x-heaxffqwigrukefg] has joined #ruby-lang
chris2 [chris2!~chris@vuxu.org] has joined #ruby-lang
jredville [jredville!u3362@gateway/web/irccloud.com/x-uzvkqdncajvxtmez] has joined #ruby-lang
Spooner [Spooner!~Miranda@host-92-23-158-179.as13285.net] has joined #ruby-lang
yxhuvud [yxhuvud!~jag@static-88.131.62.36.addr.tdcsong.se] has joined #ruby-lang
Pip [Pip!~Pip@unaffiliated/pip] has joined #ruby-lang
wmoxam_ [wmoxam_!~wmoxam@108.161.116.83] has joined #ruby-lang
andrewhl [andrewhl!~andrew@24-246-15-43.cable.teksavvy.com] has joined #ruby-lang
csherin [csherin!~csherin@61.17.18.22] has joined #ruby-lang
shevy [shevy!~shevy@194-166-25-205.adsl.highway.telekom.at] has joined #ruby-lang
flip_digits [flip_digits!~textual@c-71-199-243-97.hsd1.fl.comcast.net] has joined #ruby-lang
<shevy> 'When my team labeled our startup time the ?Ruby Tribute Minute? I knew I couldn?t ignore the problem anymore.'
<shevy> lol
<shevy> The Ruby Tribute Minute
<shevy> I gotta remember that
JackNorris [JackNorris!~JackNorri@92.48.86.35] has joined #ruby-lang
slyphon__ [slyphon__!~weechat@unaffiliated/slyphon] has joined #ruby-lang
dkannan [dkannan!u480@gateway/web/irccloud.com/x-sqkljgchnjwjxurq] has joined #ruby-lang
yxhuvud [yxhuvud!mongo@h-226-240.a207.priv.bahnhof.se] has joined #ruby-lang
ris [ris!~rsi@79.113.85.67] has joined #ruby-lang
wmoxam__ [wmoxam__!~wmoxam@75-119-249-148.dsl.teksavvy.com] has joined #ruby-lang
Spooner [Spooner!~Miranda@host-92-23-158-179.as13285.net] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
jmontross [jmontross!~Adium@c-76-102-197-68.hsd1.ca.comcast.net] has joined #ruby-lang
heppy [heppy!~heppy@75-37-193-66.lightspeed.lsatca.sbcglobal.net] has joined #ruby-lang
heppy [heppy!~heppy@75-37-193-66.lightspeed.lsatca.sbcglobal.net] has quit [#ruby-lang]
sunredsky [sunredsky!sunredsky@76.206.24.126] has joined #ruby-lang
Briareos1 [Briareos1!~quassel@202.58.198.84] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
heppy [heppy!~heppy@75-37-193-66.lightspeed.lsatca.sbcglobal.net] has joined #ruby-lang
spuk [spuk!~spuk@unaffiliated/spuk] has joined #ruby-lang
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby-lang
<shevy> hmm
<shevy> TIOBE hates ruby
<apeiros_> TIOBE ain't an entity capable of emotion, it can't hate.
<shevy> :(
<shevy> javascript before Ruby
<shevy> this world makes me sad ...
<any-key> TIOBE is silly
<shevy> I am surprised about C
<shevy> Can C still evolve actually?
<shevy> I mean C++ has this ... C++00xrx-wtf-whatever thing
<any-key> not really but it's the perfect tool for many jobs
<shevy> hmm
<shevy> ok
<any-key> C++ is a whole different beast
<any-key> and it can evolve, a bit too much for my liking, although C++0x implements things that make me hate it less
<any-key> C programming is king in embedded and low-level programming, always will be
<any-key> and other things but you get the idea
<any-key> anyone played around with http://www.therubygame.com/ ?
<any-key> I really like the idea but it's a shame emphasis is being placed on speed
<any-key> not that speed doesn't matter, it just seems like people focus on writing horrible code to win
<any-key> code golf is more fun in my opinion so weighting between the too would be really fun :D
<andrewhl> if I'm scraping an html document and I have: type = doc[i].css('td')[5].content which gets me "Rengo" when i = 0, and I want to increment i until my variable "type" no longer == "Rengo" (checking each row until a different string is found), would: while type == "Rengo" i += 1 end work?
<any-key> try it and find out!
<any-key> seems reasonable to me
<any-key> but be careful
<any-key> you'll want an upper bound on it in case "Rengo" never appears
dv310p3r [dv310p3r!~dv310p3r@nmd.sbx11041.miamifl.wayport.net] has joined #ruby-lang
<andrewhl> no, it doesn't work... it checks that type == "Rengo" and then just keeps incrementing i indefinitely
<andrewhl> because the condition is always true. It doesn't go back to check the html
<andrewhl> hmm
<any-key> well you will have to check the HTML each time...
<any-key> doc[i].css.reject { |i| i.content != "Rengo" }
<any-key> or does the current position matter?
<andrewhl> no I want to skip over rows with "Rengo"
<andrewhl> what does .reject do?
<any-key> doc[i].css.reject { |i| i.content == "Rengo" }
<andrewhl> ah cool
<any-key> it's worth learning all of those array methods, like map and collect, etc.
<andrewhl> yeah
<any-key> Enumerable has some awesome methods too, by the way
<andrewhl> oh yeah?
<any-key> yep!
<shevy> oh yeah!
<andrewhl> sexay
<andrewhl> ima look it up now
<any-key> reject is your friend, though, it'll save you a ton of time :)
<shevy> ruby will forever be famous for: yield/block and Enumerable
<any-key> and it'll pull you into the functional programming world :D
<any-key> I get upset when I can't find a map or fold function in other languages
<andrewhl> what's the functional programming world, beyond it's obvious meaning
* any-key glares at JavaScript
<any-key> andrewhl: it's filled with everything happy, but mostly arrays
<andrewhl> i see
<any-key> that makes it seems scary though
benanne [benanne!~rijdier@4.11-241-81.adsl-dyn.isp.belgacom.be] has joined #ruby-lang
<andrewhl> seems cool
<andrewhl> i suppose it doesn't require advanced math
<any-key> nope
<any-key> you can make it if you're into that kind of thing
* any-key gestures at lambda calculus :)
<andrewhl> heh
<andrewhl> not exactly:)
<shevy> .map I can understand easily
<shevy> "apply on each"
<shevy> fold, I never understand the name
<any-key> it folds it
<any-key> duhh
<any-key> ;)
<any-key> well there's the classic fold example of multiplying every element of an array: collect { |a,i| a*i }
<any-key> a is the accumulated value and i is the current element
<shevy> hmm
<any-key> whatever is returned (a*i in this case) is set as the accumulated value
<shevy> only for multiplications?
<any-key> no, whatever you want
<any-key> basically you use it for going from an array of values to one value
<any-key> so map is for array -> array
<any-key> reduce/folds are for array -> value
<any-key> it's a good tool to have at your disposal
savage- [savage-!~savage-@c-67-180-11-89.hsd1.ca.comcast.net] has joined #ruby-lang
heppy [heppy!~heppy@75-37-193-66.lightspeed.lsatca.sbcglobal.net] has joined #ruby-lang
gregmoreno [gregmoreno!~gregmoren@S01067444012f4469.vc.shawcable.net] has joined #ruby-lang
<rippa> any-key: collect is the same as map
<shevy> hey
<shevy> odd question
<shevy> is
<shevy> x = "foo"
<shevy> faster than
<any-key> rippa: I meant reduce :(
<shevy> dumdedum = "foo"
<shevy> and that's almost the difference between submission at #1 and at #3
<shevy> though granted, the other example uses .insert(-6, hyphen)
<shevy> bah
<shevy> those are no meaningful differences at all
<shevy> string.insert(10,s||=%q(-)).insert(21,s).insert(16,s).insert(5,s)
<shevy> odd code
<shevy> peculiar way to set a variable though
<shevy> :)
darkf [darkf!~darkf_dix@unaffiliated/darkf] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
codewrangler [codewrangler!~codewrang@pool-108-28-240-83.washdc.fios.verizon.net] has joined #ruby-lang
dinesh_ [dinesh_!~dinesh@183.82.18.156] has joined #ruby-lang
nuclearsandwich [nuclearsandwich!~nuclearsa@adsl-64-175-40-88.dsl.pltn13.pacbell.net] has joined #ruby-lang
imperator [imperator!~Daniel@63-225-247-192.hlrn.qwest.net] has joined #ruby-lang
Natch| [Natch|!~natch@178.73.217.144] has joined #ruby-lang
<andrewhl> any-key: btw, if you're interested, it looks like the line needed to be: doc = doc.css('tr').reject { |row| row.css('td')[5].content == "Rengo" }
jasox [jasox!~jasox@178.239.26.139] has joined #ruby-lang
DEac- [DEac-!~deac@81.16.104.86] has joined #ruby-lang
<jasox> Hi guys, Is there emacs users? I am wondering is there alternative for rsense in emacs (code completion). tnx
flori [flori!flori@irc.ping.de] has joined #ruby-lang
<shevy> emacs users all died
skiz [skiz!~skiz@c-69-181-211-4.hsd1.ca.comcast.net] has joined #ruby-lang
slyphon__ [slyphon__!~weechat@unaffiliated/slyphon] has joined #ruby-lang
thone [thone!~thone@e177081219.adsl.alicedsl.de] has joined #ruby-lang
tomzx [tomzx!~tomzx@dsl-216-221-32-204.aei.ca] has joined #ruby-lang
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
s33k [s33k!~user@110.225.144.21] has joined #ruby-lang
comboy [comboy!~quassel@static.7.66.9.176.clients.your-server.de] has joined #ruby-lang
<jasox> shevy, :D
<Mon_Ouie> I don't even use a ruby-specific completion source
<Mon_Ouie> Just the words from other buffers
Natch [Natch!~natch@178.73.216.72] has joined #ruby-lang
jmontross [jmontross!~Adium@c-76-102-197-68.hsd1.ca.comcast.net] has joined #ruby-lang
Nisstyre [Nisstyre!~yours@infocalypse-net.info] has joined #ruby-lang
jmontross [jmontross!~Adium@c-76-102-197-68.hsd1.ca.comcast.net] has joined #ruby-lang
RomD [RomD!~Roman@nrbg-d9322f99.pool.mediaWays.net] has joined #ruby-lang
dr_bob [dr_bob!~robert@p549E7C06.dip.t-dialin.net] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
<andrewvos> Well hello there
<dr_bob> ack
Jake232 [Jake232!~textual@5e04a6f7.bb.sky.com] has joined #ruby-lang
<Jake232> "The Well Grounded Rubyist" seems a pretty awesome book
<Jake232> But I've never seen it rccommended here ;)
<shevy> never heard it
<shevy> what would be kinda neat would be a merge of chris pine tutorial into a new styled pickaxe, together with "thinking patterns in ruby"
<Jake232> Yea
<Jake232> Rather than just jumping in
<Jake232> and teaching you ruby code
<Jake232> It doesnt
<Jake232> It first begins teaching you about Objects, and the whole ruby heirarchy up to Object, and BasicObject
<shevy> that's what I liked about the chris pine tutorial
<shevy> sadly it'll be very outdated eventually :(
<Jake232> Then moves onto Classes / Modules, then progresses to what "self" references in different parts of your code
<Jake232> Then it moves onto the difference between Iterators and Enumerators
<Jake232> It actually covers the core concepts, rather than just teaching you how to code Ruby, with no idea of the underlying things.
kyrylo [kyrylo!~kyrylo@46.118.252.89] has joined #ruby-lang
<Jake232> I've been writing Ruby for probably 2 months now, but this is one most enjoyable programming books I've read in quite some time.
towski [towski!~towski@173-13-170-161-sfba.hfc.comcastbusiness.net] has joined #ruby-lang
sunredsky [sunredsky!sunredsky@adsl-76-206-24-126.dsl.covlil.sbcglobal.net] has joined #ruby-lang
S1kx [S1kx!~S1kx@ip-95-223-80-198.unitymediagroup.de] has joined #ruby-lang
S1kx [S1kx!~S1kx@pdpc/supporter/monthlybyte/s1kx] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-46-212.washdc.btas.verizon.net] has joined #ruby-lang
solars [solars!~solars@mk089144206081.a1.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
indstry [indstry!~indstry@2001:470:1f11:1ec:d0e9:7f85:c5c6:3c66] has joined #ruby-lang
<indstry> whats the best gem for working with Amazon S3?
Jake232 [Jake232!~textual@5e0e111e.bb.sky.com] has joined #ruby-lang
imperator [imperator!~Daniel@63-225-247-192.hlrn.qwest.net] has joined #ruby-lang
erpuds [erpuds!~erpuds@c-98-206-147-224.hsd1.il.comcast.net] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
Mon_Ouie [Mon_Ouie!~Mon_Ouie@subtle/user/MonOuie] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
yadav [yadav!~quassel@dsl-173-248-230-235.acanac.net] has joined #ruby-lang
andersonfreitas [andersonfreitas!~andersonf@186.220.17.87] has joined #ruby-lang
maus_ [maus_!~maus@83-70-39-65-dynamic.b-ras1.wtd.waterford.eircom.net] has joined #ruby-lang
diegoviola [diegoviola!~viola@host-1-211.b15.cvc.com.py] has joined #ruby-lang
igotnolegs [igotnolegs!~igotnoleg@174-27-218-195.slkc.qwest.net] has joined #ruby-lang
duhova_rybka [duhova_rybka!~shady@marvin.ynet.sk] has joined #ruby-lang
lantins [lantins!~lantins@mx0.lividpenguin.com] has joined #ruby-lang
dejongge [dejongge!~jonke@pD9E0DFB1.dip0.t-ipconnect.de] has joined #ruby-lang
nofxx [nofxx!~nofxx@unaffiliated/nofxx] has joined #ruby-lang
livinded [livinded!~lolwut@pool-108-23-242-132.lsanca.fios.verizon.net] has joined #ruby-lang
Aaaarg [Aaaarg!~Arthur@121-74-46-205.telstraclear.net] has joined #ruby-lang
confounds [confounds!~confounds@CPE78cd8e667600-CM78cd8e6675fd.cpe.net.cable.rogers.com] has joined #ruby-lang
mtkd [mtkd!znc@209-20-90-74.slicehost.net] has joined #ruby-lang
Neil [Neil!~neil@host86-166-145-140.range86-166.btcentralplus.com] has joined #ruby-lang
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
setmeaway2 [setmeaway2!~setmeaway@119.201.52.190] has joined #ruby-lang
y3llow_ [y3llow_!~y3llow@114-36-229-64.dynamic.hinet.net] has joined #ruby-lang
s0ber_ [s0ber_!~s0ber@114-36-229-64.dynamic.hinet.net] has joined #ruby-lang
burgestrand [burgestrand!~burgestra@h-163-174.a155.priv.bahnhof.se] has joined #ruby-lang
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
setmeaway [setmeaway!setmeaway3@119.201.52.190] has joined #ruby-lang
lsegal [lsegal!jinx@modemcable249.109-177-173.mc.videotron.ca] has joined #ruby-lang
<ReinH_> Jake232: what class is this?
<Jake232> ReinH_: ?
<ReinH_> oh well grounded
<ReinH_> yeah, great book
<Jake232> Yea
<ReinH_> I'm putting together syllabus for a beginner Ruby class
<ReinH_> trying to use free materials
<Jake232> Haven't finished yet, just over half way through
<ReinH_> so Chris Pine's online book and the pickaxe
<ReinH_> wish I could just use that book
<ReinH_> David is awesome
<ReinH_> great teacher and writer
<Jake232> I'd try to teach the underlying principles, rather than jumping straight into "actual code"
<ReinH_> and a very cool guy
<Jake232> i wouldn't do the normal, and jump into if statement, loops etc
<ReinH_> Jake232: well, you have to have a balance
<ReinH_> "jumping straight into code" allows for easy wins
<Jake232> IMO, this way, having grasping knowledge of the underlying principles
<ReinH_> people don't feel like they're making progress unless they can reify their knowledge frequently
<Jake232> is more important
<ReinH_> otoh I definitely appreciate the importance of teaching w/ a strong focus on principles
<ReinH_> have to strike that balance
<Jake232> I've read half of this book, in probably 1.5hours. I mean, I've allready programmed Ruby, and some other languages
<Jake232> so I probably skimmed over some bits.
<ReinH_> right
<Jake232> But, it's certainly taught me quite a few new tricks.
<Jake232> I never even knew, about Class Variables, eg: @@something = "something"
<ReinH_> I think I'm going to write an n-curses based TUI Jabber client today
<ReinH_> because Adium and iChat piss me off regularly
SuperTaz [SuperTaz!~supertaz@c-24-130-115-179.hsd1.ca.comcast.net] has joined #ruby-lang
<Jake232> Textual ftw
<Jake232> for IRC
<ReinH_> I use irssi
<ReinH_> :)
<Jake232> Yea, heard good stories about that
<Jake232> never used it
<Jake232> Textual does me fine ;)
<ReinH_> ot
<ReinH_> er
perryh [perryh!~perry@unaffiliated/perry753] has joined #ruby-lang
<ReinH_> it's awesome
<ReinH_> hmm
<ReinH_> might try node-ncurses
benanne [benanne!~rijdier@ip-83-134-136-112.dsl.scarlet.be] has joined #ruby-lang
<Jake232> Unfortunetly, I have a PHP Project that needs finishing.
<Jake232> And I have a hatred, for PHP.
<Jake232> ReinH_: So, whats your ruby begginner class for?
<Jake232> A website your developing, orr?
srbaker [srbaker!~srbaker@70.28.245.92] has joined #ruby-lang
<erikh> it's about how to wear skinny jeans and talk about stuff like you knew about it long before anyone else
<Jake232> thought so ;)
<ReinH_> Jake232: reddit
nuclearsandwich2 [nuclearsandwich2!~yaaic@2600:1010:b004:5d3b:a1c8:762a:3536:5b0e] has joined #ruby-lang
<Jake232> ReinH_: Ahh
dRbiG [dRbiG!drbig@unhallowed.pl] has joined #ruby-lang
tamc [tamc!~tamc@94-193-227-176.zone7.bethere.co.uk] has joined #ruby-lang
Fullmoon [Fullmoon!~Fullmoon@dsl-stat-43-17.mmc.at] has joined #ruby-lang
geoffw8_ [geoffw8_!~geoffw8_@5add5509.bb.sky.com] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-46-212.washdc.btas.verizon.net] has joined #ruby-lang
srbaker [srbaker!~srbaker@70.28.245.92] has joined #ruby-lang
petercooper [petercooper!~petercoop@82.144.254.2] has joined #ruby-lang
brianpWins [brianpWins!~brianpWin@207.6.118.71] has joined #ruby-lang
tbuehlmann [tbuehlmann!~Tobias@unaffiliated/tovias] has joined #ruby-lang
skiz [skiz!~skiz@c-69-181-211-4.hsd1.ca.comcast.net] has joined #ruby-lang
looopy [looopy!~looopy@pool-141-156-46-212.washdc.btas.verizon.net] has joined #ruby-lang
jensn_ [jensn_!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
woollyams [woollyams!~woollyams@203-206-165-21.perm.iinet.net.au] has joined #ruby-lang
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby-lang
sepp2k [sepp2k!~sexy@pD95231A9.dip.t-dialin.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
srbartlett [srbartlett!~srbartlet@202.146.7.239] has joined #ruby-lang
toretore [toretore!~toretore@ti0006a380-0599.bb.online.no] has joined #ruby-lang
Fullmoon [Fullmoon!~Fullmoon@dsl-stat-43-17.mmc.at] has joined #ruby-lang
uniqanomaly [uniqanomaly!~ua@dynamic-78-8-81-232.ssp.dialog.net.pl] has joined #ruby-lang
lenilson_dias [lenilson_dias!~lenilson_@c934d329.virtua.com.br] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
dejongge1 [dejongge1!~jonke@pD9E0DFB1.dip0.t-ipconnect.de] has joined #ruby-lang
jarib_ [jarib_!~jarib@109.74.192.179] has joined #ruby-lang
jstemmer [jstemmer!~cheetah@mrpwn.stemmertech.com] has joined #ruby-lang
<adam_> can some one explain SomeClass < ::object (whats the ::object mean and why not use < object)?
<josh9> and i agree with his observation - when u open a rails app and look at the folder structure all you know about this app that it's a rails. but rails is just the delivery mechanism. it's just a detail and not part of the arcitecture.
<josh9> what you should see (in any app, not just web) is folders with names of your usage of the app (use cases) -
<josh9> 'make-payment' folder, 'register' folder, etc.
<apeiros_> adam_: note that case matters, so please write ::Object and not ::object…
<apeiros_> adam_: to answer your question: ::Object means "top-level constant Object"
<adam_> that doesn't fully answer my question.
<apeiros_> if you have `module Foo; class Object; end; class Bar < Object; end; end`, then Foo::Bar inherits from Foo::Object, not Object. using Bar < ::Object would change that.
<adam_> oh ok
<apeiros_> adam_: patience. great virtue :-p
<apeiros_> josh9: that's what you should see when you open app/models. I'm also pondering introducing app/workflow in our company apps. since a lot of things are transitory, not persistent, and right now they're handled by models, which is always only half-responsible…
<apeiros_> (sometimes it's even handled by the controller… which is arguably worse)
looopy [looopy!~looopy@static-71-166-231-146.washdc.east.verizon.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby-lang
<josh9> apeiros_ why models? we are talking about use cases that might span multiple objects and roles. when u say models u mean ruby classes that holds business logic, right?
s0ber [s0ber!~s0ber@114-36-229-64.dynamic.hinet.net] has joined #ruby-lang
<apeiros_> yes
<apeiros_> and agreed, if you need "bird view", you need text
<josh9> i think having use cases (or context, in DCI terminology) will give us better understanding of our apps.
<apeiros_> or, actually: disagreed - I don't think directories will do any good for that
<josh9> i havent' seen any ruby app that is doing it though.
<apeiros_> but maybe I'm just missing a good example.
jarib [jarib!~jarib@unaffiliated/jarib] has joined #ruby-lang
<josh9> apeiros_: yeah, there are some interesting discussions and books coming up -
jarib [jarib!~jarib@unaffiliated/jarib] has joined #ruby-lang
<josh9> clean-ruby is a book about using DCI with ruby and i can't wait to read it.
<josh9> "Data, Context, and Interaction (DCI), was created by Trygve Reenskaug (whom you may know as the creator of MVC) to make your code read the way it behaves. Pull everything out of its hiding place with “Clean Ruby” and learn how using the DCI paradigm means readable code and a super fast learning curve for your newest team members."
<apeiros_> hrm, maybe I should spend a bit of time on DCI
<apeiros_> I attended a talk on DCI at railsconf'11, but it didn't sparkle with me…
<josh9> apeiros_: is it online?
<apeiros_> no idea
<josh9> apeiros_: the idea is currently we focus on our classes and make them capable of doing everything. instead we shoud focus on roles:
<josh9> roles and objects.
<josh9> so let's say you have a user.
<josh9> this user can play multiple roles.
jmontross [jmontross!~Adium@c-76-102-197-68.hsd1.ca.comcast.net] has joined #ruby-lang
<josh9> right now this user is a mom.
<josh9> during the day the user is a programmer, and at night the user is a manager of a coffeeshop.
<josh9> let's have each role in a Module -
<josh9> Module Manager; def fire;end; def hire; end; end
<josh9> user = User.new
<josh9> user.extend Manager
<josh9> user.hire
<josh9> user.fire
<josh9> i am not sure how to unmix a module in ruby, but if it's a web app we don't need to since every request will give us new clean ruby object.
<andrewvos> josh9: Don't think you can
<josh9> so we applied a role to our object
<josh9> and this role is temporary, just like the real world.
<josh9> and all our logic is in modules instead of live part of our class. easy to manage and test.
<andrewvos> josh9: How is it easier to manage and test?
<apeiros_> josh9: the use of extend to achieve that was one thing that I disliked very much
<apeiros_> maybe a bit less if ruby was capable of unextend
<apeiros_> but right now, your object just starts accumulating functionality. you could have given it all just from the start too.
<josh9> andrewvos: testing small pieces of functionality is easier.
<josh9> apeiros_: but you might not need all that capability/roles all the time.
<josh9> your classes should not be inherited from activerecord.
<apeiros_> josh9: I'm aware of that. but you cannot *remove* a capability anymore
<andrewvos> josh9: That's a pretty blanket statement though. If you're testing small pieces of functionality it doens't matter if they're in a module or the same class.
<apeiros_> so you'll grow capabilities until you eventually have all anyway
<apeiros_> it's an exercise in vanity right now.
<apeiros_> josh9: as much as I like banisterfiends creations, I wouldn't use that in production.
<apeiros_> and iirc he said the same himself
<josh9> apeiros_: even without the ability to unmix a module i think it's nice to keep my classes smaller.
<apeiros_> josh9: ok. but it's not the route I try to go.
<andrewvos> I really don't like the idea of unmixing modules. Also, I don't see how it could ever be useful.
<josh9> and in the context of the web, i don't care about unmix since the object is short-lived.
<andrewvos> josh9: That implies that all the ruby code gets executed every request. It doesn't
<andrewvos> josh9: Not like in php.
lian_ [lian_!~lianj@17.145.34.193.static.giga-dns.com] has joined #ruby-lang
<apeiros_> mhm, framework-level code isn't short lived
<apeiros_> only request-level code is
<andrewvos> Like in sinatra. The Application class is short lived
guns [guns!~guns@c-98-228-72-208.hsd1.il.comcast.net] has joined #ruby-lang
<andrewvos> But it's only evaled once.
<apeiros_> and request-level code can travel to framework-level easily (think caching e.g.)
lianj [lianj!~lianj@17.145.34.193.static.giga-dns.com] has joined #ruby-lang
lianj [lianj!~lianj@subtle/user/lianj] has joined #ruby-lang
<josh9> andrewvos: but if i create a user object inside get '/'; end; isn't this object being created on every request to '/'?
geoffw8_ [geoffw8_!~geoffw8_@5add5509.bb.sky.com] has joined #ruby-lang
floyd [floyd!~floyd@17.145.34.193.static.giga-dns.com] has joined #ruby-lang
<andrewvos> josh9: Yep
<andrewvos> josh9: But not evaluated
<andrewvos> josh9: So you want to do something like: u = User.new; u.mixin(Module1); #dostuff; u.unmix(Module1) ?
<josh9> andrewvos: wait. because the code is evaluated only once, the module is still mixed?
<josh9> i guess i am not what 'evaluated' means.
<andrewvos> josh9: By evaluated I mean executed.
znz_jp [znz_jp!~znz@ns5.n-z.jp] has joined #ruby-lang
<josh9> andrewvos: so in sinatra, my code will be executed again and again, therefor my object will be clean, without the module mixed-in. so i have no need to worry?
<josh9> sorry if i got it all wrong..
scottschecter [scottschecter!~scottsche@c-98-252-167-171.hsd1.ga.comcast.net] has joined #ruby-lang
shapeshed [shapeshed!~shapeshed@5e02d68c.bb.sky.com] has joined #ruby-lang
Jake232 [Jake232!~textual@5e0e111e.bb.sky.com] has joined #ruby-lang
<andrewvos> josh9: No
<andrewvos> josh9: Each file will be executed only once
<andrewvos> josh9: But sinatra basically does Application.new for each request.
<andrewvos> josh9: What I mean by executed only once is that the code that defines the class is executed only once. The methods inside that class are exectued on every request.
<andrewvos> So for example "class SomeClass" will be executed only once.
jensn_ [jensn_!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
znz_jp [znz_jp!~znz@ns5.n-z.jp] has joined #ruby-lang
<josh9> andrewvos: oh. so if i have modules, classes, etc that are not part of my handlers(routes), they will be executed only for the first user of my site.
looopy [looopy!~looopy@static-71-166-231-146.washdc.east.verizon.net] has joined #ruby-lang
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby-lang
hagabaka [hagabaka!~hagabaka@unaffiliated/hagabaka] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
sodani [sodani!~shig@user-387hpcb.cable.mindspring.com] has joined #ruby-lang
sodani [sodani!~shig@user-387hpcb.cable.mindspring.com] has quit [#ruby-lang]
thrcka [thrcka!~thrcka@ip-89-102-34-33.net.upcbroadband.cz] has joined #ruby-lang
amerine [amerine!~mturner@bc171197.bendcable.com] has joined #ruby-lang
postmodern [postmodern!~postmoder@c-71-237-178-98.hsd1.or.comcast.net] has joined #ruby-lang
perryh [perryh!~perry@unaffiliated/perry753] has joined #ruby-lang
jensn [jensn!~Jens@c-83-233-145-148.cust.bredband2.com] has joined #ruby-lang
znz_jp [znz_jp!~znz@ns5.n-z.jp] has joined #ruby-lang
therrg [therrg!~therrg@eth6331.nsw.adsl.internode.on.net] has joined #ruby-lang
therrg [therrg!~therrg@eth6331.nsw.adsl.internode.on.net] has quit [#ruby-lang]
WillMarshall [WillMarshall!~willmarsh@ppp121-44-24-222.lns20.syd6.internode.on.net] has joined #ruby-lang