« Back to channel list

#ruby - 08 December 2015

« Back 1 day Forward 1 day »
[00:00:23] rgrmatt: has joined #ruby
[00:00:36] IrishGringo: has joined #ruby
[00:02:51] rgrmatt: has joined #ruby
[00:03:04] weemsledeux: has joined #ruby
[00:06:21] kobain: has joined #ruby
[00:07:23] ascarter: has joined #ruby
[00:07:35] linduxed: has joined #ruby
[00:08:40] atomical: has joined #ruby
[00:09:18] Paradox: has joined #ruby
[00:10:22] n_blownapart: has joined #ruby
[00:11:53] ascarter: has joined #ruby
[00:11:57] underplank: has joined #ruby
[00:12:25] CloCkWeRX: has left #ruby: ()
[00:15:15] elcontrastador: has joined #ruby
[00:16:00] chouhoulis: has joined #ruby
[00:16:59] lemur: has joined #ruby
[00:17:03] underplank: has joined #ruby
[00:17:56] EasyCo: has joined #ruby
[00:20:41] fullofcaffeine: has joined #ruby
[00:23:53] cmoneylulz: has joined #ruby
[00:26:31] peterhil`: has joined #ruby
[00:29:15] devbug: has joined #ruby
[00:30:20] kam270: has joined #ruby
[00:31:43] diegoviola: has joined #ruby
[00:32:10] devoldmx: has joined #ruby
[00:32:30] linduxed: has joined #ruby
[00:33:33] belak: has left #ruby: ("WeeChat 1.3")
[00:34:00] ur5us: has joined #ruby
[00:35:12] baweaver: has joined #ruby
[00:36:08] kobain: has joined #ruby
[00:36:21] DukeDave: has joined #ruby
[00:36:31] underplank: has joined #ruby
[00:37:22] solocshaw: has joined #ruby
[00:37:47] peterhil`: has joined #ruby
[00:38:07] jhill: has joined #ruby
[00:39:04] mroth: has joined #ruby
[00:39:05] kobain: has joined #ruby
[00:39:46] ascarter: has joined #ruby
[00:40:44] Hoosier_Daddy: has joined #ruby
[00:40:49] freerobby: has joined #ruby
[00:41:18] grilled-cheese: has joined #ruby
[00:41:26] kobain: has joined #ruby
[00:41:30] elliottcable: has joined #ruby
[00:41:34] acadavid: has joined #ruby
[00:41:44] Hoosier_Daddy: I need penises!
[00:41:54] jpinnix______: has joined #ruby
[00:41:59] ckrailo: has joined #ruby
[00:42:06] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/giver.jpg
[00:42:09] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/hello.jpg
[00:42:18] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/giver.jpg
[00:42:21] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/hello.jpg
[00:42:30] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/giver.jpg
[00:42:31] mg^: I've been using IRC for literally decades
[00:42:33] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/hello.jpg
[00:42:42] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/giver.jpg
[00:42:45] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/hello.jpg
[00:42:51] mg^: and there is always a new set of losers who can't find better entertainment than what this guy is doing. How sad.
[00:42:54] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/giver.jpg
[00:42:55] bahar: has joined #ruby
[00:42:57] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/hello.jpg
[00:43:06] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/giver.jpg
[00:43:09] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/hello.jpg
[00:43:14] atomical_: has joined #ruby
[00:43:16] ruboto: fflush, apeiros, banisterfiend, seanstickle, Mon_Ouie, zzak, Radar, Havenn, jhass, sevenseacat, miah, workmad3, Coraline, drbrain, zenspider, rubyhacker1, slyphon, Aria, ljarvis, baweaver, Adaedra
[00:43:18] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/giver.jpg
[00:43:21] Hoosier_Daddy: http://synflood.at/mirrors/goatse.cx/hello.jpg
[00:43:21] ruboto: +q Hoosier_Daddy!*@*
[00:43:22] ruboto: -o ruboto
[00:43:27] akahn: has joined #ruby
[00:44:41] mozzarella: why would he destroy his anus this way? disgusting
[00:44:47] mozzarella: and why did I click
[00:44:54] jhass: and why are you talking aboout it
[00:45:18] JDiPierro: has joined #ruby
[00:45:32] jmhmccr: has joined #ruby
[00:45:44] mozzarella: we can't just pretend it didn't happen
[00:47:05] glowcoil: has joined #ruby
[00:47:11] eam: that would be cultural erasure
[00:47:40] knowtheory: has joined #ruby
[00:48:01] ChanServ: +b Hoosier_Daddy!*@*
[00:48:01] ChanServ: ChanServ kicked Hoosier_Daddy: is banned from this channel
[00:48:13] underplank: has joined #ruby
[00:49:04] vcoinminer_: has joined #ruby
[00:49:13] ruboto: -q Hoosier_Daddy!*@*
[00:49:13] ruboto: -o ruboto
[00:50:52] kallisti5: has joined #ruby
[00:52:31] christiandsg: has joined #ruby
[00:52:58] moei: has joined #ruby
[00:53:42] Radar: #ruby is now moderated. Please identify with Nickserv to speak.
[00:54:04] eam: I can't identify with nickserv, we just don't have anything in common
[00:55:50] baweaver: there we go
[00:56:00] ascarter: has joined #ruby
[00:56:09] dfockler: has joined #ruby
[00:56:19] baweaver: has left #ruby: ()
[00:56:21] baweaver: has joined #ruby
[00:57:16] baweaver: has joined #ruby
[00:57:19] jhonglim: has joined #ruby
[00:57:48] jetpackjoe: has joined #ruby
[00:58:07] underplank: has joined #ruby
[00:58:13] kobain: has joined #ruby
[00:58:22] RobertBirnie: has joined #ruby
[00:58:27] dlitvak: has joined #ruby
[00:58:37] mg^: OK should be identified now
[00:59:19] boxrick1: has joined #ruby
[00:59:36] davedev24: has joined #ruby
[01:00:15] DLSteve: has joined #ruby
[01:02:48] bubbys: intersting, how many people clicked on link
[01:04:36] jhass: please do not talk about it, any attention they get is too much
[01:04:53] arturmoczulski: has joined #ruby
[01:05:02] arturmoczulski: has left #ruby: ()
[01:06:36] cantaberry: has joined #ruby
[01:06:36] sucks: has joined #ruby
[01:07:39] jabreity__: has joined #ruby
[01:08:47] underplank: has joined #ruby
[01:11:26] aibot: has joined #ruby
[01:13:35] gusrub: has joined #ruby
[01:13:54] ap4y: has joined #ruby
[01:14:04] kobain: has joined #ruby
[01:14:51] lacuna: has joined #ruby
[01:14:51] lacuna: has joined #ruby
[01:16:22] ramfjord_: has joined #ruby
[01:17:07] chouhoulis: has joined #ruby
[01:17:53] jhonglim: has joined #ruby
[01:18:12] diego1: has joined #ruby
[01:18:13] diego1: has joined #ruby
[01:18:52] maloik: has joined #ruby
[01:19:04] ap4y: has joined #ruby
[01:20:02] Spami: has joined #ruby
[01:20:14] blackmesa: has joined #ruby
[01:20:29] hackeron: has joined #ruby
[01:20:58] dlitvak: has joined #ruby
[01:21:29] lucyinthesky: has joined #ruby
[01:21:39] lucyinthesky: has left #ruby: ("Leaving")
[01:21:41] svoop: has joined #ruby
[01:26:47] wsewolod: has joined #ruby
[01:27:24] _stu_: has joined #ruby
[01:29:47] djbkd_: has joined #ruby
[01:30:40] danzilio: has joined #ruby
[01:35:14] RegulationD: has joined #ruby
[01:36:35] supermar_: has joined #ruby
[01:36:36] andersh: has joined #ruby
[01:37:40] rgrmatt: has joined #ruby
[01:38:58] Yzguy: has joined #ruby
[01:41:10] jpfuentes2: has joined #ruby
[01:41:26] rgrmatt: has joined #ruby
[01:42:16] hadees: has joined #ruby
[01:43:10] ruby-lang937: has joined #ruby
[01:43:30] jbrhbr: has joined #ruby
[01:43:41] zarubin: has joined #ruby
[01:44:02] TomPeed: has joined #ruby
[01:45:14] rgrmatt: has joined #ruby
[01:48:46] tejasmanohar: has joined #ruby
[01:49:08] favadi: has joined #ruby
[01:49:24] freerobby: has joined #ruby
[01:50:45] sucks: has joined #ruby
[01:52:13] htmldrum: has joined #ruby
[01:54:12] Arnvald: has joined #ruby
[01:54:40] thedusal: has joined #ruby
[01:57:12] hackeron: has joined #ruby
[01:57:34] christiandsg: has joined #ruby
[02:01:25] freedrull: is .gemtest an old thing https://github.com/vcr/vcr/blob/master/.gemtest
[02:01:33] freedrull: gem-testers.org :\
[02:04:46] freerobby: has joined #ruby
[02:06:39] underplank: has joined #ruby
[02:07:09] radgeRayden: has joined #ruby
[02:07:44] christiandsg: has joined #ruby
[02:07:49] sarkis: has joined #ruby
[02:09:08] rgrmatt: has joined #ruby
[02:09:35] sam_d: has joined #ruby
[02:10:12] maloik: has joined #ruby
[02:10:13] duncannz: has joined #ruby
[02:10:31] diegoviola: https://gist.github.com/3a93d3ecc90394e08c0e
[02:10:40] diegoviola: is there a better way to do this, don't think I like that unless there
[02:10:50] diegoviola: but one of them is giving me nil so it fails
[02:11:29] maneco: has joined #ruby
[02:13:58] denom: has joined #ruby
[02:14:40] supermarin: has joined #ruby
[02:14:54] denom: I have a shim for the "make" command in rbenv that keeps reappearing, I'm stumped as to which gem it's coming from and how to get rid of it.
[02:15:32] rgrmatt: has joined #ruby
[02:16:00] denom: every time I run bundle, it reappears! And then all my builds fail with `rbenv: make: command not found`, any ideas?
[02:16:06] diegoviola: any ideas please?
[02:17:23] rgrmatt: has joined #ruby
[02:17:47] baweaver: has joined #ruby
[02:17:52] chouhoulis: has joined #ruby
[02:18:53] Spami: has joined #ruby
[02:20:22] grzegorz: has joined #ruby
[02:20:24] jimmybomb1: has joined #ruby
[02:20:55] jhass: anyone got a gem that basically provides AS::HWIA without having to depend on activesupport?
[02:21:03] RobertBirnie: has joined #ruby
[02:21:11] Rodya_: has joined #ruby
[02:21:52] lacuna: has joined #ruby
[02:22:10] grzegorz: has joined #ruby
[02:22:26] Arnvald: has joined #ruby
[02:22:55] rsc___: has joined #ruby
[02:23:10] blackmesa: has joined #ruby
[02:23:32] jimmybomb: has joined #ruby
[02:24:16] radgeRayden_: has joined #ruby
[02:24:25] howdoicomputer: has joined #ruby
[02:24:36] RobertBirnie: has joined #ruby
[02:26:21] kaka_: has left #ruby: ()
[02:26:29] Yzguy: diegoviola the unless repeats itself
[02:26:58] diegoviola: Yzguy: I just changed it to unless !sedex.nil?
[02:27:16] diegoviola: Yzguy: still not sure I want that
[02:28:13] rgrmatt: has joined #ruby
[02:29:27] diegoviola: I wonder if I should give neovim a try, anyone tried it?
[02:29:33] ScottNYC: has joined #ruby
[02:30:48] Moosashi: has joined #ruby
[02:31:07] supermarin: has joined #ruby
[02:31:30] weemsledeux: has joined #ruby
[02:31:31] dlitvak: has joined #ruby
[02:32:05] cdg: has joined #ruby
[02:33:00] devoldmx: has joined #ruby
[02:33:53] sulky: has joined #ruby
[02:35:25] dlitvak: has joined #ruby
[02:37:10] RegulationD: has joined #ruby
[02:37:20] supermarin: has joined #ruby
[02:38:09] Yzguy: https://gist.github.com/yzguy/39d5b437c9a25014a89c
[02:38:30] Yzguy: maybe valid? I'm new to all the crazy consolidation stuff you can do with ruby
[02:38:42] Yzguy: forgot the other " on Verde
[02:38:50] denom: oh man, the recipe 'rbenv-binstubs' was binstubbing the 'make' command. that seems really strange..
[02:39:50] Yzguy: @diegoviola ^^
[02:40:06] Azure: has joined #ruby
[02:41:01] Arnvald_: has joined #ruby
[02:42:04] gusrub: has joined #ruby
[02:42:09] pwnd_nsfw: has joined #ruby
[02:42:46] diegoviola: Yzguy: that just gives me false back
[02:43:22] spt0: has joined #ruby
[02:43:38] zarubin: has joined #ruby
[02:43:58] Yzguy: i might have mssed up the !.nill thing
[02:44:08] Yzguy: i've used a guard clause like twice before
[02:44:24] bronson: has joined #ruby
[02:44:52] Yzguy: yeah take out the !
[02:45:16] nbdy: has joined #ruby
[02:45:19] avahey: has joined #ruby
[02:46:49] Arnvald: has joined #ruby
[02:47:49] diegoviola: Yzguy: that won't work either
[02:47:56] diegoviola: undefined method
[02:47:56] spuk: has joined #ruby
[02:48:08] diegoviola: Yzguy: I'll just use a if else block
[02:49:17] ur5us: has joined #ruby
[02:50:06] PaulCapestany: has joined #ruby
[02:51:18] Azure: has joined #ruby
[02:52:35] Yzguy: ok, it shoulda worked though.
[02:52:50] yfeldblum: has joined #ruby
[02:52:50] Rubie: has joined #ruby
[02:53:05] Rubie: hi all: im getting unexpected behavior in the little script im writing, could someone take a look https://repl.it/B6ky
[02:53:38] devbug: has joined #ruby
[02:54:08] diegoviola: Yzguy: maybe it's because I'm calling that helper method from my view so it has nothing to return to?
[02:54:09] jimmybomb1: has joined #ruby
[02:54:21] patdohere: has joined #ruby
[02:57:45] Yzguy: rubie i'm taking a look
[02:58:02] diegoviola: yeah the return doesn't work there
[03:00:49] Rubie: Yzguy: thanks
[03:03:01] sarkis: has joined #ruby
[03:04:23] fullofcaffeine: has joined #ruby
[03:05:44] Yzguy: rubie its happening on line 14
[03:05:54] Yzguy: so somewhere in the function
[03:06:29] Rubie: well i mutate it on line 24
[03:06:33] Rubie: using #unshift
[03:06:58] Rubie: but once it finishes the loop i would expect the value of test_word to be reset to word
[03:07:07] Rubie: since we never mutate word
[03:07:42] skweek: has joined #ruby
[03:09:01] Yzguy: the shift is what is causing that h to go away
[03:09:07] Yzguy: im still trying to understand why
[03:09:26] uberjar: has joined #ruby
[03:10:14] maneco: has left #ruby: ("WeeChat 1.3")
[03:10:52] Moosashi: has joined #ruby
[03:11:17] uberjar: Hi. For some reason after a fresh install issuing the following command just hangs for me.. what could be the problem ? gem install bundler
[03:11:28] jessemcgilallen: has joined #ruby
[03:11:32] Radar: uberjar: how did you do the install?
[03:11:40] fullofca_: has joined #ruby
[03:11:56] baweaver: has joined #ruby
[03:12:18] uberjar: Radar: well for some reason, you know how it it can be.. this just started working all of a sudden
[03:12:25] Radar: uberjar: Yup.
[03:12:35] uberjar: so how about I just come back if it happens again??? maybe some kind of odd network glitch
[03:12:42] maloik: has joined #ruby
[03:14:44] tahon: has joined #ruby
[03:16:01] dlitvak: has joined #ruby
[03:17:54] Moosashi: has joined #ruby
[03:18:15] nerium: Is there a way to list all classes in a folder?
[03:18:35] TyroneBlack: has joined #ruby
[03:18:35] chouhoulis: has joined #ruby
[03:18:51] TyroneBlack: has left #ruby: ()
[03:19:46] jgpawletko: has joined #ruby
[03:21:50] diego1: has joined #ruby
[03:22:03] diego1: has joined #ruby
[03:22:19] lacuna: has joined #ruby
[03:22:52] Radar: nerium: no
[03:22:54] howdoicomputer: has joined #ruby
[03:22:59] ruboto: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[03:23:14] TomPeed: has joined #ruby
[03:23:56] blackmesa: has joined #ruby
[03:26:28] sucks: has joined #ruby
[03:26:47] cjbottaro: has joined #ruby
[03:27:31] triangles: has joined #ruby
[03:32:28] nerium: @Radar I need to access and call all classes that exists in a folder
[03:32:54] nerium: I guess I can load all classes, that???s simple and then just look at all existing classes in that scope
[03:33:24] jhass: we should just make a bot that we can point at some one and it will reply with why? the next five times they say something
[03:34:13] brendan-: has joined #ruby
[03:35:14] nerium: jhass: Are you refering to me?
[03:37:53] nerium: I???ll try to explain it a bit better then.
[03:37:54] nerium: I???m building something similuar to homebrew where each class represents a lib, like ???ps???. I need to call each class in the lib folder as each lib/class encapsulates its own tests
[03:38:43] sucks: has joined #ruby
[03:39:04] nerium: That???s why I need to list all classes in a folder
[03:40:16] Moosashi: has joined #ruby
[03:42:06] devbug: has joined #ruby
[03:43:58] Yzguy: rubie word is definitely getting changed
[03:44:32] Yzguy: not sure yet, but I'm doing some crazy "puts word = #{word}" everywhere
[03:44:44] Yzguy: and it has different values during the loop
[03:44:57] Radar: nerium: example code please kthx
[03:45:00] Yzguy: but nothing is directly touching the "word" variable
[03:45:06] Yzguy: blowing my mind
[03:45:09] Rubie: unless test_word is being passed by reference
[03:45:29] Rubie: like test_word is just a reference to word
[03:45:34] nerium: @Radar https://github.com/Homebrew/homebrew/blob/master/Library/Formula/a52dec.rb
[03:45:36] baweaver: nerium: why not just do something sane like use YML/JSON for packages and make a parser
[03:45:50] Radar: ACTION opens mouth to sigh, gives up entirely on everything
[03:45:59] nerium: baweaver: What do you mean?
[03:46:02] baweaver: he meant your code
[03:46:06] baweaver: not homecrew
[03:46:23] Radar: p.s. Forumla probably defines an inherited callback
[03:46:51] tonko: has joined #ruby
[03:46:57] Radar: This is the whole "Radar is being silent on this because there is no actual code and he doesn't want to look like an idiot suggesting a fix for a non-issue"
[03:47:26] nerium: @Radar What did you expect? I not sure what code I could post that would be relevant
[03:49:11] nerium: Radar: I went with this http://stackoverflow.com/questions/833125/find-classes-available-in-a-module
[03:49:28] Radar: "Please help me with my code issue" "Please show us some code" "I don't know what code to show"
[03:49:30] maloik: has joined #ruby
[03:49:35] Radar: So you don't understand your issue fully, then?
[03:49:52] Radar: I am literally exhausted by this roundabout dance that happens with code every day
[03:50:58] Yzguy: rubie when i = 1, right after testing = check_word(test_word, i)
[03:50:59] Radar: https://gist.github.com/radar/bcfecba3970ac640b46b
[03:51:01] nerium: I do. I just need to list all classes in a folder. That would solve my problem.
[03:51:04] Radar: I guess something like that MIGHT womrk.
[03:51:16] Yzguy: is when "word" changes to "ello"
[03:51:25] ap4y: has joined #ruby
[03:51:35] nerium: Radar: Aha, that would be even better
[03:51:54] Rubie: Yzguy: so it happens in the helper method?
[03:52:14] Yzguy: yeah something happening in that and returning is changing word
[03:52:14] Rubie: Yzguy: maybe something to do with #shift
[03:52:16] bronson: has joined #ruby
[03:52:20] Yzguy: yeah I'm thinking so
[03:52:24] Radar: nerium: I missed the subclasses method, but it works for me.
[03:52:35] Yzguy: its just super weird because no where does "word" explicity get reassigned
[03:52:43] Radar: nerium: Anything that inherits from that Formula class will be available in subclasses, and then you'll have access to each of those subclasses that way.
[03:52:45] nerium: Radar: I think I can use that. Thanks
[03:52:53] claw: has joined #ruby
[03:55:03] Yzguy: rubie yeah when rearrange gets assigned the second time its ["h"], then word is ["e","l","l","o"]
[03:55:05] Rubie: Yzguy: maybe once we are in the while loop and test_word is assigned to word, ruby will not reach out of the while loop scope to reassign word. It will just re assign test_word to whatever test_word was in the previous iteration of the while loop
[03:55:41] Yzguy: well check_word doesn't know anything about "word", its out of scope
[03:56:16] Rubie: but word follows test_word around
[03:57:09] Rubie: Yzguy: just a guess
[03:59:11] Rubie: Yzguy: if you change test_word = word to test_word = word1.split("") it works
[03:59:19] Rubie: lol not sure why
[04:00:57] Yzguy: i feel like it's some a = b, b = c, so a = c type thing
[04:04:00] Yzguy: i'm stumped haha
[04:04:29] Rubie: can anyone help explain us this strange behavior https://repl.it/B6ky
[04:05:06] maloik: has joined #ruby
[04:05:13] Yzguy: ^^ when i = 1, right after line 14, "word" changes from "hello" to "ello"
[04:05:25] claw: has joined #ruby
[04:05:31] Yzguy: but no where is "word" actually reassigned
[04:06:00] cwong_on_irc: has joined #ruby
[04:06:01] durstburger: has joined #ruby
[04:06:49] krzkrzkrz: has joined #ruby
[04:07:57] ap4y: has joined #ruby
[04:10:02] colegatron: has joined #ruby
[04:10:33] puria: has joined #ruby
[04:11:03] baweaver: >> a = 'hello'; b = 'llohe'; a.chars.sort == b.chars.sort
[04:11:04] ruboto: baweaver # => true (https://eval.in/481938)
[04:11:09] baweaver: overcomplicating things
[04:11:49] braincrash: has joined #ruby
[04:12:31] Rubie: baweaver: right, but were just trying to figure out whats going on
[04:12:46] Yzguy: rubie its the test_word.shift(i)
[04:13:17] Rubie: i think its the assignment test_word = word
[04:14:00] Rubie: so the second loop around test_word = test_word
[04:15:17] supermarin: has joined #ruby
[04:15:53] Yzguy: second loop, when it hits rearrange = test_word.shift(1), rearrange gets the ["h"], but at the same time test_word changes to "ello"
[04:16:10] Yzguy: not sure how to reassigns back up to word, still don't understand that part
[04:16:19] baweaver: shift mutates things
[04:16:43] baweaver: >> a = 'string'; a.shift; a
[04:16:44] ruboto: baweaver # => undefined method `shift' for "string":String (NoMethodError) ...check link for more (https://eval.in/481939)
[04:16:49] blub: variables are names for objects, but they aren't the object itself
[04:17:01] blub: test_word = word makes both names point to the same object
[04:17:06] blub: so mutating one of them mutates the other
[04:17:08] ap4y: has joined #ruby
[04:17:13] blub: ie with a method like shift
[04:17:36] Yzguy: that makes sense
[04:17:53] code: has joined #ruby
[04:17:55] blub: but then if after you said test_word = 'foo', word would still be whatever it was
[04:17:57] zast: has joined #ruby
[04:18:05] blub: because you would just be making the name test_word point to the object 'foo' instead
[04:18:20] Moosashi: has joined #ruby
[04:19:01] TheHackOps: has joined #ruby
[04:19:01] underplank: has joined #ruby
[04:19:07] Yzguy: oh and doing like test_word = word1.split("") points test_word to a new array object
[04:19:24] chouhoulis: has joined #ruby
[04:19:29] Yzguy: very interesting
[04:21:14] Rubie: so why wouldn't test_word = (test_word + rearrange).join("") not work
[04:21:24] Rubie: in #check_word
[04:25:19] blackmesa: has joined #ruby
[04:25:24] blub: i dont see that
[04:26:16] devoldmx: has joined #ruby
[04:34:34] gix: has joined #ruby
[04:35:38] sucks: has joined #ruby
[04:36:07] symbol: has joined #ruby
[04:40:01] mtmcfarl: has joined #ruby
[04:43:08] jimmybomb2: has joined #ruby
[04:44:20] lacuna: has joined #ruby
[04:44:20] lacuna: has joined #ruby
[04:45:49] jimmybomb: has joined #ruby
[04:46:58] tahon: has joined #ruby
[04:47:11] Aasha: has joined #ruby
[04:47:39] Rodya_: has joined #ruby
[04:48:05] WizJin: has joined #ruby
[04:49:47] berserk_ren: has joined #ruby
[04:50:45] yfeldblum: has joined #ruby
[04:51:24] tahon: has joined #ruby
[04:52:12] ICantCook: has joined #ruby
[04:54:48] mahk: has joined #ruby
[04:57:31] molay: has joined #ruby
[04:57:40] diegoviola: do you guys use () in your if?
[04:57:53] iateadonut: has joined #ruby
[04:59:12] diegoviola: s/guys/folks/
[04:59:29] molay: why would an array sort give me something like this? https://gist.github.com/holaymolay/24c25d2bde8f41d7fc00#file-gistfile1-txt
[04:59:34] underplank: has joined #ruby
[05:00:39] molay: it doesn't make sense why it would do that
[05:01:31] blub: it looks sorted ?
[05:01:37] gusrub_: has joined #ruby
[05:01:56] molay: yeah.. lol. it is until it isn't.. kinda weird
[05:02:04] ap4y: has joined #ruby
[05:02:04] blub: how did you get it
[05:02:15] Radar: diegoviola: https://github.com/bbatsov/ruby-style-guide#no-parens-if
[05:03:05] diegoviola: yeah this is not python
[05:03:17] molay: blub: its an array of rays... wavlist.sort_by! {|e| e[0]}
[05:03:45] molay: blub: its an array of arrays
[05:04:30] crazydiamond: has joined #ruby
[05:04:42] molay: diegoviola: its better than python. At least it was for me
[05:04:45] djbkd: has joined #ruby
[05:05:31] maloik: has joined #ruby
[05:05:40] molay: diegoviola: There were programming concepts that totally eluded me in python... but with ruby they make total sense
[05:06:15] kfrz: has joined #ruby
[05:06:37] molay: diegoviola: don't get me wrong, I had a blast with python... but is so much more comprehendable
[05:06:59] molay: diegoviola: but ruby is so much more comprehendable
[05:10:04] darkf: has joined #ruby
[05:12:17] havenwood: molay: There are folk in the #ruby channel... :P
[05:12:51] molay: havenwood: lol. hard to know that if nobody responds
[05:13:04] WizJin: has joined #ruby
[05:15:54] NotTheFBI: has joined #ruby
[05:16:07] underplank: has joined #ruby
[05:16:15] molay: oh forget it
[05:16:20] Bloomer: has joined #ruby
[05:16:28] havenwood: molay: It's not sorted.
[05:16:46] havenwood: molay: Have a gist of the code that created the Array?
[05:17:20] rsc___: has joined #ruby
[05:19:16] molay: havenwood: nevermind. i figured out why...
[05:19:26] havenwood: molay: Aha. :)
[05:19:32] molay: havenwood: the cause... pure stupidity
[05:19:37] havenwood: molay: Figured it was the first 145 sorted with more sorted appended.
[05:19:54] molay: havenwood: yes that's exactly what it was
[05:20:05] chouhoulis: has joined #ruby
[05:20:50] molay: havenwood: thanks for the push in the right direction!
[05:21:44] codecop: has joined #ruby
[05:22:37] diego1: has joined #ruby
[05:22:45] diego1: has joined #ruby
[05:24:49] rsc___: has joined #ruby
[05:26:43] blackmesa: has joined #ruby
[05:28:25] ayonkhan: has joined #ruby
[05:30:28] gusTester: has joined #ruby
[05:32:23] DavidDudson: has joined #ruby
[05:32:42] lubarch: has joined #ruby
[05:32:58] diego1: has joined #ruby
[05:33:02] tejasmanohar: is there anything like lib2git for homebrew? https://github.com/Homebrew/homebrew
[05:33:19] diego1: has joined #ruby
[05:33:42] tejasmanohar: like a way to programmatically interact with homebrew (on the user's system) without just executing `brew ...` commands and parsing their output with pattern matching?
[05:33:43] kfrz: has joined #ruby
[05:33:53] tejasmanohar: i see it is a ruby project but dont see a gem or anything i can plug into
[05:33:55] bb010g: has joined #ruby
[05:34:48] cubicme: has joined #ruby
[05:35:54] underplank: has joined #ruby
[05:36:54] lubarch: has joined #ruby
[05:38:31] hahuang65: has joined #ruby
[05:39:11] moeSeth: has joined #ruby
[05:40:26] cryocaustik: has joined #ruby
[05:46:14] diego1: has joined #ruby
[05:46:30] Dimik: has joined #ruby
[05:47:10] diego1: has joined #ruby
[05:49:52] devoldmx: has joined #ruby
[05:50:08] cwong_on_irc: has joined #ruby
[05:50:24] bronson: has joined #ruby
[05:54:16] phillips1012: has joined #ruby
[05:57:09] supermarin: has joined #ruby
[05:57:24] favadi: has joined #ruby
[06:00:35] Rubie: has joined #ruby
[06:01:19] tildes: has joined #ruby
[06:01:41] Arnvald: has joined #ruby
[06:01:46] cubicme: hi, is there any reason that calling a lot of IO.popen {} should cause memory/resource leak? I???m caliing tiny script in my server process, and after a while it???s consuming all of the memory and I get ???Cannot allocate memory???
[06:03:44] Arnvald_: has joined #ruby
[06:05:44] S01780: has joined #ruby
[06:06:44] rakm: has joined #ruby
[06:06:51] jud^: has joined #ruby
[06:07:06] skade: has joined #ruby
[06:08:36] sarkis: has joined #ruby
[06:15:01] Arnvald: has joined #ruby
[06:15:55] sapslaj: has joined #ruby
[06:16:07] supermarin: has joined #ruby
[06:16:34] bubbys: has joined #ruby
[06:17:59] last_staff: has joined #ruby
[06:18:20] otherj: has joined #ruby
[06:18:47] sarkis: has joined #ruby
[06:19:14] rattatmatt: has joined #ruby
[06:19:41] tahon: has joined #ruby
[06:20:53] chouhoulis: has joined #ruby
[06:21:48] tahon: has joined #ruby
[06:22:40] FatKuntz: has joined #ruby
[06:23:01] FatKuntz: has left #ruby: ()
[06:23:39] leat: has joined #ruby
[06:24:58] mahk: has joined #ruby
[06:26:38] George|Orwell: has joined #ruby
[06:26:58] George|Orwell: has left #ruby: ()
[06:28:05] blackmesa: has joined #ruby
[06:28:51] sarkis: has joined #ruby
[06:31:00] jud: has joined #ruby
[06:35:39] yfeldblum: has joined #ruby
[06:36:38] yfeldblum: has joined #ruby
[06:36:43] duckpuppy: has joined #ruby
[06:39:12] sarkis: has joined #ruby
[06:40:32] bronson: has joined #ruby
[06:44:39] yardenbar: has joined #ruby
[06:45:21] ur5us: has joined #ruby
[06:45:23] Moosashi: has joined #ruby
[06:45:34] Oog: has joined #ruby
[06:45:44] RegulationD: has joined #ruby
[06:46:59] dionysus69: has joined #ruby
[06:49:09] sarkis: has joined #ruby
[06:49:47] maloik: has joined #ruby
[06:51:50] dionysus69: has joined #ruby
[06:52:17] trautwein: has joined #ruby
[06:52:51] tagrudev: has joined #ruby
[06:54:47] moeabdol: has joined #ruby
[07:00:04] sarkis: has joined #ruby
[07:00:54] ramfjord: has joined #ruby
[07:01:19] diegoviola: has joined #ruby
[07:02:31] lacuna: has joined #ruby
[07:02:31] Arnvald: has joined #ruby
[07:03:09] lacuna: has joined #ruby
[07:03:09] lacuna: has joined #ruby
[07:03:34] lxsameer: has joined #ruby
[07:03:34] lxsameer: has joined #ruby
[07:06:05] bubbys: has joined #ruby
[07:08:48] sandstrom: has joined #ruby
[07:08:54] ur5us: has joined #ruby
[07:10:14] ohaibbq: has joined #ruby
[07:11:19] cornerman: has joined #ruby
[07:11:57] tesuji: has joined #ruby
[07:12:47] sarkis: has joined #ruby
[07:17:08] tahon: has joined #ruby
[07:19:08] Jet4Fire: has joined #ruby
[07:20:18] naftilos76: has joined #ruby
[07:20:45] B1n4r10: has joined #ruby
[07:21:41] chouhoulis: has joined #ruby
[07:21:57] anisha: has joined #ruby
[07:24:01] jbrhbr: has joined #ruby
[07:24:42] Emmanuel_Chanel: has joined #ruby
[07:25:41] maloik: has joined #ruby
[07:26:18] devoldmx: has joined #ruby
[07:28:00] roshanavand: has joined #ruby
[07:29:28] blackmesa: has joined #ruby
[07:30:34] roshanavand: has joined #ruby
[07:34:41] sarkis: has joined #ruby
[07:35:24] svoop: has joined #ruby
[07:35:44] djbkd: has joined #ruby
[07:35:54] aganov: has joined #ruby
[07:37:45] andikr: has joined #ruby
[07:38:42] lxsameer: has joined #ruby
[07:40:15] ta: has joined #ruby
[07:40:37] nhhagen: has joined #ruby
[07:41:06] CrazyEddy: has joined #ruby
[07:41:26] Emmanuel_Chanel: has joined #ruby
[07:42:23] ur5us: has joined #ruby
[07:43:15] atomical: has joined #ruby
[07:45:58] duckpuppy: has joined #ruby
[07:46:58] jas02: has joined #ruby
[07:48:18] mahk: has joined #ruby
[07:50:11] SolarSailor: has joined #ruby
[07:52:47] karapetyan: has joined #ruby
[07:54:23] InvGhost: has joined #ruby
[07:58:32] googleAPIsucks: has joined #ruby
[08:00:40] tjad: has joined #ruby
[08:01:23] therealcode: has joined #ruby
[08:01:24] yfeldblum: has joined #ruby
[08:01:47] yfeldblum: has joined #ruby
[08:01:47] S01780: Morning. I'm trying to install a github program using RoR and bundler. Upon running install bundle in the file, it says "error, cannot find pg_conf," which is from the PostgreSQL install.
[08:02:03] S01780: I installed PostGre using sudo, would that mess up the path?
[08:02:54] jgt2: has joined #ruby
[08:03:29] rsc___: has joined #ruby
[08:04:26] Muon: has joined #ruby
[08:04:40] rsc___: has joined #ruby
[08:07:03] Muon: hi, is anyone familiar with the google drive API here?
[08:07:24] Muon: I'm having some trouble discerning the difference between oauth2 creds and implementing service accounts
[08:08:38] Muon: main issue is that I can only refresh oauth once an hour and only 5 times a day, and i get auth errors if it refreshes after an hour which is inevitable
[08:08:58] Glenny: has joined #ruby
[08:09:04] maloik: has joined #ruby
[08:12:09] edwinvdgraaf: has joined #ruby
[08:12:19] norc_: has joined #ruby
[08:12:39] symm-: has joined #ruby
[08:13:30] shredding: has joined #ruby
[08:15:29] kmckelvin: has joined #ruby
[08:16:21] aufi: has joined #ruby
[08:17:18] SCHAAP137: has joined #ruby
[08:17:58] TomyWork: has joined #ruby
[08:19:31] amincd: has joined #ruby
[08:20:31] JiYu: has left #ruby: ()
[08:20:38] brunto: has joined #ruby
[08:20:53] amincd: Hi, if I assign the value of str to str2, then modify str2 with sub!(pattern, replacement), why does the value of str also change?
[08:22:27] chouhoulis: has joined #ruby
[08:23:53] ta: has joined #ruby
[08:23:56] gusrub: has joined #ruby
[08:24:05] lkba: has joined #ruby
[08:24:24] sulky: has joined #ruby
[08:24:28] Musashi007: has joined #ruby
[08:24:37] DavidDudson: has joined #ruby
[08:25:33] sandstrom: has joined #ruby
[08:31:01] blackmesa: has joined #ruby
[08:37:36] sarkis: has joined #ruby
[08:42:28] amincd: ok, so ruby is pass-by-reference
[08:43:16] peterhil`: has joined #ruby
[08:43:35] maloik: has joined #ruby
[08:44:51] blackmesa: has joined #ruby
[08:45:51] norc_: amincd: No
[08:46:19] norc_: amincd: Technically Ruby is pass by value only.
[08:46:32] norc_: But that terminology doesn't work well under Ruby due to the way things work.
[08:46:55] Spami: has joined #ruby
[08:47:49] sarkis: has joined #ruby
[08:49:40] norc_: >> def foo(bar) bar = 'a' end; quux = 'b'; foo(quux); p quux
[08:49:41] ruboto: norc_ # => "b" ...check link for more (https://eval.in/482010)
[08:49:47] norc_: ^^ amincd
[08:52:49] Hounddog: has joined #ruby
[08:53:45] zast: has left #ruby: ()
[08:56:09] norc_: >> require 'ostruct'; o = OpenStruct.new; def foo(a) a.foo = 1 end; foo(o); puts o;
[08:56:10] ruboto: norc_ # => #<OpenStruct foo=1> ...check link for more (https://eval.in/482017)
[08:56:28] norc_: Things get more fun now though.
[08:57:09] norc_: The thing is you are passing objects by value.
[08:57:43] norc_: Which means you can directly modify them
[08:57:59] sarkis: has joined #ruby
[08:58:44] duckpupp1: has joined #ruby
[08:59:53] TheHodge: has joined #ruby
[09:00:26] mooe: has joined #ruby
[09:00:30] steffkes: has joined #ruby
[09:01:01] amincd: isn't "passing objects by value" the same as passing by reference?
[09:01:20] amincd: ah nevermind, I don't know the terminology well enough to even comment
[09:01:41] duckpuppy: has joined #ruby
[09:04:51] norc_: amincd: Ruby is pass by value, but the value passed is a reference.
[09:05:03] norc_: Think of it that way.
[09:06:02] amincd: norc_: I see
[09:06:11] skade: has joined #ruby
[09:06:20] amincd: norc_: I don't understand the distinction well enough to fully grok this yet, but that helps
[09:06:28] yfeldblum: has joined #ruby
[09:06:54] norc_: amincd: Pass by reference would be something like void foo(int &bar) {} in c++
[09:07:23] amincd: and pass value as reference?
[09:07:27] norc_: Where as void foo(int *bar) {} is pass by value (but the value is a reference)
[09:07:28] tvw: has joined #ruby
[09:07:43] norc_: Since you are passing a pointer which really is just a memory address.
[09:07:50] norc_: Which is just a value itself.
[09:08:08] sarkis: has joined #ruby
[09:08:44] norc_: amincd: So when you pass an argument to a ruby function it creates a local variable and stores that object in there. If you assign a new object, you are just changing the content of that variable.
[09:08:49] mark4: has joined #ruby
[09:08:57] joonty: has joined #ruby
[09:09:10] norc_: amincd: Try to inspect the whole thing with #object_id - that should make things clearer.
[09:10:45] amincd: so in ruby, assigning var1 to var2, means assigning var1's object id to var2
[09:11:05] amincd: *assigning the value of var
[09:11:08] peterhil`: has joined #ruby
[09:11:10] jgt2: has joined #ruby
[09:11:15] Rumbles: has joined #ruby
[09:11:55] norc_: amincd: In a nutshell, yes. Remember we also have op= though, but that is just a method that happens to look the same.
[09:12:18] norc_: Errr, nevermind that.
[09:12:46] norc_: op[]= I meant. :)
[09:13:13] norc_: or generally assignment operator.
[09:13:53] amincd: ok thanks, I think I get it. I still don't fully understand how a pass-by-reference assignment would be different, in practice, from a pass by reference-of-value assignment which happens in Ruby
[09:14:07] norc_: >> def foo(bar); bar.object_id; end; a = ""; puts "%d %d" % [a.object_id, foo(a)]
[09:14:08] ruboto: norc_ # => 545800120 545800120 ...check link for more (https://eval.in/482021)
[09:14:21] norc_: >> def foo(bar) bar = 'a' end; quux = 'b'; foo(quux); p quux
[09:14:24] norc_: That one.
[09:14:28] norc_: >> def foo(bar) bar = 'a' end; quux = 'b'; foo(quux); p quux
[09:14:29] ruboto: norc_ # => "b" ...check link for more (https://eval.in/482022)
[09:14:50] norc_: If ruby was pass by reference, then the method foo would have changed the content of quux to "a"
[09:14:59] amincd: norc_: yeah I see..
[09:15:06] norc_: Hi adaedra
[09:15:14] adaedra: ruby pass by reference.
[09:15:29] adaedra: well, it pass a reference, if you prefer.
[09:15:38] norc_: ruby passes reference by value. important distinction I think. :P
[09:15:50] norc_: for the case mentioned above
[09:15:56] adaedra: yeah, but still to take in mind. It's not full copy.
[09:16:28] norc_: yup. we covered that a while ago :)
[09:18:13] norc_: amincd: Things get a bit messy once you understand how Ruby shallow copies objects.
[09:18:17] sarkis: has joined #ruby
[09:18:20] norc_: Or rather they become clear again.
[09:18:36] norc_: Will avoid some nasty surprises in the long run too.
[09:18:44] Arnvald: has joined #ruby
[09:21:34] [k-: has joined #ruby
[09:22:39] ramfjord: has joined #ruby
[09:23:10] chouhoulis: has joined #ruby
[09:23:20] DanKnox[away]: has joined #ruby
[09:26:29] DavidDudson: has joined #ruby
[09:26:57] riffraff: has joined #ruby
[09:27:05] devoldmx: has joined #ruby
[09:29:53] marr: has joined #ruby
[09:32:57] rsc___: has joined #ruby
[09:35:47] amincd: thanks for your help norc_
[09:37:15] djbkd: has joined #ruby
[09:37:50] peterhil`: has joined #ruby
[09:38:03] troulouliou_div2: has joined #ruby
[09:38:23] rsc___: has joined #ruby
[09:40:23] mikecmpbll: has joined #ruby
[09:41:12] Cork: anyone know a way to handle exitcode and stderr from Shell.new executions?
[09:45:09] bweston92: has joined #ruby
[09:46:02] joonty: has joined #ruby
[09:47:56] AlexRussia: has joined #ruby
[09:48:38] sarkis: has joined #ruby
[09:51:21] rodfersou: has joined #ruby
[09:52:28] InvGhostt: has joined #ruby
[09:52:30] sami: Hi, I'm trying to write a ruby gem. I have a class within my module for block configuration and trying to use the config, configured in what ever script/rails in another class in the same module. Anyone have any experience in that? Happy to post a couple of examples.
[09:53:04] ljarvis: sami: probably lots of people, do you have a question?
[09:53:08] Averna: has joined #ruby
[09:53:37] sami: Well, can't post examples it seems :(. This is going to be a lot harder. Sitting on a highly resctricted wifi.
[09:53:43] sami: Hmm. Where do I begin :)
[09:54:19] ljarvis: the first problem, perhaps :)
[09:55:24] sami: First of, my minitests works however, I can't access the "newly set" configuration from my other class.
[09:55:43] ljarvis: we're going to struggle without examples here I think
[09:56:03] sami: ljarvis: I'm basically copying this: http://juanitofatas.com/2015/05/19/rubygem-configuration-pattern/
[09:56:19] sami: Ok, let me try to explain without sounding stupid :)
[09:56:39] Junaos: has joined #ruby
[09:56:51] ljarvis: right ok makes sense, that's a common pattern
[09:56:58] sami: I have 2 classes in my gem. MyClass and Configuration. I have a script outside of this gem which I'm trying to use the gem.
[09:57:16] sami: Inside that script I'm trying to set a configuration (from the Configuration class)
[09:57:30] mblagden: has joined #ruby
[09:57:34] miah: has joined #ruby
[09:57:40] alexherbo2: has joined #ruby
[09:57:51] sami: And from MyClass, I'm trying to use that configuration. However, the configuration does not get "forwarded" or set.
[09:57:57] sami: Does that make sense?
[09:58:00] Musashi007: has joined #ruby
[09:58:07] Sou|cutter: has joined #ruby
[09:58:13] ljarvis: I think so yes
[09:58:24] sami: Basically, I want to set a URL from config to use in myclass.
[09:58:37] ljarvis: but I would probably need the code to reproduce it to see where the issue is
[09:58:37] sami: Basically, I want to set a URL _using_ config to use in myclass.
[09:58:48] sarkis: has joined #ruby
[09:58:54] bmn: has joined #ruby
[09:58:55] sami: ljarvis: Yeah I kind of guessed that.. Hmm.
[09:59:30] sami: I can tarball and sent it to you?
[09:59:39] SegFaultAX: has joined #ruby
[10:00:41] ljarvis: ljjarvis+n@gmail.com
[10:00:54] Rodya_: has joined #ruby
[10:01:22] sami: ljarvis: could we do a dcc?
[10:01:50] ljarvis: that wont work on this box i use for irc i'm afraid
[10:01:57] sami: Ah, ok :)
[10:02:10] ljarvis: you dont have any access to any code pasties online?
[10:02:13] sami: Let me try and email it. Is there a "+" in your address?
[10:02:19] sami: ljarvis: Nope :(
[10:02:23] ljarvis: that sucks
[10:02:48] sami: Enterprise networking. hehe...
[10:03:31] ljarvis: you do programming and dont have access to github? :)
[10:03:46] sami: Haha, exactly..
[10:03:56] sami: ljarvis: sent..
[10:04:08] sami: You're welcome to virus scan and what ever you want :)
[10:04:23] ljarvis: the problem is in QRadar?
[10:04:49] sami: No, I have no connection to it yet.
[10:05:17] bronson: has joined #ruby
[10:05:24] sami: I'm testing the gem in QRadarTestGem dir.
[10:05:54] aufi: has joined #ruby
[10:06:26] phillips1012: has joined #ruby
[10:06:44] skweek: has joined #ruby
[10:06:57] sami: Ohh, you mean the class?
[10:07:01] rsc___: has joined #ruby
[10:07:09] sami: Sorry, yes, it in within the QRadar class :)
[10:07:12] sami: Sorry about that.
[10:07:24] ljarvis: right ok, the api_url is being set properly for me
[10:07:39] sami: If you run the test.rb?
[10:08:08] ljarvis: ah hold on im looking in offence now
[10:08:23] tomphp: has joined #ruby
[10:08:42] ljarvis: you're assigning the config values to constants before they're ever changed
[10:08:56] sarkis: has joined #ruby
[10:08:58] skade: has joined #ruby
[10:09:03] ljarvis: you need to use the full QRadar.configuration.xxx every time you use it
[10:09:26] ljarvis: (maybe setup a convenience method: def config; QRadar.configuration; end)
[10:09:55] Moosashi: has joined #ruby
[10:10:16] sami: ljarvis: Thank you!!
[10:12:27] colegatron: has joined #ruby
[10:15:04] roshanavand: has joined #ruby
[10:15:13] huyderman: has joined #ruby
[10:16:20] sami: Now I just need to figure out how to auth with headers in Faraday :)
[10:16:33] peterhil`: has joined #ruby
[10:18:22] ljarvis: your basic_auth call should handle that
[10:19:19] yfeldblum: has joined #ruby
[10:21:10] havenn: has joined #ruby
[10:21:11] havenn: has joined #ruby
[10:21:35] pipework: has joined #ruby
[10:22:05] SOLDIERz: has joined #ruby
[10:22:31] sarkis: has joined #ruby
[10:22:51] rsc___: has joined #ruby
[10:23:05] ajb: has joined #ruby
[10:23:20] rikkipitt: has joined #ruby
[10:23:41] Nilium: has joined #ruby
[10:23:41] greister: has joined #ruby
[10:23:52] toretore: has joined #ruby
[10:23:57] chouhoulis: has joined #ruby
[10:26:53] azgil: has joined #ruby
[10:27:06] ebertx: has joined #ruby
[10:27:29] djbt: has joined #ruby
[10:27:40] rikkipitt: hey guys, what's a good way of accessing "question" name in this json response according to the answer? https://gist.github.com/rikkipitt/0ee61a858db9268a0b3d
[10:27:43] yqt: has joined #ruby
[10:28:05] Moosashi: has joined #ruby
[10:28:06] blackmesa: has joined #ruby
[10:28:23] rikkipitt: It's hard to explain, but is there an easy way to merge these arrays by key/value to easily get the answers question name?
[10:28:35] Peg-leg: has joined #ruby
[10:28:48] mahk: has joined #ruby
[10:30:24] alphaatom: has joined #ruby
[10:30:46] ljarvis: that's not valid json
[10:32:56] sarkis: has joined #ruby
[10:34:00] ldnunes: has joined #ruby
[10:34:42] Moosashi: has joined #ruby
[10:35:38] ljarvis: anyway, something like this would work https://gist.github.com/leejarvis/0cc2762546c36891abb8
[10:35:42] ljarvis: rikkipitt: ^
[10:36:38] [k-: has joined #ruby
[10:36:45] spt0: has joined #ruby
[10:39:18] rikkipitt: thanks ljarvis, that looks good!
[10:39:27] rikkipitt: i'll try and adapt it to work in my case
[10:44:01] norc_: [1,3,6,8] - Given a float f, I want to obtain the number from the array that is the next one in descending order. Is this doable in a compact one liner?
[10:44:43] norc_: (i.e. for 5.5 I want to get 3)
[10:45:04] lubarch: has joined #ruby
[10:45:25] felixal: has joined #ruby
[10:45:35] naftilos76: has joined #ruby
[10:46:14] passerine: has joined #ruby
[10:47:09] RegulationD: has joined #ruby
[10:47:12] norc_: >> def foo(f) [1,3,6,8].sort_by { |e| (f-e).abs }[0..1].sort.first end; f(5.5)
[10:47:13] ruboto: norc_ # => undefined method `f' for main:Object (NoMethodError) ...check link for more (https://eval.in/482084)
[10:47:24] nfk|laptop: has joined #ruby
[10:47:33] norc_: >> def foo(f) [1,3,6,8].sort_by { |e| (f-e).abs }[0..1].sort.first end; foo(5.5)
[10:47:35] ruboto: norc_ # => 3 (https://eval.in/482085)
[10:47:42] norc_: Think that is about as compact as it can get
[10:49:29] linduxed_: has joined #ruby
[10:50:57] platzhirsch: has joined #ruby
[10:54:53] workmad3: has joined #ruby
[10:55:08] joonty: has joined #ruby
[10:56:43] ljarvis: what does the float have to do with it? is the array going to possibly contain floats?
[10:56:49] gregf_: >> [1,3,5,6,8].select{ |v| v < 5.5 }.last
[10:56:51] ruboto: gregf_ # => 5 (https://eval.in/482100)
[10:57:23] norc_: ljarvis: No, but the input is a float. Im just looking for a closest match
[10:57:29] norc_: gregf_: Oh. oh...
[10:57:35] blub: why didnt i think of that
[10:57:50] gregf_: it needs to be sorted tho. kinda a binary search
[10:58:04] norc_: gregf_: Yeah that is fine. The list is presorted already. :)
[10:59:21] mahk_: has joined #ruby
[11:00:39] gregf_: haha, ruby and scala seem to do the same thing at times :|
[11:00:45] gregf_: List(1,4,2,5,6).sorted.filter(x => x < 5.5).last
[11:01:04] Caius: >> [1,3,5,6,8].each_slice(2) { |a, b| break(a) if b >= 5.5 }
[11:01:06] ruboto: Caius # => 5 (https://eval.in/482102)
[11:01:19] arup_r: has joined #ruby
[11:01:30] Caius: Not as short in characters, but saves building an intermediate array
[11:02:08] KrzaQ: I have trouble with this code: http://melpon.org/wandbox/permlink/0KHGzPLh4nIFLaO5 When I uncomment lines 75-77 I'm getting "wrong number of arguments (1 for 0) (ArgumentError)", but the same thing above and below doesn't trigger that warning :(
[11:02:20] c355E3B: has joined #ruby
[11:02:24] Rodya_: has joined #ruby
[11:04:33] shevy: KrzaQ which method do you use
[11:04:36] blackmesa: has joined #ruby
[11:05:02] sarkis: has joined #ruby
[11:07:12] KrzaQ: shevy: I'm not sure what you mean.
[11:07:24] KrzaQ: I add methods to Calc as I read their definitions from stdin
[11:07:35] NET||abuse: has joined #ruby
[11:07:37] puria: has joined #ruby
[11:07:41] KrzaQ: calc.b is very simple, it returns some integer and it seems to work
[11:08:36] shevy: you got the error above but you did not show the full error message
[11:09:14] KrzaQ: http://melpon.org/wandbox/permlink/HJ0dGrjXUdQY5JTT
[11:09:26] KrzaQ: I uncommented lines 75-77
[11:09:28] KrzaQ: no other change at all
[11:09:37] KrzaQ: it was working before, but not now
[11:10:07] FooMunki: has joined #ruby
[11:10:24] drptbl: has joined #ruby
[11:12:25] ramfjord: has joined #ruby
[11:13:05] Ropeney: has joined #ruby
[11:13:13] KrzaQ: prog.rb:75:in `block (2 levels) in <main>': wrong number of arguments (given 1, expected 0) (ArgumentError)
[11:13:24] KrzaQ: I don't see where I gave it an argument it wasn't expecting :|
[11:13:24] mahk: has joined #ruby
[11:13:49] joonty: has joined #ruby
[11:15:14] sarkis: has joined #ruby
[11:15:36] shevy: trust the ruby parser!
[11:15:45] joonty: has joined #ruby
[11:15:55] skade: has joined #ruby
[11:16:06] sepp2k: has joined #ruby
[11:16:15] f4cl3y: has joined #ruby
[11:16:18] KrzaQ: I just don't understand the message
[11:16:38] dionysus69: has joined #ruby
[11:16:41] KrzaQ: I understand the words, but where is this superfluous argument?!
[11:16:42] shevy: >> def foo; end; foo 5
[11:16:43] ruboto: shevy # => wrong number of arguments (1 for 0) (ArgumentError) ...check link for more (https://eval.in/482107)
[11:16:58] shevy: I also don't understand the error message you showed, ruboto showed another error format
[11:17:46] KrzaQ: I do almost exactly the same thing in the case above and below
[11:17:48] KrzaQ: and it works
[11:18:21] shevy: well that is not true
[11:18:27] KrzaQ: I tried emptying the function body, but it still says something about an extra argument
[11:18:34] shevy: self.send($2.downcase, $1, $3)
[11:18:39] shevy: self.send(text)
[11:18:44] shevy: how is this the same thing
[11:18:45] KrzaQ: I commented that out
[11:18:47] KrzaQ: still errors
[11:19:15] KrzaQ: the error is on the "calc.class.send(:define_method, line) do" line
[11:19:32] favadi: has joined #ruby
[11:19:43] atom3: has joined #ruby
[11:20:05] shevy: so this method accepts how many arguments
[11:20:25] colli5ion: has joined #ruby
[11:20:25] rickmasta: has joined #ruby
[11:20:42] KrzaQ: and I'm passing none
[11:20:46] KrzaQ: exactly as above and belo
[11:20:50] KrzaQ: s/belo/below
[11:20:58] shevy: btw do you use a special editor?
[11:21:11] tahon: has joined #ruby
[11:21:13] j416: KrzaQ: I wouldn't be surprised if you've tangled yourself in method redefinition hell; why do you need to define all those methods?
[11:21:20] shevy: I remember one... redcar or some other r* one, modified ruby code before evaluating
[11:21:59] KrzaQ: j416: doing advent of code, decided it would be nice to let ruby do all the work for me and parse the call graph
[11:22:05] KrzaQ: every line is defined only once
[11:22:38] shevy: KrzaQ can you put up a new pastie with the exact code that errors?
[11:22:56] shevy: ideally onto https://gist.github.com/ if you don't mind :D
[11:23:40] j416: KrzaQ: I see. Have fun :)
[11:24:06] ponga: has joined #ruby
[11:24:41] chouhoulis: has joined #ruby
[11:25:23] sarkis: has joined #ruby
[11:26:28] rsc___: has joined #ruby
[11:27:18] rsc___: has joined #ruby
[11:27:46] devoldmx: has joined #ruby
[11:29:49] Ox0dea: has joined #ruby
[11:30:47] shevy: it's his ghost
[11:31:14] shevy: he probably can not speak
[11:32:05] roshanavand: has joined #ruby
[11:32:11] Ox0dea: KrzaQ: Would you like to see my super-hackish "solution" for AoC #7?
[11:33:55] krzkrzkrz: has joined #ruby
[11:34:47] norc_: Ox0dea: https://gist.github.com/anonymous/699ccac1323c5a0eac74
[11:34:59] norc_: Here. Finally RubyVM can be abused completely.
[11:35:07] Ox0dea: Is this what I think it is?
[11:37:48] norc_: Ox0dea: https://eval.in/482114
[11:38:06] Ox0dea: norc_: How to go from ISeq to Proc?
[11:38:30] Ox0dea: Well, s/Proc/a callable/.
[11:38:59] norc_: Ox0dea: Check my eval.in
[11:39:35] djbkd: has joined #ruby
[11:39:39] Ox0dea: norc_: https://eval.in/482115
[11:40:38] KrzaQ: Ox0dea: not before I get my own to work :P
[11:41:03] Ox0dea: KrzaQ: Fair enough.
[11:41:44] stamina: has joined #ruby
[11:42:13] bmalum: has joined #ruby
[11:43:02] norc_: Ox0dea: Looking at the vm code it does not seem possible at this point.
[11:43:18] NotTheFBI: has joined #ruby
[11:43:39] Ox0dea: What a tease.
[11:44:24] Ox0dea: ISeq is general is where Ruby really loses the comparison to other languages. :<
[11:44:34] Ox0dea: *in general
[11:45:01] Ox0dea: I don't know how to fix that. :/
[11:45:34] prestorium: has joined #ruby
[11:45:46] sarkis: has joined #ruby
[11:46:48] puria: has joined #ruby
[11:47:00] ahuman: has joined #ruby
[11:47:06] knight_: has joined #ruby
[11:47:35] joeyjones: has joined #ruby
[11:47:47] adeponte: has joined #ruby
[11:48:27] raenk: has joined #ruby
[11:48:59] perry: has joined #ruby
[11:49:00] perry: has joined #ruby
[11:49:40] KrzaQ: I checked to be 100% sure, all lines (my methods) appear in the input exactly once.
[11:49:44] Mon_Ouie: has joined #ruby
[11:49:54] KrzaQ: and at at least the first glance, my code seems ok
[11:50:20] Ox0dea: KrzaQ: There is another crucial observation to be made.
[11:50:29] bafbomb: has joined #ruby
[11:50:43] brainslug: has joined #ruby
[11:50:45] csmb: has joined #ruby
[11:50:50] rikkipitt: has joined #ruby
[11:50:55] dlitvak: has joined #ruby
[11:51:00] KrzaQ: Ox0dea: what is it?
[11:51:04] Ox0dea: KrzaQ: See any "m" outputs feeding into "c" ones? :P
[11:51:16] Ox0dea: How about "k" into "d"?
[11:51:20] CloCkWeRX: has joined #ruby
[11:51:39] KrzaQ: I didn't look too precisely
[11:51:40] KrzaQ: http://misc.krzaq.cc/temp/graf.png
[11:51:51] KrzaQ: but it seems that a doesn't depend on all the other nodes
[11:52:33] Jet4Fire: has joined #ruby
[11:52:40] KrzaQ: but that doesn't change my current issue
[11:53:07] Ox0dea: That picture isn't loading. What's your issue?
[11:53:35] KrzaQ: it's pretty big (it's the full call graph from AoC, ~6mb I think)
[11:53:41] KrzaQ: Ox0dea: my code doesn't run
[11:54:03] Ox0dea: "Call graph"?
[11:54:33] KrzaQ: gk AND gq -> gs - I view gs as a function of gf and gq
[11:54:39] jhass: -qo $~a jhass
[11:54:47] KrzaQ: where gk is a function of (...) and gq is a function of (...)
[11:54:56] agit0: has joined #ruby
[11:55:58] KrzaQ: I guess dependency graph would be a better name
[11:56:32] Ox0dea: So, what does "doesn't run" even mean?
[11:57:23] Evans: has joined #ruby
[11:59:10] KrzaQ: https://gist.github.com/KrzaQ/c75bb3e9a8bafebc286d - if I uncomment lines 75-77 I get prog.rb:75:in `block (2 levels) in <main>': wrong number of arguments (given 1, expected 0) (ArgumentError)
[11:59:43] KrzaQ: which is weird, because if they're commented, I get the desired result (line b is trivial for my input and is directly a number)
[12:01:31] brunto: has joined #ruby
[12:02:55] snowy: has joined #ruby
[12:03:13] rickmasta: has joined #ruby
[12:03:15] ij: has joined #ruby
[12:03:34] ij: Why does this produce an error "child fd 8 is not redirected"? i, o = IO.pipe; IO.popen(%w{date - -}, :err => [:child, o]) { |p| }
[12:04:24] Rodya_: has joined #ruby
[12:04:49] ixti: has joined #ruby
[12:05:02] gbailey: has joined #ruby
[12:05:22] akem: has joined #ruby
[12:05:24] bronson: has joined #ruby
[12:05:42] solars: has joined #ruby
[12:05:48] M-shine: has joined #ruby
[12:06:52] Ox0dea: KrzaQ: I realize you almost certainly aren't trying to write obfuscated code, but you've managed to do so. :P
[12:07:14] CloCkWeRX: has joined #ruby
[12:07:15] Ox0dea: You're doing this with on-the-fly methods to defer evaluation, right?
[12:07:47] FifthWall: has joined #ruby
[12:08:48] Couch: has joined #ruby
[12:08:54] KrzaQ: yeah, mostly
[12:09:18] keyviewer_210489: has joined #ruby
[12:09:23] Evans: has joined #ruby
[12:09:42] Ox0dea: How do you mean?
[12:09:46] csmb: has joined #ruby
[12:09:54] Ox0dea: What other "advantage" do you perceive?
[12:10:10] joeyjones: has joined #ruby
[12:10:11] joeyjones: has joined #ruby
[12:10:45] favadi: has joined #ruby
[12:11:02] KrzaQ: They'll be truly function calls. I guess that's weak
[12:12:45] shanemcd: has joined #ruby
[12:13:00] KrzaQ: Still, I see no reason for this not to work
[12:13:02] KrzaQ: yet it doesn't
[12:13:08] raenk: has joined #ruby
[12:14:00] InvGhosttt: has joined #ruby
[12:14:38] shevy: foo.rb:32: warning: ARGF#lines is deprecated; use #each_line instead
[12:14:59] shevy: aha, we need 'data.txt' right?
[12:15:34] robert_: has joined #ruby
[12:15:56] passerine: has left #ruby: ("Leaving")
[12:17:06] KrzaQ: shevy: that's why I put it on wandbox, it was a running live example
[12:18:03] KrzaQ: Added data.txt to the gist
[12:19:18] KrzaQ: hm, funny
[12:19:21] KrzaQ: it seems I redefined p
[12:19:24] shevy: does this take a long time
[12:19:28] shevy: or does nothing happen?
[12:19:38] shevy: I invoke the ruby code but it just seems to not do anything
[12:19:39] KrzaQ: <0.1 second to execute/fail
[12:19:45] shevy: save for the "warning: ARGF#lines is deprecated; use #each_line instead"
[12:19:53] myztic: has joined #ruby
[12:19:59] cantaberry: has joined #ruby
[12:20:03] KrzaQ: ah, I modified it to read from stdin for wandbox
[12:20:35] KrzaQ: anyhow, I found the problem
[12:20:43] KrzaQ: maybe I should have used longer method names
[12:20:59] Kruppe: has joined #ruby
[12:21:39] shevy: which method was it? .p() on class Calc?
[12:22:36] allcentury: has joined #ruby
[12:22:40] Ox0dea: That class is perfectly useless, by the way.
[12:22:50] Ox0dea: "Classes as namespaces" is derpy as.
[12:22:58] KrzaQ: shevy: yeah
[12:23:16] KrzaQ: Ox0dea: I'm not a ruby proffessional :P
[12:23:23] KrzaQ: I think you kinda gathered that by now
[12:23:49] Ox0dea: I mean, you clearly know enough Ruby to be dangerous.
[12:23:53] Ox0dea: To yourself and others.
[12:24:08] Ox0dea: Look at this mess you've made for all of us.
[12:25:26] chouhoulis: has joined #ruby
[12:25:33] Ox0dea: KrzaQ: You can use `::Kernel.p` instead of just `p` to invoke the right method.
[12:25:52] Ox0dea: You'll be better able to see what's going wrong.
[12:26:34] dlitvak: has joined #ruby
[12:27:17] KrzaQ: Ox0dea: it's toy code, so I don't have any inhibitions
[12:27:19] ij: Solved my issue, :child was unneccessary.
[12:27:30] Ox0dea: KrzaQ: I'm not sure I follow?
[12:27:49] Ox0dea: Giving one fuck is a fool's errand.
[12:28:15] KrzaQ: it's advent of code, if something looks particularly clever or nice or fun: I'll do it, even if I would scalp myself for it in code review in a real project
[12:28:57] Ox0dea: KrzaQ: And are you having fun?
[12:29:11] Ox0dea: Your code certainly doesn't look nice. Do you reckon it's clever?
[12:29:12] KrzaQ: until this one I had
[12:29:18] Ox0dea: Oh, right.
[12:29:40] Ox0dea: Day 7 was definitely tricksy.
[12:29:57] Ox0dea: And then a dead-simple Day 8. Bah humbug.
[12:30:08] KrzaQ: I'll see how it looks after cleanup anyway
[12:30:17] KrzaQ: I can always redo it in a saner way
[12:30:57] Ox0dea: But zen eet vood not be a toy, ja?
[12:32:00] puria: has joined #ruby
[12:34:07] p0wn3d: has joined #ruby
[12:35:48] ij: eet is a dutch woord for eat
[12:36:21] Ox0dea: I believed you immediately because of the repeated O.
[12:36:27] Ox0dea: So Dutch.
[12:36:43] boxofrox: has joined #ruby
[12:39:19] soulisson: has joined #ruby
[12:40:13] soulisson: Hi, I'm new to unit testing and I have troubles understanding what a unit test is exactly, when writing a TestCase is each method a unit test?
[12:41:09] Ox0dea: soulisson: You could do much worse as first approximations go.
[12:42:21] platzhirsch: has joined #ruby
[12:42:23] soulisson: Ox0dea, sorry I don't understand
[12:42:37] Ox0dea: soulisson: One test case per method isn't a bad way to start testing.
[12:42:49] Ox0dea: A case can (and generally should) contain multiple assertions, mind.
[12:43:53] soulisson: Ox0dea, so if we speak in a general manner each method defined in a TestCase class is a unit test?
[12:45:11] Ox0dea: soulisson: Oh, you're hung up on the terminology? Technically, the definition of "unit test" is predicated on what constitutes a "unit" in a given project.
[12:45:15] dlitvak: has joined #ruby
[12:45:41] ij: has left #ruby: ("WeeChat 1.3")
[12:46:14] Ox0dea: soulisson: But yeah, your intuition is pretty much correct.
[12:46:19] sameerynho: has joined #ruby
[12:46:43] soulisson: Ox0dea, ok,thanks
[12:46:44] Icey: has joined #ruby
[12:46:52] Icey: has joined #ruby
[12:47:09] JDiPierro: has joined #ruby
[12:47:20] Ox0dea: soulisson: Happy to help. Any reason you went with test/unit?
[12:47:53] soulisson: Ox0dea, I read something about TDD, I thought it was nice
[12:48:36] Ox0dea: soulisson: Hm? TDD is great, but test/unit is pretty spare.
[12:48:47] Ox0dea: It'll certainly suffice for getting your feet wet, I suppose.
[12:50:02] soulisson: ok, I see, thanks
[12:50:09] krzkrzkrz: has joined #ruby
[12:50:10] Ox0dea: To clarify, test/unit is one of many unit testing libraries availa
[12:50:16] Ox0dea: ble to you.
[12:51:58] blackmesa: has joined #ruby
[12:52:00] Ox0dea: In hindsight, I suppose you could already be using Minitest, but with the old API.
[12:55:55] epochwolf: has joined #ruby
[12:56:42] sdothum: has joined #ruby
[12:57:29] pandaant: has joined #ruby
[12:58:50] skweek: has joined #ruby
[13:00:57] IrishGringo: has joined #ruby
[13:01:17] KrzaQ: okay, Ox0dea: https://github.com/KrzaQ/AdventOfCode/blob/master/day07/main.rb
[13:01:25] KrzaQ: it could've been worse
[13:01:43] adaedra: Are those tabs?
[13:03:08] bmalum: has joined #ruby
[13:05:22] Rodya_: has joined #ruby
[13:06:50] radgeRayden_: has joined #ruby
[13:06:51] Ox0dea: KrzaQ: I must ask: from which resource(s) did you learn Ruby? :P
[13:07:59] ruid: has joined #ruby
[13:08:00] ruid: has joined #ruby
[13:08:02] bronson: has joined #ruby
[13:09:08] [k-: computer science class!
[13:09:25] Jardayn: has joined #ruby
[13:09:34] Ox0dea: It's just... very strange code.
[13:09:55] bmalum: has joined #ruby
[13:11:16] [k-: that's what they all say about computer science phds writing code
[13:11:42] KrzaQ: I'm not sure, Ox0dea
[13:11:51] Ox0dea: KrzaQ: Huh?
[13:11:52] KrzaQ: Nothing formal
[13:12:04] Ox0dea: That doesn't say much.
[13:12:05] KrzaQ: Just looked at rbot code and wrote some small scripts for myself
[13:12:44] KrzaQ: I like the idea of data being a stream and Ruby certainly lets me take that concept far
[13:13:10] Ox0dea: Sure, I get that.
[13:13:35] Ox0dea: Proof: https://eval.in/482109
[13:13:43] KrzaQ: but is it weird or is it wrong? (let's put the dynamic method creation aside)
[13:13:54] Ox0dea: Oh, shit. I thought you'd got it working.
[13:14:01] Ox0dea: Don't visit that link.
[13:14:55] KrzaQ: I did get that working Ox0dea
[13:15:00] Ox0dea: Okay, good.
[13:15:12] Ox0dea: Then it's definitionally not wrong?
[13:15:31] KrzaQ: It worked correctly for my input
[13:15:38] Ox0dea: Unorthodox as hell, sure, but it makes the right figures come out.
[13:15:58] KrzaQ: Trying to decipher your code now :P
[13:16:06] skade: has joined #ruby
[13:16:11] lubarch: has joined #ruby
[13:16:39] KrzaQ: what's the upcase for?
[13:16:57] atomical: has joined #ruby
[13:16:59] KrzaQ: upcase of DOOM?
[13:17:09] Ox0dea: KrzaQ: Can't have identifiers named `do`, `if`, or `in`.
[13:17:20] [k-: damn that hack
[13:17:28] Ox0dea: KrzaQ: Don't you love it?
[13:17:33] Ox0dea: Whoops. That was for [k-.
[13:17:34] wmdrossard: has joined #ruby
[13:17:46] [k-: this is why we should have comments!
[13:17:49] KrzaQ: p is pretty dangerous, if I can say so myself
[13:18:28] KrzaQ: aren't upcase names constants?
[13:18:39] decoponio: has joined #ruby
[13:18:40] KrzaQ: I guess you write to them only once, so it works
[13:18:45] [k-: ruby does allow you to override constants
[13:19:03] [k-: there are warnings in the output
[13:19:30] KrzaQ: Fair enough
[13:19:59] sgambino: has joined #ruby
[13:21:19] synthroid: has joined #ruby
[13:21:23] KrzaQ: so you're relying on the fact that, when sorted, there are no references to yet-to-be-defined constatns
[13:22:00] peterhil`: has joined #ruby
[13:22:05] d0nn1e: has joined #ruby
[13:22:14] solars: is vim-ruby-refactoring dead?
[13:22:18] KrzaQ: and you're not taking into account that ~ will return negative result
[13:22:24] KrzaQ: but overall, awesome Ox0dea
[13:23:35] [k-: the power of functional programming!
[13:24:00] Ox0dea: KrzaQ: More technically, I'm taking advantage of the fact that the input is just the "taps" of an LFSR.
[13:24:36] Ox0dea: The math for ~ works out fine regardless of integer width.
[13:25:03] favadi: has joined #ruby
[13:25:09] Ox0dea: Not in the general case, obviously.
[13:26:00] KrzaQ: it could be a problem if they made it so, same with <<
[13:26:12] KrzaQ: not a big one, but you'd see -1 instead of 65535 for example :P
[13:26:15] chouhoulis: has joined #ruby
[13:28:19] shevy: this has now reached NASA quality!
[13:28:32] solocshaw: has joined #ruby
[13:28:34] Ox0dea: That was insensitive?
[13:28:34] devoldmx: has joined #ruby
[13:28:39] durstburger: has joined #ruby
[13:29:40] ruid: has joined #ruby
[13:29:40] ruid: has joined #ruby
[13:32:18] arup_r: has joined #ruby
[13:32:55] toomus: has joined #ruby
[13:32:58] mikecmpbll: has joined #ruby
[13:33:05] toomus: Why this doesnt work?
[13:33:07] toomus: "+".gsub('+', '\+')
[13:33:11] KrzaQ: Heh, day 8 was so simple
[13:33:40] shevy: toomus perhaps because + is special
[13:33:56] jhass: >> "+".gsub('+', '\+'
[13:33:58] ruboto: jhass # => /tmp/execpad-14ec7efdfcaf/source-14ec7efdfcaf:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/482178)
[13:34:03] jhass: >> "+".gsub('+', '\+')
[13:34:05] ruboto: jhass # => "" (https://eval.in/482179)
[13:34:10] toomus: shevy: so how to escape +?
[13:34:24] toomus: from "+" to "\+"
[13:34:26] shevy: what do you want to replace actually? from + to ?
[13:34:26] freerobby: has joined #ruby
[13:34:38] jhass: I wonder if it's eaten by the backreference parser, mh
[13:34:47] mikecmpbll: seems unique to gsub
[13:34:47] shevy: ok so you want a "\\+"
[13:35:14] toomus: shevy: nope, still doesnt work
[13:35:19] roshanavand: has joined #ruby
[13:35:41] Ox0dea: >> 0x20.chr # [k-
[13:35:43] ruboto: Ox0dea # => " " (https://eval.in/482183)
[13:35:57] shevy: toomus hmm
[13:36:38] mikecmpbll: seems like a bug to me
[13:36:47] Ox0dea: Definitely.
[13:37:00] [k-: >> "\+". length
[13:37:01] ruboto: [k- # => 1 (https://eval.in/482184)
[13:37:09] KrzaQ: Ox0dea: is this unorthodox too? https://github.com/KrzaQ/AdventOfCode/blob/master/day08/main.rb
[13:37:10] [k-: it exists!
[13:37:28] mikecmpbll: works with double quotes
[13:37:41] aryaching: has joined #ruby
[13:37:53] jhass: >> "+".gsub('+', '\\\\+')
[13:37:54] ruboto: jhass # => "\\+" (https://eval.in/482185)
[13:37:58] apeiros: backslashes in replacement are a bit arduous
[13:38:06] apeiros: ^ jhass was a bit faster :)
[13:38:32] Ox0dea: It's got nothing to do with #gsub.
[13:38:38] jhass: apeiros: still I wouldn't expect to consume \anything, only \d and \k<n> as the docs only mention that
[13:38:40] dlitvak: has joined #ruby
[13:38:40] Ox0dea: >> ['\+', "\+"]
[13:38:42] ruboto: Ox0dea # => ["\\+", "+"] (https://eval.in/482186)
[13:38:55] mikecmpbll: that's different.
[13:38:58] apeiros: basically you need to have an additional layer of escaping
[13:38:59] Ox0dea: You're different.
[13:39:08] kmckelvin: has joined #ruby
[13:39:15] mikecmpbll: >> "\\+" == '\+'
[13:39:16] apeiros: >> "\\\\+" == '\\\\+'
[13:39:16] ruboto: mikecmpbll # => true (https://eval.in/482189)
[13:39:17] ruboto: apeiros # => true (https://eval.in/482189)
[13:39:24] [k-: stop shortening my your face joke!
[13:39:55] Ox0dea: >> ['+'.sub('+', 'x\+'), '+'.sub('+', '\\\+')]
[13:39:55] jhass: >> '\+' == "\\+"
[13:39:56] ruboto: jhass # => true (https://eval.in/482191)
[13:39:56] ruboto: Ox0dea # => ["x", "\\+"] (https://eval.in/482191)
[13:40:00] mikecmpbll: doesn't work with doubles, nvm :)
[13:40:04] grill: has joined #ruby
[13:40:30] Ox0dea: This is the same bug eam and I poked at regarding #tr.
[13:40:37] Caius: >> a ="+"; a["+"] = "\\+"; a
[13:40:38] Ox0dea: Or a very similar one, anyway.
[13:40:39] ruboto: Caius # => "\\+" (https://eval.in/482192)
[13:41:17] jhass: Caius: that's just calling String#sub btw
[13:41:23] djbkd: has joined #ruby
[13:41:34] [k-: >> "\\\u002b"
[13:41:36] ruboto: [k- # => "\\+" (https://eval.in/482193)
[13:41:47] Caius: jhass: except it behaves differently
[13:41:54] Caius: >> "+".sub("+", "\\+")
[13:41:55] ruboto: Caius # => "" (https://eval.in/482194)
[13:42:05] Caius: Same arguments to String#sub directly results in different result
[13:42:30] Caius: String#[]= disables backreferencing perhaps?
[13:43:02] Ox0dea: >> '\\+'.tr '\\+', ''
[13:43:03] ruboto: Ox0dea # => "\\" (https://eval.in/482198)
[13:43:10] [k-: sub only replaces the first + it finds thougj
[13:43:11] jhass: >> "++"["+"] = "\\+"
[13:43:13] ruboto: jhass # => "\\+" (https://eval.in/482199)
[13:43:22] Ox0dea: jhass: You're returning the RHS there.
[13:43:38] jhass: >> x = "++"; x["+"] = "\\+"; x
[13:43:39] ruboto: jhass # => "\\++" (https://eval.in/482200)
[13:43:50] jhass: Caius: ^ not replacing gsub anyhow
[13:44:33] Caius: >> a = "abc"; a[/(.)/] = "\\1"; a
[13:44:35] ruboto: Caius # => "\\1bc" (https://eval.in/482201)
[13:44:38] Caius: >> "abc".sub(/(.)/, "\\1")
[13:44:40] ruboto: Caius # => "abc" (https://eval.in/482202)
[13:45:48] JDiPierro: has joined #ruby
[13:46:12] dlitvak: has joined #ruby
[13:46:21] Ox0dea: Not terribly.
[13:47:09] CloCkWeRX: has joined #ruby
[13:48:14] Ox0dea: In fact, KRI calls that argument (Caius' "\\1") `backref` internally.
[13:48:14] malconis: has joined #ruby
[13:48:39] Ox0dea: Never mind.
[13:48:50] keyviewer_57179: has joined #ruby
[13:49:19] [k-: suddenly a new ruby interpreter pops up?
[13:49:40] mikecmpbll: did you write it, [k- ?
[13:49:47] Ox0dea: It's more Koichi's (and nobu's) than matz's, in my opinion.
[13:51:33] favadi: has joined #ruby
[13:51:58] [k-: i do not have much knowledge on much
[13:52:20] devster31: ok, today I even went on reddit to check the solutions but they're not doing it in a substantially different way... http://dpaste.com/26VNDBY problem is 2fold, the first line is a lower number than the solution, the second errors out with a bad unicode escape
[13:52:26] Ox0dea: [k-: There's wisdom in knowing that.
[13:52:28] _stu_: has joined #ruby
[13:52:52] emilkarl: has joined #ruby
[13:53:14] emilkarl: How could you wrap digits in a string when a span-tag the easiest way?
[13:53:15] blackmesa: has joined #ruby
[13:53:30] bnizzle: has joined #ruby
[13:53:39] goodcodeguy: has joined #ruby
[13:54:12] emilkarl: ex ???15 hours 10minutes??? -> ???<span>15</span> hours 10<span>minutes</span>???
[13:54:20] Ox0dea: >> 'foo'.center 17, '=-'
[13:54:21] ruboto: Ox0dea # => "=-=-=-=foo=-=-=-=" (https://eval.in/482204)
[13:54:27] Ox0dea: Use that instead.
[13:55:25] [k-: that wisdom only matters if you plan to act on it though
[13:55:29] emilkarl: Ox0dea: me?
[13:56:16] Ox0dea: >> '15 hours 10 minutes'.gsub /\d+/, '<span>\0</span>' # emilkarl
[13:56:17] ruboto: Ox0dea # => "<span>15</span> hours <span>10</span> minutes" (https://eval.in/482205)
[13:56:30] Ox0dea: [k-: Acting on ignorance is a bad idea.
[13:56:59] emilkarl: thanks Ox0dea
[13:57:03] Ox0dea: Happy to help.
[13:57:10] [k-: ACTION flags Ox0dea for misinterpretation
[13:58:15] cwong_on_irc: has joined #ruby
[13:58:29] Ox0dea: Defense, number 11; roughing the interpreter; 42-yard penalty, zeroth down.
[13:58:42] cwong_on_irc: has joined #ruby
[13:59:26] [k-: what is a 42-yard penalty, or a zeroth down?
[13:59:35] allcentury: has joined #ruby
[13:59:52] Ox0dea: They're handegg terms.
[13:59:57] houhoulis: has joined #ruby
[14:00:28] Ox0dea: *American handegg, I guess.
[14:00:37] chouhoulis: has joined #ruby
[14:01:07] [k-: not ad rem
[14:01:29] [k-: i used ad rem :>
[14:01:32] [k-: clever huh
[14:03:16] skade: has joined #ruby
[14:03:39] aryaching: has joined #ruby
[14:06:13] BSarante: has joined #ruby
[14:06:38] BSarante: Algum Brasileiro que possa me ajudar?
[14:06:45] jhass: English only please
[14:07:00] jhass: check /msg alis help for other channels
[14:07:55] kristofferR: has joined #ruby
[14:09:12] BSarante: It has specific community of ruby to Brazil ?
[14:09:54] BSarante: I'm having trouble with respect to a form in js
[14:10:20] favadi: has joined #ruby
[14:10:21] jhass: so look for a javascript channel?
[14:10:58] BSarante: I'm kind layman in ruby programming
[14:11:09] jhass: http://ruby-community.com/pages/channels lists all language specific Ruby channels we noticed
[14:11:40] JDiPierro: has joined #ruby
[14:11:49] BSarante: I'm doing a program in ruby ??????to enter a website
[14:13:01] jhass: actually I see a #ruby-br, only 4 people though
[14:13:09] roshanavand: has joined #ruby
[14:13:13] Ox0dea: I have some anecdata here which suggest that people who at least occasionally talk to themselves aloud do so most frequently while they are cooking for themselves. I'm in the market for corroborators.
[14:13:19] jhass: not sure if it's country or language code
[14:13:42] jhass: ?offtopic Ox0dea :P
[14:13:42] ruboto: Ox0dea, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[14:14:00] Ox0dea: I'll ask again later. ^_^
[14:14:02] devster31: wow, the bot is smart
[14:14:11] puria: has joined #ruby
[14:14:30] jhass: wow, there's a #ruby-creative
[14:14:36] jhass: do I want to know?
[14:15:11] [k-: ruboto is equipped with machine learning and natural language processing abilities
[14:15:11] devster31: what's rubycoin?
[14:15:40] jhass: http://www.rubycoin.org/
[14:17:03] devster31: what's behind ruboto?
[14:17:05] User458764: has joined #ruby
[14:17:21] [k-: ruboto is equipped with machine learning and natural language processing abilities
[14:17:35] cdg: has joined #ruby
[14:18:21] InvGhost: has joined #ruby
[14:18:40] [k-: how dare they use the ruby logo for their thingu
[14:19:13] devster31: yes, but is it based on hubot, on lita, sopel, something else?
[14:19:35] jhass: current on cinch, next gen on butler
[14:21:13] shevy: good old butler
[14:21:15] jgt2: has joined #ruby
[14:21:20] ankhers: under what circumstances can I call `obj.send(:key)', but be unable to call `obj.method(:key)'?
[14:21:25] [k-: funny jhass did not expose my lie
[14:21:37] JDiPierro: has joined #ruby
[14:21:57] jhass: Ankhers: the method being private
[14:22:05] platzhirsch: has joined #ruby
[14:22:08] jhass: Ankhers: hence why you should prefer public_send
[14:22:22] Ox0dea: That was a pretty speedy homework answer.
[14:22:48] Ox0dea: I thought we weren't supposed to do that?
[14:22:54] jhass: their problem for not learning how to research
[14:23:08] ankhers: okay, public_send still works.
[14:23:09] Ox0dea: Your problem for teaching them they don't have to.
[14:23:17] jhass: I didn't recognize it as such but I can see why you think so in hindsight
[14:23:17] davedev24: has joined #ruby
[14:23:26] shevy: Ankhers is now wiser than before
[14:23:26] Ox0dea: Fair enough.
[14:23:34] jhass: ?code Ankhers
[14:23:34] ruboto: Ankhers, We can't help you without your code, please post it to https://gist.github.com
[14:23:58] ankhers: sure, one sec.
[14:24:32] [k-: devster31: look how ruboto read Ankhers' mind
[14:25:47] davedev24: has joined #ruby
[14:27:23] ankhers: https://gist.github.com/anonymous/5820c9da68be73853a0f -- the commented out line crashes.
[14:28:00] devoldmx: has joined #ruby
[14:28:27] Ox0dea: jhass: Yep.
[14:28:39] jhass: Ankhers: this is nothing something we can use locally to reproduce your issue
[14:28:58] jhass: er, s/something//
[14:29:27] [k-: correction: this is not* something [...]
[14:30:06] ankhers: jhass: Unfortunately I cannot really give my company's code. Which is why I was just asking about scenarios where one would work, and not the other.
[14:30:12] jhass: >> class MyObject; def key; end; end; o = MyObject.new; [o.public_send(:key), o.method(:key)]
[14:30:14] ruboto: jhass # => [nil, #<Method: MyObject#key>] (https://eval.in/482213)
[14:30:35] TomPeed: has joined #ruby
[14:30:49] jhass: Ankhers: if you're not able to produce a minimal reproducing example nor share your real code and not able to solve your issue yourself, it's time to hire a consultant
[14:31:05] [k-: if you do not tell us the error, we might not be able to tell the issue at all
[14:31:31] kp666: has joined #ruby
[14:32:00] [k-: error loggggg
[14:32:18] Ox0dea: Symbol.new should do gensym.
[14:32:20] akem: has joined #ruby
[14:34:25] allcentury: has joined #ruby
[14:34:50] stamina: has joined #ruby
[14:35:20] mary5030: has joined #ruby
[14:38:05] dlitvak: has joined #ruby
[14:38:36] sankaber: has joined #ruby
[14:38:44] InvGhost: has joined #ruby
[14:39:11] lukeasrodgers: has joined #ruby
[14:41:31] banister: has joined #ruby
[14:43:10] devster31: Ox0dea, http://dpaste.com/0MY4YAH I've tried .encode('utf-8') eval (returns an error for unicode escape) and inspect, but I can't get it to print as intended
[14:44:10] Ox0dea: devster31: "As intended"?
[14:44:22] devster31: the paste contains what I'd like to output
[14:44:34] devster31: basically the same string I used as input
[14:44:51] Ox0dea: devster31: Are you *certain* AoC gave you this string?
[14:45:41] devster31: this is line 8 in my input "ckhorczuiudfjmmcc\\u\"wozqxibsfjma"
[14:46:07] Ox0dea: devster31: How are you getting hold of your input?
[14:46:43] devster31: copy paste, like in the paste I gave you, I copy the input, open a single quote in a repl, paste everything in, close the single quote
[14:48:45] RegulationD: has joined #ruby
[14:49:11] treehug88: has joined #ruby
[14:49:22] kmckelvi1: has joined #ruby
[14:50:21] ESpiney: has joined #ruby
[14:50:56] tahon: has joined #ruby
[14:56:08] blackmesa: has joined #ruby
[14:56:12] Ox0dea: devster31: https://eval.in/482227
[14:56:18] Ox0dea: I'm just as confused as you, my friend.
[14:56:59] Ox0dea: That code works, but I can't get it to do so with literals. :<
[14:57:09] puria: has joined #ruby
[14:57:56] Ox0dea: Oh, well, it's because `"\\" + "u" != "\u"`, but I can't finagle the literals into being interpreted correctly by `eval`.
[14:58:04] favadi: has joined #ruby
[14:59:16] whippythellama: has joined #ruby
[14:59:59] sankaber: has joined #ruby
[15:00:01] Bellthoven: has joined #ruby
[15:00:21] Ox0dea: >> eval '"\\u"'
[15:00:22] ruboto: Ox0dea # => (eval):1: invalid Unicode escape (SyntaxError) ...check link for more (https://eval.in/482231)
[15:00:40] Ox0dea: devster31: There's the crux of the problem, but I don't see why it should be happening.
[15:00:50] devster31: I think it's my repl
[15:01:00] devster31: this is how I did it https://eval.in/482233 and it works
[15:01:19] devster31: is it possible it's a specific version with this issue?
[15:01:20] Ox0dea: Right, but it's because you're not using string literals.
[15:01:21] stannard: has joined #ruby
[15:01:42] duckpuppy: has joined #ruby
[15:01:50] Ox0dea: You're not bumping into the escaping problem presented above.
[15:04:42] saddad: has joined #ruby
[15:06:15] skade: has joined #ruby
[15:06:25] favadi: has joined #ruby
[15:06:56] mary5030: has joined #ruby
[15:07:45] nettoweb: has joined #ruby
[15:08:04] TheHodge: has joined #ruby
[15:08:26] lubarch: has joined #ruby
[15:08:50] lacuna: has joined #ruby
[15:08:51] lacuna: has joined #ruby
[15:08:56] freerobby: has joined #ruby
[15:09:49] bronson: has joined #ruby
[15:10:11] [k-: has joined #ruby
[15:10:28] krzkrzkrz: has joined #ruby
[15:11:01] Ox0dea: has joined #ruby
[15:12:16] davedev24: has joined #ruby
[15:14:03] imperator: has joined #ruby
[15:16:01] lacuna: has joined #ruby
[15:16:02] lacuna: has joined #ruby
[15:16:45] [k-: has joined #ruby
[15:20:07] bahar: has joined #ruby
[15:21:22] ankhers: Turns out the answer is meta programming.
[15:22:39] bronson: has joined #ruby
[15:24:04] Icey: has joined #ruby
[15:24:20] User458764: has joined #ruby
[15:24:21] tvw: has joined #ruby
[15:25:17] dlitvak: has joined #ruby
[15:25:33] Ox0dea: Ankhers: Yes, this is #ruby.
[15:25:56] duckpuppy: has joined #ruby
[15:26:19] tahon: has joined #ruby
[15:26:30] ankhers: Ox0dea: Fair enough. Though, I am referring to my question about when `send' would work and `method' did not.
[15:27:20] Rodya_: has joined #ruby
[15:27:42] greg: has joined #ruby
[15:28:06] symm-: has joined #ruby
[15:28:15] atomical_: has joined #ruby
[15:28:30] adgtl: has joined #ruby
[15:28:38] adgtl: Is this correct? http://ruby-operators.herokuapp.com/#/snail
[15:28:38] dlitvak: has joined #ruby
[15:28:41] fullofcaffeine: has joined #ruby
[15:28:44] adgtl: is it called snail operator?
[15:29:28] chouhoulis: has joined #ruby
[15:29:51] gigetoo: has joined #ruby
[15:29:54] sarkis: has joined #ruby
[15:30:08] puria: has joined #ruby
[15:30:23] User458764: has joined #ruby
[15:31:02] User458764: has joined #ruby
[15:31:10] babblebre: has joined #ruby
[15:31:11] greister: has joined #ruby
[15:31:58] nertzy: has joined #ruby
[15:32:13] greister: has joined #ruby
[15:33:49] imperator: has left #ruby: ("Leaving")
[15:34:06] Ox0dea: The best name for `&.`: https://youtu.be/LE0g2TUsJ4U?t=996
[15:34:20] Ox0dea: Bonus adorable matz chuckles.
[15:34:55] adgtl: has joined #ruby
[15:35:37] IrishGringo: has joined #ruby
[15:35:40] weemsledeux: has joined #ruby
[15:37:32] noark9: has joined #ruby
[15:37:39] _stu_: has joined #ruby
[15:37:52] chalky_: has joined #ruby
[15:38:38] Rubie: has joined #ruby
[15:39:56] shevy: the lonely operator
[15:40:03] RobertBirnie: has joined #ruby
[15:40:22] nerium: has joined #ruby
[15:40:31] ta: has joined #ruby
[15:43:19] zarubin: has joined #ruby
[15:43:25] djbkd: has joined #ruby
[15:43:30] RegulationD: has joined #ruby
[15:44:06] ItSANgo_: has joined #ruby
[15:45:09] bmurt: has joined #ruby
[15:46:26] duckpuppy: has joined #ruby
[15:46:50] zacts: has joined #ruby
[15:50:30] greister: has joined #ruby
[15:53:27] mary5030: has joined #ruby
[15:54:02] greister: has joined #ruby
[15:54:49] mary5030: has joined #ruby
[15:55:23] mary5030: has joined #ruby
[15:56:01] dlitvak: has joined #ruby
[15:56:07] aufi: has joined #ruby
[15:56:29] hobodave: has joined #ruby
[15:56:49] Anderson69s_Deb: has joined #ruby
[15:56:52] [k-: raise SystemExit
[15:57:15] zacts|pi: has joined #ruby
[15:57:28] lavros: has joined #ruby
[15:59:24] Rodya_: has joined #ruby
[15:59:50] puria: has joined #ruby
[16:00:50] sucks: has joined #ruby
[16:00:59] psye: has joined #ruby
[16:01:21] tahon: has joined #ruby
[16:01:53] greister: has joined #ruby
[16:01:55] psye: has joined #ruby
[16:04:41] sh4d0wD: has joined #ruby
[16:07:04] The_Phoenix: has joined #ruby
[16:07:49] The_Phoenix: has joined #ruby
[16:08:31] djstorm: has joined #ruby
[16:08:57] radgeRayden__: has joined #ruby
[16:12:13] colegatron: has joined #ruby
[16:16:37] InvGhost: has joined #ruby
[16:16:59] Jackneill: has joined #ruby
[16:20:26] kobain: has joined #ruby
[16:21:22] podman: has joined #ruby
[16:21:36] dhollinger: has joined #ruby
[16:22:58] BTRE: has joined #ruby
[16:24:51] sh4d0wD1: has joined #ruby
[16:25:16] puria: has joined #ruby
[16:26:34] diegoviola: has joined #ruby
[16:28:50] devoldmx: has joined #ruby
[16:29:29] freerobby: has joined #ruby
[16:30:11] nerium: has joined #ruby
[16:30:35] favadi: has joined #ruby
[16:32:37] dlitvak: has joined #ruby
[16:32:47] ilovelinux: has joined #ruby
[16:32:57] blub: hi i love linux
[16:33:00] havenwood: ilovelinux: hi
[16:33:06] ilovelinux: i have problem :(
[16:33:10] blub: whats that
[16:33:17] ilovelinux: :/usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- msf/core (LoadError)
[16:33:30] ilovelinux: why it return this error?
[16:33:58] imperator: has joined #ruby
[16:34:07] hobodave: has joined #ruby
[16:34:51] agit0: has joined #ruby
[16:35:26] jhass: ?metasploit
[16:35:26] ruboto: I don't know anything about metasploit
[16:35:33] imperator: I don't suppose there's a base64_encoded? method somewhere in core that i'm missing, is there?
[16:35:34] jbrhbr: has joined #ruby
[16:35:36] cwong_on_irc: has joined #ruby
[16:35:54] jhass: ?metasploit=Please join #metasploit for help with it.
[16:35:54] ruboto: I don't know anything about metasploit
[16:36:14] jhass: !fact add metasploit Please join #metasploit for help with it.
[16:36:15] ruboto: jhass, I will remember that metasploit is Please join #metasploit for help with it.
[16:36:25] jhass: ?metasploit ilovelinux
[16:36:26] ruboto: ilovelinux, Please join #metasploit for help with it.
[16:37:12] duckpuppy: has joined #ruby
[16:39:27] uris: has joined #ruby
[16:39:35] baroquebobcat: has joined #ruby
[16:41:15] favadi: has joined #ruby
[16:41:54] ilovelinux: ruboto, jhass, thank you :)
[16:42:11] ilovelinux: ruboto, is a bot gh
[16:42:25] ruboto: I'm just a bot. You don't need to address me.
[16:43:50] atomical: has joined #ruby
[16:44:22] ramortegui: has joined #ruby
[16:44:42] ruboto: here's your cookie: ????
[16:46:20] [k-: ?rejected
[16:46:21] ruboto: I don't know anything about rejected
[16:46:30] blub: hi ruboto
[16:47:02] diegoviola: you have to be kidding me, sqlite is like the slowest db I ever tried
[16:47:11] diegoviola: importing 3k records to it shouldn't take like 5 minutes
[16:47:20] nettoweb: has joined #ruby
[16:47:21] solars: has joined #ruby
[16:47:22] diegoviola: with postgres it takes like 5 seconds
[16:47:27] noark9: has joined #ruby
[16:48:37] [Butch]: has joined #ruby
[16:49:16] sarkis: what version
[16:49:17] canton7: get your transactions right
[16:49:18] canton7: then it flies
[16:49:30] sh4d0wD: has joined #ruby
[16:49:55] diegoviola: [diego@myhost beta360]$ time rake import_csv
[16:49:56] diegoviola: real 5m39.009s
[16:50:01] pdoherty: has joined #ruby
[16:50:02] shevy: diegoviola postgres is very fast and great for big data
[16:50:57] aryaching: has joined #ruby
[16:51:34] shevy: I can see it when I download the official NCBI taxonomy database ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz - importing through INSERT takes much longer in sqlite than it does in postgresql
[16:51:52] kp666: has joined #ruby
[16:52:34] jhass: ?crosspost diegoviola
[16:52:34] ruboto: diegoviola, Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
[16:52:47] kp666: has joined #ruby
[16:54:11] sh4d0wD: has joined #ruby
[16:54:53] diegoviola: [diego@myhost beta360]$ time rake import_csv
[16:54:56] diegoviola: real 0m35.988s
[16:54:58] diegoviola: user 0m21.837s
[16:54:59] diegoviola: sys 0m1.040s
[16:55:02] diegoviola: it's not much better, but still
[16:56:16] shevy: how big is that
[16:56:34] diegoviola: [diego@myhost beta360]$ wc -l correspondence.csv
[16:56:35] diegoviola: 3861 correspondence.csv
[16:56:44] dionysus69: has joined #ruby
[16:57:06] shevy: I mean the filesize of the csv originally? the NCBI taxonomy one is about 100 MB or extracted, becomes much bigger when one has it as .sql insert statements
[16:57:08] diegoviola: I'm on a 5 years old computer
[16:57:12] diegoviola: with 2GB of RAM
[16:57:16] diegoviola: should be faster on my new thinkpad
[16:57:26] jas02: has joined #ruby
[17:00:26] wsewolod: has joined #ruby
[17:01:11] psye: has joined #ruby
[17:02:49] synthroid: has joined #ruby
[17:03:11] DurstBur1er: has joined #ruby
[17:04:15] favadi: has joined #ruby
[17:06:10] Coldblackice: has joined #ruby
[17:06:14] Pumukel: has joined #ruby
[17:06:46] RobertBirnie: has joined #ruby
[17:07:36] davedev24: has joined #ruby
[17:08:43] SCHAAP137: has joined #ruby
[17:08:48] ur5us: has joined #ruby
[17:12:15] dlitvak: has joined #ruby
[17:12:29] DexterLB: has joined #ruby
[17:14:14] hxegon: has joined #ruby
[17:14:21] nertzy: has joined #ruby
[17:15:21] thejamespinto: has joined #ruby
[17:15:58] ljarvis: not much better? it went from 5 minutes to 30 seconds?
[17:16:31] devbug: has joined #ruby
[17:16:36] amclain: has joined #ruby
[17:16:39] akem: has joined #ruby
[17:17:22] bb010g: has joined #ruby
[17:17:50] ethe: has joined #ruby
[17:19:01] ur5us: has joined #ruby
[17:19:08] agit0: has joined #ruby
[17:19:24] [k-: what is this magic doohickey rake that hides all the magic
[17:20:46] chandlerbing: has joined #ruby
[17:22:02] maloik: has joined #ruby
[17:22:24] yqt: has joined #ruby
[17:23:08] iateadonut: has left #ruby: ()
[17:23:13] lorn: has joined #ruby
[17:25:04] bronson: has joined #ruby
[17:25:24] minimalism: has joined #ruby
[17:25:44] pdoherty: has joined #ruby
[17:25:49] Ishido: has joined #ruby
[17:26:59] duckpuppy: has joined #ruby
[17:27:16] sh4d0wD: has joined #ruby
[17:29:23] christiandsg: has joined #ruby
[17:31:19] zast: has joined #ruby
[17:33:30] rakm: has joined #ruby
[17:33:46] KensoDev: has joined #ruby
[17:34:10] solars: does anyone know if vim ruby refactoring is dead? or are there any alternatives?
[17:34:56] JDiPierro: has joined #ruby
[17:35:45] mostlybadfly: has joined #ruby
[17:36:16] RobertBirnie: has joined #ruby
[17:36:32] codecop: has joined #ruby
[17:39:41] lacrymology: has joined #ruby
[17:39:59] lacrymology: how can I get a variable or call a method from its name, as a symbol?
[17:40:13] lacrymology: (I'm not sure which one it is right now, I'll check when I know how to do it)
[17:40:29] lacuna: has joined #ruby
[17:40:30] lacuna: has joined #ruby
[17:40:35] tomphp: has joined #ruby
[17:40:36] adaedra: To call a method, you have ri:Object#public_send
[17:40:37] `derpy: method `Object#public_send`: Invokes the method identified by _symbol_, passing it any arguments specified. U??? ??? http://rubydoc.info/stdlib/core/Object#public_send-instance_method
[17:41:55] [k-: ooooooooo i see `derpy got upgraded
[17:42:01] sepp2k: has joined #ruby
[17:42:03] ilovelinux: has left #ruby: ("Leaving")
[17:42:10] sneakerhax: has joined #ruby
[17:43:44] zarubin: has joined #ruby
[17:44:15] `derpy: ACTION updates [k- 
[17:44:18] `derpy: No results found
[17:45:03] adaedra: That ri: syntax is a bit misleading for people not knowing it's a call for the bot tho, I wonder how this can be made better
[17:45:54] lacrymology: change it for a > or a !, which are pretty standard?
[17:46:37] ljarvis: i think the only way to do that is for a separate line like it was before
[17:46:47] ljarvis: but at least this way you have the option
[17:46:52] adaedra: It still works
[17:47:23] ljarvis: right, that's what I mean
[17:47:28] ljarvis: you have the option to do either
[17:47:35] ljarvis: so it's fine
[17:48:36] supermarin: has joined #ruby
[17:48:39] [k-: maybe a `Object#public_send`
[17:48:40] adaedra: It's still being adjusted
[17:48:41] devbug: has joined #ruby
[17:49:04] ljarvis: that's too ambiguous
[17:49:18] adaedra: Yeah, `` is too common
[17:50:15] [k-: do you have statistics to show that 68% of the time is not intended to link a method?
[17:50:19] lacrymology: adaedra: and to access a variable in scope?
[17:50:32] adaedra: There's also the way to mention people that I have to look if I can do better
[17:50:51] adaedra: lacrymology: I think you have to look at binding for that
[17:50:53] [k-: binding.local_variable_get
[17:51:07] [k-: or something
[17:51:15] [k-: binding exists everywhere
[17:51:25] [k-: so you can call it anywhere in your code
[17:51:36] dlitvak: has joined #ruby
[17:51:38] ljarvis: lacrymology: why do you want to do that?
[17:51:40] adaedra: I'm not sure where it comes from, let's play hide and seek
[17:51:42] ljarvis: it's generally a bad idea
[17:51:50] adaedra: &ri Object#binding Kernel#binding
[17:51:52] `derpy: http://rubydoc.info/stdlib/core/Kernel#binding-instance_method, http://rubydoc.info/stdlib/core/Kernel#binding-instance_method
[17:52:19] ramfjord: has joined #ruby
[17:53:34] mrtomme: has joined #ruby
[17:54:29] lacrymology: ljarvis: it's complicated, I'm using rspec and I need to access a thing that is defined in a let from an example group. That is not possible, so I'm thinking of passing a symbol (call this method to find the value for this thing). I just did it and works (it's a method, not a variable)
[17:55:41] freerobby: has joined #ruby
[17:56:10] sh4d0wD: has joined #ruby
[17:56:23] ljarvis: wouldn't a hash do?
[17:57:07] KensoDev_: has joined #ruby
[17:57:54] tier: has joined #ruby
[17:58:13] mark4: has left #ruby: ("PART #RubyOnRails :PART #jquery :PART #reactjs :PART ##javascript :PART #elixir-lang :PART #debian :PONG :wilhelm.freenode.net")
[18:00:09] hahuang65: has joined #ruby
[18:01:00] jpfuentes2: has joined #ruby
[18:01:57] platzhirsch: has left #ruby: ()
[18:02:08] programmerq: has joined #ruby
[18:03:30] howdoicomputer: has joined #ruby
[18:03:32] Eiam: has joined #ruby
[18:03:43] jbrhbr: has joined #ruby
[18:04:39] bronson: has joined #ruby
[18:04:40] hxegon: has joined #ruby
[18:04:58] wldcordeiro: has joined #ruby
[18:06:46] wldcordeiro: has joined #ruby
[18:07:07] Xiti: has joined #ruby
[18:08:22] FLeiXiuS: has joined #ruby
[18:08:29] christiandsg: has joined #ruby
[18:08:40] FLeiXiuS: Is there an easy way to do a tail -f in ruby?
[18:09:14] jhass: FLeiXiuS: open the file and read_nonblock from it in a loop?
[18:09:22] jhass: or even just gets
[18:11:14] FLeiXiuS: jhass, Thats actually a good idea. I was going about it way wrong lol
[18:11:30] hxegon: is rspec-mocks a part of rspec by default?
[18:11:56] hxegon: I'm having trouble using the allow way of stubbing.
[18:12:04] mg^: ruby -e 'print ARGF.read while true' /var/log/messages
[18:12:45] atomical: has joined #ruby
[18:13:19] jhass: ruby -ne 'print $_' or whatever it was
[18:14:38] blub: ruby -pe ''
[18:14:41] sh4d0wD: has joined #ruby
[18:14:43] Tempesta: has joined #ruby
[18:15:21] djbkd: has joined #ruby
[18:15:22] mg^: ahh I should have remembered that
[18:16:09] jhass: there should be an stdlib called l so we can -perl
[18:16:10] mg^: actuale -pe doesn't work because it quits at EOF
[18:16:31] mg^: I have all the typos today
[18:18:02] kmckelvi1: has joined #ruby
[18:19:46] davedev24: has joined #ruby
[18:20:58] steffkes: has joined #ruby
[18:20:59] steffkes: has joined #ruby
[18:20:59] mloy: has joined #ruby
[18:22:34] mattyohe: has joined #ruby
[18:23:42] spider-mario: has joined #ruby
[18:23:56] Ishido: has joined #ruby
[18:23:57] slash_nick: you can keep 'em
[18:24:34] berserk_ren: has joined #ruby
[18:24:57] slash_nick: ACTION doesn't need them
[18:27:41] dfockler: has joined #ruby
[18:28:37] InvGhost: has joined #ruby
[18:29:42] kirun: has joined #ruby
[18:31:41] skade: has joined #ruby
[18:31:41] RegulationD: has joined #ruby
[18:32:01] Xentil: has joined #ruby
[18:32:09] last_staff: has joined #ruby
[18:32:23] christiandsg: has joined #ruby
[18:33:07] edwinvdgraaf: has joined #ruby
[18:33:23] RegulationD: has joined #ruby
[18:34:01] weemsledeux: has joined #ruby
[18:34:17] puria: has joined #ruby
[18:35:33] livcd: has joined #ruby
[18:35:52] livcd: can anyone point me to a very simple static-site generator in Ruby (something like jekyll)
[18:36:35] jhass: livcd: jekyll
[18:36:41] jhass: I like middleman
[18:36:50] [k-: i wanted to say that!
[18:36:58] dhollinger: has joined #ruby
[18:37:01] livcd: I am looking to study the code but jekyll looks too big / complicated
[18:37:25] nemesit|znc: has left #ruby: ("WeeChat 1.3")
[18:38:17] govg: has joined #ruby
[18:39:41] ramfjord: has joined #ruby
[18:39:58] jhass: https://www.ruby-toolbox.com/categories/static_website_generation hf
[18:40:20] blackjid: has joined #ruby
[18:41:01] alphaatom: has joined #ruby
[18:42:51] jbrhbr: has joined #ruby
[18:43:41] zarubin: has joined #ruby
[18:44:37] dkphenom: has joined #ruby
[18:46:23] blackmesa: has joined #ruby
[18:47:53] saddad: has joined #ruby
[18:48:00] dlitvak: has joined #ruby
[18:49:28] skade: has joined #ruby
[18:49:33] hobodave: has joined #ruby
[18:51:15] hxegon: has joined #ruby
[18:51:16] davejlong: has joined #ruby
[18:53:02] tenderlove: has joined #ruby
[18:53:29] jas02: has joined #ruby
[18:53:40] bmurt: has joined #ruby
[18:54:35] iamnix: has joined #ruby
[18:56:06] skade: has joined #ruby
[18:56:16] otherj: has joined #ruby
[18:56:44] ohaibbq: has joined #ruby
[18:57:30] unreal: has joined #ruby
[18:57:48] ScottNYC: has joined #ruby
[18:58:31] ur5us: has joined #ruby
[18:58:37] dlitvak: has joined #ruby
[18:58:39] ur5us: has joined #ruby
[19:01:52] nertzy: has joined #ruby
[19:02:31] freerobby: has joined #ruby
[19:05:17] blackmesa: has joined #ruby
[19:06:14] norc: has joined #ruby
[19:06:31] Xentil2: has joined #ruby
[19:08:10] jessemcgilallen: has joined #ruby
[19:08:22] bubbys: has joined #ruby
[19:09:49] norc: I cant figure out how to reference global variables (in particular Im interested about ruby_current_thread) using Fiddle alone. Any pointers? Ox0dea maybe?
[19:10:20] unreal: has joined #ruby
[19:10:48] jessemcgilallen_: has joined #ruby
[19:12:16] hakunin: has joined #ruby
[19:12:21] ghoorst: has joined #ruby
[19:12:50] ghoorst: hi! I'm trying to encrypt and decrypt using openssl, it works, but the first few characters are scrambled, how can this be?
[19:13:29] apeiros: ghoorst: you do something wrong. that's how.
[19:13:43] colleenmcguckin: has joined #ruby
[19:14:22] ghoorst: apeiros: obviously, but my thought was that if something regarding the encryption/decryption was wrong, nothing of the original text would come out right
[19:14:46] huddy: has joined #ruby
[19:14:59] hxegon: apeiros: make a gist so we can see what you are doing
[19:15:13] ghoorst: so I'm wondering where it might have gone wrong, encoding? File.open?
[19:15:15] apeiros: ACTION points hxegon at the backlog
[19:15:25] apeiros: wrong recipient :-p
[19:15:36] apeiros: ghoorst: how'd we know?
[19:15:40] apeiros: ghoorst: reading your thoughts?
[19:15:44] ghoorst: hxegon: one second
[19:15:49] hxegon: apeiros: oops :P
[19:15:52] brunto: has joined #ruby
[19:16:01] Moosashi: has joined #ruby
[19:16:16] Eiam: has joined #ruby
[19:16:42] shadoi: has joined #ruby
[19:16:56] hxegon: ACTION looks up how to make /me posts
[19:17:20] apeiros: by typing /me does stuff
[19:17:28] dstarh: has joined #ruby
[19:17:32] shevy: ACTION does stuff
[19:17:35] apeiros: ACTION thinks hxegon already figured
[19:17:44] hxegon: ACTION agrees with apeiros 
[19:17:44] apeiros: shevy: lies
[19:17:57] kadoppe: has joined #ruby
[19:18:17] jhass: no drugs shevy!
[19:18:26] dlitvak: has joined #ruby
[19:18:44] hxegon: ACTION puts bong under the desk
[19:19:19] apeiros: hxegon: doesn't that make it a bit difficult?
[19:19:24] ghoorst: hxegon: https://gist.github.com/aperia/341fae8bc3c5265ea666
[19:19:38] ghoorst: I'm sort of new to ruby and programming...
[19:19:46] ghoorst: so any help is much appreciated
[19:19:54] hxegon: apeiros: not if your desk has a bong hole
[19:20:45] jas02: has joined #ruby
[19:20:49] atomical_: has joined #ruby
[19:22:14] hxegon: ghoorst: probably can't help too much, but if I were you, I would look at 32-33 of encrypt.rb
[19:22:57] apeiros: hxegon: I don't think you're supposed to use a random iv to decrypt???
[19:23:06] imperator: has left #ruby: ("Leaving")
[19:23:14] apeiros: ACTION returns the favor :D
[19:23:46] jhass: agreed, you probably need the same iv
[19:24:02] yardenbar: has joined #ruby
[19:24:06] jhass: don't just store a static one with the key though
[19:24:12] zeroDivisible: has joined #ruby
[19:24:35] ghoorst: all right, so using the same IV for encryption/decryption is required, seems fair
[19:24:48] ghoorst: any other input on the code? style etc? is it decent?
[19:24:57] RTG`: has joined #ruby
[19:25:01] jhass: ghoorst: File.read and File.write should be very useful shortcuts here
[19:25:29] ghoorst: jhass: thanks
[19:25:41] mfqr: ghoorst: What book are you reading?
[19:25:56] lacrymology: has left #ruby: ()
[19:26:10] ghoorst: mfqr: none
[19:26:49] ghoorst: probably should heh
[19:26:51] jhass: ghoorst: ah yeah and we're all not particular crypto experts here, don't use this for anything serious, use gpg instead ;)
[19:27:21] ghoorst: jhass: it's not for anything serious, it's just for learning ruby and basics of symmetric cryptography
[19:27:35] agit0: has joined #ruby
[19:27:43] jhass: ghoorst: figured just much, it's just better to always include the disclaimer ;)
[19:28:19] ghoorst: jhass: indeed :)
[19:28:31] nertzy: has joined #ruby
[19:29:08] jhass: ghoorst: personally I find Base64.encode64/decode64 a lot clearer than Array#pack/unpack("m")
[19:29:32] ghoorst: jhass: thanks, will definitely use that instead
[19:29:37] shapeshifter: has joined #ruby
[19:30:46] stannard: has joined #ruby
[19:30:55] akem: has joined #ruby
[19:35:05] juddey: has joined #ruby
[19:35:45] DeXterbed: has joined #ruby
[19:35:46] hahuang65: has joined #ruby
[19:36:01] apeiros: ACTION would just store it as binary
[19:36:21] freerobby: has joined #ruby
[19:38:03] Cohedrin: has joined #ruby
[19:38:08] jhass: but what if you FTP it in ascii mode!
[19:38:27] shevy: then you can upload text!
[19:38:58] davejlong: has joined #ruby
[19:39:22] hxegon: anyone have advice for testing module instance methods in isolation? I'm having trouble stubbing a method on the dummy mixin.
[19:39:26] lacuna_: has joined #ruby
[19:40:22] apeiros: jhass: then you're a dummbatz
[19:41:57] [Butch]: has joined #ruby
[19:42:28] shevy: dummmatz?
[19:42:29] ramfjord: has joined #ruby
[19:43:46] zarubin: has joined #ruby
[19:46:01] dlitvak: has joined #ruby
[19:46:23] hxegon: specifically this example: https://gist.github.com/clebrun/8339dd224a825ec0ba59
[19:47:25] maloik: has joined #ruby
[19:48:14] jhass: hxegon: .and_return("test") perhaps? it's weird
[19:48:37] peterhil`: has joined #ruby
[19:49:08] hxegon: jhass: trying it out...
[19:49:17] lacuna: has joined #ruby
[19:49:18] lacuna: has joined #ruby
[19:50:05] Papierkorb: hxegon: you don't have a instance of the class
[19:50:20] Papierkorb: hxegon: 'bar' is not a class method, but a instance method in your case.
[19:51:07] Papierkorb: hxegon: https://gist.github.com/Papierkorb/e56273f0da711687f72e try this
[19:51:35] JDiPierro: has joined #ruby
[19:51:47] Papierkorb: hxegon: if you just want to check that #to_s is called, but not override its implementation, replace the .and_return with .and_call_original
[19:52:14] JDiPierro: has joined #ruby
[19:52:17] hxegon: Papierkorb: so I'm getting a new anonymous class, but not an instance of that class?
[19:52:27] Papierkorb: >> Class.new{}.inspect
[19:52:28] ruboto: Papierkorb # => "#<Class:0x41708e74>" (https://eval.in/482342)
[19:52:32] Papierkorb: hxegon: correct ^
[19:53:15] Papierkorb: hxegon: the 'class Foo < bar' keyword is actually just syntactic sugar for: Foo = Class.new(Bar){ .. }
[19:53:22] hxegon: hmm... I'm still getting does not implement for this
[19:53:45] benhuda: has joined #ruby
[19:53:56] Papierkorb: hxegon: the second 'describe' should be 'context'. doesn't change any semantics here
[19:54:06] freerobby: has joined #ruby
[19:54:30] hxegon: Papierkorb: still getting it, but thanks for the style tip
[19:55:20] nettoweb: has joined #ruby
[19:55:32] Papierkorb: hxegon: updated https://gist.github.com/Papierkorb/e56273f0da711687f72e - It works for me
[19:55:39] Papierkorb: "1 example, 0 failures"
[19:56:10] gizmore: has joined #ruby
[19:59:26] speakingcode: has joined #ruby
[20:01:04] hxegon: Papierkorb: what the hell, I pasted your example in the same file and that works
[20:01:13] jessemcgilallen: has joined #ruby
[20:01:50] durant_: has joined #ruby
[20:02:01] durant_: Is ruby anything like C++
[20:02:07] lacuna: has joined #ruby
[20:02:08] lacuna: has joined #ruby
[20:02:16] Papierkorb: Great. Next question.
[20:02:19] Papierkorb: hxegon: cheers
[20:03:06] hxegon: Papierkorb: https://gist.github.com/anonymous/538a267c22f68b8ae7da somehow doesn't work, but I can't find a difference (that's not style)
[20:03:16] Papierkorb: hxegon: lil' TL;DR: If you have the same objects in multiple examples ("it"s), try to use let() instead.
[20:03:45] hays: has joined #ruby
[20:03:45] durant_: has left #ruby: ("Leaving")
[20:03:49] Papierkorb: hxegon: what does it say?
[20:04:00] peterhil`: has joined #ruby
[20:06:06] hxegon: Papierkorb: what does what say?
[20:06:14] Papierkorb: hxegon: the error message?
[20:06:16] casadei: has joined #ruby
[20:06:32] hxegon: <class:...> does not implement: read
[20:06:44] Papierkorb: then there's no #read
[20:06:55] bmurt: has joined #ruby
[20:06:57] _stu_: has joined #ruby
[20:06:58] Papierkorb: is read supposed to be a class method or a instance method?
[20:07:07] hxegon: Papierkorb: instance method
[20:07:11] axl_: has joined #ruby
[20:07:23] Papierkorb: then it's really not there
[20:07:33] dkphenom: has joined #ruby
[20:07:34] davejlong: has joined #ruby
[20:07:54] Papierkorb: hxegon: the method must exist on the object.
[20:08:12] hxegon: Papierkorb: isn't that the purpose of allow... to receive?
[20:08:41] Papierkorb: you can't receive something which does not exist
[20:08:58] Papierkorb: it's like waiting at a post box which does not exist either.
[20:09:19] hxegon: then how does your example work when klass doesn't have a #to_s?
[20:09:33] Papierkorb: >> Object.method :to_s
[20:09:34] ruboto: Papierkorb # => #<Method: Class(Module)#to_s> (https://eval.in/482354)
[20:09:42] dlitvak: has joined #ruby
[20:10:02] centrx: has joined #ruby
[20:10:33] Papierkorb: just provide an empty read method in the class.
[20:10:45] hxegon: wow, poor choice of example method...
[20:10:52] atomical: has joined #ruby
[20:11:08] yfeldblum: has joined #ruby
[20:11:21] tubbo: what the fuck is this bullshit
[20:11:23] jas02: has joined #ruby
[20:11:35] tubbo: Digest::MD5.new.digest "fucking anything" # => Encoding::CompatibilityError
[20:11:39] tubbo: wtf is that shit
[20:11:51] tubbo: in a Haml file
[20:11:57] tubbo: why is MD5 now UTF-8 by default?????
[20:12:00] Papierkorb: >> Digest::MD5.hexdiges "asdasdsads"
[20:12:01] ruboto: Papierkorb # => uninitialized constant Digest (NameError) ...check link for more (https://eval.in/482356)
[20:12:06] tubbo: fucking stupid
[20:12:11] Papierkorb: >> require 'digest'; Digest::MD5.hexdiges "asdasdsads"
[20:12:12] ruboto: Papierkorb # => undefined method `hexdiges' for Digest::MD5:Class (NoMethodError) ...check link for more (https://eval.in/482357)
[20:12:13] apeiros: because hashing is a binary based operation
[20:12:25] tubbo: >> require 'digest/md5'; Digest::MD5.hexdigest 'seriously fuck you ruby'
[20:12:26] ruboto: tubbo # => "d16a3a91bcc9b7d7b36e7013e1873ad6" (https://eval.in/482358)
[20:12:31] tubbo: blam. doin it.
[20:12:36] apeiros: though I'd expect it to just .b it
[20:12:38] Papierkorb: tubbo: #digest gives you the binary representation
[20:13:05] tubbo: was that always the case? i distinctly remember this being a lot easier like 2 years ago.
[20:13:05] apeiros: anyway, the problem is trivial to solve.
[20:14:05] hxegon: maybe stubbing isn't what I think it is? I want to make a fake method so I can test #to_json...
[20:14:14] apeiros: tubbo: hm, no, I think your problem stems from how you deal with the output
[20:14:19] Papierkorb: hxegon: a stub: def read; end
[20:14:21] apeiros: because it reads utf-8 just fine.
[20:14:37] Papierkorb: maybe there's something more fancy than that. OTOH, it won't get much more readable than good ol' def
[20:14:59] hxegon: Papierkorb: :|
[20:15:20] tubbo: it is, but the fact that i had to solve it seems wrong. ruby is supposed to be utf-8 by default, all the time, everywhere...so i don't assume that i have to deal with encoding problems.
[20:15:27] tubbo: because i haven't really had to in a long time!
[20:15:30] apeiros: tubbo: that makes no sense
[20:15:35] apeiros: digest data is *binary* data
[20:15:42] apeiros: you *cannot* represent it in utf-8
[20:15:47] Papierkorb: hxegon: also, use expect when you *expect* it to happen (so, it must happen). use allow when you allow it to happen, and then act upon it. but it may not happen, and in that case, you don't really care either.
[20:16:12] apeiros: tubbo: did you in all seriousness embed binary as-is in a utf-8 template?
[20:16:18] apeiros: because frankly, that's just insane.
[20:16:36] tubbo: apeiros: agreed...it's not a problem with the code, it's a problem with the docs. i wasn't aware digest() was returning binary data to me.
[20:17:20] tubbo: if i cared enough i might contribute to ruby/ruby just to say "hey, if you want a String version of this, use hexdigest"
[20:17:41] Papierkorb: the docs could maybe add the word 'binary' ..
[20:17:48] apeiros: um, digest returns a string just fine
[20:18:03] IrishGringo: has joined #ruby
[20:18:10] apeiros: s/String/printable ascii-only string/
[20:18:48] apeiros: ACTION prefers just using appropriate naming. .hex_digest, .binary_digest
[20:19:32] tubbo: apeiros: so in your world, digest() throws a NoMethodError.
[20:19:45] apeiros: it raises, but yes.
[20:19:54] hxegon: Papierkorb: thanks, I don't know why I was trying to do it that way
[20:20:24] Moosashi: has joined #ruby
[20:20:26] tubbo: apeiros: im not interested in discussing samantics with u
[20:20:33] tubbo: disgusting* sory 4 speling
[20:20:39] apeiros: tubbo: I noticed that semantics isn't up your alley
[20:21:04] tubbo: br0 do u even spel
[20:21:34] Papierkorb: I feel like punching someone when s/he's using a letter as substitute for a proper word. kthxbai
[20:21:55] hxegon: u mad bruh?
[20:21:57] tubbo: Papierkorb: well, i feel like punching people whenever they drop pronoun
[20:21:59] mg^: If I were implementing it from scratch, I'd want to get a digest back as its own String-like object with conversion methods (.hex!, .binary!)
[20:22:08] mg^: but of course that's just opinion
[20:22:11] tubbo: Papierkorb: but i realize it's just because y'all aren't from God's Country
[20:22:20] apeiros: ACTION suggests the two of you get punching bags
[20:22:29] Papierkorb: tubbo: instead, we've got proper health care
[20:22:29] tubbo: and you don't have pointless chain words like "a", "or", "as", "the", etc
[20:22:40] tubbo: well seeing as i'm a programmer, i also have proper health care ;)
[20:22:48] tubbo: i just have to pay for it
[20:22:50] tubbo: unfortunately
[20:22:52] hxegon: ACTION quietly puts on murica shirt and red/white/blue stunner shades
[20:22:52] Papierkorb: mhenrixon_: imo too verbose
[20:24:44] Xentil: has joined #ruby
[20:25:46] pipework: tubbo: your employer doesn't?
[20:28:25] jhass: well, that went OT fast
[20:28:30] tubbo: pipework: lol they do, i just meant the gubmint doesn't
[20:28:53] eam: ultimately the employee is paying for any of their compensation through their labor
[20:29:27] pipework: eam: How "no free lunch" of you.
[20:30:08] devoldmx: has joined #ruby
[20:30:31] PlasmaStar: has joined #ruby
[20:30:39] DavidDudson: has joined #ruby
[20:30:45] dorei: has joined #ruby
[20:31:10] hobodave_: has joined #ruby
[20:31:16] eam: TANSTAAFL
[20:32:31] pipework: eam: What does the second letter mean?
[20:32:47] eam: ain't ('murica)
[20:32:56] uri__: has joined #ruby
[20:33:18] Fredrich010: has joined #ruby
[20:33:27] eam: Heinlen's authoritative, I think: https://en.wikipedia.org/wiki/There_ain%27t_no_such_thing_as_a_free_lunch
[20:35:37] sandstrom: has joined #ruby
[20:35:41] Pupeno: has joined #ruby
[20:35:41] Pupeno: has joined #ruby
[20:38:14] colleenmcguckin: has joined #ruby
[20:38:41] maloik: has joined #ruby
[20:40:18] symm-: has joined #ruby
[20:41:36] uris: has joined #ruby
[20:42:20] skade: has joined #ruby
[20:43:11] naftilos76: has joined #ruby
[20:45:10] naftilos76: Hi, is there a gem that lets me set a terminal's cursor position or draw certain characters with certain colors on certain x,y cursor coordinates. I am talking about text mode!!! Not graphics mode.
[20:45:49] hxegon: naftilos76: isn't that curses?
[20:45:59] lemur: has joined #ruby
[20:46:18] hxegon: naftilos76: https://github.com/ruby/curses
[20:46:22] naftilos76: hxegon, not sure but let me have a look
[20:46:24] mg^: In addition to curses, I saw another one recently that can do the basics
[20:46:28] mg^: can't recall the name
[20:46:53] zacts: hi rubyists
[20:47:21] hahuang65: has joined #ruby
[20:47:31] freerobby: has joined #ruby
[20:47:39] mg^: http://peter-murach.github.io/tty/
[20:48:44] hxegon: zacts: o/
[20:48:59] christiandsg: has joined #ruby
[20:50:31] moeabdol: has joined #ruby
[20:51:10] sucks: has joined #ruby
[20:51:32] naftilos76: mg^, thanks looks nice
[20:52:04] bronson: has joined #ruby
[20:54:27] jhass: naftilos76: you can some stuff with ANSI codes
[20:55:39] naftilos76: jhass, not sure how to do that. Can you pls be more specific?
[20:56:02] jhass: naftilos76: google "ANSI codes ruby"
[20:59:22] ascarter: has joined #ruby
[21:00:01] goodcodeguy: has joined #ruby
[21:03:34] lemur: has joined #ruby
[21:04:18] nerium: has joined #ruby
[21:04:32] fmcgeough: has joined #ruby
[21:04:40] BTRE: has joined #ruby
[21:10:39] stannard: has joined #ruby
[21:11:20] christiandsg: has joined #ruby
[21:12:13] InvGhost: has joined #ruby
[21:15:04] shanemcd: has joined #ruby
[21:15:48] evlute: has joined #ruby
[21:15:52] evlute: hey dudes :)
[21:16:15] nerium: has joined #ruby
[21:16:17] evlute: someone here who knows how to use the composite design pattern in ruby in a very easy example?
[21:16:46] shanemcd: has joined #ruby
[21:17:49] Papierkorb: evlute: you mean compared to Java interfaces?
[21:18:44] podman: has joined #ruby
[21:18:45] evlute: no, compared to nothing :) just wanna learn this pattern for school :)
[21:19:34] evlute: normally you have an abstract class, a leaf class and a composite class
[21:20:04] Moosashi: has joined #ruby
[21:20:18] bmalum: has joined #ruby
[21:20:19] Papierkorb: evlute: You can inherit from another class. there are no per-se 'abstract' classes in ruby though.
[21:20:42] akem: has joined #ruby
[21:20:51] davedev24: has joined #ruby
[21:21:06] mg^: It really is about the interfacing. You make the behavior of the individual objects and the composite object meet the expectations of the things making use of those objects.
[21:21:12] Papierkorb: evlute: Ruby uses mostly what we call 'duck typing'. If you have an object, which walks like a duck, and quacks like a duck, then that object *is* a duck. For this it doesn't matter if the object 'inherits' from Animal or whatever, it's a duck.
[21:22:00] Papierkorb: (If you're wondering: Yes, duck-typing is the official name)
[21:22:10] thiagofm: has joined #ruby
[21:24:16] evlute: i tried this one as an example for composite - but i'm not sure if this goes into the right direction - http://nopaste.linux-dev.org/?878775
[21:24:58] Papierkorb: evlute: please see attr_accessor
[21:25:17] evlute: yeah i know attr_accessor to get easy access to variables :)
[21:25:29] dkphenom: has joined #ruby
[21:25:41] spk: has left #ruby: ("WeeChat 1.3")
[21:25:53] evlute: but how to i access objects in objects in objects?
[21:26:12] Papierkorb: Mh. I'm not even sure if that concept, if taken by the letter, makes sense without abstract methods
[21:26:18] Papierkorb: evlute: objects in objects? What do you mean?
[21:26:25] tomchapin: has joined #ruby
[21:27:13] nerium: has joined #ruby
[21:27:29] shanemcd: has joined #ruby
[21:27:40] devgiant: has joined #ruby
[21:28:12] tildes: has joined #ruby
[21:28:31] DavidDudson: has joined #ruby
[21:28:34] evlute: the composite pattern makes sense for a part of relationship where every object in the "tree" is handled equaly. so i have an atomic leaf and a composite class which could have more composite classes or one or more leafs
[21:28:39] uris: has joined #ruby
[21:28:44] evlute: who do i access a composite in a composite
[21:29:02] mg^: the composite is a tree structure
[21:29:22] mg^: where a tree and a leaf have the same interface (both look like a duck)
[21:29:44] evlute: yeah that's what i mean
[21:29:52] evlute: but how to i access the tree in the tree
[21:30:02] mg^: well if you do it right
[21:30:06] mg^: then you access it like a leaf
[21:30:25] mg^: e.g. if you have c = composite with a and b as children, you don't care if a is a composite and b is a leaf
[21:30:37] mg^: what c does with them is exactly the same
[21:30:47] mg^: if you implement the pattern correctly
[21:30:47] InvGhostt: has joined #ruby
[21:30:54] evlute: yeah in theory it is like this, but how do i implement it in ruby
[21:31:25] Papierkorb: attr_accessor :children; def initialize; @children = []; super; end
[21:31:33] mg^: exactly the same as you'd implement it in any other language. If you must have some abstract class to define your interface
[21:31:47] mg^: then do something like def perform; fail "implement me!"; end
[21:32:06] DavidDud_: has joined #ruby
[21:32:29] evlute: why attr_accessor :children?
[21:32:32] hahuang65: has joined #ruby
[21:32:59] mg^: then your composite and your individual classes inherit from that, and you deal with implementing #perform for both classes
[21:33:48] mg^: normally the composite would gather and compose whatever data is contained in its children
[21:34:16] mg^: or call the method that does the action, etc.
[21:36:31] mg^: For instance, if your objects are each steps in a process, and you have to gather performance times and execute composite or single steps. Well, you have perform and time_to_perform methods. The individuals do their thing and report what time it takes to do that thing, and the composite will implement them such that perform calls perform on all the children, and time_to_perform sums all of the time_to_perform of its children.
[21:37:45] mg^: then, anything expecting to use them can call perform or time_to_perform, and the underlying object, whether a single or composite, is transparent to the user.
[21:38:32] nerium: has joined #ruby
[21:41:33] evlute: http://nopaste.linux-dev.org/?878783 <- is this something like a composite pattern? :( sorry i'm a noob in design patterns.
[21:41:47] evlute: oh fuck, forget about it
[21:41:50] htmldrum: has joined #ruby
[21:42:08] evlute: forgot to inherit my class B ....
[21:42:39] evlute: i don't see the sense of this... but i have to understand it for school.... :/
[21:43:05] rayzaum: has joined #ruby
[21:43:11] supermar_: has joined #ruby
[21:44:02] GiveMe1Like: has joined #ruby
[21:44:18] mg^: well, that's a start, but in order to implement the pattern, your objects have to *do* something with a well-defined interface
[21:44:32] Papierkorb: evlute: IMO it makes more sense in a language outside of ruby.
[21:44:37] Papierkorb: *language other than
[21:44:58] mg^: that is, they have to quack the right way whether you ask A to quack or B to quack
[21:45:23] mg^: and whether the object is a single or a composite does not matter to you when you ask
[21:45:45] thelastinuit: has joined #ruby
[21:46:06] banister: has joined #ruby
[21:46:08] rayzaum: algum brasileiro para me tirar uma duvida
[21:46:27] mg^: if you ask your single duck or composite duck to quack, and you care about whether or not it was a single or a composite, you haven't implemented the pattern
[21:46:30] adaedra: rayzaum: in English, please.
[21:46:30] mg^: does that make sens?
[21:46:56] gravspeed: has joined #ruby
[21:47:32] evlute: you mean, if its a leaf or a composite - in the tree it does not matter, both will behave like a "duck" because from outside the tree it's not important if its a composite or leaf
[21:48:10] mg^: exactly
[21:48:11] gravspeed: hey guys, i'm having an issue capturing the shell output of snmpget ... | grep ...
[21:48:39] moeabdol: has joined #ruby
[21:48:53] evlute: i understand this mg^ but its hard for me to translate this to a programming language. maybe i should try java with interfaces
[21:49:06] djbkd: has joined #ruby
[21:49:13] hxegon: rayzaum: n??o h?? brasileiros aqui
[21:49:32] evlute: i don't know how i can modulate the qack method for the leaf and the composite
[21:49:34] gravspeed: if i run it myself it returns an integer value
[21:49:48] gravspeed: but inside ruby it returns nothing.
[21:49:48] nerium: has joined #ruby
[21:49:50] Papierkorb: evlute: https://gist.github.com/Papierkorb/60e75eef306141cf2ff9
[21:49:58] ascarter: has joined #ruby
[21:50:15] duncannz: has joined #ruby
[21:50:49] Papierkorb: evlute: No information is leaked outside of the Node (sub-)class, the user just calls #value on it and it does whatever it wants basically. Which in this case is doing a little computation
[21:51:03] adaedra: hxegon: what's this about?
[21:51:22] hxegon: adaedra: rayzaum asked a question in portuguese
[21:51:47] hxegon: adaedra: or rather, asked if anyone spoke portuguese here
[21:51:49] evlute: thank you Papierkorb - this is really interessting - study it right now
[21:51:50] Papierkorb: evlute: note that there's ValueNode, which is a node which has just a value, and BinaryNode, which is binary (as in 'two'), which is basically a helper to implement Sum and Multiply
[21:52:12] _djbkd: has joined #ruby
[21:52:14] poguez_: has joined #ruby
[21:52:15] moeabdol: has joined #ruby
[21:52:22] RTG`: has joined #ruby
[21:52:38] adaedra: hxegon: ok
[21:53:04] jhn: has joined #ruby
[21:53:11] bmurt: has joined #ruby
[21:54:01] Papierkorb: mg^: could you have a look, does my example match the definition? I think it does, but don't wanna teach something wrong heh ..
[21:54:18] momomomomo: has joined #ruby
[21:54:32] christiandsg: has joined #ruby
[21:54:50] rayzaum: ok sorry, =) thanks for answer
[21:54:52] mg^: Papierkorb: It looks like a fine example to me.
[21:55:47] timonv: has joined #ruby
[21:56:23] evlute: this looks very interessting to me :) i'm facinated
[21:57:18] Gadgetoid: has joined #ruby
[21:57:23] lacuna: has joined #ruby
[21:57:24] lacuna: has joined #ruby
[21:57:32] Rubie: has joined #ruby
[21:58:22] Papierkorb: evlute: That concept is regularly used for "ASTs", Abstract Syntax Trees. You can use an AST to 'store' instructions the computer can then evaluate (like #value does in the example). While you don't need this concept every day, it is a really elegant solution for such problems.
[21:59:00] mg^: ahh AST is a *perfect* example of a real-world use of this pattern
[21:59:11] cloaked1: has joined #ruby
[21:59:12] cloaked1: has joined #ruby
[21:59:18] mg^: basically anything that can be represented in BNF can be implemented this way
[21:59:27] evlute: i will memorize ast for my classmates - have to introduce this pattern
[21:59:41] jbrhbr: has joined #ruby
[21:59:53] mg^: er, described in BNF I should say
[22:00:27] passcod: has joined #ruby
[22:00:31] ochkoffein: has joined #ruby
[22:01:12] nerium: has joined #ruby
[22:01:23] Papierkorb: evlute: if you want a challenge (note that I don't know how far you are knowledge wise, also this requires quite some time investment), you could try implementing a calculator: Have the user input a string like "4+3*2", and then calculate the correct result. The groundwork for the computational part is what I posted. The part of getting the string into that form is where a parser comes into play, for which in turn knowing BNF is really helpful
[22:01:42] Papierkorb: evlute: This is an advanced topic if you're new to this, so beware.
[22:02:24] Papierkorb: More like a week-end project (I'm really bad at estimating this, so maybe even more) than a "2 hour challenge"
[22:02:36] evlute: i know the a little about bakus naur form - so this would be a great practise for me
[22:02:58] DurstBur2er: has joined #ruby
[22:03:31] shanemcd: has joined #ruby
[22:03:50] Jabberwock: has joined #ruby
[22:03:55] Jabberwock: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[22:04:16] ap4y: has joined #ruby
[22:04:49] yeticry: has joined #ruby
[22:06:29] sucks: has joined #ruby
[22:06:59] lacuna: has joined #ruby
[22:06:59] lacuna: has joined #ruby
[22:06:59] duoi: has joined #ruby
[22:07:41] Papierkorb: evlute: afterwards, you can toy around with the 'parser' gem. it's a parser for ruby code. I use it for code and template instrumentation for my stuff.
[22:08:07] Papierkorb: (You could even cheat and use that gem, but then you'd learn nothing about parsers themselves :P)
[22:08:29] art-solopov: has joined #ruby
[22:08:32] djbkd: has joined #ruby
[22:09:17] Papierkorb: fsck now I forgot what I was working on >_>
[22:09:19] moeabdol: has joined #ruby
[22:10:07] colegatron: has joined #ruby
[22:10:46] evlute: Papierkorb: i have to thank you very much. And thanks mg^ too. Both of you put me a huge step forward.
[22:11:01] mg^: No proib
[22:11:16] cjbottaro: has joined #ruby
[22:11:41] ibouvousaime: has joined #ruby
[22:11:47] nerium: has joined #ruby
[22:12:32] skade: has joined #ruby
[22:12:59] futilegames: has joined #ruby
[22:13:47] shanemcd: has joined #ruby
[22:15:07] skade: has joined #ruby
[22:15:44] tomphp: has joined #ruby
[22:15:48] momomomomo: has joined #ruby
[22:20:47] calderonroberto: has joined #ruby
[22:22:00] BTRE: has joined #ruby
[22:22:22] djbkd: has joined #ruby
[22:23:35] chadmandoo: has joined #ruby
[22:23:35] yfeldblum: has joined #ruby
[22:23:56] chadmandoo: hey all. if i want to learn ruby on rails should I learn ruby first or dive right into ruby on rails
[22:23:56] skweek: has joined #ruby
[22:23:56] shanemcd: has joined #ruby
[22:24:04] hxegon: ?rails chadmandoo
[22:24:04] ruboto: chadmandoo, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[22:24:41] hxegon: chadmandoo: but you want to get some ruby under your belt for sure
[22:25:17] chadmandoo: maybe i learn simultaneously
[22:25:54] ascarter: has joined #ruby
[22:26:23] hxegon: chadmandoo: It's not impossible, but rails by itself is already a lot, and learning that without knowing ruby basics at least is going to be challenging
[22:26:35] fumduq: has joined #ruby
[22:26:42] chadmandoo: so maybe ruby first then rails
[22:26:53] hxegon: chadmandoo: IMHO
[22:27:03] chadmandoo: sounds good thats what ill do. thank you
[22:27:10] chadmandoo: has left #ruby: ()
[22:27:11] hxegon: chadmandoo: no problem.
[22:27:30] jgpawletko: has joined #ruby
[22:29:02] TheRokh: has joined #ruby
[22:30:17] TheRokh: has joined #ruby
[22:30:26] iamnix: has joined #ruby
[22:31:02] devoldmx: has joined #ruby
[22:31:21] TheRokh: has joined #ruby
[22:32:12] calderonroberto: @chadmandoo The RoR tutorial is great at providing resources. In the prerequisites you can see Michael points you in the right direction https://www.railstutorial.org/book/beginning#sec-prerequisites
[22:32:16] TheRokh: has joined #ruby
[22:32:43] ZeroAbility: has joined #ruby
[22:33:31] calderonroberto: From which I really like http://tryruby.org/levels/1/challenges/0
[22:34:14] jhn: has joined #ruby
[22:34:53] lxsameer: has joined #ruby
[22:34:54] lxsameer: has joined #ruby
[22:35:59] Mon_Ouie: has joined #ruby
[22:39:19] _djbkd: has joined #ruby
[22:40:29] _djbkd: has joined #ruby
[22:42:18] _djbkd: has joined #ruby
[22:42:24] Contigi: has joined #ruby
[22:43:22] circ-user-mgcmJ: has joined #ruby
[22:47:39] TomPeed: has joined #ruby
[22:47:47] freerobby: has joined #ruby
[22:47:51] davedev24: has joined #ruby
[22:48:35] edwinvdgraaf: has joined #ruby
[22:49:07] lipoqil: has joined #ruby
[22:49:56] djbkd: has joined #ruby
[22:54:42] jgpawletko: has joined #ruby
[22:56:36] TheHackOps: has joined #ruby
[22:57:30] stannard: has joined #ruby
[22:58:57] jimmybomb: has joined #ruby
[23:01:49] kallisti5: has joined #ruby
[23:02:17] ScottNYC: has joined #ruby
[23:04:52] jgpawletko: has joined #ruby
[23:06:15] kobain: has joined #ruby
[23:06:33] colleenmcguckin: has joined #ruby
[23:06:44] jgt2: has joined #ruby
[23:07:34] skweek: has joined #ruby
[23:07:48] chandlerbing: has joined #ruby
[23:08:45] aptrcki: has joined #ruby
[23:10:06] kies: has joined #ruby
[23:10:08] nerium: has joined #ruby
[23:10:27] lkba: has joined #ruby
[23:10:33] diegoviola: has joined #ruby
[23:10:46] malconis: has joined #ruby
[23:11:00] devbug: has joined #ruby
[23:12:36] daivyk: has joined #ruby
[23:13:09] tomphp: has joined #ruby
[23:13:27] cdg: has joined #ruby
[23:16:32] Ropeney: has joined #ruby
[23:17:15] evlute: Papierkorb: are you there?
[23:17:52] Azure|dc: has joined #ruby
[23:18:00] evlute: in the class sum - why do the values left and right have value as method?
[23:18:20] supermarin: has joined #ruby
[23:18:24] Papierkorb: evlute: have a look what type left and right have
[23:19:30] DavidDudson: has joined #ruby
[23:20:07] evlute: thats the thing i don't see the relation to the value method. binarynode inhertis from node. but @left and @right are just variables of BinaryNode
[23:20:46] tomphp: has joined #ruby
[23:20:59] blub`: has joined #ruby
[23:21:26] uris: has joined #ruby
[23:22:04] shanemcd: has joined #ruby
[23:22:24] Papierkorb: evlute: what values are those two initialized to?
[23:23:32] evlute: oh yes i see to ValueNode and the value method :)
[23:23:53] arescorpio: has joined #ruby
[23:23:56] evlute: damn this is crazy, love it :) thank you for making me see :D
[23:24:13] aptrcki: has left #ruby: ()
[23:25:54] stannard: has joined #ruby
[23:29:18] supermarin: has joined #ruby
[23:30:21] lemur: has joined #ruby
[23:31:08] futilegames: has left #ruby: ()
[23:31:24] grill: has joined #ruby
[23:32:59] bmurt: has joined #ruby
[23:33:08] ramfjord: Hey guys, I've got a question about unix pipes in ruby. I've got one process reading from one DB, and another writing to a much slower DB. They are connected by a unix pipe. I want the fast DB to be able to store as much as it could want on the file system, but the process is clearly not getting scheduled once the pipe reaches a certain size. I've found that I can emulate this behavior with the following one line snippet:
[23:33:14] ramfjord: fork { rd.close; 100000.times { |i| wr.write "#{i}\n"; puts i if (i % 5000) == 0 } }
[23:33:41] ramfjord: this will print out up to 10,000 on my machine, but after that will only start printing more once I call wr.read
[23:33:54] Dimik: has joined #ruby
[23:34:02] ramfjord: whoops - forgot the preceding line: rd, wr = IO.pipe
[23:34:15] Papierkorb: ramfjord: sounds like your kernel is blocking after the pipe buffer gets full
[23:35:31] mostlybadfly: has joined #ruby
[23:35:37] ramfjord: Papierkorb: yeah, that makes sense
[23:36:13] shanemcd: has joined #ruby
[23:36:36] M-mistake: has joined #ruby
[23:36:37] M-prosodyContext: has joined #ruby
[23:37:39] ramfjord: hmmm, doesn't look like there's a way I can set any kind of buffer size on IO.pipe - would there likely be a way to configure this through the OS?
[23:38:07] jhass: not that will never write to disk, just use up your RAM
[23:39:55] ramfjord: that must be why it's faster. I guess I'll have to write to a file directly then...
[23:39:59] peterhil`: has joined #ruby
[23:40:48] jhass: /proc/sys/fs/pipe-max-size seems to control the system wide limit, you still need a fcntl to set it for a particular instance and I doubt ruby exposes that
[23:41:26] ascarter: has joined #ruby
[23:41:36] jhass: http://unix.stackexchange.com/a/11954/114480
[23:43:11] ramfjord: right - I'll have to look more into this. I don't know why I assumed a named pipe would just page to disk if necessary, and it wouldn't matter.
[23:43:52] M-Kodo: has joined #ruby
[23:44:25] ramfjord: I need at least 100MB for this, which shouldn't be a problem with the available RAM, but if I IO.read it into memory at the beginning I'll have to wait for the first db read to finish before I can start writing
[23:44:25] FooMunki: has joined #ruby
[23:46:17] jhass: you probably could have a thread and a StringIO, db -> stringio -> fifo -> db
[23:46:33] shanemcd: has joined #ruby
[23:47:29] M-shine: has joined #ruby
[23:48:09] ramfjord: Process 1: (Thread A: DB -> StringIO), (Thread B: StringIO -> FIFO)
[23:48:25] ramfjord: Process 2: (Thread C: FIFO -> DB2)
[23:49:03] ramfjord: eh, seems like it could work
[23:49:32] bmurt: has joined #ruby
[23:50:36] ramfjord: not quite as clean as I was initially hoping, but I'll give it a go
[23:51:09] djbkd_: has joined #ruby
[23:53:01] ramfjord: ahh, nice - IO::copy_stream
[23:53:28] jhass: not sure that works with StringIO though
[23:53:49] ur5us: has joined #ruby
[23:53:52] asteros: has joined #ruby
[23:54:09] axl_: has left #ruby: ()
[23:54:44] lemur: has joined #ruby
[23:56:11] c355E3B: has joined #ruby
[23:56:12] thiagofm: has joined #ruby
[23:56:41] DavidDudson: has joined #ruby
[23:58:16] jgt3: has joined #ruby
[23:58:24] chandlerbing: has joined #ruby
[23:58:36] devoldmx: has joined #ruby
[23:58:36] devbug: has joined #ruby
[23:58:49] bruce_lee: has joined #ruby
[23:58:55] bb010g: has joined #ruby
[23:59:28] ramfjord: I feel like this is going to get ugly writing to the end and reading from the front concurrently