« Back to channel list

#ruby - 04 August 2017

« Back 1 day Forward 1 day »
[00:04:16] nobitanobi: has joined #ruby
[00:04:47] kt: has joined #ruby
[00:16:10] hays: has joined #ruby
[00:17:28] hays: i have a hash and i want to iterate through it to create another hash. I've been doing this by just creating a new hash and then iterating through the old one and populating the hash as I go. Is there a more idiomatic way to do this?
[00:17:37] hays: I see Hash[ ] as a possibility
[00:17:54] hays: but it looks weird if there is a block in there
[00:18:43] adam12: each_with_object or reduce maybe?
[00:18:50] adam12: Show us what you've already done
[00:19:50] adam12: err, inject not reduce.
[00:20:04] hays: its on another computer.. let me see if i can reproduce it
[00:23:38] cadillac_: has joined #ruby
[00:24:35] hays: adam12: this is a bit contrived... the hash is much bigger than this.. im basically pulling items out of each entry and making a new entry in the new hash. https://bpaste.net/show/e5260afe1dd6
[00:24:59] kt: has joined #ruby
[00:25:13] hays: v+1 is a proxy for some sort of set of operations or function that would return the new value
[00:25:14] FahmeF: has joined #ruby
[00:27:13] adam12: hays_: each_with_object - https://eval.in/private/4c060e51a23a8a
[00:28:34] hays: huh.. that's interesting. so that a in |i, a| is a destination
[00:28:56] adam12: Sorry, don't follow?
[00:29:10] hays: evens = (1..10).each_with_object([]) { |i, a| a << i*2 }
[00:29:45] z0mbee: has joined #ruby
[00:29:56] hays: i've never seen this.. style/syntax
[00:30:40] adam12: hays_: Ah. It's a fancier version than using inject.
[00:31:05] adam12: hays_: but yes, you'd call the variable a the "accumulator" usually. It persists through the loop.
[00:31:31] hays: why is it being passed a []
[00:31:38] bronson: has joined #ruby
[00:32:05] adam12: So we initialize with an empty hash as our accumulator, iterate through our hash like we normally do, but receive an extra arg as the accumulator, which we stick our new values in.
[00:32:19] adam12: What do you mean [ ]?
[00:32:49] hays: each_with_object in that example looks like its being passed an array
[00:33:17] adam12: It's a hash. each_with_object( { } )
[00:33:50] adam12: I'm using square-bracket notation to set the value of course.
[00:34:54] Dimik: has joined #ruby
[00:35:21] adam12: Unless you mean the example you posted about evens = ?
[00:36:51] hays: sorry, missed your link. I understand now
[00:36:55] kt: has joined #ruby
[00:37:10] hays: im still a bit puzzled how something like that would work under the hood
[00:38:19] goyox86: has joined #ruby
[00:39:41] hays: i wonder if there are docs for rubinius like for mri ruby.. i could see the source code for it
[00:42:22] jinie_: has joined #ruby
[00:44:29] jackjackdripper: has joined #ruby
[00:47:31] hays: i think i need to understand yield
[00:51:04] adam12: hays_: that would help. It's super powerful
[00:51:34] hays: yeah its one of the ruby concepts that haven't stuck well for me.. im used to coming at it from another syntactic direction
[00:52:48] jackjackdripper: has joined #ruby
[00:56:30] bruno-: has joined #ruby
[00:57:13] kt: has joined #ruby
[01:02:18] umaaji: has joined #ruby
[01:04:01] RahulT: has joined #ruby
[01:04:42] brent__: has joined #ruby
[01:04:45] elsevero: has joined #ruby
[01:05:28] dlitvak: has joined #ruby
[01:06:39] phinxy: has joined #ruby
[01:07:05] adam12: hays: https://eval.in/private/4a885ccd3137d0 a primitive version of each_with_object. Not sure if it helps.
[01:08:42] dstrunk: has joined #ruby
[01:09:25] postmodern: has joined #ruby
[01:10:10] hays: is that 'each' on line 4 a ruby keyword?
[01:10:12] cagomez: has joined #ruby
[01:10:54] adam12: hays: I'm adding a method to a hash, so it implies `each` that already exists on that hash.
[01:11:44] chouhoulis: has joined #ruby
[01:12:13] kt: has joined #ruby
[01:13:35] cam27: has joined #ruby
[01:18:20] tastygradient: has joined #ruby
[01:21:11] mim1k: has joined #ruby
[01:22:15] jenrzzz: has joined #ruby
[01:22:15] jenrzzz: has joined #ruby
[01:22:49] kt: has joined #ruby
[01:23:14] thecommongeek: has joined #ruby
[01:26:11] Nilium: has joined #ruby
[01:27:27] cam27: has joined #ruby
[01:31:46] charliesome: has joined #ruby
[01:32:03] gizmore: has joined #ruby
[01:35:31] Nilium: has joined #ruby
[01:37:00] paradisaeidae: has joined #ruby
[01:37:04] paradisaeidae_: has joined #ruby
[01:40:35] thecommongeek: has joined #ruby
[01:41:42] dstrunk: has joined #ruby
[01:42:30] dar123: has joined #ruby
[01:44:30] Nilium: has joined #ruby
[01:45:24] ramfjord: has joined #ruby
[01:45:52] llua: has joined #ruby
[01:45:57] xuanrui: has joined #ruby
[01:47:17] kt: has joined #ruby
[01:49:03] my123: has joined #ruby
[01:49:04] my123: has joined #ruby
[01:54:07] Joufflu: has joined #ruby
[01:59:23] veex: has joined #ruby
[01:59:48] kt: has joined #ruby
[02:01:36] RahulT: has joined #ruby
[02:02:04] hays__: has joined #ruby
[02:04:35] imajes: has joined #ruby
[02:05:46] http_GK1wmSU: has joined #ruby
[02:08:21] http_GK1wmSU: has left #ruby: ()
[02:10:22] kt: has joined #ruby
[02:13:38] jamal7: has joined #ruby
[02:13:41] cam27: has joined #ruby
[02:13:45] dar123: has joined #ruby
[02:16:52] naprimer: has joined #ruby
[02:19:09] ramfjord: has joined #ruby
[02:21:09] segy_: has joined #ruby
[02:23:38] Jameser: has joined #ruby
[02:25:28] kt: has joined #ruby
[02:26:55] t-recx: has joined #ruby
[02:30:25] goyox86: has joined #ruby
[02:31:54] cam27: has joined #ruby
[02:32:19] bronson: has joined #ruby
[02:35:33] Dimik: has joined #ruby
[02:39:20] ramfjord: has joined #ruby
[02:49:56] sunrunner20: has joined #ruby
[02:52:27] duderonomy: has joined #ruby
[02:53:27] QualityAddict: has joined #ruby
[02:53:31] RahulT: has joined #ruby
[02:58:03] cam27: has joined #ruby
[02:59:56] ramfjord: has joined #ruby
[03:00:09] cadillac_: has joined #ruby
[03:01:29] nobitanobi: has joined #ruby
[03:06:45] kt: has joined #ruby
[03:06:45] grant: has joined #ruby
[03:09:15] hays__: it seems like ruby has too many ways to do blocks/procs/lambdas/methods?
[03:09:28] hays__: reading http://www.reactive.io/tips/2008/12/21/understanding-ruby-blocks-procs-and-lambdas
[03:10:36] hays__: is there a kind of standard arsenal to be familiar with here or do people just use whatever
[03:11:09] baweaver: Not sure I agree with that post
[03:11:29] baweaver: it makes a habit of using bang methods (collect!) over non-bang (collect) which mutate
[03:11:42] baweaver: nitpickityness aside though...
[03:11:51] baweaver: 99% of the time you're fine with only blocks
[03:12:26] baweaver: and then the three methods to really know are map, select, and reduce from Enumerable
[03:12:39] baweaver: though I'd still read all of Enumerable because there's a lot of good stuff in there
[03:12:42] gix: has joined #ruby
[03:12:44] baweaver: &ri Enumerable
[03:12:44] `derpy: http://ruby-doc.org/core-2.4.1/Enumerable.html
[03:13:25] baweaver: >> [1,2,3].map { |x| x * 2 } # map applies a function (block) to each element and returns a NEW array with the result
[03:13:26] ruby[bot]: baweaver: # => [2, 4, 6] (https://eval.in/841320)
[03:13:56] baweaver: >> [1,2,3].select { |x| x.even? } # select uses the function to find all elements for which it returns true
[03:13:58] ruby[bot]: baweaver: # => [2] (https://eval.in/841323)
[03:14:03] domgetter: has joined #ruby
[03:14:31] hays__: this seems sufficient https://eval.in/841324
[03:14:34] baweaver: >> [1,2,3].reduce(0) { |accumulator, x| accumulator + x } # reduce is a bit trippier. It uses a function to fold the elements into one element
[03:14:35] ruby[bot]: baweaver: # => 6 (https://eval.in/841325)
[03:15:07] baweaver: the return value of each iteration is the new accumulator or memo or whatever people call it now
[03:15:10] domgetter: reduction duction, what's your function?
[03:15:15] hays__: to meet DRY in terms of whether to use procs/blocks etc
[03:15:35] hays__: baweaver: yeh im familiar with FP concepts
[03:15:35] baweaver: I rarely if ever use method()
[03:15:41] domgetter: baweaver I just call it a "running total"
[03:15:45] baweaver: I'd just use anonymous functions
[03:16:05] baweaver: domgetter: I hesitate a bit because I could be accumulating into a new array or hash too
[03:16:51] baweaver: Remember though that too DRY is BRITTLE - Badly refactored into tiny things lacking expressiveness.
[03:17:27] baweaver: Never sure how much people know :)
[03:17:44] hays__: it just seems wierd a little to have all these concepts that are a bit redundant.
[03:17:50] hays__: Procs, blocks, lambdas
[03:18:22] hays__: so blocks is what people typically stick with it seems like
[03:18:25] baweaver: For the most part though blocks do fine
[03:18:37] baweaver: Most of the others are edge cases
[03:18:54] hays__: so if I am writing one of these methods that takes something like a block/proc.. it should probably be a block
[03:18:55] domgetter: hays__ every method can receive one block in Ruby
[03:19:13] baweaver: Yep, and just use yield from there
[03:20:32] ramfjord: has joined #ruby
[03:20:32] Joufflu: how is this evaluating to false
[03:20:33] Joufflu: a = TRUE && a = FALSE
[03:20:54] leandrobighetti: has joined #ruby
[03:20:59] baweaver: >> true && false
[03:21:00] ruby[bot]: baweaver: # => false (https://eval.in/841326)
[03:21:12] baweaver: Basic Boolean logic I reckon
[03:21:12] hays__: because a=false is false?
[03:21:38] mim1k: has joined #ruby
[03:21:41] Joufflu: ACTION throws in towel
[03:21:43] baweaver: ACTION wonders why they're all caps
[03:21:56] Joufflu: yah; i dunno
[03:22:03] ruby[bot]: baweaver: # => true (https://eval.in/841327)
[03:22:20] bougyman: what are TRUE and FALSE?
[03:22:20] hays__: didnt know that either
[03:22:21] bougyman: those are constants.
[03:22:22] bougyman: [3] pry(main)> a = true && a = false
[03:22:39] ruby[bot]: baweaver: # => false (https://eval.in/841328)
[03:22:39] bougyman: [6] pry(main)> a = TRUE && a = FALSE
[03:22:58] baweaver: Didn't know it did that, odd. (the all caps true/false)
[03:23:02] bougyman: dunno what ruby version is giving you that.
[03:23:09] bougyman: I didn't, either.
[03:23:12] bougyman: never seen that.
[03:23:12] baweaver: >> RUBY_VERSION
[03:23:17] bougyman: I've seen TrueClass and FalseClass
[03:23:18] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[03:23:19] Joufflu: whatever repl.it runs
[03:23:22] bougyman: but not TRUE and FALSE
[03:23:26] baweaver: ....pesky thing
[03:23:30] baweaver: >> RUBY_VERSION
[03:23:35] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[03:23:43] baweaver: It's 2.3.0 last I knew
[03:24:14] Joufflu: ruby 2.3.1p112
[03:24:19] bougyman: [7] pry(main)> RUBY_VERSION
[03:24:22] bougyman: => "2.2.3" here
[03:25:07] hays__: the = has precedence over &&, so a=TRUE evaluates to true, a=FALSE evaluates false. then true && false is false
[03:25:11] Joufflu: yeah I thought of that from liars paradox and just gave it a shot thinking it was going to spit out an error; yet it got evaluated
[03:25:46] hays__: liars paradox which one
[03:26:00] Joufflu: This line is true
[03:26:01] hays__: strong liar?
[03:26:06] Joufflu: The first line is a lie
[03:26:17] hays__: ahh weak liar
[03:26:22] RahulT: has joined #ruby
[03:28:37] hays__: there is no way to encode 'this line is true' in ruby and then negate it
[03:29:04] hays__: in the same sense as the liar paradox
[03:34:51] RahulT: has joined #ruby
[03:35:16] kt: has joined #ruby
[03:35:21] RahulT: has joined #ruby
[03:36:10] hays__: Joufflu: "This statement is false" is my favorite
[03:36:39] leandrobighetti: has joined #ruby
[03:36:41] Joufflu: yeah right off the bat it's hard to digest
[03:40:07] Godd2: has joined #ruby
[03:40:37] sunrunner20: has joined #ruby
[03:40:44] hays__: the thing about it is that its a statement that asserts the truth or falseness of another statement explicitly
[03:41:04] ramfjord: has joined #ruby
[03:41:39] leandrobighetti: has joined #ruby
[03:44:04] Xiti: has joined #ruby
[03:46:45] gusrub: has joined #ruby
[03:47:38] kt: has joined #ruby
[03:54:55] m27frogy: has joined #ruby
[04:02:54] segy_: has joined #ruby
[04:06:39] Joufflu: has joined #ruby
[04:07:25] segy: has joined #ruby
[04:09:18] RahulT: has joined #ruby
[04:11:38] segy_: has joined #ruby
[04:13:13] kt: has joined #ruby
[04:14:52] bambanx: has joined #ruby
[04:15:32] segy: has joined #ruby
[04:16:30] ramfjord: has joined #ruby
[04:17:23] segy-: has joined #ruby
[04:19:49] segy_: has joined #ruby
[04:19:56] mim1k: has joined #ruby
[04:21:47] segy: has joined #ruby
[04:25:47] segy_: has joined #ruby
[04:25:56] kt: has joined #ruby
[04:26:40] swills: has joined #ruby
[04:27:10] segy-: has joined #ruby
[04:28:11] wilbert: has joined #ruby
[04:29:10] baroquebobcat: has joined #ruby
[04:29:35] cahoots: has joined #ruby
[04:31:28] segy_: has joined #ruby
[04:33:47] bronson: has joined #ruby
[04:38:14] Godd2: The fundamental problem is whether or not you can have meaning without referent.
[04:40:43] jackjackdripper: has joined #ruby
[04:41:06] kt: has joined #ruby
[04:45:59] jenrzzz: has joined #ruby
[04:45:59] jenrzzz: has joined #ruby
[04:47:44] nofxxxx: has joined #ruby
[04:56:40] brent__: has joined #ruby
[04:56:59] kt: has joined #ruby
[04:59:13] patrontechnosoft: has joined #ruby
[04:59:44] hanetzer: has joined #ruby
[05:00:56] hanetzer: question. why are 'bigdecimal io-console openssl psyc rdoc rake minitest net-telnet did_you_mean test-unit power_assert xmlrpc' getting installed to ~/.gem ?
[05:01:12] duderonomy: has joined #ruby
[05:04:47] havenwood: hanetzer: https://stdgems.org/
[05:04:47] govg: has joined #ruby
[05:05:36] havenwood: hanetzer: this ^ site explains
[05:05:54] hanetzer: interesting. how then is archlinux bypassing this...
[05:07:24] havenwood: hanetzer: Different distros choose different flags for the default location. The --user-install flag is one major setting that'll make the location vary.
[05:07:57] havenwood: hanetzer: dev or prod?
[05:08:40] hanetzer: havenwood: currently indev. its a new sort of windows runtime based on musl
[05:08:43] havenwood: hanetzer: Here's a nice Ruby setup on arch linux with chruby, which just changes env vars to set the environment: https://gist.github.com/jhass/8839655bb038e829fba1
[05:10:05] havenwood: hanetzer: Where are the default gems installed? Check, for example: gem env gemdir
[05:10:16] havenwood: hanetzer: gem which bigdecimal
[05:10:20] kt: has joined #ruby
[05:10:20] hanetzer: havenwood: its not quite to the point I can do that.
[05:10:41] havenwood: hanetzer: what's the holdup at present?
[05:11:05] havenwood: hanetzer: `gem` not working?
[05:11:17] hanetzer: havenwood: having issue setting up the env, most likely user error on my part.
[05:15:00] brent__: has joined #ruby
[05:15:49] ramfjord: has joined #ruby
[05:20:20] kt: has joined #ruby
[05:22:21] Bock: has joined #ruby
[05:23:05] TomyLobo3: has joined #ruby
[05:24:21] RahulT: has joined #ruby
[05:29:48] cam27: has joined #ruby
[05:31:29] ramfjord: has joined #ruby
[05:33:27] RahulT: has joined #ruby
[05:34:45] bronson: has joined #ruby
[05:37:47] kt: has joined #ruby
[05:40:13] conta: has joined #ruby
[05:44:59] cam27: has joined #ruby
[05:45:37] paradisaeidae: has joined #ruby
[05:45:42] paradisaeidae_: has joined #ruby
[05:50:20] kt: has joined #ruby
[05:50:22] minimalism: has joined #ruby
[05:51:52] RahulT: has joined #ruby
[05:52:33] tvw: has joined #ruby
[05:54:53] RahulT: has joined #ruby
[05:56:25] djbkd: has joined #ruby
[06:02:48] ltem: has joined #ruby
[06:03:38] yabbes_: has joined #ruby
[06:06:15] jenrzzz: has joined #ruby
[06:06:15] jenrzzz: has joined #ruby
[06:07:24] ramfjord: has joined #ruby
[06:15:24] anisha: has joined #ruby
[06:16:16] anas: has joined #ruby
[06:17:14] cam27: has joined #ruby
[06:17:34] paradisaeidae: has joined #ruby
[06:17:48] paradisaeidae_: has joined #ruby
[06:23:50] code_zombie_: has joined #ruby
[06:24:28] dcunit3d: has joined #ruby
[06:28:58] conta: has joined #ruby
[06:35:17] bronson: has joined #ruby
[06:36:54] RahulT: has joined #ruby
[06:39:09] kt: has joined #ruby
[06:41:47] psmolen: has joined #ruby
[06:43:12] b0mbnet: has joined #ruby
[06:43:29] ramfjord: has joined #ruby
[06:45:14] jenrzzz: has joined #ruby
[06:45:14] jenrzzz: has joined #ruby
[06:48:12] vali: has joined #ruby
[06:48:48] dionysus69: has joined #ruby
[06:54:13] kt: has joined #ruby
[06:54:28] _aeris_: has joined #ruby
[06:56:05] FahmeF: has joined #ruby
[06:59:04] Beams: has joined #ruby
[06:59:05] ramfjord: has joined #ruby
[06:59:47] digitalnomad: has joined #ruby
[07:00:01] rabajaj: has joined #ruby
[07:02:45] cam27: has joined #ruby
[07:04:54] vondruch: has joined #ruby
[07:06:58] Bhootrk_: has joined #ruby
[07:15:04] Mgtuiw211: has joined #ruby
[07:15:18] Silthias: has joined #ruby
[07:15:33] vindvaki: has joined #ruby
[07:15:43] dennisvennink: has joined #ruby
[07:15:53] sysvalve: has joined #ruby
[07:16:50] simmaniac: has joined #ruby
[07:19:13] djbkd: has joined #ruby
[07:22:48] tirej: has joined #ruby
[07:23:22] pocketprotector: has joined #ruby
[07:26:49] mark_66: has joined #ruby
[07:27:01] TvL: has joined #ruby
[07:29:24] kt: has joined #ruby
[07:30:18] hanetzer1: has joined #ruby
[07:30:25] TomyWork: has joined #ruby
[07:32:20] MrSparkle: has joined #ruby
[07:33:53] hanetzer: has joined #ruby
[07:34:59] ramfjord: has joined #ruby
[07:35:16] http_GK1wmSU: has joined #ruby
[07:36:08] bronson: has joined #ruby
[07:37:28] http_GK1wmSU: has left #ruby: ()
[07:45:56] cam27: has joined #ruby
[07:45:59] digitalnomad: has joined #ruby
[07:48:14] FahmeF: has joined #ruby
[07:52:14] kt: has joined #ruby
[07:52:31] CrazyEddy: has joined #ruby
[07:52:57] leandrobighetti: has joined #ruby
[07:58:58] MichaelBurge: has joined #ruby
[07:59:09] romankapitonov: has joined #ruby
[08:02:23] mikecmpbll: has joined #ruby
[08:03:32] pygospa: has joined #ruby
[08:05:18] pandaant: has joined #ruby
[08:08:58] ur5us: has joined #ruby
[08:09:00] ineb: mfw i bought a 144hz monitor and realized the hdmi output only supports 60hz
[08:10:34] InfinityFye: has joined #ruby
[08:11:36] marr: has joined #ruby
[08:13:08] dcunit3d: has joined #ruby
[08:13:11] hanetzer: ineb: that's the usual. I have one (linux can only push 120hz on amdgpu so far, though. still good)
[08:13:21] hanetzer: gotta use dvi or maybe displayport
[08:13:43] hanetzer: dual-link dvi, for that matter.
[08:15:03] ineb: hanetzer: the monitor only has DP and HDMI :/
[08:16:15] hanetzer: then dp it will have to be, probably.
[08:17:31] apparition: has joined #ruby
[08:18:17] cam27: has joined #ruby
[08:18:48] CrazyEddy: has joined #ruby
[08:18:53] CrazyEddy: has joined #ruby
[08:21:29] kt: has joined #ruby
[08:26:23] benjen: has joined #ruby
[08:30:23] kt: has joined #ruby
[08:31:35] ltem: has joined #ruby
[08:33:06] yosafbridge: has joined #ruby
[08:34:10] mim1k: has joined #ruby
[08:35:22] anisha: has joined #ruby
[08:37:05] bronson: has joined #ruby
[08:38:21] kkiero: has joined #ruby
[08:43:35] tomphp: has joined #ruby
[08:43:45] mikecmpbll: has joined #ruby
[08:44:29] dennisvennink: has joined #ruby
[08:51:39] MichaelBurge_: has joined #ruby
[08:55:05] kt: has joined #ruby
[08:55:10] jenrzzz: has joined #ruby
[08:55:10] jenrzzz: has joined #ruby
[09:06:42] konsolebox: has joined #ruby
[09:14:10] dcunit3d: has joined #ruby
[09:15:53] PaulCapestany: has joined #ruby
[09:20:55] cagomez: has joined #ruby
[09:28:07] Emmanuel_Chanel: has joined #ruby
[09:28:14] charliesome: has joined #ruby
[09:29:53] rgtk: has joined #ruby
[09:30:43] tomphp: has joined #ruby
[09:35:26] tomphp: has joined #ruby
[09:35:28] ShekharReddy: has joined #ruby
[09:35:38] anisha: has joined #ruby
[09:35:47] ramfjord: has joined #ruby
[09:36:09] ayonkhan: has joined #ruby
[09:37:03] mtkd: has joined #ruby
[09:38:40] bronson: has joined #ruby
[09:48:41] kt: has joined #ruby
[09:51:22] ramfjord: has joined #ruby
[09:51:55] cagomez: has joined #ruby
[09:55:15] mustaffa_: has joined #ruby
[09:55:29] lookatme: has joined #ruby
[09:55:29] tvw: has joined #ruby
[09:55:53] MarkBilk: has joined #ruby
[10:00:35] domgetter: has joined #ruby
[10:03:35] conta: has joined #ruby
[10:07:46] cagomez: has joined #ruby
[10:11:50] ramfjord: has joined #ruby
[10:15:29] dcunit3d: has joined #ruby
[10:21:45] acalycine: has joined #ruby
[10:27:25] ramfjord: has joined #ruby
[10:31:49] Terens: has joined #ruby
[10:32:17] kkiero: has left #ruby: ()
[10:33:21] ur5us: has joined #ruby
[10:34:01] vali: has joined #ruby
[10:36:39] ur5us_: has joined #ruby
[10:38:26] InfinityFye: has joined #ruby
[10:38:31] cagomez: has joined #ruby
[10:38:49] universa1: has joined #ruby
[10:39:29] bronson: has joined #ruby
[10:41:46] noe: has joined #ruby
[10:47:56] ams__: has joined #ruby
[10:52:27] _sfiguser: has joined #ruby
[10:53:11] jaruga: has joined #ruby
[10:54:22] cagomez: has joined #ruby
[11:01:18] dlitvak: has joined #ruby
[11:05:51] aupadhye: has joined #ruby
[11:11:33] high_fiver: has joined #ruby
[11:12:36] Trynemjoel: has joined #ruby
[11:15:56] dcunit3d: has joined #ruby
[11:17:15] yabbes: has joined #ruby
[11:17:43] ramfjord: has joined #ruby
[11:19:53] dionysus69: is there a ruby library that can take one photo/pdf and compare it to another and see if there's a difference?
[11:20:12] dionysus69: i am trying to validate if user uploads a signed document, physically signed and scanned
[11:20:15] kapil___: has joined #ruby
[11:21:21] jinie_: has joined #ruby
[11:21:37] dminuoso: dionysus69: What algorithm are you looking for?
[11:22:17] dionysus69: I am looking for some library that can analyze png/jpg/pdf as a photo
[11:22:47] dionysus69: and detect if changes have been made, like a signature for example
[11:22:55] dennisvennink: has joined #ruby
[11:24:03] dminuoso: dionysus69: There's various metrics to go by.
[11:24:27] dminuoso: dionysus69: RMSE, PSNR, SSIM
[11:24:46] dminuoso: dionysus69: But if you want to look for specific things being changed you basically have no choice than to find a machine learning solution.
[11:25:06] dionysus69: hmm that quickly became overly complicated :D
[11:25:43] dminuoso: dionysus69: And those btw are more quality focused.
[11:25:52] dminuoso: Then there's things like perceptually based metrics..
[11:27:55] dminuoso: dionysus69: If it was just a digital image it would be simple. But because the image was re-digitized, you have to assume that the image was not aligned perfectly, slightly folded..
[11:28:02] dminuoso: Different lightning
[11:28:07] dminuoso: Bad printer
[11:28:11] dionysus69: I have no idea what you are talking about to be honest :D I never delved into machine learning :)
[11:29:17] dionysus69: step one would be to crop a white rectangular shape, then compare to the original :S
[11:29:17] dminuoso: dionysus69: I mean what you could do, is provide a box and give some graphical hints to find that box. That could simplify the process.
[11:29:42] dminuoso: dionysus69: And how do you find where to crop?
[11:29:47] dionysus69: yep, I could do that, make a thick bordered rectangular box for example
[11:30:13] dionysus69: I could crop by giving whole document a second thick rectangular box, perhaps dashed?
[11:30:22] dminuoso: dionysus69: What if the paper was slightly folded so that the rectangular shape now appears as an octogon?
[11:30:29] dionysus69: dashed border for doc and solid border for signature for example
[11:30:53] http_GK1wmSU: has joined #ruby
[11:30:58] dionysus69: what is octogon :D
[11:31:10] dionysus69: looks like a angular circle :D
[11:31:48] dminuoso: dionysus69: think irregular octagon :P
[11:32:20] http_GK1wmSU: has left #ruby: ()
[11:33:09] Terens: I want to have several devices controlled by a centralized cloud app. First issue I have was with data sync. However data sync can be solved somewhat easilly since changes would be applied only on the cloud and sent to each device. My other issue is with RPC or something like that.
[11:33:16] dionysus69: i dont wanna become a AI professional just to find a signature :D I ll deal with that later :P
[11:33:21] ramfjord: has joined #ruby
[11:34:10] Terens: If I use websockets then there is no easy way to tell if device is connected or whether message is delivered. I have to implement timeouts/retrying/ordering myself.
[11:34:40] Terens: I looked at rabbitmq but I am not sure whether it solves my problems.
[11:39:33] VladGh: has joined #ruby
[11:40:28] bronson: has joined #ruby
[11:41:35] bane_: has joined #ruby
[11:43:24] dstrunk: has joined #ruby
[11:50:03] Paraxial: has joined #ruby
[11:50:09] Pumukel: has joined #ruby
[11:51:10] Paraxial: has joined #ruby
[11:52:53] Paraxial: has joined #ruby
[11:53:05] tacoboy: has joined #ruby
[11:54:36] ldnunes: has joined #ruby
[11:55:09] Paraxial: has joined #ruby
[11:56:08] cagomez: has joined #ruby
[12:04:30] anisha: has joined #ruby
[12:04:47] apparition47: has joined #ruby
[12:05:18] bmurt: has joined #ruby
[12:06:30] InfinityFye: has joined #ruby
[12:12:06] quiller: has joined #ruby
[12:12:10] thecommongeek: has joined #ruby
[12:14:34] anisha: has joined #ruby
[12:14:43] GinoMan: has joined #ruby
[12:16:08] darix: terens: amqp can be a good transport medium for this. especially as it can have persistent queues (if that is important for you) other options might be zeromq, MQTT
[12:16:18] darix: a lightweight MQTT implementation is mosquitto
[12:16:26] darix: if i recall correctly newer rabbitmq supports it too?
[12:16:36] cagomez: has joined #ruby
[12:16:56] dcunit3d: has joined #ruby
[12:18:34] GinoMan2440: has joined #ruby
[12:19:30] sepp2k: has joined #ruby
[12:19:52] dn`: has joined #ruby
[12:23:22] konsolebox: has joined #ruby
[12:25:42] cadillac_: has joined #ruby
[12:26:50] selim_: has joined #ruby
[12:34:40] Guest30814: has joined #ruby
[12:35:31] Guest30814: have any idea how should looks like csv with assosiation??
[12:35:40] GodFather: has joined #ruby
[12:39:27] nopolitica: has joined #ruby
[12:40:14] Guest30814: ok i have a array with [:name, :smth, :smt2, interests: [interest1:[:name, :id], interest2:[:name, :id] ]]
[12:40:41] Guest30814: how should build csv from this
[12:40:53] oleo: has joined #ruby
[12:41:49] tAn: has joined #ruby
[12:45:39] Drakevr: has joined #ruby
[12:48:53] Xiti: has joined #ruby
[12:51:19] Tempesta: has joined #ruby
[12:51:25] _aeris_: has joined #ruby
[12:54:29] ldnunes: has joined #ruby
[12:57:44] TheHodge: has joined #ruby
[13:00:57] milardovich: has joined #ruby
[13:01:27] thbar: has joined #ruby
[13:02:40] segy_: has joined #ruby
[13:03:31] agimenez: has joined #ruby
[13:05:39] sysvalve: has joined #ruby
[13:08:30] milardovich: has joined #ruby
[13:09:06] anisha: has joined #ruby
[13:11:50] nobitanobi: has joined #ruby
[13:14:14] guardian: hello, when using to_yaml on a hash, when keys are symbols they are serialized with a leading ':'
[13:14:16] guardian: is there a way to avoid that?
[13:17:46] dcunit3d: has joined #ruby
[13:25:36] imajes: has joined #ruby
[13:26:14] MarkBilk: has joined #ruby
[13:26:54] cdg: has joined #ruby
[13:32:59] DLSteve: has joined #ruby
[13:33:32] ramfjord: has joined #ruby
[13:34:08] ur5us: has joined #ruby
[13:41:32] bronson: has joined #ruby
[13:42:20] t-recx: has joined #ruby
[13:43:46] nobitanobi: has joined #ruby
[13:50:05] DTZUZO: has joined #ruby
[13:51:32] noe: has joined #ruby
[13:53:06] swills: has joined #ruby
[13:57:51] nobitanobi: has joined #ruby
[14:00:41] xenops: has joined #ruby
[14:01:15] thejoecarroll: has joined #ruby
[14:09:21] Rapture: has joined #ruby
[14:10:44] noe: has joined #ruby
[14:13:18] Mon_Ouie: has joined #ruby
[14:14:50] tomphp: has joined #ruby
[14:15:12] alex``: has joined #ruby
[14:18:28] dcunit3d: has joined #ruby
[14:21:23] segy_: has joined #ruby
[14:21:24] synthroid: has joined #ruby
[14:21:40] chouhoulis: has joined #ruby
[14:26:33] darix: guardian: make the keys strings before you serialize them
[14:28:39] guardian: sounds like the only option
[14:33:33] Ishido: has joined #ruby
[14:37:56] houhoulis: has joined #ruby
[14:38:17] faraco: has joined #ruby
[14:38:35] faraco: has left #ruby: ("Leaving")
[14:44:30] runescape07rsps: has joined #ruby
[14:46:53] impermanence: has joined #ruby
[14:46:55] rippa: has joined #ruby
[14:47:09] darix: guardian: https://stackoverflow.com/questions/12555678/hashstringify-keys-undefined#12555810
[14:47:16] darix: guardian: you arent the first person who needs it ;)
[14:47:29] [Butch]: has joined #ruby
[14:50:07] Ryzokuken: has joined #ruby
[14:50:15] impermanence: I need to get the sums and means of attribute values from an array of objects based on a particular object attribute
[14:50:36] impermanence: Is there a Ruby way to do this?
[14:50:46] impermanence: bit more specific: https://gist.github.com/jonassteinberg1/1819f5a55ac4ddb6d3726e9ed53f7b62
[14:52:55] chouhoulis: has joined #ruby
[14:53:11] bruno-: has joined #ruby
[14:55:06] mabus44: has joined #ruby
[14:55:10] eip`: has joined #ruby
[14:55:51] eip`: hi guys, ruby noob here, I have a datamapper::collection, how can I print on screen a field of it ?
[14:56:10] eip`: hope question is clear enough
[14:57:53] Mon_Ouie: impermanence: Use group_by(&:category) to get a hash that maps each category to an array of objects of that category, then reduce to calculate the sums
[14:58:29] impermanence: Mon_Ouie: oh, okay. I'll start there.
[14:58:56] impermanence: I have to drop for one minute
[14:59:23] guacamole: has joined #ruby
[15:00:56] noname1: has joined #ruby
[15:01:52] polishdub: has joined #ruby
[15:02:05] impermanence: has joined #ruby
[15:02:10] vondruch: has joined #ruby
[15:03:22] synthroid: has joined #ruby
[15:04:00] acalycine: has joined #ruby
[15:04:00] acalycine: has joined #ruby
[15:05:30] vondruch_: has joined #ruby
[15:07:20] guacamole: has joined #ruby
[15:08:18] nadir: has joined #ruby
[15:13:02] guacamole: has joined #ruby
[15:15:06] eelster: has joined #ruby
[15:15:30] eip`: lets say I do something like: data = blabla::bla.first(:name => name)
[15:15:53] eip`: with data.inspect I can see the fields, in this case "name"
[15:16:13] eip`: but what if I had more fields, and I wanted to just print the "name" field?
[15:16:54] guacamole: has joined #ruby
[15:18:44] dar123: has joined #ruby
[15:20:32] guacamole: has joined #ruby
[15:22:33] impermanence: has joined #ruby
[15:23:06] impermanence: Mon_Oui: can you paste your original response to me, please? I lost my session, but wanted to ask you a question.
[15:23:42] guacamole: has joined #ruby
[15:24:03] Mon_Ouie: impermanence: Use group_by(&:category) to get a hash that maps each category to an array of objects of that category, then reduce to calculate the sums
[15:24:16] impermanence: Mon_Ouie: thank you
[15:24:49] impermanence: Mon_Ouie: what do you mean when you say "reduce"?
[15:24:56] Mon_Ouie: &ri Enumerable#reduce
[15:24:57] `derpy: http://ruby-doc.org/core-2.4.1/Enumerable.html#method-i-reduce
[15:25:12] cahoots: has joined #ruby
[15:27:31] code_zombie_: has joined #ruby
[15:27:34] GinoMan1423: has joined #ruby
[15:37:18] digitalnomad: has joined #ruby
[15:42:08] bronson: has joined #ruby
[15:46:52] baroquebobcat: has joined #ruby
[15:47:00] brent__: has joined #ruby
[15:50:07] moeabdol: has joined #ruby
[15:51:30] polishdub: has joined #ruby
[15:56:06] rgtk: has joined #ruby
[15:56:41] brw: has joined #ruby
[15:57:11] kahra: has joined #ruby
[15:57:37] sleepee: has joined #ruby
[16:00:48] conta: has joined #ruby
[16:02:36] ozcanesen: has joined #ruby
[16:04:47] acalycine: has joined #ruby
[16:04:47] acalycine: has joined #ruby
[16:05:34] howdoi: has joined #ruby
[16:06:02] cam27: has joined #ruby
[16:10:07] TomyLobo3: has joined #ruby
[16:11:42] polishdub: has joined #ruby
[16:13:26] tomphp: has joined #ruby
[16:16:24] vindvaki: has joined #ruby
[16:16:45] FahmeF: has joined #ruby
[16:18:24] gusrub: has joined #ruby
[16:22:06] erry: has joined #ruby
[16:22:32] erry: has left #ruby: ()
[16:23:19] impermanence: has joined #ruby
[16:25:33] baroquebobcat: has joined #ruby
[16:28:29] cagomez: has joined #ruby
[16:35:54] dviola: has joined #ruby
[16:35:57] http_GK1wmSU: has joined #ruby
[16:37:38] eckhardt: has joined #ruby
[16:38:07] http_GK1wmSU: has left #ruby: ()
[16:38:57] ozcanesen: has joined #ruby
[16:39:34] Inoperable: has joined #ruby
[16:42:25] mikecmpbll: has joined #ruby
[16:42:59] cahoots: has joined #ruby
[16:43:36] Azure: has joined #ruby
[16:45:06] conta: has joined #ruby
[16:46:10] eelster: has joined #ruby
[16:46:11] dviola: has joined #ruby
[16:47:53] Diogo_: has joined #ruby
[16:51:17] Diogo: has joined #ruby
[16:52:00] Diogo: has joined #ruby
[16:54:26] phinxy: has joined #ruby
[16:54:41] bruno-: has joined #ruby
[16:54:56] ramfjord: has joined #ruby
[16:55:11] mabus44: has joined #ruby
[16:55:32] mostlybadfly: has joined #ruby
[16:56:54] cagomez_: has joined #ruby
[17:00:03] Silthias: has joined #ruby
[17:01:37] gusrub: has joined #ruby
[17:01:53] charliesome: has joined #ruby
[17:02:08] banisterfiend: has joined #ruby
[17:04:20] opekktar: has joined #ruby
[17:05:30] acalycine: has joined #ruby
[17:05:30] acalycine: has joined #ruby
[17:10:01] dmtd: has joined #ruby
[17:11:24] mustaffa_: has joined #ruby
[17:13:39] ruby-lang342: has joined #ruby
[17:13:43] Inoperable: has joined #ruby
[17:17:50] ycyclist: has joined #ruby
[17:17:51] maryo: has joined #ruby
[17:18:33] ycyclist: What is the function, in ruby, of a multi-line string continued with \ before end of line?
[17:19:53] ycyclist: \ looks pretty fallible to me. Why not just use + at end of line. Then you're not screwed by a stray space.
[17:20:01] gizmore: performance
[17:20:30] gizmore: although an optimizer will catch it soon
[17:20:46] ycyclist: But how can performance be important if you are doing it in initialization? After all, you probably do it once.
[17:21:05] ycyclist: Okay, so probably no good reason in this day and age.
[17:22:02] hutch34: has joined #ruby
[17:23:39] marxarelli: has joined #ruby
[17:23:50] jackjackdripper: has joined #ruby
[17:24:27] minimalism: has joined #ruby
[17:24:44] dviola: has joined #ruby
[17:25:20] Ryzokuken: has joined #ruby
[17:25:35] cagomez: has joined #ruby
[17:27:59] baroquebobcat: has joined #ruby
[17:29:01] rgtk: has joined #ruby
[17:31:18] duderonomy: has joined #ruby
[17:35:07] impermanence: Is there a way to sort in ascending order the string keys of my hash being returned by group_by(&:category)?
[17:35:11] impermanence: I hope that makes sense
[17:37:49] cagomez: has joined #ruby
[17:43:29] bronson: has joined #ruby
[17:44:19] Dimik: has joined #ruby
[17:47:27] mustaffa__: has joined #ruby
[17:49:15] benlieb: has joined #ruby
[17:52:17] marr123: has joined #ruby
[17:53:27] Zarthus: impermanence: that sounds RoR related
[17:54:01] mtkd: has joined #ruby
[17:54:17] baweaver: &ri Enumerable#group_by
[17:54:17] `derpy: http://ruby-doc.org/core-2.4.1/Enumerable.html#method-i-group_by
[17:54:39] baweaver: That one is Ruby.
[17:55:06] jackjackdripper1: has joined #ruby
[17:55:12] baweaver: impermanence: technically hashes aren't supposed to be sorted.
[17:55:19] baweaver: what are you trying to do?
[17:55:27] Zarthus: It sounded like he was executing a MySQL group_by statement
[17:55:33] Zarthus: I don't know what &:category would be otherwiswe
[17:55:46] baweaver: &ri Symbol#to_proc
[17:55:46] `derpy: http://ruby-doc.org/core-2.4.1/Symbol.html#method-i-to_proc
[17:55:47] marr123: has joined #ruby
[17:56:02] baweaver: that basically
[17:56:39] baweaver: >> class Person; def meth; 1 end end; [Person.new, Person.new].map(&:meth)
[17:56:40] ruby[bot]: baweaver: # => [1, 1] (https://eval.in/841703)
[17:56:45] tomphp: has joined #ruby
[17:57:32] baweaver: RoR would be group(:symbol)
[17:57:49] impermanence: baweaver: okay. I needed to convert my hash to an array at the end anyway, which I am doing now, so I'll just sort at the end, I think
[17:58:17] baweaver: sort_by -> reverse
[17:58:40] baweaver: or sort_by { |x| -x }
[17:58:56] baweaver: >> [1,2,3, -1, 5, 0].sort_by { |x| x }
[17:58:57] ruby[bot]: baweaver: # => [-1, 0, 1, 2, 3, 5] (https://eval.in/841706)
[17:59:03] baweaver: >> [1,2,3, -1, 5, 0].sort_by { |x| -x }
[17:59:04] ruby[bot]: baweaver: # => [5, 3, 2, 1, 0, -1] (https://eval.in/841707)
[17:59:29] baweaver: toy examples, but you get the gist of it
[18:00:07] baweaver: In actuality hashes in Ruby _are_ sorted but I wouldn't make a habit of relying on that one
[18:00:16] ozcanesen: has joined #ruby
[18:00:19] baweaver: if someone makes that a performance gain you're in for it later.
[18:00:40] baweaver: be back later.
[18:00:48] impermanence: bawaever: thank you, cool.
[18:01:24] mikecmpbll: has joined #ruby
[18:04:13] mim1k: has joined #ruby
[18:05:50] eightlimbed: has joined #ruby
[18:06:14] acalycine: has joined #ruby
[18:06:14] acalycine: has joined #ruby
[18:07:13] guacamole: has joined #ruby
[18:08:42] kmhn: has joined #ruby
[18:10:16] impermanence: some_array.map { |x, y| y - x} is throwing NoMethodError: undefined method `-' for nil:NilClass
[18:10:25] impermanence: this does not happen for x - y
[18:12:29] weaksauce: has joined #ruby
[18:12:52] jordanm: has joined #ruby
[18:17:39] baweaver: impermanence: what's in some_array?
[18:18:21] maryo: has joined #ruby
[18:18:54] dionysus69: has joined #ruby
[18:23:34] baweaver: because y is nil, and if y is nil then it'd still crash the other way
[18:23:35] ramfjord: has joined #ruby
[18:23:39] ruby[bot]: baweaver: # => nil can't be coerced into Fixnum (TypeError) ...check link for more (https://eval.in/841712)
[18:24:01] vuoto: has joined #ruby
[18:25:15] havenwood: >> module Impermenence; module_function def - _; 42 end end; some_array = [[Impermenence, nil]]; some_array.map { |x, y| x - y }
[18:25:17] ruby[bot]: havenwood: # => [42] (https://eval.in/841713)
[18:25:18] havenwood: >> module Impermenence; module_function def - _; 42 end end; some_array = [[Impermenence, nil]]; some_array.map { |x, y| y - x }
[18:25:20] ruby[bot]: havenwood: # => undefined method `-' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/841714)
[18:26:16] havenwood: impermanence: show the code!
[18:28:49] Muz: has joined #ruby
[18:29:05] mtkd: has joined #ruby
[18:29:20] ramfjord: has joined #ruby
[18:31:56] impermanence: sorry :) I was writing other code
[18:32:07] ivanskie: has joined #ruby
[18:32:23] ivanskie: any Savon / SOAP experts heaarrrr?
[18:33:27] impermanence: arr1 = [ bunch of ints ] ; arr2 = [ bunch of ints ] ; arr1.zip(arr2).map { |x, y| y - x }
[18:33:28] ivanskie: first time trying out savon, or dealing with soap overall. and my request in soapui works. but in savon i keep getting errors. and i don't understand what im missing. or how to see where the problem is. rather what the request looks like in savon to compare it to soapui
[18:33:44] impermanence: I guess zip is my problem probably?
[18:33:52] herwin: are the arrays the same size?
[18:35:16] jenrzzz: has joined #ruby
[18:35:24] ramfjord: has joined #ruby
[18:35:28] impermanence: I believe not but hang on
[18:35:46] impermanence: my repl was suggesting that didn't matter; that zip handled that nicely :)
[18:36:13] impermanence: not necc same size
[18:36:30] baweaver: what exactly are you trying to do?
[18:36:36] baweaver: because that'll crash
[18:36:51] impermanence: trying to do:
[18:37:07] baweaver: >> [1,2,3].zip([1,2]) { |x,y| x - y }
[18:37:08] ruby[bot]: baweaver: # => nil can't be coerced into Fixnum (TypeError) ...check link for more (https://eval.in/841717)
[18:37:08] impermanence: if two arrays have element at same index, subtract; if not, don't
[18:37:38] baweaver: is one always longer than the other
[18:37:44] baweaver: or is there any way to know that?
[18:38:08] impermanence: no way to know
[18:38:12] impermanence: from pry: [[1, 1], [2, 2], [3, nil]]
[18:38:31] clamstar: has joined #ruby
[18:38:44] impermanence: nvm pry threw the error you listed above
[18:38:56] impermanence: once I tried to map that is
[18:40:21] impermanence: if they're the same length that works great
[18:40:26] baweaver: then you need to write a conditional that gives you x if no y, y if no x, and y - x if both
[18:40:44] ramfjord: has joined #ruby
[18:40:49] moeabdol: has joined #ruby
[18:44:28] bronson: has joined #ruby
[18:45:38] baweaver: havenwood: what gives with zip's block arg?
[18:45:58] baweaver: >> [1,2,3].zip([1,2]) { |arr| arr.first }
[18:45:59] ruby[bot]: baweaver: # => nil (https://eval.in/841722)
[18:46:22] baweaver: where arr is very clearly something like [1,1]
[18:46:57] Ryzokuken: has joined #ruby
[18:47:07] baweaver: Ok, fine, the doc says it returns nil but that's silly.
[18:47:16] havenwood: baweaver: yeah, isn't that odd - it's just used for side effects
[18:47:32] baweaver: >> [1,2,3].zip([1,2]) { |arr| arr = arr.first }
[18:47:33] ruby[bot]: baweaver: # => nil (https://eval.in/841723)
[18:47:39] baweaver: ACTION grumbles
[18:50:42] ivanskie: nevermind its not actually working in soapui
[18:51:01] ivanskie: damn this is so stupid and frustrating why can't they write a proper web service geez apc. comeon
[18:51:07] ivanskie: wsdl is from 2009
[18:52:49] CacoS: has joined #ruby
[18:54:47] nopolitica: has joined #ruby
[18:58:22] digitalnomad: has joined #ruby
[19:00:12] millerti: has joined #ruby
[19:03:33] cagomez: has joined #ruby
[19:05:07] nopolitica: has joined #ruby
[19:07:00] acalycine: has joined #ruby
[19:09:28] jaruga: has joined #ruby
[19:12:43] sneakerhax: has joined #ruby
[19:14:14] Kyle__: has joined #ruby
[19:14:42] Kyle__: So.... does '~/foo' no longer work in File.open() or DBM.new()?
[19:17:10] Mon_Ouie: I don't think it ever worked
[19:17:17] mabus44: has joined #ruby
[19:17:25] Mon_Ouie: You need to expand it yourself using File.expand_path
[19:17:30] Kyle__: Mon_Ouie: On linux, BSD and OSX it worked for ages. Up until now.
[19:17:49] Kyle__: I've had it in my scripts going back to 1.8
[19:18:04] gusrub: has joined #ruby
[19:18:09] Kyle__: ACTION freely admits that maybe it _never_ should have worked, but it did.
[19:19:48] banisterfiend: has joined #ruby
[19:24:12] cagomez: has joined #ruby
[19:25:55] vuoto: has joined #ruby
[19:26:40] Mon_Ouie: That doesn't seem true though: https://eval.in/841728
[19:27:24] Mon_Ouie: Wait, I'm just getting different results as I re-run it for some reason
[19:27:38] acalycine: has joined #ruby
[19:27:38] acalycine: has joined #ruby
[19:29:44] Mon_Ouie: I guess it just doesn't show any output if a permission error occurs during the execution
[19:30:07] dstrunk: has joined #ruby
[19:35:32] guacamole: has joined #ruby
[19:36:29] sspreitz: has joined #ruby
[19:37:28] tedL: has joined #ruby
[19:38:37] phinxy: has joined #ruby
[19:39:24] Kyle__: Mon_Ouie: I think it's new behavior, even if it shouldn't be. A script I wrote in March of this year did in fact work using this. Before my most recent release-upgrade.
[19:39:56] Kyle__: I just had to search through for scripts I did that in, and the most recent is March 7th.
[19:41:04] Kyle__: It was a quick and dirty script, don't judge me too harshly ;) http://paste.ubuntu.com/25242078/
[19:42:37] impermanence: What is the correct way to perform: some_array_of_ints.map { |x| sum += x.num1 += x.num2 } ?
[19:42:53] impermanence: What is the correct way to perform: some_array_of_ints.map { |x| x.num1 += x.num2 } ?
[19:42:59] impermanence: first one is wrong, sorry
[19:43:36] impermanence: arr, so that works
[19:43:39] impermanence: what I meant was:
[19:44:05] impermanence: some_array_of_ints.map { |x| sum = x.num1 += x.num2 } ?
[19:45:11] bronson: has joined #ruby
[19:45:47] ijustcount: has joined #ruby
[19:45:55] tomphp: has joined #ruby
[19:46:35] A124: has joined #ruby
[19:47:18] impermanence: i worked it out ;)
[19:48:16] acalycine: has joined #ruby
[19:49:37] _sfiguser: has joined #ruby
[19:50:14] andrzejku: has joined #ruby
[19:52:55] ijustcount: has joined #ruby
[19:56:43] __Yiota: has joined #ruby
[19:57:26] tomphp: has joined #ruby
[20:00:11] ResidentBiscuit: has joined #ruby
[20:06:00] cjohnson: sure you don't want reduce?
[20:06:13] cjohnson: if you are wanting to sum them, you probably want to reduce
[20:09:34] banisterfiend: has joined #ruby
[20:09:57] cagomez: has joined #ruby
[20:13:46] baweaver: &ri Enumerable impermanence
[20:13:46] `derpy: impermanence: http://ruby-doc.org/core-2.4.1/Enumerable.html
[20:13:54] baweaver: you should read through that a few times
[20:14:02] baweaver: it'll clear a lot of your problems up
[20:14:11] impermanence: baweaver: cool.
[20:14:27] baweaver: cjohnson: 2.4.x introduced a sum method as well
[20:14:35] baweaver: but reduce was used beforehand, you're right.
[20:14:38] FastJack: has joined #ruby
[20:14:47] baweaver: &ri Array#sum
[20:14:47] `derpy: http://ruby-doc.org/core-2.4.1/Array.html#method-i-sum
[20:15:42] baweaver: impermanence: if you have a recent version of ruby you can use sum
[20:15:56] impermanence: baweaver: I do and will work with that
[20:16:18] baweaver: Mind, there's a lot to learn around Enumerable and all that so it takes a bit
[20:19:17] cagomez: has joined #ruby
[20:21:15] dionysus69: has joined #ruby
[20:21:26] hutch34: has joined #ruby
[20:22:32] ResidentBiscuit: has joined #ruby
[20:23:31] Rapture: has joined #ruby
[20:28:13] ur5us: has joined #ruby
[20:29:23] acalycine: has joined #ruby
[20:29:23] acalycine: has joined #ruby
[20:30:43] A124: has joined #ruby
[20:32:16] cagomez: has joined #ruby
[20:33:30] tvw: has joined #ruby
[20:34:19] baroquebobcat: has joined #ruby
[20:39:36] nopolitica: has joined #ruby
[20:45:46] eightlimbed: has joined #ruby
[20:46:08] bronson: has joined #ruby
[20:52:46] mim1k: has joined #ruby
[21:01:00] Frem: has joined #ruby
[21:02:55] FahmeF: has joined #ruby
[21:07:05] benlieb: has joined #ruby
[21:11:08] sepp2k: has joined #ruby
[21:13:15] tom69: has joined #ruby
[21:16:30] FahmeF: has joined #ruby
[21:17:31] yeticry_: has joined #ruby
[21:20:42] sepp2k1: has joined #ruby
[21:23:17] jenrzzz: has joined #ruby
[21:23:17] jenrzzz: has joined #ruby
[21:27:03] Bhootrk_: has joined #ruby
[21:30:07] acalycine: has joined #ruby
[21:30:07] acalycine: has joined #ruby
[21:32:14] eckhardt: has joined #ruby
[21:32:32] tom69: has left #ruby: ("WeeChat 1.9")
[21:37:16] dar123: has joined #ruby
[21:47:24] bronson: has joined #ruby
[21:48:01] eightlimbed: has joined #ruby
[21:54:22] johnny56: has joined #ruby
[21:57:21] hutch34: has joined #ruby
[22:08:12] jenrzzz: has joined #ruby
[22:10:37] tomphp: has joined #ruby
[22:17:14] preyalone: has joined #ruby
[22:18:54] dviola: has joined #ruby
[22:19:30] ur5us: has joined #ruby
[22:22:47] nowhere_man: has joined #ruby
[22:23:16] eightlimbed: has joined #ruby
[22:26:19] jackjackdripper: has joined #ruby
[22:27:50] jinie_: has joined #ruby
[22:30:54] acalycine: has joined #ruby
[22:30:54] acalycine: has joined #ruby
[22:33:09] guacamole: has joined #ruby
[22:34:29] jenrzzz: has joined #ruby
[22:34:39] jenrzzz: has joined #ruby
[22:34:46] foxxx0: has joined #ruby
[22:34:57] ramfjord: has joined #ruby
[22:36:36] KeyJoo: has joined #ruby
[22:40:06] gix: has joined #ruby
[22:40:07] ramfjord: has joined #ruby
[22:41:32] dennisvennink: has joined #ruby
[22:41:50] sleepee: has joined #ruby
[22:43:32] GodFather: has joined #ruby
[22:45:53] zapata: has joined #ruby
[22:48:07] bronson: has joined #ruby
[22:48:12] dviola: has joined #ruby
[22:48:48] ledestin: has joined #ruby
[22:49:48] nopolitica: has joined #ruby
[22:50:13] lxsameer: has joined #ruby
[22:52:28] grant: has joined #ruby
[22:53:11] eightlimbed: has joined #ruby
[22:55:41] ramfjord: has joined #ruby
[23:02:31] goyox86_: has joined #ruby
[23:05:21] ramfjord: has joined #ruby
[23:05:37] brent__: has joined #ruby
[23:05:39] cam27: is there a plugin that will do atuo complete on code in vim does anyone know? So far the internet is saying no.
[23:06:51] tomphp: has joined #ruby
[23:08:53] dennisvennink: has joined #ruby
[23:09:13] QualityAddict: has joined #ruby
[23:10:28] bronson: has joined #ruby
[23:16:16] leonL: has joined #ruby
[23:16:20] SeepingN: has joined #ruby
[23:17:25] Bebichua: has joined #ruby
[23:17:52] Bebichua: hello everyone
[23:18:37] Bebichua: I need to configure a DBI connection to a mysql database, so far without success.
[23:20:25] Bebichua_: has joined #ruby
[23:20:54] Bebichua_: hello everyone
[23:25:26] dcunit3d: has joined #ruby
[23:27:33] cahoots: has joined #ruby
[23:27:50] hutch34: has joined #ruby
[23:28:41] cahoots: i'm running into a case frequently where i have a method does same lifting, let's call it "params()", and then i want to store that to a local variable to reuse efficiently. but i can't name it "params" because that would be weird... so would you call it "get_params()"? "fetch_params()"?
[23:28:46] cahoots: let's get pedantic
[23:29:27] nowhere_man: has joined #ruby
[23:29:49] yorickpeterse: cahoots: you mean you'd end up with something like `params = self.params`?
[23:30:34] yorickpeterse: the name you'd give both method and variable really depends on what the method does
[23:30:52] cahoots: yorickpeterse, yes, that's what i'd end up with
[23:31:05] cahoots: the method is just split out to keep each method smal
[23:31:37] acalycine: has joined #ruby
[23:31:38] acalycine: has joined #ruby
[23:32:57] ecuanaso: has joined #ruby
[23:34:17] alveric3: has joined #ruby
[23:34:49] yorickpeterse: if the result of the method is always the same you could store it in an instance variable
[23:34:58] yorickpeterse: `def params; @params ||= ...; end`
[23:36:59] dennisvennink: has joined #ruby
[23:38:05] t-recx: has joined #ruby
[23:38:24] ramfjord: has joined #ruby
[23:43:00] nopolitica: has joined #ruby
[23:45:57] impermanence: has joined #ruby
[23:47:38] herbmillerjr: has joined #ruby
[23:48:48] cahoots: yorickpeterse, i guess one thing i'm wondering is, is it considered bad form to name a local var the same as a method? does the interpreter get confused sometimes?
[23:49:33] mostlybadfly: has joined #ruby
[23:53:19] ragnar: has joined #ruby
[23:54:11] nowhere_man: has joined #ruby
[23:55:12] ragnar: I need to open several binary files in a directory. For each file I need to edit it by inserting 65 byes of metadata starting at the beginning of file. I can't seem to figure this out without overwriting the existing data. Any ideas?
[23:57:29] baroquebobcat: has joined #ruby