apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste >3 lines of text on gist.github.com || Rails is in #rubyonrails || Log: http://irclog.whitequark.org/ruby
macmartine has quit [Quit: macmartine]
malkomalko has quit [Remote host closed the connection]
trend has quit [Ping timeout: 240 seconds]
xastion has joined #ruby
trend_ has joined #ruby
kenichi has quit [Remote host closed the connection]
khakimov has quit [Quit: Computer has gone to sleep.]
wangr has quit [Ping timeout: 246 seconds]
khakimov has joined #ruby
oooPaul has quit [Quit: Ciao for now!]
xaq has quit [Remote host closed the connection]
jenrzzz-mac has quit [Quit: jenrzzz-mac]
byronb has joined #ruby
minijupe has quit [Quit: minijupe]
nari has quit [Ping timeout: 248 seconds]
eywu has joined #ruby
baroquebobcat has quit [Ping timeout: 244 seconds]
ckrailo has quit [Quit: Computer has gone to sleep.]
<shevy> now I am in a state of confusion again
albemuth has quit [Ping timeout: 248 seconds]
<shevy> I have a method, w, which returns the main object
borkman has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
<shevy> or, when first called, it'll create the main object
<shevy> I used to describe a project like so:
<shevy> w.title = 'bla'
<shevy> w.description = 'lalala'
albemuth has joined #ruby
<shevy> but now I am also tired of typing "w."
vitor-br has joined #ruby
jcblitz has quit [Quit: jcblitz]
thecreators has joined #ruby
finch has left #ruby ["WeeChat 0.3.7"]
<apeiros_> shevy: the typical solution to that is to use an instance_exec'd DSL
<shevy> oh
IrishGringo has quit [Ping timeout: 244 seconds]
<apeiros_> Project.new do; title 'bla'; description 'lalala'; end
<apeiros_> (as usual, replace ; with newlines)
iocor has quit [Quit: Computer has gone to sleep.]
havenn has quit [Remote host closed the connection]
<icy`> apeiros_, i'm trying to just set the first item's price and timestamp, yet it seems to affect all elements. I must've messed up somewhere with default value..? http://codepad.org/OxXxqA8z
<apeiros_> icy`: slooooow loading
<apeiros_> you probably keep using the same object
<icy`> basically h = Hash.new([pc.new]*5) , where pc is a struct(:price, :time)
xastion has quit [Ping timeout: 244 seconds]
<apeiros_> yeah, [obj]*5 will create an array with 5 times the *same* object
<icy`> oh =/
<apeiros_> i.d. ary[0].object_id == ary[1].object_id etc.
<apeiros_> you want: Array.new(5) { pc.new }
<apeiros_> the block is executed 5 times. so each time a new instance is created
<apeiros_> also, personally I'd use a proper name and a constant instead of pc :-)
<apeiros_> s/i.d./i.e.,/
<icy`> thanks for the tips =) pc makes sense to me though as in my mind it stands for 'price check'
<apeiros_> PriceCheck then
axiak has joined #ruby
<apeiros_> you won't remember what pc stood for in 2 weeks…
<shevy> hehe
<shevy> and if not in 2 weeks, then surely not in 2 years!
<icy`> camel case eh =D
red-panda has quit [Remote host closed the connection]
<apeiros_> yes. it's a class.
<apeiros_> it's not ARRAY either :-p
Xethron has quit [Ping timeout: 244 seconds]
<apeiros_> (though, I CamelCase *all* constants - classes are just objects after all…)
* icy` nods
Xethron has joined #ruby
redgetan has joined #ruby
Monofu has joined #ruby
zaychenok has quit [Quit: Konversation terminated!]
zaychenok has joined #ruby
fserb has quit [Quit: ttyl]
redgetan has quit [Quit: This computer has gone to sleep]
bawer has joined #ruby
bawer has quit [Client Quit]
bawer has joined #ruby
jimeh has quit [Ping timeout: 244 seconds]
bawerd has joined #ruby
pu22l3r has joined #ruby
pr0zac0x2a has quit [Ping timeout: 245 seconds]
lmarcetic has joined #ruby
Targen has quit [Ping timeout: 246 seconds]
piotr_ has quit [Ping timeout: 244 seconds]
kah_ has joined #ruby
tintin has joined #ruby
<tintin> Will ruby 2 be a new version of ruby or will it be a new program?
<tintin> Will ruby2 be backward compatible with ruby 1.9.3 ?
randomautomator has quit [Remote host closed the connection]
kenperkins has joined #ruby
Xethron has quit [Ping timeout: 244 seconds]
Konboi has joined #ruby
Xethron has joined #ruby
macmartine has joined #ruby
<apeiros_> yes, yes and yes
horseman has joined #ruby
<icy`> ETA for ruby2 ?
<tintin> Can it happen like python3? python3 came to solve problems of python2 and python3 is not backward compatible
<tintin> Can it happen for ruby too?
<tintin> in future?
<lmarcetic> tintin, python3 and perl6 broke backwards compatibility, and are somewhat experimental in nature
<horseman> tintin: ruby 2.0 will not break compat wth ruby 1.9 when it comes out
<icy`> rvm to the rescue
<tintin> lmarcetic: I know that.
<lmarcetic> tintin, then why would you fear for ruby? it's just a new version number.
crankycoder has joined #ruby
Banistergalaxy has quit [Ping timeout: 244 seconds]
alexim has quit [Quit: sleep]
<tintin> Because if that happens for ruby too in future, then all my apps written in older ruby will be a waste of time because i have to re-write/porting again
chrxn has quit [Read error: Connection reset by peer]
<apeiros_> tintin: are you a troll?
Nies has quit [Quit: Saliendo]
<tintin> NO
kenperkins has quit [Ping timeout: 244 seconds]
chson has joined #ruby
ringotwo has quit [Remote host closed the connection]
<apeiros_> 1.9 was not backwards compatible. and it didn't take much for most things to get updated for it.
<apeiros_> that "all of my old stuff is wasted" crying is just utter bollocks.
<apeiros_> also just because a newer version comes out doesn't make the older versions magically vanish. there are even ruby 1.8 installs still in use.
<lmarcetic> there's a real question posted by some guy in #rails
<apeiros_> #rails is no real channel
<apeiros_> #ror or #rubyonrails are the thing (both the same)
<lmarcetic> so it has 102 fake users in it?
<apeiros_> it has 102 idiots in it :-p
zaychenok has quit [Quit: Konversation terminated!]
<apeiros_> though it's about 80 more than last time
<lmarcetic> *mumble grumble*
zaychenok has joined #ruby
<Spaceghostc2c> #rails is a shit place with shit people.
<apeiros_> maybe due to that time when #ror only let registered users in
<lmarcetic> alright, no need for insults
<apeiros_> yeah, sorry about that
<apeiros_> but seriously, #rails is the wrong channel
<lmarcetic> apeiros_, i meant Spaceghostc2c mainly. i'm in the other one now
nopolitica has quit [Ping timeout: 244 seconds]
<shevy> tintin ruby 1.9.x already was the transition towards 2.0
<shevy> if you use an operator like -> in 1.9.x it won't work in 1.8.x but it should work in 2.0
shadoi has quit [Quit: Leaving.]
<Spaceghostc2c> Duh?
wpaulson has joined #ruby
zaychenok has quit [Read error: Connection reset by peer]
bigoldrock has quit [Quit: Leaving.]
zaychenok has joined #ruby
adamkittelson has quit [Ping timeout: 244 seconds]
<apeiros_> I think shevy just phrased it confusingly. 1.8 does not have -> (stabby lambda), 1.9 introduced it. and 2.0 will still have it.
<horseman> apeiros_: shevy is confusion incarnate :P
zaychenok has quit [Read error: Connection reset by peer]
tintin has left #ruby [#ruby]
zaychenok has joined #ruby
<apeiros_> there's something to that…
<shevy> horseman - the man with the thousand nicks
kenperkins has joined #ruby
<icy`> hmm.. $VERBOSE=true is picking up "mismatched indentations" ... tell me this isnt going in the python direction o.O
<apeiros_> it isn't
horseman has quit [Remote host closed the connection]
<apeiros_> it's just a warning and a quite valid one.
<icy`> the fix was lining up the ends
<shevy> keep in mind that some hours ago apeiros_ wrote something about warnings in ruby though ... ;)
<icy`> i'm not sure if I had even written that class
<apeiros_> lining up the ends?
<shevy> allow me to quote apeiros_ :)))
<icy`> if...end block, or while...end
<shevy> <apeiros_> it's also the reason why i say ruby's warning system is broken.
<apeiros_> paste the code before and after the warnings? I get the feeling that your fix actually made things worse…
<icy`> no, I literally only changed whitespace
cearls has joined #ruby
<apeiros_> icy`: yes, that's the point of that warning
savage- has quit [Remote host closed the connection]
<apeiros_> but you can change it in a good way or in a bad way
cearls has quit [Client Quit]
<apeiros_> the bad way is to just remove all indentation…
<apeiros_> (one bad way)
cearls has joined #ruby
<icy`> for example, there was some if statement whose end was one tab further in
<apeiros_> yes, that's wrong. on all accounts :)
K0rnflake has joined #ruby
<apeiros_> I sure hope you use 2-spaces soft-tab, yes?
kvirani has joined #ruby
<shevy> tab!
<shevy> a tab user!!!
<icy`> does that mean turning tabs into spaces? then yes
<shevy> KILL HIMMMM
Monofu has quit [Quit: quit]
<shevy> ohhhhh
<shevy> spaces are fine
<apeiros_> icy`: yes it means that tabs are turned into 2 spaces.
<shevy> we'll kill someone else instead
<apeiros_> hard-tab means it inserts the tab-character.
<icy`> er when in gvim if i type end it does not tab left
<apeiros_> shevy: there you go. kill gvim!
<shevy> why does he use different amounts of ' ' when he types here? :\
macgregor_ has joined #ruby
<icy`> delete [] shevy
<shevy> gvim is strange
<icy`> anyway ;P
jcblitz has joined #ruby
<shevy> vim is okish though, at least the keybindings or however you name them
<shevy> 9dd
<shevy> :33
* Spaceghostc2c digs the vimz
centipedefarmer has joined #ruby
LordJesusChrist has joined #ruby
<LordJesusChrist> Fuck you all.
<offby1> ignore LordJesusChrist
kvirani has quit [Remote host closed the connection]
<LordJesusChrist> Err, wrong channel.
* LordJesusChrist has tourettes.
crankycoder has quit [Remote host closed the connection]
LordJesusChrist was kicked from #ruby by apeiros_ [yeah, fuck you too]
kevinbond has joined #ruby
cryptfu has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
mfridh has quit [Ping timeout: 245 seconds]
Banistergalaxy has joined #ruby
mnaser has quit [Quit: Computer has gone to sleep.]
kevinbond has quit [Client Quit]
jeer has quit [Quit: Computer has gone to sleep.]
horseman has joined #ruby
zaychenok has quit [Quit: Konversation terminated!]
zaychenok has joined #ruby
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
wallerdev has joined #ruby
<horseman> wallerdev: sup wally
<wallerdev> hey do i know you? :)
<apeiros_> that's the problem if you wear so many masks…
Banistergalaxy has quit [Ping timeout: 265 seconds]
<icy`> ok my "indenting back to the left after typing 'end'" issue got fixed after talking to the nice folks in #vim =)
<wallerdev> hey apeiros_ :)
<apeiros_> hi wallerdev
<wallerdev> got that ruby swag?
<apeiros_> no
<wallerdev> lol
<apeiros_> the ruby swag is off
<apeiros_> :(
<wallerdev> :(
balki has joined #ruby
voodoofish430 has quit [Quit: Leaving.]
<wallerdev> any cool projects?
igotnolegs has joined #ruby
<apeiros_> no. been working on a tabular data importer. but due to being sick it took me 4 days to write 1 day worth of code…
<icy`> oh, btw, what was that interactive ruby quiz where you could "follow" some of the people who posted answers
<apeiros_> also, ruby excel gems are a mess…
dross_ has joined #ruby
<icy`> it was mostly one-liner answers about core ruby objects, at least in the beginner where it tried to run your code... i had come across it not too long ago. Had trouble googling for it o.O
andrewhl has joined #ruby
<icy`> mightve some variation of 'rubyist' in it
dross has quit [Ping timeout: 244 seconds]
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
tommyvyo has joined #ruby
jeer has joined #ruby
<wallerdev> apeiros_: yeah haha i hate being sick, you think you can code fine when you're sick but your mind just deosnt work
<apeiros_> well, it's mostly coughing
<apeiros_> but it's interrupting. also I feel weak.
azaq23 has quit [Quit: Leaving.]
hemanth2 has joined #ruby
<icy`> apeiros_, =/ get well soon! Eurocup cheering you up at least?
<apeiros_> soccer? meh :)
<apeiros_> I yanked out the antenna cable from my tv. sucked up too much time.
jeer has quit [Client Quit]
<wallerdev> you should play soccer its a lot of fun
<apeiros_> oh, playing sure. but watching?
k_m has joined #ruby
<horseman> wallerdev: wally.
<apeiros_> I prefer watching starcraft battles. I wished there was a barcraft close…
<horseman> apeiros_: is swiss good at soccer?
<wallerdev> wally?
<apeiros_> we beat the germans 5:3 recently!
<wallerdev> soccer is super boring to watch
sailias has joined #ruby
<apeiros_> but no. swiss suck at soccer.
<apeiros_> oh, well, actually the swiss U19 is world champion in soccer. quite unexpected.
maletor has quit [Quit: Computer has gone to sleep.]
dross_ is now known as dross
liluo has joined #ruby
L-----D has joined #ruby
kevinbond has joined #ruby
<horseman> apeiros_: congrats
robotmay has joined #ruby
<horseman> apeiros_: all those lithe young swiss boys, did u get a chance to watch them btw?
<apeiros_> no, I find soccer boring to watch.
<apeiros_> most sports actually.
<horseman> apeiros_: even female gymnastics?
<icy`> sorry, i got caught up in a pm
<icy`> anyway, you can stream most things on the computer now ;P
williamcotton has joined #ruby
<icy`> apeiros_, i used to watch some of those sc2 commentary vids of tourney games, i guess
<icy`> also quite a timesink
<apeiros_> sure. but not such a mindless timesink as zapping through tv channels.
sailias has quit [Quit: Leaving.]
<icy`> true; i usually just prefer movies
pu22l3r has quit [Remote host closed the connection]
<icy`> that process ^ is mindless because of commercials, mainly
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<apeiros_> well, we're lucky that we don't have the horrible commercials situation that seems prevalent in the US
<apeiros_> I mean, how can you even stand watching tv in the US? the few times I visited I could barely stand that…
jcblitz has quit [Quit: jcblitz]
mnaser has quit [Quit: Computer has gone to sleep.]
apok_ has joined #ruby
cyong has left #ruby [#ruby]
Synthead has joined #ruby
robotmay has quit [Remote host closed the connection]
apok has quit [Ping timeout: 244 seconds]
Araxia_ has quit [Quit: Araxia_]
<Spaceghostc2c> apeiros_: I don't watch T.V., I don't even own one.
cyong has joined #ruby
dhodgkin_ has joined #ruby
dhodgkin has quit [Read error: Connection reset by peer]
dhodgkin_ is now known as dhodgkin
redgetan has joined #ruby
k_m has quit [Quit: Leaving]
silentpost has quit [Ping timeout: 244 seconds]
apok_ has quit [Ping timeout: 246 seconds]
<apeiros_> Spaceghostc2c: nah, I still want to watch movies or play games. but those are "directed" things. unlike zapping through tv where I'd just sit there and wonder after 4h what I actually did…
<Spaceghostc2c> apeiros_: I watch movies and play games. Just not on a TV.
jenrzzz-mac has joined #ruby
<apeiros_> I like watching movies in the couch on a big screen :-p
<apeiros_> fuck, annoying bug on youtube - moves videos some 20% to the right, cutting it off…
<apeiros_> wtf?
Markvilla has quit [Quit: Markvilla]
silentpost has joined #ruby
cyong has quit [Quit: Leaving.]
randym has joined #ruby
<apeiros_> awesome… adobes idea of "check for updates" is to open a browser window and show you a list with version numbers. "go check yourself, then go to the downloads page"
horseman has quit [Remote host closed the connection]
Hanmac has quit [Ping timeout: 244 seconds]
digitalcakestudi has quit [Quit: Leaving.]
Hanmac has joined #ruby
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
Spooner has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org]
Enekoos has quit [Remote host closed the connection]
PaciFisT has joined #ruby
tommyvyo has joined #ruby
zaychenok has quit [Quit: Konversation terminated!]
zaychenok has joined #ruby
jenrzzz-mac has quit [Quit: jenrzzz-mac]
PaciFisT has quit [Ping timeout: 245 seconds]
frishi has joined #ruby
sleetdrop has joined #ruby
dhruvasagar has joined #ruby
iori has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
wallerdev has quit [Quit: wallerdev]
jenrzzz-mac has joined #ruby
hemanth has joined #ruby
Progster has quit [Ping timeout: 244 seconds]
hemanth2 has quit [Quit: Leaving.]
hemanth2 has joined #ruby
Gavilan has joined #ruby
Progster has joined #ruby
jenrzzz-mac has quit [Quit: jenrzzz-mac]
MrGando has joined #ruby
yankov has quit [Quit: yankov]
nisstyre has joined #ruby
kah_ has quit [Ping timeout: 244 seconds]
TorpedoSkyline has quit [Quit: TorpedoSkyline]
chomp has joined #ruby
zaychenok has quit [Read error: Connection reset by peer]
zaychenok has joined #ruby
PragCypher has quit [Read error: Connection reset by peer]
zaychenok has quit [Client Quit]
PragCypher has joined #ruby
cearls has quit [Quit: cearls]
zaychenok has joined #ruby
kah_ has joined #ruby
PragCypher has quit [Remote host closed the connection]
kah_ has quit [Remote host closed the connection]
emmanuelux has quit [Ping timeout: 264 seconds]
silentpost has quit [Read error: Connection reset by peer]
horseman has joined #ruby
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
paul_ has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
freeayu has joined #ruby
x0F_ has joined #ruby
x0F has quit [Disconnected by services]
x0F_ is now known as x0F
zaychenok has quit [Read error: Connection reset by peer]
zaychenok has joined #ruby
silentpost has joined #ruby
eywu has quit [Quit: Leaving.]
sleetdrop has quit []
MrGando has quit [Quit: Computer has gone to sleep.]
hemanth2 has quit [Quit: Leaving.]
randym has quit [Quit: Leaving...]
macgregor_ has quit [Remote host closed the connection]
umttumt has joined #ruby
zinjacoder has quit [Read error: Connection reset by peer]
jcromartie has joined #ruby
dhodgkin has quit [Read error: Connection reset by peer]
radic has quit [Disconnected by services]
radic_ has joined #ruby
frishi has quit [Quit: Leaving...]
radic_ is now known as radic
dhodgkin has joined #ruby
counterbeing has joined #ruby
skinny_much has joined #ruby
explody has quit [Ping timeout: 244 seconds]
dhruvasagar has quit [Ping timeout: 240 seconds]
dhruvasagar has joined #ruby
<Paradox> lol
explody has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
AwesomeG1rethMan is now known as AwesomeGarethMan
AwesomeGarethMan has quit [Changing host]
AwesomeGarethMan has joined #ruby
krz has joined #ruby
yankov has joined #ruby
ukd1 has quit [Ping timeout: 248 seconds]
olrrai has quit [Ping timeout: 244 seconds]
explody has quit [Ping timeout: 265 seconds]
skinny_much has quit [Quit: Colloquy for iPod touch - http://colloquy.mobi]
iSuckAtRuby has joined #ruby
<iSuckAtRuby> I swear this is not a homework question, but could someone help me (hint me) to write a method to reverse a string? Yes, I know there is a method in the standard library.
<iSuckAtRuby> looking at the source code for the method in the standard library is unfortunately not giving me many hints (because my C skills are too rudimentary).
Tricks has quit [Read error: Connection reset by peer]
Tricks has joined #ruby
counterbeing has quit []
<iSuckAtRuby> I shall patiently await my savior ;D
<graspee> only a school could be stupid enough to force someone to implement something that is already implemented, except do it worse
<horseman> graspee: it's a good exercise to learn the basics
<iSuckAtRuby> I don't think it's stupid if a school does that.
<iSuckAtRuby> yeah, I agree.
<seanstickle> Well, you're not learning if we do it for you.
<iSuckAtRuby> I think that's a great thing to do. It's obviously unnecessary, but that doesn't mean it doesn't teach you anything.
<iSuckAtRuby> I don't want someone to do it for me. I want someone to give me a hint on how to manipulate the array class
<iSuckAtRuby> because I have no fucking idea what I'm doing and I've been at this for hours.
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<seanstickle> Well, what have you go so far?
<iSuckAtRuby> I'm too embarrassed to show it, seriously.
<seanstickle> What do I care?
<horseman> iSuckAtRuby: explain the concept
<graspee> array? or string?
<iSuckAtRuby> well
<horseman> iSuckAtRuby: explain your approach
<iSuckAtRuby> I was going to make an array
<iSuckAtRuby> and find some way to have it manipulate the array (using a loop) to print the letters starting from the last letter
dchelimsky has joined #ruby
<seanstickle> So, that doesn't work?
<iSuckAtRuby> so I guess using a while loop and making it start from [-1] and continuing for n letters
<iSuckAtRuby> that's the concept I pulled out of my ass
<iSuckAtRuby> I have no idea how to code it.
td123 has quit [Read error: Connection reset by peer]
<seanstickle> How much Ruby do you know?
<iSuckAtRuby> because I'm unsure of how to manipulate arrays except for the obvious existing methods
<iSuckAtRuby> I learned the basics just yesterday
<iSuckAtRuby> so nothing
<seanstickle> Have you read a tutorial on Ruby arrays yet?
td123 has joined #ruby
<iSuckAtRuby> I know some C and Java though.
<iSuckAtRuby> yeah
<iSuckAtRuby> this was too vague
<iSuckAtRuby> this was too cursory.
<iSuckAtRuby> the source code for this just confused me.
<seanstickle> You know how to get the last member of an array?
<iSuckAtRuby> [-1]?
<iSuckAtRuby> well
<seanstickle> And how about the member before the last member?
<iSuckAtRuby> (var)[-1]
<iSuckAtRuby> (var)[-2]? and so forth? I'm not sure, that's part of where I was getting confused.
<seanstickle> Yup
<iSuckAtRuby> the rubyist example, like I said, was vague in my opinion.
<seanstickle> There you go.
<apeiros_> iSuckAtRuby: swap 0 and -1, then 1 and -2, then 2 and -3 etc.
<seanstickle> Problem solved.
<apeiros_> until your ends meet
<epitron> PEW PEW PEW
<seanstickle> Oh, geez, you're overloading him with too much awesome
<seanstickle> Start with the very slow, and then move up eventually to the somewhat slow
* epitron pushes him into the deep end
* epitron throws sharks in
<apeiros_> alternatively: just iterate over each character from the end, pushing it onto the new string
<iSuckAtRuby> *gasp* oh swap them. duh.. For whatever reason I didn't think of that. I'll find some way to implement that.
bglusman has joined #ruby
<apeiros_> the later is easier, the former is in-situ
<epitron> s[-1], s[1] = s[1], s[-1]
<epitron> i think that might just work
<epitron> [0] of course, not [1]
<iSuckAtRuby> you can do assignment like that with multiple arrays? I didn't know that.
<seanstickle> How swapping in situ occurs to iSuckAtRuby as obvious, but iterating in reverse order is obscure … baffles me
<iSuckAtRuby> I knew you could do it with other types though.
<iSuckAtRuby> multiple arrays on the left hand side of the assignment, I mean.
<apeiros_> it's not multiple arrays
<iSuckAtRuby> no the iterating in reverse order was obvious conceptually
<epitron> s[1] is a slot in an array
<apeiros_> s[x] = y is syntax sugar for the method call s.[]=(x,y)
<epitron> the array "s"
<iSuckAtRuby> I just was not (am not) sure how to implement it. Hence why I asked :)
<seanstickle> iSuckAtRuby: the same way you'd do it in C or Java
<iSuckAtRuby> the swapping is what didn't occur to me.
tomb_ has quit [Quit: Computer has gone to sleep.]
<epitron> why you givin him a hard time seanstickle?
<seanstickle> I am so mean.
<seanstickle> :(
<iSuckAtRuby> no you're not :)
<epitron> *flashback to seanstickle's first day on irc*
<epitron> *getting berated for not knowing how to reverse a list*
<epitron> :~(
<iSuckAtRuby> HAHAH WHAT A DUMBASS *ducks*
<seanstickle> True true
<iSuckAtRuby> lmao
<iSuckAtRuby> xD
<seanstickle> I was in the #python channel recently, and realized it was full of assholes
<apeiros_> note that with multibyte encodings doing something like `reversed = ""; (original.length-1).downto(0) { |i| reversed << original[i] }` will be slow
<epitron> and the cat's in the cradle and the silver spoooooon
<seanstickle> So I apologize for any rudeness on my part
sbanwart has quit [Ping timeout: 246 seconds]
<seanstickle> I don't want to be like #python
<offby1> seanstickle: I was just about to write (before I wiped the potato-chip grease off my hands): do you think ruby is more popular with beginning programmers than (say) python?
<epitron> apeiros_: is multibyte weird when you do << ?
<offby1> seems that way to me but it's hard to tell
<apeiros_> epitron: no, the problem is original[i]
<seanstickle> offby1: now? yes
<epitron> ah
<epitron> it has to scan the string or something?
<iSuckAtRuby> apeiros, that means about as much to me as scrambled ancient greek ;)
<seanstickle> offby1: 8 years ago, no
<apeiros_> epitron: how do you think it finds the i'th char in the string?
<horseman> offby1: hey eric
<apeiros_> it can do a straight calculation of the position
<offby1> Comes a horseman
<offby1> you and your aliases
<offby1> use "screen"!
* epitron converts the string to UTF16
<apeiros_> it might be at byte i, it might be at byte i*3…
bglusman has quit [Ping timeout: 248 seconds]
<epitron> PEW PEW PEW
<apeiros_> no use
chrxn has joined #ruby
<apeiros_> utf16 doesn't guarantee 2byte per char either.
<horseman> offby1: why is your gravatar made from half your face reflected
<offby1> horseman: very perceptive
<epitron> wha?
<horseman> offby1: dont u think that's a bit odd
<graspee> he has lots of aliases because people keep blocking him. it's like "rotating the shield frequencies" in star trek
<offby1> horseman: 'cuz I like the way it looks. A former co-worker thought it was creepy though
<offby1> *shrug*
<epitron> are you saying utf16 can encode > 16-bit stuff?
<seanstickle> offby1: Ruby is more popular because (a) it's a better language that Python, (b) it's got a better community than Python, and (3) it's got a better future than Python
<apeiros_> epitron: yes. broken code. sadly too many programmers think they're smart by doing that and produce broken code…
<apeiros_> epitron: yes. of course. all utf encodings can encode *all* of unicode
<offby1> seanstickle: I assume somewhere in there is "it's easier to learn"; maybe that's part of (a)
chienpo has left #ruby [#ruby]
<seanstickle> offby1: yes, part of (a)
<seanstickle> offby1: but should be on its own, I guess
zaychenok has quit [Ping timeout: 248 seconds]
<epitron> seanstickle: s/is/seems to me that it is/
<apeiros_> and unicode is currently at >110k codepoints, so 16bit doesn't cut it. also many code points are way beyond 2^16
<seanstickle> epitron: hey, your opinions are your own
<epitron> apeiros_: ah
<iSuckAtRuby> I know next to nothing of it, but I really like C, even though it's obviously difficult.
* epitron converts the string to UTF128
<iSuckAtRuby> it's kind of terse and beautiful in its own way.
<epitron> my code will be unbroken until we start subsuming alien langauges
<apeiros_> iSuckAtRuby: ever worked with, say, iconv in C?
<apeiros_> it made me want to kill somebody…
<epitron> C is like assembly on steroids ^_^
<apeiros_> C is also full of shitty libraries
freeayu has quit [Ping timeout: 248 seconds]
Targen has joined #ruby
<epitron> well, you get what you pay for
<seanstickle> s/you get/it is my opinion that you get/
<apeiros_> I paid the same for ruby. I got much much more…
* epitron pays for Watcom C++ 25.1
<epitron> seanstickle: that was an expression :)
* offby1 used to pay for VMware
<seanstickle> s/was/might be considered to have been by me to be used as/
<epitron> BREVITY, says the bard, IS, and this is the important bit, THE SOUL OF, wait for it, WIT
jenrzzz-mac has joined #ruby
<offby1> :)
fyolnish has joined #ruby
<offby1> not to put too fine a point on it
<epitron> :)
<iSuckAtRuby> oh my gosh
<seanstickle> fiddlesticks!
<iSuckAtRuby> @ aperios, you know how you said iterate each one with an array? It's possible to do the whole thing with
<iSuckAtRuby> oh
<iSuckAtRuby> wait
<iSuckAtRuby> nevermind
* seanstickle considers other euphemistic announcements
<iSuckAtRuby> I was going to say with one line of code and assignment. But then doing it for n lines doesn't make sense.
* offby1 goes to see a man about a dog
<iSuckAtRuby> *for n chars in a string, I mean.
<offby1> what kind of a language channel is this that doesn't have an eval bot! *tsk* *tsk* *tsk*
<apeiros_> iSuckAtRuby: use tab completion for nicks.
jenrzzz-mac has quit [Remote host closed the connection]
<apeiros_> less embarassing since you will typo less…
jenrzzz-mac has joined #ruby
<epitron> iSuckAtRuby: if you want to solve that weird utf8 problem, you could split your string into chars (string.chars.to_a)
<epitron> then do the reversing thing
<offby1> apeiros_: what IRC client do you use? (I see you use a Unicode "ellipsis" character)
<epitron> (but that doesn't really matter since this is only an exercise for fun)
<apeiros_> offby1: limechat
* offby1 googles
freeayu has joined #ruby
<apeiros_> and I use … by typing it manually.
<iSuckAtRuby> I didn't even know IRC had auto completion.
<apeiros_> opt-. here.
<iSuckAtRuby> ITS LIKE BASH GUYS
<apeiros_> iSuckAtRuby: irc doesn't. your clien thas.
<graspee> irc doesn't, clients do
<apeiros_> no. bash is comparatively sane.
<iSuckAtRuby> or, yeah, my client I mean. Dammit, how many faux pas can I make in one IRC session.
<iSuckAtRuby> apeiros_, stallman is crying right now.
<offby1> iSuckAtRuby: it depends on the client you're using, but I expect most of them do completion
dchelimsky has quit [Remote host closed the connection]
<iSuckAtRuby> damn you completion
<offby1> jinx jinx jinx
<apeiros_> iSuckAtRuby: 317, after that, your faux-pas limit is exhausted and you have to leave.
<offby1> hell, he's only at five or six; plenty of headroom
<apeiros_> offby1: use strict.
fyolnish has quit [Remote host closed the connection]
<iSuckAtRuby> yup, I'm well from a buffer overflow atm.
<iSuckAtRuby> I wonder what other secrets xchat holds for me other than autocompletion.
<apeiros_> there's a ruby plugin
<iSuckAtRuby> I guess if I knew perl I'd be able to make it into an operating system like emacs.
<apeiros_> no, you totally need lisp for that.
samuelkadolph has quit [Quit: Quitting]
<iSuckAtRuby> aww. But lisp is for smart people :(
<maahes> or smalltalk, or haskell
<iSuckAtRuby> Ocaml?
<iSuckAtRuby> nahhhhhh
<maahes> basically any language that does reflection and dynamic typing, etc.
<offby1> iSuckAtRuby: nah, I do lisp :)
<iSuckAtRuby> oh, so like brainfuck.
samuelkadolph has joined #ruby
<maahes> although, technically yes you could program "the giant repl" in C or something
<iSuckAtRuby> what OSes are you guys on anyway? *BSD or GNU/Linux or Windows?
* offby1 mumbles something about "Greenspun" and ten rules
mjb2k has joined #ruby
<offby1> iSuckAtRuby: Ubuntu but I'm connecting to it from a Mac running ssh
<offby1> so I have both accessible at once
<graspee> fat pangolin
<offby1> watch your language.
<graspee> le grosse pangoline
<seanstickle> Or just use the C-Repl https://github.com/martine/c-repl
<offby1> graspee: mucho mas major; gracias
<graspee> fat pangolin, in my mind, the sequel to "stalking ocelot"
<horseman> offby1: have u upgraded to emacs 24.1 ?
<offby1> horseman: not exactly, but I run from source and upgrade every coupla weeks, so I'm not far behind
<offby1> I'm using ERC Version 5.3 with GNU Emacs 24.1.50.1 (i686-pc-linux-gnu, multi-tty) of 2012-05-28.
jcromartie has quit [Quit: jcromartie]
paul_ has quit [Ping timeout: 240 seconds]
malkomalko has joined #ruby
<maahes> I'm running archlinux
<maahes> and awesomewm
erichmenge has quit [Quit: erichmenge]
mattonrails has joined #ruby
<offby1> I'm wearing Converse All-Stars, size 10 1/2
<seanstickle> That always makes me think someone is just getting lazy with their typing
<seanstickle> awesomewmmmemw
<graspee> i had to check what wm i was using because i just stare at various terminals all the time
tommyvyo has joined #ruby
<graspee> and it's gnome
* offby1 uses whatever comes with the box ...
<offby1> ... unless the box is a recent version of Ubuntu, in which case I call in an exorcist and fire up a blowtorch :-(
<iSuckAtRuby> critiques? Still stuck. my brain is just dead.
* offby1 's eyes cross
<iSuckAtRuby> I don't really know how to use until
<iSuckAtRuby> I have no idea what I'm doing.
<offby1> iSuckAtRuby: just to be clear: you do know that "reverse" is built-in already, yes?
<epochwolf> iSuckAtRuby: you know arrays have both reverse and sort_by
<offby1> heh
<iSuckAtRuby> @ offby1, yes, scroll up :)
<offby1> ok
<offby1> I'm bad about reading scrollback
<iSuckAtRuby> oh, no, it's completely fine.
<iSuckAtRuby> I don't expect you to scrollback anyway.
<iSuckAtRuby> kind of time-consuming.
<epochwolf> iSuckAtRuby: my scrollback is only 50 lines
<iSuckAtRuby> what are you running IRC in a vintage terminal? ;)
<graspee> maybe he's hardcore and using telnet
<epochwolf> no, znc buffer is 50 lines
<offby1> iSuckAtRuby: I guess I'd do it this way: https://gist.github.com/2934502
<graspee> maybe he's hardcore and using telnelst
<graspee> oops sorry
<epochwolf> since I don't want to flood myself off a low bandwidth connection
imami|afk is now known as banseljaj
jenrzzz-mac_ has joined #ruby
<iSuckAtRuby> @offby1, just out of curiosity, did you just write that? (I assume, I doubt you have useless methods clones just lying about your github)
<offby1> sure
jenrzzz-mac_ has quit [Remote host closed the connection]
<iSuckAtRuby> by the way, you cheated, you were supposed to let me suffer and figure it out on my own :)
<iSuckAtRuby> thanks though.
<offby1> heh
<offby1> yours uses a variable "i" that you haven't defined
<iSuckAtRuby> I was wondering about that.
<iSuckAtRuby> If I used 's' would it at least have been uh..... workable?
<iSuckAtRuby> heh
<offby1> my guess is that you've done some programming in some other (inferior :-) language ...
jenrzzz-mac_ has joined #ruby
<iSuckAtRuby> goodness I have no idea what I was doing there. It's so easy to read someone's elses implementation like yours but writing you own, yeesh. (yes I know, this is obvious, but I'm new blood).
<offby1> *shrug*
<offby1> gotta start somewhere
jenrzzz-mac has quit [Ping timeout: 245 seconds]
jenrzzz-mac_ is now known as jenrzzz-mac
<offby1> eventually it'll click. If not, try cooking :)
ZachBeta has joined #ruby
Progster has quit [Ping timeout: 246 seconds]
<iSuckAtRuby> just out of curiosity, say for someone like me that didn't know the unshift method until seeing you use it just now, how would you have done it?
<iSuckAtRuby> what would you have used instead of unshift if you were a really rudimentary programmer like me?
<graspee> if you have determination, anything can be accomplished. unless you run out of time. or people with guns are trying to stop you. but normally, yeah
<iSuckAtRuby> haha
<iSuckAtRuby> yeah
<offby1> iSuckAtRuby: gimme a minute
mockra has joined #ruby
<offby1> iSuckAtRuby: https://gist.github.com/2934518
<offby1> now that I think about it, I'm surprised that worked
<offby1> IT'S LIKE MATZ IS READING MY MIND
mnaser has joined #ruby
noodletraveler has joined #ruby
<axiak> iSuckAtRuby: if I were a bad ruby programmer (which I am), I'd do this: https://gist.github.com/2934523
fayimora has joined #ruby
<offby1> axiak: you Lisper, you
<offby1> not tail-recursive, though :)
<axiak> if I were a lisper, I'd use tail recursion
<axiak> :P
<iSuckAtRuby> that sounds abstruse.
<axiak> although, tbh I would have if any ruby implementation actually does TCO
<apeiros_> ruby1.9 does
<axiak> nice!!!! :-D
<apeiros_> you need to hit the secret switch, though
<axiak> I just started ruby a week ago, so this is really exciting for me
<axiak> hahaha
<apeiros_> no, seriously, it's in there but not active by default.
<axiak> I miss python's l[::-1], but if ruby has TCO then I'm never going back
<axiak> haha
<apeiros_> I don't know what the reason is to hold it back.
<iSuckAtRuby> I started two days ago, and that lisp-like code is interesting but yeah, defintiely no idea what's going on there.
<apeiros_> what does ::-1 do?
<axiak> probably the standard reason, tracebacks are broken
<axiak> apeiros_: reverse in python is just a consequence of allowing arbitrary slicing with steps
<axiak> so [::-1] is reverse
wpaulson has joined #ruby
<axiak> (they also have a .reverse(), but that's out of the discussion here)
<graspee> how do i turn on TCO then?
<graspee> i could google it but maybe someone else wants to know too
<offby1> axiak: I've done Python for a while, and I never saw [::-1]
<offby1> "Reduce TCO now!"
<offby1> ^^ what you'll probably find ^^
<axiak> offby1: the standard reason to use [::-1] over reversed() is that [::-1] returns the same type as what you gave it, so 'abc'[::-1] is 'cba' etc
<offby1> "reversed" doesn't?!
<graspee> Damn that's irritating
<offby1> these languages ... they have WARTS
<graspee> i'm going to recompile my ruby now
<axiak> offby1: no, most functions in python are annoying in that they return lists. including map/filter/reduce/reverse/sorted
<axiak> but note that these are functions, not methods
<graspee> i'm a bit scared of the experimental nature and "there may be bugs" info i found though
<axiak> if an object has a .reverse() method, it's usually equivalent to .reverse!
<apeiros_> graspee: I think it's a #define somewhere in the source. rvm might have a patch to do it for you.
<axiak> anyway, enough python
<graspee> it is a compile time option yeah
<axiak> so the main issue with TCO is that the stack is now different from what people expect
<graspee> or you can do:
<graspee> RubyVM::InstructionSequence.compile_option = { :tailcall_optimization => true, :trace_instruction => false
<graspee> }
<axiak> does the TCO work with mutually tail recursive functions?
<apeiros_> no idea
<offby1> probably
<offby1> TCO if I recall correctly doesn't care _what_ is being called; just that it's being called in tail position
<axiak> hmmm
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
macmartine has quit [Quit: macmartine]
<axiak> I know that scala has issues in that case, and its hack is a @tailrec annotation
<axiak> so you can indicate where you really want it
<graspee> this page is a good read http://timelessrepo.com/tailin-ruby
<axiak> so that if scala can't figure it out, it'll fail loudly
jenrzzz-mac has quit [Quit: jenrzzz-mac]
prtksxna has joined #ruby
<axiak> since if you assume TCO, sometimes it's /really/ important that you're actually TCO
<apeiros_> meh, if you care that much you can just as well rewrite it to an iterative loop.
<axiak> haha
<axiak> yeah
<offby1> axiak: I dimly recall that Clojure has a strange "please do TCO in this form" thingy
<apeiros_> unless you're using a functional language, but then your language sucks if it can't optimize that for you.
<axiak> offby1: yeah, it has some recur operator or something like taht
<axiak> you call the function by telling it that you really want tco
fayimora has quit [Quit: Busy…..zzzzz]
td123 has quit [Read error: Connection reset by peer]
macmartine has joined #ruby
horseman is now known as banisterfiend
joshman_ has joined #ruby
td123 has joined #ruby
maletor has joined #ruby
<iSuckAtRuby> arrrgggj
<iSuckAtRuby> I cannot get this reverse program to work
<iSuckAtRuby> :/
<iSuckAtRuby> and you put it in my lap
<offby1> you're not hitting it hard enough.
silentpost has quit [Ping timeout: 265 seconds]
<offby1> Try a real wooden bat, not that puny aluminum thing
<iSuckAtRuby> it's not that bad. Only java's compiler makes me want to do that.
end3r- has quit [Ping timeout: 272 seconds]
<iSuckAtRuby> The ruby interpreter is at least a sensitive and benevolent being.
centipedefarmer has quit [Quit: This computer has gone to sleep]
eywu has joined #ruby
<axiak> iSuckAtRuby: dasMonDestrunken is a string here, right? you never defined my_reverse as a string method
chrxn has quit [Quit: Computer has gone to sleep.]
<iSuckAtRuby> I didn't know that you had to define the types that the method accepts.
<iSuckAtRuby> Though I know you have to in java/ C etc,
<axiak> you don't
<axiak> but you're calling the my_reverse method on the dasMonDestrunken object
<iSuckAtRuby> oh
<axiak> so somewhere in the class hierarchy it has to find that method
<iSuckAtRuby> are you saying that I need to make a class?
<axiak> no
<iSuckAtRuby> oh okay
<iSuckAtRuby> so as in, the method hierarchy? or whatever.
c0rn_ has quit [Quit: Computer has gone to sleep.]
<axiak> I'm saying that the way you're calling it, you need to add my_reverse to some class in the dasMonDastrunken hierarchy
sepp2k1 has quit [Remote host closed the connection]
<andrewhl> ugh
<andrewhl> don't use pastebin
<axiak> so something like: eigenclass, String, Enumerable, Object, ...
<offby1> I took some liberties
<offby1> took me a while to figure out why it wasn't working.
byronb has quit [Ping timeout: 240 seconds]
<iSuckAtRuby> huh? what do you mean? the code you wrote above was working just find, wasn't it?
<iSuckAtRuby> I tested it, I just wanted to extend it to get a string from the person running the program, just because
<iSuckAtRuby> and that's where I ran into problems.
<offby1> I threw that part out because I/O is always tricky :)
<offby1> this is called "giving up".
<iSuckAtRuby> whereas (correct me if I'm wrong) the code you wrote far above just reversed the array you defined at the end.
<offby1> Giving up is underrated, by the way.
<iSuckAtRuby> haha
<offby1> you are correct
<axiak> here's my version, implementing it the way you were calling it: https://gist.github.com/2934604
<iSuckAtRuby> arrrgggh :(
<iSuckAtRuby> that looks like what I wrote but its giving me errors
<iSuckAtRuby> let me check it more closely
<axiak> note the use of "class String"
<offby1> axiak: pretty similar
<iSuckAtRuby> oh
mattonrails has quit [Remote host closed the connection]
<iSuckAtRuby> but, didn't you say that I *didn't* need to make a class? How would implement it without a class? (I know this is an OOP sacrelige, but I just am interested).
<axiak> we're not making a class here
fayimora has joined #ruby
<axiak> but you called it with myObj.my_reverse
<axiak> if you don't want to, you can define a method in the current self called my_reverse, and call it with my_reverse(myObj)
<axiak> but you have to use it the correct way
<axiak> see how offby1 is using my_reverse differently
<offby1> I just gotta be me
<axiak> it doesn't matter
<offby1> Also, een country I come from, they heff no objects
<axiak> it doesn't matter if you use objects or not
<axiak> just be consistent :P
<offby1> Hobgoblins have the consistency of foolish minds
<offby1> kinda runny with lumps
<axiak> heh
<Gavilan> iSuckAtRuby: What are you trying to do?
L-----D has quit [Ping timeout: 244 seconds]
<iSuckAtRuby> reverse a string.
<iSuckAtRuby> yes
<iSuckAtRuby> yes
<iSuckAtRuby> I know.
td123 has quit [Quit: WeeChat 0.3.8]
<iSuckAtRuby> before you say it.
<Gavilan> iSuckAtRuby: What's the problem with reversing a string?
<iSuckAtRuby> an inept mind is the problem.
<Gavilan> iSuckAtRuby: why?
<offby1> the problem is it doesn't work :)
<iSuckAtRuby> well
<iSuckAtRuby> I'm not really sure exactly why my use doesn't work
<iSuckAtRuby> but something about the string class
<iSuckAtRuby> as offby1 just said.
ZachBeta has quit [Quit: Computer has gone to sleep.]
<iSuckAtRuby> I'm trying to understand what he said though
<Gavilan> iSuckAtRuby: O_o
savage- has joined #ruby
simao has quit [Ping timeout: 265 seconds]
<iSuckAtRuby> warning: reading this may be hazardous to your health.
simao has joined #ruby
<iSuckAtRuby> if you run this program and lemming spring from your computer and assault you, I take NO responsibility.
<icy`> require 'yaml'; YAML
<icy`> nice little response to that in irb ^
<Gavilan> each_char.to_a.reverse.join is probably the best...
banisterfiend has quit [Remote host closed the connection]
CheeToS has joined #ruby
d3vic3 has quit [Ping timeout: 240 seconds]
<iSuckAtRuby> thanks for the help. Got it working.
d3vic3 has joined #ruby
DesiJat has quit [Quit: leaving]
hemanth has quit [Read error: Connection reset by peer]
vitoravelino` is now known as vitoravelino
vitoravelino has quit [Changing host]
vitoravelino has joined #ruby
xaq has joined #ruby
Konboi has quit [Remote host closed the connection]
zaychenok has joined #ruby
zaychenok has quit [Read error: Connection reset by peer]
<iSuckAtRuby> oh! I just discovered the <=> operator
<iSuckAtRuby> that would've been useful an hour ago
<iSuckAtRuby> haha
IrishGringo has joined #ruby
albemuth has quit [Quit: Computer has gone to sleep.]
railrubix has joined #ruby
redgetan has quit [Quit: Leaving]
brianpWins has joined #ruby
<railrubix> hi
rippa has joined #ruby
<railrubix> I'm trying to figure out where this method is coming from, I have an ApplicationController and there I have @my_object.create_some_table
wpaulson_ has joined #ruby
dnyy has joined #ruby
ananthakumaran has joined #ruby
hemanth has joined #ruby
pnbeast has quit [Ping timeout: 245 seconds]
<railrubix> so if I have @my_object.create_**** is that an internal method of some sort?
dhruvasagar has quit [Read error: Connection reset by peer]
L-----D has joined #ruby
wpaulson has quit [Ping timeout: 244 seconds]
wpaulson_ is now known as wpaulson
<bnagy> sounds like rails, try #rubyonrails
dhruvasagar has joined #ruby
<railrubix> bngay, yup, it's rails
vitoravelino is now known as vitoravelino`afk
fayimora has quit [Quit: Busy…..zzzzz]
end3r- has joined #ruby
centipedefarmer has joined #ruby
pabloh has quit [Quit: Ex-Chat]
wmoxam has joined #ruby
<iSuckAtRuby> trying to do what I just did (sort of)
<iSuckAtRuby> except write another redundant method
<iSuckAtRuby> to sort an array
<iSuckAtRuby> rather than reverse a string.
<iSuckAtRuby> I know this code has to be kind of right... right?
<iSuckAtRuby> I know its horrendous. . but I feel like I had one of those 'aha' moments and it left.
<seanstickle> Well, first off, 2 spaces per indentation level
<seanstickle> Not … whatever you've done there
<iSuckAtRuby> Whoops, geany's auto-indent is set to 4 spaces for some reason.
bawer has quit [Ping timeout: 248 seconds]
bawerd has quit [Ping timeout: 265 seconds]
centipedefarmer has quit [Quit: This computer has gone to sleep]
<iSuckAtRuby> okay seanstickle, critique?
<iSuckAtRuby> I cleaned it up a bit. kinda.
wallerdev has joined #ruby
<seanstickle> "Kinda" being an overstatement.
<seanstickle> Align that correctly, and we can talk
<iSuckAtRuby> is there a way to paste it correctly from my editor so that the indentation doesn't get messed up?
<seanstickle> Probably
umttumt has quit [Remote host closed the connection]
xaq has quit [Remote host closed the connection]
yxhuvud has joined #ruby
pr0zac0x2a has joined #ruby
seanstickle has quit [Quit: Nihil sub sole novum]
nipra has joined #ruby
<Hanmac> isuckatruby: i help you even with bad aligned code ... why do you unshift("element") and not unshift(element) ¿
Kn|t3 has quit [Ping timeout: 244 seconds]
pr0zac0x2a has quit [Ping timeout: 265 seconds]
<iSuckAtRuby> I hope this is easier to read.
<iSuckAtRuby> lmao @ that gif.
<iSuckAtRuby> @hanmac
<iSuckAtRuby> um
<iSuckAtRuby> I was copying this without understanding it fully:
<Paradox> im saving that gif
<Paradox> its now my "wut" gif
<iSuckAtRuby> only a gif like that is worthy for the derp code I just wrote.
pr0zac0x2a has joined #ruby
davidokner has joined #ruby
<iSuckAtRuby> @ hanmac, the interpreter is giving me "undefined method 'my_sort' for "[1, 2, 3]\n":String (NoMethodError)
<Hanmac> 1) there is an end to much, elsif does not need an addional end 2) the elsif in your code does nothing you could leave them out
<Hanmac> 3) gets returns a String, but you add the method to Array
<iSuckAtRuby> using .join?
Banistergalaxy has joined #ruby
dsa has joined #ruby
thecreators has quit [Remote host closed the connection]
<iSuckAtRuby> that is so creepy
<iSuckAtRuby> oh goodness
<iSuckAtRuby> lol
<Hanmac> no you need something like eval(gets) ... (i dont recomend it but its the first way)
tamaska has quit [Quit: Leaving]
<Hanmac> Paradox dont go the way of banister
banseljaj is now known as imami|afk
<RubyPanther> yeah, junkies suck
<Paradox> im done
<Paradox> lol
EzeQL has quit [Ping timeout: 260 seconds]
yxhuvud has quit [Read error: Connection reset by peer]
yoklov has quit [Quit: bye!]
joshman_ has quit [Quit: Computer has gone to sleep.]
<iSuckAtRuby> !!
<iSuckAtRuby> I think I got it working!
vitor-br has quit [Ping timeout: 244 seconds]
<iSuckAtRuby> dammit
<iSuckAtRuby> nevermind
<iSuckAtRuby> I did something stupid that made it print out a sorted array, but not actually algorithmically sort it through the method.
yugui_zzz is now known as yugui
kevinbond has quit [Quit: kevinbond]
cyong has joined #ruby
Synthead has quit [Quit: p33 ba115]
mikeycgto has quit [Remote host closed the connection]
AndChat| has joined #ruby
Banistergalaxy has quit [Ping timeout: 252 seconds]
pr0zac0x2a has quit [Ping timeout: 265 seconds]
mjb2k has left #ruby [#ruby]
jitesh_shetty has quit [Remote host closed the connection]
dsa has quit []
savage- has quit [Remote host closed the connection]
ukd1 has joined #ruby
<ukd1> Hey, does anyone know how to skip building docs for gems?
mmercer has quit [Read error: Operation timed out]
mmercer has joined #ruby
hunglin has quit [Quit: Leaving.]
yxhuvud has joined #ruby
davidokner has quit [Ping timeout: 245 seconds]
koskoz has joined #ruby
andrewhl has quit [Remote host closed the connection]
n1x has joined #ruby
tewecske has joined #ruby
jayne has quit [Read error: Connection reset by peer]
jayne_ has joined #ruby
prtksxna has quit [Remote host closed the connection]
Tricks has quit [Ping timeout: 244 seconds]
Banistergalaxy has joined #ruby
nilg has joined #ruby
jitesh_shetty has joined #ruby
koskoz has quit [Ping timeout: 252 seconds]
AndChat| has quit [Ping timeout: 248 seconds]
ipoval has joined #ruby
overmind667 has quit [Ping timeout: 252 seconds]
Konboi has joined #ruby
Gavilan has left #ruby [#ruby]
dhruvasagar has quit [Ping timeout: 248 seconds]
lkba has quit [Ping timeout: 252 seconds]
queequeg1 has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
ananthakumaran has quit [Quit: Leaving.]
n1x has quit [Quit: "I'm going for OSF"]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
tvw has joined #ruby
krz has quit [Quit: krz]
MrGando has joined #ruby
malkomalko has quit [Remote host closed the connection]
iori has quit [Read error: Connection reset by peer]
iori has joined #ruby
icooba has joined #ruby
minijupe has joined #ruby
maletor has joined #ruby
pen has quit [Remote host closed the connection]
Targen has quit [Ping timeout: 245 seconds]
iori has quit [Read error: Connection reset by peer]
iori has joined #ruby
ryanf has joined #ruby
koskoz has joined #ruby
banisterfiend has joined #ruby
mr_neezer has joined #ruby
macmartine has quit [Quit: macmartine]
lmarcetic has quit [Quit: bb]
krusty_ar has quit [Read error: Connection reset by peer]
mr_neezer has left #ruby [#ruby]
werdnativ has joined #ruby
Axsuul has quit [Read error: Connection reset by peer]
TPFC-SYSTEM has joined #ruby
<werdnativ> how is "def end" even parseable?
octarine is now known as rcsheets^
<werdnativ> huh, it's a valid method name, I guess… Josh Peek is a lunatic.
<Paradox> laol
khakimov has quit [Quit: Computer has gone to sleep.]
supergiantrobot_ has quit [Ping timeout: 244 seconds]
ringotwo has joined #ruby
jitesh_shetty has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
LowKey has quit [Ping timeout: 272 seconds]
gentz has quit [Ping timeout: 245 seconds]
xiaotian has quit [Quit: Computer has gone to sleep.]
overmind667 has joined #ruby
chimkan has joined #ruby
chimkan has quit [Read error: Connection reset by peer]
chimkan_ has joined #ruby
mfridh has joined #ruby
burgestrand has joined #ruby
Icehawk78 has quit [Ping timeout: 252 seconds]
Icehawk78 has joined #ruby
rcsheets^ is now known as octarine
LiquidInsect has quit [Ping timeout: 244 seconds]
Axsuul has joined #ruby
Asher1 has joined #ruby
jeer has joined #ruby
Asher has quit [Read error: Connection reset by peer]
davejacobs has joined #ruby
LiquidInsect has joined #ruby
charliesome has joined #ruby
<_br_> werdnativ: Wow, I didn't know you could do that. That is bad, wth, how does that reflect on the ast ?
Asher1 has quit [Client Quit]
Asher has joined #ruby
<_br_> werdnativ: Lunatic seconded
mneorr1 is now known as mneorr
ph^ has joined #ruby
senny has joined #ruby
<werdnativ> _br_: maybe it's an acid test for ruby implementations.
flori has quit [Read error: Operation timed out]
EskiMag has joined #ruby
billiamii has quit [Quit: Leaving]
ryanf has quit [Ping timeout: 244 seconds]
mohits has quit [Quit: Leaving]
Morkel has joined #ruby
jprovazn_away has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
ryanf has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
flori has joined #ruby
koskoz has quit [Ping timeout: 252 seconds]
eywu has quit [Quit: Leaving.]
<_br_> werdnativ: Well, then the vms out there seem to fail miserably o.O
<werdnativ> which ones?
vectorshelve has joined #ruby
<werdnativ> I'm just playing with MRI 1.9.3 right now...
<Paradox> have you used yarv?
<vectorshelve> hemanth: hai bhai... had a 1 day visit to my hometown cochin yesterday and back to Chennai today :)
jimeh has joined #ruby
freeayu has quit [Ping timeout: 246 seconds]
<hemanth> vectorshelve,kool
schovi has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
red-panda has joined #ruby
nilg` has joined #ruby
AxonetBE has joined #ruby
_br_ has quit [Quit: Bye, thanks for all the fish.]
freeayu has joined #ruby
ukd1 has quit [Quit: ukd1]
ddv has joined #ruby
jitesh_shetty has joined #ruby
red-panda has quit [Remote host closed the connection]
red-panda has joined #ruby
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
djdb has joined #ruby
stewart_ has quit [Quit: Leaving.]
red-panda has quit [Remote host closed the connection]
chrxn has joined #ruby
visof has joined #ruby
red-panda has joined #ruby
prtksxna has joined #ruby
Criztian has joined #ruby
minijupe has quit [Quit: minijupe]
ddv has quit [Changing host]
ddv has joined #ruby
ephemerian has joined #ruby
dbck has joined #ruby
maesbn has joined #ruby
Occult has joined #ruby
xnm has joined #ruby
mockra has quit [Remote host closed the connection]
dekroning has joined #ruby
socomm has quit [Ping timeout: 244 seconds]
_br_ has joined #ruby
maletor has joined #ruby
jimeh has quit [Quit: bye]
burgestrand has quit [Ping timeout: 244 seconds]
gilead has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
fantazo_ has quit [Remote host closed the connection]
dhruvasagar has joined #ruby
schovi has quit [Remote host closed the connection]
ipoval has quit [Quit: ipoval]
ben_alman has quit [Excess Flood]
socomm has joined #ruby
darthdeus has quit [Quit: Leaving...]
suborbital has quit [Ping timeout: 240 seconds]
chrxn has quit [Quit: Computer has gone to sleep.]
zommi has joined #ruby
davejacobs has quit [Ping timeout: 240 seconds]
ghosTM55 has joined #ruby
bluOxigen has joined #ruby
freeayu has quit [Ping timeout: 245 seconds]
ben_alman has joined #ruby
IrishGringo has quit [Ping timeout: 244 seconds]
chimkan_ has quit [Quit: chimkan_]
freeayu has joined #ruby
gilead_ has joined #ruby
gilead has quit [Ping timeout: 265 seconds]
maahes has quit [Ping timeout: 245 seconds]
wallerdev has quit [Quit: wallerdev]
pk1001100011 has joined #ruby
maahes has joined #ruby
Eldariof-ru has joined #ruby
schovi has joined #ruby
suborbital has joined #ruby
carbncl has joined #ruby
carbncl has quit [Client Quit]
chrxn has joined #ruby
umttumt has joined #ruby
mischief has quit [Quit: you are so mercifully free of the ravages of intelligence.]
qwerxy has joined #ruby
jenglish has joined #ruby
fserb has joined #ruby
darthdeus has joined #ruby
francisfish has joined #ruby
fserb has quit [Client Quit]
tadassce has joined #ruby
timonv has joined #ruby
fserb has joined #ruby
qwerxy has quit [Quit: offski]
yugui is now known as yugui_zzz
fserb has quit [Quit: ttyl]
ozy_work has quit [Ping timeout: 244 seconds]
ryanf has quit [Ping timeout: 265 seconds]
fserb has joined #ruby
selvakumaran has joined #ruby
lolmaus has joined #ruby
tadassce has left #ruby ["Linkinus - http://linkinus.com"]
fserb has quit [Client Quit]
mdw has joined #ruby
overmind667 has quit [Quit: Lost terminal]
robotmay has joined #ruby
mdw_ has joined #ruby
fjfish has joined #ruby
francisfish has quit [Read error: Connection reset by peer]
d3vic3 has quit [Ping timeout: 252 seconds]
ghosTM55 has quit [Quit: leaving]
d3vic3 has joined #ruby
mdw has quit [Ping timeout: 244 seconds]
<selvakumaran> getting an error while installing gem, reports error in compiling in extconf.rb- how to fix it?
<bnagy> selvakumaran: read the log it tells you to read
<bnagy> or pastie the contents of it, it can be due to several things
<shevy> selvakumaran there needs to be more information
<bnagy> but mostly, missing build tools
tomb_ has joined #ruby
<selvakumaran> ok , i'll paste it
<selvakumaran> give me a sec
roolo has joined #ruby
S1kx has joined #ruby
<selvakumaran> bnagy, shevy http://paste.opensuse.org/3875946
<selvakumaran> bnagy, u were right.
<selvakumaran> My i knw how to fix it?
<selvakumaran> *may i know how to fix it?
<bnagy> that looks like you need to install zlib
<bnagy> what's suse? apt? yum?
<bnagy> anyway try zlib zlin1g zlib1g-dev or something
<bnagy> *zlib1g
Vainoharhainen has joined #ruby
Aaton_off has quit [Ping timeout: 256 seconds]
Aaton_off has joined #ruby
Aaton_off is now known as Aaton
chrxn has quit [Quit: Computer has gone to sleep.]
mohits has joined #ruby
<selvakumaran> bnagy, its Zypper
<selvakumaran> in suse
<bnagy> ok well anyway, there are some basic libs that you probably want
<bnagy> zlib, a compiler, openssl, libyaml...
<selvakumaran> Ok
<selvakumaran> fine, i am issuing zypper in zlib zlin1g zlib1g-dev in terminal lets see what happens
<bnagy> zlib1g
kaiwren has joined #ruby
<bnagy> not zlin
<graspee> the gem that always gives me errors is ruby-opengl
<graspee> so i gave up trying to fix it
<selvakumaran> bnagy, ok
<selvakumaran> graspee, :)
<selvakumaran> i am trying to install libxml-ruby
<graspee> never tried that one
d3vic3 has quit [Ping timeout: 248 seconds]
kingfishr has quit [Read error: Connection reset by peer]
kingfishr has joined #ruby
bradhe has joined #ruby
d3vic3 has joined #ruby
<selvakumaran> graspee, fine
stockholm has joined #ruby
<selvakumaran> ananthakumaran, ping
gentz has joined #ruby
jimeh has joined #ruby
<shevy> selvakumaran you probably need to have libxml2 ready
saschagehlich has joined #ruby
<shevy> latest libxml2 source is at ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz I am sure zypper provides a way to install that too
xnm has quit [Read error: Connection reset by peer]
<shevy> libxml-ruby-2.3.2.gem seems to be the latest ruby binding to it
graspee has quit [Quit: pan pan pangolin]
Ammar01 has joined #ruby
davidw has joined #ruby
davidw is now known as Guest97362
cjs has joined #ruby
<cjs> Anybody here familiar with making C extensions for Ruby?
<selvakumaran> shevy, Thanks for the update
<shevy> cjs, Hanmac here should be :-)
<Hanmac> cjs: what are you planing todo?
nipra has quit [Ping timeout: 265 seconds]
piotr_ has joined #ruby
<cjs> I'm wondering about the sample from the pickaxe book: they declare a global VALUE cTest in which they store the result of rb_define_class("MyTest" ...); does that VALUE need to be persisted, or can we just throw away the return value and get it again with another call to the rb_define_class function call?
<cjs> I'm guessing the latter....
selvakumaran_ has joined #ruby
<cjs> Also, how does the interpreter figure out what Init_whatever function to call when the extension is loaded? Will it always be Init_foo where "foo" is what's passed to the create_makefile function in extconf.rb?
workmad3 has joined #ruby
nipra has joined #ruby
Guest97362 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
selvakumaran has quit [Ping timeout: 265 seconds]
grantbdev has quit [Quit: Leaving]
<cjs> Hm...reading the MKMF docs in the appendix of the pickaxe book would probably also be a good move on my part. :-)
red-panda has quit [Remote host closed the connection]
<Hanmac> cjs i prefer my defined classes in global VALUE objects because i maybe need them later
red-panda has joined #ruby
<shevy> cjs I think via Init_ is a convention
<shevy> it is explained somewhere
<cjs> Hanmac: Hm. Makes sense. I'm actually doing my extension in C++, so I'll just pop them in to a separate namespace to avoid polluting the global one.
manizzle has quit [Ping timeout: 246 seconds]
<shevy> "When Ruby tries to load an extension, the first thing it does is look for a function named Init_extname, where extname is the name of the extension."
manizzle has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<Hanmac> cfs i do my extendions in c++ too ... when you do, the Master init function need to be extern "C" ... and then i use namespaces to store the functions in need for define_method
<cjs> Yup, I've got the extern "C" bit down. I'm doing the standard "namespace ruby { #include "ruby.h" } thing as well. Ok, so I seem to be going the right direction here. Good.
manizzle has quit [Read error: Connection reset by peer]
manizzle has joined #ruby
yankov has quit [Quit: yankov]
zommi has quit [Remote host closed the connection]
wvdschel has quit [Ping timeout: 244 seconds]
nari has joined #ruby
mbk_ has joined #ruby
vlad_starkov has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
pygospa has quit [Disconnected by services]
L-----D has quit [Quit: Leaving]
qwerxy has joined #ruby
TheRealPygo has joined #ruby
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
williamcotton has quit [Quit: williamcotton]
cyong has left #ruby [#ruby]
konrads has joined #ruby
<konrads> Hello. I am looking for a ruby gem with native ntlm proxy support
cyong has joined #ruby
<vectorshelve> ...............................................................................................................................................
<banisterfiend> vectorshelve: sup G.
<vectorshelve> banisterfiend: G ?
<banisterfiend> vectorshelve: ganster
CheeToS has quit [Ping timeout: 244 seconds]
<vectorshelve> banisterfiend: :) am fine you ?
ph^ has quit [Remote host closed the connection]
S1kx has quit [Ping timeout: 265 seconds]
ph^ has joined #ruby
WhereIsMySpoon has joined #ruby
<WhereIsMySpoon> Hi, I have https://gist.github.com/2935549 but when someone gives an invalid url I still get an exception which crashes the program - I thought rescue was supposed to catch exceptions?..
<cjs> When I want to define a module within another module, I just do rb_define_module("A::B")?
rakm has quit [Quit: Computer has gone to sleep.]
konrads has quit [Ping timeout: 244 seconds]
<banisterfiend> cjs: i think you use define_module_under
ph^ has quit [Ping timeout: 248 seconds]
jitesh_shetty has quit [Ping timeout: 244 seconds]
<cjs> Ah, thanks.
freeayu has quit [Ping timeout: 246 seconds]
<vectorshelve> WhereIsMySpoon: try using URI.parse for validating the URL and then use rescue
<vectorshelve> WhereIsMySpoon: check the comment something like this
<shevy> WhereIsMySpoon and where is the error
<shevy> vectorshelve is making giant steps with ruby :D
<vectorshelve> shevy: thank you shevy hope my comment illustrates something useful to him :)
<WhereIsMySpoon> shevy - page = open("http://www." + url)
<WhereIsMySpoon> that is teh line the error is on
<WhereIsMySpoon> there are a load of internal errors in open-uri.rb
<WhereIsMySpoon> vectorshelve: ill take a look at that
<vectorshelve> WhereIsMySpoon: see while u validate an URI its always the best to use URI.parse
kaiwren has quit [Quit: kaiwren]
<WhereIsMySpoon> vectorshelve: is that in the open-uri lib?
freeayu has joined #ruby
<shevy> URI.parse(your_url_here)
<WhereIsMySpoon> vectorshelve: hm, wonder if that'll work with open-uri's open method
* WhereIsMySpoon looks up more doc
<shevy> WhereIsMySpoon, typically I use begin; rescue Exception => error; pp error
S1kx has joined #ruby
<WhereIsMySpoon> shevy: whats the => for
<vectorshelve> WhereIsMySpoon: check it out.. or try using regex for uri validation but thats crazy at times..
<shevy> you assign the backtrace to the variable name error in this example
<shevy> after I know the specific error, I usually change Exception to it
<WhereIsMySpoon> oic
<shevy> like if it is a load error, it becomes
<shevy> rescue LoadError
<shevy> if argument error, rescue ArgumentError (i think)
arturaz has joined #ruby
<shevy> and via pp, you get a nice output. it's helpful to upload that specific error message to your pasties
<WhereIsMySpoon> shevy: https://gist.github.com/2935600
<shevy> the error that openuri raises is OpenURI::HTTPError
<WhereIsMySpoon> shevy: yea i tried to rescue that before
<WhereIsMySpoon> didnt work
<shevy> WhereIsMySpoon do you have specific code so I can reproduce the same error you get?
<WhereIsMySpoon> yes, i pasted it
<shevy> because normally, begin/rescue works fine
<shevy> no, that is not the full
<shevy> I want to copy paste only the full
<WhereIsMySpoon> that is the full method
<shevy> no man
<shevy> you do not invoke the method anywhere
<shevy> give me the line that you use to invoke it too
<WhereIsMySpoon> its part of an irc bot
<WhereIsMySpoon> i used this:
<shevy> argh
<shevy> you wrote it yourself though?
<WhereIsMySpoon> the bot? yes
<shevy> good
<WhereIsMySpoon> all entirely my own code
<WhereIsMySpoon> that link above is exactly the link that crashes it
<shevy> the part "puts url"
<shevy> what is output for url?
Kn|t3 has joined #ruby
<WhereIsMySpoon> shevy: youtube.com/asdasdsadasdsaasjkdhkdfhfuweiopafweafhasfnhjksnhfjksfjksadkfhsdjkafhsdajkfhsdjkahfsdjkahfsadk
<WhereIsMySpoon> shevy: it works fine for normal yt links
<shevy> no that is odd
<shevy> I get a completely different error hmm
<shevy> ok
<shevy> open-uri.rb:346:in `open_http': 404 Not Found (OpenURI::HTTPError)
<WhereIsMySpoon> shevy: if i change it to this: https://gist.github.com/2935624 i still get the crash
<WhereIsMySpoon> shevy: that is completely the same error i got
<shevy> yeah
<shevy> now you must decide what happens in that case
<WhereIsMySpoon> oh\
<WhereIsMySpoon> its because of hte raise
<shevy> WhereIsMySpoon, http://pastie.org/4091330
prtksxna has quit [Read error: Connection reset by peer]
prtksxna_ has joined #ruby
<shevy> aha
<shevy> I did not even see the raise :D
<WhereIsMySpoon> :p
<shevy> anyway, you rescue that very specific error, and continue from that point
<shevy> "when the url was not found, go out of the office and slay a kitten"
nari has quit [Ping timeout: 240 seconds]
<WhereIsMySpoon> yea, i know how exception handling works in general :) thanks for the help :D
mbk_ has quit [Read error: Connection reset by peer]
WhereIsMySpoon has left #ruby ["http://quassel-irc.org - Chat comfortably. Anywhere."]
WhereIsMySpoon has joined #ruby
flype has joined #ruby
<WhereIsMySpoon> shevy: what other functionalities would you recommend for a bot? just anything that comes to mind :)
<shevy> my first project in ruby was a bot
<shevy> my problem was that I added feature after feature
<shevy> until it was all a mess
<shevy> then I thought "hmm let's redesign". and since that day... the bot no longer works
<WhereIsMySpoon> haha
<shevy> and the worst was, I have no more motivation to fix it :(
<WhereIsMySpoon> well i dont mind some work to make it clean :)
<shevy> WhereIsMySpoon, I decided to however split out functionality
<shevy> let me show you one example
<shevy> ok
<shevy> the code does only one thing:
<shevy> "connect to one freenode channel and allow you to talk there"
hemanth has quit [Read error: Connection reset by peer]
<shevy> and it kinda does that... I am not going to add much to it
hemanth has joined #ruby
<shevy> I use it from my pseudo-shell, in case I installed a linux distribution... but xorg is not working. so I just do "irc ruby" and it connects me to the ruby channel here and then I can ask for
<shevy> HELP!!!!
<shevy> you see WhereIsMySpoon? :D
<shevy> I think it is better to keep functionality as modular and as simple as possible, whenever possible
<shevy> same for an irc bot
Progster has joined #ruby
<shevy> WhereIsMySpoon status information would be awesome for a bot... I mean, compile a program, package it up, then provide a download link to the result
<WhereIsMySpoon> shevy: one sec i was afk, looking at the pastie now
Markvilla has joined #ruby
<shevy> eval() functionality would be nice too. one has to ensure that someone would not abuse such a bot of course
<WhereIsMySpoon> shevy: what's include?
<WhereIsMySpoon> i thought that was cpp
<WhereIsMySpoon> ive only used require
<shevy> you have something like module Foo
darthdeus has quit [Quit: Linkinus - http://linkinus.com]
<shevy> this creates a module called Foo, which also has the Foo namespace
<shevy> if you then want to make use of that module in your class, you must include the module (the namespace kind of) into your class
<shevy> so you do that with module
<shevy> module Foo; HI_THERE = 'Hello!'; end; class Bar; include Foo; end
<WhereIsMySpoon> shevy: so instead of require'ing the whole lib, you just include a certain module?
<shevy> you must require first anyway because require only loads the .rb file
<shevy> but yeah
<WhereIsMySpoon> i see
<shevy> if it is in the same file you dont have to require :)
<WhereIsMySpoon> shevy: what did you mean by compile a program/package/provide dl link? You mean like dl some source from internets, compile/package ?
<shevy> Bar::HI_THERE # => "Hello!"
<shevy> do you see what happens there?
<shevy> well
<WhereIsMySpoon> you execute the HI_THERE method of Bar
<shevy> - Allow users to give useful instructions to the bot
<shevy> WhereIsMySpoon, well it is not a method ;)
<workmad3> WhereIsMySpoon: no
sspiff has quit [Ping timeout: 244 seconds]
<shevy> a method would have "def" usually :P
<WhereIsMySpoon> ??
<shevy> where is the def WhereIsMySpoon ;)
Ethan has joined #ruby
<WhereIsMySpoon> i thought you were executing it
<WhereIsMySpoon> not defining it
<shevy> I show you the full example
<WhereIsMySpoon> oh sorry
<shevy> module Foo; HI_THERE = 'Hello!'; end; class Bar; include Foo; end;Bar::HI_THERE # => "Hello!
<shevy> well
<WhereIsMySpoon> yea
<shevy> that was IRB output
chomp has quit [Quit: Leaving]
<shevy> module Foo; HI_THERE = 'Hello!'; end; class Bar; include Foo; end; Bar::HI_THERE
<shevy> here :P
<shevy> now the quiz! what is HI_THERE
piotr__ has joined #ruby
iocor has joined #ruby
* WhereIsMySpoon thinks
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
piotr_ has quit [Ping timeout: 244 seconds]
<shevy> these kind of quiz are easy because you can start irb, paste this and do Bar::HI_THERE.class
<WhereIsMySpoon> eh?
<shevy> well alright
ananthakumaran1 has joined #ruby
<WhereIsMySpoon> HI_THERE is a variable?
<shevy> yeah
<shevy> well
<shevy> kind of
<shevy> (irb):3: warning: already initialized constant HI_THERE
<shevy> a constant
<shevy> you could use it like a variable though :P
<WhereIsMySpoon> oh its like a static variable in java?
<WhereIsMySpoon> class variable
<shevy> dunno. I think java forbids you to make changes
<shevy> nono a class variable has @@
<shevy> and sucks
<shevy> ask workmad3
<shevy> :)
<WhereIsMySpoon> whats the difference between a class variable and this
<shevy> the @@
<shevy> hahahaha
ananthakumaran has quit [Ping timeout: 244 seconds]
<WhereIsMySpoon> <_>
<WhereIsMySpoon> look you
<shevy> no, a constant means what
<WhereIsMySpoon> it's a constant?
<WhereIsMySpoon> ...
<shevy> yeah
<WhereIsMySpoon> i dont understand the question
<shevy> precisely
<shevy> it is constant
<shevy> it does not change
<WhereIsMySpoon> ok
<shevy> because it is constant
<shevy> does it change WhereIsMySpoon?
<WhereIsMySpoon> not in your code
<shevy> ...
<shevy> ok here is a good example of a constant in ruby
<shevy> Math::PI # => 3.141592653589793
<WhereIsMySpoon> sure
<WhereIsMySpoon> that wont ever change
<shevy> you know when you need PI, for math circles
<shevy> yes!
<shevy> you now understood constants!
<WhereIsMySpoon> ok
<shevy> grab a beer
<WhereIsMySpoon> lol
<WhereIsMySpoon> i wish
<WhereIsMySpoon> im at work
<Ethan> I want a beer
<shevy> it's a bit strange in ruby because you can change constants :\
<Ethan> Oh wait, I'm not 21.
<shevy> but you should not change them
<WhereIsMySpoon> ...
<WhereIsMySpoon> then why bother making it possible to change them
sspiff has quit [Remote host closed the connection]
<WhereIsMySpoon> if its stupid to
<shevy> module Math; PI = 42;end
<shevy> Math::PI # => 42
<shevy> dunno WhereIsMySpoon
<WhereIsMySpoon> yes, that isnt helpful
<shevy> matz likes freedom
<WhereIsMySpoon> ic
<WhereIsMySpoon> well
<vectorshelve> very beautifult convcerstation log between shevy and WhereIsMySpoon :) I missed quite a few part of it.. reiterating
<shevy> perhaps there also was another reason, I dont know
<WhereIsMySpoon> what did this even have to do with my bot
<WhereIsMySpoon> <_>
<shevy> WhereIsMySpoon you asked about include :P
<WhereIsMySpoon> oh yes
<shevy> you can only include constants
<WhereIsMySpoon> shevy: so back to this compile thing
nfk has joined #ruby
<WhereIsMySpoon> what were you talking about
<shevy> module Foo <-- Foo
<WhereIsMySpoon> o.o
<shevy> well, if someone wants to download a binary package
mayankkohaley has quit [Ping timeout: 240 seconds]
<WhereIsMySpoon> that looks like trouble
<shevy> and wants it build anew
<shevy> then he could ask the bot to do that
<shevy> :)
<WhereIsMySpoon> true
<WhereIsMySpoon> is there a library for interacting with gcc?
gyre007 has joined #ruby
<WhereIsMySpoon> and make
<shevy> but I think 98% of linux users are now like windows users
<WhereIsMySpoon> not gcc
<WhereIsMySpoon> why did i say gcc
<WhereIsMySpoon> i meant make
<shevy> WhereIsMySpoon, well you can always use system('gcc foo.c')
<WhereIsMySpoon> or will i just have to execute system calls
<shevy> or system 'make'
<WhereIsMySpoon> blah
<shevy> yeah
<shevy> :)
<shevy> we don't yet have a rubyOS
mayankkohaley has joined #ruby
<WhereIsMySpoon> haha
<WhereIsMySpoon> :D
<shevy> it would also be a lot of work
<WhereIsMySpoon> yea
<shevy> much less work to just use ruby on linux (or another OS, it even works on windows)
<WhereIsMySpoon> but who would use windows to code on
<shevy> hmm
<WhereIsMySpoon> unless they're coding vb.net or something
<WhereIsMySpoon> in which case they have a whole new problem
<WhereIsMySpoon> trololo
<shevy> yeah, ruby aint very important for windows folks
<shevy> but if I would go back to windows, I'd use ruby
<shevy> with msys, you kinda have a bash-like shell on windows
<WhereIsMySpoon> or you could use cygwin
<WhereIsMySpoon> anyhoo
<shevy> yeah, pretty much the same. but every ruby script can work on windows! we have like a giant ruby ecosystem here
<shevy> and can make windows suck less
<WhereIsMySpoon> shevy: i cant see actually compiling/making the binary being an issue
zomgbie has joined #ruby
<WhereIsMySpoon> the only thing is i have to learn the dcc protocol
<WhereIsMySpoon> and implement that into my bot
<WhereIsMySpoon> :)
<WhereIsMySpoon> so i will get on that
<WhereIsMySpoon> :)
<shevy> hmm you could auto-upload to some other site
<shevy> and just provide the link to that
<WhereIsMySpoon> shevy: meh, im not really that keen on relying on some external site that may or may not work
<WhereIsMySpoon> shevy: oo actually
<WhereIsMySpoon> i could upload to dropbox
<shevy> lol
<WhereIsMySpoon> then provide link to that
<shevy> didnt you just say you dont wanna rely on external sites ;P
<WhereIsMySpoon> yea but
<WhereIsMySpoon> dropbox is like
<WhereIsMySpoon> reliable
<shevy> there are always exceptions to any rule!
<WhereIsMySpoon> themediaplace.com isnt
<WhereIsMySpoon> or whatever site u want
<shevy> today I shall not drink anything
<WhereIsMySpoon> you know what i mean
<shevy> ... except beer
cyong has quit [Quit: Leaving.]
<WhereIsMySpoon> sounds dangerous
<shevy> yeah, if it gets out of hand. a friend used to drink about 5 bottles of beer a day
<WhereIsMySpoon> that isnt much
kaiwren has joined #ruby
<WhereIsMySpoon> i could drink that in a night out :S
<WhereIsMySpoon> shevy: someone commented on my give_youtube_description gist with some method to get linkedin profiles :S:S
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
<WhereIsMySpoon> o.o
nipra has quit [Ping timeout: 246 seconds]
DrForr has joined #ruby
bglusman has joined #ruby
<shevy> perhaps a bot
<shevy> I still prefer pastie.org over gist
<WhereIsMySpoon> why
<WhereIsMySpoon> i have a github acc
<shevy> I like the colours more
<WhereIsMySpoon> so gist is good for me
<WhereIsMySpoon> pfff
<WhereIsMySpoon> are you a real man?
<WhereIsMySpoon> :p
<shevy> I use github too but the gists I dont like
ilmenite has joined #ruby
<shevy> there is worse though
<shevy> like pastebin
<WhereIsMySpoon> anyone here use quassel
<WhereIsMySpoon> pastebin sucks ass
red-panda has quit [Remote host closed the connection]
cheater_ has joined #ruby
d3vic3 has quit [Ping timeout: 244 seconds]
bglusman has quit [Ping timeout: 244 seconds]
<ilmenite> hi, ive got an array, arr = {"test" => "blah", "102" => "hello"}, im trying to use this to replace all occurences of test with blah and 102 with hello. Using gsub, i can get only the 102 to be replaced with hello, this is what im doing: "102 test".gsub(/(\d+)/) {|m| arr[$1] }
<ilmenite> any idea how do i get it to replace the string matches as well?
<WhereIsMySpoon> that's a hash not an array
<ilmenite> oh, my bad, im still new to ruby
<WhereIsMySpoon> [] is array
zomgbie_ has joined #ruby
<WhereIsMySpoon> in a hash you have key => value
d3vic3 has joined #ruby
iori has quit [Remote host closed the connection]
<WhereIsMySpoon> :)
<ilmenite> so then using this hash, why does it replace only numbers and not strings?
cheater has quit [Ping timeout: 244 seconds]
<WhereIsMySpoon> "102" is a string
<WhereIsMySpoon> not a number
zomgbie has quit [Ping timeout: 244 seconds]
iori has joined #ruby
<bnagy> ilmenite: hsh.invert?
<WhereIsMySpoon> and i assume it's because in that regex you're assuming it's an array and it's getting confused
<bnagy> ohh you mean you want to use the hash to make replacements in a string
<ilmenite> yes
visof has quit [Ping timeout: 244 seconds]
<bnagy> replacements.each {|old, new| str.gsub old, new }
bawer has joined #ruby
<ilmenite> this is what i have http://paste2.org/p/2053447
bawerd has joined #ruby
<WhereIsMySpoon> it isnt an array
<WhereIsMySpoon> stop calling it arr :p
<ilmenite> alrght, then hash
<ilmenite> how do i get the replacement to work using a hash?
<bnagy> wow, that is the kind of paste site elton john would use
<WhereIsMySpoon> rofl
nipra has joined #ruby
<bnagy> ilmenite: I just told you ^^
<workmad3> bnagy: gsub!, not gsub
<workmad3> bnagy: otherwise your changes are thrown away each time
<bnagy> oh yeah
<ilmenite> true
<ilmenite> let me try that
<workmad3> bnagy: oh, you could do new_str = replacements.reduce(str){|str, (old, new)| str.gsub old, new}
fayimora has joined #ruby
<WhereIsMySpoon> workmad3: what is (old, new)
<bnagy> yeah, one of the few goo uses of inject
<workmad3> WhereIsMySpoon: necessary... :P
<WhereIsMySpoon> specifically what do the () do
<ilmenite> oh lovely? that works very well :) thanks bnagy :)
<bnagy> ilmenite: that modifies your ols str in place - workmad3's is better
<workmad3> WhereIsMySpoon: I call it destructuring... basically, what gets passed into the block is str, [old, new]... the () destructures the array
<WhereIsMySpoon> i dont even understand workmad3's
<bnagy> WhereIsMySpoon: the () decompose arrays into args. Normally there you'd get [k,v] from the hash
<workmad3> ^^ better explanation :)
<WhereIsMySpoon> what does reduce do
<bnagy> ri Enumerable#inject
<workmad3> WhereIsMySpoon: calls the block for each item in the array, passing in the result of the previous block
<ilmenite> im still confused about workmad3's way
<bnagy> it's not often the best choice now that 1.9 has each_with_object
<Hanmac> [1,2,3].reduce(+) #=> 1 + 2 + 3 #=> 6
<bnagy> but this is one example where it is
cantonic_ has joined #ruby
<workmad3> ilmenite: my way doesn't cause changes to the original string
<Hanmac> ups its: [1,2,3].reduce(:+) #=> 1 + 2 + 3 #=> 6
<ilmenite> oh, now i got it
<ilmenite> thanks :)
mohits has quit [Read error: Connection reset by peer]
<workmad3> bnagy: reduce is useful if you're writing map-reduce style algorithms, however most ruby programs don't do that... instead, reduce tends to be misused for things like converting arrays into hashes
cantonic has quit [Ping timeout: 265 seconds]
cantonic_ is now known as cantonic
<workmad3> bnagy: what I love is that an array of 2-item arrays, people love writing reduce methods, or each_with_object methods for when they could just do hsh = Hash[ary] :)
mohits has joined #ruby
<WhereIsMySpoon> haha
<WhereIsMySpoon> nice workmad3
<WhereIsMySpoon> :p
<WhereIsMySpoon> workmad3: in your solution, replacements = [ "hello", "test" ] and what is str?
<bnagy> so I just looked at ST2... gotta admit it is kind of pretty
<bnagy> but 20 years of vim finger memory is not happy about having to use the mouse that much :(
ephemerian has quit [Quit: Leaving.]
<workmad3> WhereIsMySpoon: on the first execution, it's the argument passed into .reduce, on each execution after that it's the result of the previous execution
<WhereIsMySpoon> haha
<workmad3> bnagy: I bet your wrists wouldn't be happy either
<WhereIsMySpoon> workmad3: what argument do you pass into reduce?
<bnagy> it just needs vi style edit mode
<workmad3> WhereIsMySpoon: whatever you want as the argument on the first execution
<WhereIsMySpoon> im so confused
<workmad3> WhereIsMySpoon: if you don't give an argument there, reduce will use the first item of the collection, which is how (1..10).reduce(&:+) works
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
<WhereIsMySpoon> workmad3: https://gist.github.com/2935767
<workmad3> WhereIsMySpoon: don't worry... map and reduce are more functional-programming concepts... map is used for repeating an operation across an entire collection, reduce is for taking a collection and reducing it to a single result
<workmad3> WhereIsMySpoon: yeah, so in that situation, the argument should be the string that you want the replacements done on
<bnagy> well map is pretty core to ruby, like if you don't get map you're gonna have a bad time
<workmad3> WhereIsMySpoon: and replacements should be {"hello" => "world"}
tatsuya_o has joined #ruby
<workmad3> WhereIsMySpoon: and in that situation, the reduce is repeatedly applying the gsub for each replacement, starting with an initial string
<WhereIsMySpoon> right so
snearch has joined #ruby
<workmad3> that's something... ilmenite: any reason you're not using String.tr ?
ilmenite has quit [Quit: log off]
ilmenite has joined #ruby
<WhereIsMySpoon> workmad3: so we take a hash of replacements, turn it into an array, then replace str with the other word in the array ?
<bnagy> workmad3: tr is for charsets
<workmad3> oh, ignore that, forgetting what tr is for
<workmad3> bnagy: yeah, brainderp moment :)
<workmad3> WhereIsMySpoon: no
<WhereIsMySpoon> D:
<workmad3> WhereIsMySpoon: we have a hash of replacements, each k-v pair in the hash is passed into the block (this happens to be as an array [key, value]) and we replace key with value
<workmad3> WhereIsMySpoon: the hash isn't 'turned into an array', just each pair is passed in
<WhereIsMySpoon> ohh
byronb has joined #ruby
byronb has quit [Excess Flood]
thecreators has joined #ruby
<WhereIsMySpoon> workmad3: i think i got confused cause i only made a one k-v long hash
<WhereIsMySpoon> :)
<workmad3> WhereIsMySpoon: and the reduce then does that repeatedly for each pair, applying the substitution to the string generated by the last substitution
zinjacoder has joined #ruby
<WhereIsMySpoon> workmad3: thats quite subtle
<bnagy> WhereIsMySpoon: Enumerable. Read it. Memorize every method.
<WhereIsMySpoon> it looks very ruby, but is a little difficult to actually understand
cjs has quit [Ping timeout: 245 seconds]
<WhereIsMySpoon> bnagy: D:
<workmad3> WhereIsMySpoon: it's very easy to understand once you've groked reduce :)
<WhereIsMySpoon> true :)
<WhereIsMySpoon> anyhoo
rippa has quit [Ping timeout: 244 seconds]
<WhereIsMySpoon> lunchtime
<bnagy> print out the rdoc for Enumerable and take it with you
<WhereIsMySpoon> to bed?
<WhereIsMySpoon> :p
ringotwo has quit [Read error: Connection reset by peer]
<bnagy> you can be like 'yo, with my subway toppings, group_by colour, and I want mayo on each_slice, botch'
ringotwo has joined #ruby
<bnagy> which is funny because botch is what I did to that line
* bnagy gets his coat
<Hanmac> workmad3 ... so th there is a hash like {"hello" => "world"} and an string like "123hello456" wich should be changed to "123world456" right?
<workmad3> Hanmac: yup
federic has joined #ruby
<bnagy> Hanmac overengineered with_object solution mode: ENGAGE
malkomalko has joined #ruby
<Hanmac> replacements.each_with_object(string){|(k,v),s|s.gsub!(k,v)}
* bnagy WINS!
<banisterfiend> is this too unstable?
<bnagy> actually that's not really overengineered
<banisterfiend> class MyOpenStruct < OpenStruct; def initialize(*) super; @table = Hash.new { |h, k| h[k] = {} }; end ;end
<Hanmac> bnagy: replacements.each(&string.method(:gsub!))
<bnagy> banisterfiend: I would DelegateCLass
ephemerian has joined #ruby
prtksxna_ has quit [Remote host closed the connection]
<banisterfiend> bnagy: interesting, i've never used that API before
marcin has joined #ruby
<marcin> hi, I have problem with ruby here doc usage. Every time i want to use it I'm getting syntax error. I'm new to programming so please don't kill me :-)
BiHi has quit [Quit: Computer has gone to sleep]
djdb has quit [Remote host closed the connection]
<Hanmac> bnagy my last line does not work as i wanted ... so i think the shortest way is "replacements.each_with_object(string){|(k,v),s|s.gsub!(k,v)}"
apeiros_ has joined #ruby
tvw has quit [Remote host closed the connection]
<vectorshelve> shevy: mate after thinking quite a lot got an interesting idea on building a gem.. for stock prices of companies in market and commodities :)
liluo has quit [Remote host closed the connection]
<marcin> <bnagy> this is my problem http://pastebin.com/qLDc9ZRS
djdb has joined #ruby
noodletraveler has quit [Quit: leaving]
<bnagy> marcin: that code works fine for me?
<shevy> vectorshelve pfffft.
<marcin> then i don't have any idea why I'm having this problem :/
<shevy> goldman sucks will appreciate it vectorshelve ;)
<bnagy> marcin: did you try turning it off and on again?
<marcin> :-) ocfourse
<bnagy> is that the entire contents of the ruby file?
<marcin> yes it is
<bnagy> are you lying to me?
Croms has joined #ruby
<banisterfiend> would i lie to u baby would i lie to u, ohh baby
<marcin> nope, I tried new document just with it inside and still
<bnagy> is this another case of running ruby 1.6.8-8?
binaryplease has joined #ruby
<bnagy> ok, so to summarize, you put exactly those 3 lines into a file called 5.rb, then you type ruby 5.rb and you get a syntax error, yes?
<marcin> yes
<marcin> exacly
<bnagy> ok the universe is broken
<bnagy> what's your ruby -v and OS ?
<marcin> 1.9.3 win vista 32
Progster has quit [Ping timeout: 260 seconds]
<bnagy> hahah vista lol
<marcin> its company PC ... t.t
Facefox has quit [Ping timeout: 250 seconds]
jbw_ has quit [Ping timeout: 265 seconds]
<Tasser> marcin, virtualbox ftw
nipra has quit [Read error: Connection reset by peer]
<Tasser> marcin, http://vagrantup.com/
<marcin> ok, I'll try this
<bnagy> works for me on win7, which is the clsest windows I have to hand
<bnagy> sorry, I need to go and play pool and drink beer
<bnagy> good luck!
<marcin> thanks!
stummi has joined #ruby
<stummi> hi, can i start the ruby-cli tool in somewhat like an interactive mode like python?
<ilmenite> stummi, irb is what your looking for
krusty_ar has joined #ruby
<stummi> ilmenite, ah, yes. thanks :)
<Tasser> stummi, or pry
zz_chrismcg is now known as chrismcg
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
<banisterfiend> ilmenite: you're*
<ilmenite> ?
<banisterfiend> ilmenite: you're* looking for
<banisterfiend> not 'your looking for' :)
ephemerian has quit [Quit: Leaving.]
<ilmenite> oh yes, ive got to read more books
Facefox has joined #ruby
Dreamer3__ has quit [Quit: Leaving...]
Dreamer3 has joined #ruby
frishi has joined #ruby
jbw_ has joined #ruby
roams has joined #ruby
stummi has left #ruby ["Verlassend"]
lolmaus has quit []
krusty_ar has quit [Ping timeout: 246 seconds]
banghouse has quit [Remote host closed the connection]
n1x has joined #ruby
qowaz has joined #ruby
mdw_ has quit [Remote host closed the connection]
<vectorshelve> shevy: u wont ? :D
n1x has left #ruby [#ruby]
mengu has joined #ruby
jimeh has quit [Quit: bye]
iocor has quit [Quit: Computer has gone to sleep.]
railrubix has quit []
jonathanwallace has joined #ruby
mdw has joined #ruby
<shevy> vectorshelve if I'd had a need for it sure. but I don't :P right now I am writing on a small game, which I'll eventually convert into something gamebox-ready
workmad3 has quit [Ping timeout: 252 seconds]
dhruvasagar has quit [Ping timeout: 252 seconds]
Jackneill has joined #ruby
<dekroning> i'm currently in irb/pry and I would like to remove a class, e.g. class Foo; end I want to remove the Foo class so I can't do Foo.new anymore
Facefox has quit [Ping timeout: 244 seconds]
<banisterfiend> dekroning: Foo = nil
dhruvasagar has joined #ruby
<banisterfiend> is the easy way
<Tasser> dekroning, remove_const Foo
<banisterfiend> u can do some BS with const_remove or whatever, but u dont need to
<Tasser> ehh :Foo
<Hanmac> banstisterfiend: yours can cause a warning
workmad3 has joined #ruby
<banisterfiend> Hanmac: he's just doing it in pry/irb, it doesnt matter
nipra has joined #ruby
<apeiros_> ObjectSpace.reset! # would be fun…
<banisterfiend> also iirc remove_const is private
<banisterfiend> so it's annoying to use
<dekroning> thanks
<apeiros_> yes, remove_const needs send
<dekroning> i'm getting 'undefined method remove_const'
jimeh has joined #ruby
Facefox has joined #ruby
<apeiros_> yer doin it wrooong
Facefox has quit [Max SendQ exceeded]
<apeiros_> Object.send :remove_const, :Foo
K0rnflake has quit [Ping timeout: 248 seconds]
<apeiros_> you have to send it to the containing module/class
matled has quit [Read error: Operation timed out]
<shevy> Object.instance_eval { remove_const :Foo }
<shevy> nah... I hate eval
<shevy> .send is better
mdw has quit [Remote host closed the connection]
<vectorshelve> shevy: u use rubymotion for apps ?
Facefox has joined #ruby
<shevy> no, that is mobile only isnt it
Facefox has quit [Max SendQ exceeded]
<shevy> my mobile can do only one thing
<shevy> anything more than that, is a bug for me :)
freeayu has quit [Quit: 离开]
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
<shevy> vectorshelve I am trying something new right now...
<shevy> every project needs a logo
<vectorshelve> shevy: like what ? share the code.. I had love to contribute :)
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
<shevy> well, I am lazy with git
<shevy> one day I need to write a wrapper to do all the commands for me
Axsuul has quit [Ping timeout: 252 seconds]
<shevy> rgit upload project1
<shevy> rgit upload project515
<shevy> :P
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
umttumt has quit [Remote host closed the connection]
<shevy> in fact... I am going to start writing that right now
<workmad3> shevy: bash aliases and functions! :)
Facefox has joined #ruby
dbck has quit [Quit: Bye!]
Guedes has joined #ruby
<shevy> aliases yeah
<shevy> but I hate bash functions :(
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<shevy> I have 16972 aliases right now
<workmad3> haha
<shevy> but 90% of these are useless
flip_digits has joined #ruby
<shevy> well, once rgit is finished I have no more excuse to not use git
zomgbie_ has quit [Ping timeout: 265 seconds]
<workmad3> you didn't know about the ruby git libraries? :)
<workmad3> how about fugitive in vim?
<shevy> fugitive?
<workmad3> fugitive.vim, a plugin for doing git stuff
<shevy> hmm no, never heard of that so far
<shevy> ohhh
<shevy> that one seems to be still active: https://github.com/libgit2/rugged
`brendan has joined #ruby
bosphorus has joined #ruby
geekbri has joined #ruby
fbernier has joined #ruby
twinturbo has joined #ruby
ilmenite has quit [Ping timeout: 246 seconds]
punkrawkR has joined #ruby
selvakumaran_ has quit [Ping timeout: 246 seconds]
zii has quit [Read error: Connection reset by peer]
<Ethan> o.o
<Ethan> HARRO RUBIANS!
<Ethan> rubyists? rubians? same difference.
marcin has quit [Quit: Page closed]
<apeiros_> different sameness
<Ethan> I should seriously work on my Ruby
<Ethan> I haven't coded in over two months.
djdb has quit [Remote host closed the connection]
umttumt has joined #ruby
Kn|t3 has quit [Quit: Kn|t3]
krusty_ar has joined #ruby
Kn|t3 has joined #ruby
<Xethron> Ok, I have a really stupid question
djdb has joined #ruby
Progster has joined #ruby
<Xethron> I installed ruby a while back. And now my system crashed. Installed Fedora 16 again, but cant seem to get ruby up and running again....
red-panda has joined #ruby
dhruvasagar has quit [Ping timeout: 244 seconds]
<JonnieCache> Xethron: how are you going about installing it?
<Xethron> After quite some time I got the basics there. But when I run the ruby script, it gives an error now, which it never did before... "/home/xethron/nanobot/config.rb:16: warning: found = in conditional, should be =="
<JonnieCache> thats a warning not an error
mdw has joined #ruby
<Xethron> also: Cannot load bcrypt library. Make sure the bcrypt-ruby gem is installed.
<JonnieCache> its probably because youre using a newer ruby that includes that warning
<JonnieCache> it says youre doing an assignment in a conditional, which is likely a mistake
ephemerian has joined #ruby
<Xethron> JonnieCache, ah, ok
<JonnieCache> the second one is kinda self explanatory, no?
Konboi has quit [Remote host closed the connection]
<Xethron> JonnieCache, yes, but how do I get it on there?
<JonnieCache> gem install bcrypt-ruby
<Xethron> ah
<JonnieCache> or, if youre using bundler, add it to the Gemfile
<Xethron> I tried installing it with yum :/
<Ethan> don't use your OS's package manager to install gems
<Ethan> they're usually out of date
flype has joined #ruby
<JonnieCache> ruby and OS package managers in general often dont get on
ilmenite has joined #ruby
<Xethron> ah, ok
<ilmenite> is https://github.com/libgit2/rugged good? for normal git operations?
umttumt has quit [Remote host closed the connection]
selvakumaran_ has joined #ruby
FND has joined #ruby
matled has joined #ruby
<Xethron> JonnieCache, what is the correct way to install ruby on Fedora?
<ilmenite> yum install ruby
<Xethron> but that one is out of date
umttumt has joined #ruby
<JonnieCache> rvm or rbenv
<JonnieCache> rbenv is simpler, rvm is more full featured and automatic
<FND> is there a way to auto-serialize in-memory objects so they can be loaded into a different session? like Python's pickle, effectively
<JonnieCache> i prefer the latter but many disagree
<Xethron> JonnieCache, I used rvm last time, but I couldn't get it to work this time!
simao_ has joined #ruby
simao_ has quit [Client Quit]
<apeiros_> FND: looking for Marshal or YAML?
selvakumaran_ has quit [Ping timeout: 265 seconds]
<FND> apeiros_: I just realized I can use JSON because, luckily, it's all arrays and hashes - but that wouldn't work if it was arbitrary objects
<FND> oh, apeiros_, Marhsal seems to be just what I was looking for - thanks!
frishi has quit [Quit: Leaving...]
<FND> ... or not: TypeError: no _dump_data is defined for class Mysql2::Result
simao has quit [Quit: leaving]
heftig has quit [Quit: leaving]
<apeiros_> o0
<apeiros_> rare that an object is not marshallable. I'd file that as a bug with the mysql gem.
<apeiros_> unless it has an IO or contains a proc, it should be marshallable.
jimeh has quit [Ping timeout: 240 seconds]
liluo has joined #ruby
bawerd has quit [Quit: Leaving]
bawer has quit [Quit: Leaving]
blacktulip has joined #ruby
umttumt has quit [Remote host closed the connection]
blacktulip has quit [Remote host closed the connection]
yugui_zzz is now known as yugui
<FND> d
K0rnflake has joined #ruby
vectorshelve has quit [Quit: Page closed]
dhruvasagar has joined #ruby
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<JonnieCache> OMG THEY LET SUN RA MAKE A MOVIE!
gyre007 has quit [Quit: Ex-Chat]
<JonnieCache> time to break out the sampler...
zommi has joined #ruby
tommyvyo has joined #ruby
ruby_on_tails has joined #ruby
<ruby_on_tails> helo
wangr has joined #ruby
k1ng has joined #ruby
k1ng has left #ruby ["Leaving"]
iori has quit [Ping timeout: 244 seconds]
umttumt has joined #ruby
zomgbie has joined #ruby
twinturbo has quit [Quit: twinturbo]
yugui is now known as yugui_zzz
ruby_on_tails has left #ruby [#ruby]
yugui_zzz is now known as yugui
ananthakumaran1 has quit [Quit: Leaving.]
zomgbie has quit [Ping timeout: 245 seconds]
simao_ has joined #ruby
fmcgeough has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
RoUS has quit [Remote host closed the connection]
Vert has quit [Read error: Connection reset by peer]
simao_ is now known as simao
`brendan has quit [Ping timeout: 244 seconds]
`brendan has joined #ruby
BiHi has joined #ruby
IrishGringo has joined #ruby
nilg` has quit [Remote host closed the connection]
chson has quit [Remote host closed the connection]
williamherry has quit [Remote host closed the connection]
Cork has joined #ruby
Guedes has quit [Read error: Connection reset by peer]
<Cork> is it possible to extend so you can use else in a proc function?
<Cork> myfunc { do this } else { do this }
yugui is now known as yugui_zzz
cek has joined #ruby
carloslopes has joined #ruby
<cek> hi. solve a mistery: self.ass = 123 ArgumentError: wrong number of arguments (1 for 2)
jrist-afk is now known as jrist
<cek> how do you pass that 2 args?
ilmenite has quit [Ping timeout: 246 seconds]
vitoravelino`afk is now known as vitoravelino
pu22l3r has joined #ruby
<apeiros_> Cork: what is it supposed to do?
ilmenite has joined #ruby
<apeiros_> cek: read the backtrace.
<Cork> apeiros_: its a function that does some calculations based on the arguments, and if the data it looks up matches it calls the proc
<Cork> apeiros_: i would like to be able to have an expressive if it doesn't match
koskoz has joined #ruby
<Cork> i know i can pass two procs, but that looks a bit unintuitive when you see the code
<cek> seems like impossible task to me when assignment arity is 2
<apeiros_> Cork: you could do: my_func match: -> { do this }, no_match: -> { do that }
<apeiros_> cek: read the backtrace.
<cek> apeiros_, so what?
<apeiros_> you didn't. or failed to.
<Cork> apeiros_: true, does that mean it can't be done?
<cek> ignore
<apeiros_> cek: *shrug*
<apeiros_> Cork: not with the syntax you suggest
<Cork> ok, thx
<apeiros_> you could try to define .else on Proc. but that's ugly and there's a good possibility that it's not carried over with &block
FND has left #ruby [#ruby]
* Cork nods
<Cork> was afraid of that, but though i should at least ask before throwing away the idea :)
<apeiros_> cek: btw., once again you utterly fail to properly ask a question.
Kn|t3 has quit [Quit: Kn|t3]
iocor has joined #ruby
<apeiros_> "hey, stuff no worky! solve me!"
nilg has quit [Remote host closed the connection]
<WhereIsMySpoon> apeiros_: lol :p
Kn|t3 has joined #ruby
<Cork> WhereIsMySpoon: just got to say, lovely nice :D
<Cork> *nick
<apeiros_> it's somewhat sad too, because always remember - there is no spoon…
<Cork> :)
<apeiros_> it's impressive how fast flash burns the battery…
<apeiros_> it's like *nom,nom,nom*
passbe has quit [Ping timeout: 252 seconds]
hynkle has joined #ruby
<axiak> cek: self.ass=(123, 456)
red-panda has quit [Remote host closed the connection]
<cek> axiak, hehe, here you go: self.ass=(123, 456) SyntaxError: compile error (irb):99: syntax error, unexpected ',', expecting ')'
<WhereIsMySpoon> apeiros_: thats why apple doesn't allow it on their devices mostly :)
<axiak> oh well :P
<apeiros_> WhereIsMySpoon: while I don't like the way, I do love the result - so much more power efficient videos on the web now.
<WhereIsMySpoon> yea
<apeiros_> axiak: the only way to call a foo= method with more than 1 arg is by using send
<apeiros_> (with the sole exception being []=)
crankycoder has joined #ruby
<axiak> makes sense
<apeiros_> WhereIsMySpoon: but I'm fascinated by adobes complete failure to provide more efficient ways to stream videos
<WhereIsMySpoon> apeiros_: it is a bit odd
eurbach has joined #ruby
<WhereIsMySpoon> apeiros_: i can see adobe fading into obscurity in the next 5 years or so
<apeiros_> WhereIsMySpoon: but adobe failed at so much things the last few years, it's amazing. my latest gripe: "Check for updates" in the flash player means "hey, there I open a browser window where you can compare a couple of numbers and then go to the downloads page!"
<WhereIsMySpoon> or maybe 5-10
<WhereIsMySpoon> adobe reader sucks
<WhereIsMySpoon> flash will be replaced by html5
<apeiros_> they still got their complete creative suite
<apeiros_> indesign, illustrator & ps are still big.
<WhereIsMySpoon> photoshop is good i guess
<WhereIsMySpoon> and aftereffects
<apeiros_> right.
<WhereIsMySpoon> but theyre targeted towards a much smaller market than flash is
<apeiros_> they do make more money with it.
tk___ has joined #ruby
<WhereIsMySpoon> mm
<apeiros_> flash doesn't make them money, it costs. it's a way to sell their productive tools. and they're currently working on html5 productive tools.
<apeiros_> at least they've got that one right
<WhereIsMySpoon> thats amusing
<WhereIsMySpoon> instead of fixing flash
<WhereIsMySpoon> theyre just dumping it
<apeiros_> they should open it up
<WhereIsMySpoon> :p
yugui_zzz is now known as yugui
<WhereIsMySpoon> deffo
<WhereIsMySpoon> wait no
<WhereIsMySpoon> i dont want to die
<WhereIsMySpoon> of horrible codes
<WhereIsMySpoon> D:
<apeiros_> developing flash isn't their selling point
<WhereIsMySpoon> no but its prolly what they're most well known for
<WhereIsMySpoon> at least imo
<cek> okay, anyone else want to try?
<apeiros_> iirc they wanted to do that at one point in time… wonder what went wrong. fear probably.
<WhereIsMySpoon> cek: ?
<apeiros_> cek: read the backtrace.
shevy has quit [Ping timeout: 265 seconds]
pk1001100011 has quit [Quit: Burn your gods and kill the king; Subjugate your suffering; Dead heart, in a dead world]
<cek> looks like a parser bug to me allowing to specify multiple args for a "setter" method
<apeiros_> lol, yeah, sure.
snearch has quit [Quit: Verlassend]
<cek> like *args in yielded block budy you know
<cek> body
<apeiros_> yielding *args works fine.
dv310p3r has joined #ruby
<apeiros_> oh wow, cek *really* failed to ask the question…
<apeiros_> what he said: 15:02 cek: hi. solve a mistery: self.ass = 123 ArgumentError: wrong number of arguments (1 for 2)
<apeiros_> what he wanted to say: self.ass = 123, 234 (or whatever 2nd arg)
<apeiros_> lol
<apeiros_> well, what did I expect…
<apeiros_> and if he'd read he'd even gotten his answer… (15:16 apeiros_: axiak: the only way to call a foo= method with more than 1 arg is by using send)
uris has joined #ruby
erichmenge has joined #ruby
Markvilla has quit [Quit: Markvilla]
<apeiros_> and for the fellow reader - not a parser bug either. allowing more than 1 arg would break parallel assignment.
Markvilla has joined #ruby
shevy has joined #ruby
vlad_starkov has joined #ruby
tcopp has joined #ruby
<deryl> :)
<apeiros_> hi deryl
<apeiros_> how's rvm 2 coming along?
<deryl> hi apeiros_ - seems to be ok. thats mpapis's puppy
<apeiros_> ah, you're more involved with docs & support?
kaiwren has quit [Quit: kaiwren]
<deryl> the internal dependence on zsh (static version) for rvm2 is taking it a direction i don't want to be involved in, so i'm not working on rvm2 at all. and yes, right now i'm more docs and support.
nipra has quit [Ping timeout: 244 seconds]
<apeiros_> hu? rvm 2 will depend on zsh? I don't think I even have that installed. how came that choice to be?
carlyle has joined #ruby
<deryl> :shrug: he wants to take shell scripting 'to the next level' and rvm2 will be using SMF (sm.beginrescueend.com) internally
Markvilla has quit [Client Quit]
Markvilla has joined #ruby
crankyco_ has joined #ruby
<apeiros_> bdsm is wayne's baby, no?
<deryl> and he feels that using zsh will allow for that. *I* think it abandons the bash crowd AND goes with something non-standard which can pretty much be expected everywhere (namely bash) even under windows bash is king (cygwin). and zsh doens't support all bashims.
<deryl> yeah
<deryl> yeah. bdsm is now SMF and is wayne's baby
<deryl> rvm2 will be using it internally to make rvm2 modular. but a forcing of a dep to a specific shell.. not happy with that at all.
Jake232 has joined #ruby
<cek> will it include a towel service?
crankycoder has quit [Ping timeout: 240 seconds]
<deryl> even if its internal to rvm itself (as in for its coming command modules). plus with static, think of those of us with say 10 or 15 terminals open and running different commands in each. you just ballooned memory requirements.
<deryl> but hey thats me. i don't want to trash rvm in any way. I like what they're going to do, I just don't like the implementation idea.
<apeiros_> deryl: hm… yeah, I'm not so sure that depending on zsh is a good idea…
<deryl> would that be an ideology or a methodology?
<apeiros_> well, lets see how it pans out
<deryl> i mean i totally get the modular design, and i;m all for that.. just reliance on zsh underneath (or even bash interally as a static i'd disagree) .. definitely not happy with that
<apeiros_> deryl: yeah, I think similarly.
<deryl> so as you say, we shall see
bglusman has joined #ruby
<deryl> but rvm1 is going to pretty much stay as it is except for doc refinements and code fixes. rvm1 will still be valid for quite some time
<deryl> *some* features from rvm2 might get backported, but i envision very few
<apeiros_> in the worst case, there's also rbenv
denysonique has quit []
<deryl> you know, i have no problem with rbenv as a tool. it does what it does.
<apeiros_> well, ruby-build + rbenv
<deryl> my problem is sstephenson himself.
deevilius has joined #ruby
<apeiros_> I haven't used rbenv nor ruby-build, so I can't say anything about it. I just know there's a plan B in case rvm ceases to be a valid option for me.
<apeiros_> what's the trouble with sstephenson? Did I miss some good drama?
<deryl> I will NOT use a fucking thing that asshole makes, nor will I support his users, nor will I be kind to the assholes that use his tools that then decide to trash RVM (and usually just regurgitate sstephenson's bullshit FUD)
yugui is now known as yugui_zzz
<deryl> so its a personal thing, nothing to do with his projects objectively, its him i refuse
<apeiros_> ^^
<banisterfiend> deryl: what did he do to piss u off so much
<deryl> apeiros_: he released rbenv in the first place with utter bullshit about RVM, trashed RVM in order to get publicity, and not a single solitary time asked for details about anything to include his 'rvm executes dangerous and arbitrary code' commentary
denysonique has joined #ruby
centipedefarmer has joined #ruby
arturaz has quit [Remote host closed the connection]
bglusman has quit [Ping timeout: 244 seconds]
arturaz has joined #ruby
Kn|t3 has quit [Quit: Kn|t3]
<cek> have no idea what you're talking about. i was researching about rvm alternatives long time ago. rbenv is the first project that pops up in search
<deryl> half truths about rvm internal operations, innuendos, and then we get the flood of regurgitators to the point we (mpapis, wayne, and I) all had to post commentaries in Issues, in blog posts, etc etc combatting his bullshit. At least its dying off now, people are seeing for themselves it was bullshit, so I'm glad for that. however as a human being, I choose not to use a friggin thing that jackass puts out. I'll find another way to do something if I have
<deryl> to.
maesbn has quit [Remote host closed the connection]
deevilius has left #ruby [#ruby]
Kn|t3 has joined #ruby
Konboi has joined #ruby
<deryl> cek thats fine. talk to wayne himself. trashed wayne and his project from release, etc etc. dont' take MY word for it, go ask wayneeseguin directly. hope you got some time
v0n has joined #ruby
<deryl> ask mpapis as well.
ananthakumaran has joined #ruby
<deryl> but anyways, i didn't mean for it to expand to something this big in here.
<deryl> dropping it
albemuth has joined #ruby
<apeiros_> deryl: I asked for it
<cek> why would I ask someone? i'm fine with rvm branch we find stable and no intention of moving yet
<apeiros_> deryl: so no need to feel bad about telling your thoughts :)
<apeiros_> *so you shouldn't feel bad about…
PragCypher has joined #ruby
<deryl> apeiros_: yeah i know, but i display my temper enough as it is in here and other related channels.
yugui_zzz is now known as yugui
<deryl> firey is an understatement at times ;)
<cek> deryl, well don't pay attention to trolls
<deryl> cek yeah i do have that problem at times.
<cek> just put them in ignore and you'll see the world changing to brighter place
<deryl> hehe
<deryl> you're a bit more laid back than i am. i'm still figuring out how to be. not my.. forte ;)
<apeiros_> deryl: it's easy to say things in the aftermath, but still: I think you should have taken control of the fight by putting up a refutal site, which you should have linked to wherever somebody badmouthed rvm.
charliesome has quit [Read error: Connection reset by peer]
chson has joined #ruby
<deryl> apeiros_: we did. http://niczsoft.com/2011/11/what-you-should-know-about-rbenv-and-rvm/ or more accurately mpapis did and we collaborated on documenting the differences
xaq has joined #ruby
<apeiros_> good :)
<deryl> our bigger problem was the rbenv crowd bringing to the #rvm *channel* - daily combat against the FUD became needed because well, its our home channel.
<apeiros_> banhammer
<apeiros_> either they can put up a constructive dialogue or they can stay the f* out
<cek> deryl, setup a bot that would devoice users using "rbenv" word
<deryl> then you get the reputation of banning just because someone disagrees with you. so you almosthave to explain things real time lest other users lurk and be misinformed as well
<deryl> cek naa, i don't have a problem with rbenv perse as a *project*
<cek> deryl, well, it's like saying "fuck" in children channel.
<deryl> its some of the user base and the creator. and rbenv does come up validly in conversations relating to rvm. like i do this in rbenv how do i do it in rvm'
<apeiros_> deryl: no, it's legitimate to ban topics from a dedicated channel
mdw has quit [Remote host closed the connection]
<apeiros_> compare how we pretty much ban rails as a topic in here too
<cek> well, you devoice for 10 minutes, send a CTCP or how is it called message to the user explaining the problem.
<deryl> in fact, a funny thing for me (i guess a getting even type funny) is that after we did all the documenting of the difference and combatted on blogs and stuff, we had quite a few leave rbenv and start using rvm.
<deryl> s
<deryl> o i guess it worked out for us in the long run to some degree
jimeh has joined #ruby
<apeiros_> you can always set up an #rvm_vs_rbenv channel and do the bot thing cek said with a twist
<deryl> hahah
<deryl> i love you guys, chock full of ideas! muahaha
<deryl> you're almost as evil as i am hehe
<apeiros_> i.e., tell the user that rbenv is not discussed in #rvm, they should go to #rvm_vs_rbenv for that instead and remention will mean a ban.
rippa has joined #ruby
<cek> this way, you protect your users and yourself from discussing the sensitive matter, you know
yugui is now known as yugui_zzz
koskoz has quit [Ping timeout: 265 seconds]
hemanth has quit [Read error: Connection reset by peer]
<deryl> yeah, i had to walk away for about 3 weeks because I was getting a bit depressed and overly angry because it seemed i spent more time combatting than helping. was affecting my psyche
<apeiros_> after all, #rvm is for people to get help with rvm, not to discuss why tool X is supposedly better.
<deryl> wayne's too.
<deryl> he was PISSED!
hemanth has joined #ruby
<apeiros_> or how do you think it'd end when python users came in here going all wild about how python is better?
<apeiros_> it'd be instaban
<deryl> true
sailias has joined #ruby
PragCypher has quit [Quit: Leaving]
<deryl> wayne isn't a big ban guy even if you're expressing a contrary opinion, but then again he's FAR more laid back and nicer than I am. So, because its his project and his channel, i follow his lead most of the time.
<apeiros_> I'm open to constructive dialogue. but the moment it becomes harrassement, the focus is on protecting the channel
<deryl> i may be a dev on the project, but he's still the creator
<deryl> yeah
AxonetBE has quit [Ping timeout: 244 seconds]
yugui_zzz is now known as yugui
<deryl> i hear you, and i agree with you
afallows has joined #ruby
<deryl> should never have been needed int he first place. think that pisses me off most of all. there's MORE than enough room in this space for 2 projects like this, hell you could have 4 and still not be crowded.
AxonetBE has joined #ruby
<deryl> there's more than one way to skin a cat, that does *not* include trashing other projects *just* to get publicity for your's
ilmenite has quit [Ping timeout: 246 seconds]
<apeiros_> deryl: I think there's a vast difference between raising concerns and state why your solution is better, vs. just trash a project.
<deryl> totally agree with that. all of us would have been fine with #1. sstephenson decided to go route #2
<deryl> it *should* have been a debate between the two projects (hell think of how good a 3rd project built by both teams *together* with ideas from *both* would be!)
<WhereIsMySpoon> im pretty sure if anyone did that for a project i worked extremely hard on i'd be instabanning people talking shit about it
<WhereIsMySpoon> ^^
PaciFisT has joined #ruby
nanderoo has joined #ruby
mdw has joined #ruby
fantazo has joined #ruby
Boohbah has quit [Remote host closed the connection]
<deryl> WhereIsMySpoon: well where he was right, we agreed. If you're right, you're right. Its the FUD put into user's minds. Come on not everyone dumpster dives code to find out truth. the vast majority take whatever they hear as gospel especially where there is no response from the opposite side (which we even tried doing for awhile. no response, it will blow over, it just never did until we spoke up)
ken_barber has joined #ruby
Boohbah has joined #ruby
<deryl> and while I am a big proponent of just ban the loudmouths, wayne isn't and its his channel. so refute refute refute
<WhereIsMySpoon> :p
Doc_X has joined #ruby
ramblex has joined #ruby
<deryl> anyways, more coffee and a cig
cj3kim has joined #ruby
<WhereIsMySpoon> gotta get along with others in your project :)
<deryl> especially the creator of it.
<WhereIsMySpoon> yea :p
Doc_X1 has joined #ruby
Doc_X has quit [Quit: AFK for a while]
Doc_X1 is now known as Doc_X
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
joshman_ has joined #ruby
sbanwart has joined #ruby
jeff_sebring has joined #ruby
iocor has quit [Quit: Computer has gone to sleep.]
<workmad3> banning vocal people makes others think that you're trying to keep them quiet because you're hiding the truth
binaryplease has quit [Quit: WeeChat 0.3.8]
<apeiros_> workmad3: not if you can reference a point where the discussion can be held
heftig has joined #ruby
<apeiros_> it's simple, "#rvm is the wrong place, the discussion is in #xyz, no truth hidden".
<dekroning> I just wrote my first minitest/spec file, but i'm wondering how to run the test suite now :-) anyone have an idea ?
<apeiros_> you can't prevent people from being stupid, though.
<workmad3> dekroning: easiest way - also pull in 'minitest/autorun' and then 'ruby path/to/spec'
<dekroning> workmad3: ah, that's where the autorun is for, I thought that was for something like guard
<workmad3> no, it lets you run the tests just by running the file :)
internet_user has joined #ruby
<dekroning> workmad3: awesome, thanks a lot
<workmad3> dekroning: I'm not sure how you can run groups of files though... I've never used minitest
<dekroning> workmad3: well this is already great help for me, atleast I can start per spec now ;-)
<workmad3> :)
pk1001100011 has joined #ruby
umttumt has quit [Remote host closed the connection]
<deryl> workmad3: exactly with regards to your vocal people comment
jeff_sebring has quit [Remote host closed the connection]
jeff_sebring has joined #ruby
tolland has joined #ruby
<tolland> hi newbie here
<tolland> is there an equivalent of "bash -vx" when executing a ruby script?
jeff_sebring has quit [Remote host closed the connection]
<apeiros_> tolland: what does it do?
robdodson has joined #ruby
mayankkohaley has quit [Ping timeout: 244 seconds]
<tolland> print each line from code, and then print the eval'ed code
<tolland> inline
<WhereIsMySpoon> ruby has -v same as bash
<WhereIsMySpoon> dunno about -x
<apeiros_> tolland: no. but there's irb
<apeiros_> (and pry)
<apeiros_> where you can execute code interactively and see the returned values
Targen has joined #ruby
qowaz has quit [Ping timeout: 244 seconds]
akemrir has joined #ruby
Synthead has joined #ruby
<tolland> im trying to see what is causing an error in a ruby script that runs under ruby_noexec_wrapper
<tolland> ah
<tolland> i see swapping out ruby for irb in the hash bang line is helping... not sure if thats the recommended way... ;-)
<apeiros_> try pry with binding.pry or irb + irb_drop with binding.irb_drop
<apeiros_> uh, not really :)
<WhereIsMySpoon> o.
<WhereIsMySpoon> o.o
<apeiros_> IRB is a repl, not a ruby replacement
<WhereIsMySpoon> no, it isnt xD
<WhereIsMySpoon> apeiros_: maybe we should all switch to using irb as our env, he might be onto something
<WhereIsMySpoon> :p
Facefox has quit [Ping timeout: 248 seconds]
<apeiros_> -.-
<WhereIsMySpoon> xD
mayankkohaley has joined #ruby
theRoUS has joined #ruby
hunglin has joined #ruby
mrbrdo has quit [Quit: mrbrdo]
<tolland> i like jruby, worst comes to worstest, I can see whats happening with the java debugger ;-)
<Muz> sounds like it really has to come to the "worstest" to consider that a suitable solution.
oooPaul has joined #ruby
<WhereIsMySpoon> ^
digitalcakestudi has joined #ruby
linoj has joined #ruby
CheeToS has joined #ruby
crankyco_ has quit [Ping timeout: 265 seconds]
kevinbond has joined #ruby
iocor has joined #ruby
<tolland> export RUBYOPT="iv"
Facefox has joined #ruby
noganex has joined #ruby
<deryl> does anyone know the direct URL to the using Rails parts without Rails video talk?
<tolland> oops
<deryl> was done at one of the confs. i seem blind cause i cant find it on confreaks
<tolland> export RUBYOPT="-v"
<deryl> supposedly about how to use the different parts that rails pulls in, without having to use rails, and doing so in PORAs
mdw_ has joined #ruby
<deryl> ahh found it. http://confreaks.com/videos/897
webusnix has joined #ruby
bigfatfrock has joined #ruby
crankyco_ has joined #ruby
bglusman has joined #ruby
simao has quit [Quit: Lost terminal]
dv310p3r has quit [Quit: Leaving]
mdw has quit [Ping timeout: 265 seconds]
iocor has quit [Quit: Computer has gone to sleep.]
Jake232 has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 265 seconds]
apeiros_ is now known as apeiros
apeiros is now known as apeiros__
DrForr has quit [Quit: leaving]
apeiros__ is now known as shisohan
shisohan is now known as apeiros
hydrozen has joined #ruby
apeiros has left #ruby [#ruby]
vlad_starkov has quit [Remote host closed the connection]
albemuth has quit [Quit: Computer has gone to sleep.]
ipoval has joined #ruby
apeiros_ has joined #ruby
<WhereIsMySpoon> is there a thing like `find' in bash?
<WhereIsMySpoon> for ruby
fbernier has quit [Ping timeout: 265 seconds]
<WhereIsMySpoon> like i give a filename and it goes off and finds a folder/file by that name
liluo has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
<oz> WhereIsMySpoon: first result for "ruby file find" on google
andrewhl has joined #ruby
<WhereIsMySpoon> oz: bah, was looking for 'find bash for ruby'
<oz> ah ah :)
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<davidcelis> `find`
heftig has quit [Quit: leaving]
mohits has quit [Read error: Connection reset by peer]
lkba has joined #ruby
<WhereIsMySpoon> davidcelis: `find'
<WhereIsMySpoon> it's written like that, not with two backticks
mohits has joined #ruby
<WhereIsMySpoon> you dont execute it like that
mohits has quit [Changing host]
mohits has joined #ruby
Sheehan has joined #ruby
<lectrick> how do I list all parents of an object?
<davidcelis> WhereIsMySpoon: cool unclosed backtick
<lectrick> all the way up to the topmost? (trickiness: is it Object, or what if it's BasicObject, etc.?)
TorpedoSkyline has joined #ruby
<tolland> export RUBYOPT="-rdebug"
akem has quit [Ping timeout: 252 seconds]
yugui is now known as yugui_zzz
<davidcelis> lectrick: .ancestors ?
<WhereIsMySpoon> tolland: what on earth are you doing
<tolland> kicks it into an interactive shell, which is cool
<tolland> WhereIsMySpoon: im giving you interactive commentary on my first foray into the debugging options for ruby
<lectrick> davidcelis: ok this may be interesting, thanks
afallows has left #ruby [#ruby]
mikepack has joined #ruby
Ethan has quit [Ping timeout: 245 seconds]
ilmenite has joined #ruby
AxonetBE has quit [Quit: Leaving.]
Facefox has quit [Ping timeout: 260 seconds]
kaiwren has joined #ruby
Croms has quit [Quit: Linkinus - http://linkinus.com]
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
eykosioux has joined #ruby
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
maletor has joined #ruby
jeer has quit [Quit: Computer has gone to sleep.]
EskiMag has quit [Remote host closed the connection]
EskiMag has joined #ruby
billy_ran_away has joined #ruby
Konboi has quit [Remote host closed the connection]
<billy_ran_away> How can I test that an instance variable is set correctlyin a class?
<hoelzro> billy_ran_away: define 'correctly'
<billy_ran_away> I've tried test.instance_variable_get(:blah) but that doesn't see to work…
Facefox has joined #ruby
davejacobs has joined #ruby
<billy_ran_away> hoelzro: Umm well it depends what I pass to initialize, but I'm writing a Test::Unit test...
<hoelzro> billy_ran_away: well, if you wanted to do that, it'd be test.instance_variable_get(:'@blah')
<billy_ran_away> Ohh @
<hoelzro> but you probably don't want to do that
<hoelzro> billy_ran_away: I assume you're writing a test for a class?
<billy_ran_away> format = MaskableAttribute::Formatting::Format.new :name => :test
<billy_ran_away> assert_equal :test, format.instance_variable_get(:@method)
<billy_ran_away> Yea
<hoelzro> and you want to make sure the object has a certain state?
jayne_ is now known as jayne
bgupta has quit [Read error: Connection reset by peer]
<billy_ran_away> Well I want to be sure my @method instance variable is set correct
vlad_starkov has quit [Remote host closed the connection]
bgupta has joined #ruby
<hoelzro> billy_ran_away: well, imo, you shouldn't be checking for internal state in a test!
<billy_ran_away> hoelzro: And I don't want/need the @method to be attr_accessor
theRoUS has quit [Ping timeout: 260 seconds]
<hoelzro> it will make your code less flexible in the future
<hoelzro> only test things that people using your code (including yourself) should be using
<billy_ran_away> hoelzro: How do I test that it's handling my options construction (or deconstruction depending on your point of view) correctly?
wallerdev has joined #ruby
EskiMag has quit [Ping timeout: 245 seconds]
<hoelzro> billy_ran_away: don't worry about that
<hoelzro> worry about your object's behavior post-construction
<billy_ran_away> hoelzro: Well in this case they'll be a format method, that given a string will format a certain way...
Konboi has joined #ruby
centipedefarmer has quit [Quit: This computer has gone to sleep]
bluenemo has quit [Remote host closed the connection]
<billy_ran_away> hoelzro: But I want the format to be a nil, in which case it just runs the name as a method against the string
<billy_ran_away> hoelzro: Or a symbol, when runs against the string…
<billy_ran_away> Or a proc, which has the string passed in to it as an argument
<billy_ran_away> So I guess I should just do those as tests then...
<billy_ran_away> Okay, that makes sense
havenn has joined #ruby
<billy_ran_away> hoelzro: Thanks for helping think through things
<billy_ran_away> *me
<hoelzro> np
hemanth has quit [Read error: Connection reset by peer]
Konboi has quit [Remote host closed the connection]
Constant_ has joined #ruby
EskiMag has joined #ruby
hemanth has joined #ruby
ConstantineXVI has quit [Read error: No route to host]
<hoelzro> the rule of thumb is to only test functionality that users of your objects will use
ph^ has joined #ruby
kaiwren has quit [Quit: kaiwren]
wpaulson has quit [Ping timeout: 244 seconds]
imami|afk is now known as banseljaj
<billy_ran_away> hoelzro: I guess that makes sense
vlad_starkov has joined #ruby
<billy_ran_away> hoelzro: Can you think of a better name for my format method then format? Line 4 looks dumb: http://cl.ly/HQGc
<billy_ran_away> Err line 3
<billy_ran_away> Maybe 'is'...
<billy_ran_away> Or applied
davejacobs has quit [Ping timeout: 245 seconds]
davidcelis has quit [Ping timeout: 244 seconds]
wpaulson has joined #ruby
<digitalcakestudi> how do you go about formating floats to work as decimals such as $3.2100000000000004 
chrxn has joined #ruby
andrewhl has quit [Remote host closed the connection]
adambeynon has joined #ruby
ipoval has quit [Quit: ipoval]
cek has quit [Quit: жопа диридай диридиридай]
<digitalcakestudi> I have tried sprintf("%05.2f", @quote.total * 0.2) but that ends up $03.21
jeer has joined #ruby
<ramblex> "%.2f" % 3.2100000000000004
<apeiros_> digitalcakestudi: using floats for monetary things is instafail
carloslopes has quit [Ping timeout: 265 seconds]
baroquebobcat has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<digitalcakestudi> thanks ramblex
yugui_zzz is now known as yugui
thone has joined #ruby
jonathancutrell has joined #ruby
<apeiros_> digitalcakestudi: use BigDecimal, Integers or the monetary gem.
d3c has joined #ruby
theRoUS has joined #ruby
<workmad3> apeiros_: +1
albemuth has joined #ruby
schovi has quit [Remote host closed the connection]
<apeiros_> and I'm serious. just google "using floats for currency" if you don't believe me
* apeiros_ out
<digitalcakestudi> its already a decimal in rails so when I * 0.2 should it not round off?
<digitalcakestudi> because it didn't
<workmad3> digitalcakestudi: I.class gives you?
<workmad3> orr, @quote.total.class even
jonathancutrell has quit [Client Quit]
cj3kim has quit [Quit: Leaving]
mucker has joined #ruby
<digitalcakestudi> BigDecimal
jonathancutrell has joined #ruby
emmanuelux has joined #ruby
<jonathancutrell> Hello ruby folks.
thone_ has quit [Ping timeout: 265 seconds]
<jonathancutrell> Not sure this is the absolute best place to do this, but I'll ask anyway
yankov has joined #ruby
<jonathancutrell> I've got an inversion counter function that I've implemented in ruby, and I'm wondering how I can make it not quadratic
<jonathancutrell> http://pastie.org/4092939
davidw has quit [Ping timeout: 265 seconds]
<jonathancutrell> I haven't asked in #algorithms yet, but they are pretty quiet over there, so I figured I'd ask here first.
<jacobw> have you tried ##math also?
<digitalcakestudi> aaaaa there is 666 people hexs on all of you!
<jonathancutrell> jacobw: I have not - I'll hop over there.
wvms has quit [Quit: wvms]
chienpo has joined #ruby
ckrailo has joined #ruby
Prometheus has joined #ruby
nateberkopec has joined #ruby
porton has joined #ruby
<porton> I know Python. Should I also study Ruby? Is anything in Ruby better than Python?
<rippa> yes
<rippa> language
<deryl> learn ruby because you want to learn ruby
<jonathancutrell> Haha
<jonathancutrell> yeah.
<jonathancutrell> Essentially they have the same functionalities for the most part
Progster has quit [Ping timeout: 245 seconds]
<deryl> better / best is always subjective. (Python|Ruby) is best for some variable of 'best' or 'better'
<havenn> porton: Use Ruby! Crush the Python! (Produced by the People's Committee for Revolutionary Re-education.)
<deryl> s/variable/variant/
<jonathancutrell> python is installed on more non-traditional machines (think robots; mostly because it is older)
<havenn> Ruby has blocks. I rest my case.
<jonathancutrell> but overall, ruby and python have generally the same running time and platform spread.
pr0zac0x2a has joined #ruby
robotmay has quit [Remote host closed the connection]
<jonathancutrell> porton: also, why are you learning to program? If it's for the web, then look at specific web frameworks in both languages
hydrozen has quit [Quit: Computer has gone to sleep.]
<porton> jonathancutrell: In fact I am a professional Web programmer, but incidentally do some programming on my own
<jonathancutrell> porton: Rails/Sinatra/rack-based apps/EventMachine vs Django/Tornado etc
<jonathancutrell> porton: Are you planning to pursue new jobs, or just get smarter?
<havenn> Use Ruby to be happy.
<porton> jonathancutrell: Just get a little smarter.
macmartine has joined #ruby
<jonathancutrell> porton: Learn deeper python.
<jonathancutrell> porton: Or, learn how to do more with python.
<deryl> why be mono-language? learn both
<jonathancutrell> deryl: Why learn both?
<deryl> increase knowledge AND learn a new skill AND learn how to interface between the two
<jonathancutrell> porton: It makes more sense to be an expert in one language than to be good in one and terribly mediocre or decent in another.
<deryl> and single language knowledge can be limiting if for no other factor than being able to read how something is done
chrxn has quit [Ping timeout: 248 seconds]
macmartine has quit [Read error: Connection reset by peer]
<havenn> jonathancutrell: Kinda like why you'd try vanilla and chocolate ice cream. Be a postmoderist hyperpolyglot!
wpaulson has quit [Ping timeout: 265 seconds]
<jonathancutrell> havenn: Ha.
<deryl> just because you know one language really really well, does nto imply that because you learn another you're going to be mediocre or terrible int he new one
<deryl> s/nto/not
<jonathancutrell> deryl: Unfortunately, it often does mean that.
<deryl> usually due to lack of committment on the learner's part
<deryl> and lack of practicing with throwaways
<jonathancutrell> deryl: While I understand the benefits of learning more than one language, I think time is much better spent becoming great at the thing you are already good at than becoming knowledgable at the thing you are clueless about.
macmartine has joined #ruby
<deryl> depends. self limitation can and sometimes is a good thing. but definitely not in all cases, or even in the majority of cases
<jonathancutrell> deryl: Now, if you were to supplement your knowledge in one language with some kind of other thing (like, for instance, a strong understanding for cryptology or networking technology), then yes, widen your knowledge.
<havenn> But maybe he reaaaallly loves chocolate, and has just only tried snake flavored ice cream.
Araxia_ has joined #ruby
<deryl> i don;t see why you're so against someone learning more than one language actually
<jonathancutrell> deryl: but the main differences between python and ruby are semantics, and learning semantics doesn't really make you that much more capable than you were in the beginning.
<deryl> your logic path sort of stymies me
ilmenite has quit [Ping timeout: 246 seconds]
macmartine has quit [Remote host closed the connection]
<jonathancutrell> deryl: I'm not against it; in fact, I do know a decent amount of ruby, python, php, and node-flavor JavaScript
macmartine has joined #ruby
<porton> jonathancutrell: Have you wanted to say "syntax" instead?
kenperkins has quit [Quit: Computer has gone to sleep.]
<jonathancutrell> porton: Well, semantics is more explanatory. Because there are different looping and data structures in ruby than in python
<deryl> jonathancutrell: depends. sometimes a change to a more expressive syntax can change how you look at a problem. maybe something makes a bit more sense expressed a different way (and there is also the chance that you can't be as expressive using the syntax structure of a different language)
<deryl> there are a whole slew of reasons for learning more than one language
porton has quit [Quit: Leaving]
<deryl> same as with learning a different human vocal language
<jonathancutrell> deryl: That would be more true if you were to learn, for instance, a functional programming language, versus a scripting/class-based language like ruby
<deryl> i do not agree
<jonathancutrell> deryl: Well, that's okay.
<deryl> on the 'more true' part
<deryl> well of course it is. this is an opinionated discussion. has been since the start :)
centipedefarmer has joined #ruby
hashpuppy has joined #ruby
<jonathancutrell> deryl: to change from ruby to python, in most cases you can literally change function names and keywords and remove "end" from a file. Conceptually I can do the same thing with a computer re-compiler.
TheNumb has quit [Quit: ZNC - http://znc.sourceforge.net]
<shevy> :)
<jonathancutrell> deryl: To change the solving of a problem from ruby to, say, erlang, or haskell, would take an entirely different set of changes.
<shevy> except for certain parts like ... [for x in y where z is this and that]
<havenn> def opinionated; [true, false].sample; end
<hashpuppy> I want "class Job" with a name and filename var and a run method. i then want Job1 to inherit Job. then I'm going to add all Jobs to an array and iterate on them, calling job.run(). what's a good way to do inheritance or this type of interface in ruby?
<hashpuppy> have class Job raise NotImplementedError on Run?
<jonathancutrell> deryl: So learning a language in and of itself doesn't necessarily change the way you solve problems, unless that language at its conceptual core is different.
<shevy> hashpuppy if you subclass, your child has all the methods the parent class has too
<deryl> wow time to move back into the house. burning up out here. 22C with 64% humidity
<ramblex> python list comprehensions are awesome
<deryl> time to roll in
<hashpuppy> yeah, but my parent is abstract
TheNumb has joined #ruby
koskoz has joined #ruby
<shevy> what does that even mean :P
MasterIdler has quit [Quit: MasterIdler]
khakimov has joined #ruby
<shevy> class Cat; end; class Garfield < Cat; end
<shevy> def run; puts self.name+' runs away.'; end
Morkel has quit [Quit: Morkel]
<shevy> ah a crippled class
<shevy> already got that though. we call them ... modules
<hashpuppy> shevy: gotcha. thanks
<hashpuppy> i think i'll do that
the_jeebster has joined #ruby
bluOxigen has quit [Ping timeout: 265 seconds]
schovi has joined #ruby
moshee has quit [Ping timeout: 248 seconds]
ananthakumaran has quit [Quit: Leaving.]
fabrice31 has quit [Remote host closed the connection]
moshee has joined #ruby
davidcelis has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
<shevy> wow
<shevy> just wow
<shevy> stackoverflow:
<shevy> class_eval(<<-END, __FILE__, __LINE__)
ph^ has quit [Remote host closed the connection]
ph^ has joined #ruby
amscotti has joined #ruby
amscotti has quit [Client Quit]
eurbach has quit [Quit: Leaving.]
<apeiros_> shevy: normal here-doc syntax. the body of the here-doc starts only on the next line. as far as ruby is concerned, the string is in `<<-END`. you can treat that like any other string (i.e. chain methods etc.)
ananthakumaran has joined #ruby
jenglish has quit [Remote host closed the connection]
EskiMag has quit [Quit: EskiMag]
ph^ has quit [Ping timeout: 265 seconds]
rakm has joined #ruby
frogstarr77 has quit [Remote host closed the connection]
fjfish has quit [Remote host closed the connection]
williamcotton has joined #ruby
frogstarr78 has joined #ruby
savage- has joined #ruby
xaq has quit [Remote host closed the connection]
gilead_ has quit [Quit: Leaving]
zinjacoder_ has joined #ruby
moshee has quit [Ping timeout: 246 seconds]
robdodson has quit [Quit: robdodson]
moshee has joined #ruby
Ammar01 has quit [Quit: Leaving]
eywu has joined #ruby
senny has quit [Remote host closed the connection]
zinjacoder has quit [Ping timeout: 244 seconds]
bier has quit [Ping timeout: 244 seconds]
akemrir has quit [Quit: WeeChat 0.3.8]
yosafbridge has joined #ruby
ramblex has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
adeponte has joined #ruby
MasterIdler has joined #ruby
maletor has joined #ruby
IrishGringo has quit [Ping timeout: 244 seconds]
lorandi has joined #ruby
d-best has quit [Quit: Reconnecting]
d-snp has joined #ruby
bigfatfrock has left #ruby [#ruby]
kenperkins has joined #ruby
pr0zac0x2a has quit [Ping timeout: 244 seconds]
Johnny7956 has joined #ruby
alexim has joined #ruby
<Johnny7956> Just a quick question - what is used in ruby for image processing?
Facefox has quit [Ping timeout: 244 seconds]
<Johnny7956> Something kind of like the BitmapData class of AS3: help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html is what I'm looking for
ramblex has joined #ruby
billiamii has joined #ruby
sspiff has quit [Remote host closed the connection]
Progster has joined #ruby
mneorr1 has joined #ruby
pr0zac0x2a has joined #ruby
DrShoggoth has joined #ruby
rippa has quit [Read error: Connection reset by peer]
rippa has joined #ruby
CheeToS has quit [Ping timeout: 248 seconds]
havenn has quit [Remote host closed the connection]
bier has joined #ruby
mneorr has quit [Ping timeout: 265 seconds]
yugui is now known as yugui_zzz
umttumt has joined #ruby
t0mmyvyo has joined #ruby
peanuts___ has joined #ruby
<peanuts___> Hello all
<peanuts___> I'm looking for a way to iterate on a letter though the alphabet
<peanuts___> I know there is "a".next that gives "b"
tomb_ has quit [Quit: Computer has gone to sleep.]
<peanuts___> but how to iterate by 5 letters by example ?
<axiak> 'a'.upto('z').each { |x| p x }
Facefox has joined #ruby
<axiak> I don't know ruby, but that was my guess :P
mdw_ has quit [Remote host closed the connection]
<shevy> whaaaat
<shevy> why dont you know ruby
<shevy> :(
mengu has quit [Quit: Konversation terminated!]
t0mmyvyo has quit [Client Quit]
<axiak> I'm just starting
<shevy> ('a'..'z').to_a
<shevy> hmm there is also .step
<axiak> well you don't need the .to_a bit right?
<axiak> if you're just iterating
<axiak> ('a'..'z').each { |x| p x } works
<peanuts___> hum no
<peanuts___> what I want it
<peanuts___> it's to uncrypt a word
<axiak> there's probably a tr in ruby for that...
<peanuts___> by example I have "adasd" and it should correspond to "hello"
<axiak> peanuts___: huh?
<peanuts___> "hello" is an example
<axiak> can you explain what you want your code to actually do
brianpWins has quit [Quit: brianpWins]
<axiak> as opposed to saying "adasd" -> "hello"
<peanuts___> I have a sentence like it "asdjasd askdja ieurisod aisduio iuoauf"
yankov has quit [Quit: yankov]
<peanuts___> and inside I know by example I have the world "hello"
<axiak> peanuts___: so do you want word-by-word translations?
<peanuts___> so I want to take all the words with the same length of hello
<peanuts___> and do the substitutions
<peanuts___> by 1 letter next
<peanuts___> 2
<peanuts___> until to find the solution
<peanuts___> normally the algo to crypt it's very simple
<axiak> I guess I don't understand, when would "adasd" correspond to "hello" ?
<peanuts___> humm
<peanuts___> it's a challenge for a job
<peanuts___> the question is
<axiak> can you link the challenge? :)
<peanuts___> 3. This text is scrambled with a very basic algorithm. It contains the word "question". The text of the question is inside, in French language:
<peanuts___> Yr grkgr qr yn dhrfgvba rfg : nirm-ibhf hgvyvfr ebg13.pbz cbhe erfbhqer pr ceboyrzr?
<peanuts___> so there is question inside the "secret" sentence
<axiak> i see
<peanuts___> it can only be the words dhrfgvba or ceboyrzr
<axiak> it's probably dhrfgvba
fayimora has quit [Ping timeout: 248 seconds]
zomgbie has joined #ruby
<peanuts___> I was just wondering if there was something in the Ruby API to iterate easily with letters
eywu has quit [Quit: Leaving.]
<peanuts___> something like "a".next(2) => "c"
<shevy> "a".next.next # => "c"
<peanuts___> yes ...
<shevy> no idea why next does not accept an argument
<peanuts___> doesn't accept
<axiak> probably because that doesn't make sense :P
<shevy> oh
<shevy> indeed
balki has quit [Remote host closed the connection]
<shevy> .next 2 could also mean "return the next 2 characters"
<shevy> "a".next(2) # => "bc"
<shevy> :D
<shevy> and what happens at
<shevy> "a".next 123789502358953
<axiak> you can do this for yourself: https://gist.github.com/2937497
moshee has quit [Ping timeout: 248 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
timonv has quit [Remote host closed the connection]
alanp has joined #ruby
balki has joined #ruby
eywu has joined #ruby
wallerdev has quit [Quit: wallerdev]
nateberkopec has quit [Quit: Leaving...]
bigoldrock has joined #ruby
BiHi has quit [Quit: bye]
apok has joined #ruby
Araxia_ has quit [Read error: No route to host]
Araxia_ has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
Facefox has quit [Ping timeout: 272 seconds]
fayimora has joined #ruby
Facefox has joined #ruby
DuoSRX has quit [Remote host closed the connection]
wmoxam has quit [Quit: leaving]
roolo has quit [Quit: Linkinus - http://linkinus.com]
<Johnny7956> So no suggestions for image processing library/class?
minijupe has joined #ruby
d3vic3 has quit [Quit: leaving]
apok has quit [Remote host closed the connection]
wmoxam has joined #ruby
apok has joined #ruby
cbuxton1 has quit [Ping timeout: 245 seconds]
tatsuya_o has quit [Remote host closed the connection]
tatsuya_o has joined #ruby
yankhates has joined #ruby
webusnix has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
Vainoharhainen has quit [Ping timeout: 248 seconds]
zomgbie has quit [Ping timeout: 246 seconds]
yankhates has quit [Quit: leaving]
havenn has joined #ruby
mucker has quit [Quit: leaving]
yankhates has joined #ruby
mucker has joined #ruby
hadees has quit [Quit: hadees]
<peanuts___> axiak, done I found
mucker has quit [Client Quit]
Facefox has quit [Remote host closed the connection]
mucker has joined #ruby
havenn has quit [Read error: Connection reset by peer]
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
<peanuts___> they crypted the words by replacing the letter by the 13th next one
havenn has joined #ruby
<apeiros_> peanuts___: that's called rot13
<apeiros_> and String#tr - which somebody already mentioned - is a very easy way to "decrypt" that code.
yonggu has quit [Read error: Connection reset by peer]
brianpWins has joined #ruby
yonggu has joined #ruby
yankov has joined #ruby
<Johnny7956> Sigma00: thanks. I've seen alot of people complain about rmagick but is it pretty standard?
tomb_ has joined #ruby
Araxia_ has quit [Ping timeout: 244 seconds]
<Sigma00> Johnny7956: I have /no/ idea, sorry
<apeiros_> Johnny7956: the problem with rmagick usually isn't rmagick but imagemagick.
Facefox has joined #ruby
Facefox has quit [Max SendQ exceeded]
tcopp has quit [Quit: Lost terminal]
quest88 has joined #ruby
cbuxton has joined #ruby
Nevrosis has joined #ruby
<Nevrosis> geia sas
<Nevrosis> xaax
Nevrosis has left #ruby [#ruby]
looopy has joined #ruby
<apeiros_> o0
sbanwart has quit [Ping timeout: 265 seconds]
Eldariof-ru has quit [Ping timeout: 265 seconds]
davidcelis has quit [Ping timeout: 252 seconds]
<Johnny7956> Hmm, surprisingly limited options there
Facefox has joined #ruby
hadees has joined #ruby
sbanwart has joined #ruby
sailias has quit [Ping timeout: 245 seconds]
adamkittelson has joined #ruby
heftig has joined #ruby
davidcelis has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
blacktulip has joined #ruby
bradhe has quit [Remote host closed the connection]
qwerxy has quit [Ping timeout: 244 seconds]
Wry-mouth has joined #ruby
francisfish has joined #ruby
zomgbie has joined #ruby
brianpWins has quit [Quit: brianpWins]
c0rn_ has joined #ruby
Araxia_ has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
dr_diamond has joined #ruby
dr_diamond has quit [Changing host]
dr_diamond has joined #ruby
brianpWins has joined #ruby
brianpWins has quit [Remote host closed the connection]
carloslopes has joined #ruby
brianpWins has joined #ruby
randomautomator has joined #ruby
bradhe has joined #ruby
zomgbie has quit [Ping timeout: 244 seconds]
Gurpartap has joined #ruby
tcopp has joined #ruby
<shevy> Johnny7956 rmagick is kinda dead
<Gurpartap> If a gem provides a cli command, and I want to call it programmatically, how do I set it's arguments programatically? (it uses optionparser, i believe)
<Johnny7956> shevy, what would you recommend then?
davidcelis has quit [Ping timeout: 240 seconds]
<shevy> Johnny7956 imagemagick :)
<Gurpartap> This is the file from which I'd like to programmatically call `run` method: https://github.com/opscode/knife-ec2/blob/master/lib/chef/knife/ec2_server_create.rb
davidcelis has joined #ruby
davidcelis has joined #ruby
Lars__ has joined #ruby
<Gurpartap> halp
akem has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
<shevy> hmm is this proper ...
<shevy> Object.send :include, Foo
pablo_ has joined #ruby
peanuts___ has quit [Quit: Ex-Chat]
jrist is now known as jrist-afk
trend_ has quit [Quit: trend_]
mattonrails has joined #ruby
icooba has quit [Quit: icooba]
kenichi has joined #ruby
mikepack has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
blacktulip has quit [Remote host closed the connection]
<apeiros_> shevy: yes
Boohbah has quit [Ping timeout: 276 seconds]
Wry-mouth has quit [Remote host closed the connection]
akem has quit [Ping timeout: 240 seconds]
umttumt has quit [Remote host closed the connection]
jeer has quit []
wangr has quit [Ping timeout: 244 seconds]
Boohbah has joined #ruby
Gurpartap_ has joined #ruby
Progster has quit [Ping timeout: 240 seconds]
Gurpartap has quit [Disconnected by services]
Gurpartap_ is now known as Gurpartap
saschagehlich has quit [Quit: saschagehlich]
<Gurpartap> So if there's a class that defines cli arguments with the "option" dsl (i guess using OptionParser), how do I set them manually, if I want to call a method in that class programmatically?
trend has joined #ruby
<Gurpartap> Any ruby pro for this simple deal? ^
dr_diamond has quit [Quit: Bye !]
<shevy> Gurpartap no idea how optionparser does it
<shevy> I usually add a method when I need it to a class
Johnny7956 has quit [Ping timeout: 245 seconds]
<shevy> and bundle things like
<shevy> ruby foo.rb --disable-colours
ramblex has quit [Ping timeout: 240 seconds]
<shevy> in foo.rb, add a method def disable_colours
DanBoy has joined #ruby
<shevy> then set up some aliases to those methods
<shevy> and handle the argument passing on my own :\
<Gurpartap> It's a class that I can't (or don't want to) change/override.
<shevy> aha. well, I dont touch classes I am not allowed to modify. perhaps someone else knows
nateberkopec has joined #ruby
wangr has joined #ruby
fantazo has quit [Remote host closed the connection]
akem has joined #ruby
thecreators has quit [Remote host closed the connection]
Lars__ has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
mikepack has joined #ruby
Progster has joined #ruby
akem has quit [Max SendQ exceeded]
d3c has quit [Quit: Quit]
akem has joined #ruby
Frippe has quit [Quit: WeeChat 0.3.7]
akem has quit [Ping timeout: 246 seconds]
netogallo has joined #ruby
moura has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
ksz has joined #ruby
crankyco_ has quit [Remote host closed the connection]
koskoz has quit [Ping timeout: 244 seconds]
<WhereIsMySpoon> can ruby dynamically load code at runtime?
<wmoxam> yes
DarkFoxDK has quit [Read error: Operation timed out]
SirFunk has quit [Read error: Operation timed out]
<WhereIsMySpoon> wmoxam: how
<apeiros_> WhereIsMySpoon: it wouldn't work otherwise
<wmoxam> require 'foo'
<apeiros_> require, load, eval, class_eval, module_eval
<apeiros_> instance_eval, instance_exec
<apeiros_> did I forget a way?
<WhereIsMySpoon> require loads in before running
<apeiros_> WhereIsMySpoon: wrong
macmartine has quit [Quit: macmartine]
<WhereIsMySpoon> i mean load in whilst the code is running
<apeiros_> require does that.
DarkFoxDK has joined #ruby
<Gurpartap> require requires whenever it requires wherever it requires
<WhereIsMySpoon> so if i do if(user.says("!load myfile.rb") { require 'myfile.rb } that will add it in
<WhereIsMySpoon> missed out a )
<WhereIsMySpoon> but you get the idea
<apeiros_> besides the broken syntax, yes
<WhereIsMySpoon> yea
carloslopes has quit [Ping timeout: 240 seconds]
voodoofish430 has joined #ruby
jcromartie has joined #ruby
nfk has quit [Quit: yawn]
SirFunk has joined #ruby
<shevy> heheeh
<shevy> apeiros_ is a funny man :)
<apeiros_> I am?
<shevy> yeah!
<davidcelis> No.
Yarou has joined #ruby
<shevy> WhereIsMySpoon do you like lisp
jarred has joined #ruby
<WhereIsMySpoon> shevy: never tried it
<shevy> (it(is(not(bad(if(you(can(ignore(the(parens
<oooPaul> except)you)can't)really
<WhereIsMySpoon> lol
<WhereIsMySpoon> i see
<oooPaul> ACK! Paren imbalance! Erase the file and start over.
<oooPaul> It's like coding with punchcards. :P
<WhereIsMySpoon> xD
<axiak> a proper text editor (*cough* emacs *cough*) makes lisp pleasant, with proper indentation and paren-matching
maxok has joined #ruby
<oooPaul> emacs is an okay operating system. :P
<davidcelis> (not does (make this sense))
<axiak> davidcelis: you inverted it
<axiak> you mean (make (not this does) sense)
<davidcelis> damn
<davidcelis> its been a long time since scheme; tough for me to convert english into it
mikepack has quit [Remote host closed the connection]
iSuckAtRuby has quit [Quit: Leaving]
ghanima has joined #ruby
<WhereIsMySpoon> RIVERSIIIDE
malkomal_ has joined #ruby
ibash has joined #ruby
uris has quit [Ping timeout: 244 seconds]
malkomalko has quit [Ping timeout: 252 seconds]
ph^ has joined #ruby
QKO has joined #ruby
<shevy> it's ok with emacs
<shevy> you can use vim for its lack of a proper editor
<jacobw> viper
ph^ has quit [Ping timeout: 252 seconds]
QKO_ has quit [Ping timeout: 265 seconds]
AndChat| has joined #ruby
lkba has quit [Read error: Connection reset by peer]
nilg has joined #ruby
axiak has quit [Remote host closed the connection]
nilg has quit [Remote host closed the connection]
nilg has joined #ruby
crankycoder has joined #ruby
nfk has joined #ruby
ramblex has joined #ruby
tk___ has quit [Quit: ばいばい]
* oooPaul loves vim.
jimeh has quit [Ping timeout: 245 seconds]
macmartine has joined #ruby
vlad_starkov has joined #ruby
yankhates has quit [Ping timeout: 244 seconds]
<WhereIsMySpoon> is there any ruby library that can take a string and if it has ascii values like &amp; turn them into the proper values?
jarred_ has joined #ruby
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
sailias has joined #ruby
jarred has quit [Ping timeout: 240 seconds]
jarred_ is now known as jarred
medik has quit [Remote host closed the connection]
<ramblex> WhereIsMySpoon: you could try https://github.com/threedaymonk/htmlentities
<Mon_Ouie> CGI.unescape_html from stdlib
<WhereIsMySpoon> ramblex: ok i downloaded the zip and ran the setup.rb
<WhereIsMySpoon> now what
maxok has quit [Quit: Linkinus - http://linkinus.com]
tayy has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
carloslopes has joined #ruby
<WhereIsMySpoon> oh, its installed
<WhereIsMySpoon> that was easy
krusty_ar has quit [Read error: Connection reset by peer]
rippa has quit [Ping timeout: 244 seconds]
krusty_ar has joined #ruby
stephenjudkins has joined #ruby
pablo_ has quit [Quit: Ex-Chat]
rippa has joined #ruby
<WhereIsMySpoon> ramblex: that works great, thanks :D
<WhereIsMySpoon> this is exactly what i needed
icooba has joined #ruby
keithcelt has joined #ruby
ph^ has joined #ruby
Emmanuel_Chanel has joined #ruby
kvirani has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
Eldariof-ru has joined #ruby
axl_ has joined #ruby
icooba has quit [Client Quit]
axl_ has quit [Read error: Connection reset by peer]
BrokenCog has quit [Ping timeout: 244 seconds]
arturaz has quit [Ping timeout: 244 seconds]
centipedefarmer has quit [Quit: This computer has gone to sleep]
<shevy> WhereIsMySpoon: let's get married
niklasb has joined #ruby
axl_ has joined #ruby
IrishGringo has joined #ruby
moura has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
sailias has quit [Ping timeout: 246 seconds]
gmci has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<Paradox> there is no spoon
yankhates has joined #ruby
centipedefarmer has joined #ruby
sailias has joined #ruby
workmad3 has joined #ruby
kirun has joined #ruby
ksz has quit [Ping timeout: 248 seconds]
weslly has joined #ruby
centipedefarmer has quit [Quit: This computer has gone to sleep]
ackz has joined #ruby
weslly has left #ruby [#ruby]
Enekoos has joined #ruby
ukd1 has joined #ruby
havenn has quit [Remote host closed the connection]
keithcelt has quit [Remote host closed the connection]
jrist-afk is now known as jrist-mtg
mjb2k has joined #ruby
joel has joined #ruby
Markvilla has quit [Read error: Connection reset by peer]
sailias has quit [Ping timeout: 246 seconds]
Markvilla has joined #ruby
<joel> I'm using threads in ruby (jruby) but I'm not quite understanding the join function. For every file I have, I start a thread to process that file while under X amount of total threads launched by me. I don't want to exit until all of my threads are done processing. Right now I'm just checking the list of total running threads. Is there a way with join where I can tell the main/parent thread...
<joel> ...not to exit?
<joel> but also don't block, because you may need to launch more threads to keep processing files
<Paradox> i would like an explanation of the join() as well
<Paradox> i've always just sort of used it as a magic bullet and went wall-eyed when reading the documentation
pu22l3r has quit [Ping timeout: 245 seconds]
sailias has joined #ruby
gmci has joined #ruby
<joel> Yeah I've been there ;)
<apeiros_> joel: join stops your current thread until the thread you're joining is done
<apeiros_> it doesn't stop any other thread, though.
<Paradox> ah
<apeiros_> so Array.new(10) { Thread.new do complex_calc end }.each(&:join) creates 11 threads (main thread + 10 in that array)
<Paradox> thats a hell of a lot simpler than i thought
<joel> apeiros_: right, so in this case calling join on a child thread would stop the parent thread, thus stopping more children thread from being made.
<apeiros_> then stops the main thread until each of those 10 are done.
<apeiros_> joel: yes, you join *after* you started all threads
<apeiros_> joining immediately makes no sense.
<joel> apeiros_: which doesn't work in this case, because I need to limit the amount of total threads. When one of my limit of two finishes, I want to start another.
<apeiros_> e.g. Array.new(10) { Thread.new { complex_calc }.join } <-- this is stupid
<mjb2k> joining is for when the parent cannot continue until the child has finished
<apeiros_> joel: you're looking for a pool
jlogsdon has joined #ruby
<apeiros_> joel: look into queues.
atmosx has joined #ruby
<shevy> a parental pool
<shevy> for childish children
Aristata has quit [Quit: Leaving.]
<mjb2k> if you want to be able to create more threads while waiting on other threads to finish, I'm pretty sure joining is not what you want, unless you're joining on a thread-manager thread
Boohbah has quit [Remote host closed the connection]
centipedefarmer has joined #ruby
nightzpy_ has joined #ruby
<joel> mjb2k: in which case I should probably just be using Queue from what I read about it.
<apeiros_> generally you only join before exiting the app
<apeiros_> otherwise you most likely do something wrong.
Boohbah has joined #ruby
Targen has quit [Quit: No Ping reply in 180 seconds.]
Targen has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
hasrb has joined #ruby
nightzpy has quit [Ping timeout: 248 seconds]
tolland has left #ruby [#ruby]
jonathancutrell has left #ruby [#ruby]
graspee has joined #ruby
<joel> yeah makes sense
<joel> I need to stare at this queue doc a bit more so it makes sense to me.
<atmosx> hello
<apeiros_> joel: there's probably a thread pool gem
mneorr1 is now known as mneorr
tds has quit [Read error: Connection reset by peer]
<joel> apeiros_: I thought you where reffering specifically to: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/thread/rdoc/Queue.html
tds has joined #ruby
<apeiros_> yes. threads + queues are usually the building blocks of thread pools.
<apeiros_> you feed the work to the queue, the worker threads shift the work off the queue, process it and push the result back on a 2nd queue
<joel> apeiros_: gotchya
<joel> thanks for the input everyone
<joel> to work I go :)
andrewhl has joined #ruby
joel has quit [Quit: ChatZilla 0.9.88.2 [Firefox 12.0/20120420145725]]
axl_ has quit [Read error: Connection reset by peer]
<apeiros_> but as said, you probably don't have to reinvent thread pools.
axl_ has joined #ruby
atmosx has quit [Ping timeout: 276 seconds]
mattonrails has quit [Remote host closed the connection]
alanp has quit [Ping timeout: 245 seconds]
balki has quit [Ping timeout: 245 seconds]
balki has joined #ruby
alanp has joined #ruby
tds has quit [Ping timeout: 245 seconds]
<mjb2k> I've never used a Queue in ruby, but it looks like it's just a synchronized object, is there no way to explicitly synchronize in Ruby?
<mjb2k> (I've actually done *very* little threading in ruby)
atmosx has joined #ruby
pdtpatrick has joined #ruby
IrishGringo has quit [Ping timeout: 244 seconds]
<apeiros_> mjb2k: mutex, monitor
graspee has quit [Remote host closed the connection]
Axsuul has joined #ruby
<apeiros_> if you build low level stuff, Thread.exclusive
tds has joined #ruby
srji has joined #ruby
havenn has joined #ruby
graspee has joined #ruby
AxonetBE has joined #ruby
<aces1up> what is a good plugin that will convert text to the representative seconds? for instance if I want bi-daily I would want the amount of seconds for 12 hours or for string daily, i would want second for 24 hours
fulmato has joined #ruby
<mjb2k> looks like Mutex covers typical usage, thanks
slainer68 has joined #ruby
<slainer68> hi
suborbital1 has joined #ruby
xnm has joined #ruby
<slainer68> is there a gem/lib to transform a timestamp in ms to a string format "HH:MM:SS" or I should do this manually ?
<mjb2k> anybody know if MRI is going to allow parallel thread execution any time soon?
suborbital1 has left #ruby [#ruby]
workmad3 has quit [Ping timeout: 246 seconds]
suborbital has quit [Disconnected by services]
<mjb2k> maybe Date in stdlib?
<xclite> slainer68: TimeDate has something that does that I think
m_3 has quit [Ping timeout: 244 seconds]
kidoz has joined #ruby
<apeiros_> slainer68: a number of ms is *not* a timestamp
<apeiros_> that's a duration
<apeiros_> time != duration.
<apeiros_> and no, ruby does not have any duration or interval classes in core/stdlib
<slainer68> apeiros_: you're right, i'm talking about duration, sorry :)
<apeiros_> but it's trivial to do using divmod
<mjb2k> oh, i misunderstood that, sorry
atmosx_ has joined #ruby
<apeiros_> timestamps are the thing that e.g. Time.at accepts
uris has joined #ruby
AxonetBE has quit [Quit: Leaving.]
AxonetBE has joined #ruby
<apeiros_> haha, ruby tops out at 2k threads :D
cmarques has joined #ruby
koskoz has joined #ruby
ringotwo has quit [Ping timeout: 252 seconds]
akem has joined #ruby
lorandi has quit [Quit: Leaving]
<mjb2k> to format a duration in seconds, if you only need a resolution of seconds, how about pass it to Time and format out the time ignoring that the date happens to be in 1970 ?
<apeiros_> mjb2k: don't. do. that.
<apeiros_> instafail.
<apeiros_> you end up using mktime and forgetting that you have a timezone… whoops
<apeiros_> you end up suddenly having something > 24h… whoops
m_3 has joined #ruby
<apeiros_> seriously. it's 3 lines of divmods to have sec, min, hours and days. 6 lines to have it in a method, including def+end
bglusman has quit [Remote host closed the connection]
<mjb2k> ah yes, well that what happens with half thoughts, they give half answers (which are always wrong)
bglusman has joined #ruby
<apeiros_> note that there is Time.utc which will avoid the TZ failure. it doesn't prevent the >24h failure, though.
<mjb2k> yes you're right, it's really not that hard to get H:M:S from an int
bglusman has quit [Read error: Connection reset by peer]
axl__ has joined #ruby
axl__ has quit [Read error: Connection reset by peer]
bglusman has joined #ruby
kaiwren has joined #ruby
kaiwren has quit [Client Quit]
bglusman_ has joined #ruby
bglusman has quit [Read error: Connection reset by peer]
axl_ has quit [Ping timeout: 244 seconds]
dekroning has quit [Ping timeout: 265 seconds]
<apeiros_> well, who knows. I hope to be able to take off for a month and work on https://github.com/apeiros/chronos/ full time during that month
<apeiros_> I had it mostly done 4y ago, and then shit happened - I got hired :D
<apeiros_> it absolutely beat the crap out of Date and DateTime back in 2008. I think it's still better today. and it includes duration & interval.
atmosx has quit [Quit: leaving]
atmosx_ has quit [Quit: leaving]
mohits has quit [Ping timeout: 240 seconds]
<mjb2k> quite nice, good and *correct* time libraries are always appreciated
Eldariof-ru has quit []
<mjb2k> I hate dealing with timezones
ph^ has quit [Remote host closed the connection]
<apeiros_> yupp
axl_ has joined #ruby
<apeiros_> DST is worse, though
ph^ has joined #ruby
<mjb2k> oh yes
axl_ has quit [Read error: Connection reset by peer]
<apeiros_> leap seconds are also quite a hassle
<daed> i, too, hate dealing with timezones
<mjb2k> I got lucky, though, on a recent project which our trainers use across 4 timezones, since we were on such a tight timeline to get it out, we ended up telling them all time are CST(or CDT) because that's where the main office is, deal with it
<shevy> let's have only on timezone
<shevy> *one
<daed> mjb2k; that happened to us
sailias has quit [Quit: Leaving.]
<daed> we just standardized on EST
<daed> since 90% of the offices are there
<apeiros_> that's what UTC is there for :-p
<apeiros_> "oh-six-hundred zulu time!"
<mjb2k> hey I'd love to just use UTC, but I'm in the minority on that one
<xargoon> CET is the shit
<apeiros_> well, about all date/time libs that support TZ usually work with utc internally.
<apeiros_> timezones are just representational matter anyway.
<mjb2k> first we need to get rid of daylight savings time, then we'll work on the 1 time zone thing next
<apeiros_> nah, while TZ can be interfering, they're not much of a problem really.
ph^ has quit [Ping timeout: 240 seconds]
<slainer68> apeiros_: i'm trying https://github.com/peleteiro/ruby-duration
<slainer68> thanks
jimeh has joined #ruby
<mjb2k> yeah, moving forward I'm trying to get everything UTC, leave timezone in the presentation layer where it belongs, alas, legacy apps and databases...
<xargoon> just store a timezone per user or whatever, and remembert to convert any times they enter to UTC
<xargoon> remember*
<Paradox> hah
<Paradox> i had someone in #python argue with me that python is better for regular expressions than ruby
<Paradox> hahaha
axl_ has joined #ruby
<shevy> ok and did he say why
<Paradox> yeah, he said you can make one really simply…
<Paradox> uh…simpler than /.*/ ?
<Paradox> lol
olrrai has joined #ruby
<shevy> hmm speaking about regexes
<shevy> warning: character class has duplicated range: /(.*)-([\d\.\w]+)/
<Paradox> or %r{ } if that floats your boat
ringotwo has joined #ruby
<apeiros_> and we care what some random idiot in some random place blabbers because?
<shevy> I know someone here said \d is included by \w
<Paradox> because it makes conversation
<shevy> or vice versa?
<davidcelis> shevy: yes, it is
<apeiros_> shevy: yes, I told you that :)
<Paradox> \w includes \d
<Paradox> \d does not include \w
<davidcelis> shevy: /w == [a-zA-Z0-9_]
<davidcelis> \w*
<jlogsdon> \w is any "word" character, \d is digits only
<jlogsdon> efb twice!
<jlogsdon> sweet
<shevy> hmm and \d is ... 0,1,2,3,4,5,6,7,8 and 9?
<jlogsdon> and -
<apeiros_> \d is [0-9]
<davidcelis> 0-9
<jlogsdon> oh, not -. im dumb
<apeiros_> jlogsdon: no
<jlogsdon> WAKE UP JLO
<shevy> ok that is a nice meme, the [a-zA-Z0-9_] one
red-panda has joined #ruby
<shevy> that I can remember :)
<davidcelis> jlogsdon: DID I STUTTER
francisfish has quit [Remote host closed the connection]
centipedefarmer has quit [Quit: This computer has gone to sleep]
<jlogsdon> n-n-n-n-n-nooo
Monofu has joined #ruby
axl_ has quit [Quit: axl_]
emmanuelux has quit [Read error: Connection reset by peer]
yankhates has quit [Ping timeout: 240 seconds]
<shevy> hmm
federic has quit [Remote host closed the connection]
<shevy> so what do you usually use when you want to write tests for your ruby projects?
vlad_starkov has quit [Remote host closed the connection]
centipedefarmer has joined #ruby
<Paradox> Rspec
<jlogsdon> `gem install guard-rspec && guard install rspec` then setup spec/ folder, then run guard and go to town!
<apeiros_> stdlib test/unit + 2 files
cmarques has quit [Quit: Get MacIrssi - http://www.sysctl.co.uk/projects/macirssi/]
<apeiros_> need to try guard, though.
Monofu has quit [Remote host closed the connection]
<jlogsdon> what i love about guard is that its not specific to testing. you can use it to "guard" (monitor) any file/folder and do any action if things change
Monofu has joined #ruby
<jlogsdon> and it integrates with a bunch of notification (toaster) platforms, so you can get immediate updates on what passed/failed without looking at hte console
snearch has joined #ruby
Monofu has left #ruby [#ruby]
emmanuelux has joined #ruby
Monofu has joined #ruby
eignerchris has joined #ruby
albemuth has quit [Quit: Computer has gone to sleep.]
albemuth has joined #ruby
<WhereIsMySpoon> shevy: gimme a date and im there
<WhereIsMySpoon> <3
workmad3 has joined #ruby
kenichi has quit [Remote host closed the connection]
Gurpartap has quit [Ping timeout: 245 seconds]
Monofu has quit [Client Quit]
yankhates has joined #ruby
TorpedoSkyline has quit [Ping timeout: 240 seconds]
bnagy has quit [Ping timeout: 256 seconds]
<mjb2k> tests?? run it, does it work? Tested good ! lol
<davidcelis> shevy: minitest
bnagy has joined #ruby
sepp2k has joined #ruby
kenichi has joined #ruby
nateberkopec has quit [Quit: Leaving...]
habib has joined #ruby
<habib> Howcan i make SDL load?
jrist-mtg is now known as jrist
<habib> it says "Load error: Couldn't load SDL
ukd1 has quit [Quit: ukd1]
tndrbt has joined #ruby
snearch has quit [Quit: Verlassend]
<habib> HI Everyone. Help me to solve one problem
slainer68 has quit [Remote host closed the connection]
nanderoo has quit [Quit: Leaving.]
<habib> i've installed rubygame gem
runa has joined #ruby
<runa> heyas. what's the ruby 1.9 way to remove accents from accented letters?
<habib> and when i'm trying to run someprogram using this lib it says that it couldn't load lib
tommyvyo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<mjb2k> Habib did you install the required sdl libraries?
<habib> yes
<habib> i've downloaded all the SDLs and copied it into SysWOW64 in my win7
<mjb2k> did you follow the instruction here: https://github.com/rubygame/rubygame/wiki/Install ?
<habib> yes i did actually
<habib> from D:/programming/Ruby193/lib/ruby/gems/1.9.1/gems/nice-ffi-0.4/lib/nice-ffi/library.rb:98:in `load_library'
<habib> from D:/programming/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-sdl-ffi-0.4/lib/ruby-sdl-ffi/sdl.rb:51:in `<module:SDL>'
<habib> from D:/programming/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-sdl-ffi-0.4/lib/ruby-sdl-ffi/sdl.rb:34:in `<top (require
<habib> from D:/programming/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
<habib> from D:/programming/Ruby193/lib/ruby/gems/1.9.1/gems/rubygame-2.6.4/lib/rubygame/main.rb:22:in `<top (required)>'
<habib> from D:/programming/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
<habib> from D:/programming/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
<habib> from D:/programming/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
habib has quit [Killed (idoru (Spam is off topic on freenode.))]
joshman_ has quit [Ping timeout: 244 seconds]
srji has quit [Quit: leaving]
ghanima has quit [Ping timeout: 244 seconds]
<Tasser> hum, how do I get the string until '::' ?
fbernier has joined #ruby
srji has joined #ruby
nateberkopec has joined #ruby
<apeiros_> Tasser: str[/(.*?)::/, 1]
<apeiros_> or str.split(/::/,2).first
<Tasser> I'd use split :-)
<Tasser> why the ,2 ?
<apeiros_> you want to let the split keep on searching for all occurrences of :: ?
internet_user has quit [Remote host closed the connection]
<Tasser> nah
<apeiros_> all you need is first anyway, so 2 to tell it to stop after the first split
<Tasser> http://sprunge.us/ffLD <- test string example (I want the german word list part)
<mjb2k> Habib: I'm not too familiar with ruby on Windows, but maybe confirm you gempath ?
kidoz has quit [Ping timeout: 244 seconds]
stephenjudkins has joined #ruby
kidoz has joined #ruby
koskoz has quit [Ping timeout: 252 seconds]
ken_barber has quit [Remote host closed the connection]
<Tasser> http://rubular.com/r/4WCmGPg3f9 anyone wants to help me to match the word only?
<Tasser> wait, I can just take until the first space...
sbanwart has quit [Ping timeout: 244 seconds]
tndrbt has left #ruby [#ruby]
Criztian has quit [Remote host closed the connection]
theRoUS has quit [Ping timeout: 260 seconds]
habib has joined #ruby
<habib> damn
<habib> i missed all the answers
Progster has quit []
<habib> can u copy it?
<apeiros_> Tasser: also ^\p{Word}*
<Tasser> apeiros_, just split :-)
<apeiros_> pfff
<apeiros_> I'd assume you want all parts
<apeiros_> so match + captures.
<Tasser> hum, they should merge threach and peach... both got their odds
Constant_ has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
shadoi has joined #ruby
nahhh has quit [Read error: Operation timed out]
<apeiros_> seems like /(\p{Word}*) \{([^}]+)\}(?: \[([^]]+)\])?(?: \(([^)]+)\))?/ would give you proper captures
<shevy> ack
<shevy> regex attack!
<apeiros_> shevy: duck!
* shevy ducks!
Progster has joined #ruby
habib has quit []
chrismcg is now known as zz_chrismcg
carloslopes has quit [Ping timeout: 244 seconds]
eignerchris has quit [Remote host closed the connection]
nilg has quit [Remote host closed the connection]
VictorMartins has joined #ruby
roams has quit [Ping timeout: 252 seconds]
rippa has quit [Ping timeout: 244 seconds]
VictorMartins has quit [Client Quit]
chrxn has joined #ruby
VictorMartins has joined #ruby
banghouse has joined #ruby
jlogsdon has quit [Remote host closed the connection]
fbernier has quit [Ping timeout: 252 seconds]
nahhh has joined #ruby
silentpost has joined #ruby
ackz has quit [Quit: Leaving...]
niklasb has quit [Ping timeout: 246 seconds]
thecreators has joined #ruby
niklasb has joined #ruby
IrishGringo has joined #ruby
CaptainJet has joined #ruby
hynkle has quit [Quit: hynkle]
xnm has quit [Ping timeout: 244 seconds]
MrGando has quit [Quit: Bye]
billy_ran_away has quit []
rakm has quit [Ping timeout: 265 seconds]
workmad3 has quit [Ping timeout: 245 seconds]
nilg has joined #ruby
carloslopes has joined #ruby
chrxn has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
rakm has joined #ruby
yankhates has quit [Quit: Lost terminal]
AxonetBE has quit [Quit: Leaving.]
geekbri has quit [Remote host closed the connection]
mayankkohaley has quit [Ping timeout: 265 seconds]
pu22l3r has joined #ruby
tcopp has left #ruby [#ruby]
wangr has quit [Ping timeout: 245 seconds]
EskiMag has joined #ruby
hatoishi has joined #ruby
d3c has joined #ruby
koskoz has joined #ruby
wunz has joined #ruby
hashpuppy has quit [Quit: hashpuppy]
Konboi has joined #ruby
tommyvyo has joined #ruby
xnm has joined #ruby
Morkel has joined #ruby
nilg has quit [Remote host closed the connection]
minijupe has quit [Quit: minijupe]
hatoishi has quit [Quit: leaving]
yankhates has joined #ruby
VictorMartins has quit [Quit: VictorMartins]
<rking> Hrm. I'm writing a bit of a DSL (so that a physics guy can spec out some algorithms, and then I'll use his stuff as my test cases), and I want to give him the freedom to name vars like A_E (note the caps), but then later redefine them without warnings. How bad am I if I just wrap it in a silence_warnings do … end?
VictorMartins has joined #ruby
<rking> I'd actually prefer to cherry-pick only the constant reassignment one.
<rking> Oh wait, that's a Rails thing anyway.
yankhates has quit [Client Quit]
yankhates has joined #ruby
yxhuvud has quit [Ping timeout: 245 seconds]
andrewhl has quit [Remote host closed the connection]
<rking> Boils down to setting $VERBOSE = nil.
Gavilan has joined #ruby
bglusman_ has quit [Remote host closed the connection]
Morkel has quit [Quit: Morkel]
bglusman has joined #ruby
runa has quit [Ping timeout: 244 seconds]
<RubyPanther> rking: it depends somewhat on what you mean by "a DSL" as that has come to mean a wide variety of different things.
<rking> Yep. Here's all I mean. I want the physics guy to say stuff like:
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
mikepack has joined #ruby
<rking> r_r = 360; v = 5; A_E = 0.58; A_C = 0.613; function 'P_D', result: 123, units: 'kWh'
<rking> (Semis would be actual newlines)
nateberkopec has quit [Quit: Leaving...]
<rking> Then inside my implementation I'll run P_D as a method and assert that it returns 123 kWh
<apeiros_> rking: can you get him to do c.r_r = 360, c.A_E = 0.58 etc.?
<rking> But his vars use caps differently than ruby.
hemanth has quit [Read error: Connection reset by peer]
<apeiros_> (c as in calculation, or whatever)
<rking> apeiros_: I'd definitely rather not.
hemanth has joined #ruby
<apeiros_> rking: how about: let do; r_r 360; A_E 0.58; …; end ?
<RubyPanther> rking: so then you can just do like foo.instance_variable_set "@#{var_containing_string_r_r}", var_with_360
<apeiros_> i.e., a block in which all assignments are done
nateberkopec has joined #ruby
<rking> apeiros_: Possibly.
<RubyPanther> And then you can allow a wide variety of naming
<rking> I don't want him to have to worry about what's a const and not.
<rking> I.e., he'll work it out by putting all the consts at the top and never touching them, then the caps/not-caps thing is only a Ruby custom, not actually his custom.
sailias has joined #ruby
sailias has quit [Client Quit]
<rking> apeiros_: Oh wait, I missed what you were saying. You're suggesting method_missing?
nateberkopec has quit [Client Quit]
bglusman has quit [Ping timeout: 265 seconds]
<rking> That would actually work just fine.
<apeiros_> yes
<apeiros_> it won't work with foo= methods, though
<rking> Then we could have the ='s or not.
<apeiros_> (since they need a receiver)
<rking> Oh it won't?
<rking> Aha.
trend has quit [Read error: No route to host]
<rking> OK, I'm sure he can live without =. =)
<apeiros_> no. x = y is always lvar assignment. X = y is always constant assignment.
trend has joined #ruby
<rking> apeiros_, RubyPanther: Thanks. This is going to be a good thing.
<rking> Then as he gets more advanced I'll throw in the idea of loops and stuff.
<rking> "DSL"s FTW.
<rking> OK, what about the assertions? What would be a nice looking syntax for it?
<rking> function 'P_D', result: 123, units: 'kWh'
trend_ has joined #ruby
trend has quit [Read error: No route to host]
trend_ is now known as trend
<rking> (Is what I was starting with. I'm sure it can be cleaned up a lot)
banghouse has quit [Remote host closed the connection]
netogallo has quit [Remote host closed the connection]
<apeiros_> rking: take a look at the units gem too
<rking> apeiros_: Oh, big thanks.
<rking> I was literally sitting here thinking about how I wanted to handle units.
<apeiros_> result: 123.kWh (not sure it works straight like that)
tatsuya_o has joined #ruby
<rking> Because I can't be throwing around 14 and stuff.
<rking> OK, perfect.
<shevy> RubyPanther is back again!
<rking> These Ruby types of people fail to impress me only rarely.
<rking> (That's what I have shevy for.)
fulmato has quit [Ping timeout: 265 seconds]
pr0zac0x_ has joined #ruby
<shevy> I am the secret weapon
<shevy> when we are going to win a war, better don't use me
<apeiros_> shevy: you're the secret BFG?
<shevy> but when we are about to lose the war, pull out a shevy as the secret weapon!
<RubyPanther> If I was a cartoon squirrel it would be even more fun.
<shevy> when you aren't among the genius, but you don't want to be among the idiots either, you simply have to be ... different
Synthead has quit [Read error: Connection reset by peer]
pr0zac0x2a has quit [Ping timeout: 245 seconds]
pr0zac0x_ is now known as pr0zac0x2a
zommi has quit [Remote host closed the connection]
<RubyPanther> Then you must be sub-genius.
kidoz has quit [Quit: Ухожу я от вас]
Markvilla has quit [Quit: Markvilla]
chson has quit [Remote host closed the connection]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
srji_ has joined #ruby
ph^ has joined #ruby
EskiMag has quit [Quit: EskiMag]
Jackneill has quit [Read error: Connection reset by peer]
wvms has joined #ruby
<WhereIsMySpoon> shevy: when are we going to get married?
srji has quit [Ping timeout: 265 seconds]
<apeiros_> you found your spoon?
<shevy> WhereIsMySpoon when you find your spoon
PaciFisT has quit [Quit: Leaving.]
Helius has joined #ruby
ZachBeta has joined #ruby
<WhereIsMySpoon> shevy: you are my spoon <£
<WhereIsMySpoon> *<3
* apeiros_ must go watch porn to get that pic out of his head…
timonv has joined #ruby
havenn has joined #ruby
Guedes has joined #ruby
Guedes has quit [Changing host]
Guedes has joined #ruby
<rking> WhereIsMySpoon: How do you type "#"?
Konboi has quit [Remote host closed the connection]
<rking> Hrm, Ruby'
<rking> s doing something I don't understand: x = :a; 'b'+x
`damien has joined #ruby
<rking> That fails because it can't convert Symbol into String, but there's a Symbol#to_s you can call explicitly.
villainous has joined #ruby
<apeiros_> String#+ doesn't go and call to_s for you
<rking> Right, but it does something.
<apeiros_> it would call to_str for you.
<rking> Aha.
<rking> NoMethodError: undefined method `to_str' for 23:Fixnum
<rking> So how does 'a'+23 work?
<apeiros_> yes. that's why 'a'+23 won't work either.
<apeiros_> it doesn't
<rking> Oh, it doesn't.
<rking> Hehe
<rking> class Fixnum; def to_str; to_s end end # Ahh, Perl-like. =)
<`damien> Hey all, I ran across a weird bit of ruby code today: "method_one and return or method_two". Wouldn't this always execute method_one and method_two and return the result of method_two?
jrist is now known as jrist-afk
havenn has quit [Remote host closed the connection]
hatoishi has joined #ruby
<shevy> I guess it depends on what method_two does
<apeiros_> `damien: no
<apeiros_> evaluation order is: (method_one and return) or method_two
<`damien> Interesting
<apeiros_> so if method_one returns a falsy value, then method_two is executed. otherwise it return nil and does not execute method_two.
<apeiros_> but it's horrible code.
<`damien> I agree
<`damien> Both methods have nil return values
<shevy> hmm actually
<`damien> So I just wanted a sanity check to see if I wasn't crazy
<shevy> that code does not even run for me `damien
<apeiros_> and whoever wrote that should be flayed alive if he put it into production code…
<shevy> test.rb:12:in `<main>': unexpected return (LocalJumpError)
<`damien> I found it hunting for a bug in a rails codebase
<apeiros_> shevy: you have to put that code into a method and run that
<apeiros_> …
<apeiros_> figures
<`damien> Actual implementation looks something like "try_signing_in and return or create_new_user"
<`damien> Led to some fun bughunting
<apeiros_> wait, in a rails app's code base? or in *the* rails codebase?
looopy has quit [Remote host closed the connection]
<`damien> In an instance of rails
pu22l3r has quit [Remote host closed the connection]
<`damien> not THE rails
<`damien> I would be very concerned if it was in rails master
<shevy> I see
<apeiros_> `damien: you should be concerned
MasterIdler has quit [Ping timeout: 246 seconds]
<apeiros_> rails has tons of horrible code in it :(
<shevy> hehehehe
<`damien> Haha, I've seen some of irt
<`damien> *it
<`damien> I remember having a very interesting time fixing a bug for stale AR connections
<apeiros_> worst thing I ever came across was a method that seemingly had an infinite recursion. upon inspection of the methods it called, I noticed that one of the methods it called *redefined* the calling method.
<`damien> Oh god
<shevy> haha
<shevy> awesome!
<shevy> that's what you call DYNAMIC CODE man
<`damien> Last place I worked at we found a HTTP header that caused rails to error out :(
<shevy> it'll all make sense after some bottles of beer :)
<apeiros_> `damien: haha
looopy has joined #ruby
<`damien> it was a valid header, too
carlyle has quit [Remote host closed the connection]
<apeiros_> `damien: another issue we had: I think it was in 3.1, when we had sql containing binary data - the logger would crash
<`damien> that being said, I both love and hate rails for it's magical goodness
<apeiros_> I think that logger-patch is still in our codebase.
<`damien> lolwut
<apeiros_> yeah, the logger wrote utf-8. and it crashed because the binary data was obviously not valid utf-8.
<`damien> Hah!
<`damien> Don't get me started on UTF-8 issues
<shevy> May The Love of Encoding be with us.
suborbital has joined #ruby
<`damien> Fun fact, in ruby 1.9: String.new.encoding != "".encoding
<shevy> I got two surprises so far... psych.rb complaining about invalid bytes when I try to write a .yml file
<shevy> and the other one is a script that somehow no longer can find the proper lines in a file
<apeiros_> ah well, the more annoying issue we had with encoding was oracle. it can't properly convert KD normalized utf-8 to iso-8859-1. And for fun's sake, file uploads in firefox use KD normalized filenames…
<shevy> it worked fine on 1.8.7 :(
<`damien> Haha
<`damien> I recently started picking up C so I could take a closer look at the ruby internals
red-panda has quit [Remote host closed the connection]
hunglin1 has joined #ruby
<`damien> C is turning out to be much easier to pick up than I was expecting
<Tasser> `damien, I think jruby is kinda fun :-)
red-panda has joined #ruby
<shevy> if C wouldn't have had pointers, it would be a really simple language
<`damien> I love the idea of JRuby, but I work off a mac and Java on a mac is sadface
ph^ has quit [Remote host closed the connection]
hunglin has quit [Ping timeout: 248 seconds]
<`damien> Apple and their funky java implementation
axl_ has joined #ruby
<Tasser> huh?
ph^ has joined #ruby
<`damien> Mac OS doesn't use sun java
<`damien> or openjdk
<`damien> it's their own distro
<mjb2k> I thought they dropped all the funny Apple Java stuff
<apeiros_> wtf google groups? I can see 8 (eight!) messages on a fully blown up windows on a 1440x900 screen… srsly, wtf?!?
<`damien> not as far as I'm aware
<mjb2k> i know they still repackage it, but I think all the customization to the jvm got left behind with PPC
<`damien> Hm, I take that back
<`damien> running java -version get's me java hotspot vm
<`damien> Once I'm done with C i guess I'll start picking up JRuby/java
dhruvasagar has quit [Ping timeout: 265 seconds]
pr0zac0x2a has quit [Ping timeout: 248 seconds]
<mjb2k> the PPC Mac Java was an embarrassment to all things binary
silentpost has quit [Ping timeout: 240 seconds]
<`damien> Yeah
the_jeebster has quit [Quit: Leaving.]
<`damien> Do you know if there's a way to get java 7 running on a modern mac?
hatoishi has left #ruby [#ruby]
<`damien> I've never had luck getting the binaries to run properly
ph^ has quit [Ping timeout: 252 seconds]
<apeiros_> `damien: there are plenty of VMs to my knowledge
grantbdev has joined #ruby
uris has quit [Ping timeout: 244 seconds]
kvirani has quit [Remote host closed the connection]
<`damien> Do tell. The only one's I've seen are Sun's and OpenJDK
alanp_ has joined #ruby
<`damien> Then again I'm not that familiar with the java landscape
uris has joined #ruby
pr0zac0x2a has joined #ruby
<apeiros_> I'm not familiar with it either, but to my knowledge, oracles jvm should run on osx.
<Tasser> runs just fine on linux, so I use jruby when possible/useful
banseljaj is now known as imami|afk
billiamii has quit []
v0n has quit [Quit: Quitte]
<bigoldrock> Is there some way to re-use an object, calling one of its methods with a change to one of the variables?
yankhates has quit [Ping timeout: 245 seconds]
<Tasser> bigoldrock, change the object, call again?
<bigoldrock> I don't know how to do that without instantiating a new object
<Tasser> what's the whole story?
<WhereIsMySpoon> rking: its next to my enter key
<mjb2k> I dont get to spend much time on my personal Mac and it's really behind in updates, so I haven't seen anything about Java 7 there
<WhereIsMySpoon> i have a uk keyboard
<apeiros_> bigoldrock: you're giving very little details… how do you expect us to answer?
balki has quit [Ping timeout: 245 seconds]
alanp has quit [Ping timeout: 245 seconds]
<bigoldrock> sorry about that.
xnm has quit [Ping timeout: 244 seconds]
<shevy> hey bigoldrock
<shevy> can you change your nick to ...
<shevy> bigoldduck?
<WhereIsMySpoon> lol
apeiros_ is now known as proc{|x|x[]}
proc{|x|x[]} is now known as proc{|x|x[y]}
<proc{|x|x[y]}> isn't this an awesome nick?
<WhereIsMySpoon> o.o
<shevy> bigoldrock well, I usually define a method called .reset if I have to reuse an object
<bigoldrock> example: HttpConnect.new(user, pass)
<WhereIsMySpoon> no
<bigoldrock> myConnect = HttpConnect.new(user, pass)
<WhereIsMySpoon> its crazy
<WhereIsMySpoon> :L
<shevy> bigoldrock depends on the class. you did not write HttpConnect yourself?
looopy has quit [Remote host closed the connection]
<bigoldrock> myConnect.go
<proc{|x|x[y]}> WhereIsMySpoon: why? it's valid ruby code :-D
<shevy> otherwise you could look if it has a .connect method and whether that method allows you to set user and pass
<bigoldrock> change pass, then re-use myConnect
tayy has quit [Remote host closed the connection]
seitensei has quit [Remote host closed the connection]
<WhereIsMySpoon> proc{|x|x[y]}: bananamonkeys
<bigoldrock> just an example, not trying to hack anything ;)
<shevy> bigoldrock, if the class allows that, then sure
<proc{|x|x[y]}> WhereIsMySpoon: bananarama?
Guest72502 is now known as graft
<WhereIsMySpoon> bigoldrock: myConnect = HttpConnect.new(user, newpass) ?
DMKE has quit [Ping timeout: 244 seconds]
<WhereIsMySpoon> or am i not understanding
<aces1up> I have a module where I have declared an constant.. when I include it in a class and do MyModule::MyModuleConstant it keeps looking for it on the class I have included the module in. what am I doing wrong?
<shevy> WhereIsMySpoon, he wants to reuse the same object
<bigoldrock> shevy is right
<proc{|x|x[y]}> bigoldrock: that depends on the API of HttpConnect
kah_ has joined #ruby
zinjacoder_ has quit [Ping timeout: 246 seconds]
<proc{|x|x[y]}> you'd have to check the docs of it and see, whether it provides a setter for the password
<shevy> aces1up, if you included the module in the class, why do you want to access it via Modulename:: still ?
Xaitec has joined #ruby
axl_ has quit [Quit: axl_]
shadoi has quit [Remote host closed the connection]
<proc{|x|x[y]}> if not, you can go crazy on it and check in what ivar the pw is stored (likely in @password) and use instance_variable_set to assign a new value to it.
<proc{|x|x[y]}> but that's generally not a good idea.
shadoi has joined #ruby
Xaitec has quit [Read error: Connection reset by peer]
<proc{|x|x[y]}> bigoldrock: why do you wish to reuse the object anyway, instead of creating a new one?
<kah_> I have a hash, multi-selecet, but when I submit it adds a "---" and a - between each part of the array, any idea why?
babonk has joined #ruby
<bigoldrock> a better example is that I already have the connection and want another http uri
davidw has joined #ruby
<proc{|x|x[y]}> kah_: what?
<proc{|x|x[y]}> kah_: are you talking about a form on a website or something?
looopy has joined #ruby
davidcelis has quit [Ping timeout: 252 seconds]
davidw is now known as Guest97905
<bigoldrock> httpSession = httpConnect(user, pass, uri)
<kah_> proc{|x|x[y]}: yeah, a form..
<bigoldrock> httpSession.connect
fulmato has joined #ruby
<proc{|x|x[y]}> kah_: dude, your question makes like zero sense
alanp_ has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<bigoldrock> now, use the same connection & obj with a new uri
alanp has joined #ruby
<kah_> proc{|x|x[y]}: haha ok let me rephrase
<WhereIsMySpoon> bigoldrock: as others have said, that depends if HttpConnect allows it
<proc{|x|x[y]}> bigoldrock: same answer
balki has joined #ruby
<proc{|x|x[y]}> kah_: you know, you *really* should not leave out like *all* relevant info (hint, that you're talking about a form *is* relevant, what framework you use *is* relevant, etc.)
<bigoldrock> if it is my class, how do I make it allow this?
<kah_> proc{|x|x[y]}: ah shit, I'm in the wrong one
<kah_> should be in rails haha
<proc{|x|x[y]}> bigoldrock: add a method that allows you to set the value
<shevy> bigoldrock just add methods that do that for you
Helius has quit [Remote host closed the connection]
<proc{|x|x[y]}> bigoldrock: e.g. often simply by having an attr_accessor for it
<WhereIsMySpoon> make a method like HttpConnect::Reconnect(newUri)
<WhereIsMySpoon> *new_uri
<bigoldrock> cool, thanks!
tectonic has quit [Ping timeout: 244 seconds]
<WhereIsMySpoon> which takes the previous pw/user that were stored
<proc{|x|x[y]}> kah_: fail :-p
<WhereIsMySpoon> and uses the new uri
<WhereIsMySpoon> or smth
perry has quit [Ping timeout: 265 seconds]
tatsuya_o has quit [Remote host closed the connection]
ahuman has quit [Quit: No Ping reply in 180 seconds.]
perryh has joined #ruby
tectonic has joined #ruby
<shevy> yeah
<shevy> use smth
<shevy> def smth
<shevy> puts 'in smth now'
<shevy> end
VictorMartins has quit [Quit: Sleeping]
srji_ has quit [Quit: leaving]
<mjb2k> def jam
<mjb2k> puts 'word'
<mjb2k> end
davidcelis has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
<shevy> whoa
<shevy> now we can do
<`damien> Unrelated to my previous discussion: has anyone messed around with Goliath at all?
<shevy> smth && jam
<shevy> what is Goliath
<shevy> and who picks such a non descriptive name :(
andrewhl has joined #ruby
<mjb2k> I took him out
<shevy> lol
<`damien> Been out for a while now
<davidcelis> so... Node.ruby
<shevy> let's ddos him
<`damien> Pretty much
Guest97905 is now known as davidw
<`damien> It's basically an EventMachine server that wraps callbacks in fibers
<`damien> end goal being synchronous looking code that works asynchronously
davidw is now known as Guest31653
<davidcelis> lol EventMachine
<`damien> Don't diss da' EM
<`damien> Granted I wouldn't want to be maintaining that thing
<`damien> Codebase is gnarly
danheberden has quit [Quit: oh noes]
j0nathan_ has joined #ruby
DMKE has joined #ruby
danheberden has joined #ruby
zinjacoder_ has joined #ruby
<shadoi> Celluloid::IO is a much cleaner implementation of the same goal.
<shadoi> But Reel isn't quite done.
DrShoggoth has quit [Quit: Leaving]
<`damien> Isn't Celluloid based on an actor pattern?
<shadoi> Yes
<shadoi> concurrency and actors
<`damien> Neato. I've heard of it though I haven't really seen much usage of it in other projects I've come across
<shadoi> It's still quite young.
<`damien> Neat.
<`damien> I hope they get somewhere. Concurrency in ruby is kinda painful through stuff like EM
<otters> EM hurts
<shadoi> yeah it's super nasty to try to bolt it on.
<`damien> Tell me about it.
<`damien> sintatra_async. I shall say no more.
<shadoi> I'm currently converting all my EM servers to Celluloid::IO managed by a DCell node
<proc{|x|x[y]}> o0
<proc{|x|x[y]}> shadoi: what kind of EM servers do you have?
<shadoi> DNS, TFTP, DB, DHCP
<proc{|x|x[y]}> ah, TFTP you dabbled yesterday or today, no?
<`damien> A DHCP server in ruby?
<`damien> That sounds interesting
<`damien> What do you use it for?
<proc{|x|x[y]}> custom DNS server? why? you work for 37 signals? :)
<shadoi> cloud provisioning stack
<mjb2k> wait a minute, `damien, do say more about sinatra. I just ran across that recently and was looking forward to giving it a try for quick and easy REST services
babonk has left #ruby [#ruby]
<proc{|x|x[y]}> mjb2k: sinatra is nice for smaller apps
<mjb2k> is that not such a good idea?
<`damien> mjb2k: Sinatra is great, and it's fine for small stuff
<proc{|x|x[y]}> it's like 10min to learn
<`damien> Yep
<`damien> I love Sinatra
<shadoi> proc{|x|x[y]}: all of the services use the same database, via zeromq, it makes everything much more reliable without having to juggle configuration files and tons of disparate backing stores.
jimeh has quit [Ping timeout: 244 seconds]
Guest31653 has quit [Ping timeout: 244 seconds]
<shadoi> mjb2k: sinatra is great.
<proc{|x|x[y]}> shadoi: ok… interesting choice, still. I mean writing those servers properly…
<`damien> But if you have an API with more than a few resources you'd probably be better off with something like rails-api
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<mjb2k> oh ok, I wasn't sure if you were saying it was something nasty of what
<`damien> Oh, no
<`damien> sinatra is fine
<proc{|x|x[y]}> are there actually test suites to run a DNS server against?
d3c has quit [Quit: Quit]
<`damien> the sinatra_async gem just bolts EM and async response methods to it
<`damien> which gets painful
<`damien> error prone
<mjb2k> yea and I was only looking at it for small simple services
<`damien> and buggy as all hell
anekos has quit [Remote host closed the connection]
<`damien> Go for it!
<`damien> I think Sinatra is an excellent example of some quality ruby code
<shadoi> proc{|x|x[y]}: I only need enough functionality to provide PXE essentially. I've only implemented the bare essentials, which results in most of the services being about… oh… 200-ish lines of ruby. :)
anekos has joined #ruby
<`damien> shadoi: I'm still curious, what's your use-case for a DHCP server in ruby/EM?
albemuth has quit [Quit: Computer has gone to sleep.]
<mjb2k> we use Mule and Jersey at work and it can get a little irritating writing a book of xml just to get a simple service going
villainous has quit [Quit: villainous]
<shadoi> actually I think I ripped EM out of the DHCP server… I'm still going to move it to celluloid::io so I can have some nice service control and management capabilities.
<`damien> Hah!
<`damien> And here I was hoping you had a nifty little DHCP app up your sleve
<shadoi> There are a few DHCP and DNS servers written in ruby
Guedes has quit [Quit: Saindo]
<shadoi> The TFTP options are quite a bit worse.
<`damien> Do any of them have a nice admin GUI? That's mainly what I'd want out of a ruby based DHCP server.
<shadoi> None.
<`damien> That's a shame
ukd1 has joined #ruby
hadees has quit [Quit: hadees]
<`damien> The DHCP interface for all the routers I've ever had is painful
<shadoi> I'm planning to do a UI soon, but it'll be fairly focused on our product architecture, so probably not so generically useful.
<`damien> Fair enough
<shadoi> Maybe once I have more time (if ever) to open source it.
spinst3r has joined #ruby
<proc{|x|x[y]}> shadoi: your company still need ruby coders? sounds like you're having a fun job :D
<`damien> no worries, I was mainly just asking out of curiosity
spinst3r has quit [Client Quit]
<proc{|x|x[y]}> (not a serious inquiry… still…)
<shadoi> proc{|x|x[y]}: I would love to find some more people to work on this stuff, I need people with really solid operations/sysadmin knowledge.
<`damien> proc{|x|x[y]}: any medium to large company that uses ruby for devops/sysadmin-y stuff will have lots of interesting use-cases for ruby
proc{|x|x[y]} is now known as apeiros
ramblex has quit [Quit: ramblex]
<apeiros> meh, it's a fun nick, but I'm so not used to read it :D
<shadoi> :)
<shadoi> didn't realize it was you.
<`damien> shadoi: what's your role at your current company? what kind of stack are you working with?
<apeiros> also it somehow always puts my mind into ruby-parsing-mode, which messes with normal reading ;-)
Synthead has joined #ruby
Beoran_ has quit [Ping timeout: 246 seconds]
<shadoi> apeiros: yeah! I kept trying to parse it myself.
<Synthead> does net-sftp allow ports other than 22?
<shadoi> `damien: cloudscaling.com
<apeiros> shadoi: should I ever be looking for a new job, I'll probably try to contact you :D
<`damien> lol webscale
<`damien> What do you guys use for configuration management? chef? puppet?
<shadoi> I basically build all our APIs, data-model and provisioning system to deploy openstack (or whatever else)
<shadoi> chef, but I've been very careful to not tie ourselves to it.
hunglin1 has quit [Quit: Leaving.]
<`damien> Chef is neat, but not so great at certain things
<shadoi> yeah
<`damien> Last place I worked at we spent a lot of time extending chef to deal with server clusters
<`damien> and it's pretty much ignorant of topology in a server stack out of the box :(
pk1001100011 has quit [Ping timeout: 244 seconds]
<shadoi> basically I ripped chef-server out of the mix and implemented a very simple version of their database.
<shadoi> So I can feed the data to any config management tool
<`damien> I've heard some interesting stuff about people putting together a combo chef-solo/mcollective setup
<`damien> Interesting idea, though still not sure how they'd deal with the topology issue
<shadoi> We have enough other uses for it that I'm planning to try out an agent of our own using DCell
<`damien> Oh?
<shadoi> yeah, I can build workflow/fsm behavior into it for coordination
mjb2k has quit [Quit: Leaving]
<shadoi> something I've been thinking about for a while now…
<shadoi> initially I was going to implement it directly into puppet
zeromodu_ is now known as zeromodulus
cout has quit [Ping timeout: 245 seconds]
queequeg1 has joined #ruby
cout has joined #ruby
<`damien> pretty cool
roams has joined #ruby
<`damien> Coolest thing I ever saw with chef at one of my jobs was something we called chef-node
<`damien> We'd have a yaml config telling chef about an "environment" we'd want to make and it'd go and spin up a cluster of servers
akem has quit [Ping timeout: 244 seconds]
<`damien> Last I checked next step was to remove the need for configs and have it run off of environment "profiles"
wmoxam has quit [Quit: leaving]
<shadoi> *nod*
<shadoi> That's sort of what I built as well
akem has joined #ruby
bradhe has quit [Read error: Connection reset by peer]
bradhe_ has joined #ruby
Beoran_ has joined #ruby
<shadoi> basically all I need to build a multi-rack system with isolated resource blocks is the mac addresses and rack position of all the machines.
mpereira has joined #ruby
workmad3 has joined #ruby
andrewhl has quit [Remote host closed the connection]
CaptainJet has quit []
havenn has joined #ruby
qwerxy has joined #ruby
DanBoy has quit [Quit: Leaving]
uris has quit [Quit: leaving]
hasrb has quit [Remote host closed the connection]
hadees has joined #ruby
hadees has quit [Remote host closed the connection]
crazymykl has joined #ruby
neersighted is now known as neersight[d]
<crazymykl> is assuming a Hash is going to be in the same order if i iterate through it twice without modifying it in-between bad practice?
bradhe has joined #ruby
bradhe_ has quit [Read error: Connection reset by peer]
<crazymykl> to rephrase: is Hash ordered? if so, should I rely on that behavior?
schovi has quit [Remote host closed the connection]
ZachBeta has quit [Quit: Computer has gone to sleep.]
<shevy> crazymykl, in ruby 1.9.x yes, I think so
malkomal_ has quit [Remote host closed the connection]
dnyy has quit [Remote host closed the connection]
Progster has quit [Ping timeout: 248 seconds]
perryh is now known as perryh_away
oooPaul has quit [Quit: Ciao for now!]
ibash has quit [Quit: ibash]
<WhereIsMySpoon> crazymykl: yes in 1.9.x hash is ordered, before that, no
erichmenge has quit [Quit: erichmenge]
<crazymykl> WhereIsMySpoon: is ordering guaranteed in ruby 2.x and beyond?
<shevy> WhereIsMySpoon where is the spoon
<WhereIsMySpoon> crazymykl: 2.x is built on 1.9.x, so yes?...
<crazymykl> okay
tommyvyo has joined #ruby
red-panda has quit [Remote host closed the connection]
<shevy> middle off topic, but also related to ruby as I use ansi colour escape codes
<shevy> I output things like that way
<shevy> warn "No, don't do this!!!"
<shevy> where warn is red or something like that. just as example
<shevy> now, the colour is red, but so is the cursor
<shevy> after that was output
<shevy> is there a way to revert to the colour that was in place before that?
samuelkadolph has quit [Quit: Quitting]
<shevy> right now I default to always-white text... but perhaps the terminal has white backgruond and black font colour...
<graspee> \e[0m
<shevy> and then it would be white font on white background
<graspee> will return you to default
<shevy> really?
<graspee> yes
<Boohbah> [00m\]
<graspee> i thought for a minute you wanted to restore the colour that was there before, which i don't know if you can do
<graspee> but \e[0m will return you to the colours you'd get after you did a reset in bash say
samuelkadolph has joined #ruby
qwerxy has quit [Quit: offski]
ukd1 has quit [Ping timeout: 246 seconds]
brianpWins has quit [Quit: brianpWins]
kah_ has quit [Quit: Leaving]
j0nathan_ has quit [Ping timeout: 265 seconds]
davidcelis has quit [Ping timeout: 244 seconds]
qwerxy has joined #ruby
S1kx has quit [Ping timeout: 246 seconds]
fulmato has quit [Ping timeout: 245 seconds]
fantazo has joined #ruby
kevinbond has quit [Quit: kevinbond]
ramblex has joined #ruby
qwerxy has quit [Client Quit]
qwerxy has joined #ruby
CrazyToad has joined #ruby
billiamii has joined #ruby
Sheehan has quit [Quit: Sheehan]
Sheehan has joined #ruby
tchebb has quit [Ping timeout: 256 seconds]
SegFaultAX|work2 has quit [Quit: Lost terminal]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
macmartine has quit [Quit: macmartine]
xnm has joined #ruby
tchebb has joined #ruby
Banistergalaxy has quit [Ping timeout: 240 seconds]
quest88 has quit [Ping timeout: 265 seconds]
Sheehan has quit [Quit: Sheehan]
malkomalko has joined #ruby
BrokenCog has joined #ruby
dnyy has joined #ruby
chienpo has left #ruby [#ruby]
roams has quit [Remote host closed the connection]
ukd1 has joined #ruby
neersight[d] is now known as neersighted
cantonic has quit [Ping timeout: 245 seconds]
sailias has joined #ruby
frishi has joined #ruby
Banistergalaxy has joined #ruby