ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
brianpWins_ has joined #ruby-lang
<andrewvos> rue: Well that was enlightening. Still a pretty scary movie.
brianpWins has quit [Ping timeout: 246 seconds]
brianpWins_ is now known as brianpWins
<apeiros_> dunno, I found it a weird movie
<apeiros_> and not too entertaining
<andrewvos> Not sure why I like it
<andrewvos> Just love space movies I suppose
<apeiros_> I do too
<apeiros_> but there's just too much crap out there :(
<andrewvos> yeah
<andrewvos> Hard to find a good space movie
<andrewvos> There's like 10
<apeiros_> especially now that I read again, I realize how stupid, boring and unimaginative most movies really are
<andrewvos> You should read those Stephen Baxter books
<apeiros_> I'm still working on finishing the ones from asimov
<andrewvos> Awesome
<apeiros_> even though they're not that great (mostly because his ideas have been copied a thousand times, so they're no longer original…)
<andrewvos> yeah
<andrewvos> ok off to bed laters
<apeiros_> yeah, same
<apeiros_> gotta normalize my sleeping schedule again :)
postmodern has quit [Ping timeout: 252 seconds]
postmodern has joined #ruby-lang
stardiviner has joined #ruby-lang
fgomez has quit [Quit: leaving]
fgomez has joined #ruby-lang
Defusal_ has joined #ruby-lang
Defusal has quit [Ping timeout: 244 seconds]
yugui_zzz is now known as yugui
wpaulson has joined #ruby-lang
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
yxhuvud has quit [Ping timeout: 252 seconds]
yugui is now known as yugui_zzz
benanne has quit [Quit: kbai]
hinbody has quit [Ping timeout: 265 seconds]
tomb_ has joined #ruby-lang
tenaciousflea has joined #ruby-lang
tenaciousflea has quit [Client Quit]
mistym has quit [Remote host closed the connection]
wpaulson has joined #ruby-lang
flowerpot has joined #ruby-lang
yugui_zzz is now known as yugui
brianpWins has quit [Quit: brianpWins]
wpaulson_ has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
wpaulson has quit [Ping timeout: 244 seconds]
wpaulson_ is now known as wpaulson
apeiros_ has quit [Remote host closed the connection]
<MouseTheLuckyDog> How can I test if an instance is made from a class that is derived from ( or is ) X?
postmodern has quit [Ping timeout: 246 seconds]
dhruvasagar has quit [Ping timeout: 248 seconds]
<wpaulson> thing.class.kind_of?
<heftig> i.is_a? X
<wpaulson> instance.kind_of?(X) tells whether X is anywhere in the inheritance chain
<heftig> that's what was asked
<MouseTheLuckyDog> thanks wpaulson
asahi has quit [Quit: Leaving.]
asahi has joined #ruby-lang
asahi has quit [Client Quit]
dhruvasagar has joined #ruby-lang
asahi has joined #ruby-lang
postmodern has joined #ruby-lang
tr-808 has quit [Ping timeout: 240 seconds]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
tr-808 has joined #ruby-lang
jxie has joined #ruby-lang
rivaler has quit [Quit: rivaler]
yugui is now known as yugui_zzz
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
asahi has quit [Quit: Leaving.]
sepp2k1 has quit [Remote host closed the connection]
yugui_zzz is now known as yugui
asahi has joined #ruby-lang
asahi has quit [Client Quit]
yugui is now known as yugui_zzz
yugui_zzz is now known as yugui
Dreamer3 has joined #ruby-lang
yugui is now known as yugui_zzz
postmodern has quit [Ping timeout: 246 seconds]
VGoff is now known as VGoff_afk
akira989 has joined #ruby-lang
ronnie_ has joined #ruby-lang
kain has quit [Quit: Sto andando via]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
M4g1c5t0rM has joined #ruby-lang
postmodern has joined #ruby-lang
neoesque has joined #ruby-lang
brianpWins has joined #ruby-lang
jbsan_ has joined #ruby-lang
jbsan has quit [Read error: Connection reset by peer]
jbsan_ is now known as jbsan
wpaulson has joined #ruby-lang
umttumt has joined #ruby-lang
VegetableSpoon has joined #ruby-lang
neoesque has quit [Remote host closed the connection]
igotnolegs has quit [Quit: Computer has gone to sleep.]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
msaffitz has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
yugui_zzz is now known as yugui
VegetableSpoon has quit [Quit: Leaving]
srbartlett has joined #ruby-lang
M4g1c5t0rM has quit [Ping timeout: 246 seconds]
yugui is now known as yugui_zzz
igotnolegs has joined #ruby-lang
ronnie_ has quit [Ping timeout: 265 seconds]
awwaiid has quit [Read error: Connection reset by peer]
VGoff_afk is now known as VGoff
ryanf has joined #ruby-lang
awwaiid has joined #ruby-lang
M4g1c5t0rM has joined #ruby-lang
rohit has joined #ruby-lang
bhrgunatha has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
mistym has quit [Remote host closed the connection]
nazty has quit [Quit: WeeChat 0.3.7]
rippa has quit [Ping timeout: 260 seconds]
rohit has quit [Ping timeout: 246 seconds]
dalekurt has quit [Quit: Zzz...]
postmodern has quit [Ping timeout: 246 seconds]
slyphon has quit [Ping timeout: 245 seconds]
postmodern has joined #ruby-lang
dalekurt has joined #ruby-lang
umttumt has quit [Remote host closed the connection]
msaffitz has quit [Quit: Computer has gone to sleep.]
macmartine has quit [Quit: macmartine]
umttumt has joined #ruby-lang
umttumt has quit [Remote host closed the connection]
macmartine has joined #ruby-lang
srbartlett has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
bfreeman has quit [Quit: bfreeman]
postmodern has quit [Ping timeout: 260 seconds]
bhrgunatha has quit [Quit: ChatZilla 0.9.88.2 [Firefox 13.0/20120608021316]]
sora_h is now known as s0ra_h
s0ra_h is now known as sora_h
fayimora has quit [Quit: Busy…..zzzzz]
ronnieBoy has joined #ruby-lang
ronnie_ has joined #ruby-lang
xiaodong has joined #ruby-lang
<erikh> hello
neoesque has joined #ruby-lang
sora_h is now known as s0ra_h
s0ra_h is now known as sora_h
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
seanstickle has joined #ruby-lang
tyman_ has quit [Ping timeout: 265 seconds]
yugui_zzz is now known as yugui
jfarmer has joined #ruby-lang
macmartine has quit [Quit: macmartine]
tyman has joined #ruby-lang
brushbox has joined #ruby-lang
jfarmer has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
brushbox has quit [Quit: Leaving.]
dhruvasagar has quit [Read error: Connection reset by peer]
umttumt has joined #ruby-lang
umttumt has quit [Remote host closed the connection]
charliesome has joined #ruby-lang
calebkm has joined #ruby-lang
bfreeman has joined #ruby-lang
calebkm has quit [Remote host closed the connection]
jtoy has joined #ruby-lang
carlosed has joined #ruby-lang
mistym has quit [Remote host closed the connection]
jtoy has quit [Quit: jtoy]
MonkZ has joined #ruby-lang
MonkZ has left #ruby-lang [#ruby-lang]
Z33K|Lux has quit [Ping timeout: 260 seconds]
dalekurt has quit [Quit: Zzz...]
gsav_ has quit [Read error: Connection reset by peer]
fgomez has quit [Read error: Connection reset by peer]
carlosed has quit [Quit: Linkinus - http://linkinus.com]
yugui is now known as yugui_zzz
fgomez has joined #ruby-lang
umttumt has joined #ruby-lang
xiaodong has quit [Ping timeout: 245 seconds]
francisfish has joined #ruby-lang
xiaodong has joined #ruby-lang
brianpWins has joined #ruby-lang
gsav has joined #ruby-lang
outsmartin has joined #ruby-lang
workmad3 has joined #ruby-lang
outsmartin has quit [Quit: Leaving.]
qwerxy has joined #ruby-lang
workmad3 has quit [Ping timeout: 265 seconds]
andrew_ has quit [Remote host closed the connection]
tyman has quit [Quit: tyman]
yxhuvud has joined #ruby-lang
francisfish has quit [Remote host closed the connection]
mssola has joined #ruby-lang
mcFactor has joined #ruby-lang
workmad3 has joined #ruby-lang
mcFactor has left #ruby-lang [#ruby-lang]
M4g1c5t0rM has quit [Ping timeout: 246 seconds]
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
workmad3 has quit [Ping timeout: 265 seconds]
<rue> HI
<seanstickle> qllo
ryanf has quit [Quit: leaving]
ruskie has quit [Quit: ...]
ruskie has joined #ruby-lang
A124 has joined #ruby-lang
Criztian has joined #ruby-lang
igotnolegs has quit [Quit: Computer has gone to sleep.]
deryl has quit [Ping timeout: 265 seconds]
deryl has joined #ruby-lang
seanstickle has quit [Quit: Nihil sub sole novum]
relix has quit [Quit: Connection closed for inactivity]
timbleck has quit [Quit: Connection closed for inactivity]
charliesome has quit [Quit: Computer has gone to sleep.]
solars has joined #ruby-lang
deryl has quit [Ping timeout: 265 seconds]
voker57 has joined #ruby-lang
gouthamvel has joined #ruby-lang
fayimora has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
heftig has quit [Ping timeout: 245 seconds]
<erikh> what's up everyone?
<bnagy> bizarre bugs, you?
yugui_zzz is now known as yugui
yugui is now known as yugui_zzz
<erikh> making nginx and mruby play along
<bnagy> oh, nice
<erikh> it's going slowly, but I've got a lot of interest in contributing
<erikh> don't expect it to be a long-term thing though
<erikh> probably just bang it out over a couple of weekends and call it that.
apeiros_ has joined #ruby-lang
<erikh> also playing with this fun mail client for mac called 'mailmate'
<erikh> it's basically gui mutt
<bnagy> how's the gpg support?
<erikh> unsure, I really don't use encryption
<erikh> it does have sieve support, which was pretty surprising.
jxie has quit [Ping timeout: 245 seconds]
jxie has joined #ruby-lang
francisfish has joined #ruby-lang
gregmoreno has quit [Read error: Connection reset by peer]
<rue> erikh: Is it IMAP only?
gregmoreno has joined #ruby-lang
<erikh> rue: yes
ruurd has joined #ruby-lang
<andrewvos> Wow, this pleace is really quiet lately.
<andrewvos> What's happening?
<andrewvos> Are we losing to #ruby?
umttumt has quit [Remote host closed the connection]
<bnagy> in a sense
<bnagy> there are way more noobs, trolls and retards over there
ruurd has quit [Quit: Leaving...]
tomb_ has quit [Quit: Computer has gone to sleep.]
veex has joined #ruby-lang
brushbox has joined #ruby-lang
<veex> what is the technical definition of 'do' in ruby?
<apeiros_> it's a keyword
<apeiros_> that what you're asking?
heftig has joined #ruby-lang
<veex> does it just start a block of code in the same way { does for Java?
<veex> Or does it participate in any looping mechanism? like starting the iteration through a loop?
gouthamvel has joined #ruby-lang
<andrewvos> The fuck does this have a license for? https://github.com/jch/greenfield
gouthamvel has left #ruby-lang [#ruby-lang]
yugui_zzz is now known as yugui
umttumt has joined #ruby-lang
solars has quit [Ping timeout: 260 seconds]
flowerpot has quit [Quit: Ex-Chat]
Defusal_ has quit [Ping timeout: 240 seconds]
<apeiros_> veex: do/end delimits a block
<apeiros_> a block is a special argument, passed to a method
<apeiros_> a bit like an anonymous function (with the added bit of spice that it is a closure too)
<erikh> well, I said I would write this
<apeiros_> erikh: that article is a lie!!!!
<erikh> feh.
<apeiros_> pp is clearly so much better than p!!!1!1!!!1elf!
<apeiros_> ;-)
<erikh> I go into pp!
<apeiros_> oh
<erikh> keep reading.
<apeiros_> damn
<bnagy> lol
<apeiros_> way to kill my rant :D
<corundum> fine
<erikh> haha, I love that bot.
<bnagy> erikh: now do one on "how to ask for help, properly"
<apeiros_> erikh: ok. read to the end now. also worth a mention: y
<erikh> haha
<erikh> what's 'y'?
<apeiros_> yaml
<erikh> ah
<erikh> can you post that in the comments?
<apeiros_> noooooohohohooo
<erikh> hahaha
<apeiros_> why do you make me write comments?
<apeiros_> :'(
<apeiros_> ok
<bnagy> hm jruby + FFI + drb on win7 is 50% slower than MRI
<bnagy> for one specific workload etc
<bnagy> methinks I need a new JRE
<apeiros_> done
<apeiros_> methinks you need a proper OS
<apeiros_> /troll
<bnagy> meh, I don't _use_ windows, I just hack on it
<veex> Here's a question than apeiros_ . Take this code block: lower_case = ["hi", "these", "are", "some", "words"]
<veex> upper_case = lower_case.collect { |word| word.upcase }
<veex> puts upper_case.inspect
<veex> #=> ["HI", "THESE", "ARE", "SOME", "WORDS"]
benanne has joined #ruby-lang
<veex> the IwordI here. Why is it enclosed in pipes?
<bnagy> because syntax
<apeiros_> it's the argument the block takes
<veex> how does ruby know that 'word' means the strings within the array?
<apeiros_> as I said, it's like an anonymous function. so it consists of argument + body
<apeiros_> it knows by collect passing the individual words in.
<apeiros_> yielding, in ruby terminology. since the keyword to call the block is `yield`
<veex> yes but why not name word something like strings
<apeiros_> that is, collect calls the block once for each element in the array.
<veex> would it still know to do the same thing?
<apeiros_> it's a variable. you can name the variable whatever you want.
<apeiros_> (as long as you stick to variable naming rules)
<veex> it just knows that |word| means anything within the array so it could be |candy| and it would do the same as long as it was candy.upcase
<erikh> apeiros_: thanks
<apeiros_> veex: yes
<apeiros_> actually it doesn't know "anything within the array"
tbuehlmann has joined #ruby-lang
<apeiros_> it knows "passed in by collect"
yugui is now known as yugui_zzz
<veex> ahh, okay, so it knows that lower_case is the array and since upper_case is being set to the array it knows that |word| is any constant attached to the variable uppcase
<bnagy> o_0
<veex> You are amazing apeiros_ by the way :)
<apeiros_> thx
<erikh> look at the 'yield' keyword.
<veex> was my last explanation correct?
<apeiros_> hm, I think not
<erikh> that's what collect looks like.
<erikh> (only in C in the proper interpreter)
<bnagy> veex: your last explanation wasn't even in any language I am able to parse, let alone correct :)
<veex> crap
<erikh> do you understand what's happening?
<veex> No
<erikh> ok, so in that code...
<andrewvos> So, I want to buy a projector... Sadly, my imac isn't the best to output video to a projector because of it's location. THinking of getting one of those mini pcs. Thoughts?
<erikh> there's an implicit block. there's one available to every method
<erikh> I GOT THIS
<bnagy> think of it like this. collect (the method) takes every element in a collection (like an Array) and throws it into the block you provide
<andrewvos> Not exactly a ruby question, but haalp
<erikh> self is our array in the case of ary.collect
<erikh> we walk through self, yielding each object and pushing it to the new array
<apeiros_> veex: lower_case is an array. you then call collect on it. collect goes through each element in the array lower_case and calls the block once for each of these elements
<erikh> at the point of the yield, the block provided to collect is given x
<erikh> and the evaluation is stored in the new array 'ret'
<erikh> then we return the array.
<andrewvos> Maybe a Mac Mini?
<apeiros_> so the block is like a function. collect passes the element. you call upcase on it. the block returns that upper-cased string (since it's the last expression)
<apeiros_> collect puts each of the return values into a new array (see erikh's code, how collect would look when written in ruby)
<apeiros_> and collect then returns that new array.
<apeiros_> you then assign the result of collect (that array of uppercased strings) to the variable upper_case
<veex> This is great stuff. I'm reading through each comment and thinking
<apeiros_> that's what goes on, step by step
<veex> So the code you provided erik. The block is the def all the way ending with the .each before the { |x| ?
<erikh> no.
<erikh> hold on a sec.
<bnagy> popcorn time again!
<erikh> haha I'm not mad
<bnagy> veex: the block is either do |block_arg| ... end or {|block_arg| ... }
<erikh> actually, I need to run to the store and get caffeine
<erikh> can someone explain implicit blocks and explicit ones?
<erikh> I think that's the problem.
<bnagy> the stuff in the pipes gives you a locally scoped reference to the arg, judt like def foo( method_arg )
<veex> everything is the block except the pipes
<veex> Everything within the { } is the block
<bnagy> words.map HERE COMES THE BLOCK!!! {|word| word.upcase} THE BLOCK IS FINISHED NOW
<veex> I feel stupid
<veex> Okay, nice, so the block is that guy
<bnagy> or do |word| word.upcase end if that's more to your taste
<veex> Nice bnagy, I get what the block is, and the locally scoped reference object.
<bnagy> a block is just a little chunk of code we can chuck around
<veex> What's the diff between explicit and implicit block?
<bnagy> you could make one like block= proc {|word| word.upcase}
<bnagy> and then words.map &blk
<bnagy> an implicit block is what you were doing before
charliesome has joined #ruby-lang
Defusal has joined #ruby-lang
Defusal has quit [Changing host]
Defusal has joined #ruby-lang
<veex> what is an explicit block?
<bnagy> what I just did then
perryh is now known as perryh_away
<veex> I think I get it. Explicit is sort of a named method
fgomez has quit [Ping timeout: 240 seconds]
<bnagy> basically when you define a method, you can see if there is an implicit block with block_given? and if there is , you can yield to it
<veex> whereas implicit is anonymous within a code block
dejongge has joined #ruby-lang
<bnagy> otherwise if you define your ethod like foo(arg, &blk) then you can take an explicit block
<bnagy> and then blk.call or do whatever
zmack has joined #ruby-lang
<veex> so explicit block can be passed as parameters
<veex> whereas implicit blocks are anonymous and can't really be passed
<veex> I can't call the implicit block on the words.upper_case. I'd have to call the class method?
* veex feels hopeless
stardiviner has joined #ruby-lang
<bnagy> no, you're just using random words
burgestrand has joined #ruby-lang
<bnagy> don't worry about terminology, just worry about if you understand how it works
qwerxy has quit [Quit: offski]
<veex> so implicit is random words
<veex> that you've made up vs explicit being standardized words
<erikh> not really.
<bnagy> no "19:12 < veex> so explicit block can be passed as parameters
<bnagy> 19:12 < veex> whereas implicit blocks are anonymous and can't really be passed
<bnagy> is random words
<bnagy> sorry the line after, my mouse hates me
<erikh> veex: is english your first language? not trying to be offensive, just curious if you'd be better suited to help in a different one.
zmack has quit [Ping timeout: 246 seconds]
<veex> Yes, I'm an American. I'll try to write more clearly.
<veex> I'm tired. I've been up all night but I usually write like that anyways. Perhaps I need to look at this visually. Are there any visual tools or websites that show this stuff visually?
AlHafoudh has joined #ruby-lang
<bnagy> the poignant guide has cartoon rabbits
<erikh> the text is about as visual as it gets
<veex> I have a degree in computer science. I don't know why this is challenging me.
<erikh> it's ok.
<veex> You can laugh all you want...
<erikh> I'm not. I'd suggest practicing with a few different styles and reading some code.
<bnagy> which bit don't you understand?
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
<bnagy> +1 for writing code though - just write soe toy methods that use blocks in a few different ways
<erikh> implementing something that uses Enumerable would be good practice too.
<veex> I just don't understand explicit vs implicit blocks right now. I did get the first part where collect is working on the block array.
<erikh> well
<erikh> let's start at the top
<erikh> you were having trouble with the terms?
<erikh> let's google them and get definitions first.
<erikh> additionally, seeing as it can't be any earlier than 3am in the states, I'd suggest getting some rest.
<veex> I did quickly while chatting here.
<erikh> we'll be here tomorrow.
<veex> Yeah, I need some sleep. Where are you guys from?
<erikh> I'm in silicon valley.
<veex> That's awesome. San Mateo County?
<erikh> yep.
<erikh> menlo park.
<veex> I worked at a startup out there. It was fascinating.
<erikh> yeah it's a ... different place for sure
<veex> Do you write Ruby or do Rails stuff all day?
<erikh> ruby, C, shell, and chef
<erikh> I'm in ops.
<veex> OPS?
<erikh> operations, system administration, make things go, etc.
<veex> I do automated QA stuff. Mostly in C#
<erikh> oh, neat. C# is a really neat langauge
jxie has quit [Ping timeout: 252 seconds]
<veex> I am throwing myself completely into Rails and Ruby.
<erikh> can't say I'm much for developing outside of vim, but it's not as bad as I predicted it to be
<erikh> vsvim helped a lot :P
<erikh> cooll
<veex> We have mostly small conservative business in the middle of the United States. Most of it is maintenance work. Any new development is usually done by a small number of companies or consultants.
<erikh> be sure to understand ruby thoroughly before diving into rails.
<erikh> Sinatra might be a good first step if you're hell-bent on doing web stuff.
<erikh> or maybe .org or .net or something
<erikh> I can't remember.
<veex> I know of Sinatra. I think just pure Rails will do.
<erikh> well, rails changes the guts a lot
<bnagy> there is nothing pure about rails
<erikh> you'll get used to things that don't exist outside of rails
<erikh> and as soon as you need to write a pure ruby tool, your world will be rocked.
<erikh> rails isn't a bad system, it's just not a good primer for ruby.
<veex> How about Sinatra and openauth?
<veex> so gems work with both rails and sinatra?
<erikh> the oauth gem should work outside of rails
<erikh> and yes, gems are a ruby thing, not a rails thing.
<erikh> some gems are rails-specific though.
<AlHafoudh> hi all
<AlHafoudh> I am curious if this code can be optimized somehow. This is my first use of metaprogramming in rails app. https://gist.github.com/9b7abd548373050b8431
<erikh> you probably don't need that define_method at all
<erikh> also that query is going to beat the tar out of your database at any scale
<veex> You're a genius erik. How old are you?
<erikh> hahah
<erikh> old.
<veex> over 25?
<erikh> keep going.
<veex> There's hope for me then. If I can pound rails/ruby into my thick skull.
<apeiros_> self.send(:define_method <-- this is pretty much the epitome of misunderstanding when to use self and when to use send…
<apeiros_> just define_method
gouthamvel has joined #ruby-lang
<erikh> apeiros_: define_method won't work in a method
<veex> Ha ha apeiros_
<apeiros_> erikh: of course it will
<erikh> it's protected or private, can't remember which.
<apeiros_> erikh: yes, self.define_method *won't work*
<apeiros_> but just define_method *will* work
<erikh> hrm
<apeiros_> private/protected means no explicit receiver, including self
<erikh> you're probably right and I'm too tired to check.
<erikh> oh btw
<erikh> rbfu
<erikh> is awesome
<apeiros_> erikh: same reason why self.puts "hi" won't work ;-)
<apeiros_> but you write puts "hi", not self.send :puts, "hi"
<erikh> because the puts method is on Kernel and not Object?
<erikh> it's also a class method
<erikh> IIRC
* erikh runs
<veex> what does the | | do in that code?
<erikh> the ||= ?
<veex> elf.uid ||= begin
<apeiros_> AlHafoudh: self.class.where(uid: new_uid).any? <-- use an exists? query instead
<erikh> yeah so that's "or equals"
<erikh> basically, it's equivalent to this: self.uid = self.uid || something_else
<apeiros_> self.after_initialize(:generate_uid) <-- this means your model will get a new uuid each time it is initialized, that includes being read from the db. I doubt you want that.
<apeiros_> AlHafoudh: also the reason why this is a #rubyonrails question
<erikh> if it's already set, it doesn't try to overwrite it.
<AlHafoudh> apeiros_: i asked there
<erikh> oh, something you will see different in C#
<apeiros_> ah, well, omit that. you do self.uid ||=.
<apeiros_> AlHafoudh: so cross-poster… why am I even replying then…
<erikh> veex: so x || y is 'if x is true, return it, else return y'
<erikh> not Boolean.
<erikh> the way ruby booleans work makes this possible
* apeiros_ really needs to finish that gist on proper cross-posting and start kicking people again…
<erikh> apeiros_: eh
<erikh> don't
<erikh> it just doesn't happen that often
<apeiros_> often enough.
<veex> oh sorry apeiros_
<apeiros_> or rather: too often
<AlHafoudh> eh
<apeiros_> veex: why?
<veex> I am cross posting
<veex> so the | | is an 'if..else' routine
<erikh> it
<erikh> it's not | |
<erikh> it's ||=
<erikh> 'or equals'
<erikh> just like || 'or' and = 'assignment'
<apeiros_> 'or assigns'`
<apeiros_> ?
<erikh> oh derp
<erikh> I'm tired.
<apeiros_> ^^
<veex> so the || is or
<veex> Got it
yannis has joined #ruby-lang
<burgestrand> or is or, too! :d
<veex> Yeah, I can see that self.after_initialize(:generate_uid) will generate a new user ID everytime this thing initializes
<apeiros_> AlHafoudh: that whole thing is still a race conditions. even if (due to the nature of UUIDs) it is very unlikely to ever explode.
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
<apeiros_> veex: it doesn't, because of the ||=
<apeiros_> I missed that part
<erikh> I'd really consider axing that database call if nothing else
<AlHafoudh> apeiros_: yeah, I am fixing that now
<erikh> try to insert it against a constraint
<erikh> if it fails, retry
<erikh> that will be much faster
<apeiros_> sadly rails/ar has no proper mechanics to deal with insert-constraint-failures
<erikh> it raises
<erikh> well, save! does
<apeiros_> yes, but where do you rescue?
<erikh> begin; blah.foo = uid; blah.save!; rescue retry; end
<apeiros_> the code dealing with it should be in the model. but you have no callback for that
<apeiros_> erikh: yes. where is that code? it'll likely end up being in the controller, which is the wrong place.
<veex> so the :generate_uid are symbols. How does Ruby know that generate creates a new uid?
<erikh> apeiros_: right where he has it now
<erikh> he could make a model method to do it too
<erikh> but that seems kind of silly.
<erikh> this is why I hate rails.
* erikh grins.
<apeiros_> erikh: then you'd have to call something else than save! and remember that
<veex> do all parameters have to be symbols of the type :symbol notation?
<apeiros_> and given that this is a piece of code to extend all models, and you could potentially have many of these, that way of dealing with it won't scale…
<erikh> fair enough, I really don't want to think about this too hard.
<erikh> the where has to go though
<apeiros_> well, proper solution IMO would be to have proper callbacks to deal with insertion failures.
<erikh> veex: it depends on the method.
<apeiros_> so you could hook up on these and cause a retry. but rails doesn't have them.
<erikh> mysql/pg/etc will raise
<erikh> I think.
<apeiros_> yes
<apeiros_> again, the problem is with the location of the rescue.
<erikh> I disagree
<erikh> but meh
<apeiros_> with what?
<apeiros_> that the controller is the wrong place to rescue that stuff?
<apeiros_> note that self.uid = "foo" does not issue a save
<apeiros_> yeah, that doesn't do a thing
gouthamvel has quit [Ping timeout: 260 seconds]
<erikh> meh.
<veex> apeiros_, would you rather go with C# razor views?
<erikh> the self.save! should work.
<apeiros_> veex: I'd require a huge payment to even consider touching stuff from m$
<erikh> C# is nice stuff man
<apeiros_> erikh: self.save! won't invoke that piece of code
<erikh> no, right there
<apeiros_> that rescue will not be hit when you try to save that model
<erikh> where I do the insert
<erikh> why not?
<apeiros_> because in that piece of code, there is no insert
<apeiros_> the value is only set in the ruby object
<erikh> meh
<erikh> stupid rails.
<apeiros_> the insert is done when you do save/save!. and save/save! does not call that code.
<erikh> you can't call the save *right there*?
<apeiros_> yes, you could. it'd be horrible :)
<erikh> well that's what I've been suggesting this whole time
<apeiros_> "oh you create a new instance of this model? let me save it to the database right away, no matter whether you actually want that!" :D
<erikh> bah
gouthamvel has joined #ruby-lang
<apeiros_> also, since after_initialize is also run after deserializing when reading from the db, it'd mean every select issues an insert too ;-)
* dhoss wouldn't have a problem with non-lezy saving
<erikh> I would too
<dhoss> otherwise i'd put it in a transaction
<erikh> hrm
<erikh> that's a really good idea.
<erikh> transaction, insert, rollback immediately
<apeiros_> I don't think it'd work out as you think it would
<dhoss> er it does every time i do it
<apeiros_> with AR?
<dhoss> no, so i could be missing something
<apeiros_> pears & apples then. I'm not arguing that there are other approaches. but with ARs way of modeling things, I doubt that approach could work.
toretore has joined #ruby-lang
<apeiros_> one of the problems with rails is (IMO) that it shies away from repeating work. i.e. it wants validations only in one place (the model). but that simply leaves soooo many things uncovered and is hiding from reality.
<erikh> it tries to get rid of the database too much
<erikh> it's unfortunate.
<apeiros_> mhm
<erikh> I understand the rationale, but lord, it's unfortunate.
<apeiros_> database abstraction is a noble goal. but it's a very leaky abstraction.
<erikh> I'm starting to play with cassandra more
<erikh> it's a pretty neat system.
francisfish has quit [Remote host closed the connection]
saLOUt has joined #ruby-lang
<AlHafoudh> apeiros_ erikh veex : i have updated the code like this: https://gist.github.com/a1d67bd1912c949425c3 , what do you think?
<veex> could you transmit a large piece of data over a rest API connection? Let's say a large bitmap?
qwerxy has joined #ruby-lang
<veex> validate on save too
_br_ has quit [Quit: Bye, thanks for all the fish.]
<apeiros_> AlHafoudh: still my remarks on define_method and exists?
* veex falls asleep..thank you apeiros_ and erik :)
<AlHafoudh> apeiros_: I did not see the whole log, sorry, I am going to look at it
dejongge has quit [Ping timeout: 252 seconds]
_br_ has joined #ruby-lang
<apeiros_> I think I wouldn't use define_method to begin with. I'd have an attr_accessor for uid_size and use the ivar.
<AlHafoudh> apeiros_: how do you mean that?
ronnie_ has quit [Quit: Leaving...]
srbartlett has joined #ruby-lang
jmeeuwen has quit [Quit: Disconnecting from stoned server.]
jmeeuwen has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
seanstickle has joined #ruby-lang
KillerFox has quit [Ping timeout: 265 seconds]
umttumt has quit [Remote host closed the connection]
KillerFox has joined #ruby-lang
gix has quit [Ping timeout: 265 seconds]
twelvechairs has joined #ruby-lang
gix has joined #ruby-lang
srbartlett has quit [Remote host closed the connection]
<apeiros_> AlHafoudh: I mean a plain `def …` instead of define_method would do
<AlHafoudh> apeiros_: I cannot do that there, its called from class method
<AlHafoudh> apeiros_: has_uid is class method
<apeiros_> yes you can do that. define_method doesn't define the method in a different scope than def does.
<apeiros_> ah well
gouthamvel has joined #ruby-lang
dalekurt has joined #ruby-lang
<burgestrand>  hm, it can though, can’t it?
<burgestrand> kind of like the difference between alias and alias_method
<apeiros_> you'd have to provide a different receiver
<apeiros_> which he doesn't
<apeiros_> I'd go with an InstanceMethods module anyway.
<burgestrand> I love nitpicking, you know that :d
xiaodong has quit [Ping timeout: 244 seconds]
qwerxy has quit [Quit: offski]
xiaodong has joined #ruby-lang
outsmartin has joined #ruby-lang
sailias has joined #ruby-lang
brushbox has quit [Quit: Leaving.]
<erikh> I thought he was doing it to get a closure
stardiviner has joined #ruby-lang
qwerxy has joined #ruby-lang
ruurd has joined #ruby-lang
sailias has quit [Ping timeout: 246 seconds]
<bnagy> RAWR holy crap I have x64 debugging via FFI
<bnagy> (on windows, so nobody cares)
<lianj> bnagy: ?
gouthamvel has left #ruby-lang [#ruby-lang]
ruurd has quit [Quit: Leaving...]
<bnagy> lianj: FFI wrapper for the windows debugging engine, now works on x86 and x64
<bnagy> nevermind, I'm just happy :)
<lianj> oh sweet :)
<lianj> (if i was on windows)
<bnagy> I had given up on x64 until I suddenly realised there's a 64 bit jruby
ryez has joined #ruby-lang
msaffitz has joined #ruby-lang
zmack has joined #ruby-lang
wpaulson has joined #ruby-lang
zmack has quit [Remote host closed the connection]
adambeynon has joined #ruby-lang
TDJACR has quit [Ping timeout: 250 seconds]
TDJACR has joined #ruby-lang
gouthamvel has joined #ruby-lang
TDJACR has quit [Read error: Operation timed out]
gouthamvel has left #ruby-lang [#ruby-lang]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
TDJACR has joined #ruby-lang
zz_wasnotrice is now known as wasnotrice
chrismcg is now known as zz_chrismcg
msaffitz has quit [Quit: Computer has gone to sleep.]
wpaulson has joined #ruby-lang
jxie has joined #ruby-lang
burgestrand has quit [Read error: Connection reset by peer]
ruby-lang349 has joined #ruby-lang
carlosed has joined #ruby-lang
twelvechairs has quit [Read error: Connection reset by peer]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
deryl has joined #ruby-lang
carlosed has quit [Client Quit]
retro|cz has quit [Ping timeout: 265 seconds]
zmack has joined #ruby-lang
wpaulson has joined #ruby-lang
ruurd has joined #ruby-lang
ruurd has quit [Client Quit]
Jake232 has joined #ruby-lang
francisfish has joined #ruby-lang
zz_chrismcg is now known as chrismcg
macmartine has joined #ruby-lang
chrismcg is now known as zz_chrismcg
jmeeuwen has quit [Ping timeout: 252 seconds]
yannis has quit [Quit: yannis]
qwerxy has quit [Quit: offski]
tomb_ has joined #ruby-lang
wpaulson_ has joined #ruby-lang
macmartine has quit [Quit: macmartine]
Hakon|mbp has joined #ruby-lang
wpaulson has quit [Ping timeout: 265 seconds]
wpaulson_ is now known as wpaulson
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
xiaodong has quit [Ping timeout: 240 seconds]
xiaodong has joined #ruby-lang
wasnotrice is now known as zz_wasnotrice
yannis has joined #ruby-lang
neoesque has quit [Quit: Bye!]
Asher1 has quit [Quit: Leaving.]
macmartine has joined #ruby-lang
Asher- has joined #ruby-lang
ryez has quit [Ping timeout: 245 seconds]
gentz has quit [Ping timeout: 248 seconds]
MouseTheLuckyDog has quit [Quit: Leaving]
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
gentz has joined #ruby-lang
deryl has quit [Quit: Time To Go, Too Bad, So Sad!]
deryl has joined #ruby-lang
mistym has joined #ruby-lang
deryl has quit [Client Quit]
deryl has joined #ruby-lang
thone_ has joined #ruby-lang
Asher- is now known as Asher
thone has quit [Ping timeout: 248 seconds]
Z33K|Lux has joined #ruby-lang
Z33K|Lux has quit [Client Quit]
Z33K|Lux has joined #ruby-lang
Z33K|Lux has quit [Client Quit]
zmack has quit [Remote host closed the connection]
lsegal has joined #ruby-lang
felipe__ has joined #ruby-lang
gregf has quit [Quit: WeeChat 0.3.8]
Hakon|mbp has quit [Read error: Connection reset by peer]
brunocoelho has joined #ruby-lang
andrew__ has joined #ruby-lang
sailias has joined #ruby-lang
jbsan has quit [Quit: jbsan]
solars has joined #ruby-lang
andrew__ has quit [Ping timeout: 252 seconds]
jbsan has joined #ruby-lang
umttumt has joined #ruby-lang
sora_h is now known as s0ra_h
agilob has joined #ruby-lang
agilob has quit [Client Quit]
andrew__ has joined #ruby-lang
sailias has quit [Ping timeout: 246 seconds]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
rippa has joined #ruby-lang
jmeeuwen has joined #ruby-lang
drollwit has joined #ruby-lang
workmad3 has joined #ruby-lang
gouthamvel has joined #ruby-lang
wpaulson has quit [Ping timeout: 248 seconds]
gouthamvel has left #ruby-lang [#ruby-lang]
imperator has joined #ruby-lang
saLOUt has quit [Quit: Konversation terminated!]
saLOUt has joined #ruby-lang
ryanf has joined #ruby-lang
gregf has joined #ruby-lang
wpaulson has joined #ruby-lang
wpaulson_ has joined #ruby-lang
JohnBat26 has joined #ruby-lang
selvakumaran has joined #ruby-lang
xiaodong has quit [Quit: leaving]
wpaulson has quit [Ping timeout: 240 seconds]
wpaulson_ is now known as wpaulson
francisfish has quit [Remote host closed the connection]
qwerxy has joined #ruby-lang
umttumt has quit [Remote host closed the connection]
wpaulson has quit [Ping timeout: 248 seconds]
Jake232 has quit [Quit: Computer has gone to sleep.]
<imperator> what's the "right" way to exit a ruby process from within a ruby process using C? rb_f_exit?
<samuelkadolph> imperator: rb_exit(int)
saLOUt has quit [Ping timeout: 265 seconds]
selvakumaran has quit [Ping timeout: 246 seconds]
<rue> 1/0;
<imperator> *splosion!*
tyman has joined #ruby-lang
tyman has quit [Remote host closed the connection]
agilobable2 has joined #ruby-lang
flak has joined #ruby-lang
rippa has quit [Read error: Connection reset by peer]
flak has quit [Client Quit]
agilobable2 has quit [Client Quit]
rippa has joined #ruby-lang
agilob has joined #ruby-lang
tyman has joined #ruby-lang
qwerxy has quit [Ping timeout: 248 seconds]
francisfish has joined #ruby-lang
selvakumaran has joined #ruby-lang
qwerxy has joined #ruby-lang
<imperator> samuelkadolph, thanks
wpaulson has joined #ruby-lang
seanstickle has quit [Quit: Nihil sub sole novum]
<imperator> hm, can't seem to trigger at_exit handlers when creating a remote thread in a ruby process :(
symm- has joined #ruby-lang
agilob has quit [Quit: Lost terminal]
<symm-> why is it so difficult to read a text file in ruby?
agilob has joined #ruby-lang
<imperator> symm-, IO.read(file)
<symm-> it's utf-8
<imperator> symm-, have a specific problem?
<symm-> where do I specify utf-8?
<imperator> IO.foreach(file, :encoding => 'UTF-8')
<lianj> File.open('foo', 'r:utf-8'){|f| f.read }
<symm-> lianj: that worked
<symm-> now, why in the world isn't there a File.read('foo', 'r:utf-8') ?
<symm-> the mind boggles
<symm-> I swear to good I look this shit up every time.
<symm-> sorry... wanted to vent
workmad3 has quit [Ping timeout: 252 seconds]
<samuelkadolph> Because File.read is for simple uses
<lianj> my ruby reads uf-8 by default
<symm-> ... but of course there's a readlines()
<samuelkadolph> lianj: Only because your terminal locale is UTF8
<lianj> ofcourse, because thats sane
<symm-> bleh, I am honestly pissed. I know you don't look a gift horse in the mouth, but I wanted to do write a "simple" one off script to do some text stuff, and I've been sitting here trying things out and reading blog posts for 30 minutes
<symm-> to read a fracking utf-8 string from a file.... seriously /me shakes head
<symm-> sorry.. peace out
symm- has left #ruby-lang ["Leaving..."]
<lianj> o/
<imperator> time for taco bell
felipe__ has quit [Ping timeout: 246 seconds]
burgestrand has joined #ruby-lang
<rue> Mm, Taco Bell would be considered great mexican food over here
gouthamvel has joined #ruby-lang
<rue> Not Chipotle, though. I never understood what people saw in those bland rice bundles.
<rue> Well, actually, that probably means they’d like it too
neocoin has quit [Remote host closed the connection]
<whitequark> imperator: for what do you need that?
<whitequark> not taco bell, but at_exit and CreateRemoteThread.
timepilot has joined #ruby-lang
francisfish has quit [Remote host closed the connection]
VegetableSpoon has joined #ruby-lang
AlHafoudh has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
igotnolegs has joined #ruby-lang
JohnBat26 has quit [Read error: No route to host]
JohnBat26 has joined #ruby-lang
imperator has quit [Ping timeout: 240 seconds]
fgomez has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
ryanf has quit [Ping timeout: 260 seconds]
perryh_away is now known as perryh
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
imperator has joined #ruby-lang
<imperator> whitequark, trying to kill a ruby process nicely, so that it calls at_exit handlers
JohnBat26 has quit [Ping timeout: 265 seconds]
francisfish has joined #ruby-lang
zz_wasnotrice is now known as wasnotrice
drollwit has quit [Remote host closed the connection]
flak has joined #ruby-lang
flak has quit [Client Quit]
wasnotrice is now known as zz_wasnotrice
ryanf has joined #ruby-lang
qwerxy has quit [Quit: offski]
rippa has quit [Ping timeout: 252 seconds]
wpaulson has joined #ruby-lang
ryanf has quit [Ping timeout: 265 seconds]
benanne has quit [Quit: kbai]
Maidomax has quit [Ping timeout: 240 seconds]
A124 has quit [Quit: Leaving.]
saLOUt has joined #ruby-lang
zz_wasnotrice is now known as wasnotrice
<erikh> hello
<erikh> File.read has open options as a fourth argument
<erikh> it's in the docs.
<erikh> File.read is also encoding-capable.
<erikh> anyhow.
<erikh> imperator: abort?
rippa has joined #ruby-lang
<imperator> erikh, tried rb_f_abort, which kills the process, but doesn't seem to call the at_exit handler
<erikh> well crap
qwerxy has joined #ruby-lang
ttilley has quit [Ping timeout: 245 seconds]
selvakumaran has quit [Remote host closed the connection]
<rue> erikh: Think he mighta read #read doc.
_madcoder_ has joined #ruby-lang
<rue> Which is easy to do since that’s what ri gives when you ask about File.read…
neocoin has joined #ruby-lang
ttilley has joined #ruby-lang
<erikh> aha
nisstyre has quit [Quit: Leaving]
<erikh> imperator: you should help me on my process monitor!
wpaulson has quit [Ping timeout: 246 seconds]
<erikh> bbiaw
<imperator> rue, ri weirdness https://gist.github.com/2945488
nisstyre has joined #ruby-lang
<andrewvos> imperator: Seems the colour codes aren't working for some reason :/
wpaulson has joined #ruby-lang
A124 has joined #ruby-lang
nisstyre has quit [Remote host closed the connection]
<erikh> imperator: load ansi.sys
<erikh> or use a proper terminal instead of cmd.exe
zz_chrismcg is now known as chrismcg
<weeb1e> Is this the best way to split off lines with regex and still retain the remainder of the string? lines = []; while line = s.slice!(/^[^\n]+\n/); lines << line.chomp; end
<imperator> erikh, tried it with powershell, didn't go well
retro|cz has joined #ruby-lang
<andrewvos> imperator: I think Console is something that is usable on windows
ttilley has quit [Ping timeout: 245 seconds]
wasnotrice is now known as zz_wasnotrice
ttilley has joined #ruby-lang
workmad3 has joined #ruby-lang
benanne has joined #ruby-lang
nisstyre has joined #ruby-lang
<imperator> andrewvos, no luck, though i like the tabbed consoles :)
<andrewvos> yeah it's a lot better than cmd.exe
<deryl> hell 4DOS/4NT is better than cmd.exe
<andrewvos> imperator: Weird that. Trying to remember if there is sort of bash_profile sort of stuff on Windows
<andrewvos> imperator: Is TERM set to anything?
timepilot has quit [Quit: timepilot]
<erikh> imperator: yeah, you just need to load up ansi.sys
<erikh> that should resolve your color issues.
<erikh> alternatively rdoc might have a thing to turn them off. you should speak with drbrain.
saLOUt has quit [Quit: Konversation terminated!]
<imperator> andrewvos, no
<imperator> erikh, just not going to worry about it for now
<imperator> but thanks
M4g1c5t0rM has joined #ruby-lang
<veex> I have a problem installing the pg gem on amazon ec2. I've installed the libpg-dev library too and install it using sudo gem install pg with--opt--/usr/lib/ etc
arooni-mobile has quit [Ping timeout: 245 seconds]
saLOUt has joined #ruby-lang
agilobable2 has joined #ruby-lang
agilobable2 has quit [Client Quit]
drollwit has joined #ruby-lang
tbuehlmann has quit []
wpaulson_ has joined #ruby-lang
rippa has quit [Ping timeout: 240 seconds]
drollwit has quit [Remote host closed the connection]
imperator has quit [Quit: Leaving]
sepp2k has joined #ruby-lang
zmack has joined #ruby-lang
drollwit has joined #ruby-lang
sandbags has joined #ruby-lang
sandbags has quit [Changing host]
sandbags has joined #ruby-lang
workmad3 has quit [Ping timeout: 240 seconds]
zmack has quit [Remote host closed the connection]
sepp2k has quit [Ping timeout: 246 seconds]
drollwit has quit [Remote host closed the connection]
perryh is now known as perryh_away
ryanf has joined #ruby-lang
Bwild has quit [Ping timeout: 246 seconds]
zz_wasnotrice is now known as wasnotrice
sepp2k has joined #ruby-lang
wpaulson has quit [Ping timeout: 244 seconds]
<rue> veex: Sounds exciting
<rue> A problem, you say.
<erikh> rue: what, watching arnie blow shit up isn't enough for you? you have to come into irc too?
<erikh> :P
<rue> Doing 3 things at once is single-tasking for me.
<erikh> nerd
<rue> I’m watching football, Predator, IRCing, and also reading some internet
<rue> Wife always complains when I switch between two or three shows, but it’s not like you can’t follow along
<erikh> eh I am very much a single-tasker
<erikh> I find distractions very easily.
<rue> Just do so many things that you can’t fit in any distractions
<erikh> it doesn't work that way for me
<erikh> there's considerable "spin up" time.
<rue> You’re not doing many enough things
<erikh> haha
<erikh> anyhow, off to the coffee shop.
<erikh> bbiaw
mssola has quit [Quit: Konversation terminated!]
wpaulson has joined #ruby-lang
qwerxy has quit [Quit: offski]
<apeiros_> is it possible that $stdin.raw is totally whacko on OSX? (I did a require 'io/console' first…)
<apeiros_> oh
<rue> Oh
<apeiros_> my fault… x is an actually existing command…
<apeiros_> (in bash)
<apeiros_> and my little script terminated early :)
francisfish has quit [Remote host closed the connection]
wasnotrice is now known as zz_wasnotrice
fayimora has quit [Ping timeout: 264 seconds]
<apeiros_> well, it's still whacko. it can deadlock :D
<apeiros_> http://pastie.org/4104832 <-- changing the window size can result in sudden deadlocks.
fayimora has joined #ruby-lang
msaffitz has joined #ruby-lang
<sandbags> i'm a little puzzled. I have an array of words with a couple containing accented characters. ary.grep(/[^a-z]/i) picks them out. Yet ary.grep(/[a-z]/i) doesn't exclude them. What am I missing?
<apeiros_> /[a-z]/i means "must include *one* character which is a-z
<andrewvos> rue: Explain your tweet please, Sir.
<sandbags> awww crap, yes
<sandbags> thanks apeiros_
<apeiros_> it doesn't mean "the whole string must consist only of characters a-z
<rue> andrewvos: Which one? There’re quite a few that don’t make sense
<sandbags> lazy thinking
<andrewvos> The latest one.
<sandbags> ^ and $ and there we go
<apeiros_> sandbags: um, no
<apeiros_> you want \A and \z
<apeiros_> ^ and $ are begin/end of line, not of string.
<sandbags> apeiros_: /^[a-z]+$/ did the trick
<sandbags> apeiros_: in this case, same thing
<apeiros_> *sob*
<apeiros_> whatever
<sandbags> apeiros_: quite
gouthamvel has joined #ruby-lang
<rue> andrewvos: “Football is a game played by 22 players, and in the end, Germany wins”
<apeiros_> rue: except when switzerland beats them 5:3
<andrewvos> ahh
<veex> @rue I've had the problem for a few days nad it's scrapped my install of a few rail clones... I have looked through every stack overflow article about it
<apeiros_> also, isn't that soccer?
<rue> veex: Describing the problem would probably help
<rue> In a gist or something.
<andrewvos> You just thought you would insert "nad" into that sentence?
<andrewvos> Childish
<rue> apeiros_: Only to suckers
<apeiros_> 'murricans?
wpaulson__ has joined #ruby-lang
M4g1c5t0rM has quit [Read error: Connection reset by peer]
wpaulson_ has quit [Ping timeout: 246 seconds]
fayimora has quit [Ping timeout: 264 seconds]
sailias has joined #ruby-lang
<erikh> veex: apt-get install libpq
<erikh> try again.
msaffitz has quit [Ping timeout: 240 seconds]
fayimora has joined #ruby-lang
msaffitz has joined #ruby-lang
<veex> did that
Carnage\ has joined #ruby-lang
sailias has quit [Quit: Leaving.]
wpaulson_ has joined #ruby-lang
<veex> I removed libpg5 and reinstalled: sudo apt-get install libpq-dev
<veex> Still the same error!
fayimora has quit [Ping timeout: 246 seconds]
* veex steam coming out of meh ears
wpaulson has quit [Ping timeout: 246 seconds]
wpaulson_ is now known as wpaulson
<rue> libpq
<rue> libpg
<erikh> libpq.
arooni-mobile has joined #ruby-lang
<veex> bitnami@ip-10-245-31-241:~/apps/BaseApp2$ sudo apt-get install libpg
<veex> Reading package lists... Done
<veex> Building dependency tree
<veex> Reading state information... Done
<veex> E: Unable to locate package libpg
<erikh> use a pastebin, please.
<rue> libpg isn’t libpq :)
<erikh> and it's libpq-dev you want, or maybe libpq5.
<erikh> err, libpq5-dev
<rue> Ahh, Debil/Linux
<erikh> that should work..
<erikh> not sure why it wouldn't. are you passing any options to gem install?
<veex> No
<erikh> rue: can I get you to stare at some C?
<erikh> it's pretty small so far.
<rue> Sure (Your results may vary. void* where prohibited.)
<erikh> heh.
arooni-mobile has quit [Read error: Connection reset by peer]
fayimora has joined #ruby-lang
<erikh> it's my mruby binding... it's totally not finished but I'm still looking for style comments.
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
gouthamvel has left #ruby-lang [#ruby-lang]
yxhuvud has quit [Ping timeout: 260 seconds]
<apeiros_> mruby seems to be quite a spark for imagination
<erikh> ping
<erikh> (had to close my laptop for a minute)
<erikh> apeiros_: it's a pretty neat runtime
<rue> erikh: Not terribly keen on #including .c’s. There’s a typedecl mismatch from char* to ngx_str_t*; also, use const wherever you possibly can
<erikh> I'll have to look up const -- not entirely sure what it does yet.
<veex> I'm going to have to go ahead and ask you to log into my ec2 instance erikh or apeiros_ ........
<erikh> veex: that's not a good idea, especially in a public channel.
<apeiros_> veex: sorry, not interested
<erikh> I'm also pretty preoccupied
<erikh> the best way to learn is to try, not to ask.
<apeiros_> AAAAAAH!
<veex> And I'll bring some people over and ahhh get the (wall diveder from Office Space) taken care of
<apeiros_> man, I'm so sick of inconsistent core/stdlib ruby API >:-(
<apeiros_> Queue#push only accepts a single arg…
<veex> These goddamn TPS reports!
<erikh> rue: the include of the .c file is an unfortunate side effect of nginx's build system.
<rue> Ah, yeah
<veex> You guys are gangsta's
* apeiros_ is not sure whether that's a compliment…
<rue> I tended to use .inl for those things just for visual separation, but I do not remember — or remember if I knew —how nginx modules work
<rue> apeiros_: I believe it is what the youth refer to the hip as
<rue> erikh: Some old article I had in my bookmarks: http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=181
<rue> "const correctness" is probably a good search term
<rue> And, of course, you may be limited by the module API in that, too.
<erikh> yeah, I found a couple of articles with a quick google.
<erikh> well I haven't done a lot of nginx integration yet
<veex> http://youtu.be/rL9ihXiFAko This one's especially for apeiros_
<apeiros_> that looks like from the 80thies…
<rue> erikh: I’d always use braces for if/else/while etc. unless it’s literally while(true) blah;
<veex> The lyrics are timeless. Shakespeare typing.
<erikh> ah, yeah.
<erikh> I'll fix that.
<erikh> dominikh caught a few bugs too, so lots of changes to make.
<erikh> rue: thank you!
<erikh> rue: I have a curiosity if you're ok with talking about it -- what do you generally work on? I never hear about it.
<rue> Nothing right now
seanstickle has joined #ruby-lang
<rue> P
hinbody has joined #ruby-lang
<rue> Er. Probably won’t accept anything until August still.
<erikh> contracting?
perryh_away is now known as perryh
msaffitz has quit [Quit: Computer has gone to sleep.]
<rue> Yeah, unless something really interesting comes up. There’s this one consulting company here that a couple of the guys keep trying to get me to…they do Scala/Clojure/F# stuff (and also want to expand to Ruby/Python/frontend), so it might be an interesting change
<seanstickle> Scala/Clojure/ and F#?
<seanstickle> What a weird mix.
<seanstickle> I'd have expected Haskell maybe. But not a .Net language.
<erikh> rue: oh, neat.
<rue> Haskell, really?
<rue> Nobody actually does Haskell outside SF and Seattle
<seanstickle> F# is just a CLRed version of Haskell/ML with less awesomeness.
<rue> (*Slight exaggeration)
<Mon_Ouie> F# looks a lot like OCaml
<rue> seanstickle: The CLR is the important part
<seanstickle> Or the terrible part, depending on your point of view.
brunocoelho has quit [Remote host closed the connection]
saLOUt has quit [Quit: Konversation terminated!]
<rue> Well, it’s still important whether good or bad :)
<erikh> .NET libraries are pretty f'n killer.
workmad3 has joined #ruby-lang
M4g1c5t0rM has joined #ruby-lang
saLOUt has joined #ruby-lang
<seanstickle> Yes, particularly good on my Mac.
<seanstickle> Oh wait, no. Maybe I was thinking about my Linux box.
<seanstickle> Oh wait no.
<seanstickle> And don't get me started on Mono.
dalekurt_ has joined #ruby-lang
A1241 has joined #ruby-lang
saLOUt has quit [Client Quit]
mistym_ has joined #ruby-lang
Defusal_ has joined #ruby-lang
saLOUt has joined #ruby-lang
workmad3 has quit [Ping timeout: 246 seconds]
Criztian has quit [Remote host closed the connection]
<rue> Oo, mono is totally great
M4g1c5t0rM has quit [*.net *.split]
A124 has quit [*.net *.split]
mistym has quit [*.net *.split]
yannis has quit [*.net *.split]
outsmartin has quit [*.net *.split]
dalekurt has quit [*.net *.split]
Defusal has quit [*.net *.split]
dalekurt_ is now known as dalekurt
yannis has joined #ruby-lang
Axsuul has quit [Remote host closed the connection]
M4g1c5t0rM has joined #ruby-lang
outsmartin has joined #ruby-lang
heftig has quit [Ping timeout: 272 seconds]
heftig has joined #ruby-lang
heftig has quit [Client Quit]
<rue> Hrm, didn’t go for the bait.
<seanstickle> I'm not *that* crazy
cantonic has joined #ruby-lang
vesan_ has joined #ruby-lang
<apeiros_> hm, \e[0J is bad to clear the screen :-S
vesan has quit [Read error: Connection reset by peer]
<apeiros_> damn
<apeiros_> http://pastie.org/4105326 - how the hell do I properly redraw upon a SIGWINCH?
Axsuul has joined #ruby-lang
<apeiros_> (draft code, don't mind the crappiness)
neocoin has quit [Remote host closed the connection]
<apeiros_> (only tested on OSX 10.7 too, and I think you've to manually set the xterm to be xterm-256color, default is still xterm-color iirc)
Weems has quit [Read error: Connection reset by peer]
ryanf has quit [Quit: leaving]
Carnage\ has quit []
frem has quit [Quit: Farewell!]
heftig has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
<apeiros_> nobody? :(
<apeiros_> the code is runnable like that. the problem exhibits when trying to resize the window…
Codif has joined #ruby-lang
xtagon has joined #ruby-lang
Codif has quit [Remote host closed the connection]
ben_m has joined #ruby-lang
solars has quit [Ping timeout: 265 seconds]
brushbox has joined #ruby-lang
benanne has quit [Quit: kbai]
jeremyolliver has joined #ruby-lang
wpaulson__ has quit [Read error: Connection reset by peer]
MouseTheLuckyDog has joined #ruby-lang
wpaulson has joined #ruby-lang
<MouseTheLuckyDog> I'm getting a weird message runniong a script.
<MouseTheLuckyDog> WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.8.0
jeremyolliver has quit [Client Quit]
jeremyolliver has joined #ruby-lang
<MouseTheLuckyDog> Funny since the script does not use Nokogiri just hpricot, but hpricot may call NokoGiri. Rhe question is how to fix this?
burntbit has joined #ruby-lang
srbartlett has joined #ruby-lang
<veex> Hey do you guys know destroyallsoftware.com? They use a shell in that demo that runs ruby immediately to debug. How do you do that?
saLOUt has quit [Quit: Konversation terminated!]
Jade has quit [Read error: Connection reset by peer]
heftig has quit [Ping timeout: 245 seconds]
mistym_ has quit [Remote host closed the connection]
<apeiros_> MouseTheLuckyDog: reinstall/build the nokogiri gem
s0ra_h is now known as sora_h
mistym has joined #ruby-lang
heftig has joined #ruby-lang
perryh is now known as perry
<xtagon> veex: Pry maybe?
outsmartin has quit [Quit: Leaving.]
<xtagon> veex: Can you link to the video you're talking about?
wpaulson has quit [Read error: Connection reset by peer]
burntbit has quit [Ping timeout: 246 seconds]
burntbit has joined #ruby-lang
xtagon has quit [Quit: leaving]
wpaulson has joined #ruby-lang
perry is now known as perryh_away
apeiros_ has quit [Remote host closed the connection]
publicvoid__ has joined #ruby-lang
jeremyolliver has quit [Quit: Page closed]
jperry2 has joined #ruby-lang
pablo_ has joined #ruby-lang
heftig has quit [Quit: leaving]
publicvoid_ has quit [Ping timeout: 246 seconds]
deryldoucette has joined #ruby-lang
ruby-lang349 has quit [Ping timeout: 245 seconds]
deryl has quit [Ping timeout: 240 seconds]
deryldoucette is now known as deryl
pablo_ has quit [Quit: Ex-Chat]
tomb_ has quit [Quit: Computer has gone to sleep.]
xtagon has joined #ruby-lang
tomb_ has joined #ruby-lang
woollyams has joined #ruby-lang
cored has quit [Ping timeout: 255 seconds]
cantonic_ has joined #ruby-lang