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
igotnolegs has joined #ruby-lang
burns180 has joined #ruby-lang
shevy has joined #ruby-lang
setmeaway has joined #ruby-lang
rdeshpande has joined #ruby-lang
burns180_ has joined #ruby-lang
rue has joined #ruby-lang
chimkan_ has joined #ruby-lang
jaafar has joined #ruby-lang
darkf_ has joined #ruby-lang
acyed has joined #ruby-lang
burns180 has joined #ruby-lang
DRCALKIN has joined #ruby-lang
hexo has joined #ruby-lang
wmoxam has joined #ruby-lang
wmoxam has joined #ruby-lang
darkf_ has joined #ruby-lang
hagabaka has joined #ruby-lang
m3nd3s has joined #ruby-lang
brianpWins has joined #ruby-lang
indstry has joined #ruby-lang
jxie_ has joined #ruby-lang
wmoxam has joined #ruby-lang
burns180_ has joined #ruby-lang
ryanf has joined #ruby-lang
QaDeS_ has joined #ruby-lang
havenn has joined #ruby-lang
ryanf has joined #ruby-lang
jkyle has joined #ruby-lang
Joeysomo has joined #ruby-lang
takaokouji has joined #ruby-lang
ryanf_ has joined #ruby-lang
seanstickle has joined #ruby-lang
burns180 has joined #ruby-lang
gnufied has joined #ruby-lang
gnufied1 has joined #ruby-lang
shtirlic has joined #ruby-lang
tomzx_ has joined #ruby-lang
willdrew has joined #ruby-lang
takaokouji has joined #ruby-lang
machine1 has joined #ruby-lang
burns180_ has joined #ruby-lang
jxie has joined #ruby-lang
brownies has joined #ruby-lang
wmoxam has joined #ruby-lang
neoesque has joined #ruby-lang
wmoxam has joined #ruby-lang
wmoxam has joined #ruby-lang
machine1 has joined #ruby-lang
andkerosine has joined #ruby-lang
rue has joined #ruby-lang
<andkerosine> Anybody familiar with yajl-ruby?
rue has joined #ruby-lang
wmoxam has joined #ruby-lang
darkf_ has joined #ruby-lang
burns180 has joined #ruby-lang
heppy has joined #ruby-lang
<Spooner> yajl-ruby - 377.5x faster than YAML.dump - oh YAML, we love you really :D
A124 has joined #ruby-lang
brownies has joined #ruby-lang
wmoxam has joined #ruby-lang
<andkerosine> Haha, yeah...
<andkerosine> I'd really like to use it for my config, but it's not behaving properly. The json gem works, but I'd much prefer yajl's speed.
wmoxam has joined #ruby-lang
brownies has joined #ruby-lang
burns180_ has joined #ruby-lang
jkyle has joined #ruby-lang
ankurgel has joined #ruby-lang
<ankurgel> andkerosine, hi
<ankurgel> andkerosine, I tell you what, you were freaking right about waking up and code again.
<ankurgel> andkerosine, woke up 5 minute back and this: https://gist.github.com/1970329
<ankurgel> [["cars", "racs", "scar"], ["for"], ["potatoes"], ["four"], ["creams", "scream"]]
<ankurgel> works like charm!
<andkerosine> So glorious.
<andkerosine> Very cool, man.
<andkerosine> Wide-awake now, then? : )
<ankurgel> andkerosine, all thanks to you man!
<andkerosine> Only partially.
<ankurgel> andkerosine, It was all your work! :)
<andkerosine> Well, I provided a skeleton.
<ankurgel> :)
<andkerosine> A fairly fleshed-out one, but it didn't have all the parts, so some credit is yours.
<ankurgel> yes, wide awake after doing this now! :)
<ankurgel> andkerosine, I changed everything now as if I was already thinking about how to do that.
<ankurgel> directly changed the portion which were becoming and PITA
<ankurgel> and *boom*, in next attempt - Success
<ankurgel> s/and/a
<andkerosine> Good stuff.
<andkerosine> Pita bread, I mean. : )
<ankurgel> Ha :D
<andkerosine> Planning on sticking with Ruby for a while?
<ankurgel> yes, this time, I'll stick to it.
<andkerosine> It's an amazing all-purpose tool.
<andkerosine> How's your C++ repertoire?
<ankurgel> C++ is fine enough, I guess.
<ankurgel> I still have to get habitual with Standard Template Library.
<andkerosine> Gross.
<andkerosine> : )
<ankurgel> But, rest of things are okay and works most of the time. :)
<andkerosine> Mm-hmm.
<ankurgel> andkerosine, Yesterday, you mentioned something about making IRC bot. It sounds interesting.
<ankurgel> How do we do that?
<andkerosine> I only ask because that's the beauty of programming. Once you have the fundamentals, picking up new languages is mostly just familiarizing yourself with its syntax.
<andkerosine> I didn't mention an IRC bot.
<andkerosine> But I do recall there being talk of such.
<seanstickle> That's sort of like saying picking up Japanese is pretty easy, once I have Icelandic down pat.
<andkerosine> Not at all.
<seanstickle> It's true in a sort of reductionist way. :/
<ankurgel> andkerosine, yes. completely agreed. php, java, c++ are almost same. and ruby belongs to same branch of OOPS, so conceptually same, syntatically different.
<andkerosine> Programming "grammars" are much less expansive.
<ankurgel> hmm
<seanstickle> Try giving a C programmer a bunch of Prolog code to learn. It takes a bit longer.
<ankurgel> ^ ?
<andkerosine> It was an overgeneralization, yes.
<ankurgel> Which prolog code?
<erikh> one might suggest though that after learning a few of them, you develop skills to pick them up quicker.
<andkerosine> I don't think that can be denied.
<andkerosine> It's switching paradigms that's hardest.
<erikh> that said, paradigms can be hard to learn -- see the oodles of sql users out there
<ankurgel> after dealing with few languages and understanding that the entire focus is programming itself and not the language, person apparently becomes language-agnostic
<andkerosine> Ah... hm, gotta disagree.
qpingu has joined #ruby-lang
<andkerosine> If you're used to being able to have side-effects (as is nearly always the case), a purely functional language will be Greek at first.
<seanstickle> If anything, after learning a number of languages, I am more partisan to some languages.
<seanstickle> Not more agnostic.
<ankurgel> hmm
<andkerosine> Agnostic in your ability to grasp, not necessarily prefer.
<erikh> agnostic means 'doesn't know'
<ankurgel> andkerosine, 100/100 in that problem. YAY
<andkerosine> I was looking for how to break it.
<seanstickle> erikh: yeah, but colloquially, meaning "doesn't care"
<erikh> seanstickle: fair
<andkerosine> Only hiccup I could see was duplicates in the groups.
<ankurgel> andkerosine, this was how it was tested: https://gist.github.com/1970415
<ankurgel> nailed it :D
<seanstickle> And I still love me some APL.
<erikh> maybe if I was more of a mathematician I could appreciate APL
<erikh> until then though, I doubt it.
<seanstickle> I enjoy its complete lack of precedence rules
<erikh> just left to right?
<seanstickle> Right to left
<andkerosine> Go, Poland.
<nofxx> heheh the last south park episode, cartman is sent to a strictly agnostic home <erikh> agnostic means 'doesn't know'
<erikh> is it like forth in that regard?
<andkerosine> erikh: Seeing Conway's GoL in essentially one line of APL was interesting.
<erikh> I did see that, but I didn't understand it.
<seanstickle> erikh: no, not a stack
<seanstickle> erikh: 2 * 2 + 4
<andkerosine> ankurgel: One test that would have "failed" would be having exact duplicates in the original word list.
<seanstickle> erikh: => 12
wmoxam has joined #ruby-lang
<erikh> ah yes
<erikh> ok, thanks.
<ankurgel> andkerosine, it will fail? *checks*
<andkerosine> ankurgel: Then there would be duplicates in the results, which probably isn't desirable.
<ankurgel> but, if duplicated are entered, then they must be expecting them to get paired up too, no?
<andkerosine> combine_anagrams(['creams', 'scream', 'scream', 'cats', 'tacs']) == [['cats', 'tacs'], ['creams', 'scream', 'scream']]
<ankurgel> yes
<andkerosine> Surely there's no reason to have 'scream' twice?
<ankurgel> Dubious. If the thing is like, number of words in array entered must be present on returned array,
<ankurgel> then duplication have been allowed.
<ankurgel> for that specific value.
<ankurgel> 'creams', 'scream', 'scream'
<andkerosine> Hm, I suppose.
<andkerosine> Still, it's something I would have done to potentially trip you up. : )
<ankurgel> :D o.O
<andkerosine> As a learning endeavor.
RomyRomy has joined #ruby-lang
<heftig> ['creams', 'scream', 'scream', 'cats', 'tacs'].group_by { |w| w.each_char.sort }.values
<ankurgel> :) always required.
<nofxx> "We cannot know with certainty if God or Christ exists. They COULD. Then again There COULD be a giant reptilian bird in charge of everything. Can we be CERTAIN there isn't? NO, so it's pointless to talk about."
<jorgenpt> heftig: Neat
<ankurgel> heftig, eww! fantastic
<jorgenpt> Enumerable has so much cool stuff I forget about
<andkerosine> Best thing in programming.
<ankurgel> I can use group_by to group from array/range specified on left according to condition specified at right?
<seanstickle> To crush your computers, see them driven before you, and hear the lamentations of their fans?
<andkerosine> Specified in the block, "at right" is a bit incorrect.
<heftig> ankurgel: it will sort the elements into a hash, with the return value of the block as key
<andkerosine> ankurgel: irb will forever be your friend.
<ankurgel> andkerosine, yes, tried it already after he posted :)
<andkerosine> Noice.
<ankurgel> and grouping some other patterns now.
<andkerosine> ankurgel: Linux user?
<ankurgel> andkerosine, thorough. :)
<andkerosine> You, sir, are good people.
<andkerosine> How many dollar words in /usr/share/dict/words? : )
<ankurgel> er. you want to program it?
<ankurgel> that's dictionary file, right?
<andkerosine> Eh, not urgent.
<ankurgel> oh
<ankurgel> look dollar
<ankurgel> done
<andkerosine> Haha.
<andkerosine> A "dollar word" is a word whose alphabetical value is 100.
<andkerosine> Where a = 1, b = 2... z = 26.
<seanstickle> Ah, gematria
wmoxam has joined #ruby-lang
<andkerosine> seanstickle: Bless your beautiful soul.
<andkerosine> I have been looking for that word for years.
<ankurgel> so, "d+o+..." = 100? like that?
<nofxx> andkerosine, pry ftw! irb is past now
<andkerosine> "wizards" is a dollar word.
<andkerosine> 23 + 9 + 26 + 1 + 18 + 4 + 19 == 100
<ankurgel> Interesting stuff. ! :)
<andkerosine> Just a thought. It's a nice practice program, methinks.
<seanstickle> Old school number/word mysticism
<ankurgel> we can code it in rb, to check for dollar word easily.
<ankurgel> but iterating over every word, will be slowwwww
<andkerosine> Not at all.
mistym has joined #ruby-lang
<ankurgel> hm
burns180 has joined #ruby-lang
<ankurgel> andkerosine, this is that file -rw-r--r-- 1 root root 910K 2009-04-29 23:22 american-english in /usr/share/dict/
<ankurgel> 910K. hm
<ankurgel> 98569 words in my dict
<andkerosine> Heh, 234937 in mine.
<jorgenpt> I found a horrible oneliner to do it
<andkerosine> Me, too.
<jorgenpt> 2296 dollar words in my dict, out of ~235k
<andkerosine> Are you redeclaring the alphabet inside of the #find block?
<andkerosine> Or lots of #ord-ing?
<jorgenpt> Lots of #ord-ing
<ankurgel> heftig, instead of using .value to extract values from hash. What if I wanted other part of hash?
<nofxx> ankurgel, especially for you, that are playing and learning ruby, pry is incredible tool http://pry.github.com/
<ankurgel> which method for that?
<andkerosine> ankurgel: #keys
<jorgenpt> andkerosine: .keys
<jorgenpt> Err. Tab completion fail. :-p
<andkerosine> Haha.
<nofxx> who is* .. pardon my français
<ankurgel> okay. :) I tried #key first out of random and it failed.
<andkerosine> #keys.first? : )
<ankurgel> yes, my bad jorgenpt
<ankurgel> no.
<ankurgel> .key
gjaldon has joined #ruby-lang
<jorgenpt> andkerosine: Mine's 136 characters, including generous application of whitespace. How about you?
<hagabaka> if you're trying to find a key that corresponds to a known value, there's no built-in method, but there's Hash#invert, or you can find it manually
<seanstickle> Wait, what game are we playing?
<seanstickle> Calculating dollar words?
<jorgenpt> Yup
<jorgenpt> Oh, hey, Kernel#open, where have you been my whole life?
wmoxam has joined #ruby-lang
<seanstickle> 113 chars here
<jorgenpt> 107 after killing whitespace and using shorter aliases
<seanstickle> Are we assuming only lower case words?
<jorgenpt> I'm not
<seanstickle> Or do capital letters have different values?
<seanstickle> a=A=1?
<jorgenpt> Yes
<jorgenpt> That's my assumption.
<andkerosine> Mm-hmm.
<andkerosine> Sorry, going for sub-100. : )
<seanstickle> 107 when I kill whitespace
<seanstickle> Does this include the name of the file to read?
<seanstickle> Because mine does
<jorgenpt> Yep
<seanstickle> What's the name of the file
<seanstickle> So I am not using a longer named file than you
<jorgenpt> This is code that I can put "puts " before and ".count" after, and have it return something
<andkerosine> /usr/share/dict/words
<seanstickle> Ok, same with me
<jorgenpt> Ditto
<andkerosine> jorgenpt: I'm using #p and #size.
<seanstickle> andkerosine: you have less than 100?
<andkerosine> Gonna get there.
<andkerosine> I can almost taste it.
<jorgenpt> I'm measuring with "echo -n ... | wc -c"
<jorgenpt> I'm at 105
<andkerosine> I think I /might/ be doing something kind of clever. We'll see.
<andkerosine> 113 at the moment. : /
<ankurgel> andkerosine, how do I convert a character into it's equivalent ascii value?
<seanstickle> That's telling
<ankurgel> for a string or a char, I can use: "ankurgel".each_byte{|c| puts c}
<ankurgel> but, that's tiresome
<andkerosine> ankurgel: 'A'.ord == 97
<andkerosine> 97.chr == 'A', naturally.
<ankurgel> cool!!
<ankurgel> ord denotes?
<jorgenpt> I'm at 100!
<andkerosine> ankurgel: Erm... it's always just been what's used, heh.
<jorgenpt> ankurgel: Ordinal, I think?
<andkerosine> Almost every language uses chr and ord.
<ankurgel> okay :)
<andkerosine> jorgenpt: Don't show yet.
<andkerosine> Or, go ahead... just don't post here.
<andkerosine> I'll be tempted to look and inevitably will.
<jorgenpt> Hehe :-)
<seanstickle> 100!
jxie has joined #ruby-lang
<hagabaka> have you decided on what is the input and output of your code?
<jorgenpt> I've been assuming the list of words that are dollar words
<hagabaka> do you have to hardcode the path and read the file yourself, and do you return the count or print it?
<jorgenpt> (from a newline separated dict file)
<jorgenpt> And former, with /usr/share/dict/words as the path
<andkerosine> hagabaka: Final result should be an outputted number.
<jorgenpt> andkerosine: You're on OS X, right?
<jorgenpt> andkerosine: Oh, the number of words and not the array of words?
<hagabaka> yeah I'm just saying to have a meaningful contest there should be defined rules about these
<jorgenpt> Hehe, yes.
<jorgenpt> seanstickle: 99 *pffft*
<jorgenpt> (with return value being list of words that fit the bill)
<ankurgel> bleh. Have some fest to attend somewhere. Off I go.
* ankurgel will return in evening with more tomfoolery. RUBY #FTW
<ankurgel> andkerosine, see you. thanks again. :)
<seanstickle> Dnag
<andkerosine> jorgenpt: No, Debian. But yeah, the number of words.
<jorgenpt> Oh herp derp, 96.
<andkerosine> Damn...
<jorgenpt> That's the array.
<jorgenpt> Let me rebuild it to return the count without something as dumb as .count
<seanstickle> Wait, are we returning the list of words?
<seanstickle> Or just the total count of the number of words
<jorgenpt> Oh, you're saying we're including p(x.size) in the count?
wmoxam has joined #ruby-lang
<jorgenpt> seanstickle: My impl is the former
Slackwise has joined #ruby-lang
<seanstickle> I'm just returning an array of all the dollar words
<andkerosine> I mean, it doesn't change up our solutions, I imagine.
<andkerosine> Just whether or not we're calling #size at the end, no?
<seanstickle> Well, it changes the length of mine
<seanstickle> Which I gathered was the point
<jorgenpt> Yeah
brushbox has joined #ruby-lang
<jorgenpt> And you can take completely different approaches for it
gregf has joined #ruby-lang
<seanstickle> Ok, time to share implementations
<seanstickle> Cards on the table gentlemen
burns180_ has joined #ruby-lang
<andkerosine> Just a tick.
<andkerosine> Final solution should output a number, or an array of dollar words?
<jorgenpt> I'm a puny 109 with the whole "print the count"
<seanstickle> Array of dollar words
<andkerosine> I think I win. ^_^
<jorgenpt> I'm 94 with "return the array"
<seanstickle> Damn you!
<seanstickle> open("/usr/share/dict/words").select{|x|x.downcase.chomp.split(//).map{|y|y.ord-96}.reduce(:+)==100}
<seanstickle> My naive solution
<seanstickle> I am ashamed to put it before you.
<jorgenpt> Well, 102 with my 94 + #p & #size
<andkerosine> 92 for me.
<jorgenpt> Dang
<andkerosine> I thought #scan(/.+/) an #bytes were pretty clever.
<seanstickle> andkerosine: Yours does not address capital letters
<andkerosine> Feck.
<jorgenpt> 101: p open("/usr/share/dict/words").each.select{|n|n.downcase.chars.inject(-14){|m,c|m+c.ord-96}==0}.size
<jorgenpt> Just something I started but didn't optimize @ 109: open("/usr/share/dict/words").each.inject(0){|m,n|m+(n.downcase.chars.inject(-14){|m,c|m+c.ord-96}==0?1:0)}
<jorgenpt> (look ma, no #size!)
<andkerosine> 99: p File.read('/usr/share/dict/words').scan(/.+/).select{|w|w.upcase.bytes.reduce(:+)-w.size*64==100}
<andkerosine> Not sure why you'd opt for downcase instead of upcase, gents.
<jorgenpt> Huh, I guess map+reduce is less than inject.
<jorgenpt> Hah, yeah, that was a silly assumption :-p
<seanstickle> jorgenpt: you don't need the each in your first one
<seanstickle> jorgenpt: saves some space
rushed has joined #ruby-lang
<jorgenpt> Oh neat
<andkerosine> jorgenpt rather clearly wins. He's at 101 with all sorts of potential optimizations.
<jorgenpt> That I never realized, which is just embarassing
<seanstickle> I am missing that inject(-14) thing
<seanstickle> Not sure what it's doing
<andkerosine> Cancels out \n?
<seanstickle> Ah
<jorgenpt> Cancels out \n
<andkerosine> Does it cancels out \n?
<jorgenpt> And moves the 100 to the LHS of the expr
<andrewvos> https://twitter.com/#!/youreyoureyoure <-- is doing me proud
<jorgenpt> 86 cancels out the \n
<andkerosine> Simultaneously sad and wonderful how fun that was for me. : )
<jorgenpt> 86 - 100 = -14
<andkerosine> I was looking at it as 100 + 10 ("\n") - 96... but same thing, really.
<jorgenpt> But I think doing map.reduce is better than that
<jorgenpt> Golfing is fun
<andkerosine> Very much so.
<seanstickle> So I got 98 once I use upcase
<jorgenpt> It needs pretty clear rules to not peeve people out, though
<jorgenpt> So I can't get upcase to work, hm
<andkerosine> We eventually settled on 'em.
<andkerosine> Really?
<seanstickle> Woo, I win!
jkyle has joined #ruby-lang
<andkerosine> Swap 96 for 64?
<jorgenpt> Yaeh
<jorgenpt> It's giving me a diff result
<andkerosine> Odd.
<seanstickle> jorgenpt: Yeah, I noticed that
<hagabaka> andrewvos: do you find those with a program?
wmoxam has joined #ruby-lang
wmoxam has joined #ruby-lang
<andkerosine> hagabaka: Heroku + Twitter gem, I think?
<seanstickle> jorgenpt: open("/usr/share/dict/words").each.select{|n|n.upcase.chars.inject(-46){|m,c|m+c.ord-64}==0}
<andkerosine> 88: p open('/usr/share/dict/words').each.select{|w|w.upcase.bytes.reduce(:+)-w.size*64==100}
<andrewvos> hagabaka: The script searches twitter for "you're a "
<andrewvos> sorry I mean "your a "
<hagabaka> ah
flebel has joined #ruby-lang
<hagabaka> I thought it did complicated grammatical analysis :p
<seanstickle> andkerosine: nice
<andrewvos> hagabaka: Here's the cod https://gist.github.com/1970654
<andrewvos> code*
<andkerosine> hagabaka: There are libraries for that.
<andkerosine> APIs, too.
<andkerosine> "Woo, I win!" : P
<jorgenpt> For the longest time I had
<jorgenpt> "`".ord in my code
<jorgenpt> That was embarassing.
<andkerosine> It's clever.
<andkerosine> No, I initially used it too.
<andkerosine> Better than an extra +1 for no reason?
<jorgenpt> Hehe, yes
<seanstickle> andkerosine: your recent one returns a weird collection though
<jorgenpt> Yeah, the upcase/downcase thing gives completely different results
<jorgenpt> The upcase one being broken
<andkerosine> 83: p open('/usr/share/dict/words').select{|w|w.upcase.bytes.reduce(:+)-w.size*64==100}
<seanstickle> Why should that be, do you think?
<andkerosine> I'll stop. : )
<seanstickle> andkerosine: yours returns not the same as mine of jorgenpt's
<seanstickle> It returns, for example, "variolovaccinia"
<seanstickle> Which is not a dollar word
<erikh> you don't want to use bytes
<erikh> that won't play nice with multi-byte characters.
<jorgenpt> open("/usr/share/dict/words").select{|n|n.downcase.chars.inject(-14){|m,c|m+c.ord-96}==0} != open("/usr/share/dict/words").select{|n|n.upcase.chars.inject(-14){|m,c|m+c.ord-64}==0}
<erikh> use split(//), there's probably a better idiom though
<jorgenpt> Which I don't get
<hagabaka> andrewvos: so do you basically just have that rake file as your heroku project?
<erikh> p File.read('words').map { |x| x.downcase.split(//) }.group_by { |x| x.inject(0) { |x, y| x + y } }[100]
<andkerosine> jorgenpt: Does your 64 need to be a 65?
<erikh> unless I'm misunderstanding the problem.
lsegal has joined #ruby-lang
<jorgenpt> andkerosine: No, I don't think so?
<jorgenpt> 'A'.ord - 64 == 1
<seanstickle> erikh: not so much of a problem as it is a golf gam
igotnolegs has joined #ruby-lang
<hagabaka> I mean do you need a web application to run it, or does heroku run it as part of the continuous integration process?
<erikh> ah
<erikh> can I use awk? :)
<andkerosine> hagabaka: Scheduled tasks.
<andkerosine> erikh: It's golf.
<seanstickle> erikh: only if you implement awk in Ruby in the single line
<andkerosine> Haha.
<erikh> seanstickle: pfft
<erikh> ruby -e '`awk -F""...
<seanstickle> When does the next round of golf start?
<andrewvos> hagabaka: yeah, it's just a cron job on heroku
<jorgenpt> Oh~
<jorgenpt> D-uh. Because I'm using the wrong inject initial value.
<erikh> here's a little hash algo I wrote for a work thing
<erikh> VALID_PORTS[port_string.chars.inject(0) { |x, y| x += y[0].ord } % VALID_PORTS.length]
<andkerosine> seanstickle: You down? http://crimsoncode.posterous.com/
burns180 has joined #ruby-lang
<andkerosine> Much less amenable to golfing, unfortunately.
<andkerosine> Unless you know the nitty-gritty of the PNG spec.
rohit has joined #ruby-lang
<seanstickle> Ha
<seanstickle> How about something smaller, like find all words in the dict that are 1 Hamming distance away from a given word
<andkerosine> Words with the same gematric value as their neighbors?
<seanstickle> oooo
<andkerosine> Eh, everybody would use #inject as a given.
<andkerosine> I... think?
justinmcp has joined #ruby-lang
<erikh> actually I think enumerable has sum
<erikh> nah, that's activesupport
<erikh> phooey.
<jorgenpt> Nope, it's Enumerable#sum
<jorgenpt> Or wait
<jorgenpt> Yes, it's AS. You're right.
<andkerosine> /dict/words sorted by how many permutations of the word are also words?
<seanstickle> Yes
<seanstickle> Challenge accepted
<jorgenpt> What are you writing? A ruby -e snippet that prints the entire thing?
<hagabaka> hmm 'wizards'.sum - 96 * 7 #=> 100, maybe it can be useful
<andkerosine> Hm... first and last that's not 1?
<andkerosine> hagabaka: That was my trick. : )
<hagabaka> oh didn't see
<andkerosine> Stopped working if I didn't split, though...
<jorgenpt> hagabaka: .sum is mod 2**n, though.
<hagabaka> default n = 16, 2**n - 1 is pretty big...
<jorgenpt> I wonder if that's limited to n <= 32 or 64, or if it can be any int.
<hagabaka> 2**16 / 'z'.ord is 537, don't think there a words that long
<jorgenpt> Oh, ok
<jorgenpt> Yeah, got 74 with sum :-)
<hagabaka> "This is not a particularly good checksum." but particularly handy for gematria :p
<jorgenpt> 74: p open("/usr/share/dict/words").select{|n|n.upcase.sum-64*n.size==46}.size
<andkerosine> seanstickle: So, uh... yeah, maybe not permutations? : )
<seanstickle> Too hard?
<andkerosine> I don't think any of us have the computing power for it.
<seanstickle> I already have a solution in 9 chars
burns180_ has joined #ruby-lang
<andkerosine> ...
<seanstickle> i give up
<andkerosine> Permutation grows exponentially and starts crawling after n = 9, at least for me.
<hagabaka> but you're just asked "how many"
<andkerosine> Still have to check them all?
<seanstickle> Ok, how about a quick golf on the shortest path between n cities
<andkerosine> require 'traveling_salesman'
<hagabaka> oh, missed "sorted by"
<jorgenpt> Huh, I was trying to ghetto my golf by modifying $. - but it's .. weird.
<hagabaka> I thought it was "how many words in dict have permutations that are also words"
<andkerosine> Ah, nah.
<andkerosine> Though... that's still not feasible, I don't think.
<andkerosine> Regardless, you have to do permutations.to_a, which is really big in many cases.
<andkerosine> -s
banister has joined #ruby-lang
<andkerosine> 1.9.3p0 :011 > s = Time.now; (1..8).to_a.permutation.to_a; Time.now - s
<andkerosine> => 0.04674625
<andkerosine> 1.9.3p0 :012 > s = Time.now; (1..9).to_a.permutation.to_a; Time.now - s
<andkerosine> => 1.168795912
<andkerosine> 1.9.3p0 :013 > s = Time.now; (1..10).to_a.permutation.to_a; Time.now - s
<andkerosine> => 3.709175693
<andkerosine> Unless I'm missing something?
<andkerosine> jorgenpt: How would modifying $. work?
<hagabaka> words.length - word.uniq.length?
<andkerosine> Ah, there is that.
<hagabaka> I mean, after sorting by letter
<jorgenpt> andkerosine: Just a counter that is initialized
<jorgenpt> ruby -e '5.times{$.+=1}; p$.' => 5
<andkerosine> Disgusting. : P
<jorgenpt> I was trying this:
<jorgenpt> v=0;open("/usr/share/dict/words").each{|n|v+=n.upcase.sum-64*n.size==46?1:0};p v
<andkerosine> Semicolons in Ruby golf?
<andkerosine> You go too far, sir.
<jorgenpt> But it doesn't work with $. instead of v, which is weird.
<andkerosine> Huh.
<andkerosine> Something in the code modifies $.?
<banister> sup homies
<erikh> banister: !
<jorgenpt> $. is interpreter line, so having only one line shouldn't?
<banister> you erikh what's up
<banister> yo*
wmoxam_ has joined #ruby-lang
<erikh> not much, just trying to find some energy. you?
<jorgenpt> Anyway, it's still more than my 74 char one.
imperator has joined #ruby-lang
maek has joined #ruby-lang
<banister> erikh: got a headache, but ive been messing with rbx
<banister> it's pretty cool
<jorgenpt> And now I should stop! The competition is over!
<erikh> is 2.0 out yet?
<jorgenpt> And food needs picking up.
<erikh> I hear good things, but I'm just not that interested in interpreter development.
<maek> is there some magic in ruby, if inside a class I do return :foo it knows that I want to run/return the method foo ?
<erikh> maek: no
<andkerosine> Really?
<erikh> return method(:foo)
<maek> sorry no method func
<andkerosine> You gosta make it, bru.
manojhans has joined #ruby-lang
<maek> line 56 of the second code example
jkyle has joined #ruby-lang
<erikh> look at line 24 of it.
langbiangplaza has joined #ruby-lang
<maek> erikh: thanks
<erikh> yerp
<andkerosine> ^ Never seen that.
langbiangplaza has joined #ruby-lang
<banister> erikh: not yet
langbiangplaza has joined #ruby-lang
langbiangplaza has joined #ruby-lang
fragmachine has joined #ruby-lang
FortKnox has joined #ruby-lang
<fragmachine> how would I match this '\360' with regexp when I don't know what the numbers will be? I tried grep(/\/[0-9]/) but it doesn't work. I only want to return something if the slash is present as well as the numbers
<andkerosine> =~ %r{\\d+$}
jkyle has joined #ruby-lang
<andkerosine> Not quite...
<andkerosine> '\360' =~ %r{\\\d+$}
<andkerosine> Breaks if the string is double-quoted, though.
<andkerosine> And the $ is maybe unnecessary...
s0ber has joined #ruby-lang
<banister> andrewvos: sup
<fragmachine> I get this error '(irb):17: warning: regexp has `}' without escape' and it doesn't return anything
<fragmachine> I'm on 1.8.7
<andkerosine> Well, then, gimme a sec. : )
<fragmachine> awesome thanks :)
<andkerosine> You're mistyping something.
<andkerosine> 1.8.7 :002 > '\360' =~ %r{\\\d+$}
<andkerosine> => 0
<andkerosine> banister: Context tells me that was meant for me, but I don't want to presume.
<banister> andkerosine: hehe, actually it was for andrewvos, i was going to answer his tweet on irc :)
<andkerosine> Ah, all right.
<fragmachine> I'm trying to put it in grep - a.grep(/=~ %r{\\\d+$}/)
<andkerosine> Ah, haha.
<andkerosine> %r{} is synonymous with //
<andkerosine> I just resort to it out of habit whenever slashes come into the picture.
burns180 has joined #ruby-lang
<andkerosine> I think if you use //, you'll have to escape your \ with \\\\\\\\, believe it or not.
<andkerosine> So I strongly recommend %r{}.
<fragmachine> so many?
<andkerosine> Strange, huh?
<fragmachine> I'll say
<fragmachine> can you use %r{} with grep?
<andkerosine> Certainly.
<andkerosine> foo.grep %r{...}
<andkerosine> //.class == %r{}.class
<fragmachine> awesome that works perfectly
<andkerosine> Sorry, disregard that bit...
<fragmachine> what does %r and {} do?
<andkerosine> Can't remember the specifics, but I know I remember reading a horror story about eight slashes somewhere.
<andkerosine> Ruby took those "contextual strings" I call them from Perl.
<andkerosine> You know how escaping quotes is annoying?
<fragmachine> yea it's annoying
<andkerosine> 1.8.7 :004 > 'John\'s saying "hello".'
<andkerosine> => "John's saying \"hello\"."
<andkerosine> 1.8.7 :005 > "John's saying \"hello\"."
<andkerosine> => "John's saying \"hello\"."
<andkerosine> 1.8.7 :006 > %{John's saying "hello".}
<andkerosine> => "John's saying \"hello\"."
<andkerosine> %{} is used to wrap the string in "agnostic" quotes, so that you don't have to bother escaping any.
<andkerosine> %q{} wraps it in single quotes, and still no need to escape.
<andkerosine> Same for %Q{}, except double quotes.
<andkerosine> Then there's %w{} which takes the insides and splits on spaces, so that you don't have to ['do', 'this', 'annoying', 'thing'], you can just %w{put words in here}.
<fragmachine> man that's all awesome
<fragmachine> Ruby rocks
<andkerosine> And then %r{} lets you pass in a Regexp without having to escape forward slashes and the like.
<andkerosine> Sorry for the invasion.
<andkerosine> But yes, Ruby is absolutely amazing.
<andkerosine> Matz is a beautiful human.
<fragmachine> I've been learning C for some class and it's like smashing your head against a wall repeatedly for hours
<andkerosine> Man, after being in Ruby all day and then having to look at C... nightmare.
<fragmachine> especially after playing around with ruby first
<andkerosine> Mm-hmm.
<fragmachine> things just work in Ruby
<andkerosine> Pretty much everything about Ruby feels incredibly "natural", which is such a strange thing to say about a programming language, I think.
<fragmachine> its true though
<andkerosine> I mean, the language was designed from the very start to be that way, so it makes sense enough.
Natch| has joined #ruby-lang
<mistym> I wish C didn't have the combination of verbose syntax and linguistic complexity. I understand that with a lower-level language a lot of stuff is going to be necessarily harder, and that's fine, but the syntax could stand to be a lot more readable and less intrusive.
<andkerosine> mistym: Particular examples?
srbaker has joined #ruby-lang
A124 has quit [#ruby-lang]
maek has joined #ruby-lang
<andkerosine> Just how explicit you have to be, in general?
A124 has joined #ruby-lang
<fragmachine> painfully explicit
<mistym> Yeah, exactly.
<mistym> Mandatory parens, curly braces up the wazoo, etc.
<andkerosine> Ruby has done terrible/wonderful things to me.
<fragmachine> haha
<andkerosine> Typing parens, braces, and semicolons has been second-nature for so long.
<andkerosine> Now I type them and feel dirty.
<mistym> I mean, it's not lisp, but it could stand to be a lot pleasanter to write and quicker to visually parse.
<andkerosine> Lisp is nice on the parsing eyes, I think, just not the aesthetic ones.
<andkerosine> Purely functional means tiny little pieces.
<mistym> Yes, I suppose it's an acquired taste. To the untrained eye it's hard to parse, but I'm sure that goes away with familiarity.
<andkerosine> It's mostly just a byproduct of proper indentation.
<andkerosine> Could be the Python speaking...
<mistym> I haven't done much Python, but after a little poking around in Coffeescript I'm really appreciating the indentation.
<erikh> heh, I was just getting through lesson 30 of lpthw
<erikh> it's a neat language
slaytanic has joined #ruby-lang
TinhTienMau has joined #ruby-lang
rippa has joined #ruby-lang
TinhTienMau has joined #ruby-lang
seanstickle has joined #ruby-lang
burns180_ has joined #ruby-lang
<banister> erikh: why do u like it, human child?
TinhTienMau has joined #ruby-lang
x0F__ has joined #ruby-lang
TinhTienMau has quit [#ruby-lang]
TinhTienMau has joined #ruby-lang
TinhTienMau has joined #ruby-lang
TinhTienMau has quit [#ruby-lang]
<banister> mistym: i think C is pretty readable, except perhaps when people start doing weird pointer arithmetic or strange pointer declarations
TinhTienMau has joined #ruby-lang
<seanstickle> Is there anything like Perl::Critic for Ruby?
<seanstickle> I have searched, but I have not found.
<banister> seanstickle: what is Perl::Critic sean
<heftig> while ( *(i++) = *(j++) );
<seanstickle> banister: thing that does static analysis of code to enforce a user-defined coding convention
<banister> seanstickle: cool idea
<seanstickle> Indeed
TinhTienMau has quit [#ruby-lang]
<seanstickle> And I should find a Ruby version very handy indeed
<banister> seanstickle: do you think it would make a floor feel good?
<seanstickle> Not as good as a carpet would.
macmartine has joined #ruby-lang
<nofxx> someday I'll make coffee for C, really simple actually.. just remove ';' and add 'do end'
manojhans has joined #ruby-lang
burns180 has joined #ruby-lang
srbaker has joined #ruby-lang
gnufied has joined #ruby-lang
dubellz has joined #ruby-lang
donaldwauchop has joined #ruby-lang
donaldwauchop has joined #ruby-lang
burns180_ has joined #ruby-lang
bgupta has joined #ruby-lang
<bgupta> Hi I am working on am working on the second version of a ruby CLI utility I wrote. The first version had limited functionality and I was able to get away with OptParse. For the next iteration I want to be able to use subcommands. eg. mycommand commandheirarchyone finalcommand
<bgupta> I also want to be able to support both global options as well as subcommand options.
<bgupta> I want "free" help generated.
<bgupta> I found Thor but it doesn't seem to support global options.
<bgupta> An example of global options would be mycommand --debug commandheirarchyone finalcommand
<bgupta> (I was able to get the subcommand thing working using Thor namespaces though..)
<bgupta> can't fingure out how to get global options working.
<andkerosine> "commandhierarchyone" is kind of obtuse.
<andkerosine> I mean, I've only ever used OptParse, so I likely won't be able to help, but I could assist in the search if I better understood what you meant.
nofxx has joined #ruby-lang
nofxx has joined #ruby-lang
Heimidal has joined #ruby-lang
<andkerosine> nofxx: What purpose is served in changing host like that?
<andkerosine> I see it all the time, of course, but I've never seen the point.
<nofxx> andkerosine, sorry mate, dunno what you mean
<nofxx> irc host?
<andkerosine> Mm-hmm.
<andkerosine> You switch to unaffiliated, but is that for anonymity, or...?
<bgupta> andkerosine: Let me show you some code:
<bgupta> basically I want to be able to add "hammer --debug hosts list" (--debug would be a global flag/option that sets something globally.
<andkerosine> Ah, gotcha.
<andkerosine> Thor seems pretty... thorough, so I imagine it's got to be an option.
<andkerosine> Is it that you're opposed to introducing string manipulation unless absolutely necessary?
<bgupta> One would think... but it's not in the wiki, and I am not a good enough coder to figure it out by digging through the code.
<erikh> banister: it's fast and the standard library is pretty solid
<erikh> other than that? meh.
<bgupta> string manipulation? I guess what I want is the CLI framework to handle the git style subcommand stuff for me, so I can focus on actually writing the code.
<andkerosine> Mm-hmm.
<bgupta> git supports global flags as well as subcommand specific flags and args, so I assumed that was a standard pattern..
<andkerosine> Again, I'm sure it is, but I'm entirely unfamiliar.
<bgupta> (I mention git, because many peopel mention Thor as a tool designed to write git style commands)
<andkerosine> --global and -local, yes?
<erikh> there's also extlib
<erikh> which is what chef uses.
<andkerosine> ^ Far wiser Rubyist than I, and I require sleep.
burns180 has joined #ruby-lang
<bgupta> erikh: Chef knife supports global flags? I didn't seem to when I last peeked?
<bgupta> will check it out though
<erikh> I may have missed the core of your question, but git doesn't support global flags either
<erikh> at least, not afaik
<banister> erikh: hey a guy was using p-dogg in production the other day, very interesting
<bgupta> type "git"
<erikh> banister: p-dogg?
<bgupta> one example is git -c name=value <command> [<args>]
<erikh> ah
<erikh> trollop!
<erikh> I forgot.
<erikh> there's also slop, which I think can do what you want too.
<erikh> I know for a fact trollop can.
<bgupta> ok so I heard like a dozen different cli frameworks, gli, commander, boson, Thor, etc.. figured I'd start my way at the most popular.... and see.. will checkout trollop.
<bgupta> (I ruled out gli and subcommand)
<erikh> there's also the pattern like so
<injekt> bgupta: slop!
<erikh> which might be less trouble than evaluating 15 different option parsing libraries :)
<injekt> just evaluate one!
<erikh> heh.
<injekt> why am I up at 7:30 :(
<erikh> because you're getting old
<injekt> (also im an uncle yay etc)
<injekt> yeah
<erikh> I like to get to the office around 7:15 -- usually affords me 3+ hours of work before the rest of the engineering staff gets in.
<injekt> nice
<injekt> makes sense on a work day, I have no excuse for a sunday
<erikh> yeah, I couldn't sleep last night, ended up getting up around 5am today
<erikh> took a leak, read facebook, went back to bed
<injekt> :)
<erikh> banister: that's awesome, it's always nice to have your work used.
<banister> erikh: i have a phone interview with fb on friday :/
<erikh> moving to menlo park?
<banister> erikh: it's an interesting application too
<erikh> I live right down the street from their HQ
<erikh> like literally a 5 minute drive
<banister> no idea, i dont know anything about them i dont even have an fb account
<injekt> you dont know anything about them?
<erikh> sounds like a pretty interesting place to work
<erikh> good timing too, considering they're going to IPO soon.
<banister> injekt: about where they're based or anything like that
<erikh> although that might be too late to get worthy options.
<injekt> banister: ah
<erikh> they're in menlo park, in the old sun building.
<erikh> on willow street!
<erikh> they have a big sign on the front that says "like" with a thumbs up
<erikh> accidentally ended up there one night because I went the wrong way going home
<erikh> fwiw, rent here is insane. do your research @ salary time
<banister> i just have an interview, no job yet
<erikh> yeah I doubt you'll have trouble
<banister> thanks
<erikh> if you do end up out here, we'll have to get beer.
<banister> they contacted me though so i guess that's a good sign
<banister> hehe
<banister> sure thing
<manveru> oh noes, banister joins the dark side
<bgupta> erikh: Unless I am missing something trollop doesn't do all the help generation like Thor does..
<bgupta> Am I doing something wrong?
<injekt> it does
<injekt> iirc you have to use Trollop::die or something
<injekt> not sure, I wasn't a fan (obviously)
<injekt> oh you need to raise Trollop::HelpNeeded
<injekt> ...
<bgupta> OK continuing to read. (And it can do stuff like nested subcommands.. e.g. git branch delete blah
<bgupta> ??
<bgupta> can it do, I mean
<injekt> no
<injekt> their example shows how do to it
<injekt> on their website
<manveru> :)
<bgupta> I tried running their example...
<injekt> (fwiw slop has a Commands class for this)
<manveru> nobody plugging slop, eh?
<injekt> :D
<manveru> ah, there
<bgupta> http://trollop.rubyforge.org/ (The sub-commands code)
<bgupta> it works with subcommand it just isn't printing help
<injekt> bgupta: that doesn't print help
abcsdgad has joined #ruby-lang
<injekt> check the next example, they raise their helpneeded class to show help
<bgupta> I see.
<bgupta> thanks
<injekt> the same thing in slop: https://gist.github.com/a1d310c595e2ee760ae2
<erikh> der herpink
<injekt> herp derpzing
<erikh> on :derp
<injekt> do :herp
abcsdgad has joined #ruby-lang
<hagabaka> yeah, I hate that so many libraries have you subclass things to do things
<erikh> dunno. subclassing feels pretty natural to me
<bgupta> I am working on a massive cli utility that will have lots of nested subcommands, so I am kinda hoping my cli framework really really helps me with the basic stuff.
<erikh> the cult of include seems like more pointless idealism
<injekt> DSL ALL THE THINGS
<injekt> (kidding btw)
<bgupta> (I doesn't help that I am a total begineer ruby coder. and have only written two programs: https://github.com/theforeman/foreman/blob/0.4-stable/extras/cli/foremancli and https://github.com/bgupta/dnsmadeeasy/blob/master/ec2-set-dme-dns.rb (The first link is the program I am rewriting as a git style command, that will support much more functionality)
<banister> bgupta: this also looks cool (by the guy who did nanoc) https://github.com/ddfreyne/cri
abcsdgad has joined #ruby-lang
<injekt> reading from line 59 to 141 was one of the sole reasons I wrote slop
<nofxx> nanoc rocks
<injekt> anyway, as always there's a ton of choices. Try them all and see what works best?
<bgupta> injekt: Of my program??
<erikh> mmm puppet
<injekt> bgupta: what?
<bgupta> nvm.. misunderstood
Asher has joined #ruby-lang
abcsdgad has joined #ruby-lang
<A124> bgupta: (offopic) Any family or other relation with Nitin Gupta?
burns180_ has joined #ruby-lang
<bgupta> No immediate family by that name
<A124> Ok. Thank you ^^
<erikh> gupta's a pretty common indian name, isn't it?
<bgupta> Supposedly the Smith of india. which when it comes down to it, isn't quite as common as it used to be.
<A124> Ah.
<bgupta> But yeah, fairly comon..
<erikh> I see. I was wondering that, but didn't want to assume.
esotericalgo has joined #ruby-lang
<A124> Does anyone know performance differences between 1.8.6(7) and 1.9.3?
<erikh> parallel gc, YARV, better thread management
<erikh> faster rubygems
<erikh> LOTS of things. 1.9.3 is a huge improvement even over 1.9.2
abcsdgad has joined #ruby-lang
<A124> Oh. Thanks a lot. I meant by percentage general or something.. But This is still good. What is faster on rubygems please?
<injekt> you'll have to search for specifics if you want benchmarks
<erikh> yeah, there's no real thing as a general benchmark
<injekt> or better yet, try some out yourself. As erikh says, there's a TON
<erikh> and I'll direct you to the rubygems changelog for information on performance improvements.
<A124> Yeah I should. But what he said gives me even more valuable information for me
<bgupta> erikh: You know puppet?
<erikh> injekt: I need something to do
<A124> Nope.
<injekt> erikh: more blawgh?
<erikh> bgupta: a long time ago I worked on the test suite for it -- I use chef these days
<erikh> injekt: give me a topic
<injekt> hmm
<erikh> something light on opinion and hard on detail & instrumentation -- I hate the DHH style blogs.
<injekt> erikh: did you do Parallel computing lately?
<injekt> ah, light on opinion
<erikh> I did, but I don't feel comfortable talking about it with any authority yet.
Para has joined #ruby-lang
<bgupta> erikh: cool.. I am basically writing "knife" for the foreman+puppet combination.. (Foreman kinda fills the same role as the node classification compnent of the chef server)
<injekt> that's fair
<erikh> bgupta: yeah, I keep hearing about it but i don't know much about it.
yxhuvud has joined #ruby-lang
<bgupta> (I picked the name hammer as a play on knife.)
<erikh> heh.
<erikh> foreman is heroku's deal, right?
Zolrath has joined #ruby-lang
<erikh> I'm *really* looking forward to the chef-server rewrite in erlang.
<bgupta> No it's this guy Ohad Levy, who know works for RedHat.
<injekt> yeah
<injekt> what?
<erikh> the ruby/java mess that is chef-server now is a bit of a cluster-f
<injekt> David Dollar built the foreman I know
<injekt> for heroku
<injekt> maybe there's 2 foremans?
<erikh> we could be talking about two different things.
<injekt> aye
<bgupta> Foreman is great in that it does full bare metal provisioning.
<bgupta> ohh wait there is two foremans
<erikh> foreman is a process manager, yes?
<erikh> the DD foreman.
<bgupta> the newer one, which I am NOT talking about, is much more popular in the ruby community
<injekt> ah
<erikh> I've been meaning to read it because that's what I'm working on
<erikh> injekt: ?
<injekt> erikh: was responding to 'which I am NOT talking about'
<erikh> yes -- but is the foreman I'm thinking of (heroku's foreman) a process manager?
<injekt> oh
<injekt> yessir
<injekt> managing the procfile stuff
<erikh> raggi told me about it, but I haven't looked at it yet.
<bgupta> erikh... there is a feature request to add chef support to foreman, and Ohad is open to it.. but noone working on the project uses Chef, so we don't have anyone that is really in a place to work on it.
<bgupta> (hint hint)
<injekt> it's pretty neat
<erikh> heh
<erikh> well, I don't have much bandwidth these days for big projects
<injekt> amen to that :(
<bgupta> If you ever want it, you can ping him on #theforeman (ohadlevy)
<erikh> I have something big I'm working on already, and it's getting to the point where I'm running into the nitty gritty.... the last mile that's very draining on the brain.
<erikh> bgupta: thanks, but I'll probably have to pass.
<injekt> I wish I had more time for OSS lately
<bgupta> ohad is open to ripping out facter and replacing it with a modular inventory service that you could plug ohai into
<erikh> oh neat
<bgupta> OSS is HARD.
<erikh> there's a couple of ohai-alikes out there.
<erikh> I also wrote this which might be able to assist
<bgupta> yeah.. slat has theirs (grains) and cfengine has something too
<erikh> it's not a comprehensive solution by any means, but it is a starting point if you just want to use the code
<erikh> better than the ifconfig-scraping mess that facter and ohai use.
A1241 has joined #ruby-lang
<bgupta> bookmarked, for anyone who picks up the project.
<erikh> bgupta: doug maceachern has his own thing too, but I forget what it's called
<erikh> it's basically ohai done in C
<erikh> (which IMO is the right way to do it)
<bgupta> My biggest problem is that I don't really know how to code, and just learned some ruby as I desperatly needed a CLI to interact with foreman
<erikh> eh, looking at your code I'd say you're well on the way to being good at it
<erikh> just gotta keep coding.
<bgupta> (I knew bash/awk stuff)
<A1241> erikh: Thanks for the info :) Sorry, I got VDSL2 disconnect xD .. Router was reconfiguring.
<erikh> A1241: no problem.
<A1241> No it was not, the shut it off
<bgupta> It took me an very very long time to write the code you saw, but thank you.
<A1241> Classic "dumb" familly bussines, instead of telling me, they plugit out
gjaldon has joined #ruby-lang
<bgupta> (I spent a long time making sure it wasn't "embarassing", once I got it functional)
davidw has joined #ruby-lang
dous has joined #ruby-lang
rippa has joined #ruby-lang
rippa has joined #ruby-lang
burns180 has joined #ruby-lang
<erikh> heh. my messaging system uses around 110 file descriptors to send 500k messages
<erikh> I should probably fix that.
<erikh> sorry, about 1.5 million messages
<erikh> ruby test.rb > /dev/null 11.56s user 12.68s system 118% cpu 20.521 total
<erikh> not bad really. 0mq is pretty badass
toretore has joined #ruby-lang
burns180_ has joined #ruby-lang
tbuehlmann has joined #ruby-lang
<bgupta> It's frustrating as many of the sugary cli frameworks are missing different pieces, but working to fill the gaps, just none of them are quite there yet. e.g. - gli won't have support for more than one layer of command until v2. And boson can't support running it other than "boson commandname" (can't just run "commmandname". Thor doesn't seem to support global flags. I either have to wait, or do more coding than I ha
<bgupta> hoped to do.
<bgupta> Well more hand rolled "scafolding" than I had hoped to do.
<bgupta> gli and thor both are very easy to use.
brianpWins has joined #ruby-lang
burns180 has joined #ruby-lang
greap has joined #ruby-lang
manojhans has joined #ruby-lang
burns180_ has joined #ruby-lang
Nss has joined #ruby-lang
burns180 has joined #ruby-lang
<erikh> hrm. question: I'm dealing with a lot of file descriptors that get allocated very quickly. to route around some "too many open files" problems, I've inserted GC.start after my close calls.
<Asher> if you use a block for opening files doesn't ruby close them?
<erikh> what I'm wondering is if it makes more sense to queue and batch those closes for performance or not
<erikh> Asher: sockets.
<erikh> 0mq sockets to be precise.
<Asher> GC.start is going to traverse the heap at least once every time it's called
<Asher> … not sure if that is responsive
<yxhuvud> erikh: you could also increase the allowed amount of file descriptors. Not a solution that scales though ..
<erikh> yeah, but doesn't 1.9.3 do it without stopping the world?
<erikh> yxhuvud: yeah, the use case here doesn't make sense to apply ulimit
<Asher> now that you mention it that sounds right but i'm not sure… i know it is cow now and i think that went with it being in its own thread.. but not sure what the status of that is now
A124 has joined #ruby-lang
<erikh> yar. I'll ask a co-worker who's a lot more familiar with this specific class of problems.
ben has quit [#ruby-lang]
takaokouji has joined #ruby-lang
burns180_ has joined #ruby-lang
srbartlett has joined #ruby-lang
gnufied has joined #ruby-lang
robbyoconnor has joined #ruby-lang
SiliconDon has joined #ruby-lang
stamina has joined #ruby-lang
aza_kibou has joined #ruby-lang
machine1 has joined #ruby-lang
fragmach_ has joined #ruby-lang
<fragmach_> anyone know how I could use a regexp to detect a sequence like this ""\006\221\263B\262\210H\256\221\3140m\246\256\210""? The numbers will change but I can split it into pieces or otherwise hack it up.
havenn has joined #ruby-lang
<bnagy> awt?
<bnagy> then how will the new sequence be 'like' that one?
<bnagy> apart from having bytes in it?
<fragmach_> I just need to know whether a similar sequence to that is returned. Its from a Cipher class, and if the password is wrong it returns a whole bunch of that gibberish
<bnagy> that's not gibberish
<bnagy> it's just non-ascii
<fragmach_> oh ok, how can I work it into a more sensible state
<fragmach_> ?
<fragmach_> or more useable
francisfish has joined #ruby-lang
<bnagy> useable for what? I'm not trying to be difficult, but.. it's just a string of bytes
<bnagy> it is not useful or useless inherently
<bnagy> you could try to force_encoding 'UTF-8'
<bnagy> if that fails then you're probably not looking at 'text'
<fragmach_> Basically a method either returns "This is a message" or something similar, or it returns a sequence like that
<fragmach_> I want to be able to say "invalid password" if I get a bunch of bytes like that
<bnagy> that's the thing about symmetric ciphers, they always return _something_
<fragmach_> yea it's annoying, I can;t just search for digits or special characters becuase they might be part of the message
<bnagy> but unless you know for a fact that the plaintext is ascii or similarly constrained you can't tell if you have the right key
<fragmach_> I tried making a regexp but it was to frusterating and I gave up
srbartlett has joined #ruby-lang
<fragmach_> when I put the right key in I get a plaintext response
<bnagy> ok then try the force_encoding trick
<fragmach_> Ok I'll look into it
burns180 has joined #ruby-lang
tekin has joined #ruby-lang
<fragmach_> I get undefined method `force_encoding'
<fragmach_> do I need to require something?
<bnagy> actually probably encode, sorry, that's what I do
fayimora_ has joined #ruby-lang
<bnagy> except now I am confused cause it is not raising an exception like it should
<fragmach_> I don;t have an encode method available, I'm on 1.8.7 btw
<bnagy> on String?
d3vic3 has joined #ruby-lang
<bnagy> ah 1.8.7
<fragmach_> yea becuase macs come with that default
<fragmach_> I have 1.9.3 but anyone I send it too wont
<bnagy> I haven't used 1.8.7 for years. Does it have each_byte?
twittard has joined #ruby-lang
<fragmach_> yea it has each_byte
<bnagy> some_str.each_byte.all? {|b| b&128==0} # good string
<bnagy> that is hideously non-portable etc etc
<fragmach_> it says false
<bnagy> for the bad string, it should
<fragmach_> woot that's awesome!
<fragmach_> yea returns true for good string
<fragmach_> thanks heaps, I've been pulling my hair out for hours!
<bnagy> it's a terrible way to do it
<fragmach_> how does it work?
<bnagy> but it will work for us-ascii
<bnagy> well ascii is all 7 bit, due to legacy reasons
<bnagy> so anything that has the top bit set (which is what binary & with 128 checks) is not ascii
<fragmach_> ok well the message will always be set by my ruby program
<fragmach_> so should be ok
<fragmach_> I think
<fragmach_> haha
machine1 has joined #ruby-lang
jbvp has joined #ruby-lang
looopy has joined #ruby-lang
<jbvp> hi
<A124> *chrrr*
apeiros_ has joined #ruby-lang
SiliconDon has joined #ruby-lang
burns180_ has joined #ruby-lang
benanne has joined #ruby-lang
kek1 has joined #ruby-lang
cyri_ has joined #ruby-lang
gnufied has joined #ruby-lang
burns180 has joined #ruby-lang
wmoxam_ has joined #ruby-lang
wmoxam has joined #ruby-lang
rushed_ has joined #ruby-lang
rushed_ has quit [#ruby-lang]
SiliconDon has joined #ruby-lang
burns180_ has joined #ruby-lang
francisfish has joined #ruby-lang
havenn has joined #ruby-lang
dejongge has joined #ruby-lang
sandbags has joined #ruby-lang
publicvoid_ has joined #ruby-lang
canton7 has joined #ruby-lang
Fullmoon has joined #ruby-lang
burns180 has joined #ruby-lang
tekin has joined #ruby-lang
thone has joined #ruby-lang
manojhans has joined #ruby-lang
manojhans has joined #ruby-lang
ruxpin` has joined #ruby-lang
<ruxpin`> could someone please elaborate on what's happening here with Array#pack("H*")?
<ruxpin`> ["01234567890abcdef"].pack("H*") => "\001#Eg\211\n\274\336\360"
<imperator> erikh, IO.closefrom :)
sirfilip has joined #ruby-lang
<rippa> ruxpin`: it packs hexadecimal bytes
manojhans has joined #ruby-lang
<ruxpin`> rippa: I read that from the Array docs, but I don't really understand what it does on a byte level
<rippa> 001 == 0x01
<ruxpin`> rippa: I need to implement same behaviour on another language (unless a bit library exists, and I have trouble finding a proper library without knowing what it actually does)
<rippa> "#".ord == 35 == 0x23
<rippa> every two letters are treated as hexadecimal byte
A124 has joined #ruby-lang
<ruxpin`> "a" packed is "\240"
<ruxpin`> "A" packed is the same
<ruxpin`> "b" packed is "\260"
<ruxpin`> "ab" packed is "\253"
<ruxpin`> I am puzzled
<rippa> "a" is 0xA0
TvL2386 has joined #ruby-lang
<rippa> "b" is 0xb0
<rippa> "ab" is 0xAB
<ruxpin`> but "ab".to_i(16) is 171
<ruxpin`> how it gets to str "\253"
<rippa> ruxpin`: octal
<rippa> "ab".to_i(16).to_s(8)
<rippa> #=>53
<rippa> *253
<ruxpin`> oooooh
<ruxpin`> but what's with the newline (and #Eg too) in the produced packed string?
<rippa> same
<ruxpin`> just coincidence that the octal falls in ascii range?
<rippa> "#" == "\043"
<rippa> yes
<ruxpin`> great, thanks. I think I got the gist :)
burns180_ has joined #ruby-lang
weeb1e has joined #ruby-lang
<weeb1e> Hi everyone
<weeb1e> Does anyone know why I would be getting this? received ConnectionUnbound for an unknown signature: 7 (EventMachine::ConnectionNotBound)
gnufied has joined #ruby-lang
dous has joined #ruby-lang
<canton7> weeb1e, try posting the code which reproduces that error
<weeb1e> canton7: Nevermind, I found the cause, EM just makes it a real pain to pinpoint
<weeb1e> It was an undefined constant in one of the connections event handler methods
pw_ has joined #ruby-lang
<pw_> hi how can I make https get with auth like: " #curl -G -u "user:pword" https://api.github.com/repos/user/repo/issues " in ruby?
<pw_> someone on so wrote open-uri is flawed and he suggests to use curb, but thats not well documented
<matled> pw_: there are different http libraries available or you can just call an external program like curl
quatauta has joined #ruby-lang
<pw_> matled: thats with %x right?
<matled> pw_: well, I prefer using a temporary file and curl -sSf to catch the error, but %x should work too
<pw_> matled: thx can you recommend a lib though? curbs documentation is ...well its hard :-)
<matled> even though %x is a bit complicated to get right due to shell escape, so I would prefer some method like system or exec which takes the arguments seperately
<matled> I used curb only once, it seems to have quite good features but I found the documentation not too easy too
<pw_> matled: k
<matled> that's the reason why I prefer to call external curl for quick&easy, I already know how to use curl :)
dejongge has joined #ruby-lang
<pw_> matled: <3 curl && wget <3
<matled> pw_: something like this I'm using often: https://gist.github.com/97a313e2970c7ca10e69
BadQuanta has joined #ruby-lang
<matled> pw_: the main problem with this is missing support for connection reusing
<pw_> matled: thats fantastic, hope you dont mind me using that sometime :-)
<matled> sure, use it as you like :)
Guest28535 has joined #ruby-lang
PronamChatterjee has joined #ruby-lang
burns180 has joined #ruby-lang
machine2 has joined #ruby-lang
wmoxam_ has joined #ruby-lang
alex_k has joined #ruby-lang
SiliconDon has joined #ruby-lang
manojhans has joined #ruby-lang
tr-808 has joined #ruby-lang
fayimora has joined #ruby-lang
aroop has joined #ruby-lang
ankurgel has joined #ruby-lang
dejongge has joined #ruby-lang
enebo has joined #ruby-lang
burns180_ has joined #ruby-lang
adambeynon has joined #ruby-lang
seanstickle has joined #ruby-lang
Sailias has joined #ruby-lang
AlHafoudh has joined #ruby-lang
ankurgel has joined #ruby-lang
vesan has joined #ruby-lang
darkf has joined #ruby-lang
tekin has joined #ruby-lang
burns180 has joined #ruby-lang
<ankurgel> nofxx, Hi. You told me about pry (http://pry.github.com/) . I was trying to install it on my machine. Have rvm. Getting this unprecedented error during installation.
<ankurgel> gem install pry
<ankurgel> ERROR: Loading command: install (LoadError)
<ankurgel> no such file to load -- zlib
<ankurgel> ERROR: While executing gem ... (NameError)
<ankurgel> uninitialized constant Gem::Commands::InstallCommand
<ankurgel> Please to help :)
dous has joined #ruby-lang
jamw has joined #ruby-lang
dfr|mac has joined #ruby-lang
chimkan has joined #ruby-lang
<manveru> ankurgel: ready `rvm notes`
<manveru> *read
<ankurgel> manveru, I installed zlib earlier.
<ankurgel> wait a sec
<ankurgel> I installed everything by this:
<ankurgel> rvm pkg install zlib
<ankurgel> rvm pkg install openssl
<ankurgel> and iconv
<ankurgel> then installed some dev lib packages
<ankurgel> then rvm intall 1.9.2 --with-zlib-dir=$rvm_path/usr .. same for other pkgs
<ankurgel> I then set default to 1.9.2
<ankurgel> gem -v works, gives 1.8.5 I think.
<ankurgel> but, gem is unable to install anything.
<andrewvos> hello internets
<erikh> andrewvos: hello!
<andrewvos> erikh: oh hai
<andrewvos> So my evil plan is working it seems https://twitter.com/#!/youreyoureyoure
<andrewvos> It manages to find idiots around the world with pinpoint accuracy
<ankurgel> ^That is cool. 'Your a' sir!
<erikh> heh
<andrewvos> hah
<andrewvos> trying to find a trollface profile pic for it
burns180_ has joined #ruby-lang
<ankurgel> andrewvos, you coded this bot in rb?
SiliconDon has joined #ruby-lang
<andrewvos> ankurgel: yah
<andrewvos> ankurgel: The code is extremely simple
<ankurgel> andrewvos, wow. Can I see the source? bots interest me but presently I I know shit about making them. :)
<andrewvos> ankurgel: It's just a rake task that runs in the heroku scheduler every hour https://gist.github.com/1970654
<ankurgel> andrewvos, really?
morozovm has joined #ruby-lang
<erikh> ankurgel: andrewvos automates his trolling
<erikh> he's had a lot of practice
<andrewvos> haha
<ankurgel> erikh, yes, seems like it.
<ankurgel> automated trolling. Ha :D
manoj has joined #ruby-lang
<ankurgel> andrewvos, how is this scheduler authenticating with that twitter account?
<andrewvos> ankurgel: There's a few lines of config code above that code
<andrewvos> ankurgel: http://twitter.rubyforge.org/
ankurgel has quit ["Leaving"]
ankurgel has joined #ruby-lang
<ankurgel> heftig, hey
Spooner has joined #ruby-lang
<ankurgel> heftig, in morning, you provided some kickass shortcut for task I was trying to do (anagrams grouping)
<ankurgel> ['creams', 'scream', 'scream', 'cats', 'tacs'].group_by { |w| w.each_char.sort }.values
<ankurgel> ^This ,heftig
gokul has joined #ruby-lang
<ankurgel> was going through this again. a little confused in |w| w.each_char.sort part. :|
<seanstickle> What's to be confused about?
<ankurgel> seanstickle, w is an extracted word there, right.
<ankurgel> so, w.each_char.sort kind of provides sorted array,
<ankurgel> but of individual characters.
<seanstickle> Yup
andkerosine has joined #ruby-lang
<ankurgel> oh oh.. Yes, it worked.
gregmore_ has joined #ruby-lang
<ankurgel> so, group_by will create an hash, with key as this,
chimkan___ has joined #ruby-lang
<ankurgel> and values as those who agree with this key, right?
<ankurgel> and, that gives me grouping. *Nice*
QaDeS has joined #ruby-lang
m3nd3s has joined #ruby-lang
francisfish has joined #ruby-lang
dejongge has joined #ruby-lang
<andkerosine> ankurgel: https://gist.github.com/1973664
<andkerosine> That might help you better visualize exactly what's going on.
<ankurgel> andkerosine, Oh Hai!
<andkerosine> 'Allo.
<andkerosine> The keys are all the results that occur within the block.
<ankurgel> and values are those which gets returned by block?
jamw has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
<andkerosine> Hm... no. The block is finding keys.
<andkerosine> The values are everything on the LHS that matches each found key.
<ankurgel> How in ['creams', 'scream', 'scream', 'cats', 'tacs'].group_by { |w| w.each_char.sort } , values are coming from the array on left?
<ankurgel> why not ('a'..'z') then?
<ankurgel> oh.. oh.
<ankurgel> right
<ankurgel> right
<andkerosine> : )
<ankurgel> 'aeiouy'.include? let defines 'true' and 'false'
<ankurgel> which goes as key
<andkerosine> Mm-hmm.
<ankurgel> and those cases from LHS goes as value.
<andkerosine> Nailed it.
<ankurgel> brilliantly explained. Now, got hold of it. :)
<ankurgel> thanks again :)
<andkerosine> I thought it was a solid example.
<andkerosine> Sure thing.
<ankurgel> It is. Indeed, it is.
<andkerosine> Foundations are important. Seeing a feature used in its simplest form helps you visualize how it can be used more complexly.
<ankurgel> will have to continue practicing.
<andkerosine> C'est la vie.
<ankurgel> :)
vesan has joined #ruby-lang
jasonw22 has joined #ruby-lang
<andkerosine> Are you familiar with the practice sites available for Ruby?
<ankurgel> practice sites? as in?
<andkerosine> Sites to practice your Ruby skills on... : )
<ankurgel> erm.. no. I just google and stackoverflow things when I dont' understand.
<ankurgel> not particularly any site to practice any skill.
<ankurgel> what are they?
<andkerosine> Ah, that's no good.
<andkerosine> You want to be more prepared for problems when they arise, and you do that by practicing things before you actually need them.
<andkerosine> Hm, I imagine you've heard of Project Euler, no?
<ankurgel> yes.
<ankurgel> Codechef, spoj
<ankurgel> I practice via spoj and codechef.
<andkerosine> Ah, right on.
<ankurgel> note down programs and code.
<ankurgel> online judge to mark them.
burns180 has joined #ruby-lang
<ankurgel> also, the anagram thing we were doing today, was some kinda assignment which was to be judged online as well.
<ankurgel> that analysis I showed you.. :)
vesan has joined #ruby-lang
<andkerosine> I recall.
<andkerosine> There's also this: http://rubeque.com/
<andkerosine> With a less cluttered scoreboard than most sites.
<andkerosine> == motivation?
<ankurgel> true
<ankurgel> thanks. seems interesting. gonna check that out.
* ankurgel bookmarks.
<ankurgel> hmm. problems are nicely structured. + tags #ftw
<ankurgel> wow
<andkerosine> And they've added a whole lot more since I last visited.
<andkerosine> Might have to jump back in for the fun of it.
<ankurgel> Just 2 pages of problem for now?
<andkerosine> Seems to be so.
any-key has joined #ruby-lang
<andkerosine> http://codeeval.com/ has much more, ah, interesting problems, but they're significantly harder near the end.
havenn has joined #ruby-lang
<ankurgel> hmm. Must prepare for tomorrow's exam first and then get back to ruby.
<andkerosine> Have fun with that.
<andkerosine> : P
<ankurgel> yes, that is like 'Fun! Fun! Fun!'.
<ankurgel> Unnecessary interruption :|
mytrile has joined #ruby-lang
<erikh> so yeah. line 35 runs in a separate thread, but the whole process blocks until line 47 completes. I've verified the proc runs. any reason the global wouldn't be set?
Keva161 has joined #ruby-lang
burns180_ has joined #ruby-lang
lsegal has joined #ruby-lang
jkyle has joined #ruby-lang
<erikh> rue: sorry to pester; but if you're around...
<erikh> I'm le stumped
<andrewvos> :(
<erikh> that *should* be global and set by the time it gets back
<erikh> feh
<erikh> whoa. nevermind
* erikh continues to fail
<erikh> throwing a sleep in there fixed it
mssola has joined #ruby-lang
<erikh> it got the ack before the proc finished.
<erikh> oh! I know why.
<erikh> shiiii
flak has joined #ruby-lang
<andrewvos> wha?
<erikh> basically I need to keep up on this code
<erikh> it's a medium-sized base at this point and I'm working on it once a week or so
jaisoares has joined #ruby-lang
<erikh> but basically the event system there is fire-and-forget
<erikh> the ack comes back before the message is fully processed
rippa has joined #ruby-lang
jaisoares has quit [#ruby-lang]
<erikh> there's a feedback loop in there, a message may never complete
<erikh> (intentional)
mistym has joined #ruby-lang
darkf_ has joined #ruby-lang
Fullmoon has joined #ruby-lang
gokulnath has joined #ruby-lang
mytrile has joined #ruby-lang
maek has joined #ruby-lang
Kero has joined #ruby-lang
maek has quit [#ruby-lang]
<andkerosine> Should that be class_eval'd instead?
deryldoucette has joined #ruby-lang
burns180 has joined #ruby-lang
<Mon_Ouie> I don't see any reason you'd use class_eval there
<shevy> because of his ponies
<andkerosine> Mon_Ouie: Well, just to avoid the unaesthetic repetition.
<andkerosine> They're almost the exact same signature, and DRY is nice.
<andkerosine> Also, the ponies.
tomzx has joined #ruby-lang
<andrewvos> Why won't anybody think of the ponies?
jkyle has joined #ruby-lang
macmartine has joined #ruby-lang
dfr|mac has joined #ruby-lang
thejspr has joined #ruby-lang
<imperator> erikh, i was afk there for a bit, dunno if you saw my message
burns180_ has joined #ruby-lang
wallerdev has joined #ruby-lang
<erikh> imperator: what message? sorry
<erikh> IO.closefrom?
* erikh peeks
<erikh> eh, undocumented?
<erikh> or is it a library?
<erikh> I talked to Lourens Naude and he mentioned ZMQ::LINGER, which seems to resolve most of my issues.
<erikh> either way, it's working and I think it's time to doco this up and merge it
<imperator> yeah, io-extra
<imperator> ok, sounds like you got it, nm
<erikh> ah, something of yours?
<imperator> yep
<Mon_Ouie> Oh, you could use a class macro to define such methods if you want
<erikh> imperator: neat, I'm already using sys-proctable on this project, I may have to poke deeper at that when the time is right
<imperator> erikh, eric wong has contributed some nice patches; i think he uses it with unicorn, or maybe one of his other libs
<erikh> cooool
<erikh> 388 / 391 LOC (99.23%) covered.
<erikh> \o/
<imperator> that reminds me, i need to tweak the rakefile for sys-proctable
havenn has joined #ruby-lang
curtism has joined #ruby-lang
io_syl has joined #ruby-lang
burns180 has joined #ruby-lang
<shevy> hmm
pemeon has joined #ruby-lang
pemeon has quit [#ruby-lang]
adambeynon has joined #ruby-lang
rippa has joined #ruby-lang
jacktrick has joined #ruby-lang
dr_bob has joined #ruby-lang
srbaker has joined #ruby-lang
machine1 has joined #ruby-lang
Z33K|Lux has joined #ruby-lang
mark_locklear has joined #ruby-lang
AlHafoudh has joined #ruby-lang
virunga has joined #ruby-lang
chimkan has joined #ruby-lang
francisfish has joined #ruby-lang
chimkan_ has joined #ruby-lang
havenn has joined #ruby-lang
dejongge has joined #ruby-lang
danishman has joined #ruby-lang
havenn_ has joined #ruby-lang
JEG2 has joined #ruby-lang
Stalkr_ has joined #ruby-lang
vonHohenheimm has joined #ruby-lang
Bwild has joined #ruby-lang
burns180_ has joined #ruby-lang
csprite has joined #ruby-lang
achiu has joined #ruby-lang
csprite has quit [#ruby-lang]
looopy has joined #ruby-lang
riginding has joined #ruby-lang
Heimidal has joined #ruby-lang
burns180 has joined #ruby-lang
<andkerosine> Reckon there'd be any interest in an API gem for tfd.com?
<shevy> dunno
<shevy> I can only say that I dont know what tfd is
<andkerosine> That saddens me a bit.
<shevy> it reminds me of TNT though
<shevy> TNT.explosion!
<andkerosine> No need for it to be destructive. : )
<shevy> hmm now I understand why folks come up with fun names for their gems
<andkerosine> How about a gem for using Gmail for storage?
seanstickle has joined #ruby-lang
<shevy> hmm
<shevy> what's this do?
<shevy> I mean
<shevy> in gmail is only email or?
<andkerosine> No, all files.
<andkerosine> Saving would send to self with an attachment.
<andkerosine> Receiving would use POP to grab the requested file.
<andkerosine> Slow, probably, but novel.
<shevy> hmm
<dominikh> novel? that idea is as old as gmail itself.
<andkerosine> Is there a gem for it? : )
burns180_ has joined #ruby-lang
<dominikh> actually, yes, kind of.
<andkerosine> Hm?
<dominikh> https://rubygems.org/gems/net-fs-gmail-backup – it's far from the API you'd expect, and far from working
<shevy> hehehe
<shevy> we shall build this mighty tower ...
<shevy> ... on sand!!!
gix has joined #ruby-lang
dfr|mac has joined #ruby-lang
mattonrails has joined #ruby-lang
<erikh> there's a FUSE driver for gmail
<andkerosine> dominikh: Where does the bot's username go?
<dominikh> andkerosine: the "username" option
<dominikh> and by "username" I mean "user"...
<andkerosine> And if one isn't supplied, like in the example?
<dominikh> then it uses the default, which is "cinch"
<dominikh> same goes for realname
<andkerosine> Ah.
jxie has joined #ruby-lang
naz has joined #ruby-lang
curtism has joined #ruby-lang
curtism has joined #ruby-lang
retro|cz has joined #ruby-lang
<curtism> e
dubellz has joined #ruby-lang
<shevy> o
burns180 has joined #ruby-lang
jacktrick has joined #ruby-lang
Fullmoon has joined #ruby-lang
brianpWins_ has joined #ruby-lang
<andkerosine> gem install dominiks-hair
<shevy> gem install dominikhs-pony
mistym has joined #ruby-lang
amerine has joined #ruby-lang
sandeep has joined #ruby-lang
danielvdotcom has joined #ruby-lang
burns180_ has joined #ruby-lang
virunga has joined #ruby-lang
SunNoise has joined #ruby-lang
<dominikh> andkerosine: you can't have my hair, sorry
<andkerosine> dominikh: Perfectly reasonable.
<shevy> yay
<shevy> I got his pony!
aza_kibo_ has joined #ruby-lang
acyed has joined #ruby-lang
benanne has joined #ruby-lang
davidw has joined #ruby-lang
burns180 has joined #ruby-lang
jacktrik has joined #ruby-lang
WillMarshall has joined #ruby-lang
achiu has joined #ruby-lang
SunNoise has quit [#ruby-lang]
justinxreese has joined #ruby-lang
havenn has joined #ruby-lang
burns180_ has joined #ruby-lang
twittard has joined #ruby-lang
leopard_me has joined #ruby-lang
jasonw22 has joined #ruby-lang
Keva161 has joined #ruby-lang
ruxpin` has quit [#ruby-lang]
t has joined #ruby-lang
Keva161 has joined #ruby-lang
burns180 has joined #ruby-lang
kyrylo has joined #ruby-lang
brianpWins has joined #ruby-lang
DEac- has joined #ruby-lang
Stalkr_ has joined #ruby-lang
hagebake has joined #ruby-lang
io_syl has joined #ruby-lang
burns180_ has joined #ruby-lang
Fractality has joined #ruby-lang
seanstickle has joined #ruby-lang
wmoxam_ has joined #ruby-lang
wmoxam has joined #ruby-lang
machine1 has joined #ruby-lang
burns180 has joined #ruby-lang
indstry has joined #ruby-lang
indstry has joined #ruby-lang
indstry has quit [#ruby-lang]
S2kx has joined #ruby-lang
Kero has joined #ruby-lang
wmoxam has joined #ruby-lang
postmodern has joined #ruby-lang
wmoxam has joined #ruby-lang
wmoxam_ has joined #ruby-lang
wmoxam has joined #ruby-lang
burns180 has joined #ruby-lang
wmoxam has joined #ruby-lang
morozovm has quit [#ruby-lang]
hagebake has joined #ruby-lang
wmoxam has joined #ruby-lang
igotnolegs has joined #ruby-lang
<dominikh> ... Struct allows index-based access to its fields? wow
macmartine has joined #ruby-lang
fukushima has joined #ruby-lang
kek1 has quit [#ruby-lang]
burns180_ has joined #ruby-lang
m3nd3s has joined #ruby-lang
<andkerosine> dominikh: Do you not agree that that probably does more harm than good?
<dominikh> andkerosine: what does?
<andkerosine> Indexed Struct access.
<dominikh> well, from a technical pov it makes sense. From a design pov not so nice
<andkerosine> Just seems like it opens doors on problems that don't need to be problems.
<lianj> like (uint32)(st+4) or st[1] ?
<andkerosine> *values_at is a little unaesthetic, but it's better than having to plan for, say, an API's order changing.
<lianj> oh wow, wrong channel anyhow :D
<andkerosine> Haha.
<dominikh> :D
<andkerosine> D == C + Ruby?
<dominikh> andkerosine: uhm, actually, Struct#value_at expects integers :)
<andkerosine> #values_at to build a Struct from a Hash.
<dominikh> uhm, how does that have anything to do with how you're _then_ using the Struct?
<andkerosine> Ah, I thought you meant /building/ a Struct.
<andkerosine> Regardless, you have to declare its fields in the initializer, yes?
<dominikh> yes.
<andkerosine> Mm-hmm.
<andkerosine> Sorry. Misinterpreted "access", which is terrible.
<dominikh> Struct actually inherits from Enumerable. So it got iterators, it can even be exploded into an array
ascarter has joined #ruby-lang