« Back to channel list

#ruby - 27 October 2015

« Back 1 day Forward 1 day »
[00:00:03] colstrom_: @Ox0dea Why would you... ew.
[00:00:08] zenguy_pc: has joined #ruby
[00:00:22] Ox0dea: colstrom_: I didn't make it valid.
[00:00:40] Ox0dea: Used sanely, destructuring is pretty nifty; I just like pushing things.
[00:00:58] colstrom_: Oh, sure. Destructuring is a very reasonable concept.
[00:01:17] colstrom_: But... the idea is generally to IMPROVE clarity.
[00:01:40] colstrom_: Still, learned something (horrible and) new.
[00:01:51] rbowlby: has joined #ruby
[00:02:05] crime: mmm thats like lispy and perly
[00:02:22] crime: horrid yet functional
[00:02:39] torpig: has joined #ruby
[00:02:55] colstrom_: Perly Lisp?
[00:03:10] crime: im glad thats not a thing
[00:03:11] colstrom_: All of the power, none of the elegance?
[00:03:19] Ox0dea: crime: You're... in #ruby?
[00:03:20] danneu: meanwhile, in langs without destructuring, you feel like a dingus with your intermediate value you have to manually assign apart
[00:04:06] crime: Ox0dea: ? was i getting too far off topic?
[00:04:24] Ox0dea: crime: No, I meant to indicate that "Perl-y Lisp" is a decent first brush at succinctly describing Ruby.
[00:04:30] dfinninger: has joined #ruby
[00:04:56] workmad3: has joined #ruby
[00:05:01] crime: id say its more of a perly lisp, and id also argue that theres a difference, because ruby has a consistent model of computation and perl less so
[00:05:13] crime: a lispy perl is just higher order perl, which theres plenty of crap on cpan for
[00:05:34] h99h9h88: has joined #ruby
[00:05:35] crime: but a perly lisp has convenient variables already set, and a way to interface with the code that is consistent all the way down, which ruby has
[00:05:43] Ox0dea: Exactly...
[00:05:49] colstrom_: Ox0dea Perl-y Lisp with a health dose of Smalltalk?
[00:05:54] crime: misread you
[00:05:54] Ox0dea: colstrom_: Just so.
[00:06:00] crime: s/all that/yep
[00:06:27] crime: smalltalk died an unjust death
[00:06:33] crime: cog vm tho, that cog vm
[00:07:03] crime: i was real excited about Cardinal as well, before it died
[00:07:08] ss_much: has joined #ruby
[00:07:10] colstrom_: And thus we have my journey FROM Perl and Smalltalk, TO Ruby. I picked up Lisp later, but use it alongside Ruby.
[00:07:15] XxionxX: has left #ruby: ()
[00:07:30] crime: my first language was lisp, then perl, lua, and now ruby
[00:07:38] crime: emacs killed lisp for me
[00:07:43] crime: after a while anyways
[00:07:58] colstrom_: @crime Smalltalk isn't dead! It's... as alive as it ever really was. Probably moreso now, if you count people using it. Pharo and such!
[00:08:08] K1MOS: has joined #ruby
[00:08:14] colstrom_: So much conceptual beauty.
[00:08:22] colstrom_: Wrapped in a development model that just... never caught on.
[00:08:34] colstrom_: And we're all poorer for it.
[00:09:07] crime: i tried a while back to get pharo to compile and never could
[00:09:14] emptyflask: has joined #ruby
[00:09:15] colstrom_: One day... maybe one day, I'll bring those things I loved from Smalltalk's tooling to Ruby.
[00:09:22] crime: i got squeak running after that and quickly realized I don't know the first thing about smalltalk programming
[00:10:23] crime: I really like reading about it, and you know what else I've found, there's another language that has a really interesting model that is worth trying to learn from
[00:10:39] crime: really fascinating architecture, clean code most of the time unless you're reading tk junk
[00:10:56] crime: documentation is p terrible, though
[00:11:36] Alina-malina: has joined #ruby
[00:12:32] Rodya_: has joined #ruby
[00:14:23] EminenceHC: has joined #ruby
[00:15:14] Wompy: has joined #ruby
[00:15:59] MyMind: has joined #ruby
[00:17:18] dfinninger: has joined #ruby
[00:17:19] _blizzy_: has joined #ruby
[00:17:44] _blizzy_: has joined #ruby
[00:17:57] millerti: has joined #ruby
[00:18:14] _blizzy_: has joined #ruby
[00:18:39] _blizzy_: has joined #ruby
[00:19:04] _blizzy_: has joined #ruby
[00:19:29] _blizzy_: has joined #ruby
[00:20:03] jgt1: has joined #ruby
[00:20:20] zenspider: !ban _blizzy_ !T 1d please fix your connection
[00:20:21] ChanServ: +b _blizzy_!*@*
[00:20:21] ChanServ: ChanServ kicked _blizzy_: please fix your connection
[00:22:07] EminenceHC: has joined #ruby
[00:22:38] alcipir: has joined #ruby
[00:22:54] zenspider: !unban _blizzy_
[00:23:30] solocshaw1: has joined #ruby
[00:24:28] zenspider: damnit ruboto
[00:25:25] crime: so I made my 'clever' solution: https://gist.github.com/anonymous/d0712fc26e4dee48280d
[00:25:27] zenspider: !ban _blizzy_ !T 0d argh
[00:25:27] ruboto: zenspider, could not find a matching user for "_blizzy_"
[00:25:32] zenspider: ruboto: FUCK YOU
[00:26:04] ruboto: I don't know anything about rude
[00:26:07] crime: yes you do
[00:26:18] zenspider: you can't be rude to a robot
[00:26:51] shevy: so this is why skynet wanted to get rid of mankind
[00:26:53] crime: he was rude to you
[00:27:06] crime: ?the skynet master plan
[00:27:07] ruboto: skynet, I don't know anything about the
[00:27:20] crime: mhm just what I thought
[00:27:24] crime: tough guy
[00:27:53] ChanServ: +o zenspider
[00:27:55] zenspider: -b _blizzy_!*@*
[00:27:59] rickmasta: has joined #ruby
[00:28:07] crime: you know what if skynet was just a HA thing?
[00:28:10] northfurr: has joined #ruby
[00:28:26] crime: if they had written that in erlang, maybe that wouldntve happened
[00:28:32] crime: just let it crash, right?
[00:28:33] Ox0dea: crime: Your solution doesn't work for 101.
[00:28:41] Ox0dea: And, of course, infinitely many other inputs.
[00:28:52] _blizzy_: has joined #ruby
[00:28:52] ChanServ: +b _blizzy_!*@*
[00:28:52] ChanServ: ChanServ kicked _blizzy_: please fix your connection
[00:28:58] crime: 101 isnt possible
[00:29:00] zenspider: I hate you ruboto
[00:29:11] Ox0dea: crime: The next largest number after 101 that uses the same digits is 110.
[00:29:21] crime: thats problematic
[00:29:29] crime: edge case, probably no big deal whatevs
[00:29:51] Ox0dea: crime: It also doesn't work for 202.
[00:29:55] crime: yes it does though
[00:29:58] crime: i just tried it
[00:30:12] millerti: I wish there were a Ruby equivalent to Sympy.
[00:30:40] Joufflu: has joined #ruby
[00:30:49] crime: thats weird, I got it, and how it inf loops when I try it again
[00:30:53] crime: i did get the answer though
[00:31:02] wildlander: has joined #ruby
[00:31:11] Ox0dea: crime: Your "solution" is non-deterministic by dint of its reliance on #shuffle.
[00:31:19] grambo: has joined #ruby
[00:31:24] crime: but i let it run for at least ten seconds
[00:31:28] crime: surely that would be enough
[00:31:41] crime: i didnt mean to call you that
[00:32:54] crime: so tried it with jruby, and got back the answer instantly, tried it again and it hangs forever
[00:33:11] Ox0dea: That's non-determinism for ya.
[00:33:17] crime: tried it again with ruby, got answer instantly, then never
[00:33:36] crime: well then in a manner of speaking, it might not be possible to reproduce bug reports
[00:33:38] crime: so i'm good
[00:33:42] crime: this is someone else's problem now
[00:33:48] Ox0dea: The universe's.
[00:34:06] zenspider: crime: think about the 'never' part... why is that?
[00:34:09] crime: this may crash codewars one sec
[00:34:21] crime: oh they have a time limit that sucks
[00:34:33] crime: zenspider: idk, because the first time you run it, it works instantly
[00:34:42] crime: thats the weird thing about it
[00:35:28] crime: oh something weird is happening
[00:35:48] crime: i .tap'd my update variable and its dropping a digit somewhere and just saying 11 over and over when I give it 101
[00:35:59] crime: but only the second time i run it
[00:36:14] Ox0dea: >> '011'.to_i # crime
[00:36:14] bruno-: has joined #ruby
[00:36:15] ruboto: Ox0dea # => 11 (https://eval.in/457450)
[00:36:35] crime: that would've taken my dumb ass ages to figure out
[00:36:39] Ox0dea: >> '%d' % '011' # How about this one?
[00:36:40] ruboto: Ox0dea # => "9" (https://eval.in/457451)
[00:36:51] ekinmur: has joined #ruby
[00:37:22] crime: so if 0 is the first digit, it cant be a thing, got it
[00:37:28] crime: i can fix this and bogo on
[00:38:38] pu22l3r: has joined #ruby
[00:42:25] tomchapin: has joined #ruby
[00:42:51] step1step2: has joined #ruby
[00:42:53] cpruitt: has joined #ruby
[00:43:10] tomchapin: has joined #ruby
[00:43:17] agent_white: has joined #ruby
[00:44:30] crime: mk this is not working
[00:45:45] zenspider: crime: not finishing == bad logic. what logic in your code might not finish?
[00:46:06] zenspider: also, your code formatting ... no. just no.
[00:46:11] crime: yeah i know
[00:46:16] crime: im working a better version now
[00:46:17] crime: dont worry
[00:46:50] Ox0dea: crime: Is that Lua's influence, then?
[00:46:52] crime: but it keeps shuffling to 011 and dropping the 0 im just trying to figure out how to call .to_s on it before it drops that 0
[00:47:01] crime: not really thats just ugly code i wrote because i suck
[00:47:20] Ox0dea: crime: I'm referring to things like `then` and `until` at the front of the line.
[00:47:23] crime: doing this particular thing in ruby would be slightly more obnoxious
[00:47:39] Ox0dea: crime: You should consider a deterministic approach.
[00:48:00] crime: i will after the bogo-approach is actually working
[00:49:21] RegulationD: has joined #ruby
[00:50:37] atom3: has joined #ruby
[00:51:26] EminenceHC: has joined #ruby
[00:53:23] nighthwk1: has joined #ruby
[00:53:46] tvw: has joined #ruby
[00:54:01] crime: this works and will work until someone figures out what edge case it doesnt handle properly: https://gist.github.com/anonymous/debb99e693099afb548d
[00:54:22] crime: it doesnt do the NEXT biggest
[00:54:30] jwaldrip: has joined #ruby
[00:54:57] baweaver: has joined #ruby
[00:55:35] al2o3-cr: has joined #ruby
[00:56:28] Ox0dea: crime: Go shopping?
[00:56:57] Ox0dea: "<foo> is hard; let's go shopping" is a thing.
[00:56:58] crime: im about to just travel another layer deeper into bogo
[00:57:11] crime: im gonna fill an array of results and pick the smallest one
[00:58:09] Ox0dea: crime: What if `n` has over 9000 digits?
[00:58:45] gregf: has joined #ruby
[00:58:51] crime: not a test case on codewars and is out of scope of my implementation
[00:59:13] SenpaiSilver: has joined #ruby
[01:00:17] Ox0dea: Now you're thinking inside the box.
[01:00:24] zenspider: crime: "until someone figures out" == you
[01:00:27] tedstriker: has joined #ruby
[01:00:43] zenspider: you need to think about your code BEFORE you type. it isn't on us to think for you
[01:00:51] basiles: has joined #ruby
[01:00:58] dpulliam: has joined #ruby
[01:01:00] verdoc: has joined #ruby
[01:01:02] Ox0dea: crime: Do you own a hammock?
[01:01:18] crime: im living out of my car currently
[01:01:32] Ox0dea: Anything is a hammock if you're brave enough.
[01:01:35] chorgi: has joined #ruby
[01:02:47] bubbys: has joined #ruby
[01:02:48] roxtrongo: has joined #ruby
[01:03:38] crime: this passed the codewar tests, in only a quarter of a second I might add. not exactly a snail's pace! https://gist.github.com/anonymous/3832495ce868e217cb68
[01:04:00] chipotle_: has joined #ruby
[01:04:29] finisherr: has joined #ruby
[01:04:54] bryanray: has joined #ruby
[01:05:16] crime: it passes the tests, but it still takes too long to run somehow. I'm able to run even large numbers in subsecond time, and they are taking more than 6000ms to test 4 numbers each under 10000
[01:05:33] saddad: has joined #ruby
[01:05:48] zenspider: where is the problem description?
[01:05:58] crime: http://www.codewars.com/kata/55983863da40caa2c900004e/train/ruby
[01:06:16] crime: the pragmatic approach is just to swap lower digits towards the right
[01:06:33] baweaver: won't really work
[01:06:49] zenspider: ugh. I can't see anything w/o making an acct
[01:07:26] crime: you take a number and find the next biggest number with the same digits unless one cant be formed
[01:07:35] crime: so 213 is 231
[01:07:36] baweaver: zenspider: Given a number (4312) find the next largest with the same digits (4321)
[01:07:39] crime: 111 is a fail
[01:07:40] ivanskie: has joined #ruby
[01:07:51] al2o3-cr: zenspider: https://gist.github.com/anonymous/1c1f5baad40363c43ebe
[01:08:07] zenspider: so the time should be proportional to the size of the number and shouldn't use things like shuffle or while/until
[01:08:32] baweaver: crime: what can you notice about those numbers you gave?
[01:08:45] baweaver: you're scanning from the right until you happen to see....
[01:09:24] baweaver: 213 -> 231, 4312 -> 4321, 101 -> 110
[01:09:58] emptyflask: has joined #ruby
[01:10:15] baweaver: something partitioning, swapping, and sorting
[01:10:20] crime: im actually gonna call it a night, starbucks is closing
[01:10:24] d34th4ck3r: has joined #ruby
[01:10:37] crime: i'll fix it after work tomorrow i guess
[01:10:43] leafybasil: has joined #ruby
[01:11:00] stannard: has joined #ruby
[01:13:43] alexdunne: has joined #ruby
[01:14:15] thejamespinto: has joined #ruby
[01:14:30] baweaver: http://stackoverflow.com/a/9368616/2872906
[01:14:30] zenspider: oh, n/m... I read partitioning differently
[01:15:17] zenspider: I didn't partition or swap
[01:15:22] zenspider: it's ugly, but most 1-liners are
[01:17:19] finisherr: has joined #ruby
[01:18:08] gregoriokusowski: has joined #ruby
[01:18:58] zenspider: -o zenspider
[01:20:03] bigmac__: how do i print all combinations of 0..1, 10 in length
[01:20:25] idealexit: has joined #ruby
[01:21:16] verdoc: has joined #ruby
[01:21:23] Ox0dea: bigmac__: The same way you did for length 8.
[01:21:47] pullcheezy: has joined #ruby
[01:22:11] baweaver: what have you tried?
[01:23:48] dopie: has joined #ruby
[01:24:05] user083: has joined #ruby
[01:24:24] Ox0dea: bigmac__: http://logs.ryanbigg.com/ruby?date=2015-10-20#4366340
[01:25:09] Contigi: has joined #ruby
[01:25:09] Ox0dea: I almost didn't recognize you with the second underscore.
[01:25:19] dfinninger: has joined #ruby
[01:25:42] havenwood: bigmac__: Change 8 to 10 or 255 to 1023.
[01:26:09] floh1695: has joined #ruby
[01:26:46] bonhoeffer: has joined #ruby
[01:26:53] weemsledeux: has joined #ruby
[01:27:03] baweaver: went and scared another one Ox0dea :(
[01:29:18] chopin: has joined #ruby
[01:29:41] RobertBirnie: has joined #ruby
[01:29:55] baweaver: well, back home I go. Cheers.
[01:30:13] skcin7: has joined #ruby
[01:30:39] govg: has joined #ruby
[01:30:51] K1MOS: has joined #ruby
[01:31:22] bruce_lee2: has joined #ruby
[01:31:26] Ox0dea: Remind me to forget next time.
[01:31:40] tkuchiki: has joined #ruby
[01:32:04] K1MOS: has joined #ruby
[01:32:04] deimos: has joined #ruby
[01:32:55] K1MOS: has joined #ruby
[01:34:08] gregf: has joined #ruby
[01:34:40] skinux_: has joined #ruby
[01:35:59] skinux: has joined #ruby
[01:36:44] jerry_tao: has joined #ruby
[01:36:50] colstrom_: has joined #ruby
[01:36:59] bruno-: has joined #ruby
[01:37:33] K1MOS: has joined #ruby
[01:37:57] floh1695: has left #ruby: ("Leaving")
[01:38:09] dopieee: has joined #ruby
[01:39:35] Alazoral: has joined #ruby
[01:40:26] rbennacer: has joined #ruby
[01:43:10] bigmac__: has joined #ruby
[01:43:39] h99h9h88: has joined #ruby
[01:45:45] chopin: has joined #ruby
[01:46:53] ellisTAA: has joined #ruby
[01:47:30] s00pcan_: has joined #ruby
[01:47:55] pullcheezy: has joined #ruby
[01:50:50] h99h9h88: has joined #ruby
[01:50:55] RegulationD: has joined #ruby
[01:51:00] northfurr: has joined #ruby
[01:51:55] h99h9h88: has joined #ruby
[01:52:08] gregf: has joined #ruby
[01:53:01] workmad3: has joined #ruby
[01:54:22] bigmac__: i found in my history
[01:55:57] matp: has joined #ruby
[01:56:35] freerobby: has joined #ruby
[01:56:47] Ox0dea: It's always in the last place to which you get direct-linked.
[01:57:20] devoldmx: has joined #ruby
[01:57:41] northfurr: has joined #ruby
[01:57:42] sp4rrow: has joined #ruby
[01:58:12] havenwood: bigmac__: Does it need to be ordered?
[01:58:46] alcipir: has joined #ruby
[01:59:05] moeabdol: has joined #ruby
[02:00:05] fedexo: has joined #ruby
[02:00:13] p1k: has joined #ruby
[02:03:31] havenwood: >> bigmac = 10; (2**bigmac).times.map { |n| '%08b' % n }
[02:03:32] ruboto: havenwood # => ["00000000", "00000001", "00000010", "00000011", "00000100", "00000101", "00000110", "00000111", "00 ...check link for more (https://eval.in/457463)
[02:04:51] diegoaguilar: has joined #ruby
[02:06:16] swgillespie: has joined #ruby
[02:06:18] havenwood: Ox0dea: gah
[02:06:51] havenwood: >> bigmac = 10; (2**bigmac).times.map { |n| "%0#{bigmac}b" % n }
[02:06:52] ruboto: havenwood # => ["0000000000", "0000000001", "0000000010", "0000000011", "0000000100", "0000000101", "0000000110", " ...check link for more (https://eval.in/457464)
[02:07:00] banister: has joined #ruby
[02:07:05] jonnie: has joined #ruby
[02:07:23] havenwood: Ox0dea: I'm not the only one having trouble going from 8 to 10. ;)
[02:07:26] govg: has joined #ruby
[02:07:40] dopamean_: has joined #ruby
[02:08:00] Ox0dea: >> bigmac__ = 10; '%0*b' % [bigmac__, 42]
[02:08:01] ruboto: Ox0dea # => "0000101010" (https://eval.in/457465)
[02:08:29] Ox0dea: I quite like that part of sprintf's semantics.
[02:09:26] s00pcan: has joined #ruby
[02:09:57] dikaio: has joined #ruby
[02:10:33] weemsledeux: has joined #ruby
[02:13:17] l_tonz: has joined #ruby
[02:15:24] Igorshp: has joined #ruby
[02:15:59] mollusk_: has joined #ruby
[02:16:27] znz_jp: has joined #ruby
[02:17:15] ruby-newb: has joined #ruby
[02:17:18] jdawgaz: has joined #ruby
[02:18:14] bollullera: has left #ruby: ()
[02:18:29] ruby-newb: anyone here familiar with ruby?
[02:18:35] pipework: What is ruby?
[02:19:06] in0perable: has joined #ruby
[02:19:40] Ox0dea: I only know of the gemstone and the Kaiser Chiefs song by that name.
[02:19:46] p0wn3d: has joined #ruby
[02:19:58] Ox0dea: I suspect it must be asking about one of the two.
[02:21:12] cmoneylu_: has joined #ruby
[02:21:35] ruby-newb: This might be a silly question.. but is there anything special going on if you define an initialize method on a class singleton
[02:21:42] ruby-newb: versus as an instance method
[02:22:55] Ox0dea: ruby-newb: You can't create instances of singleton classes, so `def self.initialize` doesn't make a great deal of sense.
[02:23:08] benlovell: has joined #ruby
[02:23:26] in0perable: aint no python boy
[02:23:40] ruby-newb: well, that's kind of my question
[02:23:54] ruby-newb: is it okay then to define that singleton class method for a different purpose
[02:24:01] ruby-newb: since you can't create an instance
[02:24:22] ruby-newb: and nothing funky will go on?
[02:25:06] Pupeno: has joined #ruby
[02:25:09] Ox0dea: ruby-newb: You are not morally obligated to concern yourself with the mental well-being of the next person to read your code.
[02:25:26] Ox0dea: But it might be you, and that's something to bear always in mind.
[02:26:08] ruby-newb: Well.. I actually did write this code.. and it's committed.. and deployed, but I looked back at it and thought.. that's kind of confusing
[02:26:14] null__: has joined #ruby
[02:26:14] null__: has joined #ruby
[02:27:16] ruby-newb: I'm asking, because I have a feeling it's being called twice.. even though I only ever explicitly call it once
[02:28:00] m3_del: has joined #ruby
[02:28:01] ruby-newb: Was wondering if the awkward/confusing method choice might be the reason why
[02:28:09] Ox0dea: Post code?
[02:29:17] skcin7: has joined #ruby
[02:29:24] chenillen: has joined #ruby
[02:31:38] hahuang65: has joined #ruby
[02:33:02] ruby-newb: http://pastebin.com/VJHntFzW
[02:33:03] ruboto: ruby-newb, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/d82d559b2a5f6c06958c
[02:33:03] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[02:33:15] Asher: has joined #ruby
[02:33:17] ruby-newb: thank you ruboto
[02:35:28] ruby-newb: I call the initialize method on the class just once in my initializors folder
[02:35:45] ruby-newb: It appears my events are getting listened to (logged) twice though
[02:35:49] Ox0dea: ruby-newb: The actual #initialize method on the singleton class, not #new on the class itself, yes?
[02:35:59] Ox0dea: How come?
[02:36:21] ruby-newb: How come what?
[02:36:41] sl33k: has joined #ruby
[02:37:29] Ox0dea: I guess I'm just wondering why you chose the most confusing name possible.
[02:37:53] ruby-newb: Well, I wrote this when I was first learning ruby, so I didn't think much of it
[02:38:17] ruby-newb: The name does make sense, all confusion aside
[02:39:20] bruno-: has joined #ruby
[02:39:38] ruby-newb: I suppose I'll change it, but was just wondering if have picked that name could explain for why the listeners appear to be getting initialized twie
[02:39:46] sanjoseninja: has joined #ruby
[02:40:02] pullcheezy: has joined #ruby
[02:40:07] Ox0dea: ruby-newb: Co-opting #initialize for your own purposes is confusing, and it may well indeed explain the strange behavior you're seeing.
[02:40:40] moeabdol: has joined #ruby
[02:41:21] favadi: has joined #ruby
[02:41:31] Ox0dea: It'd be easy enough to debug-print `caller` to determine whence you're being invoked a second time.
[02:42:34] zenguy_pc: has joined #ruby
[02:48:18] dfinninger: has joined #ruby
[02:48:31] darkf: has joined #ruby
[02:48:34] darkf: has joined #ruby
[02:48:41] sanjoseninja: has left #ruby: ("Leaving")
[02:50:37] slawrence00: has joined #ruby
[02:50:44] ryba: has joined #ruby
[02:51:58] wldcordeiro: has joined #ruby
[02:52:31] AnoHito: has joined #ruby
[02:54:30] Contigi777: has joined #ruby
[02:56:36] pullcheezy: has joined #ruby
[02:56:40] davedev24: has joined #ruby
[02:57:12] auzty: has joined #ruby
[02:58:06] devoldmx: has joined #ruby
[02:59:12] Soda: has joined #ruby
[03:00:05] jwaldrip: has joined #ruby
[03:00:41] The_Phoenix: has joined #ruby
[03:02:32] m3_del: has joined #ruby
[03:02:38] wennefer: has joined #ruby
[03:02:45] davedev24: has joined #ruby
[03:03:01] Musashi007: has joined #ruby
[03:03:03] zenguy_pc: has joined #ruby
[03:03:35] rshetty: has joined #ruby
[03:03:53] AnoHito_: has joined #ruby
[03:04:01] wennefer: has joined #ruby
[03:04:24] bnizzle: has joined #ruby
[03:05:04] jdawgaz: has joined #ruby
[03:05:21] m3_del: has joined #ruby
[03:05:49] wennefer: has joined #ruby
[03:06:48] Eiam_: has joined #ruby
[03:06:50] zenguy_pc: has joined #ruby
[03:07:18] EminenceHC: has joined #ruby
[03:07:47] davedev24: has joined #ruby
[03:09:26] northfurr: has joined #ruby
[03:09:43] wennefer: has joined #ruby
[03:10:13] wennefer: has joined #ruby
[03:13:22] EminenceHC: has joined #ruby
[03:14:30] wennefer: has joined #ruby
[03:15:04] djbkd: has joined #ruby
[03:16:05] cwong_on_irc: has joined #ruby
[03:16:35] baweaver: has joined #ruby
[03:16:39] cwong_on_irc: has joined #ruby
[03:17:22] Trynemjoel: has joined #ruby
[03:18:31] wennefer: has joined #ruby
[03:19:51] uber: has joined #ruby
[03:20:43] v4n: has joined #ruby
[03:21:16] rshetty: has joined #ruby
[03:21:29] bluOxigen: has joined #ruby
[03:22:04] rshetty_: has joined #ruby
[03:22:51] kenichi: has joined #ruby
[03:25:05] zenguy_pc: has joined #ruby
[03:25:47] george2: has joined #ruby
[03:26:12] Trynemjoel: has joined #ruby
[03:28:28] p0wn3d: has joined #ruby
[03:28:54] govg: has joined #ruby
[03:30:06] l_tonz: has joined #ruby
[03:32:11] wennefer_: has joined #ruby
[03:33:31] hahuang65: has joined #ruby
[03:34:43] Trynemjoel: has joined #ruby
[03:36:58] RegulationD: has joined #ruby
[03:38:27] tubuliferous_: has joined #ruby
[03:39:34] naftilos76: has joined #ruby
[03:40:46] alexdunne: has joined #ruby
[03:40:53] bruno-: has joined #ruby
[03:41:17] workmad3: has joined #ruby
[03:42:22] l_tonz: has joined #ruby
[03:44:13] emptyflask: has joined #ruby
[03:48:33] pullcheezy: has joined #ruby
[03:51:40] benlieb: has joined #ruby
[03:52:51] unreal: has joined #ruby
[03:52:54] moeabdol: has joined #ruby
[03:52:59] rshetty: has joined #ruby
[03:53:56] zenguy_pc: has joined #ruby
[03:53:59] Eiam_: Is there a way to do multiple .map(&:one).map(&:two) in the same map?
[03:54:00] jgt1: has joined #ruby
[03:54:09] Eiam_: (I realize the data set is changing after each map)
[03:54:17] finisherr: has joined #ruby
[03:54:21] Eiam_: I guess a reduce
[03:55:07] bigmac__: j'u78uyu[u,, fjkufitrrtpll111111111111111111111111111111111111111111111111111111111111111vghhpoopop[o
[03:55:39] Eiam_: bigmac__: meow
[03:57:53] chopin: has joined #ruby
[03:57:57] davidt: has joined #ruby
[03:58:37] bricker: has joined #ruby
[03:59:11] swgillespie: has joined #ruby
[03:59:13] adamholt: has joined #ruby
[03:59:21] Puffball: has joined #ruby
[03:59:21] baweaver: Eiam_: use the block form
[03:59:53] baweaver: data.map { |v| v.one.two }
[04:00:01] Eiam_: yeah.. meh
[04:00:03] baweaver: don't get carried away in shorthand
[04:00:20] Eiam_: baweaver: It always opens up new areas of ruby to me every time someone points out some weird shorthand
[04:00:33] Eiam_: baweaver: so I usually ask because someone plops out "o this thing" I'm im like what the hell is taht I've never seen that!
[04:00:41] baweaver: could you make it do that, yeah
[04:00:47] baweaver: should you? Probably not
[04:01:00] gener1c: has joined #ruby
[04:01:05] Eiam_: but yes, the longform of .map{|x| x.a.b.c} certainly works
[04:01:49] jdawgaz: has joined #ruby
[04:01:49] tmtwd: has joined #ruby
[04:01:54] sshuff|gone: has joined #ruby
[04:02:38] jwaldrip: has joined #ruby
[04:03:19] bluOxigen: has joined #ruby
[04:04:19] baweaver: >>module Enumerable;def stream(*meths) self.map{|i|meths.reduce(i){|s,m|s.send(m)}} end end; (1..10).stream(:to_s, :chars, :size)
[04:04:20] ruboto: baweaver # => [1, 1, 1, 1, 1, 1, 1, 1, 1, 2] (https://eval.in/457509)
[04:04:54] m3_del: has joined #ruby
[04:05:35] baweaver: https://github.com/baweaver/streamable
[04:05:58] Eiam_: haha, well thats creating a mechanism to do it =)
[04:06:12] baweaver: hence the 'can you' bit
[04:06:24] ruby-lang163: has joined #ruby
[04:07:24] speaking1ode: has joined #ruby
[04:07:27] Eiam_: baweaver: Like I always tell leadership "its code, we can do whatever we want!"
[04:07:33] hmsimha_: has joined #ruby
[04:07:45] baweaver: ACTION raises finger
[04:07:49] baweaver: ACTION lowers finder
[04:07:51] Ox0dea: Eiam_: I'm going to show you something.
[04:07:53] baweaver: you'll figure it out
[04:07:55] Eiam_: but I dont' pitch features so, no one hates me
[04:08:10] baweaver: buckle up mate
[04:08:12] Eiam_: (The glib statement makes no work for everyone)
[04:08:17] baweaver: things are about to get wild
[04:08:29] Ox0dea: baweaver: It's just Uberscore this time.
[04:08:29] Eiam_: Ox0dea: I'm.. excited yet concerned
[04:08:31] Ox0dea: Eiam_: https://gist.github.com/0x0dea/628de90e12acc1874a9a
[04:08:35] leafybasil: has joined #ruby
[04:08:43] baweaver: When Ox0dea drops code you know things are going down
[04:08:51] Ox0dea: I like it, but you probably shouldn't.
[04:09:03] Eiam_: undef_method *instance_methods
[04:09:05] Eiam_: that doesn't seem good
[04:09:39] Eiam_: okay well, lets see if I can understand this =)
[04:09:43] rshetty: has joined #ruby
[04:09:49] Ox0dea: It's so that #method_missing can catch anything you attach to `&_`.
[04:09:58] inteq: has joined #ruby
[04:10:11] baweaver: what's the verbose bit for?
[04:10:29] Ox0dea: baweaver: You're not supposed to undef #__send__ and #__id__.
[04:10:47] braincrash: has joined #ruby
[04:11:00] Eiam_: isn't that why he defines :_ ?
[04:11:11] Ox0dea: s/__id__/object_id/, apparently.
[04:11:46] Ox0dea: Eiam_: I define #_ on Kernel so that you can use `&_` from "anywhere".
[04:12:02] Ox0dea: With Uberscore, you can say `foo.map(&_one.two.red.blue)`.
[04:12:22] Ox0dea: Symbols are hard; let's go prosing.
[04:13:02] Eiam_: right you define it on kernel
[04:13:27] Ox0dea: Otherwise you'd have to explicitly `include` Uberscore wherever you wanted to use it, and that'd be lame.
[04:14:12] baweaver: problem is it'd be nasty slow.
[04:14:25] ellisTAA: has joined #ruby
[04:15:17] sl33k: how is ruby the language able to pull off all that magic that adding "has_secure_password" to a model gives you?
[04:15:20] Eiam_: so basically every time you try to call another ., it adds it into your chain array, which & calls to_proc on
[04:16:15] Eiam_: which then just reduces through the array of failed method_missing calls ?
[04:16:18] Ox0dea: Eiam_: Almost; #to_proc is being invoked on an instance of Uberscore::Context, not @chain.
[04:16:20] Eiam_: it works backwards ..
[04:16:33] Ox0dea: It doesn't.
[04:16:42] baweaver: sl33k: #RubyOnRails
[04:16:55] sl33k: baweaver: this is a language question.
[04:17:01] baweaver: it's a method
[04:17:09] sl33k: the language gives it the power
[04:17:13] Ox0dea: sl33k: In short, everything is always open.
[04:17:17] sl33k: baweaver: so that is a method call?
[04:17:24] baweaver: it's a method
[04:17:29] Eiam_: sl33k: https://github.com/rails/rails/blob/869a90512f36b04914d73cbf58317d953caea7c5/activemodel/lib/active_model/secure_password.rb#L53
[04:17:54] sl33k: so in the method do they add instance variables to an existing object
[04:18:04] baweaver: read Eiam_'s link
[04:18:25] ivanskie: has joined #ruby
[04:18:33] Eiam_: (its the source for its implementation as far as i can tell)
[04:18:44] Eiam_: looks pretty straightforward at a glance but I'm hardly a pro
[04:18:45] baweaver: looks like it at least.
[04:18:57] Eiam_: nothing like what Ox0dea posted =)
[04:19:13] Ox0dea: Uberscore is remarkably straightforward for what it does...
[04:19:49] Eiam_: Ox0dea: =p unregistering instance methods, and abusing method_missing
[04:19:58] Eiam_: not exactly ruby 101
[04:20:01] Eiam_: just DSL 101
[04:20:01] Ox0dea: It's the only way...?
[04:20:11] sl33k: Eiam_: the method definition helps me in understanding. thanks
[04:20:15] dopieee: has joined #ruby
[04:20:35] sl33k: i dont know enough of ruby modules to understand the top of the code page though ( would ignore that for now)
[04:20:37] danneu: uberscore looks nice. ruby is too verbose without `.map(_+2)` style shortcuts
[04:20:38] arescorpio: has joined #ruby
[04:20:40] sl33k: ACTION magic
[04:20:48] Ox0dea: danneu: I emphatically agree.
[04:21:07] Ox0dea: That map(&:foo) can't be chained or receive arguments is a wart, in my opinion.
[04:21:26] baweaver: it's mostly a weakness from freestyle parens
[04:21:35] danneu: it's no clojure, for sure
[04:21:45] Ox0dea: Clojure has freestyle parens? :P
[04:22:05] Eiam_: Ox0dea: hah, yeah thats basically exactly what I was asking for
[04:22:06] danneu: nah just cool style
[04:22:10] baweaver: it has all the parens you could dream of
[04:22:10] Eiam_: I'm loath to actually put this in my code though
[04:22:16] willardg: has joined #ruby
[04:22:24] Ox0dea: Eiam_: Then you have to open an explicit block or invoke #map twice.
[04:22:30] Eiam_: Ox0dea: right
[04:22:58] danneu: i also like the hack https://github.com/sconover/wrong
[04:23:02] Ox0dea: Eiam_: You'd only run into trouble if you used Uberscore in a scope where you had a local named _.
[04:23:10] baweaver: Look into Scala if you like that style
[04:23:11] zenguy_pc: has joined #ruby
[04:23:21] Eiam_: sl33k: include <blah> just craps all the module methods in
[04:23:33] Eiam_: sl33k: the rest of its literally just basic method calls & enums
[04:24:02] benlovell: has joined #ruby
[04:24:34] sl33k: ruby feels to powerful and kinda feel i might cut myself too easily coming from Java
[04:24:55] Ox0dea: Ruby is a Swiss-army footgun.
[04:24:57] Pupeno: has joined #ruby
[04:24:57] Pupeno: has joined #ruby
[04:25:32] danneu: you just have to learn to shoot through the hole you keep making in your foot
[04:25:57] Eiam_: its only a problem when you have t odebug someone elses code
[04:26:03] Eiam_: who is using their footgun
[04:26:13] Ox0dea: But "someone else" could be you in five minutes.
[04:26:14] danneu: e.g. your own code in a few months
[04:26:14] baweaver: ACTION hates Java
[04:26:17] braincra-: has joined #ruby
[04:26:27] arup_r: has joined #ruby
[04:26:32] Eiam_: Ox0dea: all my code is write once, because the projects change every year
[04:26:38] Eiam_: so I never get to reuse anything anyway
[04:26:42] danneu: ruby conspires against you in simple ways too. like `require 'thing'` dumping into the global namespace.
[04:26:48] Eiam_: write once, extend a few times through out the year, then throw out
[04:26:50] danneu: nice lil obstacle for you in a week
[04:26:52] stannard: has joined #ruby
[04:26:56] danneu: "so where did this come from"
[04:27:02] Eiam_: repeat all over again
[04:27:36] Eiam_: but yeah, if I was writing code I had to maintain
[04:27:44] Eiam_: I probably wouldn't choose ruby (even tho I love ruby)
[04:28:00] baweaver: you can write junk in any language
[04:28:04] Ox0dea: > There is no good and evil, there is only power, and those too weak to seek it.
[04:28:05] baweaver: it's not the fault of the language
[04:28:25] Eiam_: baweaver: I don't think there is a problem with Ruby
[04:28:33] Eiam_: I think that a LOT of people see a problem and in ruby they think "time for A DSL"
[04:28:42] Eiam_: and that can make interfacing with the rest of the ruby eco system very cumbersome
[04:28:57] gix: has joined #ruby
[04:29:03] Eiam_: because i've got 30 libs using method_missing
[04:29:16] Eiam_: and stepping through it all becomes a painful experience
[04:29:32] danneu: "i'll just grep this method and look up the source code!"
[04:29:50] Ox0dea: But we have #source_location.
[04:30:15] Eiam_: battle vets show their stripes
[04:30:22] baweaver: https://sift-tool.org/index.html
[04:30:23] Ox0dea: baweaver: Is it actually better than ag?
[04:30:30] Ox0dea: Their benchmarks look artificial.
[04:30:40] baweaver: spent all that time looking at ag to find this a week later
[04:30:45] baweaver: ops friend recommended it
[04:31:03] baweaver: hadn't had a chance to test it
[04:31:07] baweaver: but ag works fine for most things
[04:31:10] danneu: #source_location that takes you to method_missing?
[04:31:56] baweaver: Ox0dea: *snarks* they're using it to extract HTML with REGEXP
[04:32:36] baweaver: Maybe they're using the simpler implementation of Regex? PCRE and friends are actually kinda nasty slow
[04:32:50] Ox0dea: I think they're using simpler everything.
[04:33:11] baweaver: see https://swtch.com/~rsc/regexp/regexp1.html
[04:33:24] baweaver: I'll have to look into it later honestly
[04:33:33] baweaver: ag is proven good so I still tend to use it a lot
[04:33:42] baweaver: that and emmet, especially with angularJS apps
[04:34:24] Ox0dea: baweaver: That they're dead-silent on the actual files used to get their numbers smells of snake oil.
[04:34:36] baweaver: mmm, good catch
[04:39:19] davedev24: has joined #ruby
[04:39:58] jerry_tao: has left #ruby: ()
[04:41:17] bruno-: has joined #ruby
[04:43:56] l_tonz: has joined #ruby
[04:44:55] Ox0dea: Eiam_: Uberscore is scarcely a proper target for DSL hatred.
[04:44:59] Ox0dea: Here, take this: https://eval.in/457517
[04:45:12] hahuang65: has joined #ruby
[04:45:13] Eiam_: Ox0dea: I didn't say it was
[04:46:11] Ox0dea: I know, I just wanted to show that. :P
[04:46:11] stardiviner: has joined #ruby
[04:47:17] Ox0dea: '!' isn't the best character for drawing Langton's ant, but it's ' ' + 1 and that was convenient.
[04:47:57] moeabdol: has joined #ruby
[04:49:36] benlieb: has joined #ruby
[04:50:20] sanjayu: has joined #ruby
[04:51:26] mloy: has joined #ruby
[04:52:32] davedev24: has joined #ruby
[04:52:52] blur3d: has joined #ruby
[04:54:10] tubuliferous_: has joined #ruby
[04:55:39] foooobear: has joined #ruby
[04:55:41] d34th4ck3r: has joined #ruby
[04:58:51] devoldmx: has joined #ruby
[05:02:59] mloy: has left #ruby: ("Leaving")
[05:06:21] zenguy_pc: has joined #ruby
[05:09:36] leafybasil: has joined #ruby
[05:10:43] s2013: has joined #ruby
[05:13:50] towski_: has joined #ruby
[05:15:57] alatebloomer: has joined #ruby
[05:17:03] Coldblackice: has joined #ruby
[05:17:29] jgt1: has joined #ruby
[05:18:07] Bloomer: i am new here, first time
[05:18:34] jdawgaz: has joined #ruby
[05:18:36] Bloomer: anyone can see my message?
[05:18:40] rshetty: has joined #ruby
[05:19:07] djbkd: has joined #ruby
[05:20:05] Ox0dea: Hi, Bloomer.
[05:20:22] Bloomer: thanks for reply
[05:20:36] stardiviner: has joined #ruby
[05:20:39] Bloomer: i thought no one can see me lol
[05:20:50] ellisTAA: has joined #ruby
[05:20:59] sp4rrow: has joined #ruby
[05:21:12] nemo_: has joined #ruby
[05:21:18] Ox0dea: > The world is quiet here.
[05:21:56] devoldmx: has joined #ruby
[05:22:22] Bloomer: i got some question
[05:22:35] Bloomer: i am going to build a api with rails
[05:22:39] stardiviner: has joined #ruby
[05:22:40] Bloomer: what you guys recommend?
[05:22:56] Bloomer: use grape or rails-api or any others?
[05:23:22] nemo__: has joined #ruby
[05:23:31] Ox0dea: Bloomer: Is it going to be a tiny little thing?
[05:23:57] Bloomer: i think so, very basic api
[05:24:10] Bloomer: but maybe need to also incldue some webpage
[05:24:17] Ox0dea: Then every offering in the space is likely to provide the functionality you'll need.
[05:24:18] Bloomer: webpage and api
[05:24:37] Bloomer: what you mean?
[05:24:48] Bloomer: you mean to use rails-api gem?
[05:24:57] HANJIN: has joined #ruby
[05:25:02] weemsledeux: has joined #ruby
[05:25:22] Ox0dea: Have you looked into it and found it to be deficient for your purposes?
[05:26:48] Bloomer: if I need API functino and web app in same rails app
[05:26:57] Bloomer: can I do that?
[05:27:33] baweaver: Probably want to be asking in #RubyOnRails
[05:27:58] baweaver: but in general yeah, you can. Look into responds_to and go through a basic rails tutorial
[05:28:03] shinenelson: has joined #ruby
[05:28:13] moeabdol: has joined #ruby
[05:28:16] ruby964: has joined #ruby
[05:28:24] Ox0dea: >> Class.instance_methods & Enumerable.instance_methods
[05:28:25] ruboto: Ox0dea # => [:include?] (https://eval.in/457518)
[05:28:32] Musashi007: has joined #ruby
[05:28:35] Ox0dea: Pop quiz: when is that a problem?
[05:29:01] Bloomer: sorry~i dont know we have #RubyOnRails
[05:29:08] Bloomer: i will ask it there
[05:29:19] workmad3: has joined #ruby
[05:29:27] lxsameer: has joined #ruby
[05:29:35] willardg: has joined #ruby
[05:34:07] sp4rrow: has joined #ruby
[05:34:09] govg: has joined #ruby
[05:36:31] HakN99: has joined #ruby
[05:37:58] favadi: has joined #ruby
[05:39:08] solocshaw: has joined #ruby
[05:41:19] HakN99: has joined #ruby
[05:43:54] flyinprogrammer: has joined #ruby
[05:44:38] Bloomer: Why I cannot talk in #RubyOnRails channel?
[05:45:30] h99h9h88: has joined #ruby
[05:46:13] Ox0dea: ?rails Bloomer
[05:46:13] ruboto: Bloomer, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[05:46:17] davedev24: has joined #ruby
[05:46:48] quazimodo: has joined #ruby
[05:47:04] quazimodo: anyone here use Rally for project management?
[05:47:22] HakN96: has joined #ruby
[05:48:01] Bloomer: ok~ let me try
[05:48:44] tkuchiki: has joined #ruby
[05:52:41] arup_r: Bloomer: Good you joined #ruby. Your life will be changed now
[05:55:10] Moblin: has joined #ruby
[05:57:04] craysiii: has joined #ruby
[05:58:48] krz: has joined #ruby
[06:01:20] dionysus69: has joined #ruby
[06:01:45] yeticry_: has joined #ruby
[06:03:30] astrobunny: has joined #ruby
[06:05:37] quaj: has joined #ruby
[06:05:41] Gnomethrower: has joined #ruby
[06:09:17] psye: has joined #ruby
[06:09:46] bruno-: has joined #ruby
[06:10:11] dionysus69: has joined #ruby
[06:12:06] bricker: has joined #ruby
[06:16:24] dhjondoh: has joined #ruby
[06:20:56] Guest78532: has joined #ruby
[06:21:18] charliesome: has joined #ruby
[06:23:14] astrobunny: has joined #ruby
[06:24:41] krz: has joined #ruby
[06:24:52] benlovell: has joined #ruby
[06:25:32] krz: has joined #ruby
[06:25:42] l_tonz: has joined #ruby
[06:25:48] dionysus69: has joined #ruby
[06:25:59] l_tonz: has joined #ruby
[06:32:36] big|bad|wolf: has joined #ruby
[06:33:38] jgt1: has joined #ruby
[06:33:40] vdamewood: has joined #ruby
[06:34:21] Rollabunna: has joined #ruby
[06:34:42] dionysus69: has joined #ruby
[06:35:27] agent_white: has joined #ruby
[06:36:37] ruurd: has joined #ruby
[06:37:46] Musashi007: has joined #ruby
[06:38:05] dionysus69: has joined #ruby
[06:38:48] yardenbar: has joined #ruby
[06:40:16] tagrudev: has joined #ruby
[06:40:29] aganov: has joined #ruby
[06:41:47] patdohere: has joined #ruby
[06:42:41] dionysus69: has joined #ruby
[06:42:41] dionysus69: has joined #ruby
[06:43:05] m3_del: has joined #ruby
[06:47:19] The_Phoenix: has joined #ruby
[06:47:27] skade: has joined #ruby
[06:48:09] leat: has joined #ruby
[06:52:11] favadi: has joined #ruby
[06:53:29] duncannz: has joined #ruby
[06:54:18] Motoservo: has joined #ruby
[06:54:43] jwaldrip: has joined #ruby
[06:55:14] dionysus69: has joined #ruby
[06:55:19] rshetty: has joined #ruby
[06:56:09] krz: has joined #ruby
[06:59:26] lkba: has joined #ruby
[07:00:17] astrobunny: has joined #ruby
[07:01:34] trosborn: has joined #ruby
[07:05:41] ta: has joined #ruby
[07:07:59] riotjones: has joined #ruby
[07:10:01] bruno-: has joined #ruby
[07:11:12] northfurr: has joined #ruby
[07:12:34] Pupp3tm4st3r: has joined #ruby
[07:12:40] duoi: has joined #ruby
[07:15:41] hahuang65: has joined #ruby
[07:16:27] skade: has joined #ruby
[07:16:55] Xeago: has joined #ruby
[07:17:26] workmad3: has joined #ruby
[07:19:35] jas02: has joined #ruby
[07:19:36] Guest78532: has left #ruby: ()
[07:20:00] trautwein: has joined #ruby
[07:22:06] skcin7: has joined #ruby
[07:24:44] sgambino: has joined #ruby
[07:26:55] favadi: has joined #ruby
[07:28:36] ta: has joined #ruby
[07:29:56] andikr: has joined #ruby
[07:32:47] duncannz: has joined #ruby
[07:32:51] astrobunny: has joined #ruby
[07:34:26] rshetty: has joined #ruby
[07:34:40] l_tonz: has joined #ruby
[07:35:15] p1k: has joined #ruby
[07:40:22] karapetyan: has joined #ruby
[07:40:24] dionysus69: has joined #ruby
[07:40:42] howdoi: has joined #ruby
[07:42:09] Motoservo: has joined #ruby
[07:43:15] caliostro: has joined #ruby
[07:45:04] m3_del: has joined #ruby
[07:45:49] yardenbar: has joined #ruby
[07:46:03] neanderslob: has joined #ruby
[07:47:58] jackjackdripper: has joined #ruby
[07:48:18] Ox0dea: Hey, caliostro. Still looking for a debugger? :P
[07:48:34] A124: has joined #ruby
[07:49:43] caliostro: hi 0x0dea, i am playing which byebug
[07:49:50] caliostro: it's very fun!
[07:50:18] sdwrage: has joined #ruby
[07:50:30] Fredrich010: has joined #ruby
[07:50:57] jonnie: has joined #ruby
[07:51:28] caliostro: i am using it to do thread debugging, it works for me
[07:51:30] ruurd: has joined #ruby
[07:52:25] Pumukel: has joined #ruby
[07:54:12] codecop: has joined #ruby
[07:55:54] caliostro: i would like to found a plugin for emacs
[07:56:38] terlar: has joined #ruby
[07:59:03] arup_r: has joined #ruby
[07:59:35] benlieb: has joined #ruby
[08:00:11] krz: has joined #ruby
[08:01:45] SCHAAP137: has joined #ruby
[08:01:51] trosborn: has joined #ruby
[08:02:30] trosborn: has joined #ruby
[08:03:39] benlovell: has joined #ruby
[08:04:57] shevy: you poor man
[08:08:30] sl33k: has joined #ruby
[08:10:18] sl33k: how do you even choose the right gems?
[08:10:30] leafybasil: has joined #ruby
[08:10:55] sl33k: in java world, we had things like Apache, Google, Sun/Oracle libraries that we could trustt
[08:11:02] ljarvis: sl33k: does it work? when was it last updated/is it still maintained? the first one being of utmost importance
[08:11:17] sl33k: playing around and I typed: blog gems, found tens of hits
[08:11:24] bruno-: has joined #ruby
[08:11:37] sl33k: ljarvis: i cant invest the time checking all of them gems
[08:11:56] yardenbar: has joined #ruby
[08:12:00] sl33k: its a sincere question man
[08:12:02] ljarvis: I mean, I don't expect you to check them all
[08:12:05] sl33k: ...or woman
[08:12:07] ljarvis: but pick 2 popular ones
[08:12:28] trosborn: has joined #ruby
[08:12:45] ljarvis: do you have a partcular example or are you speaking in general?
[08:12:49] sl33k: apparently found out a friend of mine wrote a gem for batch into ActiveRecord yesterday
[08:13:01] apeiros: ?toolbox sl33k
[08:13:01] ruboto: sl33k, https://www.ruby-toolbox.com is a website which lists lots of gems, topically organized
[08:13:22] apeiros: sl33k: toolbox also includes some metrics in its overview which can help with the decision.
[08:13:28] apeiros: but generally, there's no guarantees.
[08:13:34] TomyWork: has joined #ruby
[08:13:40] sl33k: truth be told, i know this friend from Java world...either way I'll rather use a Hibernate or Spring library than his code. Why? I have assurance of continuality maintenance from last two than some individual
[08:14:27] astrobunny: has joined #ruby
[08:14:42] ljarvis: yeah unfortuantely that's hardly guarenteed, it's a price you have to pay and a chance you have to take
[08:15:21] agent_white: has joined #ruby
[08:15:30] ljarvis: i wish i had moretime for oss at the moment :( *still* no internet in the new place even after 5 weeks
[08:15:47] apeiros: oh wow, that's fucked
[08:15:55] sl33k: thanks for toolbox link...looks better
[08:16:20] ljarvis: yeah, been working at family/friends/coffee shops :(
[08:16:23] sl33k: ljarvis: i hope to start doing OSS earlu y next year
[08:16:29] ljarvis: sl33k: great!
[08:16:33] sl33k: just a lot of stuff to take in first >-<
[08:18:18] aufi: has joined #ruby
[08:19:30] last_staff: has joined #ruby
[08:19:42] colegatron: has joined #ruby
[08:19:54] colegatron: good morning
[08:20:04] AxonetBE: has joined #ruby
[08:20:33] froginvasion: has joined #ruby
[08:21:35] agent_white: has joined #ruby
[08:21:47] skade: has joined #ruby
[08:22:29] Peg-leg: has joined #ruby
[08:27:22] haxrbyte_: has joined #ruby
[08:29:37] zotherstupidguy: has joined #ruby
[08:30:29] troulouliou_div2: has joined #ruby
[08:30:43] norc: has joined #ruby
[08:30:44] bruce_lee2: has joined #ruby
[08:31:43] norc: Is there a way to specify a quantifier for a regex group before the group?
[08:32:12] norc: I just feel like it decreases readability so much to have this at the end.
[08:32:24] blaxter: has joined #ruby
[08:32:34] apeiros: quantifier comes after the quantified element
[08:33:03] apeiros: you'd have to write your own engine, or a "transpiler" (yay, buzzword!)
[08:33:19] rshetty_: has joined #ruby
[08:34:15] norc: apeiros: Fair enough. I mean with your tip from yesterday regarding /x it is not such a big deal, because with good indention and commenting I can work with it.
[08:34:20] jgt1: has joined #ruby
[08:35:12] Pupeno: has joined #ruby
[08:38:16] pandaant: has joined #ruby
[08:38:51] froginvasion: norc, just wondering but why do you want this besides readability? I think it's unavoidable that regexes are already unreadable either way
[08:38:58] kimegede: has joined #ruby
[08:39:11] froginvasion: not "unreadable", but as in a sense, you need to 'parse' it with your mind in order to make sense of it
[08:41:12] rshetty: has joined #ruby
[08:41:55] apeiros: for the amount of information a regex contains, I find them actually quite readable
[08:42:23] yfeldblum: has joined #ruby
[08:42:25] apeiros: I've seen tries of more readable expression engines and the result was not pretty (stuff like "3 times 'x', 3-5 times 'z'")
[08:42:48] apeiros: I mean they looked nice for tiny expressions. but anything reasonably complex simply exploded.
[08:43:15] norc: Honestly anything that approaches complex is often easier handled with a proper parser.
[08:43:34] apeiros: honestly, you're wrong ;-)
[08:43:40] norc: Possibly. :)
[08:43:58] norc: I have just seen Perl programs. So maybe Im just branded in a bad way here.
[08:44:04] apeiros: I mean yes, there's cases where people try with insanely complex regex where I'd agree a proper parser would probably be better.
[08:44:21] norc: apeiros: So it comes down to what you and I consider "complex" :)
[08:44:33] apeiros: but parsers are complex themselves too and come with their own set of problems.
[08:45:02] apeiros: regex have the advantage of being rather compact, which gives you a large amount of locality. that helps a lot with understanding what's going on.
[08:45:07] big|bad|wolf: has joined #ruby
[08:45:12] Motoservo: has joined #ruby
[08:45:25] trosborn: has joined #ruby
[08:45:45] lipoqil: has joined #ruby
[08:45:50] m3_del: has joined #ruby
[08:45:53] solars: has joined #ruby
[08:47:03] apeiros: one of my largest regexen is for email validation, covering most of email address BNF (deliberately left some stuff out because I don't want that to be valid - like multiline addresses).
[08:47:07] apeiros: you could write that with a parser
[08:47:16] apeiros: but I think it'd be a *lot* more pain.
[08:47:26] hfp_work: has joined #ruby
[08:48:43] Fredrich010: has joined #ruby
[08:48:59] kerunaru: has joined #ruby
[08:50:23] astrobunny: has joined #ruby
[08:50:30] apeiros: norc: https://gist.github.com/apeiros/361975e9551c06cc5ea7 <- that's complex ;-)
[08:50:58] norc: apeiros: Ah well. This supposedly RFC 822 compliant regex is a bit more complex. http://ex-parrot.com/~pdw/Mail-RFC822-Address.html
[08:51:12] apeiros: rfc822 is obsolete, though
[08:51:15] alexdunne: has joined #ruby
[08:51:56] norc: apeiros: But yeah, this is not what I meant when I said complex. :)
[08:52:57] apeiros: the domain part btw. is [^@] because there's a separate test for that
[08:53:33] norc: Gotcha. It is an interesting example to look at though.
[08:53:55] troulouliou_div2: has joined #ruby
[08:54:56] norc: But it shows that what I have been doing yesterday (splitting my regex into the smallest parts, and interpolating them into the next logical bits again) was not wrong. :)
[08:55:53] apeiros: yes, IME that's quite a successful strategy.
[08:56:00] apeiros: it also allows testing the small chunks individually.
[08:57:19] mikecmpbll: has joined #ruby
[08:58:12] workmad3: has joined #ruby
[08:59:08] mark2: has joined #ruby
[09:00:26] CrazyEddy: has joined #ruby
[09:00:27] norc: apeiros: Yeah. Definitely beats http://pastie.org/10510639 (that is what AddrSpec apparently yields after all interpolations)
[09:01:42] apeiros: granted, if you wrote it by hand, you'd probably drop all the (?:-imx???) parts
[09:02:59] joonty: has joined #ruby
[09:03:48] marr: has joined #ruby
[09:05:41] apeiros: *sob*, rugged docs wrong, or I can't read.
[09:06:00] Pupeno: has joined #ruby
[09:06:00] Pupeno: has joined #ruby
[09:07:42] benhuda: has joined #ruby
[09:07:54] ibouvousaime: has joined #ruby
[09:12:38] yashinbasement: has joined #ruby
[09:13:13] jonnie: has joined #ruby
[09:13:36] Stan: has joined #ruby
[09:14:02] techsethi: has joined #ruby
[09:14:03] zipace: has joined #ruby
[09:14:03] zipace: has joined #ruby
[09:14:36] big|bad|wolf: has joined #ruby
[09:16:22] vigintas: has joined #ruby
[09:16:40] chthon: has joined #ruby
[09:16:44] Motoservo: has joined #ruby
[09:17:06] _joes__: has joined #ruby
[09:17:11] Hounddog: has joined #ruby
[09:20:25] mbrownes: has joined #ruby
[09:20:44] yardenbar: has joined #ruby
[09:20:54] TomyWork: has joined #ruby
[09:21:52] bonemind: has joined #ruby
[09:22:18] subscope: has joined #ruby
[09:22:32] Hounddog: has joined #ruby
[09:22:59] mbrownes: Hi there! I'm new to ruby and I'm working on a small project where I'm building a connect four clone for in the terminal. I was thinking of using (n)curses to make the UI more usable. My question is: would this be to hard for a beginner and which curses library would you recommend?
[09:23:29] mbrownes: I see that the original stdlib library has gone stale
[09:23:35] mbrownes: is it stale good to use?
[09:24:53] nfk|laptop: has joined #ruby
[09:25:30] senayar: has joined #ruby
[09:27:53] quazimodo: has joined #ruby
[09:28:13] caliostro: i can found a lot of tutorial on ruby and tcl tk integration
[09:29:24] gizless: has joined #ruby
[09:29:27] mbrownes: I'm not necessarily looking for a full on GUI solution, I still want the program to run in the terminal
[09:29:33] mbrownes: Thanks though
[09:30:39] bnizzle: has joined #ruby
[09:32:19] Archyme_: has joined #ruby
[09:33:02] caliostro: Look for this book, "Build Awesome Command-Line Applications in Ruby"
[09:33:36] caliostro: You will go deep into writing ruby command line application, using OptionParser and Gli
[09:35:45] oddmunds: mbrownes: i've used ncurses
[09:36:03] oddmunds: it was some years ago, but the libraries were abandoned and outdated
[09:36:27] yfeldblum: has joined #ruby
[09:36:28] mbrownes: did you use a ruby wrapper or the native library?
[09:37:05] jgt1: has joined #ruby
[09:37:18] tolo123: has joined #ruby
[09:37:42] tolo123: has left #ruby: ()
[09:39:24] TheHodge: has joined #ruby
[09:39:45] govg: has joined #ruby
[09:40:01] oddmunds: mbrownes: here's what i used https://github.com/jraregris/cave-santa/blob/master/lib/svirfneblin/display.rb
[09:40:18] mbrownes: Because I really don't like having an interactive game in a terminal where every gamestate is printed again to the screen one after another
[09:40:32] mbrownes: would be nice if i could just update the game board in the terminal
[09:41:04] mbrownes: is this your project?
[09:41:25] oddmunds: ncursesw is probably what you want (unless there's come something better since)
[09:41:51] oddmunds: it let's you use unicode
[09:41:57] mbrownes: there's the original stdlib library curses
[09:42:11] mbrownes: https://github.com/ruby/curses
[09:42:22] mbrownes: i'm checking out ncursesw right now
[09:43:35] Feyn: has joined #ruby
[09:43:49] mbrownes: yeah curses still has some commits from this year
[09:44:47] voker57: has joined #ruby
[09:44:47] krz: has joined #ruby
[09:45:05] Timba-as: has joined #ruby
[09:46:35] m3_del: has joined #ruby
[09:48:07] Motoservo: has joined #ruby
[09:48:43] karapetyan: has joined #ruby
[09:49:30] dmolina: has joined #ruby
[09:54:03] beauby: has joined #ruby
[09:54:48] jimms: has joined #ruby
[09:55:09] dikaio: has joined #ruby
[09:55:25] yardenbar: has joined #ruby
[09:56:28] niemcu: has joined #ruby
[09:56:46] jgt1: has joined #ruby
[09:57:37] caliostro: what is the advantage of using Fiber over Thread ?
[09:57:59] rodfersou: has joined #ruby
[09:59:15] apeiros: that question makes as much sense as asking "what's the advantage of eating an apple over a pear?"
[09:59:38] apeiros: fibers and threads are different. which one you should use depends on what you want to do.
[09:59:53] ljarvis: well.. the shape of the apple makes me feel more comfortable, pears are insane
[10:00:14] Igorshp: has joined #ruby
[10:00:50] apeiros: the main difference is that threads are preemptive and fibers are cooperative
[10:01:20] leafybasil: has joined #ruby
[10:01:24] ljarvis: and apples are tastier
[10:01:31] apeiros: ljarvis: lies!
[10:01:51] apeiros: actually I don't even know.
[10:01:58] apeiros: don't remember when I last ate a pear.
[10:02:06] ljarvis: but i eat apples, so logic
[10:02:10] leafybasil: has joined #ruby
[10:02:38] apeiros: hm, nice. just realized that this test app doesn't need to use rails. at all. so plain gem. yay :D
[10:02:57] ljarvis: that's what you call success
[10:03:10] caliostro: i understand
[10:03:21] apeiros: and finally finished one part of my git tool - I can now check whether an acceptance branch contains commits which are "problematic" (read: not coming from another branch, not just a merge commit, and change something else than just Gemfile & Gemfile.lock)
[10:03:34] caliostro: i am new to this concept, i've never found it in othere languages , os ,...
[10:03:56] quazimodo: has joined #ruby
[10:04:04] foooobear: has joined #ruby
[10:04:06] yfeldblum: has joined #ruby
[10:04:07] Musashi007: has joined #ruby
[10:04:11] apeiros: caliostro: quite a couple of languages implement concurrency in one way or the other. and your OS certainly does.
[10:04:17] apeiros: though, php and javascript don't.
[10:04:18] favadi: has joined #ruby
[10:04:36] apeiros: (unless you count webworkers, but I'd like to pretend that webworkers don't exist)
[10:04:46] adaedra: pear > apple
[10:05:29] adaedra: (and I'd like to pretend PHP don't exist)
[10:07:17] akem: has joined #ruby
[10:07:39] apeiros: oh how I'd like to be able to pretend php doesn't exist???
[10:07:51] apeiros: luckily it only resurfaces only every now and then anymore.
[10:08:12] AxonetBE: has left #ruby: ()
[10:08:15] tvw: has joined #ruby
[10:12:05] yayu___: has joined #ruby
[10:12:54] vsh_: has joined #ruby
[10:13:04] vsh_: has left #ruby: ()
[10:13:18] benlovell: has joined #ruby
[10:13:54] yayu___: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[10:16:11] jgt1: has joined #ruby
[10:18:40] trautwein: has joined #ruby
[10:18:52] norc: adaedra: JS has some form of concurrency tho in form of the event queues
[10:19:16] apeiros: norc: nope. all concurrency happens outside of js.
[10:19:27] tkuchiki_: has joined #ruby
[10:19:44] apeiros: there's no way to concurrently run *js code*. (insert webworker comment)
[10:20:35] rickmasta: has joined #ruby
[10:21:23] AlexRussia: has joined #ruby
[10:21:38] sameerynho: has joined #ruby
[10:21:48] Olipro_: has joined #ruby
[10:22:06] yardenbar: has joined #ruby
[10:23:10] Musashi007: has joined #ruby
[10:23:56] bruno-: has joined #ruby
[10:24:07] astrobunny: has joined #ruby
[10:25:31] ibouvousaime_: has joined #ruby
[10:26:42] gregoriokusowski: has joined #ruby
[10:27:00] norc: apeiros: I just meant stuff like XHR (granted, it is just a simple form of cooperative multitasking) - so there is *some* concurrency at least. :)
[10:27:21] apeiros: norc: but XHR is not javascript code running concurrently.
[10:27:27] krisquigley: has joined #ruby
[10:27:33] sgambino: has joined #ruby
[10:28:05] tkuchiki: has joined #ruby
[10:28:19] Pathfinder: has joined #ruby
[10:28:29] norc: The pain you get for real concurrency with shared resources is immense though.
[10:28:51] apeiros: but you could implement an event system like what js uses with fibers quite easily (I once did with threads, then realized I could have just used fibers - so stupid)
[10:30:39] l_tonz: has joined #ruby
[10:32:11] workmad3: http://joearms.github.io/2013/04/05/concurrent-and-parallel-programming.html <-- JS can be concurrent, but not parallel (unless you use webworkers)
[10:32:38] norc: Doesnt Ruby have a GIL in the MRI to prevent real parallelism?
[10:33:26] workmad3: norc: it prevents more than 1 thread being active at once... you could still have parallelism at a higher system level by having multiple ruby processes
[10:33:28] norc: workmad3: I think the only instance where you can actually interrupt code is through some immediate events which need to get processed immediately.
[10:33:48] subscope: has joined #ruby
[10:34:34] workmad3: norc: concurrency doesn't require interruptible code... it just means two 'things' can be ongoing at once, e.g. while one 'thing' is waiting for an ajax response, another 'thing' could be responding to an event
[10:34:52] ibouvousaime: has joined #ruby
[10:34:53] davedev24: has joined #ruby
[10:34:57] Motoservo: has joined #ruby
[10:35:13] colegatron: has joined #ruby
[10:35:24] apeiros: workmad3: no, JS can't even be concurrent.
[10:35:25] yorickpeterse: norc: a GIL prevents in-process parallelism
[10:35:37] apeiros: a mistake surprisingly many people make
[10:35:52] workmad3: apeiros: so you're saying than you can never have an ajax request waiting while other events happen?
[10:35:56] apeiros: you can offload work to an external party which probably even does it in parallel
[10:36:09] apeiros: workmad3: no, I say ajax is not *js code* being concurrently run
[10:36:28] apeiros: it's work offloaded to an external party. outside your js runtime.
[10:37:15] apeiros: and the response has to wait for the JS runtime to signal the ability to process it (i.e., no code running anymore)
[10:37:28] astrobunny: has joined #ruby
[10:37:31] norc: apeiros has a point here. ajax does just a call to the XMLHttpRequest API of the browser. When its done, the browser then inserts an event into the JS event queue
[10:38:40] workmad3: hmm... I'd still argue that semantically, that's concurrency in your JS app, because conceptually your JS code is waiting on the response to an ajax request (so things are progressing there) while other things can occur
[10:38:56] workmad3: but I'm not particularly invested in that view, so feel free to knock it down ;)
[10:39:26] apeiros: workmad3: given that a JS usually consists of more than JS, I'd agree. but JS itself is not capable of concurrency.
[10:39:41] apeiros: i.e. *js app* is concurrent. *js code* is not.
[10:39:59] workmad3: apeiros: ah, there's the difference... I see concurrency as a property of a system, not at the code level :)
[10:40:18] apeiros: in that case, anything which can be embedded can be concurrent.
[10:40:38] apeiros: which makes the distinction somewhat pointless IMO :)
[10:41:59] jwaldrip: has joined #ruby
[10:42:07] karapetyan: has joined #ruby
[10:42:30] workmad3: apeiros: I'm not sure which distinction you're referring to there
[10:42:40] Igorshp: has joined #ruby
[10:43:49] ldnunes: has joined #ruby
[10:44:02] metalic: has joined #ruby
[10:47:09] hfp__work: has joined #ruby
[10:47:12] Azure: has joined #ruby
[10:47:22] m3_del: has joined #ruby
[10:49:01] pard: has joined #ruby
[10:49:39] froginvasion: apeiros, of course you can make 'concurrent' requests, or so they will appear to be. JS works with an event-loop-model
[10:49:49] agent_white: has joined #ruby
[10:50:01] davedev24: has joined #ruby
[10:50:27] pard: in 2.0, this won't work def _l(l,L) print l, L end _l /l/, 12
[10:51:06] tesuji_: has joined #ruby
[10:51:09] pard: i'm not sure why
[10:51:51] pard: because it actually works in the prev versoins
[10:52:57] pard: am i maybe doing sth in a wrong way?
[10:53:09] workmad3: pard: 'SyntaxError: (irb):1: formal argument cannot be a constant' <-- seems pretty clear why they finally got around to disallowing it
[10:53:29] pard: oh thanks
[10:54:35] govg: has joined #ruby
[10:54:55] pard: i'm not sure though as why this won't work too def l_(l,_l) print l, _l end l_ /l/, 12
[10:56:05] stamina: has joined #ruby
[10:56:20] workmad3: pard: needs a ; to terminate the def statement
[10:56:23] workmad3: >> def l_(l,_l) print l, _l end; l_ /l/, 12
[10:56:24] ruboto: workmad3 # => (?-mix:l)12nil (https://eval.in/457695)
[10:56:52] pard: thanks a lot; will it work in 2.0 ?
[10:56:56] Musashi007: has joined #ruby
[10:57:21] workmad3: pard: def l_(l,_l) print l, _l end l_ /l/, 12 doesn't work in 1.9 either btw
[10:57:34] pard: ACTION goes to put it to test
[10:57:44] workmad3: 19>> def l_(l,_l) print l, _l end l_ /l/, 12
[10:57:45] ruboto: workmad3 # => /tmp/execpad-0e929bbf254f/source-0e929bbf254f:2: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/457696)
[10:57:52] workmad3: 18>> def l_(l,_l) print l, _l end l_ /l/, 12
[10:57:53] ruboto: workmad3 # => /tmp/execpad-bb49f54954f6/source-bb49f54954f6:2: syntax error, unexpected tIDENTIFIER, expecting kEN ...check link for more (https://eval.in/457697)
[10:57:56] norc: workmad3: Which ambiguity does that help solving though?
[10:58:52] workmad3: norc: statements need either a newline or a ; to terminate... def l_(l,_l) print l, _l end is a statement
[10:59:26] norc: Good point
[10:59:39] RegulationD: has joined #ruby
[10:59:40] norc: Hopefully some day I might not be terrible at all of this. :(
[11:00:01] syath: has joined #ruby
[11:00:35] beast: has joined #ruby
[11:00:44] hmsimha_: has joined #ruby
[11:00:54] RegulationD: has joined #ruby
[11:01:03] y0da: has joined #ruby
[11:01:12] Igorshp: has joined #ruby
[11:01:15] ruby-lang903: has joined #ruby
[11:02:07] RegulationD: has joined #ruby
[11:02:53] spider-mario: has joined #ruby
[11:03:15] astrobunny: has joined #ruby
[11:03:22] vasilakisFiL: has joined #ruby
[11:03:22] RegulationD: has joined #ruby
[11:03:37] ruurd: has joined #ruby
[11:03:51] vasilakisFiL: hey! just wondering.. is there any performance/memory difference when you have defined a class inside another class vs a class inside a module ?
[11:03:56] vasilakisFiL: and instantiate the inner class of course
[11:04:00] kerunaru: has joined #ruby
[11:04:40] RegulationD: has joined #ruby
[11:04:58] ledestin: has joined #ruby
[11:05:07] Jackneill: has joined #ruby
[11:05:17] allcentury: has joined #ruby
[11:05:22] norc: vasilakisfil: Use what makes more sense, and worry about performance after: a) you have written functional code, b) written tests, c) profiled, and d) deduced that this is a bottleneck.
[11:05:54] vasilakisFiL: Yeah that's what I do.. but I was just wondering..
[11:05:55] RegulationD: has joined #ruby
[11:07:12] RegulationD: has joined #ruby
[11:07:35] sepp2k: has joined #ruby
[11:07:57] norc: vasilakisfil: From what I understand about the object model it should not make a difference either way though.
[11:08:22] RegulationD: has joined #ruby
[11:11:31] norc: vasilakisfil: To your question though: class Foo; end -- this creates a new Class, and adds a constant ("Foo") to the constant table of whatever "self" is in that context.
[11:11:36] norc: (Someone correct me if Im wrong here)
[11:12:06] norc: vasilakisfil: So based on your question, there is no difference.
[11:13:43] charliesome: has joined #ruby
[11:13:48] Timba-as: has joined #ruby
[11:15:57] pard: has joined #ruby
[11:17:32] pard: def l ( _12 ) print _12 end ; 5 / l 5
[11:17:48] pard: what might be wrong?
[11:19:03] pard: why SyntaxError: (irb):2: syntax error, unexpected tINTEGER, expecting keyword_do or '{' or '('
[11:20:59] pard: ACTION is actually highly baffled
[11:21:18] adaedra: I'm not even sure what this code is supposed to do.
[11:21:37] adaedra: Also, give real names to your arguments. What is "_12" supposed to mean.
[11:22:12] Igorshp: has joined #ruby
[11:22:30] pard: def baffl (anArgument) anArgument end ; 5 / baffl 5
[11:22:39] adaedra: A name should describe what you method/variable/class/module/dinosaur/etc is supposed to be/do.
[11:22:44] ccooke: pard: the parser does not like a statement after a methodd definition
[11:22:53] Jackneill_: has joined #ruby
[11:23:16] weihan: has joined #ruby
[11:23:28] adaedra: pard: add parenthesis around baffl argument. Otherwise, there's an ambiguity.
[11:24:29] pard: thanks a lot ccooke
[11:24:43] norc: >> p not true
[11:24:44] ruboto: norc # => /tmp/execpad-813912d63833/source-813912d63833:2: syntax error, unexpected keyword_true, expecting '( ...check link for more (https://eval.in/457711)
[11:24:44] pard: thanks a lot adaedr
[11:24:56] norc: Why does this not work? o_o
[11:25:19] pard: adaedra thanks
[11:25:24] adaedra: norc: because it does `(p not) true`
[11:25:33] norc: >> p(not true)
[11:25:34] ruboto: norc # => /tmp/execpad-8b3fbe21f0a8/source-8b3fbe21f0a8:2: syntax error, unexpected keyword_true, expecting '( ...check link for more (https://eval.in/457712)
[11:25:49] niftylettuce: has joined #ruby
[11:25:59] adaedra: interesting.
[11:26:38] kirun: has joined #ruby
[11:26:46] ccooke: it's still ambiguous
[11:26:55] ccooke: >> p(not(true))
[11:26:56] ruboto: ccooke # => false ...check link for more (https://eval.in/457713)
[11:28:30] pard: adaedra, i thought e1 e2 l means e1(e2(l))
[11:28:48] zotherstupidguy: has joined #ruby
[11:28:57] norc: ccooke: An SO answer claims this is because Ruby uses an LALR parser for a non-LALR grammar mmm.
[11:29:32] ccooke: makes sense
[11:30:03] pard: they have been doing it in a harder-than-actually-necessary
[11:30:27] pard: their solution in my humble opinion is more of a problem
[11:30:28] caliostro: useless code, unexpected tINTEGER, expecting keyword_do or '{' or '(' from (irb):107:in `eval'
[11:31:03] workmad3: pard: it does... but you're not using that particular rule, you're using infix /, so you're getting (5 / baffl) 5 effectively
[11:31:20] workmad3: >>d ef baffl(anArgument) anArgument end ; 5./ baffl 5
[11:31:21] ruboto: workmad3 # => /tmp/execpad-a74cd13241ab/source-a74cd13241ab:2: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/457722)
[11:31:30] workmad3: >> def baffl(anArgument) anArgument end ; 5./ baffl 5
[11:31:31] ruboto: workmad3 # => 1 (https://eval.in/457723)
[11:31:36] jonnie: has joined #ruby
[11:32:05] zenguy_pc: has joined #ruby
[11:32:09] pard: thanks, so l 5 is an expressiol? or an statemen?
[11:33:11] norc: class Foo; end; # If I run this on main object, where does the constant "Foo" get added to?
[11:33:34] blaxter: has joined #ruby
[11:33:50] pard: i mean, can it be thought of as having less precedenc than / ?
[11:33:58] dhjondoh: has joined #ruby
[11:34:02] etyety: has joined #ruby
[11:34:33] prestorium: has joined #ruby
[11:35:25] chipotle: has joined #ruby
[11:35:29] civil_: has joined #ruby
[11:37:13] norc: Oh nvm I remember. It gets added to Object (its eigenclass)
[11:37:18] but3k4: has joined #ruby
[11:37:46] Motoservo: has joined #ruby
[11:37:55] impostorship: has joined #ruby
[11:37:59] impostorship: has joined #ruby
[11:38:53] pard: >> def l(e) e end; l(l 5)
[11:38:54] ruboto: pard # => 5 (https://eval.in/457737)
[11:39:55] pard: ruboto, thanks ; so l 5 _is_ an expressoin?
[11:42:50] apeiros: froginvasion: read. the. backlog.
[11:43:23] pard: apeiros, greetin's
[11:44:28] pard: def baffl (anArgument) anArgument end ; 5 / baffl 5 won't work
[11:44:37] p0wn3d: has joined #ruby
[11:45:04] pard: can it be caused by the list-op havng a less precedenc than / ?
[11:46:07] eikood: has joined #ruby
[11:46:21] norc: pard: For operator precedence, take a look at this nicely formatted table: http://stackoverflow.com/a/21060235
[11:46:48] shevy: how did you find that norc
[11:46:49] chorgi: has joined #ruby
[11:46:51] pard: norc, thanks a lot
[11:46:52] mbeasley: has left #ruby: ("WeeChat 0.4.2")
[11:46:57] shevy: pard was asking for exactly that yesterday wasn't he
[11:47:07] pard: no he was not
[11:47:26] norc: shevy: I randomly typed URLs until I found what I was looking for. (Note, this statement might not be true)
[11:48:03] m3_del: has joined #ruby
[11:48:34] pard: so, list-op is not an actual op ? it is not listd there
[11:49:13] alexdunne: has joined #ruby
[11:49:53] trabulmonkee: has joined #ruby
[11:50:12] ruurd: has joined #ruby
[11:50:29] pard: shevy , greetin's; no, what i'm asking is whether list-op is an actual op , and if it is , what is its precedenc
[11:50:56] jimms: has joined #ruby
[11:50:59] norc: pard: http://stackoverflow.com/a/21060235
[11:51:04] norc: http://ruby-doc.org/core-2.1.5/doc/syntax/precedence_rdoc.html
[11:52:43] TPBallbag: has joined #ruby
[11:52:51] pard: norc, thanks but could not find list-op ;sir, as for what list-op means, in l 12, 12 l is a list-op
[11:52:57] sdothum: has joined #ruby
[11:53:01] gregf: has joined #ruby
[11:53:18] pard: am i being a nitpicker?
[11:53:21] shevy: and what is l 12, 12 l
[11:53:29] shevy: looks like a palindrome to me
[11:53:42] pard: shevy , i meant l 12, 12
[11:53:49] pard: l is calld a list-op
[11:53:52] shevy: ok that is l(12,12) right?
[11:55:06] naztharune: has joined #ruby
[11:55:31] astrobunny: has joined #ruby
[11:55:35] shevy: well it's a method call
[11:55:45] hughjass: has joined #ruby
[11:56:09] shevy: you are right, the tables don't mention rules for ()
[11:56:50] subscope: has joined #ruby
[11:56:59] pard: i'm trying to unravel the reason sth lik 5 / l 5 won't work
[11:58:05] pard: i have been told it is because / takes precedenc over list-op , so it actually becomes ( 5 - l ) 5
[11:58:06] norc: pard: If you repeadedly refuse to read the answer you have been given already, Im not sure shevys response will help you.
[11:58:51] shevy: pard how can it become ( 5 - l ) 5
[11:58:54] shevy: where is the /
[11:59:07] pard: sorry i meant /
[11:59:10] norc: shevy: Today I learned something bizarre.
[11:59:18] norc: For real!
[11:59:21] shevy: norc does it have something to do with cats?
[12:00:06] solocshaw: has joined #ruby
[12:00:11] Cyther: has joined #ruby
[12:00:15] norc: >> def cats(a) end; cats(not true)
[12:00:16] ruboto: norc # => /tmp/execpad-59afbbbc3b79/source-59afbbbc3b79:2: syntax error, unexpected keyword_true, expecting '( ...check link for more (https://eval.in/457745)
[12:00:33] norc: I actually stared at this for a good minute, until someone here explained it to me.
[12:00:55] pard: norc, by 'list-op' i mean an actuall op , not a list of op's, and i could not find it in the links i was given; my apologies though, i should have clarified it
[12:01:02] CloCkWeRX: has joined #ruby
[12:02:38] norc: pard: Have you tried looking for yourself?
[12:02:50] pard: i did ; no avail :\
[12:03:38] pard: looks like an anomaly
[12:03:40] synthroid: has joined #ruby
[12:03:59] norc: pard: Well, given the data you have, Im sure you can quickly test that one case for yourself.
[12:04:09] pard: i will :)
[12:04:48] shevy: norc right, I think someone here mentioned that once... eam probably, he is a parser-guru (in perl)
[12:05:10] pard: >> def l(_e) _e end; print l 5, l 5
[12:05:11] ruboto: pard # => /tmp/execpad-11ee811382a2/source-11ee811382a2:2: syntax error, unexpected tINTEGER, expecting keywor ...check link for more (https://eval.in/457753)
[12:05:29] norc: shevy: You mean he wrote an LALR parser using nothing but regular expressions?
[12:05:29] shevy: pard did we not start with that syntax error yesterday :D
[12:05:41] benhuda: has joined #ruby
[12:05:50] shevy: norc I dunno... perhaps he did in the past when he was using perl. he is much older now, like larry wall's younger brother
[12:06:24] shevy: ruby people tend to do extremely weird stuff when they are bored
[12:06:33] agent_white: has joined #ruby
[12:06:45] norc: pard: If you really want to write unreadable code, I recommend you give perl a try. You will have much better success there. ;-)
[12:07:03] pard: no ; it was the L.getInt /e/ - 5 thing (for which i was given an answr)
[12:07:42] atomical: has joined #ruby
[12:07:55] shevy: yeah, // makes regex
[12:07:59] shevy: >> /foo/.class
[12:08:00] ruboto: shevy # => Regexp (https://eval.in/457758)
[12:08:15] pard: norc, sir, i'm doing a torture test on the parser;by shevy!
[12:08:24] shevy: but it still always is L.getInt(/e/ - 5)
[12:08:58] shevy: Ox0dea what happened to [k ?
[12:09:33] pard: >> class L; def L.getInt(e) 5 end end; L.getInt /e/ - 5
[12:09:34] ruboto: pard # => undefined method `-' for /e/:Regexp (NoMethodError) ...check link for more (https://eval.in/457760)
[12:09:45] pard: >> class L; def L.getInt(e) 5 end end; L.getInt / 5 / - 5
[12:09:46] ruboto: pard # => wrong number of arguments (0 for 1) (ArgumentError) ...check link for more (https://eval.in/457761)
[12:09:46] Motoservo: has joined #ruby
[12:10:21] pard: its quirky
[12:10:24] shevy: did you find a bug there
[12:10:46] pard: i presume no; a quirk
[12:11:34] pard: i wonder why they have not yet considerd a man-made parser
[12:11:49] pard: much like the llvm's cpp thing
[12:11:53] shevy: why is this not a bug?
[12:12:44] pard: i have been told it's all about semi-sginificant space
[12:15:25] norc: pard: Because Matz said so.
[12:15:40] pard: you naild it pard :)
[12:16:23] pard: i wonder though, making parens an optional thing has little merits
[12:16:32] pard: i might be wrong though
[12:16:43] crime: has joined #ruby
[12:17:05] sanjayu: has joined #ruby
[12:18:14] roxtrongo: has joined #ruby
[12:18:16] pard: it's much like a misleading ad -- <h1>"it's optional!"</h1> <h12>"except where it is not"</h12>
[12:18:22] agent_white: has joined #ruby
[12:21:50] norc: pard: No it is still optional.
[12:22:01] pard: what about this
[12:22:06] norc: pard: Operator precedence does not affect this.
[12:22:09] norc: >> def a(a) 2.0 end; 3 / (a 5)
[12:22:10] ruboto: norc # => 1.5 (https://eval.in/457781)
[12:22:20] norc: The () to call a is still optional.
[12:22:25] pard: >> def l(e) e end; print l 5, l 5
[12:22:26] ruboto: pard # => /tmp/execpad-7928da07e314/source-7928da07e314:2: syntax error, unexpected tINTEGER, expecting keywor ...check link for more (https://eval.in/457782)
[12:22:58] pard: it's optional where it's not actually requird
[12:23:00] norc: >> def l(e) e end; print (l 5), (l 5)
[12:23:01] ruboto: norc # => 55nil (https://eval.in/457783)
[12:23:02] andykingking: has joined #ruby
[12:23:03] norc: It is still optional.
[12:23:14] andykingking: has left #ruby: ()
[12:23:43] pard: unless where it is not, like the one you gave
[12:23:58] norc: pard: And I showed you how it is optional.
[12:24:12] norc: I made two calls to l without ().
[12:24:43] norc: The extra paranthesis I added are not for method calls, but to guide the parser.
[12:25:33] pard: still they are requir'd, thoug not to signify an invocation
[12:26:21] norc: Just like paranthesis can be required various mathematical notations to change the precendence of operators. They are still *optional*
[12:26:27] Pupp3tm4st3r: has joined #ruby
[12:26:50] pard: but print l 5, l 5 won't parse; that's what i mean sir
[12:27:00] tknz: has joined #ruby
[12:27:29] Igorshp: has joined #ruby
[12:27:40] user083: has joined #ruby
[12:28:19] pard: i cede though, that might be the parser's stupidity in reducing print l 5, l 5 as (print l 5, l) 5
[12:29:12] norc: pard: Nope, thats not it.
[12:29:19] jdawgaz: has joined #ruby
[12:29:28] norc: >> def l(e) e end; [l 5, l 5]
[12:29:29] ruboto: norc # => /tmp/execpad-54ca05e29043/source-54ca05e29043:2: syntax error, unexpected tINTEGER, expecting keywor ...check link for more (https://eval.in/457784)
[12:29:32] norc: Same error.
[12:29:49] pard: it actually is
[12:30:27] jwaldrip: has joined #ruby
[12:30:33] pard: it would actually parse as (l 5, l) 5
[12:31:01] Igorshp: has joined #ruby
[12:31:09] pard: which is highly annoying parser stupidity (HAPS)
[12:31:49] davedev24: has joined #ruby
[12:31:52] norc: l(5, l 5) you mean
[12:31:57] Xzanron: has joined #ruby
[12:32:44] user083: has joined #ruby
[12:33:35] norc: That however looks broken.
[12:35:32] benlovell: has joined #ruby
[12:37:11] pard: norc, yes, that is the way the parser should do it , but it won't :\
[12:37:12] chorgi: has joined #ruby
[12:37:37] subscope: has joined #ruby
[12:37:45] user083: has joined #ruby
[12:37:57] norc: pard: No it does that actually. Put it in you still get the same error message.
[12:38:11] pard: even in case of l(5, l 5), HAPS makes it parse to be l((5, l) 5)
[12:38:12] norc: >> def l(e) e end; [5, l 5]
[12:38:13] ruboto: norc # => /tmp/execpad-df983d92401b/source-df983d92401b:2: syntax error, unexpected tINTEGER, expecting keywor ...check link for more (https://eval.in/457801)
[12:38:51] pard: Should Old Men Not Be Mad? :)
[12:39:35] pard: 5, l 5 will become (5, l) 5
[12:39:50] russt: has joined #ruby
[12:39:57] pard: what is it but HAPS? :)
[12:40:58] Motoservo: has joined #ruby
[12:42:43] user083: has joined #ruby
[12:42:53] pard: ACTION is going to do a parser-on-chip, in SysC
[12:43:03] thejoecarroll: has joined #ruby
[12:43:23] tak1n: has joined #ruby
[12:44:03] tak1n: has joined #ruby
[12:45:31] freerobby: has joined #ruby
[12:45:54] sdwrage: has joined #ruby
[12:47:41] user083: has joined #ruby
[12:48:01] stardiviner: has joined #ruby
[12:48:40] odigity: has joined #ruby
[12:48:50] m3_del: has joined #ruby
[12:49:41] stannard: has joined #ruby
[12:50:09] akem: has joined #ruby
[12:50:20] jgt1: has joined #ruby
[12:52:45] user083: has joined #ruby
[12:53:20] HayesHimself: has joined #ruby
[12:53:26] skinux: has joined #ruby
[12:53:39] skinux: Anyone have issues installing gems because of SSL errors?
[12:53:40] CloCkWeRX: has joined #ruby
[12:54:41] dmitch: has joined #ruby
[12:55:43] cwong_on_irc: has joined #ruby
[12:56:20] cwong_on_irc: has joined #ruby
[12:56:26] quazimodo: has joined #ruby
[12:56:47] jhass: skinux: ^
[12:56:53] cwong_on_irc: has joined #ruby
[12:57:41] cajone: has joined #ruby
[12:57:58] user083: has joined #ruby
[12:58:17] Chaoborid: has joined #ruby
[12:58:29] jhass: mmh, weird
[12:59:13] jhass: well, then I don't know. The common problem there was an old rubygems versions with an outdated cert bundled
[13:00:56] davedev24: has joined #ruby
[13:02:41] tkuchiki: has joined #ruby
[13:02:56] user083: has joined #ruby
[13:03:13] binaryplease: has joined #ruby
[13:03:14] akem2: has joined #ruby
[13:03:26] mengu: has joined #ruby
[13:03:34] mengu: has joined #ruby
[13:04:13] rickmasta: has joined #ruby
[13:04:24] joonty: has joined #ruby
[13:05:39] iamvery: has joined #ruby
[13:05:43] basiles: has joined #ruby
[13:05:45] nzst: has joined #ruby
[13:05:49] rshetty_: has joined #ruby
[13:06:13] nzst: Hi, I use rbenv and am working on an upgrade mechanism for ruby versions through puppet. I am wondering how I can check which ruby unicorn, rails and my gems are currently running under
[13:06:18] benlovell: has joined #ruby
[13:07:29] rbennacer: has joined #ruby
[13:07:41] rshetty_: has joined #ruby
[13:07:52] malconis: has joined #ruby
[13:07:53] skinux: I believe this is the gem it's trying to run rubygems-update-2.0.3.gem
[13:07:56] user083: has joined #ruby
[13:08:24] shredding: has joined #ruby
[13:08:31] malconis: has joined #ruby
[13:08:35] skinux: Or install
[13:08:39] allcentury: has joined #ruby
[13:09:08] aswen: has joined #ruby
[13:09:14] RegulationD: has joined #ruby
[13:09:49] jhass: skinux: how come?
[13:09:58] mag42c: has joined #ruby
[13:10:17] skinux: I don't know. The main goal is to install rails
[13:10:28] jhass: nzst: not sure there's a way beyond /proc/<pid>/exe
[13:10:29] RegulationD: has joined #ruby
[13:10:49] jhass: skinux: but what lead you to that assumption?
[13:11:01] Fire-Dragon-DoL: has joined #ruby
[13:11:37] benlovell: has joined #ruby
[13:11:43] RegulationD: has joined #ruby
[13:11:54] skweek: has joined #ruby
[13:12:58] RegulationD: has joined #ruby
[13:13:53] metalic: has joined #ruby
[13:13:54] `tim`: has joined #ruby
[13:14:16] RegulationD: has joined #ruby
[13:14:17] jimms: has joined #ruby
[13:15:14] diegoaguilar: has joined #ruby
[13:15:31] RegulationD: has joined #ruby
[13:15:42] Chaoborid: has joined #ruby
[13:15:47] jimms: has joined #ruby
[13:15:54] tkuchiki: has joined #ruby
[13:16:45] RegulationD: has joined #ruby
[13:18:02] RegulationD: has joined #ruby
[13:18:02] user083: has joined #ruby
[13:18:02] cdg: has joined #ruby
[13:18:43] cdg: has joined #ruby
[13:19:05] Vile`: has joined #ruby
[13:20:57] blackoperat: has joined #ruby
[13:22:49] tkuchiki: has joined #ruby
[13:23:37] pu22l3r: has joined #ruby
[13:24:49] rwilcox: has joined #ruby
[13:25:06] arup_r: atmosx: hi
[13:25:12] pu22l3r: has joined #ruby
[13:25:25] cdg: has joined #ruby
[13:25:59] beauby: has joined #ruby
[13:26:53] episage: has joined #ruby
[13:27:13] millerti: has joined #ruby
[13:27:41] Chaoborid: has joined #ruby
[13:27:41] Rinzlit: has joined #ruby
[13:27:55] Motoservo: has joined #ruby
[13:27:55] NeverDie: has joined #ruby
[13:28:01] RobertBirnie: has joined #ruby
[13:28:04] Xeago: has joined #ruby
[13:28:31] user083: has joined #ruby
[13:28:41] jonnie: has joined #ruby
[13:29:39] platzhirsch: has joined #ruby
[13:32:38] sgambino: has joined #ruby
[13:34:45] govg: has joined #ruby
[13:35:50] RobertBirnie: has joined #ruby
[13:35:55] odigity: has joined #ruby
[13:39:04] user083: has joined #ruby
[13:39:36] centrx: has joined #ruby
[13:40:10] dhjondoh: has joined #ruby
[13:40:45] lkba: has joined #ruby
[13:41:03] lkba_: has joined #ruby
[13:41:14] decoponio: has joined #ruby
[13:41:31] sankaber: has joined #ruby
[13:41:39] beauby: has joined #ruby
[13:42:04] basiles: has joined #ruby
[13:42:18] RegulationD: has joined #ruby
[13:42:53] tvw: has joined #ruby
[13:44:00] user083: has joined #ruby
[13:44:41] stannard: has joined #ruby
[13:44:51] sankaber: has joined #ruby
[13:44:55] nfk: has joined #ruby
[13:47:58] edenc: has joined #ruby
[13:48:48] Bloomer: has joined #ruby
[13:49:26] Guest53: has joined #ruby
[13:49:34] m3_del: has joined #ruby
[13:50:14] izzol: there is anything else then nokogiri for parsing HTML page?
[13:50:29] verdoc: has joined #ruby
[13:50:43] izzol: I'm tired to fighting with nokogiri installation process.
[13:52:09] izzol: Successfully installed oga-1.3.1
[13:52:14] izzol: finally :-)
[13:52:25] izzol: havenwood: thanks, I'm going to try it.
[13:52:45] InternetFriend: has joined #ruby
[13:54:32] user083: has joined #ruby
[13:54:50] iceden: has joined #ruby
[13:54:51] darthdeus: has left #ruby: ("Linkinus - http://linkinus.com")
[13:55:10] solocshaw: has joined #ruby
[13:55:24] edenc: has joined #ruby
[13:55:28] whippythellama: has joined #ruby
[13:55:39] sanjayu: has joined #ruby
[13:55:45] nzst: jhass: my terminal couldn't handle the characters in /proc/<pid>/exe
[13:55:53] Pupeno: has joined #ruby
[13:55:53] Pupeno: has joined #ruby
[13:56:03] Guest53: has joined #ruby
[13:56:42] Igorshp: has joined #ruby
[13:57:15] mag42c: has joined #ruby
[13:57:37] sunya7a: has joined #ruby
[13:58:32] mikolalysenko: has joined #ruby
[13:58:35] s2013: has joined #ruby
[13:59:32] pwnd_nsfw: has joined #ruby
[13:59:36] jhass: nzst: of course not, it's a link to the binary
[14:00:12] jgpawletko: has joined #ruby
[14:00:18] marahin: has joined #ruby
[14:00:40] nzst: jhass: oh, i wonder if there is a file in thet proc/<pid> directory that might tell me what ruby version is running my unicorn
[14:00:46] hughjass: has joined #ruby
[14:00:52] dnomyar: has joined #ruby
[14:01:02] nzst: i ack-grep and it seems like it's using the expected version, but i don't know my way around that directory at all
[14:01:57] hughjass: has left #ruby: ()
[14:02:03] yorickpeterse: Yeah Oga is pretty neat
[14:02:10] l_tonz: has joined #ruby
[14:02:51] jhass: nzst: /proc/<pid>/exe -v
[14:03:01] norc: >> "".match(/(.*)/)[1]
[14:03:01] jwaldrip: has joined #ruby
[14:03:02] ruboto: norc # => "" (https://eval.in/457859)
[14:03:07] norc: Why does this give me an empty string rather than nil?
[14:03:08] jdawgaz: has joined #ruby
[14:03:26] nzst: jhass: awesome, that was the trick, thanks
[14:04:04] yorickpeterse: norc: because you're matching something that's optional
[14:04:13] hughjasss: has joined #ruby
[14:04:15] yorickpeterse: >> ''.match(/.*/)
[14:04:16] ruboto: yorickpeterse # => #<MatchData ""> (https://eval.in/457860)
[14:04:23] yorickpeterse: >> ''.match(/.+/)
[14:04:24] ruboto: yorickpeterse # => nil (https://eval.in/457861)
[14:04:32] norc: yorickpeterse: Ah. I guess that makes sense.
[14:04:36] marahin: Hello, I'm having an issue where I try to access remote API over http. Everything is described on gist: https://gist.github.com/Marahin/436861c3708ed439e4a1
[14:04:42] havenwood: >> "".match /x*/
[14:04:43] ruboto: havenwood # => #<MatchData ""> (https://eval.in/457862)
[14:05:07] user083: has joined #ruby
[14:05:12] norc: >> "".match(/(?:(.+)?)/)[1]
[14:05:13] ruboto: norc # => nil (https://eval.in/457863)
[14:05:20] norc: So that is my fix then?
[14:05:56] norc: I mean I want the match data if it matches, and a nil otherwise.
[14:06:28] yorickpeterse: eh, you'd have to use something like +
[14:07:01] norc: I used it there, and surrounded with a ? to make the match optional again (but that group is not referenced)
[14:07:37] hiyosi: has joined #ruby
[14:07:46] hughjasss: marahin can u gist the response i cant be bothered to run snippet
[14:07:47] norc: Seems to work. Thanks for the help yorickpeterse
[14:07:57] marahin: hughjasss: oh, of course, one moment
[14:08:17] Xeago: has joined #ruby
[14:08:43] norc: All the hidden bugs Im suddenly finding still after a couple hundred tests. :)
[14:09:33] marahin: hughjasss: I added the resp.txt file, https://gist.github.com/Marahin/436861c3708ed439e4a1
[14:09:37] RegulationD: has joined #ruby
[14:09:38] marahin: response.txt*
[14:09:56] marahin: it has been pointed out that I might not "translate" from gzip format, I'm not really sure how to implement that then...
[14:10:18] joncol: has joined #ruby
[14:11:14] hughjasss: \x1f\x8b you gettin gzip
[14:11:43] Aswebb_: has joined #ruby
[14:12:00] joncol: Are there any EventMachine users here?
[14:12:13] hughjasss: marahin if you accessing an api have a look at how the response needs to come back in doco
[14:12:56] marahin: hughjasss: can you point me in some direction? I don't really get what you just said
[14:13:05] ibouvousaime: has joined #ruby
[14:13:09] Dar: has joined #ruby
[14:13:23] kalusn: has joined #ruby
[14:13:37] hughjasss: marahin give me 5 seconds ill load it up
[14:13:44] marahin: hughjasss: thank you very much
[14:13:53] jwaldrip: has joined #ruby
[14:14:40] doublemalt_: has joined #ruby
[14:15:20] Guest53: has joined #ruby
[14:15:36] user083: has joined #ruby
[14:15:54] failshell: has joined #ruby
[14:15:57] umgrosscol: has joined #ruby
[14:16:05] Pupp3tm4st3r: has joined #ruby
[14:16:11] jwaldrip: has joined #ruby
[14:16:29] wldcordeiro: has joined #ruby
[14:16:32] Chaoborid: has joined #ruby
[14:17:09] dhjondoh: has joined #ruby
[14:17:57] jobewan: has joined #ruby
[14:18:01] Pupp3tm4st3r: has joined #ruby
[14:18:03] hughjasss: marahin is this api publically accessable?
[14:18:05] NeverDie: has joined #ruby
[14:18:13] marahin: hell, I think so?
[14:18:21] hughjasss: no keys needed?
[14:18:36] marahin: let me check, maybe it's my browser's session that allows me to access it
[14:18:37] nzst: has joined #ruby
[14:18:41] riotjones: has joined #ruby
[14:18:58] hughjasss: im getting []
[14:19:11] chorgi: has joined #ruby
[14:19:36] marahin: hughjasss: indeed I just noticed it, when I create a new browser session it responses with "[]"
[14:19:58] hughjasss: my guess is its a private/protected api and you need to pass over an access key in the headers or similar
[14:20:05] marahin: i logged in steamcommunity.com, however I am currently logged off - I guess session stores something that still allows you to access API but doesnt keep you logged in
[14:20:25] marahin: hughjasss: well shouldn't I be available to look up the access key from chrome devtools?
[14:20:33] hughjasss: not necessarily
[14:20:41] hughjasss: it depends how the api is secured
[14:20:49] mary5030: has joined #ruby
[14:21:12] hughjasss: my suggestions are to get a api client like postman and play around in it then convert it ruby code once you understand it better
[14:21:44] dopieee: has joined #ruby
[14:22:19] JDiPierro: has joined #ruby
[14:23:32] metalic: has joined #ruby
[14:23:45] mary5030: has joined #ruby
[14:23:58] krz: has joined #ruby
[14:24:10] nzst: has left #ruby: ("ERC (IRC client for Emacs 24.5.1)")
[14:24:39] Igorshp: has joined #ruby
[14:26:05] user083: has joined #ruby
[14:26:33] Hanmac: has joined #ruby
[14:26:47] jdawgaz: has joined #ruby
[14:28:33] sonOfRa: has joined #ruby
[14:30:25] rbennacer: has joined #ruby
[14:30:27] A124: has joined #ruby
[14:31:06] user083: has joined #ruby
[14:32:41] gusTester: has joined #ruby
[14:34:04] axl_: has joined #ruby
[14:34:15] Xiti: has joined #ruby
[14:34:53] kirun_: has joined #ruby
[14:36:03] jwaldrip: has joined #ruby
[14:36:54] Alayde: has joined #ruby
[14:37:20] dopamean_: has joined #ruby
[14:38:40] but3k4: has joined #ruby
[14:38:43] freerobby: has joined #ruby
[14:39:44] jessemcgilallen: has joined #ruby
[14:40:04] GhettoCode: has joined #ruby
[14:41:44] kerunaru: has joined #ruby
[14:42:00] Alayde: has joined #ruby
[14:42:32] slawrence00: has joined #ruby
[14:42:33] rshetty: has joined #ruby
[14:42:36] bonemind: has joined #ruby
[14:44:09] dravine: has joined #ruby
[14:45:33] gregf: has joined #ruby
[14:46:12] Rollabunna: has joined #ruby
[14:47:10] user083: has joined #ruby
[14:47:36] rshetty: has joined #ruby
[14:48:31] rippa: has joined #ruby
[14:49:12] araujo_: has joined #ruby
[14:49:38] monsieurp: has joined #ruby
[14:49:38] monsieurp: has joined #ruby
[14:50:21] m3_del: has joined #ruby
[14:50:26] araujo_: has joined #ruby
[14:50:57] dnomyar: has joined #ruby
[14:51:02] benlovell: has joined #ruby
[14:51:02] Fire-Dragon-DoL: has joined #ruby
[14:51:35] bruno-_: has joined #ruby
[14:52:54] BTRE: has joined #ruby
[14:53:30] nemo_: has joined #ruby
[14:54:18] mordocai: has joined #ruby
[14:54:27] etyety: has joined #ruby
[14:54:42] Jardayn: has joined #ruby
[14:55:08] polishdub: has joined #ruby
[14:55:20] towski_: has joined #ruby
[14:56:42] iateadonut: has joined #ruby
[14:57:40] user083: has joined #ruby
[14:57:59] ibouvousaime_: has joined #ruby
[14:59:19] zotherstupidguy: has joined #ruby
[15:00:12] joncol: has joined #ruby
[15:01:30] Wompy: has joined #ruby
[15:02:08] musicmatze: has joined #ruby
[15:02:13] mag42c: has joined #ruby
[15:02:33] joncol: Is there any recommended way of defining in-place an object with a specific method `update`? Something like a local lambda only used for one thing? I could do `Class.new { def update; ...; end }.new` but that doesn't look very nice.
[15:02:39] user083: has joined #ruby
[15:04:21] efwe: has joined #ruby
[15:04:27] rodfersou: has joined #ruby
[15:04:45] joncol: Maybe I cannot even declare a class in a function...
[15:04:49] chopin: has joined #ruby
[15:05:17] kramsee: has joined #ruby
[15:06:23] adaedra: just a one time object?
[15:06:28] apeiros: Object.new.tap { |o| o.define_method(:update) { ??? } }
[15:06:50] apeiros: but this has the sound of code smell
[15:07:03] apeiros: this has the air of a code smell? yeah, I think that fits better :)
[15:07:41] tvw: has joined #ruby
[15:07:58] benlovel1: has joined #ruby
[15:08:36] freerobby: has joined #ruby
[15:09:06] arthurix_: has joined #ruby
[15:09:38] synthroid: has joined #ruby
[15:10:04] karapetyan: has joined #ruby
[15:10:06] paulcsmith: has joined #ruby
[15:10:32] beauby: has joined #ruby
[15:11:33] l_tonz: has joined #ruby
[15:12:55] AnoHito: has joined #ruby
[15:13:10] user083: has joined #ruby
[15:13:16] treehug88: has joined #ruby
[15:13:27] IrishGringo: has joined #ruby
[15:13:50] dnomyar: has joined #ruby
[15:14:24] AnoHito: has joined #ruby
[15:17:53] diegoaguilar: has joined #ruby
[15:18:41] Guest53: has joined #ruby
[15:18:41] y0da: has joined #ruby
[15:18:50] dfinninger: has joined #ruby
[15:18:56] dfockler: has joined #ruby
[15:19:17] mag42c_: has joined #ruby
[15:19:41] p0wn3d__: has joined #ruby
[15:20:26] chouhoulis: has joined #ruby
[15:20:36] beauby: has joined #ruby
[15:20:45] karapetyan: has joined #ruby
[15:21:17] shock_one: has joined #ruby
[15:22:21] karapetyan: has joined #ruby
[15:22:38] inteq: has joined #ruby
[15:23:07] EminenceHC: has joined #ruby
[15:23:31] yorickpeterse: So before I venture forth into hell, is there a Gem out there capable of parsing PostgreSQL's "EXPLAIN ANALYZE" output?
[15:23:46] yorickpeterse: All I can find are Gems that can parse SQL queries
[15:23:50] yorickpeterse: but not the output of EXPLAIN
[15:24:48] rcvalle: has joined #ruby
[15:25:33] voker57: has joined #ruby
[15:25:42] norc: yorickpeterse: What do you mean by "parsing" ?
[15:25:43] dmitch: has joined #ruby
[15:26:55] yorickpeterse: Turning it from the string based form into something more meaningful that can be queried
[15:27:00] ekinmur: has joined #ruby
[15:27:11] yorickpeterse: e.g. being able to walk through the steps of a query plan, see the columns a step uses, the time it took, etc
[15:28:13] norc: yorickpeterse: https://github.com/depesz/Pg--Explain
[15:28:20] norc: yorickpeterse: That is probably the closest thing around
[15:28:43] arthurix: has joined #ruby
[15:29:04] norc: yorickpeterse: Anyway, switch on JSON output for your explain path, and then you can play with the tree yourself.
[15:29:13] yorickpeterse: EXPLAIN ANALYZE can spit out JSON?
[15:29:30] norc: yorickpeterse: http://www.postgresql.org/docs/9.1/static/sql-explain.html
[15:29:35] blaxter: has joined #ruby
[15:29:45] norc: YAML too.
[15:29:50] yorickpeterse: yay not having to write a parser
[15:30:00] norc: Well, it still is a complex task
[15:30:01] crunk_bear: has joined #ruby
[15:30:35] beauby: has joined #ruby
[15:30:48] barhum2013: has joined #ruby
[15:31:12] Motoservo: has joined #ruby
[15:31:22] karapetyan: has joined #ruby
[15:31:46] RobertBirnie: has joined #ruby
[15:31:49] araujo: has joined #ruby
[15:31:49] araujo: has joined #ruby
[15:31:59] yorickpeterse: Huh, seems it can't do EXPLAIN ANALYZE in JSON, only regular EXPLAIN
[15:32:04] yorickpeterse: unless I suck at the syntax
[15:32:19] vr_mex: has joined #ruby
[15:32:52] chouhoulis: has joined #ruby
[15:33:00] caliostro: has left #ruby: ("Exit-Chat")
[15:33:41] emilkarl: has joined #ruby
[15:33:41] jdawgaz: has joined #ruby
[15:34:07] yorickpeterse: explain (format json, analyze) ...
[15:34:18] yorickpeterse: god these Postgres people really think of everything
[15:34:23] yorickpeterse: I wonder if Pg can also do my laundry
[15:35:44] swgillespie: has joined #ruby
[15:36:08] workmad3: yorickpeterse: I think that's on the roadmap for 9.7
[15:36:21] yorickpeterse: create extension pg_laundry;
[15:36:54] lkba: has joined #ruby
[15:37:01] snockerton: has joined #ruby
[15:37:30] ruurd: has joined #ruby
[15:37:53] asad_: has joined #ruby
[15:38:01] gusTester: has left #ruby: ()
[15:38:01] dopieee: has joined #ruby
[15:38:27] asad_: How do keyword arugments work? Does ruby take a hash and create local variables with the same name as hash keys?
[15:38:44] Igorshp: has joined #ruby
[15:39:40] Timba-as_: has joined #ruby
[15:39:46] Motoservo: has joined #ruby
[15:40:26] yorickpeterse: Local variables are basically "indexes" so to speak
[15:40:27] yorickpeterse: So for example
[15:40:34] yorickpeterse: def some_method(foo); foo; end
[15:40:38] yorickpeterse: could basically be replaced with
[15:40:42] yorickpeterse: def some_method(0); 0; end
[15:41:04] yorickpeterse: IIRC keyword arguments map to local variables in a similar way, though MRI does use a Hash internall to store the keyword arguments
[15:41:28] tomeara: has joined #ruby
[15:41:30] ESpiney: has joined #ruby
[15:41:35] roger_rabbit: has joined #ruby
[15:42:04] asad_: when passing keyword args, we're actually passing a hash right?
[15:42:36] Timba-as__: has joined #ruby
[15:42:49] yorickpeterse: Don't fully remember how MRI implemented it from the top of my head
[15:42:50] Ox0dea: asad_: Essentially, yes, but not technically.
[15:43:22] asad_: Ox0dea: Is there a good article online on how keyword args work technically?
[15:43:29] asad_: Ox0dea: I couldn't find anything.
[15:43:34] Ox0dea: asad_: The source is authoritative.
[15:44:19] skade: has joined #ruby
[15:44:47] ReK2: has joined #ruby
[15:45:01] willardg: has joined #ruby
[15:45:06] Ox0dea: asad_: For YARV, they are indeed parsed and converted to the internal hash structure, and from there "injected" into the local variable table, more or less.
[15:45:25] northfurr: has joined #ruby
[15:45:41] NeverDie: has joined #ruby
[15:46:11] K1MOS: has joined #ruby
[15:46:19] asad_: Ox0dea: What about the default keyword args in a method definition? Does ruby internally create local variables with those values initially?
[15:46:32] Ox0dea: asad_: Yes.
[15:47:02] asad_: Ox0dea: The default args in a method definition look like a hash. Is it a hash?
[15:48:13] Ox0dea: asad_: It's not a Hash at the "Ruby level" at the time you define the method, but it so very quickly becomes one under the hood that the distinction is of little consequence.
[15:48:18] Ox0dea: https://eval.in/457913
[15:48:37] Ox0dea: Note the `getlocal` opcoes near the bottom.
[15:49:43] northfurr: has joined #ruby
[15:49:53] asad_: Ox0dea: I have no idea what that is...
[15:50:03] fedexo: has joined #ruby
[15:50:12] Ox0dea: asad_: Ruby is compiled to bytecode and it's the bytecode that gets interpreted.
[15:50:16] aufi: has joined #ruby
[15:50:34] asad_: Ox0dea: Yeah I know that...I just don't understand the output..
[15:50:36] Ox0dea: In any case, it shows that keyword arguments do become locals.
[15:50:47] cyle: has joined #ruby
[15:51:03] rismoney1: has joined #ruby
[15:51:09] m3_del: has joined #ruby
[15:51:13] barhum2013: has joined #ruby
[15:51:41] timonv: has joined #ruby
[15:52:30] keen________: has joined #ruby
[15:52:56] Motoservo: has joined #ruby
[15:53:16] cwong_on_irc: has joined #ruby
[15:53:58] bricker: has joined #ruby
[15:55:07] dionysus69: has joined #ruby
[15:56:21] s2013: has joined #ruby
[15:58:09] binaryplease: has joined #ruby
[15:59:09] Ox0dea: Does this conclusively prove that YARV doesn't allocate a Ruby Hash for keyword signatures? https://eval.in/457921
[15:59:36] Ox0dea: I figured not.
[15:59:37] SebastianThorn: is the gem oga the new cool kid on the block?
[16:00:23] yorickpeterse: Ox0dea: because IIRC it doesn't allocate Hash but the underlying st_ stuff
[16:00:30] Ox0dea: yorickpeterse: Yes, I know that part.
[16:00:36] yorickpeterse: but I last looked into this when kwargs were first introduced, so I could be wrong
[16:00:40] yorickpeterse: SebastianThorn: yes
[16:00:50] yorickpeterse: it's _very_ cool
[16:01:27] wldcordeiro: has joined #ruby
[16:01:58] p0wn3d: has joined #ruby
[16:02:31] Ox0dea: What should `Prime.include?` do?
[16:02:48] Ox0dea: >> Class.instance_methods & Enumerable.instance_methods
[16:02:50] ruboto: Ox0dea # => [:include?] (https://eval.in/457922)
[16:03:11] amclain: has joined #ruby
[16:03:46] Ox0dea: This "problem" is also present for the Gem::Specification class, but it at least returns `false` rather than looping forever looking for a module in the primes.
[16:03:50] BSaboia: has joined #ruby
[16:04:49] based_pdev: has joined #ruby
[16:05:01] shevy: is .include? not a general method?
[16:05:19] Xeago: has joined #ruby
[16:05:27] Ox0dea: It's an instance method on Class and Enumerable.
[16:05:27] ftj: has joined #ruby
[16:05:40] Ox0dea: s/Class/Module/, technically.
[16:06:00] luckyme: has joined #ruby
[16:06:53] EminenceHC: has joined #ruby
[16:07:02] Ox0dea: Prime and Gem::Specification both have Enumerable mixed into their singleton classes, which makes for this unfortunate ambiguity.
[16:07:03] mrtomme: has joined #ruby
[16:07:58] Ox0dea: `Prime.include?(Enumerable)` "should" be true, but so should `Prime.include?(17)`.
[16:08:03] Ox0dea: Only the latter is the case at present.
[16:08:04] pullcheezy: has joined #ruby
[16:09:35] Ox0dea: >> require 'prime'; ObjectSpace.each_object(Class).select { |c| c.include? Enumerable }
[16:09:38] ruboto: Ox0dea # => (https://eval.in/457924)
[16:09:40] Ox0dea: ^ The dog that bit me.
[16:09:56] Ox0dea: I think it's a bug, but specializing `Prime.include?` also seems weird for some reason.
[16:10:28] arthurix_: has joined #ruby
[16:11:27] tno: has joined #ruby
[16:11:55] Motoservo: has joined #ruby
[16:12:25] l_tonz: has joined #ruby
[16:12:36] willardg: has joined #ruby
[16:14:49] arthurix: has joined #ruby
[16:15:07] darthdeus: has joined #ruby
[16:16:13] redtomahawk: has joined #ruby
[16:17:40] polishdub: has joined #ruby
[16:19:07] Emmanuel_Chanel: has joined #ruby
[16:19:21] Soda: has joined #ruby
[16:19:38] aspiers: has joined #ruby
[16:21:43] eam: oh ruby
[16:21:58] ryba: has joined #ruby
[16:22:43] shevy: eam woke up!
[16:23:18] Ox0dea: ACTION used Hypnosis.
[16:23:39] Stan: has joined #ruby
[16:23:44] yorickpeterse: "ActiveRecord is, in my opinion, the best implementation of an ORM I have ever worked with."
[16:23:46] yorickpeterse: "However, often I find myself having to drop into Arel or straight up SQL in order to get what I need."
[16:24:07] dorei: has joined #ruby
[16:24:11] yorickpeterse: ergh, stupid AR
[16:26:12] RobertBirnie: has joined #ruby
[16:26:25] jordanm: has joined #ruby
[16:26:42] towski_: has joined #ruby
[16:27:10] tak1n: has joined #ruby
[16:27:27] kirun: has joined #ruby
[16:28:45] niemcu: has joined #ruby
[16:29:27] thun: has joined #ruby
[16:29:36] corpsicle: has left #ruby: ()
[16:30:00] shevy: hah epic contradiction
[16:30:06] shevy: I guess it won't do your laundry after all
[16:30:23] thun: If have a file hashes.rb with a simple hash declared in it (not in a class) and I include it with require './hashes.rb' How do I access the hashes declared in hashes.rb?
[16:30:25] denver: has joined #ruby
[16:30:26] thun: Is it possible?
[16:30:36] shevy: a coding thuna!
[16:30:51] tkuchiki: has joined #ruby
[16:31:04] shevy: thun several ways; a very simple and primitive one is to make your hash a constant like HASH = {}
[16:31:47] thun: shevy: It's a config file used in another project. Was trying to just quickly parse out some of the hashes.
[16:31:59] shevy: a better way for longevity of code is to namespace everything; put it into a module or class, use @ there even on the module/class level, use class/module methods to access/manipulate it (or also put it into a hash constant residing in your main namespace)
[16:32:14] p0wn3d__: has joined #ruby
[16:32:19] thun: Can I get access to those variables without changing the original hashes.rb?
[16:32:29] Ox0dea: thun: Are they local variables?
[16:32:30] shevy: you can also use $hash which is a sure sign that you did not know of alternatives
[16:32:48] mg^: filthy dollars
[16:33:09] shevy: we chould propose ? for global variables in ruby
[16:33:25] mg^: No, I've done way worse than that
[16:34:17] snockerton: has joined #ruby
[16:34:18] thun: https://gist.github.com/mikebthun/1212c2c866f7a10dc4eb
[16:34:47] shevy: thun these are local variables
[16:34:59] Ox0dea: thun: You'll have to use eval, then.
[16:35:00] mg^: I made a singleton class called Global that uses method_missing and a mutex to hold universally accessible things
[16:35:23] shevy: mg^ I like the name Global
[16:35:33] Alayde: has left #ruby: ("WeeChat 1.1.1")
[16:35:38] troulouliou_div2: has joined #ruby
[16:35:45] mg^: So I can do things like Global.foo = "foo" and then access Global.foo later in another thread...
[16:35:55] shevy: thun this is a cool line here: require '.\hashes.rb'
[16:37:00] Motoservo: has joined #ruby
[16:37:46] EminenceHC: has joined #ruby
[16:38:16] rbennacer: has joined #ruby
[16:38:22] thun: Ox0dea: How do you mean? I am looking for a quick hack
[16:38:29] Ox0dea: thun: Reconsider.
[16:39:02] thun: This is a piece of throwaway code, I did not write 'hashes.rb' and can not change it
[16:39:43] thun: But I need to programmatically loop over the hashes
[16:40:10] n008f4g_: has joined #ruby
[16:40:17] mg^: Is this homework, by chance?
[16:40:49] thun: I am moving a bunch of variables to another app and might have to do it every now and then.
[16:41:50] Ox0dea: > This is a piece of throwaway code
[16:42:04] thun: Yes... it is middleman code to generate other code
[16:42:19] thun: But if somone changes the original hashes I will have to re-run
[16:42:23] Maletor: has joined #ruby
[16:42:38] Ox0dea: "Someone"?
[16:42:54] Ox0dea: Who is "someone" in this context?
[16:42:56] mg^: Ok so you've got this hashes.rb that someone else writes. You need to get at the contents of that, take the data stored in the hashes, at put it somewhere else. That's a correct summary?
[16:43:21] thun: I do not maintain hashes.rb
[16:43:30] Ox0dea: `eval(File.read('hashes.rb'))`, and may the fates frown upon you.
[16:43:39] thun: Lol perfect ty...
[16:46:35] frozenfoxx: has joined #ruby
[16:50:14] mhib: has joined #ruby
[16:51:51] m3_del: has joined #ruby
[16:52:24] txtsd: has joined #ruby
[16:53:13] txtsd: Hi. I have a quick question. How do I call a method that's in a class that's in a module?
[16:53:25] EminenceHC: has joined #ruby
[16:54:31] Ox0dea: txtsd: What kind of method?
[16:54:31] metalic: has joined #ruby
[16:55:32] Ox0dea: `M::C.foo` if it's a class method, otherwise you'll need to have an instance of M::C to invoke #foo.
[16:55:33] txtsd: It's defined as def extract!
[16:56:07] Ox0dea: txtsd: Are you allowed to say exactly which method you're trying to call?
[16:56:56] rakm: has joined #ruby
[16:57:07] K1MOS: has joined #ruby
[16:57:07] Ox0dea: Which module and class, then?
[16:57:29] NeverDie: has joined #ruby
[16:57:46] txtsd: It's from gemoji. I'm trying to call extract from extractor.rb
[16:57:50] nateberkopec: has joined #ruby
[16:57:54] pard: has joined #ruby
[16:58:00] darix: this change seems wrong. wouldnt a better fix be to use ".compact" instead of ".compact!"? https://github.com/discourse/discourse/commit/6c172a30d3165eeaf6e13006c06441c29a41f3ab
[16:58:12] m3t4l1c_s0ul: has joined #ruby
[16:58:51] pard: norc you there ?
[16:58:56] CooloutAC: has left #ruby: ("Selakem Shalom, PEACE")
[16:59:00] Ox0dea: darix: Yes. I don't think that fellow realized `diff` was being reassigned.
[16:59:13] skade: has joined #ruby
[16:59:21] mengu: has joined #ruby
[16:59:28] jdawgaz: has joined #ruby
[16:59:30] pard: shevy you there?
[16:59:52] pard: Ox0dea, greetin's
[17:00:20] Ox0dea: txtsd: So are you opposed to creating your own instance of Emoji::Extractor, or?
[17:00:32] pard: Ox0dea, http://whitequark.org/blog/2013/04/01/ruby-hacking-guide-ch-11-finite-state-lexer/
[17:00:41] shevy: pard somewhat... have to buy food soon
[17:00:57] pard: shevy http://whitequark.org/blog/2013/04/01/ruby-hacking-guide-ch-11-finite-state-lexer/
[17:01:34] shevy: you find the articles that you asked for days ago!
[17:01:35] Ox0dea: pard: http://logs.ryanbigg.com/ruby?date=2015-08-29#3976195
[17:01:52] txtsd: Ox0dea: I don't know any ruby. I have a python background. I don't know how to do that. I figured I would just need to write one line of code to call that method.
[17:01:53] rbowlby: has joined #ruby
[17:01:58] shevy: Ox0dea is such a stalker
[17:02:06] Ox0dea: Of myself...?
[17:02:36] shevy: of everyone
[17:02:42] atmosx: Hello everyone
[17:02:43] pard: what is it ?
[17:02:44] shevy: do I have to stalk you now where you stalk others
[17:02:53] Ox0dea: pard: Just visit the link?
[17:03:13] Ox0dea: pard: I just thought it was humorous that you linked me to an article to which I linked somebody else not terribly long ago.
[17:03:26] karapetyan: has joined #ruby
[17:03:27] txtsd: Ox0dea: Is this not all I need to call that method? `Emoji::Extractor.extract()`
[17:03:31] shevy: pard finally he added the explanation, he had me wonder as well ;)
[17:03:36] pard: sorry i'm so slow getting things
[17:03:44] Ox0dea: txtsd: No, because #extract is an instance method, so you need an instance of Emoji::Extractor.
[17:04:09] Ox0dea: Looking at the constructor, you'll need to provide the desired size of the resultant images and in which directory you'd like them placed.
[17:04:24] Ox0dea: Emoji::Extractor.new(42, '/tmp/foo').extract! or some such.
[17:04:31] SCHAAP137: has joined #ruby
[17:04:37] Wompy: has joined #ruby
[17:05:14] Wompy: has joined #ruby
[17:06:53] pard: what matters is now i have it , gsl
[17:07:05] p0wn3d: has joined #ruby
[17:07:52] akem: has joined #ruby
[17:10:14] mprelude: has joined #ruby
[17:10:26] e1senhorn: has joined #ruby
[17:10:32] Blaguvest: has joined #ruby
[17:10:34] e1senhorn: has left #ruby: ()
[17:10:43] pard: shevy , reading it ?
[17:11:13] atmosx: Extending a class like: class Person;attr_reader :sex;end; class Woman < Person; attr_reader :name;end ... is a violation of the Liskov principle right?
[17:12:07] synthroid: has joined #ruby
[17:12:09] atmosx: Liskov Sub Principle to be more precise.
[17:12:10] txtsd: Ox0dea: I would never have worked out that format. Thanks. Where should I actually call this from though?
[17:12:43] txtsd: Ox0dea: I need to change that EMOJI_TTF variable to point to a custom location, so I can't use the official gem.
[17:12:56] p0wn3d__: has joined #ruby
[17:13:09] Ox0dea: txtsd: Just redefine that constant.
[17:13:09] pard: has left #ruby: ("Leaving")
[17:13:14] frozenfoxx: I'm having some problems with some code (https://github.com/frozenfoxx/hack-doom/blob/master/certain/lib/libcertain.rb). I need to be able to fire off a system command and capture/process its output/input in realtime. I've tried a variety of methods like IO.popen("command") and such but either they all exit early, don't seem to respond to stdin, don't output stdout, or similar. I've gotten somewhat there with Open3.pipeline("command") but don't know
[17:13:23] Ox0dea: txtsd: You'll get a warning, but it won't be the end of the world.
[17:13:51] frozenfoxx: I'm sorry for bugging you folks with it but I'm kindo f at my wit's end, I'm just not really sure what I need to do. The affected code is in line 23 on that file.
[17:13:56] shevy: yeah sounds like a job for popen, you can assign to stdout stderr etc..
[17:14:18] frozenfoxx: shevy: When using IO.popen("command") it just terminates early, don't know why.
[17:14:41] shevy: http://ruby-doc.org/stdlib-2.2.3/libdoc/open3/rdoc/Open3.html#method-c-popen3
[17:14:56] frozenfoxx: shevy: thanks, I'll have a look.
[17:15:06] shevy: no idea about IO.popen, never used it. in ruby there is... system, then there is `` and for anything else there is popen3
[17:15:42] shevy: the first answer seems to be semi-relevant http://stackoverflow.com/questions/17067010/extracting-value-from-stdout-of-open3-popen3-through-regex-and-store-it
[17:15:51] shevy: I hate how much code one has to write compared to system() or `` there :(
[17:16:00] evo2020: has joined #ruby
[17:16:45] frozenfoxx: shevy: Thanks, I'll have a look at this too. If it helps, I'm basically wrapping up a CLI server so I can hand it off to websocketd.
[17:17:31] frozenfoxx: shevy: That means I need to be able to grab certain lines of output based on regex to call other commands to send over the websocket, and capture/process commands from stdin over websocket to determine how to pass it to the cli server.
[17:17:31] DoubleMalt: has joined #ruby
[17:17:46] evo2020: I have been looking for a way to keep score in a procedural ruby app. All I can find are OOP references. Has anyone ever encountered a problem like that?
[17:17:47] frozenfoxx: shevy: looks like this should help me get rolling, so I'll let you know what happens.
[17:17:49] skinux: has joined #ruby
[17:18:08] s2013: has joined #ruby
[17:18:45] nemo_: has joined #ruby
[17:19:33] failshell: has joined #ruby
[17:19:54] treehug88: has joined #ruby
[17:20:54] Eiam: has joined #ruby
[17:21:04] Musashi007: has joined #ruby
[17:21:05] Xeago: has joined #ruby
[17:21:42] Mon_Ouie: has joined #ruby
[17:21:44] wprice: has joined #ruby
[17:21:58] _tpavel: has joined #ruby
[17:22:47] failshell: has joined #ruby
[17:23:18] barhum2013: has joined #ruby
[17:24:38] evo2020: shevy are you able to point me in the right direction with my question?
[17:24:54] evo2020: U probably know resources that I dont
[17:25:00] Eiam_: has joined #ruby
[17:25:49] hfp_work: has joined #ruby
[17:26:55] dmitch: has joined #ruby
[17:27:43] musou: has joined #ruby
[17:28:49] Guest683: has joined #ruby
[17:29:03] L8: has joined #ruby
[17:29:04] Ox0dea: frozenfoxx: Status?
[17:29:11] txtsd: Ox0dea: I have no idea what I'm doing. Help. https://bpaste.net/show/7dab3aa38018
[17:31:54] tkuchiki: has joined #ruby
[17:32:01] Ox0dea: txtsd: It seems they never pushed the update that added Extractor to RubyGems.
[17:32:16] wprice: has joined #ruby
[17:32:38] txtsd: Ox0dea: So my code is proper?
[17:32:41] K1MOS: has joined #ruby
[17:32:50] hfp_work: has joined #ruby
[17:32:54] leafybas_: has joined #ruby
[17:32:56] txtsd: Is there a way I can install the gem from source? I have the git repo cloned.
[17:32:57] Ox0dea: txtsd: You're assigning to the wrong constant.
[17:33:11] Y_Ichiro: has joined #ruby
[17:33:11] Y_Ichiro: has joined #ruby
[17:33:27] txtsd: Oh what's the correct way to override the constant?
[17:33:37] v4n_: has joined #ruby
[17:34:09] Ox0dea: `Emoji::Extractor::EMOJI_TTF` is the one you want.
[17:34:25] Yzguy: has joined #ruby
[17:35:11] txtsd: Oh yea, that makes sense.
[17:35:16] jxl180: has joined #ruby
[17:35:40] leafybas_: has joined #ruby
[17:35:52] Ox0dea: txtsd: `gem b *spec && gem i *gem` from the top of the repo.
[17:37:00] superscott: has joined #ruby
[17:37:33] dmolina: has joined #ruby
[17:37:48] Xeago: has joined #ruby
[17:37:50] Aswebb_: has joined #ruby
[17:38:15] postmodern: has joined #ruby
[17:38:16] trosborn: has joined #ruby
[17:38:46] Ox0dea: txtsd: Sorry, I accidentally made you chase a goose. :<
[17:39:10] Ox0dea: You'll just need to require 'emoji/extractor'.
[17:40:04] Ox0dea: I don't know where that file disappeared to when I went looking for it, but it's definitely there in the current version of the gem.
[17:40:27] hooper: has joined #ruby
[17:40:40] treehug88: has joined #ruby
[17:40:54] hooper: has joined #ruby
[17:41:12] txtsd: Wait so I don't need to install from source?
[17:41:20] hooper: has joined #ruby
[17:41:28] Ox0dea: txtsd: No, that shouldn't be necessary.
[17:41:34] jessemcgilallen: has joined #ruby
[17:41:40] duckpuppy: has joined #ruby
[17:42:37] txtsd: Okay, good. But emoji/extractor is relative to the gem, right? How will it know where to look for it?
[17:43:06] willardg: has joined #ruby
[17:43:46] Ox0dea: txtsd: The gem's lib/ directory gets added to the load path, so it'll be found just fine.
[17:44:24] NeverDie_: has joined #ruby
[17:44:30] superscott: has left #ruby: ()
[17:44:30] frozenfoxx: Ox0dea: status, food. It's lunchtime where I am. :)
[17:44:52] Ox0dea: frozenfoxx: That's no way to run a command ferry!
[17:45:05] ledestin: has joined #ruby
[17:45:13] txtsd: Ox0dea: Doesn't look like it's working https://bpaste.net/show/e40ee96fa519
[17:45:15] shinnya: has joined #ruby
[17:45:30] frozenfoxx: Ox0dea: I promise as soon as lunch is over I'm going to try shevy's suggestion. :)
[17:45:47] frozenfoxx: Ox0dea: I've been beating my head on this for weeks, so I'll be happy to have ANY progress.
[17:46:12] frozenfoxx: Ox0dea: what's funny about it is I'm pretty sure how to get this rolling in bash, but I really need it done in Ruby. Because Ruby.
[17:46:37] Ox0dea: frozenfoxx: https://eval.in/457987
[17:47:05] Ox0dea: I couldn't execute it on eval.in because it forks, but playing with it locally should get you headed in the right direction.
[17:47:27] nemo_: has joined #ruby
[17:47:42] frozenfoxx: Ox0dea: thanks, I'll try this one, too.
[17:47:48] Ox0dea: When you run it, it'll wait for your input; lines containing "echo" will be sent to `sh` and the result displayed, and all other lines will be ignored.
[17:47:59] dnomyar: has joined #ruby
[17:48:08] superscott: has joined #ruby
[17:48:20] frozenfoxx: Ox0dea: that's awesome, definitely something I can use!
[17:48:21] psye: has joined #ruby
[17:48:27] frozenfoxx: Ox0dea: I'll give it a try as soon as food's over.
[17:48:37] __tpavel: has joined #ruby
[17:48:38] Ox0dea: I should probably eat myself.
[17:49:00] Ox0dea: I'm rolling; food if I don't get all Strings.
[17:49:02] Ox0dea: >> [*ObjectSpace.each_object].sample 3
[17:49:03] ruboto: Ox0dea # => ["'", "test_files", " super \"You don't have write permissions for the \#{directory} directory.\" ...check link for more (https://eval.in/457992)
[17:49:25] Ox0dea: txtsd: I'm afraid it's working fine here. :<
[17:50:01] millerti: has joined #ruby
[17:50:01] millerti: How can I do a reverse each_index in Ruby? array.reverse.each_index doesn't do the trick.
[17:50:14] txtsd: Ox0dea: Some env settings perhaps?
[17:50:29] User458764: has joined #ruby
[17:50:32] Ox0dea: txtsd: God dammit. I was right the first time; the version on RubyGems doesn't have Extractor.
[17:50:32] jhass: millerti: (array.size-1).downto(0) do |i|
[17:50:51] txtsd: How is it working for you then?
[17:50:53] Ox0dea: The `gem` command must be doing some caching that got in the way.
[17:51:02] millerti: jhass: Ok. I wasn't sure if there was a better way...
[17:51:12] Ox0dea: txtsd: It's working because I installed from source.
[17:51:38] txtsd: Oh alright. I'll do that then. I replace the *spec and *gen with the actual filenames, right?
[17:51:53] Ox0dea: txtsd: Well, it'd work fine with the asterisks in this case, but sure.
[17:52:08] Wompy: has joined #ruby
[17:52:26] Ox0dea: txtsd: I apologize for making this so much more trouble than it might've been.
[17:52:35] m3_del: has joined #ruby
[17:53:16] Wompy: has joined #ruby
[17:53:42] EminenceHC: has joined #ruby
[17:54:40] skade: has joined #ruby
[17:54:55] [Butch]: has joined #ruby
[17:55:45] codecop: has joined #ruby
[17:55:56] shinnya: has joined #ruby
[17:56:13] skade: has joined #ruby
[17:57:15] txtsd: Ox0dea: I had globbing turned off so the asterisks weren't working. I finally found a reason to enable globbing lol.
[17:57:30] txtsd: And don't worry about the trouble. Just as long as I can get this done.
[17:57:32] Ox0dea: txtsd: *All* globbing?!
[17:57:39] last_staff: has joined #ruby
[17:58:08] based_pdev_: has joined #ruby
[17:59:09] karapetyan: can i pass block to array.include?
[17:59:15] txtsd: Yep. I was trying to learn zsh and shell concepts by making my own zshrc.
[17:59:19] BSaboia: has joined #ruby
[18:00:24] Ox0dea: txtsd: Fair enough, but ditching globbing altogether is absurd. :P
[18:00:51] Ox0dea: karapetyan: No, you want Array#any?.
[18:01:00] txtsd: I just couldn't find a reason to use it. Plus I liked not having to quote my URLs.
[18:01:24] txtsd: Ox0dea: I think ttfunk is throwing an error now https://bpaste.net/show/bb296fc88f29
[18:01:26] karapetyan: Ox0dea: yes, thanks
[18:01:30] Ox0dea: karapetyan: Sure thing.
[18:01:32] dfinninger: has joined #ruby
[18:01:48] Ox0dea: txtsd: Yeah, you'll have to manually install that; Gemoji doesn't specify it as a dependency.
[18:02:14] CanTonic: has joined #ruby
[18:02:17] ta: has joined #ruby
[18:02:22] txtsd: Ox0dea: From source? I have it installed via `gem`
[18:03:23] Ox0dea: txtsd: Oh, sorry; I just assumed you were getting the LoadError that I did.
[18:04:39] CanTonic: has joined #ruby
[18:05:09] Guest53: has joined #ruby
[18:06:03] sl33k: has joined #ruby
[18:06:48] NeverDie: has joined #ruby
[18:07:16] h99h9h88: has joined #ruby
[18:08:26] millerti: Anyone know how to install ruby-prof in Ubuntu 15.10? I trued using gem, but it complains that it doesn't have dev tools, although I have installed ruby-dev. And apparently, apt-get no longer has a ruby-dev package I can get from the Ubuntu repos.
[18:09:36] pipework: millerti: I use chruby and ruby-install for managing my ruby versions.
[18:09:46] pipework: Not the distro repos.
[18:10:31] LBRapid: has joined #ruby
[18:11:11] baweaver: has joined #ruby
[18:11:35] KensoDev: has joined #ruby
[18:12:01] karapetyan: if i iterating array using select and condition fails. What i should return from block to return nothing in select? '' ?
[18:12:38] Ox0dea: karapetyan: Either falsey value will do.
[18:12:58] dfinninger: has joined #ruby
[18:13:06] ftj: has joined #ruby
[18:13:20] karapetyan: Ox0dea: https://gist.github.com/anonymous/22ca02b50f9f31aa6856
[18:15:11] Ox0dea: karapetyan: Why #delete? Why return a name in a boolean context?
[18:15:31] Ox0dea: txtsd: I can't make ttfunk break like that. :/
[18:16:05] mikecmpbll: has joined #ruby
[18:16:11] yardenbar: has joined #ruby
[18:16:28] Ox0dea: Are you on an older Ruby?
[18:17:35] txtsd: Ox0dea: I went ahead and gem installed the dependencies of ttfunk too. Still throws the same error.
[18:17:49] txtsd: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
[18:18:19] txtsd: Ox0dea: are you using it on the correct font file though?
[18:18:37] Ox0dea: txtsd: I can't say whether we have the exact same one, but I'd imagine we do.
[18:18:42] bricker1: has joined #ruby
[18:18:43] millerti: So since Ruby has a GIL, does it have some convenient IPC functions? For instance, can I easily launch a child process and communicate with it using queues?
[18:19:15] Ox0dea: ~ $ md5sum AppleColorEmoji.ttf
[18:19:17] Ox0dea: 76479dd8ae4aecf3dd12dd92021fbaef AppleColorEmoji.ttf
[18:19:58] frozenfoxx: Ox0dea: question about your eval.in post, do you need to do Thread.join at the bottom?
[18:20:24] Ox0dea: frozenfoxx: No, but you need to tell the input stream you're done one way or another.
[18:20:24] hfp_work: has joined #ruby
[18:20:26] nertzy: has joined #ruby
[18:20:36] txtsd: Ox0dea: 87b2a869cf824dd42347963b38e3a863 AppleColorEmoji.ttf This one's from 10.11.1
[18:21:32] treehug88: has joined #ruby
[18:21:54] danneu: has joined #ruby
[18:21:55] Ox0dea: txtsd: Well, there it is.
[18:22:33] txtsd: Ox0dea: That's no reason for it to break though.
[18:22:35] User458764: has joined #ruby
[18:22:57] txtsd: Ox0dea: What version are you on?
[18:23:25] al2o3-cr: has joined #ruby
[18:23:31] Ox0dea: txtsd: I'm chruby'd to 2.2.3p173 for this problem.
[18:23:34] frozenfoxx: Ox0dea: Hmm, putting your example in still prematurely terminates my code. :(
[18:23:52] frozenfoxx: Ox0dea: I can't tell if it's celluloid or not, going to see if I can disable it
[18:24:24] Ox0dea: frozenfoxx: I confess to not having written it with any particular view to its inclusion in a larger system.
[18:24:26] txtsd: Ox0dea: Send me your ttf. Let me try running it on that.
[18:24:38] karapetyan: Ox0dea: #<ArgumentError: comparison of Hash with Hash failed> why ? https://gist.github.com/anonymous/358b8c28f3f6c4296197
[18:24:51] snockerton: has joined #ruby
[18:25:58] frozenfoxx: Ox0dea: No worries. I think it might be conflicting with celluloid
[18:26:25] hfp_work: has joined #ruby
[18:26:26] Ox0dea: txtsd: http://git.io/vWyLn
[18:26:37] frozenfoxx: Ox0dea: If I can do this without celluloid that'd probably be better, it just seemed like it'd be a better way to do concurrency. That said, if I can't get this done in it then I'd prefer to have something that works in an ugly way than a pretty way that doesn't work
[18:26:43] Ox0dea: For some reason, `parse!` isn't being called in time for `@strikes` to get initialized.
[18:26:55] hfp__work: has joined #ruby
[18:27:08] Ox0dea: I've no idea why a slightly different input font file would cause that to happen.
[18:29:11] Ox0dea: frozenfoxx: The POC was more meant to indicate how to use Open3 for basic "command and control"; $thing you described would certainly benefit from not blocking, so you'll want to marry the two.
[18:29:30] |\|370: has joined #ruby
[18:30:01] h99h9h88: has joined #ruby
[18:30:21] alexdunne: has joined #ruby
[18:30:55] djellemah: millerti: http://ruby-doc.org/core-2.2.3/IO.html#method-c-popen with cmd as '-' . Never tried it myself though.
[18:31:12] karapetyan: any help guys?
[18:31:14] aderium: has joined #ruby
[18:31:20] frozenfoxx: Ox0dea: Agreed, I'm playing around with it a little bit and think I might have this working.
[18:31:50] Mon_Ouie: millerti: There is no such thing in stdlib (well, there's IO as mentioned above, you would still need to serialize your objects though). Also keep in mind the GIL does not affect multiple processes, only multiple threads running within the same process.
[18:32:17] mghaig: has joined #ruby
[18:32:25] |\|370: has joined #ruby
[18:32:29] h99h9h88: has joined #ruby
[18:32:50] millerti: I've done multiprocess Ruby before, where one Ruby program calls via popen another and communicates via stdio. I was just wondering if anyone had streamlined it.
[18:32:57] al2o3-cr1: has joined #ruby
[18:33:13] txtsd: Ox0dea: I've been looking at that line, but I have no idea what to make of it.
[18:33:25] skade: has joined #ruby
[18:33:59] postmodern: what's the defacto way to determine if a mechanize response is html?
[18:34:03] h99h9h88_: has joined #ruby
[18:34:18] postmodern: !page.kind_of?(Mechanize::File) ?
[18:34:21] txtsd: Ox0dea: Can you try running it on the ttf I queried you?
[18:34:33] frozenfoxx: Ox0dea: yeah, the more I work with this the more I think it'll work. Thank you so much! Thanks to you, too, shevy, I'll give the links you sent me a closer look later as well
[18:35:36] frozenfoxx: Ox0dea: At the risk of being dumb, is there a good quick way to signify the end of input? I'm thinking in the while loop just a "while res = o.gets || res != 'quit'" or something?
[18:36:19] h99h9h88_: has joined #ruby
[18:37:01] shadoi: has joined #ruby
[18:37:02] millerti: Grr. I'm trying to use ruby-prof, and it keeps producing bogus dot files.
[18:37:08] shadoi: has left #ruby: ()
[18:37:14] frozenfoxx: Ox0dea: OH! And one more question (because I apparently take tips from the Steve Jobs of "one more thing"), the new thread is reading from "i" which is mapped to stdin which means ANYTHING in my program that interacts with stdin SHOULD be interpreted by that thread, yes?
[18:37:33] paulcsmith: has joined #ruby
[18:37:45] Xiti: has joined #ruby
[18:37:47] paulcsmith: has joined #ruby
[18:37:58] paulcsmith: has joined #ruby
[18:38:49] JusticeFries: has left #ruby: ()
[18:39:22] djellemah: millerti: there are a couple of parallel each / parallel map gems. I vaguely remember being dissatified with them. Yeah I know, not helpful :-|
[18:39:27] Ox0dea: frozenfoxx: Well, that loop should terminate when there's nothing more to read, but that'll never happen if the source is a stream.
[18:39:52] tak1n: has joined #ruby
[18:39:57] millerti: djellemah: The reason I ask is mostly so that I don't keep reinventing the wheel.
[18:40:20] Xeago: has joined #ruby
[18:40:24] millerti: Also, I wish there were an equivalent to sympy for Ruby.
[18:40:28] cyle: has joined #ruby
[18:40:46] Ox0dea: frozenfoxx: Kernel#gets actually reads from ARGF, which is essentially $stdin if you didn't leave any filenames in ARGV.
[18:41:09] bryanray: has joined #ruby
[18:41:36] Ox0dea: txtsd: Same error for that TTF.
[18:42:06] EminenceHC: has joined #ruby
[18:42:52] GnuYawk: has joined #ruby
[18:43:36] jord: has joined #ruby
[18:44:22] frozenfoxx: Ox0dea: Good stuff, I think I understand. As I'm testing it out here it's working nicely. This also means that, nifty as Celluloid is, I probably won't have to use it and less external dependencies makes me a happy camper.
[18:44:34] kadoppe: has joined #ruby
[18:44:51] frozenfoxx: Ox0dea: I've had little sleep, so I'm going to mulligan my Engrish.
[18:45:11] frozenfoxx: Ox0dea: anyway, thanks so much, I've beat my head on that for three weeks now trying to figure out how to make it work.
[18:45:23] Ox0dea: frozenfoxx: It's much fewer abrasive if you interpret it as a Game of Thrones reference.
[18:45:33] djellemah: millerti: There is a very old and crufty (1.9.3) symbolic algebra library here http://blade.nagaokaut.ac.jp/~sinara/ruby/math/algebra/algebra-0.72/doc/index.html
[18:45:47] txtsd: Ox0dea: Am I SOL then? I just want to extract the damn PNGs :(
[18:45:53] frozenfoxx: Ox0dea: I'm that horrible heretic that doesn't like Game of Thrones. Please don't make me Sean Bean!
[18:46:10] millerti: djellemah: There's also a C version of sympy called symengine that has been made into a Ruby extension, but it's incomplete.
[18:46:14] Ox0dea: txtsd: I mean, do you want the older TTF for which it works just fine?
[18:46:30] Ox0dea: (See query.)
[18:46:38] txtsd: Ox0dea: No, I need the new emojis from the most recent version.
[18:46:40] Ox0dea: frozenfoxx: He lives!
[18:47:05] workmad3: frozenfoxx: blasphemy! Your punishment is to be every Sean Bean character in every film and show he's ever been in!
[18:47:45] Ox0dea: txtsd: I suppose your only option is to file an issue with ttfunk, then. :<
[18:47:56] h99h9h88: has joined #ruby
[18:48:31] frozenfoxx: workmad3: in that case, quoting Black Death, "victory is mine!"
[18:48:53] Guest53: has joined #ruby
[18:49:31] mbrune: has joined #ruby
[18:49:37] pipework: frozenfoxx: you mean Stewie Griffin.
[18:50:10] jdawgaz: has joined #ruby
[18:50:13] mbrune: hey all I am doing an ssh.exec!("") and I have an awk string that I want to run but I can't seem to escape it in such a way that ruby and awk both understand
[18:50:31] mbrune: awk 'END{print "\"id\":\""$1 "\", \"image\":\"" $2"\""}'
[18:50:40] mbrune: that that works in bash/sh/etc
[18:50:47] frozenfoxx: pipework: no, he says it right before he's got his limbs pulled off at the end of the movie.
[18:50:55] pipework: frozenfoxx: it was a joke
[18:51:02] karapetyan: has joined #ruby
[18:51:16] frozenfoxx: pipework: sorry, it didn't come across that way with text. :/
[18:51:44] lkba: has joined #ruby
[18:52:38] pipework: frozenfoxx: If someone says that Family Guy says anything original, it's either a joke or a reflection of their lack of a worthwhile educational background.
[18:53:20] m3_del: has joined #ruby
[18:54:22] failshell: has joined #ruby
[18:55:19] sl33k_: has joined #ruby
[18:55:49] benlovell: has joined #ruby
[18:55:51] benlovel1: has joined #ruby
[18:55:53] drbrain: mbrune: try using %q[???]
[18:56:16] drbrain: >> %q[ this is a string that can have ", ' or {} inside it ]
[18:56:17] ruboto: drbrain # => " this is a string that can have \", ' or {} inside it " (https://eval.in/458010)
[18:57:01] karapetyan: has joined #ruby
[18:57:07] djellemah: Ox0dea: thanks for that thaw code using Fiddle, it gives me one way of doing what I want. Now, all I have to do is resist the many temptations down that road ;-)
[18:57:31] Ox0dea: djellemah: Sure thing. That particular rabbit hole does indeed run quite deep. :)
[18:57:31] dmolina: has joined #ruby
[18:58:05] dmolina1: has joined #ruby
[18:58:36] skinux: I seem to have Ruby 2.1.5p273 (which I just downloaded yesterday), which contains a CA certificate issue. How do I update so this issue is resolved? Do I have to download and install Ruby again?
[18:58:53] Xeago: has joined #ruby
[18:59:05] Ox0dea: drbrain: Thoughts on `Prime.include?`?
[18:59:07] skinux: I found documentation for update fix versions online, which shows 2.0 and 2.2, but not 2.1
[19:00:08] Ox0dea: >> Class.instance_methods & Enumerable.instance_methods # drbrain
[19:00:09] ruboto: Ox0dea # => [:include?] (https://eval.in/458015)
[19:00:10] rbennacer: has joined #ruby
[19:00:17] v4n: has joined #ruby
[19:01:46] jhn: has joined #ruby
[19:01:55] drbrain: Ox0dea: it exposes that sometimes #include? is crappy
[19:02:00] Ox0dea: Fair enough.
[19:02:20] Ox0dea: Still, it could be made to respond sensibly.
[19:02:23] drbrain: I guess there should be a note in the documentation
[19:02:26] drbrain: yes, it could
[19:02:29] Ox0dea: Should it?
[19:02:43] `based_pdev`: has joined #ruby
[19:02:53] rehat_: has joined #ruby
[19:03:21] skinux: How do I tell gem to install from a local file?
[19:03:47] drbrain: skinux: gem install local_file_name.gem
[19:04:42] drbrain: Ox0dea: I think it should
[19:04:47] skinux: I did that, it said it couldn't find it in repository
[19:04:51] drbrain: since it can never return false
[19:05:14] drbrain: skinux: and `ls local_file_name.gem` exists?
[19:05:52] skinux: I'm using Windows
[19:05:56] skinux: But yes it exists
[19:06:04] shevy: skinux did you try "gem install ./name.gem" too
[19:06:11] Ox0dea: drbrain: But it can return false?
[19:06:12] chouhoulis: has joined #ruby
[19:06:25] drbrain: skinux: try gem install --local local_file_name.gem then
[19:06:28] drbrain: Ox0dea: I don't see how
[19:06:38] drbrain: Enumerable#include? assumes a finite set
[19:07:01] Ox0dea: Well, sure, but if Prime.include? is to be specialized, I don't see why a bit of domain knowledge couldn't be applied.
[19:07:09] skinux: That worked
[19:07:31] al2o3-cr: has joined #ruby
[19:07:57] Ox0dea: drbrain: https://eval.in/458018
[19:08:02] Ox0dea: There's the patch I intended to propose.
[19:08:31] dikaio: has joined #ruby
[19:08:46] northfurr: has joined #ruby
[19:09:04] drbrain: Ox0dea: you might get better performance by divmod each prime with value
[19:09:36] Ox0dea: Really, `Prime.include?` is hardly the best way to check for primality, but it should at least not lie.
[19:11:38] Ox0dea: Gem::Specification is another such "enumerable class", but its finitude absolves it somewhat.
[19:12:38] Ox0dea: Using ObjectSpace to find the classes which include Enumerable leads to a bad time if you've required 'prime'.
[19:12:58] Dakota-choad: has joined #ruby
[19:15:30] willardg: has joined #ruby
[19:15:46] Coldblackice: has joined #ruby
[19:15:59] pipework: Ox0dea: I'm willing to bet that most sentences involving "Using ObjectSpace" lead to a bad time.
[19:16:20] G186: has joined #ruby
[19:16:24] Ox0dea: pipework: Wrong channel?
[19:16:37] pipework: Ox0dea: No, why would you think that?
[19:16:42] pipework: [12:12:38 PM] <Ox0dea> Using ObjectSpace to find the classes which include Enumerable leads to a bad time if you've required 'prime'.
[19:17:09] yfeldblum: has joined #ruby
[19:17:22] tvw: has joined #ruby
[19:17:28] h99h9h88: has joined #ruby
[19:18:09] daffy_duck: has joined #ruby
[19:18:10] dionysus69: has joined #ruby
[19:18:12] skade: has joined #ruby
[19:18:17] Ox0dea: pipework: The part where you don't think it's great that we *can* analyze the entire system threw me off.
[19:18:36] pipework: Ox0dea: Oh, it's not that it's not great, just that bad times are had.
[19:19:12] bricker: has joined #ruby
[19:20:00] poguez_: has joined #ruby
[19:20:10] Ox0dea: > Terrible, yes, but great.
[19:20:28] luckyme: has joined #ruby
[19:20:30] Ox0dea: ObjectSpace is Voldemort confirmed.
[19:21:18] mghaig_: has joined #ruby
[19:22:03] pipework: He who shall not be introspected?
[19:23:02] dfinninger: has joined #ruby
[19:23:10] firstdayonthejob: has joined #ruby
[19:23:37] shevy: stop peeking at inside ruby!
[19:23:59] arthurix_: has joined #ruby
[19:24:46] Fire-Dragon-DoL: has joined #ruby
[19:25:24] kerunaru: has joined #ruby
[19:25:39] drbrain: reminds me of a bug where you could crash ruby by using ObjectSpace to find the String gsub was using to build the result string and adding characters to it
[19:25:52] drbrain: or something like that
[19:25:54] diegoaguilar: has joined #ruby
[19:26:13] karapetyan: has joined #ruby
[19:26:59] Eiam_: has joined #ruby
[19:28:46] Salve: has joined #ruby
[19:28:48] pdoherty: has joined #ruby
[19:29:20] kerunaru: has joined #ruby
[19:29:54] skinux: Umm..apparently gem is set to use JRuby,how do I set it to use regular Ruby?
[19:30:08] targaf: has joined #ruby
[19:30:19] slash_nick: skinux: are you using rvm?
[19:30:35] skinux: Not unless it's doing it automagically
[19:30:46] ruurd: has joined #ruby
[19:30:49] shevy: hah I once had fun with jruby too and installed into /usr prefix, then I wondered why ruby no longer worked
[19:31:23] adaedra: sounds like you were asking for trouble.
[19:31:44] skinux: I installed JRuby after I installed Ruby, but on Windows, I didn't set any custom locations.
[19:32:11] mhib: has joined #ruby
[19:34:53] lemur: has joined #ruby
[19:35:58] ayonkhan: has joined #ruby
[19:37:45] baweaver_: has joined #ruby
[19:38:13] PaulCapestany: has joined #ruby
[19:38:53] v4n_: has joined #ruby
[19:42:56] ivanskie: has joined #ruby
[19:44:15] platzhirsch: has joined #ruby
[19:44:28] northfurr: has joined #ruby
[19:47:17] sepp2k: has joined #ruby
[19:47:18] skinux: I think I figured it out. JRuby was before Ruby in PATH, so I moved switched it around. We'll see if that works.
[19:47:42] northfurr: has joined #ruby
[19:47:47] skinux: Maybe not the real way of doing it, but it seems to be working.
[19:47:55] skade: has joined #ruby
[19:47:57] skinux: Work-around if nothing else.
[19:48:37] Xiti: has joined #ruby
[19:50:31] northfurr: has joined #ruby
[19:51:27] mbrune: wtf redis?
[19:52:12] mbrune: http://pastebin.com/7YqzWGwY returns the correct and current unix time
[19:52:12] ruboto: mbrune, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/847855ec24a8a4e38349
[19:52:12] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[19:52:34] mbrune: but when I go to the redis server the only key there is "test"
[19:53:02] mbrune: any ideas?
[19:53:26] skweek: has joined #ruby
[19:53:34] C0r3: has joined #ruby
[19:53:40] skade: has joined #ruby
[19:54:02] uber: has joined #ruby
[19:54:04] m3_del: has joined #ruby
[19:54:12] lxsameer: has joined #ruby
[19:54:28] northfurr: has joined #ruby
[19:54:29] NeverDie_: has joined #ruby
[19:54:32] targaf: is there a way to call a ruby file from another file and pass variables along with the call?
[19:54:37] al2o3-cr: has joined #ruby
[19:54:54] C0r3: I have basic programming experience... By 'basic' I mean it literally and not the language 'BASIC'.. :P I have prior experience in PHP and now I wish to migrate to Ruby. Can anyone guide me the right way??
[19:55:23] swgillespie: has joined #ruby
[19:55:50] shevy: C0r3 write as much code as possible in ruby
[19:56:02] shevy: start with something small that you would do in php
[19:56:40] Motoservo: has joined #ruby
[19:56:44] C0r3: shevy: I used php for developing web apps. Also use a framework.
[19:57:26] C0r3: shevy: Can you please tell me any nice example tasks that can help me enhance my Ruby programming skills?
[19:58:02] Ox0dea: C0r3: Scratch an itch.
[19:58:38] shevy: C0r3 well do you have irb running locally already; if so start it
[19:58:45] `tim`: has joined #ruby
[19:58:46] Guest53: has joined #ruby
[19:58:54] Ox0dea: targaf: Could you elaborate? The broadest applicable answer is "yes, structure your code appropriately".
[19:59:18] h99h9h88: has joined #ruby
[19:59:28] Salve: targaf: yeah, use a pipe and stream the data
[19:59:32] C0r3: shevy: I don't even know what is IRB. I'll give a search..
[19:59:55] Ox0dea: C0r3: Why did you capitalize it?
[19:59:55] Salve: c0r3: interactive ruby
[19:59:59] skweek: has joined #ruby
[20:00:00] targaf: fair enough. I'm using https://github.com/yob/pdf-reader/blob/master/examples/extract_images.rb and need to pass certain variables from my main script (directory, filename, etc..) to it
[20:00:09] ahegyi: has joined #ruby
[20:00:11] shevy: C0r3 ok, it allows you to evaluate ruby code as you type it in, very simple to test your code. it comes distributed with ruby normally
[20:00:31] targaf: I'm looking to call that linked file so it has access to the variables I mentioned but I don't know the appropriate syntax.
[20:00:46] benlovell: has joined #ruby
[20:00:47] benlovel1: has joined #ruby
[20:01:00] C0r3: Ox0dea: It seemed to me like some acronym.
[20:01:07] C0r3: shevy: Something like Python Interactive Shell.
[20:01:32] shevy: in python you get it when running "python" without arguments
[20:01:32] C0r3: shevy: I understood. I'll install it. Give me a minute.
[20:01:52] Ox0dea: C0r3: It's only an acronym if you pronounce it "herb", elseways it's just an initialism.
[20:01:53] shevy: in ruby that is separate, usually resides in bin/irb
[20:02:24] shevy: ok when you have irb running, let me know
[20:03:10] C0r3: shevy: Okay... Ox0dea: Alright!
[20:03:11] bender_unit: has joined #ruby
[20:04:33] C0r3: shevy: Done!
[20:05:30] skade: has joined #ruby
[20:05:49] northfurr: has joined #ruby
[20:06:04] Renich: has joined #ruby
[20:06:25] shevy: C0r3 have a look at this site: https://pine.fm/LearnToProgram/chap_01.html
[20:06:45] shevy: it may appear too primitive for you since you already know php, but just type in the examples given into irb
[20:06:55] shevy: after that tutorial you will know yield, procs, methods, classes and modules
[20:07:10] shevy: (just skip the homework/assignment stuff)
[20:07:52] C0r3: shevy: Okay.. So I shall continue this tutorial till end?
[20:08:11] willardg: has joined #ruby
[20:08:12] shevy: yeah, just skip when you feel you can't learn from that page
[20:08:51] shevy: chap_04.html will probably be more useful but look at the 3 chapters too
[20:09:02] pdoherty: has joined #ruby
[20:09:04] opensource_ninja: has joined #ruby
[20:09:12] shevy: the code to that tutorial is pretty cool too, it's a single .rb file
[20:09:31] shevy: I once wanted to publish an updated version but it's so much work :(
[20:09:53] C0r3: shevy: That's your website?
[20:10:35] shevy: chris pine
[20:10:39] shevy: here is how you can look at the source if you want to: https://pine.fm/LearnToProgram/?ShowTutorialCode=true
[20:10:55] shevy: it's a bit weird though, I would not write it like that, but it's cool that it is a single .rb file
[20:11:00] shevy: but anyway, work through the chapters first!
[20:11:40] djbkd: has joined #ruby
[20:11:41] C0r3: shevy: The entire website is a single .rb file???
[20:12:07] shevy: he wrote it in 2003 or so if you look at the copyright notice :)
[20:12:10] C0r3: shevy: I can't believe..
[20:12:10] karapetyan: has joined #ruby
[20:12:19] ruurd: has joined #ruby
[20:12:39] C0r3: Awesome!!
[20:12:59] shevy: by the way C0r3 also read this short interview - it is also very old but this is the best difference between ruby and e. g. python, the philosophy: http://www.artima.com/intv/ruby.html
[20:13:05] pocketprotector-: has joined #ruby
[20:13:10] jriggins: has joined #ruby
[20:13:43] C0r3: shevy: Hang on I'll make a note of all the recommendations...
[20:14:37] C0r3: shevy: Tell me more.
[20:14:47] shevy: the interview is really short, it's like only 8 paragraphs in question-answer style
[20:15:06] shevy: dunno... both articles linked above actually originated from 2003 :\
[20:15:21] shevy: one thing that you should later learn is how to write a .gem file yourself for your code to distribute it
[20:15:24] C0r3: I'll check that. I noted it down.
[20:16:18] dopamean_: has joined #ruby
[20:17:02] bender_unit: has joined #ruby
[20:17:03] C0r3: Okay.. How much time should I expect to get a grip over Ruby? If I have 1 year of programming experience. And you can see my code at www.github.com/Qumonto/usersys
[20:17:24] trosborn: has joined #ruby
[20:17:55] C0r3: I feel the Ruby community is more friendly than the PHP community. Is it always like this?
[20:19:13] cdg: has joined #ruby
[20:20:42] Yzguy: has joined #ruby
[20:21:15] yashinbasement: has joined #ruby
[20:21:27] swgillespie: has joined #ruby
[20:22:43] mozzarella: did ruby ever ship with a static web server?
[20:22:46] cwong_on_irc: has joined #ruby
[20:23:03] jhass: ruby -run -ehttpd
[20:23:18] cwong_on_irc: has joined #ruby
[20:23:50] havenwood: mozzarella: For example, current dir on port 8080: ruby -run -ehttpd . -p 8080
[20:24:00] bender_unit: has joined #ruby
[20:25:12] havenwood: mozzarella: https://github.com/ruby/ruby/blob/trunk/lib/un.rb#L298-L334
[20:25:20] G186: has joined #ruby
[20:25:22] Oatmeal: has joined #ruby
[20:26:15] nertzy: has joined #ruby
[20:26:43] C0r3: shevy: Thanks for the info...
[20:27:49] mozzarella: so, it loads the "un" file and executes "httpd" as code (which calls the httpd function)?
[20:27:57] havenwood: C0r3: Your experience should speed up learning nicely. Can't say what a grip on Ruby is or how long it might take you. It's a nice community!
[20:28:32] uber: has joined #ruby
[20:30:28] jhass: mozzarella: method, yeah
[20:31:28] alexdunne: has joined #ruby
[20:32:42] ruurd: has joined #ruby
[20:32:56] Steve_Jobs: has joined #ruby
[20:34:32] ni291187: has joined #ruby
[20:34:44] ni291187: why are niggers racist?
[20:34:53] ruboto: +q ni291187!*@*
[20:34:53] ruboto: -o ruboto
[20:35:22] dionysus69: has joined #ruby
[20:35:29] bruno-: has joined #ruby
[20:36:32] skinux: Does Rails have it's own version of Ruby packaged???
[20:37:25] danneu: skinux: no, as in rails runs on whichever ruby you have installed
[20:37:53] momomomomo: has joined #ruby
[20:38:11] skinux: Hmm. I installed needed packages using command-line, but RubyMine keeps saying their missing and fails to install them.
[20:39:28] skinux: It's trying to install debase, but it says it cannot install dependency debase-ruby_core_source
[20:39:39] chouhoul_: has joined #ruby
[20:39:43] skinux: It shouldn't be trying to because both are already installed.
[20:40:46] momomomomo: skinux: maybe try in the jetbrains support email
[20:41:06] kerunaru: has joined #ruby
[20:41:26] skinux: Yeah..so I can wait a day or two for them to reply.
[20:42:43] momomomomo: skinux: just suggesting an avenue that might be of help to you; that's a product-specific integration. You probably need to ensure that you've got the right ruby environment configured for rubymine
[20:43:26] symm-: has joined #ruby
[20:43:36] jamesaxl: has joined #ruby
[20:43:52] skinux: Honestly I wish I knew how to develop extensions to Eclipse, so I could create my own custom "IDE".
[20:44:45] momomomomo: I don't use an IDE for ruby
[20:44:50] momomomomo: only for c++ and java
[20:45:50] arthurnn: has joined #ruby
[20:46:10] skinux: I was just thinking maybe I should just use Sublime Text or Notepad++ and either Gradle or Maven individually instead of using RubyMine
[20:47:17] momomomomo: skinux: some people like IDEs, some people like text editors, it's all preference
[20:47:33] momomomomo: try sublime text, it's nice
[20:47:33] shevy: try notepad++ if you are on windows, and try to stay as simple as possible. ruby is simple, one should not need eclipse for it
[20:48:11] skinux: I prefer IDEs, but if I can't get an IDE to work with me then I'll use a text editor, ruby/rails themselves, and whatever other tools needed via command-line.
[20:48:32] momomomomo: skinux: that's generally the way of things
[20:48:44] Radar: Sublime Text 3 or death
[20:48:54] arthurix: has joined #ruby
[20:49:00] Radar: IDEs are not that great for Ruby because it is a dynamic language
[20:49:03] skinux: I like IDEs, for one thing because I don't have to learn all the commands of various things.
[20:49:04] svkurowski: has joined #ruby
[20:49:18] momomomomo: I use vim + syntastic
[20:49:20] Radar: I often see a lot of people (coworkers included!) who spend more time fiddling around with their IDE to run commands like "git commit" or Rake tasks.
[20:49:29] svkurowski: ruby -e "require 'date'; puts Date.rfc3339('2009-04-04T09:51:28+00:00').strftime('%Y/%m-%B/%d-%A/%H-%M')" > Why does this print 0 for the minute and the hour value?
[20:49:33] Radar: Like, how hard is to tab over into the terminal and run the commands?
[20:49:42] momomomomo: or just stay in the terminal and use vim
[20:49:48] momomomomo: or emacs if that's your thing
[20:49:49] Radar: svkurowski: Is this an interview question?
[20:50:12] svkurowski: I'm trying to batch process a bunch of files
[20:50:21] Radar: svkurowski: It's because you're using Date and not Time.
[20:50:26] Radar: svkurowski: Date is for days, months and years.
[20:50:46] havenwood: >> require 'date'; puts DateTime.rfc3339('2009-04-04T09:51:28+00:00').strftime('%Y/%m-%B/%d-%A/%H-%M')
[20:50:47] momomomomo: >> puts Time.rfc3339('2009-04-04T09:51:28+00:00').strftime('%Y/%m-%B/%d-%A/%H-%M')"
[20:50:48] ruboto: havenwood # => 2009/04-April/04-Saturday/09-51 ...check link for more (https://eval.in/458061)
[20:50:48] ruboto: momomomomo # => /tmp/execpad-c2e1fcd0568d/source-c2e1fcd0568d:2: syntax error, unexpected tSTRING_BEG, expecting key ...check link for more (https://eval.in/458062)
[20:51:23] Radar: Sorry, DateTime in this instance since Time does not have that method.
[20:51:38] svkurowski: Wow, I'm stupid
[20:51:51] momomomomo: svkurowski: nah, that's a small mistake
[20:53:30] VeryBewitching: has joined #ruby
[20:53:31] al2o3-cr: has joined #ruby
[20:53:36] ivanskie: has joined #ruby
[20:53:48] Guest53: has joined #ruby
[20:54:51] m3_del: has joined #ruby
[20:56:25] Musashi007: has joined #ruby
[20:58:07] Igorshp: has joined #ruby
[20:58:14] h99h9h88: has joined #ruby
[20:59:03] h99h9h88: has joined #ruby
[20:59:13] bnagy_: has joined #ruby
[21:00:05] jessemcgilallen: has joined #ruby
[21:00:19] eggoez: has joined #ruby
[21:00:31] Couch: has joined #ruby
[21:00:44] stamina: has joined #ruby
[21:03:01] roxtrongo: has joined #ruby
[21:04:36] Musashi007: has joined #ruby
[21:05:18] NeverDie: has joined #ruby
[21:05:44] Xeago: has joined #ruby
[21:05:55] yqt: has joined #ruby
[21:07:12] swgillespie: has joined #ruby
[21:07:32] h99h9h88: has joined #ruby
[21:08:14] targaf: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[21:08:34] crime: has joined #ruby
[21:09:54] hashpuppy: has joined #ruby
[21:09:57] jackjackdripper: has joined #ruby
[21:11:12] hashpuppy: how can i remove all elements that have more than 2 values. so, [1, 1, 2, 3, 4, 4, 4] would return [2, 3]
[21:11:16] hashpuppy: more than 1 value
[21:11:44] everbot: has joined #ruby
[21:12:15] ruurd: has joined #ruby
[21:12:39] baweaver_: what have you tried?
[21:14:02] kerunaru: has joined #ruby
[21:14:08] baweaver_: hashpuppy: ^
[21:14:20] Igorshp: has joined #ruby
[21:14:49] havenwood: hashpuppy: Are duplicates always together or might they be in any order?
[21:14:49] hashpuppy: [1, 1, 1, 2, 3, 4, 4].group_by{|x| x}.values.select{|x| x.length == 1}.flatten
[21:15:27] numbertheory_isP: has joined #ruby
[21:16:26] baweaver_: you can also use group_by(&:itself)
[21:16:30] havenwood: >> [1, 1, 2, 3, 4, 4, 4].chunk(&:itself).map(&:last).select(&:one?).flatten
[21:16:31] ruboto: havenwood # => [2, 3] (https://eval.in/458065)
[21:16:36] twe4ked: has joined #ruby
[21:16:45] havenwood: and select(&:one?)
[21:17:00] hashpuppy: hmm... thanks
[21:17:02] akem: has joined #ruby
[21:17:11] hashpuppy: just like learning different ways to do things
[21:17:22] Ox0dea: havenwood: hashpuppy said any order?
[21:17:38] devoldmx: has joined #ruby
[21:17:41] havenwood: Ox0dea: I asked, hashpuppy didn't say.
[21:17:48] Ox0dea: They did.
[21:17:51] havenwood: Ox0dea: ah, yes, any order - hashpuppy did say
[21:17:57] havenwood: i missed that
[21:18:15] baweaver_: havenwood made a mistake! Let the merciless heckling begin!
[21:18:21] baweaver_: well I'm done
[21:18:57] havenwood: hashpuppy: So then, final answer: group_by(&:itself).values.select(&:one?).flatten
[21:19:42] mag42c: has joined #ruby
[21:19:43] hashpuppy: why do i get NoMethodError: undefined method `itself' for 1:Fixnum
[21:19:53] Ox0dea: hashpuppy: You're using an old Ruby.
[21:20:47] havenwood: hashpuppy: 2.1.7 is the latest 2.1 but for 2.2 features use 2.2.3.
[21:21:21] havenwood: hashpuppy: In 2.1: group_by { |i| i }.values.select(&:one?).flatten
[21:21:51] pocketprotector-: has joined #ruby
[21:21:53] Ox0dea: >> [1,2,3,2,3,4].reduce([]) { |m, x| m.delete(x) || m << x; m }
[21:21:54] ruboto: Ox0dea # => [1, 4] (https://eval.in/458071)
[21:21:58] Ox0dea: I quite like that one.
[21:22:13] hashpuppy: yeah, not bad
[21:22:27] havenwood: >> [1,2,3,2,3,4].each_with_object([]) { |x, m| m.delete(x) || m << x }
[21:22:28] ruboto: havenwood # => [1, 4] (https://eval.in/458072)
[21:22:31] havenwood: slight variation ^
[21:22:32] Trynemjoel: has joined #ruby
[21:22:37] hashpuppy: delete in reduce seems weird to me, though it's probably not
[21:22:41] Ox0dea: hashpuppy: It is.
[21:22:57] Ox0dea: But it's referentially transparent, so still "functional".
[21:22:59] ss_much: has joined #ruby
[21:23:17] blackmesa: has joined #ruby
[21:23:32] Ox0dea: We're not modifying the receiver, just our internal scratch buffer.
[21:24:18] dreinull75: "foo"[2].chr #=> "o" which is ok, "foo"[3].chr returns an error. Is it possible to find out which class/method returned the nil?
[21:24:41] Ox0dea: >> 'foo'[3] # dreinull75
[21:24:42] ruboto: Ox0dea # => nil (https://eval.in/458075)
[21:24:48] Ox0dea: It was #[]!
[21:25:11] baweaver_: In Ruby, purity isn't the best idea. Referential Transparency is what you want to aim for
[21:25:25] Igorshp: has joined #ruby
[21:25:33] Ox0dea: ^ This fellow's got the right of it.
[21:25:33] dreinull75: Ox0dea, um, well I know the source here. I mean dynamically. This is not my actual code :)
[21:25:46] Ox0dea: dreinull75: Read the backtrace?
[21:25:47] baweaver_: ACTION also uses Haskell
[21:25:59] dreinull75: I want to return some specific message
[21:26:24] shock_one: has joined #ruby
[21:26:29] dreinull75: It's a string creating app that can't have nil. I need some readable stuff.
[21:26:56] dreinull75: So in order to give the user some idea what's going on I need to tell them where the nil originated from.
[21:27:02] nateberkopec: has joined #ruby
[21:27:09] Ox0dea: dreinull75: NameError#receiver is a thing in 2.3.
[21:27:15] Ox0dea: I suspect that is of no benefit to you at this time.
[21:27:36] dreinull75: If it's worth waiting for?
[21:27:51] shock_one: has joined #ruby
[21:28:12] Ox0dea: ~ $ ruby -e '42.foo rescue p $!.receiver'
[21:28:16] Ox0dea: It's pretty nifty.
[21:28:22] failshell: has joined #ruby
[21:28:44] ruurd: has joined #ruby
[21:29:20] ytti: i didn't know that, cool
[21:29:28] ytti: but also, i get dirty, nasty ideas
[21:29:43] ytti: that will make the next person reading the code bestow ancient curse on my family
[21:29:44] dreinull75: "foo"[3].chr rescue p $!.receiver still returns nil though
[21:30:41] Ox0dea: dreinull75: It's unclear which branch of magic you're hoping Ruby has studied.
[21:31:09] Ox0dea: Are you wanting to monitor every single method invocation and respond "appropriately" if the return value is `nil`?
[21:31:19] swgillespie: has joined #ruby
[21:31:27] bender_unit: has joined #ruby
[21:31:39] Papierkorb: Asking random.org might be a good idea in that case.
[21:31:59] Ox0dea: Or TracePoint.
[21:32:01] danielpclark: has joined #ruby
[21:32:05] Ox0dea: But seven hells.
[21:32:09] alexdunne: has joined #ruby
[21:32:10] dreinull75: Ox0dea I've thought about that too and I'm not sure. For my decorators that's a good idea. For everthing else nil might come handy too.
[21:33:07] dreinull75: I could handle these things just fine with nil checks but it will look ugly. So I'm trying to simplify things a bit for the user.
[21:33:35] drbrain: dreinull75: "foo"[3] is nil, though, so what do you want it to return?
[21:33:57] Ox0dea: A user-friendly error message, it seems.
[21:33:58] allcentury: has joined #ruby
[21:34:05] bender_unit: has joined #ruby
[21:34:12] hxegon: has joined #ruby
[21:34:30] arthurix_: has joined #ruby
[21:34:47] dreinull75: The problem ist that I'm working with DB associations. If they are missing there's a problem. So I want to tell the user to check their data. If not just spit out some Strings with data.
[21:35:39] sepp2k1: has joined #ruby
[21:35:52] drbrain: it seems the best you could do is guess at where the error occurred
[21:36:14] dreinull75: I'm using these method calls in slim templates so there is not much room for logic
[21:36:17] yfeldblum: has joined #ruby
[21:36:19] drbrain: Either the contents of the string or the argument to String#[] could be the source
[21:38:23] dreinull75: Is there a way to create wrapper methods in the simple delegate subclass for the methods concerned? If nil, return some message, if valid forward them?
[21:38:53] arthurix: has joined #ruby
[21:39:17] matp: has joined #ruby
[21:39:51] bender_unit: has joined #ruby
[21:40:58] bb010g: has joined #ruby
[21:42:25] Ox0dea: dreinull75: Do you know about Module#prepend?
[21:43:15] dreinull75: Ox0dea thought maybe there'S a simpler method
[21:43:34] shadoi: has joined #ruby
[21:43:46] skade: has joined #ruby
[21:43:51] shadoi: has left #ruby: ()
[21:44:07] jwaldrip: has joined #ruby
[21:44:39] benlovel1: has joined #ruby
[21:44:40] benlovell: has joined #ruby
[21:46:54] Pupeno: has joined #ruby
[21:48:09] shazaum_: has joined #ruby
[21:48:29] nateberkopec: has joined #ruby
[21:50:36] Ox0dea: dreinull75: https://eval.in/458084
[21:50:50] ivanskie: has joined #ruby
[21:51:07] Ox0dea: I decided not to try to figure out how to get the nil-causing argument(s).
[21:52:11] slawrence00: has joined #ruby
[21:53:28] dreinull75: Ox0dea: wow, that's cool. Thank you!
[21:53:34] Ox0dea: dreinull75: Don't say things like that.
[21:53:37] Ox0dea: (You're welcome.)
[21:53:40] blue_deref: has joined #ruby
[21:55:06] sdwrage: has joined #ruby
[21:55:39] m3_del: has joined #ruby
[21:55:59] Ox0dea: dreinull75: https://eval.in/458086
[21:56:08] Ox0dea: Simple enough, no?
[21:56:10] pu22l3r_: has joined #ruby
[21:56:13] leafybasil: has joined #ruby
[21:56:41] Ox0dea: For sufficiently warped definitions of "simple", granted.
[21:56:52] Igorshp: has joined #ruby
[21:57:38] bender_unit: has joined #ruby
[21:58:05] dreinull75: I think I've seen that before...
[21:58:37] opensource_ninja: has joined #ruby
[21:59:12] yashinbasement: has joined #ruby
[21:59:42] yashinbasement: has joined #ruby
[21:59:54] dreinull75: https://twitter.com/brixen/status/657259014460346368
[21:59:58] bollullera: has joined #ruby
[22:00:20] northfurr: has joined #ruby
[22:00:33] sankaber: has joined #ruby
[22:00:49] dreinull75: in a more controlled environment this looks straight forward :)
[22:01:29] ruurd: has joined #ruby
[22:02:15] firstdayonthejob: has joined #ruby
[22:03:16] jgpawletko: has joined #ruby
[22:03:23] ecksit: has joined #ruby
[22:03:52] jwaldrip: has joined #ruby
[22:04:49] failshell: has joined #ruby
[22:05:01] skade: has joined #ruby
[22:05:08] New_to_Ruby: has joined #ruby
[22:05:36] jgpawletko: has joined #ruby
[22:05:59] maxz: has joined #ruby
[22:07:50] adaedra: Ah, here comes the ruby expert
[22:07:56] havenwood: New_to_Ruby: hi
[22:08:17] h99h9h88: has joined #ruby
[22:09:38] scoot_: has joined #ruby
[22:09:46] nateberkopec: has joined #ruby
[22:10:42] mghaig: has joined #ruby
[22:11:50] mary5030: has joined #ruby
[22:12:07] bender_unit: has joined #ruby
[22:12:58] jessemcgilallen: has joined #ruby
[22:13:29] shevy: New_to_Ruby hey you are no longer new
[22:13:32] shevy: you were here yesterday too!
[22:14:18] BlackCoyote: has joined #ruby
[22:15:06] jgpawletko: has joined #ruby
[22:15:22] northfurr: has joined #ruby
[22:15:25] Less_new_to_Ruby: I am trying to get my head around why when defining a method I would pass it an argument.
[22:15:38] shevy: how do you define a method without arguments Less_new_to_Ruby
[22:16:18] Less_new_to_Ruby: def method_name rather than def method_name(arguments)
[22:16:46] shevy: the second one accepts arguments, the first one does not
[22:16:47] havenwood: Less_new_to_Ruby: Use just a method if that suffices. Choose the simplest thing.
[22:17:14] benlovell: has joined #ruby
[22:17:15] benlovel1: has joined #ruby
[22:17:15] Less_new_to_Ruby: I'm doing the koans and am seeing methods defined with arguments and they're throwing me off.
[22:18:42] malconis: has joined #ruby
[22:21:35] naztharune: has joined #ruby
[22:22:04] cornerma1: has joined #ruby
[22:22:25] Less_new_to_Ruby: I'm at the point where (8 days in) I feel as though I should be past the basics. I feel a little dumb for being hung up on, what I think, seems like an easy enough concept to everyone else.
[22:25:05] shevy: it's just a method
[22:25:09] shevy: you bind code into it
[22:25:13] shevy: when you invoke the method, that code is run
[22:25:29] roxtrongo: has joined #ruby
[22:26:33] chouhoulis: has joined #ruby
[22:28:08] Less_new_to_Ruby: I understand it better after reading and trying this example. http://goo.gl/bUKt0h
[22:28:31] leafybasil: has joined #ruby
[22:29:32] quazimodo: has joined #ruby
[22:29:48] djbkd: has joined #ruby
[22:30:31] skade: has joined #ruby
[22:31:15] mois3x: has joined #ruby
[22:31:19] platzhirsch: has joined #ruby
[22:31:43] RegulationD: has joined #ruby
[22:31:49] nateberkopec: has joined #ruby
[22:32:41] tkuchiki: has joined #ruby
[22:33:19] opensource_ninja: has joined #ruby
[22:33:33] hiyosi: has joined #ruby
[22:33:58] agit0: has joined #ruby
[22:36:56] Underdogg: has joined #ruby
[22:38:40] TheNet: has joined #ruby
[22:38:54] TheNet: is there a way to toggle between instance variables being writable or readable?
[22:38:59] bruno-: has joined #ruby
[22:39:15] agit0: has joined #ruby
[22:39:38] adaedra: You can freeze instances, but instance variables can always be reaffected.
[22:40:12] TheNet: can I create my own accessor methods?
[22:40:53] TheNet: how would I create a write method?
[22:40:57] adaedra: attr_reader, attr_writer, attr_accessor for default behavior, otherwise define `name` and `name=(_)` to your convienence
[22:41:04] nertzy: has joined #ruby
[22:41:08] shevy: def foo=(i); @foo = i # TheNet
[22:42:04] ruby-lang734: has joined #ruby
[22:43:27] ruurd: has joined #ruby
[22:44:08] Ropeney: has joined #ruby
[22:44:27] dopamean_: has joined #ruby
[22:44:40] Igorshp: has joined #ruby
[22:45:05] avahey: has joined #ruby
[22:45:16] mollusk_: has joined #ruby
[22:50:18] yardenbar: has joined #ruby
[22:51:05] Igorshp: has joined #ruby
[22:53:08] nateberkopec: has joined #ruby
[22:53:10] Alina-malina: has joined #ruby
[22:54:40] codeurge: has joined #ruby
[22:55:19] Or1on: has joined #ruby
[22:55:42] yfeldblum: has joined #ruby
[22:55:45] pathlost: has joined #ruby
[22:56:23] m3_del: has joined #ruby
[22:57:00] Ox0dea: dreinull75: Still about?
[22:57:21] dreinull75: Ox0dea kinda, doing the Javascript tour now
[22:57:47] dreinull75: I should really check out opal
[22:57:55] sanjayu: has joined #ruby
[22:58:03] failshell: has joined #ruby
[22:58:04] Ox0dea: dreinull75: Well, I decided to go all out on your crazy nil-monitoring idea: https://eval.in/458098
[22:59:42] ruurd: has joined #ruby
[23:00:22] dreinull75: Ox0dea: wow, I tried something similar via the initialize method but probably called super too late.
[23:00:50] rickmasta: has joined #ruby
[23:02:11] dreinull75: Ox0dea I'm going to study this tomorrow, I'm falling asleep. Thank you for looking into it.
[23:02:31] Ox0dea: dreinull75: Sure thing. I would actually advise you to forget all you witnessed here today.
[23:02:39] quazimodo: has joined #ruby
[23:02:55] andersoldahl: has joined #ruby
[23:03:02] dfinninger: has joined #ruby
[23:03:26] dreinull75: Ox0dea why? It solves a problem and I'm using this in a local environment only. So as long as I'm happy and it works I'm fine.
[23:03:49] Ox0dea: dreinull75: Fair enough, I guess.
[23:04:10] Ox0dea: I've gotta reboot; kernel upgrades break automount. :<
[23:05:29] Ox0dea: has joined #ruby
[23:05:31] htmldrum: has joined #ruby
[23:05:38] karapetyan: has joined #ruby
[23:06:07] nfk: has joined #ruby
[23:06:33] karapetyan: has joined #ruby
[23:06:52] charliesome: has joined #ruby
[23:07:03] bender_unit: has joined #ruby
[23:07:17] northfurr: has joined #ruby
[23:07:18] roxtrongo: has joined #ruby
[23:07:34] malconis: has joined #ruby
[23:08:50] bryanray: has joined #ruby
[23:09:03] h99h9h88: has joined #ruby
[23:09:03] yardenbar: has joined #ruby
[23:09:22] svkurowski: Which environment variable do i have to set s.t. Datetime#strftime outputs day and month names in another language than English? I tried LANG=de_DE.UTF-8 LC_ALL=de_DE.UTF-8 LANGUAGE=de_DE ./script.rb but it still outputs english names
[23:11:23] willharrison: has joined #ruby
[23:12:41] JammyHammy: has joined #ruby
[23:12:56] skinux: has joined #ruby
[23:13:27] failshell: has joined #ruby
[23:14:31] nateberkopec: has joined #ruby
[23:14:52] jwaldrip: has joined #ruby
[23:15:51] kristofferR: has joined #ruby
[23:17:18] bender_unit: has joined #ruby
[23:21:15] gambl0re: has joined #ruby
[23:22:28] skade: has joined #ruby
[23:23:07] TheHodge: has joined #ruby
[23:26:18] chipotle: has joined #ruby
[23:27:22] chipotle_: has joined #ruby
[23:28:51] weemsledeux: has joined #ruby
[23:31:42] CloCkWeRX: has joined #ruby
[23:33:01] alexdunne: has joined #ruby
[23:34:15] freerobby: has joined #ruby
[23:34:50] dopamean_: has joined #ruby
[23:35:02] skweek: has joined #ruby
[23:35:23] EminenceHC: has joined #ruby
[23:35:53] nateberkopec: has joined #ruby
[23:36:07] pontiki: has joined #ruby
[23:36:12] jwaldrip: has joined #ruby
[23:36:41] jgt1: has joined #ruby
[23:36:55] pandaant: has joined #ruby
[23:39:12] _aeris_: has joined #ruby
[23:39:53] shevy: yo snowtiki
[23:40:02] shevy: xmas is coming with more snow and a ruby release
[23:41:07] jgpawletko: has joined #ruby
[23:42:17] jani: has joined #ruby
[23:44:12] l_tonz: has joined #ruby
[23:44:27] l_tonz: has joined #ruby
[23:44:38] crime: what are we getting?
[23:46:31] shevy: preliminary frozen string support, at the least via some configure-compile option: https://github.com/ruby/ruby/blob/trunk/ChangeLog#L132
[23:46:53] crime: frozen as in immutable?
[23:47:12] crime: nvm, i'll read the thing
[23:47:16] shevy: I don't quite know with what to send to configure to for the next ruby version, I'll probably test frozen strings as early as possible so it will bite me as little as possible lateron
[23:47:51] shevy: I guess _ = '' will be similar to _ = ''.freeze
[23:49:57] jord: has joined #ruby
[23:50:40] fowl: has joined #ruby
[23:56:36] willharrison: has joined #ruby
[23:56:49] barhum2013: has joined #ruby
[23:57:12] m3_del: has joined #ruby
[23:57:16] nateberkopec: has joined #ruby
[23:57:54] iateadonut: has joined #ruby
[23:59:15] bruno-: has joined #ruby
[23:59:27] Xiti: has joined #ruby
[23:59:43] malconis: has joined #ruby