Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
<swarley> sorry, typing with the keyboard at a 45 degree angle is awkward
nark-1 has joined #ruby
<swarley> and i know
<apeiros_> (you can have the latter too, see scriptfile on github - I should wrap that thing up as a gem…)
werdnativ has joined #ruby
<apeiros_> swarley: I try not to imagine what you're doing…
looopy has joined #ruby
<swarley> Lol, just sitting with my knee up >.>
<RubyPanther> __DATA__ is Perl
<swarley> my favorite thing from C that ive done has been ERROR(__LINE__, __FILE__)
<swarley> Error on line 43 in lol.c!
yoklov has joined #ruby
<seanstickle> I think we've established that my use of italics was poorly chosen.
<Whizzy> Hello. May I ask what the language ruby was designed to be used for?
<swarley> Whizzy, general use, object orientation
<banisterfiend> apeiros_: can u ban RubyPanther for life from #ruby
<apeiros_> swarley: did something similar, but used printf and added a message
kevinbond has joined #ruby
<seanstickle> Whizzy: for programmer delight.
<apeiros_> banisterfiend: I can. but so far he didn't give enough reason. he's close, tho
<seanstickle> Whizzy: what kind of answer are you expecting?
<nark-1> which one is better for a post request: http://pastie.org/3410953?
<banisterfiend> maybe we should provoke him
<swarley> apeiros_, i was making a kernel with my friend, when i got printf, and sprintf to work as they should in the stdlib, i near died of excitement
<apeiros_> banisterfiend: hu? and there I thought he was consistently provoking about everybody…
<Whizzy> Well sean, I was looking for games, database apps, web use... something along those lines
<seanstickle> Whizzy: yep, all those
<seanstickle> Whizzy: and other stuff
manhunter has joined #ruby
<apeiros_> swarley: you seriously implemented all of printf/sprintf? like all the %*03d spookiness?
<Whizzy> Is it an easy language to pick up?
<apeiros_> Whizzy: yes. it's one of the easiest.
<manhunter> hi, what is the difference between functional programming and high level language, ?
<apeiros_> but it's not without its depths
<seanstickle> Whizzy: yes.
<Whizzy> What would you say is *THE* easiest?
<manhunter> is ruby a compiling langauage or interpret langauge like java?
<apeiros_> Whizzy: language? maybe logo
<seanstickle> manhunter: the same difference as between an apple and a library.
<apeiros_> manhunter: languages are not interpreted or compiled
<manhunter> seanstickle: can't get your poing
<seanstickle> Oh, jeez. manhunter is a troll.
<Whizzy> Never heard of Logo...
<manhunter> i meant programming language
<apeiros_> manhunter: you can have C interpreted, you can have ruby compiled
<manhunter> C language is compiled with gcc
<apeiros_> it's really a matter of the tools you use, not the language
<swarley> Whizzy, this video begins with Matz explaining why he developed ruby i believe http://www.confreaks.com/videos/11-mwrc2010-ruby124c41
<apeiros_> manhunter: yes, and C is interpreted with Cint
<apeiros_> as said, a property of the tools, not the language.
<swarley> any language can be either. depends on the implementation
<Whizzy> lol thank you swarley... Let me put this another way...
<manhunter> apeiros_: is it optional to use compiler or interpreter?
<apeiros_> manhunter: you may want to fire up a browser, point it to wikipedia and start reading first.
<apeiros_> or you could go to a CS course…
<swarley> for example haskell has ghc as well as runhaskell (i think is interpreted, but i may be wrong)
<manhunter> is ruby functional programming language?
<seanstickle> Or you could just say, yes, Ruby is typically interpreted, but there are compilers for it.
<hron84> manhunter: programming languages are not compiled. Source files are compiled. For programming languages you can write interpreter and compiler too. For example, for ruby, there is an interpreter, and a compuliler (jrubyc, rubinius/rbx) too. So it is highly depends on what do you want to do.
pdtpatr1ck has joined #ruby
<apeiros_> manhunter: srsly, did you try doing some research on your own for like 5 minutes before asking here?
<RubyPanther> MRI is written in C, you could say that Ruby "is" just a C library/DSL
<hron84> RubyPanther: python too :-)
<seanstickle> Suddenly everyone is a denotational semantics professor.
<manhunter> apeiros_: i read the wikipedia page for ruby
<apeiros_> I think I better get off irc… either people today are incredibly annoying or I'm just easy to be pissed off atm…
<Whizzy> I was challenged by a friend that I could not write a full blown (zork style) text adventure within a year. Now I need to shut his mouth, and prove him wrong. (Taking his money is just the icing on the cake)
<seanstickle> apeiros_: a bit from column A, a bit from column B
<Whizzy> Now... Let me ask
<RubyPanther> rb_funcall(rb_mKernel,rb_intern("puts"), 1, rb_str_new2("Compiled or interpreted???"));
<Whizzy> What language is best suited for games, such as text adventures.
<RubyPanther> take two chill pills and call somebody in the morning
<apeiros_> seanstickle: prolly
<apeiros_> Whizzy: ruby is certainly a good choice for that
<manhunter> apeiros_: yes, source code is writen in any programming language
<hron84> manhunter: pay more five minutes to research about it. for example, take look http://www.ruby-lang.org/en/
<apeiros_> Whizzy: depending on your prior level of knowledge you can pick up ruby in anything between a day and a couple of weeks
glosoli has joined #ruby
<seanstickle> Whizzy: IFMML
<seanstickle> IFML, sorry
_habnabit has joined #ruby
toothr has joined #ruby
manhunter has quit ["WeeChat 0.3.6"]
sroy2 has joined #ruby
<Whizzy> apeiros... No disrespect. I mean no ill manners towards you... But I'm in IRC asking whay the language was developed. Do you really think I have a level of knowledge? lol
<seanstickle> Whizzy: most questions or origin do not have simple answers
<apeiros_> Whizzy: then obviously it'd be more in the "couple of weeks" region…
<RubyPanther> Whizzy: Ruby exists to make programmers happier
<seanstickle> or -> of
<Whizzy> Sorry Sean... IFMML ?
<seanstickle> Whizzy: Interactive Fiction Markup Language
<apeiros_> Whizzy: also, you can have a background other than programming which is still helpful for picking up ruby quickly.
<Whizzy> Really?
<RubyPanther> Most languages exist to make the math geeks happier, to make the linguists happier, or to make the CPU happier.
<Whizzy> Didn't think of that... Well, I am a professional fund raiser... So nothing i do would help me there
toothr has quit [#ruby]
<seanstickle> I was a professional nuclear reactor operator.
<seanstickle> It takes all kinds.
_habnabit has quit [#ruby]
<sroy2> Whizzy: just for future knowledge… I've found wikipedia is a great place to look up answers to questions like that...
<Whizzy> Nuclear reactor operator? Why? Why would you do that?
mengu has joined #ruby
<seanstickle> Whizzy: they paid me.
<RubyPanther> That was before the accident. It caused a mutation. Now he zaps software bugs with xray beams from his eyes. It is his mutant power.
<Whizzy> >Sroy Yeah, but when you want to know whats going on, I find that talking to the people that do it, day in and day out works best.
<burgestrand> See, your background is helping you already.
<seanstickle> Now you can write a fundraising system in Ruby
<Whizzy> seanstickle Could never pay me enough to do that.
<banisterfiend> seanstickle: kinda like homer simpson? :P
<Whizzy> I don't need a fund raising system in ruby.
<Whizzy> lol
<seanstickle> Most of the fundraising systems I've worked with suck
<seanstickle> Raiser's Edge, yuck.
<Whizzy> That's becuase the fund raisers suck
<banisterfiend> burgestrand: sup burg dogg
<burgestrand> banisterfiend: \o,
<seanstickle> Whizzy: perhaps you should stop doing it.
<seanstickle> Whizzy: doesn't sound like you are very happy with that line of work.
fowl has joined #ruby
<banisterfiend> fowl: what's up dogg
<Whizzy> Are you kidding? I work three months out of the year, and spend the other 9 with my baby blowing money...
<seanstickle> You get a percent of the spend?
dagnachewa has joined #ruby
<Whizzy> I get $3.00 an item. Now, I have 12 schools in my city, with a total of 20000 salesmen, er... I mean students...
<Whizzy> Each of them sale (on average 15 items each)
<apeiros_> get yourself a private ruby teacher then
<Whizzy> Nah... I can teach myself, or I don't deserve to win the bet.
<apeiros_> isn't using irc cheating then?
<fowl> whats this a dick measuring contest? i own hundreds of women and much land in south america. i own a yacht with a swimming pool in it, fuck with me.
<apeiros_> I mean, where's the line?
<fowl> i'm ballin out the chain
simao has joined #ruby
<Whizzy> Not to research the languages, and see which I want to use... Why would that be cheating?
<apeiros_> *shrug*, your and your friend's rules. it's not as if I cared.
<Whizzy> >Fowl. Why would you think that sir?
rushed has joined #ruby
<seanstickle> Whizzy: you could always use one of the original interactive fiction languages: http://www.ifarchive.org/if-archive/games/source/advent-original.tar.gz
<Whizzy> Ah... Didn't know there was a special language for that...
<seanstickle> FORTRAN
<Whizzy> Well thank you Seanstickle...
<Whizzy> Fortran? Never heard of it. Is it an easy language to pick up?
<seanstickle> Many have learned it.
dibri has joined #ruby
<Whizzy> Many have learned to run a Nuclear reactor... doesn't mean it's easy sir...
mattonrails has joined #ruby
<Whizzy> Then again... homer simpson does it...
* burgestrand hugs apeiros_
* apeiros_ huggles burgestrand
<apeiros_> howdy buddy
<burgestrand> :)
<apeiros_> at least 2 people who aren't annoying :)
<seanstickle> :(
<burgestrand> watching this awesome video of some nanofilmthingy which makes surfaces completely water repellant
<seanstickle> burgestrand: bets on whether that has nasty health-destroying side effects?
<burgestrand> I would hope not, they tested it in hospitals :P
<seanstickle> They used thalidomide in hospitals too.
<Whizzy> Thanks all for the chat. Good day..
<fowl> yeah yeah
<apeiros_> seanstickle: why :( ?
<fowl> go get your attention somewhere else, LOL
Whizzy has quit [#ruby]
<burgestrand> This’ll probably only be fun for a few minutes, unlike kittens
<apeiros_> burgestrand: yeah, superhydrophobics are awesome. seen that very vid a while ago
<burgestrand> hehe
<burgestrand> Would be awfully annoying on clothing though, sure enough it keeps liquid out, but I’d assume it also keeps it in, and we aren’t the most dry creatures, to say the least
* burgestrand shrugs
<burgestrand> Also, DNA-sequencers on USB sticks that can sequence your whole genome in 2 hours, also kind of cool
<fowl> burgestrand enjoy it while it's optional
<burgestrand> fowl: what makes you think it is?
<burgestrand> ;)
<apeiros_> burgestrand: so… you use that on all your dates or sth? :)
swarley has joined #ruby
<seanstickle> I remember an old sci-fi story about applying superhydrophobic material to the front of a boat.
<burgestrand> Oh, wow, that’d be an awkard moment
<seanstickle> Pulls the boat through the water, making cheap transportation.
<burgestrand> seanstickle: !
<burgestrand> seanstickle: awesome!
<burgestrand> Also, put it on a wakeboard.
<apeiros_> I'd assume that pressure changes some properties of superhydrophobics
mayankkohaley_ has joined #ruby
<burgestrand> Yeah, probably, it would still be kind of cool with a hoverboard for water.
<seanstickle> Reactionless drives are the future anyways.
<apeiros_> I'd also assume that challenges like americas cup - where the boats use quite high-tech stuff - would experiment with such things
<apeiros_> seanstickle: you mean like this? http://www.youtube.com/watch?v=Zqmdv5iyIOY
<swarley> What did i miss
<seanstickle> apeiros_: well, besides being a hoax, that's a reaction drive.
<banisterfiend> burgestrand: burgerstand
<seanstickle> apeiros_: I mean something out of Niven
<burgestrand> Wipeout!
<apeiros_> seanstickle: sure it's a hoax? I mean the basic technology used there is pretty old…
<apeiros_> at least I thought it was just a cool/fun application of it…
<seanstickle> apeiros_: the tech is solid, but there are screencaps where the track is showing through the model
<burgestrand> banisterfiend: banisterfiend
<apeiros_> seanstickle: hm, well, too sad. it'd have been a funny experiment
bob2 has joined #ruby
colint has joined #ruby
decentrality has joined #ruby
<banisterfiend> burgestrand: burger stand
<burgestrand> banisterfiend: :p
neurodrone has joined #ruby
neurodrone has joined #ruby
<swarley> im bored. Someone tell me what to code
<banisterfiend> swarley: you can solve issues on my project if u want
<burgestrand> every time I give somebody that’s bored a suggestion on what to code they think it’s boring
<fowl> oo hey swarley how about a robot that parses news and makes jokes in horrible taste out of it?
<swarley> banisterfiend, depends, it may be over my head, after seeing your 9 line polish calculator lol
<banisterfiend> swarley: that wasnt mine, that was heftig's
<swarley> ah, right
<swarley> sorry
<banisterfiend> aka hefty boy's
<swarley> mistaken identity
<swarley> banisterfiend, whats your project?
<banisterfiend> swarley: fix the grammar and writing in this: https://github.com/pry/pry-exception_explorer/wiki
<fowl> swarley let me know when you're done i can screw it up again for you
<swarley> xD
<swarley> hm
<swarley> i might actually do that
<banisterfiend> swarley: though if you're one of those guys who mixes up 'your' and 'you're' forget about it ;)
<swarley> xD not at all, my mother is a novelist
<swarley> making that mistake in my house is grounds for sleeping outside
<swarley> im also not a looser
<swarley> just 15 years old
<swarley> So its reasonable that I live with my mother >.>
<swarley> banisterfiend, do you have the raw markdown?
<banisterfiend> swarley: if u 'edit' the wiki you see it
<swarley> Ah
<banisterfiend> but i wasn't entirely serious, also pick issues off here: https://github.com/pry/pry/issues
<banisterfiend> there's a tonne
<fowl> pfft
stringoO has joined #ruby
csprite has joined #ruby
<swarley> im editing it a bit
<swarley> making the words flow a bit better
<fowl> swarley if you can try to fit in into an AABB rhyme pattern
<swarley> LOL
<RubyPanther> This isn't Perl
mayankkohaley has joined #ruby
<banisterfiend> fowl: target sighted
<fowl> That's alright RubyPanther, this time we'll just act like that makes sense ;)
<swarley> what is pry btw
<banisterfiend> swarley: http://pry.github.com
libertyprime has joined #ruby
<RubyPanther> fowl: http://www.wall.org/~larry/natural.html Why Perl's poetry is better than Ruby's.
<RubyPanther> "Indeterminate dimensionality" in particular, or as I usually refer to it, ideological orthogonality.
<fowl> RubyPanther to that I scoff with a hearty guffaw
<RubyPanther> heh
<swarley> banisterfiend, huh, thats interesting
<RubyPanther> To the extent that Ruby needs more hearty guffaws, I certainly agree.
<swarley> i got so bored the other day i made File::Write, File::Append, File::Write... constants L|
<swarley> :|*
mayankkohaley has joined #ruby
crankycoder has joined #ruby
<fowl> swarley i like to try to break ruby with pry or come up with superfluous ways to do things
<swarley> lol
<swarley> whenever i code in perl i always end up beaking down and making some lame excuse for irb
<swarley> because there is just so little i can do with perl -e
crankycoder has joined #ruby
<swarley> and still understand what ive typed
crankyco_ has joined #ruby
emanu has joined #ruby
badabim has joined #ruby
ZachBeta has joined #ruby
<seanstickle> Yeah, lack of Perl REPL is annoying
crankycoder has joined #ruby
<swarley> maybe i should make a game with curses
Seisatsu has joined #ruby
<fowl> how about gosu?
<swarley> i really need to learn how to use GTK2 though..
<swarley> maybe i could make a calculator or something
<swarley> hm
<swarley> i really need to learn GLib
<swarley> so that i can finally start making applications with GUI
nfluxx has joined #ruby
<fowl> write an irc bot with the purpose of harassing #ruby-lang
mayankkohaley has joined #ruby
blueadept has joined #ruby
blueadept has joined #ruby
<swarley> fowl, this was the first module made
<swarley> in a bot that was my first attempt at modularity
<swarley> its designed to harrass people
jsvana has joined #ruby
<swarley> randomly takes words in messages and changes them to butt
robbyoconnor has joined #ruby
<swarley> expanding the amount of u s as needed to fill the length of the word
<jsvana> Given a hash with element :foo, how would I check if :foo is in an array, e.g., foo: [1, 2, 3, 4]
<jsvana> ?
<swarley> if hash[:foo].class == Array
<fowl> somehash.keys.include? :foo
<swarley> oh
<swarley> is in an array
* apeiros_ smacks fowl
<fowl> oh
<swarley> i dont think there is a way to tell if an object is nested
<apeiros_> .keys.include? is so insanely stupid…
<fowl> haha
<swarley> apeiros_, what would you do instead in a situation that would use .keys.include?
<fowl> apeiros_ papyrus is regressing my mind
<apeiros_> swarley: .keys.include? is a very expensive way to say .has_key?
<jsvana> swarley: so, no way to do it?
<swarley> oh, i need to read more rdocs
<swarley> jsvana, i dont believe so. but as you just saw, im not 100% sure of everything ;)
<apeiros_> swarley: .has_key? is O(1), which means that no matter how large your hash is, the time needed by it is (almost) constant
bonhoffer has joined #ruby
<swarley> i see
<fowl> jsvana so you have this hash like { :foo => something } and you want to see if :foo is in any array?
<bonhoffer> any idea how to test a full match with regex -- i want to make sure the whole string matches
<fowl> or some_array
<apeiros_> swarley: .keys.include? however is a) O(n), which means the larger the hash, the more time is needed, and b) has also a higher constant cost as it needs to create an array first.
<jsvana> fowl: yep. { :foo => [1, 2, 3, 4] }
<fowl> some_array.include?(:foo), since you know what you're looking for?
<jsvana> well, no
<bonhoffer> "1111a".match(/\d/) => false
jds has joined #ruby
<jsvana> foo just needs to match a number from that.
<apeiros_> bonhoffer: see anchors
<apeiros_> bonhoffer: you want /\A\d\z/
<swarley> jsvana, can we see a code snippit?
<bonhoffer> of course
<fowl> :foo is never going to match a number
<bonhoffer> or ^ $ in ruby too, right?
<apeiros_> notice however that that will only match a string containing a single digit. probably you want \d+ too
<fowl> >_>
<apeiros_> bonhoffer: no
<bonhoffer> oh, good to know, thanks
<apeiros_> bonhoffer: ^$ are start/end of *line*, \A\z are start/end of *string*
<apeiros_> "123\nfoobar" =~ /^\d+$/ # matches
<swarley> /^\d+\w$/ would match it
<bonhoffer> i see
<swarley> i believe
<swarley> but \w is just the a
<apeiros_> "123\nfoobar" =~ /\A\d+\z/ # does not match
<bonhoffer> in particular, i'm trying to match 10/10/12 but not 10//10/12 or any characters 10/a/10
<swarley> oh
<apeiros_> just anchor your expression then.
<bonhoffer> this has to run without error score.split("/").collect { |a| a.to_f }.sum
<swarley> /^\d+\/\d+\/d+$/ is what i would do. but maybe i dont understand what youre doing
<apeiros_> .inject(:+) { |s,a| s+a.to_f }
<bonhoffer> i will anchor the expression
<apeiros_> also, to_f doesn't raise with non-numerics.
<jsvana> bonhoffer: /^\d{2}\/\d{2}\/\d{2}$/
<bonhoffer> apeiros_, nice . . .
<apeiros_> jsvana: you just failed anchoring
<jsvana> apeiros_: oh?
<apeiros_> jsvana: see what I wrote above about ^$ vs. \A\z
<fowl> /..!..(0_o
<bonhoffer> sorry i want any size: 10/10/28/28/281/128
fr0gprince_ has joined #ruby
<bonhoffer> but _not_ 10//10 -- testing in rubular -- it is tough
<apeiros_> bonhoffer: also, why to_f if you only have ints?
<bonhoffer> apeiros_, i really want to read up on your inject
<jsvana> /\A(\d+\/)+\z/
<swarley> bonhoffer, /\A(\d+ | \d+\/)+\z/
<swarley> - ' '
* apeiros_ is nice today… /\A\d+(?:\/\d+)*\z/
<bonhoffer> wow
<bonhoffer> both -- swarley i understand yours
<apeiros_> unless an empty string is valid too… my expression requires at least one value
<bonhoffer> apeiros_, perfect -- it is ?: that is new to me
<apeiros_> bonhoffer: it means "don't capture"
<apeiros_> otherwise it's normal grouping
<apeiros_> captures are the things that end up in $1-$9
<swarley> /^(.+?)$/; $1
<swarley> i wish ruby had sub and translate built into the regex like s/// and tr///
<swarley> not really needed, but i liked it
<apeiros_> swarley: String#gsub and String#tr
<swarley> Yes i know
<fowl> thats just extra gobbledeegook
<swarley> I just like using it in the way i do with perl
<fowl> you'll grow to appreciate it not muddying things up
<apeiros_> swarley: actually I don't
<apeiros_> and I did perl quite a bit
<swarley> I would understand why you wouldnt
ZachBeta has joined #ruby
<apeiros_> it's IMO pretty clean the way ruby does it
<swarley> it is more verbose (appearance wise) to use String#sub
<fowl> ruby hates sandwiches. no subs. only def people.
<swarley> LOL
<burgestrand> swarley: https://gist.github.com/1447592
<bonhoffer> apeiros_, i've been playing with it but i don't get your don't include -- it does work
<burgestrand> :p
<apeiros_> bonhoffer: I don't get what you say, sorry
<bonhoffer> \d+ <-- any string then i want groups of \d+\/
<bonhoffer> i just don't understand why it works . .. but i should read up on it, sorry
<swarley> :o
jcromartie has joined #ruby
diago has joined #ruby
<banisterfiend> swarley: u bring out the 'lol' too easily, u should tease more, play harder to get or the guys making u lol will get bored
<swarley> it would probably be easier to split your string up by "/" and then check each individually for /\A\d+\Z/
<bonhoffer> thanks a ton for that -- the docs are very good on this . . .
<swarley> or a to_i that isnt 0
hck has joined #ruby
<bonhoffer> apeiros_, oh, i see what you mean by don't capture . . . just performance increase
incomprehensib-1 has joined #ruby
mayankkohaley has joined #ruby
danibx has joined #ruby
<apeiros_> bonhoffer: here, yes, only performance & intention
<swarley> anyone have a link to a Ruby-GNOME2 box layout
<swarley> example
macmartine has joined #ruby
<swarley> GTK Code view has poor ruby syntax hilighting
<bonhoffer> apeiros_, i get inject, but why inject(:+), what is that syntax?
* swarley is tired of gedit
<apeiros_> bonhoffer: oh I think I messed it up :)
linoj_ has joined #ruby
<bonhoffer> oh
<apeiros_> should be either .inject(:+) or inject with a block
<bonhoffer> i don't think it needs that -- yes
<apeiros_> since you have to map to float, you can drop the (:+)
<bonhoffer> nice -- thanks
<apeiros_> bonhoffer: also if you only have ints, use Integer(val, 10)
<apeiros_> instead of val.to_f
<bonhoffer> no, could be floats
<apeiros_> not with that regex.
<bonhoffer> oh, yes, you are right, thanks
<bonhoffer> need to put a . in there
<fowl> if you've got a string that could be some numbers you should just eval it and see what happens, could be magic? ;)
<bonhoffer> \A[\d\.]+(?:\:[\d\.]+)*\z
<apeiros_> float = /[+-]?\d+(?:\.\d+)?/; list = /#{float}(?:\/#{float})*/; raise unless string =~ list
<apeiros_> @ bonhoffer
<apeiros_> wrong and not very readable ;-p
<bonhoffer> mine?
<apeiros_> yes
<apeiros_> use composition for more complex expressions. makes them much more readable.
Targen has joined #ruby
<bonhoffer> oh, i'm doing : separators now
<bonhoffer> composition?
<apeiros_> well…
<apeiros_> float = /[+-]?\d+(?:\.\d+)?/; list = /#{float}(?::#{float})*/; raise unless string =~ list
nari has joined #ruby
<apeiros_> a = /foo/; b = /#{a}bar/ # <-- composition
<bonhoffer> got you . . . nice
gartick has joined #ruby
<apeiros_> ruby will even retain flags you set for subexpressions.
banisterfiend has joined #ruby
mkscrg has joined #ruby
MrGando has joined #ruby
luke-- has joined #ruby
wenbert has joined #ruby
lompa has joined #ruby
savage- has joined #ruby
sterNiX has joined #ruby
Liothen has joined #ruby
emmanuelux has joined #ruby
stkowski has joined #ruby
hck has joined #ruby
hck89 has joined #ruby
igotnolegs has joined #ruby
jordanstephens has joined #ruby
lompa has quit ["Leaving"]
sterNiX has joined #ruby
hck89 has joined #ruby
trend has joined #ruby
andrewhl has joined #ruby
rramsden has joined #ruby
Eth4n has joined #ruby
wenbert_ has joined #ruby
gartick has joined #ruby
jordanstephens has joined #ruby
emmanuelux has joined #ruby
kenneth has joined #ruby
<Eth4n> NickServ id
Guest71208 has joined #ruby
<kenneth> hey there, i'm wondering if anybody has experience doing math in ruby. i'm trying to implement a gradient descent algorithm
DylanJ has joined #ruby
<kenneth> and the part i'm having trouble with is d/dx: http://akhun.com/seo/skitch/Machine_Learning-20120218-182758.png
<DylanJ> i have a string "R\xC1T\xCDA\xCE-\x10MS\x11" which "apparently" is the equivlent of "RATMAN-[MS]" How on earth can i display the first string like the second?
CreativeEmbassy has joined #ruby
<kenneth> i barely remember my high school calculus class, much less how to solve it procedurally :p i know d/dx represents the slope of the tangent (rate of change) of my function (lambda) at point x
<fowl> kenneth in ruby remember to use parentheses with your math
<fowl> overdo it
<kenneth> right d/(dx)
<kenneth> etc
gokul has joined #ruby
andrewhl has joined #ruby
nari has joined #ruby
senthil has joined #ruby
arvindravi has joined #ruby
<kenneth> ugh it's coming back to me
spligak has joined #ruby
daniel_hinojosa has joined #ruby
mayankkohaley has joined #ruby
hadees has joined #ruby
anoNxeRo has joined #ruby
anoNxeRo has joined #ruby
wenbert has joined #ruby
crankyco_ has joined #ruby
<kenneth> so if i recall correctly i need to evaluate limit[h:0, (my_lambda(h+a)-my_lambda(a))/h]
Hanmac has joined #ruby
crankycoder has joined #ruby
ph^ has joined #ruby
jimmy has joined #ruby
crankycoder has joined #ruby
ZachBeta has joined #ruby
ph^ has joined #ruby
<kenneth> so basically, my question is how to evaluate a limit in ruby?
<fowl> sorry kenneth your question crosses into the realm of reasons i didnt take calculus. math is an art best left to those Collegiate Wizards
<kenneth> haha
<kenneth> well this is the part where i regret skipping CS :p
<startling> kenneth: there's a #calculus, funnily enough.
<seanstickle> kenneth: or perhaps https://github.com/brainopia/symbolic
sroy2_ has joined #ruby
<kenneth> yeah seanstickle i found this article, and his solution doesn't find the limit, just an infinitely close value
<seanstickle> kenneth: actually, not even infinitely close
<seanstickle> kenneth: you could always implement a ruby gem that does nonstandard analysis
<seanstickle> kenneth: that would avoid the need for limits
sdwrage has joined #ruby
nowthatsamatt has joined #ruby
td123 has joined #ruby
jds has joined #ruby
mlkarney has joined #ruby
Arkaniad has joined #ruby
<Arkaniad> Anyone here able to help me with some Capistrano issues?
radic_ has joined #ruby
sterNiX has joined #ruby
bbttxu has joined #ruby
bbttxu has joined #ruby
robert___ has joined #ruby
bonhoffer has joined #ruby
<spligak> Is there any sort of style preference in the ruby community for do; end blocks or {} blocks? Is it usually to use {}'s for one-liners where possible?
andrewhl has joined #ruby
<startling> spligak: yep
<startling> spligak: I'm not too experienced in ruby, but someone linked me here: https://github.com/bbatsov/ruby-style-guide when I asked that
blueadept has joined #ruby
blueadept has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
manhunter has joined #ruby
<manhunter> hi, is ruby functional language or procedural language?
kushal_ has joined #ruby
<td123> it's got elements of both
<td123> but it's first an object oriented language
<manhunter> what is functional language mean?
<spligak> A functional programming language is one where a function is the main control structure.
<startling> manhunter: it means "almost everything is a function"
<manhunter> i can write ruby code without defining a function
<manhunter> what is procedural language?
<startling> manhunter: a language where you just type things in order and it does them
<banisterfiend> manhunter: you need to spend some time on wikipedia
<spligak> Probably a good place to start: http://en.wikipedia.org/wiki/Procedural_programming
<spligak> The "See also" section has links to other types of programming, including functional.
<manhunter> startling: in every language i type line of code in order
<banisterfiend> manhunter: a procedural language is one like C
havenn has joined #ruby
<banisterfiend> manhunter: where the basic units of organization are procedures (functions)
<manhunter> is ruby a procedural language?
<startling> manhunter: you've never used a functional programming language, then
<startling> manhunter: it can be
<banisterfiend> manhunter: no, it's an object oriented language
<fowl> oop ruby is old hat
<banisterfiend> fowl: do u like old hats fowl
<fowl> i like dusty old hats
<banisterfiend> u like to walk around waring nothing but those hats, and then invte strange men over
<manhunter> i know what object oriented means , it about class and object
<manhunter> but is ruby a procedural language?
<fowl> in ruby Class is an Object and Object is a Class!
<banisterfiend> manhunter: you're a stupid bitch, read wikipedia
sdwrage has joined #ruby
<fowl> manhunter if you want to write code procedurally go ahead, i do it all the time
<manhunter> i can't understand it, http://en.wikipedia.org/wiki/Procedural_programming
<fowl> and i'm not saying you should just because I do, but keep in mind that around here I'm considered a pretty cool dude.
<manhunter> can anyone answer my question? is ruby a procedural language?
<banisterfiend> manhunter: NO it's not
<manhunter> banisterfiend: why not?
<manhunter> banisterfiend: give one reason
sterNiX has joined #ruby
<fowl> yeah banisterfiend prove it liar
<banisterfiend> manhunter: because you can program in almost every paradigm in most programmign languages, you can even program OOP in C. Yet no one calls C an object oriented language. The point is what is the emphasis of the language, what style does the programming language want you to program in? what is idiomatic for that language, what was that lanauge designed for?
<banisterfiend> manhunter: and ruby was not designed to be a procedural language, it was designed to be an object oriented language
<banisterfiend> so to ask if it IS a procedural programming language the answer is no - because that's not what it was designed for
<banisterfiend> however if you ask instead 'can you program a procedural style in ruby?' teh answer is yes
<banisterfiend> just as you can program an OOP style in C, or even a functional style in C (if u try hard enough)
sdwrage has joined #ruby
<manhunter> banisterfiend: ok, thank you
<startling> functional in C would be pretty hard, yeah.
<manhunter> can anyone answer my question? is ruby a functional language?
<fowl> hory shit
<startling> btw, this guy is banned in all the #python-* channels. we can't tell if he's a troll or not.
vermelho has joined #ruby
<fowl> startling: nice try Snake-Friend, but you just gave yourself up. we don't abide Guido's kin in this channel
<startling> heh.
vermelho has quit ["WeeChat 0.3.6"]
vermelho has joined #ruby
<manhunter> procedural langauge means it executes code step by step or line by line, right?
<fowl> manhunter nope
<td123> manhunter: ruby has some functional elements, but you can't classify it as a functional language
<kenneth> OH YEA
havenn has joined #ruby
<kenneth> the longest i've ever spent working on a 60 line script
<kenneth> :p
<banisterfiend> kenneth: dr kenneth noisewater?
<kenneth> critique my code please!
<kenneth> banisterfiend: hmm? what is that
<td123> kenneth: now write an algorithm that will learn the xor function :)
<fowl> kenneth can i just edit it from gist
<kenneth> fowl: yea
<fowl> oh wait im not sure you can do that anymore i dont see the edit button
<kenneth> you should be able to
<kenneth> hmm
<fowl> oh nvm found it
Kn|t3_ has joined #ruby
<manhunter> td123: what is functional language then?
<banisterfiend> kenneth: I know what you're asking yourself and the answer is yes. I have a nick name for my penis. Its called the Octagon, but I also nick named my testes - my left one is James Westfall and my right one is Dr. Kenneth Noisewater. You ladies play your cards right you just might get to meet the whole gang."
<kenneth> looool
<manhunter> fuck l0000l
<td123> troll alert
manhunter has quit ["WeeChat 0.3.6"]
jds has joined #ruby
<td123> lol..
<kenneth> i might have to rewrite this in lisp anyway
mlkarney_ has joined #ruby
<kenneth> because say i want to move something like this to production, i will probably have to pre-generate the solution lambdas and store them somewhere, for scalability
<kenneth> because running this super simple script takes 50ms on my laptop
<td123> kenneth: or you can use already existing libs ;)
<fowl> kenneth i just changed your while true block into until good
<fowl> good = false; until good that is
<kenneth> i wish ruby would let you treat code as data
<kenneth> i have a bunch of use cases where serializing a lambda would be oh-so-awesome
<kenneth> td123: got any to name-drop?
<kenneth> fowl: sweet, didn't know about until
Kn|t3_ has joined #ruby
<td123> I don't do any math related work on ruby so dunno, but any machine learning library will surely have something
havenn_ has joined #ruby
crankyco_ has joined #ruby
mlkarney has joined #ruby
<fowl> you can also use it postfix too, if you can find a use for it
Kn|t3__ has joined #ruby
Kn|t3_ has joined #ruby
liluo has joined #ruby
mlkarney has joined #ruby
czn has joined #ruby
mlkarney has quit [#ruby]
mlkarney has joined #ruby
crankycoder has joined #ruby
rickmasta has joined #ruby
Kn|t3_ has joined #ruby
nfluxx has joined #ruby
oddmunds has joined #ruby
crankycoder has joined #ruby
nuba has joined #ruby
tomku has joined #ruby
orospakr has joined #ruby
kushal__ has joined #ruby
sterNiX has joined #ruby
Evixion has joined #ruby
mlkarney has joined #ruby
ap0gee has joined #ruby
ZachBeta has joined #ruby
vikingly has joined #ruby
CreativeEmbassy has joined #ruby
havenn has joined #ruby
<vikingly> Hi! I have a group of Ruby classes that conceptually belongs together. Is it recommended to create a module for these classes?
<seanstickle> Yes.
Arkaniad has joined #ruby
banisterfiend has joined #ruby
<vikingly> Is there a best practice for naming modules? The main concept is defined in one class, e.g Event, and the others classes are used by that class. Should the Module also be called Event?
Kn|t3__ has joined #ruby
acts_as_david has joined #ruby
<DylanJ> how can i make "\xFF" spit out 255?
crankyco_ has joined #ruby
<DylanJ> "\xFF".magic => 255
<banisterfiend> vikingly: what module, you mean the enclosing module for your project?
jergason has joined #ruby
crankyc__ has joined #ruby
<vikingly> banisterfiend: Not for the whole project. I'd like to group models in rails that conceptually belong together into modules.
acts_as_david has quit [#ruby]
<banisterfiend> vikingly: ask on a rails channel, i think they have their own idioms
<vikingly> banisterfiend: is there a ruby best practice? The rails convention is that a class SomeClass in SomeModule is defined in 'app/models/some_module/some_class.rb'.
<banisterfiend> vikingly: i guess that's what i do in pure ruby too
<banisterfiend> without being consciously aware of it
crankyco_ has joined #ruby
<vikingly> banisterfield: Thanks.
<banisterfiend> no problem
<vikingly> One of the classes is always the main concept in my case. I want to name the module MainModuleName=MainClass+postfix. Any suggestion to what the postfix should be?
acts_as_david has joined #ruby
tomzx has joined #ruby
dhruvasagar has joined #ruby
davejacobs has quit [#ruby]
davejacobs has joined #ruby
mayankkohaley has joined #ruby
Seisatsu has joined #ruby
luxurymode has joined #ruby
davejacobs has quit [#ruby]
kenneth has joined #ruby
pu22l3r has joined #ruby
ZachBeta has joined #ruby
<DylanJ> how can i make "\xFF" spit out 255? "\xFF" => 255 ?
Evixion` has joined #ruby
sdwrage has joined #ruby
akem has joined #ruby
andrewhl has joined #ruby
bjhaid has joined #ruby
a__ has joined #ruby
Eth4n has joined #ruby
zakwilson has joined #ruby
headius has joined #ruby
ubermensch has joined #ruby
sterNiX has joined #ruby
<DylanJ> "\xFF
<DylanJ> "\xFF".bytes.to_a <--
DylanJ has quit [#ruby]
<spligak> How would I go about writing a function which yields a character in a continuous rotation? Given "aeiou" the first time I'd call func() it would yield "a" then the second time, "e" and so on. Once we got to the end, it would repeat.
<spligak> I'm fiddling with str.split(//).rotate - but I think there's an easier way
TheMystic has joined #ruby
pdtpatr1ck has joined #ruby
<spligak> Oh neat, got something working here...
<spligak> http://pastie.org/3412251 -- how's this look?
rippa has joined #ruby
<spligak> I suppose I need to yield once before I rotate, though
<spligak> no, just yield the current first char, then rotate. don't need to fiddle with anything before the loop
IAD has joined #ruby
x0F_ has joined #ruby
acts_as_david has joined #ruby
<swarley> anyone here good with GTK
<swarley> ?
cableray has joined #ruby
<spligak> Updated the pastie a bit. It seems pretty neat - though I'm sure there are some Ruby golfers who could one-line this.
vraa has joined #ruby
bjhaid has joined #ruby
looopy has joined #ruby
<swarley> spligak,
<swarley> irb(main):004:0> "hello".tr('n-za-mN-ZA-M','a-zA-Z')
<swarley> => "uryyb"
<spligak> I guess I could just monkey patch this onto String itself, be able to do things like "aeiou".rotate {|c| p c }
dark3rdre4ms has joined #ruby
<swarley> DylanJ
<swarley> ?\xFF
<swarley> oh
<swarley> he's gone
<swarley> oh
<swarley> you mean shifting the letters around
<rippa> haven't read the thread
<TheMystic> spligak: http://pastie.org/3412303
<rippa> is it related to #cycle ?
<swarley> var = "aeiou"; var.split(//).unshift(var.drop(1))
colint_ has joined #ruby
<TheMystic> which incidentally works in 1.8 too
<TheMystic> (because it doesn't require Array#rotate!)
<rippa> str = *str.chars
<spligak> TheMystic: that's an excellent improvement. still fairly clear what's happening, too.
<swarley> i dont see the use in this, but i would do mine. even though it is probably inefficient
<swarley> yours is vastly superior lol
<TheMystic> swarley: yours does something entirely different.
<spligak> Mine? or his? TheMystic has made improvements, IMHO
<swarley> I thought, it was taking ['a','e','i','o','u'] and moving the letters
<spligak> Just rotating them however many times, providing the first through yield
<TheMystic> swarley: you're doing a ROT13. spligak is just yielding each character in the string the specified number of times
<swarley> mine would make it ['u','a','e','i','o']
<swarley> TheMystic, i make another one liner
looopy has joined #ruby
<swarley> <swarley> var = "aeiou"; var.split(//).unshift(var.drop(1))
<TheMystic> oh, your second one
<TheMystic> i see now
<TheMystic> still, different
<swarley> yeah
<swarley> but given enough iterations it would do the same outcome
<swarley> without output though
<spligak> It's totally cool though, all this is fairly enlightening. Working on my ruby-foo.
<TheMystic> "aeiou".split(//).rotate
<TheMystic> (in 1.9)
<spligak> The reason I'm looking to use yield is the ability to nest this type of operation cleanly.
looopy has joined #ruby
<swarley> anyone good with GTK, first time working with it and i just want my TextView to expand to the correct size lol
adman65 has joined #ruby
RenatoSilva has joined #ruby
gianlucadv has joined #ruby
banisterfiend has joined #ruby
<spligak> TheMystic: How does this look? Is it cool to patch this into String? http://pastie.org/3412251
Pikkachu has quit [#ruby]
<swarley> oh
<swarley> so this is cycle
<TheMystic> spligak: monkeypatching is generally discouraged, unless it's really a general-purpose extension to a core class
Ttech has joined #ruby
<banisterfiend> TheMystic: or the monkey-patch does something really badass
<TheMystic> e.g. ActiveSupport's Object#blank? is a pretty good monkeypatch
macmartine has joined #ruby
<spligak> I see. So better to leave it packaged up with my module or whathaveyou?
<TheMystic> banisterfiend: no. you fail. :)
<TheMystic> spligak: depends on what you're using it for.
<TheMystic> might belong in a utility module or somesuch.
<rippa> puts string.split("")
<rippa> here
<rippa> I rotated a string
<rippa> by 90 degrees
thone_ has joined #ruby
<spligak> rippa: nice :)
<TheMystic> ahh, and yes, this is Array#cycle
<swarley> so guys
<spligak> TheMystic: so it could be simplified I take it?
<TheMystic> spligak: "aeiou".cycle(14) {|c| puts c }
<TheMystic> erm, not quite i guess...
<spligak> Yeah, needs the conversion right?
<swarley> ("aeiou".split(//).cycle(14) {|c| puts c}).take(14)
<TheMystic> yes, and the integer that #cycle takes is the number of times thru the whole thing, not the total number of yields
<swarley> more cycling than needed
<swarley> but you end with 14 chars
<rippa> "asd".chars.cycle(3, &method(:p))
<rippa> it has smilie!
<banisterfiend> TheMystic: if the monkeypatch is just used for a development or debugging tool, it's fine IMO
<swarley> oh
<swarley> whoops
<rippa> swarley: you can drop the parens
<swarley> yeah
<rippa> "aeiou".split(//).cycle(14) {|c| puts c}.take(14)
<swarley> ope
<swarley> no
<banisterfiend> TheMystic: consider #should in rspec :)
<swarley> because cycle doesnt return an array
<rippa> wait what
Eth4n has joined #ruby
<rippa> "aeiou".split(//).cycle(14).take(14) {|c| puts c}
looopy has joined #ruby
<TheMystic> banisterfiend: ...which is a horror that must die.
<rippa> swarley:
<swarley> god im dumb tonight
<rippa> one 14 is redundant though
<banisterfiend> TheMystic: or this: https://github.com/pry/pry-exception_explorer ;)
<TheMystic> banisterfiend: but even so, rspec contains its monkeypatching in its own execution context. it doesn't globally monkeypatch everything to add #should
<rippa> "aeiou".split(//).cycle.take(14) {|c| puts c}
<swarley> but you can drop the { .. }
<swarley> because take wont call the block
<banisterfiend> TheMystic: that's not possible, you can invoke #should on any object
<banisterfiend> TheMystic: 5.should == 6, it works in rspec
<rippa> "aeiou".split(//).cycle.take(14).each {|c| puts c}
<swarley> there we go
<TheMystic> puts "aeiou".split(//).cycle(3).take(14)
headius has joined #ruby
<rippa> TheMystic: why the argument to #cycle?
<swarley> well you would need to do math to make sure you are supplying enough letters as you are taking
wallerdev has joined #ruby
<rippa> you can just use #cyce without arguments
Banistergalaxy has joined #ruby
<rippa> that gives you endless numbers
<TheMystic> banisterfiend: yes, but only in your test suite, because you `require 'rspec'`
<TheMystic> and even that is pretty horrible, because then all code running within your test suite is different from that running in your dev environment.
<TheMystic> rippa: just don't call #to_a on it :)
<banisterfiend> TheMystic: that was what i said, if the monkeypatch is confined to development or debugging context it's not so bad.
dnjaramba has joined #ruby
<TheMystic> it's still pretty bad. especially for a test harness, where you really really want your code to behave the same as in production.
<rippa> I want some way to monkeypatch stuff because it makes it easy to use, but contain it so it doesn't fuck things up
<rippa> like some kind of tag
<TheMystic> rippa: ISTR matz working on something for that
<rippa> =MONKEYS
<rippa> good to hear
pdtpatr1ck has quit [#ruby]
<swarley> sometimes i think
<spligak> So I guess here's where the application of our string rotation comes into play.
<swarley> i want to filter ruby like you can filter perl
<swarley> and then i get mad at myself
<swarley> and tell myself i need to die in a hole
<swarley> because thats a dumb idea
<spligak> I'm looking to substitute vowels in a string - say, "school" would become "schaal" and "schael" etc, through all permutations.
<spligak> The vowel positions are known, and are currently stored in an array - this case I guess would be [3,4] right?
<spligak> So assuming we can easily rotate over a string of vowels, trying to determine how to use that to generate all these iterations.
<spligak> or.. permutations, whatever we're calling them.
Ttech has joined #ruby
<rippa> there's #permutations, you know
<spligak> I do
<rippa> *permutation
seo has joined #ruby
<spligak> haven't quite figured out a way to use that here.
<TheMystic> well, here's conceptually what you're doing: generating all the permutations of length n of the five vowels (presuming only English text), where n is the number of vowels in the string.
<TheMystic> once you've done that, you can substitute the vowels into the string in the right places.
<rippa> %w<a e o i u>.permutation(2)
<spligak> Gah! It completely slipped my mind permutation takes a number like that.
<swarley> spligak, you can weed out vowels with this http://pastie.org/3412441
<swarley> either one works
<swarley> but using it or not depends on your method anyway
<swarley> use it or dont, im just killing time ;)
<TheMystic> huh, i didn't know there was a #permutation method :)
<spligak> TheMystic: it's pretty awesome. used it earlier for reducing duplicates in every possible way.
<spligak> where n-chords would need to stay intact, right? so "ssschoolll" you'd want to reduce in such a way to where you do get "oo" in a version without having to have a predefined set of chords.
<TheMystic> ...but #permutation is permutations without repetition.
<TheMystic> which is not what you want here.
<swarley> holy jesus
<swarley> i didnt know
dnjaramba has joined #ruby
<swarley> {a: "foo"} # => {:a=>"foo"}
<swarley> how was i unaware
<swarley> that i dont need a json lib
<TheMystic> swarley: oh but you still do. don't you dare go around #eval'ing JSON.
<swarley> xD
<spligak> swarley: I'll second that. /stare
<TheMystic> that kind of coding will earn you one free kick to the harblz.
<swarley> i would have just had an external file and done load 'conf/conf.json'
<swarley> lol
<swarley> i wouldnt eval an entire json file
<TheMystic> besides, you can just suck in JSON with psych (or syck), right?
<swarley> i didnt know that
<swarley> i thought it only handled YAML
<TheMystic> (because JSON is a strict subset of YAML)
<swarley> btw
<spligak> TheMystic: you are correct, sir. Any idea as to how I could get .permutations to include dupes like "[a, a]" ?
<swarley> why do yaml files begin with ---
<TheMystic> spligak: was looking for that -- not sure
<TheMystic> swarley: because that's what delimits a yaml 'document', and you can have multiple documents per file
<swarley> ah
<spligak> by including each vowel twice, looks like. eek.
* TheMystic <-- way more versed in the vagaries of yaml than necessary
<spligak> %w<a a e i o u>.permutation(2).each
<spligak> that seems horrific, though.
<spligak> easy, but just not clean.
banseljaj has joined #ruby
setient has joined #ruby
mlkarney has joined #ruby
<spligak> actually, that's going to produce too much useless stuff, anyway -- dupes of a whole bunch of pairs, obviously.
<TheMystic> .sort.uniq
<swarley> ^
<TheMystic> but i don't think it actually works
<spligak> worth the cost for simplicity, you think?
<spligak> well, it returns an enumerable
<swarley> what
jergason has joined #ruby
<spligak> permutation does, right?
<swarley> oh
<spligak> so you'd have to consume that and then .uniq
<swarley> i wasnt paying attention to know whats going on with that
<TheMystic> well, you have to include n copies of each vowel for #permutation(n)
<TheMystic> in the general case
<swarley> %w{a e i o u} * n?
zomgbie has joined #ruby
<TheMystic> yep
<spligak> oh good lord.
<spligak> okay
<spligak> let me fiddle with this idea for a sec
<TheMystic> which is a rather brute-force metho.
<TheMystic> +d
<TheMystic> ("aeiou".split(//) * 3).permutation(3).to_a.sort.uniq.length #=> 125 == 5 ** 3
<swarley> this may seem long and complicated
<swarley> but imagine just multiplying the string in C
<TheMystic> yes, but for n > 3, it gets _really_ slow
<banisterfiend> swarley: what poblem are you trying to solve exactly
<swarley> for(int i = 0; i != count i++) strcat(str, str);
<swarley> banisterfiend, with GTK?
<spligak> I suspect it'd be the .sort which would make it slow -- why are you including that?
<banisterfiend> swarley: i mean all this permutation() stuff
<swarley> oh
<swarley> thats not me
<swarley> lol
<spligak> banisterfiend: I'm permutation happy at the moment ;)
dnjaramba has joined #ruby
_|christian|_ has joined #ruby
<TheMystic> oooo
<TheMystic> a = "aeiou".split(//); a.product(a, a[, ...])
<TheMystic> there's how you do it
<TheMystic> permutation without replacement == cartesian product
<TheMystic> erm, permutation _with_ replacement
<swarley> k
<swarley> someone is going to tell me what the hell permutation does
<TheMystic> you could even be evil and define Array#** >:-D
<spligak> swarley: every possible combination of a given set
<swarley> oh
<spligak> though, that's not entirely correct
<swarley> that would make some crazy arrays
<swarley> given i dont know
<spligak> yeah
<spligak> TheMystic: I'd use that if I fully understood what's happening
ZachBeta has joined #ruby
<spligak> this bit: a[,...] befuddles me
nixmaniack has joined #ruby
<swarley> File::Slurp('~/.ssh/id_rsa.pub').split(//).permutation.to_a
mayankkohaley has joined #ruby
<TheMystic> spligak: oh, that's just to indicate that you can take #product of an array with itself as many times as you need.
<swarley> That would kill my computer
<TheMystic> the number of times you do it == the number of chars in the resulting arrays.
<spligak> so how would you call that with a variable, say?
<TheMystic> a = str.split(//); a.product(a, a) # where r = 2
<TheMystic> a = "aeiou".split(//); a.product(*(a * r))
<TheMystic> more generally, for any r
<TheMystic> in your case, where r == the number of vowels in the string
eldariof has joined #ruby
<spligak> right - now usage makes sense. just uncomfortable with the splat syntax
dnjaramba has joined #ruby
krz has joined #ruby
banseljaj has joined #ruby
dibri has joined #ruby
dnjaramba has joined #ruby
bassplayerdoug has joined #ruby
Shamgar has joined #ruby
sdwrage has quit [#ruby]
dnjaramba_ has joined #ruby
hukl has joined #ruby
<spligak> TheMystic: when using your latest version, I'm getting "can't convert String into Array" for some reason?
<spligak> On this bit: a.product(*(a * r))
dnjaramba has joined #ruby
<TheMystic> oh, i see why.
<TheMystic> a = "aeiou".split(//); a.product(*([a] * r))
nemesit has joined #ruby
<TheMystic> to get r copies of the array instead of an array with r repetitions of the *elements* in a
<TheMystic> oh, actually, it should be:
dnjaramba_ has joined #ruby
<TheMystic> a = "aeiou".split(//); a.product(*([a] * (r - 1)))
<spligak> That's so much faster it's laughable.
trivol has joined #ruby
<TheMystic> it still doesn't take much to break malloc() with that though
<TheMystic> anyway, bedtime.
TheMystic has quit [#ruby]
dnjaramba has joined #ruby
jmaister has joined #ruby
majoh has joined #ruby
dominikh has joined #ruby
wenbert has joined #ruby
Morkel has joined #ruby
dnjaramba has joined #ruby
bier has joined #ruby
jcromartie has joined #ruby
wallerdev has joined #ruby
dnjaramba has joined #ruby
ribayr has joined #ruby
lkba has joined #ruby
remink has joined #ruby
vraa has joined #ruby
dnjaramba has joined #ruby
robert__ has joined #ruby
spligak has quit [#ruby]
banseljaj has joined #ruby
iband has joined #ruby
dnjaramba has joined #ruby
csprite has joined #ruby
juanojeda has joined #ruby
<juanojeda> hi guys, i have a bit of a novice question
<juanojeda> i'm trying to set up guard-livereload and it requires devkit, but whenever i try to install the gem it spits out a bunch of errors and won't install
ephemerian has joined #ruby
<juanojeda> to clarify - i've installed devkit as per the instructions at https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
vraa has joined #ruby
eldariof has joined #ruby
<hukl> juanojeda: you are on windows ?
LMolr has joined #ruby
<hukl> juanojeda: hrm i have no experience on windows :/
Radar has joined #ruby
<juanojeda> hukl yes i'm on windows :(
danslo has joined #ruby
ph^ has joined #ruby
jds has joined #ruby
ryanf has joined #ruby
Spockz` has joined #ruby
oposomme has joined #ruby
adambeynon has joined #ruby
tk_ has joined #ruby
rcs has joined #ruby
Husio has joined #ruby
<juanojeda> what does it mean when I get the error: failed to build gem native extension?
Banistergalaxy has joined #ruby
<Husio> hi
dibri has joined #ruby
<Husio> is there official ruby tutorial?
<Husio> or I should choose one from list on the ruby website
jds has joined #ruby
<banseljaj> Husio: Pickaxe is the sorta official book
<wallerdev> juanojeda: usually that means that you need some library installed on your system to build that gem
<juanojeda> is there any way to determine which library I need?\
<Husio> ok
<wallerdev> does it give you any other messages? and what gem is it?
<juanojeda> i'm trying to install guard-livereload
<juanojeda> it spits out a bunch of stuff - i can pastebin it?
<wallerdev> sure
<wallerdev> looks like the gem has an irc channel at #guard no idea how active it might be tho
<juanojeda> yeah I'm in there now and I've asked but no dice so far
<juanojeda> no action there it looks like
<wallerdev> what OS are you on?
<juanojeda> >.> Vista 64bit
dnjaramba has joined #ruby
stayarrr has joined #ruby
<wallerdev> well I'm guessing that's the problem haha
<juanojeda> dangit
<wallerdev> the last 2 lines that start with cmain.cpp are the issue
<wallerdev> I'm not really familiar with that error though
<juanojeda> hrmm
<juanojeda> it gives me somewhere to start though
<juanojeda> thanks :)
<wallerdev> yeah you could try asking the author of the gem if there are any known issues with windows
berkes has joined #ruby
virunga has joined #ruby
jds has joined #ruby
dnjaramba has joined #ruby
<juanojeda> turns out it needs the prerelease version of eventmachine
<juanojeda> fixed I think
davidpk has joined #ruby
<juanojeda> yes!
jbw_ has joined #ruby
briankbuckley has joined #ruby
yxhuvud has joined #ruby
dnjaramba has joined #ruby
wenbert has joined #ruby
setient has joined #ruby
dcl has joined #ruby
vraa has joined #ruby
Arkaniad has quit [#ruby]
punkrawkR has joined #ruby
iocor has joined #ruby
Jrz has joined #ruby
apeiros_ has joined #ruby
daglees has joined #ruby
dnjaramba has joined #ruby
Eth4n has joined #ruby
dnjaramba has joined #ruby
sungji has joined #ruby
punkrawkR has joined #ruby
sawjig has joined #ruby
<juanojeda> how do I add a gem to a gemfile group?
<burgestrand> You put inside the group in the Gemfile
<burgestrand> juanojeda: http://gembundler.com/groups.html
Deele has joined #ruby
ged has joined #ruby
<juanojeda> so I need to edit a gemfile?
<burgestrand> Yes, if you want to change gemfile groups you need to edit your gemfile
zomgbie has joined #ruby
<juanojeda> thanks burgestrand
tuxaddicted has joined #ruby
medik has joined #ruby
<shevy> burgerstrand!
<shevy> burgers on the strand!
<banisterfiend> shevy: you seem excited
<shevy> just his nick cracking me up
<shevy> strand = beach
<shevy> though
<shevy> I guess his nick is more from Burg, which means castle
<shevy> but isn't as funny as Strand
<burgestrand> it’s both actually
<banisterfiend> sand castle?
<shevy> haha
zastaph has joined #ruby
<shevy> I guess a Castle near an ocean or something
<banisterfiend> burgestrand: what do u think the dilly is with macruby now that apple are phasing out GC
<burgestrand> banisterfiend: got no speculation, only hope
<Sp4rKy> :W 8
<banisterfiend> burgestrand: what hope can be left, aside from implementing their own gc layer? (i guess)
<burgestrand> yeah, GC’ll still be around for a while though
Talvino has joined #ruby
<banisterfiend> burgestrand: but they're still driving towards a setting sun, that's not going to enthuse people
<banisterfiend> hmmm
<shevy> we shall sadly mourn macruby
dnjaramba has joined #ruby
<banisterfiend> burgestrand: can you come up with a way to identify class methods vs instance methods? :)
<banisterfiend> oh
<banisterfiend> obj.method(:blah).owner == obj.singleton_class
medik has joined #ruby
robotmay has joined #ruby
dnjaramba has joined #ruby
kreantos has joined #ruby
Kambus has joined #ruby
dnjaramba has joined #ruby
cdabba has joined #ruby
Foxandxss has joined #ruby
My_Hearing has joined #ruby
jds has joined #ruby
phantomfakeBNC has joined #ruby
dnjaramba has joined #ruby
zomgbie has joined #ruby
medik has joined #ruby
glosoli has joined #ruby
banisterfiend has joined #ruby
QaDeS has joined #ruby
Banistergalaxy has joined #ruby
ph^ has joined #ruby
waxjar has joined #ruby
juanojeda has quit [#ruby]
punkrawkR has joined #ruby
niklasb has joined #ruby
medik has joined #ruby
fridim_ has joined #ruby
bashdy has joined #ruby
lateau_ has joined #ruby
snakeleg has joined #ruby
wenbert has joined #ruby
dnjaramba has joined #ruby
oposomme has joined #ruby
graybeard has joined #ruby
Eth4n has joined #ruby
Eth4n has joined #ruby
dnjaramba has joined #ruby
snearch has joined #ruby
<snakeleg> help
medik has joined #ruby
tvo has joined #ruby
<apeiros_> snakeleg: you should probably specify what you need help with.
seanstickle has joined #ruby
<snakeleg> i'm new in ruby
<snakeleg> q:what are the best sources for learning ruby?
johndbritton has joined #ruby
<banisterfiend> how can i find out whether an UnboundMethod's owner is an eigenclass?
<shevy> snakeleg http://pine.fm/LearnToProgram/?Chapter=01 work through this as fast as possible
medik has joined #ruby
<snakeleg> thanks,shevy
mengu has joined #ruby
rms-ict has joined #ruby
yeltzooo has joined #ruby
rabbitear has joined #ruby
medik has joined #ruby
conceal_rs has joined #ruby
mayankkohaley has joined #ruby
jamw has joined #ruby
dnjaramba has joined #ruby
medik has joined #ruby
graybeard has joined #ruby
akem has joined #ruby
Ch4rAzZz has joined #ruby
fr0gprince_mac has joined #ruby
Guest6314 has joined #ruby
medik has joined #ruby
bonhoffer has joined #ruby
Divinite has joined #ruby
<Divinite> Anyone know where I can learn about how to use EventMachine for a telnet server?
<seanstickle> Build an icapd server instead.
<Divinite> Sorry, I don't know what that is. What is it?
fighella has joined #ruby
<Divinite> seanstickle: What's an icapd server?
<seanstickle> Sorry, that was just me hoping for one.
<seanstickle> It's a sort of calendar server.
<Divinite> Oh, well that's not my aim lol. But do you know where I can learn to use it? I've been using gserver for prototyping.
<fighella> can anyone help out with a quick pry question… (how do i save changes to a record… simple i thought)
dnjaramba has joined #ruby
<banisterfiend> fighella: what is meant be record
<banisterfiend> by*
azbarcea__ has joined #ruby
<banisterfiend> fighella: ?
<fighella> err sorry (bit of a noob) but basically Class is Book, the first "book" in my database i am calling the record… so i change the title of the Book.first using pry… and then want to save my change….
medik has joined #ruby
<Divinite> banisterfiend: fighella is calling you.
<fighella> banisterfiend: err sorry (bit of a noob) but basically Class is Book, the first "book" in my database i am calling the record… so i change the title of the Book.first using pry… and then want to save my change….
<banisterfiend> fighella: save it to where?
havenn has joined #ruby
<fighella> banisterfiend: it's already in my database… i want to save the change… or update the record
<banisterfiend> fighella: well there must be a method on the object that lets you do that
<banisterfiend> it's not a pry issue afaik
<banisterfiend> fighella: maybe ask in #rails
dnjaramba has joined #ruby
<fighella> banisterfiend: haha i did, they sent me here! :) thanks for your help tho… i will find the method… (i think it must just differentiate a bit to the way i do it in regular rails console) thank you tho! much appreciated
_ramo has joined #ruby
<_ramo> hi
fighella has quit [#ruby]
fighella has joined #ruby
<Divinite> banisterfiend: What should I use to make a telnet server? I'm hosting a Hackathon @ my school soon.
<banisterfiend> fighella: how do you do it in the regular rails console?
<_ramo> I'm trying to install http://capifony.org/ on my server... somehow, gem install capifony runs without error, but when i try to do a "capifony ." the console says: capifony: command not found . does anyone know what's going wrong here?
xec has joined #ruby
Divinite has joined #ruby
<fighella> banisterfiend: @book = Book.first , @book.update(:name => 'new name'), @book.save (something like that)
<banisterfiend> fighella: and how does that not work in pry?
<banisterfiend> fighella: it should work teh same
<Divinite> banisterfiend: Sorry I missed what you said, if you said anything.
<fighella> banisterfiend: in pry it's : cd Book, cd first, name = 'new name' … returns the name… then 'save'.. returns true…
<banisterfiend> Divinite: nothing, sorry
fayimora_ has joined #ruby
<fighella> banisterfiend: when i view the object after… it hasn't got my change
<fighella> Weird! :)
<Divinite> banisterfiend: So can you recommend anything?
<banisterfiend> fighella: try self.name = 'new name'
dnjaramba has joined #ruby
MissionCritical has joined #ruby
<banisterfiend> fighella: btw u dont have to 'cd' in pry if u dont want to, u could type exzctly what u typed in rails console and it will work in pry too
<banisterfiend> fighella: 'cd' is just a convenience, u dont *have* to use it:)
<Divinite> Is anyone else here??
<banisterfiend> fighella: i tihnk your issue though is that when you simply go 'name = 'new name'' you are just deifning a local
<apeiros_> no
<rabbitear> Divinite: you mean besides bots?
<fighella> banisterfiend: aaahh that'd be ittt
<fighella> durrgggh
<fighella> thanksS! :)
<banisterfiend> fighella: np
<banisterfiend> fighella: works now?
<fighella> let me have a look (feed a screaming baby) and get back to you
<fighella> thanksss
<Divinite> Well, rabbitear and apeiros_ hello there
<banisterfiend> oh o
<banisterfiend> ok
davidpk has joined #ruby
<apeiros_> Divinite: I'm not here
<rabbitear> hello there too
<Divinite> Can you guys help me?
andyl has joined #ruby
<rabbitear> you've fallen and we should call the cops?
<apeiros_> Divinite: with?
<Divinite> I'm wondering what to use for a telnet server. I was thinking EventMachine.
<apeiros_> Divinite: new to ruby?
<Divinite> What's your opinion.
<Divinite> Yes
<apeiros_> start with a simpler way then. see TCPServer
<rabbitear> telnet server in linux?
<Divinite> Like 3-4 day
<canton7> eventmachine works great for that sort of thing... Though there might be something beter
<banisterfiend> Divinite: eventmachine may be overkill
<rabbitear> one second, brb
<Divinite> Alright.
<fighella> banisterfiend: screaming averted… hah.. lets try this
<apeiros_> Divinite: it's like a 10 liner with TCPServer (require 'socket' to get TCPServer, it's part of stdlib and hence comes with ruby)
<Divinite> Does it have an "input" handler?
<apeiros_> well, 10 liner for a somewhat working telnet-server :)
<canton7> hwo easy is it to do multiple simultaneous connections with TCPServer?
<canton7> s/hwo/how
<apeiros_> canton7: as easy as any concurrent programming
<apeiros_> you can use either threads or Kernel#select + non-blocking
<Divinite> I was using gserver.
<apeiros_> hm, I never really got the appeal of gserver.
<apeiros_> then again, I never really tried.
_ramo has quit [#ruby]
<Divinite> But everyone doesnt like it. I find it really easy.
<Divinite> But I'm a noob so yeah.
<Divinite> *at Ruby.
<fighella> banisterfiend: that was right… thanks a million
<Divinite> I need to make an input and reply to it.
<banisterfiend> fighella: np
<Divinite> apeiros_: So how would it grab input?
Dreamer3 has joined #ruby
<apeiros_> Divinite: server = TCPServer.new(host, port); client = server.accept
<apeiros_> client is a TCPSocket, you can perform normal IO operations on it, like IO#gets etc.
<apeiros_> note, you probably want "0.0.0.0" as host. that's the instruction to bind to all interfaces.
<Divinite> Ok. Well I half understand that.
<Divinite> apeiros_: It's going to be on a vps.
<canton7> Divinite, just out of interest, I wrote you an echo server using eventmachine: http://pastie.org/3413568
<Divinite> apeiros_: It only has one ip, should I bind to it?
<Divinite> canton7: I'm going to check that out, thanks!
<apeiros_> that's your choice. I never bind to specific addresses.
<Divinite> apeiros_: Why?
<apeiros_> because I don't see an advantage, only the disadvantage of less comfort.
<Divinite> canton7: Thanks so much :D
Amirh has joined #ruby
<Divinite> apeiros_: Well, I suppose.
<Divinite> canton7: Would that be able to take more than one connection at a time?
<canton7> Divinite, yeah. You can an instance of the Handler class per connection, and obviously send_data sends data only to that connection, and receive_data receives data only from that connection
dnjaramba has joined #ruby
<Divinite> Ok, so you could also log connecting ip's?
<Divinite> canton7:
<canton7> Divinite, sure, I've updated the pastie to show that
<Divinite> Awesome. Thanks so much! I think I'll say a thank you on www.chattaboxa.info soon! :)
Eth4n has joined #ruby
Eth4n has joined #ruby
<Divinite> Alright! I'll add that to my list to read!
<Divinite> canton7: Any other recommendations?
<canton7> Divinite, I suspect everything you'll need to follow an eventmachine approach is in those latter two links. The docs are pretty good
<Divinite> canton7: Thanks so much for your help!
hubub_ has joined #ruby
<canton7> no worries :)
Oog has joined #ruby
<Oog> using rvm installing ruby 1.9.3 on os x lion with xcode 4.2 i used --with-gcc=clang and it worked but i see the note that this breaks gems with native extensions....
medik has joined #ruby
<Oog> i need xcode 4.2 for ios development. if i install osx-gcc-installer will it break xcode?
danslo1 has joined #ruby
fighella has quit [#ruby]
<Oog> or can i install osx-gcc-installer with xcode and itll live separately?
simao has joined #ruby
bashdy has joined #ruby
gartick has joined #ruby
nari has joined #ruby
dnjaramba has joined #ruby
luxurymode has joined #ruby
banseljaj has joined #ruby
mayankkohaley has joined #ruby
medik has joined #ruby
<Oog> you know i just saw that you can use brew install ruby... that seems to be working
medik has joined #ruby
<Oog> wow that worked... why doesnt rvm work...
phantomfakeBNC has joined #ruby
<banseljaj> Oog: you installed a system ruby
<Oog> oh so the rvm installs a special ruby?
<Oog> i thought it just managed versions so it would compile the same code
QKO has joined #ruby
<shevy> I think RVM installs into a directory in your home dir
<Oog> it does
<seanstickle> Unless you install as root
<Oog> but rvm has a problem compiling ruby when xcode 4.2 is installed
<Oog> you have to use --with-gcc=clang which supposedly breaks native extensions
<Oog> so im trying to figure out why system ruby was able to compile
<Oog> but rvm has the problem
<banseljaj> I haven
<banseljaj> I haven't used a mac, but sounds like alibrary conflics
dnjaramba has joined #ruby
<Oog> yeah interesting anyway thanks
16WAAA9CW has joined #ruby
twelvechairs has joined #ruby
medik has joined #ruby
etank has joined #ruby
dnjaramba has joined #ruby
elliot__ has joined #ruby
conntrack has joined #ruby
dnjaramba has joined #ruby
dibri has joined #ruby
kjellski has joined #ruby
<kjellski> can anyone tell me how I could load a file into rib and have the variables in the script accessible afterwards? or do I need to change the namespace? and if so, how?
<kjellski> -rib +irb
rippa has joined #ruby
rcj_ has joined #ruby
zomgbie has joined #ruby
dnjaramba has joined #ruby
kirun has joined #ruby
fr0gprince_ has joined #ruby
oposomme has joined #ruby
<banisterfiend> kjellski: hi
<kjellski> hi
<kjellski> banisterfiend, hi
<banisterfiend> kjellski: type this: TOPLEVEL_BINDING.eval File.read(your_file), your_file, 1
<banisterfiend> no
<banisterfiend> that wont work in stupid irb
<banisterfiend> that will work in pry though
<banisterfiend> irb uses a different binding than TOPLEVEL_BINDING
<kjellski> banisterfiend, whoot? I've got no idea
<banisterfiend> kjellski: you could try what i said anyway
<kjellski> banisterfiend, I thought there would be something nice and clean like use or load-into or so...
phantomfakeBNC has joined #ruby
* apeiros_ repeats what he says everytime somebody wants that:
<apeiros_> local variables are called LOCAL for a reason, damit
<apeiros_> so stop trying to do something stupid. use constants for data that should be available across requires.
<banisterfiend> kjellski: try this: IRB.CurrentContext.workspace.binding.eval File.read(your_file), your_file
* apeiros_ sobs
fr0gprince_ has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
linoj_ has joined #ruby
<banisterfiend> kjellski: that worked for me
<kjellski> apeiros_, I'm just trying to test a small script and want the data it's collecting to be interactively usable for some modifications
<kjellski> banisterfiend, thanks!
<apeiros_> kjellski: ye, don't change a thing really.
<apeiros_> if it's just a small script, making a letter uppercase isn't hard.
<apeiros_> but hey, go around 500 corners if you prefer.
<banisterfiend> kjellski: really what you want is to start an irb-like session in the middle of your code, rather than bringing your code (awkwardly) to an irb session
<banisterfiend> kjellski: apeiros wrote a tool called 'pry' for that, http://pry.github.com
flippingbits has joined #ruby
<apeiros_> (banisterfiend didn't mean to say that I wrote it)
conntrack has joined #ruby
dnjaramba has joined #ruby
<kjellski> apeiros_, never mind, just made that one uppercase character...
bluenemo has joined #ruby
bluenemo has joined #ruby
diago has joined #ruby
glosoli has joined #ruby
eka has joined #ruby
<banisterfiend> kjellski: probably the best way, but did u try that long thing i typed out first?
<banisterfiend> just curious if it worked for u
<shevy> sex
dnjaramba has joined #ruby
<kjellski> banisterfiend, nope, actually I start fiddling around with pry
<banisterfiend> kjellski: i wish u had tried it
Kn|t3_ has joined #ruby
<kjellski> banisterfiend, I'll try it for you, sec
<kjellski> banisterfiend, nope, no locals available after TOPLEVEL_BINDING.eval File.read(your_file), your_file, 1
<banisterfiend> kjellski: ok, did u try the other one?
<apeiros_> banisterfiend: you can't create new variables in a binding
Asher1 has joined #ruby
<banisterfiend> kjellski: IRB.CurrentContext.workspace.binding.eval File.read(your_file), your_file
<apeiros_> they'll only be available during the eval
<kjellski> banisterfiend, okay...
<banisterfiend> apeiros_: let's see ;)
<apeiros_> in irb it's possible to some extent, due to how irb works
<apeiros_> banisterfiend: http://pastie.org/3414038
crankycoder has joined #ruby
<apeiros_> there
<kjellski> banisterfiend, this one works!
<kjellski> ;)
<banisterfiend> apeiros_: i know, but in this case the binding is kept alive since it's the context for the session
<apeiros_> it is, however possible to change existing locals: http://pastie.org/3414038
<kjellski> never mind, pry beats the shit out of me
<banisterfiend> kjellski: because stdlib is a fossil anyway, better to keep things as gems if u want them rapidly updated
<apeiros_> banisterfiend: true, which is why I said it works in irb to some extent
<apeiros_> banisterfiend: well, if we're lucky, stdlib becomes gemified
<apeiros_> in 2.0
<kjellski> apeiros_, I hope so
<banisterfiend> kjellski: it took u about 20 seconds to install pry
<banisterfiend> i dont think you'll gain so much having it in stdlib
crankyco_ has joined #ruby
<kjellski> banisterfiend, you could avoid typing "irb" which leads you to the "wrong" repl though ;)
neurodrone has joined #ruby
neurodrone has joined #ruby
<banisterfiend> kjellski: irb isn't bad, it's better than the default python repl anyway
Vendethiel has joined #ruby
<banisterfiend> and for some reason irb comes with a bunch of useful stuff turned off
<banisterfiend> like completion and indentation
<kjellski> banisterfiend, but pry seems really _way_ better then irb
<banisterfiend> kjellski: i think you just like the colors:)
Jake232 has joined #ruby
workmad3 has joined #ruby
<kjellski> banisterfiend, since you wrote it, you know the places that are really better, I started like 5 minutes ago and already like the completion, the help and, yes, the colors...
<banisterfiend> kjellski: the really cool stuff is here: http://banisterfiend.wordpress.com/2012/02/14/the-pry-ecosystem/
adambeynon has joined #ruby
<banisterfiend> my favorite is pry-exception_explorer but it seems to have been completely ignored by almost everyone :)
rickmast has joined #ruby
<kjellski> banisterfiend, wohoooo, looks like slime ^^ but I'll explore the full capabilities on the run...
dnjaramba_ has joined #ruby
Azure|netbook|dc has joined #ruby
Azure|dc has joined #ruby
<banisterfiend> kjellski: yeah that's the idea, smalltalk/slime
<banisterfiend> we'll get there eventually...
__class__ has joined #ruby
<kjellski> anyways, since I've just started ruby, maybe another question
<banisterfiend> kjellski: a module's class? what's that?
<kjellski> actually I've just my one script file in my "projects" directory
<banisterfiend> you mean: module MyModule; class MyClass... ?
Seisatsu_ has joined #ruby
<kjellski> banisterfiend, argh
ph^ has joined #ruby
Azure|dc2 has joined #ruby
<banisterfiend> kjellski: if XML is just a class, then you can reopen via: class Nokogiri::XML; def to_json...
<banisterfiend> kjellski: whether it's a good idea is another thing :)
<kjellski> banisterfiend, that's what I do, but where to put that code? and is there another way? Or a more (magical word following) idiomatic way?
Azure|netbook has joined #ruby
Kn|t3_ has joined #ruby
nd____ has joined #ruby
phantomfake has joined #ruby
bonhoffer has joined #ruby
<banisterfiend> kjellski: if you're modifying a class that already exists u could probably put it in something like a extensions/xml_extensions.rb file or something
<banisterfiend> im not sure of any idioms in this area but they probably exist
<banisterfiend> kjellski: but it's best to store it in a way that makes clear to people it's a monkeypatch
Azure has joined #ruby
nuba_ has joined #ruby
sroy2_ has joined #ruby
<kjellski> banisterfiend, yeah, just for my little hack here....
<banisterfiend> kjellski: if it was me, and this was a library you were writing, i'd put it in lib/my_project/extensions/nokogiri_xml_extensions.rb if u were patchinga lot of stuff on nokogiri though maybe i'd put it in extensions/nokogiri/xml_extensions.rb
waxjar has joined #ruby
<kjellski> banisterfiend, thats a good hint on how to structure this, it this a generally good ruby code structure approach? http://bit.ly/yUGo07
liluo has joined #ruby
<banisterfiend> kjellski: looksfine
sernin has joined #ruby
seanstickle has joined #ruby
Mohan has joined #ruby
looopy has joined #ruby
Eth4n has joined #ruby
divout has joined #ruby
dhruvasagar has joined #ruby
kreantos has joined #ruby
mikeycgto has joined #ruby
berkes has joined #ruby
PatrixCR has joined #ruby
PatrixCR has quit [#ruby]
atmosx has joined #ruby
bonhoffer has joined #ruby
silky has joined #ruby
lateau_ has joined #ruby
canton7 has quit ["Leaving"]
chaitanya has joined #ruby
ekaleidox has joined #ruby
_|christian|_ has joined #ruby
Knodi has joined #ruby
canton7 has joined #ruby
lkba has joined #ruby
bashdy has joined #ruby
daglees has joined #ruby
canton7 has joined #ruby
looopy has joined #ruby
Morkel has joined #ruby
<kjellski> banisterfiend, I'm running into a problem that I don't understand. In my project, I've moved the file from . to lib/extensions/nokogiri_json_extension.rb and now the parser is telling me that in some line there is an unexpected tSYMBOL
<kjellski> Where should I start to look at how to design module structure?
Eth4n has joined #ruby
dark3rdre4ms has joined #ruby
dark3rdre4ms has joined #ruby
Sailias has joined #ruby
davidpk has joined #ruby
headius has joined #ruby
emocake has joined #ruby
conntrack has joined #ruby
tayy has joined #ruby
divout has joined #ruby
oposomme has joined #ruby
Eth4n has joined #ruby
Eth4n has joined #ruby
Kn|t3_ has joined #ruby
kevinbond has joined #ruby
incomprehensibly has joined #ruby
pdtpatr1ck has joined #ruby
kjellski has joined #ruby
waxjar has joined #ruby
fr0gprince_ has joined #ruby
csavola has joined #ruby
gokul has joined #ruby
l5k has joined #ruby
stdcall has joined #ruby
mlkarney has joined #ruby
minijupe has joined #ruby
chaitanya has joined #ruby
stdcall has quit [#ruby]
hukl has joined #ruby
fr0gprince_ has joined #ruby
Eth4n has joined #ruby
Eth4n has joined #ruby
stdcall has joined #ruby
nixmaniack has joined #ruby
kreantos has joined #ruby
ChampS666 has joined #ruby
<shajen> how to use setTimeout in coffescript?
<apeiros_> shajen: wrong channel?
<pen> anyone using rake as a replacement for make? if so how do you handle dependencies? how do you replace autotools?
<shajen> apeiros_: ok, sory :)
oposomme has joined #ruby
vereteran has joined #ruby
<banseljaj> Hi. Help with shoes?
oposomme has joined #ruby
yoklov has joined #ruby
acekiller has joined #ruby
justfielding has joined #ruby
waxjar has joined #ruby
Kn|t3_ has joined #ruby
td123 has joined #ruby
Kn|t3_ has joined #ruby
oposomme has joined #ruby
glosoli has joined #ruby
justfielding has joined #ruby
havenn has joined #ruby
simao has joined #ruby
Eth4n has joined #ruby
psudo has joined #ruby
psudo has quit [#ruby]
minijupe has joined #ruby
Sailias has joined #ruby
Excureo has joined #ruby
justfielding has joined #ruby
a__ has joined #ruby
simao_ has joined #ruby
KL7 has joined #ruby
araujo has joined #ruby
nemesit has joined #ruby
dootdoot has joined #ruby
andrewhl has joined #ruby
xlogic has joined #ruby
Divinite has joined #ruby
Eth4n has joined #ruby
Eth4n has joined #ruby
glosoli has joined #ruby
paissad has quit ["Leaving"]
oposomme has joined #ruby
gabeh has joined #ruby
mattonrails has joined #ruby
Kn|t3__ has joined #ruby
kreantos has joined #ruby
dch4pm4n has joined #ruby
Kn|t3_ has joined #ruby
Kn|t3_ has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
niklasb has joined #ruby
andycc has joined #ruby
<andycc> Hey guys, I have a bit of a problem with a sinatra web app - a (sort of) URL shortener. I wrote it and hosted it on Heroku, and all works well if I use the .herokuapp.com URL. However, I want to have a .tk domain name for it. Thing is, if I try to access the app via the .tk domain name, it just doesn't work. Any pointers on what I should try?
<andycc> (by "it doesn't work" I mean it shows a blank page)
irocksu has joined #ruby
<irocksu> hi
<irocksu> is there a good latex parser in ruby?
tommyvyo has joined #ruby
niklasb has joined #ruby
stdcall has joined #ruby
Kn|t3_ has joined #ruby
looopy has joined #ruby
v0yager has joined #ruby
tomzx has joined #ruby
Guest has joined #ruby
p0y has joined #ruby
stdcall has joined #ruby
tommg has joined #ruby
headius has joined #ruby
tayy has joined #ruby
elliot__ has joined #ruby
mayankkohaley has joined #ruby
imami|afk has joined #ruby
anon117 has joined #ruby
Kn|t3_ has joined #ruby
incomprehensibly has joined #ruby
stdcall_ has joined #ruby
ph^ has joined #ruby
mattonrails has joined #ruby
blueadept has joined #ruby
Vendethiel has joined #ruby
jgrevich has joined #ruby
stringoO has joined #ruby
Targen has joined #ruby
flippingbits has joined #ruby
Ajdare has joined #ruby
chimkan_ has joined #ruby
wallerdev has joined #ruby
bashdy has joined #ruby
adamjleonard has joined #ruby
zomgbie has joined #ruby
dibri has joined #ruby
nfluxx has joined #ruby
mickn has joined #ruby
swarley has joined #ruby
davidpk has joined #ruby
wyhaines has joined #ruby
stephans has joined #ruby
oposomme has joined #ruby
oposomme has joined #ruby
oposomme has joined #ruby
hennie has joined #ruby
mrtheshadow has joined #ruby
gabeh has joined #ruby
bonhoffer has joined #ruby
banseljaj has joined #ruby
looopy has joined #ruby
burgestrand has joined #ruby
hennie has quit [#ruby]
jds has joined #ruby
bbttxu has joined #ruby
ph^ has joined #ruby
dibri has joined #ruby
banisterfiend has joined #ruby
oposomme has joined #ruby
rms-ict has joined #ruby
srid has joined #ruby
srid has joined #ruby
srid has joined #ruby
Kn|t3__ has joined #ruby
mitya_ has joined #ruby
<hron84> andycc: how do you determine your domain? Or how do you generate links? Please provide us some code to help you.
wallerdev has joined #ruby
Squee-D has joined #ruby
<mitya_> hi everyone
SegFaultAX has joined #ruby
slippyd has joined #ruby
<mitya_> I am trying to get the Rack handler for Thin, when I type Rack::Handler.constants :Thin is one of the entries
<mitya_> but when I do > Rack::Handler::Thin it says no such file to load
<mitya_> How can I get the Thin rack handler
<burgestrand> mitya_: install thin
snakeleg has joined #ruby
mikepack has joined #ruby
Felixfox has joined #ruby
nfluxx has joined #ruby
headius has joined #ruby
maletor has joined #ruby
<mitya_> burgestrand: Ah... I had assumed that since Rack had the handler Thin was installed... my mistake
<mitya_> burgestrand: thanks
andycc has joined #ruby
bluOxigen has joined #ruby
daniel_hinojosa has joined #ruby
tayy has joined #ruby
gabeh has joined #ruby
colint has joined #ruby
pdtpatr1ck has joined #ruby
emmanuelux has joined #ruby
ceej has joined #ruby
Ryan has joined #ruby
kjellski has joined #ruby
<banseljaj> Anyone well acquainted with shoes available?
<shevy> never used shoes, never will
<seanstickle> shevy: you're more of a vibram man?
<shevy> seanstickle I am a ruby-gtk man!
Kn|t3_ has joined #ruby
<shevy> though ruby-qt looks better. but its docu sucks
<seanstickle> Ah, that too
<seanstickle> wxruby forevah
Phazte has joined #ruby
hayon has joined #ruby
hkhalid has joined #ruby
<hkhalid> hi
Phazte has quit [#ruby]
<hkhalid> friends
<shevy> hi
<shevy> foes
igotnolegs has joined #ruby
<hkhalid> shevy are you on osx
<seanstickle> IFF!
<hkhalid> or linux
<shevy> linux of course
<hkhalid> hmmmm
<hkhalid> oh fuck
<hkhalid> I forgot I can vm now
<slippyd> Howdy all.
<slippyd> I'm having a weird issue with running Ruby that requires gems from TextMate.
<banseljaj> :(
<slippyd> And TextMate pros in the room?
<banseljaj> All I want is a simple GUI app. And i keep getting dragged into these gui wars. :(
<banseljaj> Can't anyone help. :\
* hkhalid busts a gui on banseljaj
<slippyd> banseljaj: It depends on what you're familiar with and what platform(s) you'd like to target.
dnjaramba has joined #ruby
* banseljaj has all the gui toolkits installed, yet has had no work done. :\
<hkhalid> use gosu
<hkhalid> and make games
<hkhalid> and learn how to use it
<slippyd> Platform-specific GUI tools are almost always going to be better (simpler, more flexible, more fluid, more docs and examples), but it may not suit your needs (e.g. if you want something simple, but cross-platform)
samertm has joined #ruby
<samertm> hey
johndbritton has joined #ruby
<samertm> how would one add another variable to an object?
<samertm> like if I had an array called grid
<samertm> and I wanted to give it a value 'max'
<tayy> given a Date object (a future date), how do i subtract two days and set a time to it?
csprite has joined #ruby
<banseljaj> slippyd: Hmm. I'm on ;linux, and i intend to go cross platform. But for now, I'd stick with simpler.
<tayy> i found d << n, which returns n months bef self. but i need it to be in days?
stephans has joined #ruby
simao has joined #ruby
atmosx has joined #ruby
dnjaramba has joined #ruby
banseljaj has joined #ruby
SegFaultAX has joined #ruby
<banseljaj> hello?
<banseljaj> hkhalid: you just named a gui toolkit i've never heard of before. ;-; Which is what has been happening to me all the time
flippingbits has joined #ruby
<banseljaj> slippyd: I am on linux. Want to do cross platform
<slippyd> banseljaj: Hmm
<slippyd> You'll have to ask someone else her n.
<slippyd> ^here then
<slippyd> I'm a Mac guy.
* hkhalid slaps slippyd around a bit with a large trout
davidpk has joined #ruby
<banseljaj> Well, the ruby is the same, no?
<banseljaj> hkhalid: Am i to assume that you are muslim by your name?
<hkhalid> no
<hkhalid> are you mooslimg
bhunt has joined #ruby
<atmosx> my ebox cannot handle usb devices anymore
<atmosx> either the non-original power adapter is the cause, or I somehow manage to burn the ports
<banseljaj> I was.
<atmosx> hmmm hope it's the former the real reason
<atmosx> banseljaj: you changed religion? that's strange
workmad3 has joined #ruby
<atmosx> not more weird than java programming whatsoever
dootdoot has joined #ruby
<banseljaj> I left religion. I'm an atheist
<banseljaj> Nayways. Anyone able to guide me through shoes? :(
<atmosx> Where are you from Ali?
<hkhalid> if you were shia
<hkhalid> I can understand if you saw people beating themselves up like tards
zakwilson has joined #ruby
<atmosx> banseljaj: I don't like GUI programming
<banseljaj> Not Sgia.
<banseljaj> Shia
enherit has joined #ruby
<hkhalid> or your parents are morons
<hkhalid> when it comes to religion
<atmosx> hkhalid: ?
<atmosx> hkhalid: wtf are you talking about?
<banseljaj> Actually, my da's an atheist. :P
<hkhalid> muslims
<tayy> what's the alternative for adding 8.hours to a DateTime obj in plain ruby?
<atmosx> hkhalid: You consider muslims 'tards?
<atmosx> hkhalid: and I assume the Christians are the smart ones?
matthias3 has joined #ruby
<shevy> religions are a disease of the mind
burgestrand has joined #ruby
<atmosx> shevy: it might be, if you are a fanatic. But judging someone from it's reliigion is as stupid as judging him by the color of his skin. Or by his skills in a programming language (to mention something closer to our reality)
<hkhalid> people do that all the time
<hkhalid> its the reason ruby isnt picked up as much
<hkhalid> as people view the japanese part and get racist
nfluxx has joined #ruby
<hkhalid> its not antiquated histroy in US that they locked up japaense people
<atmosx> hkhalid: I hardly believe so
<hkhalid> and tortured them here in USA
<shevy> atmosx: eh. I do not go around and tell anyone that there are people who wrote a holy book, that an entity like "god" would exist, and other hallucinations.
<atmosx> I didn't even knew that Matz was Japanese when I first grab ruby.
<hkhalid> atmosx that becuase you dont care about ruby
<hkhalid> you should have a pic of him on your wall
<atmosx> shevy: I totally understand you I won't argue with you on that. I'll argue if you insult them on a false basis that you *know the truth* and they don't. You can't prove that God exists more than you can prove that it doesn't.
<atmosx> even the very definition of God is a point of debate in many cultures
<shevy> But I don't run around claiming god exists, whereas the religions do.
<atmosx> hkhalid: care about ruby in what sense? I don't care about my computer either, in a way.
<atmosx> hkhalid: I don't live out of it… if that's what you mean.
<atmosx> shevy: Because they believe so. Does that bother you in any way? :-)
<hkhalid> you should read about Matz
<hkhalid> and worship him
<shevy> No, it's not at all. It is a claim made by humans. It came mostly because people of the past did not want to understand that after death comes nothing, so they had to come up with mysticism. It's the same reason why people in the past believed that there exists "starmetal" (iron in meteorites falling down from the sky). Those mental diseases will become less and less the more people know.
<atmosx> hkhalid: haha okay.
<hkhalid> im jk
<shevy> atmosx, yup it does. Because the church is tax exempt for instance here.
<hkhalid> im muslim, but not muslim like the tards I see today. I believe life is a simulation and god is the ultimate programmer, I cant prove it but life seems like that to me, and if it walks like a duck ..etcetc...
<shevy> atmosx, but I am equally unfair to all religions ;)
<atmosx> shevy: in Greece too. I agree with you it should be heavily taxed
<hkhalid> I can exaplin life in code
<shevy> yeah hkhalid
mlkarney has quit [#ruby]
<hkhalid> most muslims would think im psycho
<atmosx> shevy: I agree on that, not taxing the church it's stupid and contradicts the very existence of it. It's mission if you get me
<shevy> people in the past did not know about genes and DNA
<hkhalid> i dont talk about it, but they are all just about money and status
<hkhalid> nothing to do with islam i think
<shevy> today you have synthetic biology
<banseljaj> hkhalid: o.O
<atmosx> hkhalid: are you muslim?
<hkhalid> uh yes
<banseljaj> fanatics are the ones diseased. and they make the majority look bad.
<hkhalid> I just said I am
<hkhalid> but I dont think in terms of good and bad and perosn in clouds
<hkhalid> i think more of dimensions and energy and code
<atmosx> shevy: there are people who think that the harmony and complexity of a cell is a proof of a god-like thing uppon thee
<seanstickle> dimensions and energy huh?
<seanstickle> Sounds New Agey
<hkhalid> i write short blurbs everyday to explain how life is code
<seanstickle> Like totally about the vibrations man
<hkhalid> nah f new wage
<shevy> atmosx yup but that does not "explain" anything. they put up a claim and stop there without wanting to explain it. for the church it is tactical, because it did not fit into their world view. just remember how galileo was made their enemy for claiming that the earth ain't the center of the world
<hkhalid> new age is for white yuppies
<atmosx> shevy: how can you explain something you don't understand?
<hkhalid> atmosx is is following a religion.....athiesm
<seanstickle> hkhalid: sounds like what you're on about
<hkhalid> seanstickle you need to turn off the tv dude
<hkhalid> and radio
<hkhalid> and reddit
d3vic3 has joined #ruby
<seanstickle> People listen to the radio still?
<seanstickle> Are you IRCing from 1988?
* banseljaj hides, before others beat him up for opening the pandora's box
<shevy> atmosx, what exactly isn't understood? "harmony" isn't a scientific term and "complexity" can be brought down to the individual levels. You can bring in DNA into different organisms and cause cells to express them. you will be able to eventually design a minimalistic cell and bootstrap its genome to do more and more things which aren't quite as possible today (as said, systems biology and synthetic biology)
<hkhalid> wtf
<hkhalid> shevy you are cool
<shevy> when you say god did x or y, you don't explain anything
<hkhalid> me or atom?
<shevy> anyone who says that, noone in particular :)
matthias6 has joined #ruby
<shevy> or like the guys who state that life originated outside the earth
<hkhalid> you are athiest too
<shevy> I would never define myself as something
* hkhalid sense wisdom in shevy
<shevy> it is pointless to state I would be an atheist because there is no god
<seanstickle> hkhalid: you're probably sensing his aura
<seanstickle> hkhalid: part of your crystal powers
sungji has joined #ruby
<shevy> in the end
<shevy> robots will win anyway
<hkhalid> seanstickle is the type of guy his mom hates she gave birth to
<seanstickle> Or mutant squirrels
<seanstickle> hkhalid: I think you just violated your New Age oath
<shevy> lol
<atmosx> shevy: let's make the assumption that God exists. Are you sure you will be able to understand him?
<shevy> that's a silly assumption
<atmosx> no, it's not :-)
* hkhalid does voodoo on seanstickle
<seanstickle> hkhalid: islamic voodoo? is that a thing?
<shevy> I would not understand such an entity of course, as I would not have the required data to analyse
<atmosx> Can you understand the details of the string theory?
ph^ has joined #ruby
mikepack has joined #ruby
<shevy> of course not
<seanstickle> Nobody understands string theory. They just know how to move the symbols around.
<atmosx> shevy: neither do I :-P
<shevy> but I see high maths as a way to obscure simplicity
<seanstickle> We're all mathematical nominalists now
<shevy> you build up a concept that is so complicated only 3 people in the world understand it
<shevy> then you challenge everyone else to explain it
<kjellski> any ideas how to get a pry console into eclipse console window?
<shevy> however, there is the real world, and then there are theories that try to explain phenomens of it
* banseljaj raises his hand
<banseljaj> I can ask question?
* seanstickle calls on banseljaj
<shevy> just as the people of the past thought that starmetal fell down from the sky as a gift by the god(s), that theory is outdated nowadays
<banseljaj> Okay, I am creating a class to read a file and split it into sentences.
<tayy> how do i set specifically just the %H of a DateTime object to 08:00:00?
<shevy> @sentences = File.readlines('your_file').split('.'
<shevy> )
<banseljaj> So far, I have the initialize methof, which takes a file name, and opens it
<shevy> good, you are halfway there then
<epitron> "As far as the laws of mathematics refer to reality, they are not certain; and as far as they are certain, they do not refer to reality." -- Albert Einstein
<banseljaj> And another method that splits it into lines
<epitron> i think that's where string theory has problems
<banseljaj> I just have a problem.
<epitron> "applying to reality" :)
ZachBeta has joined #ruby
<seanstickle> epitron: why?
<shevy> what problem do you have
<epitron> untestability
<seanstickle> epitron: it's not untestable. it's just very hard to test.
<banseljaj> I want split it around ".i" + a space, and not just on "."
<banseljaj> regex?
<shevy> what is "i"?
<epitron> seanstickle: so you're a string theory enthusiast? :)
<seanstickle> epitron: I am an enthusiast of many things.
<epitron> alrighty then!
<banseljaj> The sentences are in lojban
<seanstickle> epitron: Renaissance demonology, string theory, Lacanian psychoanalysis, Ruby programming...
<shevy> if it were ". " you could use .split(". "), if it gets more complicated, .split also accepts a Regex.... not sure how it would look... .split(/\. /) ... I dont get the "i" there at all
<seanstickle> :)
<banseljaj> And in lojban, a conlang, the sentences split at .i
<shevy> lojban? is that slowensk?
<banseljaj> It's aa conlang
Knodi has joined #ruby
<banseljaj> shevy: no
<epitron> shevy: upper case punctuation is important
<seanstickle> Lojban, once upon a time called Loglan
<shevy> well if "i" is a character, then .split(".i ") would just work anyway or?
<seanstickle> A language I quite enjoy
<banseljaj> seanstickle: inded
fermion has joined #ruby
<epitron> oops, i thought you meant //i :)
<banseljaj> seanstickle: You do? .ua
<shevy> I understand only half what's going on here right now :(
Knodi has joined #ruby
<tayy> hello. anyone plss?
<seanstickle> banseljaj: go'i
<tayy> i need to set a DateTime obj's time to 08:00 (leaving date untouched)
<banseljaj> seanstickle: .uisai
<shevy> tayy no real idea ... I dont know how to set the hour slot of date time objects alone
<banseljaj> shevy: thanks
<seanstickle> banseljaj: but we should refrain from speaking the True Language here
<shevy> my_date_object.hour = '08:00' # that's what I would do in Ruby! it surely wont work with Datetime
<seanstickle> banseljaj: it will confuse the mundanes.
<banseljaj> seanstickle: I understand. :D
<shevy> I dont see a way of it to modify the hour slot anyway
<shevy> from that page
<shevy> unless you parse anew
<shevy> DateTime.parse('2001-02-03T08:00:00.123456789+07:00')
<shevy> man that is ugly :\
<tayy> i tried converting to a Time obj but there is no hour method
<tayy> i've also required active_support, but still can't get .hours method (for adding 8.hours)
<niklasb> tayy: i think datetime is immutable, you should just create a new instance like in `DateTime.new(old.year, old.mon, old.mday, 8, 0, 0)`
graybeard has joined #ruby
sahli_ has joined #ruby
<seanstickle> banseljaj: you study other conlangs?
<seanstickle> banseljaj: Lincos, perhaps?
<tayy> niklasb: that worked!! thanks!
<banseljaj> Nah.
<banseljaj> seanstickle: So far, it's esperanto, klingon, quenya sindarin, ido, interlingua
<banseljaj> learning toki pona and lojban
<atmosx> haha klingon
<seanstickle> Never got into Ido
<aliSahli> hello
matthias1 has joined #ruby
<aliSahli> how i can deploy tow rails applications
<aliSahli> one use rails 2.3
<aliSahli> and other use rails 3.0
<banseljaj> aliSahli: Where are you deploying?
<aliSahli> ubuntu server
<banseljaj> local deployment?
<atmosx> ubuntu!
<banseljaj> ask around.
<aliSahli> no server deployment
<aliSahli> with capistrani
<aliSahli> with capistrano
<banseljaj> Ubuntu: The OS of gods. :D
<atmosx> aliSahli: under gentoo there is a concept of slot
<atmosx> s
<atmosx> although ruby implemention 1.9 sucks big time
<atmosx> banseljaj: blah
* banseljaj works with EnYa and heroku so can't help much. :\
<atmosx> what's enya?
* atmosx really needs to learn how to program in rails (someday)
<banseljaj> Engine Yard
<aliSahli> no i have my server and i want to configure it my self
<fayimora> atmosx: u should
<banseljaj> Rails was fun
<banseljaj> is
<atmosx> fayimora: hmm I still need to grasp ruby, I'm really amateur yet.
<atmosx> fayimora: and I managed to write an app using sinatra + haml in no time
<atmosx> so I don't miss rails all that much
<aliSahli> don't change subject please :)
jcromartie has joined #ruby
<atmosx> aliSahli: you like better vim or emacs?
<atmosx> lol
<fayimora> atmosx: I was poor in ruby when i started learning rails.. I learnt ruby with rails
<aliSahli> lol
<atmosx> fayimora: Oh ic.
<aliSahli> banseljaj: you know rvm ?
<atmosx> aliSahli: I know rvm
<atmosx> aliSahli: I know MVC also :-P
<banseljaj> aliSahli: A bit, yes.
fridim_ has joined #ruby
<banseljaj> atmosx: you know ABC?
<banseljaj> :P
<aliSahli> you think is the best solution ?
<atmosx> banseljaj: kinda :-P not all of it
<atmosx> rvm can handle multiple gems without root permissions
<aliSahli> atmosx: good my son
<banseljaj> aliSahli: In my experience, yes.
<atmosx> that said though, some gems require system-wide installations (like sqlite3) otherwise is a huge pain in the ass redefining LD_LIBRARY_PATH to a $HOME/opt directory (or similar)
<aliSahli> have you an article expalin this experience ? or somthing ?
<banseljaj> For local management, with an individual ".rvmrc" file, it works seamlessly
<atmosx> aliSahli: what do you wanna do with rvm again?
dnjaramba has joined #ruby
<aliSahli> i need to deploy tow rails applications
<banseljaj> rvm.beginrescueend.com?
<aliSahli> one use rails 2.3
<aliSahli> and other use 3.0
<aliSahli> yes banseljaj
atmosx_ has joined #ruby
<banseljaj> I have no article. Mostly did my experiments.
<banseljaj> haven't deployed an app though. :\
<aliSahli> okey
marvin_ has joined #ruby
PhilK has joined #ruby
milkpost_ has joined #ruby
<tayy> sorry guys. another quick question!
iamjarvo has joined #ruby
<tayy> how do i get the script to do smth when Time = smth?
<iamjarvo> what exactly is a directory stream
jcromartie has joined #ruby
dnjaramba has joined #ruby
<RubyPanther> iamjarvo: that is the io you read a directory through
<iamjarvo> RubyPanther: so in simple terms its a rirectory reader
justfielding has joined #ruby
<RubyPanther> iamjarvo: yes. In C it is the higher level interface, usually implemented with a file descriptor
dnjaramba has joined #ruby
<banseljaj> aliSahli: try #rails. Maybe they'll have better luck
ChampS666 has joined #ruby
<aliSahli> means ?
<iamjarvo> RubyPanther: thanks
IVA has joined #ruby
y3llow has joined #ruby
s0ber has joined #ruby
Spockz` has joined #ruby
DDAZZA has joined #ruby
phantomfakeBNC has joined #ruby
dnjaramba has joined #ruby
<banseljaj> Hmm. need help with a loop
<banseljaj> I have an array of sentences now.
<banseljaj> what i want is to pass each sentence and ask the user to type it from memory
matthias2 has joined #ruby
<banseljaj> If both are equal, the loop continues, otherwise, it should ask to type the same sentence again.
<banseljaj> Any ideas :(
phantomfakeBNC has joined #ruby
<banseljaj> guys?
chimkan_ has joined #ruby
robacarp has joined #ruby
<canton7> banseljaj, iterate through your sentences (a nice little sentences.each will do), then have another loop that keeps looping until they get it right
fr0gprince_mac has joined #ruby
<banseljaj> canton7: in the inner loop, just a sentence==input would do, right?
<canton7> banseljaj, or tbh, you can use a "redo" inside the internal loop
<banseljaj> redo?
<banseljaj> Never used it before *-*
<canton7> banseljaj, http://pastie.org/3416243 works
RomyRomy has joined #ruby
phantomfakeBNC has joined #ruby
<banseljaj> canton7: Thanks. :)
robacarp_ has joined #ruby
phantomfakeBNC has joined #ruby
<RomyRomy> hi burgestrand
<burgestrand> RomyRomy: Hi, long time since I saw you :)
senny has joined #ruby
<RomyRomy> Yeah :)
<RomyRomy> I have a dorky Ruby question to ask you
<RomyRomy> I feel a bit shy asking it in front of 600 people lol
<RomyRomy> Mind if I PM you, burgestrand ?
<burgestrand> RomyRomy: not at all
visof has joined #ruby
visof has joined #ruby
dnjaramba_ has joined #ruby
<banseljaj> I need to require a file from the current directory of the app, but it's not doing that.
<banseljaj> How do i fix that?
<canton7> require_relative is great if you're using 1.9
<banseljaj> 1.9.3
<banseljaj> And if i want to require a tree?
<banseljaj> say all files under "lib/"
<banseljaj> require_relative doesn't work in shoes 3.1. 0.)
Divinite has joined #ruby
ephemerian has joined #ruby
minijupe has joined #ruby
mattonrails has joined #ruby
<burgestrand> banseljaj: iterate over the files, require them one by one :)
<canton7> banseljaj, with multiple files, e.g. Dir['lib/**/*.rb'].each{ |f| ..... }
<banseljaj> burgestrand and canton7 do you have shoes experience?
<canton7> nope
<burgestrand> banseljaj: only the kind I put on my feet, sorry
jcromartie has joined #ruby
<Divinite> I wear them a lot
<banseljaj> :(
<banseljaj> Nobody knows shoes indeed. :(
<apeiros_> canton7: Dir[].each { -> Dir.glob {
<apeiros_> nicer
<apeiros_> ([] can't take a block, glob can)
<canton7> that's true, good point
<apeiros_> I think I better don't even start commenting on the require part… I'll just get upset.
<banseljaj> I think i'll just put everyhting in the same file. :\
remink has joined #ruby
<banseljaj> it belongs there, really
dnjaramba has joined #ruby
mrtheshadow has joined #ruby
visof has joined #ruby
visof has joined #ruby
syskk has joined #ruby
<syskk> quick noob question: i've never had to use a message queue before, what is it used for? the wikipedia article doesn't really help… any practical use case?
<burgestrand> syskk: for one thing, a to-do list for worker processes
<syskk> ok.. but why not simply invoke the worker process as we need it?
<syskk> or you mean many todos for a single worker process?
<burgestrand> syskk: lots of reasons, but mostly because you don’t need to know how the process gets done or who does it
<syskk> ok
<syskk> so what would a message look like? can you give an example?
<burgestrand> syskk: for example you could have a bunch of really powerful machines that do nothing but heavy number crunching with complicated logic, you could have hundreds of these and just have them take work off the message queue, for example
<syskk> ok i see
BrokenCog has joined #ruby
<burgestrand> syskk: any kind of format you like, depends on what kind of message queue you use; some use JSON because it’s easy to structure, some just put a string of numbers in there (like an ID)
<syskk> so messages are simply strings?
<syskk> ok cool
<burgestrand> Yeah, most of the time it’s some kind of string-based format I’d say
<syskk> can it be seen as a RPC mechanism?
<syskk> i guess it depends on what your workers do with the messages right?
<burgestrand> RPC, it’s all it is
<burgestrand> or, no, sorry
<burgestrand> But yeah, in a sense, you don’t wait for an answer though, but in a sense it’s a kind of RPC
<burgestrand> (you could wait for an answer, of course, but often you don’t because that’s why you put the thing in a message queue in the first place)
<syskk> ok cool
<syskk> would it be correct to see it as a socket where you don't know when and who is going to get your message?
dnjaramba has joined #ruby
mikepack has joined #ruby
s0ber has joined #ruby
waxjar has joined #ruby
<syskk> http://www.rabbitmq.com/getstarted.html some nice graphics here i think i get it now
<burgestrand> syskk: I’d say it’s like post-it’s :p
_|christian|_ has joined #ruby
banisterfiend has joined #ruby
Spockz` has joined #ruby
kevinbond has joined #ruby
Knodi has quit [#ruby]
banseljaj has joined #ruby
pdtpatr1ck has joined #ruby
tayy has joined #ruby
snearch has joined #ruby
jds has joined #ruby
conor_ireland has joined #ruby
robacarp has joined #ruby
simao has joined #ruby
dnjaramba has joined #ruby
QaDeS_ has joined #ruby
ilteris has joined #ruby
<ilteris> hello, can someone explain this syntax to me? @defeat = {rock: :scissors, paper: :rock, scissors: :paper}
<ilteris> so variable names start with @ I presume. Is that a dictionary?
<ilteris> What abou colons? :D
<ilteris> s/abou/about
cbuxton has joined #ruby
<burgestrand> ilteris: @variables are instance variables, they’re attached to an object
<burgestrand> ilteris: more specific, the object they’re attached to can be inspected by looking at the special variable "self"
<ilteris> burgestrand this is the code I am looking at: http://pastie.org/3416528
<burgestrand> ilteris: { thingy: otherthingy } is a short way to declare a dictionary, where thingy: is the key and otherthingy is the value, this syntax is unique to ruby 1.9, you can also use { :thingy => otherthingy }, which also works and is the only thing that works for keys that are not symbols
<burgestrand> ilteris: finally, :thingies are symbols :)
fr0gprince_mac has joined #ruby
<ilteris> ah lol now it starts to make sense
<burgestrand> ilteris: symbols are a kind of literal, like numbers or "string", that look like strings
mxweas_ has joined #ruby
<ilteris> when is an appropriate to use a symbol? never heard of symbol before in other languages.
<ilteris> so a form data should be a symbol?
<Tasser> ilteris, do you know of enums?
<ilteris> enumerators, little bit.
<Tasser> nope, enums
<ilteris> no I don't :)
dnjaramba has joined #ruby
<burgestrand> ilteris: which other languages do you know?
emocake has joined #ruby
ed1t has joined #ruby
andrewhl has joined #ruby
<ilteris> burgestrand: mostly objective-c and some java but I cannot say I am the master of any
<ilteris> so back to enums, are they similar to symbols?
<ilteris> trying to understand the connection
samgranieri has joined #ruby
<ed1t> I have an array of Bill object and each Bill object has an property amount. Is there a one liner in ruby to sum all amounts?
<burgestrand> ed1t: bills.map(&:amount).reduce(:+)
robacarp_ has joined #ruby
mklappstuhl has joined #ruby
kevinbond has joined #ruby
<mklappstuhl> hey
<ed1t> thx
emocake has joined #ruby
<mklappstuhl> can anyone tell me which s3 library to use? rightscale's seems outdated aws-s3's is wierd at some places
<burgestrand> ilteris: trying to come up with a new way of explaining what a symbol is :)
<shevy> the first thing to know about symbols is
<shevy> they are BORING
<ilteris> lol
<shevy> enums are a lot more interesting
<burgestrand> ilteris: but, think of it like this, you have a dictionary, and in this dictionary you want to look things up
<burgestrand> ilteris: the keys themselves don’t matter much, you only care that they’re easy to distinguish and that they’re efficient
dnjaramba_ has joined #ruby
<shevy> I like to think of symbols as totally boring, lame ass crippled string-like entities
<burgestrand> ilteris: in ObjC, you might to do this: #define KEY_ONETHING 0, #define KEY_OTHERTHING 2
<ilteris> yup
<shevy> they may be fast, but they make up for this by being so boring, that every word further spent explaining them is a wasted time of BORINGNESS
* shevy really just tries to help burgestrand!
glosoli has joined #ruby
<burgestrand> ilteris: you could then use KEY_ONETHING and KEY_OTHERTHING in place of 0 and 2, and it’d be easy to read the code while the actual things are represented some other way, it’s also nice that you can check if something == KEY_ONETHING efficiently and it does not use up much memory either
<Tasser> how to convert a struct to a hash?
<ilteris> yup
<burgestrand> ilteris: ruby symbols are pretty much for the same thing
<ilteris> oh
<ilteris> that's it?
<burgestrand> ilteris: yup, the difference is that they’re literals
bhunt has joined #ruby
<ilteris> how can I get the "value" of a symbol then?
<burgestrand> ilteris: :symbol == :symbol, superfast comparison (represented as a number internally), and makes sense when you look at it
<burgestrand> ilteris: the value of a symbol is the symbol :)
<burgestrand> ilteris: like the value of 5 is 5
<ilteris> heh oke
<ilteris> so here: content_type :text
<ilteris> :text is an identifier
<shevy> Tasser hmm. not sure this is possible
<burgestrand> ilteris: it could just as well have been content_type "text"
<ilteris> that's already set by the interpreter
<burgestrand> ilteris: (in this particular case)
<shevy> seems to return only the ID hmmmmmm
<burgestrand> ilteris: but yes, :text is an identifier in this case
<burgestrand> ilteris: and, well, any other case, it’s what they’re used for
<burgestrand> :p
<ilteris> okay, makes more sense now. thanks burgestrand :)
<burgestrand> ilteris: one thing about symbols though, is that they’re never garbage collected
<burgestrand> ilteris: it would be a bad idea to generate hundreds of them
<shevy> boring as they are
adambeynon has joined #ruby
<ilteris> hehe oke
<burgestrand> ilteris: so, don’t do this: 1_000_000.times.map { |index| index.to_s.to_sym }
dnjaramba has joined #ruby
kevinbond has joined #ruby
<ilteris> why would the person uses symbols here as opposed to regular strings? http://pastie.org/3416528
<ilteris> are they faster to compare than strings?
<burgestrand> ilteris: yup
<ilteris> so we could alternatively use strings in this snippet
<ilteris> little rellief :)
<ilteris> thanks for the patience burgestrand
<burgestrand> ilteris: every symbol has a unique number internally, as well as any object, but for any given symbol this number is *always* the same if it’s the same symbol
Dunas has joined #ruby
<burgestrand> ilteris: :symbol.object_id == :symbol.object_id, while "string".object_id != "string".object_id
<burgestrand> ilteris: but yeah, you probably could
<Dunas> I can't find a way to use Shoes in standalone programs, help?
<ilteris> good tip though, thanks
<burgestrand> ilteris: symbols are mostly just an optimization, and I’d dare say most of the times it makes little difference
<burgestrand> but using a symbol communicates that this thing is an identifier, which is useful information to the programmer
<ilteris> so faster comparison vs. garbage not collected tradeoff
nricciar_ has joined #ruby
<burgestrand> Yeah
<ilteris> burgestrand: how is it being an identifier useful information to the programmer? do you mind giving an example?
<burgestrand> ilteris: was thinking it communicates intent
<ilteris> rather than just data
<burgestrand> Yeah, rather than just a random string
<ilteris> gotcha
zomgbie has joined #ruby
<burgestrand> My highly personal opinion, I might add ;)
<ilteris> no, it's a good one. I appreciate it
<RubyPanther> if it is used internally in the program and not displayed to the user, then it is a program identifier, and if you display it to the user, then it is data.
robacarp1 has joined #ruby
drewrm has joined #ruby
dnjaramba has joined #ruby
<burgestrand> and as soon as you add context to it it’s information
<ilteris> okay thanks gentlemen. going back reading. be back later with my questions :D
xlogic has joined #ruby
xastion has joined #ruby
baroquebobcat has joined #ruby
xastion_ has joined #ruby
robacarp1 has joined #ruby
dnjaramba has joined #ruby
startling has joined #ruby
ada2358 has joined #ruby
trivol has joined #ruby
dnjaramba has joined #ruby
cbuxton has joined #ruby
liluo has joined #ruby
Fretta has joined #ruby
idletom has joined #ruby
sterNiX has joined #ruby
sterNiX has joined #ruby
zixiz has joined #ruby
incomprehensibly has joined #ruby
zixiz has joined #ruby
bhunt has joined #ruby
robacarp has joined #ruby
<slippyd> I'm getting a:
<slippyd> Permission denied - doc /Users/slippyd/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir'
<slippyd> How would I go about finding out where RDoc is trying to create a directory?
<slippyd> So I can fix the permissions, of course.
dnjaramba has joined #ruby
ChampS666 has joined #ruby
cbuxton has joined #ruby
SegFaultAX has joined #ruby
jacktrick has joined #ruby
caiges_ has joined #ruby
dootdoot has joined #ruby
robacarp_ has joined #ruby
jaywastaken has joined #ruby
workmad3 has joined #ruby
gh has joined #ruby
dnjaramba_ has joined #ruby
ChampS666 has joined #ruby
milkpost_ has joined #ruby
jds has joined #ruby
award85 has joined #ruby
dnjaramba has joined #ruby
robacarp1 has joined #ruby
briankbuckley has joined #ruby
luke-- has joined #ruby
robacarp1 has joined #ruby
virunga has joined #ruby
RichGuk has joined #ruby
muneeb has joined #ruby
justinmcp has joined #ruby
dnjaramba has joined #ruby
ZAQfx has joined #ruby
KristianDK has joined #ruby
nari has joined #ruby
robacarp1 has joined #ruby
rsaaguy has joined #ruby
jbhewitt has joined #ruby
robacarp2 has joined #ruby
<atmosx> Is there any ruby implementation for this? http://en.wikipedia.org/wiki/Rabin_fingerprint
<atmosx> Google does not help, so I think there's none
stephans has joined #ruby
dnjaramba has joined #ruby
<virunga> atmosx, i don't know... Does it need you for pattern matching on text?
<atmosx> virunga: yes. I wanna do some simple text fingerpriting using it.. because on wikipedia says it's way faster than sha1/md5/etc
dnjaramba has joined #ruby
<virunga> atmosx, how long is the pattern? Like a common english word for example?
<atmosx> virunga: yeah max
ixti has joined #ruby
<atmosx> 8 chars
<virunga> there's a lot of algorithms you could use instead of that one. A perfect one for your purpose would be the Shift-And algorithm
<virunga> invented from the author of yahoo
De`off has joined #ruby
ZachBeta has joined #ruby
<atmosx> virunga: oh thanks :-) I had no idea.
dnjaramba has joined #ruby
<virunga> atmosx, in theory has a worse time of MC with fingerprint but in practice is really fast
waxjar has joined #ruby
<atmosx> virunga: I'll give it a try although… I need to study this part: The algorithm tells whether a given text contains a substring which is "approximately equal" to a given pattern, where approximate equality is defined in terms of Levenshtein distance — if the substring and pattern are within a given distance k of each other, then the algorithm considers them equal.
<virunga> maybe has the same time... i dont remember now
<atmosx> don't worry I'll run some tests asap
<atmosx> thanks for the pointers
<virunga> atmosx, i don't know the Levenshtein distance but i think you can use a modified version of the agrep algorithm
macmartine has joined #ruby
<virunga> the book algorithms on strings, trees and sequences is good for you
<virunga> it conteins all this kind of algo
<virunga> it's perfect for that
<virunga> if i'm not wrong tha MC with fingerprint is build on agrep so....
<virunga> now i'm leaving
<virunga> good luck
<atmosx> I have a book on algo's. It's in introduction. Unfrotunatelly I won't have time to read it before summer :-/
<atmosx> but thanks :-)
<atmosx> goto night
<atmosx> good night heh
<virunga> 'nite
virunga has quit ["Sto andando via"]
dotnull has joined #ruby
dnjaramba has joined #ruby
s0ber has joined #ruby
robacarp has joined #ruby
y3llow has joined #ruby
ckrailo has joined #ruby
snip_it has joined #ruby
y3llow has joined #ruby
dootdoot has joined #ruby
nw` has joined #ruby
mengu has joined #ruby
y3llow has joined #ruby
jasonlfunk has joined #ruby
y3llow has joined #ruby
iocor has joined #ruby
<jasonlfunk> I am a web developer who primarily uses PHP at the moment. I'm looking to switch away to a different language; not because PHP is bad but because I know there are other languages that are cleaner, more polished, more consistent, etc. Currently, I'm narrowed down to Python or Ruby. Any thoughts on the matter?
<atmosx> jasonlfunk: well, you're in ruby.
<jasonlfunk> I know
dnjaramba has joined #ruby
<jasonlfunk> I wanted to hear the arguments straight from the horse's mouth
<jasonlfunk> And I didn't know a better channel to ask in.
jakky has joined #ruby
<atmosx> jasonlfunk: look here http://bit.ly/wog6S6 it's a detailed thread on the ruby-ml
incomprehensibly has joined #ruby
<atmosx> jasonlfunk: you'll find plenty of answers from sophisticated people and you can make up a mind of your own.
<jasonlfunk> Perfect. Just what I was looking for. Thanks.
<jasonlfunk> Would it be considered a sin to use ruby for webdev w/o using Rails? I typically don't like using MVC frameworks. I like ground-up things.
<jasonlfunk> The Sanatra package looked intriguing to me.
krisfremen has joined #ruby
<apeiros_> jasonlfunk: no, it's perfectly fine, not to use rails.
nari has joined #ruby
randym has joined #ruby
<jasonlfunk> #python is certainly a more animated channel than ruby. :)
mikeric has joined #ruby
<apeiros_> matter of timing
acekiller has joined #ruby
dnjaramba has joined #ruby
albemuth has joined #ruby
shevy has joined #ruby
ZachBeta has joined #ruby
briankbuckley has joined #ruby
ZachBeta has joined #ruby
jakky has joined #ruby
ZachBeta has joined #ruby
dnjaramba has joined #ruby
gabeh has joined #ruby
glosoli has joined #ruby
Banistergalaxy has joined #ruby