« Back to channel list

#ruby - 02 June 2018

« Back 1 day Forward 1 day »
[00:03:06] Autolycus: has joined #ruby
[00:05:20] jenrzzz: has joined #ruby
[00:07:25] dendazen: has joined #ruby
[00:08:22] c0ncealed1: has joined #ruby
[00:09:15] derp10327: has joined #ruby
[00:15:27] rfoust: has joined #ruby
[00:16:22] derp10327: has joined #ruby
[00:17:26] samosaphile: has joined #ruby
[00:23:30] orbyt_: has joined #ruby
[00:35:35] sanscoeur: has joined #ruby
[00:47:03] fmcgeough: has joined #ruby
[00:47:32] rfoust: has joined #ruby
[00:48:10] jready: has joined #ruby
[00:50:06] fmcgeough: has joined #ruby
[00:50:50] peterR``: has joined #ruby
[01:01:46] cmhobbs: has joined #ruby
[01:04:59] cmhobbs: hey folks! i'm banging my head against a problem. i've got an array of hashes like this: [{foo: 'bar', baz: 'qux'}, {foo: 'quux', baz: 'quuuux'}, ...] and i'd like to just turn that into an array of "tuples" [[key, value], [key, value], ...]
[01:05:14] cmhobbs: at the moment, i've tried foo.map { |element| element.to_a }
[01:05:38] cmhobbs: but that nests multiple arrays [[[key, value], ...], ...]]
[01:05:55] cmhobbs: and calling flatten outside the block just gives me a completely flat array (as expected...)
[01:06:01] havenwood: cmhobbs: flat_map(&:to_a)
[01:06:14] cmhobbs: is flat_map a railsism?
[01:06:17] havenwood: >> [{foo: 'bar', baz: 'qux'}, {foo: 'quux', baz: 'quuuux'}].flat_map(&:to_a)
[01:06:28] havenwood: cmhobbs: It's Ruby core.
[01:06:43] cmhobbs: thanks so much
[01:06:49] havenwood: cmhobbs: you're welcome
[01:07:26] cmhobbs: been doing this ruby stuff for 12 years and i haven't yet heard of #flat_map
[01:07:30] cmhobbs: learn something new everyday i guess
[01:07:43] havenwood: cmhobbs: Alternatively you can `map` then `flatten(1)`, but `flat_map` is better.
[01:07:57] cmhobbs: well, i was doing map and then flatten but i must've had things out of order
[01:08:01] cmhobbs: because i was getting weird nesting
[01:08:23] havenwood: cmhobbs: You'd need: flatten(1)
[01:08:28] havenwood: cmhobbs: Or you flatten too much.
[01:08:44] havenwood: >> [{foo: 'bar', baz: 'qux'}, {foo: 'quux', baz: 'quuuux'}].map(&:to_a).flatten(1)
[01:08:49] cmhobbs: one more stupid question. if i've got a hash that i can always assume (dangerous, yes) will only contain a single key, is there a better way to get only the value out of it than calling foo.keys.first?
[01:08:50] havenwood: #=> [[:foo, "bar"], [:baz, "qux"], [:foo, "quux"], [:baz, "quuuux"]]
[01:09:02] cmhobbs: what is this... flatten takes arguments?
[01:09:12] havenwood: cmhobbs: yerp
[01:09:14] cmhobbs: goodness, i need to read the core docs more closely
[01:09:43] havenwood: cmhobbs: Flat map is like map with flatten one level only.
[01:09:45] havenwood: Which is what you want here.
[01:10:29] havenwood: cmhobbs: Alternatively you could do: first.first
[01:10:37] cmhobbs: yeah, seems just as ham fisted
[01:10:44] cmhobbs: i know assuming there's only ever one key is dangerous, too
[01:10:52] cmhobbs: but in this case it'll never change. it's a one off with some data munging
[01:10:53] kmurphy4: has joined #ruby
[01:10:54] havenwood: cmhobbs: oh, you want the value?
[01:10:58] havenwood: do you know the key?
[01:11:01] cmhobbs: yeah, just the only value that'll be in there
[01:11:06] cmhobbs: i may not know the key, no
[01:11:29] cmhobbs: i just know that i'm getting a single hash each time in this iterator that looks like { foo: 'bar' } (where the value could be a different data structure)
[01:11:33] cmhobbs: all i want is the sole value
[01:11:38] cmhobbs: point is it'll only ever have one key and one value
[01:11:38] gizmore|2: has joined #ruby
[01:11:43] havenwood: cmhobbs: i guess you meant: foo.values.first
[01:11:52] cmhobbs: i just want the key
[01:11:54] cmhobbs: there's only ever one key
[01:11:59] cmhobbs: at the moment it's just foo.keys.first
[01:12:07] cmhobbs: but it seems ham fisted
[01:12:15] cmhobbs: but in this case, the input is more likely the problem
[01:12:16] havenwood: gotcha, haha - I got confused by "value of the key"
[01:12:21] havenwood: you want the key
[01:12:33] cmhobbs: i want the key and there's only ever one of them in this case
[01:12:46] havenwood: keys.first is best. there's a proposed #one method but it hasn't been accepted.
[01:12:56] havenwood: it's would also ensure there is indeed only one item
[01:12:58] cmhobbs: yeah, seems a little too specific
[01:12:59] cmhobbs: thanks for the input
[01:28:34] cmhobbs: has left #ruby: ("WeeChat 1.6")
[01:31:20] auv: has joined #ruby
[01:37:49] Dykam: has joined #ruby
[01:41:25] havenwood: They left, but fwiw here are benchmarks of keys, each_key, first and flatten: https://gist.github.com/havenwood/2cfe05dd66b9227706412535c32ed41b
[01:42:08] apparition: has joined #ruby
[01:42:09] havenwood: TruffleRuby with keys take the cake, with 42M IPS.
[01:42:21] havenwood: JRuby is runner up with 19M.
[01:43:04] havenwood: CRuby's best showing is also keys at 7M.
[01:44:05] havenwood: And Rubinius is odd man out, with first being fastest at 0.8M.
[01:50:25] jud: has joined #ruby
[02:01:45] karapetyan: has joined #ruby
[02:04:03] amar: has joined #ruby
[02:04:40] shinnya: has joined #ruby
[02:13:27] arekushi: has joined #ruby
[02:13:30] cschneid: has joined #ruby
[02:13:44] cschneid: has joined #ruby
[02:17:25] aakp: has joined #ruby
[02:17:40] aakp: has joined #ruby
[02:31:49] rkazak: has joined #ruby
[02:32:33] cadillac_: has joined #ruby
[02:34:10] sytherax: has joined #ruby
[02:38:36] headius: havenwood: I got 34M for JRuby
[02:40:37] headius: the benchmark also doesn't use any of the results and it's likely TR can statically "do nothing"
[02:40:57] havenwood: headius: oh, my mistake! Looking at the reported version, I accidentally ran it with graal.
[02:41:36] headius: havenwood: well that's fine, but throw -Xcompile.invokedynamic on there too
[02:42:05] havenwood: ah, graal actually does increase performance - i'll add invokedynamic and update the gist
[02:42:11] headius: the benchmark blocks are going to be the biggest cost here
[02:42:20] sytherax: has joined #ruby
[02:44:47] headius: I modified your bench to call keys.first five times and use the results, and JRuby gets 27M ips to TR's 8M
[02:45:23] headius: on graal with indy
[02:46:36] havenwood: headius: ahh, how interesting
[02:46:55] headius: TR is good at optimizing away unused work...we're getting there :-)
[02:47:00] havenwood: headius: thanks for the heads up! I'm getting 40M now with the original bench with graal and indy
[02:47:44] headius: I'll gist my changes and numbers in a sec
[02:49:12] headius: https://gist.github.com/headius/4982be842c5282d6de7e2d018c5cd262
[02:49:48] headius: TR still manages to eliminate most of the first.first one but the others it's being forced to do the work it seems
[02:50:21] headius: it's hard to benchmark an impl that eliminates useless work because it eliminates the benchmark
[02:51:56] aakp: has joined #ruby
[02:52:47] shinnya: has joined #ruby
[02:53:42] headius: havenwood: FWIW let me know what else you see with JRuby + indy + graal...for small benchmarks here that gives JRuby outstanding perf
[02:53:49] headius: mixed back for large apps though
[02:55:36] arekushi: has joined #ruby
[02:57:02] aakp: has joined #ruby
[03:00:10] cadillac_: has joined #ruby
[03:07:41] cschneid: has joined #ruby
[03:10:30] braincrash: has joined #ruby
[03:10:59] cschneid: has joined #ruby
[03:12:06] coderphi_: has joined #ruby
[03:13:56] eelster: has joined #ruby
[03:18:14] shinnya: has joined #ruby
[03:21:41] cschneid: has joined #ruby
[03:21:57] aakp: has joined #ruby
[03:23:02] ciscam: has joined #ruby
[03:25:20] shinnya: has joined #ruby
[03:26:32] emilford: has joined #ruby
[03:26:47] cschneid: has joined #ruby
[03:28:01] aakp: has joined #ruby
[03:33:18] bmurt: has joined #ruby
[03:33:31] emilford: has joined #ruby
[03:36:38] havenwood: headius: JRuby indy graal really is fast! Good stuff.
[03:37:00] p0p0pr37_: has joined #ruby
[03:37:02] havenwood: headius: JRuby indy graal wins nicely on the pure Ruby SipHash gem I cut this week: https://gist.github.com/havenwood/b526607da727b044b28ecca7c27589ef
[03:37:14] amar: has joined #ruby
[03:38:11] headius: oh yeah that's a perfect case for JRuby + Graal right now
[03:38:34] headius: given these exciting results we'll be working over the next few weeks to get stuff inlining that isn't currently...that should open up more doors
[03:39:02] havenwood: For an empty SipHash13 digest on my laptop: JRuby indy/graal 99K - TruffleRuby 68K - CRuby 59K - JRuby 56K
[03:39:32] headius: is that a gem I can install?
[03:39:43] havenwood: headius: yup: https://github.com/havenwood/digest-sip_hash
[03:39:50] headius: I'm curious about jruby indy hotspot now
[03:40:08] havenwood: headius: It's about 100 lines of Ruby: https://github.com/havenwood/digest-sip_hash/blob/master/lib/digest/sip_hash.rb
[03:41:47] headius: havenwood: you should also try -Xfixnum.cache=false
[03:42:07] headius: to blunt the cost of numerics, we cache -256..256 Fixnum objects
[03:42:19] headius: but on Graal that can get in the way of escape analysis, so it's usually faster to disable it
[03:42:38] headius: sometimes much faster
[03:42:56] havenwood: ah, interesting
[03:42:58] gix-: has joined #ruby
[03:43:19] emilford: has joined #ruby
[03:43:20] headius: we may detect graal in the future and only use it in the interpreter, or something
[03:46:33] headius: yeah seems to help some of them
[04:00:18] Dimik: has joined #ruby
[04:04:30] karapetyan: has joined #ruby
[04:05:56] phaul: has joined #ruby
[04:06:45] aakp: has joined #ruby
[04:09:08] pabs: has joined #ruby
[04:09:42] UncleCid__: has joined #ruby
[04:12:04] derp10327: has joined #ruby
[04:12:34] ciscam: has joined #ruby
[04:32:16] aakp: has joined #ruby
[04:35:03] alfiemax: has joined #ruby
[04:36:31] ogres: has joined #ruby
[04:46:51] sanscoeur: has joined #ruby
[04:55:59] russellx: has joined #ruby
[05:01:33] jnix: has joined #ruby
[05:02:36] ldepandis: has joined #ruby
[05:06:37] kmurphy4: has joined #ruby
[05:10:16] TinkerT: has joined #ruby
[05:12:05] aakp: has joined #ruby
[05:16:52] aakp: has joined #ruby
[05:26:52] nowhere_man: has joined #ruby
[05:34:57] armyriad: has joined #ruby
[05:36:18] p0p0pr37_: has joined #ruby
[05:36:18] p0p0pr37_: has joined #ruby
[05:36:59] amar: has joined #ruby
[05:40:58] sytherax: has joined #ruby
[05:44:34] tdy: has joined #ruby
[05:44:59] phaul: has joined #ruby
[05:45:09] reber: has joined #ruby
[05:48:52] alfiemax: has joined #ruby
[05:55:42] pabs: has joined #ruby
[06:02:48] sytherax: has joined #ruby
[06:06:07] karapetyan: has joined #ruby
[06:09:04] postmodern: has joined #ruby
[06:12:15] aakp: has joined #ruby
[06:15:42] sytherax: has joined #ruby
[06:21:42] Immune: has joined #ruby
[06:24:02] sytherax: has joined #ruby
[06:24:33] nowhere_man: has joined #ruby
[06:30:07] kapil___: has joined #ruby
[06:32:09] aakp: has joined #ruby
[06:36:34] aakp: has joined #ruby
[06:40:38] sytherax: has joined #ruby
[06:44:28] sytherax: has joined #ruby
[06:46:46] aakp: has joined #ruby
[06:49:33] sytherax: has joined #ruby
[06:49:49] TomyLobo: has joined #ruby
[06:50:28] rippa: has joined #ruby
[06:52:09] aakp: has joined #ruby
[06:54:13] trautwein: has joined #ruby
[06:59:41] alfiemax: has joined #ruby
[07:00:28] alfiemax: has joined #ruby
[07:01:01] nickjj_: has joined #ruby
[07:05:46] alfiemax: has joined #ruby
[07:11:39] emilford: has joined #ruby
[07:12:11] gigetoo: has joined #ruby
[07:18:16] ciscam: has joined #ruby
[07:20:34] sytherax: has joined #ruby
[07:23:17] mtkd: has joined #ruby
[07:28:52] KevinSjoberg: has joined #ruby
[07:29:22] sytherax: has joined #ruby
[07:32:15] p0p0pr37_: has joined #ruby
[07:32:15] p0p0pr37_: has joined #ruby
[07:36:26] emilford: has joined #ruby
[07:37:43] amar: has joined #ruby
[07:41:21] clemens3: has joined #ruby
[07:48:58] sytherax: has joined #ruby
[07:52:40] quobo: has joined #ruby
[07:55:19] duderonomy: has joined #ruby
[07:57:52] sytherax: has joined #ruby
[08:01:34] alfiemax: has joined #ruby
[08:03:39] sytherax: has joined #ruby
[08:07:33] karapetyan: has joined #ruby
[08:11:15] emilford: has joined #ruby
[08:22:08] schleppel: has joined #ruby
[08:22:56] bbobb: has joined #ruby
[08:24:11] phaul: has joined #ruby
[08:32:31] sytherax: has joined #ruby
[08:37:24] mikecmpbll: has joined #ruby
[08:38:28] amar: has joined #ruby
[08:39:41] amar: has joined #ruby
[08:41:01] emilford: has joined #ruby
[08:41:03] sytherax: has joined #ruby
[08:45:47] reber: has joined #ruby
[08:45:57] OS-35301: has joined #ruby
[08:46:43] amar: has joined #ruby
[08:49:50] ldepandis: has joined #ruby
[08:50:55] emilford: has joined #ruby
[08:51:28] phaul: has joined #ruby
[08:53:52] sytherax: has joined #ruby
[08:54:05] ldepandis: has joined #ruby
[08:56:41] apeiros: has joined #ruby
[08:58:29] jrm: has joined #ruby
[08:59:38] wget: has joined #ruby
[08:59:38] wget: has joined #ruby
[09:00:58] mtkd: has joined #ruby
[09:01:30] samosaphile: has joined #ruby
[09:05:45] emilford: has joined #ruby
[09:06:38] sytherax: has joined #ruby
[09:12:25] ams__: has joined #ruby
[09:12:29] wget: has joined #ruby
[09:21:38] bonhoeffer: has joined #ruby
[09:23:23] wget: has joined #ruby
[09:23:50] sytherax: has joined #ruby
[09:24:53] sytherax: has joined #ruby
[09:26:17] p0p0pr37_: has joined #ruby
[09:26:17] p0p0pr37_: has joined #ruby
[09:28:46] tomphp: has joined #ruby
[09:30:33] emilford: has joined #ruby
[09:31:26] ellcs: has joined #ruby
[09:40:32] emilford: has joined #ruby
[09:42:34] wget: has joined #ruby
[09:42:35] wget: has joined #ruby
[09:43:07] psychicist__: has joined #ruby
[09:47:09] psychicist__: has joined #ruby
[09:47:33] \void: has joined #ruby
[09:50:51] tAn: has joined #ruby
[09:51:39] tAn: has joined #ruby
[09:52:23] tAn: has joined #ruby
[09:53:31] tAn: has joined #ruby
[09:55:28] emilford: has joined #ruby
[10:02:10] vutral|kali: has joined #ruby
[10:02:26] vutral|kali: hello anyone here having strange results from mathematic expressions in ruby?
[10:03:01] apeiros: vutral|kali: that's a rather vague question, don't you think?
[10:03:26] vutral|kali: 64-32.2 = 31.799999999999997 instead of 31.8
[10:03:35] apeiros: ?float vutral|kali
[10:03:42] apeiros: ACTION pokes ruby[bot]
[10:04:05] apeiros: vutral|kali: Your numbers don't add up? You get "weird" results? read http://floating-point-gui.de/
[10:04:39] apeiros: in short: floats are not base10 but base2 and have finite space, they're therefore approximations which will not always match your base10 expectations.
[10:05:27] ruby[bot]: has joined #ruby
[10:05:27] ChanServ: +o ruby[bot]
[10:05:33] apeiros: ?float vutral|kali
[10:05:47] ruby[bot]: vutral|kali: Your numbers don't add up? You get "weird" results? read http://floating-point-gui.de/
[10:05:50] wget: has joined #ruby
[10:06:19] apeiros: >> sprintf "%.60f", 0.1 # you see, not even 0.1 is truly 0.1
[10:06:29] ruby[bot]: apeiros: # => "0.100000000000000005551115123125782702118158340454101562500000" (https://eval.in/1014117)
[10:07:10] vutral|kali: and how do i get the rounded results?
[10:07:19] apeiros: by rounding
[10:07:32] apeiros: or by using rational or bigdecimal
[10:08:03] apeiros: mind you, there are no silver bullets. you have to use solutions which match your requirements & context.
[10:09:23] karapetyan: has joined #ruby
[10:10:48] phaul: has joined #ruby
[10:15:15] emilford: has joined #ruby
[10:16:03] zapata: has joined #ruby
[10:25:16] emilford: has joined #ruby
[10:27:07] wget: has joined #ruby
[10:27:07] wget: has joined #ruby
[10:30:16] emilford: has joined #ruby
[10:30:25] Mike11: has joined #ruby
[10:33:10] alfiemax: has joined #ruby
[10:33:30] tAn: has joined #ruby
[10:35:04] coderphive: has joined #ruby
[10:40:04] emilford: has joined #ruby
[10:40:57] tomphp: has joined #ruby
[10:43:22] phaul: has joined #ruby
[10:47:09] sytherax: has joined #ruby
[10:48:30] sameerynho: has joined #ruby
[10:50:28] karapetyan: has joined #ruby
[10:51:09] za1b1tsu: has joined #ruby
[10:52:53] karapetyan: has joined #ruby
[10:56:23] karapetyan: has joined #ruby
[10:57:43] amar: has joined #ruby
[11:00:25] gigetoo: has joined #ruby
[11:00:56] sytherax: has joined #ruby
[11:04:18] alfiemax: has joined #ruby
[11:04:53] emilford: has joined #ruby
[11:05:11] d^sh: has joined #ruby
[11:08:07] sytherax: has joined #ruby
[11:08:25] wget: has joined #ruby
[11:13:06] AJA4350: has joined #ruby
[11:15:26] weird_error: has joined #ruby
[11:16:57] pabs: has joined #ruby
[11:16:59] wget: has joined #ruby
[11:17:03] alfiemax: has joined #ruby
[11:18:56] yqt: has joined #ruby
[11:19:39] sytherax: has joined #ruby
[11:24:11] ellcs: has joined #ruby
[11:28:45] wget: has joined #ruby
[11:29:48] tAn: has joined #ruby
[11:33:48] alfiemax: has joined #ruby
[11:34:22] mtkd: has joined #ruby
[11:36:06] icedragon: has joined #ruby
[11:36:26] phaul: has joined #ruby
[11:39:25] wget: has joined #ruby
[11:40:05] pabs: has joined #ruby
[11:41:11] emilford: has joined #ruby
[11:41:19] jhass|off: has joined #ruby
[11:41:57] alex``: has joined #ruby
[11:43:15] nettie: has joined #ruby
[11:44:20] balo_: has joined #ruby
[11:45:59] cschneid: has joined #ruby
[11:46:40] alfiemax: has joined #ruby
[11:46:42] Dbugger: has joined #ruby
[11:47:02] c0ncealed1: has joined #ruby
[11:50:21] pavelz: has joined #ruby
[11:55:11] biberu: has joined #ruby
[11:58:51] emilford: has joined #ruby
[12:01:56] wget: has joined #ruby
[12:02:27] alfiemax: has joined #ruby
[12:03:42] alfiemax_: has joined #ruby
[12:13:28] kmurphy4: has joined #ruby
[12:14:02] emilford: has joined #ruby
[12:14:46] banisterfiend: has joined #ruby
[12:18:50] cyberg: has joined #ruby
[12:20:27] venmx: has joined #ruby
[12:26:42] wget: has joined #ruby
[12:27:57] venmx: has joined #ruby
[12:36:21] emilford: has joined #ruby
[12:40:32] venmx: has joined #ruby
[12:48:15] coderphive: has joined #ruby
[12:48:57] pavelz: has joined #ruby
[12:49:59] gr33n7007h: has joined #ruby
[12:51:03] gigetoo: has joined #ruby
[12:51:24] bmn: has joined #ruby
[12:53:24] houhoulis: has joined #ruby
[12:54:26] houhoulis: has joined #ruby
[12:55:38] snapcase: has joined #ruby
[12:56:31] sytherax: has joined #ruby
[12:59:34] wget: has joined #ruby
[13:00:29] venmx: has joined #ruby
[13:05:53] jamesaxl: has joined #ruby
[13:07:06] wget: has joined #ruby
[13:07:35] karapetyan: has joined #ruby
[13:09:16] emilford: has joined #ruby
[13:10:28] karapetyan: has joined #ruby
[13:11:07] nowhere_man: has joined #ruby
[13:12:23] kapil___: has joined #ruby
[13:12:26] tAn: has joined #ruby
[13:19:26] sytherax: has joined #ruby
[13:20:21] phaul: has joined #ruby
[13:21:59] yqt: has joined #ruby
[13:23:11] wget: has joined #ruby
[13:27:01] TheBetrayer: has joined #ruby
[13:28:43] dendazen: has joined #ruby
[13:30:00] DLSteve: has joined #ruby
[13:32:12] wget: has joined #ruby
[13:39:46] DoubleMalt: has joined #ruby
[13:50:23] tAn: has joined #ruby
[13:53:30] emilford: has joined #ruby
[13:53:36] sagax: has joined #ruby
[13:53:53] fmcgeough: has joined #ruby
[13:56:42] nertzy: has joined #ruby
[13:57:00] alfiemax: has joined #ruby
[13:58:00] wget: has joined #ruby
[14:02:35] sytherax: has joined #ruby
[14:16:15] kmurphy4: has joined #ruby
[14:28:12] kmurphy4: has joined #ruby
[14:29:38] Esa_: has joined #ruby
[14:30:50] wget: has joined #ruby
[14:32:13] tAn: has joined #ruby
[14:34:20] cadillac_: has joined #ruby
[14:38:19] emilford: has joined #ruby
[14:40:28] cagomez: has joined #ruby
[14:44:36] Dbugger: has joined #ruby
[14:49:05] emilford: has joined #ruby
[14:49:54] plexigras: has joined #ruby
[14:50:44] wget: has joined #ruby
[14:50:44] wget: has joined #ruby
[14:52:06] bbobb: has joined #ruby
[14:53:06] orbyt_: has joined #ruby
[14:57:54] hph^: has joined #ruby
[14:58:35] amar_: has joined #ruby
[15:00:31] emilford: has joined #ruby
[15:03:50] tomphp: has joined #ruby
[15:05:07] fmcgeough: has joined #ruby
[15:12:31] TvL2386_: has joined #ruby
[15:13:22] cschneid: has joined #ruby
[15:20:25] dviola: has joined #ruby
[15:25:08] wget: has joined #ruby
[15:29:39] jrafanie: has joined #ruby
[15:30:10] tomphp: has joined #ruby
[15:30:40] cagomez: has joined #ruby
[15:33:08] ogres: has joined #ruby
[15:35:31] houhoulis: has joined #ruby
[15:35:32] dendazen: has joined #ruby
[15:37:51] jaequery: has joined #ruby
[15:40:08] Zaab1t: has joined #ruby
[15:42:41] tAn: has joined #ruby
[15:44:04] hph^: has joined #ruby
[15:44:14] cschneid: has joined #ruby
[15:44:29] hph^: has joined #ruby
[15:45:12] hph^: has joined #ruby
[15:45:25] User458764: has joined #ruby
[15:45:33] hph^: has joined #ruby
[15:45:40] quobo: has joined #ruby
[15:45:53] hph^: has joined #ruby
[15:46:13] hph^: has joined #ruby
[15:46:37] hph^: has joined #ruby
[15:47:54] User458764: Hi, in an argument based program how do you express a range, for example $ foo [--price between 10 20]
[15:49:27] apeiros: User458764: that's entirely up on you to decide :)
[15:49:50] apeiros: I'd probably go with `foo --price 10-20`
[15:49:57] User458764: apeiros I mean what is the best practice ;)
[15:50:07] apeiros: I doubt there's established practice
[15:50:31] User458764: does 10-20 is a string?
[15:50:43] apeiros: all command line arguments are strings
[15:51:16] User458764: apeiros thanks I will go on that
[15:52:15] elomatreb: That will break or at least be unwieldy if you allow negative values though
[15:52:32] User458764: elomatreb right
[15:52:44] apeiros: looks a bit ugly. that's all.
[15:52:52] elomatreb: IMO either space separate, or use ..
[15:52:57] apeiros: however, things like .. are less known outside programming
[15:53:21] apeiros: or two args. --min-price --max-price
[15:55:41] al2o3-cr: yeah, i'd go with --min-price --max-price
[15:59:53] User458764: apeiros i'd go with it too since I would like to express only --min-price or --max-price
[16:00:38] yokel: has joined #ruby
[16:00:39] elomatreb: Yeah, in that case this is definitely the correct choice
[16:01:46] Dimik: has joined #ruby
[16:04:52] tomphp: has joined #ruby
[16:15:00] wget: has joined #ruby
[16:17:58] tomphp: has joined #ruby
[16:19:36] houhoulis: has joined #ruby
[16:22:45] tomphp: has joined #ruby
[16:23:54] peterR``: has joined #ruby
[16:29:06] kapil___: has joined #ruby
[16:29:34] OMGBloopMonster: has joined #ruby
[16:32:17] amatas: has joined #ruby
[16:32:25] wget: has joined #ruby
[16:32:25] wget: has joined #ruby
[16:38:26] vikaton: has joined #ruby
[16:41:00] alex``: has joined #ruby
[16:41:47] alfiemax: has joined #ruby
[16:41:53] nowhere_man: has joined #ruby
[16:48:30] havenwood: User458764: This doesn't answer your question, but I think it's good practice to first check if your long option is on the GNU table of long options: https://www.gnu.org/prep/standards/html_node/Option-Table.html#Option-Table
[16:48:52] havenwood: User458764: (It isn't in this case, but those are nice to standardize on.)
[16:49:10] havenwood: User458764: I agree with mandatory --help and --version: https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html#index-CGI-programs_002c-standard-options-for
[16:50:10] havenwood: User458764: If the name of the command already denotes that it's price, i'd say: -a --max, -i --min
[16:50:30] havenwood: Or: -M --max, -m --min
[16:51:21] havenwood: User458764: If you're using OptionParser, I have a recent example of some interesting features: https://gist.github.com/havenwood/02123198a79447543a3ea053e7e592fd
[16:55:00] pabs: has joined #ruby
[16:58:17] tomphp: has joined #ruby
[17:01:57] wget: has joined #ruby
[17:01:57] wget: has joined #ruby
[17:19:52] p0p0pr37_: has joined #ruby
[17:36:02] rkazak: has joined #ruby
[17:36:46] ellcs: has joined #ruby
[17:39:19] wget: has joined #ruby
[17:41:43] emilford: has joined #ruby
[17:43:24] dviola: has joined #ruby
[17:47:11] wget: has joined #ruby
[17:47:11] wget: has joined #ruby
[17:52:59] emilford: has joined #ruby
[18:04:30] GinoMan: has joined #ruby
[18:06:48] sameerynho: has joined #ruby
[18:07:05] GinoMan: has joined #ruby
[18:09:44] bbobb: has joined #ruby
[18:12:32] tAn: has joined #ruby
[18:14:12] tomphp: has joined #ruby
[18:16:09] wget: has joined #ruby
[18:18:06] wilbert: has joined #ruby
[18:18:47] emilford: has joined #ruby
[18:25:44] biberu: has joined #ruby
[18:26:47] emilford: has joined #ruby
[18:34:46] emilford: has joined #ruby
[18:36:29] rkazak: has joined #ruby
[18:38:10] Azure|dc: has joined #ruby
[18:42:04] emilford: has joined #ruby
[18:49:21] emilford: has joined #ruby
[18:54:05] paul91: has joined #ruby
[18:54:21] banisterfiend: has joined #ruby
[18:57:07] emilford: has joined #ruby
[18:58:32] test123456789: has joined #ruby
[19:00:50] mtkd: has joined #ruby
[19:02:57] ellcs: has joined #ruby
[19:04:03] agent_white: has joined #ruby
[19:06:22] tomphp: has joined #ruby
[19:09:59] wget: has joined #ruby
[19:10:26] KnownSyntax_: has joined #ruby
[19:11:12] p0p0pr37_: has joined #ruby
[19:11:12] p0p0pr37_: has joined #ruby
[19:12:30] emilford: has joined #ruby
[19:13:01] Nightmare: has joined #ruby
[19:13:25] amatas: has joined #ruby
[19:13:37] jtperreault: has joined #ruby
[19:20:48] KnownSyntax: has joined #ruby
[19:23:09] tomphp: has joined #ruby
[19:24:58] wget: has joined #ruby
[19:27:03] banisterfiend: has joined #ruby
[19:27:52] emilford: has joined #ruby
[19:30:29] Vingador: has joined #ruby
[19:32:52] fmcgeough: has joined #ruby
[19:33:08] amar: has joined #ruby
[19:35:58] emilford: has joined #ruby
[19:37:45] wget: has joined #ruby
[19:41:53] alfiemax: has joined #ruby
[19:44:38] Yzguy: has joined #ruby
[19:48:13] wget: has joined #ruby
[19:50:55] paul91: has left #ruby: ()
[19:52:02] \void: has joined #ruby
[19:53:12] minimalism: has joined #ruby
[19:54:35] alfiemax: has joined #ruby
[19:55:01] emilford: has joined #ruby
[19:58:42] jready: has joined #ruby
[20:00:12] SCHAPiE: has joined #ruby
[20:00:20] tomphp: has joined #ruby
[20:01:39] banisterfiend: has joined #ruby
[20:03:40] emilford: has joined #ruby
[20:04:09] wilbert: has joined #ruby
[20:08:09] tdy: has joined #ruby
[20:09:41] VladGh: has joined #ruby
[20:11:06] emilford: has joined #ruby
[20:11:29] banisterfiend: has joined #ruby
[20:13:59] Vingador_: has joined #ruby
[20:14:50] alfiemax: has joined #ruby
[20:16:21] ur5us: has joined #ruby
[20:24:59] Vingador: has joined #ruby
[20:25:18] tomphp: has joined #ruby
[20:27:17] wget: has joined #ruby
[20:27:18] wget: has joined #ruby
[20:28:08] Yzguy: has joined #ruby
[20:28:14] alfiemax: has joined #ruby
[20:29:00] ldepandis: has joined #ruby
[20:40:51] alfiemax: has joined #ruby
[20:43:08] emilford: has joined #ruby
[20:45:17] banisterfiend: has joined #ruby
[20:45:36] tAn: has joined #ruby
[20:48:58] emilford: has joined #ruby
[20:52:12] gigetoo: has joined #ruby
[20:53:34] alfiemax: has joined #ruby
[20:57:47] tomphp: has joined #ruby
[20:59:11] emilford: has joined #ruby
[21:01:41] p0p0pr37_: has joined #ruby
[21:02:54] dinfuehr: has joined #ruby
[21:06:24] alfiemax: has joined #ruby
[21:06:42] mtkd: has joined #ruby
[21:09:49] desperek: has joined #ruby
[21:12:08] griffindy: has joined #ruby
[21:17:31] emilford: has joined #ruby
[21:18:06] banisterfiend: has joined #ruby
[21:20:27] sytherax: has joined #ruby
[21:22:55] wget: has joined #ruby
[21:28:15] Vingador_: has joined #ruby
[21:30:40] karapetyan: has joined #ruby
[21:31:06] tomphp: has joined #ruby
[21:37:59] ur5us: has joined #ruby
[21:38:48] emilford: has joined #ruby
[21:40:40] alfiemax: has joined #ruby
[21:47:18] emilford: has joined #ruby
[21:50:48] tAn: has joined #ruby
[21:57:50] alfiemax: has joined #ruby
[22:02:44] banisterfiend: has joined #ruby
[22:02:56] kspencer: in psych, is there a way to declare the root node or any node as a specific class and have ruby recognize that? I want the node to be an Array/sequence, everything I try doesn't seem to work, and I basically want a yaml->ruby conversion to output [] instead of nil
[22:03:17] emilford: has joined #ruby
[22:03:45] kspencer: I want to be able to Array.push into it, but so far no go on anything
[22:03:51] amar: has joined #ruby
[22:05:09] shinnya: has joined #ruby
[22:06:07] karapetyan: has joined #ruby
[22:07:10] wget: has joined #ruby
[22:09:02] GodFather: has joined #ruby
[22:10:48] KevinSjoberg: has joined #ruby
[22:14:56] emilford: has joined #ruby
[22:14:57] alfiemax: has joined #ruby
[22:27:23] emilford: has joined #ruby
[22:27:42] carbivore: has joined #ruby
[22:29:28] pabs: has joined #ruby
[22:31:53] alfiemax: has joined #ruby
[22:34:10] emilford: has joined #ruby
[22:35:35] wget: has joined #ruby
[22:39:18] karapetyan: has joined #ruby
[22:41:37] carbivore: has joined #ruby
[22:44:41] pabs: has joined #ruby
[22:44:42] alfiemax: has joined #ruby
[22:49:08] fffco: has joined #ruby
[22:49:18] emilford: has joined #ruby
[22:53:38] wget: has joined #ruby
[22:57:13] alfiemax: has joined #ruby
[22:59:26] emilford: has joined #ruby
[23:05:22] segy: has joined #ruby
[23:09:36] Vingador: has joined #ruby
[23:10:17] alfiemax: has joined #ruby
[23:13:21] emilford: has joined #ruby
[23:13:54] karapetyan: has joined #ruby
[23:14:13] apeiros: has joined #ruby
[23:18:41] Vingador: has joined #ruby
[23:22:14] bonhoeffer_win: has joined #ruby
[23:22:46] emilford: has joined #ruby
[23:23:27] griffindy: has joined #ruby
[23:24:54] ogres: has joined #ruby
[23:25:35] TomyLobo: has joined #ruby
[23:27:41] mn3m: has joined #ruby
[23:28:46] carbivore: has joined #ruby
[23:31:06] Vingador_: has joined #ruby
[23:31:30] emilford: has joined #ruby
[23:32:32] fmcgeough: has joined #ruby
[23:32:55] test007: has joined #ruby
[23:35:43] amar: has joined #ruby
[23:36:36] karapetyan: has joined #ruby
[23:37:08] orbyt_: has joined #ruby
[23:38:37] ur5us: has joined #ruby
[23:39:21] wget: has joined #ruby
[23:43:19] coderphive: has joined #ruby
[23:46:50] griffindy: has joined #ruby
[23:48:41] karapetyan: has joined #ruby
[23:48:53] alfiemax: has joined #ruby
[23:49:11] karapetyan: has joined #ruby
[23:49:22] emilford: has joined #ruby
[23:49:42] karapetyan: has joined #ruby