« Back to channel list

#ruby - 07 November 2015

« Back 1 day Forward 1 day »
[00:05:08] markfletcher: has left #ruby: ()
[00:06:23] ivanskie: has joined #ruby
[00:08:04] benlieb: has joined #ruby
[00:09:57] ja: has joined #ruby
[00:10:07] ja: has joined #ruby
[00:10:22] stannard: has joined #ruby
[00:10:50] rgrmatt: has joined #ruby
[00:10:59] charliesome: has joined #ruby
[00:11:38] dorei: has joined #ruby
[00:14:13] baweaver: has joined #ruby
[00:15:11] ebbflowgo: has joined #ruby
[00:15:28] roshanavand: has joined #ruby
[00:16:24] ivanskie: has joined #ruby
[00:17:29] casadei_: has joined #ruby
[00:18:28] to_json: has joined #ruby
[00:18:34] to_json: has joined #ruby
[00:20:20] kies^: has joined #ruby
[00:20:34] j3r0: has joined #ruby
[00:21:58] Arkon: has joined #ruby
[00:24:36] mostlybadfly: has joined #ruby
[00:24:46] Rollabunna: has joined #ruby
[00:25:13] roshanavand: has joined #ruby
[00:25:39] Rodya_: has joined #ruby
[00:25:59] craysiii: why does the ruby styleguide recommend the hashrocket syntax instead of the json style?
[00:26:07] lukaszes: has joined #ruby
[00:26:09] craysiii: https://github.com/styleguide/ruby
[00:27:09] millerti: has joined #ruby
[00:28:23] DLSteve: has joined #ruby
[00:29:13] Ox0dea: craysiii: https://github.com/bbatsov/ruby-style-guide has much more of a following.
[00:29:24] craysiii: yeah i just realized i should be reading that one
[00:29:59] radgeRayden: has joined #ruby
[00:30:22] jdawgaz: has joined #ruby
[00:32:30] shevy: dunno, it does not mention any reason
[00:32:38] Arkon: has joined #ruby
[00:33:25] shevy: keyword args are weird in that guide
[00:33:33] shevy: remove_member(user, true)
[00:33:38] shevy: remove_member user, skip_membership_check: true
[00:33:47] shevy: in the second case I also need to know the name
[00:33:54] Trynemjoel: has joined #ruby
[00:34:05] shevy: I opted to prefer using custom hashes or symbols as instructions
[00:35:23] _blizzy_: til ruby has lambdas
[00:37:44] Spami: has joined #ruby
[00:37:52] predator217: has joined #ruby
[00:37:53] Ohga: has joined #ruby
[00:38:11] ddv: has joined #ruby
[00:38:56] aadam21: has joined #ruby
[00:39:02] dankweed: has joined #ruby
[00:39:08] dankweed: does ruby come default with a gui?
[00:40:07] craysiii: yeah shevy that was odd
[00:40:25] craysiii: dankweed no, most people use a simple text editor like vim/emacs/sublimetext
[00:40:45] dankweed: i meant a gui library i know theres gems
[00:40:46] craysiii: you mean a gui library?
[00:40:51] dankweed: we have to do a project and it requires a gui
[00:40:52] craysiii: not worth your time
[00:40:59] dankweed: i didnt know if he wanted the default
[00:41:03] dankweed: if it even has one like java
[00:41:36] hwcd: has joined #ruby
[00:42:17] Ohga: I have this quickly written script that gathers so called Markov chains. There is something wrong with it, variable scope or something.. on L22,23 the "entry" updates from two spaces to space, some letter, but in the next block invokation it's back to two spaces.. http://pastie.org/10535014
[00:42:23] Ohga: what am I doing wrong?
[00:43:18] fgo: has joined #ruby
[00:43:19] swgillespie: has joined #ruby
[00:45:52] Ox0dea: dankweed: Ruby ships with Tcl/Tk bindings.
[00:45:57] willardg: has joined #ruby
[00:46:20] zenguy_pc: has joined #ruby
[00:46:39] dankweed: excuse my language but yeah thats gonna be a mess alright ;\
[00:48:24] craysiii: you could use C# winforms and IronRuby hehe.
[00:50:21] Ox0dea: You could use a browser.
[00:50:31] Ox0dea: >> Time.now.year # dankweed
[00:50:32] ruboto: Ox0dea # => 2015 (https://eval.in/464636)
[00:51:38] TomPeed: has joined #ruby
[00:51:39] rzsd: has joined #ruby
[00:53:01] craysiii: i really wish i could get shoes to work
[00:53:07] hxegon: has joined #ruby
[00:53:54] EminenceHC: has joined #ruby
[00:54:34] dEPy: has joined #ruby
[00:54:35] rzsd: If i do dt = Date.today then do dt.to_time.strftime('%I:%M%p'), i get "12:00AM" as expected. But i i do (Date.today).to_time.strftime('%I:%M%p') i get undefined method strftime. Why is this so ?
[00:55:08] jhass: rzsd: because you did require "time" in one but not in the other
[00:55:39] duckpupp1: has joined #ruby
[00:55:41] rzsd: @jhaas: sorry didnt get that. require "time" ?
[00:55:47] am55: has joined #ruby
[00:56:14] jas02: has joined #ruby
[00:56:27] rzsd: can you please explain ?
[00:56:35] sankaber: has joined #ruby
[00:56:46] jhass: mmh, looks like Time#strftime is actually in core
[00:57:00] jhass: >> (Date.today).to_time.strftime('%I:%M%p')
[00:57:01] ruboto: jhass # => uninitialized constant Date (NameError) ...check link for more (https://eval.in/464637)
[00:57:12] jhass: >> require "date"; (Date.today).to_time.strftime('%I:%M%p')
[00:57:13] ruboto: jhass # => "12:00AM" (https://eval.in/464638)
[00:57:21] jhass: well, your example doesn't reproduce
[00:57:35] jhass: besides that
[00:57:44] jhass: >> require "date"; Date.today.strftime('%I:%M%p')
[00:57:45] ruboto: jhass # => "12:00AM" (https://eval.in/464639)
[00:57:52] jhass: the to_time is entirely redundant
[00:57:53] rzsd: @jhass: im using ruby 2.1.2
[00:57:59] rzsd: 2.1.2p95
[00:58:11] jhass: you should update to at least .7
[00:58:25] rzsd: @jhass: is this a bug ?
[00:58:35] jhass: 21>> require "date"; Date.today.strftime('%I:%M%p') # but it's not relevant to your issue
[00:58:36] ruboto: jhass # => "12:00AM" (https://eval.in/464640)
[00:59:03] jhass: rzsd: 80% of all point releases are security fixes
[00:59:05] millerti: has joined #ruby
[01:02:21] rzsd: @jhass: I tried on ruby 2.2.0, and i have to require "date" else i get Date uninitialized constant Context::Date... error. After i require date, if i do Date.today.to_time.strftime('%I:%M%p') it works as expected
[01:02:25] hxegon_: has joined #ruby
[01:02:35] Feyn: has joined #ruby
[01:02:41] jhass: rzsd: yes, of course
[01:02:54] jhass: rzsd: the to_time is still entirely redundant
[01:03:05] rgrmatt: has joined #ruby
[01:03:07] daed: yeah i'm not following the to_time?
[01:03:50] rzsd: @jhass: ok, makes sense now
[01:06:49] Spami: has joined #ruby
[01:07:45] djellemah_: has joined #ruby
[01:08:08] BraddPitt: rzsd no need to preface usernames with @, irc will hilight the user when their full nick is mentioned
[01:10:23] rzsd: BraddPitt: got it, thanks :)
[01:11:12] Ox0dea: has joined #ruby
[01:11:23] ddv: has joined #ruby
[01:11:45] Ox0dea: BraddPitt: As long as it's on a word boundary, mind.
[01:12:03] tkuchiki: has joined #ruby
[01:13:01] infamos: has joined #ruby
[01:13:05] jdawgaz: has joined #ruby
[01:13:46] shevy: hmm we have .index and .rindex but do we also have a way to obtain the position of all indices of a given token? like: 'a b a b', seeking for a would return 1 3 (or 0 2 whatever)
[01:14:39] Ox0dea: > whatever
[01:14:43] Ox0dea: Dijkstra would like a word with you.
[01:15:12] baweaver: has joined #ruby
[01:15:25] EminenceHC: has joined #ruby
[01:16:10] tomphp: has joined #ruby
[01:16:47] bigmac: has joined #ruby
[01:17:09] Ox0dea: >> 'alabaster'.each_char.with_index.with_object([]) { |(c, i), a| a << i if c == ?a } # shevy
[01:17:10] ruboto: Ox0dea # => [0, 2, 4] (https://eval.in/464641)
[01:17:57] neanderslob: has joined #ruby
[01:18:04] Asher: has joined #ruby
[01:18:35] rgrmatt: has joined #ruby
[01:19:05] Ox0dea: What does that mean?
[01:19:49] shevy: it does not feel right
[01:19:52] low-prof1: has joined #ruby
[01:19:59] diegoaguilar: has joined #ruby
[01:20:01] Ox0dea: It's pefect.
[01:20:02] shevy: I also just noticed that you used ?a
[01:20:02] rabbithole: has joined #ruby
[01:20:23] shevy: I am wondering what would happen if I make a suggestion to add .indices
[01:20:29] Ox0dea: You will lose.
[01:20:52] shevy: I think you are right
[01:20:55] ruboto: Why don't you try it and see for yourself?
[01:21:05] shevy: we need to get hanmac to make the suggestion
[01:21:18] sp4rrow: has joined #ruby
[01:21:33] blackmesa: has joined #ruby
[01:21:49] passcod: has joined #ruby
[01:23:07] SenpaiSilver: has joined #ruby
[01:24:05] neanderslob: has joined #ruby
[01:27:28] inteq: has joined #ruby
[01:28:08] krz: has joined #ruby
[01:28:46] sshuff|gone: has joined #ruby
[01:30:29] rgrmatt: has joined #ruby
[01:30:33] Trynemjoel: has joined #ruby
[01:30:44] rickmasta: has joined #ruby
[01:31:10] Ox0dea: shevy: I went too far. `PILE OF POO * 2` does The Right Thing now.
[01:32:26] ddv: has joined #ruby
[01:34:59] neanderslob: has joined #ruby
[01:35:10] A124: has joined #ruby
[01:35:18] fedexo: has joined #ruby
[01:35:27] ekinmur: has joined #ruby
[01:37:04] mattwildig: has joined #ruby
[01:37:11] rgrmatt: has joined #ruby
[01:40:30] aadam21: has joined #ruby
[01:40:36] shock_one: has joined #ruby
[01:41:03] NeverDie_: has joined #ruby
[01:42:26] s00pcan: has joined #ruby
[01:44:29] NeverDie: has joined #ruby
[01:44:30] Ox0dea: >> include
[01:44:31] ruboto: Ox0dea # => Object (https://eval.in/464645)
[01:45:18] Feyn: has joined #ruby
[01:46:03] fgo: has joined #ruby
[01:46:38] solocshaw: has joined #ruby
[01:47:07] giuseppesolinas: has joined #ruby
[01:47:33] Arkon: Hello, it is a little bit about chef also: in a recipe I am doing citadel(bucket). How come I can do this (working fine) and I am not doing Citadel.new(bucket) instead ?
[01:48:18] Arkon: there is no Citadel.new() anywhere. Is it possible to create an object without calling the constructor ?
[01:48:33] Arkon: I am probably just missing it actually
[01:48:38] to_json: has joined #ruby
[01:48:38] to_json: has joined #ruby
[01:49:02] Ox0dea: Arkon: You are (thankfully); Follow the trail provided by `method(:citadel).source_location`.
[01:49:50] Arkon: Oh nice thanks Im trying
[01:50:37] jas02: has joined #ruby
[01:52:46] Pupeno: has joined #ruby
[01:53:04] NeverDie: has joined #ruby
[01:54:53] rgrmatt: has joined #ruby
[01:57:41] duckpupp1: has joined #ruby
[01:58:28] braincrash: has joined #ruby
[01:59:02] rbennacer: has joined #ruby
[01:59:06] hxegon: has joined #ruby
[01:59:25] build22_: has joined #ruby
[01:59:47] Xiti: has joined #ruby
[02:00:06] DLSteve: has joined #ruby
[02:03:41] bruno-: has joined #ruby
[02:04:24] Arkon: has joined #ruby
[02:11:06] goodcodeguy: has joined #ruby
[02:13:30] passcod: has joined #ruby
[02:14:55] Arkon: has joined #ruby
[02:16:00] rgrmatt: has joined #ruby
[02:17:18] sp3: has joined #ruby
[02:19:59] sdothum: has joined #ruby
[02:20:02] pwnd_nsfw: has joined #ruby
[02:21:01] devoldmx: has joined #ruby
[02:22:13] Mo: has joined #ruby
[02:22:32] sankaber: has joined #ruby
[02:25:38] Rollabunna: has joined #ruby
[02:30:27] fedexo: has joined #ruby
[02:34:33] RobertBirnie: has joined #ruby
[02:35:13] RobertBirnie: has joined #ruby
[02:37:53] Rodya_: has joined #ruby
[02:38:23] diegoaguilar: has joined #ruby
[02:39:14] saddad: has joined #ruby
[02:41:24] leafybas_: has joined #ruby
[02:41:27] gambl0re: has joined #ruby
[02:41:56] RegulationD: has joined #ruby
[02:42:13] aadam21: has joined #ruby
[02:42:44] hxegon_: has joined #ruby
[02:44:13] Rollabunna: has joined #ruby
[02:44:52] abucha: has joined #ruby
[02:45:41] neanderslob: has joined #ruby
[02:46:25] Ohga: has left #ruby: ()
[02:47:19] fgo: has joined #ruby
[02:47:37] arescorpio: has joined #ruby
[02:47:50] wildlander: has joined #ruby
[02:52:17] neanderslob: has joined #ruby
[02:58:24] duckpupp1: has joined #ruby
[02:58:27] swgillespie: has joined #ruby
[02:59:17] lele: has joined #ruby
[03:00:48] build22_: has joined #ruby
[03:02:08] rustyk: has joined #ruby
[03:02:17] rustyk: has left #ruby: ()
[03:02:46] rustyk: has joined #ruby
[03:02:59] rustyk: has left #ruby: ()
[03:04:10] Fire-Dragon-DoL: In case ruby process is run without TTY, will it have a nil $stdout ?
[03:04:37] Fire-Dragon-DoL: and since I'm there, should I use $stdout or STDOUT :S
[03:04:48] rabbithole: has joined #ruby
[03:04:55] bruno-: has joined #ruby
[03:06:00] neanderslob: has joined #ruby
[03:07:01] baweaver: has joined #ruby
[03:07:13] Ox0dea: $ ruby -e 'warn $stdout.tty?' > /dev/null
[03:07:35] Ox0dea: Fire-Dragon-DoL: STDOUT is a constant and should thus not be changed by anybody; utilize that information to decide which to use.
[03:08:04] s00pcan: has joined #ruby
[03:08:33] abucha: has joined #ruby
[03:10:56] Fire-Dragon-DoL: Ox0dea: ok thanks, performing a few tests if you send process in background and leave console, or run it with monit
[03:11:09] Fire-Dragon-DoL: I don't want a puts crash the entire system :P
[03:11:41] Ox0dea: Fire-Dragon-DoL: As demonstrated, $stdout is still an IO if the controlling process has had its output redirected.
[03:11:56] Ox0dea: `nil` does not respond to #tty?.
[03:13:29] CloCkWeRX: has joined #ruby
[03:13:42] Fire-Dragon-DoL: Ox0dea: mh if I run the command without redirecting (to dev null) and send it in background, then leave (exit and exit from ssh) and come back, in theory that process is not redirected and without a pty, I'm testing if in that case $stdout is still there
[03:13:58] abucha: has joined #ruby
[03:15:05] jas02: has joined #ruby
[03:16:09] Ox0dea: Fire-Dragon-DoL: It will be; it certainly won't be `nil`, at any rate.
[03:16:53] Fire-Dragon-DoL: Ox0dea: ok good, thanks for the exaustive explaination. Just for safety I added an if $stdout && $stdout.tty? and a rescue nil near the puts (it's only one or a bootstrap script)
[03:17:16] Ox0dea: Fire-Dragon-DoL: Defensive programming never hurt anybody, I guess.
[03:17:53] Ox0dea: Be advised that that'd be `$stdout&.tty?` if you were on trunk. :P
[03:22:38] wprice: has joined #ruby
[03:24:57] s00pcan: has joined #ruby
[03:27:09] neanderslob: has joined #ruby
[03:27:43] chouhoulis: has joined #ruby
[03:30:04] to_json1: has joined #ruby
[03:30:12] tulak: has joined #ruby
[03:31:19] tokik: has joined #ruby
[03:33:04] Fire-Dragon-DoL: Ox0dea: wasn't that going to be `$stdout.?tty?`
[03:33:13] Ox0dea: Fire-Dragon-DoL: It was.
[03:33:21] Fire-Dragon-DoL: oh they changed it again, lol
[03:33:44] Fire-Dragon-DoL: I MIGHT stick with `try` for the moment
[03:33:45] s00pcan: has joined #ruby
[03:35:30] sdothum: has joined #ruby
[03:36:36] goodcodeguy: has joined #ruby
[03:36:37] zenguy_pc: has joined #ruby
[03:38:16] neanderslob: has joined #ruby
[03:39:40] freerobby: has joined #ruby
[03:40:52] tubuliferous_: has joined #ruby
[03:41:27] peppers: has joined #ruby
[03:42:30] tubuliferous_: has joined #ruby
[03:43:51] tectonic: has joined #ruby
[03:44:17] aadam21: has joined #ruby
[03:44:30] charliesome: has joined #ruby
[03:46:21] Arkon: has joined #ruby
[03:48:26] JDiPierro: has joined #ruby
[03:48:37] i: has joined #ruby
[03:48:41] fgo: has joined #ruby
[03:50:33] Channel6: has joined #ruby
[03:52:17] abucha: has joined #ruby
[03:52:57] Pupeno: has joined #ruby
[03:54:19] jdawgaz: has joined #ruby
[03:55:17] kp666_: has joined #ruby
[03:59:07] duckpupp1: has joined #ruby
[03:59:16] pu22l3r: has joined #ruby
[04:00:55] Musashi007: has joined #ruby
[04:02:03] asianMike: has joined #ruby
[04:03:18] build22_: has joined #ruby
[04:03:27] shevy: IceDragon, your old nemesis is back again... Fire-Dragon-DoL
[04:03:40] odigity: So class Object is an instance of class Class, which is a subclass of Object? OWW! (sorry, just snapped a synapse)
[04:03:44] icedragon: ACTION throws water
[04:03:48] linoge: has joined #ruby
[04:03:48] Fire-Dragon-DoL: IceDragon: I'm back!!!
[04:04:01] icedragon: D8< My arch nemesis, we meet again!
[04:04:05] Fire-Dragon-DoL: wait, that's not fair, aren't you made of Ice? Water is too bad :P
[04:04:10] Ox0dea: > The dragon has three heads.
[04:04:12] Ox0dea: It is known.
[04:04:13] icedragon: ACTION says that from 200 yards away
[04:04:22] icedragon: D8< I'll get you
[04:04:26] icedragon: ACTION backs away
[04:04:37] icedragon: Just you watch!
[04:04:40] icedragon: ACTION runs off screaming
[04:04:58] Musashi007: Guys, what exactly is the ???:??? in # Braintree::Configuration.environment = :sandbox doing?
[04:05:03] Fire-Dragon-DoL: ACTION watches IceDragon with some concern
[04:05:03] linoge: ACTION sits and starts to eat popcorns
[04:05:20] linoge: Musashi007, :? That's a symbol
[04:05:21] shevy: odigity everything is an object!
[04:05:27] Ox0dea: >> >> [Class.is_a?(Module), Class.is_a?(Object), Module.is_a?(Class), Module.is_a?(Object), Object.is_a?(Class), Object.is_a?(Module)].all? # odigity
[04:05:28] ruboto: Ox0dea # => /tmp/execpad-e747df11e2a6/source-e747df11e2a6:2: syntax error, unexpected >> ...check link for more (https://eval.in/464660)
[04:05:29] shevy: so all classes are objects!
[04:05:34] Ox0dea: >> [Class.is_a?(Module), Class.is_a?(Object), Module.is_a?(Class), Module.is_a?(Object), Object.is_a?(Class), Object.is_a?(Module)].all? # odigity
[04:05:35] ruboto: Ox0dea # => true (https://eval.in/464661)
[04:05:46] icedragon: ACTION trips over a ruby and lands in a python pit
[04:05:57] shevy: R.I.P. IceDragon
[04:06:09] Musashi007: symbol means an immutable object?
[04:06:20] shevy: a symbol will have the same object id
[04:06:50] bruno-: has joined #ruby
[04:06:51] Ox0dea: >> [:foo.object_id == :foo.object_id, "foo".object_id == "foo".object_id] # Musashi007
[04:06:52] ruboto: Ox0dea # => [true, false] (https://eval.in/464662)
[04:06:53] Musashi007: kk reading. ty
[04:06:56] icedragon: everything is an object, the bootstrap trio is a mystery (Class, Module, Object)
[04:07:23] shevy: Musashi007 in your code example, you simply call a method called "environment", and pass a symbol as value to it
[04:07:31] shevy: erm, "environment="
[04:07:37] Ox0dea: IceDragon: Do you know that's some of the oldest code in Ruby?
[04:07:41] willardg: has joined #ruby
[04:07:44] baweaver: has joined #ruby
[04:07:52] Fire-Dragon-DoL: IceDragon: you definitely won the prize for being the most humorous today
[04:08:13] icedragon: ???(?????????)??????
[04:08:29] icedragon: 0x0dea: Nope, care to share? Is it riddled with globals?
[04:08:36] shevy: the fire dragon acknowledged that the ice dragon is superior
[04:08:40] icedragon: and weird arcane syntax
[04:08:41] Musashi007: so I???m passing sandbox to the method environment? if I wanted to change that as a configuration variable, could I just go: Braintree::Configuration.environment = ENV['BRAINTREE_ENVIRONMENT']
[04:08:46] icedragon: (??? ????????????????)???
[04:08:55] Ox0dea: IceDragon: I just meant that matz knew what he wanted from day one.
[04:09:10] Fire-Dragon-DoL: IceDragon: what are you doing CRAZY man, you don't want to know what's inside OLDES RUBY, it's ancient, is secret, it's a pit of PYTHONS!
[04:09:12] jas02: has joined #ruby
[04:09:28] icedragon: 0x0dea: That... is impressive in many ways :O
[04:09:32] rgrmatt: has joined #ruby
[04:09:36] shevy: Musashi007 if the method and code that was written by whoever wrote that braintree thing, then sure. it all depends on how it is written. if the author did not like flexibility then perhaps you are required to pass symbols
[04:09:40] icedragon: To withstand the test of time
[04:09:50] shevy: note that ENV['FOO'] will be a string though
[04:09:51] Fire-Dragon-DoL: Musashi007: for safety, do ENV['BRAINTREE_ENVIRONMENT'].to_sym
[04:10:05] Ox0dea: IceDragon: BasicObject threw a slight spanner into the works, but Ruby's object model is still remarkably consistent.
[04:10:07] linoge: shevy, he could use .to_sym right?
[04:10:18] Ox0dea: linoge: Or #intern.
[04:10:32] Ox0dea: Fire-Dragon-DoL: An alias for #to_sym.
[04:10:36] shevy: ENV variables used to break my code when I was a newbie
[04:10:48] shevy: since then I have learned to radically distrust ENV!
[04:10:54] Fire-Dragon-DoL: ENV variables still manage to break code when they don't like you
[04:11:13] neanderslob: has joined #ruby
[04:11:35] shevy: ruby objects live in a dirty environment
[04:11:38] icedragon: shevy: I pull ENV values early and keep them in my code, the last thing you want to see is ENV['API_PASSWORD'] riddled all our your code
[04:11:43] braincrash: has joined #ruby
[04:11:59] icedragon: 0x0dea: BasicObject always bothered me
[04:12:00] shevy: I usually handle them very early before defining any method
[04:12:07] icedragon: It just came out of nowhere for me
[04:12:19] Musashi007: @Fire-Dragon-DoL thank you #shevy
[04:12:26] shevy: I think BasicObject was added after _why wrote his sandboxed irb
[04:12:33] Ox0dea: IceDragon: Jim Weirich created BlankSlate.
[04:12:33] icedragon: ACTION posts that on twitter
[04:12:42] Ox0dea: It was so good that it got put into core as BasicObject.
[04:12:55] shevy: I asked _why for the code for the sandbox back then and he said it's too ugly, he does not want to share it :(
[04:12:59] icedragon: So I need to make something awesom that will be included in ruby as well
[04:13:05] icedragon: and conrete my name in ruby history!
[04:13:17] shevy: you must do it like hanmac
[04:13:29] icedragon: then its hopeless
[04:13:33] icedragon: ACTION returns to his cave
[04:13:34] shevy: https://github.com/ruby/ruby/blob/trunk/ChangeLog#L8034
[04:13:43] shevy: https://github.com/ruby/ruby/blob/trunk/ChangeLog#L88
[04:13:51] s00pcan: has joined #ruby
[04:13:53] shevy: he is slowly taking over ruby
[04:14:05] shevy: Ox0dea on the other hand can't get any suggestion into core
[04:14:16] Ox0dea: shevy: But I am in the ChangeLog twice?
[04:14:22] Ox0dea: For stupid things, mind.
[04:14:52] shevy: we still have 2 months left in 2015
[04:14:55] infamos: has joined #ruby
[04:15:05] Ox0dea: They'll close the merge window soon.
[04:15:19] Ox0dea: #grep-like #any? and friends aren't going to make it. :<
[04:15:26] Ox0dea: (I hate that.)
[04:15:32] abucha: has joined #ruby
[04:16:23] gix: has joined #ruby
[04:17:53] icedragon: 0x0dea, shevy: I'd like a F***ing core Boolean module right about now
[04:18:06] icedragon: HUH RUBY TEAM, GIVE ME BOOLEAN SO I CAN STOP HACKING IT IN EVERY SINGLE PROJECT!
[04:18:15] icedragon: (??? `????)??? ~?????????
[04:18:28] Ox0dea: Use Ruby's truthiness semantics to your advantage, silly.
[04:18:40] minimalism: has joined #ruby
[04:19:00] icedragon: 0x0dea: I do, its just that one odd case where you want to check if something is a "Boolean" a literal true or false for data validation
[04:19:08] baweaver: has joined #ruby
[04:19:19] icedragon: You know like how we have Numeric
[04:19:28] icedragon: for Float, Integer, Bignum, the whole family
[04:19:31] charliesome: has joined #ruby
[04:19:51] neanderslob: has joined #ruby
[04:20:00] icedragon: Its not even Integer, its Fixnum orz
[04:20:03] icedragon: see my point
[04:20:25] devoldmx: has joined #ruby
[04:20:31] blubjr: why did ruby take fixnum and bignum and not flonum
[04:21:21] c_nick: has joined #ruby
[04:21:33] safe: has joined #ruby
[04:21:57] The_Phoenix: has joined #ruby
[04:22:19] braincra-: has joined #ruby
[04:23:28] Ox0dea: IceDragon: I do confess to having reached for Boolean a time or two, and you're right that its absence is slightly anomalous.
[04:23:44] Ox0dea: For what it's worth, Integer is a thing; it's the superclass of Fixnum and Bignum.
[04:24:08] leafybas_: has joined #ruby
[04:24:13] icedragon: So let us, #ruby COME TOGETHER AND DEMAND A BOOLEAN CLASS/MODULE!
[04:24:36] icedragon: yeah you can just include it into TrueClass FalseClass
[04:25:48] astrobunny: has joined #ruby
[04:26:18] Ox0dea: Pretty sure TrueClass and FalseClass should just be subclasses of Boolean.
[04:27:36] icedragon: 0x0dea: see, when you can't change core class structure, you settle for the next best
[04:27:38] Musashi007: .to_sym didn???t resolve it.. do you guys see anything wrong with : https://gist.github.com/skuhn/a14eb0fb656e26afefc1
[04:27:58] Ox0dea: But you can change it?
[04:28:22] icedragon: Musashi007, try ENV.fetch('RACK_ENV', :development).to_sym ?
[04:28:46] icedragon: Symbols will just return themselves when to_sym is called
[04:31:04] Musashi007: wait you???re suggesting i replace environment = ENV['RACK_ENV'] || 'development' with that?
[04:33:16] icedragon: @Musashi007 Yup
[04:34:56] Musashi007: i dont??? gegt how that would set environment, however.
[04:35:59] solocshaw: has joined #ruby
[04:36:13] Ox0dea: IceDragon: https://eval.in/464670
[04:36:20] Ox0dea: Yay, Ruby! <3
[04:36:28] Ox0dea: Kinda scary, though.
[04:36:39] icedragon: ACTION points
[04:36:45] rabbitho1e: has joined #ruby
[04:37:32] icedragon: 0x0dea: very clever, I never got into dl/fiddle apart from simple win32 bindings
[04:37:37] Musashi007: I???m a little worried about how I???m using symbols - It used to be set like this: # Braintree::Configuration.environment = :production . I then set an environment var to be ???production???. and changed it to Braintree::Configuration.environment = ENV['BRAINTREE_ENVIRONMENT'].to_sym
[04:38:11] Ox0dea: IceDragon: Poking raw memory is fun.
[04:38:16] Ox0dea: Thanks, QBasic.
[04:38:37] icedragon: 0x0dea: until you poke the wrong address and everything goes up in black with a kernel panic
[04:39:04] Ox0dea: Relevant: https://eval.in/464671
[04:39:07] devbug: has joined #ruby
[04:40:09] Ox0dea: I wonder why the segfault happens at the very hand of the process's address space, though.
[04:40:14] Ox0dea: *very end
[04:41:03] kies^: has joined #ruby
[04:42:39] darkf: has joined #ruby
[04:43:43] s00pcan: has joined #ruby
[04:44:36] nibbo: has joined #ruby
[04:44:48] A124: has joined #ruby
[04:45:07] aadam21: has joined #ruby
[04:46:40] Arkon_: has joined #ruby
[04:48:37] blackmesa: has joined #ruby
[04:48:50] cmoney: has joined #ruby
[04:49:01] CloCkWeRX: has joined #ruby
[04:49:32] fgo: has joined #ruby
[04:50:01] CloCkWeRX: has left #ruby: ()
[04:53:14] atomical: has joined #ruby
[04:53:18] solocshaw: has joined #ruby
[04:54:10] jhack: has joined #ruby
[04:55:05] mattwildig: has joined #ruby
[04:59:52] duckpupp1: has joined #ruby
[05:01:31] shevy: IceDragon yeah even crystal has a boolen value
[05:02:06] shevy: Musashi007 you invest too much time into thinking about symbols. focus on what you want to do, and why
[05:03:23] jas02: has joined #ruby
[05:03:27] shevy: in your case, if an environment variable called BRAINTREE_ENVIRONMENT exists, it's string value will be queried, then turned into a symbol
[05:03:42] shevy: so if BRAINTREE_ENVIRONMENT is foo
[05:03:46] shevy: the above code will evaluate to:
[05:03:53] shevy: Braintree::Configuration.environment = :foo
[05:04:01] build22_: has joined #ruby
[05:04:24] shevy: if the variable does not exist
[05:04:27] shevy: then things will fail
[05:04:30] shevy: >> nil.to_sym
[05:04:31] ruboto: shevy # => undefined method `to_sym' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/464672)
[05:04:43] Musashi007: I don???t know what I don???t know.. so it???s a struggle.
[05:05:10] aadam21: has joined #ruby
[05:05:53] NeverDie: has joined #ruby
[05:06:24] shevy: yeah, you are thinking that symbols are cool
[05:06:26] shevy: but they are boring
[05:07:04] Musashi007: Not that they are cool, that it is the reason I am getting this error
[05:07:29] bruno-: has joined #ruby
[05:08:21] Musashi007: I think I got it. @IceDragon was correct that it needed .to_sym I think
[05:08:36] shevy: you are not even assigning
[05:08:36] icedragon: =w= see, IceDragon is right
[05:08:55] icedragon: shevy, D: even Crystal has Boolean!?
[05:09:10] icedragon: ;-; come on, someone get ruby team to squeeze Boolean in
[05:09:18] shevy: yeah https://github.com/manastech/crystal/blob/master/src/bool.cr
[05:09:24] icedragon: I don't want to hack anymore
[05:09:41] c_nick: array_1 =[] array_2=[] hash.each {|element| array_1 << element{:name] array_2 << element{:age}} Is there a better way to do this
[05:10:11] shevy: jhass is active https://github.com/manastech/crystal/commit/f9ba36be81ed917bc1582740c4e62b15a9cc9899
[05:11:43] Ox0dea: has joined #ruby
[05:13:27] Ox0dea: c_nick: https://eval.in/464680
[05:13:33] Ox0dea: Didn't we learn #transpose yesterday?
[05:14:13] Ox0dea: Never mind; it was #group_by.
[05:16:18] shock_one: has joined #ruby
[05:18:06] yfeldblum: has joined #ruby
[05:19:27] kies^: has joined #ruby
[05:20:31] dayepa: has joined #ruby
[05:20:34] vigintas1: has joined #ruby
[05:23:47] Arkon: has joined #ruby
[05:24:25] NeverDie_: has joined #ruby
[05:24:59] leafybas_: has joined #ruby
[05:26:03] astrobunny: has joined #ruby
[05:26:14] c_nick: Ox0dea: yes, We did learn Transpose with MAP, but what i was confused was splitting different key values into arrays
[05:26:24] c_nick: I Will check your solution thank you .. i was afk
[05:28:07] Ox0dea: c_nick: Ah, fair enough. The method you wanted was #values_at, but you could just as well say `[h[:name], h[:age]]`. The latter is a little "noisy", though.
[05:28:25] Melpaws: has joined #ruby
[05:28:38] eboaz: has joined #ruby
[05:29:52] swgillespie: has joined #ruby
[05:30:27] astrobunny: has joined #ruby
[05:31:12] tulak: has joined #ruby
[05:34:41] c_nick: Ox0dea: ok :)
[05:37:43] BTRE: has joined #ruby
[05:38:09] Fire-Dragon-DoL: good night everyone
[05:38:20] blubjr: bye fire dragon
[05:40:01] baweaver: has joined #ruby
[05:40:21] arup_r: has joined #ruby
[05:44:31] mary5030: has joined #ruby
[05:45:33] kies^: has joined #ruby
[05:45:59] c_nick: has left #ruby: ()
[05:46:18] infamos: has joined #ruby
[05:48:00] zenguy_pc: has joined #ruby
[05:48:12] TheNet: has joined #ruby
[05:49:12] blackmesa: has joined #ruby
[05:50:24] dopie: has joined #ruby
[05:50:40] fgo: has joined #ruby
[05:54:12] RobertBirnie: has joined #ruby
[05:54:40] charliesome: has joined #ruby
[06:00:38] duckpupp1: has joined #ruby
[06:04:44] InternetFriend: has joined #ruby
[06:04:50] musou: has joined #ruby
[06:04:52] build22_: has joined #ruby
[06:06:03] radgeRayden_: has joined #ruby
[06:06:41] gizmore: has joined #ruby
[06:08:13] bruno-: has joined #ruby
[06:09:52] hightower: has joined #ruby
[06:10:21] mattwashere: has joined #ruby
[06:10:31] hightower: Hey, what's a convenient way to parse lines in a file and store captured match ($1) of all lines that matched into an array?
[06:11:12] rgrmatt: has joined #ruby
[06:12:28] rabbithole: has joined #ruby
[06:13:39] al2o3-cr: hightower: File.readlines(file).select { |line| line.match /regexp/ }
[06:13:41] JDeen: has joined #ruby
[06:14:43] hightower: al2o3-cr, right, but that only performs selection, not automatic mapping of the results to $1 of each match
[06:15:33] Ox0dea: al2o3-cr: Why do you hate #grep?
[06:15:47] al2o3-cr: hightower: I just woke up :)
[06:15:55] al2o3-cr: Ox0dea: I don't
[06:16:04] Ox0dea: al2o3-cr: Then why that gnarly block back there?
[06:16:47] Ox0dea: `select { |line| line.match /regexp/ }` is just `grep(/regexp/)`.
[06:17:07] al2o3-cr: Ox0dea: because i'm still half asleep :)
[06:17:11] Ox0dea: Bollocks.
[06:18:42] Ox0dea: >> 'abc123def456'[/(\d+\w+)/, 1] # hightower
[06:18:43] ruboto: Ox0dea # => "123def456" (https://eval.in/464686)
[06:19:00] astrobunny: has joined #ruby
[06:19:17] hightower: Ox0dea, fantastic, ++
[06:19:24] bnizzle: has joined #ruby
[06:19:28] al2o3-cr: Ox0dea: What's you fucking problem?
[06:19:51] Ox0dea: Maintain your composure.
[06:22:25] JDeen: Hi there. Not sre if its the right place to ask the probelm. I am interested in implementing a JSON api on a Rails app with Grape. I would like to use jsonapi.org format. Does any one know a open source project that uses it.
[06:25:33] barhum2013_: has joined #ruby
[06:27:54] sinkensabe: has joined #ruby
[06:33:15] astrobunny: has joined #ruby
[06:33:46] bnizzle: has joined #ruby
[06:33:51] trosborn: has joined #ruby
[06:34:10] DexterLB: has joined #ruby
[06:34:52] yfeldblum: has joined #ruby
[06:36:24] shock_one: has joined #ruby
[06:37:46] mattwashere: has joined #ruby
[06:40:32] bnizzle1: has joined #ruby
[06:41:07] baweaver: has joined #ruby
[06:43:04] trosborn: has joined #ruby
[06:43:28] RegulationD: has joined #ruby
[06:43:30] chouhoulis: has joined #ruby
[06:45:56] tubuliferous_: has joined #ruby
[06:48:52] Ox0dea: Is the act of prepending "prepension" or "prependiture"?
[06:49:07] solocshaw: has joined #ruby
[06:50:01] Ox0dea: VeryBewitching: Halp.
[06:51:23] Ox0dea: "Inclusion", "extension", "prepension", but also "expenditure", "prependiture".
[06:51:44] fgo: has joined #ruby
[06:52:40] jas02: has joined #ruby
[06:52:46] dionysus69: has joined #ruby
[06:53:01] Ox0dea: Even /usr/share/dict/words-insane isn't of much help on this one. :<
[06:54:02] VeryBewitching: Prependiture would reference the past, as would expenditure
[06:54:11] VeryBewitching: It's not the act of doing it, it's the result of having done it
[06:54:34] VeryBewitching: including, extending, prepending
[06:54:51] hahuang65: has joined #ruby
[06:56:20] chipotle: has joined #ruby
[06:57:50] VeryBewitching: ACTION pokes Ox0dea
[06:58:04] Ox0dea: VeryBewitching: "Appension" looks very wrong to me.
[06:58:49] charliesome: has joined #ruby
[06:59:05] VeryBewitching: ACTION shrugs
[06:59:59] VeryBewitching: "Inclusion", "Extension", "Prologue", "Epilogue"
[07:00:03] Ox0dea: "Suspenditure" is a word, but "appenditure" connotes vaguely clinical in a way I don't like.
[07:01:00] VeryBewitching: What is this in reference to, if you don't mind me asking?
[07:01:23] duckpupp1: has joined #ruby
[07:01:24] Ox0dea: >> Module.instance_method(:prepend) # VeryBewitching
[07:01:25] ruboto: Ox0dea # => #<UnboundMethod: Module#prepend> (https://eval.in/464695)
[07:01:32] Ox0dea: I'd like to speak of the act.
[07:02:42] VeryBewitching: >> Module.instance_method(:prologue)
[07:02:43] ruboto: VeryBewitching # => undefined method `prologue' for class `Module' (NameError) ...check link for more (https://eval.in/464696)
[07:02:45] dotix: has joined #ruby
[07:03:28] VeryBewitching: That's promising.
[07:03:30] kp666: has joined #ruby
[07:03:47] Ox0dea: #prepend is similar in nature to #include and #extend.
[07:04:08] VeryBewitching: Is it evaluated first?
[07:04:19] VeryBewitching: I've never seen the method.
[07:04:21] Ox0dea: >> Foo = Module.new; String.prepend(Foo); String.ancestors.first
[07:04:22] ruboto: Ox0dea # => Foo (https://eval.in/464697)
[07:04:34] Ox0dea: It's for sticking methods right at the front of the lookup chain.
[07:04:59] Ox0dea: And `super` behaves very conveniently therein by looking down instead of up.
[07:05:22] VeryBewitching: Sounds like witchcraft to me
[07:05:41] build22_: has joined #ruby
[07:05:43] Ox0dea: It's the cleanest way I know to incorporate a minimally invasive #method_missing.
[07:06:12] Ox0dea: If you don't intend to handle it, you just `super` and let whatever was already there take over.
[07:06:23] Ox0dea: Much better than mucking about with aliasing.
[07:07:12] VeryBewitching: I was trying to find a way to preserve existing method definitions from mixins so I could call mixin B's copy of the method on this object.
[07:07:26] Ox0dea: You wanted Module#prepend. :)
[07:07:27] VeryBewitching: I can't remember what frustrated me about trying to do it, but I couldn't get it to work as I wanted to
[07:07:36] hwcd: has joined #ruby
[07:08:02] trosborn: has joined #ruby
[07:08:32] justbleed: has joined #ruby
[07:08:33] VeryBewitching: Well if I called include for 4 modules that all implemented :hello, I wanted, each time it's overridden, to duplicate the method and add it into a module variable which allowed me to toss the constant for the source mixin module and call my method.
[07:09:01] Ox0dea: Ah, that sounds pretty stateful, though.
[07:09:03] VeryBewitching: I'll look at prepend though, maybe there's something happy and warm there
[07:09:44] bruno-: has joined #ruby
[07:09:55] Ox0dea: That is, you'd almost certainly need to maintain either a class variable or a module instance variable for remembering your place.
[07:10:00] VeryBewitching: For calculating rates for insurance purposes, the method for doing it from last year has to be maintained as it was.
[07:10:36] kies: has joined #ruby
[07:10:59] Ox0dea: And this year's is different but similar to last's, presumably?
[07:11:00] VeryBewitching: I was trying to do it when it was called: rate.calc(Tips::Re2012)
[07:11:36] VeryBewitching: I had another way to do it, which worked, but I wanted to make this work for fun, mostly
[07:11:39] Pupeno: has joined #ruby
[07:11:51] VeryBewitching: Kinda, sometimes the formula and it's sources are wildly different
[07:11:57] VeryBewitching: But the inputs are always the same
[07:12:01] Ox0dea: Maybe you just wanted #remove_const?
[07:12:16] trosborn: has joined #ruby
[07:13:17] astrobun_: has joined #ruby
[07:13:33] rgrmatt: has joined #ruby
[07:14:08] VeryBewitching: Well with the above, Tips::Re2012#calc and Tips::Re2011#calc would both be preserved (their method definitions) inside the Rate class scope.
[07:14:24] astrobun_: has joined #ruby
[07:14:36] VeryBewitching: But it was screwy, and I never pursued it.
[07:15:19] tvw: has joined #ruby
[07:15:33] krz: has joined #ruby
[07:17:31] rippa: has joined #ruby
[07:23:45] kies: has joined #ruby
[07:25:14] Arkon: has joined #ruby
[07:29:56] VeryBewitching: The actual solution was kinda just as nice though.
[07:30:10] yeticry: has joined #ruby
[07:32:07] tulak: has joined #ruby
[07:32:20] trosborn: has joined #ruby
[07:32:59] dfockler: has joined #ruby
[07:33:36] dfockler: woop ruby nights
[07:33:47] VeryBewitching: Ox0dea: Your original wordlist has an anomaly
[07:34:08] Ox0dea: VeryBewitching: Hm?
[07:35:08] VeryBewitching: Ox0dea: {inclusion: :grow, extension: :grow, prepension: :before, appension: :after}
[07:35:29] VeryBewitching: Two of these things are not like the others.
[07:36:53] Ox0dea: Well, I was only really looking at them morphologically, but I'd also be happy to maintain that they're all essentially to do with growth.
[07:38:13] VeryBewitching: I guess I'd have to know what you're intending.
[07:38:35] Ox0dea: "by way of module prependiture", more or less.
[07:38:50] VeryBewitching: But prependiture into another module?
[07:39:24] Ox0dea: Well, that's the only place it can happen?
[07:40:22] VeryBewitching: No, I meant "the act of being mixed in"?
[07:40:57] Ox0dea: Specifically "the act of being prepended"; on that I won't budge. :)
[07:41:14] Ox0dea: If you chance upon some happy third possibility, I'm all eyes.
[07:41:51] baweaver: has joined #ruby
[07:44:39] swgillespie: has joined #ruby
[07:44:45] Arkon: has joined #ruby
[07:45:35] lxsameer: has joined #ruby
[07:45:44] Ox0dea: Me right now: http://i.imgur.com/sH2tqKT.gifv
[07:45:58] Ox0dea: (Trypophobia warning, I guess.)
[07:46:20] VeryBewitching: That could make a sober man question the soundness of his own mind.
[07:48:22] zenguy_pc: has joined #ruby
[07:48:38] Ox0dea: ACTION is safe by at least three counts.
[07:49:27] VeryBewitching: "Inclusion", "Extension", "Prepension", "Appension" => "Including", "Extending", "Prepending", "Appending" is how I would go about it.
[07:50:23] moeabdol: has joined #ruby
[07:50:26] crdpink2: has joined #ruby
[07:51:13] blackmesa: has joined #ruby
[07:53:03] fgo: has joined #ruby
[07:57:00] karapetyan: has joined #ruby
[07:57:51] sulky: has joined #ruby
[07:58:20] Miron: has joined #ruby
[07:59:26] isuckdickatcodin: has joined #ruby
[07:59:29] isuckdickatcodin: has left #ruby: ()
[08:00:01] tubuliferous_: has joined #ruby
[08:02:09] duckpupp1: has joined #ruby
[08:02:14] speakingcode: has joined #ruby
[08:02:26] goodcodeguy: has joined #ruby
[08:02:31] Ox0dea: That the "include" clitic found its way into the discussion is a circumstantial accident, but the other two do make a compelling case for "prepension".
[08:02:55] baroquebobcat: has joined #ruby
[08:02:59] Ox0dea: It's just that the "pre-" in "prependiture" is much more plainly not a prefix; there's no such word as "penditure".
[08:03:39] dotix: has joined #ruby
[08:03:47] shock_one: has joined #ruby
[08:04:07] Ox0dea: https://www.wordnik.com/words/penditure
[08:04:55] Ox0dea: Every single example is a broken hyphenation.
[08:04:59] BSaboia: has joined #ruby
[08:06:27] build22_: has joined #ruby
[08:08:05] djbkd: has joined #ruby
[08:08:25] mary5030: has joined #ruby
[08:08:41] Ox0dea: I found "prependation": https://github.com/libopencm3/libopencm3/commit/d15a
[08:10:13] bruno-: has joined #ruby
[08:12:59] PaulCapestany: has joined #ruby
[08:16:01] conta: has joined #ruby
[08:17:56] hhatch: has joined #ruby
[08:19:22] lukaszes: has joined #ruby
[08:22:01] Ropeney: has joined #ruby
[08:22:05] kcidkcusi: has joined #ruby
[08:22:11] kcidkcusi: are there any programmers here?
[08:23:29] Ox0dea: >> 'kcidkcusi'.reverse # Should I phone the authorities?
[08:23:30] ruboto: Ox0dea # => "isuckdick" (https://eval.in/464699)
[08:24:05] kcidkcusi: has left #ruby: ()
[08:24:51] dionysus69: has joined #ruby
[08:26:12] bmalum: has joined #ruby
[08:29:38] sulky: has joined #ruby
[08:30:57] speakingcode: has joined #ruby
[08:31:41] firstdayonthejob: has joined #ruby
[08:32:07] apeiros: heh Ox0dea - you scared them away :D
[08:32:17] solars: has joined #ruby
[08:33:28] aibot: has joined #ruby
[08:33:38] mrd_: has joined #ruby
[08:34:17] Miron: has joined #ruby
[08:35:55] iateadonut: has joined #ruby
[08:36:04] spider-mario: has joined #ruby
[08:40:32] iateadonut: has joined #ruby
[08:42:12] speakingcode: has joined #ruby
[08:42:20] PaulCapestany: has joined #ruby
[08:42:30] Ox0dea: apeiros: The fear was inside them all along.
[08:42:45] Ox0dea: >> 0xfea12.itself # the only thing we have to fear
[08:42:46] ruboto: Ox0dea # => 1042962 (https://eval.in/464702)
[08:43:29] aspiers: has joined #ruby
[08:43:54] baweaver: has joined #ruby
[08:44:33] YaknotiS: has joined #ruby
[08:47:31] jiada: has joined #ruby
[08:48:33] jiada: Hey guys,I'm trying to slove https://leetcode.com/problems/distinct-subsequences/.
[08:48:34] jiada: My first version was wrote in recursion.As expected, "Time Limit
[08:48:34] jiada: Exceeded".Then I converted it to loop.It's really difficult.And
[08:48:38] jiada: unfortunatly,it's still too slow, almost 1min.
[08:48:42] jiada: Here is my code and profile report https://gist.github.com/d845736b1982a18d008f.git.
[08:48:48] jiada: 1. In haskell,recursion is more recommanded than loop.And I find it's
[08:48:51] jiada: more natural to thinking in recursion.How to make ruby effective in
[08:48:54] jiada: recursion?
[08:49:01] jiada: 2. Is there any tutorial teaching converting recursion to loop?
[08:49:08] jiada: 3. And how to improve the loop version?
[08:51:15] lyq: has joined #ruby
[08:54:03] fgo: has joined #ruby
[08:55:30] minimalism: has joined #ruby
[08:55:31] willardg: has joined #ruby
[08:56:23] moeabdol: has joined #ruby
[08:57:59] tulak: has joined #ruby
[08:59:30] tulak: has joined #ruby
[08:59:40] kies: has joined #ruby
[09:02:56] duckpupp1: has joined #ruby
[09:03:44] lyq: How to improve this program?https://gist.github.com/lyqscmy/d845736b1982a18d008f
[09:07:14] build22_: has joined #ruby
[09:10:24] bmalum: has joined #ruby
[09:12:08] qba73: has joined #ruby
[09:13:32] Rollabunna: has joined #ruby
[09:14:16] solocshaw: has joined #ruby
[09:14:47] rgrmatt: has joined #ruby
[09:15:45] etcetc: has joined #ruby
[09:16:33] User458764: has joined #ruby
[09:17:12] trosborn: has joined #ruby
[09:18:18] hightower: Hey, I have a couple threads and I send them their corresponding work via Queues. What's the standard way for threads to signal to the main thread that they've done their work?
[09:19:23] rgtk: has joined #ruby
[09:20:30] karapetyan: has joined #ruby
[09:20:34] marr: has joined #ruby
[09:20:35] apeiros: hightower: a queue
[09:21:04] apeiros: btw., did you say you send the work via queue*s*? plural? a single queue is sufficient to serve multiple threads.
[09:21:27] hightower: apeiros, yes I did create separate queue for each thread
[09:21:42] bruno-: has joined #ruby
[09:23:03] Arkon_: has joined #ruby
[09:24:06] karapetyan: has joined #ruby
[09:25:52] shock_one: has joined #ruby
[09:26:04] leafybas_: has joined #ruby
[09:26:15] hightower: apeiros, I did that because each thread is only processing one type of work
[09:26:33] kies: has joined #ruby
[09:26:44] kies^: has joined #ruby
[09:30:21] hightower: apeiros, but in any case, how would you use a queue to signal to the main thread that all threads have executed their work? I don't see a method that would help with that in Queue's manual
[09:31:47] karapetyan: has joined #ruby
[09:32:14] conta: has joined #ruby
[09:32:34] apeiros: hightower: you push result and optionally the thread to the queue. main thread can read from the queue. but with a "one thread per type of work" - not sure that's the right approach. might as well just use a hash with a mutex (thread => done-status)
[09:33:00] apeiros: though I'm still not sure I see a good reason to do a "one thread per worktype" pattern
[09:33:54] adac: has joined #ruby
[09:41:14] blackmesa: has joined #ruby
[09:41:38] charliesome: has joined #ruby
[09:43:42] karapetyan: has joined #ruby
[09:44:42] baweaver: has joined #ruby
[09:46:58] trosborn: has joined #ruby
[09:49:19] zenguy_pc: has joined #ruby
[09:50:14] Spami: has joined #ruby
[09:51:51] tulak_: has joined #ruby
[09:54:04] symm-: has joined #ruby
[09:55:10] djellemah: hightower: http://ruby-doc.org/stdlib-2.2.3/libdoc/thwait/rdoc/ThreadsWait.html might help
[09:56:17] hightower: djellemah, right, thanks, my issue is that I don't want to terminate the threads, but just be notified when all threads have executed the work I sent to them
[09:56:38] hightower: (they still remain working after that, waiting for the next batch of work)
[09:56:54] fgo: has joined #ruby
[10:03:44] duckpupp1: has joined #ruby
[10:06:58] trosborn: I???m having a hard time rewriting a multi line block as a single line block: https://gist.github.com/trosborn/fcecd8dc944471a53415
[10:07:09] trosborn: If anyone could lend a hand, that would be great :)
[10:07:40] voker57: has joined #ruby
[10:07:58] build22_: has joined #ruby
[10:11:45] DEA7TH: has joined #ruby
[10:13:39] apeiros: trosborn: you need parens. {} has different precedence than do/end.
[10:13:50] apeiros: foo bar {} is foo(bar {})
[10:14:00] apeiros: foo bar do ??? end is foo(bar) do ??? end
[10:16:14] bmalum: has joined #ruby
[10:18:05] trosborn: Ah I see, so like this: within all('.salad_sizes_name'). (last { find('input').set('Large') })
[10:19:33] rgtk: has joined #ruby
[10:25:58] charliesome: has joined #ruby
[10:26:28] bruce_lee: has joined #ruby
[10:27:37] skade: has joined #ruby
[10:28:06] apeiros: trosborn: no, like this: within(all('.salad_sizes_name').last { find('input').set('Large') }). but the basic idea of the block going to last is correct :)
[10:29:24] yosiat: has joined #ruby
[10:30:44] pard: has joined #ruby
[10:31:53] User458764: has joined #ruby
[10:32:03] pard: greet all
[10:32:40] pard: just found an nteresting case
[10:32:48] unrar: has joined #ruby
[10:33:08] jas02: has joined #ruby
[10:34:14] trosborn: Hm.. I don???t think I am comprehending how that works. Is that passing all('.salad_sizes_name').last { find('input').set('Large') } into within as a single param?
[10:34:15] pard: >> def l(_e) _e end; l l:e #the 2nd l is a labl
[10:34:16] ruboto: pard # => undefined local variable or method `e' for main:Object (NameError) ...check link for more (https://eval.in/464728)
[10:34:20] SCHAAP137: has joined #ruby
[10:35:11] pard: >> def l(_e) _e end; l:e
[10:35:12] apeiros: s/labl/symbol/
[10:35:12] ruboto: pard # => :e (https://eval.in/464729)
[10:35:34] apeiros: I still don't get why you like to prefix your lvars with _ for no apparent reason
[10:35:40] pard: apeiros, no sir, i meant a label
[10:36:17] apeiros: *sigh* and I get sir'ed again. I'm a lord, damit.
[10:36:35] pard: i.e, l l:e means l l=>e, but l:e means l(:e)
[10:36:53] apeiros: no, l:e does not mean l=>e. it means :l => e
[10:37:14] charliesome: has joined #ruby
[10:37:20] pard: thanks a lot
[10:37:34] shock_one: has joined #ruby
[10:37:53] apeiros: and yes, l:e -> l(:e), and l l:e -> l(l: e)
[10:38:15] apeiros: I dislike ruby allowing this. only place where it is reasonably used is code golf.
[10:38:41] pard: strange though, i rather like this quirk
[10:38:51] sinkensabe: has joined #ruby
[10:38:56] pard: only not in deployed code
[10:39:04] apeiros: I wouldn't call it a quirk. it's unambiguous.
[10:39:28] pard: thanks, but how so ?
[10:39:30] apeiros: plain `l:e` can't possibly be `:l => e`
[10:39:43] pard: thanks; you are right
[10:39:48] apeiros: >> var = key: "value" # inavlid
[10:39:49] ruboto: apeiros # => /tmp/execpad-ba6c9f245f3a/source-ba6c9f245f3a:2: syntax error, unexpected tLABEL ...check link for more (https://eval.in/464735)
[10:40:03] apeiros: hashes without {} are only allowed as an argument
[10:40:09] pard: >> [l: 12]
[10:40:10] ruboto: pard # => [{:l=>12}] (https://eval.in/464736)
[10:40:47] apeiros: hm, ok. in this place they are not an argument. true. there it is actually ambiguos.
[10:41:11] apeiros: >> def l(v); "method call"; end; [l:1]
[10:41:13] ruboto: apeiros # => [{:l=>1}] (https://eval.in/464739)
[10:41:27] apeiros: this case is actually ambiguous.
[10:41:30] CloCkWeRX: has joined #ruby
[10:41:39] pard: i really like the way a japanese mind works ; no wonder they've come this far
[10:42:28] build22_: has joined #ruby
[10:43:02] pard: apeiros, thanks; i actually had not consider'd that case
[10:43:20] pandaant: has joined #ruby
[10:44:59] RegulationD: has joined #ruby
[10:48:34] trosborn: Okay??? so I tried to refactor some similar code except, and the command line is yelling at me: https://gist.github.com/trosborn/84e526f0504ad0dbde5f
[10:49:17] mattwashere: has joined #ruby
[10:50:25] Musashi007: has joined #ruby
[10:53:17] stamina: has joined #ruby
[10:53:53] blueOxigen: has joined #ruby
[10:55:44] lkba_: has joined #ruby
[10:56:07] shock_one: has joined #ruby
[10:56:53] goodcodeguy: has joined #ruby
[10:56:57] al2o3-cr: has joined #ruby
[10:57:51] fgo: has joined #ruby
[10:59:06] Radar: trosborn: define "yelling'
[10:59:45] FernandoBasso: has joined #ruby
[10:59:56] trosborn: I updated the gist with the stack trace: https://gist.github.com/trosborn/84e526f0504ad0dbde5f
[11:00:13] tulak: has joined #ruby
[11:01:07] Radar: You're missing a bracket for the within.
[11:01:12] moei: has joined #ruby
[11:01:13] Radar: within(all('.salad_sizes_price')[1]
[11:01:16] Radar: bracket is missing after the ]
[11:03:02] j3r0: has joined #ruby
[11:03:45] lavros: has joined #ruby
[11:04:02] tomphp: has joined #ruby
[11:04:09] TheHodge: has joined #ruby
[11:04:27] duckpupp1: has joined #ruby
[11:05:59] trosborn: I???m confused :/ I have similar code earlier in the test that works fine: within(all('.salad_sizes_name').last { find('input').set('Large') })
[11:06:36] dstarh: has joined #ruby
[11:06:48] trosborn: Do I need to use an additional set of brackets for my broken code?
[11:07:21] djellemah: trosborn: within(all('.salad_sizes_name').last { find('input').set('Large') } ) <- this one
[11:07:55] rodfersou: has joined #ruby
[11:09:45] troulouliou_div2: has joined #ruby
[11:12:03] apeiros: trosborn: I doubt that your last code example works fine.
[11:12:38] apeiros: your last code example passes the block to the method `last`. I'm pretty sure you want to pass it to `within`
[11:13:01] skade: has joined #ruby
[11:13:13] apeiros: and as said before, you'd have to use parens like this `within(expression) { block }` to achieve that.
[11:13:41] Jackneill: has joined #ruby
[11:16:47] rgrmatt: has joined #ruby
[11:17:13] trosborn: Okay, you???re right that code did not work fine :/
[11:17:45] trosborn: within { all('.salad_sizes_name').last.find('input').set('Large') }
[11:17:53] trosborn: is that what you mean I should do?
[11:17:53] trajing: has joined #ruby
[11:18:16] apeiros: trosborn: stop riddling. read the example I gave you. analyze it and apply it to your case.
[11:18:22] apeiros: in short: no. that's not what you should do.
[11:19:13] conta: has joined #ruby
[11:20:21] dstarh: has joined #ruby
[11:21:00] mikecmpbll: has joined #ruby
[11:23:15] trosborn: My apologies, I got confused because earlier when you gave me this I just copy pasted it assuming it would work: within(all('.salad_sizes_name').last { find('input').set('Large') })
[11:23:21] trosborn: Anyways I got it now: within(all('.salad_sizes_name').last) { find('input').set('Large') }
[11:27:16] arup_r: has joined #ruby
[11:27:41] yosiat: has joined #ruby
[11:28:06] Miron: has joined #ruby
[11:28:37] etcetc: has joined #ruby
[11:32:27] charliesome: has joined #ruby
[11:38:49] sulky: has joined #ruby
[11:41:03] skade: has joined #ruby
[11:41:22] embs: has joined #ruby
[11:46:04] RegulationD: has joined #ruby
[11:46:12] Pupeno: has joined #ruby
[11:50:18] zenguy_pc: has joined #ruby
[11:53:12] but3k4: has joined #ruby
[11:54:39] millerti: has joined #ruby
[11:55:29] Pupeno: has joined #ruby
[11:55:29] Pupeno: has joined #ruby
[11:56:19] eggoez: has joined #ruby
[11:56:34] jas02: has joined #ruby
[11:59:13] fgo: has joined #ruby
[11:59:25] ht__: has joined #ruby
[12:03:19] hhatch: has joined #ruby
[12:03:33] ht__: has joined #ruby
[12:05:11] duckpupp1: has joined #ruby
[12:08:26] krz: has joined #ruby
[12:11:00] doddok: has joined #ruby
[12:11:34] ht__: has joined #ruby
[12:12:52] charliesome: has joined #ruby
[12:13:39] freerobby: has joined #ruby
[12:14:51] Drakevr: has joined #ruby
[12:15:02] iko1: has joined #ruby
[12:15:36] but3k4: has joined #ruby
[12:15:47] millerti: has joined #ruby
[12:16:02] kirun: has joined #ruby
[12:16:18] but3k4: has joined #ruby
[12:16:25] abucha: has joined #ruby
[12:18:41] but3k4: has joined #ruby
[12:20:06] gard_: has joined #ruby
[12:21:15] tokik: has joined #ruby
[12:23:02] rgtk: has joined #ruby
[12:23:03] skade: has joined #ruby
[12:23:14] sepp2k: has joined #ruby
[12:23:16] weihan: has joined #ruby
[12:24:22] Arkon: has joined #ruby
[12:24:49] tsht: has joined #ruby
[12:28:15] weihan: has joined #ruby
[12:33:36] Miron: has joined #ruby
[12:33:50] Azure: has joined #ruby
[12:34:17] millerti: has joined #ruby
[12:36:33] sonOfRa: has joined #ruby
[12:37:49] weihan: has joined #ruby
[12:40:24] freerobby: has joined #ruby
[12:40:29] Axsuul: has joined #ruby
[12:40:56] matp: has joined #ruby
[12:44:34] bmalum: has joined #ruby
[12:45:00] karapetyan: has joined #ruby
[12:46:27] jdawgaz: has joined #ruby
[12:46:39] rickmasta: has joined #ruby
[12:48:52] shinnya: has joined #ruby
[12:51:19] jas02: has joined #ruby
[12:53:25] am55: has joined #ruby
[12:53:58] tomphp: has joined #ruby
[12:54:14] FernandoBasso: has joined #ruby
[12:54:39] weihan: has joined #ruby
[12:54:40] jeffreylevesque: has joined #ruby
[12:56:43] rgrmatt: has joined #ruby
[12:57:56] iateadonut: has joined #ruby
[12:58:24] Ropeney_: has joined #ruby
[12:59:20] weihan: has joined #ruby
[13:00:03] fgo: has joined #ruby
[13:01:15] Icey: has joined #ruby
[13:01:27] Icey: has left #ruby: ()
[13:01:41] desmondhume: has joined #ruby
[13:04:42] am55: has joined #ruby
[13:05:18] leafybas_: has joined #ruby
[13:05:59] duckpupp1: has joined #ruby
[13:06:18] grn: has joined #ruby
[13:06:59] karapetyan: has joined #ruby
[13:09:42] but3k4: has joined #ruby
[13:11:15] Mon_Ouie: has joined #ruby
[13:16:56] conta: has joined #ruby
[13:17:03] lavros_: has joined #ruby
[13:20:00] doddok: has joined #ruby
[13:22:00] krz: has joined #ruby
[13:22:49] victortyau: has joined #ruby
[13:23:19] lavros: has joined #ruby
[13:24:09] platzhirsch: has joined #ruby
[13:28:14] ekinmur: has joined #ruby
[13:28:51] synthroid: has joined #ruby
[13:30:14] ebbflowgo: has joined #ruby
[13:30:15] victortyau: has joined #ruby
[13:30:31] tricktricktrck: has joined #ruby
[13:31:12] goodcodeguy: has joined #ruby
[13:32:14] ebbflowgo: has joined #ruby
[13:32:50] Miron: has joined #ruby
[13:34:29] tricktricktrck: has joined #ruby
[13:34:33] mattwildig: has joined #ruby
[13:34:47] northfurr: has joined #ruby
[13:37:50] tricktricktrck: has joined #ruby
[13:38:23] The_Phoenix: has joined #ruby
[13:40:25] Peteykun: has joined #ruby
[13:41:28] ht__: has joined #ruby
[13:41:48] abucha: has joined #ruby
[13:42:19] shock_one: has joined #ruby
[13:43:24] rgrmatt: has joined #ruby
[13:43:57] mary5030: has joined #ruby
[13:45:00] skcin7: has joined #ruby
[13:45:04] tricktricktrck: has joined #ruby
[13:45:30] jas02: has joined #ruby
[13:45:53] lavros: has joined #ruby
[13:48:11] tricktricktrck: has joined #ruby
[13:48:41] cmoney: has joined #ruby
[13:49:39] rgrmatt: has joined #ruby
[13:49:55] tknz: has joined #ruby
[13:50:29] zenguy_pc: has joined #ruby
[13:51:20] _aeris_: has joined #ruby
[13:52:34] build22_: has joined #ruby
[13:54:01] alexandre-linux: has joined #ruby
[13:55:02] _blizzy_: has joined #ruby
[13:56:05] build22_: has joined #ruby
[13:57:18] alexandre-linux: has joined #ruby
[13:57:25] luca768: has joined #ruby
[13:58:32] ht__: has joined #ruby
[14:01:14] fgo: has joined #ruby
[14:01:32] karapetyan: has joined #ruby
[14:01:51] ohcibi: has joined #ruby
[14:03:35] nateberkopec: has joined #ruby
[14:04:27] ciampix_: has joined #ruby
[14:04:33] desmondhume: has joined #ruby
[14:05:47] tricktricktrck: has joined #ruby
[14:06:44] duckpupp1: has joined #ruby
[14:10:31] sankaber: has joined #ruby
[14:11:26] shredding: has joined #ruby
[14:11:38] symm-: has joined #ruby
[14:12:59] wsewolod: has joined #ruby
[14:13:17] ciampix_: has joined #ruby
[14:13:58] ciampix2: has joined #ruby
[14:15:48] moeabdol: has joined #ruby
[14:17:35] abucha: has joined #ruby
[14:17:49] conta: has joined #ruby
[14:18:24] hightower: has joined #ruby
[14:19:21] bahar: has joined #ruby
[14:19:55] ciampix2: has joined #ruby
[14:21:11] bluOxigen: has joined #ruby
[14:21:19] NeverDie: has joined #ruby
[14:22:06] tricktricktrck: has joined #ruby
[14:22:19] stannard: has joined #ruby
[14:23:41] tubuliferous_: has joined #ruby
[14:23:43] diegoaguilar: has joined #ruby
[14:24:03] tricktricktrck: has joined #ruby
[14:26:00] alain2: has joined #ruby
[14:27:36] mille_pattes: has joined #ruby
[14:28:02] blueOxigen: has joined #ruby
[14:28:27] lukaszes: has joined #ruby
[14:32:01] mattwildig: has joined #ruby
[14:34:52] DEA7TH: has joined #ruby
[14:36:34] ht__: has joined #ruby
[14:36:35] desmondhume: has joined #ruby
[14:38:15] dionysus69: has joined #ruby
[14:39:27] JDiPierro: has joined #ruby
[14:42:40] matp_: has joined #ruby
[14:43:40] shock_one: has joined #ruby
[14:45:41] troulouliou_div2: has joined #ruby
[14:45:48] iateadonut: has joined #ruby
[14:47:57] northfurr: has joined #ruby
[14:50:14] northfurr: has joined #ruby
[14:51:26] matp: has joined #ruby
[14:53:23] eldariof: has joined #ruby
[14:53:31] mghaig: has joined #ruby
[14:53:43] davedev24: has joined #ruby
[14:54:34] ht__: has joined #ruby
[14:55:51] kstuart: has joined #ruby
[14:57:43] conta: has joined #ruby
[14:58:11] lukaszes: has joined #ruby
[15:00:30] kobain: has joined #ruby
[15:02:34] fgo: has joined #ruby
[15:02:38] hxegon: has joined #ruby
[15:02:39] RegulationD: has joined #ruby
[15:03:14] mghaig: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[15:03:39] mghaig: has joined #ruby
[15:05:00] karapetyan: has joined #ruby
[15:06:36] ht__: has joined #ruby
[15:09:41] jas02: has joined #ruby
[15:10:49] krz: has joined #ruby
[15:11:00] ja: Ruby ought to allow backslahes in symbol literals so I could write :SMS\Account instead of :'SMS::Account', hehehehe
[15:11:28] Fire-Dragon-DoL: has joined #ruby
[15:12:33] th0m__: has joined #ruby
[15:13:10] kalusn: has joined #ruby
[15:13:27] shock_one: has joined #ruby
[15:13:41] yqt: has joined #ruby
[15:17:18] karapetyan: has joined #ruby
[15:21:06] kstuart: has joined #ruby
[15:21:17] moss: has joined #ruby
[15:23:25] krz: has joined #ruby
[15:23:27] northfurr: has joined #ruby
[15:23:48] s00pcan: has joined #ruby
[15:24:48] s00pcan: has joined #ruby
[15:25:51] northfurr: has joined #ruby
[15:27:17] subscope: has joined #ruby
[15:29:37] northfurr: has joined #ruby
[15:31:29] banister: has joined #ruby
[15:32:19] northfurr: has joined #ruby
[15:32:28] mistermocha: has joined #ruby
[15:33:17] spider-mario: has joined #ruby
[15:34:06] subscope: has joined #ruby
[15:34:09] Gi0: has joined #ruby
[15:35:32] desmondhume: has joined #ruby
[15:36:08] northfurr: has joined #ruby
[15:36:26] codecop: has joined #ruby
[15:37:28] blackmesa: has joined #ruby
[15:38:31] northfurr: has joined #ruby
[15:38:38] ht__: has joined #ruby
[15:38:46] bmalum: has joined #ruby
[15:40:28] rippa: has joined #ruby
[15:41:04] northfurr: has joined #ruby
[15:41:48] rgtk: has joined #ruby
[15:43:53] ESpiney: has joined #ruby
[15:43:56] northfurr: has joined #ruby
[15:47:26] zenguy_pc: has joined #ruby
[15:48:51] bluOxigen: has joined #ruby
[15:49:52] nateberkopec: has joined #ruby
[15:53:24] rzsd: has joined #ruby
[15:56:24] mghaig: has joined #ruby
[15:56:27] rzsd: I have a hash like h = {"9:00AM" => "abc", "10:00AM" => "def","01:00PM" => "ghi", "02:00PM" => "jkl"}.When i do h.sort i get {"01:00PM" => "ghi", "02:00PM" => "jkl","9:00AM" => "abc", "10:00AM" => "def"}
[15:56:45] rzsd: im stumped by this strange behavior
[15:56:53] mattwildig: has joined #ruby
[15:56:53] rzsd: what could be causing this ?
[15:57:24] havenwood: >> "01:00PM" > "9:00AM"
[15:57:25] ruboto: havenwood # => false (https://eval.in/464771)
[15:57:45] cdg: has joined #ruby
[15:57:53] havenwood: >> '0' > '9'
[15:57:54] ruboto: havenwood # => false (https://eval.in/464772)
[15:58:01] rzsd: havenwood:yeah, im expecting the result to be unchanged as h is already in sorted form
[15:58:26] slash_part: apparently not
[15:58:53] rzsd: and the strange thing is if i create another hash, h1 = {"9:00AM" => "abc", "10:00AM" => "def","01:00PM" => "ghi", "02:00PM" => "jkl"} and then do h1.sort i get the correct output
[15:58:58] step1step22: has joined #ruby
[15:59:17] havenwood: rzsd: http://ruby-doc.org/core/String.html#method-i-3C-3D-3E
[15:59:28] wprice: has joined #ruby
[16:00:23] sumark: has joined #ruby
[16:00:28] matled: has joined #ruby
[16:00:53] rzsd: havenwood:im wondering why in in case of h1 the result is different, when both are of type Hash ?
[16:00:59] havenwood: >> ['1', '09', '010'].sort
[16:01:00] ruboto: havenwood # => ["010", "09", "1"] (https://eval.in/464773)
[16:01:07] Arkon: has joined #ruby
[16:01:22] havenwood: rzsd: So you understand that ^ sort order?
[16:01:32] rzsd: {"9:00AM" => "abc", "10:00AM" => "def","01:00PM" => "ghi", "02:00PM" => "jkl"}.sort
[16:01:41] rzsd: >>{"9:00AM" => "abc", "10:00AM" => "def","01:00PM" => "ghi", "02:00PM" => "jkl"}.sort
[16:01:42] ruboto: rzsd # => [["01:00PM", "ghi"], ["02:00PM", "jkl"], ["10:00AM", "def"], ["9:00AM", "abc"]] (https://eval.in/464774)
[16:02:17] shock_one: has joined #ruby
[16:02:30] DoubleMalt: has joined #ruby
[16:02:38] dionysus69: has joined #ruby
[16:02:41] rzsd: havenwood:see its giving the incorrect sort order
[16:02:47] TheNet: has joined #ruby
[16:02:50] karapetyan: has joined #ruby
[16:03:03] slash_part: rzsd: ?... 01 is before 02... and 1 is before 9... what's wrong?
[16:03:05] Ebok: use sort_by
[16:03:05] havenwood: rzsd: What order would you expect this to be?: ['1', '09', '010'].sort
[16:03:29] rzsd: >>{"09:00AM" => "abc", "10:00AM" => "def","01:00PM" => "ghi", "02:00PM" => "jkl"}.sort
[16:03:30] ruboto: rzsd # => [["01:00PM", "ghi"], ["02:00PM", "jkl"], ["09:00AM", "abc"], ["10:00AM", "def"]] (https://eval.in/464775)
[16:03:56] havenwood: rzsd: Are you trying to sort by the keys then?
[16:03:59] fgo: has joined #ruby
[16:04:04] jas02: has joined #ruby
[16:04:06] rzsd: havenwood:yeah exactly, i want it to be sorted as per the time in the keys
[16:04:13] havenwood: rzsd: What Ebok said.
[16:04:19] slash_part: but you're sorting by the strings, not the times
[16:04:21] Ebok: sort_by{|key,value| value}
[16:04:29] Ebok: sort_by{|key,value| key}
[16:04:35] ht__: has joined #ruby
[16:04:37] Ebok: Or negate either of those to reverse them
[16:04:43] Ebok: -key -value
[16:04:48] rzsd: >>{"09:00AM" => "abc", "10:00AM" => "def","01:00PM" => "ghi", "02:00PM" => "jkl"}.sort_by{|key,value| key}
[16:04:49] ruboto: rzsd # => [["01:00PM", "ghi"], ["02:00PM", "jkl"], ["09:00AM", "abc"], ["10:00AM", "def"]] (https://eval.in/464776)
[16:05:06] Ebok: That is correct
[16:05:17] havenwood: rzsd: So that's ^ sorting by key. Now try by value.
[16:05:54] Ebok: 01 is before 02, those are strings remember. So its sorting by abcdef. If you want it to sort by the TIME you should use miltiary time
[16:05:55] slash_part: rzsd: that's sorting the way you want because you left-padded 9:00AM with a 0 now...
[16:05:56] rzsd: havenwood: the values wont necessarily be in alphabetical order as above
[16:06:18] havenwood: rzsd: I think you should do a gist with various examples of possible input and desired output for each.
[16:06:19] adac: has joined #ruby
[16:06:27] ruboto: rzsd, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[16:06:44] ebbflowgo: has joined #ruby
[16:07:01] havenwood: rzsd: You want to sort them somehow. Multiple examples with desired order would be enlightening
[16:07:55] Ebok: Honestly, just type out what you want the sort to result in >_>
[16:08:09] slash_part: or use keys that are Time objects instead of strings... 24hour time (ditch am/pm) would work
[16:08:20] Ebok: ^ that would be best
[16:08:42] Ebok: military time
[16:09:12] Ebok: You can also make a quick method converter to take the military time key when printing it to something to format it
[16:09:19] JCOE: has joined #ruby
[16:10:00] Ebok: assuming the Time objects dont have something built it
[16:10:11] rzsd: >>{"09:00AM" => "abc", "10:00AM" => "def","01:00PM" => "ghi", "02:00PM" => "jkl"}.sort_by{|key,value| key.to_time}
[16:10:12] ruboto: rzsd # => undefined method `to_time' for "09:00AM":String (NoMethodError) ...check link for more (https://eval.in/464777)
[16:10:44] Ebok: Well time is a gem so first you haev to require 'Time'
[16:11:07] Ebok: Secdondly the AM and : makes that a string, so you need to look up Timeobject format
[16:11:10] rzsd: >>require "time" {"09:00AM" => "abc", "10:00AM" => "def","01:00PM" => "ghi", "02:00PM" => "jkl"}.sort_by{|key,value| key.to_time}
[16:11:11] ruboto: rzsd # => /tmp/execpad-ed31a90b9746/source-ed31a90b9746:2: syntax error, unexpected '{', expecting keyword_end ...check link for more (https://eval.in/464778)
[16:11:33] havenwood: rzsd: Please experiment in your local REPL and just use ruboto to demonstrate to others.
[16:11:50] rzsd: Ebok: i tried in console on my machine, works with requiring time, thanks a lot :)
[16:11:59] Ebok: Yourwelcome
[16:12:00] Joufflu: has joined #ruby
[16:12:19] bnizzle: has joined #ruby
[16:13:23] Xeago: has joined #ruby
[16:13:37] Melpaws: has joined #ruby
[16:13:38] sankaber: has joined #ruby
[16:13:53] banister: has joined #ruby
[16:14:11] yosiat: has joined #ruby
[16:14:27] mattwashere: has joined #ruby
[16:15:04] build22_: has joined #ruby
[16:19:35] arooni: has joined #ruby
[16:20:03] bmalum_: has joined #ruby
[16:24:20] mattwashere: has joined #ruby
[16:25:29] chouhoulis: has joined #ruby
[16:27:53] funnel: has joined #ruby
[16:28:00] lkba: has joined #ruby
[16:31:31] baweaver: has joined #ruby
[16:31:57] shevy: simplicity
[16:33:44] Croves: has joined #ruby
[16:34:34] conta: has joined #ruby
[16:35:08] kstuart: has joined #ruby
[16:37:06] tulak_: has joined #ruby
[16:37:43] adac: has joined #ruby
[16:44:21] tjohnson: has joined #ruby
[16:47:49] ni638629: has joined #ruby
[16:48:44] Oatmeal: has joined #ruby
[16:48:57] psye: has joined #ruby
[16:49:13] RobertBirnie: has joined #ruby
[16:49:37] ni638629: Hi there. New to ruby, can suggest a good guide/tutorial for beginners?
[16:50:23] pontiki: ni638629: !r4ia
[16:50:44] pontiki: ni638629: railstutorial.org
[16:50:57] pontiki: ni638629: !getting-started
[16:50:59] ruboto: http://ruby-community.com/pages/links
[16:51:09] pontiki: we're in #ruby aren't we
[16:51:13] adaedra: yes we are.
[16:51:15] pontiki: ni638629: #rubyonrails
[16:51:31] ruboto: I don't know anything about r4ia
[16:51:40] adaedra: pontiki: notice they asked about ruby for now.
[16:51:51] pontiki: you are so right
[16:51:56] pontiki: i am so wrong
[16:54:26] gard_: has joined #ruby
[16:54:45] stannard: has joined #ruby
[16:58:31] jas02: has joined #ruby
[17:00:53] RobertBirnie: has joined #ruby
[17:01:38] shevy: sounds like a song
[17:02:30] moss: has joined #ruby
[17:04:44] fgo: has joined #ruby
[17:05:53] moeabdol: in ruby, i have a class MyClass the class has instance variables like size, count, etc. it also holds an array of certain values [[1, 1], [2, 2]]
[17:05:59] blackmesa: has joined #ruby
[17:06:02] moeabdol: if i instantiate an instance
[17:06:17] moeabdol: my = MyClass.new([[1, 1], [2, 2]])
[17:06:23] moeabdol: when I call my directly
[17:06:51] moeabdol: I get the famous <MyClass:0x00001023210>
[17:07:02] mattwildig: has joined #ruby
[17:07:07] moeabdol: how can i make it so when I call my directly i can get the values in the array
[17:07:17] adaedra: implement #to_s
[17:07:40] moeabdol: i want to implement to_a
[17:07:51] moeabdol: but delegate it in such a way that I can call it directly
[17:08:44] shevy: <MyClass:0x00001023210> is a stringified representation
[17:08:58] duckpupp1: has joined #ruby
[17:10:44] sysanthrope: has joined #ruby
[17:10:50] ni638629: has joined #ruby
[17:10:57] moeabdol: does Array call to_s or to_a when accessed directoy
[17:10:59] agentmeerkat: has joined #ruby
[17:11:08] _blizzy_: has joined #ruby
[17:11:18] moeabdol: if I call a does it call to_a or to_s?
[17:11:29] adaedra: What do you mean by "calling" it
[17:11:31] shevy: http://stackoverflow.com/a/9526262/722915 gives a nice example
[17:11:46] moeabdol: i mean by just typing a in the console
[17:12:01] adaedra: that uses #to_s
[17:12:05] havenwood: moeabdol: Try playing with this in irb: class MyClass; def initialize value; @value = value end; def inspect; @value.inspect end; def to_a; @value.to_a end; end
[17:12:09] shevy: in irb it will use inspect, see the example above
[17:12:21] RajD: has joined #ruby
[17:12:43] swgillespie: has joined #ruby
[17:12:48] moeabdol: I see shevy thanks +1
[17:13:39] lkba: has joined #ruby
[17:13:52] shevy: \o/ I always wondered myself why the 0x00001023210 was important to know
[17:14:05] devl: has joined #ruby
[17:14:08] adaedra: to differentiate objects, I'd say.
[17:16:25] lkba_: has joined #ruby
[17:16:50] baweaver: has joined #ruby
[17:17:20] sye: has joined #ruby
[17:17:57] moeabdol: shevy: do you mind taking a look at my code here
[17:17:59] moeabdol: https://gist.github.com/moeabdol/dd76475999d90e91e03a
[17:18:11] moeabdol: i'm basically trying to create my own custom array
[17:18:38] moeabdol: i used the forwardable module to delegate certain function to Array
[17:19:06] moeabdol: if I create an npc instance with some array in it and try to call it directly in irb
[17:19:20] moeabdol: i still get the dreaded <NPC:0x00123234>
[17:20:17] fantazo: has joined #ruby
[17:21:52] shevy: no idea about forwardable, have you not defined your custom .inspect yet?
[17:23:05] moeabdol: shevy: I did
[17:23:09] moeabdol: but still getting the same
[17:23:16] moeabdol: def inspect
[17:23:51] Croves: has joined #ruby
[17:24:10] shevy: I don't see this in your code
[17:24:33] moeabdol: I just modified it and test it when you proposed
[17:25:19] shevy: it's not on https://gist.github.com/moeabdol/dd76475999d90e91e03a :D
[17:26:13] moeabdol: I updated the gist shevy
[17:26:43] moeabdol: but it still yields the same <NPC:0x0004234>
[17:26:52] sye: has joined #ruby
[17:27:03] shevy: that is not right
[17:27:32] shevy: I mean what you write there that it yields that, is not right
[17:27:34] shevy: I tested it on: http://pastie.org/10536661
[17:28:15] shevy: here is a second try: http://pastie.org/10536664
[17:28:26] shevy: the first returns the array; @npc must be an array; the second one returns 42
[17:28:41] shevy: so it works! now you only have to customize the message you want to appear
[17:29:27] symm-: has joined #ruby
[17:30:33] shevy: you can let it return anything
[17:30:37] moeabdol: it works when i remove puts
[17:30:39] moeabdol: and use p instead
[17:31:32] dionysus69: has joined #ruby
[17:31:32] havenwood: >> n = Numeric.new; n.to_s[/(?<=0x00)[^>]+/].hex >> 1 == n.object_id
[17:31:33] ruboto: havenwood # => undefined method `hex' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/464787)
[17:31:59] moeabdol: shevy i suppost inspect works now
[17:32:20] moeabdol: cause I have the same result wither i Implement my own inspect or delegate to Arrays inspect
[17:32:25] moeabdol: however when I
[17:32:27] Mon_Ouie: has joined #ruby
[17:32:39] moeabdol: expect(npc).to eq([1, 1])
[17:32:46] moeabdol: expected: [1, 1]
[17:32:50] moeabdol: got: [1, 1]
[17:32:56] moeabdol: and it still fails
[17:33:12] davedev24: has joined #ruby
[17:33:19] havenwood: >> RbConfig::CONFIG["arch"]
[17:33:20] ruboto: havenwood # => "i686-linux" (https://eval.in/464788)
[17:33:26] moeabdol: any idea why that's happening
[17:33:51] cornerma1: has joined #ruby
[17:33:56] havenwood: I just assume x86_64. Oops.
[17:34:58] shevy: moeabdol perhaps this helps: http://pastie.org/10536681
[17:35:04] moeabdol: I'm sure am not comparing agains object id
[17:35:12] voker57: has joined #ruby
[17:35:30] shevy: the first one is a normal "puts x", which displays '42'; the other two variants apparently don't use .to_s
[17:36:23] moeabdol: very clear thanks
[17:39:35] moeabdol: i still get this
[17:39:37] JDiPierro: has joined #ruby
[17:39:37] moeabdol: expected [[0, 0], [1, 1], [2, 2]] to match [[0, 0], [1, 1], [2, 2]]
[17:40:19] Ox0dea: moeabdol: Are you using `to_be`?
[17:40:21] shevy: looks identical?
[17:40:26] WajidKagzi: has joined #ruby
[17:40:44] moeabdol: Ox0dea: i used to eq and to match
[17:40:45] Ox0dea: `to_be` checks object identity, not equality.
[17:40:49] shevy: perhaps there is some implicit to array / to string comparison happening
[17:40:58] shevy: do_be_do_be_do!
[17:41:24] NeverTired: has joined #ruby
[17:41:35] WajidKagzi: i am have access to frontendmasters.com, they provide videos for learning, anyone know how i can scrape this site for all the videos so that I can study offline?
[17:42:16] Ox0dea: moeabdol: Maybe consider not subclassing Array for NPC? The relationship isn't obvious at all.
[17:42:20] shevy: two ways come to my mind; one is open-uri, the other is mechanize WajidKagzi
[17:42:28] shevy: or perhaps a combination of both
[17:42:46] Blaguvest: has joined #ruby
[17:43:02] WajidKagzi: @shevy any resources? I would have to access it using my username and password
[17:43:13] Ox0dea: WajidKagzi: Are you asking us to assist you in the infringement of copyright and/or the licensing agreement you promised to abide?
[17:43:33] goodcodeguy: has joined #ruby
[17:43:36] moeabdol: Ox0dea: the thing is I need NPC to be an array with a slight customization (two more variables)
[17:43:37] WajidKagzi: whoa whoa whoa
[17:44:07] Ox0dea: moeabdol: Right, but maybe reconsider; you probably want a Struct.
[17:44:23] shevy: WajidKagzi have a look at http://www.rubydoc.info/gems/mechanize/Mechanize and http://mechanize.rubyforge.org/ - there is some example for password + user
[17:44:26] symm-: has joined #ruby
[17:44:41] tvw: has joined #ruby
[17:44:57] moeabdol: Ox0dea: can I access the Struct like npc[1]
[17:45:18] Ox0dea: moeabdol: NPC here means "non-player character", right?
[17:45:26] daveomcd: has joined #ruby
[17:45:51] shevy: I think a struct requires a specific key... perhaps if the key is 1
[17:45:59] Ox0dea: moeabdol: Okay, so what's *your* second element?
[17:46:07] Ox0dea: Like, what does `moeabdol[1]` evaluate to?
[17:46:09] moeabdol: which represents positions of multiple npcs
[17:46:30] moeabdol: npc represents a team of positions on a grid
[17:46:48] moeabdol: npc[0] first npc position npc[1] second and so on
[17:47:06] moeabdol: i have two main npcs in the game
[17:47:11] moeabdol: each npc is a team
[17:47:16] moeabdol: humans vs zombies
[17:47:47] moeabdol: humans = NPC.new([[0, 0], [1, 1], [2, 2]])
[17:47:48] Ox0dea: Poor naming is causing you to chase the wrong object model, in my opinion.
[17:48:29] moeabdol: I have part of the program implemented
[17:48:30] Ox0dea: That should be `humans = [Entity.new(0, 0), ...]`, where `Entity = Struct.new(:x, :y)` or some such.
[17:48:38] moeabdol: and is using an array of each team
[17:49:18] moeabdol: the team as a whole have common properties
[17:49:28] moeabdol: like being intelligent or dumb
[17:50:02] sye: has joined #ruby
[17:50:20] Ox0dea: Arrays are plenty powerful, but this is Ruby; you have all the tools in the world to program at the appropriate level of abstraction, and you should use them.
[17:51:09] Ox0dea: Having your core domain objects be "arrays with metadata" is almost masochistic.
[17:51:17] sye: has joined #ruby
[17:52:12] WajidKagzi: @sessions = current_professional.sessions.map{|session| session.patient}.uniq
[17:52:53] WajidKagzi: using uniq as a method to identify duplicates is good enough right? should i make a better method?
[17:52:56] mrtomme: has joined #ruby
[17:52:56] swgillespie: has joined #ruby
[17:53:02] moeabdol: Ox0dea: i see. thank you I'll probably think of a better design
[17:53:14] UtkarshRay: has joined #ruby
[17:53:25] Ox0dea: WajidKagzi: #uniq doesn't identify the duplicates, per se; it just removes them.
[17:53:32] j3r0: has joined #ruby
[17:53:36] nateberkopec: has joined #ruby
[17:53:43] blue_deref: has joined #ruby
[17:54:16] Advocation: has joined #ruby
[17:54:16] WajidKagzi: but its fail safe right?
[17:54:36] Ox0dea: As long as the elements have sensible definitions of equality, sure.
[17:55:26] WajidKagzi: aight, cool beans
[17:55:33] Fredrich010: has joined #ruby
[17:57:08] mgorbach: has joined #ruby
[17:57:44] Arkon: has joined #ruby
[17:59:15] WajidKagzi: @shevy Mechanize is very cool, thanks.
[17:59:23] build22: has joined #ruby
[18:01:00] mgorbach: has joined #ruby
[18:04:02] gambl0re: has joined #ruby
[18:05:03] rgrmatt: has joined #ruby
[18:05:56] fgo: has joined #ruby
[18:09:46] duckpupp1: has joined #ruby
[18:09:58] mghaig: has joined #ruby
[18:10:43] Psyq: has joined #ruby
[18:11:23] nofxx: has joined #ruby
[18:13:28] Psyq: has joined #ruby
[18:16:45] Psyq: has joined #ruby
[18:17:39] moeabdol: Ox0dea: i found out why it wasn't working
[18:17:49] moeabdol: I just needed to include Enoumrable
[18:18:01] kies: has joined #ruby
[18:18:25] Ox0dea: >> Enumerable.instance_methods.size
[18:18:26] ruboto: Ox0dea # => 51 (https://eval.in/464814)
[18:19:02] rgrmatt: has joined #ruby
[18:20:17] last_staff: has joined #ruby
[18:20:40] Papierkorb: >> Enumerable.instance_methods.size - Object.instance_methods.size
[18:20:41] ruboto: Papierkorb # => -5 (https://eval.in/464815)
[18:20:51] Papierkorb: >> Enumerable.instance_methods.size - Module.instance_methods.size
[18:20:52] ruboto: Papierkorb # => -46 (https://eval.in/464816)
[18:21:28] Papierkorb: oh, right, there are no other methods in the mod
[18:21:47] hpwcd: has joined #ruby
[18:21:48] Ox0dea: Or you've conflated methods with instance methods.
[18:26:59] stannard: has joined #ruby
[18:27:23] davedev24: has joined #ruby
[18:27:24] poguez_: has joined #ruby
[18:28:28] gokulnath: has joined #ruby
[18:32:16] sepp2k: has joined #ruby
[18:33:01] nertzy: has joined #ruby
[18:34:12] desmondhume: has joined #ruby
[18:35:27] shock_one: has joined #ruby
[18:35:54] zapata: has joined #ruby
[18:38:32] diegoaguilar: has joined #ruby
[18:38:41] GBrawl: has joined #ruby
[18:38:53] Dreamer3: has joined #ruby
[18:39:01] GBrawl: has joined #ruby
[18:41:57] ThatsNotJack: has joined #ruby
[18:42:13] swgillespie: has joined #ruby
[18:44:35] skweek: has joined #ruby
[18:46:17] blackmesa: has joined #ruby
[18:47:21] DLSteve: has joined #ruby
[18:48:49] mghaig: has joined #ruby
[18:50:30] nofxx: has joined #ruby
[18:50:42] nemesit|znc: has joined #ruby
[18:50:49] kies: has joined #ruby
[18:56:14] ricer2: has joined #ruby
[18:57:02] jackjackdripper: has joined #ruby
[18:59:27] mattwashere: has joined #ruby
[18:59:29] bmalum: has joined #ruby
[18:59:52] cmoney: has joined #ruby
[18:59:56] shevy: Ox0dea the people on ##php talk a lot more than we here on #ruby :(
[19:00:49] havenwood: shevy: We're more concise?
[19:01:38] Zarthus: shevy: ruby googles before they ask? ;)
[19:02:08] shevy: hmm ... I need to observe them for a bit longer before I can judge; apparently they talk about webpages more than we do here
[19:02:24] Zarthus: well, most of the webtalk is in #rubyonrails
[19:02:45] weemsledeux: has joined #ruby
[19:02:48] Zarthus: and php - in my opinion - is a language mostly purely for websites ;)
[19:03:43] minimalism: has joined #ruby
[19:05:44] Ox0dea: Zarthus: People used to say that about JavaScript.
[19:06:02] Zarthus: Ox0dea: I still do.
[19:06:08] Ox0dea: Zarthus: You're wrong.
[19:06:20] Zarthus: Ox0dea: Yes. unfortunately :(
[19:06:33] Ox0dea: How do you mean?
[19:06:48] shevy: we can boot the linux kernel in javascript!
[19:06:57] Zarthus: the sudden explosion of everything-javascript lead to some particularily monstrous creations
[19:07:02] rgrmatt: has joined #ruby
[19:07:03] fgo: has joined #ruby
[19:07:09] Ox0dea: >> Time.now.year == 1995 # Zarthus
[19:07:10] ruboto: Ox0dea # => false (https://eval.in/464829)
[19:07:21] Psyq: has joined #ruby
[19:07:25] Zarthus: I liked it better when it was just contained to my browser.
[19:07:58] shevy: because it's a joke
[19:08:05] Zarthus: I've had an ongoing war with node package manager for several years now
[19:08:22] Zarthus: at some point it filled my servers 25 gig ssd with dependencies
[19:08:55] Ox0dea: Cool story. I thought we were talking about a programming language.
[19:09:35] shevy: why do you like it so much
[19:09:56] Ox0dea: There's no good reason to hate it anymore.
[19:10:24] ricer2: has joined #ruby
[19:10:29] Zarthus: I don't like the programming language, but I'm not forced to write in it.
[19:10:32] duckpupp1: has joined #ruby
[19:10:38] Ox0dea: What about the language don't you like?
[19:10:40] Zarthus: I don't like the packaging system because it doesn't work for me, and I *am* forced to work with it.
[19:11:01] Zarthus: It's just not a language I like writing as a professional web developer or overall
[19:11:07] kadoppe: has joined #ruby
[19:11:18] Ox0dea: How come?
[19:11:33] Zarthus: I don't have much of a reason. I just don't feel happy when I write javascript.
[19:11:38] havenwood: Can we just make an undefined a function already?
[19:11:40] mattwildig: has joined #ruby
[19:12:11] yqt: has joined #ruby
[19:13:04] peteyg: has joined #ruby
[19:13:40] beauby: has joined #ruby
[19:13:46] Ox0dea: havenwood: Did you see this? https://eval.in/464832
[19:14:10] Ox0dea: I don't actually know what all that memory I'm poking is for, but it works. :P
[19:14:20] havenwood: Ox0dea: Haha, nope didn't see!
[19:14:26] devoldmx: has joined #ruby
[19:14:34] jeffreylevesque: has joined #ruby
[19:14:57] Ox0dea: I'm not even writing inside the `struct RBasic` memory either, so it's unclear what exactly is happening.
[19:15:55] hxegon: has joined #ruby
[19:16:36] Musashi007: has joined #ruby
[19:17:13] Fire-Dragon-DoL: has joined #ruby
[19:21:34] hxegon: has joined #ruby
[19:22:10] tubuliferous_: has joined #ruby
[19:22:18] miah: has joined #ruby
[19:22:33] build22: has joined #ruby
[19:24:43] agentmeerkat: has joined #ruby
[19:30:12] mattwashere: has joined #ruby
[19:30:13] Axsuul: has joined #ruby
[19:30:21] kp666: has joined #ruby
[19:31:45] rgrmatt: has joined #ruby
[19:33:48] conta: has joined #ruby
[19:37:08] Spami: has joined #ruby
[19:40:46] diegoaguilar: has joined #ruby
[19:41:54] jas02: has joined #ruby
[19:42:47] Marsupermammal: has joined #ruby
[19:43:54] ebbflowgo: has joined #ruby
[19:43:55] jwaldrip: has joined #ruby
[19:44:52] al2o3-cr: has joined #ruby
[19:45:50] ebbflowgo: has joined #ruby
[19:45:54] skweek: has joined #ruby
[19:45:58] ciampix: has joined #ruby
[19:47:50] ciampix_: has joined #ruby
[19:48:08] inteq: has joined #ruby
[19:48:14] mattwashere: has joined #ruby
[19:48:28] ciampix: has joined #ruby
[19:48:41] baweaver: has joined #ruby
[19:50:51] ciampix: has joined #ruby
[19:51:17] stamina: has joined #ruby
[19:51:59] ciampix: has joined #ruby
[19:54:32] lele: has joined #ruby
[19:55:32] mattwash_: has joined #ruby
[19:55:58] ebbflowgo: has joined #ruby
[19:56:50] beauby: has joined #ruby
[19:57:06] idefine: has joined #ruby
[19:57:22] mattwash_: has joined #ruby
[19:58:04] towski_: has joined #ruby
[19:58:10] mattwash_: has joined #ruby
[19:58:26] mattwildig: has joined #ruby
[19:58:55] Spami: has joined #ruby
[20:02:03] pdoherty: has joined #ruby
[20:04:55] SenpaiSilver: has joined #ruby
[20:05:13] User458764: has joined #ruby
[20:05:28] northfurr: has joined #ruby
[20:05:32] lkba: has joined #ruby
[20:06:31] ss_much: has joined #ruby
[20:08:08] fgo: has joined #ruby
[20:08:55] idefine: has joined #ruby
[20:09:36] cicloid: has joined #ruby
[20:11:16] duckpupp1: has joined #ruby
[20:14:57] Drakevr: has joined #ruby
[20:15:16] Coldblackice: has joined #ruby
[20:15:57] cmoney: has joined #ruby
[20:17:05] SenpaiSilver: has joined #ruby
[20:18:50] northfurr: has joined #ruby
[20:19:32] SenpaiSilver: has joined #ruby
[20:19:41] towski_: has joined #ruby
[20:19:48] beauby: has joined #ruby
[20:20:11] mattwashere: has joined #ruby
[20:21:23] shinnya: has joined #ruby
[20:23:46] rickmasta: has joined #ruby
[20:24:01] shock_one: has joined #ruby
[20:26:28] dionysus69: has joined #ruby
[20:27:05] rickmasta: has joined #ruby
[20:27:26] fedexo: has joined #ruby
[20:27:42] Fredrich010: has joined #ruby
[20:27:58] rickmasta: has joined #ruby
[20:29:14] northfurr: has joined #ruby
[20:31:19] PaulCapestany: has joined #ruby
[20:32:07] tubuliferous_: has joined #ruby
[20:32:42] bmalum: has joined #ruby
[20:32:45] to_json: has joined #ruby
[20:32:46] to_json: has joined #ruby
[20:34:18] krainboltgreene: has left #ruby: ()
[20:34:19] tmtwd: has joined #ruby
[20:35:21] k3asd`: has joined #ruby
[20:35:34] kalusn: has joined #ruby
[20:35:41] charliesome: has joined #ruby
[20:36:07] jas02: has joined #ruby
[20:36:23] bruno-: has joined #ruby
[20:37:15] DiCablo: has joined #ruby
[20:37:34] codecop: has joined #ruby
[20:37:48] karapetyan: has joined #ruby
[20:39:01] Jardayn: has joined #ruby
[20:39:02] blueOxigen: has joined #ruby
[20:39:48] karapetyan: has joined #ruby
[20:39:51] JDiPierro: has joined #ruby
[20:41:15] sankaber: has joined #ruby
[20:43:59] goodcodeguy: has joined #ruby
[20:44:02] northfurr: has joined #ruby
[20:44:03] karapetyan: has joined #ruby
[20:45:31] VeryBewitching: has joined #ruby
[20:45:31] hwcd: has joined #ruby
[20:46:52] agentmeerkat: has joined #ruby
[20:47:40] bmalum: has joined #ruby
[20:49:35] mattwashere: has joined #ruby
[20:50:25] harumph: has joined #ruby
[20:50:41] northfurr: has joined #ruby
[20:51:11] bodgix: has joined #ruby
[20:52:00] harumph: dumb question: after each request a Sinatra app logs something like "GET / HTTP/1.1 200 62782 2.34"
[20:52:09] harumph: what is the second number refer to?
[20:52:23] adaedra: I'd say the size of the response
[20:52:58] harumph: adaedra: that makes sense
[20:53:48] tubuliferous_: has joined #ruby
[20:54:56] Oog: has joined #ruby
[20:56:31] Pupeno: has joined #ruby
[20:57:24] Arkon: has joined #ruby
[20:57:41] cdg: has joined #ruby
[20:58:49] weemsledeux: has joined #ruby
[20:58:57] charliesome: has joined #ruby
[21:00:29] nateberkopec: has joined #ruby
[21:00:59] skcin7: has joined #ruby
[21:02:47] ricer2: has joined #ruby
[21:03:23] dh64: has joined #ruby
[21:05:48] gizmore: has joined #ruby
[21:05:58] ESpiney: has joined #ruby
[21:06:41] Oog: has joined #ruby
[21:07:48] sankaber: has joined #ruby
[21:07:50] BubonicPestilenc: has joined #ruby
[21:08:12] BubonicPestilenc: I'm interested, are there any "new"/"advanced" alternatives to nokogiri?
[21:08:41] mghaig: has joined #ruby
[21:10:29] fgo: has joined #ruby
[21:11:09] Arkon: has joined #ruby
[21:12:03] duckpupp1: has joined #ruby
[21:13:20] mattwashere: has joined #ruby
[21:13:56] bruno-: has joined #ruby
[21:17:38] Arkon: has joined #ruby
[21:18:18] maxz: has joined #ruby
[21:18:36] Ox0dea: GitHub's raw diff API supports ?w and ?ts parameters for quashing whitespace and adjusting the tab size; are there any others?
[21:19:13] Ox0dea: They're using, essentially, `git diff --word-diff-regex=.` to display the precise differences in the UI; it'd be nice if the raw diffs could be coerced into doing the same.
[21:20:42] Arkon_: has joined #ruby
[21:21:56] swgillespie: has joined #ruby
[21:22:48] banister: has joined #ruby
[21:23:33] mghaig: has joined #ruby
[21:23:54] yfeldblum: has joined #ruby
[21:23:54] segfalt``: has joined #ruby
[21:24:32] csaunders: has joined #ruby
[21:24:41] Trieste: has joined #ruby
[21:25:14] ricer2: has joined #ruby
[21:25:17] millerti: has joined #ruby
[21:26:16] CustosLim3n: has joined #ruby
[21:26:30] Trynemjoel: has joined #ruby
[21:27:11] northfurr: has joined #ruby
[21:27:27] s00pcan: has joined #ruby
[21:27:29] jwaldrip: has joined #ruby
[21:28:24] moei: has joined #ruby
[21:29:27] devoldmx: has joined #ruby
[21:30:14] twistedpixels: has joined #ruby
[21:30:50] northfurr: has joined #ruby
[21:30:56] hxegon: has joined #ruby
[21:32:34] dtordable: has joined #ruby
[21:32:55] ricer2: has joined #ruby
[21:33:10] hmsimha_: has joined #ruby
[21:33:36] constantinexvi: has joined #ruby
[21:34:04] Musashi007: has joined #ruby
[21:34:08] dtordable: has joined #ruby
[21:34:13] Trieste: has joined #ruby
[21:34:25] Arkon: has joined #ruby
[21:34:50] rgrmatt: has joined #ruby
[21:35:26] ekinmur: has joined #ruby
[21:37:30] jamo: has joined #ruby
[21:38:00] shock_one: has joined #ruby
[21:38:30] dorei: has joined #ruby
[21:38:37] mattwashere: has joined #ruby
[21:41:18] trosborn: has joined #ruby
[21:41:19] dtordable: has joined #ruby
[21:41:27] Azure: has joined #ruby
[21:41:51] borkdude_: has joined #ruby
[21:42:12] Trieste: has joined #ruby
[21:44:52] harumph: has joined #ruby
[21:45:19] diegoaguilar: has joined #ruby
[21:45:48] Xeago: has joined #ruby
[21:46:25] nibbo: has joined #ruby
[21:49:00] dtordable: has joined #ruby
[21:49:29] Axsuul: has joined #ruby
[21:50:26] andykingking: has joined #ruby
[21:50:35] andykingking: has left #ruby: ()
[21:51:26] baweaver: has joined #ruby
[21:51:26] infernix: has joined #ruby
[21:51:49] sepp2k: has joined #ruby
[21:52:25] beauby: has joined #ruby
[21:53:02] dtordable: has joined #ruby
[21:55:20] magikid: has joined #ruby
[21:56:20] cek: darlings, where do I find gems/2.1.0/extensions/x86_64-linux/2.1.0-static/ dir in gem config? RbConfig::CONFIG doesn't know a thing about it. I assume its rubygems field.
[21:57:33] adaedra: `gem env` may hold the path you're looking for.
[21:59:03] cek: it doesn't
[22:00:15] bigmac: im trying to generate 2 arrays from repeated_permutation and combine into a hash
[22:00:23] bigmac: https://eval.in/464839
[22:00:30] bigmac: here is the best example i can come up with
[22:01:33] brendan-: has joined #ruby
[22:02:50] bigmac: the problem i have run into is when i try to increase the size of this duel repeated_permutation
[22:02:56] mattwashere: has joined #ruby
[22:03:00] bigmac: buffer over flow happens and ruby terminates
[22:03:40] bigmac: here is where it happens
[22:03:42] bigmac: loot+=cash.repeated_permutation(cnt).map(&:join)
[22:04:26] Ox0dea: bigmac: You've been at this for weeks. I bet if you described *what* you're trying to do instead of all this *how*, you could move on to the next part.
[22:04:45] i: has joined #ruby
[22:05:09] dopie: has joined #ruby
[22:05:12] Fire-Dragon-DoL: has joined #ruby
[22:05:34] bigmac: i have been at this for weeks lol
[22:06:03] apeiros: bigmac: a buffer overflow means it's a bug in ruby and should be reported. however, you realize how much data 4**n permutated values produce?
[22:06:23] bigmac: yes, i understand
[22:06:30] havenwood: bigmac: For a little fun: ['y', 'x'].repeated_permutation(10).with_index.map { |a, i| [a.join, i.to_s(4).tr('0123', 'abcd')] }.to_h
[22:06:48] apeiros: you should probably look into figuring a more efficient way to get what you want
[22:06:56] Arkon: has joined #ruby
[22:08:42] Melpaws: has joined #ruby
[22:08:46] apeiros: btw., you've got a weird way to write %w[a b c d]
[22:08:49] minimalism: has joined #ruby
[22:09:02] apeiros: (or [*"a".."d"] if you want to retain the ability to dynamically change the chars)
[22:09:03] northfurr: has joined #ruby
[22:09:58] bigmac: havenwood: thanks you for your example
[22:10:05] solocshaw: has joined #ruby
[22:11:32] fgo: has joined #ruby
[22:11:35] apeiros: havenwood: I wonder - with that much data, it might actually pay off to use each_with_object instead of map.to_h
[22:12:41] havenwood: apeiros: Aye, I started in that direction. I'm not sure!
[22:12:46] duckpupp1: has joined #ruby
[22:12:46] havenwood: bigmac: you're welcome
[22:14:35] dtordable: has joined #ruby
[22:18:03] nateberkopec: has joined #ruby
[22:18:17] darthdeus: has left #ruby: ("Leaving")
[22:22:26] shevy: apeiros that's a neat trick the * thing
[22:23:39] SirFunk: Anyone know if there is a way to share variables between workers in unicorn?
[22:24:27] Ox0dea: >> [*ObjectSpace.each_object].sample 3 # shevy: You never noticed it here?
[22:24:29] ruboto: Ox0dea # => [#<Encoding:IBM775>, " s.test_files = [\"test/psych/handlers/test_recorder.rb\", \"test/psych/json/ ...check link for more (https://eval.in/464840)
[22:24:38] Ox0dea: Hey, not all Strings!
[22:27:14] shevy: you play russian roulette
[22:27:32] shevy: you also pulled out an IBM encoding
[22:27:48] shevy: I hope you do feel appropriately guilty now
[22:28:12] trosborn: has joined #ruby
[22:28:17] northfurr: has joined #ruby
[22:29:37] Pupeno: has joined #ruby
[22:30:15] rgrmatt: has joined #ruby
[22:30:52] northfurr: has joined #ruby
[22:32:23] symm-: has joined #ruby
[22:33:13] yosiat: has joined #ruby
[22:33:41] northfurr: has joined #ruby
[22:34:08] banister: has joined #ruby
[22:34:58] framling: has joined #ruby
[22:35:23] shevy: if I have a big string, can I find the position of a substring? I need to read in all from the start of a text file, until the occurance of a specific substring, similar to __END__ but custom
[22:35:43] mattwashere: has joined #ruby
[22:35:47] northfurr: has joined #ruby
[22:36:18] Ox0dea: >> 'foobar'.index 'bar' # shevy?
[22:36:19] ruboto: Ox0dea # => 3 (https://eval.in/464841)
[22:37:36] andykingking1: has joined #ruby
[22:37:39] Ox0dea: Better would be to say something like `line = file.gets until line.chomp == '__END__'` or some such.
[22:37:46] andykingking1: has left #ruby: ()
[22:37:54] Ox0dea: And then the file will be open and ready to read from after the __END__.
[22:39:34] nofxx: ah... sipping a just brewed coffee... italian
[22:39:40] shevy: yeah I guess .index works \o/
[22:39:42] ruboto: here's a coffee, you seem to need it: ???
[22:40:05] shevy: this bot is really helpful in all situations of life
[22:40:59] nofxx: adaedra, ty... 1 month w/o espresso. Machine is repairing. Bad logistics... need to have 2 espresso machines ;)
[22:41:21] nofxx: but italian is nice too... dunno how it's called in your country.... moka, italian, bialetti....
[22:41:24] adaedra: I can't say I understand you, I don't drink coffee.
[22:42:01] nofxx: adaedra, qm nao bebe caf? bom sujeito n?o ?! (who doest drink coffee isn't a good fellow)
[22:42:11] nofxx: sounds better in portuguese ;)
[22:42:18] Ox0dea: adaedra: I can't say I understand you.
[22:42:42] adaedra: nofxx: too bad.
[22:43:30] bigmac: has joined #ruby
[22:46:29] northfurr: has joined #ruby
[22:47:01] apeiros: shevy: or just copy my scriptfile project from github and replace the token
[22:47:15] northfurr: has joined #ruby
[22:48:02] northfurr: has joined #ruby
[22:48:41] northfurr: has joined #ruby
[22:49:54] northfurr: has joined #ruby
[22:50:26] rgtk: has joined #ruby
[22:51:28] northfurr: has joined #ruby
[22:52:02] stannard: has joined #ruby
[22:52:27] peteyg: has joined #ruby
[22:53:56] northfurr: has joined #ruby
[22:55:58] skweek: has joined #ruby
[22:56:19] beauby: has joined #ruby
[22:57:26] Arkon: has joined #ruby
[22:58:18] apeiros: havenwood: hm, just occurred to me that `['y', 'x'].repeated_permutation(10).with_index.map { |a, i| [a.join, i.to_s(4).tr('0123', 'abcd')] }.to_h` is a very expensive way to perform what's essentially just a base transformation :)
[22:58:28] karapetyan: has joined #ruby
[22:59:17] Ox0dea: apeiros: That's why I asked bigmac to clarify what he's trying to do; there is absolutely a better way to do whatever it is.
[23:00:28] apeiros: value = key.tr('yx', '01').to_i(2).to_s(4).tr('0-3','a-d')
[23:01:20] gard_: has joined #ruby
[23:01:32] apeiros: Ox0dea: sure. same reason I said they should look into more efficient ways
[23:01:51] havenwood: i was just excited to use base 4
[23:02:08] rbennacer: has joined #ruby
[23:02:17] apeiros: you're so excited
[23:02:20] apeiros: you just can't hide it
[23:02:53] apeiros: you're about to lose control and I think you like it :D
[23:03:07] apeiros: damn disco sounds???
[23:03:26] shevy: I have a question, since hashes seem to keep track of the insertion order nowadays (which I find useful anyway) - does anyone know what the main argument was to have hashes retain the insertion order?
[23:03:50] apeiros: shevy: that it is often useful and relatively cheap
[23:04:07] apeiros: and that to manually do it outside of hashes is much more expensive
[23:07:09] bigmac__: has joined #ruby
[23:07:36] jdawgaz: has joined #ruby
[23:09:43] atomical: has joined #ruby
[23:11:10] banister: Mon_Ouie 'alut
[23:11:57] to_json: has joined #ruby
[23:11:57] to_json: has joined #ruby
[23:12:34] but3k4: has joined #ruby
[23:13:33] duckpupp1: has joined #ruby
[23:14:00] mattwashere: has joined #ruby
[23:14:32] dannluciano: has joined #ruby
[23:16:30] riotjones: has joined #ruby
[23:17:52] jdawgaz: has joined #ruby
[23:18:13] gambl0re: has joined #ruby
[23:18:29] goodcodeguy: has joined #ruby
[23:18:30] Arkon: has joined #ruby
[23:18:33] DLSteve: has joined #ruby
[23:18:41] jas02: has joined #ruby
[23:18:49] nateberkopec: has joined #ruby
[23:19:53] build22: has joined #ruby
[23:20:04] fedexo: has joined #ruby
[23:21:13] Fire-Dragon-DoL: has joined #ruby
[23:22:13] Fire-Dragon-DoL: has joined #ruby
[23:23:48] ivanskie: has joined #ruby
[23:24:03] jdawgaz: has joined #ruby
[23:25:47] build22: has joined #ruby
[23:27:29] charliesome: has joined #ruby
[23:31:53] lukaszes: has joined #ruby
[23:35:47] mattwashere: has joined #ruby
[23:36:23] b3nt_pin: has joined #ruby
[23:37:28] fgo: has joined #ruby
[23:37:55] Vile`: has joined #ruby
[23:39:12] bb010g: has joined #ruby
[23:41:17] duncannz: has joined #ruby
[23:42:19] duncannz: has joined #ruby
[23:43:26] SCHAAP137: has joined #ruby
[23:43:57] ruurd: has joined #ruby
[23:46:21] mattwashere: has joined #ruby
[23:47:05] _blizzy_: has joined #ruby
[23:49:14] s00pcan: has joined #ruby
[23:49:40] devl: has joined #ruby
[23:49:40] ruurd: has joined #ruby
[23:53:16] saber: has joined #ruby
[23:55:45] QORRiE: has joined #ruby
[23:56:07] bruno-: has joined #ruby
[23:59:10] chipotle: has joined #ruby
[23:59:15] shevy: anyone happens to have some experience with youtube + ruby bindings? aka how simple would it be to query the title of a youtube video from the commandline through a ruby script, if all that one has is the URL to the youtube video in question?
[23:59:25] freerobby: has joined #ruby