« Back to channel list

#ruby - 27 January 2016

« Back 1 day Forward 1 day »
[00:00:38] tildes: has joined #ruby
[00:00:47] DarkElement: has joined #ruby
[00:01:08] drbrain: DarkElement: https://gist.github.com/DarkElement75/f6e7154d906390d98ad2#file-gistfile1-txt-L12
[00:01:30] ellisTAA: has joined #ruby
[00:01:41] drbrain: DarkElement: you may want to http://www.nokogiri.org/tutorials/installing_nokogiri.html#red_hat___centos
[00:02:14] DarkElement: I looked at that already
[00:02:33] ec: DarkElement: yes?
[00:02:45] drbrain: ec typo of "one sec"
[00:03:41] jamw: has joined #ruby
[00:03:59] bronson: has joined #ruby
[00:04:18] DarkElement: Back and trying.
[00:04:31] DarkElement: Yes, I tried to install zlib
[00:04:37] DarkElement: It also said that was not a package.
[00:05:33] DarkElement: drbrain, any ideas? perhaps I need to search for packages with similar names
[00:05:40] ICantCook: has joined #ruby
[00:06:21] TomPeed: has joined #ruby
[00:06:44] DarkElement: Yea it said I already had zlib installed...
[00:06:44] kirillzh: has joined #ruby
[00:06:58] drbrain: DarkElement: and zlib-devel?
[00:07:38] DarkElement: Oh that might have done it
[00:07:45] snowy: has joined #ruby
[00:07:52] firstdayonthejob: has joined #ruby
[00:08:20] DarkElement: ermegerd it worked thank you
[00:08:27] pdoherty: has joined #ruby
[00:12:11] Abrin: has joined #ruby
[00:12:13] DarkElement: All is well now
[00:12:26] dlitvak: has joined #ruby
[00:14:19] Abrin: Has anyone used Arcadia before? I was just wondering what people's opinions were.
[00:16:45] Ebok: has joined #ruby
[00:17:31] tyrbo: has joined #ruby
[00:21:10] ellisTAA: how does 5 ^ 6 == 3?
[00:21:13] Brando753: has joined #ruby
[00:22:51] pawnbox: has joined #ruby
[00:24:50] nymous: has joined #ruby
[00:28:00] dlitvak: has joined #ruby
[00:30:19] guacamole: has joined #ruby
[00:31:16] alexherbo2: has joined #ruby
[00:32:13] griffindy: has joined #ruby
[00:32:16] baweaver: has joined #ruby
[00:33:12] ellisTAA: can someone say why this doesnt return the reversed string but the normal string ???? https://gist.github.com/ellismarte/39adb3d8e3d57f050863
[00:33:47] unsymbol: has joined #ruby
[00:34:39] ebbflowgo: has joined #ruby
[00:34:53] dlitvak: has joined #ruby
[00:35:49] hxegon: has joined #ruby
[00:36:12] Mon_Ouie: 5 = 0b101, 6 = 0b110, 0b101 XOR 0b110 = 0b011 = 3
[00:36:38] drbrain: ellistaa: maybe looking for **?
[00:39:29] ur5us: has joined #ruby
[00:39:29] hays: has joined #ruby
[00:42:01] akkad: has joined #ruby
[00:42:34] nymous: nah, oj didn't helped much, just 3 minutes less
[00:43:50] gr1zzlybe4r: has joined #ruby
[00:44:33] gr1zzlybe4r: Does Ruby have something equivalent to $PYTHONPATH in Python? Or, does one always need to use "load_path.unshift" to get that functionality?
[00:45:17] weemsledeux: has joined #ruby
[00:46:08] drbrain: gr1zzlybe4r: $RUBYLIB
[00:46:47] mrsolow: has joined #ruby
[00:47:11] drbrain: gr1zzlybe4r: also ruby -I /path/to/your/ruby/files
[00:47:28] dlitvak_: has joined #ruby
[00:48:12] gr1zzlybe4r: drbrain: So, that will allow me to `require "my_script"` for all scripts located in the path's specified by $RUBYLIB?
[00:48:26] gr1zzlybe4r: drbrain: Thanks :)
[00:48:50] drbrain: ruby -I is added in front of RUBYLIB is added in front of gems
[00:49:55] baweaver: has joined #ruby
[00:50:28] B1n4r10: has joined #ruby
[00:51:46] maneco: has joined #ruby
[00:52:22] jgpawletko: has joined #ruby
[00:52:51] pawnbox: has joined #ruby
[00:53:31] maneco: has joined #ruby
[00:55:28] ElFerna: has joined #ruby
[00:55:35] lyoshajapan: has joined #ruby
[00:58:14] lyoshajapan: has joined #ruby
[00:58:39] huQeQwdpu47q: has joined #ruby
[00:58:47] DLSteve: has joined #ruby
[00:59:52] kirillzh: has joined #ruby
[00:59:53] huQeQwdpu47q: has joined #ruby
[01:01:32] jottr_: has joined #ruby
[01:01:35] kies^: has joined #ruby
[01:05:15] Guest57677: has joined #ruby
[01:05:15] Darmani: So I'm building Hangman.
[01:05:18] Darmani: http://ideone.com/9pFk1s
[01:05:24] Darmani: Can you guys tell me what you think of it so far?
[01:05:30] Darmani: It's not finished but tell me if it's okay.
[01:05:40] Liquid--: has joined #ruby
[01:06:10] dlitvak: has joined #ruby
[01:08:40] elifoster: has joined #ruby
[01:09:21] charliesome: has joined #ruby
[01:11:40] scottschecter: has joined #ruby
[01:14:55] usershell: has joined #ruby
[01:15:17] wanderer_: has joined #ruby
[01:15:24] Ebok: has joined #ruby
[01:15:55] wanderer_: has joined #ruby
[01:16:26] stevemackinnon: has joined #ruby
[01:17:28] lyoshajapan: has joined #ruby
[01:17:48] lyoshajapan: has joined #ruby
[01:17:59] Scripore: has joined #ruby
[01:18:52] freerobby: has joined #ruby
[01:19:04] musicnode: has joined #ruby
[01:19:08] mfb2: has joined #ruby
[01:19:17] aspire: has joined #ruby
[01:19:23] dlitvak: has joined #ruby
[01:19:51] tyrbo: has joined #ruby
[01:20:26] dlitvak: has joined #ruby
[01:21:27] tildes: has joined #ruby
[01:21:32] baweaver: Darmani: global variables are not recommended
[01:21:37] ebbflowgo: has joined #ruby
[01:21:38] baweaver: use a constant instead in that case.
[01:21:43] usershell: has joined #ruby
[01:21:57] bb010g: has joined #ruby
[01:22:28] Darmani: baweaver - Done ^.^
[01:22:32] Darmani: Does the logic look okay?
[01:22:34] pawnbox: has joined #ruby
[01:22:36] Darmani: Or is it sketchy?
[01:22:55] baweaver: 22 needs work
[01:23:36] Darmani: I figured... Was it at least a good try? Lol
[01:23:40] baweaver: for contents: CONTENTS = File.read('name').split
[01:23:55] mantas322: has joined #ruby
[01:23:56] baweaver: Look into highline for prompts
[01:24:14] Darmani: highline...? Is that a gem?
[01:24:28] blackgoat: has joined #ruby
[01:24:44] Darmani: baweaver - Alright, thanks dude ^^
[01:24:50] baweaver: also avoid mutating variables in display type methods
[01:24:52] ascarter: has joined #ruby
[01:24:59] baweaver: display_view line 18
[01:25:13] baweaver: instead, I would put that in initialize
[01:25:30] ascarter_: has joined #ruby
[01:25:38] mantas322: So i've been reading recent articles that the ruby community hates black woman and muslims, is this true?
[01:25:51] mantas322: Well I never!
[01:25:56] baweaver: !troll mantas322
[01:25:56] ruby[bot]: +bb mantas322!*@*$#ruby-banned *!*@gateway/web/freenode/ip.73.208.106.255$#ruby-banned
[01:25:56] ruby[bot]: ruby[bot] kicked mantas322: is a bannable offense, see http://ruby-community.com/pages/user_rules
[01:26:08] Darmani: Why'd you kick himmm
[01:26:26] baweaver: meta on trolls is also bannable, feel free to discuss in #ruby-offtopic
[01:26:29] n00bDev: has joined #ruby
[01:26:43] Darmani: Q.Q I guess... I wanted to have a little fun... lol
[01:26:59] baweaver: and that's the end of that, we don't feed trolls
[01:27:03] guacamole: has joined #ruby
[01:27:20] Darmani: Okay boss man.
[01:27:25] casadei: has joined #ruby
[01:27:31] Graphettion: Stay professional and on-topic. enough said.
[01:27:43] Graphettion: There are plenty of other rooms to troll in. :)
[01:27:53] baweaver: Feel free to continue meta-discussion in #ruby-offtopic.
[01:28:03] Darmani: right right right I get it
[01:28:09] Darmani: ACTION sighs
[01:29:37] baweaver: anyways, I would mask that hidden input
[01:29:54] Scriptonaut: could anyone suggest either ideas or a resource for basic commandline ruby program ideas for a beginner? I am trying to coach a friend to get started with ruby and to keep him interested I think I need to help him make useful programs that he can actually see in action
[01:30:10] baweaver: OptParser would be simple
[01:30:15] baweaver: I think Gosu might be more hand
[01:30:19] baweaver: used for games
[01:30:33] baweaver: otherwise I would look into Wicked Cool Ruby Scripts
[01:30:42] Scriptonaut: baweaver: were you responding to me?
[01:30:45] baweaver: or there was one on building CLIs in Ruby
[01:30:54] baweaver: sorry, switching through a few tabs
[01:30:54] Scriptonaut: Oh. Ok so OptParser, wha tis that
[01:30:54] B1n4r10: has joined #ruby
[01:31:18] Graphettion: Scriptonaut: http://tryruby.org/
[01:31:23] guacamole: has joined #ruby
[01:31:35] cpup: has joined #ruby
[01:31:50] Scriptonaut: I just convinced him to compile ruby, so he has it on his system
[01:32:02] baweaver: graphettion: yeah, that too.
[01:32:06] Scriptonaut: baweaver: I'll look at Wicket Cool Ruby Scripts
[01:32:19] baweaver: Most anything by No Starch Press is great on Ruby
[01:32:31] baweaver: There was a Mazes book from Prag Prog earlier
[01:32:34] baweaver: I'd have to find it again
[01:32:45] Graphettion: http://rubinius.com/ is a good compiler
[01:33:36] baweaver: https://pragprog.com/book/jbmaze/mazes-for-programmers
[01:33:37] baweaver: there it is
[01:33:56] Graphettion: http://blog.teamtreehouse.com/coolest-ruby-projects-ever
[01:35:15] ta: has joined #ruby
[01:37:14] Graphettion: https://pragprog.com/book/tpp/the-pragmatic-programmer
[01:37:52] baweaver: Really most anything from PragProg and NoStarch are worth a read
[01:37:54] newbie22: has joined #ruby
[01:38:18] Scriptonaut: I'm mostly looking for just some simple ideas
[01:38:25] Scriptonaut: I'm proficient in ruby, so I can help with the implementation
[01:38:39] Scriptonaut: and he is a poweruser with linux/BSD, so I figured some commandline utilities would be cool
[01:38:46] Scriptonaut: something you can pipe to and it does something useful
[01:38:55] Scriptonaut: or perhaps a hardware monitor (CPU, MEM, battery, etc)
[01:39:01] tyrbo: has joined #ruby
[01:39:43] baweaver: God, Bluepill, Monit, Eye, and a few others.
[01:43:35] dexter-tzu: has joined #ruby
[01:43:38] mfb2: has joined #ruby
[01:45:45] Limix: has joined #ruby
[01:46:25] ElFerna: has joined #ruby
[01:49:04] workmad3: has joined #ruby
[01:49:50] jcdesimp: has joined #ruby
[01:51:24] epi_: has joined #ruby
[01:53:15] tyrbo: has joined #ruby
[01:53:52] CloCkWeRX: has joined #ruby
[01:54:05] ebbflowgo: has joined #ruby
[01:54:15] houhoulis: has joined #ruby
[01:54:21] pdoherty: has joined #ruby
[01:54:26] zoo-zed: has joined #ruby
[01:57:42] Musashi007: has joined #ruby
[01:58:12] blackmesa: has joined #ruby
[02:00:10] k13nox: has joined #ruby
[02:01:10] mattp_: has joined #ruby
[02:02:38] Scriptonaut: has left #ruby: ()
[02:03:06] B1n4r10: has joined #ruby
[02:04:10] bronson: has joined #ruby
[02:04:18] jamw: has joined #ruby
[02:07:47] epi_: has left #ruby: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[02:10:11] kalopsian: has joined #ruby
[02:11:07] guacamole: has joined #ruby
[02:11:22] dstarh: has joined #ruby
[02:16:10] guacamole: has joined #ruby
[02:16:53] guacamole: has joined #ruby
[02:20:00] x77686d: has joined #ruby
[02:21:26] pontiki: has joined #ruby
[02:24:09] kbni: is there any issue with having labels being mixed-case?
[02:24:13] guacamole: has joined #ruby
[02:24:14] kbni: :LikeThis?
[02:25:09] paradisaeidae: has joined #ruby
[02:30:08] Radar: kbni: labels in what context?
[02:32:50] Coldblackice: has joined #ruby
[02:32:52] tyrbo: has joined #ruby
[02:33:01] baweaver: has joined #ruby
[02:35:40] countryHick: has joined #ruby
[02:37:31] ta: has joined #ruby
[02:38:50] wanderer: has joined #ruby
[02:41:29] tenderlove: has joined #ruby
[02:42:58] hannelita: has joined #ruby
[02:43:17] al2o3-cr: has joined #ruby
[02:44:11] akem: has joined #ruby
[02:48:51] basic`: has joined #ruby
[02:49:17] basic`: hi all, i'm trying to parse some "csv" style data into an array and having quite a bit of trouble dealing with quotes
[02:49:31] basic`: http://pastebin.com/GRd438zB
[02:49:32] ruby[bot]: basic`: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/8c5d463e0b10052d6f30
[02:49:34] ruby[bot]: basic`: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[02:49:47] basic`: thanks ruby[bot]
[02:50:09] kbni: Radar, in a list of fields to iterate over
[02:50:26] Radar: kbni: Do you have some code you can show us?
[02:50:29] basic`: you can see that first column is getting split even though there are quotes
[02:50:47] basic`: if i use double quotes, i get an error "CSV::MalformedCSVError: Illegal quoting in line 1."
[02:50:52] kbni: inside class Foo.. self.fields = [ :id, :name, :ProjectID ]
[02:51:00] kbni: then self.field is iterated over
[02:51:07] Radar: basic`: It's not CSV though
[02:51:10] basic`: i'm not sure how to get this thing to work correctly, or maybe i should give up on csv and use some regex
[02:51:20] Radar: basic`: Look at the ShellWords package. It might get you closer.
[02:51:27] basic`: shellwords? okay
[02:51:29] basic`: thanks, lemme look
[02:51:41] kbni: Radar, sorry, is that enough? otherwise.. https://github.com/scoop/autotask_api/blob/master/lib/autotask_api/account.rb
[02:51:45] kbni: iterated over then by https://github.com/scoop/autotask_api/blob/master/lib/autotask_api/entity.rb
[02:51:58] Radar: kbni: No, there's no issue with having them like that.]
[02:52:05] Radar: kbni: But I guess if you're asking about it you might be seeing an issue?
[02:52:21] Radar: I guess if it's an API you don't get to control if they're project_Id instead ProjectID
[02:52:23] Radar: project_id*
[02:52:25] kbni: I'm not seeing an issue - I'm new to ruby and it's nuanced ways, I'm just wondering why the original author has done it like that
[02:52:29] Radar: You could snake case them
[02:52:35] kbni: snake case?
[02:52:38] Radar: kbni: probably just for compat with the API
[02:52:42] Radar: kbni: this_is_snake_case
[02:52:44] kbni: The problem is the API uses camelcase, and does not change
[02:53:38] kbni: so whilst :resourceid.to_s.camelize.gsub(/ID$/, 'ID') changes it to ResourceID correctly, :projectworktypeid needs to change it to ProjectWorkTypeID
[02:53:55] kbni: I'm wondering why the author simply didn't populate fields with [ :ProjectID, :ProjectWorkTypeID ] etc
[02:54:04] chouhoulis: has joined #ruby
[02:55:54] weemsledeux: has joined #ruby
[02:57:35] Bloomer: has joined #ruby
[02:57:35] basic`: Radar: hm, not seeing how shellsplit helps... i need to create an array out of https://gist.github.com/anonymous/8c5d463e0b10052d6f30 basically (added a comment there)
[02:57:54] Radar: basic`: Sorry, I thought it might but I guess it didn't :(
[02:58:27] basic`: no worries, i was needing something to help me feel some hopefulness :)
[02:59:08] blackmesa: has joined #ruby
[02:59:47] kcantwel: has joined #ruby
[03:00:03] al2o3-cr: basic`: it does return an array
[03:01:04] kbni: Is it possible to do a case insensitive search for a node in xpath/nokogiri?
[03:01:27] k13nox: has joined #ruby
[03:01:29] System42: has joined #ruby
[03:02:02] pawnbox: has joined #ruby
[03:02:07] arlek: has joined #ruby
[03:02:22] basic`: al2o3-cr: ya, but it doesn't split properly with the commas
[03:02:33] al2o3-cr: Yeah, I see that now
[03:02:47] aeontech: has joined #ruby
[03:03:12] basic`: i'm trying to understand its gsub
[03:03:49] mrsolow: has joined #ruby
[03:03:53] n00bDev: has joined #ruby
[03:04:39] skcin7: has joined #ruby
[03:08:00] ljames: has joined #ruby
[03:08:07] govg: has joined #ruby
[03:08:31] usershell: has joined #ruby
[03:09:00] ljames: has joined #ruby
[03:09:12] basic`: odd, i get a premature end of class if i try and define it myself
[03:09:22] devbug: has joined #ruby
[03:12:34] ramfjord: has joined #ruby
[03:13:02] wheresmyjetpack: has joined #ruby
[03:13:21] duckpuppy: has joined #ruby
[03:19:36] basic`: hey, it's really close... need to make sure it doesn't strip quotes from inside of the quotes...
[03:20:43] tenderlove: has joined #ruby
[03:21:00] basic`: https://gist.github.com/anonymous/8c5d463e0b10052d6f30 :)
[03:21:34] basic`: guessin dq == doublequote
[03:23:35] A124: has joined #ruby
[03:27:14] Pande: has joined #ruby
[03:32:08] konsolebox: has joined #ruby
[03:32:23] VeganGreg: has joined #ruby
[03:32:34] A124: has joined #ruby
[03:34:19] mousier: has joined #ruby
[03:37:50] workmad3: has joined #ruby
[03:38:30] pantato: has joined #ruby
[03:38:53] SenpaiSilver: has joined #ruby
[03:39:18] ta: has joined #ruby
[03:39:37] Musashi007: has joined #ruby
[03:40:07] rkazak: has joined #ruby
[03:41:19] toretore: has joined #ruby
[03:42:13] nbdy: has joined #ruby
[03:44:40] devbug: has joined #ruby
[03:48:19] basic`: got it! thanks for the pointer Radar -- i was able to slightly modify that regex and make this work
[03:48:37] CloCkWeRX: has left #ruby: ()
[03:48:47] robbyoconnor: has joined #ruby
[03:48:48] basic`: https://github.com/grigarr/puppetlabs-accounts/blob/master/lib/puppet/functions/accounts_ssh_options_parser.rb :)
[03:48:53] TomPeed: has joined #ruby
[03:49:12] robbyoconnor: has joined #ruby
[03:49:33] ss_much: has joined #ruby
[03:53:02] hannelita: has joined #ruby
[03:55:55] Guest49796: has joined #ruby
[03:58:46] hlegius: has joined #ruby
[04:00:43] VeganGreg: How good does one need to be at programming to get an entry level developer job? I've been teaching myself ruby/rails/and jquery for about a year and am trying to figure out whether I might be decent enough to start looking for a gig.
[04:01:27] blackmesa: has joined #ruby
[04:02:03] kies^: has joined #ruby
[04:02:37] baweaver: has joined #ruby
[04:02:42] al2o3-cr: basic`: this should work: options.scan(/(?:\'[^'']*\'|[^,])+/)
[04:03:21] basic`: al2o3-cr: oh fancy
[04:03:48] k13nox: has joined #ruby
[04:04:37] basic`: al2o3-cr: that's much cleaner
[04:05:03] jamw: has joined #ruby
[04:05:07] krz: has joined #ruby
[04:05:29] nofxx: has joined #ruby
[04:05:29] nofxx: has joined #ruby
[04:05:52] al2o3-cr: yours is a bit OTT
[04:06:36] bronson: has joined #ruby
[04:07:36] zacts: has joined #ruby
[04:08:32] basic`: huh, oh i see what's happening
[04:08:47] basic`: it almost works al2o3-cr -- it's not escaping / removing some of the inner quotes correctly
[04:09:30] basic`: ["from=\"10.1.1.42", "10.1.1.41\"", "no-port-forwarding", -- the quotes inside of the from="ip,ip" need to go away
[04:09:35] slackbotgz: has joined #ruby
[04:10:24] treaki_: has joined #ruby
[04:11:28] al2o3-cr: basic`: options.scan(/(?:\'[^'']*\'|[^,])+/).map { |h| h.tr("'", '') } ?
[04:12:36] basic`: same output it looks like
[04:12:47] basic`: it's okay, i can use the slightly modified shellprint stuff
[04:13:05] jackjackdripper: has joined #ruby
[04:13:19] al2o3-cr: Ah, is the whole string single quoted?
[04:14:15] Scripore: has joined #ruby
[04:14:56] al2o3-cr: basic`: if it is, use: options.scan(/(?:\"[^""]*\"|[^,])+/).map { |h| h.tr('"', '') }
[04:15:41] tjbiddle: has joined #ruby
[04:16:02] Radar: vegangreg: the demand is high enough now that you could probably start applying for jobs and get them
[04:16:24] casadei: has joined #ruby
[04:16:40] VeganGreg: that's definitely encouraging---I've read that the demand is quite high
[04:18:26] toretore: has joined #ruby
[04:19:16] VeganGreg: I'm moving to Portland next month and am planning on starting to apply for work when I get there
[04:19:31] zast: has joined #ruby
[04:19:34] braincrash: has joined #ruby
[04:19:35] DarkElement: has joined #ruby
[04:23:07] pdoherty: has joined #ruby
[04:23:09] Renich: has joined #ruby
[04:23:21] devbug_: has joined #ruby
[04:23:59] Radar: Oh neat. They have a good Ruby group there iirc.
[04:24:25] czsr: has joined #ruby
[04:24:58] Abrin: I am so glad that someone recommend the book 'Practical Object-Oriented Design in Ruby' it is flippin amazing!
[04:25:22] Abrin: sorry....just got overexcited there for a second and had to share with the group. :)
[04:25:35] Radar: Abrin: that's alright :) Excited sharing is best sharing.
[04:25:52] pawnbox: has joined #ruby
[04:26:27] Abrin: This group has great book recommendations.
[04:26:48] iateadonut: has joined #ruby
[04:27:01] s00pcan: has joined #ruby
[04:28:23] VeganGreg: Radar: it looks like that's true---also planning on gettin involved with the meetup groups and whatnot
[04:29:47] VeganGreg: any job hunting advice/things to watch out for in the programming job world would be appreciated
[04:30:05] Radar: never work for equity
[04:30:12] jamw: has joined #ruby
[04:30:16] Radar: man, so many things :P
[04:30:25] Abrin: sorry to ask a stupid question, but what is equity?
[04:30:27] Radar: Ask around at the Ruby meetups. They'll give you better advice than an IRC channel can
[04:30:41] Radar: Abrin: A share of the eventual profit of the business.
[04:30:56] eam: you should totally work for equity -- but only if you understand how it works
[04:31:10] Abrin: Oh yes, I can see how one could live to regret that.
[04:31:12] baweaver: eam likes equity right now
[04:31:18] eam: equity sharing is why silicon valley is full of millionaires
[04:31:27] wonk: has joined #ruby
[04:31:34] eam: (and by full I mean actually full)
[04:31:44] baweaver: eam worked for Square when they went public, and still does.
[04:31:44] Radar: Would be nice if some of that VC money made its way to AU :P)
[04:31:54] Abrin: I heard SF is going through another bubble. I get why the first one existed but the second is a mystery to me.
[04:32:21] eam: baweaver: been a fan of working for an equity mix my whole life
[04:32:32] VeganGreg: it seems like there are lots of legal issues surrounding equity compensation that are quite difficult to understand
[04:32:43] Abrin: I actually have no idea what Square is. I've been living in bliss when it comes to anything in the world of business.
[04:32:51] Radar: square.com
[04:33:06] eam: vegangreg: one of the larger angles is that you can push earnings into capital gains
[04:33:17] Abrin: I remember when the first bubble came around all my friends kept talking about vesting. They were millionares overnight and hten lost those millions overnight.
[04:33:19] eam: but there are a ton of complications with doing that
[04:33:30] s00pcan: has joined #ruby
[04:33:40] baweaver: I'm pretty well pure salary at this point
[04:33:49] eam: Abrin: the key about any investing, whether through your labor or buying stocks for cash, is to be conservative and plan for the worst
[04:34:01] baweaver: though with SIE's formation, I might see about some stock sharing / etc coming up...
[04:34:07] eam: the folks who "lost millions" never really had them
[04:34:14] Abrin: eam: Yes, but everyone always thinks they are going to get out with their money before the worst happens. Hee hee.
[04:34:25] Musashi007: has joined #ruby
[04:34:30] eam: lots of over-leveraged people in any industry
[04:34:34] Abrin: eam: Oh yes, it was a paper shuffle. I mean Redhat sold for $100 a share at one point.
[04:34:40] VeganGreg: and there seem to be a lot of issues with actually being able to sell your shares when you terminate your employment
[04:34:55] VeganGreg: lots of restrictions in the contract
[04:35:07] eam: I have a buddy who worked at apple from the late 90s to late 00s. He regularly sold his stock as it vested over the decade he was there
[04:35:27] eam: it would've been worth a LOT more if he had held it, but he's happy he sold it because it fit the risk profile he had at the time
[04:35:32] Abrin: eam: Lucky buddy!
[04:35:39] eam: (and his previos gig was netscape, where he saw a lot of coworkers hold then fold)
[04:35:52] RegulationD: has joined #ruby
[04:36:14] eam: chickens, hatch, reasonable expectations, etc
[04:36:34] Abrin: I know people who worked for Microsoft as 'non-employees' even though they were employees with that big lawsuit-thingy back in the day
[04:36:42] eam: Abrin: I did that as well
[04:36:58] eam: I was an orange-badge msft temp
[04:37:16] Abrin: netscape...damn I miss that browser. Firefox makes me miserable these days.
[04:37:26] eam: it was immediately after the perma-temp lawsuit, they treated us very well
[04:38:12] baweaver: ah, eam, I have a new employer now
[04:38:22] eam: oh yeah? where'd you hop to?
[04:38:34] baweaver: Sony Interactive Entertainment :P
[04:38:40] baweaver: (restructure)
[04:38:43] tlarevo: has joined #ruby
[04:38:51] eam: I was gonna say, weren't you already at sony?
[04:38:52] baweaver: they have an emergency meeting to tell us about it
[04:39:03] baweaver: happened some time yesterday
[04:39:21] Abrin: I'd ask why the heck there is a second bubble but I don't want to get too OT in the channel. If anyone is ever in #ruby-offtopic I'd love to hear about it there.
[04:39:36] eam: I'm in there, happy to chat
[04:39:44] shevy: Abrin is this nostalgia here :D
[04:39:55] krz: has joined #ruby
[04:40:02] ta: has joined #ruby
[04:40:09] jottr: has joined #ruby
[04:40:36] shevy: "netscape geocities-browsing marquee-tag loving pinkish-homepage fossil visitors"!
[04:41:26] Abrin: come with us to #ruby-oftopic shevy. We are getting all nostalgic in there. :)
[04:42:00] shevy: they play unicode hangman there :<
[04:42:13] eam: bring back the blink tag
[04:43:56] al2o3-cr: shevy: not anymore, the bot is brown bread :(
[04:44:13] Abrin: ACTION snickers....bring back the bling tag.
[04:47:03] DarkElement: How can I get the html of a page/ use nokogiri or open-uri through a proxy?
[04:48:16] benlovell: has joined #ruby
[04:48:34] DiCablo: has joined #ruby
[04:49:43] User458764: has joined #ruby
[04:49:43] barajasfab: has joined #ruby
[04:53:05] al2o3-cr: DarkElement: how do you mean?
[04:53:44] hannelita: has joined #ruby
[04:53:44] DarkElement: New question, since you can do that with http://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html, can I parse the output of this with Nokogiri?
[04:54:11] al2o3-cr: DarkElement: yes
[04:54:36] DarkElement: Ok. al2o3-cr, any place you can recommend for proxies? I've not used them in this fashion before.
[04:54:58] usershell: has joined #ruby
[04:55:13] al2o3-cr: DarkElement: What do you need a proxy for?
[04:56:04] DarkElement: So that craigslist doesn't ip block me when I make a bunch of asynchronous requests with my army of web scrapers.
[04:56:41] tildes: has joined #ruby
[04:57:20] DarkElement: Is there a simple website where they are constantly adding new proxies?
[04:57:44] al2o3-cr: DarkElement: I don't know of any off hand
[04:57:57] DarkElement: No problem, not really a #ruby question anyway
[04:58:09] al2o3-cr: DarkElement: btw, open-uri takes a proxy
[04:59:47] DarkElement: I tried that earlier and it wasn't working though
[05:00:04] al2o3-cr: What was you trying?
[05:00:27] Ebok: has joined #ruby
[05:01:10] DarkElement: Idk, I don't have the code. It resembled the example online, however
[05:03:15] blackmesa: has joined #ruby
[05:03:18] usershell: has joined #ruby
[05:03:19] underplank: has joined #ruby
[05:03:32] CloCkWeRX: has joined #ruby
[05:05:53] duncannz: has joined #ruby
[05:08:55] houhoulis: has joined #ruby
[05:10:29] htmldrum: has joined #ruby
[05:11:10] yuung: has joined #ruby
[05:13:10] usershell: has joined #ruby
[05:14:15] lemur: has joined #ruby
[05:16:54] joneshf-laptop: has joined #ruby
[05:16:57] yfeldblum: has joined #ruby
[05:21:26] lxsameer: has joined #ruby
[05:23:11] Ebok: has joined #ruby
[05:23:24] pawnbox_: has joined #ruby
[05:23:47] tenderlove: has joined #ruby
[05:24:57] Limix: has joined #ruby
[05:25:27] Radar: Nokogiri::HTML.parse
[05:25:31] DarkElement: Net::HTTP.new(url, nil, proxy_addr, proxy_port).start{ |http| } is never executing, anyone have any ideas what i'm doing wrong ?
[05:25:38] Radar: DarkElement: HTTParty.get
[05:26:03] DarkElement: What does that do?
[05:26:16] Radar: I'm assuming you want to make HTTP requests easily?
[05:26:22] DarkElement: Yea, with a proxy
[05:26:24] Radar: And you're using Net::HTTP because... you don't want to make them easily?
[05:26:27] Radar: http://support.quotaguard.com/support/solutions/articles/5000013940-getting-started-with-the-httparty-gem-quotaguard-static
[05:26:31] DarkElement: I thought that was the way to do it
[05:26:41] Radar: HTTParty has a much nicer API than Net::HTTP.
[05:27:31] DarkElement: This doesn't look any "nicer" than net/http
[05:27:37] blackgoat: has joined #ruby
[05:27:40] DarkElement: But if it's faster, then yea i'm down
[05:28:26] DarkElement: Radar, what does quotaguardstatic have to do with it?
[05:28:34] Radar: DarkElement: Why do you fail to read.
[05:28:44] Radar: DarkElement: It's an example of using a proxy with HTTParty in Ruby.
[05:28:50] Radar: The first result on google for "httparty proxy"
[05:29:05] Radar: Rather than messing around with Net::HTTP's frankly awful API
[05:30:19] pawnbox: has joined #ruby
[05:31:29] droptone: Question: I'm leveraging ActiveRecord in my Ruby project and I've got the class definitions set to mimick a corresponding Rails project, with dependent: :destroy elements set in the classes
[05:31:52] droptone: If, within the Ruby project, I .destroy an object, will ActiveRecord by default destroy all dependent records?
[05:32:34] karapetyan: has joined #ruby
[05:32:50] GinoManWorks_: has joined #ruby
[05:34:49] karapetyan: has joined #ruby
[05:36:52] dlitvak: has joined #ruby
[05:36:54] govg: has joined #ruby
[05:37:32] ramfjord: has joined #ruby
[05:38:41] ReK2: has joined #ruby
[05:39:24] tyrbo: has joined #ruby
[05:39:27] Radar: ?code droptone
[05:39:27] ruby[bot]: droptone: We can't help you without your code, please post it to https://gist.github.com
[05:39:44] karapetyan: has joined #ruby
[05:40:17] GinoManWorks: has joined #ruby
[05:41:36] oivoodoo: has joined #ruby
[05:42:08] jottr: has joined #ruby
[05:42:26] colegatron: has joined #ruby
[05:48:40] rkazak: has joined #ruby
[05:49:27] droptone: Radar: It's a question. I have the same dependent: :destroy declerations in my classes that one would have in a Rails model. If I .destroy a model in my Ruby project, will it automatically destroy the dependent classes like it would in Rails?
[05:49:35] droptone: Do I really need to post code for this?
[05:49:38] Radar: droptone: Yes.
[05:49:42] droptone: Ok, thank you.
[05:49:45] Radar: droptone: I want to know that we're talking about the same things.
[05:49:52] droptone: Ok, hang on.
[05:51:46] oivoodoo: has joined #ruby
[05:52:46] droptone: Radar: https://gist.github.com/anonymous/5980902e6d9671a0ed33
[05:53:00] Radar: droptone: ok, thanks.
[05:53:09] Radar: droptone: Yes, ActiveRecord works the same no matter where you use it.
[05:53:15] droptone: Perfect, thank you.
[05:54:52] jackjackdripper: has joined #ruby
[05:55:53] terminalrecluse: has joined #ruby
[05:55:56] hannelita: has joined #ruby
[05:57:09] akem: has joined #ruby
[05:59:39] yoongkang: has joined #ruby
[05:59:57] ur5us: has joined #ruby
[06:04:54] dionysus69: has joined #ruby
[06:05:01] blackmesa: has joined #ruby
[06:08:44] bronson: has joined #ruby
[06:08:45] Brklyn: has joined #ruby
[06:09:04] al2o3-cr: has joined #ruby
[06:09:09] wolffles: has joined #ruby
[06:09:10] arup_r: has joined #ruby
[06:15:19] duckpuppy: has joined #ruby
[06:16:07] marcdel: has joined #ruby
[06:16:24] Ilyes512: has joined #ruby
[06:17:02] sigurding: has joined #ruby
[06:17:24] valeri_ufo: has joined #ruby
[06:20:36] marcdel_: has joined #ruby
[06:21:33] al2o3-cr: has joined #ruby
[06:22:13] mc_fail: has joined #ruby
[06:22:24] mattp_: has joined #ruby
[06:22:38] darkf: has joined #ruby
[06:25:38] puria: has joined #ruby
[06:30:23] joneshf-laptop: has joined #ruby
[06:33:30] ponga: has joined #ruby
[06:37:08] ur5us: has joined #ruby
[06:39:30] pengus: has joined #ruby
[06:39:35] Macaveli: has joined #ruby
[06:41:48] rkazak: has joined #ruby
[06:42:24] VeganGreg: has joined #ruby
[06:42:35] ta: has joined #ruby
[06:42:36] aganov: has joined #ruby
[06:42:52] jottr: has joined #ruby
[06:43:13] wolffles: another way to do: ary[1]*ary[21]*ary[41]*ary[61]
[06:43:53] flughafen: morning shevy
[06:43:57] flughafen: ACTION just got back from japan
[06:45:16] mdw: has joined #ruby
[06:45:18] terminalrecluse: has joined #ruby
[06:45:23] solars: has joined #ruby
[06:46:50] shevy: yo flughafen - one day airplanes will fly from berlin again!
[06:46:55] kennyfrc: has joined #ruby
[06:48:16] baweaver: wolffles: what have you tried?
[06:48:27] baweaver: and what is the entire problem?
[06:48:38] baweaver: remember arrays start at index 0 as well
[06:48:47] manveru: wolffles:ary.values_at(1,21,41,61).reduce(:*)
[06:48:56] usershell: has joined #ruby
[06:49:13] eggoez: has joined #ruby
[06:49:21] wolffles: thats what i was looking for
[06:49:40] manveru: i know what you need baby
[06:49:48] wolffles: i was trying to do a splat and inject
[06:50:37] manveru: well, there might be another way if you always need it in steps of 20, but right now it would just make stuff longer
[06:53:36] devlitzi: has joined #ruby
[06:53:44] shevy: "<manveru> i know what you need baby" lol, one more IRC quote to add for my epic collection
[06:54:49] chouhoulis: has joined #ruby
[06:56:10] aufi: has joined #ruby
[06:56:38] wolffles: manveru thanks
[06:56:58] jordanm: has joined #ruby
[06:57:06] ohcibi: has joined #ruby
[06:57:08] jcdesimp: has joined #ruby
[07:00:49] n00bDev: has joined #ruby
[07:01:40] TomyLobo: has joined #ruby
[07:03:39] ledestin: has joined #ruby
[07:04:41] benlovell: has joined #ruby
[07:04:50] hannelita: has joined #ruby
[07:04:53] Pupp3tm4st3r: has joined #ruby
[07:05:56] arup_r: has joined #ruby
[07:06:48] blackmesa: has joined #ruby
[07:10:16] oivoodoo: has joined #ruby
[07:11:03] arup_r: has joined #ruby
[07:13:23] aeontech: has joined #ruby
[07:13:37] duncannz: has joined #ruby
[07:13:55] user: has joined #ruby
[07:15:42] karapetyan: has joined #ruby
[07:18:05] rkazak: has joined #ruby
[07:18:36] ss_much_: has joined #ruby
[07:18:48] tyrbo: has joined #ruby
[07:19:02] Pupp3tm4st3r: has joined #ruby
[07:19:24] huQeQwdpu47q_: has joined #ruby
[07:19:34] guacamole: has joined #ruby
[07:20:44] ReK2GnULinuX: has joined #ruby
[07:21:21] pengus: has joined #ruby
[07:21:25] colegatron_origi: has joined #ruby
[07:22:26] symm-: has joined #ruby
[07:24:02] andikr: has joined #ruby
[07:24:31] sigurding: has joined #ruby
[07:27:06] alexherbo2: has joined #ruby
[07:29:55] hakunin: has joined #ruby
[07:30:26] jackjackdripper: has joined #ruby
[07:31:10] marcdel: has joined #ruby
[07:34:51] kerunaru: has joined #ruby
[07:38:11] mdw: has joined #ruby
[07:39:18] anisha_: has joined #ruby
[07:39:37] scepticulous: has joined #ruby
[07:41:33] firstdayonthejob: has joined #ruby
[07:41:46] Xiti: has joined #ruby
[07:41:59] al2o3-cr: has joined #ruby
[07:43:33] VeganGreg: has joined #ruby
[07:43:36] jottr: has joined #ruby
[07:45:53] visudo: has joined #ruby
[07:47:34] tvw: has joined #ruby
[07:47:50] User458764: has joined #ruby
[07:48:40] benlovell: has joined #ruby
[07:51:22] CloCkWeRX: has joined #ruby
[07:51:52] last_staff: has joined #ruby
[07:52:47] troulouliou_div2: has joined #ruby
[07:54:06] Jet4Fire: has joined #ruby
[07:57:44] PedramT: has joined #ruby
[07:58:14] duckpuppy: has joined #ruby
[07:58:53] PedramT_: has joined #ruby
[07:59:23] Azulinho: has joined #ruby
[07:59:43] tituspull0: has joined #ruby
[08:00:25] VeganGreg: has joined #ruby
[08:02:03] skade: has joined #ruby
[08:03:09] anisha_: has joined #ruby
[08:03:42] ta: has joined #ruby
[08:03:42] duncannz: has joined #ruby
[08:04:29] howdoi: has joined #ruby
[08:05:07] ddv: test failed
[08:05:32] hannelita: has joined #ruby
[08:07:45] Ebok: has joined #ruby
[08:09:50] blackmesa: has joined #ruby
[08:10:03] TomyWork: has joined #ruby
[08:10:21] bronson: has joined #ruby
[08:11:46] aufi: has joined #ruby
[08:12:42] Azulinho: has joined #ruby
[08:13:36] tjbiddle: has joined #ruby
[08:15:12] SCHAAP137: has joined #ruby
[08:16:39] tomphp: has joined #ruby
[08:20:33] AlexJakeGreen: has joined #ruby
[08:20:50] yardenbar: has joined #ruby
[08:21:01] lkba: has joined #ruby
[08:24:03] ferr: has joined #ruby
[08:25:09] pawnbox: has joined #ruby
[08:26:33] speaking1ode: has joined #ruby
[08:26:47] PedramT: has joined #ruby
[08:27:22] yoongkang: has joined #ruby
[08:27:33] drbrain: has joined #ruby
[08:28:11] blackms: has joined #ruby
[08:30:40] gregf_: oops :| sorry
[08:31:20] smileart: has joined #ruby
[08:31:54] ramfjord: has joined #ruby
[08:32:07] blur3d: has joined #ruby
[08:32:24] mark2: has joined #ruby
[08:34:27] einarj: has joined #ruby
[08:35:41] ddv: gregf_: /Users/ddv/Development
[08:36:55] workmad3: has joined #ruby
[08:37:57] mdw: has joined #ruby
[08:41:09] kerunaru: has joined #ruby
[08:43:38] kerunaru: has joined #ruby
[08:44:03] sepp2k: has joined #ruby
[08:44:27] jottr: has joined #ruby
[08:44:39] codecop: has joined #ruby
[08:45:32] sftrabbit: has joined #ruby
[08:46:08] burbus: has joined #ruby
[08:47:42] jbrhbr: has joined #ruby
[08:49:14] berserk_ren: has joined #ruby
[08:49:36] workaccounthuehu: has joined #ruby
[08:49:57] mikecmpbll: has joined #ruby
[08:50:51] nettoweb: has joined #ruby
[08:51:13] ta: has joined #ruby
[08:51:42] atomical: has joined #ruby
[08:53:09] atomical_: has joined #ruby
[08:53:13] blaxter: has joined #ruby
[08:53:44] mdw: has joined #ruby
[08:54:56] tyrbo: has joined #ruby
[08:55:29] burgestrand: has joined #ruby
[08:55:33] dkam: has joined #ruby
[08:55:54] atomical_: has joined #ruby
[08:56:43] pcoke_: has joined #ruby
[08:57:24] coyo: has joined #ruby
[08:57:49] jcdesimp: has joined #ruby
[08:58:58] sandstrom: has joined #ruby
[08:59:30] Xeago: has joined #ruby
[09:02:26] moshee: has joined #ruby
[09:02:42] moshee: has joined #ruby
[09:03:05] VeganGreg: has joined #ruby
[09:03:29] drptbl: has joined #ruby
[09:04:20] duncannz: has joined #ruby
[09:06:18] hannelita: has joined #ruby
[09:08:20] duncannz: has joined #ruby
[09:08:43] catbusters: has joined #ruby
[09:09:04] kp666: has joined #ruby
[09:09:07] mdw: has joined #ruby
[09:09:39] kp666: has joined #ruby
[09:10:04] c0m0: has joined #ruby
[09:10:21] kp666: has joined #ruby
[09:11:02] kp666: has joined #ruby
[09:11:44] k13nox: has joined #ruby
[09:11:45] kp666: has joined #ruby
[09:12:30] kp666: has joined #ruby
[09:12:47] Brklyn: has joined #ruby
[09:12:48] devlitzi: has joined #ruby
[09:12:52] blackmesa: has joined #ruby
[09:13:17] kp666: has joined #ruby
[09:13:20] duncannz: has joined #ruby
[09:14:09] yoongkang: has joined #ruby
[09:16:04] tomphp: has joined #ruby
[09:16:24] UtkarshRay: has joined #ruby
[09:17:04] DoubleMalt: has joined #ruby
[09:18:10] rdark: has joined #ruby
[09:18:53] kirillzh: has joined #ruby
[09:20:11] ramlem: has joined #ruby
[09:24:20] PedramT: has joined #ruby
[09:24:41] lurch_: has joined #ruby
[09:24:56] shredding: has joined #ruby
[09:26:20] FooMunki: has joined #ruby
[09:27:42] snowy: has joined #ruby
[09:28:57] rodfersou: has joined #ruby
[09:33:27] zarubin: has joined #ruby
[09:36:28] Luna_Moonfang: has joined #ruby
[09:37:14] govg: has joined #ruby
[09:37:50] Luna_Moonfang: has joined #ruby
[09:38:15] benlovell: has joined #ruby
[09:39:01] tyrbo: has joined #ruby
[09:40:08] k13nox: has joined #ruby
[09:41:40] huyderman: has joined #ruby
[09:42:33] k13nox: has joined #ruby
[09:42:36] astrobun_: has joined #ruby
[09:44:14] hannelita: has joined #ruby
[09:44:47] chussenot: has joined #ruby
[09:45:07] jottr: has joined #ruby
[09:46:31] Wizek: has joined #ruby
[09:50:08] baweaver: has joined #ruby
[09:53:35] kerunaru: has joined #ruby
[09:54:31] evidex: has joined #ruby
[09:54:59] einarj: has joined #ruby
[09:55:02] marr: has joined #ruby
[09:56:12] sftrabbit: has joined #ruby
[09:58:24] FooMunki: has joined #ruby
[09:59:00] chthon: has joined #ruby
[10:00:56] CloCkWeRX: has joined #ruby
[10:01:08] bronson: has joined #ruby
[10:02:36] pawnbox: has joined #ruby
[10:03:38] VeganGreg: has joined #ruby
[10:03:42] sandstrom: has joined #ruby
[10:04:04] sandstrom: I have a global constant named `PIPELINE`, and I don't quite understand where its coming from. Is this a native ruby thing, or just some weirdness in my project or a gem?
[10:04:27] zeroDivisible: has joined #ruby
[10:05:16] skade: has joined #ruby
[10:05:29] yorickpeterse: sandstrom: could be that another Gem/file defines it
[10:05:51] sandstrom: yorickpeterse Yes, I guess (that or Ruby, but I couldn't find anything in the Ruby docs)
[10:06:01] benlovell: has joined #ruby
[10:06:03] hannelita: has joined #ruby
[10:06:42] yorickpeterse: I don't think Ruby itself defines PIPELINE anywhere
[10:07:00] yorickpeterse: constants don't have any source location information attached by default, so it's hard to figure out where it comes from
[10:08:18] sandstrom: yorickpeterse I found a probable suspect via `seek = PIPELINE.to_s.underscore; $".detect{ |load_path| load_path.include?(seek) }`
[10:08:37] mr_blue: has joined #ruby
[10:09:11] dlitvak: has joined #ruby
[10:09:16] dwfait: has joined #ruby
[10:09:39] yorickpeterse: well that doesn't define it, that just references it
[10:10:26] tyrbo: has joined #ruby
[10:11:12] anisha_: has joined #ruby
[10:13:22] h99h9h88: has joined #ruby
[10:13:34] chipotle: has joined #ruby
[10:15:55] platzhirsch: has joined #ruby
[10:16:56] stamina: has joined #ruby
[10:17:43] moei: has joined #ruby
[10:18:07] konsolebox: has joined #ruby
[10:19:59] Ox0dea: sandstrom: Why not just redefine it to trick the interpreter into warning you about its previous definition?
[10:20:25] PedramT_: has joined #ruby
[10:20:43] joonty: has joined #ruby
[10:22:02] Cohedrin: has joined #ruby
[10:22:13] User458764: has joined #ruby
[10:23:12] Cohedrin: has joined #ruby
[10:23:42] gregf_: hello, does capistrano execute the .bashrc/.bash_profile always? or do i need to source it explicitly?
[10:23:55] the_drow: has joined #ruby
[10:25:05] sandstrom: Ox0dea clever idea!
[10:25:10] dkam: has joined #ruby
[10:26:26] PedramT: has joined #ruby
[10:26:53] mdw7: has joined #ruby
[10:27:38] dlitvak: has joined #ruby
[10:27:46] arup_r: has joined #ruby
[10:29:14] skade: has joined #ruby
[10:29:16] ddv: gregf_: http://capistranorb.com/documentation/faq/why-does-something-work-in-my-ssh-session-but-not-in-capistrano/#
[10:29:20] platzhirsch: has left #ruby: ()
[10:29:33] Ishido: has joined #ruby
[10:31:35] gregf_: ddv: thanks, i'll just source it in one of the tasks where i restart apache :|
[10:32:47] the_drow: Is there a recommended logging library you guys use?
[10:32:53] gbgdev: has joined #ruby
[10:32:53] VeganGreg: has joined #ruby
[10:33:00] benlovell: has joined #ruby
[10:33:11] Azulinho: has joined #ruby
[10:34:21] Ox0dea: >> require 'logger' # the_drow
[10:34:23] ruby[bot]: Ox0dea: # => true (https://eval.in/508689)
[10:34:56] the_drow: I know that ruby has a logging library
[10:35:08] govg: has joined #ruby
[10:35:08] Ox0dea: I was giving you a recommendation.
[10:35:10] ddv: you didn't tell us that the_drow
[10:35:19] gregf_: >> require "logger"; logger = Logger.new(STDOUT);logger.debug("Foo")
[10:35:20] ruby[bot]: gregf_: # => D, [2016-01-27T10:35:19.802024 #7438] DEBUG -- : Foo ...check link for more (https://eval.in/508690)
[10:35:30] the_drow: But it's not as good as logbook for python for example
[10:36:14] havenwood: the_drow: What do you not have that you need?
[10:36:16] gregf_: the_drow: what more do you need from a logging library?
[10:37:02] srenatus: has joined #ruby
[10:37:40] sandstrom: Is there a way to make an instance pass an `is_a?` check besides subclassing? It's for a thin wrapper / decorator that will delegate most things to its underlying instance.
[10:37:41] dlitvak: has joined #ruby
[10:38:04] the_drow: I need to direct errors to stderr, I need to be able to emit statistics, I need to be able to provide context and guide developers to use structured logging, colors, I need thread safety, buffered output
[10:38:15] Ox0dea: sandstrom: Are you sure you want that to happen?
[10:38:25] the_drow: statistics = metrics e.g. counters, timers etc.
[10:38:38] whiteline: has joined #ruby
[10:38:56] sandstrom: Ox0dea I may be making a mistake in my thinking, but I'd like to explore it.
[10:39:26] havenwood: the_drow: Are you suggesting Logger can't output to STDERR or isn't Thread safe, etc?
[10:40:02] Ox0dea: sandstrom: Well, I imagine you don't want to redefine #is_a?, in which case you'll need to poke about in raw memory to adjust your thing's ancestor chain post-facto.
[10:40:06] the_drow: Nope. I'm suggesting that a single logger instance can't output to two different streams
[10:40:39] sftrabbit: has joined #ruby
[10:40:40] sandstrom: Ox0dea it may be a bad idea. I'll ponder it some more
[10:41:02] ddv: the_drow: http://stackoverflow.com/questions/6407141/how-can-i-have-ruby-logger-log-output-to-stdout-as-well-as-file
[10:41:33] ldnunes: has joined #ruby
[10:41:58] the_drow: So there isn't one goto solution except extending logger?
[10:43:24] Musashi007: has joined #ruby
[10:43:35] Ox0dea: the_drow: Maybe look at Logging.
[10:44:05] the_drow: Still evaluating it's performance
[10:45:53] jottr: has joined #ruby
[10:46:45] the_drow: I was just wondering if there are other alternatives other than log4r which is pretty old and logging
[10:47:11] Meow-J: has joined #ruby
[10:47:14] karapetyan: has joined #ruby
[10:47:34] mrtomme: has joined #ruby
[10:47:49] dlitvak: has joined #ruby
[10:49:40] karapetyan: has joined #ruby
[10:51:31] lurch_: has joined #ruby
[10:53:20] karapetyan: has joined #ruby
[10:53:25] Azulinho: has joined #ruby
[10:56:23] dlitvak: has joined #ruby
[10:57:05] tvw: has joined #ruby
[10:57:16] burgestrand: has joined #ruby
[10:58:37] jcdesimp: has joined #ruby
[10:59:24] mrtomme: has left #ruby: ()
[11:00:00] tyrbo: has joined #ruby
[11:00:03] mr_blue: has joined #ruby
[11:01:52] blackmesa: has joined #ruby
[11:02:04] Yzguy: has joined #ruby
[11:04:17] al2o3-cr: has joined #ruby
[11:06:15] dlitvak: has joined #ruby
[11:07:14] usershell: has joined #ruby
[11:07:25] dlitvak: has joined #ruby
[11:08:14] newbie22: has joined #ruby
[11:08:15] benlovell: has joined #ruby
[11:08:52] lkba: has joined #ruby
[11:14:22] yfeldblum: has joined #ruby
[11:14:41] ebbflowgo: has joined #ruby
[11:14:59] Anderson69s_Pi: has joined #ruby
[11:15:58] dlitvak: has joined #ruby
[11:17:58] _joes_: has joined #ruby
[11:18:33] jottr: has joined #ruby
[11:18:48] gruz0: has joined #ruby
[11:19:53] PedramT: has joined #ruby
[11:19:56] Ebok: has joined #ruby
[11:20:02] gbgdev: has joined #ruby
[11:20:48] CloCkWeRX: has joined #ruby
[11:21:44] diegok: has joined #ruby
[11:22:15] chthon: has joined #ruby
[11:22:37] eregon_: has joined #ruby
[11:22:48] despai: has joined #ruby
[11:23:06] benlovell: has joined #ruby
[11:27:52] baweaver: has joined #ruby
[11:28:21] hyperdrive: has joined #ruby
[11:28:28] tabakhase: has joined #ruby
[11:28:29] xMopxShell: has joined #ruby
[11:29:12] loren: has joined #ruby
[11:31:30] govg: has joined #ruby
[11:36:53] binaryplease: has joined #ruby
[11:38:22] Cohedrin: has joined #ruby
[11:39:49] dlitvak: has joined #ruby
[11:41:51] rsc___: has joined #ruby
[11:42:41] charliesome: has joined #ruby
[11:43:24] colegatron_origi: has joined #ruby
[11:44:01] fumk: has joined #ruby
[11:46:07] ziyadb: has joined #ruby
[11:46:10] dionysus69: has joined #ruby
[11:46:47] Shaboum: has joined #ruby
[11:48:24] dlitvak: has joined #ruby
[11:48:50] sigurding: has joined #ruby
[11:53:22] PedramT: has joined #ruby
[11:54:36] benlovell: has joined #ruby
[11:56:11] artX000: has joined #ruby
[11:56:37] usershell: has joined #ruby
[11:58:22] platzhirsch: has joined #ruby
[11:58:25] yoongkang: has joined #ruby
[12:01:37] codecop: has joined #ruby
[12:02:13] usershell: has joined #ruby
[12:03:23] bronson: has joined #ruby
[12:03:26] bruce_lee: has joined #ruby
[12:05:19] sandstrom: has joined #ruby
[12:06:29] ElFerna: has joined #ruby
[12:06:38] dlitvak_: has joined #ruby
[12:07:30] newbie22: has joined #ruby
[12:09:57] blackmesa: has joined #ruby
[12:10:04] Pupp3tm4st3r: has joined #ruby
[12:10:36] Xeago: has joined #ruby
[12:14:35] mark2: has left #ruby: ("PART #RubyOnRails :PART #jquery :PART #reactjs :PART ##javascript :PART #elixir-lang :PART #debian :PART #zsh :PART #nethunter :PONG :sinisalo.freenode.net")
[12:16:08] dlitvak: has joined #ruby
[12:16:19] sdothum: has joined #ruby
[12:18:31] darkf_: has joined #ruby
[12:19:28] einarj_: has joined #ruby
[12:21:13] chthon: has joined #ruby
[12:25:06] solocshaw: has joined #ruby
[12:25:09] dlitvak_: has joined #ruby
[12:25:40] PedramT: has joined #ruby
[12:29:11] usershell: has joined #ruby
[12:29:51] Pumukel: has joined #ruby
[12:30:01] treaki_: has joined #ruby
[12:30:50] usershell: has joined #ruby
[12:31:11] CloCkWeRX: has joined #ruby
[12:31:26] c355E3B: has joined #ruby
[12:33:14] usershell: has joined #ruby
[12:37:09] rolfb: has joined #ruby
[12:37:20] burgestrand: has joined #ruby
[12:38:46] dlitvak: has joined #ruby
[12:38:55] pandaant: has joined #ruby
[12:41:00] aupadhye: has joined #ruby
[12:43:05] casadei: has joined #ruby
[12:43:33] pawnbox: has joined #ruby
[12:43:42] lucasb: has joined #ruby
[12:47:30] usershell: has joined #ruby
[12:47:45] mfb2: has joined #ruby
[12:50:38] workmad3: has joined #ruby
[12:50:42] skade: has joined #ruby
[12:54:58] usershell: has joined #ruby
[12:59:22] jcdesimp: has joined #ruby
[13:00:53] jcdesimp_: has joined #ruby
[13:01:18] einarj: has joined #ruby
[13:02:35] f4cl3y: has joined #ruby
[13:03:07] ElFerna: has joined #ruby
[13:04:37] konsolebox: has joined #ruby
[13:04:41] benlovell: has joined #ruby
[13:04:45] sandstrom: has joined #ruby
[13:06:36] PedramT: has joined #ruby
[13:06:46] synthroid: has joined #ruby
[13:07:05] konsolebox: has joined #ruby
[13:09:21] avril14th: has joined #ruby
[13:11:39] konsolebox: has joined #ruby
[13:12:38] usershell: has joined #ruby
[13:15:11] pdoherty: has joined #ruby
[13:16:47] lurch_: has joined #ruby
[13:17:07] Jardayn: has joined #ruby
[13:17:11] Xeago: has joined #ruby
[13:17:47] janoti: has joined #ruby
[13:19:20] janoti: iam learning ruby very very new to ruby i was reading some file the content is EM::WebSocket.run(:host => "0.0.0.0", :port => 8080, :debug => false) do |ws|
[13:19:20] janoti: ws.onopen { |handshake|
[13:19:21] janoti: puts "WebSocket opened #{{
[13:19:21] janoti: :path => handshake.path,
[13:19:21] janoti: :query => handshake.query,
[13:19:22] janoti: :origin => handshake.origin,
[13:19:26] janoti: ws.send "Hello Client!"
[13:19:39] janoti: what is do|ws| doing and from where ws came from
[13:19:44] janoti: i am not able to understand
[13:19:53] rsc___: have you look at eventmachine's docs?
[13:20:02] griffindy: has joined #ruby
[13:20:14] rsc___: xyz do |abc| ... end is a way to pass blocks into a function
[13:20:36] rsc___: http://www.reactive.io/tips/2008/12/21/understanding-ruby-blocks-procs-and-lambdas/
[13:20:41] janoti: run is function right
[13:20:41] failshell: has joined #ruby
[13:20:56] janoti: and then what is ws is it a local variable
[13:21:04] janoti: i am from c++ background
[13:21:12] dlitvak_: has joined #ruby
[13:21:54] charliesome: has joined #ruby
[13:22:39] sandstrom: has joined #ruby
[13:24:59] sftrabbit: has joined #ruby
[13:26:32] oivoodoo: has joined #ruby
[13:26:49] Ox0dea: janoti: It's local to the block.
[13:27:31] Ox0dea: #run yields a new instance of EM::WebSocket to the block and `|ws|` captures it to be used however.
[13:28:23] Ox0dea: They've used a block for this interface to give you setup and teardown "for free".
[13:28:27] rsc___: janoti: think of `do |ws| ... end` as a function
[13:28:39] rsc___: `ws` is the thing passed to this function as an argument
[13:29:47] rsc___: think of it as `void on_open_handler(handshake) { ... }` and then you pass that to `ws.onopen(&on_open_handler)`... in c++ terms
[13:30:20] janoti: now i got it
[13:31:27] newdan: has joined #ruby
[13:32:24] Ox0dea: rsc___: It is a little more than that, though; #run can operate "around" the block, so it can do finalization as well.
[13:32:47] aupadhye: has joined #ruby
[13:32:57] rsc___: Ox0dea: so can functors in C++. but the thing ruby has (that that c++ doesnt) is closures
[13:33:11] Ox0dea: Surely C++ has closures by now?
[13:35:34] workmad3: has joined #ruby
[13:35:37] binaryplease: has joined #ruby
[13:36:51] chipotle: has joined #ruby
[13:37:05] tvw: has joined #ruby
[13:38:01] mary5030: has joined #ruby
[13:39:08] pcoke_: has joined #ruby
[13:40:16] claw: i need to .force_encoding("iso-8859-1") on every value in a string in a transforming way
[13:40:29] blackmesa: has joined #ruby
[13:41:36] apeiros: claw: if you want to translate from one encoding to another, String#encode is what you need.
[13:41:37] the_drow: has joined #ruby
[13:42:18] claw: apeiros: actually the encoding is not the problem. i am wondering if there is ruby methods to mutate all the hash values
[13:42:20] apeiros: .force_encoding does not translate. it only informs ruby which encoding the string currently uses (i.e. you're telling ruby that the value in .encoding was wrong and it should use the new one instead)
[13:42:42] apeiros: claw: Hash#each or Hash#map + to_h
[13:44:57] failshell: has joined #ruby
[13:45:12] k13nox: has joined #ruby
[13:45:29] claw: aaah my fault
[13:45:40] zarubin: has joined #ruby
[13:45:41] oivoodoo: has joined #ruby
[13:45:49] claw: i did it right but missed .encode("UTF-8") after the force_encoding
[13:46:25] apeiros: IMO having to use .force_encoding is an indicator that you have bad code earlier
[13:46:41] claw: apeiros: i am connected to mysql 3.23
[13:46:42] apeiros: wherever you are generating those strings, you should generate them with the proper charset already set.
[13:46:46] vdamewood: has joined #ruby
[13:46:56] apeiros: your database adapter can certainly handle charsets
[13:46:58] claw: mysql 3.23 has no support for utf
[13:47:12] apeiros: that's not necessary. it's sufficient if your db adapter has.
[13:47:39] apeiros: we too have a db with iso-8859-1 charset as storage, and we have our client library translate it
[13:47:55] claw: my adapter is the mysql gem
[13:48:20] apeiros: then I'd check the docs. I'm not using mysql, so I might be wrong. but it'd surprise me if that's not part of it.
[13:49:23] claw: ill test mysql2 according to https://stackoverflow.com/questions/17558500/ruby-and-mysql-utf-8-characters
[13:50:12] bqscott: has joined #ruby
[13:51:32] ESpiney: has joined #ruby
[13:51:35] arup_r: has joined #ruby
[13:51:40] claw: same problem
[13:52:04] drptbl: has joined #ruby
[13:53:09] pwnd_nsfw`: has joined #ruby
[13:53:49] mdw: has joined #ruby
[13:54:12] darix: claw: your table is set to utf8 charset too?
[13:54:26] claw: darix: i cant there is not support for utf8
[13:54:35] claw: its freakin old
[13:54:46] claw: 3.23 was more than 16 years ago
[13:54:57] darix: claw: maybe start with "run on something that actually gets security fixes still?"
[13:56:01] claw: its on customer side all i can do is to advice them to do so
[13:56:07] darix: well do so
[13:57:13] AndChat|80625: has joined #ruby
[13:59:13] AndChat|80625: has joined #ruby
[13:59:23] dstarh: has joined #ruby
[13:59:36] User458764: has joined #ruby
[13:59:49] AndChat|80625: has joined #ruby
[14:00:39] arup_r: has joined #ruby
[14:00:56] burgestrand: has joined #ruby
[14:03:42] sgambino: has joined #ruby
[14:05:37] bronson: has joined #ruby
[14:06:11] failshell: has joined #ruby
[14:07:22] valetudo: has joined #ruby
[14:08:07] aryaching: has joined #ruby
[14:09:18] sgambino: has joined #ruby
[14:13:20] duckpuppy: has joined #ruby
[14:14:00] arup_r: has joined #ruby
[14:15:13] truenito: has joined #ruby
[14:15:13] cdg: has joined #ruby
[14:15:27] workmad3: has joined #ruby
[14:16:39] hxegon: has joined #ruby
[14:17:09] robh71: has joined #ruby
[14:17:17] sgambino: has joined #ruby
[14:18:44] sigurding: has joined #ruby
[14:19:05] jottr_: has joined #ruby
[14:19:13] truongtc: has joined #ruby
[14:20:38] truongtc: has joined #ruby
[14:21:00] s2013: has joined #ruby
[14:22:02] cdg: has joined #ruby
[14:22:28] the_drow: how do I replace unicorn's logger with my own?
[14:23:15] dopamean_: has joined #ruby
[14:24:12] dlitvak: has joined #ruby
[14:24:57] benlovell: has joined #ruby
[14:25:01] despai: has joined #ruby
[14:25:57] arup_r: has joined #ruby
[14:26:50] dlitvak_: has joined #ruby
[14:30:07] TomPeed: has joined #ruby
[14:32:58] platzhirsch: has joined #ruby
[14:33:07] krobzaur: has joined #ruby
[14:33:41] floatingpoint: has joined #ruby
[14:36:18] konsolebox: has joined #ruby
[14:36:43] jottr: has joined #ruby
[14:37:27] duckpuppy: has joined #ruby
[14:38:42] konsolebox: has joined #ruby
[14:38:57] [spoiler]: `01/27/16 14:15:43: startLearn: Battery relearn cannot be started due to the following reasons: The BBU is relaxing.`
[14:39:13] colegatron_origi: has joined #ruby
[14:39:14] [spoiler]: Sorry m8, I didn't know you were chillin'
[14:39:25] Azure|dc: has joined #ruby
[14:40:41] aegis3121: has joined #ruby
[14:42:11] atomical: has joined #ruby
[14:42:13] stannard: has joined #ruby
[14:45:56] aryaching: has joined #ruby
[14:47:08] VeryBewitching: has joined #ruby
[14:49:38] AlexRussia: has joined #ruby
[14:49:44] PedramT: has joined #ruby
[14:51:44] yoongkang: has joined #ruby
[14:52:22] avril14th: has joined #ruby
[14:52:33] go|dfish: has joined #ruby
[14:54:09] Shoutsid: has joined #ruby
[14:54:17] uris: has joined #ruby
[14:54:48] malconis: has joined #ruby
[14:55:33] malconis: has joined #ruby
[14:56:17] dml337ira: has joined #ruby
[14:59:07] gbgdev: has joined #ruby
[15:00:03] Brklyn: has joined #ruby
[15:01:32] yellowcupeats: has joined #ruby
[15:01:45] yellowcupeats: Anyone here familiar with Conway's Game of Life? (https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life#Rules)
[15:02:01] ruby[bot]: Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[15:02:41] yellowcupeats: No question really...just had it in an interview yesterday and totally failed.
[15:02:43] Canar: yellowcupeats: It was the first significant Java code I wrote... hm, would have been close to 20 years ago on old Sun hardware.
[15:02:50] avril14th: yellowcupeats: yups
[15:03:09] Ox0dea: yellowcupeats: What gave you trouble? :/
[15:03:12] aegis3121: one of those things I'm familiar with but can never recall until someone starts talkign about it.
[15:03:24] Papierkorb: yellowcupeats: and 'familiar' enough, but can't think of the rule sets right now
[15:03:45] yellowcupeats: I tried breaking it down but just couldn't do it. I've been developing for 4 years now and now feel like I shouldn't even be a programmer.
[15:03:56] workmad3: has joined #ruby
[15:04:01] dave23: has joined #ruby
[15:04:01] Ox0dea: 1 or 2 neighbors births a cell (reproduction), 3 or more kills it (overpopulation).
[15:04:18] Canar: 1 maintains, 2 births
[15:04:30] Canar: err, 2/3 actually
[15:04:36] avril14th: yellowcupeats: don't worry it's not cause you failed that that you suck at programming
[15:04:37] Canar: think of the * * * oscillator
[15:04:40] ddv: yellowcupeats: you failed a silly interview question, it happens you move on
[15:04:41] yellowcupeats: I don't know what is missing in my education that didn't allow me to solve it.
[15:04:54] Papierkorb: yellowcupeats: what was the question?
[15:05:10] Ox0dea: Implement Conway's GoL, surely.
[15:05:12] yellowcupeats: Just to TDD the game of life
[15:05:18] yellowcupeats: Rules -> (https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life#Rules)
[15:05:30] yellowcupeats: I tried doing a nested array at first.
[15:06:05] vikas027: has joined #ruby
[15:06:17] Ox0dea: "Flat is better than nested."
[15:06:33] Ox0dea: It keeps the operations simpler, if nothing else.
[15:06:52] ilyasov: has joined #ruby
[15:06:54] yellowcupeats: Probably should've done flat with Cells that have an x, y attributes
[15:07:11] Papierkorb: Ox0dea: @board[x][y] seems more straight forward than @board[y * WIDTH + x]
[15:07:15] ilyasov: can i simplify this line of code?
[15:07:16] ilyasov: x.to_s(2).count('0') == y.to_s(2).count('0')
[15:07:24] Ox0dea: Papierkorb: I disagree, but all right. :)
[15:07:31] ilyasov: with maybe some comparator that takes block
[15:09:29] Ox0dea: carella: If you're not comparing more than two, no sense complicating it beyond that simple check.
[15:09:53] aswen: has joined #ruby
[15:09:55] Abrin: has joined #ruby
[15:10:44] jcdesimp: has joined #ruby
[15:10:50] kennyfrc: has joined #ruby
[15:11:33] Papierkorb: carella: I agree with Ox0dea, if it's not a "hot method" (-> Profiling!), that's the code people will understand.
[15:12:33] Carella: Papierkorb: i just participated in some online challenge where time is of the essence
[15:12:49] Carella: I thought maybe there's a shorter solution
[15:12:52] dlitvak: has joined #ruby
[15:13:08] Ox0dea: Speedcoding and golfing are quite different things.
[15:13:11] Papierkorb: carella: https://stackoverflow.com/questions/1639723/ruby-count-the-number-of-1s-in-a-binary-number It's less readable and not shorter, but according to the guy in there, much faster.
[15:13:11] mfb2: has joined #ruby
[15:13:36] Carella: Papierkorb: i meant in terms of typing
[15:13:45] themsay: has joined #ruby
[15:14:29] Carella: Ox0dea: sorry, it don't know what golfing is in this context
[15:14:37] Ox0dea: carella: Short code.
[15:14:42] Ox0dea: Excessively short.
[15:14:44] Carella: Ox0dea: thanks
[15:14:48] Ox0dea: No worries.
[15:14:58] Ox0dea: Coding fast is about thinking fast far more than it is about typing.
[15:15:57] freerobby: has joined #ruby
[15:16:04] Carella: Ox0dea: yeah, but after I won and saw that massive chunk of code my opponent wrote in clojure I tried to shorten my solution even more - that's how I ended up with my line
[15:16:28] Carella: At this point I decided to do some golfing, guilty as charged :)
[15:16:35] baweaver: has joined #ruby
[15:16:39] aupadhye_: has joined #ruby
[15:17:20] sumark: has joined #ruby
[15:17:32] Bloomer: has joined #ruby
[15:18:42] despai: has joined #ruby
[15:18:55] sucks: has joined #ruby
[15:19:08] s2013: has joined #ruby
[15:19:28] Papierkorb: carella: this is the same bytecount: [x,y].map{|a|a.to_s(2).count '0'}.inject :==
[15:19:47] decoponio: has joined #ruby
[15:20:12] apeiros: I'm not sure that qualifies as "simplify" :D
[15:20:26] Papierkorb: carella: [x,y].map{|a|a.to_s(2).count'0'}.inject:== # 2 bytes saved
[15:20:35] Papierkorb: apeiros: code golfing != simplifying ;)
[15:20:39] s2013: has joined #ruby
[15:21:03] apeiros: ah, they want shorten, not simplify
[15:21:40] Ox0dea: Papierkorb: ('%b'%a) to shave a byte. :)
[15:22:09] lurch_: has joined #ruby
[15:22:13] Scripore: has joined #ruby
[15:22:16] Ox0dea: Shame about not being able to use ?0 to save another.
[15:24:10] drPoggs: has joined #ruby
[15:24:18] Ox0dea: ![x,y].uniq{|a|('%b'%a).count'0'}[1]
[15:24:31] shinnya: has joined #ruby
[15:24:56] B1n4r10: has joined #ruby
[15:24:58] Mon_Ouie: a,b=???;a==b is shorter than using inject (still longer than ^ though)
[15:25:20] axl__: has joined #ruby
[15:25:37] chouhoulis: has joined #ruby
[15:25:53] kies^: has joined #ruby
[15:26:58] yellowcupeats: I was stuck trying to implement a 2 dimensional array
[15:27:26] zerowaitstate: has joined #ruby
[15:27:53] Papierkorb: yellowcupeats: rows = Array.new(HEIGHT){ [] }
[15:28:02] idefine: has joined #ruby
[15:28:07] Papierkorb: yellowcupeats: or rather this: rows = Array.new(HEIGHT){ Array.new WIDTH }
[15:28:11] tenderlove: has joined #ruby
[15:28:14] marr: has joined #ruby
[15:28:25] zerowaitstate: what is the current preferred way of connecting to MySQL from Ruby? The "semi-official" Ruby library written by tmtm seems to be deprecated
[15:28:43] yorickpeterse: zerowaitstate: using the mysql2 gem
[15:28:55] yorickpeterse: https://github.com/brianmario/mysql2
[15:29:07] rippa: has joined #ruby
[15:29:27] hxegon: has joined #ruby
[15:29:38] marr: has joined #ruby
[15:31:11] evidex: has joined #ruby
[15:32:33] Ox0dea: >> [[nil] * 3] * 2 # Papierkorb
[15:32:35] ruby[bot]: Ox0dea: # => [[nil, nil, nil], [nil, nil, nil]] (https://eval.in/508905)
[15:32:35] Scripore: has joined #ruby
[15:32:39] Ox0dea: But probably don't actually do that.
[15:33:11] Papierkorb: Ox0dea: that doesn't work
[15:33:35] Papierkorb: >> a = [[nil] * 3] * 2 ; a[1][0] = 4; puts a.join
[15:33:36] ruby[bot]: Papierkorb: # => 44 ...check link for more (https://eval.in/508906)
[15:33:37] mary5030: has joined #ruby
[15:33:43] axl__: has joined #ruby
[15:33:45] Papierkorb: well .. you get the idea
[15:34:39] ad: has joined #ruby
[15:34:57] Ox0dea: It works if your values aren't reference types.
[15:35:26] whippythellama: has joined #ruby
[15:36:12] BTRE: has joined #ruby
[15:36:46] Ox0dea: Er, never mind. I know how you mean.
[15:36:48] fbandov: has joined #ruby
[15:37:39] mary5030: has joined #ruby
[15:38:29] lindistock: has joined #ruby
[15:38:57] centrx: has joined #ruby
[15:39:50] shredding: has joined #ruby
[15:41:06] sgambino: has joined #ruby
[15:42:08] babblebre: has joined #ruby
[15:43:40] Jardayn: has joined #ruby
[15:46:38] dlitvak: has joined #ruby
[15:47:04] kaleido: has joined #ruby
[15:48:02] mondok: has joined #ruby
[15:50:25] ponga: has joined #ruby
[15:50:30] ponga: hello everybody
[15:50:34] waheedi: has joined #ruby
[15:50:37] ponga: I finished my first IRC game !
[15:50:56] ddv: nobody cares
[15:51:08] ponga: ddv: but its written in rub
[15:51:15] Ox0dea: ddv: Watch me.
[15:51:21] ddv: Ox0dea: :)
[15:51:23] Ox0dea: ponga: Is it the card game you invented?
[15:51:40] ponga: Ox0dea: more like I borrowed ideas from classic 500, but yeah
[15:51:49] ponga: one i made myself to play with pals when i was at highschool
[15:51:51] AlexJakeGreen: has joined #ruby
[15:51:56] Ox0dea: Nice! Where do I sign up?
[15:51:56] ddv: ponga: is it on github?
[15:51:59] dave23: ACTION is caring vehemently
[15:52:17] yoongkang: has joined #ruby
[15:52:18] burgestrand: has joined #ruby
[15:52:26] ponga: ddv: it will be, not at the moment because its bot msg output in korean at the moment, and some comment lines are in korean too
[15:52:36] ponga: after its organized and translated, it will be on github
[15:52:44] ddv: awesome
[15:52:58] ponga: Ox0dea: its IRC gaming, i don't think you need to sign up, it just needs !start and 3 more people !join
[15:53:36] ponga: and the code is ugly as hell
[15:54:09] tjohnson: has joined #ruby
[15:54:13] sgambino: has joined #ruby
[15:54:25] Ox0dea: ponga: Sure, I more meant: which channel should I join to play?
[15:54:52] ponga: well , i haven't created one for it but its called flossom, so i guess its #flossom maybe?
[15:55:17] davedev24: has joined #ruby
[15:55:19] evidex: has joined #ruby
[15:55:26] ponga: anyway Ox0dea thank you for being nice and pretending to pay attnetion to my work
[15:55:30] ponga: i mean it
[15:55:43] dave23: ponga, can i actually paly it somewhere
[15:55:55] dave23: s/paly/play
[15:56:08] ponga: dave23: yes you can , i will update everything to be in English in next 24 hrs
[15:56:20] ponga: sadly the game rule instruction is in korean at the moment
[15:56:43] Ox0dea: ponga: You're suggesting I pretended to remember that you were working on a card game of your own design?
[15:56:59] ponga: oh .. that
[15:57:15] ponga: how did you manage to remember that? even i didn't remember I said that in this channel
[15:57:19] ponga: you have a superb memory
[15:58:58] psy: has joined #ruby
[15:59:30] Ox0dea: I'm trying to figure out why you felt the need to hedge your gratitude with an accusation of pretension.
[15:59:34] sgambino: has joined #ruby
[16:00:07] synthroid: has joined #ruby
[16:00:15] psy: has joined #ruby
[16:01:16] hannelita: has joined #ruby
[16:01:49] s2013: has joined #ruby
[16:02:10] oivoodoo_: has joined #ruby
[16:02:29] benlovell: has joined #ruby
[16:02:35] shevy: ponga you are getting stalked! :D
[16:02:43] ponga: shevy: am i ?!
[16:02:53] ponga: Ox0dea: oh and i was just.. you know, my poor code writing skill
[16:03:01] oivoodoo_: has joined #ruby
[16:03:03] ponga: just looking at my cardgame bot code makes me sad
[16:03:20] manveru: welcome to the world of coding
[16:03:45] Ox0dea: ponga: Barney Stinson has something to say about that.
[16:04:06] Ox0dea: http://i.imgur.com/e3Y4g2a.jpg
[16:04:12] manveru: the crazy/hot equilibrium?
[16:04:15] ponga: lol barney meme
[16:04:45] oivoodoo_: has joined #ruby
[16:05:12] shevy: he is not cool because he has no beard
[16:05:36] Liquid--: has joined #ruby
[16:05:57] ponga: I'm just a bit worried that my regex will not work once its translated in English
[16:06:15] _p0p0pr37: has joined #ruby
[16:06:19] kaleido: nothing really works in english. its a pretty terrible language
[16:06:39] shevy: ponga what do you mean? what does your regex match if not english?
[16:06:50] ponga: shevy: korean
[16:06:58] idefine_: has joined #ruby
[16:07:04] ponga: like this /??????\s\w\w$/
[16:07:18] ponga: kaleido: thumbs up for ya
[16:07:53] bronson: has joined #ruby
[16:07:58] ponga: shevy: my code is built around the cinch function that it catches msg via regex
[16:08:06] brahman: has joined #ruby
[16:08:06] brahman: has joined #ruby
[16:08:09] ponga: so I'd have to test it again after translated
[16:08:46] zast: has joined #ruby
[16:09:05] sandstrom: has joined #ruby
[16:09:51] workmad3: has joined #ruby
[16:10:22] FooMunki: has joined #ruby
[16:10:56] asccigcc: has joined #ruby
[16:11:54] Ox0dea: How not to implement Conway's Game of Life, for the curious: https://eval.in/508928
[16:12:18] Ox0dea: The initial grid is this guy: https://upload.wikimedia.org/wikipedia/commons/f/fb/I-Column.gif
[16:12:23] moeabdol: has joined #ruby
[16:12:54] sgambino: has joined #ruby
[16:14:36] rkazak: has joined #ruby
[16:17:44] shevy: ponga ah yes I remember... the IRC bot
[16:17:51] shevy: writing an IRC bot was my first project in ruby :)
[16:17:59] shevy: since then, I broke the old code.... and then tired of it...
[16:18:04] tomchapin: has joined #ruby
[16:18:25] manveru: shevy: i remember when you built it :)
[16:19:47] huQeQwdpu47q: has joined #ruby
[16:20:19] TomPeed: has joined #ruby
[16:21:00] dlitvak: has joined #ruby
[16:21:25] benoror: has joined #ruby
[16:21:47] d0lph1n98: has joined #ruby
[16:21:50] synthroid: has joined #ruby
[16:22:14] Limix: has joined #ruby
[16:23:34] jbrhbr: has joined #ruby
[16:24:20] darix: has joined #ruby
[16:24:29] heftig: has joined #ruby
[16:24:31] parus_: has joined #ruby
[16:24:50] kalleth: has joined #ruby
[16:25:00] gnarf_: has joined #ruby
[16:25:24] RushPL: has joined #ruby
[16:25:40] contradictioned: has joined #ruby
[16:26:16] theslow1: has joined #ruby
[16:26:29] chouhoulis: has joined #ruby
[16:27:14] ponga: shevy: when was it?
[16:27:49] Hobbyboy: has joined #ruby
[16:28:00] janoti: has joined #ruby
[16:28:23] ELGUERRERO: has joined #ruby
[16:29:12] JDiPierro: has joined #ruby
[16:29:41] kirillzh: has joined #ruby
[16:30:02] ELGUERRERO: has left #ruby: ()
[16:30:12] PaulePanter: has joined #ruby
[16:30:23] haasn: has joined #ruby
[16:30:25] kfpratt: has joined #ruby
[16:31:28] shevy: ponga hmmm... 10 years ago or something like that I think...
[16:31:39] ponga: and manveru remembers that??
[16:31:45] ponga: how long have you guys been on IRC?
[16:31:49] ponga: it scares me
[16:31:56] shevy: yeah it scares me as well that he remembers
[16:32:14] hobodave: has joined #ruby
[16:32:16] Sou|cutter: I've been on IRC over 20 years too. Scary
[16:32:21] ponga: shevy: but you didn't have cinch gem or equivilant back then did you
[16:32:29] ponga: did you code it from scratch
[16:32:32] manveru: 18 years i think...
[16:32:33] shevy: ponga correct! yeah
[16:32:35] bougyman: was it rbot?
[16:32:37] ramfjord: has joined #ruby
[16:32:39] bougyman: or just Net::IRC?
[16:32:40] shevy: not even rbot hehe
[16:32:56] ponga: shevy: so you just did HTTP connection?
[16:32:57] shevy: someone told me that line here: select( [$stdin], nil, nil, 1.1 )
[16:32:57] manveru: that was before that existed
[16:32:59] Ox0dea: Net::IRC?
[16:33:01] shevy: and I was using that for the bot :)
[16:33:02] ponga: and sending raw commands?
[16:33:27] shevy: ponga the IRC protocol is thankfully quite simple
[16:33:44] shevy: it took me a while before I understood that a PING wants a PONG ...
[16:34:02] ponga: shevy: that's how I named my nick actually
[16:34:18] ponga: ping and pong
[16:36:16] mg^: I first got on IRC in 1996. So that's 20 years this year
[16:36:34] centrx: what network?
[16:36:42] mg^: Undernet
[16:37:22] mg^: I'm still officially a channel admin for #chatzone which was the default for a lot of IRC clients back then. Though I don't really go there often these days.
[16:37:28] Musashi007: has joined #ruby
[16:38:21] dionysus69: has joined #ruby
[16:38:33] dlitvak_: has joined #ruby
[16:38:39] s2013: has joined #ruby
[16:39:01] centrx: I was on DALnet until they were attacked/imploded in 2002
[16:39:04] mg^: I wrote an awful lot of mirc code, and later perl code, to deal with that mess when it had thousands of users and there was very little defense by ircd itself from the nefarious activities that go on
[16:39:09] ponga: shevy: I still have one or two automation method to complete tho, its manually driven thru user input at the moment
[16:39:29] benlovell: has joined #ruby
[16:39:35] ponga: mg^: and you landed on #ruby after perl?
[16:40:27] shevy: so many ruby users went through perl
[16:40:29] mg^: yeah I decided a few years ago that I didn't want to wait for perl 6 to be polished when it looked like Ruby had basically everything perl 6 was promising, but already mature
[16:41:00] centrx: perl was all there was until python & ruby
[16:41:07] mg^: and ruby code read really well to me... a lot less write-only code out there
[16:41:19] newdan: centrx: What about tcl?
[16:41:23] xapak: has joined #ruby
[16:41:30] centrx: I've heard horrific stories about tcl
[16:41:36] mwlang: has joined #ruby
[16:41:38] mg^: heh, I *still* have to use TCL to this day
[16:41:41] kirillzh: has joined #ruby
[16:41:52] mg^: Becase F5 load balancers use it
[16:42:04] ponga: speaking of python, I still don't understand the need of (self) parameter
[16:42:13] pdoherty: has joined #ruby
[16:42:27] Renich: has joined #ruby
[16:42:33] Shoutsid: has joined #ruby
[16:42:42] newdan: ponga: Take it up with #python. They decided to do that to keep it simple, ...or something. I agree with you though ponga I don't like it
[16:43:24] ponga: newdan: I still wonder what benefit they earn from it
[16:43:32] newdan: OOP in Ruby is much cleaner to read
[16:43:36] synthroid: has joined #ruby
[16:44:06] xapak: Probably silly question, but do you know why `value` is taking the empty array instead of `projects`? https://gist.github.com/anonymous/bbe498583eadb98882a2
[16:44:33] manveru: xapak: because an empty array is neither nil nor false
[16:44:40] centrx: xapak, also it's not an empty array
[16:44:43] manveru: and everything else is true
[16:44:55] manveru: it's an array full of empty things :)
[16:45:02] snowy: has joined #ruby
[16:45:05] mg^: I can't type out that answer fast with a fork on one hand
[16:45:28] ponga: mg^: but you still managed to type ^ , btw you having meal now?
[16:45:53] ponga: different timezone always get me buzzed
[16:45:54] Cohedrin: has joined #ruby
[16:45:55] the_drow: Is there a way to get the string description of an http status code out of a number?
[16:45:56] ponga: i mean confused
[16:46:13] newdan: xapak: Just curious, what language are you used to where [""] is considered false?
[16:46:21] mg^: yeah it's breakfast time
[16:47:14] ponga: do we have any gem to test if there was any variable that is never actually used or referred to?
[16:48:19] astrobun_: has joined #ruby
[16:49:03] despai: has joined #ruby
[16:49:31] baweaver: has joined #ruby
[16:49:38] Macaveli: has joined #ruby
[16:49:58] manveru: ponga: see rubocop
[16:50:07] mg^: yeah rubocop does a good job at that
[16:50:20] Mon_Ouie: Even ruby -w tells you about that too
[16:50:21] ponga: nice name btw
[16:50:29] mg^: it also detects "useless" assignments
[16:50:38] manveru: it detects a shitton of things
[16:50:41] mg^: you should see my git commit messages "Rubocop shot me in the crotch again"
[16:51:35] mg^: For the things that require more shiny code, we have it integrated right into the CI system so a build fails if rubocop doesn't like it
[16:51:42] Ox0dea: has joined #ruby
[16:52:00] Ox0dea: >> require 'webrick/httpstatus'; WEBrick::HTTPStatus::StatusMessage[404] # the_drow
[16:52:01] ruby[bot]: Ox0dea: # => "Not Found" (https://eval.in/508941)
[16:52:07] Cohedrin: has joined #ruby
[16:52:20] Ox0dea: It's missing 418 "I'm A Teapot", though.
[16:52:26] arup_r: has joined #ruby
[16:52:45] ponga: mg^: i like that, rubogrammarnazi
[16:53:01] yoongkang: has joined #ruby
[16:54:31] Cohedrin: has joined #ruby
[16:54:49] [Butch]: has joined #ruby
[16:55:14] sanguisdex: has joined #ruby
[16:55:16] uris: has joined #ruby
[16:55:19] rakm: has joined #ruby
[16:57:16] lucasb: Ox0dea: hey, I liked your GoL. why did you said "how *not* to implement it" ?
[16:57:36] lucasb: would be easy to require 'curses' there and clear the screen for each step, wouldn't?
[16:57:48] Ox0dea: lucasb: Self-deprecation is cruise control for modesty.
[16:57:54] Ox0dea: It's a great implementation. ^_^
[16:58:10] Ox0dea: lucasb: Sure, no need for curses even; just shell out to `clear` or the like.
[16:59:36] PedramT: has joined #ruby
[17:00:18] B1n4r10: has joined #ruby
[17:00:31] synthroid: has joined #ruby
[17:00:47] mwlang: what???s a clean way to turn [???A???, ???B???, ???C???] into this hash: { ???V0??? => ???A???, ???V1???, => ???B???, ???V2??? => ???C???} basically, the hash key is an indexed variable name assigned the array value at that position.
[17:01:16] Ox0dea: mwlang: But... why?
[17:01:39] jottr: has joined #ruby
[17:01:43] symm-: has joined #ruby
[17:02:21] mwlang: because the hash is what needs to be passed to the rendering template file.
[17:02:27] uris: has joined #ruby
[17:02:30] lucasb: [:a,:b,:c].zip(0..2).map(&:reverse).to_h # how *not* to do it :)
[17:02:34] atomical: has joined #ruby
[17:03:53] Ox0dea: >> %w[A B C].each_with_index.with_object({}) { |(e, i), h| h["V#{i}"] = e } # mwlang
[17:03:53] zambini: has joined #ruby
[17:03:54] ruby[bot]: Ox0dea: # => {"V0"=>"A", "V1"=>"B", "V2"=>"C"} (https://eval.in/508942)
[17:04:33] ponga: hey I have these two commands, !add and !del, but i want to use 'remove' instead of 'del' but had to keep it 3 characters.. do we have any conventional(programmar-wise) way of doing it
[17:04:39] mwlang: dang. nice???
[17:04:40] ponga: !rem sounds dumb
[17:04:45] Ox0dea: ponga: !rm
[17:04:47] mwlang: ACTION goes to look up #with_object
[17:04:52] ponga: Ox0dea: k thanks
[17:04:57] Ox0dea: No worries.
[17:05:11] ponga: its these things that are hard to find thru google search
[17:05:15] ponga: had to rely this channel
[17:05:20] Limix: has joined #ruby
[17:05:31] Mon_Ouie: 'rem' even makes me think of 'remember' which is misleading
[17:05:43] lucasb: or remark, it's a comment
[17:05:43] amclain: has joined #ruby
[17:06:03] Ox0dea: Somebody's done BASIC programming.
[17:06:37] zambini: I never learned that that's what it was in M$ batching
[17:06:45] zambini: Learn something new every day
[17:06:57] Ox0dea: I thought for a long time that it meant "remove" (from compilation or whatever).
[17:07:11] camilasan: has joined #ruby
[17:08:54] freerobby: has joined #ruby
[17:09:46] minimalism: has joined #ruby
[17:10:06] blackmesa: has joined #ruby
[17:10:31] howdoi: has joined #ruby
[17:11:29] jcdesimp: has joined #ruby
[17:13:02] zambini: Me too. My thought was "Wow of course Microsoft would do something dumb like that"
[17:13:55] Ox0dea: Remember to remove your remarks, R.E.M.
[17:16:05] TomSequitur: has joined #ruby
[17:16:36] DexterLB: has joined #ruby
[17:18:01] mg^: dnl is the one that takes the cake for unintuitive comment markers
[17:20:24] aeontech: has joined #ruby
[17:20:37] baweaver: has joined #ruby
[17:21:30] govg: has joined #ruby
[17:22:27] lemur: has joined #ruby
[17:23:26] blackmesa: has joined #ruby
[17:23:43] chussenot: has joined #ruby
[17:23:44] visudo: has joined #ruby
[17:24:30] SCHAAP137: has joined #ruby
[17:25:45] uris: has joined #ruby
[17:26:38] cicloid: has joined #ruby
[17:27:41] zambini: "Do Not Laser"?
[17:28:20] mfb2: has joined #ruby
[17:28:23] sdothum: has joined #ruby
[17:28:31] Canar: do not learn
[17:28:43] mg^: discard next line
[17:29:04] mg^: I see few of you have had the "privilege" of working with m4
[17:29:20] Canar: goto autohell
[17:29:35] x0F: has joined #ruby
[17:31:35] ricer2_g4H4: has joined #ruby
[17:31:40] oivoodoo: has joined #ruby
[17:32:35] TomyLobo: has joined #ruby
[17:34:02] wilbert: has joined #ruby
[17:34:26] chouhoulis: has joined #ruby
[17:34:34] dlitvak: has joined #ruby
[17:36:32] janoti: has joined #ruby
[17:37:16] TomSequitur: has joined #ruby
[17:37:43] emilford: has joined #ruby
[17:39:07] Jackneill: has joined #ruby
[17:39:31] nofxx: has joined #ruby
[17:39:31] nofxx: has joined #ruby
[17:39:40] Renich: hello, personas!
[17:39:48] Renich: I need help with this string: items:15:evicted_unfetched 0
[17:40:00] uris: has joined #ruby
[17:40:18] sftrabbit: has joined #ruby
[17:40:19] Renich: I want it like this items[15][evicted_undfetched] = 0
[17:40:29] Renich: in fact, we could use symbols
[17:40:34] Renich: and there is a big list of those
[17:41:23] Renich: and I am using ruby 2.0
[17:42:44] rht: has joined #ruby
[17:42:47] puria: has joined #ruby
[17:44:19] freerobby: has joined #ruby
[17:44:20] underplank: has joined #ruby
[17:44:56] Maletor: has joined #ruby
[17:45:04] mdw: has joined #ruby
[17:45:11] usershell: has joined #ruby
[17:45:36] lxsameer: has joined #ruby
[17:45:36] lxsameer: has joined #ruby
[17:46:31] Dimik: has joined #ruby
[17:47:20] musicnode: has joined #ruby
[17:47:21] Macaveli: has joined #ruby
[17:48:53] synthroid: has joined #ruby
[17:48:58] jbrhbr: has joined #ruby
[17:49:07] renderful: has joined #ruby
[17:49:27] Ox0dea: Hi, Renich. Could you clarify?
[17:49:58] Ox0dea: You want `items` to be an array of hashes?
[17:50:40] Macaveli: has joined #ruby
[17:50:53] Xeago: has joined #ruby
[17:51:15] Macaveli: has joined #ruby
[17:52:01] Anderson69s: has joined #ruby
[17:52:03] Renich: Ox0dea: sure. I have a text file with lots of lines like this: items:15:evicted_unfetched 0. I'd like to parse that text file with ruby and put the info in a multi-level hash.
[17:52:45] Renich: Ox0dea: so it looks something like: items[:15][:evicted_unfetched] = 0
[17:53:24] Ox0dea: Renich: Is the first part always going to be numeric, then?
[17:53:30] IronD: has joined #ruby
[17:53:32] Renich: Ox0dea: a hash of hashes. Even, though, 15 is hte index, I have several values that point to 15
[17:53:38] Renich: Ox0dea: can we make it a symbol?
[17:53:54] Ox0dea: Renich: You'd have to quote it, but sure.
[17:54:09] Ox0dea: What kind of values can be in that first column? Just small numbers?
[17:54:19] Renich: Ox0dea: yes
[17:54:47] aef: has joined #ruby
[17:54:53] tomphp: has joined #ruby
[17:54:58] Ox0dea: Well, I don't see why it shouldn't be an array of hashes, then, but a hash of hashes would work too.
[17:55:20] Ox0dea: No sense in using numeric Symbols, though. :P
[17:55:31] Renich: be it an Array of Hashes then
[17:55:41] mikecmpbll: has joined #ruby
[17:55:59] Ox0dea: Do you know about regular expressions?
[17:56:19] Renich: Ox0dea: yes, I do. Not an expert, though
[17:56:29] nofxx: has joined #ruby
[17:56:29] nofxx: has joined #ruby
[17:57:17] lucasb: all lines start with "items:"?
[17:57:22] scottschecter: has joined #ruby
[17:57:25] Renich: lucasb: yes
[17:57:25] Ox0dea: Renich: As long as your input file is reasonably clean, `input.scan(/(\d+):(\S+)\s+(\d+)/)` would get you a nested Array of all the results.
[17:58:02] Renich: Ox0dea: ok, so scan it is
[17:58:12] Ox0dea: Renich: You could also just read the file line-by-line and use #match instead of #scan.
[17:58:18] oivoodoo_: has joined #ruby
[17:58:31] Ox0dea: The latter is probably the superior choice if you've got a legitimately big list.
[17:58:33] Renich: Ox0dea: will try both
[17:59:00] dfockler: has joined #ruby
[17:59:03] Renich: Ox0dea: it could et big... 1000s of lines
[17:59:07] Renich: so match it is
[17:59:13] workmad3: has joined #ruby
[17:59:17] elifoster: has joined #ruby
[17:59:42] TomSequitur: has joined #ruby
[17:59:44] sads: has joined #ruby
[18:00:21] Ox0dea: As for storing it, a neat trick is to use the `||=` operator to assign to something only if there's not already a value there.
[18:00:44] Ox0dea: >> array = []; array[1] ||= {}; array[1][:key] = :value; array # Renich
[18:00:45] ruby[bot]: Ox0dea: # => [nil, {:key=>:value}] (https://eval.in/508949)
[18:00:46] usershell: has joined #ruby
[18:01:20] Renich: Ox0dea: yeah, I've used ||=. Thanks
[18:01:36] Ox0dea: Sure thing. Seems like you've got all the tools you'll need. :)
[18:02:10] symm-: has joined #ruby
[18:03:12] pietr0: has joined #ruby
[18:04:12] x77686d: has joined #ruby
[18:04:28] Xeago: has joined #ruby
[18:04:35] gambl0re: has joined #ruby
[18:04:35] gambl0re: has joined #ruby
[18:05:13] gruz0: has joined #ruby
[18:05:21] sgambino: has joined #ruby
[18:05:47] last_staff: has joined #ruby
[18:05:52] syko: has joined #ruby
[18:05:54] mrdomino: has joined #ruby
[18:05:56] firstdayonthejob: has joined #ruby
[18:05:59] Brklyn: has joined #ruby
[18:09:36] ElFerna: has joined #ruby
[18:09:52] shevy: hmm is there a simple way to just read the first line of a file, until the first "\n"? I have some files that may be big, using File.read() or File.readlines() seems a bit of a waste
[18:10:03] shevy: I only have to fetch a header, which is on the first line always
[18:10:37] synthroid: has joined #ruby
[18:10:38] Ox0dea: shevy: File#gets
[18:10:46] shevy: aha thanks
[18:10:51] jackjackdripper: has joined #ruby
[18:11:16] c0m0: File.read("/etc/passwd").split("\n")[0]
[18:11:16] Ox0dea: Don't forget to close it.
[18:11:28] Ox0dea: c0m0: shevy doesn't want to read the entire file into memory.
[18:12:03] Ox0dea: File.open('foo') { |f| header = f.gets }
[18:12:15] h99h9h88: has joined #ruby
[18:12:16] Ox0dea: It's ugly, but it'll auto-close the file and only read the first line.
[18:12:37] Ox0dea: You could maybe do something a little nicer with #tap.
[18:12:57] duckpuppy: has joined #ruby
[18:13:09] shevy: huh... why does this work? does it not have to be terminated manually at the target character?
[18:13:22] c0m0: 0x0dea: what is gets method?
[18:13:29] lucasb: loop.lazy.map { f.gets }.take_while {|l| l =~ /\S/ }.to_a # inside File.open
[18:13:33] Ox0dea: c0m0: It reads a line from any IO-like object.
[18:14:15] c0m0: so I can write too File.open("/etc/passwd").gets
[18:14:29] uris: has joined #ruby
[18:14:53] Ilyes512: has joined #ruby
[18:15:07] Ox0dea: c0m0: Yeah, but you'll leave a file handle open.
[18:15:09] mjuszczak: has joined #ruby
[18:15:12] dexter-tzu: has joined #ruby
[18:15:40] shevy: aaaaah... gets() by default checks for newline
[18:15:42] mjuszczak: has joined #ruby
[18:15:47] Ox0dea: Indeed it does.
[18:15:55] c0m0: Ox0dea: ok thanks
[18:15:59] JDiPierro: has joined #ruby
[18:16:03] Ox0dea: lucasb: The amount of convolution going on there for something so simple is glorious. :P
[18:16:57] shevy: another soulbrother... now norc, Ox0dea and lucasb are a new weird-code team
[18:17:02] lucasb: Ox0dea: yes. I forgot about f.gets("\n\n")
[18:17:10] shevy: huh what is this
[18:17:24] Xeago: File.open("/etc/passwd") {|e| puts e.gets }
[18:17:29] Xeago: that'll close
[18:17:37] shevy: the double newline is actually funne
[18:17:40] shevy: erm, *funny
[18:17:49] lucasb: it's the separator for 'gets' to search for
[18:17:55] Ox0dea: Xeago: I'm sure shevy needs a reference to the header he just read, though.
[18:18:06] Ox0dea: But yeah, that'd do for just printing it.
[18:18:15] Ox0dea: lucasb: `loop.lazy` is an interesting construct.
[18:18:23] c0m0: how can I read the last line?
[18:18:29] Ox0dea: It's probably never The Right Thing, but it's fun to play with.
[18:18:43] nettoweb: has joined #ruby
[18:19:08] shevy: yah, it's just fasta files... they contain an identifier, which is the first line, and the rest is just nucleotide or amino acid junk and can be huge
[18:19:32] m8: has joined #ruby
[18:19:34] shevy: so much perl code exists... also python code... barely any ruby soulmate out there, there :(
[18:19:42] Ox0dea: shevy: Sure you don't wanna just pipe them into `xargs head -1`?
[18:20:27] dhollinger: has joined #ruby
[18:20:42] shevy: dunno, that looks scary non-ruby!
[18:20:50] shevy: let me be in my ruby prison
[18:20:52] yonatankoren: has joined #ruby
[18:21:03] Ox0dea: Well, all right.
[18:21:18] s2013: has joined #ruby
[18:21:37] Ox0dea: c0m0: The optimal approach is usually to seek to the very end, read and store characters until you hit a newline, then reverse the buffer.
[18:22:20] Ox0dea: *read backwards, to clarify.
[18:23:48] baweaver: has joined #ruby
[18:25:44] c0m0: so I need to use the seek method
[18:26:47] Ox0dea: c0m0: To read only the last line of a file without wastefully reading all the others, yes.
[18:26:51] pawnbox: has joined #ruby
[18:27:36] c0m0: that I would like to know is, there is any method to use like gets, but for the last line
[18:27:49] h99h9h88: has joined #ruby
[18:27:54] sigurding: has joined #ruby
[18:28:24] shevy: peculiar question :)
[18:28:36] shevy: perhaps we could have add nobu a getslast
[18:28:43] shevy: erm *nobu add a getslast
[18:29:00] beneills: has joined #ruby
[18:29:40] Ox0dea: c0m0: Is your file quite large?
[18:30:13] c0m0: Ox0dea: not, I just asked for curiosity
[18:30:33] musicnode: has joined #ruby
[18:30:36] Ox0dea: c0m0: Be curious about #seek instead. ^_^
[18:30:52] mg^: yeah seek and destroy!
[18:31:04] mg^: or something like that
[18:31:12] c0m0: 0x0dea: ok, tomorrow I will try to use seek :)
[18:32:23] synthroid: has joined #ruby
[18:33:18] Trynemjoel: has joined #ruby
[18:34:35] idefine: has joined #ruby
[18:34:42] wilbert: has joined #ruby
[18:34:50] hannelita: has joined #ruby
[18:36:07] cactuzzz: has joined #ruby
[18:36:21] hannelita: has joined #ruby
[18:37:02] jackjackdripper1: has joined #ruby
[18:37:05] JDiPierro: has joined #ruby
[18:37:14] hanneli: has joined #ruby
[18:37:33] treehug88: has joined #ruby
[18:37:55] freerobby: has joined #ruby
[18:39:40] ledestin: has joined #ruby
[18:40:02] pdoherty: has joined #ruby
[18:40:29] ht__: has joined #ruby
[18:40:55] gnudon: has joined #ruby
[18:43:05] tomphp: has joined #ruby
[18:43:07] kirillzh: has joined #ruby
[18:43:34] ElFerna: has joined #ruby
[18:45:49] skcin7: has joined #ruby
[18:46:23] Ishido: has joined #ruby
[18:46:42] speaking1ode: has joined #ruby
[18:46:50] jackjackdripper: has joined #ruby
[18:47:08] idefine: has joined #ruby
[18:47:49] sgambino: has joined #ruby
[18:48:24] snockerton: has joined #ruby
[18:48:29] shadoi: has joined #ruby
[18:48:31] musicnode: has joined #ruby
[18:48:54] ElFerna: has joined #ruby
[18:49:07] snockerton: is it possible to use popen3 and get stdout "streaming" back to the parent thread before the child thread exits?
[18:49:57] hobodave: has joined #ruby
[18:51:46] emilford: has joined #ruby
[18:52:40] dlitvak: has joined #ruby
[18:52:54] ht__: has joined #ruby
[18:53:03] adaedra: It's the default behavior, just read on stdout and stderr
[18:53:23] adaedra: (the ones passed to you)
[18:54:07] synthroid: has joined #ruby
[18:54:47] Ebok: has joined #ruby
[18:54:57] Mon_Ouie: Also Kernel#spawn allows to set up redirection directly so you don't need to do anything
[18:55:00] speaking1ode: has joined #ruby
[18:55:34] joonty: has joined #ruby
[18:55:40] wilbert_: has joined #ruby
[18:56:52] zeroDivisible: has joined #ruby
[18:57:41] Renich: Well, thanks a lot Ox0dea, for the help. One question, though: http://fpaste.org/315422/45392103/
[18:57:57] Renich: Ox0dea: I have a bunch of nils. Is it because indexes don't start at 0?
[18:58:24] Ox0dea: Renich: It's because they do. :P
[18:58:24] Ox0dea: Arrays are contiguous by definition.
[18:58:32] Ox0dea: >> a = []; a[5] = 1; a
[18:58:33] ruby[bot]: Ox0dea: # => [nil, nil, nil, nil, nil, 1] (https://eval.in/508956)
[18:58:37] burgestrand: has joined #ruby
[18:58:41] Renich: Ox0dea: so a hash of hashes is what I want, then
[18:58:50] Renich: Ox0dea: thanks a lot, dude
[18:59:01] Ox0dea: Renich: Are the `nil`s going to be a problem, then?
[18:59:09] Scripore: has joined #ruby
[18:59:56] lurch_: has joined #ruby
[19:00:00] Renich: Ox0dea: I don't know, but I don't want them there since I don't need them in the list
[19:00:10] Renich: Ox0dea: already turned into a hash of hashes
[19:00:23] Ox0dea: A Hash with small numeric keys wishes it were an Array.
[19:00:44] Renich: Ox0dea: http://fpaste.org/315423/14539212/
[19:00:55] ht__: has joined #ruby
[19:01:10] Ox0dea: I suspect it won't much matter for your present purpose, but hashes are generally more expensive than arrays.
[19:01:20] Renich: Ox0dea: yeah, hehe. I'll try to "Rubyise" the script even more. Using a telnet gem or something.
[19:01:36] Renich: Ox0dea: will each skip the nils?
[19:02:26] Ox0dea: Well, no, but you could just #compact the Array, only then your indices would be off.
[19:03:19] uris: has joined #ruby
[19:03:40] idefine: has joined #ruby
[19:04:07] Renich: Ox0dea: yeah, but I'd loose the item ID. I'd have to have a larger array
[19:04:13] Renich: Ox0dea: deeper, that is
[19:04:25] Ox0dea: Renich: Er, no, you'd just have holes.
[19:04:34] babblebre: has joined #ruby
[19:04:50] malconis: has joined #ruby
[19:04:55] ht__: has joined #ruby
[19:04:59] Ox0dea: If you're gonna integer keys, at least make them actual integers. :P
[19:05:23] Renich: Ox0dea: OK
[19:05:56] sgambino: has joined #ruby
[19:06:50] Renich: oh, telnet is part of stdlib
[19:09:06] snockerton: adaedra: i can't get the default behavior of popen3 to work like that - https://gist.github.com/adampats/b1bdb665a133891d3bd7
[19:09:08] sgambino: has joined #ruby
[19:09:26] RobertBirnie: has joined #ruby
[19:09:42] despai: has joined #ruby
[19:09:46] workmad3: has joined #ruby
[19:09:51] Asher: has joined #ruby
[19:10:17] speaking1ode: has joined #ruby
[19:10:22] snockerton: i've tried all kinds of trickery to read stdout, but it only outputs in the parent thread once the child thread exits!
[19:11:13] newdan: In Python when I have an uncaught exception in the shell, I can do "import pdb; pdb.pm()" and it will let me debug from the exception point, post-mortem. Is there anything like that in Ruby?
[19:11:46] hahuang65: has joined #ruby
[19:12:05] snockerton: i use pry-byebug
[19:12:16] jcdesimp: has joined #ruby
[19:12:23] TheDracle: has joined #ruby
[19:12:34] snockerton: then put binding.pry in my code / rescue block
[19:13:02] xapak: has left #ruby: ()
[19:13:05] TheDracle: So, I've installed gems locally on a build system using bundle install --deployment, and all of the gems have been placed underneath vendor/bundle/ruby/1.9.1/gems
[19:13:15] TheDracle: However I can't seem to require the gems after doing this.
[19:13:16] dlitvak: has joined #ruby
[19:13:20] newdan: snockerton: So if the exception's already happened, you're out of luck?
[19:13:28] TheDracle: I've tried setting GEM_PATH, and other wonky things... But it just seems like bundler ought to have set it up correctly.
[19:13:55] sgambino: has joined #ruby
[19:14:00] TheDracle: Any ideas on how I can get it so these gems are accessible to ruby?
[19:14:16] mdw: has joined #ruby
[19:15:01] Macaveli: has joined #ruby
[19:15:35] centrx: has joined #ruby
[19:15:48] synthroid: has joined #ruby
[19:15:52] Ox0dea: newdan: https://github.com/deivid-rodriguez/byebug/blob/master/GUIDE.md#-m----post-mortem
[19:16:19] spider-mario: has joined #ruby
[19:16:21] Ox0dea: They even used familiar nomenclature!
[19:16:41] newdan: Ox0dea: Haha, cool thanks
[19:17:02] newdan: I wonder why the builtin Ruby debug feature seems... ...relatively unloved
[19:17:21] RegulationD: has joined #ruby
[19:17:23] Ox0dea: snockerton: It's not entirely clear what you're going for here. Is test1 not supposed to be connecting to the server you start in test2?
[19:18:16] dlitvak: has joined #ruby
[19:18:40] Ox0dea: TheDracle: Try invoking your script as `bundle exec ruby foo.rb`.
[19:19:23] TheDracle: Ox0dea, Seems closer :) Some other error now, thanks :)
[19:19:36] Ox0dea: Happy to help! :)
[19:20:36] juddey: has joined #ruby
[19:20:57] blackmesa: has joined #ruby
[19:22:21] oivoodoo: has joined #ruby
[19:22:40] speaking1ode: has joined #ruby
[19:26:51] ht__: has joined #ruby
[19:27:03] elricsfate_: has joined #ruby
[19:27:06] elricsfate_: Hi all http://fpaste.org/315435/45392273/
[19:27:22] elricsfate_: This would test if ldap_cacert is NOT nil right?
[19:27:40] elricsfate_: I'm not sure if nil should be quoted or not, pretty sure it shouldn't since it would probably be viewed as a string at that point
[19:28:22] h99h9h88: has joined #ruby
[19:28:47] sts: Does anyone know why FileUtils.chmod(0750, ['a', 'b']) would throw: fileutils.rb:904:in `block in symbolic_modes_to_i': invalid file mode: 0750 (ArgumentError)
[19:28:53] PedramT: has joined #ruby
[19:29:00] platzhirsch: has left #ruby: ()
[19:30:06] benlovell: has joined #ruby
[19:31:13] sgambino: has joined #ruby
[19:31:14] sftrabbit: has joined #ruby
[19:32:36] uris: has joined #ruby
[19:32:54] Ilyes512: has joined #ruby
[19:34:32] gruz0: has joined #ruby
[19:34:35] shevy: works here... what is symbolic_modes_to_i hmm
[19:35:55] symm-: has joined #ruby
[19:36:39] ur5us: has joined #ruby
[19:36:50] lucasb: I can confirm it works here too. what's your ruby version, sts?
[19:36:51] TomSequitur: has joined #ruby
[19:37:33] synthroid: has joined #ruby
[19:37:54] Kruppe: has joined #ruby
[19:38:11] idefine: has joined #ruby
[19:38:45] TomSequitur: has left #ruby: ()
[19:38:45] symm-_: has joined #ruby
[19:39:17] x77686d: has joined #ruby
[19:40:26] hannelita: has joined #ruby
[19:40:27] waheedi: anyone know the javascript function eval?
[19:41:01] ruby[bot]: Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[19:41:15] nofxx: Waheedi, which lang doesn't have an #eval thingy?
[19:41:18] waheedi: if you use this eval('([[[\"1\",\"one\",,,9]],,\"en\"])') it will return array of 5 items 0 and 1 should be 1 and one
[19:41:41] waheedi: how can i make that happen with ruby :)
[19:41:52] waheedi: i feel its a shame to ask the question
[19:42:33] waheedi: nofxx: thingy then, lol
[19:42:57] lucasb: in ruby, consecutive commas are syntax error
[19:43:17] lucasb: you can type 'nil, nil, nil, etc.' :)
[19:43:28] waheedi: i can't control that
[19:43:30] waheedi: i wish i can
[19:43:59] shevy: to silence all ruby message output from a .rb file, "$stdout = StringIO.new" is in general the recommended way? or are there alternatives
[19:44:48] newdan: shevy: When running on the terminal you can use 'ruby foo.rb > /dev/null'
[19:45:08] Mon_Ouie: redirect to File::NULL in Ruby
[19:45:26] Ox0dea: shevy: http://logs.ryanbigg.com/ruby?date=2016-01-12#4944064 :P
[19:45:34] Ox0dea: I think you must put me on mute sometimes. :<
[19:45:58] shevy: no... I don't remember that conversation
[19:45:58] drbrain: shevy: $stdout = File.open IO::NULL, "w"
[19:46:19] Ox0dea: drbrain: Any reason not to #reopen?
[19:46:30] arup_r: has joined #ruby
[19:46:38] drbrain: in case you want to output something then STDOUT still holds it
[19:46:45] waheedi: lucasb: the problem is that there is few thing you need to remove from that string to become a clear array, like replacing ,, with ,nil, and removing the \, but sometime "one" string could be anything including ,, and
[19:47:24] sts: lucasb: 2.1.5p273
[19:47:32] drbrain: sure, you could get STDOUT back from IO.for_fd
[19:47:33] Ox0dea: sts: Weird filesystem?
[19:47:50] drbrain: but I think assigning to $stdout is always best
[19:47:55] waheedi: maybe i need to use regex but even that might go wrong
[19:47:58] Ox0dea: Yeah, makes sense.
[19:47:59] nofxx: has joined #ruby
[19:48:01] _djbkd: has joined #ruby
[19:48:10] shevy: Ox0dea oh I think I now remember that... that was probably for another project ... right now I have something else, similar but different. I also just realized that some other output still appears, from configure... probably system "./configure"
[19:48:12] Ox0dea: Waheedi: Seems like you should just be using JavaScript.
[19:48:21] sts: why does it actually call symbolic_modes_to_i? because its a absolute mode which I'm passing.
[19:48:24] idefine: has joined #ruby
[19:48:31] Ox0dea: shevy: It's probably going to $stderr, so just redirect that to IO:NULL as well.
[19:48:37] waheedi: Ox0dea: oh yeah ;)
[19:49:21] waheedi: how can i execute javacasript code inside a ruby method?
[19:49:38] baweaver: has joined #ruby
[19:50:27] newdan: Waheedi: https://github.com/cowboyd/therubyracer#synopsis ?
[19:50:37] waheedi: thanks newdan
[19:50:54] Ox0dea: snockerton: I'm still not sure what you're up to, but maybe this'll steer you in the right direction: https://gist.github.com/0x0dea/6a06310137042bcb98f0
[19:50:55] ht__: has joined #ruby
[19:51:04] Ox0dea: Waheedi: https://github.com/vanruby/javascript
[19:51:28] platzhirsch: has joined #ruby
[19:51:31] elifoster: has joined #ruby
[19:51:38] platzhirsch: has left #ruby: ()
[19:51:50] kies^: has joined #ruby
[19:52:29] snockerton: Ox0dea: thx, i figured out it was the STDOUT.flush i was missing
[19:53:30] SCHAAP137: has joined #ruby
[19:53:58] IronDicideth: has joined #ruby
[19:54:23] elricsfate__: has joined #ruby
[19:54:46] kirillzh: has joined #ruby
[19:55:47] skcin7: has joined #ruby
[19:57:03] pawnbox: has joined #ruby
[19:57:35] joonty: has joined #ruby
[19:58:49] Xeago: has joined #ruby
[19:59:13] yfeldblum: has joined #ruby
[19:59:18] synthroid: has joined #ruby
[19:59:33] sts: Ox0dea: maybe its just because i use it from a hash key? https://gist.github.com/anonymous/9076a82005cad4ff9b57
[20:00:55] govg: has joined #ruby
[20:01:17] e4xit: has joined #ruby
[20:02:27] leksster: has joined #ruby
[20:02:35] waheedi: incase anyone interested how to overcome that arr = cxt.eval("arr = eval('([[[\"1\",\"one\",,,9]],,\"en\"])[0][0][0]');")
[20:03:18] Ox0dea: sts: It's because you're using a String.
[20:03:44] petricore: has joined #ruby
[20:04:27] sts: Ox0dea: ah. I need to convert to octal.
[20:04:54] Ox0dea: sts: Or just use octal from the start.
[20:05:56] Ox0dea: >> '0750'.to_i.to_s 8 # Here's the problem.
[20:05:59] ruby[bot]: Ox0dea: # => "1356" (https://eval.in/508975)
[20:06:05] symbole: has joined #ruby
[20:06:17] hannelita: has joined #ruby
[20:06:52] usershell: has joined #ruby
[20:07:15] Jardayn: has joined #ruby
[20:07:15] Ox0dea: >> Integer('0750') == '0750'.to_i
[20:07:17] ruby[bot]: Ox0dea: # => false (https://eval.in/508976)
[20:09:47] Xeago: has joined #ruby
[20:10:38] FernandoBasso: has joined #ruby
[20:11:29] uris: has joined #ruby
[20:12:04] nertzy2: has joined #ruby
[20:12:15] elricsfate_: has joined #ruby
[20:12:15] lxsameer: has joined #ruby
[20:12:15] lxsameer: has joined #ruby
[20:12:49] sgambino: has joined #ruby
[20:14:44] karapetyan: has joined #ruby
[20:15:03] mdw: has joined #ruby
[20:15:20] tildes: has joined #ruby
[20:15:54] dexter-tzu: has joined #ruby
[20:17:47] BTRE: has joined #ruby
[20:18:09] yoongkang: has joined #ruby
[20:18:44] casadei: has joined #ruby
[20:20:15] sgambino: has joined #ruby
[20:20:40] TheDracle: has joined #ruby
[20:21:02] synthroid: has joined #ruby
[20:23:09] DarkElement: has joined #ruby
[20:23:54] oivoodoo: has joined #ruby
[20:23:57] DarkElement: I am trying to get proxy connections working with HTTParty, as Radar recommended earlier. However, I must be doing something wrong since my code never manages to get the html. Any ideas? https://gist.github.com/DarkElement75/7d9b98429ebc130e8063
[20:24:20] yqt: has joined #ruby
[20:28:33] Ox0dea: DarkElement: Google is ignoring you.
[20:29:00] DarkElement: Every link I looked at just gave the same thing that didn't work
[20:29:06] h99h9h88: has joined #ruby
[20:29:09] DarkElement: I tried all the things
[20:29:17] DarkElement: What is URI(ENV())?
[20:29:46] mfb2: has joined #ruby
[20:29:48] mdw: has joined #ruby
[20:30:14] Ox0dea: Nothing appropriate.
[20:30:31] DarkElement: Are you going to help?
[20:31:13] DarkElement: I don't know why I un /ignore'd you
[20:31:18] kirillzh: has joined #ruby
[20:31:21] FernandoBasso: has joined #ruby
[20:31:24] DarkElement: Won't make that mistake again.
[20:31:36] gregf: has joined #ruby
[20:31:38] hannelita: has joined #ruby
[20:32:11] dcunit3d: has joined #ruby
[20:32:55] tomchapin: has joined #ruby
[20:34:01] Ebok: has joined #ruby
[20:34:15] ror15: has joined #ruby
[20:34:41] ror15: I'm not sure if this is a factory_girl thing or not. I'm trying to use attributes_for and getting a nomethoderror. What am I doing wrong?
[20:34:43] ror15: https://www.refheap.com/114152
[20:35:37] Xeago: has joined #ruby
[20:37:28] greenhat: ror15: Did you mix in the factory_girl methods? https://github.com/thoughtbot/factory_girl/blob/master/GETTING_STARTED.md#configure-your-test-suite
[20:39:34] toretore: has joined #ruby
[20:41:16] william3: has joined #ruby
[20:42:43] Ebok: has joined #ruby
[20:42:46] synthroid: has joined #ruby
[20:43:08] greenhat: ror15: Also, hardcoding counts (where you expect Contact.count) to equal 1 will eventually bite you. You just just check that Contact.count has gone up by one.
[20:43:19] kirillzh: has joined #ruby
[20:43:32] colegatron_origi: has joined #ruby
[20:43:34] greenhat: With minitest you would use assert_difference. I don't know the rspec equivalent.
[20:44:51] ht__: has joined #ruby
[20:46:20] ror15: greenhat: That was it, thank you
[20:46:42] pawnbox: has joined #ruby
[20:46:58] ror15: greenhat: Also just playing with rspec so I'll change that test, cheers
[20:47:06] Asher: has joined #ruby
[20:47:50] elricsfate__: has joined #ruby
[20:48:00] skcin7: has joined #ruby
[20:48:46] Pande: has joined #ruby
[20:49:07] Cohedrin: has joined #ruby
[20:49:12] sgambino: has joined #ruby
[20:50:27] hobodave: has joined #ruby
[20:50:32] baweaver: has joined #ruby
[20:50:48] PedramT: has joined #ruby
[20:51:49] Radar: DarkElement: What is res.status_code?
[20:51:56] Radar: DarkElement: You're not checking if it's a successful request.
[20:52:14] DarkElement: Radar, one sec
[20:53:20] cicloid: has joined #ruby
[20:53:21] DarkElement: Radar, it never reaches the point where it prints res
[20:53:39] Radar: is it even making the request?
[20:53:47] DarkElement: It gets right to it
[20:53:50] DarkElement: then never finishes, so it seems
[20:54:06] DarkElement: Also, may be a stupid question but do you need to prepend http:// to the proxy address
[20:54:23] Radar: I don't have any idea.
[20:54:35] Ebok: has joined #ruby
[20:54:35] tvw: has joined #ruby
[20:54:36] Radar: Don't think I can debug this one from so far away
[20:54:50] agent_white: has joined #ruby
[20:55:23] agent_white: Afternoon folks
[20:55:31] DarkElement: Radar, want the code?
[20:55:37] Radar: DarkElement: I saw it.
[20:55:43] Radar: I still don't any any idea.
[20:57:00] visudo_: has joined #ruby
[20:57:53] snguyen: has joined #ruby
[20:58:55] Radar: DarkElement: My guess is the request isn't even reaching the proxy.
[20:59:06] choke: has joined #ruby
[20:59:06] DarkElement: So what should I do
[20:59:35] Radar: ACTION wants to snark so badly.
[20:59:52] synthroid: has joined #ruby
[20:59:54] Radar: DarkElement: What do you think you should do? Perhaps it'd be a good start to walk through the request process. Find out if the request actually hits the proxy, yeah?
[21:00:10] Radar: I am disappointed that it doesn't appear that you're doing _any_ thinking of your own on this one.
[21:00:28] DarkElement: I have been trying that with curl
[21:00:32] snguyen: has joined #ruby
[21:00:34] DarkElement: And it is also not connecting
[21:01:14] chipotle: has joined #ruby
[21:01:14] Radar: Soooooooooooooo the next logical step is....?
[21:01:29] Radar: (p.s. I just very explicitly told you what it should be. This is a test to see if you're paying attention)
[21:01:57] DarkElement: I tried other proxies, and other websites, was that what you meant?
[21:02:08] DarkElement: I can ping the proxy?
[21:02:50] Ebok: has joined #ruby
[21:03:13] Radar: That means that it accepts ping requests. Is port 80 even open on that machine?
[21:03:14] tvw: has joined #ruby
[21:03:18] sandstrom: has joined #ruby
[21:03:43] snguyen: i'm trying to load a git repo that contains my *.rb files from another package, but i'm struggling to load them in. i've created a gem for it and added the gem it with my gemfile. when i ran bundle install, i saw the repo get pulled into my rbenv environment. but these attempts didn't work: require 'myrailsapp/app/models/user.rb', require 'myrailsapp/app/models/user'. what am i doing wrong?
[21:04:21] Ebok: has joined #ruby
[21:04:28] synthroid: has joined #ruby
[21:04:33] DarkElement: Radar, I just tried to ping it, it responded from a different ip saying it was Unreachable. I guess it is not open since I had to ping it without the :80
[21:04:51] TheDracle: has joined #ruby
[21:04:53] sgambino: has joined #ruby
[21:05:20] Radar: DarkElement: So you're using a "proxy" which you don't have any control over?
[21:05:45] sgambino: has joined #ruby
[21:06:11] Radar: DarkElement: I cannot help you with this. It's impossible.
[21:06:22] Radar: You're not understanding at all how proxies work and I don't have the time to explain it to you.
[21:06:29] s2013: has joined #ruby
[21:06:33] mary5030: has joined #ruby
[21:06:45] antgel: has joined #ruby
[21:08:56] lkba: has joined #ruby
[21:09:32] nertzy2: has joined #ruby
[21:10:33] DarkElement: I chose a proxy from a large list. K.
[21:10:36] tomphp: has joined #ruby
[21:10:55] Radar: And the list shows that this proxy is currently active?
[21:13:02] jcdesimp: has joined #ruby
[21:13:14] Shaboum: has joined #ruby
[21:14:36] blackgoat: has joined #ruby
[21:14:52] einarj: has joined #ruby
[21:16:45] pawnbox: has joined #ruby
[21:17:25] oivoodoo: has joined #ruby
[21:17:31] Ox0dea: No such file or directory
[21:17:45] idefine: has joined #ruby
[21:17:47] ur5us_: has joined #ruby
[21:18:46] vF3hNGxc47h8: has joined #ruby
[21:18:54] ht__: has joined #ruby
[21:19:58] sftrabbit: has joined #ruby
[21:20:18] futilegames: has joined #ruby
[21:20:48] moeabdol1: has joined #ruby
[21:21:05] wilbert_: has joined #ruby
[21:21:13] gruz0: has joined #ruby
[21:22:05] idefine: has joined #ruby
[21:22:28] baweaver: has joined #ruby
[21:23:07] bruce_lee: has joined #ruby
[21:23:20] DarkElement: has joined #ruby
[21:23:54] babblebre: has joined #ruby
[21:24:07] tomphp: has joined #ruby
[21:24:14] stannard: has joined #ruby
[21:24:42] agent_white: has joined #ruby
[21:24:55] ht__: has joined #ruby
[21:25:34] einarj: has joined #ruby
[21:26:16] synthroid: has joined #ruby
[21:26:18] FooMunki: has joined #ruby
[21:26:36] idefine: has joined #ruby
[21:27:48] speaking1ode: has joined #ruby
[21:28:58] tomphp: has joined #ruby
[21:31:03] jackjackdripper1: has joined #ruby
[21:31:13] tomphp: has joined #ruby
[21:33:00] cpup: has joined #ruby
[21:33:01] Ox0dea: $ pkgfile lol; echo $?
[21:33:06] Ox0dea: I'm genuinely surprised.
[21:34:22] PaulCapestany: has joined #ruby
[21:35:34] tomphp: has joined #ruby
[21:35:43] loophole_: has joined #ruby
[21:35:49] idefine: has joined #ruby
[21:35:54] freerobby1: has joined #ruby
[21:37:44] pawnbox: has joined #ruby
[21:37:59] tomphp: has joined #ruby
[21:38:31] cpup: has joined #ruby
[21:39:09] ruby-lang310: has joined #ruby
[21:41:48] BSaboia: has joined #ruby
[21:41:49] vishwa: has joined #ruby
[21:42:23] vishwa: How do you make an array of arrays? I'm trying to add arrays as an element of another array
[21:42:38] vishwa: But it prints individual elements
[21:42:54] s2013: has joined #ruby
[21:43:21] baweaver: has joined #ruby
[21:43:38] Radar: vishwa: show us what you're trying please
[21:43:53] volty: has joined #ruby
[21:44:16] BrunoSaboia: has joined #ruby
[21:44:34] dexter-tzu: has joined #ruby
[21:44:46] vishwa: Radar: Here's the whole thing - https://gist.github.com/anonymous/f49fd41c16f9a2f0bcfa
[21:44:52] ht__: has joined #ruby
[21:44:57] vishwa: Trying to add arrays to the global array $training
[21:45:00] Ox0dea: That's too much thing.
[21:45:11] Ox0dea: >> [1] + [2] # vishwa: This is the "problem", right?
[21:45:12] ruby[bot]: Ox0dea: # => [1, 2] (https://eval.in/509022)
[21:45:15] Radar: Small reproducable example please
[21:45:32] Radar: I don't want to read through nearly 200 lines of someone else's code this early in the AM
[21:45:55] emilford_: has joined #ruby
[21:46:52] duckpuppy: has joined #ruby
[21:47:50] vishwa: https://gist.github.com/anonymous/68486c202b4424fb841b, this isn't runnable though. Too many custom functions
[21:47:58] synthroid: has joined #ruby
[21:48:22] vishwa: the local array prints fine, [...], the global array prints one element on each line
[21:48:59] Radar: [08:45:14] <Radar> Small reproducable example please
[21:49:11] choke: has joined #ruby
[21:49:12] Radar: I know that I can sometimes not communicate clearly, but in that instance I think I was very clear.
[21:49:22] Radar: 44 lines is not small. It is "medium".
[21:49:32] vishwa: Oh yeah sure man
[21:50:02] ecksit: has joined #ruby
[21:50:35] Synthead: is there a way I can use IniFile to read a string that contains "inifile" data?
[21:50:50] Synthead: seems really dumb to write it to a file then read it
[21:50:56] ht__: has joined #ruby
[21:50:58] kobain: has joined #ruby
[21:51:01] Trynemjoel: has joined #ruby
[21:51:02] idefine: has joined #ruby
[21:51:16] Maletor: has joined #ruby
[21:51:21] Radar: Synthead: https://github.com/twp/inifile#examples?
[21:51:33] ramfjord: has joined #ruby
[21:51:46] Synthead: Radar: that loads a file. I'm looking to load a string
[21:51:54] Ox0dea: Synthead: Is that the library?
[21:52:02] Eiam_: has joined #ruby
[21:52:04] Synthead: Ox0dea: yeah
[21:52:23] Ox0dea: Synthead: Doesn't seem to support reading from an actual String; you should be able to pass it a StringIO.
[21:52:35] Ox0dea: >> s = StringIO.new 'ohai im a file'; s.read
[21:52:36] ruby[bot]: Ox0dea: # => "ohai im a file" (https://eval.in/509028)
[21:52:57] Synthead: Ox0dea: interesting
[21:53:42] emilford: has joined #ruby
[21:53:52] lucasb: interestring
[21:54:01] IronReaver: has joined #ruby
[21:54:06] baweaver: interesting
[21:54:20] Synthead: Ox0dea: maybe not http://pastie.org/10698424
[21:54:41] Ox0dea: That's lame. :/
[21:54:42] vishwa: Radar: I have a refined question: How do I print an array of arrays?
[21:54:55] loophole: vishwa: i don't read your code; a = []; a.push([1,2]); a.each {|e| print "#{e}\n"}
[21:55:02] Radar: >> p [[1],[2]]
[21:55:03] ruby[bot]: Radar: # => [[1], [2]] ...check link for more (https://eval.in/509030)
[21:55:10] Radar: vishwa: ^
[21:55:25] Synthead: vishwa: might look into awesome_print too
[21:56:13] vishwa: If I have [[1,3,5], [2,4,6]] thanks guys
[21:56:48] vishwa: Ugh. Thanks. Lol
[21:57:15] vishwa: has left #ruby: ()
[21:58:20] joonty: has joined #ruby
[21:59:21] DarkElement: So Radar I got it working with curl so now it's only a matter of getting it working in ruby
[22:01:19] Synthead: Ox0dea, Radar: I'm gonna use this instead: https://github.com/antw/iniparse thanks for the help!
[22:01:21] TeresaP: has joined #ruby
[22:01:31] emilford: has joined #ruby
[22:01:37] wilbert_: has joined #ruby
[22:02:50] Ox0dea: Synthead: Sure thing.
[22:03:07] emax: has joined #ruby
[22:03:29] emax: hello rubyists! Beginner here looking to trim down a method.
[22:03:48] h99h9h88: has joined #ruby
[22:04:02] DarkElement: It works never mind bye
[22:04:05] DarkElement: has left #ruby: ("Leaving")
[22:04:34] emax: https://gist.github.com/preetdha/2ffffc0ece6d3f8a96e3
[22:05:03] yoongkang: has joined #ruby
[22:05:09] baweaver: Is it in that order by requirement?
[22:05:15] emax: Wondering if anyone could help me with that. Too many if/elsifs there.
[22:05:42] emax: Yes, basically want to search through that array and take the first possible board position
[22:05:59] emax: If it is not already taken
[22:06:03] Mon_Ouie: emax: Enumerable#find on an array with all the possible strings in the right order
[22:06:28] baweaver: %w(5 1 3 7 9 2 4 6 8).find { |i| !board.taken?(i) }
[22:06:38] jcdesimp: has joined #ruby
[22:06:58] devgiant: has joined #ruby
[22:07:08] Ox0dea: *'513792468'.chars
[22:07:36] baweaver: not very readable though
[22:07:36] Ox0dea: FTFY, to clarify.
[22:07:46] baweaver: what if there's a 2-digit?
[22:07:47] Mon_Ouie: Also rename board to b and basic_move to _
[22:08:09] baweaver: that I disagree with
[22:08:19] lucasb: in 1..9 there's no 2-digit :)
[22:08:19] Ox0dea: http://i.imgur.com/hU2HbIq.jpg
[22:08:22] baweaver: single letter names breed more confusion
[22:08:31] emax: Ok thanks guys, let me play with that. brb
[22:08:32] Ox0dea: baweaver: Mon_Ouie was poking fun at me.
[22:08:37] Mon_Ouie: I thought we were golfing :(
[22:08:40] baweaver: there's not, but if there are in the future
[22:08:44] baweaver: makes sense
[22:08:56] baweaver: was thinking in the newbie context
[22:09:11] baweaver: golfing makes sense to us, but to them it might appear legit
[22:09:12] Mon_Ouie: Also tic-tac-toe is usually played on a 3??3 grid
[22:09:31] Ox0dea: 3x3x3 for an actual game, though.
[22:09:47] Ox0dea: Er, 3x3x3x3, rather.
[22:09:56] Ox0dea: 9 boards simultaneously, is the point I mean to make.
[22:10:50] Ox0dea: http://mathwithbaddrawings.com/ultimate-tic-tac-toe-original-post/
[22:11:21] emax: wow you guys are awesome
[22:11:31] gbgdev: has joined #ruby
[22:11:32] stevemackinnon: has joined #ruby
[22:11:48] waheedi: any idea <class:SoftReference>': uninitialized constant Ref::SoftReference::Monitor (NameError)? from /opt/ruby-1.9.3-p125/lib/ruby/gems/1.9.1/gems/therubyracer-0.12.2/lib/v8/weak.rb:2:in `<module:V8>'
[22:12:19] gbgdev: has joined #ruby
[22:12:25] waheedi: how to install this gem libv8 (3.16.14.7 x86_64-linux)?
[22:12:32] burgestrand: has joined #ruby
[22:12:34] cicloid: has joined #ruby
[22:12:47] waheedi: gem install libv8 -v 2.16.14.7?
[22:13:10] shevy: ERROR: Could not find a valid gem 'libv8' (= 2.16.14.7) in any repository
[22:13:21] theslow1_: has joined #ruby
[22:13:22] shevy: ERROR: Possible alternatives: libv8
[22:13:34] havenwood: shevy: https://twitter.com/joeerl/status/689502447513956352
[22:13:35] Ox0dea: shevy: Great timing. :P
[22:14:04] idefine: has joined #ruby
[22:14:07] yfeldblum: has joined #ruby
[22:14:18] idefine: has joined #ruby
[22:14:33] shevy: that always reminds me of the monty python life of brian
[22:14:51] tomphp: has joined #ruby
[22:15:25] TeresaP: If I have a class Foo with a method "abc" and it calls another method also called "abc" in the Bar class, is there another way to force it to use the other class other than @core = Object.extend(Bar) and doing @core.abc?
[22:16:07] pdoherty: has joined #ruby
[22:16:20] Scripore: has joined #ruby
[22:16:24] kirillzh: has joined #ruby
[22:16:33] Mon_Ouie: If you don't care what object the abc method is called on, it probably shouldn't be an instance method in the first place. If you make it a class method you can just use Bar.abc.
[22:16:54] TeresaP: I don't have control over Bar
[22:17:19] lucasb: is Bar a class or a module?
[22:17:28] shevy: must be a module I guess
[22:17:33] TeresaP: Good point. One sec.
[22:17:52] TeresaP: Foo is a class, Bar is a module
[22:18:24] ElFerna: has joined #ruby
[22:18:52] glcx: has joined #ruby
[22:19:06] Ox0dea: >> String.is_a? Module # What the!
[22:19:07] ruby[bot]: Ox0dea: # => true (https://eval.in/509044)
[22:19:34] Ox0dea: Classes are just instantiable modules, you say?
[22:20:54] lucasb: I don't know if this works, but I would guess you can include Bar in your Foo class, then to 'alias bar_abc abc', then define your own Foo's abc method
[22:21:10] lucasb: *then do 'alias ...'
[22:21:35] Mon_Ouie: They're instanciable inheritable non-includable non-extendable modules
[22:22:03] Ox0dea: 60% of the time, classes are modules 100% of the time.
[22:22:26] shevy: now TeresaP is wiser
[22:22:54] devbug: has joined #ruby
[22:24:48] musicnode: has joined #ruby
[22:24:58] TheDracle: has joined #ruby
[22:25:30] finisherr: has joined #ruby
[22:25:52] PedramT_: has joined #ruby
[22:26:19] baweaver: has joined #ruby
[22:26:41] matp: has joined #ruby
[22:27:19] pawnbox: has joined #ruby
[22:28:22] Frem: has joined #ruby
[22:30:14] emax: can I chain a .sort and .find together for an array?
[22:30:21] emax: i mean a .sample and .find
[22:30:32] emax: i want to randomize an array and then search from it
[22:30:51] ruby[bot]: Why don't you try it and see for yourself?
[22:31:23] emilford: has joined #ruby
[22:31:32] Ox0dea: &ri Array#shuffle emax
[22:31:32] `derpy: emax: http://ruby-doc.org/core-2.3.0/Array.html#method-i-shuffle
[22:31:53] emax: damn, ruby has so many useful methods!
[22:31:57] emax: Thanks guys!
[22:32:06] adaedra: I will go with toretore and wonder why.
[22:32:16] adaedra: Because this makes no sense.
[22:32:49] Ox0dea: How come not?
[22:32:51] nerium: has joined #ruby
[22:33:28] Ox0dea: >> [1,2,3,4,5].sample(&:even?)
[22:33:29] ruby[bot]: Ox0dea: # => 4 (https://eval.in/509047)
[22:33:34] Ox0dea: Well, you got lucky there.
[22:33:36] adaedra: you'll get, for the most cases, the same result
[22:33:40] Ox0dea: But #sample doesn't take a block.
[22:33:54] shevy: are you playing roulette again
[22:34:04] Ox0dea: I'm defending emax from the baddies.
[22:34:15] Ox0dea: As I understand it, they want to grab a random element that meets some predicate.
[22:34:17] adaedra: >> %w[shevy Ox0dea].sample # next unfair kick
[22:34:18] ruby[bot]: adaedra: # => "Ox0dea" (https://eval.in/509050)
[22:34:21] emax: thank you Ox0dea!
[22:34:25] shevy: emax makes me want to find the meme with the beard dude
[22:34:26] Ox0dea: No worries. <3
[22:34:47] Mon_Ouie: In this case, probably to randomize the AI (instead of having one that, say, plays optimally)
[22:34:56] shevy: drunk AI!
[22:35:04] emax: have an easy mode and a hard mode
[22:35:40] zodoz: has joined #ruby
[22:35:53] baweaver: has joined #ruby
[22:36:12] Cohedrin: has joined #ruby
[22:36:20] adaedra: shevy: I think we were doing AIs so they can do our work while we get drunk. If they got drunk too, it defeats the purpose?
[22:37:13] shevy: good point
[22:37:25] Cohedrin: has joined #ruby
[22:38:19] burgestrand: has joined #ruby
[22:38:22] TheDracle: has joined #ruby
[22:38:57] snguyen: has joined #ruby
[22:40:43] ccaffeini: has joined #ruby
[22:41:25] harly_: has joined #ruby
[22:41:47] whippythellama: has joined #ruby
[22:43:00] zenlot1: has joined #ruby
[22:44:09] idefine: has joined #ruby
[22:45:33] lucasb: Let's say one object include Enumerable, and it's each method yields more than one value at a time
[22:45:50] lucasb: like, 'yield a, b'
[22:46:29] lucasb: some Enumerable methods that uses blocks like {|x| ... }, will have x be a, and others methods will have x be [a,b]
[22:46:37] volty: { |*args| ?
[22:46:37] B1n4r10: has joined #ruby
[22:46:51] adaedra: lucasb: like Hash?
[22:46:51] Ox0dea: lucasb: Do you have Lisp's multiple value semantics in mind?
[22:47:23] lucasb: for example: map {|x| ... } # x is a
[22:47:32] lucasb: select {|x| ... } # x is [a,b]
[22:47:43] lucasb: I know I can do |*x| and get an array
[22:47:56] lucasb: I just wonder if there's some convention I'm missing
[22:48:25] lucasb: If I do map {|*x| ... } I get [a,b]
[22:48:31] lucasb: If I do select {|*x| ... } I get [[a,b]]
[22:48:50] Ox0dea: lucasb: Is this for a Hash?
[22:49:07] lucasb: Ox0dea, adaedra: it's for a custom method I created
[22:49:07] adaedra: >> {a:1}.each{|n|p n}
[22:49:09] ruby[bot]: adaedra: # => [:a, 1] ...check link for more (https://eval.in/509053)
[22:49:21] adaedra: >> {a:1}.each{|n, m|p [n, m]}
[22:49:23] ruby[bot]: adaedra: # => [:a, 1] ...check link for more (https://eval.in/509054)
[22:49:25] lucasb: *custom object
[22:49:48] adaedra: Hash (kind of) do what you want, yielding two values
[22:50:06] adaedra: (Not sure if it's yielding two values or yielding an array of two)
[22:50:32] adaedra: (Oxpedantea may complete me on this one)
[22:50:37] nertzy2: has joined #ruby
[22:51:25] Ox0dea: That is kinda weird.
[22:51:29] marienz: has joined #ruby
[22:51:39] Ox0dea: #map and #select do indeed receive Array arguments differently.
[22:52:01] lucasb: Ox0dea: so, you confirm the weirdiness?
[22:52:06] adaedra: damn, I thought I was doing a predictable language.
[22:52:08] Ox0dea: Rather, it actually depends on how you yield them!
[22:52:13] Ox0dea: adaedra: Ha!
[22:52:35] adaedra: >> {a:1}.select{|n, m|p [n, m]}
[22:52:36] ruby[bot]: adaedra: # => [:a, 1] ...check link for more (https://eval.in/509056)
[22:52:49] adaedra: >> {a:1}.select{|n|p n}
[22:52:51] ruby[bot]: adaedra: # => :a ...check link for more (https://eval.in/509057)
[22:53:15] lucasb: class C; include Enumerable; def each; yield 1, 2; yield 3, 4; end; end
[22:53:21] lucasb: ^^ I just did this
[22:53:32] solocshaw: has joined #ruby
[22:53:33] Ox0dea: https://eval.in/509058
[22:53:51] lucasb: I just have to watch out which way should I write the block arguments
[22:54:58] adaedra: At least it seems constant between ruby implementations.
[22:55:21] idefine: has joined #ruby
[22:55:24] Ox0dea: It's still really weird that `yield` actually does do "multiple values", but only for #map and not #select.
[22:55:27] adaedra: I would say better be sure and use |n, m| each time
[22:55:45] adaedra: every time* ?
[22:56:59] Ox0dea: Just to clarify, this is definitely weird, yeah? https://eval.in/509061
[22:57:25] pawnbox: has joined #ruby
[22:57:39] Darmani: has joined #ruby
[22:57:45] Darmani: Hey kids<3
[22:58:09] zodoz_: has joined #ruby
[22:58:56] idefine: has joined #ruby
[22:58:58] adaedra: Ox0dea: http://i0.kym-cdn.com/photos/images/newsfeed/000/173/576/Wat8.jpg?1315930535
[22:59:04] lucasb: ok, I try to be careful with my blocks arguments signature. thanks everybody for acknowledging the situation.
[22:59:12] replay: has joined #ruby
[22:59:38] Ox0dea: lucasb: Thanks for bringing the situation to our attention. :P
[23:00:14] karapetyan: has joined #ruby
[23:00:17] Ox0dea: There must be some logic behind it, but I can't see it.
[23:00:23] Asher: has joined #ruby
[23:00:32] RobertBirnie: has joined #ruby
[23:00:37] Ox0dea: It's the same weirdness as for Hash#select/reject, though.
[23:00:52] visudo: has joined #ruby
[23:01:09] lucasb: maybe some core code is considering the arity of the block for some methods and not for others
[23:02:37] adaedra: after this weirdness it's time for bed
[23:03:56] Mon_Ouie: https://gist.github.com/anonymous/7b9a69291f5b3bcc9952
[23:04:09] TheDracle: has joined #ruby
[23:04:18] Mon_Ouie: I haven't followed the referenced tickets to see the rationale behind doing this
[23:04:35] jackjackdripper: has joined #ruby
[23:04:48] mfb2: has joined #ruby
[23:06:22] Ox0dea: It's very strange.
[23:06:26] lucasb: oh, so there was designs decision behind that. I'll try do dig some discussion on it. thanks for the note Mon_Ouie.
[23:06:58] Dimik: has joined #ruby
[23:07:37] emilford: has joined #ruby
[23:08:11] Azure: has joined #ruby
[23:09:06] baweaver: has joined #ruby
[23:09:32] usershell: has joined #ruby
[23:10:24] volty: select works on the whole iteration data
[23:10:30] volty: while map transforms it
[23:10:35] volty: nothing strange
[23:11:23] volty: i meant select HAS to return everything from the iteration (that passes)
[23:11:54] kalopsian: has joined #ruby
[23:12:09] volty: while map transforms what it receives
[23:12:47] h99h9h88_: has joined #ruby
[23:13:19] volty: we have a map that receives & returns partial iteration data
[23:14:34] victortyau: has joined #ruby
[23:15:11] JDiPierro: has joined #ruby
[23:15:25] kfpratt: has left #ruby: ()
[23:16:58] volty: select (as well as first) has to return the original yield (when test passes), while map returns whatever you tell it to
[23:17:20] TomPeed: has joined #ruby
[23:17:57] snowy: has joined #ruby
[23:18:06] jackjackdripper: has joined #ruby
[23:18:24] triangles: has joined #ruby
[23:18:29] Ox0dea: Why should that have any bearing on what either method is given to work with?
[23:18:37] Ebok: has joined #ruby
[23:19:18] volty: I do not get it.
[23:19:49] toretore: https://eval.in/509090 seems to be an arity thing
[23:21:12] volty: I am saying that map & select & first are consistent as long as inside the closure the args are distributed in the same way.
[23:21:29] volty: and I bet they are
[23:21:45] jackjackdripper: has joined #ruby
[23:21:46] baweaver: that word, I do not think it means what you think it means
[23:21:56] baweaver: function, or block.
[23:22:04] volty: ok, block
[23:23:07] toretore: https://eval.in/509091 it has to do with how yield works specifically
[23:23:12] PaulCapestany: has joined #ruby
[23:24:10] Ropeney: has joined #ruby
[23:24:10] volty: the question should be if yield does it differently
[23:24:34] kerunaru: has joined #ruby
[23:24:48] toretore: >> proc{|a| a }.call(1,2,3)
[23:24:50] ruby[bot]: toretore: # => 1 (https://eval.in/509094)
[23:24:54] kerunaru: has joined #ruby
[23:24:59] Ox0dea: That's different.
[23:25:23] Ox0dea: `yield a, b` is an Array.
[23:25:34] Ox0dea: *Except* in a call to #map with a block declared to take a single parameter.
[23:25:50] volty: ops, sorry, it yield differently
[23:26:01] baweaver: lambdas are fun!
[23:26:04] Ox0dea: That's the *only* place Ruby has what might be called "real" multiple values.
[23:26:14] Ox0dea: The asymmetry with the rest of the system means it's wrong.
[23:26:34] toretore: >> def y; yield 1,2; end; y{|a| a }
[23:26:36] ruby[bot]: toretore: # => 1 (https://eval.in/509095)
[23:26:49] toretore: >> def y; yield [1,2]; end; y{|a| a }
[23:26:51] ruby[bot]: toretore: # => [1, 2] (https://eval.in/509097)
[23:26:52] volty: https://eval.in/private/e0b11ce3b1380d
[23:27:24] pawnbox: has joined #ruby
[23:27:52] volty: yap, I was wrong because not tested, the examples were wrong too because didn't show what was entering the block
[23:28:13] Ox0dea: toretore: Does that mean all the other Enumerable methods are doing it wrong?
[23:28:33] toretore: it's not about Enumerable, it's just how yield works afaict
[23:29:08] toretore: your each is yielding (1,2) but the block (whichever one it is) receives only (1)
[23:29:16] Darmani: "Error install jumpstart_auth, the 'http_parser.rb' native gem requires installed build tools"
[23:29:21] Darmani: Can someone explain this to me in English?
[23:29:25] toretore: Darmani, os?
[23:29:37] toretore: count me out
[23:29:48] jackjackdripper1: has joined #ruby
[23:29:55] Mon_Ouie: It is about how Enumerable implements them, #map enum_yield(argc, argv) (which is like Ruby's yield(*args)), most other methods use rb_yield(arg) (which is like yield(arg))
[23:30:14] arlek_: has joined #ruby
[23:30:32] volty: why then map and select 's block receive different args ?
[23:30:43] Mon_Ouie: No idea, I can't read Japanese
[23:30:43] Ox0dea: Mon_Ouie just said...
[23:31:09] Ox0dea: Maybe it's a philosophical thing.
[23:32:34] Darmani: Ox0dea - Is there another gem I could use that does the same thing?
[23:32:41] Darmani: Don't leave me hanging Q.Q
[23:32:55] Ox0dea: Darmani: gem install gentoo
[23:33:35] Darmani: could not find valid gem in any repository.
[23:33:37] toretore: Estimated time until install completed: 34 years 2 months 3 days
[23:33:54] Azure: has joined #ruby
[23:34:04] Darmani: Ox0dea - Are you sure that's the name?
[23:34:25] elifoster: has joined #ruby
[23:35:09] despai: has joined #ruby
[23:35:27] toretore: Darmani, it was a joke, there is no alternative if it's a dependency
[23:36:00] Darmani: That's mean :[ I thought he was serious
[23:36:40] visudo: has joined #ruby
[23:37:44] volty: https://eval.in/private/59a3d9deafbaad
[23:37:50] volty: stranger & stranger
[23:37:59] Eiam_: has joined #ruby
[23:38:29] TomPeed: has joined #ruby
[23:38:37] agent_white: has joined #ruby
[23:39:23] Ox0dea: # => stranger
[23:41:05] Ox0dea: It's high time somebody wrote a script to prevent that.
[23:41:17] Ox0dea: Anybody know any programmers?
[23:41:33] volty: only you uu uu uuuuuuu, only you ....
[23:42:03] Ox0dea: https://www.youtube.com/watch?v=9r2pEdc1_lI
[23:43:10] dtordable: Ox0dea: tell me
[23:43:24] Ox0dea: dtordable: ?
[23:43:26] volty: :), it would be easier to inject a rewritten select into Enumerable, wouldn't ?
[23:43:58] rikkipitt: has joined #ruby
[23:45:12] s2013: has joined #ruby
[23:45:17] tAn: has joined #ruby
[23:45:33] Ox0dea: Well, Array doesn't actually use Enumerable's implementations for the most part.
[23:45:50] waheedi: I'm receiving this error /usr/local/lib/ruby/gems/2.0.0/gems/therubyracer-0.12.2/lib/v8/object.rb:69:in `method_missing': undefined method `empty?' for #<V8::Array:0x007f6b078913a8> (NoMethodError)
[23:47:23] idefine: has joined #ruby
[23:49:57] Ox0dea: >> [].methods.group_by { |m| [].method(m).owner }.map { |c, m| [c, m.size] }
[23:49:59] ruby[bot]: Ox0dea: # => [[Array, 93], [Enumerable, 34], [Kernel, 42], [BasicObject, 7]] (https://eval.in/509119)
[23:50:27] Mon_Ouie: >> Enumerable.instance_methods.size
[23:50:28] B1n4r10: has joined #ruby
[23:50:28] ruby[bot]: Mon_Ouie: # => 53 (https://eval.in/509122)
[23:50:47] Ox0dea: 18>> Enumerable.instance_methods.size
[23:50:48] ruby[bot]: Ox0dea: # => 44 (https://eval.in/509124)
[23:50:56] Ox0dea: Progress!
[23:51:19] idefine: has joined #ruby
[23:53:13] nfk: has joined #ruby
[23:54:10] IronDicideth: has joined #ruby
[23:54:26] waheedi: hmm in know what going on !!!
[23:54:33] TomPeed: has joined #ruby
[23:57:30] idefine: has joined #ruby
[23:58:33] Mon_Ouie: Hey, since when do we have grep_v!
[23:59:04] joonty: has joined #ruby