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
davidbalbert is now known as davidbalber|away
lcdhoffman has quit [Quit: lcdhoffman]
WillMarshall has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
anachronistic has joined #ruby-lang
anachronistic has quit [Client Quit]
tonni has quit [Read error: Connection reset by peer]
tonni has joined #ruby-lang
imajes has quit [Ping timeout: 256 seconds]
imajes has joined #ruby-lang
justinram has quit [Remote host closed the connection]
thatdutchguy has quit [Remote host closed the connection]
dous_ has joined #ruby-lang
dous_ has quit [Changing host]
dous_ has joined #ruby-lang
nertzy has joined #ruby-lang
dous has quit [Ping timeout: 276 seconds]
pkrnj has joined #ruby-lang
datanoise has quit [Ping timeout: 276 seconds]
bluepojo has quit [Quit: Leaving.]
bluepojo has joined #ruby-lang
thinkdevcode has quit [Remote host closed the connection]
nertzy has quit [Quit: This computer has gone to sleep]
rue|w has joined #ruby-lang
rue|w has quit [Ping timeout: 240 seconds]
gregmoreno has quit [Remote host closed the connection]
tomzx_ has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
runeb has joined #ruby-lang
ddd has quit [Ping timeout: 245 seconds]
cultureulterior_ has quit [Quit: cultureulterior_]
ddd has joined #ruby-lang
runeb has quit [Ping timeout: 240 seconds]
CaptainJet has joined #ruby-lang
<zenspider> ddd: I'm not speaking out against metaprogramming... (which I've done--and plenty... just google: zenspider clevar)... I'm speaking out against refinements
<zenspider> steveklabnik: to be fair... kay thinks he should have _emphasized_ messages over objects. he doesn't have a problem with OO. see fonc for plenty of examples of how kay isn't fixing OO they way he originally designed it.
<steveklabnik> he said he got the size of objects wrong
<steveklabnik> you should think of subsystems as objects
<steveklabnik> like your tcp stack
<steveklabnik> this was very recent
<steveklabnik> you'r referencing his older stuff, which is also good. the 'i didnt have C++/Java in mind' stuff
<zenspider> I'm also referencing stuff he's publishing RIGHT NOW. combined object / lambda architecture is still the OO we know and love
<steveklabnik> "One of the mistakes that we made years ago is that we made objects too small." (~00:26)
<steveklabnik> true
<steveklabnik> i'm really excited tos ee how VIPR turns out
<steveklabnik> personally
erichmenge has joined #ruby-lang
charliesome has joined #ruby-lang
mistym has quit [Remote host closed the connection]
<steveklabnik> wait, hmm, was that the name? the crazy DSL stuff?
<steveklabnik> VPRI
<steveklabnik> not vipr
<zenspider> heh
ddd has quit [Quit: Leaving.]
<steveklabnik> OS + GUI + tools in under 10kloc
<zenspider> vpri is just their firm. fonc is the overarching project. cola is an implementation detail
<zenspider> under 30kloc
datanoise has joined #ruby-lang
<steveklabnik> roger
<steveklabnik> i check up every once in a while
GarethAdams has joined #ruby-lang
<zenspider> they seriously don't publish enough... but one should be due shortly given the month
<zenspider> holy crap... MBA update is 130 meg. usually they're like... 5
pkrnj has quit [Quit: Computer has gone to sleep.]
<zenspider> bbl
jxie has quit [Ping timeout: 264 seconds]
Kyril has joined #ruby-lang
datanoise has quit [Ping timeout: 260 seconds]
jperry2 has joined #ruby-lang
jxie has joined #ruby-lang
erichmenge has quit [Read error: Connection reset by peer]
erichmenge has joined #ruby-lang
methods has joined #ruby-lang
ttilley has quit [Quit: ttilley]
ttilley has joined #ruby-lang
methods has left #ruby-lang [#ruby-lang]
bfreeman has quit [Quit: bfreeman]
ananna has quit [Remote host closed the connection]
jperry2 has quit [Quit: jperry2]
arubin_ has joined #ruby-lang
ttilley has quit [Quit: ttilley]
setmeaway has joined #ruby-lang
mjio has quit [Quit: Computer has gone to sleep.]
GarethAdams has quit [Quit: Leaving...]
datanoise has joined #ruby-lang
Madis has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121026125834]]
tomzx_ has quit [Ping timeout: 246 seconds]
mrsolo has quit [Quit: Leaving]
<Spaceghostc2c> The real metaprogrammming developer always know where self is. That's one of the first hurdles to being an accomplished metaprogrammer. Otherwise, you're just metabrogramming.
swarley_ has left #ruby-lang [#ruby-lang]
kjr has quit [Quit: kjr]
brianpWins has quit [Quit: brianpWins]
pkrnjevi_ has joined #ruby-lang
jxie_ has joined #ruby-lang
datanoise has quit [Ping timeout: 264 seconds]
pkrnjevi_ is now known as pkrnj
<Spaceghostc2c> bougyman: Looking.
<Spaceghostc2c> bougyman: Why the hell does it say Metabobject
<Spaceghostc2c> Lol.
<bougyman> because in common lisp you have access to the MOP
banisterfiend has quit [Ping timeout: 252 seconds]
<Spaceghostc2c> bougyman: MetaBOBoject.
<Spaceghostc2c> Instead of metaobject.
spuk has joined #ruby-lang
jxie has quit [Ping timeout: 248 seconds]
enebo has quit [Quit: enebo]
stardiviner has joined #ruby-lang
lsegal has joined #ruby-lang
sn0wb1rd has joined #ruby-lang
savage- has quit [Remote host closed the connection]
wyhaines has quit [Remote host closed the connection]
RantriX has joined #ruby-lang
kjr has joined #ruby-lang
CoverSlide|TPFR has quit [Ping timeout: 245 seconds]
tallship has joined #ruby-lang
senekis has quit [Quit: leaving o/]
CoverSlide|TPFR has joined #ruby-lang
lcdhoffman has joined #ruby-lang
Serial_Killer_C has joined #ruby-lang
methods has joined #ruby-lang
mjio has joined #ruby-lang
brianpWins has joined #ruby-lang
Serial_Killer_C has quit [Remote host closed the connection]
kurko_ has joined #ruby-lang
phaedrix_ has quit [Ping timeout: 255 seconds]
methods1 has joined #ruby-lang
methods1 has left #ruby-lang [#ruby-lang]
mistym has joined #ruby-lang
methods has quit [Ping timeout: 246 seconds]
mistym has quit [Read error: Connection reset by peer]
mistym has joined #ruby-lang
Dreamer3 has joined #ruby-lang
Gekz has joined #ruby-lang
Gekz has quit [Changing host]
Gekz has joined #ruby-lang
erichmenge is now known as erichmenge_
savage- has joined #ruby-lang
Guest41156 has quit [Quit: restarting client because for the lulz]
<manveru> in japanese metabo means overweight
Musfuut has joined #ruby-lang
Musfuut is now known as Guest26813
krohrbaugh has quit [Quit: Leaving.]
<Spaceghostc2c> So was that joke intentional?
<erikh> seeing as the cover art doesn't have it, i'd chalk it up to a typo
<manveru> too bad :(
<manveru> would've been such a nice pun :)
<erikh> heh
<manveru> speaking of MOP, one of these days someone gotta fix agora...
<Spaceghostc2c> manveru: It was punintentional though.
<manveru> http://soft.vub.ac.be/research/agora/ -- there's a java prototype, but even java doesn't support code from 1998 anymore
sn0wb1rd has quit [Ping timeout: 265 seconds]
savage- has quit [Quit: savage-]
erichmenge has joined #ruby-lang
erichmenge_ has quit [Remote host closed the connection]
alvaro_o has quit [Quit: Ex-Chat]
savage- has joined #ruby-lang
havenn has joined #ruby-lang
erichmenge_ has joined #ruby-lang
erichmenge_ has quit [Client Quit]
erichmenge_ has joined #ruby-lang
ilyam has quit [Quit: ilyam]
erichmenge has quit [Ping timeout: 252 seconds]
gsav has joined #ruby-lang
erichmenge_ is now known as erichmenge
ottbot has quit [Ping timeout: 246 seconds]
sn0wb1rd has joined #ruby-lang
<erikh> I'm having a really hard time finding a code example
ottbot has joined #ruby-lang
emptyflask has joined #ruby-lang
datanoise has joined #ruby-lang
<manveru> there was something better, but might be dead now
rebelcan has quit [Quit: leaving]
ilyam has joined #ruby-lang
datanoise has quit [Ping timeout: 268 seconds]
methods has joined #ruby-lang
methods has quit [Client Quit]
methods has joined #ruby-lang
ddd has joined #ruby-lang
erichmenge has quit [Quit: ZNC - http://znc.in]
erichmenge has joined #ruby-lang
erichmenge has quit [Client Quit]
erichmenge has joined #ruby-lang
Averna has joined #ruby-lang
arubin_ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<zzak> gateway is back up
<zzak> woot
bfreeman has joined #ruby-lang
phaedrix_ has joined #ruby-lang
vesan has quit [Ping timeout: 260 seconds]
vesan has joined #ruby-lang
ryanf has joined #ruby-lang
savage- has quit [Quit: savage-]
RantriX has quit [Remote host closed the connection]
savage- has joined #ruby-lang
slyphon has quit [Quit: WeeChat 0.3.8]
Aria has joined #ruby-lang
mjio has quit [Quit: Computer has gone to sleep.]
krz has joined #ruby-lang
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
spuk has joined #ruby-lang
ryanf has quit [Read error: Connection reset by peer]
ryanf has joined #ruby-lang
<matti> zzak: ;]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
kurko_ has quit [Quit: Computer has gone to sleep.]
havenn has quit [Ping timeout: 246 seconds]
<zzak> matti: sup
emptyflask has quit [Remote host closed the connection]
havenn has joined #ruby-lang
savage- has quit [Quit: savage-]
savage- has joined #ruby-lang
febuiles has joined #ruby-lang
febuiles has quit [Changing host]
febuiles has joined #ruby-lang
aetcore has quit [Remote host closed the connection]
brianpWins has quit [Quit: brianpWins]
aetcore has joined #ruby-lang
rub has joined #ruby-lang
johan has joined #ruby-lang
johan is now known as Guest89654
kjr has quit [Quit: kjr]
Guest89654 has left #ruby-lang [#ruby-lang]
znz_v has quit [Quit: kill -QUIT $$]
znz_v has joined #ruby-lang
jhn has joined #ruby-lang
<zzak> is a double always 16 digits on 64 bit?
intellitech has joined #ruby-lang
jhn has left #ruby-lang [#ruby-lang]
rohit_ has joined #ruby-lang
dhruvasagar has joined #ruby-lang
<Aria> No, a double is always 80 bits.
<Aria> And NEVER maps to digits exactly.
datanoise has joined #ruby-lang
<zzak> hmm, what is BigDecimal.double_fig supposed to tell me then?
jmena has joined #ruby-lang
<Aria> ... I am honestly terrified of that.
<Aria> WTF does that class have to do with Floats.
<Aria> er, with IEEE Double-precision floats, anyway.
havenn has quit [Remote host closed the connection]
<jmena> Hi! Noob here. I have a little problem. I'm trying to find out where a method from a gem is defined.
<Spaceghostc2c> zzak: Docs. Read more of them.
makifun has joined #ruby-lang
<jmena> say
makifun has quit [Client Quit]
<methods> anyone else have issues installing sqlite3-ruby gem on centos ?
datanoise has quit [Ping timeout: 264 seconds]
<jmena> I mean, the 'say' method.
CaptainJet has quit []
<Aria> Spaceghostc2c: The docs are unclear what that would mean.
nateeeee has joined #ruby-lang
nateeeee has quit [Client Quit]
nateeeee has joined #ruby-lang
<zzak> Spaceghostc2c: I am working on them as we apeak
<zzak> speak
<zzak> thats why i ask
<Aria> Yow, jmena. That class has some topological crazy, so it'll be a bit of a search.
<Spaceghostc2c> Let me locate.
<jmena> Damn.
<Aria> jmena: It's an instance method, so it'll be something included or inherited, to start. But that's a lot of possibilities.
dhruvasagar has quit [Read error: Connection reset by peer]
<jmena> I was wondering what the best way to investigate it is.
<jmena> I tried searching the whole project—no luck.
adamdonahue has joined #ruby-lang
<jmena> I'm guessing it's something defined in one of the dependencies?
<Spaceghostc2c> Aria: It's specifying the number of digits that can be represented.
<Spaceghostc2c> What's hard about that?
<Aria> Spaceghostc2c: the "double" part.
<zzak> what would be the common representation for a 64bit system?
<Spaceghostc2c> Aria: Just the name?
dhruvasagar has joined #ruby-lang
<zzak> for me, it's saying 16
<Aria> Spaceghostc2c: Yeah. Also, which "Float" they mean.
<Aria> Spaceghostc2c: Considering that a Float is something other than that class, despite that class being floating-point.
mistym has quit [Remote host closed the connection]
<Spaceghostc2c> Aria: I think it's system-level.
<zzak> but i dont want to commit an arbitrary result if it's not realistic
<Spaceghostc2c> Go look at the C source.
nateeeee has quit [Client Quit]
<zzak> i am
nateeeee has joined #ruby-lang
<Spaceghostc2c> That's bits, I'd think.
<zzak> look for VpDblFig
<zzak> The BigDecimal.double_fig class method returns the number of digits a Float number is allowed to have
<Aria> Heh.
havenn has joined #ruby-lang
<Aria> Floats don't have digit.
<Aria> They have bits. But they're 80 bits if double, 64 if single.
<Aria> zzak: Why are you asking about digits, anyway?
<zzak> Aria: Just to add an example to the docs
<Aria> Those docs specifically in the stdlib?
<zzak> Aria: For me: BigDecimal.double_fig #=> 16
<jmena> Aria: Thank you! How did you go about finding it?
<zzak> Aria: yes ma'am
<Aria> jmena: I followed the inheritance chain -- I looked in several likely looking included modules, then checked Thor.
<Aria> zzak: Eugh. Good luck?
<zzak> haha, thanks, its probably not necessary
<zzak> but i was curious
<Aria> Yeah. Oy. What a mess -- 16 digits is a decent /guess/ but there's edge cases, since of course, bits don't map to decimal digits.
nateeeee has quit [Quit: Leaving]
<jmena> Aria: But I mean, did you do it manually by browsing Github?
villainate has joined #ruby-lang
<Aria> jmena: Yes. If it was any more complicated, I'd have downloaded the two repos and git grepped them for 'def say'
<jmena> Aria: Good to know. Thank you!
villainate has quit [Client Quit]
villainate has joined #ruby-lang
kitallis has joined #ruby-lang
aetcore has quit []
<villainate> when using ruby threads, if i make a system call to openssl will there be issues with threadsafety?
phaedrix_ has quit [Quit: WeeChat 0.3.9]
<zzak> why not use the OpenSSL module?
<villainate> sure i can do that. i was under the impression that openssl could have issues with thread safety in general.
<burgestrand> If by system call you mean system() or `` (backticks) or %x, or similar, then that in and of itself does not raise any thread safety issues.
<villainate> system()
<villainate> i see
<zzak> yeh i think system() forks a new process
<villainate> i am probably just reading too much into using openssl in a c-implementation
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
<burgestrand> It’s wise to assume that no library explicitly stating thread-safety is thread-safe.
<burgestrand> WIth that said I have no idea if the openssl library is thread-safe or not.
<Aria> Yeah, system() isn't about threads at all, it fully spawns a new process. OpenSSL is a heap of mess though, so don't trust it ;-)
<zzak> if you're just shelling out for a quick fix, then whatever, but if you're doing any heavy lifting i'd go with OpenSSL and if you run into any issues with thread-safety bugs.ruby-lang.org is your friend
<Aria> OpenSSL is "safe" to use from threads in some cases, not others. There's no such thing as absolute thread-safety, but it's understandable.
<villainate> right so you mean using the ruby library is recommended. ok i will look into it.
lcdhoffman has quit [Quit: lcdhoffman]
<zzak> give it a shot, report any thread related issues you run into
<Aria> Oh, quite. But shelling out is completely safe. Just depends on what you're doing.
<villainate> due the fact that it is forking?
<Aria> Yeah.
<Aria> Has nothing to do with threads, so there's no thread safety issue ;-)
<villainate> gotcha thanks
<zzak> right, but its also possible to use the streaming or chunk apis using the module
<villainate> i see
<Aria> (and as a point of terminology, "a call to system()" is not "a system call")
<villainate> ok what is "a system call"? using ruby to call a kernel level method?
<Aria> Yeah. Or any userland process calling into the operating system kernel.
<villainate> ok gotcha
<Aria> read, write, select, open a file.
<rohit_> Will it be correct in saying that Ruby 2.0 is the same platform as 1.9? I'm asking this in reference to the Bundler Gem and this issue https://github.com/carlhuda/bundler/issues/2151
<Aria> All of those are system calls. All the stuff in section 2 of the unix manpages.
<villainate> thanks aria
<Aria> sure thing, villainate
febuiles has quit [Quit: febuiles]
<villainate> and zzak of course
<zzak> good luck
ilyam has quit [Quit: ilyam]
jmena has quit [Ping timeout: 245 seconds]
sn0wb1rd has quit [Quit: sn0wb1rd]
woollyams has quit [Quit: Computer has gone to sleep.]
krohrbaugh has joined #ruby-lang
cantonic_ has joined #ruby-lang
Paradox has quit [Ping timeout: 240 seconds]
sn0wb1rd has joined #ruby-lang
sn0wb1rd has quit [Client Quit]
cantonic has quit [Ping timeout: 255 seconds]
cantonic_ is now known as cantonic
rohit_ has quit [Quit: Leaving]
jxie_ has quit [Quit: leaving]
rohit has joined #ruby-lang
areil has joined #ruby-lang
yxhuvud has joined #ruby-lang
jxie has joined #ruby-lang
Aria has quit [Remote host closed the connection]
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
AlHafoudh has quit [Quit: Computer has gone to sleep.]
svyatov has joined #ruby-lang
thinkdevcode has joined #ruby-lang
jxie has quit [Read error: Connection reset by peer]
havenn has quit [Ping timeout: 248 seconds]
ryanf has quit [Ping timeout: 264 seconds]
Rizzle has joined #ruby-lang
ViperMaul|_ has quit [Ping timeout: 256 seconds]
jxie has joined #ruby-lang
svyatov has quit [Quit: svyatov]
francisfish has quit [Ping timeout: 252 seconds]
Paradox has joined #ruby-lang
datanoise has joined #ruby-lang
uuair has joined #ruby-lang
rohit has quit [Ping timeout: 246 seconds]
datanoise has quit [Ping timeout: 246 seconds]
yanovitchsky has quit [Quit: yanovitchsky]
<rking> Hi guys. Trying to golf this down for a buddy, suggestions welcome: @content_home_main = if home_main = Content.find_by_name("home_main"); home_main.content else "home_main not found." end
<rking> I found his use of the temp var interesting. I actually like it better than redundantly doing 'Content.find_by_name'
ryanf has joined #ruby-lang
<rking> One option is this:
<rking> (Content.find_by_name("home_main") || OpenStruct.new(content: "home_main not found")).content
|Vargas| has joined #ruby-lang
<bluepojo> rking: I'd just do this https://gist.github.com/4044083
Dreamer3 has quit [Quit: Computer has gone to sleep.]
<bluepojo> your second paste is pretty convoluted
<bluepojo> or even better
<bluepojo> define a method on Content
<bluepojo> that returns "not found" or the content
<rking> bluepojo: That gist doesn't actually do anything except move the temp out of the statement.
<bluepojo> right, but why make it shorter?
<rking> Which is OK, but I have this sense that there's a more fundamental way to say this.
<bluepojo> your goal is to write software that works and is easy to maintain, not to be extra clever with leet ruby skills
<bluepojo> write code that is easy to read
<bluepojo> instead of code that uses every facet of the language you've ever learned
<rking> I agree, but you have to have a full vocabulary to be able to make wise choices.
<bluepojo> I have a full vocabulary
<bluepojo> you're being too clever
<bluepojo> and you'll hate yourself for it
<rking> The OpenStruct thing was just a brainstorm, though I actually do advocate the NullObject idea
<bluepojo> in 6 monhts
lun_ has quit [Remote host closed the connection]
<bluepojo> I think the best option is to define a method on Content
<bluepojo> encapsulate the functionality
<rking> OK, but that merely pushes the problem elsewhere.
<bluepojo> right, but it encapsulates it
<rking> This is a low-level, tactical challenge.
<bluepojo> so the rest of your app doesn't need to worry about it
<rking> Yes, that's completely orthogonal.
<bluepojo> and you can change it in future in 1 place
<bluepojo> instead of everywhere
<bluepojo> no it's not
<rking> =|
<rking> How do you even know this isn't in a method?
<bluepojo> if it is, then write it clearly and leave it alone
<rking> Of course I wouldn't do this several times, and in classes that don't own this data.
<rking> This is a pattern I've seen enough that I wanted to ask about it here.
rohit has joined #ruby-lang
cosah has quit [Ping timeout: 240 seconds]
<rking> Another example is a nested data structure, like: a[:b][:c][:e], where you either want that or a default value
lun_ has joined #ruby-lang
cosah has joined #ruby-lang
<bluepojo> ah yeah, that's more of challenge… if :c isn't defined, you'll get undefined [] for nilclass
<bluepojo> the vanilla way to do it is
<bluepojo> if a && a[:b] && a[:b][:c] && a[:b][:c][e]
<bluepojo> which kinda sucks
<bluepojo> but it's a hard problem to solve and I don't believe there are libraries to do it
<bluepojo> cause you'd impact Hash's retrieval performance pretty significantly if you have it check for everything along the way
<bluepojo> some times the answer is to create a more specific data structure instead of deeply nested hashes
<bluepojo> depends on your specific usecase though
<rking> Yeah
<tpope> you want deep_fetch
<bluepojo> andand makes the above pattern a little nicer
<bluepojo> the gem
<rking> tpope: Yeah, good point. That would be worth writing if you had that going on in one or two places.
icooba has joined #ruby-lang
gsav has quit [Read error: Connection reset by peer]
jxie has quit [Read error: Connection reset by peer]
<rking> bluepojo: Aha! Yes, andand is exactly the solution to the first.
<rking> bluepojo: See? Now I feel like your chiding me for zooming in on this problem was a bit chideful.
jxie has joined #ruby-lang
<rking> There's two perfectly viable tools I didn't think of before, .andand + .deep_fetch. I can choose whether they are helpful or not in context, but just telling people with questions: "You don't mean that" isn't always profitable.
<bluepojo> I was pretty clear in giving a solution, I thought… the first question I was a bit chideful cause it's an extremely common thing for rubyists to be super clever, thinking it's great at the moment only to come back to their code months later and being unable to read it… or the other devs spend another 10mins when they get to the code trying to figure it out.
<bluepojo> It's usually better to write more code if it's clearer than less code cause it's cleverer
<bluepojo> didn't mean to direct any hate at you, it's more of a conditioned reaction
<bluepojo> apologies if you were offended
<rking> bluepojo: BTW the andand docs mention another way to do this, which is also convoluted but interesting: @phone = ->(loc){ loc && loc.phone }.call(Location.find(:first, ...elided... ))
<bluepojo> ow, that's painful
<bluepojo> haha
<bluepojo> cool tho
<rking> bluepojo: At this point I have a conditioned reaction in response to that particular conditioned reaction. I love cutting through users' "xy problems", but I think the total support solution says answer both x and y if possible.
<bluepojo> Generally I like to tell people how i do things. I'll say there are other ways to do it, but it often confuses people if you give them too many options… I leave it up to them to find other ways to do it if they like.
<bluepojo> they're already confused enough if they're coming to you for help
<rking> I should have done a better job of purifying the context to make it seem like a more intentional question.
<bluepojo> fair enough
bluepojo has quit [Ping timeout: 256 seconds]
solars has joined #ruby-lang
<erikh> c[:a][:b][:c] rescue default_value
<rking> erikh: Right
<rking> But =~(
<erikh> yes, you can easily load up your projects with 800 additional gems and writing 300 lines of code to solve this problem "properly"
<rking> I think for a Hash access like that, it's probably idiom-worthy
<erikh> or you can cheat with inject too
<erikh> but not sure which is worse
<rking> erikh: I'd pretty seriously consider putting that in Hash#deep_fetch
<rking> I don't think it's great to have it propagate across many spots in the code.
<rking> Nah, in that case you wouldn't have any benefit of using rescue over has_key?
<erikh> if you're going to call out to something that takes a list of items, might as well use the inject method
<rking> erikh: I'm not quite seeing your inject solution.
adamdonahue has left #ruby-lang [#ruby-lang]
amd has joined #ruby-lang
amd has left #ruby-lang [#ruby-lang]
svyatov has joined #ruby-lang
<erikh> list.inject(o) { |h,k| if h.respond_to?(:[]) then h[k] else return nil }
NemesisD has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
<rking> Oh, OK.
<rking> So yeah, still more of a candidate for the definition of deep_fetch, though.
<NemesisD> anyone familiar with SAX parsing in nokogiri? i want to fire an event for every certain element, but i can't figure out how i could access that node
<erikh> right; it also doesn't have the other problems that rescue nil does
hinbody has quit [Ping timeout: 255 seconds]
<NemesisD> the hooks it exposes are start_element and stop_element, but those only expose name and attributes
ezkl has joined #ruby-lang
Gekz has quit [Read error: Connection reset by peer]
hinbody has joined #ruby-lang
achiu has quit [Ping timeout: 252 seconds]
Gekz has joined #ruby-lang
Gekz has quit [Changing host]
Gekz has joined #ruby-lang
achiu has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
bpuzzled has joined #ruby-lang
bpuzzled has quit [Changing host]
bpuzzled has joined #ruby-lang
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
mytrile has joined #ruby-lang
vlad_starkov has joined #ruby-lang
thinkdevcode has quit [Remote host closed the connection]
dr_bob has joined #ruby-lang
rohit has quit [Quit: Leaving]
datanoise has joined #ruby-lang
AlHafoudh has joined #ruby-lang
dr_bob has quit [Ping timeout: 246 seconds]
datanoise has quit [Ping timeout: 252 seconds]
dr_bob has joined #ruby-lang
NemesisD has quit [Quit: leaving]
yanovitchsky has joined #ruby-lang
qwerxy has joined #ruby-lang
uuair has quit [Quit: uuair]
woollyams has joined #ruby-lang
hinbody has quit [Ping timeout: 246 seconds]
cschwartz has joined #ruby-lang
Averna has quit [Quit: Leaving.]
hinbody has joined #ruby-lang
rue|w has joined #ruby-lang
datanoise has joined #ruby-lang
leopard_me has joined #ruby-lang
jashank has quit [Changing host]
jashank has joined #ruby-lang
datanoise has quit [Ping timeout: 268 seconds]
wallerdev has quit [Quit: wallerdev]
d3vic3 has joined #ruby-lang
ruurd has joined #ruby-lang
agarcia has joined #ruby-lang
ilyam has joined #ruby-lang
<yorickpeterse> Morning
havenn has joined #ruby-lang
havenn has quit [Remote host closed the connection]
moonglum has joined #ruby-lang
gnufied has joined #ruby-lang
vbatts has quit [Ping timeout: 252 seconds]
znake has joined #ruby-lang
ilyam has quit [Quit: ilyam]
lake has quit [Quit: WeeChat 0.3.7]
lake has joined #ruby-lang
blacktulip has joined #ruby-lang
qwerxy has quit [Quit: offski]
dc5ala has joined #ruby-lang
jxie has quit [Quit: leaving]
icooba has quit [Ping timeout: 260 seconds]
Mon_Ouie has quit [Ping timeout: 246 seconds]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
jxie has joined #ruby-lang
icooba has joined #ruby-lang
<yorickpeterse> http://www.youtube.com/watch?v=aBgnlBoIkVM this is actually really cool
tockitj_ has left #ruby-lang [#ruby-lang]
tockitj_ has joined #ruby-lang
tockitj_ has left #ruby-lang [#ruby-lang]
qwerxy has joined #ruby-lang
tockitj_ has joined #ruby-lang
<tockitj_> yorickpeterse, what is it ?
runeb has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 240 seconds]
<yorickpeterse> Talk about cool Ruby 1.9 features
bpuzzled has quit [Quit: Leaving]
<yorickpeterse> From Aloha Ruby
d3vic3 has quit [Ping timeout: 248 seconds]
cosah has quit [Ping timeout: 252 seconds]
yanovitchsky has quit [Quit: yanovitchsky]
yanovitchsky has joined #ruby-lang
ryanf has quit [Ping timeout: 256 seconds]
workmad3 has joined #ruby-lang
yanovitchsky has quit [Ping timeout: 256 seconds]
d3vic3 has joined #ruby-lang
ezkl has quit [Quit: Textual IRC Client: www.textualapp.com]
adambeynon has joined #ruby-lang
krohrbaugh has quit [Read error: Operation timed out]
krohrbaugh has joined #ruby-lang
apeiros_ has joined #ruby-lang
Criztian has joined #ruby-lang
qwerxy has quit [Quit: offski]
rohit has joined #ruby-lang
BobAnon has joined #ruby-lang
L0L0L0L0L has quit [Ping timeout: 246 seconds]
roadt has joined #ruby-lang
<roadt> hi, why a class can't mixin another class? (i ask this in neighbor, no luck)
znake has quit [Quit: Linkinus - http://linkinus.com]
<steveklabnik> because classes aren't able to be mixed in ;)
<steveklabnik> you gotta use modules
<roadt> steveklabnik, that's not answer to my question. ;)
datanoise has joined #ruby-lang
<steveklabnik> what would 'mixing a class in' mean?
<roadt> steveklabnik, don't see any problem to relax this a little.
<roadt> steveklabnik, py seems allow that.
<steveklabnik> can you give me an example?
<steveklabnik> i dont think so
<roadt> wondering any background, consideration..
<steveklabnik> http://gist.github.com
Axsuul has quit [Ping timeout: 276 seconds]
<roadt> steveklabnik, py module doesn't respond for mixin. so it allow inherit a list of class.1st is base class, later classes are mixin'ed in. actually a fake multiple inheritance
<yorickpeterse> roadt: no, that's exactly the reason
rohit has quit [Ping timeout: 246 seconds]
<roadt> steveklabnik, no gist stuff yet.. tks :)
<yorickpeterse> A class inherits, it doesn't include
<yorickpeterse> A module can be included, it can't extend
<yorickpeterse> That's just the way things are
rohit has joined #ruby-lang
jarib has quit [Excess Flood]
<apeiros_> A class inherits and includes
<yorickpeterse> Saying something like "But classes should be mixed in to!" is like saying you want to perform mathematical calculations using regular expressions
jarib has joined #ruby-lang
jarib has quit [Excess Flood]
<yorickpeterse> * too
<apeiros_> it can't be included
datanoise has quit [Ping timeout: 240 seconds]
<gnufied> although there was a discussion, couple of days back here, so as a class can borrow features from other classes
AlHafoudh has quit [Ping timeout: 240 seconds]
jarib has joined #ruby-lang
<gnufied> trying to find relevant ticket in ruby-lang redmine
<apeiros_> if define_method wasn't so picky this wouldn't be an issue at all. you could just reattach methods at will
<rohit> So what was said after my </end_guess> message? I got d/c :(
<roadt> yorickpeterse, no, concetually speaking. it is possilbe , with the proper meaning.
<roadt> gnufied, by meta programming
<roadt> gnufied, ?
* apeiros_ never understood that limitation of define_method with UnboundMethod
levicole has quit [Ping timeout: 268 seconds]
<yorickpeterse> roadt: The answer is simple: No, you can not include/mix in a class into another one
<apeiros_> I think he was more asking for the "why"
<apeiros_> as in, what's the design rationale behind it
<yorickpeterse> If you could modules would serve no purpose
<gnufied> ^ yup
<roadt> yorickpeterse, i know it can not. yup ... look for some background about this.
<yorickpeterse> roadt: then what exactly is your question?
vlad_starkov has quit [Remote host closed the connection]
<apeiros_> well, I guess in such a world you could view modules as a) pure namespaces and b) something akin to an abstract class (since you can't instantiate)
levicole has joined #ruby-lang
yellow5 has quit [Quit: time to go!]
<roadt> yorickpeterse, why ruby not permit to include another class but only module. (since there are langs permit that).
yellow5 has joined #ruby-lang
<roadt> apeiros_, yeah. exactly.
<gnufied> long and short, it is by design
<steveklabnik> ruby's object protocl is different than python's
<steveklabnik> is the short answer
<apeiros_> that's still "what", not "why"
<rohit> What does it mean to mix a module into a class?
<rohit> What *would* it mean to mix a class into a class?
<gnufied> (redmine is failing me)
<gnufied> borrow methods without going whole hog of unbounded methods etc I suppose
<yorickpeterse> rohit: because that's the way it's designed
<yorickpeterse> there's no point in having two different data types do the same thing
<yorickpeterse> or one data type being used for two different things
<yorickpeterse> It's like trying to use a hammer to bake a steak while also using it for hitting nails
mlangenberg has joined #ruby-lang
<roadt> yorickpeterse, not really. py , c++ allow this. and give the example that. this is a window. wow. this is also a shape.
<roadt> yorickpeterse, so i mean it is possible. with the proper meaning.
<rohit> AFAIK mixins are like interfaces. You want a class to be of a certain type, say Shape, but you also want to be able to do stuff that a window would so you inherit from Shape and mix Window module in
<yorickpeterse> Because X does it too doesn't make it a good idea
<rohit> BUT if you mix another class, you are effectively doing multiple inheritance
<rohit> yorickpeterse, Nobody is questioning if it's a good!
<rohit> idea*
<rohit> yorickpeterse, It's a valid question to ask - why ruby doesn't allow mixing a class into another class. Dismissing the question as RUBY IS DESIGNED SO is not helpful
<roadt> yorickpeterse is quite defensing something. which i don't get clear. yet. :)
<yorickpeterse> ...
<yorickpeterse> Except that *is* the reason
<yorickpeterse> it's a design issue, that's it
<mlangenberg> I'm caching some data in memory in a Hash by date. I noticed that using MAP[date.today] ||= {} is much faster than MAP[date.today.to_s] ||= {}. Why would this be?
<yorickpeterse> There isn't some super natural reason as to why it's not possible
<yorickpeterse> It just isn't because it hasn't been added
<yorickpeterse> mlangenberg: the latter converts it to a string
<yorickpeterse> and quite possibly formats it
<steveklabnik> mlangenberg: not sure, but you're not converting stuff to a string, so the first one does less stuff
<steveklabnik> you'd have to profile to learn for sure
<roadt> yorickpeterse, it looks like explicitly forbidden, so should have a reason, which is i'm looking for.
<steveklabnik> because modules are not classes ;)
<mlangenberg> Sure, but what does Hash use internally? Because the date object has a different object_id every time.
<steveklabnik> mlangenberg: what do you mean by 'uses internall'y?
<roadt> yorickpeterse, i'm ok with either options actually. difference make the world more beautiful :P
<mlangenberg> Actually I'm wondering: This is faster, can I use it?
<steveklabnik> use for what?
<rohit> yorickpeterse, No there isn't a super natural reason. Somebody made a choice not to add multiple inheritance to Ruby. Somebody decided interfaces weren't good. So decided to have modules and mixins. But why? Reasoning about language choices is a good thing ...
<mlangenberg> steveklabnik: key for hash lookup
<steveklabnik> mlangenberg: object id
<yorickpeterse> Oh jezus, I'm not going to try to explain this any further
<roadt> steveklabnik, why don't say Class is_a Module ? XD
<steveklabnik> 1.9.3-p194 :001 > Class.is_a? Module => true
<steveklabnik> ;)
<roadt> steveklabnik, oh, no, sorry, Class inherit from Module
<mlangenberg> steveklabnik: Date.today.object_id != Date.today.object_id
<steveklabnik> 1.9.3-p194 :002 > Class.ancestors => [Class, Module, Object, Kernel]
<steveklabnik> mlangenberg: sure
<steveklabnik> mlangenberg: that has nothing to do with how hashes keep track of keys
<steveklabnik> hashes can use any object as a key
<roadt> steveklabnik, ah. also is_a Module. good point.
<steveklabnik> i am 99.9% sure that it uses the object_id to handlet hat, though not 100%
qwerxy has joined #ruby-lang
leopard_me has quit [Quit: Computer has gone to sleep.]
<apeiros_> hashes use #hash and #eql?
rohit has quit [Ping timeout: 264 seconds]
<apeiros_> for an object to be considered the same key, it must return the same value on #hash, and must return true when compared with #eql?
<roadt> apeiros_, eql? is for hash. AIK.
<apeiros_> ideally, different keys return a different value for #hash
<apeiros_> it's not required, though
* roadt is away for supper.
<mlangenberg> little benchmark: https://gist.github.com/4045071
<apeiros_> if you turn on identity map, it'll use object identity (i.e., equal?/object_id, but I doubt that it actually goes via the method call)
<mlangenberg> I'm always in favor of storing strings instead of objects in a hash, but there seems to be quite a difference
<apeiros_> identity map: Hash#compare_by_identity
<apeiros_> mlangenberg: one reason a string might be slower: Hash special cases strings
<apeiros_> it dups and freezes them, also the to_s itself is additional work
<mlangenberg> Ah, it boils down to the difference between Date#to_s and Date#hash
<apeiros_> mlangenberg: also using the object as key does *not* create a new object
<mlangenberg> In my case I had a heavy calculation there
<apeiros_> you're using an existing object as a key, whereas with .to_s you create a new object
<mlangenberg> I was just trying what would be the best to memoize a heavy calculation for a long running process, the calculation is once per day.
<apeiros_> a string as key of its own should be faster than a date as key, though
<gnufied> roadt: there is some info there. So, what if for example, you mixin - String class inside Array class?
rohit has joined #ruby-lang
<mlangenberg> apeiros_: I could do: h[Date.today.hash] ||= …, so it will just lookup Fixnums
<gnufied> ruby does not check receiver and that will crash the interpreter
<rohit> Umm did my gist link get through? Sorry getting d/c a lot. :(
<gnufied> I mean, if you call a string method after it gets mixed into Array class, that will most likely crash the interpreter
<apeiros_> mlangenberg: that's pointless
<gnufied> so, this goes back to what steveklabnik was saying, that Ruby has different method dispatching rules
<gnufied> (no receiver checking for one)
<mlangenberg> apeiros_: why? It will save memory size of the hash.
<apeiros_> mlangenberg: a) you're not save against collisions with that
<gnufied> and including classes within other classes will wreck havoc. especially if you consider classes that were defined in C
<apeiros_> b) unless you have tens of thousands of keys, this will not save you any significant amount of memory
<mlangenberg> apeiros_: You are right, I am over thinking this.
<apeiros_> c) if you have the dates around anyway, it will not even save you any memory
<apeiros_> since, as said, you're using an existing object as the key. using an existing object as a key does *not* increase memory usage (since no new object is being created)
<gnufied> roadt: and no, didn't see your gist. sorry
<rohit> roadt, I think your question boils down to why multiple inheritance is bad, this might help http://stackoverflow.com/a/407928
<rohit> Hashing plane date obj vs converting to string and then hashing - https://gist.github.com/4045084 - big difference, I don't know why
<gnufied> because you are essentially creating more objects in second case
<gnufied> not sure, if that exactly accounts for the difference. but surely, that will be a factor
<rohit> interesting, one sec
<rohit> https://gist.github.com/4045084 still a difference
<gnufied> but my point was, each time you are calling to_s, you are forcing an extra string creation
beiter has joined #ruby-lang
<rohit> yup, that is correct :D
<rohit> I'm a bm/profiling noob. Just hashing a string is fast but still slower than hashing a Time obj
<rohit> Calling obj.to_s adds a 22s overhead :D
<gnufied> I suppose to_s will trigger strftime on time objects
<gnufied> and that is indeed costly operation
kentos has quit [Quit: Leaving]
<rohit> Also interesting, the second set: https://gist.github.com/4045084
AlHafoudh has joined #ruby-lang
krz has quit [Quit: krz]
<roadt> gnufied, tks for digging.
<gnufied> roadt: np.
<roadt> gnufied, that means matz make class's method call validate reciever 's data type (in ruby interpreter). quite impl details..
<roadt> rohit, actually , i put my question to why mixin class is not good, usually, mixin means 'no multiple-inhertance!' , right? XD
GarethAdams has joined #ruby-lang
<rohit> And I ask again - What does it *mean* to mixin a Module? What does it mean to mixin a Class? The later implies multiple inheritance imho.
<rohit> Actually nm, I don't know the answer, I was just speculating. I would have suggested to ask on Ruby Core mailing list but so far I've only seen emails from the issue tracker, none from just people :D
<roadt> rohit, yeah, i know the point.and can they be the same?
beiter has quit [Read error: Connection reset by peer]
beiter_ has joined #ruby-lang
bastilian has joined #ruby-lang
<roadt> rohit, yeah, tks. still nice talking. thoughtful. :)
<rohit> roadt, IMO no, just adding methods + state from a module doesn't make the class obj a type of the module. In fact I suspect the reason why there is a Module object is to differentiate between the two. Module is basically an abstract class i.e it can't be initialized
<workmad3> rohit: Object.is_a?(Kernel)
<rohit> And with that my whole theory goes down the drain :D
<rohit> workmad3, hello :)
<workmad3> rohit: also, mixins are a form of multiple inheritance, they just aren't unconstrained class interface inheritance :)
<workmad3> and hi :)
<workmad3> *unconstrained class multiple inheritence even
<workmad3> mixins are a form of interface with implementation
<rohit> Ah
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
<rohit> Scala interfaces also allow implementation
<workmad3> so in the same way that java allows single class inheritance but multiple interface inheritance, ruby supports single class inheritance with multiple mixin inheritance
<rohit> I was on the right path till I started speaking gibberish :D
<workmad3> it's multiple class inheritance that can get messy :)
<workmad3> especially C++'s implementation of it
<roadt> rohit, yeah. Module is quite abstract. I should say it is comfortable that parent doesn't has features of child class. say Class can initialize some obj, Module, not you can't.
<andrewvos> Anyone know if I can use -X -L in Net::SSH?
<workmad3> python has a form of multiple inheritance that doesn't have the same foibles, but it does so by imposing a specific ordering to the inheritance that basically collapses it down into a single inheritance tree in essence
<rohit> inheritance trees are good, inheritance graphs bad
<workmad3> :)
<workmad3> C++ gets really weird... you can have virtual private superclasses
<workmad3> private inheritance is quite a nice idea though...
<workmad3> it's basically implementation inheritence on its own
Paradox has quit [Ping timeout: 268 seconds]
<workmad3> so you could do private inheritance from, say, Array, and internally you could treat the class as an Array, but YouClass.is_a?(Array) would be false
rohit has left #ruby-lang ["Leaving"]
<workmad3> but it's really easy to just do that with object proxies in ruby, so it's not that big an ommission :)
rohit has joined #ruby-lang
* roadt think workmad3 fall in love with C++.
<workmad3> I like C++, it has some nice stuff in it
<workmad3> haven't touched it for years now though :)
<workmad3> and it can be a nightmare at times too
<roadt> workmad3, me too.
<workmad3> more importanting, IMO, is that you can learn quite a lot of OO ideas from looking at a selection of languages that implement different styles of inheritance, different types of OO, etc
<workmad3> *importantly
<rohit> I did a fantastic job of not paying attention to my c++ lectures, and I'm glad for it. I wish we had data structures in C rather C++.
<workmad3> importanting? wtf?
beiter_ has quit [Read error: Connection reset by peer]
beiter has joined #ruby-lang
beiter has quit [Client Quit]
<workmad3> my C++ lectures @ uni were... crap
<workmad3> I taught myself the interesting and useful aspects of C++ :)
<workmad3> templates, template metaprogramming, RAII, standard library stuff...
<workmad3> then I discovered ruby :D
* roadt thought he know the possible reason that ruby does't allow mixin a class. and think it not a big deal now.
Criztian has quit [Remote host closed the connection]
<roadt> workmad3, do you like c++11 (oh, i'm offtopicing..)
<workmad3> roadt: I stopped C++ stuff before it was released, never really looked at it in depth :(
<rohit> Templates are pretty cool
<roadt> workmad3, i see..
<workmad3> and yeah... ruby might actually be able to allow mixing in a class in terms of implementation... but it would screw with the semantics IMO
<workmad3> roadt: Templates are indeed cool :D they're a complete, functional language that operates on types, and they're programs that run in the compiler
<workmad3> ^^ rohit even
<rohit> I have this in my bookmarks for a long time, about time I start looking at Mirah - http://www.mirah.org/
<roadt> workmad3, yeah.. but complex and debug issues still need to be resolved. ah...seems ruby channel is quite comfortable with native language topic. :)
<roadt> workmad3, like ruby, implemented by ruby, replace java, compile to javabytecode directly. good to know.
Paradox has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
<roadt> s/workmad3/rohit/
<roadt> sorry, rohit.
<roadt> :P
<workmad3> :)
<rohit> Actually Mirah has an odd feature. It's type system is *pluggable*. Won't that make programs unpredictable?
<roadt> should be good with caution. i, for one, like go language. which is try to use a free-type system to replace template .
<roadt> c++ template..
lun_ has quit [Ping timeout: 246 seconds]
<roadt> but still a adventure
<roadt> but maybe worthy.
lun_ has joined #ruby-lang
* roadt put 'Mirah' in his bookmarks.
Hakon has joined #ruby-lang
vlad_starkov has joined #ruby-lang
lun_ has quit [Ping timeout: 276 seconds]
Hakon has quit [Ping timeout: 240 seconds]
jxie has quit [Quit: leaving]
lun_ has joined #ruby-lang
robbyoconnor has joined #ruby-lang
robbyoconnor has quit [Client Quit]
<andrewvos> hello
rub has quit [Ping timeout: 255 seconds]
<naquad> what are alternative to rails? i like ActiveRecord orm, but rails are really heavy, sinatra has very limited functionality, ramaze seems to be not supported (last commit was more than 6 month ago)
<andrewvos> Sinatra has limited functionality?
datanoise has joined #ruby-lang
<andrewvos> `gem install functionality`
<naquad> andrewvos, no controllers, no view helpers, ...
<roadt> lol
<workmad3> naquad: if you need those things, maybe you want to reassess your view that rails is heavy
rohit has quit [Quit: Leaving]
<naquad> workmad3, if rails would be less resource consumptive (>100 megs of memory on application with 2 models and <300 r/s)
carloslopes has joined #ruby-lang
<naquad> i wouldn't even think about alternatives
<andrewvos> naquad: My phone has more memory than that.
<workmad3> naquad: if your app is that small, do you need controllers, view helpers, etc?
<naquad> workmad3, i've got used to that, plus i have backend/frontend separation
rindolf has joined #ruby-lang
<workmad3> naquad: ok, so what you're basically saying is 'I like the stuff that rails gives me, but I want it to do that for free'
<naquad> workmad3, basically yes :3
<workmad3> naquad: well... tough
anildigital_work has quit [Read error: Connection reset by peer]
<roadt> better rails.
anildigital_work has joined #ruby-lang
<workmad3> naquad: if you want a less heavyweight solution, you're going to need to lower your expectations of what you'll get
datanoise has quit [Ping timeout: 256 seconds]
<workmad3> naquad: or pay the price of a broader framework in terms of resource consumption
<roadt> need better rails, means , you need make rails better. XD
<workmad3> naquad: on top of which, as andrewvos pointed out, *phones* have more memory than that... free hosting solutions give you more than that...
lun_ has quit [Remote host closed the connection]
vesan has quit [Read error: Connection reset by peer]
vesan has joined #ruby-lang
kurko_ has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 240 seconds]
mistym has joined #ruby-lang
svyatov has quit [Quit: svyatov]
rub has joined #ruby-lang
svyatov has joined #ruby-lang
<yorickpeterse> http://vimeo.com/53062800 Another interesting talk
<yorickpeterse> Unrelated to Ruby but worth the watch
<yorickpeterse> andrewvos: meeeh
<yorickpeterse> Not a fan of kickstarter, it really seems to be *the* place for people to go to when they're lazy to back shit up themselves
thatdutchguy has joined #ruby-lang
vlad_starkov has joined #ruby-lang
mistym has quit [Remote host closed the connection]
kitallis has quit [Ping timeout: 265 seconds]
kitallis has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 276 seconds]
dhruvasagar has joined #ruby-lang
<andrewvos> Yeah. I think he should stop wasting his time and get started on a Ruby magazine.
<andrewvos> Seriously want to read about new gems and see code snippets and shit in a magazine.
jmena has joined #ruby-lang
jmena has left #ruby-lang [#ruby-lang]
jmen has joined #ruby-lang
leopard_me has joined #ruby-lang
<gnufied> he already publishes ruby weekly newsletters
retro|cz has quit [Ping timeout: 244 seconds]
jmen has left #ruby-lang [#ruby-lang]
<andrewvos> gnufied: I want a magazine to keep next to the toilet.
jmen has joined #ruby-lang
nertzy has joined #ruby-lang
jmen has left #ruby-lang [#ruby-lang]
jmena has joined #ruby-lang
postmodern has quit [Quit: Leaving]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<gnufied> start a Kickstarter campaign for that then
<yorickpeterse> ^
<yorickpeterse> andrewvos: print the ruby newsletter
<yorickpeterse> sell it on kickstarter
<yorickpeterse> GENIUS
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
mistym has quit [Remote host closed the connection]
Paradox has quit [Ping timeout: 268 seconds]
mwjcomputing has joined #ruby-lang
sepp2k has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
runeb has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
ruurd has quit [Quit: Leaving...]
runeb has joined #ruby-lang
Paradox has joined #ruby-lang
kitallis has quit [Quit: Computer has gone to sleep.]
rub has quit [Ping timeout: 265 seconds]
gnufied1 has joined #ruby-lang
aetcore has joined #ruby-lang
gnufied has quit [Ping timeout: 252 seconds]
<yorickpeterse> http://larubyconf.com/ Anybody thinking of going here?
<steveklabnik> i spoke last year :)
<yorickpeterse> Maybe if I can finish my linter in time I can give a talk about all the bollocks of Ripper and what not
<yorickpeterse> Oh?
<steveklabnik> also i live in la
<steveklabnik> sooooo
<yorickpeterse> Are you asking me out?
<steveklabnik> no
<yorickpeterse> :<
<yorickpeterse> Anyway, maybe I can get my next employer to partially pay for it
<rindolf> yorickpeterse: I'd like to go to http://railsisrael.events.co.il/tracks
<stardiviner> What is is this ? %w{ apple kk }
<yorickpeterse> heh, I don't plan on going to Israel anytime soon (no offense)
<yorickpeterse> stardiviner: array of words
<yorickpeterse> it's an alternative way of writing ['apple', 'kk']
aetcore has quit [Ping timeout: 246 seconds]
<stardiviner> yorickpeterse: array of words ? That's the name of it ? thanks
<yorickpeterse> Well it's not the literal name
<yorickpeterse> but that's what it does
<yorickpeterse> there's %w{}, %W{}, %q{}, %Q{}, etc
<yorickpeterse> They all do different things
<stardiviner> yorickpeterse: I see, thanks for help
<oddmunds> %w{blah blah} is the equalent of "blah blah".split(' ')
<andrewvos> stardiviner: It's an Array Literal
* andrewvos just watched RubyTapas
<oddmunds> it's more common to see %w(blah blblah) isn't it?
datanoise has joined #ruby-lang
<yorickpeterse> Doesn't really matter what you use
<yorickpeterse> As long as it doesn't conflict with the contents
<yorickpeterse> e.g. %w{foo bar{ } is invalid
<stardiviner> Yes, I'm write vim snippets, so I want a name for it, for different types similar snippets.
<oddmunds> yorickpeterse: you can use spaces and perverse things like that, can't you?
mlangenberg has quit [Quit: mlangenberg]
<yorickpeterse> Anything but the "container" characters can be used
<yorickpeterse> But spaces separate words in this case
nertzy has quit [Quit: This computer has gone to sleep]
mlangenberg has joined #ruby-lang
<yorickpeterse> Hrmpf, I suppose I have to come up with a proper topic if I want to give that talk
<yorickpeterse> Just "Here's my code, it only sucks a little bit! You should totally use it!" doesn't really work out
gmci has joined #ruby-lang
gmci is now known as Guest26286
jxie has joined #ruby-lang
<roadt> lol
nitti has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
justinram has joined #ruby-lang
villainate has quit [Quit: Leaving]
erichmenge_ has joined #ruby-lang
lcdhoffman has joined #ruby-lang
<jmena> What would be a good way to modify (increment/decrement) a number that is in a line from a text file I'm reading?
erichmenge has quit [Disconnected by services]
erichmenge_ is now known as erichmenge
Serial_Killer_C has joined #ruby-lang
<jmena> Right now I'm reading the text file line by line, using regex to to detect the number, convert the number to an integer, adding/subtracting 1 to that number and converting it back to a string.
<jmena> Looks like this: modified_score = line.slice(/-?\d+/).to_i.send(operation.to_sym, 1).to_s
mlangenberg has quit [Quit: mlangenberg]
<jmena> Operation is a single character: either + or -
<rindolf> jmena: can't you use (s.to_i + 1).to_s
rindolf has quit [Read error: Connection reset by peer]
rindolf has joined #ruby-lang
<jmena> I don't think so. Each line in the file looks like this:" first_name last_name | score"
<jmena> That's why I'm using regex to match digits first.
dc5ala has quit [Quit: Ex-Chat]
<jmena> And I'm using send(operation.to_sym 1) because I'm using the same method for both addition and subtraction. operation contains that single string '+' or '-'.
wyhaines has joined #ruby-lang
mlangenberg has joined #ruby-lang
<jmena> Here's the full method: https://gist.github.com/4045819
methods has quit [Quit: Leaving.]
retro|cz has joined #ruby-lang
outoftime has joined #ruby-lang
robotmay has joined #ruby-lang
<whitequark> is it considered a good practice to duplicate ivars in #initialize_copy?
<whitequark> otherwise #dup is almost useless imo
Kyril has quit [Quit: Quitte]
rolfb has joined #ruby-lang
kurko_ has quit [Ping timeout: 246 seconds]
vbatts has joined #ruby-lang
runeb has quit [Remote host closed the connection]
francisfish has joined #ruby-lang
kurko_ has joined #ruby-lang
runeb has joined #ruby-lang
ddd has quit [Quit: Leaving.]
ddd has joined #ruby-lang
rippa has joined #ruby-lang
stiang has joined #ruby-lang
ddd has left #ruby-lang [#ruby-lang]
ddd has joined #ruby-lang
francisfish has quit [Ping timeout: 246 seconds]
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
ddd has left #ruby-lang [#ruby-lang]
rindolf has quit [Read error: Connection reset by peer]
rindolf has joined #ruby-lang
ddd has joined #ruby-lang
runeb has quit [Remote host closed the connection]
svyatov has quit [Quit: svyatov]
sailias has joined #ruby-lang
runeb has joined #ruby-lang
Serial_Killer_C has quit [Remote host closed the connection]
<jmena> Is it weird that none of these examples wrk in irb? http://www.ruby-doc.org/core-1.9.3/String.html#method-i-gsub
<steveklabnik> jmena: they're missing the first /
<steveklabnik> hmmm
<steveklabnik> they're correct on HEAD at least
d3vic3 has quit [Ping timeout: 260 seconds]
mistym has quit [Remote host closed the connection]
<jmena> steveklabnik: Same thing pretty much everywhere here: http://www.ruby-doc.org/core-1.9.3/Regexp.html
<roadt> maybe rdoc 's bug
<roadt> even source code of old revision is right.
d3vic3 has joined #ruby-lang
<steveklabnik> also possible
<roadt> i rarely read doc, but always check source code..
enebo has joined #ruby-lang
<jmena> What would be the best way to report it? I"m a n00b.
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<steveklabnik> drbrain may want to know as well ;)
Hakon has joined #ruby-lang
<jmena> steveklabnik: Thanks!
wallerdev has joined #ruby-lang
carloslo_ has joined #ruby-lang
carlosl__ has joined #ruby-lang
carloslopes has quit [Ping timeout: 276 seconds]
carloslo_ has quit [Ping timeout: 246 seconds]
Mon_Ouie has joined #ruby-lang
<yorickpeterse> If a particular setter method is evaluated in the context of a instance method, is there a nicer way to call that method (instead of assigning a var) other than `my_setter=(param)`?
<yorickpeterse> `my_setter = param` would just create a local variable
<steveklabnik> self.my_setter = param
<yorickpeterse> ta
Connecti0n has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
<workmad3> yorickpeterse: also 'my_setter=(param)' will evaluate as 'my_setter = (param)' (i.e. it would still be a local variable)
<yorickpeterse> Oh?
<yorickpeterse> hmmm, that might explain why the tests failed
<yorickpeterse> Yup, seems that was the case. Thansk
<yorickpeterse> * thanks
senekis has joined #ruby-lang
gnufied1 has quit [Quit: Leaving.]
moonglum has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Criztian has joined #ruby-lang
headius has joined #ruby-lang
gsav has joined #ruby-lang
gsav_ has joined #ruby-lang
retro|cz has quit [Ping timeout: 244 seconds]
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
gsav has quit [Quit: Lost terminal]
methods has joined #ruby-lang
vlad_sta_ has joined #ruby-lang
Serial_Killer_C has joined #ruby-lang
AlHafoudh has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
intellitech has quit [Ping timeout: 276 seconds]
stiang has quit [Quit: stiang]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
davidbalber|away is now known as davidbalbert
rue|w has quit [Read error: Operation timed out]
marlonandrade has joined #ruby-lang
marlonandrade has quit [Client Quit]
goshakkk has joined #ruby-lang
headius has quit [Quit: headius]
gnufied has joined #ruby-lang
beiter has joined #ruby-lang
<tockitj_> why does pry show such a strange representation of hashes ?
apeiros_ has quit [Remote host closed the connection]
bastilian has quit [Quit: Leaving...]
jxie has quit [Read error: Connection reset by peer]
<erichmenge> tockitj_: how do you mean?
enebo has quit [Quit: enebo]
jmena is now known as jhn
<tockitj_> it shows things like [ :key, :value ] => nil, instead of { :key => :value }
<darix> so it isnt a hash but an array
headius has joined #ruby-lang
<yorickpeterse> tockitj_: you mean this? http://pastebin.com/raw.php?i=M0dKc1mS
<yorickpeterse> Hm
<yorickpeterse> because that's caused because of `pp`
<tockitj_> [83] pry(main)> { :a => :b }
<tockitj_> => {[:a, :b]=>nil}
wallerdev has quit [Quit: wallerdev]
<tockitj_> its very likely pp
<tockitj_> why pp does this ?
<darix> i cant reproduce your behavior in either pry on 1.8 or 1.9
<yorickpeterse> Works fine here too
<yorickpeterse> Pry version 0.9.10 on Ruby 1.9.3
<yorickpeterse> (`pry --version` to get that)
datanoise has quit [Ping timeout: 240 seconds]
<darix> tockitj_: open a new pry shell and just copy the :a => :b }
<darix> tockitj_: open a new pry shell and just copy the { :a => :b }
mlangenberg_ has joined #ruby-lang
<yorickpeterse> Are you sure it's not some other random gem that's being loaded and messes it up?
mlangenberg has quit [Ping timeout: 246 seconds]
mlangenberg_ is now known as mlangenberg
bradland has joined #ruby-lang
headius has quit [Ping timeout: 252 seconds]
wallerdev has joined #ruby-lang
<tockitj_> not sure.. got lots of gems.. its something i've messed..
<tockitj_> nvm guys, thanks
<jhn> tockitj_: maybe try creating a new gemset and reinstall pry?
<darix> jhn: that is a very complicated way
<darix> but well
savage- has quit [Quit: savage-]
savage- has joined #ruby-lang
|Vargas| has quit [Quit: ...]
thatdutchguy has quit [Remote host closed the connection]
jxie has joined #ruby-lang
thatdutchguy has joined #ruby-lang
dstywho has joined #ruby-lang
kain has joined #ruby-lang
senekis has quit [Ping timeout: 268 seconds]
senekis has joined #ruby-lang
goshakkk has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
thatdutchguy has quit [Ping timeout: 240 seconds]
mlangenberg has quit [Quit: mlangenberg]
ddfreyne has quit [Excess Flood]
ddfreyne has joined #ruby-lang
bastilian has joined #ruby-lang
rue has quit [Remote host closed the connection]
sush24 has joined #ruby-lang
rue has joined #ruby-lang
rampantmonkey has joined #ruby-lang
havenn has joined #ruby-lang
tubbo`cloud is now known as tubbo
d3vic3 has quit [Quit: leaving]
tubbo has left #ruby-lang [#ruby-lang]
beiter has quit [Quit: beiter]
ottbot has quit [Ping timeout: 260 seconds]
ilyam has joined #ruby-lang
datanoise has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 246 seconds]
justinram has quit [Remote host closed the connection]
hakunin_ has joined #ruby-lang
Uranio has joined #ruby-lang
hakunin has quit [Read error: Connection reset by peer]
mlangenberg has joined #ruby-lang
datanoise has quit [Ping timeout: 252 seconds]
runeb has quit [Remote host closed the connection]
savage- has quit [Quit: savage-]
mlangenberg has quit [Client Quit]
bradland has quit [Ping timeout: 246 seconds]
ottbot has joined #ruby-lang
cschwartz has quit [Ping timeout: 252 seconds]
mytrile has quit [Remote host closed the connection]
ruurd has joined #ruby-lang
<rolfb> is something replacing Iconv in ruby 2.0?
bradland has joined #ruby-lang
<manveru> string encoding
<freedrull> i think i am going to give up getting eventmachine-twitter working with ruby-processing, and just make an alternative to eventmachine-twitter(in some sort of nonblocking way), how about the old fashioned way with threads lol
slyphon has joined #ruby-lang
<manveru> processing is on java?
agarcia has quit [Quit: Konversation terminated!]
<freedrull> yeah
<manveru> then go for it, jruby has native threads :)
<manveru> oh, damn, now i summoned headius
<freedrull> oh yeah! perfect
<freedrull> maybe just open a connection to twitter's streaming api in another thread, have it write to some shared datastructure when there is new tweets, have my #draw method check that shared data for updates when its time to refresh the screen
vlad_sta_ has quit [Remote host closed the connection]
rampantmonkey has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<manveru> just make sure you put a mutex around the access
sailias has quit [Quit: Leaving.]
<freedrull> oh good idea
darix has quit [Quit: brb]
<freedrull> although only one thing should be writing at a time
<gnufied> there are like 10 locking primitives in JVM
<manveru> yeah, but writing and reading at the same time is no good idea :)
<manveru> of course you could just use a queue, if you only need one update at a time
darix has joined #ruby-lang
darix has quit [Changing host]
darix has joined #ruby-lang
vlad_starkov has joined #ruby-lang
cosah has joined #ruby-lang
<freedrull> that would be fine too, the screen updates so fast anyway
rolfb has quit [Quit: Linkinus - http://linkinus.com]
rue|w has joined #ruby-lang
datanoise has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
workmad3 has quit [Quit: Lost terminal]
ruurd has quit [Quit: Leaving...]
workmad3 has joined #ruby-lang
rue|w has quit [Ping timeout: 252 seconds]
Uranio has quit [Remote host closed the connection]
ilyam has quit [Quit: ilyam]
sailias has joined #ruby-lang
sn0wb1rd has joined #ruby-lang
ruurd has joined #ruby-lang
<vbatts> zzak drbrain: should i just assign doc patches to you, zzak?
dc5ala has joined #ruby-lang
intellitech has joined #ruby-lang
gregmoreno has joined #ruby-lang
krohrbaugh has joined #ruby-lang
Jaded has joined #ruby-lang
Connecti0n has quit [Quit: Connecti0n]
Connecti0n has joined #ruby-lang
nitti has quit [Remote host closed the connection]
nitti has joined #ruby-lang
bradland has quit [Quit: bradland]
alvaro_o has joined #ruby-lang
burgestrand has quit [Quit: Leaving.]
iamlacroix has joined #ruby-lang
burgestrand has joined #ruby-lang
mlangenberg has joined #ruby-lang
bastilian has quit [Quit: Linkinus - http://linkinus.com]
sn0wb1rd has quit [Quit: sn0wb1rd]
ryanlecompte has joined #ruby-lang
emptyflask has joined #ruby-lang
dr_bob has quit [Quit: Leaving.]
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
__butch__ has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 264 seconds]
My_Hearing has joined #ruby-lang
davidbalbert is now known as davidbalber|away
emptyflask has quit [Remote host closed the connection]
emptyflask has joined #ruby-lang
blazes816 has quit [Quit: blazes816]
runeb has joined #ruby-lang
mlangenberg_ has joined #ruby-lang
blazes816 has joined #ruby-lang
mlangenberg has quit [Ping timeout: 264 seconds]
mlangenberg_ is now known as mlangenberg
apeiros_ has joined #ruby-lang
mlangenberg has quit [Client Quit]
stiang has joined #ruby-lang
runeb has quit [Ping timeout: 252 seconds]
blazes816 has quit [Ping timeout: 255 seconds]
tockitj_ has quit [Quit: Leaving]
GarethAdams has quit [Quit: Leaving...]
dbussink has quit [Excess Flood]
thatdutchguy has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
dbussink has joined #ruby-lang
nyuszika7h has quit [Quit: Upgrading WeeChat]
jarib has quit [Excess Flood]
jarib_ has joined #ruby-lang
jarib_ has quit [Excess Flood]
jarib has joined #ruby-lang
nyuszika7h has joined #ruby-lang
My_Hearing is now known as Mon_Ouie
ohsix has quit [Ping timeout: 268 seconds]
stiang has quit [Quit: stiang]
sepp2k1 has joined #ruby-lang
Nisstyre has quit [Ping timeout: 240 seconds]
sepp2k has quit [Ping timeout: 240 seconds]
sn0wb1rd has joined #ruby-lang
saLOUt has joined #ruby-lang
saLOUt has quit [Client Quit]
Nisstyre has joined #ruby-lang
thatdutchguy has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 240 seconds]
icooba has quit [Quit: Computer has gone to sleep.]
mister_x29 has joined #ruby-lang
pkrnjevi_ has joined #ruby-lang
mister_x29 has quit [Remote host closed the connection]
sush24 has quit [Quit: This computer has gone to sleep]
pkrnjevi_ is now known as pkrnj
Mon_Ouie has quit [Ping timeout: 246 seconds]
ilyam has joined #ruby-lang
mrsolo has joined #ruby-lang
ruurd has quit [Quit: Leaving...]
ViperMaul|_ has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
Rizzle has quit [Ping timeout: 276 seconds]
tockitj_ has joined #ruby-lang
beiter has joined #ruby-lang
rindolf has quit [Remote host closed the connection]
<tockitj_> is it posible to have a gem file automatically required on start of every ruby session ?
sailias has quit [Quit: Leaving.]
apeiros_ has quit [Remote host closed the connection]
apeiros_ has joined #ruby-lang
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
qwerxy has quit [Quit: offski]
pkrnj has joined #ruby-lang
areil has quit [Remote host closed the connection]
apeiros_ has quit [Read error: Connection reset by peer]
apeiros has joined #ruby-lang
<reactormonk> tockitj_, .pryrc?
beiter has quit [Ping timeout: 246 seconds]
thinkdevcode has joined #ruby-lang
cschwartz has joined #ruby-lang
<tockitj_> reactormonk, thats ok.. but i'm thinking of maybe some more general mechanism ? aside of pry
ruurd has joined #ruby-lang
<manveru> tockitj_: RUBYOPT="-r whatevergem"
banisterfiend has joined #ruby-lang
cschwartz has quit [Ping timeout: 260 seconds]
apeiros has quit [Ping timeout: 264 seconds]
<tockitj_> manveru, nice
<manveru> man ruby for more :)
<tockitj_> but gem can't auto-include itself into ruby (to act as core gem)
<manveru> ?
<manveru> you mean in prelude?
<tockitj_> don't know what prelude is :)
apeiros_ has joined #ruby-lang
<manveru> heh
davidbalber|away is now known as davidbalbert
methods has left #ruby-lang [#ruby-lang]
<manveru> that's where for example rubygems is required in 1.9
rampantmonkey has joined #ruby-lang
<manveru> all the ruby core is in C
apeiros has joined #ruby-lang
<manveru> only a few parts in the prelude.c are ruby
apeiros has quit [Read error: Connection reset by peer]
<tockitj_> _all_ core stuff is C ?
<manveru> yes
<manveru> in MRI, that is
davidbalbert is now known as davidbalber|away
<tockitj_> didn't know that :)
<tockitj_> thanks
apeiros has joined #ruby-lang
<Harzilein> h,,
<Harzilein> hmm*
apeiros_ has quit [Ping timeout: 248 seconds]
Connecti0n has quit [Remote host closed the connection]
<Harzilein> i feel a bit bad about using ragel for my informally specified format
<Harzilein> the other extreme would be something like while line =~ /^Outdated gems/../^$/ # chris2
<Harzilein> (i want to parse the output of bundle outdated)
<manveru> oh my...
<manveru> you had a problem, then you used regex... :)
<manveru> and because two problems ain't enough, you square that with bundler
<Harzilein> in the middle is something where i get to name the most important things, along the lines of statemachine
<chris2> manveru: haha
<Harzilein> uh, no, i did not start by wanting to parse something, then deciding it ought to be bunder output ;)
justinram has joined #ruby-lang
<chris2> (more seriously, i would just do some plain line-based code with regexps)
beiter has joined #ruby-lang
<Harzilein> any other input?
<bougyman> you know what's fun? making a regexp parser in vimscript.
<reactormonk> bougyman, writing syntax HL for vim?
<Harzilein> no, vimscript isn't fun. i wanted to use it for... hmm... good thing i don't remember what i used it for, but i spent an entire saturday night (i.e. till long after dawn) with it
<bougyman> reactormonk: yep
<chris2> i curse the day someone decided to make vi.* programmable
<reactormonk> bougyman, muahaha
<Harzilein> oh, yes, i remember: i wanted to use vim's quite expansive language detection code as a file(1) replacement
<bougyman> something along those lines.
<reactormonk> bougyman, but at least you can get speed in vim - try implementing something similar to vim-CommandT in emacs
<jhn> How come "hello".gsub(/([aeiou])/, '<\1>') #=> "h<e>ll<o>"
<jhn> But "oh hai 10".gsub(/-?\d+/, '<\1>') #=> "oh hai <>"
<Harzilein> bougyman: i need a ltgrey on slightly-less-ltgrey-theme to look at that i think... so when i pull back i can be sure i won't accidentally see it again :D
<reactormonk> jhn, you didn't capture?
<bougyman> Harzilein: ahahaha
<jhn> Oh.
<jhn> Parenthesis!
<jhn> Oops! :)
stiang has joined #ruby-lang
<jhn> I spent like an hour figuring that one out. Maybe I should ask for help more often...
tockitj_ has quit [Quit: Leaving]
<reactormonk> you know the saying with tree and wood?
<jhn> Yep. :)
headius has joined #ruby-lang
jarib has quit [Excess Flood]
beiter has quit [Quit: beiter]
jarib has joined #ruby-lang
jarib has quit [Excess Flood]
jarib has joined #ruby-lang
Axsuul has joined #ruby-lang
headius has quit [Ping timeout: 246 seconds]
beiter has joined #ruby-lang
beiter has quit [Client Quit]
beiter has joined #ruby-lang
headius has joined #ruby-lang
beiter has quit [Client Quit]
lcdhoffman has joined #ruby-lang
robotmay has quit [Remote host closed the connection]
thone_ has joined #ruby-lang
ruurd has quit [Quit: Leaving...]
thone has quit [Ping timeout: 252 seconds]
rebelcan has joined #ruby-lang
headius has quit [Ping timeout: 246 seconds]
ruurd has joined #ruby-lang
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
Mon_Ouie has joined #ruby-lang
pkrnj has joined #ruby-lang
beiter has joined #ruby-lang
rampantmonkey has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
pkrnj has quit [Client Quit]
pkrnj has joined #ruby-lang
wmoxam has quit [Ping timeout: 260 seconds]
oreoshake has joined #ruby-lang
<oreoshake> anyone know of a lib to detect if two urls satisfy the same-origin policy? or a snippet of code I can use and attribute?
iamlacroix has left #ruby-lang [#ruby-lang]
Uranio has joined #ruby-lang
ryanf has joined #ruby-lang
carlosl__ has quit [Remote host closed the connection]
<andrewvos> oreoshake: Kindly elaborate.
<andrewvos> oreoshake: Ok I googled it. Cookies don't generally store the host name. So no, this is not possible.
<oreoshake> it's unrelated to cookies, related to CSP (firefox won't send CSP reports cross-origin)
<andrewvos> Holy shit. I just read that back. Why did I think you said cookies?
<andrewvos> I think I saw the word cookie in another window.
<oreoshake> well, that is usually the context in which it is discussed :)
<oreoshake> i only ask because my first impl didn't work, realized this has to have been done a thousand times over
<andrewvos> So you need to share a cookie between domains right?
<andrewvos> This is your goal I'm assuming?
bluepojo has joined #ruby-lang
<oreoshake> i need to determine if report-uri points to an external host, if so handle it differently. so my question isn't really about urls, just hosts
<andrewvos> oreoshake: Well you would do that client side?
<oreoshake> argh, terminology fail. i need to determine if repoort-uri points to a host on a different origin (which includes port numbers)
nitti_ has joined #ruby-lang
<oreoshake> no, server side. i change the report-uri if its cross-origin
havenn has quit [Remote host closed the connection]
<oreoshake> (uses an internal endpoint to forward the reports)
<andrewvos> What is report-uri?
<oreoshake> it's a directive of CSP that determines where the browser sends reports
<oreoshake> CSP = content security policy
havenn has joined #ruby-lang
<andrewvos> Oh so not this then https://github.com/dasch/ruby-csp
<andrewvos> So can you explain this without any acronyms?
nitti__ has joined #ruby-lang
<oreoshake> oh noes! acronym collision. http://www.w3.org/TR/CSP/
<andrewvos> This seems complex. Have you stopped to ask yourself "Why am I doing this shit?"?
nitti has quit [Ping timeout: 240 seconds]
<andrewvos> If the introduction to something has the word "mitigate", you going to have a bad time.
<oreoshake> absolutely. if you want to receive content security policy reports at a central endpoint that is not on the same origin, you need to work around this limitation in Firefox
wmoxam has joined #ruby-lang
<whitequark> andrewvos: I can.
havenn has quit [Ping timeout: 246 seconds]
nitti_ has quit [Ping timeout: 246 seconds]
<oreoshake> and it all boils down to determining if a URI satisfies the same origin policy for a base URI
<whitequark> browsers were designed from scratch to allow embedding content from different origins. when the content is malicious and you don't filter your input, you get an [XSS] security hole.
<andrewvos> whitequark: You can?
nitti has joined #ruby-lang
<whitequark> CSP is a band-aid designed to save your ass if you don't filter your input.
stiang has quit [Quit: stiang]
<oreoshake> agreed, but security is about layers
rippa has quit [Ping timeout: 245 seconds]
<andrewvos> whitequark: What I don't understand is how you would filter external content?
<whitequark> oreoshake: I don't believe that adding complexity to a problem with security will solve it
<whitequark> andrewvos: don't include external content on your site
<andrewvos> whitequark: If you're loading up some JS from an external source it's too late.
<whitequark> yeah yeah. don't do that.
<andrewvos> Okay
<oreoshake> whitequark: agree to disagree :)
<andrewvos> whitequark: So I think we both agree that CSP shouldn't be needed.
<andrewvos> oreoshake: Are you a Technical Architect?
<oreoshake> it isn't needed, it's a nice to have
<whitequark> andrewvos: if you're already including untrusted code, nothing will save you
<oreoshake> if you use CSP and don't allow inline-script, you can be pretty sure you don't have xss - again, as a blanked
<andrewvos> oreoshake: A nice to have is a better web app. Don't waste time yak shaving this shit.
<oreoshake> if you have CSP, it will identify xss in your app
nitti__ has quit [Ping timeout: 276 seconds]
<andrewvos> Well done. Your users will be really excited.
<oreoshake> you don't get it
<andrewvos> (Sorry I'm not trying to be rude, just trying to explain my point)
<andrewvos> I should get a card that says that on it, so I can hand it to coworkers.
vlad_starkov has quit [Remote host closed the connection]
Dreamer3 has joined #ruby-lang
jhn has quit [Ping timeout: 245 seconds]
dstywho has quit [Quit: Leaving]
senekis has quit [Read error: Operation timed out]
senekis has joined #ruby-lang
enebo has joined #ruby-lang
davidbalber|away is now known as davidbalbert
havenn has joined #ruby-lang
davidbalbert is now known as davidbalber|away
emptyflask has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 260 seconds]
runeb has joined #ruby-lang
runeb has quit [Remote host closed the connection]
blazes816 has joined #ruby-lang
BobAnon has quit [Ping timeout: 252 seconds]
array_ is now known as array
havenn has quit [Read error: Connection reset by peer]
L0L0L0L0L has joined #ruby-lang
pr0ton_ has joined #ruby-lang
davidbalber|away is now known as davidbalbert
<pr0ton_> okay, i have some questions about threading / processes
<pr0ton_> but i'm a bit confused because of different ruby versions and implementations
<pr0ton_> i'm using 1.9.3 and i wanted to know if a thread will be a real kernel thread or more of a green thread?
<ryanf> a real kernel thread
<pr0ton_> i'm doing some fairly CPU intensive work (parsing XML) so I wanted to run it in a threadpool
<ryanf> but with a global interpreter lock, so that only one thread can execute ruby code at a time
<pr0ton_> ah i see. there is no way to get over the GIL ?
<banisterfiend> pr0ton_: jruby
<pr0ton_> hmmm.
Nisstyre has quit [Quit: Leaving]
beiter has quit [Quit: beiter]
methods1 has joined #ruby-lang
havenn has joined #ruby-lang
ruurd has quit [Quit: Leaving...]
ruurd has joined #ruby-lang
mwjcomputing has quit [Quit: Leaving]
pkrnj has quit [Quit: Computer has gone to sleep.]
<erikh> totally unsure why Singleton has to make Marshal blow up
<erikh> it should at least be configurable.
<oddmunds>
datanoise has joined #ruby-lang
emptyflask has joined #ruby-lang
ruurd has quit [Quit: Leaving...]
methods1 has left #ruby-lang [#ruby-lang]
oreoshake has quit [Remote host closed the connection]
ilyam_ has joined #ruby-lang
ruurd has joined #ruby-lang
pkrnj has joined #ruby-lang
oreoshake has joined #ruby-lang
oreoshake has quit [Remote host closed the connection]
alexkira has quit []
wmoxam_ has joined #ruby-lang
ilyam has quit [Ping timeout: 255 seconds]
ilyam_ is now known as ilyam
ilyam has quit [Read error: Connection reset by peer]
postmodern has joined #ruby-lang
ilyam has joined #ruby-lang
datanoise has quit [Ping timeout: 240 seconds]
apeiros_ has joined #ruby-lang
vlad_starkov has joined #ruby-lang
woollyams has quit [Quit: Computer has gone to sleep.]
<array> hello ruby folk! i'm hoping someone can lend a hand with this http://privatepaste.com/4a006dd08f/rubylang - excuse the nasty, i'm still learning.
apeiros has quit [Ping timeout: 240 seconds]
<array> i'm having trouble figuring out what data i need to feed to ProgressBar to determine the progress of response.body
lcdhoffman has quit [Quit: lcdhoffman]
__butch__ has quit [Quit: Leaving.]
vlad_starkov has quit [Ping timeout: 246 seconds]
carl_ has joined #ruby-lang
carl_ has quit [Client Quit]
rampantmonkey has joined #ruby-lang
rampantmonkey has quit [Client Quit]
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
datanoise has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
svyatov has joined #ruby-lang
havenn has quit [Ping timeout: 276 seconds]
havenn has joined #ruby-lang
wmoxam has quit [Ping timeout: 256 seconds]
workmad3 has joined #ruby-lang
workmad3 has quit [Client Quit]
kurko_ has quit [Quit: Computer has gone to sleep.]
<freedrull> ruby-1.9.3-p0 :007 > Digest::MD5.digest("tesT") => "\xF2\xFAv\x87jv\xFB\x05\xB9\xB6\x0E\xF1\xD21r/"
<freedrull> sorry
<reactormonk> array, pastie not found.
<array> reactormonk: sorry, it expired. here you go: http://privatepaste.com/f5d0e6bc46/rubylang - thanks for looking!
KU0N has joined #ruby-lang
Criztian has quit [Read error: Connection reset by peer]
<reactormonk> array, you know Rack?
Criztian has joined #ruby-lang
havenn has quit [Remote host closed the connection]
havenn has joined #ruby-lang
<array> reactormonk: i don't, no.. but if it is something you feel would help out with this, i'll definitely go down that avenue!
kurko_ has joined #ruby-lang
davidbalbert is now known as davidbalber|away
havenn has quit [Ping timeout: 260 seconds]
roadt has quit [Ping timeout: 260 seconds]
havenn has joined #ruby-lang
nitti has quit [Remote host closed the connection]
davidbalber|away is now known as davidbalbert
Uranio has quit [Quit: WeeChat 0.3.8]
qwerxy has joined #ruby-lang
oreoshake has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
oreoshake has left #ruby-lang [#ruby-lang]
CaptainJet has joined #ruby-lang
sailias has joined #ruby-lang
kurko_ has quit [Quit: Computer has gone to sleep.]
datanoise has quit [Ping timeout: 245 seconds]
mwjcomputing has joined #ruby-lang
swarley has joined #ruby-lang
havenn has quit [Remote host closed the connection]
mwjcomputing has quit [Ping timeout: 252 seconds]
senj has joined #ruby-lang
datanoise has joined #ruby-lang
RandyInLA has joined #ruby-lang
sailias has quit [Quit: Leaving.]
lcdhoffman has joined #ruby-lang
<pr0ton_> does ruby have something like this - http://packages.python.org/python-prctl/ ?
apeiros_ has joined #ruby-lang
apeiros_ has quit [Ping timeout: 252 seconds]
RandyInLA has quit [Read error: Connection reset by peer]
RandyInLA has joined #ruby-lang
ruurd has quit [Quit: Leaving...]
krohrbaugh has quit [Quit: Leaving.]
<Spaceghostc2c> pr0ton_: What does it do?
krohrbaugh has joined #ruby-lang
qwerxy has quit [Quit: offski]
senj has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
senj has joined #ruby-lang
ohsix has joined #ruby-lang
gsav has joined #ruby-lang
RantriX has joined #ruby-lang
solars has quit [Ping timeout: 260 seconds]
thinkdevcode has quit [Remote host closed the connection]
gsav_ has quit [Ping timeout: 246 seconds]
gsav has quit [Ping timeout: 268 seconds]
emptyflask has quit [Ping timeout: 276 seconds]
Serial_Killer_C has quit [Remote host closed the connection]
PythonGirl has joined #ruby-lang
postmodern has quit [Quit: Leaving]
PythonGirl has left #ruby-lang [#ruby-lang]
<pr0ton_> Spaceghostc2c: it's a sys call that is used for process (pr) control (ctl)
KU0N has quit [Quit: Linkinus - http://linkinus.com]
imperator has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
towski has joined #ruby-lang
banisterfiend has quit [Ping timeout: 246 seconds]
leopard_me has quit [Quit: Computer has gone to sleep.]
<TTilus> pr0ton_: Process?
<pr0ton_> i tried looking at process and it doesn't let you make system calls to prctl
<pr0ton_> i'm looking at ffi
blacktulip has quit [Remote host closed the connection]
<TTilus> that'll prolly be what you need
<TTilus> the result might look ugly, but at least you get the job done
enebo has quit [Quit: enebo]
lcdhoffman has joined #ruby-lang
<zenspider> hoe and hoe-seattlerb released
intellitech has quit [Quit: This computer has gone to sleep]
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
mistym has quit [Remote host closed the connection]
<zenspider> ssh 1.1.0 released
datanoise has quit [Ping timeout: 260 seconds]
datanoise has joined #ruby-lang
unXus has joined #ruby-lang
Criztian has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 240 seconds]
ozzloy has joined #ruby-lang
svyatov has quit [Quit: svyatov]
swarley has quit [Ping timeout: 240 seconds]
thinkdevcode has joined #ruby-lang
justinram has quit [Remote host closed the connection]
datanoise has joined #ruby-lang
toretore has quit [Quit: Leaving]
nitti has joined #ruby-lang
postmodern has joined #ruby-lang
nitti has quit [Ping timeout: 240 seconds]