« Back to channel list

#ruby - 10 July 2015

« Back 1 day Forward 1 day »
[00:01:42] dgutierrez1287: has joined #ruby
[00:02:06] leonardoajim: has joined #ruby
[00:02:18] OrbitalKitten: has joined #ruby
[00:02:58] n1x: has joined #ruby
[00:03:00] blackmesa: has joined #ruby
[00:04:26] leonardoajim: has joined #ruby
[00:04:30] charliesome: has joined #ruby
[00:05:29] kobain: has joined #ruby
[00:06:07] alphaatom: has joined #ruby
[00:06:24] Igorshp: has joined #ruby
[00:06:30] Rixius: has joined #ruby
[00:07:55] Aswebb_: has joined #ruby
[00:08:05] alphaatom: has joined #ruby
[00:10:43] CloCkWeRX: has joined #ruby
[00:12:07] bricker: has joined #ruby
[00:12:40] alphaatom: has joined #ruby
[00:13:00] IanV0rn2341: has joined #ruby
[00:13:58] mistermocha: has joined #ruby
[00:15:48] hotpancakes: has joined #ruby
[00:17:17] Musashi007: has joined #ruby
[00:17:31] dudo: has joined #ruby
[00:17:51] baweaver: has joined #ruby
[00:18:03] sharpmachine: has joined #ruby
[00:18:52] millerti: has joined #ruby
[00:19:20] 16WABGS0F: has joined #ruby
[00:19:23] 16WABGS0F: https://gist.github.com/siassaj/0364592698a14636afbf
[00:19:37] 16WABGS0F: I have this problem with name spacing
[00:23:15] MichaelGG_: has joined #ruby
[00:23:56] quazimodo: I didn't know the calling environment would mess up my usage of name spaces inside
[00:24:21] silkfox: has joined #ruby
[00:24:26] fgo: has joined #ruby
[00:25:04] alphaatom: has joined #ruby
[00:26:57] alphaatom: has joined #ruby
[00:27:20] arturmartins: has joined #ruby
[00:28:05] bruno-: has joined #ruby
[00:29:14] alphaatom: has joined #ruby
[00:31:50] hotpancakes: has joined #ruby
[00:32:53] dgutierrez1287: has joined #ruby
[00:33:19] yfeldblum: has joined #ruby
[00:35:42] simplyianm: has joined #ruby
[00:35:52] dgutierrez1287: has joined #ruby
[00:36:59] dgutierrez1287: has joined #ruby
[00:37:14] nathanstitt: has joined #ruby
[00:37:33] yizr: has joined #ruby
[00:37:39] hfp_work: has joined #ruby
[00:37:42] rushed: has joined #ruby
[00:37:50] tmtwd_: has joined #ruby
[00:38:09] hfp: has joined #ruby
[00:38:13] Oog: has joined #ruby
[00:40:03] duderonomy: has joined #ruby
[00:40:46] shazaum_: has joined #ruby
[00:42:09] toretore: quazimodo: did you try restarting the server?
[00:42:21] quazimodo: toretore: no, should that help?
[00:42:33] quazimodo: why would that help??
[00:42:54] quazimodo: oh ok apparently we did
[00:43:45] keen__________16: has joined #ruby
[00:44:38] bahar: has joined #ruby
[00:44:38] shevy: conversations on #ruby are sometimes funny to read
[00:45:09] sevenseacat: has joined #ruby
[00:45:09] simplyianm: has joined #ruby
[00:45:10] arescorpio: has joined #ruby
[00:45:35] quazimodo: shevy: you're smart
[00:45:39] quazimodo: https://gist.github.com/siassaj/0364592698a14636afbf
[00:45:45] quazimodo: namespace weird!?
[00:46:10] shevy: would this work?
[00:46:26] quazimodo: there's no logic to figure out in that exapmle, only the namespace issue
[00:46:28] surs: has joined #ruby
[00:46:31] shevy: module Couriers::Base::Api.get_quote(params)
[00:46:36] Rollabunna: has joined #ruby
[00:46:43] shevy: I forgot a def
[00:46:59] shevy: hmmm I guess the namespace has to exist
[00:47:09] shevy: >> def Foo.bar; puts 'hi'; end; Foo.bar
[00:47:10] ruboto: shevy # => uninitialized constant Foo (NameError) ...check link for more (https://eval.in/395919)
[00:47:18] shevy: >> module Foo; end; def Foo.bar; puts 'hi'; end; Foo.bar
[00:47:19] ruboto: shevy # => hi ...check link for more (https://eval.in/395920)
[00:47:51] shevy: do you have more than one constant called Api?
[00:47:53] dgutierrez1287: has joined #ruby
[00:48:16] quazimodo: Couriers::Base::Api <- used to do an api call to the courier that it's specialised for
[00:48:32] quazimodo: Api::V2::WhateverController <- Rocketpants controllers
[00:48:34] shevy: I have had weird results with same-named things
[00:48:57] shevy: class Colour # topnamespace; and also: module Foo; module Colour, then I have to use either Colour or ::Colour
[00:49:08] shevy: or I also did this: module Foo; class Foo
[00:49:26] Jamal: has joined #ruby
[00:49:33] Pupeno: has joined #ruby
[00:49:37] dfockler: has joined #ruby
[00:49:48] shevy: quazimodo is the wrong Api class invoked?
[00:50:30] aderium: has joined #ruby
[00:50:53] quazimodo: the ::Api module is called (the one used for rocket pants)
[00:50:56] quazimodo: but that's very weird for me
[00:51:10] quazimodo: Module.nesting shows that I'm looking for Api in all the right places
[00:51:40] shevy: yeah confusion through same names :)
[00:51:49] wldcordeiro: has joined #ruby
[00:52:07] mclee: has joined #ruby
[00:53:01] duderonomy: has joined #ruby
[00:53:14] shevy: I just realized something else...
[00:53:19] shevy: def Foo.bla
[00:53:32] shevy: ruby would not know whether Foo is a class or a module
[00:53:47] shevy: unless it was defined prior to doing that
[00:54:09] shevy: but now that I used it... I'd love to be able to do that!
[00:55:34] shevy: if only we could have a third type
[00:56:02] shevy: in the above, Foo would be a morph... it could be a class... or it could be a module... but at that time, it would not matter!
[00:57:05] aderium: has joined #ruby
[00:57:25] Ox0dea: >> Class.new.is_a?(Module)
[00:57:26] ruboto: Ox0dea # => true (https://eval.in/395921)
[00:57:45] tvw: has joined #ruby
[00:58:54] ankur: senjai: can you suggest me some open source project, ?
[00:59:12] shevy: >> Class.new.is_a?(Class)
[00:59:13] ruboto: shevy # => true (https://eval.in/395922)
[00:59:21] shevy: Ox0dea it's both! a schroedinger cat
[01:00:08] quazimodo: backto the weird namespacing
[01:00:41] shevy: cats are dogs
[01:00:51] shevy: classes are modules
[01:00:54] quazimodo: wheres workmad
[01:01:18] shevy: shaving his beard
[01:01:41] shevy: should be 02:00 in the UK right now, if he has to go to work, he has to sleep!
[01:03:24] quazimodo: Facking constant lookup
[01:03:37] shevy: simplify!
[01:04:31] tkuchiki: has joined #ruby
[01:05:23] quazimodo: shevy: i don't get it though
[01:05:34] quazimodo: it shouldn't be deing that retarded stuff
[01:06:00] shevy: yeah, I have had funny error messages due to that
[01:06:55] quazimodo: but we needt o feex
[01:07:24] dseitz: has joined #ruby
[01:08:03] Oog: has joined #ruby
[01:08:28] mclee: has joined #ruby
[01:10:13] lolmaus: has joined #ruby
[01:10:26] toretore: quazimodo: gist all the relevant files, in their entirety
[01:10:55] duderonomy: has joined #ruby
[01:11:11] lkba_: has joined #ruby
[01:11:50] charliesome: has joined #ruby
[01:12:36] luckyno7: has joined #ruby
[01:12:51] goodcodeguy: has joined #ruby
[01:13:13] leonardoajim: has joined #ruby
[01:14:33] mmasaki_: has joined #ruby
[01:14:44] n1x: has joined #ruby
[01:15:12] stantonnet: has joined #ruby
[01:16:32] leonardoajim: has joined #ruby
[01:17:58] quazimodo: let me get a coffee, i'll bbl
[01:18:53] ivanskie: has joined #ruby
[01:20:28] paulcsmith: has joined #ruby
[01:21:15] kev12123: has joined #ruby
[01:21:51] kev12123: i can't get action mailer to actually send emails :/
[01:22:36] kev12123: I've tried using every solution i've found online, yet nothing works
[01:22:52] Ox0dea: kev12123: You've provided ample information for us to meaningfully assist you. Just a second.
[01:24:05] Channel6: has joined #ruby
[01:26:13] christiandsg: has joined #ruby
[01:26:57] mistermocha: has joined #ruby
[01:26:58] eggoez: has joined #ruby
[01:27:47] fabrice31: has joined #ruby
[01:29:55] Limix: has joined #ruby
[01:31:42] dgutierrez1287: has joined #ruby
[01:32:15] pr0ton: has joined #ruby
[01:34:24] mistermocha: has joined #ruby
[01:35:39] sharpmachine: has joined #ruby
[01:36:38] segy: has joined #ruby
[01:38:13] n1x: has joined #ruby
[01:47:16] eggoez: has joined #ruby
[01:47:21] towski_: has joined #ruby
[01:47:40] rushed: has joined #ruby
[01:50:08] NeverDie_: has joined #ruby
[01:52:04] yossarian: has joined #ruby
[01:52:25] bffff_: has joined #ruby
[01:55:08] Ropeney: has joined #ruby
[01:56:03] fgo: has joined #ruby
[01:56:13] but3k4: has joined #ruby
[01:56:45] Aswebb_: has joined #ruby
[01:56:51] dc_: has joined #ruby
[01:58:04] hotpancakes: has joined #ruby
[01:59:49] haltEnigma: has joined #ruby
[02:00:51] tubuliferous_: has joined #ruby
[02:01:50] ybian: has joined #ruby
[02:02:30] Oog: has joined #ruby
[02:02:45] jesterfraud: has joined #ruby
[02:03:21] laurentide: has joined #ruby
[02:05:14] JeramyRR: has joined #ruby
[02:08:25] ivanskie: has joined #ruby
[02:10:02] cabreraM516: has joined #ruby
[02:11:32] haltEnigma: Hey , I'm new to Ruby and I've built a simple action mailer , i successfully create the user and the server indicates the email has been sent , however the email goes through.Here is my code
[02:12:19] CloCkWeRX: has joined #ruby
[02:12:20] n1x: has joined #ruby
[02:12:31] haltEnigma: https://www.filepicker.io/api/file/PHa7b3LJRpywf55n42fJ
[02:14:03] simplyianm: has joined #ruby
[02:14:05] mmasaki: has joined #ruby
[02:15:48] surs1: has joined #ruby
[02:16:16] Sehryn: has joined #ruby
[02:16:45] davedev24_: has joined #ruby
[02:16:56] haltEnigma: https://www.filepicker.io/api/file/n0GPYhj4Sd6UXrRikAzd https://www.filepicker.io/api/file/c7cxv2O7RZ6Q1u3ZWDsg https://www.filepicker.io/api/file/OFageNdoTg2lr3rVW7Vo https://www.filepicker.io/api/file/zaf56a32TdCVccXUMhPi
[02:17:51] enders: has joined #ruby
[02:18:46] hotpancakes: has joined #ruby
[02:19:37] devbug: has joined #ruby
[02:20:00] mmasaki: has joined #ruby
[02:21:44] charliesome: has joined #ruby
[02:22:06] haltEnigma: has joined #ruby
[02:23:10] n1x: has joined #ruby
[02:23:44] white_magic: has joined #ruby
[02:24:12] white_magic: hi, I was wondering if someone could explain a few syntactical aspect of Ruby for me..
[02:25:01] white_magic: For example, what does the colon before a keyword mean? It's not always a hashmap, right? For example, in this page: http://guides.rubyonrails.org/association_basics.html
[02:25:10] white_magic: "has_many :orders, dependent: :destroy"
[02:25:23] prettiestPony11: has joined #ruby
[02:25:24] mozzarella: it's a symbol
[02:25:26] white_magic: seems like ":destroy" is kind of like a function pointer
[02:25:27] zanloy: white_magic, That is a symbol. It is like an immutable string but different.
[02:25:35] mozzarella: >> :test.class
[02:25:36] ruboto: mozzarella # => Symbol (https://eval.in/395928)
[02:26:14] luriv_: has joined #ruby
[02:26:25] simplyianm: has joined #ruby
[02:26:26] zanloy: >> :test.to_s
[02:26:26] ruboto: zanloy # => "test" (https://eval.in/395929)
[02:26:47] zanloy: >> "test".to_sym
[02:26:48] ruboto: zanloy # => :test (https://eval.in/395930)
[02:26:58] christiandsg: has joined #ruby
[02:26:59] white_magic: gotcha.. thanks
[02:27:06] surs2: has joined #ruby
[02:28:38] hotpancakes: has joined #ruby
[02:31:03] davedev24_: has joined #ruby
[02:31:48] davedev24: has joined #ruby
[02:33:06] jesterfraud: has joined #ruby
[02:33:28] evanjs_: has joined #ruby
[02:34:59] quazimodo: What in the fuck
[02:35:23] quazimodo: Api => Api; Base::Api => Couriers::Base::Api; Api => Couriers::Base::Api
[02:35:40] quazimodo: Rails autoloading
[02:35:43] quazimodo: Motherfucker
[02:36:24] sharpmachine: has joined #ruby
[02:36:34] n1x: has joined #ruby
[02:37:01] sevenseacat: swear at all of the things!!
[02:37:13] christiandsg: has joined #ruby
[02:39:36] baweaver: has joined #ruby
[02:41:53] Oog: has joined #ruby
[02:41:53] sevenseacat: quazimodo: my name still isnt kitty.
[02:44:05] cabreraM516: has joined #ruby
[02:46:48] Ox0dea: #ruby needs a CoC.
[02:46:52] surs3: has joined #ruby
[02:47:51] sevenseacat: you mean, like http://ruby-community.com/pages/code_of_conduct ?
[02:48:21] Nilium: ACTION gots an octocat figurine
[02:48:24] Nilium: It is nice.
[02:50:13] RegulationD: has joined #ruby
[02:51:00] Musashi007: has joined #ruby
[02:51:36] jesterfraud: has joined #ruby
[02:52:02] yizr: has joined #ruby
[02:52:10] Ox0dea: Why does the code of conduct explicitly mention gender if it immediately goes on to include "gender identity and expression"? That's either redundant or exclusive.
[02:53:22] psye: has joined #ruby
[02:54:05] jimmythehat: has joined #ruby
[02:54:22] jimmythehat: is there a way to programmatically do it ' array]
[02:54:31] Ox0dea: jimmythehat: Try again?
[02:54:42] davedev24_: has joined #ruby
[02:55:04] jimmythehat: array[3][6][6][2] = 42
[02:55:24] mclee: has joined #ruby
[02:55:38] leonardoajim: has joined #ruby
[02:55:39] Ox0dea: jimmythehat: You want to be able to write that?
[02:56:12] mary5030: has joined #ruby
[02:56:40] jimmythehat: Ox0dea programmatically do that. So [3][6][6][2] can change to [2][4] or [1][2][3] or whatever. The most efficient way of updating a multidimensional array's entry. Just one of its entries.
[02:56:44] chinmay_dd_: has joined #ruby
[02:56:57] davedev24_: has joined #ruby
[02:57:12] havenwood: has joined #ruby
[02:57:57] hahuang65: has joined #ruby
[02:58:07] Oog: has joined #ruby
[02:58:54] Ox0dea: You can programmatically *access* an arbitrarily deep element using something like [3, 6, 6, 2].reduce(array, :[]).
[02:58:57] kb3ien: has joined #ruby
[02:59:16] Xoro: has joined #ruby
[02:59:20] chinmay_dd__: has joined #ruby
[02:59:25] Ox0dea: But if you want to be able to cleanly update, you might consider using an autovivifying Hash:
[02:59:27] Ox0dea: >> array = Hash.new { |h, k| h[k] = Hash.new &h.default_proc }; array[3][6][6][2] = 42; array
[02:59:28] ruboto: Ox0dea # => {3=>{6=>{6=>{2=>42}}}} (https://eval.in/395931)
[02:59:35] mistermocha: has joined #ruby
[02:59:43] kb3ien: My `rails generate` hangs forever, the open file handle that it's reading is AF_LOCAL "/tmp/spring/f7d7415c8e2a052c43f10695522d4a16" What's this about ?
[03:01:13] havenwood: ?rails kb3ien
[03:01:13] ruboto: kb3ien, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[03:01:14] jimmythehat: kb3lien actually forever? if you're in a jam just remove the sprinng gem and run bundle install, but if you want to keep spring im not sure :)
[03:01:32] GriffinHeart: has joined #ruby
[03:01:40] Limix: has joined #ruby
[03:02:19] jimmythehat: Ox0dea so is that more efficient than running array[x][y]..[n] ?
[03:02:27] Ox0dea: jimmythehat: No, not at all. :)
[03:02:49] Ox0dea: You'll want to stick with your multi-dimensional array, but the Hash#default_proc trick is fun to show off.
[03:04:01] Ox0dea: indices = [3, 6, 6, 2]; last = indices.pop; indices.reduce(array, :[])[last] = 42
[03:04:09] Ox0dea: That seems like a reasonably clean approach.
[03:04:10] unshadow_: has joined #ruby
[03:05:02] ruby-lang503: has joined #ruby
[03:05:15] jimmythehat: so what does reduce actually do?
[03:05:33] MasterPiece: has joined #ruby
[03:05:40] hotpancakes: has joined #ruby
[03:05:47] jimmythehat: and why the symbol of an empty array?
[03:05:53] kb3ien: has left #ruby: ()
[03:05:57] eggoez: has joined #ruby
[03:06:59] Ox0dea: It helps to think of #reduce as sticking the operator between all the elements and calling it one at a time in order to build up a "total".
[03:07:36] Ox0dea: :[] is just the operator in this case; it represents the Array#[] method.
[03:08:26] zacstewart: has joined #ruby
[03:08:35] Ox0dea: "Fold" is arguably a more illustrative name.
[03:08:49] theery: has joined #ruby
[03:09:05] Ox0dea: [1, 2, 3, 4].reduce(:+) becomes, essentially, 1 + 2 + 3 + 4.
[03:09:25] ny837: has joined #ruby
[03:10:44] chouhoulis: has joined #ruby
[03:11:11] Oog: has joined #ruby
[03:11:54] hahuang65: has joined #ruby
[03:12:26] braincrash: has joined #ruby
[03:13:44] chouhoulis: has joined #ruby
[03:13:51] mistermocha: has joined #ruby
[03:15:19] hahuang65: has joined #ruby
[03:15:27] bungoman: has joined #ruby
[03:16:02] jimmythehat: Ox0dea oohh cool (just watching a video on it) that's useful. werid but useful :P
[03:16:29] jimmythehat: thanks a loot
[03:16:36] Ox0dea: Sure thing.
[03:17:58] baweaver: http://www.dreamincode.net/forums/topic/372710-working-with-2d-arrays-and-trying-to-change-touching-indexes/page__view__findpost__p__2134986
[03:18:06] baweaver: That was a fun one that shows some reduce in action
[03:18:10] baweaver: well, map and reduce
[03:18:21] baweaver: read the top post for context
[03:18:55] baweaver: baweaver == lemur
[03:19:00] sharpmachine: has joined #ruby
[03:19:16] prettiestPony11: has joined #ruby
[03:20:07] zacstewart: has joined #ruby
[03:20:45] scottschecter: has joined #ruby
[03:20:51] Pupeno_: has joined #ruby
[03:21:12] baweaver: Ox0dea: You might like the problem on that one.
[03:22:26] tmtwd: has joined #ruby
[03:23:14] Oog: has joined #ruby
[03:24:29] hahuang61: has joined #ruby
[03:24:29] Xiti: has joined #ruby
[03:27:59] Tuccuay: has joined #ruby
[03:28:00] wookiehangover: has joined #ruby
[03:28:27] fabrice31: has joined #ruby
[03:29:31] darkf: has joined #ruby
[03:29:40] Ox0dea: has joined #ruby
[03:30:01] christiandsg: has joined #ruby
[03:30:03] krasnus: has joined #ruby
[03:30:04] Ox0dea: baweaver: I'm just thinking of all the little utility functions I'd have to write to do this even remotely cleanly without alphanumerics. :P
[03:30:41] urbanmonk: has joined #ruby
[03:31:03] alem0lars: has joined #ruby
[03:31:24] Ox0dea: Bless you, Alonzo Church, but the lambda calculus : programming :: cave scribblings : human language.
[03:31:30] mistermocha: has joined #ruby
[03:33:17] bronson: has joined #ruby
[03:33:34] notthekgb: has joined #ruby
[03:34:29] darkf_: has joined #ruby
[03:35:07] notthekgb: Ruby noob: how do I set a value to an array index? This is so I can cycle through the array sequentially each time the function is called, doing x++ and then arr.length = x and x = 0 to reset once all values have been called
[03:35:41] WhiteAssCrackers: has joined #ruby
[03:35:49] Ox0dea: notthekgb: I think you want Array#each.
[03:35:52] ruboto: apeiros, fflush, banisterfiend, seanstickle, Mon_Ouie, zzak, Radar, Havenn, jhass, sevenseacat, miah, workmad3, Coraline, drbrain, zenspider, rubyhacker1, slyphon, Aria, ljarvis
[03:36:08] sevenseacat: !ban WhiteAssCrackers !T 1d
[03:36:09] ChanServ: +b WhiteAssCrackers!*@*
[03:36:09] ChanServ: ChanServ kicked WhiteAssCrackers: is banned from this channel
[03:36:11] notthekgb: I've tried using array.each but that just returns all the values sequentially
[03:36:25] baweaver: >> [1,2,3].each_with_index.to_a
[03:36:25] ruboto: baweaver # => [[1, 0], [2, 1], [3, 2]] (https://eval.in/395933)
[03:36:59] Ox0dea: baweaver: Isn't it heretical to use methods like #concat in functional Ruby?
[03:37:08] Ox0dea: I realize your usage in this case is referentially transparent, mind.
[03:37:28] baweaver: >> a = [1]; a.concat([2]); a
[03:37:29] ruboto: baweaver # => [1, 2] (https://eval.in/395934)
[03:37:43] Ox0dea: It's still fine, though.
[03:37:47] notthekgb: Is there some way of setting x to the array index value defaulting to 0?
[03:37:53] Ox0dea: You never expose the internal "non-functional" object.
[03:38:01] baweaver: yeah, but still....
[03:38:10] baweaver: I thought concat was pure for some reason
[03:38:25] Ox0dea: You thought it was #push?
[03:38:46] hotpancakes: has joined #ruby
[03:38:50] Ox0dea: Wait, what am I talking about?
[03:38:51] baweaver: I suppose you can use +
[03:39:16] Ox0dea: So much garbage to collect. :/
[03:39:33] gix: has joined #ruby
[03:41:47] yosafbridge: has joined #ruby
[03:42:09] krasnus: has joined #ruby
[03:42:19] mistermocha: has joined #ruby
[03:42:39] alem0lars: has joined #ruby
[03:43:01] a346: has joined #ruby
[03:43:21] yfeldblum: has joined #ruby
[03:44:33] olistik: has joined #ruby
[03:44:36] Xoro: has joined #ruby
[03:44:37] Ox0dea: notthekgb: Would you mind posting example code? It's quite likely there's a better way to do $thing than maintaining an index across calls.
[03:45:36] danielpclark: has joined #ruby
[03:45:38] Aswebb_: has joined #ruby
[03:45:39] notthekgb: I would but it uses an API so the language isn't proper Ruby
[03:45:49] notthekgb: I literally started yesterday :P
[03:46:11] Ox0dea: All right, then. You're probably looking for something like: @index ||= 0; code...; @index += 1
[03:46:15] Ox0dea: But that's really not great.
[03:46:47] riskish: has joined #ruby
[03:49:04] tubuliferous_: has joined #ruby
[03:50:41] iateadonut: has joined #ruby
[03:51:02] Ox0dea: baweaver: So, why the objection to an internal #concat, exactly?
[03:51:13] xcesariox: has joined #ruby
[03:51:16] Ox0dea: Nobody can see the impurity.
[03:51:32] sacarlson: has joined #ruby
[03:51:36] baweaver: Just that I thought it was a pure version for some off reason
[03:51:45] baweaver: anyways, it doesn't really matter
[03:51:53] baweaver: I just need to remember that one.
[03:52:03] baweaver: either that or flip the order
[03:52:07] sacarlson: I'm looking at this https://github.com/cowboyd/commonjs.rb is this the best method to run node.js inside of ruby? if so I need examples that include require in them
[03:52:32] baweaver: what fresh hell inspired people to go and do that?
[03:52:40] Ox0dea: sacarlson: Try this one: https://github.com/vanruby/javascript
[03:52:40] baweaver: ....nevermind
[03:52:52] baweaver: probably something I don't want answered.
[03:52:55] sacarlson: Ox0dea: ok I'll take a look
[03:53:05] Ox0dea: sacarlson: Note well that it's satirical, and for very good reason.
[03:53:49] LucasRim: has joined #ruby
[03:54:39] LucasRim: has left #ruby: ()
[03:54:46] casadei_: has joined #ruby
[03:57:10] havenwood: has joined #ruby
[03:57:17] luriv_: has joined #ruby
[03:58:19] sacarlson: Ox0dea: so with this javascript above I can run npm pakages in it also with require?
[03:58:38] sacarlson: I didn't see any example in it that included require
[03:58:41] baweaver: What are you trying to do anyways?
[03:59:09] sacarlson: I'm trying to use the libs of Stellar making a bridge in the protocol to ruby
[03:59:27] sacarlson: stellar libs are writen in node.js
[03:59:29] baweaver: explain that to me like I'm 5
[03:59:43] penzur: has joined #ruby
[04:00:12] lucasr: has joined #ruby
[04:00:16] sacarlson: I just need to run javascripts that can also have require in them I guess with an engine that supports all features of node.js
[04:00:29] baweaver: like just using nodejs
[04:00:40] havenwood: sacarlson: Any relation to Ruby?
[04:00:48] baweaver: why do you _need_ to use ruby?
[04:01:12] sacarlson: because my apps are writen in ruby that need access to the stellar payment system
[04:01:39] lucasr: hey can i ask someone on notation for a method? I???m kinda lost???
[04:01:52] sacarlson: my app is a poker accounting system that uses stellar as a payment system for p2p poker play
[04:01:57] baweaver: you can lucasr, it's best to just ask
[04:02:19] baweaver: considering it's not findable on the internet at all
[04:02:36] baweaver: Stellar comes up as a parallax scrolling plugin on google
[04:03:32] sacarlson: https://github.com/sacarlson/pokerth_accounting/wiki https://www.stellar.org/
[04:03:58] baweaver: lordy they like buzzwords
[04:04:09] lucasr: I???m having trouble understanding the scan method??? so I???m looking at this: .scan(/.{1,3}/)
[04:04:21] baweaver: look into regex
[04:04:22] sacarlson: the new version of stellar doesn't support my old stellar interface api
[04:04:26] baweaver: . is any character
[04:04:49] baweaver: {x,y} is x to y times
[04:04:52] rbowlby: has joined #ruby
[04:04:57] baweaver: so in this case, one to three characters
[04:05:45] baweaver: Now on Stellar, why does it need to use that
[04:06:05] Aeyrix: i accidentally installed the documentation
[04:06:07] Ox0dea: >> "\n".scan(/.{1,3}/)
[04:06:07] Aeyrix: for these gems
[04:06:08] ruboto: Ox0dea # => [] (https://eval.in/395937)
[04:06:13] Ox0dea: baweaver: Why you lie?!
[04:06:22] baweaver: newline isn....
[04:06:29] baweaver: technically
[04:06:51] baweaver: lucasr: short answer, learn regex
[04:06:56] Ox0dea: Aeyrix: Running low on terabytes?
[04:06:59] Feyn: has joined #ruby
[04:07:03] Aeyrix: Ox0dea: It takes years.
[04:07:07] lucasr: cool. i???ll look into that!
[04:07:37] eam: >> "\n".scan(/.{1,3}/m)
[04:07:38] ruboto: eam # => ["\n"] (https://eval.in/395942)
[04:07:49] Ox0dea: eam: /m for magic?
[04:07:58] eam: as always
[04:08:04] eam: and /sm is secret magic
[04:08:19] baweaver: https://www.stellar.org/blog/stellar-consensus-protocol-proof-code/ - they love being unnecessarily dense
[04:08:56] auzty: has joined #ruby
[04:09:51] surs4: has joined #ruby
[04:10:45] howdoicomputer: has joined #ruby
[04:11:06] baweaver: sacarlson: best advice is to ditch stellar, seems like a crappy system honestly.
[04:11:19] baweaver: second piece of advice, learn ruby
[04:11:53] baweaver: you have getter and setter methods, returns, and a whole lot of other stuff in there that reads like a java programmer
[04:11:55] sacarlson: baweaver: so you didn't like my program? it work perfectly now on the present system of stellar
[04:12:13] pengin: has joined #ruby
[04:12:16] sacarlson: it's the upgraded stellar system I'm preparing for
[04:12:18] eam: I wish ruby RE supported (?{})
[04:12:46] sacarlson: Stellar is the future of money tranfer
[04:12:56] baweaver: it's the future of blowing hard
[04:13:03] baweaver: and a lot of hot air
[04:13:13] sacarlson: it works that's all I need say
[04:13:22] sacarlson: and it works today
[04:13:24] baweaver: they don't actually say anything other than a lot of really fast buzzwords that makes apache documentation look readable
[04:13:32] bigmac_: has joined #ruby
[04:14:05] Musashi007: has joined #ruby
[04:14:10] Ox0dea: > The exact rules for how often (??{}) and (?{}) are executed in a pattern are unspecified.
[04:14:15] Ox0dea: eam: No thanks. :)
[04:15:00] fgo: has joined #ruby
[04:15:02] eam: Ox0dea: what's wrong with that? just write good code without side effects :)
[04:15:21] hotpancakes: has joined #ruby
[04:15:39] eam: it's totally reasonable not to specify the iterative internals of a RE engine
[04:17:07] sigurding: has joined #ruby
[04:17:57] braincra-: has joined #ruby
[04:18:45] Ropeney: has joined #ruby
[04:20:15] quazimodo: is mri 2.2.0 limited to around 3000 threads at a time?
[04:20:28] quazimodo: or is this a system setting/configuration
[04:21:01] eam: quazimodo: probably a system setting of yours
[04:21:27] eam: you might be hitting a memory limit, depending on where you're running that
[04:23:16] quazimodo: eam i'm guessing system setting
[04:23:28] quazimodo: i'd imagine ruby should eb able to have hundreds of thousands of threads
[04:23:32] quazimodo: they aren't that heavy :/
[04:23:48] eam: they can be (and it's not necessarily ruby's fault
[04:24:14] eam: you'll probably run into pid_max capping the max tid well before 100k
[04:24:27] eam: a lot of systems limit that at 5 digits
[04:24:33] quazimodo: that's my ubuntu setting
[04:25:01] quazimodo: so how do erlang et al get away with their hundreds of thousands of threads?
[04:25:15] eam: and the underlying libc on some platforms can allocate a hell of a lot of address space for tls, like 64MB in some cases
[04:25:22] eam: quazimodo: they're not really threads
[04:25:23] bigmac_: has joined #ruby
[04:25:52] quazimodo: i thought erlang threads were native threads
[04:26:21] choke: has joined #ruby
[04:26:23] eam: anyone doing hundreds of thousands is using some kind of concurrency abstraction
[04:26:28] burgestrand: has joined #ruby
[04:26:35] quazimodo: well my machine's threads-max is ~63000
[04:26:45] eam: which might at some point map onto a real thread pool, but it'd be an N:M relationship
[04:26:47] sevenseacat: ACTION spawned a billion processes in elixir for the fun of it once
[04:27:02] eam: quazimodo: same deal for goroutines btw
[04:27:04] quazimodo: eam hrm didn't know htat
[04:27:06] surs: has joined #ruby
[04:27:12] quazimodo: cool to know
[04:27:21] quazimodo: i guess that's why it's easy to make a lot of fibers
[04:27:58] eam: quazimodo: which value are you looking at for threads-max?
[04:28:20] eam: if this is linux, check /proc/sys/kernel/pid_max
[04:28:21] quazimodo: cat /proc/sys/kernel/threads-max
[04:28:26] quazimodo: for my machines threads max
[04:28:28] Oog: has joined #ruby
[04:28:28] eam: is it 32k?
[04:28:31] quazimodo: pid_max is process ids right?
[04:28:34] lkba: has joined #ruby
[04:28:39] eam: yes, but it also limits thread ids
[04:28:52] eam: yeah so you're capped at 32k
[04:29:04] quazimodo: 32k threads overall?
[04:29:11] eam: yes system limit
[04:29:14] eam: threads + pids
[04:29:18] eam: tid/pid
[04:29:20] bruno-: has joined #ruby
[04:29:28] quazimodo: i have 30k full then?
[04:29:40] eam: ps -eLf|wc -l
[04:29:41] quazimodo: there's a process specific cap somewhere too
[04:30:14] eam: quazimodo: if you're looking at max user processes, that one does not apply to threads
[04:30:19] eam: (the rlimit)
[04:30:32] quazimodo: eam: i'm not sure what' im looking at, first time i've explored this space
[04:30:50] eam: oh 854 is how many total threads you had? from ps/wc?
[04:31:02] eam: ulimit -a will show you the rlimits, the per-user limits
[04:31:05] Oog: has joined #ruby
[04:31:28] eam: (sorta per user, sorta per process)
[04:32:38] eam: each thread needs a C stack (in addition to any ruby level resources) so the "stack size" you see -- well that's memory allocated per thread at the libc level. Ruby will use that, plus a bit more per thread
[04:32:55] eam: on my system that's 10MB/thread for the stack
[04:33:03] AyeDubyew: has joined #ruby
[04:33:05] quazimodo: max user processes (-u) 31567
[04:33:22] eam: so 100k threads would be around a Tb of RAM just for the C level call stack
[04:33:32] eam: did I math that correctly?
[04:34:14] notthekgb: Ox0dea: @index?
[04:34:22] Ox0dea: eam: Looks properly mathed to me.
[04:35:11] Ox0dea: notthekgb: That's an instance variable. You'll have to use a $global instead if you're not using a class.
[04:35:12] quazimodo: stack size (kbytes, -s) 8192
[04:35:32] quazimodo: 8000 odd kb per thread?
[04:35:43] eam: quazimodo: 8MB
[04:35:50] quazimodo: 8mb PER THREAD?
[04:35:53] quazimodo: that's insane?
[04:36:11] eam: quazimodo: well, think of it this way: how many functions can you call before you blow out the stack?
[04:36:15] notthekgb: hmmm. I'll try writing out the sort of thing I'm looking to achieve, albeit not in Ruby.
[04:36:22] eam: an integer is 8 bytes
[04:36:27] eam: an address is 8 bytes
[04:36:50] Ox0dea: >> require 'objspace'; ObjectSpace.memsize_of(Thread.main)
[04:36:51] ruboto: Ox0dea # => 525104 (https://eval.in/395975)
[04:36:53] fgo: has joined #ruby
[04:36:53] eam: so int foo(int a, int b, int c) is gonna take a minimum of 32 bytes
[04:36:56] eam: to call
[04:37:03] eam: (and a bit more because reasons
[04:37:18] sphex: quazimodo: that's just virtual memory.. it's won't use any real memory until it is accessed.
[04:37:34] eam: address space yeah
[04:37:54] eam: when you put more stuff on the stack it'll fault and allocate real memory backing it
[04:38:15] eam: quazimodo: you can use the pmap command to inspect the memory layout of a process
[04:38:20] sphex: quazimodo: it reserves a lot of virtual memory just to guarantee that it can have enough that is consecutive (which is required for a thread stack)
[04:38:54] eam: quazimodo: try this in your shell: pmap $$
[04:39:05] eam: that'll show you the memory layout of (probably bash)
[04:39:39] d3v: has joined #ruby
[04:40:03] eam: sphex: I don't think it maps the entire thing at once though
[04:40:05] jamesaxl|2: has joined #ruby
[04:40:11] notthekgb: This isn't ruby (or anything, really) but this is what I'm looking to achieve, Ox0dea: http://pastebin.com/f6fTTi7V
[04:40:12] ruboto: notthekgb, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/e139526f7a4368740419
[04:40:12] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[04:40:15] eam: the stack grows downward so there's no need to reserve space
[04:40:25] darkf_: has joined #ruby
[04:40:48] notthekgb: oops, sorry about the pastebin link.
[04:41:00] sphex: eam: the mapping is known and reserved by the kernel, but yeah I think on most architecture, the CPU page table is updated lazily after page faults.
[04:41:04] quazimodo: i had no idea that a thread would need 8mb reserved
[04:41:16] quazimodo: i thought maybe kernel gives it more space as it needs it
[04:41:17] eam: quazimodo: it doesn't use 8M of real memory
[04:41:24] eam: it does, at another level
[04:41:56] quazimodo: an erlang box would use maybe a couple thousand threads in a pool to manage 100k+ fake threads eh?
[04:41:58] Frem: has joined #ruby
[04:42:02] neanderslob: has joined #ruby
[04:42:03] quazimodo: i guess that makes each fake thread much cheaper
[04:42:03] eam: quazimodo: /proc/$$/smaps has the same data as pmap, but with more detail about what each region actually represents
[04:42:04] ips|malc: has joined #ruby
[04:42:35] eam: quazimodo: I imagine probably only around N cpu worth of threads (but I don't know erlang all that well, so)
[04:42:44] Ox0dea: notthekgb: https://gist.github.com/0x0dea/8f080dd3b08695e427a7
[04:43:11] eam: you can't run more than one thread per cpu, so it doesn't make a whole lot of sense to have more threads than cpus -- unless you're doing it to be lazy around implementing your state machine
[04:43:43] eam: or because you want the kernel to schedule for you
[04:43:45] eam: eg a thread-per-connection
[04:44:14] eam: quazimodo: this is essentially why the high performance servers are no longer thread-per-connection
[04:44:27] eam: why no one uses apache prefork, etc
[04:44:41] eam: cost per thread
[04:44:43] zacstewart: has joined #ruby
[04:44:53] eam: (and in apache it's worse, because process)
[04:45:49] quazimodo: hence the reason actors can be nice
[04:46:11] quazimodo: abstractions on lots of areas, messaging, deadlocking and also the concurrency model
[04:46:41] bnagy: that was the highest density of wrong statements per foot I think I have ever seen on IRC
[04:46:53] eam: bnagy: which one
[04:47:04] quazimodo: I'm new to concurrency, trying to organise my thoughts
[04:47:04] bnagy: everything about memory and the stack
[04:47:11] eam: bnagy: which parts?
[04:47:14] notthekgb: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[04:47:20] bnagy: all the parts, that's what everything means
[04:47:33] bnagy: 12:35 < eam> when you put more stuff on the stack it'll fault and allocate real memory backing it
[04:47:39] sphex: look! I'm sorry! I wanted to look smert!
[04:47:41] bnagy: 12:37 < eam> the stack grows downward so there's no need to reserve space
[04:47:57] eam: you don't think the stack grows downward?
[04:48:16] bnagy: the stack grows downward
[04:48:29] eam: ok so you were wrong about "everything?"
[04:48:40] eam: what in particular do you disagree with?
[04:48:44] sacarlson: I can make a stack go any way I want I just put my computer upside down
[04:49:06] sacarlson: sorry couldn't resist that one
[04:50:39] eam: bnagy: do you disagree that the regions aren't backed by physical memory until a page fault occurs?
[04:50:52] theery: has joined #ruby
[04:51:00] willywos: has joined #ruby
[04:51:25] bnagy: which has nothing to do with the stack
[04:51:31] bnagy: that's just virtual memory
[04:51:40] ght: Question: I have a series of parameters passed from an API where the params are seperated by the string "-_-_-", and the params are confirmed being passed correctly, but when I execute this line, any...
[04:51:42] eam: bnagy: are you saying the stack is somehow outside of virtual memory?
[04:51:54] ght: param with a space in, the data after the space is discarded: params_arr = ARGV[1].split("-_-_-")
[04:52:00] eam: bnagy: are you saying that linux never page faults in the stack region?
[04:52:06] bnagy: eam: please don't put words in my mouth, they're bad enough in yours
[04:52:07] toretore: ght: ?gist your code
[04:52:10] ght: I thought .split() only based on the data provided and didn't also include space?
[04:52:16] ruboto: ght, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[04:52:18] ght: toretore: This is the only relevant code.
[04:52:21] ght: That single line.
[04:52:29] eam: bnagy: well I'm asking because you seemed very sure that everything I said was wrong, but now it seems you don't have any complaints at all
[04:52:30] sphex: compilers will generate code to periodically perform "stack probes" (when a lot of space is going to be used in the current frame) so that the kernel can grow the stack mapping incrementally. but that's for "the" process stack.. I don't think this trick is used for the multiple thread stacks.
[04:52:33] dellavg: has joined #ruby
[04:52:45] bnagy: eam: the lines I actually pasted are both wrong
[04:52:58] bnagy: as was a bunch of other wacky stuff being said
[04:53:01] ght: Does .split() not only split strings based on the parameter provided, but also by spaces? I don't see that in the documentation.
[04:53:02] eam: well you've agreed that not all of them are wrong, so what specifically do you think is in correct?
[04:53:40] eggoez: has joined #ruby
[04:53:44] toretore: >> 'foo-_-_-bar-_-_-baz'.split('-_-_-')
[04:53:45] ruboto: toretore # => ["foo", "bar", "baz"] (https://eval.in/395977)
[04:53:47] eam: sphex: there's a stack per thread
[04:54:00] ght: Yes, that works toretore, of course. That's not the issue.
[04:54:01] eam: if there wasn't, you couldn't be calling different functions in each thread
[04:54:08] ght: The issue is there's a parameter with a space in it.
[04:54:16] revath: has joined #ruby
[04:54:18] ght: And it's splitting on the space. For example, "My user" is a parameter.
[04:54:26] ght: And it's splitting it but the array is only returning "My"
[04:54:41] eam: and I believe that on linux, they must be the same size, which is why all of this is determined up front
[04:54:41] ght: Despite me specifying -_-_- as the split() parameter.
[04:54:42] toretore: let's see an example
[04:54:55] Musashi007: has joined #ruby
[04:55:05] bnagy: page faults just aren't relevant to what userland processes see as memory at all
[04:55:11] timonv: has joined #ruby
[04:55:19] bnagy: if you access unmapped memory you will fault
[04:55:20] sphex: eam: yeah. but "the" process stack and the thread stacks are not handled the same. the process stack has a fixed layout and is mapped lazily. not the thread stacks AFAIK. but they're still virtual memory.
[04:55:22] toretore: >> 'foo-_-_-My user-_-_-baz'.split('-_-_-')
[04:55:23] ruboto: toretore # => ["foo", "My user", "baz"] (https://eval.in/395978)
[04:55:26] eam: bnagy: that's correct, but if you think that contradicts anything I've said then you've misunderstood
[04:55:44] bnagy: you said there's no need to reserve space for the stack, that's wrong
[04:55:44] toretore: ght: do you understand why i want to see the code now? what you're saying is provably wrong
[04:56:05] bnagy: you said that "12:37 < eam> the stack grows downward so there's no need to reserve space" which is wrong
[04:56:16] eam: bnagy: I'm using simplified terms because I'm talking to a newbie, I'm saying "memory" in a lot of cases where sometimes I mean address space and sometimes I mean real memory. Is that the point of confusion?
[04:56:17] bnagy: because allocators know 0 about real memory
[04:56:30] Ox0dea: bnagy: Why irssi?
[04:56:41] bnagy: you're not simplifying, you just don't know what you're talking about
[04:56:57] eam: I submit that you, perhaps, do not know what I'm talking about
[04:57:07] eam: I think that's becoming clear the more I question you
[04:57:30] toretore: how about, instead of just repeating "you're wrong", you enlighten us on how it actually works?
[04:57:32] nveselinov: has joined #ruby
[04:57:38] ght: Well toretore, I realize you guys always say "dump all your code", but of course some of us work on proprietary applications where you can't dump entire methods or functions without heavy modification.
[04:57:43] ght: So thanks just the same, I'll take care of it.
[04:57:45] eam: toretore: +1
[04:57:46] heyimwill: has joined #ruby
[04:58:09] toretore: ght: you can still make an example to demonstrate your problem
[04:58:28] chinmay_dd: has joined #ruby
[04:58:29] mike___1234: has joined #ruby
[04:59:00] eam: bnagy: how about this, I'll continue to explain, but I'll ask you follow along with my examples ok?
[04:59:15] eam: when I said "the stack grows downward so there's no need to reserve space" I am referring to address space
[04:59:41] eam: because the stack grows downward there is no concern about obtaining contiguous address space
[04:59:49] fgo: has joined #ruby
[05:00:01] bnagy: why does the direction of the stack affect that?
[05:00:09] i8igmac: has any one tried downloading pandora music?
[05:00:10] eam: here is an example you can run on your own computer to verify. Start irb, enter $$; then run pmap $pid | grep stack
[05:00:23] eam: then in irb run def f(); f(); end; f()
[05:00:26] sacarlson: has left #ruby: ()
[05:00:31] eam: then run pmap $pid | grep stack again
[05:00:39] bnagy: eam: the stack is mapped, always
[05:00:45] eam: you will see that the *address space* of the stack region has changed
[05:00:52] eam: bnagy: please follow along with my example
[05:01:08] eam: ok, then everyone else can
[05:01:36] sphex: that's just for "the" process stack which has a fixed layout (together with the old text, bss and brk regions, etc. the kernel maps it lazily and the compiler must issue "stack probes" to ensure it works. AFAIK, this is not the case for thread stacks.
[05:01:57] lucasr: has joined #ruby
[05:02:08] eam: sphex: I'm less certain of that, but are you sure? I believe they're implemented identically
[05:02:08] bnagy: stack regions, thread or process, must be mapped. If you try to grow the stack past the limit you will stack overflow
[05:02:27] bnagy: if you somehow modify $sp to be outside of a valid region you will segfault
[05:02:47] bnagy: either way your stack space must "reserved" before you use it
[05:03:07] hahuang65: has joined #ruby
[05:03:07] bnagy: in virtual memory, because we're always talking about virtual memory because the whole diversion into page faults was silly
[05:03:53] eam: it's not silly to diverge into page faults when the question is "why is it using that much real memory?"
[05:04:16] eam: (and the answer is: it isn't, addressing it will cause a fault)
[05:04:30] eam: bnagy: you're right that it must be mapped though
[05:04:39] snockerton: has joined #ruby
[05:04:52] sphex: eam: no, not certain. but it still has to be completely reserved within the kernel of course. it could be lazily mapped too since compilers will issue stack probes all the same. I don't think it would be a worthwhile optimization nowadays though.
[05:05:08] bnagy: you're again bringing things into virtual memory that shouldn't be there
[05:05:28] bnagy: userland reserved vs committed memory is a different thing
[05:05:34] eam: bnagy: when the question is "does it really use X memory per thread" I don't see why discussing page faults is irrelevant -- because that's how it doesn't actually use that memory
[05:05:39] bnagy: that's why we have swap
[05:05:44] bnagy: no, it's not
[05:05:47] eam: we do not swap all address space
[05:06:10] eam: dude, one one of my systems there's a 64MB/thread address space allocation -- and we have tens of thousands of threads
[05:06:21] bnagy: yes, that's how virtual memory works
[05:06:27] eam: there is neither enough swap nor physical ram for that
[05:06:34] sphex: bnagy: there's a trick that is involved for stack memory only, and I think only for the main process stack. it is not mapped all at once.
[05:06:42] eam: there's simply nothing backing those regions until they're used (and they never are)
[05:07:17] eam: I agree it's not allocated via sbrk btw
[05:07:24] eam: but really, try the demo
[05:07:46] eam: I made it just for you, to head off any further misunderstanding =/
[05:08:21] eam: also, I gotta go watch a tv show with my wife but I'll be back in a bit if anyone wants to chat about how this stuff works
[05:09:19] blue_deref: has joined #ruby
[05:10:25] eggoez: has joined #ruby
[05:11:32] jesterfraud: has joined #ruby
[05:11:39] bnagy: that will give me time to make popcorn
[05:12:33] tkuchiki: has joined #ruby
[05:12:47] bnagy: "stack memory" o_0
[05:12:53] mleung: has joined #ruby
[05:12:53] bnagy: ok I have to do actual work
[05:13:50] CloCkWeRX: has joined #ruby
[05:14:30] hahuang65: has joined #ruby
[05:14:51] DanKnox: has joined #ruby
[05:15:58] dhjondoh: has joined #ruby
[05:16:44] GriffinHeart: has joined #ruby
[05:18:46] fantazo: has joined #ruby
[05:21:02] sigurding: has joined #ruby
[05:23:25] noethics: ya me 2 bnagy
[05:23:42] noethics: what a coincidence
[05:24:46] bluOxigen: has joined #ruby
[05:25:53] grey_beard: has joined #ruby
[05:26:02] Limix: has joined #ruby
[05:26:47] jesterfraud: has joined #ruby
[05:29:20] fabrice31: has joined #ruby
[05:31:30] aryaching: has joined #ruby
[05:32:34] eam: bnagy: I hope you're not disagreeing that the stack is comprised of memory now :^)
[05:33:06] eam: bnagy: the specific mechanism I was describing, and that sphex hinted at is explained in detail here: http://unix.stackexchange.com/questions/63742/what-is-automatic-stack-expansion
[05:33:23] eam: you can find the implementation in the kernel here: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/mm/mmap.c#n2282
[05:33:59] eam: don't take my word for it though - try it yourself!
[05:34:17] eGGsha: has joined #ruby
[05:34:29] eam: bummer that this got derailed =/
[05:34:30] Aswebb_: has joined #ruby
[05:34:59] lucasr: Hey guys. I???ve been looking at regex for a bit now, and I think I have the jist of it. but I???m still confused about something. https://gist.github.com/lucasrim/250b3b476d08085db4b0
[05:36:05] baweaver: scan puts matches in an array
[05:36:10] baweaver: only 3 characters match
[05:36:30] baweaver: >> '1234'.scan(/\d{3}/)
[05:36:31] ruboto: baweaver # => ["123"] (https://eval.in/395983)
[05:36:50] baweaver: you're saying _only_ groups of 3
[05:37:03] devbug_: has joined #ruby
[05:37:03] lucasr: ohh. okay
[05:37:06] baweaver: also, stop using return
[05:37:17] tubuliferous_: has joined #ruby
[05:37:21] eam: I like explicit returns =/
[05:37:22] baweaver: ruby infers returnd
[05:37:32] surs1: has joined #ruby
[05:37:41] baweaver: >> def one; 1 end; one
[05:37:42] ruboto: baweaver # => 1 (https://eval.in/395986)
[05:37:51] baweaver: so no need to set number to anything
[05:37:56] baweaver: just run that transformation
[05:38:35] lucasr: ah. okay so deleted number = and return.
[05:38:53] blueOxigen: has joined #ruby
[05:39:15] baweaver: https://gist.github.com/lucasrim/250b3b476d08085db4b0#comment-1489884
[05:39:40] baweaver: also don't use . unless you _mean_ any character
[05:39:48] baweaver: in this case you want \d which is digit
[05:39:54] lucasr: so basically what the regex is saying in .{3} is only give us the things that come in increments of three, and .{1,3} is saying??? just once every 3 characters?
[05:40:46] baweaver: between one and three
[05:40:49] baweaver: but it's greedy
[05:40:54] baweaver: so it wants the most possible
[05:41:01] baweaver: ...unless there are less than the most
[05:41:12] lucasr: that just made it click.
[05:41:20] baweaver: http://www.rubular.com
[05:41:26] baweaver: that's your new best friend in regex
[05:41:44] baweaver: though be warned, regex can make a mess fast
[05:41:47] baweaver: use sparingly
[05:42:49] tagrudev: has joined #ruby
[05:43:38] pyro_: has joined #ruby
[05:45:23] hotpancakes: has joined #ruby
[05:46:11] lucasr: hey thanks so much
[05:46:14] lucasr: that makes a lot of sens
[05:47:19] baweaver: best way to learn ruby is to go through the documentation for Enumerable, String, Array, and Hash
[05:47:33] howdoicomputer: has joined #ruby
[05:47:55] lucasr: is there a resource you like the most?
[05:48:59] acke: has joined #ruby
[05:50:13] baweaver: standard ruby docs cover most of it
[05:50:23] acke: has joined #ruby
[05:50:24] baweaver: past that, consider Eloquent Ruby (book)
[05:52:01] GitGud: has joined #ruby
[05:56:40] genpaku: has joined #ruby
[05:57:39] roolo: has joined #ruby
[05:58:40] revath: has joined #ruby
[05:59:20] olistik: has joined #ruby
[05:59:22] konsolebox: has joined #ruby
[06:00:02] devbug: has joined #ruby
[06:00:04] andikr: has joined #ruby
[06:01:55] ivanskie: has joined #ruby
[06:03:34] grey_beard: has joined #ruby
[06:05:00] ght: Question: Is there any way to force Ruby to take a parameter that has spaces in it and force it to be ARGV[1]?
[06:07:05] konsolebox: Synchronization in threads is kind of different in concept from the actual meaning of being synchronized (simultaneous) isn't it? It confuses me every time. (Points out to Mutex#synchronize).
[06:08:13] techietrash: has joined #ruby
[06:10:13] arup_r: has joined #ruby
[06:10:38] eam: ght: yes, but you're probably asking a shell question rather than a ruby question. As in your_script.rb "arg with spaces"
[06:11:03] eam: the shell tokenizes the args before ruby starts up
[06:14:12] konsolebox: ght: The arguments passed to Ruby is a finite array of null-terminated strings. Try to realize that the concept of a shell's environment does not apply to the binaries it executes.
[06:14:18] eam: konsolebox: I think the idea is that the lock contention is synchronous
[06:15:14] konsolebox: eam: umm, please elaborate "lock contention"
[06:15:31] konsolebox: eam: from https://en.wikipedia.org/wiki/Synchronization: Computer science (In computer science, especially parallel computing, synchronization refers to the coordination of simultaneous threads or processes to complete a task with correct runtime order and no unexpected race conditions.)
[06:15:55] konsolebox: eam: this time it's about the "order". and probably most computer scientists think like that.
[06:16:16] eam: konsolebox: yeah, so one thread is running the block and other threads interacting with the semaphore synchronize by blocking on it
[06:16:32] dfockler: has joined #ruby
[06:16:43] eam: you could say they're "not doing anything" but you could also say the thing they're doing is contending on the semaphore
[06:17:16] eam: (while the block is running, synchronously)
[06:17:25] GriffinHeart: has joined #ruby
[06:17:57] jenrzzz: has joined #ruby
[06:18:07] arturaz: has joined #ruby
[06:19:02] eam: like, traffic at an intersection is synchronous because the north-south cars pause while the east-west cars drive and vice versa
[06:19:48] eGGsha: has joined #ruby
[06:20:49] casadei_: has joined #ruby
[06:21:22] toretore: roundabouts are cooperatively scheduled
[06:21:38] konsolebox: eam: i understand what you try to imply, however i think a mutex is not the best fit example for trying to execute things to become or appear simultaneous. time, or an atomic variable would be better. mutex actually allow things to go more asynchronous.
[06:21:50] eam: konsolebox: I don't disagree with you :)
[06:21:56] peter_paule: has joined #ruby
[06:22:55] devbug_: has joined #ruby
[06:24:44] hahuang65: has joined #ruby
[06:25:42] arturmartins: has joined #ruby
[06:27:47] solars: has joined #ruby
[06:28:46] baweaver: the goal is to minimize critical sections as much as possible, and for the most part that's going to involve immutability until absolutely necessary to break it
[06:29:02] T3: has joined #ruby
[06:29:10] toretore: ght: it's not up to ruby, it's up to the shell. usually you use quotes, as in `ruby file.rb -a'foo bar' -bhello`
[06:29:52] baweaver: The less you have to touch mutex the better
[06:29:54] allomov: has joined #ruby
[06:30:57] jenrzzz: has joined #ruby
[06:42:57] chouhoul_: has joined #ruby
[06:43:01] luckyruby: has joined #ruby
[06:44:08] konsolebox: ok i think it's a little bit forgivable if we interpret or translate @mutex.synchronize{ code } as executing code in synchronization with @mutex. Although the concept of it is a little irritatingly not perfect. Well science allowed it anyway.
[06:44:57] konsolebox: the problem is i'm having a problem in choosing the proper term to call or refer to its "state".
[06:45:42] Soda: has joined #ruby
[06:49:22] lucasr: has joined #ruby
[06:52:12] roolo: has joined #ruby
[06:53:46] GriffinHeart: has joined #ruby
[06:54:47] allomov: has joined #ruby
[06:55:50] fabrice31: has joined #ruby
[06:55:59] alphaatom: has joined #ruby
[06:56:44] poguez_: has joined #ruby
[06:57:08] eGGsha: has joined #ruby
[06:57:30] tuor: has joined #ruby
[06:58:00] tuor: hi, i have tried to install a gem on my debian (wheezy), but got this error: http://paste.debian.net/280944/
[06:59:16] tuor: What does this mean?: "`require': cannot load such file"
[06:59:40] choke: has joined #ruby
[07:00:14] tuor: I mean require is a normal command for including stuff, so what is the problem?
[07:00:29] Oog: has joined #ruby
[07:01:36] devbug: has joined #ruby
[07:02:13] tbuehlmann: tuor, this might help: http://stackoverflow.com/a/17403687/384293
[07:02:38] michael_mbp: has joined #ruby
[07:02:38] rodfersou: has joined #ruby
[07:03:50] tuor: tbuehlmann, ah thx. :)
[07:06:53] tuor: the ruby1.9.1-dev was not in the recommends, so i didn't install it. works now.
[07:08:12] tbuehlmann: before installing rubies on a new system, I check https://github.com/postmodern/chruby/wiki/Ruby for requirements
[07:10:52] RickHull: has joined #ruby
[07:11:08] Ilyas: has joined #ruby
[07:11:11] RickHull: Hi, what's the best way to get ruby structures out of a yaml file with multiple documents?
[07:11:57] RickHull: currently i'm looking at Psych.parse_stream(File.read(filename)) { |doc| # Psych::Nodes::Document }
[07:12:23] RickHull: it's not clear how to convert a Psych::Nodes::Document to a ruby structure
[07:12:27] C1V0: has joined #ruby
[07:12:43] RickHull: http://ruby-doc.org/stdlib-2.1.0/libdoc/psych/rdoc/Psych/Nodes/Document.html
[07:13:30] RickHull: i'd be tempted to look at its superclass for useful methods
[07:13:41] RickHull: is there a link to its superclass on that page?
[07:14:01] RickHull: my general opinion: this documentation style is user-unfriendly
[07:14:30] RickHull: is there a good way to see what methods are available? including superclasses?
[07:14:46] RickHull: as it stands, the methods available are pitiful
[07:15:02] codecop: has joined #ruby
[07:15:11] sevenseacat: there is a link to its parent class, yes
[07:15:20] sevenseacat: in the big box that says 'parent'
[07:15:36] RickHull: how big is it, out of how many boxes?
[07:15:42] lkba: has joined #ruby
[07:16:16] tuor: tbuehlmann, ah thx.
[07:16:17] blackmesa: has joined #ruby
[07:16:17] RickHull: but indeed #to_ruby is what i was looking for, thanks
[07:16:23] sevenseacat: if i answer you, are you going to change the question again?
[07:16:35] RickHull: the question stands, you answered it
[07:16:40] RickHull: the complaint stands as well
[07:17:04] sevenseacat: 'i didnt bother reading, i just complained because i couldnt see what was right there on the page?'
[07:17:07] michael_mbp: has joined #ruby
[07:17:59] RickHull: please forgive me for not understanding to the totally different UI from e.g. http://ruby-doc.org/stdlib-2.1.0/
[07:18:01] aganov: has joined #ruby
[07:18:27] sevenseacat: you are forgiven.
[07:18:31] RickHull: which, btw, sucks for YAML http://ruby-doc.org/stdlib-2.1.0/libdoc/yaml/rdoc/index.html
[07:18:42] sevenseacat: I've never seen that set of docs before
[07:19:10] sphex: whoa. "()" means nil?
[07:20:37] konsolebox: apeiros: From yesterday's conversation: http://ruby-doc.org/core-2.2.2/Thread.html#method-i-raise: "Raises an exception from the given thread. The caller does not have to be thr." - What do you think "caller" is being referred to?
[07:20:47] sevenseacat: "()" is a string with parentheses in it.
[07:21:21] bnagy: rrrrr rvm returns from the grave to screw me one last time
[07:21:41] RickHull: konsolebox: the object which dispatches to #raise
[07:21:44] sphex: sevenseacat: oookay. `()` then?
[07:21:46] fabrice31: has joined #ruby
[07:21:52] bnagy: kind of hilarious bug. I imploded and removed it years ago, but it left rvm.sh in /etc/profile.d...
[07:21:56] ruboto: sevenseacat # => nil (https://eval.in/396014)
[07:22:11] sevenseacat: its a grouping of nothing.
[07:22:16] bnagy: which adds rvm_dir to your path which is now empty which means you get a :: in your peth
[07:22:18] sevenseacat: so it doesnt mean anything.
[07:22:23] konsolebox: RickHull: ok, can you give an example how that object dispatches it?
[07:22:27] bnagy: which bash treats as the same as having '.'
[07:22:37] bnagy: hilarity ensues o_0
[07:22:39] konsolebox: RickHull: and how would that differ in either threads?
[07:22:49] ruboto: RickHull # => nil ...check link for more (https://eval.in/396015)
[07:23:03] RickHull: >> ().class
[07:23:04] ruboto: RickHull # => NilClass (https://eval.in/396016)
[07:24:48] RickHull: konsolebox: what is the problem?
[07:25:26] tubuliferous_: has joined #ruby
[07:25:50] RickHull: just understanding the docs? or do you have unexpected code behavior?
[07:26:05] krz: has joined #ruby
[07:26:06] konsolebox: RickHull: apeiros: konsolebox: callers are objects. objects and threading are orthogonal concepts.
[07:26:28] RickHull: is your problem with the behavior or with doc verbiage?
[07:27:02] konsolebox: RickHull: no, it's about yesterday's conversation about how "callers" can _only_ be used or interpreted.
[07:27:23] sphex: sevenseacat: huh. well, it means the empty argument list when there's no space following the method name (which is what I was trying to do). very confusing.
[07:27:33] GriffinHeart: has joined #ruby
[07:27:37] sphex: and it makes ruby look a bit like lisp yay
[07:27:43] RickHull: sphex: well it's good ruby caught the error early!
[07:28:01] sevenseacat: you didnt provide any context for your question, I could have told you that parentheses also denote a method call
[07:28:17] dhjondoh: has joined #ruby
[07:28:24] sevenseacat: but by themselves, they dont mean anything
[07:28:24] sphex: RickHull: it doesn't.. it passes a nil argument instead. :/
[07:28:30] sevenseacat: no it doesnt.
[07:28:39] sevenseacat: foo() will not pass a nil to foo.
[07:29:13] sevenseacat: >> def foo(*args); puts args; end; foo()
[07:29:14] ruboto: sevenseacat # => nil (https://eval.in/396017)
[07:29:22] edwinvdgraaf: has joined #ruby
[07:29:23] devbug_: has joined #ruby
[07:29:26] sevenseacat: >> def foo(*args); puts *args; end; foo()
[07:29:27] ruboto: sevenseacat # => ...check link for more (https://eval.in/396018)
[07:29:41] sevenseacat: you suck ruboto.
[07:29:43] livathinos: has joined #ruby
[07:30:21] sphex: sevenseacat: yeah, not a question.. just a confusion I guess. :p and I'm always wondering if there's more to it.
[07:30:25] RickHull: >> def foo(*args); p args; end; foo()
[07:30:26] ruboto: RickHull # => [] ...check link for more (https://eval.in/396019)
[07:30:36] sevenseacat: oh yeah. puts vs p. derp.
[07:31:36] RickHull: >> def foo(*args); args; end; foo() # better
[07:31:37] ruboto: RickHull # => [] (https://eval.in/396020)
[07:32:13] sphex: >> def foo(*args); args; end; foo ()
[07:32:14] ruboto: sphex # => [nil] (https://eval.in/396021)
[07:32:22] devbug: has joined #ruby
[07:32:24] skade: has joined #ruby
[07:32:41] RickHull: sphex: yep, ruby didn't catch the error
[07:32:52] edwinvdgraaf: has joined #ruby
[07:32:52] sphex: it's a lisp easter egg!
[07:33:13] RickHull: if lisp is your surprise-baseline, expect to continue to be surprised
[07:33:26] Oog: has joined #ruby
[07:33:48] rdark: has joined #ruby
[07:34:22] edwinvdg_: has joined #ruby
[07:34:26] sphex: oh don't I wish there were more. but not this one.. it's syntactically confusing. :/
[07:34:44] haxrbyte: has joined #ruby
[07:35:01] sevenseacat: I dont see how
[07:35:11] RickHull: eliminate the confusion with the rule: method parens are always attached to the method
[07:35:36] sevenseacat: they are. the behaviour of the `foo ()` one is undefined.
[07:35:38] GPrime: has joined #ruby
[07:35:51] RickHull: if you give a method name and then a space, then that method name might not be interpreted as a method
[07:36:05] RickHull: e.g. if a local var exists
[07:36:26] sevenseacat: or rather, it passes the group () (which means nothing) as the first argument to foo
[07:36:36] sevenseacat: which is where the nil comes from
[07:36:50] sevenseacat: it gets a meaningless 'nothing' argument which it translates to nil
[07:36:52] RickHull: >> def foo(*args); args; end; foo = :bar; foo ()
[07:36:54] ruboto: RickHull # => [] (https://eval.in/396025)
[07:36:56] mkarnebeek: has joined #ruby
[07:37:10] RickHull: >> def foo(*args); args; end; foo = :bar; foo
[07:37:11] ruboto: RickHull # => :bar (https://eval.in/396026)
[07:37:14] hotpancakes: has joined #ruby
[07:37:20] sphex: sevenseacat: oh ok. yeah I figured it looked like just an implementation side-effect too.
[07:38:27] RickHull: sphex: note particularly that assigining the value `:bar` to the var `foo` does not affect our method definition of `foo`
[07:38:42] RickHull: we can disambiguate the method call with: foo()
[07:38:50] white_bear: has joined #ruby
[07:38:56] RickHull: but certainly not with: foo ()
[07:39:35] RickHull: >> def foo(*args); args; end; foo = :bar; foo()
[07:39:36] ruboto: RickHull # => [] (https://eval.in/396036)
[07:40:31] Aswebb_: has joined #ruby
[07:41:03] tuor: hi, how can i get autocompletion like in the shell for irb? I'm very new in ruby and don't know so much stuff, so just "search" with <tab><tab> is very nice.
[07:41:18] haxrbyte: has joined #ruby
[07:41:40] RickHull: tuor: try `pry` instead of irb
[07:41:56] RickHull: if needed, `gem install pry # sudo as nec`
[07:42:02] tuor: RickHull, ok thx.
[07:42:46] Polysics: has joined #ruby
[07:42:55] RickHull: pry is irb on steroids
[07:43:06] sphex: RickHull: interesting.. lemme reread that a bit.
[07:43:15] RickHull: both are REPLs. irb hasn't seen any meaningful features in like 10 years
[07:43:30] RickHull: pry gives an amazing amount of introspection
[07:43:49] RickHull: you can show method definitions etc.
[07:43:57] arturmartins: has joined #ruby
[07:45:08] tuor: ah ok. :)
[07:45:14] sphex: RickHull: so it seems to interpret it as a method call whenever there are arguments, or directly followed by "()" right?
[07:45:36] RickHull: ruby is very context sensitive in this respect
[07:45:56] RickHull: it wants to be ambigous about object.property
[07:46:07] konsolebox: What's the safest way to stop a thread that gets to long-wait access a semaphore from time to time? Using Thread#raise?
[07:46:09] RickHull: is object.property an attr / ivar?
[07:46:15] RickHull: or is it a method that returns a value?
[07:46:36] RickHull: konsolebox: i hate to say this, but it sounds like a deeper problem
[07:46:45] jaygen_: has joined #ruby
[07:46:52] RickHull: that said, you can use Timeout.timeout, but there are blog posts that say you shouldn't
[07:47:06] sphex: I was wondering about that... these method/local-variable situations can be disambiguated at parse-time (based on assignments seen thus far, etc)?
[07:47:22] mkarnebeek: has joined #ruby
[07:47:28] RickHull: >> Timeout.timeout(5) { `sleep 6` }
[07:47:29] ruboto: RickHull # => uninitialized constant Timeout (NameError) ...check link for more (https://eval.in/396040)
[07:47:46] RickHull: >> require 'timeout'; Timeout.timeout(2) { `sleep 1` }
[07:47:47] ruboto: RickHull # => (https://eval.in/396041)
[07:48:13] RickHull: >> require 'timeout'; Timeout.timeout(1) { `sleep 2` }
[07:48:14] ruboto: RickHull # => (https://eval.in/396042)
[07:48:33] RickHull: anyway, ruboto sanely disallowed it
[07:48:35] Hanmac1: has joined #ruby
[07:48:46] Scroff: has joined #ruby
[07:48:54] ndrei: has joined #ruby
[07:49:02] RickHull: sphex: yes, closures come into play as well
[07:49:03] apeiros: konsolebox: IMO badly worded. should be "calling thread does not have to be the current thread"
[07:49:41] mkarnebeek: I would like to bring https://bugs.ruby-lang.org/issues/10533 to attention
[07:49:54] mkarnebeek: Anybody who might be able to help me with this?
[07:49:55] RickHull: mkarnebeek: hasn't loaded yet
[07:50:01] apeiros: if only the docs for that method alone are looked at, it's not clear that `thr` is a reference to `currently executed thread`
[07:50:04] RickHull: but at best you can expect discussion here, i think
[07:50:40] sevenseacat: mkarnebeek: what can we do about it?
[07:50:40] RickHull: mkarnebeek: reported by drbrain, that is a good sign as far as relevance. not sure about resolution timeline
[07:50:53] sevenseacat: looks like you've put a patch together for it
[07:50:53] RickHull: mkarnebeek: Status:Closed
[07:51:03] sevenseacat: no-one here is ruby core
[07:51:04] sphex: huh. why can't ruboto allow the full MRI by spawning a freshly installed sandboxed VM with ruby packages for each command it gets. :p
[07:51:07] burgestrand: Don't use timeout if you can help it, it can raise in very odd situations and cause even more odd bugs.
[07:51:32] RickHull: Burgestrand: that's in line with the "blog posts" i referenced
[07:51:40] mkarnebeek: Yes, i've also mailed two core developers and sent a mail to the mailing list, but no responses so far
[07:51:40] RickHull: got a specific link to bad behavior?
[07:51:44] Musashi007: has joined #ruby
[07:51:57] RickHull: mkarnebeek: so is it fixed on a new version?
[07:52:15] burgestrand: RickHull: how about exceptions being raised in ensure-blocks, causing the ensure-clause to fail?
[07:52:16] mkarnebeek: RickHull: No, the previous patch did not fix it
[07:52:22] mkarnebeek: it's incorrectly set at closed
[07:52:31] apeiros: sphex: "why can't" - you seem to have a solution? I suggest you implement it and provide it for ruboto to use :)
[07:52:41] sevenseacat: mkarnebeek: I don't think anyone here can really help
[07:52:42] RickHull: Burgestrand: not doubting you, just looking for specifics
[07:52:45] burgestrand: RickHull: you have a link to those blog posts? I don't think I've read anything about this
[07:52:48] RickHull: i use Timeout.timeout a lot
[07:52:51] RickHull: with no issue
[07:53:01] joonty: has joined #ruby
[07:53:05] RickHull: "a lot" in various contexts, historically, without issue
[07:53:07] giuseppesolinas: has joined #ruby
[07:53:18] apeiros: "I use it a lot" != "it is not a problem"
[07:53:24] RickHull: totally agreed
[07:53:24] burgestrand: Empirically proven safe
[07:53:30] RickHull: i'm looking for specific issues here
[07:53:37] RickHull: so far we're all just hand-waving
[07:53:49] sphex: apeiros: "<ruboto> please hold..."
[07:53:53] mkarnebeek: sevenseacat: i was hoping to poke around and get somebody with permissions to apply the patch
[07:54:04] burgestrand: I'll see if I can make an example work.
[07:54:06] sevenseacat: mkarnebeek: no-one here can do it, sorry.
[07:54:06] RickHull: mkarnebeek: not gonna happen here
[07:54:23] olistik: has joined #ruby
[07:54:26] burgestrand: It's going to have to be slightly littered with sleeps though, since the issue is inherently racy.
[07:54:44] mkarnebeek: Ok, any tips on what i can to to get this moving?
[07:54:47] RickHull: Burgestrand: heh, no need to actually demonstrate
[07:54:59] RickHull: Burgestrand: I have read the prior complaints, and I don't doubt them
[07:55:04] burgestrand: RickHull: so what's the issue?
[07:55:09] RickHull: they didn't apply in my situation
[07:55:20] RickHull: i just don't recall what the exact complaints are
[07:55:44] RickHull: my issue would be: feel free to use Timeout.timeout except in these {...} situations
[07:55:55] RickHull: i'm not sure what those situations are
[07:56:13] apeiros: I think it's more like: don't use Timeout.timeout
[07:56:16] mkarnebeek: sevenseacat: Ok, tnx, any tips on what i can do to get this moving?
[07:56:19] ta: has joined #ruby
[07:56:20] RickHull: i think that a blanket "Timeout.timeout considered harmful" is incorrect
[07:56:28] apeiros: then you're mistaken
[07:56:31] sevenseacat: mkarnebeek: nope.
[07:56:39] RickHull: apeiros: duel!
[07:56:39] Antiarc: I just sat down and if we're talking about timeout.rb it is the devil and you should avoid it like the plague
[07:56:42] mkarnebeek: RickHull: Ok, tnx, any tips on what i can do to get this moving?
[07:56:44] apeiros: RickHull: at noon?
[07:56:56] sevenseacat: I trust Antiarc on this matter, he knows his shit.
[07:57:03] Antiarc: Seriously it is an amazing way to break your code and the code of anyone that uses your code in spectacular and indeterminate ways
[07:57:24] Antiarc: It's like Netflix's Chaos Monkey for your Ruby code
[07:57:25] RickHull: sure, halfway between cali and CH?
[07:57:30] sevenseacat: also you've been gone a while Antiarc, wb
[07:57:31] apeiros: RickHull: the problem with timeout is that it will interrupt your code *in any possible place*
[07:57:42] Antiarc: sevenseacat: Howdy, thanks. I've been around, just not in #ruby :)
[07:57:43] apeiros: RickHull: sounds good. where's that? atlantic?
[07:57:50] Antiarc: (I've been lurking in elixir-lang for a while :)
[07:57:55] RickHull: apeiros: i suggest that this is desirable in many cases
[07:57:56] sevenseacat: I haven't seen you there either :P
[07:57:59] DoubleMalt: has joined #ruby
[07:58:09] RickHull: apeiros: SF bay area
[07:58:22] Antiarc: RickHull: It's not because it can interrupt in places that you wouldn't want it to. Like in ensure blocks, which are designed to check resources back into resource pools.
[07:58:25] apeiros: RickHull: cali or the middle between cali & ch?
[07:58:35] RickHull: apeiros: ah, good point
[07:58:39] exadeci: has joined #ruby
[07:58:41] RickHull: cape hatteras maybe
[07:58:43] hololeap: has joined #ruby
[07:58:53] tomphp: has joined #ruby
[07:58:56] RickHull: porto mallorca?
[07:58:59] Antiarc: There was an issue in the mongodb driver where you could, if the stars aligned, have a timeout occur in the ensure block of a pool check-in, and that connection would then never get checked in and would leak
[07:59:03] Antiarc: And the connection would be pinned to that thread
[07:59:05] apeiros: ok, bermuda triangle at noon. it is settled. we shall duel :D
[07:59:15] allomov: has joined #ruby
[07:59:17] Antiarc: So the connection could never be acquired again, and that thread could never talk to mongodb again for the duration of that process' lifetime
[07:59:18] RickHull: Antiarc: i don't disagree. maybe avoid it in libs
[07:59:19] Antiarc: That was a fun one.
[07:59:26] RickHull: where you don't know who's calling in what context
[07:59:30] Antiarc: RickHull: You don't have to use it in libs to break stuff though
[07:59:33] apeiros: RickHull: your timeout block may span a single method
[07:59:44] RickHull: "generally harmful" sure
[07:59:45] apeiros: RickHull: but that single method is not a single line of code itself
[07:59:56] Antiarc: If you wrap a call in a Timeout block, and anything in that call - a library 26 calls down the stack maybe - is vulnerable to this kind of disruption, you can break it
[08:00:11] apeiros: and unless you inspected and basically mentally inlined all code and considered *every single point* in that code, you can't be sure it's not harmful.
[08:00:13] lee-jon: has joined #ruby
[08:00:20] Antiarc: The insidious thing about timeout is that you can inject exceptions into the code in places that it has no way of knowing it should handle the exception
[08:00:53] apeiros: you had File.open in your code? -> possible fh leak
[08:01:04] apeiros: you had a DB connection open in your code? -> potentially broken session
[08:01:05] Antiarc: So rather than the code saying "I know this exception can happen, and should handle it or pass it", you are injecting an exception from another thread at an arbitrary point into your "main" thread; it completely bypasses the normal stack-based guarantees
[08:01:16] apeiros: you access some shared state -> potentially corrupt data
[08:01:21] Antiarc: It's just...you're eventually going to break something with it. It's bad.
[08:01:27] sevenseacat: class is now in session
[08:01:31] apeiros: and there's so, sooo, sooooo many subtle ways it may break your stuff???
[08:01:34] RickHull: sure but my processes are short lived... and it works for me...
[08:01:46] Antiarc: And when something does break it'll be super weird and unobvious and you won't be able to reproduce it until it happens in production 3 weeks later at 4 AM
[08:01:56] sevenseacat: this is much more interesting that trying to figure out this elixir scheduling thing
[08:02:19] burgestrand: I wonder if there's a way to break a Mutex using Timeout, or if the implementation details of MRI prevents that from happening.
[08:02:26] Antiarc: (I have an irrationally strong hatred of timeout.rb)
[08:02:34] RickHull: Burgestrand: i like that idea. how bad can we break shit?
[08:02:42] burgestrand: (Break as in cause it to be forever locked without anybody to unlock it)
[08:02:49] RickHull: Antiarc: can you imagine a better impl?
[08:02:54] RickHull: it sure seems useful
[08:03:08] Antiarc: RickHull: Use IO.select for socket-based timeouts
[08:03:14] zacstewart: has joined #ruby
[08:03:14] surs2: has joined #ruby
[08:03:20] Antiarc: Use good old fashioned manual timings for CPU loops in a single thread
[08:03:24] burgestrand: The tricky part is that Ruby C methods might/might not be susceptible to these kind of raise timing issues.
[08:03:34] Antiarc: I think Mutex should be safe if you're using the block form
[08:03:45] burgestrand: Antiarc: my thesis is that it's not necessarily so!
[08:04:00] burgestrand: Antiarc: granted, synchtonize is implemented in C, but maybe there's a point in the call stack where the mutex won't be unlocked. :)
[08:04:09] apeiros: RickHull: anyway, bottom line is: timeout is always bad. there's situations you can get away with it. but that doesn't mean it's not bad :)
[08:04:41] Antiarc: Burgestrand: The thing timeout does is that it can raise an exception during execution *any* line of your Ruby code (or any single bytecode op, to be more specific)
[08:04:46] RickHull: i believe it now
[08:04:50] RickHull: i kind of believed it before
[08:04:57] apeiros: examples of where you might get away with it: workers in separate processes which are built to restart any task, regardless of how broken the data is
[08:05:03] RickHull: it still has remained useful and non-broken in my experience
[08:05:06] burgestrand: If Mutex#synchronize was implemented in Ruby using begin; mutex.lock; yield; ensure; mutex.unlock; end this would be easy to break with enough tries.
[08:05:16] Antiarc: It won't be able to interrupt the Ruby VM while it's in C-land, AFAIK
[08:05:30] apeiros: manual shell script which if it times out it'll terminate anyway
[08:05:54] apeiros: Antiarc: C-land can yield
[08:05:57] Antiarc: (If you want to read more about this, read up on Java's Thread.stop and why it was deprecated. Exact same stuff.)
[08:05:57] burgestrand: Antiarc: if I remember correctly Ruby will check the thread interrupt flag quite a few times even in C-land.
[08:06:02] apeiros: as in: tell the scheduler to continue
[08:06:17] RickHull: btw, confession: i can count the number ofensure blocks that have made it to production on one finger, maybe less
[08:06:24] apeiros: also C land now afaik runs in a separate thread, so even if the C code blocks, ruby code can still be scheduled. not sure about that, though.
[08:06:36] apeiros: RickHull: you have many many more hidden in methods you call
[08:06:45] RickHull: yeah, that i very much believe
[08:06:52] Antiarc: Right, it'll yield, but a thrown exception is going to pop the Ruby stack, right? Bah, I'm going to have to go look at the VM
[08:06:54] RickHull: but i'm a minimalist
[08:06:59] burgestrand: apeiros: that is news to me, previously the API was very explicit to allow parallell execution during C functions.
[08:07:10] burgestrand: apeiros: at least for Ruby 2.0, not sure about 2.1 and 2.2
[08:07:14] apeiros: Antiarc: no idea. I should probably one day expand my knowledge in that regard :)
[08:07:28] Antiarc: (I've spent most of my time lately in the jruby source, which is really good for thinking about concurrency stuff!)
[08:07:45] Antiarc: Things get really interesting when Ruby operations that are accidentally atomic because of the GVL are no longer so :)
[08:07:48] apeiros: Burgestrand: hm, I thought "C in separate thread" had been introduced in 2.0. but I only skimmed those news. maybe I misunderstood something.
[08:07:48] RickHull: Antiarc: oh, interesting
[08:08:06] RickHull: Antiarc: i'm a ruby guy in a java shop, and i think there is a huge jruby opportunity
[08:08:12] apeiros: Antiarc: yeah, assumed atomicity considered harmful
[08:08:15] Antiarc: RickHull: JRuby is awesome and you should use it :D
[08:08:29] burgestrand: apeiros: there was an API in 1.9 that was "experimental, might go away" which allowed you to unlock the GVL during e.g. a blocking C call, but I believe it was considered "will stay" in 2.0
[08:08:34] rbowlby: has joined #ruby
[08:08:36] RickHull: Antiarc: but I see very little in terms of Jruby for java guys, or jruby for ruby guys that want to integrate with java guys
[08:08:38] Antiarc: If for no other reason than being able to call Java packages directly from Ruby is baller as hell
[08:08:52] RickHull: Antiarc: like i literally have no idea how the integration works
[08:08:58] RickHull: and i've googled a fair bit
[08:09:03] RickHull: and I know headius etc
[08:09:12] RickHull: and i'm sure i could ping him and he would tell me
[08:09:15] Antiarc: RickHull: There are two ways to do it. The first is that you can run JRuby as a replacement for MRI, except you can load JARs and call Java code from JRuby
[08:09:34] Antiarc: The second is that you can actually embed the JRuby runtime in a Java project and then call Ruby code from Java. But I've done much less of that.
[08:09:41] burgestrand: apeiros: it's kind of hard to use for very similar reasons, it's a ruby API function that you pass 1) a "blocking" function to call, 2) arguments to said function, 3) a function to unblock #1, 4) arguments to unblock function.
[08:09:47] Antiarc: I find it really helpful to just use Ruby as a business logic driver on top of Java stuff.
[08:09:56] RickHull: Antiarc: do you have any comprehensive, go-to blog posts or docs?
[08:10:09] RickHull: i feel like there was a lot more 5 years ago
[08:10:15] RickHull: or even 10, when jruby was starting
[08:10:18] Antiarc: RickHull: For calling Java from JRuby: https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby
[08:10:24] RickHull: but now, there are no more introductory posts
[08:10:31] RickHull: that looks familiar, not purple however
[08:11:00] Antiarc: https://github.com/jruby/jruby/wiki/RedBridge
[08:11:02] Antiarc: And that's the other way
[08:11:09] RickHull: ok, go to the first link
[08:11:13] RickHull: ctrl-f classpath
[08:11:36] RickHull: what does it mean, for a ruby guy, for my "jar file to be on the classpath"
[08:11:57] Antiarc: RickHull: The classpath is basically the JVM's equivalent to Ruby's loadpath
[08:12:01] RickHull: no need to answer that question specifically
[08:12:05] RickHull: and yeah, i get that
[08:12:10] eGGsha: has joined #ruby
[08:12:16] krz: has joined #ruby
[08:12:22] Antiarc: Look at jbundler - it manages all the classpath shenanigans for you
[08:12:32] RickHull: ok, hm, that's new
[08:12:37] Antiarc: You just specify dependent JARs and it will download them with maven and mangle the classpath for you
[08:13:14] RickHull: for me particularly, i've got 10y of ruby dev, and only getting deep into java in the last few months with $new_job
[08:13:16] axl_: has joined #ruby
[08:13:18] burgestrand: apeiros: https://github.com/ruby/ruby/blob/ruby_2_2/thread.c#L1289 ??? it's a mouthful to read, but quite interesting.
[08:13:34] RickHull: i'd love to be all productive with jruby and integrate with my java bros
[08:13:41] Antiarc: I'm more of a Ruby dev than a Java dev, but my current projecte required Actual Concurrency, so I built it on JRuby and have had a total blast with it
[08:13:44] RickHull: but the big picture is not clear
[08:13:54] Antiarc: I've gotten to the point that I'm actually contributing stuff back to jruby, which is a ton of fun
[08:13:59] Antiarc: Java's a lot easier to hack on than C, IMO
[08:14:11] Antiarc: And the JRuby source is about four billion times more comprehensible than MRI's
[08:14:21] RickHull: inneresting
[08:14:42] RickHull: from when i've dived into MRI, i was surprised by ruby-like it "seemed"
[08:14:45] RickHull: R_VALUE and such
[08:14:51] RickHull: not sure how much of that is macros
[08:14:59] Antiarc: It's macros all the way down :)
[08:14:59] RickHull: and i'm not claiming to have understood it
[08:15:09] RickHull: but it "looked familiar"
[08:15:12] T3: has joined #ruby
[08:15:31] Antiarc: But yeah, all you have to do to start integrating with your team's Java code is to load a jar or class file from Ruby and start calling Java objects as though they were Ruby objects
[08:15:50] Antiarc: Like https://github.com/cheald/manticore/blob/master/lib/manticore/response.rb
[08:15:51] RickHull: makes sense
[08:15:59] Antiarc: That's a Ruby object that implements a couple of Java interfaces directly
[08:16:00] djbkd: has joined #ruby
[08:16:01] apeiros: Burgestrand: i should change my workplace to one where I can just read such stuff because it's a good idea to know that shit
[08:16:15] Antiarc: And you can pass it to a Java Executor as a Callable, even though it's a Ruby class!
[08:16:43] Antiarc: http://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/org/apache/http/client/ResponseHandler.html - that's what it implements
[08:16:55] RickHull: Antiarc: i guess what i'm missing, particularly given the manticore example, is how to get started
[08:17:12] RickHull: i'm guessing response.rb doesn't "work" without a lot of other infra / setup / config
[08:17:30] Antiarc: Well, it's part of a bigger project, but there's not a ton to it
[08:17:35] RickHull: which is fine. but a walkthru / tutorial is what i'm looking for
[08:17:48] RickHull: like let's say we have Proprietary.jar
[08:18:00] RickHull: and how do we make use of it from jruby
[08:18:03] Antiarc: Put it in the same place as proprietary.rb
[08:18:09] fabrice31_: has joined #ruby
[08:18:11] Antiarc: require_relative "./Proprietary.jar"
[08:18:30] Antiarc: And then you can say my_java_obj = Java::CompanyNamePropriertary::Object.new
[08:18:45] Antiarc: And that'll instantiate a company.name.proprietary.Object instance
[08:18:47] ljarvis: isn't that java.XXX
[08:19:13] Antiarc: The form is Java::CamelCastUriPath::Object
[08:19:24] RickHull: Antiarc: cool, that seems pretty straightforward. my googling was not as enlightening
[08:19:36] Zai00: has joined #ruby
[08:19:37] burgestrand: RickHull: have you looked at https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby?
[08:19:41] Antiarc: Java::OrgApacheHttp::NoHttpResponseException maps to org.apache.http.NoHttpResponseException
[08:19:48] Antiarc: It's reeeeally easy.
[08:20:07] CloCkWeRX: has left #ruby: ()
[08:20:07] RickHull: Burgestrand: heh, yep, already linked
[08:20:20] Antiarc: You could also java_import that object, or include_package the package
[08:20:34] Antiarc: so include_package "org.company.proprietary" would make that package visible in the current module scope
[08:20:43] Antiarc: So then you could just foo = ProprietaryObject.new
[08:20:57] sevin: has joined #ruby
[08:20:58] iateadonut: has joined #ruby
[08:21:00] konsolebox: RickHull: i try to avoid Timeout as well, but i guess I'll just use Mutex#sleep and a thread flag to stop the thread.
[08:21:01] RickHull: what if a feature request comes in to the java guys
[08:21:03] Antiarc: Or java_import "org.company.proprietary.ProprietaryObject", if you don't want to include the whole package
[08:21:13] RickHull: and i'm all "hey i can do that in jruby"
[08:21:26] RickHull: can we get that functionality into the jar?
[08:21:58] Antiarc: It depends on how the project is being deployed, really. To ship that you would have to ship the jruby-complete jar with your deliverable (as a POM dependency or whatever) and set up a Ruby VM that exposes your execution environment
[08:22:01] RickHull: i'm sure the answer is yes, but this the other question i had trouble ansewring
[08:22:15] RickHull: in my case we are using maven
[08:22:18] Antiarc: https://github.com/jruby/jruby/wiki/RedBridge describes that sort of thing
[08:22:27] RickHull: ok, that is a new link :)
[08:22:42] RickHull: pasted before, yes. but i didn't click on it then :)
[08:22:54] rickmasta: has joined #ruby
[08:23:12] Antiarc: That would be more useful for adding Ruby scripting to an existing Java project
[08:23:13] RickHull: konsolebox: are you waiting on socket comms?
[08:23:31] konsolebox: RickHull: no..
[08:23:33] Antiarc: But the Ruby-Java crosstalk still works. You can still call Java code from Ruby that's called from Java
[08:23:52] sivoais: has joined #ruby
[08:23:59] Antiarc: RickHull: #jruby is super helpful if you're interested in dipping your toes in, FWIW
[08:24:28] RickHull: I'm sure. i got frustrated by the jruby web content (docs, tutorials)
[08:24:32] Oog: has joined #ruby
[08:24:41] RickHull: and #jruby was probably my next step, but i gave up
[08:24:45] arturmartins: has joined #ruby
[08:24:54] RickHull: until you prompted me :)
[08:24:58] Antiarc: TBH it may not be a bad idea to document the places you have issues, and then file those as a ticket. The JRuby leads have been wanting to improve its visibility and make it easier for Ruby devs to pick it up and experiment with it
[08:25:13] RickHull: cool, i'm super happy to help out in that area
[08:25:15] Antiarc: So noting the places where a newcomer has issues or concerns would be valuable!
[08:25:44] Scrofff: has joined #ruby
[08:26:29] sphex: hey. I'm trying to do something but I'm not sure I understand what it is... you know when you pass a block to :define_method, it does a thing to it which associates it with the class (and allows it to access instance variables, etc). can I get the same thing done to an anonymous proc (which I could then call with #call)?
[08:26:42] yeticry: has joined #ruby
[08:26:50] Antiarc: You could just bind the proc as a block, no?
[08:26:56] Antiarc: define_method :foo, &my_proc
[08:27:11] olistik_: has joined #ruby
[08:27:22] i8igmac: has joined #ruby
[08:28:15] sphex: yeah, but then I don't have it as a first-class value (which I can put in data structures, etc). unless I get it back from #method I guess.
[08:28:48] Antiarc: I guess I don't quite grok what you're doing
[08:28:57] MagePsycho: has joined #ruby
[08:29:00] ruboto: We can't help you without your code, please post it to https://gist.github.com
[08:29:59] sphex: oh wait.. maybe it's when you actually call something through an object that it gets its association with it..
[08:30:28] burgestrand: We're not javascript.
[08:30:49] bruno-: has joined #ruby
[08:31:06] Antiarc: I'm not 100% sure on this, but I think that define_method :foo, &proc will behave similarly to @instance.instance_exec(&proc)
[08:31:11] sphex: my code is all garbled and confused. I'm trying to make a test DSL to learn metaprogramming and it's not happening. :/
[08:31:50] burgestrand: sphex: http://ideone.com/7yXSCv
[08:32:04] lxsameer: has joined #ruby
[08:32:04] lxsameer: has joined #ruby
[08:32:05] burgestrand: Unfortunately the &block passed to wrapped will get lost because of this. :(
[08:32:30] burgestrand: Can probably get around that by using define_method instead if you really want to. :)
[08:33:20] senayar: has joined #ruby
[08:33:23] sevin: has joined #ruby
[08:33:45] senayar: has joined #ruby
[08:35:28] dumdedum: has joined #ruby
[08:36:32] haxrbyte: has joined #ruby
[08:37:24] chinmay_dd: has joined #ruby
[08:38:29] blackmesa: has joined #ruby
[08:39:49] sphex: Antiarc, Burgestrand: it works! not sure why, my brains are fried at this point. I guess it makes sense though. I was really searching for somekind of built-in wrapper just like that and forgot about instance_exec completely.
[08:40:00] Scroff: has joined #ruby
[08:40:09] sphex: Burgestrand: thanks for the example!
[08:41:29] hahuang65: has joined #ruby
[08:41:59] burgestrand: sphex: https://eval.in/396073 ??? made another one!
[08:42:18] devbug_: has joined #ruby
[08:42:45] Antiarc: Ooh, refine. Fancy.
[08:43:06] fabrice31: has joined #ruby
[08:43:08] burgestrand: The downside is that the arguments will be strict once you define it as a method (i.e. it becomes a lambda)
[08:43:18] sphex: holy s**t
[08:43:36] burgestrand: The upside is that you can now pass blocks to wrapped.call!
[08:44:02] livathinos: has joined #ruby
[08:45:43] msgodf: has joined #ruby
[08:45:46] edwinvdgraaf: has joined #ruby
[08:46:06] krz: has joined #ruby
[08:46:09] lessless: has joined #ruby
[08:46:18] sphex: Burgestrand: awesome. Proc#bind would be exactly what I was thinking of... thanks!
[08:47:30] sphex: I'm gonna have to reread this for a while...
[08:47:52] yfeldblum: has joined #ruby
[08:48:08] xkef: has joined #ruby
[08:49:17] yfeldblum: has joined #ruby
[08:49:23] Antiarc: https://gist.github.com/cheald/8e19ad6e2b821e7ff83b
[08:49:32] Antiarc: That does the same thing, though it has to use send to call #define_method
[08:49:58] quimrstorres: has joined #ruby
[08:50:11] burgestrand: I'm not sure how thse things will behave regarding the ruby method caching.
[08:50:54] Antiarc: define_method will invalidate the cache
[08:50:57] ruby-lang867: has joined #ruby
[08:51:08] Antiarc: as should define_singleton_method
[08:51:09] burgestrand: Indeed, I'm just not sure of the repercussions.
[08:51:23] Antiarc: Well, if you're calling it in a loop in production code, Bad Things. :)
[08:51:40] Antiarc: (though ostruct is really the only place where that tends to happen on any kind of regular basis, IME)
[08:51:46] burgestrand: Because the method cache is not just One Global Cache anymore, is it?
[08:51:58] Antiarc: Right, I think it's per inheritance tree as of 2.2?
[08:52:42] surs3: has joined #ruby
[08:53:34] burgestrand: Found some claims that starting with 2.1, altering a class will only invalidate the caches for that class and its subclasses. Wonder how altering the singleton class pans out???
[08:54:34] RickHull: fuck, cache invalidation, naming things, and off by one errors
[08:55:19] Antiarc: Burgestrand: That's a good question, actually. instance.extend(ExtraFunctionalityModule) is something I used to see but generally got patched out because of method cache churn. I wonder if it's viable now.
[08:55:21] RickHull: there are only 2 hard problems in programming: determining when to go bed, and doing so
[08:55:38] sevin: has joined #ruby
[08:55:48] burgestrand: Antiarc: looks like accessing the singleton class does cause some kind of cache invalidation.
[08:56:17] burgestrand: Antiarc: https://eval.in/396079
[08:56:23] olistik: has joined #ruby
[08:57:04] sphex: in my case, this would all be done only when defining the class. looks like the define_method/method/remove_method trick will do fine and I won't have any instance_exec either. but instance_exec isn't (as much of) a performance problem I guess?
[08:57:17] senayar: has joined #ruby
[08:57:19] Antiarc: Burgestrand: Hrm. That's unfortunateish.
[08:57:25] anisha: has joined #ruby
[08:57:33] burgestrand: sphex: it's only a performance problem if you do a lot of my_proc.bind(object)
[08:57:34] Antiarc: sphex: It's not particularly a performance problem, no.
[08:57:51] burgestrand: sphex: and it's kind of isolated, so I would say don't mind it at all unless you run into performance problems
[08:58:01] Antiarc: Rule of thumb is that you don't want to be extending objects or defining new methods at runtime after all your initial setup
[08:58:14] RickHull: rule #2 is always be profilin
[08:58:25] burgestrand: Rule #3 is you don't need performance until you need it
[08:58:37] RickHull: and when you do, she is a fickle strumpet
[08:58:41] ndrei: has joined #ruby
[08:59:01] sphex: Burgestrand: ok. I'll be doing those during class definition only (and then save the "bound" procs).
[08:59:31] araujo: has joined #ruby
[08:59:36] Antiarc: You probably shouldn't worry about method cache stuff too much right now. Just keep the term in mind so that when someone yells at you for cache thrash you'll know what to look at :)
[08:59:47] tchebb: has joined #ruby
[09:00:22] RickHull: rule #1 is don't worry about stuff too much right now
[09:00:27] Oog: has joined #ruby
[09:00:30] burgestrand: Now that the method cache busting mostly isn't global I don't really care either way??? and I didn't even before I knew there was a global method cache that could be busted either.
[09:00:58] RickHull: rule #0 is MRI is a black box and you don't want to open the lid
[09:01:04] araujo: has joined #ruby
[09:01:14] Antiarc: heh, back in the day eliminating ostruct usage produced a measuable improvement in my Rails app performance
[09:01:40] RickHull: and then things were improved, and your optimization wasn't?
[09:02:18] Antiarc: I still don't recommend the use of ostruct.
[09:02:25] marr: has joined #ruby
[09:02:36] RickHull: Hashie::Mash for everyone!
[09:02:37] burgestrand: Accessing a random undefined method? SURE, HERE'S A NIL!
[09:02:51] edwinvdgraaf: has joined #ruby
[09:02:58] senayar: has joined #ruby
[09:03:15] bnagy: I never understood ostruct. Like.. just use a hash o_0
[09:03:26] bnagy: struct at least has some uses
[09:03:51] RickHull: the siren song for ostruct was foo.bar and foo['bar']
[09:04:04] RickHull: let alone foo[:bar]
[09:04:13] chinmay_dd: has joined #ruby
[09:04:24] quimrstorres: has joined #ruby
[09:04:25] RickHull: (at the code level, leaving aside C nerds)
[09:05:05] dumdedum: has joined #ruby
[09:05:30] susmus: has left #ruby: ()
[09:06:56] sevin: has joined #ruby
[09:06:59] bnagy: I guess, but I still don't get it :)
[09:07:00] RickHull: god forbid you wanted a key named :delete
[09:07:20] RickHull: i get it, from a caller / user / convenience angle
[09:07:35] RickHull: the "symbol vs string" hash key problem
[09:07:49] RickHull: and also wanting to use methods instead of key access on hashes
[09:07:49] bnagy: it's like finding candy on the ground and eating it
[09:08:23] bronson: has joined #ruby
[09:08:28] RickHull: just blame it on "loljs" and move on :)
[09:08:47] ralku: has joined #ruby
[09:10:08] lkba: has joined #ruby
[09:10:29] RickHull: beety dubs https://code.google.com/p/loljs/
[09:10:43] Antiarc: well that's horrifying
[09:10:43] edwinvdgraaf: has joined #ruby
[09:10:58] RickHull: i know, google code, right?
[09:11:19] chinmay_dd: has joined #ruby
[09:11:34] edwinvdg_: has joined #ruby
[09:11:49] Scrofff: has joined #ruby
[09:13:27] _main_0: has joined #ruby
[09:13:35] tubuliferous_: has joined #ruby
[09:13:48] Oog: has joined #ruby
[09:13:48] Igorshp: has joined #ruby
[09:14:56] tomphp_: has joined #ruby
[09:14:58] quimrstorres: has joined #ruby
[09:16:03] arup_r: has joined #ruby
[09:16:34] konsolebox: On what platform could IO::pipe be not usable?
[09:17:35] konsolebox: Windows and Mac = ok?
[09:17:54] gizmore: has joined #ruby
[09:18:00] RickHull: pipes are pretty inherent to unix
[09:18:05] RickHull: i would expect mac does ok
[09:18:12] RickHull: windows maybe
[09:18:24] konsolebox: RickHull: DOS does pipes, but i'm not sure if it's the same
[09:19:10] RickHull: as far as hackers in this channel go, they probably use piping OS's and are not fully in tune with non-piping OS's
[09:19:22] _main_: has joined #ruby
[09:20:01] burgestrand: Ruby just calls pipe() in the end, so wherever that is available should be fine
[09:20:38] zenspider: mingw should be fine. pipe is a posix thing
[09:21:05] burgestrand: Finding platform support for many things is suprisingly hard???
[09:21:21] RickHull: konsolebox: do you have a specific concern?
[09:21:31] RickHull: or maybe something in the docs?
[09:22:52] zenspider: konsolebox: there's a gem win32-pipe
[09:23:11] zenspider: by imperator, of course
[09:23:15] kraljev11: has joined #ruby
[09:23:39] bodgix_wrk: has joined #ruby
[09:23:51] konsolebox: RickHull: seeing "Not available on all platforms." in http://ruby-doc.org/core-2.2.2/IO.html#method-c-pipe just made me ask this.
[09:23:54] redcue: has joined #ruby
[09:24:19] RickHull: konsolebox: yeah, ruby has its heart in unix
[09:24:38] konsolebox: RickHull: it probably works well with UN*X, but it just made me wonder about Windows.. it's one of my target platforms after all.
[09:24:44] RickHull: you'll generally do well to assume any non-unix impls approximate the unix impls
[09:25:01] konsolebox: RickHull: i don't care about post-NT windows systems actually. starting Win2k (not really), XP would be fine
[09:25:05] RickHull: and yeah, where you have to support those platforms
[09:25:14] RickHull: it's loads of "fun"
[09:25:40] RickHull: ruby does a good job, generally, imho, in being multi-platform
[09:25:44] lee-jon: has left #ruby: ()
[09:25:49] surs4: has joined #ruby
[09:26:09] RickHull: that said, every time i've dealt with ruby headaches on windows, the answer has always been "linux"
[09:26:21] redcue: depends on how you define 'a good job' ^^
[09:26:41] RickHull: redcue: relative to?
[09:26:48] konsolebox: *pre-NT windows
[09:27:04] konsolebox: RickHull: anyway i guess i just have to test. if mingw emulates it well, then it's fine.
[09:27:20] tuor: hi, I have a string object with a xml in it (as a string). I want to write it in a file and make it readable (now it's all one string I want to have a nice readable xml file).
[09:27:22] RickHull: konsolebox: i wish i had better advice
[09:27:26] redcue: Don't get me wrong I think ruby actually does a good job in being multi-platform
[09:27:38] tuor: how can I do it?
[09:27:44] RickHull: konsolebox: but yes, it generally comes down to testing and workarounds for majorly different platforms
[09:28:01] RickHull: tuor: easy peasy
[09:28:12] dionysus69: has joined #ruby
[09:29:11] aswen: has joined #ruby
[09:29:17] RickHull: tuor: http://ruby-doc.org/core-2.2.2/IO.html#method-i-write
[09:29:32] tuor: RickHull, thx
[09:29:46] RickHull: tuor: also - http://ruby-doc.org/core-2.2.2/File.html
[09:30:00] RickHull: File is the api you would use, but it inherits from IO
[09:30:07] zenspider: RickHull: except, of course, the second you mention fork. that's why ruby wound up adding #spawn
[09:30:46] RickHull: zenspider: yep, good point, resonates here at $new_job
[09:31:05] ndrei: has joined #ruby
[09:31:28] bruno-: has joined #ruby
[09:32:20] tbuehlmann: tuor, an easy way is File.write('/path/to/file', 'your xml string')
[09:32:34] RickHull: i am terrible at giving advice to ruby programmers on windows
[09:32:44] eGGsha: has joined #ruby
[09:32:51] konsolebox: RickHull: it sounds like tuor also wants to prettify the xml.
[09:33:07] dANO-: has joined #ruby
[09:33:11] RickHull: readable schmeadable
[09:33:21] tuor: konsolebox, yes.
[09:33:47] tuor: first just write, and when i can do it, "do it readable"
[09:33:56] RickHull: it's a good exercise
[09:34:00] RickHull: separate the operations
[09:34:12] RickHull: one the one hand, inject whitespace to make it readable
[09:34:19] RickHull: on the other hand, write it to the filesystem
[09:34:33] RickHull: note that whitespace on windows implies CRLF
[09:34:43] RickHull: whereas on unix it's just LF
[09:34:49] RickHull: good luck, heading to bed, cheers
[09:35:29] RickHull: sorry, not whitespace so much as newlines
[09:35:41] RickHull: outside of newlines, windows and unix generally agree on whitespace
[09:35:49] RickHull: heading to bed ferrealz now
[09:35:56] xkef_: has joined #ruby
[09:37:34] haroldwu: has joined #ruby
[09:38:24] konsolebox: tuor: https://google.com/search?q=ruby+xml+prettify
[09:40:47] Lildirt: has joined #ruby
[09:42:15] lolmaus_: has joined #ruby
[09:42:30] tuor: RickHull, good night & thx.
[09:42:34] tuor: konsolebox, thx. :)
[09:42:42] RickHull: tuor: cheers, nn
[09:43:15] tuor: (here it's 11:41 ^^ UTC+2)
[09:43:26] adaedra: Hello CEST
[09:43:38] ruboto: tuor, it's morning, see http://www.total-knowledge.com/~ilya/mips/ugt.html
[09:43:39] RickHull: in IRC time it's always morning or evening
[09:44:07] adaedra: jhass, apeiros: is there a version of ?ugt for farewells?
[09:44:28] jhass: not yet, but we indeed should make one
[09:44:30] RickHull: ?uft adaedra
[09:44:31] ruboto: adaedra, I don't know anything about uft
[09:44:41] RickHull: ruboto: get smarter
[09:44:53] adaedra: ?smarter RickHull
[09:44:53] ruboto: RickHull, I don't know anything about smarter
[09:45:03] arup_r: has joined #ruby
[09:45:03] jhass: ?botsnack
[09:45:03] ruboto: nomnomnomnom
[09:45:09] RickHull: ruboto: RickHull is smarter
[09:45:15] Oog: has joined #ruby
[09:45:19] RickHull: ruboto: botsnack
[09:45:25] RickHull: ruboto: usuck
[09:45:26] ruboto: nomnomnomnom
[09:45:28] platzhirsch: has joined #ruby
[09:45:49] platzhirsch: has left #ruby: ()
[09:46:03] RickHull: ruboto: dwim
[09:46:18] RickHull: ruboto: don't stop not contradicting yourself
[09:46:21] tuor: adaedra, got it thx ;)
[09:46:26] Oog_: has joined #ruby
[09:46:57] livathinos: has joined #ruby
[09:48:20] revath: has joined #ruby
[09:49:45] xlogic: has joined #ruby
[09:49:55] Lildirt: has joined #ruby
[09:50:40] shibly: has joined #ruby
[09:50:45] shibly: has left #ruby: ()
[09:50:48] shibly: has joined #ruby
[09:50:53] shibly: has left #ruby: ()
[09:50:58] shibly: has joined #ruby
[09:51:04] shibly: has left #ruby: ()
[09:52:32] tkuchiki: has joined #ruby
[09:52:36] Lildirt: has joined #ruby
[09:53:02] edwinvdgraaf: has joined #ruby
[09:53:08] surs: has joined #ruby
[09:54:58] jk_scowling: has joined #ruby
[09:55:18] jespada: has joined #ruby
[10:01:56] tkuchiki: has joined #ruby
[10:03:05] eGGsha: has joined #ruby
[10:04:26] RickHull: has left #ruby: ()
[10:04:28] surs1: has joined #ruby
[10:05:30] hotpancakes: has joined #ruby
[10:08:46] matp: has joined #ruby
[10:11:01] Axy: has joined #ruby
[10:11:01] Axy: has joined #ruby
[10:11:05] blackmes1: has joined #ruby
[10:13:15] mesamoo: has joined #ruby
[10:14:07] devbug: has joined #ruby
[10:16:19] lee-jon: has joined #ruby
[10:16:33] spleeze: has joined #ruby
[10:16:56] enders: has joined #ruby
[10:18:06] Oog: has joined #ruby
[10:19:45] ndrei: has joined #ruby
[10:20:40] devbug_: has joined #ruby
[10:20:59] krz: has joined #ruby
[10:21:25] edwinvdgraaf: has joined #ruby
[10:22:53] senayar: has joined #ruby
[10:22:53] senayar: has joined #ruby
[10:24:29] white_bear: has joined #ruby
[10:25:14] chipotle: has joined #ruby
[10:25:40] white_bear_: has joined #ruby
[10:28:18] blackmes1: has joined #ruby
[10:28:30] kraljev11: has joined #ruby
[10:28:32] iateadonut1: has joined #ruby
[10:30:57] tmtwd: has joined #ruby
[10:31:37] bruno-: has joined #ruby
[10:32:23] zacstewart: has joined #ruby
[10:32:32] stamina: has joined #ruby
[10:32:52] lkba_: has joined #ruby
[10:33:56] livathinos: has joined #ruby
[10:34:39] hotpancakes: has joined #ruby
[10:34:51] chinmay_dd: has joined #ruby
[10:37:42] grey_beard: has left #ruby: ()
[10:38:26] devbug: has joined #ruby
[10:39:29] sevenseacat: has joined #ruby
[10:42:06] camilasan: has joined #ruby
[10:45:30] raddy: has joined #ruby
[10:45:36] davedev24_: has joined #ruby
[10:45:44] raddy: Hello Everybody
[10:46:18] Muhannad: has joined #ruby
[10:46:35] raddy: Mod_Passenger always load a ruby app in development environment and not in production
[10:47:15] adaedra: you have an env variable to set, RACK_ENV or RAILS_ENV in you passenger config I think
[10:47:21] howdoicomputer: has joined #ruby
[10:47:26] quimrstorres: has joined #ruby
[10:48:11] adaedra: Or maybe passenger has this option directly, don't know it well enough
[10:48:52] kraljev11: i get error: Error:(6, 61) overriding lazy value y in class Nominal of type Seq[Int];
[10:48:55] kraljev11: value y must be declared lazy to override a concrete lazy value
[10:48:57] kraljev11: class NominalBasic(name: Symbol, x: Unlabeled, override val y: Seq[Int], names: Vector[String], loss: Loss[Nominal])
[10:49:16] kraljev11: but when i declare it lazy I get that lazy cannot be declared there
[10:49:29] abuzze_: has joined #ruby
[10:49:37] phutchins2: has joined #ruby
[10:49:44] Toska: has joined #ruby
[10:51:13] adaedra: is that Ruby?
[10:51:28] kraljev11: oh, sorry, wrong subreddit
[10:51:36] adaedra: is that Reddit?
[10:54:46] raddy: has joined #ruby
[10:56:00] abuzze: has joined #ruby
[11:00:08] skade: has joined #ruby
[11:00:16] chouhoulis: has joined #ruby
[11:01:46] tubuliferous_: has joined #ruby
[11:03:59] fabrice31: has joined #ruby
[11:04:29] burgestrand: raddy: for apache, nginx or standalone?
[11:04:30] senayar: has joined #ruby
[11:04:38] fabrice31: has joined #ruby
[11:04:51] surs2: has joined #ruby
[11:05:11] raddy: Burgestrand : apache.
[11:05:40] burgestrand: raddy: https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#PassengerAppEnv
[11:06:24] burgestrand: raddy: I would suggest you ask in #passenger if that doesn't help.
[11:08:28] bronson: has joined #ruby
[11:10:43] Scroff: has joined #ruby
[11:11:18] unshadow: has joined #ruby
[11:11:48] adaedra: I'd prefer a Burgerstand.
[11:12:03] neanias: Burger friday
[11:12:31] edwinvdgraaf: has joined #ruby
[11:12:36] [k-: has joined #ruby
[11:13:20] adaedra: [k-, here we meet again.
[11:13:50] [k-: ACTION bored extravagantly
[11:13:54] [k-: good day to you
[11:14:25] Musashi007: has joined #ruby
[11:14:57] raddy: I have set RACKENV Production, RAILSENV Production already, But it didn't help
[11:16:28] edwinvdg_: has joined #ruby
[11:17:12] dgutierrez1287: has joined #ruby
[11:18:56] [k-: oh shit
[11:19:04] [k-: I meant bowed
[11:19:15] [k-: stupid autocorrect
[11:19:19] jhass: raddy: it's RACK_ENV=production and RAILS_ENV=production
[11:20:50] bakednotfried: has joined #ruby
[11:21:00] raddy: jhass : Invalid command 'RACK_ENV=production
[11:21:26] dgutierrez1287: has joined #ruby
[11:21:45] lessless: has joined #ruby
[11:21:46] burgestrand: raddy: how have you set it?
[11:21:54] jhass: well, the PassengerAppEnv directive takes production only
[11:22:03] jhass: and sets the correct variables
[11:22:05] burgestrand: raddy: by default, passenger will already have set those variables to production.
[11:22:36] raddy: Then what for my app always starts in development ?
[11:22:53] burgestrand: raddy: maybe your app doesn't read environment?
[11:23:22] jhass: or maybe you configured that somewhere without realizing
[11:25:52] shevy: the infamous ghost variables
[11:26:29] okdas: has joined #ruby
[11:26:29] okdas: has joined #ruby
[11:26:50] kjkn: has joined #ruby
[11:26:54] dEPy: has joined #ruby
[11:27:29] [k-: set_trace_func!
[11:28:40] edwinvdgraaf: has joined #ruby
[11:29:05] Scroff: has joined #ruby
[11:29:40] shevy: set_snoop_[k-!
[11:30:09] sdothum: has joined #ruby
[11:30:17] [k-: 0000 c_func return
[11:30:46] shevy: [k- do you program in C?
[11:32:29] chipotle: has joined #ruby
[11:34:54] edwinvdgraaf: has joined #ruby
[11:36:38] MagePsycho: how to seek confirmation in ruby? like are you sure you want to continue
[11:37:08] [k-: you ask the person
[11:37:22] [k-: you normally use a blocking method
[11:37:26] diegoviola: has joined #ruby
[11:37:37] [k-: gets, etc
[11:37:38] apeiros: ?context MagePsycho
[11:37:38] ruboto: MagePsycho, Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
[11:38:00] apeiros: hm, maybe that factoid goes slightly in the wrong direction for this case :)
[11:38:16] apeiros: well: "Please add more context to your question". this.
[11:38:43] ndrei: has joined #ruby
[11:38:48] urbanmonk: has joined #ruby
[11:39:10] MagePsycho: actually before running the script i want to show the variable values and say are you sure you want to continue to run the script with these variables? just to make sure they are passing correct arguments
[11:39:27] shevy: MagePsycho user_input = gets.chomp
[11:39:27] adaedra: Console script?
[11:39:32] shevy: case user_input
[11:39:35] shevy: when 'yes','y'
[11:39:36] hotpancakes: has joined #ruby
[11:39:40] shevy: @continue = true
[11:39:45] adaedra: ?gist shevy
[11:39:45] ruboto: shevy, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[11:40:03] shevy: ?spam adaedra
[11:40:03] ruboto: adaedra, I don't know anything about spam
[11:40:05] urbanmonk: has joined #ruby
[11:40:13] MagePsycho: yeah console script
[11:40:16] [k-: ?roode adaedra
[11:40:16] ruboto: adaedra, I don't know anything about roode
[11:40:16] adaedra: look who's talking
[11:40:20] Hanmac1: shevy ????????? of all rwx users likes it ;P
[11:40:39] shevy: hanmac1 I am rewriting all my old ruby-gnome scripts again!
[11:40:40] apeiros: MagePsycho: take a look at highline gem
[11:40:46] apeiros: makes user interaction easier
[11:40:52] shevy: finished about 20% so far, doing like one .rb per day
[11:40:57] howdoicomputer: has joined #ruby
[11:40:58] MagePsycho: it???s just a simple interaction
[11:40:59] olistik: has joined #ruby
[11:41:04] Hanmac1: shevy better help me and then you can rewrite them into rwx ones ;P
[11:41:42] adaedra: MagePsycho: if you don't want to add dependencies, just read a line (gets) and compare it. But yes, highline is good.
[11:41:57] shevy: hanmac1 one thing at a time... first I have to seriously learn C... it feels so boring compared to ruby though
[11:42:10] skade: has joined #ruby
[11:42:36] MagePsycho: is there a way to pass argument in ruby console script like shell script: runDbRepairTool ???url=url-goes-here ???db=<db-name> ???user=<username> ???pass=<password>
[11:42:47] edwinvdgraaf: has joined #ruby
[11:42:51] ldnunes: has joined #ruby
[11:42:53] shevy: MagePsycho all commandline arguments passed to a .rb file are available in ARGV
[11:42:54] adaedra: I think it's getopt
[11:43:02] MagePsycho: for now i am passing like: runDbRepairTool arg1 arg2 arg3 arg4 ..
[11:43:19] shevy: all of these args will be in ARGV
[11:43:33] adaedra: MagePsycho: for easy parsing of that: http://www.rubydoc.info/stdlib/optparse/OptionParser
[11:43:35] shevy: MagePsycho http://jnoconor.github.io/blog/2013/10/13/a-short-explanation-of-argv/
[11:45:21] MagePsycho: shevy: nice explaination
[11:45:30] MagePsycho: adaedra: can be a good option
[11:45:47] shevy: you should test it as soon as possible, the moment you write the code yourself will be the moment you understand it :)
[11:46:55] adaedra: MagePsycho: should make it much more easier than just going through ARGV, it's here for that ;)
[11:47:00] AyeDubyew: has joined #ruby
[11:47:16] shevy: ARGV is very simple
[11:48:11] shevy: look how complicated optionparser can become!
[11:48:15] shevy: option_parser.on("-v", "--[no-]verbose", "Run verbosely") { |v|
[11:48:22] tmtwd: has joined #ruby
[11:48:24] adaedra: shevy: when you just pass ordered, non labelled elements, yes. Going through named options, with potentially optionnal or short options quickly becomes a mess.
[11:48:30] diegoviola: I write my ruby code with vim
[11:48:33] diegoviola: what about you
[11:48:51] adaedra: I use butterflies.
[11:48:51] eGGsha: has joined #ruby
[11:48:58] shevy: adaedra yeah, the moment one wants to support all of -, --, and also =, handling ARGV 1:1 is too much work for the gain
[11:49:27] shevy: ruby foobar.rb -v --help -fruit=bananas
[11:49:49] shevy: if it would be a french script, one would use baguette instead :)
[11:50:24] adaedra: also, optparse is stdlib, so everything is good in it.
[11:50:43] adaedra: give me a break with that.
[11:51:22] shevy: eh, stdlib isn't always perfect
[11:51:41] adaedra: I meant it in the way "No need for external deps"
[11:51:46] shevy: there is also GetoptLong in stdlib :)
[11:52:03] shevy: strangely enough, I never actually used it
[11:52:22] TheHodge: has joined #ruby
[11:52:52] n008f4g_: has joined #ruby
[11:53:02] Hanmac1: has left #ruby: ()
[11:54:06] adaedra: You never used stdlib? :o
[11:54:47] shevy: I mean GetoptLong, I don't know when to preferrentially use it over optparse
[11:54:59] shevy: *preferentially
[11:56:06] fabrice31_: has joined #ruby
[11:56:18] surs3: has joined #ruby
[11:56:23] fantazo: has joined #ruby
[11:56:27] matti: has joined #ruby
[11:56:27] matti: has joined #ruby
[11:56:33] El3ktra: has joined #ruby
[11:57:06] [k-: You never used stdlib? :o
[11:58:42] shevy: a parrot!
[12:00:06] [k-: a non-answerer!
[12:00:13] nfk: has joined #ruby
[12:00:45] MagePsycho: how to parse xml, i am planning to get the db details from .xml file
[12:00:56] shevy: parsing xml is painful
[12:01:14] [k-: just get a library
[12:01:18] shevy: least painful way may be to install nokogiri: http://www.nokogiri.org/
[12:01:36] [k-: the most painful way would be xslt
[12:01:56] [k-: wait a moment
[12:02:07] [k-: yorickpeterse has a library for that!
[12:02:34] shevy: yorickpeterse likes pain
[12:02:51] adaedra: MagePsycho: all your options http://awesome-ruby.com/#awesome-ruby-html-xml-parsing
[12:03:03] jbw_: has joined #ruby
[12:03:25] adaedra: yorickpeterse would tell you to use oga, of course
[12:03:35] yorickpeterse: I don't do xslt
[12:03:42] MagePsycho: shevy: mechanize comes with nokogir ight?
[12:03:58] shevy: it has a dependency on it
[12:04:26] shevy: btw MagePsycho you can check on the dependencies via browser too: https://rubygems.org/gems/mechanize
[12:04:30] shevy: then you can click on nokogiri
[12:04:47] shevy: Total downloads: 43,136,874
[12:04:49] [k-: or gem list
[12:04:51] shevy: many people like pain
[12:04:56] diegoviola: why do you guys torture yourself with xml?
[12:05:13] [k-: json or dea
[12:05:13] yorickpeterse: I quite like HTML
[12:05:13] shevy: why do you use windows diegoviola :)))
[12:05:16] yorickpeterse: it's quite elegant
[12:05:18] adaedra: Let's all do JSONx
[12:05:32] adaedra: look it up
[12:05:33] diegoviola: shevy: lol... blame my boss
[12:05:43] apeiros: ACTION prefers jsonb
[12:05:55] shevy: oh good... there is also jsonc!
[12:06:02] adaedra: JSON is sometimes not enough
[12:06:02] apeiros: aaahaha, jsonx is *precisely* what I assumed it to be
[12:06:07] shevy: we get the whole alphabet covered
[12:06:08] [k-: oh fuck you
[12:06:15] diegoviola: shevy: but I have vbox in fullscreen, so I don't really "use" windows
[12:06:25] shevy: "JSONx is an IBM standard format to represent JSON as XML."
[12:06:32] adaedra: diegoviola: still windows.
[12:06:37] shevy: diegoviola I know you like to say that :)
[12:06:40] yorickpeterse: not surprising
[12:06:45] diegoviola: adaedra: I have Arch in fullscreen
[12:06:56] yorickpeterse: They're crazy enough to even run Node.js on their mainframes
[12:07:02] yorickpeterse: because that's totally going to use all those cores efficiently
[12:07:10] shevy: diegoviola it's like a vegetarian buying dead animals for the cat at home :)
[12:07:32] diegoviola: I know, I'll get a SATA to USB cable soon and I won't have to boot into windows anymore
[12:07:33] yorickpeterse: For the cat it's natural so it's totally ok
[12:07:41] adaedra: diegoviola: still windows under
[12:07:44] shevy: well my cat can't go shopping yet...
[12:07:50] diegoviola: adaedra: what?
[12:08:08] diegoviola: adaedra: with a sata-over-usb cable I won't have to boot into windows anymore
[12:08:27] diegoviola: adaedra: I will just plug to my SSD and boot arch
[12:08:37] shevy: see adaedra? he is not using windows!!!
[12:08:52] MagePsycho: how to print array in ruby
[12:08:57] adaedra: you're filling my screen with highlights?
[12:09:01] shevy: MagePsycho simplest way is: p array
[12:09:05] adaedra: MagePsycho: for debugging, p or pp
[12:09:13] diegoviola: shevy: I stopped using windows 15 years ago
[12:09:19] shevy: if you wish to output or modify, you can use .each and output then
[12:09:26] shevy: or rather .map for modify then
[12:09:40] MagePsycho: diegoviola: shevy: which OS you guys use
[12:09:59] diegoviola: shevy: write a shevyx in ruby
[12:10:09] shevy: windows gets too much into the way
[12:10:16] shevy: but in principle, ruby files should work just fine
[12:10:20] rushed: has joined #ruby
[12:10:28] diegoviola: MagePsycho: Linux
[12:10:30] diegoviola: MagePsycho: Arch
[12:10:38] ruboto: we're not all guys - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[12:11:00] shevy: diegoviola I once wanted, but it's so much work. I think these kind of things can not really be done by a single person... unless he is crazy, like that TempleOS dude
[12:11:09] [k-: yorickpeterse isn't a male :o
[12:11:18] howdoicomputer: has joined #ruby
[12:11:29] diegoviola: shevy: yeah I was kidding
[12:11:30] adaedra: shevy: there's a lot of custom oses other there
[12:11:53] rbowlby: has joined #ruby
[12:12:01] yorickpeterse: I identify as an airplane
[12:12:03] [k-: redstar os best os
[12:12:07] surs: has joined #ruby
[12:12:15] [k-: lies, flughafen is the airport here!
[12:12:22] adaedra: redhat != redstar os
[12:12:24] shevy: flughafen is still downed
[12:12:25] surs: has joined #ruby
[12:12:27] adaedra: shevy: osdev.org
[12:12:45] [k-: adaedra redstar os BEST OS
[12:13:04] shevy: adaedra there is no redstar on that page! :(
[12:13:23] flughafen: shevy: [k- the flughafen lives!!!!
[12:13:26] adaedra: shevy: no, that's for building your own system
[12:13:40] MagePsycho: which ruby editor you prefer everyone
[12:13:58] adaedra: shevy: https://en.wikipedia.org/wiki/Red_Star_OS
[12:14:02] diegoviola: MagePsycho: vim
[12:14:27] MagePsycho: why not pycharm?
[12:14:41] flughafen: MagePsycho: vim
[12:14:47] MagePsycho: i love products from jetbrains
[12:14:47] shevy: I am not that experimental anymore... I kind of got lazy with linux
[12:14:52] MagePsycho: intellij phpstorm pycharm
[12:14:59] flughafen: i use eclipse for java
[12:15:01] shevy: "Red Star OS is a North Korean Linux-based operating system."
[12:15:08] flughafen: buyt maybe i should give eclim a try
[12:15:11] adaedra: MagePsycho: because some people prefer a lightweight editor to a full featured IDE
[12:15:12] shevy: [k- you are poking fun at the north korean hacker community here!
[12:15:28] adaedra: shevy: so, 0 people?
[12:15:34] tvw: has joined #ruby
[12:15:41] [k-: it's totes best os!
[12:16:09] [k-: do you even see a Linux os that looks half add gold
[12:16:15] senayar: has joined #ruby
[12:16:16] shevy: dunno, I guess in the capital city they may have some techies too
[12:16:58] shevy: [k- look at that man https://drbenjaminhabib.files.wordpress.com/2012/07/imgp5035.jpg how can Singapore compete here la!
[12:17:01] shevy: it's a PYRAMID
[12:17:12] hotpancakes: has joined #ruby
[12:17:19] [k-: WE HAVE A DURIAN
[12:17:28] shevy: we could ask ponga when he comes back, he was born in south korea
[12:17:43] zeeraw: has joined #ruby
[12:17:45] bkxd: has joined #ruby
[12:17:59] shevy: durian pancakes?
[12:18:14] pulgolino: has joined #ruby
[12:18:31] shevy: the world wide web is full of craziness
[12:18:43] Papierkorb: has joined #ruby
[12:19:04] [k-: how dare you insult our great metropolitan city!
[12:19:17] [k-: durian is love!
[12:19:21] [k-: durian is life!
[12:19:46] [k-: is that pyramid even earthquake proof
[12:20:43] shevy: [k- I think so, it's damn heavy
[12:20:45] yalue: has joined #ruby
[12:21:07] tkuchiki: has joined #ruby
[12:21:19] [k-: heavy != earthquake proof
[12:21:23] shevy: MagePsycho which editor do you use?
[12:22:20] shevy: haven't heard that one before
[12:22:25] blackmes1: has joined #ruby
[12:22:32] MagePsycho: sorry thats for python
[12:22:40] joonty: has joined #ruby
[12:22:41] adaedra: it's the rubymine of python, shevy
[12:23:06] MagePsycho: https://www.jetbrains.com/ruby/?fromMenu
[12:23:39] [k-: cough, Ruby ide...
[12:23:41] senayar: has joined #ruby
[12:24:00] [k-: avdi just wrote something about Ruby tooling!
[12:24:35] MagePsycho: which ide you use? i heard vim.. what else
[12:24:59] shevy: I don't use an IDE in ruby
[12:25:11] shevy: many people here use sublime editor
[12:25:15] shevy: I use bluefish 1.0.7!
[12:25:20] diegoviola: why would anyone use sublime
[12:25:23] [k-: sublime text*
[12:25:24] diegoviola: it's a paid app
[12:25:43] apeiros: because it's a good app, that's why
[12:25:58] diegoviola: apeiros: the thing is that it's not a good app
[12:26:04] joonty: has joined #ruby
[12:26:11] apeiros: diegoviola: the thing is - that's like your opinion.
[12:26:37] tens0r: has joined #ruby
[12:26:47] [k-: oooooo buuuuuurrrrnnnnnnnn
[12:26:55] shevy: he should stop to use windows!
[12:27:02] diegoviola: shevy: I use arch
[12:27:06] [k-: ACTION pours apeiros a cup of cold tea
[12:27:07] shevy: although, notepad++ is quite ok
[12:27:41] MagePsycho: how to exit with message if there is any error
[12:27:56] maloik: I didn't even read avdi's post as if it was about tooling, more about the fact that we still work with ruby "despite" what others might see as a reason not to
[12:28:23] burgestrand: MagePsycho: http://ruby-doc.org/core-2.2.2/Kernel.html#method-i-abort
[12:28:25] MagePsycho: nokogri seems great tool for parsing xml.. now i need to check if it doesn???t find xml to parse.. print error and exit
[12:28:27] [k-: but he wants a message
[12:28:28] maloik: sort of in the same way many people flock to "manual" ways of making coffee, or use record players despite the fact that they're annoying as you have to turn around the record
[12:28:41] MagePsycho: i only started ruby two days ago.. so veryvery new
[12:28:51] [k-: oh abort writes a message to stderr
[12:29:52] [k-: MagePsycho do you want to terminate on error or just raise an error
[12:30:06] tuor: hi, I have a String: import = "<xml>...</xml>" and I do it looking better: nice_imput = Document.new import
[12:30:11] shevy: maloik when you write despite though, what alternatives were given to ruby?
[12:30:32] jonathanwallace: has joined #ruby
[12:31:18] tuor: this works fine. But how can I do exactly the oposite? I need first to do it readable and then again back into one string (with out any unneeded withe space)
[12:31:27] diegoviola: "Sometimes "pi = 3.14" is (a) infinitely faster than the "correct" answer and (b) the difference between the "correct" and the "wrong" answer is meaningless. And this is why I get upset when somebody dismisses performance issues based on "correctness". The thing is, some specious value of "correctness" is often irrelevant because it doesn't matter. While performance almost always matters. And I absolutely
[12:31:29] diegoviola: detest the fact that people so often dismiss performance concerns so readily." -- Linus Torvalds
[12:31:39] diegoviola: he seems to care more about performance than code readability, what are your thoughts on that?
[12:31:54] olistik: has joined #ruby
[12:31:59] apeiros: ?ot diegoviola
[12:31:59] ruboto: diegoviola, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[12:32:21] shevy: linus does not use ruby :(
[12:32:34] diegoviola: apeiros: ok sorry
[12:33:53] diegoviola: shevy: you can't write the linux kernel in ruby, can you?
[12:34:17] shevy: there is even assembler code in the kernel
[12:35:41] uber: has joined #ruby
[12:35:59] krz: has joined #ruby
[12:36:14] T3: even?!?!
[12:36:21] T3: ofc there is assembler in the the kernel
[12:36:58] T3: and you dont want to write linux in ruby and ruby doesnt run natively on the hardware
[12:37:13] diegoviola: there is also my typo patch merged in the linux kernel
[12:37:26] hotpancakes: has joined #ruby
[12:37:35] [k-: Linux in Ruby...
[12:37:51] T3: talk about bad ideas lol
[12:38:02] T3: programming is all about the right tool for the job
[12:38:33] [k-: shevy uses Ruby for all the jobs
[12:39:22] randiman: has joined #ruby
[12:39:30] saintcajetan: has joined #ruby
[12:39:35] raddy: Hello Everybody
[12:40:05] raddy: I hope we can have multiple versions of ruby and passenger,
[12:40:10] raddy: Am i correct ?
[12:40:22] bougyman: we have tons of them
[12:40:24] bougyman: you are correct.
[12:40:43] yorickpeterse: bougyman: no longer running lighttpd?
[12:40:45] shevy: [k- the only valid complaint is that ruby is slow
[12:40:56] bougyman: yorickpeterse: i'm not?
[12:41:11] [k-: >> $$/$$
[12:41:12] ruboto: [k- # => 1 (https://eval.in/396272)
[12:41:15] yorickpeterse: bougyman: I recall back in the Ramaze days at least everything for the Rubyists was using lighttpd
[12:41:19] bougyman: yorickpeterse: I still use lighty for myself.
[12:41:25] bougyman: dayjob uses nginx
[12:41:28] shevy: I use lighty too!
[12:41:39] shevy: apache's config file change annoyed me so much that I switched
[12:43:43] shevy: http://patshaughnessy.net/2013/10/30/generational-gc-in-python-and-ruby
[12:43:50] shevy: "Unlike in Ruby, using Python you can define instance variables or object attributes on the fly like this. This seems like a bit of interesting magic missing from Ruby."
[12:45:09] arup_r1: has joined #ruby
[12:45:28] diegoviola: what terminal emulators do you guys use?
[12:45:56] shevy: bash in kde konsole
[12:46:02] shevy: roxterm is quite nice too
[12:46:22] bnagy: I am in <3 with iterm2
[12:46:56] diegoviola: I'm using termite right now
[12:46:59] aderium: has joined #ruby
[12:47:02] jhass: ?ot diegoviola
[12:47:03] ruboto: diegoviola, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[12:47:46] Limix: has joined #ruby
[12:48:01] diegoviola: move yourself to #ruby-offtopic to keep this channel free of spam, thanks
[12:48:35] shevy: they just want to have more ruby questions!
[12:48:45] diegoviola: sorry about that
[12:49:03] apeiros: wow, that sorry was quite well timed
[12:49:08] apeiros: I already had the !kick written diegoviola.
[12:49:24] sevenseacat: I woulda done it anyway
[12:49:28] [k-: much was anticipated
[12:49:38] shevy: this cat is a killer
[12:49:43] apeiros: sevenseacat: it's friday. I'm mellow.
[12:49:46] erowlin: has joined #ruby
[12:49:56] tubuliferous_: has joined #ruby
[12:50:00] shevy: mice, rabbits, birds and spammers all fall prey
[12:50:12] erowlin: Hi ! is someone good at RSpec here ? I have a very basic question I think since I ???m new at testing .
[12:50:19] apeiros: ?ask erowlin
[12:50:19] ruboto: erowlin, Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[12:50:33] erowlin: Ok Ruboto, will gist. Thx
[12:51:14] hashrocket: has joined #ruby
[12:51:19] diegoviola: apeiros: why is asking about a terminal emulator not tolerated? I bet I could say that in #python and they won't cry too much
[12:51:37] apeiros: diegoviola: if you want to have the discussion, have it in OT
[12:51:47] diegoviola: or do we have to ask about the stdlib only here?
[12:51:53] ljarvis: diegoviola: then go to python to discuss it
[12:51:59] shevy: erowlin ruboto is a bot by the way, just in case you are about to say thank you :)
[12:52:01] diegoviola: ljarvis: you go there
[12:52:07] ljarvis: those are the rules
[12:52:19] shevy: there is a rule to go to python?
[12:52:20] erowlin: Code here : https://gist.github.com/Erowlin/dc427693374aa75a3d27, Line 34, I???m looking to keep the ID of the DefinedPushMessage just created to check if I can find it on the next block, and if I can delete it properly in the other ????it???? block
[12:52:44] tuor: shevy, I have one. ;) Still don't know how to do it.
[12:52:45] eGGsha: has joined #ruby
[12:53:00] diegoviola: ok sorry about that
[12:53:13] sevenseacat: you keep saying that and you keep trolling anyway
[12:53:20] diegoviola: crying as in complaining about offtopic
[12:53:26] diegoviola: I'm not trolling
[12:53:39] apeiros: !kick diegoviola I said if you want to discuss those things, go to OT, I meant it.
[12:53:39] helpa: apeiros: No.
[12:53:40] ruboto: ruboto kicked diegoviola: said if you want to discuss those things, go to OT, I meant it.
[12:53:40] ruboto: -o ruboto
[12:53:48] ljarvis: You've apologised a couple of times but continued. If you want to stop..
[12:53:48] diegoviola: has joined #ruby
[12:54:10] diegoviola: 5 hours later someone else will come here and ask a bunch of offtopic questions and nobody will raise a word, you guys are hypocrites
[12:54:21] ruboto: we're not all guys - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[12:54:42] erowlin: Cmon, why don???t you go in PV, some people like me need some help ;)
[12:54:43] apeiros: !ban diegoviola !T 1d permanently OT
[12:54:44] ChanServ: +b diegoviola!*@*
[12:54:44] ChanServ: ChanServ kicked diegoviola: permanently OT
[12:54:48] ljarvis: "ya'll are hypocrites" was what I think you wanted
[12:55:01] ljarvis: erowlin: sorry, having a look
[12:55:13] erowlin: Thanks Ijarvis !
[12:55:20] ljarvis: it's an L, but no worries
[12:55:28] canton7: one day 'guys' will be defined as gender-neutral and everything will be ok...
[12:55:30] erowlin: I was wondering :)
[12:56:03] ljarvis: erowlin: basically, you can't/shouldn't do that.
[12:56:08] burgestrand: erowlin: you are probably looking for a "before" block.
[12:56:14] ljarvis: erowlin: you should either group them into a new before/context block
[12:56:17] erowlin: What should I do ljarvis ?
[12:56:33] burgestrand: erowlin: https://www.relishapp.com/rspec/rspec-core/v/3-3/docs/hooks/before-and-after-hooks
[12:56:34] erowlin: I???m looking at the before documentation
[12:56:40] erowlin: Thanks you Burgestrand !
[12:57:01] ljarvis: yeah that's a good start, I think you'll want to scope them with describe or context (whichever makes more sense for your usecase)
[12:57:16] erowlin: Is it a good thing to check if I can .find(id) just after the .save ?
[12:57:24] erowlin: I believe it???s useless no ?
[12:57:37] ljarvis: if you knew the save didn't fail, then probably
[12:57:50] ljarvis: right it's save! so yes
[12:57:57] erowlin: Except if I want to be sure that the find method is not overrided
[12:58:00] ljarvis: (it'll blow up if it failed to save)
[12:58:20] ljarvis: if the find method is overridden, you have the permission to find and kill whoever overrided it
[12:58:33] ljarvis: works for me
[12:58:36] erowlin: true story
[12:58:37] burgestrand: erowlin: how detailed you are in your tests is determined by what kind of level of confidence you want.
[12:59:00] burgestrand: erowlin: you can test every line, every method, most of the time that's not very useful though, so you test the things that are important and leave the rest.
[12:59:13] erowlin: I just started with testing trying to do some TDD, but it???s hard. I think I take the worst case, I don???t trust other developpers and everything should be tested
[12:59:32] ljarvis: fwiw I think you're tests are looking great for a start. Very succinct
[12:59:49] ljarvis: but yeah you don't need to overtest
[12:59:49] erowlin: It???s a hard question I ask myself, what should I test and not ?
[12:59:53] erowlin: Thank you ljarvis
[13:00:44] MichaelGG_: has joined #ruby
[13:00:47] raddy: Hello Everybody
[13:00:51] troulouliou_dev: has joined #ruby
[13:00:51] bmurt: has joined #ruby
[13:01:06] lkba: has joined #ruby
[13:01:18] tuor: I think my question is forgotten (because of some ot), so I repeate it: I have a string with xml in it. I can make it readable with REXML::Document.new "string", but how can i do exactly the oposit? (remove all unececery withespace and linebreaks)
[13:02:08] ljarvis: erowlin: I think your spec would be a good unit test. I don't think it really needs to hit the database. Testing retrieval is probably overkill. Testing validity is good and you're already doing it. Testing delete/find directly is testing something your orm will already cover
[13:02:20] a346: has joined #ruby
[13:02:21] ljarvis: ?code tuor
[13:02:21] ruboto: tuor, We can't help you without your code, please post it to https://gist.github.com
[13:02:35] MagePsycho: dbRepairUrl -> db_repair_url
[13:02:40] raddy: PassengerRuby /usr/bin/ruby , But still ruby intrepret shows as /usr/local/rvm/wrappers/ruby-1.9.3-p448/ruby
[13:02:55] raddy: Can anybody help me ?
[13:03:00] burgestrand: erowlin: personally I usually don't directly test code that isn't mine.
[13:03:37] erowlin: Ok I understand
[13:03:38] ljarvis: raddy: try #passenger
[13:03:38] raddy: which ruby shows /usr/bin/ruby as well
[13:03:50] erowlin: I will just remove find and all ORM related tests
[13:03:52] burgestrand: erowlin: I will indirectly exercise code that isn't mine, but I don't write explicit tests for them. For example I wouldn't have written the test for.delete.
[13:03:53] raddy: Nobody is responding there
[13:03:53] erowlin: you???re right
[13:04:30] ljarvis: raddy: for a start, changing PassengerRuby isn't going to set the Ruby in your terminal session
[13:04:36] erowlin: Thank you for your indications :).
[13:04:42] ljarvis: raddy: it'll set the interpreter path for the passenger process
[13:04:52] burgestrand: erowlin: like ljarvis said though, you're doing good.
[13:05:01] erowlin: Thank you !
[13:05:06] erowlin: Want to hire me ?
[13:05:08] burgestrand: erowlin: just keep in mind that every test you write has a cost in 1) time to run and 2) time to maintain.
[13:05:12] raddy: ljarvis : I know about the command.
[13:05:16] shevy: tuor if you wanna remove all linebreaks you could always do a .gsub(/\n/,' ') or something like that
[13:05:24] erowlin: We have to setup CI
[13:05:34] burgestrand: erowlin: hehe, I'm about to start looking for a new place to work myself so no. ;)
[13:05:46] burgestrand: (changing cities)
[13:05:57] erowlin: I have a good place in Paris if you???re looking for an awesome job
[13:06:02] tuor: shevy, ok. I'll paste the code. One moment please. ;)
[13:06:02] [k-: dat disclosure
[13:06:10] burgestrand: erowlin: thanks, but not quite that far, I'm moving to Stockholm.
[13:06:32] erowlin: BTW, thank you all, have a nice day
[13:06:41] bmurt: has joined #ruby
[13:06:41] burgestrand: erowlin: you too.
[13:06:47] Rollabunna: has joined #ruby
[13:07:03] aryaching: has joined #ruby
[13:08:27] white_bear_: is it possible to reference variables indirectly, like ${!foo_*} in bash will match all foo_* variables?
[13:08:48] raddy: ljarvis : Can you please check this link ? https://groups.google.com/forum/#!topic/phusion-passenger/38EeHPgKpoo
[13:08:48] bougyman: white_bear_: not that way
[13:08:50] apeiros: white_bear_: no. and don't abuse variables as a hash.
[13:08:50] bougyman: but there is a awy
[13:09:08] joelataylor: has joined #ruby
[13:09:14] ljarvis: raddy: sorry I don't do passenger so probably won't be able to help much further
[13:09:38] apeiros: white_bear_: the things which exist are in Object, Module and Binding for the various variable types
[13:10:38] [k-: and Kernel#global_variables
[13:11:39] apeiros: [k-: there are no global variables.
[13:11:47] apeiros: ACTION pretends they don't exist
[13:12:02] [k-: buuuuut
[13:12:06] ruboto: You can find an overview of my commands at http://ruby-community.com/ruboto/commands
[13:12:09] ljarvis: ACTION throws a $_ at apeiros 
[13:12:12] tuor: https://gist.github.com/anonymous/02fbd1c79ac8476a4337
[13:12:38] apeiros: ACTION doesn't notice a thing
[13:12:42] [k-: there is trace for globals even!
[13:12:54] shevy: we can trace them!
[13:13:01] burgestrand: tuor: so you want to minify the XML?
[13:13:25] apeiros: ACTION sees nothing
[13:13:27] white_bear_: bougyman: looping through all data types (Object, Module and Binding, as mentioned above) and using reflection?
[13:13:31] lavros: has joined #ruby
[13:13:56] jespada: has joined #ruby
[13:15:11] chipotle: has joined #ruby
[13:15:16] bungoman: has joined #ruby
[13:15:59] rbennacer: has joined #ruby
[13:16:24] tuor: Burgestrand, yes.
[13:16:29] whippythellama: has joined #ruby
[13:16:35] maloik: "Can you just make sure that X can NEVER EVER happen? And then add a checkbox 'exception' on the form"
[13:16:38] maloik: (tableflip)
[13:17:36] zacstewart: has joined #ruby
[13:18:04] aryaching_: has joined #ruby
[13:18:11] rippa: has joined #ruby
[13:18:56] MagePsycho: how to get current working directory in ruby
[13:19:10] MagePsycho: mageDir = `$PWD`
[13:19:11] MagePsycho: puts "#{mageDir}/app/etc/local.xml"
[13:19:14] MagePsycho: doesn???t work
[13:19:40] MagePsycho: i am working on ruby console script
[13:19:59] decoponio: has joined #ruby
[13:20:01] apeiros: maloik: business as usual?
[13:20:19] apeiros: I could fill a book which such cases.
[13:20:42] maloik: so could I, that's exactly the problem
[13:20:46] mesamoo: has joined #ruby
[13:20:47] MagePsycho: whippythellama: thats works :) thanks
[13:20:52] maloik: no matter how much I push back that stuff keeps on coming and they never learn :(
[13:20:58] MagePsycho: white_bear_: thats works thanks man
[13:21:35] apeiros: should they learn?
[13:21:47] chouhoulis: has joined #ruby
[13:21:50] adaedra: learn what?
[13:21:51] apeiros: I've changed to just explaining the cost
[13:22:10] white_bear_: MagePsycho: np
[13:22:12] apeiros: and if they're ready to pay the price, then well, they can have their edge cases
[13:22:15] Toska: has joined #ruby
[13:22:23] Zinja: has joined #ruby
[13:23:01] MagePsycho: loving ruby really.. such a neat and clean compared to php
[13:23:01] apeiros: while it annoys the purist in me - the rest is now "so what? I'm paid to solve their problems"
[13:24:08] apeiros: MagePsycho: `pwd` certainly works. but don't forget that it comes with a newline. but as white_bear_ already said, Dir.pwd (or .getwd) is better.
[13:24:10] mjuszczak: has joined #ruby
[13:24:11] burgestrand: tuor: I don't think REXML supports XML canonicalization, but Nokogiri does.
[13:24:17] blackmes1: has joined #ruby
[13:24:23] burgestrand: s/supports/implements/
[13:24:33] adaedra: I don't want to work v_v
[13:25:13] MagePsycho: apeiros: yeah i noticed that
[13:25:47] failshell: has joined #ruby
[13:25:55] Limix: has joined #ruby
[13:25:56] prettiestPony11: has joined #ruby
[13:25:58] [k-: ACTION gives adaedra a hug
[13:26:02] [k-: there there
[13:26:25] adaedra: oga is life, oga is love
[13:26:44] [k-: so modest :p
[13:26:47] mando: has joined #ruby
[13:26:48] maloik: apeiros: I dunno, I'm just really annoyed because it makes understanding the entire system so much harder
[13:27:08] Rollabunna: has joined #ruby
[13:27:24] apeiros: maloik: I fully understand that. I feel the same. exceptions to rules are the death of understandability and maintainability
[13:27:31] arup_r: has joined #ruby
[13:27:53] apeiros: so that's what I make sure to explain them. and I'm somewhat sure that despite my best efforts, they don't fully understand the cost of their wishes. but so be it.
[13:27:54] rbennacer: has joined #ruby
[13:28:04] [k-: you mean python?
[13:28:15] arup_r1: has joined #ruby
[13:28:24] hakunin: has joined #ruby
[13:28:33] apeiros: adaedra: it's friday. week-end is coming.
[13:29:08] psye: has joined #ruby
[13:29:15] ljarvis: it's here!
[13:29:19] ljarvis: ACTION throws beer everywhere
[13:29:35] ljarvis: I have achieved quite little today
[13:29:57] sevenseacat: i've done the exercises from chapter 14 and most of 15 of programming elixir. progress.
[13:30:19] xkef: has joined #ruby
[13:30:22] shevy: this is an elixir-loving cat
[13:30:34] ljarvis: nice one sevenseacat
[13:30:45] ljarvis: I am also enjoying Elixir
[13:30:46] paulcsmith: has joined #ruby
[13:30:55] [k-: I have somewhat grasp monads
[13:31:14] [k-: do I get an award
[13:31:41] adaedra: apeiros: I know! If only it came quicker!
[13:31:57] apeiros: adaedra: it comes with 1s/s!
[13:32:10] hotpancakes: has joined #ruby
[13:32:14] adaedra: apeiros: but relativity!
[13:32:21] [k-: I only remember 1 monad law I think
[13:32:36] sevenseacat: i'm nowhere up to that level yet
[13:32:41] adaedra: it's known, saturday comes after friday way slowler than monday comes after sunday
[13:32:45] sevenseacat: ACTION has been trying to figure out how to rotate a list
[13:33:15] MagePsycho: p array works great.. i thought one is joking
[13:33:17] shevy: caturday!
[13:33:27] [k-: Array#rotate
[13:33:33] shevy: MagePsycho it's just a very short method name
[13:33:40] adaedra: RotationFactory
[13:33:49] bungoman: has joined #ruby
[13:33:51] segfalt: has joined #ruby
[13:33:54] shevy: MagePsycho here is the documentation: http://ruby-doc.org/core-2.2.2/Kernel.html#method-i-p
[13:34:13] shevy: apparently it invokes obj.inspect()
[13:34:52] raddy: has left #ruby: ()
[13:34:53] [k-: AbstractCollectionRotationFactory
[13:35:04] tuor: Burgestrand, ah ok. thx.
[13:35:05] zeeraw: has joined #ruby
[13:35:41] JoshL: has joined #ruby
[13:35:56] adaedra: MagePsycho: there is also pp, which tries to format a bit (require 'pp'; pp object)
[13:36:07] jpfuentes2: has joined #ruby
[13:36:12] [k-: we should omit parentheses!
[13:36:29] shevy: [k- you are in such a good mood today
[13:36:33] shevy: lack of homework right?
[13:36:55] [k-: :o you are amazingly accurate!
[13:37:07] [k-: I do have some homework but I'm lazy :p
[13:37:15] aderium: If someone can give me some pointers :) I have downloaded the ruby source 2.1.6 on Solaris 11.2
[13:37:47] Toska: Aderium: You won't need to worry about the pointers in ruby.
[13:37:56] mrconfused: has joined #ruby
[13:38:01] aderium: yesterday when looking at RVM scripts we have discovered that the way RVM looks for the arch hardware is rather inapproriate for Solaris and was always giving back i386
[13:38:06] Timba-as: has joined #ruby
[13:38:16] aderium: tthat is it was looking at uname instead of isaifno
[13:38:19] shevy: are you sure this is just related to RVM and not the ruby source directly?
[13:38:30] xlogic: has joined #ruby
[13:38:30] aderium: now I am discovering something wimilar with ruby during the configuration phase
[13:38:34] aderium: checking build system type... i386-pc-solaris2.11
[13:38:35] aderium: checking host system type... i386-pc-solaris2.11
[13:38:35] aderium: checking target system type... i386-pc-solaris2.11
[13:38:42] ruboto: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[13:38:53] shevy: who else is using solaris here!
[13:38:54] MagePsycho: one question.. if function is defined below the caller
[13:38:57] MagePsycho: what happens
[13:39:04] sevenseacat: try it and see.
[13:39:10] ta: has joined #ruby
[13:39:19] [k-: it doesn't work
[13:39:19] sevenseacat: pretty easy to test!
[13:39:23] shevy: MagePsycho best way is to define everything upfront before calling anthing
[13:39:41] [k-: Ruby is not compiled, it is interpreted
[13:39:44] aderium: https://gist.github.com/CirrusThink/af14defdc12cce9ddb34
[13:39:52] [k-: it just throws an error when it sees one
[13:40:13] aderium: the issue is in uname -m = i86pc
[13:40:35] aderium: it really should check for isainfo -k
[13:40:41] sarkyniin: has joined #ruby
[13:40:48] shevy: hmm can't you patch this ad-hoc?
[13:40:56] aderium: yeah where do I do so ?
[13:41:10] aderium: need to know what file to nano
[13:41:14] MagePsycho: can anyone help .. how to wrap this ina function: https://gist.github.com/MagePsycho/d3b13bea24e4d5c5ea1a
[13:41:19] shevy: not entirely sure, I hate those configure.ac* magic thingies :D
[13:41:49] MagePsycho: dpeth is unknow.. so whenever a continue button is found i need to submit the form: form.submit(form.button_with(:id => "button-continue"))
[13:41:59] charliesome: has joined #ruby
[13:42:01] MagePsycho: how to do this recursively or using some kinda loop
[13:42:08] shevy: Aderium is the wrong "uname" entry in the Makefile?
[13:42:36] aderium: the issue is that in Solaris 11.2 it is incorrect to use uname to detect the system and the loaded kernel bits
[13:42:48] aderium: isainfo -k should be used
[13:43:30] aderium: so I am looking in the where in the source I should ad hoc to use correct app
[13:43:41] shevy: yeah let's see
[13:43:49] shevy: I assume that perhaps it comes from: tool/config.guess:# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
[13:43:51] jespada: has joined #ruby
[13:44:12] aderium: btw how do you clean a previous configure ?
[13:44:16] shevy: configure.in:AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
[13:44:28] shevy: "make distclean" should work or "make clean", but perhaps you may have to re-run autoconf
[13:45:06] aderium: make: Fatal error: Don't know how to make target `distclean'
[13:45:09] shevy: like sh autogen.sh ... or autoreconf something
[13:45:20] shevy: tried make clean as well?
[13:45:26] aderium: same thing
[13:46:01] shevy: works for me, though I did not have any error during configure so perhaps it did not generate any important files since it broke early for you
[13:46:02] aderium: k cleaned :)
[13:46:13] hanyn: has joined #ruby
[13:46:26] aderium: alright so where do I nano ? tool/config.guess ?
[13:46:28] shevy: "autoconf" also could be tried, but first you have to find that weird entry where uname is used rather than isainfo
[13:46:33] shevy: not sure! still looking...
[13:46:34] xkef: has joined #ruby
[13:46:40] haneen: has joined #ruby
[13:46:41] rbennacer: has joined #ruby
[13:47:02] shevy: I can see several lines here:
[13:47:04] shevy: tool/config.guess:uname -m = `(uname -m) 2>/dev/null || echo unknown`
[13:47:08] shevy: and more uname - entries
[13:47:22] shevy: tool/config.guess:UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
[13:47:31] shevy: so I assume that one seems to be a likely candidate for your 4 uname lines that are all wrong
[13:47:56] shevy: perhaps that file is generic though :\
[13:48:13] aderium: let me check
[13:48:23] shevy: https://gist.github.com/shevegen/4cd5e0a530440d95994a
[13:48:35] serivich: has joined #ruby
[13:48:35] gard: has joined #ruby
[13:48:37] adaedra: usually, these kind of things allow to specify architecture manually, if it's your issue
[13:48:52] shevy: hopefully! then he could just replace those uname entries
[13:49:22] shevy: there is some case handling... like line 349 echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
[13:49:32] shevy: they definitely want to use UNAME :)
[13:50:02] aderium: ok so ad hoc 1 UNAME_MACHINE=`(isainfo -n) 2>/dev/null` || UNAME_MACHINE=unknown
[13:51:45] silkfox: has joined #ruby
[13:52:32] drewvanstone: has joined #ruby
[13:53:15] JakFrist: has joined #ruby
[13:53:44] olistik: has joined #ruby
[13:53:56] v0n: has joined #ruby
[13:54:21] eggoez: has joined #ruby
[13:54:49] devdazed: has joined #ruby
[13:55:15] livathinos: has joined #ruby
[13:55:32] mando: has joined #ruby
[13:55:45] MagePsycho: is this fair enough for the function implementation: https://gist.github.com/MagePsycho/d3b13bea24e4d5c5ea1a
[13:56:13] [k-: Logger pls
[13:56:15] brotspinne: has joined #ruby
[13:56:28] aderium: checking build system type... tool/config.guess: unable to guess system type
[13:56:40] [k-: ruby convention: snake_case
[13:57:14] adaedra: Fix your indent yo
[13:57:21] [k-: indentation pro----
[13:57:28] [k-: I was going to say that!
[13:57:28] aderium: https://gist.github.com/CirrusThink/c78ecfd188e094b5df38
[13:58:04] aderium: so the UNAME_MACHINE = amd64 is correct but somewhere else its still using uname
[13:58:10] adaedra: `:id => xxx` can be written `id: xxx`
[13:58:15] bahar: has joined #ruby
[13:58:31] haxrbyte_: has joined #ruby
[13:58:39] [k-: :id => is backwards compatible!
[13:58:44] enebo: has joined #ruby
[13:59:02] adaedra: `` is to be used when you want to get output back from process ??? if your goal is just to run it, there are better ways
[13:59:06] olistik: has joined #ruby
[13:59:14] adaedra: [k-: Backward compatibility with 1.8 can go meet me in hell
[13:59:20] MagePsycho: am i doing right here: https://gist.github.com/MagePsycho/d3b13bea24e4d5c5ea1a
[13:59:27] MagePsycho: just the implementation of function
[13:59:29] senayar: has joined #ruby
[13:59:29] senayar: has joined #ruby
[13:59:36] burgestrand: TIL NotImplementedError is not a StandardError.
[13:59:44] Igorshp: has joined #ruby
[13:59:50] [k-: it's a runtimeerror I guess
[14:00:01] [k-: also, your code is not DRY
[14:00:12] burgestrand: No, RuntimeError is a StandardError.
[14:00:14] [k-: especially the last few lines
[14:00:22] burgestrand: >> raise NotImplementedError rescue nil
[14:00:23] ruboto: Burgestrand # => NotImplementedError (NotImplementedError) ...check link for more (https://eval.in/396314)
[14:00:42] burgestrand: >> raise "runtime" rescue nil
[14:00:42] ruboto: Burgestrand # => nil (https://eval.in/396315)
[14:01:17] senayar: has joined #ruby
[14:01:23] bungoman: has joined #ruby
[14:02:11] evanjs: has joined #ruby
[14:02:54] poguez_: has joined #ruby
[14:03:08] skyrocker: has joined #ruby
[14:03:26] j_mcnally: has joined #ruby
[14:03:26] skyrocker: has left #ruby: ()
[14:03:41] MagePsycho: [k-: was that for me?
[14:03:52] haxrbyte: has joined #ruby
[14:04:09] MatrixBridge: has joined #ruby
[14:05:06] Sehryn: has joined #ruby
[14:05:25] IrishGringo: has joined #ruby
[14:05:32] erowlin: has joined #ruby
[14:05:41] senayar: has joined #ruby
[14:06:15] mesamoo: has joined #ruby
[14:06:29] MagePsycho: so rubby convention is to use snake case for both variable and function?
[14:06:31] hinbody: has joined #ruby
[14:06:41] momomomomo: has joined #ruby
[14:06:56] but3k4: has joined #ruby
[14:07:07] axl__: has joined #ruby
[14:07:08] adaedra: and CamelCase for classes/modules names
[14:07:18] adaedra: and UPPERCASE for constants
[14:07:20] jonathanwallace: has joined #ruby
[14:07:28] MagePsycho: good to know
[14:07:36] MagePsycho: [k: can you explain when you say: Logger pls
[14:07:57] quimrstorres: has joined #ruby
[14:08:34] juanpablo_: has joined #ruby
[14:09:04] [k-: A logger is a dedicated object that will handle outputting messages (information, debug, warnings, errors) to a file/descriptor
[14:09:42] MagePsycho: [k-: any example
[14:10:03] but3k4: has joined #ruby
[14:10:03] tkuchiki: has joined #ruby
[14:10:08] konsolebox: anyone using camel-case for functions, attributes and variables? (i don't of course)
[14:10:16] [k-: Logger.error "Unexpected value: -3"
[14:10:28] yorickpeterse: konsolebox: Ruby standard is snake_case for methods/variables/etc
[14:10:41] quimrstorres: has joined #ruby
[14:10:48] konsolebox: yorickpeterse: yes i just wonder if anyone does
[14:10:50] yorickpeterse: and PascalCase for constants
[14:11:08] werelivinginthef: has joined #ruby
[14:11:22] edwinvdgraaf: has joined #ruby
[14:12:14] zacstewart: has joined #ruby
[14:12:40] evanjs: has joined #ruby
[14:13:25] j_mcnally: has joined #ruby
[14:13:37] duggiefresh: has joined #ruby
[14:13:53] bruno-: has joined #ruby
[14:13:59] zeeraw: has joined #ruby
[14:14:37] MagePsycho: fp = File.new("#{mageDir}/var/dp-repair-tool-#{mageVersion}.html", "a+") -> why the new file is not being created
[14:14:46] koos303: has joined #ruby
[14:14:55] Scripore: has joined #ruby
[14:15:08] MagePsycho: puts "#{mageDir}/var/dp-repair-tool-#{mageVersion}.html" -> shows correct value
[14:15:33] [k-: does the file exist before the method call?
[14:15:45] c355E3B: has joined #ruby
[14:18:11] victortyau: has joined #ruby
[14:18:20] nathanstitt: has joined #ruby
[14:18:37] MagePsycho: should it supposed to create on the fly
[14:19:56] bungoman: has joined #ruby
[14:20:27] NeverDie: has joined #ruby
[14:20:59] charliesome: has joined #ruby
[14:21:15] bffff_: has joined #ruby
[14:22:08] MagePsycho: [k-: sorry that works but folder is not beiing created
[14:22:12] MagePsycho: only file is created
[14:22:25] MagePsycho: how to create folder as well if that doesn???t exist
[14:22:38] adaedra: FileUtils.mkdir
[14:22:52] surs1: has joined #ruby
[14:23:05] edwinvdgraaf: has joined #ruby
[14:23:06] [k-: adaedra to the rescue!
[14:24:08] edwinvdg_: has joined #ruby
[14:24:33] shevy: MagePsycho make sure to do require 'fileutils' on the top
[14:24:40] dopie: has joined #ruby
[14:25:00] ta: has joined #ruby
[14:25:02] blackmes1: has joined #ruby
[14:25:08] chthon: has joined #ruby
[14:25:35] MagePsycho: does order matter? before require mechanize or after?
[14:25:48] [k-: it shouldn't matter
[14:26:53] sshuff: has joined #ruby
[14:26:55] MagePsycho: didn???t work No such file or directory -
[14:27:00] [k-: (in this case)
[14:27:10] [k-: ?context
[14:27:10] ruboto: Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
[14:27:20] MagePsycho: fp = File.new("#{mageDir}/var/dp-repair-tool/#{mageVersion}-result.html", "a+")
[14:27:34] pullphinger: has joined #ruby
[14:27:45] chipotle: has joined #ruby
[14:28:09] MagePsycho: dp-repair-tool folder doesn???t exist.. i want to create that folder as well and also the file (in case of file only it works)
[14:28:35] russellw: has joined #ruby
[14:28:46] ruboto: We can't help you without your code, please post it to https://gist.github.com
[14:28:50] Soda: has joined #ruby
[14:29:00] revath: has joined #ruby
[14:29:04] brotspinne: MagePsycho: look at FileUtils.mkdir_p and FileUtils.touch
[14:29:14] shevy: MagePsycho put your requires on top of a file usually
[14:29:18] randiman: has joined #ruby
[14:29:25] leonardoajim: has joined #ruby
[14:29:42] shevy: create the directory before creating the file in it
[14:30:01] MagePsycho: i don???t want manual creation of file, i am looking for alternative of mkdir -p /any/path/
[14:30:03] shevy: you can check if a file exists via: if File.exist? file_here; and File.directory? whether a directory exists
[14:30:15] shevy: yeah that is .mkdir_p
[14:30:16] brotspinne: MagePsycho: there is no alternative
[14:31:04] yorickpeterse: hahahah, fucking ActionCable of course has a Base class
[14:31:04] blackmes1: has joined #ruby
[14:31:07] yorickpeterse: it's like they never learn
[14:31:38] aderium: can anyone tell me what s iconrrect here ? https://gist.github.com/CirrusThink/51bda73b7e3df66cffd3
[14:31:52] momomomomo: Aderium: !ask
[14:31:52] helpa: Aderium: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[14:31:53] kies^: has joined #ruby
[14:31:54] RegulationD: has joined #ruby
[14:31:58] momomomomo: Aderium: ?ask
[14:31:58] togdon: has joined #ruby
[14:32:03] momomomomo: where's this bot
[14:32:11] momomomomo: Aderium: How to ask good questions and get great answers: http://www.mikeash.com/getting_answers.html
[14:32:27] adaedra: momomomomo: command first, target after
[14:32:30] adaedra: ?bot momomomomo
[14:32:30] ruboto: momomomomo, I don't know anything about bot
[14:32:40] momomomomo: ?Aderium ask
[14:32:40] ruboto: ask, I don't know anything about Aderium
[14:32:45] momomomomo: ugh stupid bot
[14:32:49] ljarvis: ?ask Aderium
[14:32:49] ruboto: Aderium, Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[14:32:50] shevy: someone is botfailing here!
[14:32:51] brotspinne: Aderium: it says "configure: error: cannot guess build type; you must specify one" this is wrong
[14:32:58] aderium: I am not a bot, not sure what that means
[14:33:08] shevy: yeah momomomomo he is not a bot!
[14:33:09] momomomomo: still doesn't give the correct response
[14:33:10] ljarvis: momomomomo: ?command [user]
[14:33:13] momomomomo: Aderium: read the link I posted
[14:33:23] momomomomo: right, but it doesn't have one of the most frequently used commands
[14:33:25] aderium: just trying to detect where to make the correct changes so that ruby can correctly recognize in Solaris 11.2 that it is a amd64 system
[14:33:30] momomomomo: which is a silly oversight
[14:33:32] jhn: has joined #ruby
[14:33:41] ljarvis: i dont understand what you mean
[14:33:56] drewo: has joined #ruby
[14:33:59] aderium: unfortunately the source indicated the miss use of the uname command which is incorrect in Solaris
[14:34:02] MagePsycho: shevy: FileUtils.mkdir_p "#{dbRepairLogDir}"
[14:34:03] MagePsycho: fp = File.new("#{dbRepairLogDir}/#{mageVersion}-result.html", "a+")
[14:34:15] shevy: Aderium on the https://gist.github.com/shevegen/4cd5e0a530440d95994a
[14:34:23] shevy: case "${UNAME_SYSTEM}" in
[14:34:27] shevy: the shell script has that
[14:34:35] shevy: what is the value of UNAME_SYSTEM there?
[14:34:35] MagePsycho: shevy: that works :)
[14:34:37] MagePsycho: thanks a ton
[14:34:49] shevy: wrong case
[14:35:00] shevy: I hate shell scripts
[14:35:18] shevy: I assume it must be this value:
[14:35:54] shevy: so I guess that, whatever it is returning for these, that case is not handled by that gigantic shell case menu
[14:35:58] JMoir: has joined #ruby
[14:35:59] shevy: that spans around 1000 lines ...
[14:36:25] momomomomo_: has joined #ruby
[14:36:27] msnyon: has joined #ruby
[14:36:47] aderium: Yeah I went thorugh them but I cant seem to see where for a solaris != sparc it uses the uname command which I need to substitute with isainfo
[14:37:00] aderium: or maybe can I in the ./configure just state it ?
[14:37:08] aderium: like -- somthing
[14:37:08] shevy: you can try that
[14:37:17] aderium: whats the correct command ? i dont know
[14:37:29] shevy: nono, I think you can just edit "configure" perhaps
[14:37:45] yihsiaol: has joined #ruby
[14:37:53] shevy: # Name of the host.
[14:37:58] shevy: ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
[14:38:04] fantazo: has joined #ruby
[14:38:05] tubuliferous_: has joined #ruby
[14:38:13] aderium: in configure ?
[14:38:25] MagePsycho: shevy: why you hate shell scripts, this script is part of my shell script :)
[14:38:25] shevy: it's hardcoded there though
[14:38:26] shevy: uname -m = `(uname -m) 2>/dev/null || echo unknown`
[14:38:29] jimmythehat: has joined #ruby
[14:38:36] shevy: MagePsycho I find them an unreadable and unbearable mess
[14:38:41] neredsenvy: has joined #ruby
[14:38:43] MagePsycho: from shell script i will be calling ruby script for web form submisstion
[14:39:05] MagePsycho: shevy: if you follow some boilerplate then it will be interesting
[14:39:13] Igorshp: has joined #ruby
[14:39:31] senayar: has joined #ruby
[14:39:38] pfish: has joined #ruby
[14:39:44] shevy: Aderium I think the more sustainable way would be to modify the part wherever that uname creeps into configure, and run autoreconf; it should be either configure.ac or configure.in
[14:39:50] aderium: already modified line 1393 with uname -m = `(isainfo -n) 2>/dev/null || echo unknown` so its somewhere else
[14:39:53] chinmay_dd_: has joined #ruby
[14:39:53] MagePsycho: of course ruby does much more than shell thats why chef cookbooks are there
[14:40:15] shevy: here is my configure: https://goo.gl/rPw0yu
[14:40:24] shevy: Aderium yeah there are several uname entries
[14:40:40] neredsenvy: I run my ruby/json parser script it throws an error in console but since it outputs the contents of json file as well (not by my request) it only shows last two lines of the exception. So I don't know exactly what went wrong.
[14:40:44] neredsenvy: How can I fix this ?
[14:40:44] aderium: ok did that
[14:40:45] shevy: all those lines here:
[14:40:46] shevy: uname -m = `(uname -m) 2>/dev/null || echo unknown`
[14:40:46] shevy: uname -r = `(uname -r) 2>/dev/null || echo unknown`
[14:40:49] aderium: configure.in:698: warning: underquoted definition of RUBY_TRY_CFLAGS
[14:40:57] aderium: configure.in:698: run info '(automake)Extending aclocal'
[14:41:00] senayar: has joined #ruby
[14:41:04] shevy: well that is just a warning
[14:41:05] josh: has joined #ruby
[14:41:38] russellw: Does anyone know how to get hold of conftest.c while building Ruby on Windows? http://stackoverflow.com/questions/31321321/building-ruby-on-windows-and-conftest-c
[14:41:52] pfish: anyone know why editing gc.c would stop verconf.h from being created.
[14:41:53] A205B064: has joined #ruby
[14:42:01] aderium: https://gist.github.com/CirrusThink/2a222889c2c7df7839f9
[14:42:04] pfish: alternatly where and how is verconf.h created
[14:42:32] shevy: Aderium, I think the case entry does not handle these four cases:
[14:42:40] shevy: uname -m = amd64, uname -r = 5.11, uname -s = SunOS, uname -v = 11.2
[14:43:13] shevy: checking build system type... tool/config.guess: unable to guess system type
[14:43:29] shevy: cat >&2 <<EOF $0: unable to guess system type <--- that is the error you get I assume
[14:43:57] mary5030: has joined #ruby
[14:44:18] shevy: you have 4 values: case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
[14:44:24] shevy: can you find out the 4 values of these?
[14:44:41] zeeraw: has joined #ruby
[14:44:57] shevy: especially the second one
[14:45:01] aderium: those should be correct
[14:45:09] mary5030: has joined #ruby
[14:45:09] shevy: ok but what is the value of UNAME_SYSTEM exactly
[14:45:33] aderium: I think the issue is this one Machine = i86pc
[14:46:00] shevy: well there is one handle for that
[14:46:01] shevy: i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
[14:46:10] aderium: what line number is that ?
[14:46:28] shevy: https://gist.github.com/shevegen/4cd5e0a530440d95994a#file-config-guess-L360
[14:46:50] shevy: so it ignores the last entry, but checks on the other 3
[14:46:53] jtdoncas: has joined #ruby
[14:46:56] aderium: ah so you are statically putting in i386 ?
[14:47:04] shevy: that's not my code :)
[14:47:10] shevy: but that is how bash should handle case menus
[14:47:17] aderium: well yeah you as in uby sorry
[14:47:18] shevy: ruby has case/when too
[14:47:39] shevy: I have no idea what is returned on your system sorry, I have never used solaris
[14:47:52] mrconfused: has joined #ruby
[14:47:57] havenwood: has joined #ruby
[14:48:05] shevy: do you have your link to the ruby bug tracker?
[14:48:07] chris2: shevy: replace old config.guess simply with new ones
[14:48:16] aderium: SunOS us02.dollydrive.com 5.11 11.2 i86pc i386 i86pc Solaris
[14:48:33] aderium: isainfo -v
[14:48:35] aderium: 64-bit amd64 applications
[14:48:36] aderium: avx xsave pclmulqdq aes sse4.2 sse4.1 ssse3 popcnt tscp ahf cx16 sse3
[14:48:37] aderium: sse2 sse fxsr mmx cmov amd_sysc cx8 tsc fpu
[14:48:37] aderium: 32-bit i386 applications
[14:48:39] aderium: avx xsave pclmulqdq aes sse4.2 sse4.1 ssse3 popcnt tscp ahf cx16 sse3
[14:48:39] aderium: sse2 sse fxsr mmx cmov sep cx8 tsc fpu
[14:48:49] MagePsycho: this is my final script: https://gist.github.com/MagePsycho/2d1aec63ece20c654d93
[14:48:55] shevy: uname -a seems to work doesn't it?
[14:48:55] MagePsycho: i am going to write a article
[14:48:59] aderium: isainfo -n
[14:49:02] mando: has joined #ruby
[14:49:05] skade: has joined #ruby
[14:49:11] aderium: uname -a spits out incorrect info
[14:49:24] aderium: and ruby then alays compiles in i386
[14:49:32] shevy: MagePsycho now that is better but in ruby it is common to use lowercased method names
[14:49:35] aderium: isainfo gives the correct info
[14:49:42] shevy: Aderium aha
[14:50:10] MagePsycho: shevy: yeah .. i am getting used to.. i have noted that
[14:50:16] shevy: aha nobu and others replied: https://bugs.ruby-lang.org/issues/11342
[14:50:43] aderium: I started that bug ....
[14:50:44] MagePsycho: shevy: if you have time someday.. i would like to have how you gonna re-factor it and share with me
[14:50:48] riotjones: has joined #ruby
[14:50:51] aderium: that is a 2.2.2 issue
[14:50:58] shevy: Aderium yeah and two core devs responded already \o/ :D
[14:51:04] JMoir: has joined #ruby
[14:51:08] aderium: yeah tested the solution and no go
[14:51:09] shevy: MagePsycho ack! it's your code!
[14:51:09] MagePsycho: shevy: i think i should add usage :)
[14:51:22] shevy: MagePsycho yes, add --help option
[14:51:29] shevy: "This script supports the following options:"
[14:51:42] unshadow_: has joined #ruby
[14:51:46] MagePsycho: i know how to do in shell
[14:51:48] adaedra: MagePsycho: if you used optparse, it should help you with that
[14:52:12] shevy: Aderium, it seems as if from that script, it returns: UNAME_MACHINE = amd64
[14:52:18] shevy: so amd64 is the first entry right?
[14:52:25] shevy: I don't see many handles for that in the case menu
[14:52:33] shevy: so I assume it falls through, then reports that it can not guess anything
[14:52:52] shevy: only amd64 one I see is this one:
[14:52:53] shevy: amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
[14:53:06] shevy: but that can not match because you have no CYGWIN second, you should have SunOS second, or something like that
[14:53:16] adaedra: MagePsycho: look at the documentation, it has an example of handling --help
[14:53:19] shevy: perhaps just try to add the same option, but with a leading amd64 part?
[14:53:27] Channel6: has joined #ruby
[14:53:32] ddarkpassenger: has joined #ruby
[14:53:41] Kully3xf: has joined #ruby
[14:53:49] shevy: i86pc:SunOS:5.*:* | amd64:SunOS:5.*:* | i86xen:SunOS:5.*:*)
[14:53:54] shevy: can this be right? hmmm
[14:53:54] Scroff: has joined #ruby
[14:54:36] shevy: btw even if this does not work, give nobu some more feedback, he understands those scripts :)
[14:54:43] hotpancakes: has joined #ruby
[14:55:29] blaines: has joined #ruby
[14:55:33] aderium: thank you let me test it
[14:55:38] aderium: then irun autoconf ?
[14:55:59] revath: has joined #ruby
[14:56:07] aderium: ok that worked
[14:56:10] erowlin: has joined #ruby
[14:56:16] aderium: we are moving along but still something not right
[14:56:26] shevy: it worked?
[14:56:34] hotpanca_: has joined #ruby
[14:56:35] blaines_: has joined #ruby
[14:56:56] aderium: https://gist.github.com/CirrusThink/9c40b03303defacdaa49
[14:56:59] omegamike: has joined #ruby
[14:57:00] shevy: keep good track of the errors you get Aderium
[14:57:07] shevy: so that nobu can change the build system lateron
[14:57:12] havenwood: nice, new error
[14:57:34] ItSANgo_: has joined #ruby
[14:57:38] aderium: ok looks like now its a compiler thing
[14:58:07] aderium: not sure why its looking for C , should all go gcc
[14:58:09] shevy: havenwood lol
[14:58:33] tjohnson: has joined #ruby
[14:59:23] sharpmachine: has joined #ruby
[14:59:28] havenwood: shevy: New error is great here. Got past the socket problem from yesterday! :)
[14:59:41] ta: has joined #ruby
[14:59:57] shevy: Aderium not sure whether autoreconf can work here, probably one has to modify configure.ac or something...
[15:00:21] theery: has joined #ruby
[15:00:22] IrishGringo: has joined #ruby
[15:00:24] shevy: configure still has those hardcoded uname entries right? and you say that these are wrong so perhaps autoreconf it can not work because of that
[15:00:46] aderium: I think the issue now is that its looking for a C compiler and not a gcc ?
[15:00:58] aderium: https://gist.github.com/CirrusThink/9c40b03303defacdaa49
[15:00:59] shevy: I think that is just a generic error message
[15:01:11] shevy: checking whether the C compiler works... no
[15:01:16] shevy: does not really tell you what the problem is
[15:01:16] j_mcnally: has joined #ruby
[15:01:26] aderium: where does it get this from checking build system type... i386-pc-solaris2.11
[15:01:26] shevy: See `config.log' for more details
[15:01:31] shevy: can you gist config.log
[15:01:41] tuor: hi, why doesn't this write in the file? It creates the file, but it does'nt write "hello" in it. : https://gist.github.com/anonymous/a79b305f7e7c39d57ff6
[15:01:49] shevy: Aderium no idea... I guess it assembles that "i386-pc-solaris2.11" string
[15:02:06] brotspinne: tuor: you forgot file.close
[15:02:10] shevy: Aderium, probably this line right? https://gist.github.com/shevegen/4cd5e0a530440d95994a#file-config-guess-L374
[15:02:11] aderium: https://gist.github.com/CirrusThink/78f4a6484d1c7a6597b3
[15:02:16] shevy: echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
[15:02:24] shevy: still a hardcoded uname there
[15:02:41] shevy: nobody ever thought that uname could be wrong!
[15:02:55] fullofcaffeine: has joined #ruby
[15:03:04] shevy: are you able to assemble the correct string via isainfo?
[15:03:07] aderium: http://docs.oracle.com/cd/E19082-01/819-2380/enfli/index.html
[15:03:14] shevy: because if you could, you could put the proper command there
[15:03:16] tuor: brotspinne, ok.. It works, but why do I need it?
[15:03:17] aderium: yeah via isainfo yes
[15:03:18] casadei_: has joined #ruby
[15:03:28] brotspinne: tuor: but it's better to use a block like File.open(...) do ... end because the end will close the file automatically
[15:03:34] symm-: has joined #ruby
[15:03:43] shevy: so perhaps a new entry should be added to the case menu
[15:03:49] adaedra: Aderium: you know, if your problem is just uname ??? write a small script that returns correct values, name it uname, and place it higher in $PATH
[15:03:50] olistik: has joined #ruby
[15:03:51] shevy: and rather than UNAME, some isainfo thing should be used
[15:03:57] tuor: brotspinne, ah ok.
[15:04:05] shevy: aha that is also a solution from adaedra :)
[15:04:06] revath: has joined #ruby
[15:04:26] aderium: well except there are 3 times the uname is used that it is correct... I
[15:04:32] adaedra: I'm still thinking there may be a configuration option for that though.
[15:04:34] brotspinne: tuor: the writes will be buffered sometimes. depends on what you write and how much.. only when the file is closed or flushed, everthing will be written. it could also help to do file.puts which adds a line break
[15:05:10] tuor: brotspinne, ah that's the reason.
[15:05:43] malconis: has joined #ruby
[15:05:44] shevy: brotspinne and flughafen - the two coolest nicks here
[15:06:29] Timba-as: has joined #ruby
[15:06:34] tkuchiki: has joined #ruby
[15:07:30] dfockler: has joined #ruby
[15:07:32] tuor: so, when I close the file, I can't work anymore with this file-object? What do I do, when I want to work multiple times with the same file?
[15:08:07] t0rrieri_: has joined #ruby
[15:08:23] yeticry: has joined #ruby
[15:08:25] aderium: I think whet I autoconf it brought everythning back ......
[15:08:38] brotspinne: tuor: you use File.open ... do ... end and within the block you can write how often you like
[15:08:53] aderium: https://gist.github.com/CirrusThink/020bb1796b570e5986cb
[15:08:56] aderium: let me redo
[15:09:17] zdman135: has joined #ruby
[15:09:26] jriese: has joined #ruby
[15:10:05] dgutierrez1287: has joined #ruby
[15:10:12] tuor: brotspinne, ah ok. Ah and the filen name can be a string variable and so i can "remember" the file name.
[15:10:29] jhass: tuor: you can also nest, File.open(...) do |filea|; File.open(...) do |fileb| ... end; end;
[15:10:38] erowlin: has joined #ruby
[15:10:58] shevy: Aderium yeah, best also keep a separate file that has your modifications/patches to it
[15:11:45] tuor: jhass, ah for working with multiple files in the same code block?
[15:11:47] brotspinne: tuor: not sure what you mean. just do like this https://gist.github.com/anonymous/2607d0796ea378a74d84
[15:11:49] df: has joined #ruby
[15:11:54] jhass: tuor: yeah
[15:12:27] aderium: just messed up ....
[15:12:30] jhass: like copying parts of a file over into another
[15:12:34] tuor: jhass, ah got it. :)
[15:12:50] brotspinne: tuor: oops https://gist.github.com/anonymous/ef18b90a174b0fcfd714
[15:13:29] krz: has joined #ruby
[15:14:15] revath: has joined #ruby
[15:15:53] tuor: brotspinne, ah right ::new is not exactly the same.
[15:16:02] olistik: has joined #ruby
[15:16:14] tuor: OK thx for your help brotspinne & jhass :)
[15:17:22] werelivinginthef: has joined #ruby
[15:18:47] senayar: has joined #ruby
[15:18:47] senayar: has joined #ruby
[15:19:26] dojobo: has joined #ruby
[15:19:58] jhack: has joined #ruby
[15:20:13] senayar: has joined #ruby
[15:20:13] senayar: has joined #ruby
[15:20:16] dojobo: i'm getting "no such file or directory" with open-uri (using a local path, not a url) even though i can cat the very same path just fine. ideas?
[15:21:00] dojobo: (also, the script worked fine in windows, now i am trying to run it in linux--with an appropriate filepath of course)
[15:21:24] hmnhf: has joined #ruby
[15:21:56] j_mcnally: has joined #ruby
[15:22:58] n4t3: has joined #ruby
[15:23:18] adaedra: using file:///... ?
[15:23:47] shevy: dojobo and File.exist?(path_here) returns true?
[15:24:13] n4t3: Hi, does anybody know if I can create a destructive method for a class of mine?
[15:24:33] shevy: I don't think you can easily destroy objects
[15:24:58] shevy: you could perhaps poke through ObjectSpace and grab the rogue object by its ankles :)
[15:25:04] n4t3: Maybe I meant to say bang method. Can't really tell the difference.
[15:25:06] tuor: it's working :).
[15:25:06] revath: has joined #ruby
[15:25:17] tuor: good night.
[15:25:18] erowlin: has joined #ruby
[15:25:18] shevy: actually I don't know how to remove an object from ObjectSpace... is that even possible?
[15:25:24] tuor: has left #ruby: ("bye")
[15:25:29] shevy: well a bang method just has a trailing '!'
[15:25:34] surs2: has joined #ruby
[15:25:36] Scroff: has joined #ruby
[15:25:40] shevy: other than that, it is not special. you can have it do anything
[15:25:58] n4t3: I know, but I want it to modify the object like chomp! or strip! does.
[15:26:09] shevy: yeah ok so you want to modify it in place
[15:26:24] ljarvis: n4t3: what do you want help doing exactly? just modify the object in place. Be sure to provide a non bang version too :)
[15:26:43] shevy: .chomp! and .strip! have it easy, String objects have the replace() method so you can replace the object
[15:26:56] n4t3: And if it's my own class, not a String?
[15:27:14] ljarvis: you just mutate the variables as you normally would
[15:27:15] aderium: and we are configuring .... !!!!!!!
[15:27:24] ljarvis: maybe we could help if you provided some code, n4t3
[15:27:55] shevy: Aderium really??? how did you manage
[15:28:03] shevy: or rather what files did you have to modify
[15:28:23] aderium: ill post in a minute, only 4 lines
[15:28:40] aderium: I did not realize that /bin/arch needed to be /usr/bin/arch
[15:28:47] aderium: that was one of them
[15:29:13] n4t3: shevy: I want to replace the entire object in place.
[15:29:44] shevy: n4t3 yeah, if it's a String then it would be easy :)
[15:30:00] dojobo: thanks shevy and adaedra, was afk for a few, will try those
[15:30:04] chipotle: has joined #ruby
[15:30:08] aderium: still need to see if it actualy compiles 64
[15:30:14] jhn: has joined #ruby
[15:30:18] aderium: the target stated does not seem correct
[15:30:22] aderium: ill gist in a minute
[15:30:43] aderium: error in make :(
[15:30:44] zacstewart: has joined #ruby
[15:31:18] rcvalle: has joined #ruby
[15:31:35] Morrolan: has joined #ruby
[15:31:44] aderium: https://gist.github.com/CirrusThink/73ff6241758a3b7f9f14
[15:32:15] pdoherty: has joined #ruby
[15:32:36] Morrolan: has joined #ruby
[15:32:49] bwilson: has joined #ruby
[15:33:48] aderium: COLLECT_LTO_WRAPPER is incorrect
[15:33:54] aderium: can i add this to the configure ?
[15:33:54] shevy: ok well at least it is another error
[15:33:56] dojobo: hrmmm... File.exists? is returning false with both file:// and the bare path
[15:33:56] NeverDie: has joined #ruby
[15:34:03] shevy: no idea what is COLLECT_LTO_WRAPPER sorry
[15:34:05] spider-mario: has joined #ruby
[15:34:10] shevy: but you could add new variables like that sure
[15:34:28] shevy: dojobo so the file does not exist!
[15:35:31] NeverDie: has joined #ruby
[15:35:31] Aswebb_: has joined #ruby
[15:36:00] joelataylor: has joined #ruby
[15:36:47] dojobo: shevy: but "cat ~/file/path.rss" prints the file
[15:37:02] shevy: ok but that is not the absolute path
[15:37:10] dojobo: ah so maybe that's my problem
[15:37:23] shevy: I think you can use File.expand_path() too before sending this to File.exist?
[15:37:45] erowlin: has joined #ruby
[15:38:02] dojobo: a-ha, now it returns true
[15:38:24] NeverDie: has joined #ruby
[15:38:39] dojobo: shevy: yes, that worked for me too
[15:39:07] jhn: has joined #ruby
[15:39:08] shevy: simple problems are good problems
[15:39:14] shevy: Aderium has a not so simple problem
[15:39:15] aryaching: has joined #ruby
[15:39:17] dojobo: although since these are just paths i'm throwing in a yaml, i'll do abs paths, but expand_path is good to know
[15:39:33] aderium: I cant believe nobody caught this so far :)
[15:39:44] ddarkpassenger: has joined #ruby
[15:39:44] aderium: I just could not understand why ruby was always i386
[15:40:01] podman: has joined #ruby
[15:40:59] Scripore: has joined #ruby
[15:41:03] GitGud: has joined #ruby
[15:41:39] shevy: I think it really is because there are so few solaris users out there
[15:41:52] shevy: I can not even give you a single other example here on #ruby who uses solaris as main OS :)
[15:42:21] yihsiaol: has joined #ruby
[15:42:39] omegamike: has joined #ruby
[15:43:38] NeverDie: has joined #ruby
[15:43:51] bruno-: has joined #ruby
[15:45:21] amclain: has joined #ruby
[15:45:40] omegamike: has joined #ruby
[15:45:52] fabrice31: has joined #ruby
[15:46:48] joelataylor: has joined #ruby
[15:47:05] snockerton: has joined #ruby
[15:49:45] aderium: plenty of companies do, this I believe is probably a common issue on other solaris ports to like OmniOS
[15:51:17] adaedra: The university I attended before used Solaris as main OS.
[15:51:31] togdon: has left #ruby: ("Bye-Bye.")
[15:51:54] shevy: adaedra tell them to join #ruby!
[15:52:17] gambl0re: has joined #ruby
[15:52:43] BigRonnieRon: has joined #ruby
[15:52:48] bruno-: has joined #ruby
[15:52:49] theery: has joined #ruby
[15:53:27] BigRonnieRon: has joined #ruby
[15:54:57] jespada: has joined #ruby
[15:56:21] v4n: has joined #ruby
[15:57:11] bruno-: has joined #ruby
[15:59:01] Hobbyboy: has joined #ruby
[16:00:44] bruno-: has joined #ruby
[16:01:48] nateberkopec: has joined #ruby
[16:02:15] aef: has joined #ruby
[16:02:50] towski_: has joined #ruby
[16:03:56] theery: has joined #ruby
[16:05:30] radens: What is the ruby Hash equivalent of python's dict.items? It returns a list of (key, value) tuples
[16:06:00] radens: {'a':1, 'b':2} -> [['a',1],['b',2]]
[16:07:26] Darkwater: radens: each
[16:07:41] canton7: >> { a: 1, b: 2 }.to_a
[16:07:42] ruboto: canton7 # => [[:a, 1], [:b, 2]] (https://eval.in/396379)
[16:07:56] canton7: or if you're looping over it, use #each, yeah
[16:08:04] radens: excellent, thanks
[16:10:19] jpfuentes2: has joined #ruby
[16:11:23] tkuchiki: has joined #ruby
[16:11:38] peter_paule: has joined #ruby
[16:11:58] erowlin: has joined #ruby
[16:13:12] bricker: has joined #ruby
[16:13:12] howdoicomputer: has joined #ruby
[16:13:15] JoshL: has joined #ruby
[16:14:13] krz: has joined #ruby
[16:14:25] RobertBirnie: has joined #ruby
[16:15:04] eGGsha: has joined #ruby
[16:15:42] bronson: has joined #ruby
[16:17:50] C1V0: has joined #ruby
[16:17:56] j_mcnally: has joined #ruby
[16:18:23] revath: has joined #ruby
[16:18:40] neanias: !gif the village people
[16:18:46] neanias: >> {'a':1, 'b':2}.to_a
[16:18:47] ruboto: neanias # => [[:a, 1], [:b, 2]] (https://eval.in/396382)
[16:19:07] mleung: has joined #ruby
[16:19:07] neanias: >> {a: 1, b: 2}.to_a
[16:19:08] ruboto: neanias # => [[:a, 1], [:b, 2]] (https://eval.in/396385)
[16:19:31] radens: >> {'a'=>1, 'b'=>2}
[16:19:32] ruboto: radens # => {"a"=>1, "b"=>2} (https://eval.in/396388)
[16:19:35] mrconfused: has joined #ruby
[16:19:42] adaedra: neanias: what was that about the village people?
[16:19:52] radens: oh weird. The rocket ship and colon *are* different.
[16:20:03] neanias: Wrong channel, adaedra
[16:20:05] maletor_: has joined #ruby
[16:20:11] adaedra: radens: because a: is :a =>
[16:20:11] neanias: Someone was talking about the YMCA
[16:20:29] Mon_Ouie: Consider the fact that keys don't have to be symbols, too
[16:20:41] Mon_Ouie: They could be any object that implements #eql? and #hash properly
[16:20:43] centrx: has joined #ruby
[16:20:45] neanias: Better to use symbols though
[16:20:52] JMoir: has joined #ruby
[16:21:01] radens: I'd rather them not be.
[16:21:15] Mon_Ouie: No, sometimes symbols are just not appropriate
[16:21:44] Mon_Ouie: e.g. if you want to represent a set of objects, you could use a hash table (which is how the Set class in stdlib works)
[16:22:25] [Butch]: has joined #ruby
[16:26:14] tubuliferous_: has joined #ruby
[16:26:37] paulcsmith: has joined #ruby
[16:26:51] rindolf: has joined #ruby
[16:26:57] [H]unt3r: has joined #ruby
[16:29:13] momomomomo: has joined #ruby
[16:29:18] stamina: has joined #ruby
[16:29:40] aderium: Making away .....
[16:30:02] shevy: Aderium is about to succeed!
[16:30:33] aderium: https://gist.github.com/CirrusThink/343758e59652783325a3
[16:30:38] aderium: not that fast ....
[16:31:01] aderium: choosing wrng class ...
[16:31:56] chipotle: has joined #ruby
[16:32:39] shevy: ld: fatal: file dmyext.o: wrong ELF class: ELFCLASS32
[16:32:43] pietr0: has joined #ruby
[16:33:11] aderium: looks like its still choosing a 32 class ..
[16:33:57] surs3: has joined #ruby
[16:34:30] Senjai: Good morning ruby
[16:34:41] apeiros: good morning Senjai
[16:35:26] havenwood: shevy: ELVES!!!
[16:35:28] mrconfused_: has joined #ruby
[16:35:54] eam: Aderium: -m64?
[16:36:07] Ox0dea: has joined #ruby
[16:36:17] Ox0dea: Hey, ?guys, what's the best terminal emulator?
[16:36:30] eam: Ox0dea: for what system?
[16:36:35] Scroff: has joined #ruby
[16:36:42] Ox0dea: I was only poking fun at diegoviola.
[16:36:56] eam: because I have opinions and such
[16:37:08] Ox0dea: st does everything I need and little else.
[16:37:46] pengin: has joined #ruby
[16:37:56] balazs: has joined #ruby
[16:38:34] jtdoncas: has joined #ruby
[16:38:44] redjack1964: has joined #ruby
[16:39:19] NeverDie: has joined #ruby
[16:39:36] lkba_: has joined #ruby
[16:40:04] eam: Ox0dea: I wish I was running X :)
[16:40:06] Senjai: eam: You have me curious now. I use urxvt
[16:40:25] Ox0dea: eam: Oh? Do you use links, then?
[16:40:33] Senjai: eam: You run wayland or something else? Or nothinh at all
[16:40:36] eam: Senjai: I'm happy with urxvt (or just rxvt) and st sounds nice too. But I'm on osx so I use a hacked up iterm2
[16:40:53] eam: none of my linux boxes have video cards
[16:41:17] eam: I'd love to junk osx and put linux on this thing, but can't for various business reasons
[16:41:17] tubuliferous_: has joined #ruby
[16:41:19] luckyno7: has joined #ruby
[16:41:35] xlogic: has joined #ruby
[16:41:49] sdothum: has joined #ruby
[16:42:13] neanderslob: has joined #ruby
[16:42:21] bodgix_wrk: has left #ruby: ()
[16:43:18] Ox0dea: Is there a better non-alphanumeric source of randomness than $$?
[16:43:28] centrx: Don't put Word 2015 on it
[16:43:37] eam: Ox0dea: non-alphanumeric?
[16:43:43] Ox0dea: No letters or numbers.
[16:43:49] apeiros: +in the code
[16:43:51] eam: I uh, /dev/urandom is just bytes
[16:43:51] bb010g: has joined #ruby
[16:44:04] centrx: $$ isn't random, it's a process number
[16:44:08] apeiros: eam: they want to write code which does not contain letters or numbers
[16:44:15] eam: oooh I see
[16:44:24] Alayde: has joined #ruby
[16:44:25] eam: there go all my useful recommendations ;)
[16:44:54] Ox0dea: >> _=$$/$$;__=_-_;@_=_+_;$_=@_+_;$__=@_+$_;$-_=$__*$_;@__=''<<$-_*($__+$_)+@_;$___=''<<$-_*$__-$__<<$-_*($__+@_)<<@__<<@__;@___=''<<$-_*$__-$_*$_<<$-_*($__+$_)-$_<<@__<<@__;(___=->____{$.+=_;____<<($.%$-_==__ ?$___+@___:$.%$_==__ ?$___:$.%$__==__ ?@___:$.);$.<($__*@_)**@_?___[____]:____})[[]]
[16:44:55] ruboto: Ox0dea # => [1, 2, "Fizz", 4, "Buzz", "Fizz", 7, 8, "Fizz", "Buzz", 11, "Fizz", 13, 14, "FizzBuzz", 16, 17, "Fiz ...check link for more (https://eval.in/396389)
[16:44:58] Ox0dea: I do shit like that for giggles. :)
[16:44:59] apeiros: Ox0dea: I think most people asking about "non-alphanumeric" have little trouble to understand that it means "no letters or numbers". their problem usually is related to the context where you don't want letter or numbers ;-)
[16:45:22] eam: I read that as asking about the data, not the name of the symbol referencing it
[16:45:53] apeiros: eam: yeah, did so too when they asked a similar question and was rather confused as it didn't make sense in the case of that question :)
[16:45:58] Ox0dea: Forgive my ambiguity, then. I had hoped explicitly mentioning $$ might have clarified the matter.
[16:46:50] eam: makes sense with context :)
[16:47:10] Rollabunna: has joined #ruby
[16:48:09] dfockler: Ox0dea: I really liked the division to get 1
[16:48:15] mleung: has joined #ruby
[16:48:16] eam: what's the context of 'random' here, what's it being used for?
[16:48:23] Ox0dea: eam: Randomness.
[16:48:35] Ox0dea: A linear congruential generator's seed, to be more precise.
[16:48:36] hotpancakes: has joined #ruby
[16:48:39] eam: yeah but, how? It's not a real prng, so
[16:48:57] Ox0dea: An LCG is a PRNG, for what that's worth.
[16:49:09] fullofcaffeine: has joined #ruby
[16:49:09] centrx: Ox0dea, Have you looked at SecureRandom http://ruby-doc.org/stdlib-2.2.2/libdoc/securerandom/rdoc/SecureRandom.html
[16:49:20] eam: you could use the contents of $", they will vary between systems
[16:49:33] apeiros: centrx: hard to use without writing alphanumeric chars in the code ;-)
[16:49:33] Ox0dea: eam: But it'll always be the same.
[16:49:38] eam: Ox0dea: within a system, yes
[16:49:43] Ox0dea: That's not very random.
[16:49:48] eam: well, nothing will be
[16:49:55] Ox0dea: The PID will be "pseudo-random".
[16:50:21] eam: well, kinda, it's just incrementally increasing
[16:50:26] eam: you could use time
[16:50:36] Ox0dea: But how to do so without alphanumerics?
[16:51:04] Ox0dea: There are a few Time instances in ObjectSpace at program start, but they're always the same and I don't think I could get at them besides.
[16:51:05] eam: what primitives have you built so far?
[16:51:10] Ox0dea: Lots and lots.
[16:51:13] eam: got a list?
[16:51:43] bsdbofh: has joined #ruby
[16:52:23] shinnya: has joined #ruby
[16:52:43] eam: ok, I know how to do it
[16:53:18] eam: you can construct arbitrary characters by using non-alphanumeric unicode literals, then indexing as bytes (you can index with whatever integers you have in non-alphanumeric globals)
[16:53:46] krz: has joined #ruby
[16:53:53] Ox0dea: That skips over the problem of seeding, no?
[16:53:55] rbowlby: has joined #ruby
[16:53:57] eam: given that, I think you should be able to build the string "send" and then call arbitrary methods
[16:54:23] eam: never actually using an alnum character
[16:55:10] Azulinho: has joined #ruby
[16:55:14] Ox0dea: It's quite easy to construct any string, but *actually* invoking #send is, I think, not currently possible.
[16:55:58] Ox0dea: Non-alphanumeric Ruby is still technically Turing-complete without it, but it would make it much easier to write interesting programs.
[16:56:17] rbowlby_: has joined #ruby
[16:57:20] Ox0dea: $$/$$ gets you the 1 from which all other numbers can be derived, and then String#<< is how you build up arbitrary strings, since shoveling actually appends the character at that codepoint.
[16:57:27] Ox0dea: >> '' << 97 << 98 << 99
[16:57:28] ruboto: Ox0dea # => "abc" (https://eval.in/396390)
[16:58:02] eam: you can call map? which means you can pass a symbol: &:"#{$,}"
[16:58:13] eam: assuming you set $, = "method name"
[16:58:13] Ox0dea: No, I've implemented MAP without alphanumerics.
[16:58:26] eam: oh, so not actually map then
[16:59:04] Ox0dea: Not Ruby's #map, but it takes a collection and a Proc and applies the latter to every element of the former, so there's no practical difference.
[16:59:15] eam: a real proc?
[16:59:19] Ox0dea: A real Proc.
[16:59:25] Ox0dea: >> ->{}[]
[16:59:26] ruboto: Ox0dea # => nil (https://eval.in/396391)
[16:59:28] bungoman: has joined #ruby
[16:59:28] zacstewart: has joined #ruby
[16:59:30] Scripore: has joined #ruby
[17:00:21] zacstewart: has joined #ruby
[17:02:33] hahuang65: has joined #ruby
[17:02:57] snockerton: has joined #ruby
[17:02:58] JakFrist: has joined #ruby
[17:03:03] mjuszczak: has joined #ruby
[17:05:01] eam: this is a fascinating puzzle but I'm gonna get some work done for a bit :D
[17:05:30] sgambino: has joined #ruby
[17:05:54] Ox0dea: Well, I'm glad you think so. Apologies for the distraction.
[17:06:01] Ox0dea: >> $_=$$/$$;@_=->_,__{_==[]?[]:[__[_[$_-$_]]]+@_[_[$_..-$_],__]}; foo = [1, 2, 3]; @_[foo, -> x { x + 1 }]
[17:06:02] ruboto: Ox0dea # => [2, 3, 4] (https://eval.in/396394)
[17:06:09] Ox0dea: @_ is MAP there.
[17:06:09] eam: Ox0dea: don't apologize this is a great challenge
[17:06:49] Ox0dea: It's implemented recursively, but it kinda cheats in taking advantage of Ruby's binding semantics.
[17:07:52] Mon_Ouie: >> get_block = ->(&b) { b }; send = get_block(&:"send"); send[:anything, "rand"]
[17:07:53] ruboto: Mon_Ouie # => undefined method `get_block' for main:Object (NoMethodError) ...check link for more (https://eval.in/396395)
[17:08:00] Mon_Ouie: >> get_block = ->(&b) { b }; send = get_block[&:"send"]; send[:anything, "rand"]
[17:08:01] ruboto: Mon_Ouie # => 0.9301043372750087 (https://eval.in/396396)
[17:08:13] Mon_Ouie: Can't you adapt this to not use any alphanumerical characters?
[17:10:19] eam: oh damn, there's your send
[17:10:44] Ox0dea: Mon_Ouie: That's brilliant.
[17:13:26] allcentury: has joined #ruby
[17:13:55] mesamoo: has joined #ruby
[17:14:16] Torrieri: has joined #ruby
[17:14:17] Torrieri: has joined #ruby
[17:14:20] axl_: has joined #ruby
[17:15:04] allcentury: hi all - I'm trying to understand when variables in a block in ruby need parens, I'm not sure I understand the convention. For example I'm having to do [1, 2, 3].each_with_object(0).with_index do |(num, obj), index| but I don't understand why I need the parens
[17:15:25] duggiefresh: has joined #ruby
[17:15:40] T3: has joined #ruby
[17:16:02] bruno-: has joined #ruby
[17:17:03] Antiarc: You need the parens for deconstructing assignment. https://gist.github.com/cheald/d88f37a5b9f0e5cfcc8e
[17:17:07] Mon_Ouie: [1, 2, 3].each_with_object(0).to_a
[17:17:09] Mon_Ouie: >> [1, 2, 3].each_with_object(0).to_a
[17:17:10] ruboto: Mon_Ouie # => [[1, 0], [2, 0], [3, 0]] (https://eval.in/396397)
[17:17:37] Rollabunna: has joined #ruby
[17:17:38] Antiarc: In the first case, the first parameter passed is the array [num, obj]. If you want to expand that into individual variables, you pass a paren-delineated list of variables to destructure the array into
[17:17:53] Mon_Ouie: ^ this is the collection seen by with_index, which calls its own block with one element from that collection and the index
[17:18:04] thiagovsk: has joined #ruby
[17:18:21] chussenot: has joined #ruby
[17:18:23] Ox0dea: allcentury: This should help clarify things:
[17:18:24] Ox0dea: >> _,(_,_,((_,(foo,_)),_)) = [1, [2, [3, 4], [[5, [:target], 6], [7], 8, [9], 10]]]; foo
[17:18:25] ruboto: Ox0dea # => :target (https://eval.in/396398)
[17:18:48] gard: has joined #ruby
[17:20:34] Ox0dea: In allcentury's defense, the parentheses aren't always required, which can be a little confusing.
[17:20:38] Ox0dea: >> foo = [1, 2, 3]; foo.zip(foo).map { |a, b| a + b }
[17:20:39] ruboto: Ox0dea # => [2, 4, 6] (https://eval.in/396400)
[17:20:50] JMoir: has joined #ruby
[17:21:03] Jackneill: has joined #ruby
[17:21:25] jhass: yeah, you get the first level for free, do |x, y| -> do |(x, y)|
[17:21:25] shevy: Ox0dea you write really strange code
[17:21:28] fgo: has joined #ruby
[17:21:34] Antiarc: Well, the parens are required when the value passed to the block is an array containing an array. When it's just a 1-level array, the array can be destructured with multiple params and no parens
[17:22:07] shevy: _,(_,_,((_,(foo,_)),_)) is almost like ASCII art... a spaceship
[17:22:17] Antiarc: >> [[[1, [:a]], false], [[2, [:b]], true]].map {|(num, (sym)), bool| [num, sym, bool] }
[17:22:18] ruboto: Antiarc # => [[1, :a, false], [2, :b, true]] (https://eval.in/396402)
[17:22:54] Antiarc: Each iterated entry contains an array containing an array, and we can destructure even the deep array via the parens in the block params
[17:23:23] allcentury: Got it, thank you Antiarc
[17:23:59] Rodya_: has joined #ruby
[17:24:04] hahuang61: has joined #ruby
[17:24:37] Mon_Ouie: Also notice how x = 1, 2, 3 is different from x, = 1, 2, 3 and x, y = 1, 2, 3
[17:25:04] td: has joined #ruby
[17:25:31] eggoez: has joined #ruby
[17:26:08] postmodern: has joined #ruby
[17:26:54] Ox0dea: Mon_Ouie: Reckon there's a better way to get hold of Kernel than `send[send['', 'class'], 'ancestors'][-2]`?
[17:27:38] failshell: has joined #ruby
[17:27:51] Ox0dea: Or Object even, where that -2 would be a -3, but I suspect I'm missing some cleverer way of getting there.
[17:28:56] blackmes1: has joined #ruby
[17:29:20] Mon_Ouie: Not sure (nor am I sure what constitutes "better" for your purposes :p), but when you have one of those you can start using const_get instead
[17:29:39] Ox0dea: Right, that was the plan.
[17:30:01] Ox0dea: >> send=->&_{_}[&:"send"]; send[send[send[send['', 'class'], 'ancestors'][-2], 'const_get', 'Time'], 'new']
[17:30:01] ruboto: Ox0dea # => 2015-07-10 17:30:01 +0000 (https://eval.in/396404)
[17:30:08] dudo: has joined #ruby
[17:30:22] jtdoncas: has joined #ruby
[17:31:02] bruno-: has joined #ruby
[17:31:15] zeeraw: has joined #ruby
[17:31:21] polpak: Ox0dea: Why not just Kernel ?
[17:31:44] livathinos: has joined #ruby
[17:31:46] Ox0dea: polpak: I can't use letters or numbers in the final code.
[17:31:56] sdothum: has joined #ruby
[17:31:57] Ox0dea: I can replace all of those strings with non-alphanumeric equivalents.
[17:32:26] Ox0dea: And the -2 as well, of course.
[17:32:54] Unknown59167: has joined #ruby
[17:32:58] Ox0dea: >> _=$$/$$;[*?`...?{][_..-_]*''
[17:32:59] ruboto: Ox0dea # => "abcdefghijklmnopqrstuvwxyz" (https://eval.in/396407)
[17:33:04] chipotle: has joined #ruby
[17:33:48] dfockler: has joined #ruby
[17:33:59] brain_shim: has joined #ruby
[17:34:38] bronson: has joined #ruby
[17:36:23] werelivinginthef: has joined #ruby
[17:36:56] mjuszczak: has joined #ruby
[17:38:51] lkba: has joined #ruby
[17:39:51] hahuang65: has joined #ruby
[17:40:01] DoubleMalt: has joined #ruby
[17:41:34] chouhoulis: has joined #ruby
[17:41:49] snockerton: has joined #ruby
[17:41:49] RegulationD: has joined #ruby
[17:42:12] chouhoulis: has joined #ruby
[17:42:38] fullofcaffeine: has joined #ruby
[17:43:05] mjuszczak: has joined #ruby
[17:43:54] startupality: has joined #ruby
[17:44:03] djbkd: has joined #ruby
[17:44:13] theery: has joined #ruby
[17:44:33] revath: has joined #ruby
[17:44:36] omegahm: has joined #ruby
[17:46:18] x1337807x: has joined #ruby
[17:46:41] fabrice31: has joined #ruby
[17:46:51] mjuszczak: has joined #ruby
[17:47:15] werelivinginthef: has joined #ruby
[17:47:31] Marsupermammal: has joined #ruby
[17:48:00] konsolebox: has joined #ruby
[17:48:48] konsolebox: has joined #ruby
[17:49:07] Rollabunna: has joined #ruby
[17:50:32] freerobby: has joined #ruby
[17:51:54] Rollabunna: has joined #ruby
[17:52:22] jY: has joined #ruby
[17:52:47] jY: is there a good way to turn "['foo', 'bar']" that is a string into an array?
[17:53:00] hotpancakes: has joined #ruby
[17:53:26] bricker: Ox0dea: what is $$ ?
[17:53:32] Ox0dea: The process ID.
[17:53:35] ruboto: Ox0dea # => 15717 (https://eval.in/396411)
[17:53:45] Ox0dea: It's the only nonzero global variable available at program start.
[17:53:45] workmad3: has joined #ruby
[17:53:55] centrx: jY, if it's JSON or YAML yeah
[17:54:11] Limix: has joined #ruby
[17:54:14] pothibo: has joined #ruby
[17:54:15] bricker: Ox0dea: so what's the point of dividing it by itself at the beginning? Just to make the script more confusing?
[17:54:17] jY: centrx: its pretty much also valid json
[17:54:29] Ox0dea: bricker: No, I need to be able to construct numbers, and for that I need something nonzero.
[17:54:40] Alina-malina: has joined #ruby
[17:55:06] Ox0dea: Well, I need a 1, to be precise, and $$ / $$ gets me there.
[17:55:22] quazimodo: has joined #ruby
[17:55:22] bricker: Ox0dea: right... so the point of $$/$$ is just to look confusing
[17:55:25] quazimod1: has joined #ruby
[17:55:34] bricker: Ox0dea: so why not just type _=1 ?
[17:55:41] Ox0dea: Because I can't use numbers or letters...
[17:55:49] centrx: it's some kind of sick joke
[17:56:02] centrx: brainruby
[17:56:07] bricker: Ox0dea: I missed that part of the conversation
[17:56:22] snockerton: has joined #ruby
[17:56:35] jtdoncas: has joined #ruby
[17:56:38] reset: has joined #ruby
[17:57:07] revath: has joined #ruby
[17:58:43] bricker: Ox0dea: Can you explain how this works? [*?`...?{]
[17:59:07] klaas: has joined #ruby
[17:59:15] eam: bricker: it's the range of characters from ` to {
[17:59:24] eam: splat'ed
[17:59:30] Ox0dea: eam: And excluding the end.
[17:59:36] eam: yeah, ... vs ..
[17:59:48] Ox0dea: >> ?a == 'a'
[17:59:49] ruboto: Ox0dea # => true (https://eval.in/396412)
[17:59:59] eam: ` and { are the characters surrounding a-z range in ascii
[18:00:34] bricker: :) It's obvious when it's broken down
[18:00:37] eam: Ox0dea: didn't realize that splat works that way, that's much nicer than ().to_a
[18:00:44] eam: I'm going to start using that in real code
[18:00:52] a346: has joined #ruby
[18:01:03] Ox0dea: It's not particularly uncommon.
[18:01:05] mando: has joined #ruby
[18:01:08] eam: the precedence of .. is super frustrating
[18:01:22] eam: Ox0dea: yeah I know *, I just didn't realize its precedence was correct for ..
[18:01:35] Ox0dea: eam: Well, you probably shouldn't have terribly complex expressions on either side.
[18:01:37] eam: I write 1..10.to_a all the time :(
[18:01:45] Ox0dea: Oh, right.
[18:01:53] Senjai: Ox0dea: That ? notation needs to go
[18:02:01] Senjai: I remember reading up on that a longgg time ago
[18:02:09] Ox0dea: It might go away for 3.0.
[18:02:09] Zai00: has joined #ruby
[18:02:24] Ox0dea: I'd also prefer it didn't.
[18:02:36] jonathanwallace: has joined #ruby
[18:02:43] Ox0dea: >> ?????:?:
[18:02:44] ruboto: Ox0dea # => /tmp/execpad-8e19d5c57214/source-8e19d5c57214:2: warning: string literal in condition ...check link for more (https://eval.in/396413)
[18:02:51] pipework: having fun?
[18:02:52] startupality: has joined #ruby
[18:02:59] towski_: has joined #ruby
[18:03:21] eam: >> $VERBOSE=nil or eval "????::??"
[18:03:22] ruboto: eam # => ":" (https://eval.in/396414)
[18:05:14] fullofcaffeine: has joined #ruby
[18:05:48] PlasmaStar: has joined #ruby
[18:07:00] NeverDie: has joined #ruby
[18:07:23] Kully3xf_: has joined #ruby
[18:09:20] allomov: has joined #ruby
[18:10:26] n008f4g_: has joined #ruby
[18:10:56] snockerton: has joined #ruby
[18:11:03] surs4: has joined #ruby
[18:12:34] chouhoul_: has joined #ruby
[18:14:49] failshell: has joined #ruby
[18:16:29] baweaver: has joined #ruby
[18:16:30] hotpancakes: has joined #ruby
[18:17:20] Scroff: has joined #ruby
[18:19:22] djbkd: has joined #ruby
[18:19:29] T3: has joined #ruby
[18:19:38] sshuff: has joined #ruby
[18:19:41] xkef: has joined #ruby
[18:20:08] JoshL: has joined #ruby
[18:20:18] Rollabunna: has joined #ruby
[18:22:26] JakFrist: has joined #ruby
[18:22:30] Darkwater: I want to write something similar to attr_accessor, do I really need to use class_eval?
[18:24:00] bricker: Darkwater: no, you can just define a class method
[18:24:02] jbw_: has joined #ruby
[18:24:08] Darkwater: how do I do that?
[18:24:47] prestorium: has joined #ruby
[18:24:53] shevy: class Foo; def self.attr_bla; end; end
[18:24:58] revath: has joined #ruby
[18:25:07] Darkwater: well the method name needs to be dinamic
[18:25:16] shevy: k so you can use define_method
[18:25:16] aaeron: has joined #ruby
[18:25:38] Darkwater: oh, so that does exist
[18:25:39] aaeron: I am using fileutils for copying sudo owned files
[18:25:41] Darkwater: coudln't find it on devdocs
[18:25:44] aaeron: it obviously fails
[18:26:09] aaeron: is there any way i can use file utils with sudo
[18:26:11] toretore: has joined #ruby
[18:26:21] aaeron: except doing sudo ruby file_name.rb
[18:26:46] Darkwater: note that they're not owned by sudo, they're owned by root
[18:26:52] Darkwater: sudo cmd executes cmd as root
[18:26:57] aaeron: sorry my bad
[18:27:19] Darkwater: if it's for a single use you can just change the owner manually
[18:27:31] Darkwater: ie. sudo chown yourusername:yourgroupname file.txt
[18:27:38] rbennacer: has joined #ruby
[18:27:51] aaeron: That wont be possible as I am running this command on someone elses box
[18:28:23] aaeron: wanted to use the standard. If not do u recommend using mixlib? or sh ?
[18:28:24] Darkwater: other than that it isn't really possible without sudo
[18:28:28] Darkwater: unless you want to get hacky
[18:28:32] workmad3: has joined #ruby
[18:28:44] aaeron: which is the best command line utility u suggest
[18:28:45] eam: aaeron: why/how does it fail? sudo will work with ruby just fine
[18:28:46] Darkwater: you could do `sudo mv ile.txt file.txt`
[18:29:01] aaeron: i dont want to run the file using sudo
[18:29:03] astrobun_: has joined #ruby
[18:29:09] eam: aaeron: you need to provide more details about what you're trying to do
[18:29:10] chouhoulis: has joined #ruby
[18:29:22] vickleton: has joined #ruby
[18:29:50] aaeron: eam: changing this to a testable code
[18:29:51] aaeron: `sudo cp #{src} #{dst}`
[18:29:54] aaeron: using fileutils
[18:30:08] aaeron: I can use mixlib
[18:30:22] eam: aaeron: you will need to use sudo to elevate ruby to root
[18:30:25] eam: if you want to use FileUtils
[18:30:37] eam: you can do it in a subprocess if you don't want to do it to the entire ruby program
[18:30:40] eam: fork/exec
[18:30:49] gregf: has joined #ruby
[18:30:58] aaeron: What about using mixlib?
[18:31:10] drewo: has joined #ruby
[18:31:13] eam: aaeron: sure, or you can use system()
[18:31:14] aaeron: I am not able to decide which is better
[18:31:30] eam: system "sudo", "cp", src, dst
[18:31:51] Darkwater: that's nearly the same as `sudo cp #{src} #{dst}`
[18:32:03] aaeron: eam, darkawater: which one do u prefer for executing shell commands.
[18:32:04] eam: Darkwater: sure, but it's invoked from ruby which it seems he wants
[18:32:19] evanjs: has joined #ruby
[18:32:21] eam: aaeron: system is simple and builtin, it's fine unless you have other needs
[18:32:25] Darkwater: well it's cleaner anyway since it'll work fine if the arguments contain spaces or similar
[18:32:30] eam: Darkwater: yeah
[18:32:47] Darkwater: I usually just use `` or sometimes %x tho
[18:33:05] mfp_: has joined #ruby
[18:33:08] rbennacer: has joined #ruby
[18:33:15] eam: you may get into trouble with those in conjunction with sudo -- often sudo is configured to require stdout to be a terminal
[18:33:17] kies^: has joined #ruby
[18:33:17] aaeron: Darkwater
[18:33:33] aaeron: how do u test the output
[18:33:41] eam: system() will use the stdin/out/err of the script, which are probably terminals
[18:33:46] mdarby: has joined #ruby
[18:33:48] Scripore: has joined #ruby
[18:33:48] Darkwater: `echo hi` # => "hi\n"
[18:33:53] Darkwater: >> `echo hi`
[18:33:54] ruboto: Darkwater # => (https://eval.in/396418)
[18:33:59] Darkwater: why did I expect that to work
[18:34:30] Ox0dea: Because `echo` is usually a shell builtin?
[18:34:33] Darkwater: (it only breaks because that bot blocks shell commands)
[18:34:34] chipotle: has joined #ruby
[18:34:36] postmodern: is it really necessary to add rake as a development_dependency? i mean rake comes pre-installed with ruby
[18:34:43] Mro95: has joined #ruby
[18:34:43] Darkwater: `` uses $SHELL so no
[18:34:48] Mro95: hello Darkwater
[18:34:52] Darkwater: go away Mro95
[18:34:56] eam: Darkwater: not necessarily
[18:35:07] Darkwater: *a* shell anyway
[18:35:12] eam: Darkwater: not necessarily
[18:35:37] baweaver: has joined #ruby
[18:35:43] eam: Darkwater: well, in your case there - no shell
[18:36:01] symbol: has joined #ruby
[18:36:06] eam: ruby will examine the string and if it determines it can tokenize it without spawning a shell it will optimize it away
[18:36:17] Darkwater: I'm talking about ruby's standard implementation of Kernel#`
[18:36:19] eam: generally that means "does it have metacharacters"
[18:36:21] eam: Darkwater: me too
[18:36:22] Darkwater: (if that's the correct name)
[18:36:37] eam: we're talking about the same ` or system
[18:36:50] eam: Darkwater: test it :)
[18:37:14] symbol: has joined #ruby
[18:37:17] eam: strace -f -eexecve ruby -e'`echo hi`'
[18:37:38] eam: Darkwater: compare with: strace -f -eexecve ruby -e'`echo hi # this comment has a metachar: * `'
[18:37:53] eam: ruby will see the * and determine it can't tokenize the string
[18:38:18] Darkwater: let me correct myself then
[18:38:19] aaeron: has joined #ruby
[18:38:22] Darkwater: it behaves just like a shell
[18:38:39] Darkwater: as far as the programmer is concerned it's the same anyway
[18:39:40] mfp_: has joined #ruby
[18:39:49] hahuang65: has joined #ruby
[18:40:36] symbol: has joined #ruby
[18:40:49] eam: mostly, until it isn't, at which point hair will be pulled
[18:41:12] symm-: has joined #ruby
[18:42:00] Darkwater: what's the most efficient way to turn :foo into :@foo?
[18:42:31] Darkwater: do I have to turn it into a string and back or is there a better way?
[18:42:50] Mon_Ouie: >> :"@#{:foo}"
[18:42:51] ruboto: Mon_Ouie # => :@foo (https://eval.in/396422)
[18:43:01] Darkwater: oh right you can do that
[18:43:22] eam: functionally the same as to_s though, right?
[18:44:21] benlieb: has joined #ruby
[18:44:22] aaeron: has joined #ruby
[18:44:58] baweaver: has joined #ruby
[18:45:21] seal: has joined #ruby
[18:46:01] symbol: has joined #ruby
[18:46:45] Spami: has joined #ruby
[18:47:29] arescorpio: has joined #ruby
[18:48:12] shadoi: has joined #ruby
[18:48:28] Ox0dea: More precisely, interpolation literally attempts to use the object's #to_s method.
[18:49:24] ta: has joined #ruby
[18:50:05] Darkwater: I want to make a mixin that provides a method similar to attr_accessor, can someone give me some pointers?
[18:50:09] Darkwater: http://hastebin.com/pahosogezo.rb
[18:50:21] jroith: has joined #ruby
[18:50:24] Darkwater: not sure how/where to define attribute
[18:52:08] Baprath: has joined #ruby
[18:52:19] duggiefresh: has joined #ruby
[18:52:38] bruno-: has joined #ruby
[18:52:52] howdoicomputer: has joined #ruby
[18:53:18] dseitz: has joined #ruby
[18:53:59] jhass: Darkwater: remove the self. in the def and use extend instead of include
[18:54:59] Darkwater: works, thanks
[18:55:05] Darkwater: (that part at least, got other problems)
[18:55:29] umgrosscol: has joined #ruby
[18:55:42] Ox0dea: Darkwater: You don't technically need to convert name back to a Symbol, for what it's worth.
[18:55:44] keen__________16: has joined #ruby
[18:55:49] blaines: has joined #ruby
[18:56:03] Ox0dea: Also maybe consider using case equality instead of #is_a?.
[18:56:43] Ox0dea: Then you get things like `attribute :foo, /bar/` for free, where `foo` has to match some regular expression.
[18:56:49] symbol: I need a new nick.
[18:56:51] Kully3xf: has joined #ruby
[18:56:54] Darkwater: right, cool
[18:57:03] Darkwater: also how would I initialize @attributes?
[18:57:04] Ox0dea: symbol: I intentionally capitalized there to avoid highlighting you. :/
[18:57:15] Ox0dea: Darkwater: Hook #extended.
[18:57:24] symbol: Ox0dea: Heh, no worries :)
[18:57:38] symbol: It makes me feel important
[18:57:58] redteam: has joined #ruby
[18:59:05] shevy: i hate symbol
[18:59:18] blaines_: has joined #ruby
[18:59:23] ytti: but you also use {}
[18:59:25] Antiarc: symbol: I recommend symboI or symb0l :P
[18:59:32] ytti: so your opinions don't matter
[18:59:34] ytti: you're a bad man
[18:59:58] ytti: ACTION loves all the symbols hurt by the shevy
[18:59:59] symbol: ??\_(???)_/??
[19:00:14] former_symbol: once I was the symbol called Prince
[19:00:20] Darkwater: ah self.extended
[19:00:20] former_symbol: erm sorry, :Prince
[19:01:18] rwilcox: has joined #ruby
[19:01:29] shevy: I need to rewrite a ruby project and I don't feel motivated :(
[19:01:49] Darkwater: Ox0dea: do I need to call instance_variable_set on base in extended?
[19:01:59] Ox0dea: Darkwater: That's one way to do it.
[19:02:07] Darkwater: just @foo = bar doesn't work
[19:02:15] Ox0dea: Right, as should make sense.
[19:02:45] Ox0dea: Metaprogramming in Ruby can be unpleasantly verbose. :/
[19:02:54] ivanskie: has joined #ruby
[19:03:01] Scroff: has joined #ruby
[19:03:03] skyjumper: is it considered good practice to do `ClassName === instance` instead of `instance.is_a? ClassName`?
[19:03:11] ytti: Ox0dea, add DSL to compress it
[19:03:21] ytti: when in doubt, another layer of indirection
[19:03:30] ytti: your coworkers will thank you for the innovative approach
[19:03:52] blue_deref: has joined #ruby
[19:03:55] Ox0dea: Crystal has macros. :(
[19:04:05] havenwood: has joined #ruby
[19:04:23] Darkwater: hm, Integer === Integer is false
[19:04:30] Darkwater: how do I use a case statement with types?
[19:04:37] Ox0dea: Darkwater: "Type" on the left.
[19:04:57] skyjumper: Darkwater: Integer === 5
[19:04:59] ytti: Darkwater, you are asking if Interger's class is Integer
[19:05:00] Ox0dea: Oh, you meant in a `when` clause?
[19:05:02] ytti: Darkwater, it's not, it is class
[19:05:03] skyjumper: right hand side takes an instance
[19:05:06] Darkwater: yeah I know
[19:05:14] toretore: skyjumper: some say.. that it's bad practice
[19:05:18] Darkwater: when Integer
[19:05:19] skyjumper: is that considered a normal thing to do?
[19:05:20] toretore: that === is only for case
[19:05:21] Darkwater: input coudl be Integer
[19:05:30] skyjumper: it's confusing as hell, when .is_a? is pretty clear
[19:06:15] Ox0dea: Darkwater: That branch of your case statement would execute if Integer === input.
[19:06:35] Darkwater: so I need to dos omething else
[19:06:52] Darkwater: what I want would be this if case used == instead of ===
[19:07:00] jhass: skyjumper: keep .is_a?, only weirdos use === outside case
[19:07:13] Darkwater: because I want to check if input *is* Integer, or String, or whatever
[19:07:26] skyjumper: jhass: thanks. someone changed my is_a? code to use === and it looked a little like alpha coder marking his territory
[19:07:29] jimmythehat: does anyone know why attr_accessor_with default was depricated? What would be the easiest way to give an attribute a default value?
[19:07:42] Ox0dea: Darkwater: case input.class, then?
[19:07:44] Darkwater: actually realized I'm gonna used Numeric instead of Integer, but still
[19:07:51] jhass: jimmythehat: set it in your initialize method
[19:07:52] Darkwater: isn't Integer.class == Class?
[19:07:59] j_mcnally: has joined #ruby
[19:08:01] toretore: skyjumper: there is no reason for this person to do that
[19:08:08] jamesaxl: has joined #ruby
[19:08:15] skyjumper: toretore: no technical reason, anyway
[19:08:24] Darkwater: I guess I coudl case Integer.name
[19:08:29] jimmythehat: why was it deprecated? seems nice
[19:08:38] Darkwater: yeah that works
[19:08:52] jimmythehat: oh its rails anyway
[19:10:00] finisherr: has joined #ruby
[19:11:24] sphex_: has joined #ruby
[19:11:39] superflat: has joined #ruby
[19:11:59] sarkyniin: has joined #ruby
[19:12:02] nathanstitt: has joined #ruby
[19:12:05] evanjs: has joined #ruby
[19:13:30] Scroff: has joined #ruby
[19:15:45] mjuszczak: has joined #ruby
[19:16:41] maletor_: has joined #ruby
[19:17:12] shivam_v: has joined #ruby
[19:17:29] Torrieri: has joined #ruby
[19:17:29] Torrieri: has joined #ruby
[19:17:32] jackjackdripper: has joined #ruby
[19:18:01] shivam_v: hello people ! i am a newbie to rails.Any good book for a better understanding of rails ?
[19:18:45] jhass: ?rails shivam_v
[19:18:45] ruboto: shivam_v, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[19:20:33] ndrei: has joined #ruby
[19:20:34] Kully3xf_: has joined #ruby
[19:21:04] thiago733: has joined #ruby
[19:21:29] senayar: has joined #ruby
[19:21:29] senayar: has joined #ruby
[19:21:54] davedev24_: has joined #ruby
[19:22:48] revath: has joined #ruby
[19:22:53] kirun: has joined #ruby
[19:24:04] alexherbo2: has joined #ruby
[19:24:24] serivich: has joined #ruby
[19:27:42] momomomomo: has joined #ruby
[19:27:56] baweaver: has joined #ruby
[19:28:42] hotpancakes: has joined #ruby
[19:29:03] j_mcnally: has joined #ruby
[19:31:07] NeverDie: has joined #ruby
[19:31:22] djbkd: has joined #ruby
[19:31:41] revath: has joined #ruby
[19:32:19] Rollabunna: has joined #ruby
[19:33:16] momomomomo: has joined #ruby
[19:34:40] jroith: has joined #ruby
[19:35:39] superflat: has left #ruby: ()
[19:35:42] DoubleMalt: has joined #ruby
[19:36:26] chipotle: has joined #ruby
[19:37:30] Musashi007: has joined #ruby
[19:37:31] Kully3xf: has joined #ruby
[19:42:17] pdoherty: has joined #ruby
[19:42:27] icebourg: has joined #ruby
[19:43:20] zata: has joined #ruby
[19:43:23] znn: has joined #ruby
[19:43:23] zata: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[19:43:27] zata: has joined #ruby
[19:43:33] znn: i am considering switching to ruby from js, and i've been depending on this module hashing my passwords: https://github.com/ncb000gt/node.bcrypt.js/
[19:43:41] lxsameer: has joined #ruby
[19:43:56] znn: how can i make the switch cleanly and check passwords that have been hashed with this module?
[19:43:59] dagda1_: has joined #ruby
[19:45:32] jhass: znn: https://rubygems.org/search?utf8=%E2%9C%93&query=bcrypt
[19:46:32] znn: jhass: i figured there was a bcrypt gem
[19:46:34] Ox0dea: znn: node.bcrypt.js and bcrypt-ruby both use the OpenBSD implementation under the hood, so your hashes *should* remain valid.
[19:46:49] znn: i don't have a solid undertanding of exactly how bcrypt works, i just know it comes recommended
[19:47:12] bougyman: it's super easy to use.
[19:47:39] fabrice31: has joined #ruby
[19:48:10] startupality: has joined #ruby
[19:50:47] T3: has joined #ruby
[19:52:55] hotpancakes: has joined #ruby
[19:54:11] atomical: has joined #ruby
[19:54:12] icebourg: has joined #ruby
[19:54:45] shevy: you can do it!
[19:54:54] Antiarc: any valid bcrypt implementation should be able to validate a bcrypt hash
[19:54:59] Antiarc: And they will almost all use openssl :)
[19:55:37] Limix: has joined #ruby
[19:55:49] chrisdpeters: has joined #ruby
[19:56:47] silkfox: has joined #ruby
[19:56:54] znn: Antiarc: that's really good to know
[19:57:09] dc: has joined #ruby
[19:57:18] JMoir: has joined #ruby
[19:57:54] blackmes1: has joined #ruby
[19:58:16] Antiarc: bcrypt hashes are the form ${version}${rounds}${salt}{checksum}, so you always have all the information in the hash necessary to validate an input string against that hash
[19:58:21] Antiarc: (since the rounds and salt are included)
[19:58:52] ytti: i still want library which allows me to specify two hsahes and it'll give me xor of the hashes
[19:59:03] monod: has joined #ruby
[19:59:10] ytti: just insurance against given hash being inherently broken
[19:59:13] ytti: or implementation issues or sometihng
[19:59:31] djbkd: has joined #ruby
[19:59:31] ytti: so even in worst case, i have plenty of time to change the combo
[19:59:59] bronson: has joined #ruby
[20:00:26] Senjai: znn: bcrypt comes recommended because it's a non reversable algorithm, which is perfect for passwords
[20:00:27] pengin: has joined #ruby
[20:00:40] Senjai: And it's fairly secure
[20:00:41] bungoman: has joined #ruby
[20:00:56] JMoir: Hello, probably a stupid question, I'm new to ruby (and sadly testing too!), but how would I test a form that created an entry in a database? I'm testing with Test::Unit and using Sinatra.
[20:01:10] nofxx: has joined #ruby
[20:01:11] Senjai: JMoir: ?code
[20:01:15] Senjai: ?code JMoir
[20:01:16] ruboto: JMoir, We can't help you without your code, please post it to https://gist.github.com
[20:01:18] Antiarc: ytti: I'm not quite sure what you mean there; you can xor two strings pretty trivially though?
[20:01:18] dudedudeman: JMoir: are you like... me? because i'm sitting here working on the same thing
[20:01:20] Senjai: Bleh, this vs helpa
[20:02:02] JMoir: I dont have code for this yet, I don't know what to put, that's the problem. I've looked in all the docs I can and searched high and low but I can't find a method of testing for database additions
[20:02:04] shadoi: has joined #ruby
[20:02:08] ytti: Antiarc, usuually differnet algos give ifferent otput length
[20:02:18] mujou: has joined #ruby
[20:02:22] quimrstorres: has joined #ruby
[20:02:22] ytti: Antiarc, it's probably ont hard, but with crypto, i'd really want someone clued to do it
[20:02:23] Antiarc: JMoir: The way I think about it is - how would you test it manually?
[20:02:24] JMoir: hah, really dudedudeman?
[20:02:29] dudedudeman: JMoir: here's an example of how i'm testing some of my sinatra stuff right now
[20:02:29] dudedudeman: https://gist.github.com/anonymous/97695895483174a84b8d
[20:02:32] Senjai: JMoir: Write it first, then ask us. Gotta make an attempt for us to help you. A form is a concept that can mean many things
[20:02:41] ytti: 23:00 < Senjai> znn: bcrypt comes recommended because it's a non reversable algorithm, which is perfect for passwords
[20:02:44] ytti: as opppoesd to?
[20:02:46] dudedudeman: no forms in that though, so it might not be helpful
[20:03:15] Antiarc: ytti: Yeah, they give different lengths, but I don't quite understand the goal. What would xoring two hashes together accomplish for you, other than producing a third non-trivially-reversible string?
[20:03:42] ytti: Antiarc, if one of the hashes i ssomehow broken, i don't have hurry to fix my software/platform
[20:03:42] Antiarc: (or producing 0 if the strings are equal, but you can just test string equality in that case)
[20:03:44] Senjai: ytti: Any kind of weak algorithm that allows you to unencrypt a string to get the original value
[20:03:46] xkef_: has joined #ruby
[20:03:48] multi_io: has joined #ruby
[20:03:51] ytti: Antiarc, i'm insuring against broken hash
[20:03:52] JMoir: Antiarc: well if I were to manually test it, I'd take a look in the database and see if it was there... Ah I have an idea, I was heading at it from the wrong direction
[20:04:12] Antiarc: ytti: So basically just OTP-encrypting your hash?
[20:04:14] ytti: Senjai, i think there is some kind of misunderstanding here
[20:04:20] nathanstitt: has joined #ruby
[20:04:21] Senjai: ytti: possibly
[20:04:22] peter_paule: has joined #ruby
[20:04:29] ytti: Senjai, being reversible and being hash does not mean weak and strong
[20:04:32] Antiarc: That's how I generally think about testing - "how would I do this manually?", and then translate that into code
[20:04:35] ytti: Senjai, all hashes are irreversible
[20:04:41] toretore: Senjai: bcrypt is recommended over other hashing algorithms because it takes a longer time to run
[20:04:43] Senjai: Yes, by definition.
[20:04:52] ytti: Senjai, but that does not mean they are 'stronger' than reversible
[20:04:56] ytti: it's just totally different use-case
[20:05:25] shevy: irreversible is such a strong word
[20:05:27] JMoir: Cheers Antiarc xD Sometimes it helps to have someone phrase the problem in a different way to realise how blind you are, haha
[20:05:43] ytti: Antiarc, otp-encryptiong your hash sounds contrieved, i just want xor of two hashes, to buy insurance :)
[20:05:50] ytti: shevy, i disagree
[20:05:54] dudedudeman: i'd also like to pose a question. I am running the follow test code, and I get a nomethoderror on line 66, where it tells me i have an undefined methods 'destroy!' for nilclass. What the bleep am i missing ? https://gist.github.com/anonymous/97695895483174a84b8d
[20:06:05] Antiarc: JMoir: I find the best way to solve a problem is to ask a question in a public forum and then look foolish when asking the qeustion reveals the answer :D
[20:06:11] shevy: ytti finnish is such a strong language!
[20:06:17] howdoicomputer: has joined #ruby
[20:06:18] Senjai: dudedudeman: Todo.last is returning nil
[20:06:22] ytti: shevy, if you take arbitrary amount of data and turn it to fixed size of data
[20:06:29] Senjai: dudedudeman: @todo.save may have failed
[20:06:30] Ox0dea: shevy: If I tell you I did some arithmetic and arrived at the number 3, could you tell me what I did to get there?
[20:06:31] Antiarc: ytti: xor'ing one string with another string is effectively just a one-time pad encryption
[20:06:32] ytti: shevy, it's very safe to say it's irreversible
[20:06:37] shevy: i-r-r-e-v-e-r-s-i-b-l-e
[20:06:43] Antiarc: (just make sure your crypttext length matches your plaintext length)
[20:07:02] shevy: Ox0dea if you mean by code then I am unable to decipher your extremely advanced brainfuck code sorry
[20:07:21] shevy: the _,(_,_,((_,(foo,_)),_)) monad
[20:07:21] ytti: shevy, aah, sorry, i'm slow
[20:07:31] Senjai: Ox0dea: I could tell you -a- solution :P
[20:07:36] ytti: i blame the the rose
[20:07:42] shevy: the the the rose!
[20:07:50] ytti: Antiarc, that is entirely reasonable way to look at it
[20:07:56] JMoir: Antiarc: Very true, unfortunately! haha
[20:07:59] momomomomo_: has joined #ruby
[20:08:09] ytti: Antiarc, bottom line is, i wantsies such library, written by people who understand something about crypto, which i a not
[20:08:10] shevy: dudedudeman oops you asked a question... I missed that. lemme see...
[20:08:16] dudedudeman: ok, well that makes sense. i Put a @todo = Todo.new in that mehtod, and it passes no issues. But, I have an entire setup method in the beginning of my test class that defines @todo. Shouldn't that mean that it shouldn't return nil?
[20:08:31] ytti: Antiarc, to me it seems so obviously right way to store your user passwords, why take risk, when insurance costs ~nothing
[20:08:37] Senjai: ytti: Todo.last hits the database...
[20:08:42] Senjai: sorry, dudedudeman ^
[20:08:54] fantazo: has joined #ruby
[20:09:30] Scroff: has joined #ruby
[20:09:47] shevy: ok so somewhere in your code, @todo becomes nil dudedudeman
[20:09:49] toretore: dudedudeman: are you using ActiveRecord?
[20:09:58] dudedudeman: toretore: yes. not rails
[20:10:04] toretore: dudedudeman: you should be using save! in your tests
[20:10:09] lkba_: has joined #ruby
[20:10:14] dudedudeman: and not just save
[20:10:24] segfalt: has joined #ruby
[20:10:28] toretore: now it will fail silently
[20:10:39] Antiarc: ytti: Well, what does it get you? Can you rely on your crypttext not being compromised? This sounds a lot like the "pepper" argument, which AFAIK, is not really considered to be all that valuable a defnese defense these days
[20:10:47] toretore: and that's why you're having the problem you are right now
[20:10:56] ytti: Antiarc, lets say i do it for bcrypt and scrypt
[20:10:58] AndChat-43764: has joined #ruby
[20:11:12] ytti: Antiarc, or bcrpyt and pbkdf2
[20:11:26] ytti: Antiarc, if it turns out one of them is inherently broken
[20:11:30] ytti: Antiarc, or my implementation of it
[20:11:32] Antiarc: Oh, I see, you're hashing two different times then combining the hashes
[20:11:34] ytti: Antiarc, i don't have problem
[20:11:46] Scroff: has joined #ruby
[20:11:54] ytti: Antiarc, yes, hash1(secret) xor hash2(secret)
[20:12:00] ytti: (with salts, obviously)
[20:12:22] dudedudeman: I... actually think i found my issue. i was defining @Todo.destroy! and @todo_last = Todo.last twice in my code
[20:12:31] surs: has joined #ruby
[20:12:44] dudedudeman: i removed it from inside my test method, reli9ed on the setup method, and now all tests pass
[20:13:23] toretore: it should be in your test method, not in setup
[20:13:28] dudedudeman: updated suite: https://gist.github.com/anonymous/5eea7f1e6fe91823cde1
[20:13:44] dudedudeman: toretore: why's that? (not arguing, genuinely curious and learning)
[20:13:47] Antiarc: ytti: The argument against that is that you're supposed to set the iterations for your hash function to the maximum level tolerable in your environment (ie, how long your users can wait)
[20:14:02] Antiarc: If your user can wait 2 sec for password verification, then you set bcrypt to take roughly 2 seconds worth of rounds on your current hardware
[20:14:06] dojobo: i'm failing to load nokogiri on a cron job
[20:14:15] Antiarc: If you mix bcrypt + scrypt then you have to dilute each to do 1 second's worth of rounds
[20:14:24] dojobo: i'm using rvm with 2.1 so it should work?
[20:14:39] toretore: dudedudeman: setup is only for setting up what's common for all your test methods
[20:14:43] Antiarc: It is a good idea to protect against catastrophic hash failure, but it comes with a pretty big tradeoff
[20:14:48] toretore: destroying the record isn't
[20:14:51] havenwood: dojobo: https://rvm.io/deployment/cron
[20:15:14] dojobo: thanks havenwood, i did use that
[20:15:31] Antiarc: (If validation speed isn't a substantial concern, then you could certainly have a very strong number of rounds for both hash functions, which would provide excellent insurance)
[20:15:33] havenwood: dojobo: Using wrappers?
[20:16:37] dojobo: yeah, my rvm path seems to be ~/.rvm
[20:16:53] dojobo: (in crontab i'm using the absolute path though, not ~)
[20:17:10] ytti: Antiarc, i don't think that is fair argument
[20:17:11] Antiarc: Plus, if someone knows that you're mixing the two hash functions, and they get your hashes DB, then they can literally parallelize the work necessary to break the hash - 1000 rounds of scrypt can run in one thread, while 1000 rounds of bcrypt can run in another thread, then you mix the two results. This would take half the time of running 2000 rounds of either, assuming roughly equal runtime.
[20:17:28] ytti: Antiarc, if your margin is 50% of cpu time, you're fucked :)
[20:17:41] dojobo: i'm gonna try 2.0 in case there's some funkiness with the 2.1/nokogiri install
[20:17:55] ytti: Antiarc, if they get my DB
[20:17:56] Antiarc: I'm just regurgitating what I've read on the topic, I'm not a cryptologist :)
[20:18:08] centrx: *gurgle*gurgle*gurgle*
[20:18:11] baweaver: has joined #ruby
[20:18:12] christiandsg: has joined #ruby
[20:18:16] shevy: thank you for the audio support centrx
[20:18:31] ytti: Antiarc, they dont even know what the hash is for scrypt or bcrypt
[20:18:34] Renich: has joined #ruby
[20:18:41] dudedudeman: toretore: ah, thank you. ok i cleaned that up and things aren't being slung around everywhere
[20:18:46] ytti: Antiarc, because they'd need to know one of them, to recover the other
[20:18:56] ytti: Antiarc, so before they can even start bruteforcing they have to know one of the
[20:18:57] centrx: https://youtu.be/FWkJ86JqlPA?t=2s
[20:19:29] kobain: has joined #ruby
[20:19:35] Antiarc: Assuming they know the input is scrypt(pw) ^ bcrypt(pw), you don't have to know one or the other - you can compute them in parallel for each attempt
[20:20:16] Antiarc: (And you should never rely on your implementation being secret to ensure security)
[20:20:33] ta: has joined #ruby
[20:20:51] Antiarc: There's also a Huge Freakin Issue with that approach in that you can't progressively upgrade your rounds
[20:20:55] eGGsha: has joined #ruby
[20:21:13] Antiarc: And I'm not even sure how you'd reverse that outside of storing the salts for each adjacent to the PW
[20:21:35] Antiarc: So you'd have to store the salts and rounds for each hash adjacent to the hash itself if you wanted to validate and progressively upgrade
[20:21:35] dudedudeman: ACTION raises the roof
[20:21:52] ytti: Antiarc, you raise rounds by asking customer to change password
[20:22:09] ytti: the margin of hash should be like 'oh it takes age of universe now'
[20:22:22] ytti: not '50% more cpu and we're dead'
[20:22:35] ytti: i'm not worried of brute force attacks
[20:22:37] centrx: The universe is a figment of your imagination
[20:22:39] kobain: has joined #ruby
[20:22:44] ytti: i'm worried implementation or algo being inherently broken
[20:23:05] Frem: has joined #ruby
[20:23:10] ytti: i'll gladly make brute force 2x easier (i don't agree it does) to gain insurance for broken algo
[20:23:57] s2013: has joined #ruby
[20:24:00] leonardoajim: has joined #ruby
[20:25:50] djbkd: has joined #ruby
[20:26:58] MagePsycho: has joined #ruby
[20:27:14] Antiarc: ytti: You can't validate the PW if you don't know how many rounds were used to crypt the hash, and xoring destroys that information unless you store it adjacent
[20:28:43] Rodya_: has joined #ruby
[20:29:00] ytti: Antiarc, don't worr yabout that
[20:29:02] jaycee: has joined #ruby
[20:29:08] ytti: Antiarc, you'll add the meta information in the headers
[20:29:32] ytti: Antiarc, $version$salt1$salt2$xor_result
[20:29:39] ytti: from version you know your implementaiton
[20:29:46] ytti: which algos, whihc algo parameters etc
[20:33:55] blackmes1: has joined #ruby
[20:34:24] evanjs: has joined #ruby
[20:35:15] jenrzzz: has joined #ruby
[20:37:04] drewo: has joined #ruby
[20:37:17] sharpmachine: has joined #ruby
[20:37:47] chipotle: has joined #ruby
[20:38:00] Ox0dea: Has it been mathematically verified that salt is the best condiment for hashes?
[20:38:06] Limix: has joined #ruby
[20:38:20] Rodya_: has joined #ruby
[20:38:28] Matadoer: has joined #ruby
[20:38:31] eggoez: has joined #ruby
[20:38:44] yfeldblum: has joined #ruby
[20:39:01] momomomomo_: has joined #ruby
[20:39:29] jonathanwallace: has joined #ruby
[20:39:39] jhass: no, that's trivial
[20:40:20] CorySimmons: has joined #ruby
[20:40:39] mjuszczak: has joined #ruby
[20:40:57] gix: has joined #ruby
[20:41:41] Ox0dea: Is it? Some cursory research into the matter seems to indicate that cryptologists haven't even tried most of the other options.
[20:44:21] jhass: they haven't because it's trivial
[20:44:53] mary5030: has joined #ruby
[20:45:06] mleung: has joined #ruby
[20:45:30] qhartman: has joined #ruby
[20:46:43] mary5030: has joined #ruby
[20:47:14] benlieb: has joined #ruby
[20:47:29] ItSAN____: has joined #ruby
[20:49:01] pothibo: has joined #ruby
[20:51:54] workmad3: has joined #ruby
[20:51:55] startupality: has joined #ruby
[20:51:59] blackmes1: has joined #ruby
[20:52:42] Hanmac: has joined #ruby
[20:53:13] senayar: has joined #ruby
[20:53:28] hotpancakes: has joined #ruby
[20:56:38] sharpmachine: has joined #ruby
[20:57:58] towski_: has joined #ruby
[21:00:01] shevy: it's trivial because they haven't!
[21:00:12] JakFrist: has joined #ruby
[21:00:24] hotpancakes: has joined #ruby
[21:01:18] Exuma: has joined #ruby
[21:01:28] [Butch]: has joined #ruby
[21:01:32] Rollabun_: has joined #ruby
[21:02:04] ndrei: has joined #ruby
[21:03:34] djbkd: has joined #ruby
[21:04:00] j_mcnally: has joined #ruby
[21:05:39] x1337807x: has joined #ruby
[21:06:10] fmcgeough: has joined #ruby
[21:08:18] benlieb: has joined #ruby
[21:09:19] znn: has joined #ruby
[21:09:47] d10n-work: has joined #ruby
[21:09:51] silkfox: has joined #ruby
[21:10:16] Nahra: has joined #ruby
[21:10:33] mjuszczak: has joined #ruby
[21:10:36] mase-chatter: has joined #ruby
[21:12:16] luckyno7: has joined #ruby
[21:14:33] phutchins2: has joined #ruby
[21:14:49] aaeron: has joined #ruby
[21:14:58] Zai00: has joined #ruby
[21:15:00] dagda1: has joined #ruby
[21:15:06] mando: has joined #ruby
[21:15:15] dh64: has joined #ruby
[21:17:06] bungoman: has joined #ruby
[21:17:37] OffTheRails: has joined #ruby
[21:18:34] blackmesa: has joined #ruby
[21:20:37] xkef: has joined #ruby
[21:21:45] olistik: has joined #ruby
[21:22:12] FernandoBasso: has joined #ruby
[21:23:36] christiandsg: has joined #ruby
[21:24:27] beef-wellington: has joined #ruby
[21:26:39] bungoman: has joined #ruby
[21:27:37] blackmes1: has joined #ruby
[21:31:04] shevy: today is sleepy day
[21:31:11] jonathanwallace: has joined #ruby
[21:31:40] willywos: has joined #ruby
[21:32:32] bruno-: has joined #ruby
[21:33:36] surs1: has joined #ruby
[21:34:09] allcentury: has joined #ruby
[21:34:34] shevy: hmm .index() finds when the match is 100%
[21:35:02] shevy: but is there a way to have it find the index for the most-likely match candidate? for instance, if an array has one entry called 'foobar', and my search term would be 'oba'
[21:35:06] shevy: (in an Array)
[21:35:39] shevy: >> array = ['abc','def','foobar']; array.index 'oba'
[21:35:40] ruboto: shevy # => nil (https://eval.in/396434)
[21:37:03] nb_bez___: has joined #ruby
[21:37:07] Ox0dea: >> %w[foo bar foobar].index { |x| x[/oba/] }
[21:37:08] ruboto: Ox0dea # => 2 (https://eval.in/396435)
[21:39:07] chipotle: has joined #ruby
[21:39:21] arashb: has joined #ruby
[21:40:07] davedev24_: has joined #ruby
[21:42:00] bungoman: has joined #ruby
[21:42:21] shevy: ah so a regex match
[21:46:53] ta: has joined #ruby
[21:48:14] fabrice31: has joined #ruby
[21:48:39] olistik: has joined #ruby
[21:48:54] Papierkorb: has joined #ruby
[21:50:18] charliesome: has joined #ruby
[21:50:39] davedev24_: has joined #ruby
[21:52:30] Azure: has joined #ruby
[21:53:07] tomphp: has joined #ruby
[21:56:04] nathanstitt: has joined #ruby
[21:56:54] axl_: has joined #ruby
[21:58:47] Channel6: has joined #ruby
[22:00:29] kadoppe: has joined #ruby
[22:00:36] hotpancakes: has joined #ruby
[22:00:52] leonardoajim: has joined #ruby
[22:01:04] aaeron: has joined #ruby
[22:01:31] decoponio: has joined #ruby
[22:01:41] swgillespie: has joined #ruby
[22:01:47] jordanm: has joined #ruby
[22:01:57] surs2: has joined #ruby
[22:02:22] loc22: has joined #ruby
[22:02:44] olistik: has joined #ruby
[22:03:21] bubbys: has joined #ruby
[22:03:50] aaeron: has joined #ruby
[22:03:52] charliesome: has joined #ruby
[22:04:11] Scripore: has joined #ruby
[22:05:13] Rodya_: has joined #ruby
[22:06:02] neanderslob: has joined #ruby
[22:06:08] edwinvdgraaf: has joined #ruby
[22:06:08] Pupeno: has joined #ruby
[22:06:50] infinitone: has joined #ruby
[22:07:21] ivanf: has joined #ruby
[22:08:16] ivanskie: has joined #ruby
[22:09:17] momomomomo_: has joined #ruby
[22:10:36] ex0ns: Hi ! Is there any equivalent to the struct.pack function of Python in ruby ?
[22:11:05] jbw_: has joined #ruby
[22:11:06] ex0ns: struct.pack('Q', 0x0406cd) -> '\xcd\x06\x04\x00\x00\x00\x00\x00'
[22:11:25] adaedra: Array#pack?
[22:11:29] dfockler: ahhh the old pack function
[22:11:40] adaedra: `Array#pack`? (Let's remove ambiguity)
[22:12:03] adaedra: >> [ 0x0406cd ].pack 'Q'
[22:12:04] ruboto: adaedra # => "\xCD\x06\x04\x00\x00\x00\x00\x00" (https://eval.in/396436)
[22:12:24] ex0ns: Thank wyou
[22:12:32] adaedra: wyou're welcome
[22:12:34] Scroff: has joined #ruby
[22:12:45] ex0ns: It's quite strange to use an array to wrap a FixNum
[22:12:52] ex0ns: to "pack" it
[22:13:47] adaedra: because you can pack multiple things
[22:13:56] Ox0dea: And more often do.
[22:14:05] MagePsycho: has joined #ruby
[22:14:15] dfockler: it seems a little weird to only pack one thing
[22:14:16] surs3: has joined #ruby
[22:14:33] adaedra: >> [ 0xdeadbeef, 0x1337cafe, 0xadaeda ].pack('QQQ')
[22:14:34] ruboto: adaedra # => "\xEF\xBE\xAD\xDE\x00\x00\x00\x00\xFE\xCA7\x13\x00\x00\x00\x00\xDA\xAE\xAD\x00\x00\x00\x00\x00" (https://eval.in/396437)
[22:14:44] Ox0dea: adaedra: Q*?
[22:15:06] adaedra: Ox0dea: I know pack from name, tbh, never really used it :)
[22:15:27] yxhuvud: ACTION have to look up the arguments every single time
[22:15:50] Ox0dea: Some of them have pretty good mnemonic correlation.
[22:16:32] adaedra: Q is a 32-bit int, no?
[22:16:35] ex0ns: adaedra: oh I see, I think I understand the purpose of this function then (and its name too)
[22:16:48] ex0ns: native endian
[22:17:24] Ox0dea: ex0ns: String#unpack is the complementary function, for reference.
[22:17:36] casadei_: has joined #ruby
[22:17:41] JakFrist: has joined #ruby
[22:18:07] adaedra: hihi, remembers me this function that converted things in little endian from native by calling htons then swapping bytes.
[22:18:48] ex0ns: Ox0dea: useful indeed, thanks
[22:18:53] ex0ns: adaedra: in C ?
[22:19:08] adaedra: or C++, maybe, same thing at this level.
[22:19:10] ex0ns: All of these network stuff
[22:19:27] adaedra: I rarely go down to this level in Ruby
[22:19:29] ex0ns: adaedra: I do not make any difference between the two :)
[22:19:39] j_mcnally: has joined #ruby
[22:19:59] ex0ns: Probably because I have never written useful stuff in C++
[22:20:11] shevy: who has anyway
[22:20:22] bodgix_wrk: has joined #ruby
[22:20:29] adaedra: A lot of people, shevy
[22:20:37] ex0ns: Ox0dea: I hope they will move to Rust
[22:20:43] ex0ns: Game Engine
[22:20:47] ex0ns: Browser Engine
[22:21:08] Ox0dea: ex0ns: I suspect they're not writing Servo for nothing. :)
[22:21:11] ex0ns: but it's very specific imo
[22:21:35] adaedra: ex0ns: they're doing that, it's servo iirc
[22:21:44] SCHAAP137: has joined #ruby
[22:21:44] ex0ns: Ox0dea: I am waiting for it :)
[22:21:59] ex0ns: And for an Rust implementation of OpenSSL
[22:22:09] adaedra: I should go back to doing rust, but I don't know what to write with it :/
[22:22:25] havenwood: has joined #ruby
[22:22:31] ex0ns: I have started writing some real basic program with it few days ago
[22:22:32] LJT: has joined #ruby
[22:22:43] ex0ns: But I don't have a project to go any further
[22:23:11] dfockler: adaedra: I have the same problem!
[22:23:20] ex0ns: But I quite love it, even if I still have trouble with this ownership and borrowing stuff
[22:23:46] adaedra: Ah yes I found it the other day
[22:23:47] dfockler: I started working on an interpreted language
[22:23:55] adaedra: I wanted to rewrite some basic unix utils
[22:24:09] ex0ns: But it's really amazing to be able to write functionnal programming with low level language
[22:24:10] dfockler: adaedra: You should do them threaded
[22:24:22] shevy: adaedra in which language?
[22:24:24] adaedra: dfockler: baby steps
[22:24:29] adaedra: shevy: rust
[22:24:30] ivanf: has left #ruby: ()
[22:25:02] adaedra: dfockler: but I have a sudoku solver, maybe I could thread that when I'll be more advanced
[22:25:03] jimmythehat: can the block come first in a method's argument list? e.g. def meth &block, arg1, arg2
[22:25:15] adaedra: try and see?
[22:25:16] anisha: has joined #ruby
[22:25:18] tsou: has joined #ruby
[22:25:23] ytti: adaedra, write throughput, packetlosss, jitter, latency tester
[22:25:27] ytti: i want usable one
[22:25:38] dfockler: that's pretty hard
[22:25:47] adaedra: what are you talking about, ytti
[22:25:48] dfockler: probably why it doesn't exist
[22:25:49] shevy: jimmythehat don't think so
[22:25:54] shevy: jimmythehat the & is special
[22:25:57] ytti: adaedra, you wanted rust project
[22:26:06] ytti: dfockler, main reason is, you can't use kernel udp calls
[22:26:13] ytti: dfockler, performance is terribad
[22:26:24] ytti: https://github.com/libpnet/libpnet might help with it
[22:26:30] adaedra: yeah, maybe a bit too much advanced yet, not even sure I could do that in C :p
[22:26:38] giuseppesolinas: has joined #ruby
[22:26:43] ytti: even in c it'll be terribad if you try to just open udp socket
[22:26:48] ytti: and read/write there
[22:26:56] ytti: you must pretty much bypass the OS
[22:27:25] dfockler: That's why Wireshark is one of the few, it's pretty tough to get to that point
[22:28:02] ytti: wireshark is for completley other case use than what ineed
[22:28:09] ytti: ineed program, which i start in two ends
[22:28:14] ytti: and it'll tell throughput between them
[22:28:18] ytti: packet loss, jitter and lantecy
[22:28:26] ytti: kinda like iperf or thrulay
[22:28:30] ytti: but one which actually works
[22:29:10] bodgix_wrk: has left #ruby: ()
[22:29:49] davedev24_: has joined #ruby
[22:30:05] ex0ns: Sounds to be an advanced topic
[22:30:15] ChanServ: -b FrankD_!*@*
[22:30:30] omegahm: has joined #ruby
[22:32:28] mjuszczak: has joined #ruby
[22:32:46] adaedra: there will surely be a latencyctl tool to cover that in systemd soon.
[22:33:00] zacstewart: has joined #ruby
[22:33:20] jhass: adaedra: write cinch for rust ;P
[22:34:12] brain_shim: has joined #ruby
[22:34:37] Pupeno: has joined #ruby
[22:34:37] Pupeno: has joined #ruby
[22:35:58] Scripore: has joined #ruby
[22:39:51] MagePsycho: has joined #ruby
[22:40:36] chipotle: has joined #ruby
[22:44:38] davedev24: has joined #ruby
[22:49:24] mary5030: has joined #ruby
[22:50:08] OffTheRails: has joined #ruby
[22:51:35] freerobby1: has joined #ruby
[22:51:58] T3: has joined #ruby
[22:52:28] Thomas-0725: has joined #ruby
[22:52:34] luckyno7: has joined #ruby
[22:52:38] fgo: has joined #ruby
[22:53:33] hotpancakes: has joined #ruby
[22:53:42] Thomas-0725: Hello! When using .reduce on an array that contains arrays as elements, is it necessary to use .flatten first? For example: [1, 2, 3, [4, 3, 2] ].flatten.reduce(:*)
[22:53:46] Azure: has joined #ruby
[22:53:47] Thomas-0725: Do I need to flatten?
[22:54:05] sphex: has joined #ruby
[22:54:12] armyriad: has joined #ruby
[22:54:12] PlasmaStar: has joined #ruby
[22:54:15] bankair: has joined #ruby
[22:54:35] rikai: has joined #ruby
[22:54:54] brandon: has joined #ruby
[22:55:03] LiquidInsect: has joined #ruby
[22:55:03] sumark: has joined #ruby
[22:55:04] shaman42: has joined #ruby
[22:55:06] sts_: has joined #ruby
[22:55:17] senayar: has joined #ruby
[22:55:17] senayar: has joined #ruby
[22:55:38] jhass: it always depend on your usecase, but in this case you'd want to, yeah
[22:55:49] TTilus: has joined #ruby
[22:55:50] jenrzzz: has joined #ruby
[22:55:58] sdothum: has joined #ruby
[22:55:59] _5moufl: has joined #ruby
[22:56:00] s00pcan: has joined #ruby
[22:57:06] zata: has joined #ruby
[22:57:21] Trynemjoel: has joined #ruby
[22:57:22] chridal: has joined #ruby
[22:57:26] C0deMaver1ck: has joined #ruby
[22:57:29] lele: has joined #ruby
[22:57:38] ItSANgo: has joined #ruby
[22:57:59] hfp_work: has joined #ruby
[22:58:03] mduk: has joined #ruby
[23:00:41] arooni-mobile: has joined #ruby
[23:00:46] peter_paule: has joined #ruby
[23:00:46] ada2358: has joined #ruby
[23:01:07] arooni-mobile: has joined #ruby
[23:02:17] ItSANgo__: has joined #ruby
[23:02:43] tsvenson: has joined #ruby
[23:04:16] dgutierrez1287: has joined #ruby
[23:05:42] [Keith]: has joined #ruby
[23:06:06] pengin: has joined #ruby
[23:06:23] _blizzy_: has joined #ruby
[23:08:16] nofxx: Anyone using couchrest ? Can't find where pass some parameters to rest-client. ssl_cert_key or ssl_verify
[23:11:37] Thomas-0725: thank you jhass
[23:12:26] bungoman_: has joined #ruby
[23:13:18] NeverDie: has joined #ruby
[23:13:20] Scroff: has joined #ruby
[23:13:27] dseitz: has joined #ruby
[23:13:42] lkba: has joined #ruby
[23:15:30] joelataylor: has joined #ruby
[23:17:24] randiman: has joined #ruby
[23:17:50] juanpablo_: has joined #ruby
[23:19:48] surs4: has joined #ruby
[23:20:04] Torrieri: has joined #ruby
[23:20:04] Torrieri: has joined #ruby
[23:20:40] Pupeno: has joined #ruby
[23:21:52] Pupeno: has joined #ruby
[23:21:52] Pupeno: has joined #ruby
[23:24:11] allcentury: has joined #ruby
[23:26:59] zenspider: has joined #ruby
[23:33:44] [Keith]: has joined #ruby
[23:34:03] hotpancakes: has joined #ruby
[23:35:10] kies^: has joined #ruby
[23:35:24] bubbys: has joined #ruby
[23:37:33] JakFrist: has joined #ruby
[23:38:33] Pupeno: has joined #ruby
[23:40:04] atomical_: has joined #ruby
[23:41:52] chipotle: has joined #ruby
[23:44:51] stantonnet: has joined #ruby
[23:44:58] simplyianm: has joined #ruby
[23:45:43] tkuchiki: has joined #ruby
[23:46:08] s2013: has joined #ruby
[23:47:48] x1337807x: has joined #ruby
[23:48:55] senayar: has joined #ruby
[23:49:04] fabrice31: has joined #ruby
[23:49:58] Crazy_Atheist: has joined #ruby
[23:53:25] Rodya_: has joined #ruby
[23:54:06] quimrstorres: has joined #ruby
[23:54:50] chipotle: has joined #ruby
[23:56:19] zenspider: locked myself out of my own server... good job!
[23:57:13] ZeeNoodleyGamer: has joined #ruby
[23:57:16] eggoez: has joined #ruby
[23:57:32] bricker: root/hunter2
[23:57:56] Limix: has joined #ruby