« Back to channel list

#ruby - 07 December 2015

« Back 1 day Forward 1 day »
[00:01:21] rickmasta: has joined #ruby
[00:03:29] zenguy_pc: has joined #ruby
[00:05:08] nixmaniack: has joined #ruby
[00:06:57] supermarin: has joined #ruby
[00:08:57] christiandsg: has joined #ruby
[00:19:25] quazimodo: has joined #ruby
[00:20:01] underplank: has joined #ruby
[00:20:28] LiquidInsect: has joined #ruby
[00:20:50] quazimodo: i need to write some data to rail's send_data method as CSV, i've tried looking around for a csv sanitizer but I didn't find one, i'm not sure if ruby's CSV class can be used to sanitize my string before saving it as csv headers, => def batch_headers
[00:20:54] quazimodo: data = @template.placeholders.map(&:value).join(',')
[00:20:56] quazimodo: name = /(.*)\..*/.match(@template.name)[1]
[00:20:59] quazimodo: send_data data, :filename => "#{name}.csv", type: :csv
[00:21:07] quazimodo: .... apologies, that was meant to be a gist link
[00:21:12] quazimodo: https://gist.github.com/siassaj/c5e6b7bcf29be5e626a6
[00:21:30] tomdp: has left #ruby: ("Leaving")
[00:21:37] devoldmx: has joined #ruby
[00:21:41] tomdp: has joined #ruby
[00:23:24] JDiPierro: has joined #ruby
[00:23:45] Xeago: has joined #ruby
[00:24:34] __fps__: has joined #ruby
[00:24:55] jetpackjoe: has joined #ruby
[00:29:27] Jet4Fire: has joined #ruby
[00:35:20] bronson: has joined #ruby
[00:37:37] zeroDivisible: has joined #ruby
[00:38:07] tjad: has joined #ruby
[00:39:17] Jet4Fire: has joined #ruby
[00:43:17] lokulin: has joined #ruby
[00:46:02] akem: has joined #ruby
[00:46:14] banister: has joined #ruby
[00:48:17] govg: has joined #ruby
[00:49:33] Jet4Fire: has joined #ruby
[00:51:24] Ox0dea: I think it'd be neat if the `::` "operator" delegated to the receiver's definition of #const_get.
[00:52:22] fly5566: has joined #ruby
[00:54:31] agentmeerkat: has joined #ruby
[00:56:22] InvGhostt: has joined #ruby
[00:56:48] tjad: has joined #ruby
[00:57:26] christiandsg: has joined #ruby
[00:57:33] Ox0dea: Why doesn't it?
[00:59:09] Jet4Fire: has joined #ruby
[01:03:09] speaking1ode: has joined #ruby
[01:04:03] supermarin: has joined #ruby
[01:04:19] vikas027: has joined #ruby
[01:05:00] jessemcgilallen: has joined #ruby
[01:07:32] rickmasta: has joined #ruby
[01:08:41] emptyflask: has joined #ruby
[01:09:03] __fps__: has joined #ruby
[01:09:03] Trieste: has joined #ruby
[01:09:06] moty66: has joined #ruby
[01:09:29] Jet4Fire: has joined #ruby
[01:10:01] jetpackjoe: has joined #ruby
[01:11:10] pdoherty: has joined #ruby
[01:14:42] bb010g: has joined #ruby
[01:19:13] Jet4Fire: has joined #ruby
[01:19:33] nettoweb: has joined #ruby
[01:19:36] xybre: Ox0dea: because :: also works on methods which are not consts
[01:20:58] duncannz: has joined #ruby
[01:25:55] Dimik: wednesday = (Date.parse(date1)..Date.parse(date2)).select { |x| x.wednesday? }
[01:25:55] Dimik: puts wednesday
[01:26:35] Dimik: how can i clean this up of "-" in between %d-%m-%Y to just %d%m%Y
[01:27:57] Ox0dea: >> require 'date'; Date.today.strftime '%d%m%Y' # Dimik
[01:27:58] ruboto: Ox0dea # => "07122015" (https://eval.in/481118)
[01:28:24] arescorpio: has joined #ruby
[01:28:45] Jet4Fire: has joined #ruby
[01:29:16] dlitvak: has joined #ruby
[01:31:58] Dimik: yeah i tried that
[01:32:11] Dimik: it's not working i guess cause there's a bunch of dates in my string
[01:32:47] craysiii: has joined #ruby
[01:32:58] Dimik: https://eval.in/481121
[01:34:24] Ox0dea: Dimik: Was that supposed to be a demonstration of your having "tried that"?
[01:34:55] dlitvak: has joined #ruby
[01:35:08] christiandsg: has joined #ruby
[01:35:39] Arnvald: has joined #ruby
[01:35:52] centrx: has joined #ruby
[01:37:08] Dimik: whatever man lol
[01:37:12] duckpuppy: has joined #ruby
[01:38:44] Jet4Fire: has joined #ruby
[01:39:13] mary5030: has joined #ruby
[01:40:29] crdpink2: has joined #ruby
[01:41:41] blackmesa: has joined #ruby
[01:45:32] sarkis: has joined #ruby
[01:45:57] Ox0dea: Dimik: I had to go all the way up to the attic to get it, but I am now in possession of a perfectly serviceable baby spoon; are you still hungry?
[01:47:54] nettoweb: has joined #ruby
[01:48:45] nerium: has joined #ruby
[01:48:46] Jet4Fire: has joined #ruby
[01:49:06] nerium: Is there a way to speed up bundle install when you have gems that points to large repos?
[01:49:07] krz: has joined #ruby
[01:49:28] Dimik: disable the docs
[01:50:03] nerium: Diabolik: Docs?
[01:50:09] nerium: Dimik: ??
[01:50:23] nerium: Dimik: Or did you talk to someone else?
[01:50:44] Dimik: http://stackoverflow.com/questions/1381725/how-to-make-no-ri-no-rdoc-the-default-for-gem-install
[01:51:15] nerium: Dimik: The problem is that the repo is big, not the docs
[01:51:18] djbkd: has joined #ruby
[01:51:21] nerium: It???s 100mb+
[01:51:43] Dimik: yeah just try it
[01:51:45] Dimik: won't hurt
[01:52:01] Dimik: saves a ton of time on ~1Ghz raspberry pi
[01:52:14] nerium: I disabled the docs 7 years ago, so that???s no the case
[01:52:29] jhass: it only downloads as fast as it downloads ...
[01:52:34] jpfuentes2: has joined #ruby
[01:53:10] xybre: nerium: "large repos" on github?
[01:53:22] nerium: jhass: or it ignores the package until I tell it to update
[01:53:29] nerium: that would be the easiest solution
[01:53:56] jhass: a regular bundle install with the repo fetched shouldn't refetch it
[01:54:01] rgb-one: has joined #ruby
[01:54:06] cashnguns: has joined #ruby
[01:54:14] jhass: even a bundle update should only do a fetch in the cached clone
[01:54:26] nerium: jhass: still it freezes on this particular package for 1 min
[01:54:38] crazydiamond: has joined #ruby
[01:54:43] nerium: maybe it does something else
[01:54:56] xybre: What "package"?
[01:55:19] nerium: xybre: https://github.com/pmq20/mathjax-rails
[01:55:21] rgb-one: nerium, are you having any issues with using bundler?
[01:55:35] nerium: rgb-one: nope
[01:57:19] joneshf-laptop: has joined #ruby
[01:57:25] xybre: Uhg why is that repo so large when it's like a dozen files. Oh. The vendored crap. Joy.
[01:58:00] nerium: It???s 48MB, not 100 like i said before
[01:58:10] Ox0dea: Same OOM.
[01:59:10] nerium: but it only takes 15 sec to download using git, so there must be someting else that???s wrong
[01:59:15] Jet4Fire: has joined #ruby
[01:59:27] elton: has joined #ruby
[02:02:57] chouhoulis: has joined #ruby
[02:04:14] skcin7: has joined #ruby
[02:05:34] xybre: Definitely --verbose/trace to see what's happening.
[02:06:15] Yzguy: has joined #ruby
[02:07:46] mary5030: has joined #ruby
[02:08:56] Jet4Fire: has joined #ruby
[02:10:46] cantaberry: has joined #ruby
[02:11:59] christia1: has joined #ruby
[02:15:14] rgb-one: has left #ruby: ()
[02:18:20] Jet4Fire: has joined #ruby
[02:19:08] Coldblackice: has joined #ruby
[02:19:16] Arnvald: has joined #ruby
[02:20:14] framlinqp: has joined #ruby
[02:21:50] devoldmx: has joined #ruby
[02:24:42] zacts: has joined #ruby
[02:26:28] SenpaiSilver_: has joined #ruby
[02:27:02] jgt1: has joined #ruby
[02:27:35] sdothum: has joined #ruby
[02:28:26] Jet4Fire: has joined #ruby
[02:29:18] rickmasta: has joined #ruby
[02:29:41] nateberkopec: has joined #ruby
[02:29:54] peterhil`: has joined #ruby
[02:32:05] grillo: yo. what's the best way to iterate through an array such that I am able to reset the current iterator position as needed?
[02:32:13] Radar: grill_: example plz
[02:32:37] dlitvak: has joined #ruby
[02:33:20] Ox0dea: grill_: Enumerable#next.
[02:33:22] grillo: in java, you can do for (int i = 0; blah blah; i++) { i = 0; blah blah; }
[02:33:37] Ox0dea: Oh, that.
[02:33:47] myztic: has joined #ruby
[02:33:47] Ox0dea: You're probably doing it wrong?
[02:33:59] ledestin: has joined #ruby
[02:34:06] grillo: can this be done or not?
[02:34:15] Radar: grill_: Explain why you want to do that, please.
[02:34:36] grillo: i want to do it because i'd like to see if it can be done
[02:34:52] Radar: Ox0dea: all yours
[02:35:37] Ox0dea: ACTION passes, thanks.
[02:35:53] grillo: sounds like it isn't possible
[02:35:57] Yzguy: I don't think you would use a for loop
[02:36:01] grillo: looks to be another flaw in ruby
[02:36:19] Radar: grill_: If you're here to criticise Ruby, may I suggest that you don't?
[02:36:20] Arnvald: grill_: are you here just to bash the language?
[02:36:25] Radar: Arnvald: snap
[02:36:25] Arnvald: grill_: it can be done
[02:36:37] Arnvald: grill_: there's a method Enumerable#rewind
[02:36:49] Arnvald: you can iterate over a collection and then rewind enumerator to the beginning
[02:36:52] Arnvald: and start iterating again
[02:36:56] Arnvald: all inside the loop
[02:37:20] grillo: wonderful. little life hack here: pretend there's a flaw with a language whenever you're not getting anywhere with a question, and someone will inevitably pop in with a viable solution
[02:37:29] grillo: thanks :)
[02:37:30] bronson: has joined #ruby
[02:37:57] Ox0dea: grill_: But that wasn't an answer to your question.
[02:38:07] Ox0dea: So you really were just trolling/pretending to be retarded.
[02:38:21] Ox0dea: Oh, dammit. :<
[02:38:35] Ox0dea: I thought you asked about arbitrarily positioning the iterator.
[02:38:35] Jet4Fire: has joined #ruby
[02:38:47] Ox0dea: Still friends?
[02:38:56] Arnvald: grill_: it comes with a consequence, though, if you use it too often people will consider you a troll and start ignoring you
[02:39:09] Radar: "RUBY SUXXORS"
[02:39:12] grillo: it's sorta a nuclear weapon
[02:39:18] Radar: (p.s. I can / will ban for that)
[02:39:29] grillo: but it's the worst when someone assumes you're not doing something the right way
[02:39:47] Radar: Mainly because of http://ruby-community.com/pages/user_rules#rule_2_3
[02:39:54] Azure: has joined #ruby
[02:40:09] Yzguy: I don't think that's the assumption, they are trying to understand your problem, and then come up with the best solution for you.
[02:40:25] Radar: Oh and http://ruby-community.com/pages/user_rules#rule_2_5
[02:40:28] Ox0dea: grill_: We're just trying to be the Henry Ford to your faster horse. <3
[02:40:51] Ox0dea: Also, I thought you wanted arbitrary positioning. :<
[02:40:53] grillo: i simply need to iterate through an array and reset the index for a specific algorithm
[02:41:05] Ox0dea: grill_: Iterate through the whole array?
[02:41:12] grillo: i do want arbitrary positioning, but this gets me closer to a reasonable solution
[02:41:39] mistym: has joined #ruby
[02:41:43] Ox0dea: Why not just maintain an index if that's really what this algorithm calls for?
[02:42:05] grillo: yes. that's the other way to do it
[02:42:52] duckpuppy: has joined #ruby
[02:43:05] blackmesa: has joined #ruby
[02:43:06] Ox0dea: I bet there's another if you'd say what you're trying to implement.
[02:43:29] grillo: perhaps, but i'm trying to do this on my own for practice purposes
[02:44:17] Ox0dea: Whale, #rewind and repeated calls to #next will get you your faster horse. Godspeed.
[02:44:22] Azure: has joined #ruby
[02:45:21] jhonglim: has joined #ruby
[02:46:09] bigmac: has joined #ruby
[02:48:50] Jet4Fire: has joined #ruby
[02:49:55] Bellthoven: has joined #ruby
[02:52:15] CrazyEddy: has joined #ruby
[02:53:33] jpfuentes2: has joined #ruby
[02:54:00] kfrz: has joined #ruby
[02:56:47] dlitvak: has joined #ruby
[02:56:55] Yzguy: https://github.com/guard/guard
[02:57:12] Yzguy: pretty cool, use it to run your tests every time you change file
[02:57:57] Jet4Fire: has joined #ruby
[03:03:11] slash_me: eregon_: http://bundler.io/bundle_package.html
[03:03:42] slash_me: nerium: ^... sorry eregon_ . And anyway, I was scrolled up quite a ways so my mistake all around
[03:04:01] dlitvak: has joined #ruby
[03:05:49] Ox0dea: slash_me: Going for the leaderboard? :)
[03:06:58] slash_me: Ox0dea: fingers crossed
[03:07:56] Jet4Fire: has joined #ruby
[03:08:24] rickmasta: has joined #ruby
[03:08:47] moeabdol: has joined #ruby
[03:08:49] lightstalker1: has joined #ruby
[03:09:05] krzkrz: has joined #ruby
[03:09:21] colegatron: has joined #ruby
[03:09:55] zacts: sorry, typo :-P
[03:10:57] Bellthoven: has joined #ruby
[03:12:16] bigmac: im reading about redis clustering... what does reshard mean in terms of clustering
[03:12:40] jhass: ACTION looks
[03:12:43] jhass: nope, not #redis
[03:12:57] bigmac: oh, thought it was a ruby thing
[03:13:27] sucks: has joined #ruby
[03:13:57] mooe: has joined #ruby
[03:15:19] xybre: redis is a redis thing
[03:16:38] rgrmatt: has joined #ruby
[03:16:42] durstburger: has joined #ruby
[03:16:49] jhass: is this recursion?
[03:18:07] Ox0dea: recurse (v.): to cast a spell a second time.
[03:18:36] Jet4Fire: has joined #ruby
[03:19:19] grillo: is it possibe to make initialize return some value (e.g. true or false)?
[03:19:40] grillo: maximum bummer
[03:19:54] Ox0dea: Are you sure?
[03:20:15] jhass: Ox0dea: don't take the bait
[03:20:30] Ox0dea: Oh, right.
[03:20:50] grillo: maybe. i have this class that i'd like to simply return some information on initialization
[03:20:54] duckpuppy: has joined #ruby
[03:21:06] grillo: i guess i can just use getters though
[03:22:55] doublemalt_: has joined #ruby
[03:25:59] jhass: doesn't sound like it needs to be a class
[03:26:11] devbug: has joined #ruby
[03:26:32] hotpancakes: has joined #ruby
[03:27:35] krzkrzkrz: has joined #ruby
[03:28:19] Jet4Fire: has joined #ruby
[03:30:59] ascarter: has joined #ruby
[03:31:52] peterhil`: has joined #ruby
[03:32:37] TheHackOps: has joined #ruby
[03:33:05] govg: has joined #ruby
[03:33:16] TheHackOps: Hi, I am just wondering, I have resque-web installed and I wish to use it to see the status of resque which I talk to through PHP
[03:33:31] TheHackOps: I have installed everything, but I have no idea how to start it so I can go to it in my browser
[03:33:46] TheHackOps: Would someone mind explaining how the whole RoR web stuff works
[03:34:00] TheHackOps: https://github.com/resque/resque-web << Thats the app I am trying to run
[03:35:29] hello9: has joined #ruby
[03:36:58] Radar: TheHackOps: Did you follow https://github.com/resque/resque-web#starting?
[03:37:20] jhass: TheHackOps: create a config.ru with `require "resque_web"; run ResqueWeb::Engine.new` and run rackup or your favorite appserver (puma, unicorn, passenger, thin, whatever else)
[03:37:42] TheHackOps: I am about as new to RoR as a baby born an hour ago
[03:37:44] kfpratt: has joined #ruby
[03:37:58] TheHackOps: Where do i create this config
[03:38:05] TheHackOps: I am so confused
[03:38:16] djbkd: has joined #ruby
[03:38:32] Jet4Fire: has joined #ruby
[03:39:22] Bellthoven: has joined #ruby
[03:39:28] jhass: TheHackOps: didn't sound like you're using Rails?
[03:40:44] TheHackOps: jhass, No idea
[03:40:57] jhass: well, if you don't know then how shall I
[03:41:03] TheHackOps: All I know is I want to use this web portal
[03:41:06] Radar: TheHackOps: Did you create a new Rails app?
[03:41:10] jhass: if you do you're in the wrong channel, if not the answer is anywhere
[03:41:19] Radar: ?rails TheHackOps
[03:41:19] ruboto: TheHackOps, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[03:41:33] TheHackOps: Basiaclly I just installed Ruby
[03:41:39] jhass: Radar: my guess is currently 75% not using Rails
[03:41:42] TheHackOps: and now I am trying to get this web portal installed
[03:41:49] xybre: grill_: use a class method like Rails does: Foo.create is generally what I use.
[03:41:59] jhass: TheHackOps: how about you try my suggestion
[03:42:22] Radar: jhass: they don't know where to create the config
[03:42:33] jhass: Radar: I said "anywhere" above
[03:42:36] TheHackOps: jhass, Ok this might sound weird in the context of ruby but why am i creating a new project if I am trying to use an existing one?
[03:42:49] TheHackOps: I am a PHP/C# dev in the webstack
[03:43:00] jhass: TheHackOps: I have a doubt, you say you just installed Ruby, how do you run Resque?
[03:43:09] TheHackOps: jhass, Not running yet
[03:43:16] TheHackOps: Trying to get something concrete I can look at
[03:43:16] Radar: TheHackOps: Because Resque-web is a Rails engine; it's a "mini-app" which needs to have a parent app to leech off.
[03:43:25] Radar: jhass is suggesting it MIGHT work if you create a config.ru file
[03:43:42] TheHackOps: Radar, So I should just create a new blank app
[03:43:44] jhass: TheHackOps: if you don't have your resque running yet, running resque-web will be completely useless
[03:43:44] tomchapin: has joined #ruby
[03:43:45] TheHackOps: and include it?
[03:43:52] Radar: config.ru should include just https://gist.github.com/radar/18cdf7d579fb51cabd60
[03:43:58] Radar: might work with rackup config.ru
[03:44:01] Radar: TheHackOps: yes, that's right
[03:44:48] jhass: TheHackOps: you say this is for a PHP app? are you sure there isn't a PHP based solution?
[03:45:05] jhass: why do you want to write your background jobs in Ruby?
[03:45:23] bb010g: has joined #ruby
[03:45:26] TheHackOps: jhass, I dont
[03:45:30] TheHackOps: And I am not
[03:45:31] chandlerbing: has joined #ruby
[03:45:34] TheHackOps: So, let me explain mroe
[03:45:36] skcin7: has joined #ruby
[03:45:36] jhass: then Resque doesn't do what you think it does
[03:45:49] jhass: I don't see how
[03:45:55] TheHackOps: Resque is a job queue, it has a PHP client
[03:46:05] blackmesa: has joined #ruby
[03:46:14] TheHackOps: Now, I dont know of a PHP web client so I am trying to use the Ruby one
[03:46:30] jhass: that also comes with a PHP based worker or what?
[03:47:01] djbkd: has joined #ruby
[03:47:29] TheHackOps: jhass, AFAIK resque-web is just a queue monitor
[03:47:33] jhass: TheHackOps: http://cloud.aeshna.de/u/mrzyx/screenshots/screenshot_20151207_044727.png which one is it?
[03:48:13] Jet4Fire: has joined #ruby
[03:48:36] jhass: should've copied Sidekiq instead
[03:48:52] TheHackOps: I am thinking about removing all this stuff from my server
[03:48:56] TheHackOps: Its all getting way to complex
[03:48:56] jhass: anyway, my suggestion which Radar repeated still applies then
[03:49:05] xybre: jhass: since when has PHP done the sensible thing?
[03:49:25] kfrz: has joined #ruby
[03:49:28] jhass: xybre: since 200 years in the future, maybe
[03:49:41] TheHackOps: Ruby bashing on PHP
[03:49:50] jhass: what did you expect
[03:50:07] TheHackOps: meh this is not my place, I am a guest so I am not going to start shit talking
[03:50:23] Radar: TheHackOps: Did you try following our instructions yet?
[03:50:42] TheHackOps: No, they dont rly make sense to a noob like me
[03:50:53] TheHackOps: I am still strongly in the wrong mindset
[03:50:56] TheHackOps: for Ruby stuff
[03:51:17] krzkrzkrz: has joined #ruby
[03:51:48] Radar: Which part of "create a file with these contents" and "then run this command" is hard to follow?
[03:51:55] Radar: Contents: https://gist.github.com/radar/18cdf7d579fb51cabd60
[03:51:57] Radar: Command: rackup config.ru
[03:52:05] TheHackOps: Radar, The fact that I have no idea where to run it
[03:52:12] TheHackOps: Wait that makes me sound retarded
[03:52:13] jhass: it doesn't matter
[03:52:24] Radar: TheHackOps: create a new file called "config.ru" literally anywhere
[03:52:29] Radar: then run the command "rackup config.ru" in that same directory
[03:52:32] Radar: There is no step 3
[03:52:34] Radar: only profit
[03:53:35] TheHackOps: configuration /home/phantom/Resque-server/config.ru not found
[03:53:38] TheHackOps: when I run that
[03:53:53] mary5030: has joined #ruby
[03:54:08] TheHackOps: I see what you mean
[03:54:12] TheHackOps: touch config.ru
[03:54:22] TheHackOps: I would assume its something like composer init
[03:55:30] yeticry: has joined #ruby
[03:56:37] sucks: has joined #ruby
[03:57:05] TheHackOps: Radar, `to_app': missing run or map statement (RuntimeError)
[03:57:17] hello9: has joined #ruby
[03:57:21] Radar: TheHackOps: I can't fucking believe it.
[03:57:30] Radar: Did you really just touch the file and not add anything to it?
[03:57:41] Radar: DESPITE being _repeatedly_ told to add contents to the file?
[03:57:52] Radar: ACTION 's mouth is hanging open
[03:57:58] jhass: yeah, are you drunk or something?
[03:58:18] Jet4Fire: has joined #ruby
[03:58:40] TheHackOps: You guys dont know how different this whole eco system is
[03:58:47] TheHackOps: to every other system
[03:59:01] Radar: TheHackOps: I don't understand how creating a file in ruby and putting things in it is different to creating a file in PHP and putting things in it
[03:59:10] Radar: TheHackOps: Please explain to me the differences between these two actions.
[03:59:16] TheHackOps: Radar, You didnt even tell me what the file does
[03:59:31] TheHackOps: I assume its a composer.json like file
[03:59:36] Radar: [14:51:55] <Radar> Contents: https://gist.github.com/radar/18cdf7d579fb51cabd60
[04:00:21] jhass: 04:37 <jhass> TheHackOps: create a config.ru with `require "resque_web"; run ResqueWeb::Engine.new` and run rackup
[04:00:26] jhass: it was the first thing I said
[04:00:48] favadi: has joined #ruby
[04:01:12] TheHackOps: In PHP there is no concept of subapps
[04:01:20] ruboto: +q TheHackOps!*@*
[04:01:20] ruboto: -o ruboto
[04:01:22] ruboto: You can find a log of this channel at http://irclog.whitequark.org/ruby/
[04:01:40] Radar: Looks like he needs to actually create a Rails app anyway because
[04:01:42] jhass: You have 30 minutes to reread our conversation and try to understand things
[04:01:46] supermarin: has joined #ruby
[04:01:52] Radar: "uninitialized constant FormErrorsHelper::ActionView (NameError)"
[04:01:55] Radar: ?rails TheHackOps
[04:01:56] ruboto: TheHackOps, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[04:02:17] lele: has joined #ruby
[04:02:39] jhass: Radar: it's pretty sad that they make it that dependent on rails
[04:02:48] Radar: jhass: definitely
[04:02:54] Radar: jhass: Probably because they've assumed
[04:03:19] Radar: hooray for spawning another "Ruby is full of elitist jerks!" story
[04:03:40] xybre: They still haven't /join'd #rubyonrails either.
[04:03:48] Radar: Must be working out how to do that.
[04:05:23] xybre: And yes we know how different the ecosystem is, most of us do things other than Ruby.
[04:06:19] colegatron: has joined #ruby
[04:06:25] ruboto: -q TheHackOps!*@*
[04:06:25] ruboto: -o ruboto
[04:06:46] grillo: what's the best way to take a string (e.g. "1 2 3 4"), pull out all the numbers, and place each in an array?
[04:07:13] jhass: &ri String#split
[04:07:14] `derpy: method `String#split`: Divides str into substrings based on a delimiter, returning an array of these su??? ??? http://rubydoc.info/stdlib/core/String#split-instance_method
[04:07:16] grillo: rather, is there a one-liner op for it
[04:07:49] hotpancakes: has joined #ruby
[04:08:11] Jet4Fire: has joined #ruby
[04:08:12] grillo: that method would work unless someone screws up the input (e.g. "1,2,3,4" instead of "1 2 3 4"), correct?
[04:08:18] rickmasta: has joined #ruby
[04:08:23] ruboto: Why don't you try it and see for yourself?
[04:08:49] grillo: sigh. what's that commandline ruby interpreter?
[04:09:02] ruboto: Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting `binding.pry` directly in your source code. Visit https://pryrepl.org/ or get it now with: gem install pry pry-doc
[04:09:28] djbkd: has joined #ruby
[04:10:28] rsc___: has joined #ruby
[04:12:33] braincrash: has joined #ruby
[04:12:42] jbrhbr: has joined #ruby
[04:12:51] grillo: <3 answer #2
[04:12:57] grillo: *comment #2
[04:12:59] grillo: http://stackoverflow.com/questions/13759091/does-ruby-regular-expression-have-a-not-match-operator-like-in-perl
[04:13:36] jhass: grill_: you can link to specific answers
[04:13:50] grillo: first comment on the question
[04:16:30] nixmaniack: has joined #ruby
[04:16:31] nixmaniack: has joined #ruby
[04:17:05] jgt1: has joined #ruby
[04:18:05] chandlerbing: has joined #ruby
[04:18:40] hotpancakes: has joined #ruby
[04:19:28] sneakerhax: has joined #ruby
[04:19:40] durstburger: has joined #ruby
[04:24:16] nateberkopec: has joined #ruby
[04:26:48] nixmaniack: has joined #ruby
[04:27:08] Bellthoven: has joined #ruby
[04:27:24] hxegon: has joined #ruby
[04:27:34] crdpink: has joined #ruby
[04:30:04] hxegon: Anyone know how to make this display the joined list in erb? https://gist.github.com/anonymous/a2c97d11a3e4a659ebc3
[04:30:59] WizJin: has joined #ruby
[04:31:02] Radar: ?rails hxegon
[04:31:02] ruboto: hxegon, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[04:31:08] xybre: >> [1,2,3].join(",")
[04:31:09] ruboto: xybre # => "1,2,3" (https://eval.in/481157)
[04:31:10] jhass: hxegon: move the = to the first <%
[04:31:27] hxegon: Radar: not a rails question
[04:31:39] Xeago: has joined #ruby
[04:32:08] Radar: hxegon: Sorry. Typically ERB questions are Rails questions.
[04:32:18] hxegon: Radar: not in this case :)
[04:32:30] Radar: hxegon: you're a unique and beautiful snowflake
[04:32:42] hxegon: jhass: still getting an error here
[04:32:51] peterhil`: has joined #ruby
[04:33:39] tjad: has joined #ruby
[04:33:54] nofxx: has joined #ruby
[04:33:55] nofxx: has joined #ruby
[04:34:23] htmldrum: has joined #ruby
[04:34:25] hotpancakes: has joined #ruby
[04:35:39] paradisaeidae: has joined #ruby
[04:36:33] gix: has joined #ruby
[04:36:49] dlitvak: has joined #ruby
[04:37:36] supermarin: has joined #ruby
[04:37:59] xcesariox: has joined #ruby
[04:38:42] agent_white: has joined #ruby
[04:38:56] hotpancakes: has joined #ruby
[04:39:39] nixmaniack: has joined #ruby
[04:39:53] bronson: has joined #ruby
[04:40:41] howdoi: has joined #ruby
[04:42:33] Ox0dea: >> //.method(:!~).owner # grill_
[04:42:34] ruboto: Ox0dea # => Kernel (https://eval.in/481164)
[04:42:59] Ox0dea: Regexp#!~ is still "not documented" under Regexp, but that "makes sense".
[04:43:27] Ox0dea: http://ruby-doc.org/core-2.2.3/Object.html#method-i-21-7E
[04:44:35] elton: has joined #ruby
[04:44:37] supermar_: has joined #ruby
[04:46:31] bronson: has joined #ruby
[04:47:57] rickmasta: has joined #ruby
[04:49:07] blackmesa: has joined #ruby
[04:49:36] rgrmatt: has joined #ruby
[04:53:57] jetpackjoe: has joined #ruby
[04:53:57] skweek: has joined #ruby
[04:54:05] Xeago: has joined #ruby
[04:54:21] jpfuentes2: has joined #ruby
[04:54:45] elton: has joined #ruby
[04:56:54] kies: has joined #ruby
[04:58:34] Xeago: has joined #ruby
[05:01:28] iateadonut: has joined #ruby
[05:02:15] pyoor: has joined #ruby
[05:15:34] wheresmyjetpack: has joined #ruby
[05:17:10] youch: has joined #ruby
[05:20:21] ascarter: has joined #ruby
[05:20:51] pdoherty: has joined #ruby
[05:20:52] grillo: has joined #ruby
[05:21:33] durstburger: has joined #ruby
[05:21:36] darkf: has joined #ruby
[05:21:59] doublemalt_: has joined #ruby
[05:22:12] skcin7: has joined #ruby
[05:23:13] Bellthoven: has joined #ruby
[05:28:54] nateberkopec: has joined #ruby
[05:29:16] rsc___: has joined #ruby
[05:29:32] astrobunny: has joined #ruby
[05:33:35] peterhil`: has joined #ruby
[05:33:53] tildes: has joined #ruby
[05:34:49] rsc___: has joined #ruby
[05:35:28] grillo: has joined #ruby
[05:38:49] stannard: has joined #ruby
[05:39:48] berserk_ren: has joined #ruby
[05:45:35] Insti: has joined #ruby
[05:46:27] droptone: Here's a question for you Ruby experts: I need to encrypt the contents of a directory via my Ruby app.
[05:46:31] droptone: Any thoughts on that? Should I just call an external application? My host OS is Centos 7.x
[05:46:39] PaulCapestany: has joined #ruby
[05:49:08] Mon_Ouie: has joined #ruby
[05:50:54] xybre: droptone: what are you doing with the directory?
[05:51:30] shinenelson: has joined #ruby
[05:52:10] blackmesa: has joined #ruby
[05:53:58] igorT: has joined #ruby
[05:54:07] Trynemjoel: has joined #ruby
[05:54:54] favadi: has joined #ruby
[05:55:19] PaulCapestany: has joined #ruby
[05:55:45] droptone: xybre: I need to A) check to see if a series of files in a directory are encrypted, if so, B) decrypt, C) write changes to them, then D) re-encrypt.
[05:56:00] droptone: Normally, on my home machine, I leverage a TrueCrypt container, but of course that's not applicable here.
[05:56:57] droptone: As far as what I'm doing, I'm storing sensitive content to them, hence the need for encryption.
[05:57:56] jetpackjoe: has joined #ruby
[05:58:19] xybre: So you only want them decrypted in memory, not on disk.
[05:58:55] droptone: Looks like ccrypt might be a proper solution, it leverages the Rijndael cypher.
[05:59:08] xybre: Why not just mount your TrueCrypt container?
[06:00:32] droptone: The guys in #linux are recommended using 7z to both encrypt and compress the files, that's good.
[06:00:35] skweek: has joined #ruby
[06:00:42] droptone: xybre: That container exists on my local machine, not on this remote host.
[06:00:52] christiandsg: has joined #ruby
[06:02:21] grillo: has joined #ruby
[06:02:26] CloCkWeRX: has joined #ruby
[06:03:02] xybre: Yeah, I mean a specific truecrypt container for the files you're talking about.
[06:05:41] Channel6: has joined #ruby
[06:05:59] WizJin: has joined #ruby
[06:07:26] krzkrzkrz: has joined #ruby
[06:08:19] djbkd: has joined #ruby
[06:08:23] xybre: also this might be relevant: https://rubygems.org/gems/coy
[06:08:42] lurch_: has joined #ruby
[06:08:58] droptone: xybre: Very nice, thank you.
[06:09:18] nerium: has joined #ruby
[06:09:29] droptone: Has this project been abaonded?
[06:10:57] christiandsg: has joined #ruby
[06:10:58] lxsameer: has joined #ruby
[06:10:58] lxsameer: has joined #ruby
[06:11:21] Ox0dea: has joined #ruby
[06:12:33] Gnut: has joined #ruby
[06:15:55] dionysus69: has joined #ruby
[06:16:19] grillo: has joined #ruby
[06:18:44] finisherr: has joined #ruby
[06:18:48] bronson: has joined #ruby
[06:20:34] solocshaw: has joined #ruby
[06:22:21] durstburger: has joined #ruby
[06:26:06] makenoise: has joined #ruby
[06:28:23] jessemcgilallen: has joined #ruby
[06:29:38] nateberkopec: has joined #ruby
[06:29:56] grillo: has joined #ruby
[06:30:00] DavidDudson: has joined #ruby
[06:31:27] makenoise: has joined #ruby
[06:31:47] Bellthoven: has joined #ruby
[06:33:17] Arnvald: has joined #ruby
[06:34:26] peterhil`: has joined #ruby
[06:34:49] toy: has joined #ruby
[06:34:56] timonv: has joined #ruby
[06:38:23] supermarin: has joined #ruby
[06:39:04] makenoise: has joined #ruby
[06:39:08] jetpackjoe: has joined #ruby
[06:39:33] jbrhbr: has joined #ruby
[06:40:57] trautwein: has joined #ruby
[06:43:33] grillo: has joined #ruby
[06:44:09] Mia: has joined #ruby
[06:44:10] Mia: has joined #ruby
[06:44:19] droptone: What's the best method to run an external command within a Ruby script? %x, exec, or system?
[06:47:05] Mon_Ouie: Those all serve completely different purposes
[06:47:28] apeiros: ?best droptone
[06:47:29] ruboto: droptone, "Best" and "better" are subjective. Try to use a different term.
[06:47:39] droptone: "Most appropriate"
[06:47:44] droptone: It's all good, I got it.
[06:47:52] droptone: I'm using %x because it returns the result of the command.
[06:48:03] droptone: It appears exec() halts the existing process and replaces it
[06:48:05] apeiros: you realize that that wasn't any more telling? :)
[06:48:14] droptone: I'm good, thank you though.
[06:48:24] droptone: I'll be more specific next time.
[06:48:24] apeiros: it's more for future question of yours
[06:48:41] droptone: Yes, I just hang out here a lot so sometimes I just freestyle it.
[06:48:43] apeiros: and I think ?best needs a rewording. merely changing the term usually won't help.
[06:48:53] droptone: I try to keep it to #ruby-offtopic but every so often it slips out here, and then I promptly regret it.
[06:49:16] droptone: In #ruby-offtopic I'm addicted to hangman.
[06:49:54] apeiros: !fact ed best "better" and "best" depend entirely on your context. Try to describe what quality would make one thing better than the other.
[06:49:55] ruboto: apeiros, I stand corrected that best is "better" and "best" depend entirely on your context. Try to describe what quality would make one thing better than the other.
[06:50:30] droptone: The bot stands corrected!
[06:50:51] Ox0dea: droptone: `foo` > %x(foo)
[06:51:05] Ox0dea: The former does the same but uses more conventional orthography.
[06:51:09] rgrmatt: has joined #ruby
[06:51:26] cornerma1: has joined #ruby
[06:51:37] droptone: Here's a specific question: The syntax of %x, is it simply %x(mkdir test)?
[06:51:44] droptone: I realize I can use Dir.mkdir, it's just an example.
[06:51:55] droptone: I'm having trouble finding specific examples online.
[06:52:05] droptone: apeiros: Thank you.
[06:52:15] Ox0dea: But you can use all sorts of delimiters for percent strings.
[06:52:21] apeiros: `mkdir test` == %x(mkdir test) == %x/mkdir test/ == %x|mkdir test| # or whatever other delimiter
[06:52:34] droptone: ahh, thank you.
[06:52:35] Ox0dea: Read: avoid %x.
[06:52:57] auzty: has joined #ruby
[06:53:35] apeiros: IMO you shouldn't use %x with variable substitution
[06:53:53] droptone: So, while %x would work, it's preferred to use another option, such as backticks?
[06:54:23] hackmathics: has joined #ruby
[06:54:39] Ox0dea: That's ultimately your prerogative, but you've been given sufficient material to make the right choice. :P
[06:54:46] nbdy: has joined #ruby
[06:55:11] blackmesa: has joined #ruby
[06:55:13] jpfuentes2: has joined #ruby
[06:55:39] christiandsg: has joined #ruby
[06:55:45] xybre: ACTION prefers %x(), partially because backticks are bad in *sh, cultivating good habits and all
[06:55:49] droptone: lol, heavens Ox0.
[06:55:54] Mon_Ouie: has joined #ruby
[06:55:57] droptone: xybre: Thank you.
[06:56:15] krzkrzkrz: has joined #ruby
[06:56:18] apeiros: droptone: %x *is* backticks
[06:56:19] nixmaniack: has joined #ruby
[06:56:43] tagrudev: has joined #ruby
[06:56:47] droptone: Right, I understand that, but Ox0 said "Read: avoid %x()"
[06:56:51] xybre: They are equivilent in Ruby.
[06:57:00] droptone: So that implies that I should avoid using %x() specifically.
[06:57:06] apeiros: they aren't just equivalent. they're literally the same thing.
[06:57:15] grillo: has joined #ruby
[06:57:24] apeiros: well, apart of the apparently different sigils.
[06:57:25] Ox0dea: %x literally invokes Kernel#`.
[06:57:45] xybre: http://ruby-doc.org/core-2.1.1/doc/syntax/literals_rdoc.html#label-Percent+Strings
[06:57:55] Ox0dea: >> def `(*); 42; end; %x(1 2 3)
[06:57:56] ruboto: Ox0dea # => 42 (https://eval.in/481233)
[06:58:02] Ox0dea: Holy shit, Ruby.
[06:58:33] Pupp3tm4st3r: has joined #ruby
[06:58:56] xybre: And that's why we love it.
[07:00:16] xybre: I kinda wish there was a %X and a %x to match the %q and %Q syntax though.
[07:01:23] Ox0dea: droptone: For why I'm not the biggest fan of %x: http://idiosyncratic-ruby.com/15-207-ways-to-rome.html#percent-syntax-q
[07:01:28] apeiros: %x & ` compile to literally the same instruction sequence :)
[07:01:47] Ox0dea: droptone: All 66 can just as well be used for %x.
[07:02:06] Yzguy: has joined #ruby
[07:02:39] Ox0dea: Ah, make that 67, since space (!) is valid for %x.
[07:02:54] droptone: Ox0: Thank you.
[07:02:58] xybre: They're still different to the compiler. %x does brcket matching, while backtick does not.
[07:03:10] Ox0dea: xybre: That's parsing, not compilation.
[07:03:10] xybre: >> %x{echo "{}"}
[07:03:11] ruboto: xybre # => (https://eval.in/481237)
[07:04:03] xybre: Yes, parsing.
[07:04:04] CrazyEddy: has joined #ruby
[07:04:26] xybre: >> %x{echo {}}
[07:04:27] ruboto: xybre # => (https://eval.in/481238)
[07:04:40] Ox0dea: xybre: Please check the link.
[07:04:43] xybre: Ah can't do syscall, ah well.
[07:05:20] nerium: has joined #ruby
[07:06:47] solars: has joined #ruby
[07:08:01] codecop: has joined #ruby
[07:08:06] rsc___: has joined #ruby
[07:10:45] grillo: has joined #ruby
[07:14:46] devbug: has joined #ruby
[07:15:43] ta: has joined #ruby
[07:19:05] christiandsg: has joined #ruby
[07:19:13] jessemcgilallen: has joined #ruby
[07:19:53] tjad: has joined #ruby
[07:21:30] devbug: has joined #ruby
[07:21:43] Gnut: has joined #ruby
[07:21:57] elton: has joined #ruby
[07:22:29] WizJin: has joined #ruby
[07:23:12] durstburger: has joined #ruby
[07:23:43] CrazyEddy: has joined #ruby
[07:24:25] grillo: has joined #ruby
[07:27:02] davedev24: has joined #ruby
[07:30:22] nateberkopec: has joined #ruby
[07:30:46] jetpackjoe: has joined #ruby
[07:30:54] ellisTAA: has joined #ruby
[07:30:59] flughafen: morning guys
[07:31:19] blub: hi flughafen
[07:31:37] Lap64: has joined #ruby
[07:31:40] Lap64: hello all
[07:31:43] ellisTAA: when i try to scrape this website for links, it doesn???t return any of the imgs, i was thinking that maybe the imgs get loaded in after the page loads ??? could someone tell me if they think this is what???s happening http://grid.vsco.co/grid/3433
[07:31:56] Lap64: i have written a script which was find content for me using google api
[07:32:46] Lap64: its was running fine till few days back but now suddenly it stopped running and the error i am getting is Network is unreachable - connect(2) for "ajax.googleapis.com" port 80 (Curl::Err::HttpError)
[07:32:50] Lap64: what does this mean ?
[07:32:54] Lap64: can someone please help
[07:34:15] flughafen: shevy: i'm going to install opensuse leap, if i'm not back within 2 hours, make someting take off and search for me !
[07:34:24] Ox0dea: Lap64: It's likely they banned you by one means or another.
[07:34:33] yardenbar: has joined #ruby
[07:35:54] Ox0dea: ellistaa: `curl http://grid.vsco.co/grid/3433 | grep img` is indeed silent.
[07:36:27] ellisTAA: Ox0dea: meaning it is probably getting loaded after the page gets loaded?
[07:36:47] Lap64: Ox0dea, how t ocheck if i am banned ?
[07:36:57] Ox0dea: Lap64: Try from another IP address?
[07:37:02] Ox0dea: ellistaa: Yep.
[07:37:17] Fridtjof: has joined #ruby
[07:37:55] ellisTAA: Ox0dea: thanks
[07:37:59] grillo: has joined #ruby
[07:38:06] Lap64: Ox0dea, there is no way to check from this server that ip is banned ?
[07:38:17] shevy: flughafen kk
[07:38:44] shevy: flughafen could be worse, could be flughafen-downed-via-bluescreen-of-death
[07:39:16] Ox0dea: Lap64: Unless you're using an API that was very recently discontinued, that error messages suffices to indicate that you've tripped some flag and been denied access.
[07:40:01] Ox0dea: Lap64: That you're not expressing indignation at the mere suggestion indicates you might have some inkling as to why this might've happened. :P
[07:40:33] Lap64: Ox0dea, there might be two things
[07:40:52] Ox0dea: Lap64: Did you go Sahnic fast with your requests?
[07:40:56] Lap64: Ox0dea, 1. the API has changed some flags 2.I might have abused something and IP got blocked lols
[07:40:57] poguez_: has joined #ruby
[07:41:10] Ox0dea: Lap64: Aye, I'd reckon on the latter.
[07:41:33] Lap64: Ox0dea, umm well it was working fine since ast 1 year and i was following the guidelines but still
[07:41:35] Lap64: you never know
[07:42:16] Ox0dea: I'm sure it's an automated thing, but that's not to say you violated some zero-tolerance policy either.
[07:43:34] Ox0dea: flughafen: Do you actually use SUSE?
[07:43:47] flughafen: Ox0dea: yes... ?
[07:44:08] flughafen: lol. why Ox0dea
[07:44:14] Ox0dea: Just wondering.
[07:44:19] Ox0dea: How come?
[07:44:26] flughafen: hehe. i work for SUSE Ox0dea
[07:44:40] Ox0dea: Just dogfooding, then?
[07:46:02] durstburger: has joined #ruby
[07:46:25] flughafen: haha, it's decent. I'd probably be on archlinux
[07:46:50] flughafen: but we'll see about leap, as it's uses a lot of sles stuff
[07:47:29] jbrhbr: has joined #ruby
[07:47:39] ur5us: has joined #ruby
[07:49:35] flughafen: plus i think zypper is a great package management tool
[07:51:38] grillo: has joined #ruby
[07:53:19] sandstrom: has joined #ruby
[07:53:27] bigkevmcd: has joined #ruby
[07:54:48] shevy: I hated suse
[07:55:01] Macaveli: has joined #ruby
[07:55:21] ta: has joined #ruby
[07:55:49] shevy: I approve that they rewrote yast in ruby though
[07:56:17] ta: has joined #ruby
[07:56:32] shevy: https://github.com/ruby/ruby/blob/trunk/ChangeLog#L7
[07:56:39] shevy: so they deprecated autoload?
[07:57:08] nixmaniack: has joined #ruby
[07:57:09] shevy: hmm https://bugs.ruby-lang.org/issues/11664
[07:57:25] shevy: "passing a pre-frozen string"
[07:57:30] shevy: we got the iceage coming
[07:58:00] rsc___: has joined #ruby
[07:58:12] blackmesa: has joined #ruby
[07:58:50] shevy: "(and maybe autoload will be removed entirely by matz)"
[07:59:47] yfeldblum: has joined #ruby
[08:01:36] krzkrzkrz: has joined #ruby
[08:02:09] Bloomer: has joined #ruby
[08:03:35] jetpackjoe: has joined #ruby
[08:05:22] grillo: has joined #ruby
[08:08:44] zotherstupidguy: has joined #ruby
[08:11:19] Bellthoven: has joined #ruby
[08:12:14] maloik: has joined #ruby
[08:12:34] aganov: has joined #ruby
[08:12:34] vondruch: has joined #ruby
[08:12:41] TheBloke: has joined #ruby
[08:14:36] jas02: has joined #ruby
[08:14:42] SCHAAP137: has joined #ruby
[08:16:17] symm-: has joined #ruby
[08:17:33] Cork: anyone know how to catch stderr errors from Shell command execution?
[08:18:13] sandstrom: has joined #ruby
[08:18:58] grillo: has joined #ruby
[08:19:26] shevy: result = `ls 2>&1` respectively the other shell redirections
[08:20:37] vondruch: has joined #ruby
[08:20:54] Cork: shevy: https://pastebin.mozilla.org/8854007
[08:21:17] Cork: and preferably i want to catch the problem not mix it into the normal text
[08:21:21] devgiant: has joined #ruby
[08:21:35] snowy: has joined #ruby
[08:21:38] apeiros: Cork: use spawn
[08:21:53] apeiros: you can let it use different IOs for stdout and stderr
[08:22:26] Cork: apeiros: i need the functionality of Shell.install_system_commands (for code readability)
[08:22:46] Cork: this is going to be a series of calls
[08:22:50] apeiros: Cork: then read its docs. either it offers the feature or you can't.
[08:22:54] dhjondoh: has joined #ruby
[08:23:07] bronson: has joined #ruby
[08:23:08] Cork: the docs is close to none existent :/
[08:23:18] apeiros: well, then use the source, luke
[08:24:04] Cork: how is the source going to help me?
[08:24:43] apeiros: if you have to ask that, then it probably won't help you.
[08:25:17] Hounddog: has joined #ruby
[08:26:00] apeiros: in other words: consider it not possible to catch stderr output via Shell.install_system_commands.
[08:26:06] Ox0dea: >> Regexp.union
[08:26:07] ruboto: Ox0dea # => /(?!)/ (https://eval.in/481292)
[08:26:15] Ox0dea: That output = my response.
[08:26:29] Ox0dea: Why not just //?
[08:27:01] apeiros: they don't match the same.
[08:27:19] apeiros: /(?!)/ essentially matches nothing
[08:27:44] apeiros: whereas // matches everything
[08:27:49] mikecmpbll: has joined #ruby
[08:27:52] apeiros: polar opposites, so to say :)
[08:27:59] dhjondoh: has joined #ruby
[08:28:31] Bellthoven: has joined #ruby
[08:29:29] Ox0dea: Well, I think it looks like a pirate with a hook for an eye swimming for shore.
[08:29:31] blackms: has joined #ruby
[08:29:39] apeiros: lolwut? :D
[08:29:41] flughafen: has joined #ruby
[08:29:46] quazimodo: has joined #ruby
[08:29:49] Ox0dea: It's right there, plain as day.
[08:30:21] vondruch: has joined #ruby
[08:30:24] apeiros: ACTION looks out the window
[08:30:30] apeiros: that might actually be an apt description today???
[08:30:31] Ox0dea: Slashes for arms, parens for head, the ! is like a scar eye or something, and the ? is the hook.
[08:30:40] apeiros: (fog, foggy fog fog)
[08:30:49] Ox0dea: apeiros: Heh, I was going to specify "non-European".
[08:31:07] nateberkopec: has joined #ruby
[08:32:22] Ox0dea: apeiros: I've been waiting for a "something = nothing" quip to arrive, but it ain't comin'. Explanation makes perfect sense, thanks.
[08:32:49] apeiros: I'm not equipped for quipping, so no quips for you today, sorry.
[08:33:04] flughafen: apeiros sounds broken without any quips
[08:34:18] skade: has joined #ruby
[08:35:19] shevy: apropos broken ... how's the flughafen in Berlin
[08:35:25] shevy: and did you install suse finally?
[08:35:50] peterhil`: has joined #ruby
[08:36:25] joonty: has joined #ruby
[08:37:50] nettoweb: has joined #ruby
[08:39:01] marr: has joined #ruby
[08:39:34] brunto: has joined #ruby
[08:41:13] Symbiosisz: has joined #ruby
[08:42:09] Bellthoven: has joined #ruby
[08:42:48] flughafen: yesh, i installed leap, but i'm still configuring, i'm switching from xmonad -> i3
[08:43:58] dhjondoh: has joined #ruby
[08:44:16] Macaveli: has joined #ruby
[08:44:45] peterhil`: has joined #ruby
[08:47:32] TomyWork: has joined #ruby
[08:48:45] nettoweb: has joined #ruby
[08:48:47] jetpackjoe: has joined #ruby
[08:49:28] mikecmpbll: has joined #ruby
[08:50:36] blackmesa: has joined #ruby
[08:51:27] shevy: we are in the day and age of fat DEs!
[08:52:19] blub: hi shevy
[08:52:28] shevy: yo blubster
[08:52:36] flughafen: blub blub blub
[08:54:02] krzkrzkrz: has joined #ruby
[08:54:44] quazimodo: has joined #ruby
[08:55:08] ruboto: shevy, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
[08:55:32] Rumbles: has joined #ruby
[08:55:48] edwinvdgraaf: has joined #ruby
[08:56:13] jpfuentes2: has joined #ruby
[08:56:40] krzkrzkrz: has joined #ruby
[08:58:08] mark4: has joined #ruby
[08:59:02] tesuji: has joined #ruby
[08:59:08] tvw: has joined #ruby
[09:01:08] elliottcable: has joined #ruby
[09:01:12] VaibhavRajput: has joined #ruby
[09:01:29] VaibhavRajput: has left #ruby: ()
[09:02:41] mikecmpbll: has joined #ruby
[09:02:53] MEATCHICKEN: has joined #ruby
[09:03:06] jgt1: has joined #ruby
[09:03:17] Bloomer: has joined #ruby
[09:03:26] Bellthoven: has joined #ruby
[09:05:36] Macaveli: has joined #ruby
[09:06:20] lacrosse: has joined #ruby
[09:13:38] rsc___: has joined #ruby
[09:15:05] mistym: has joined #ruby
[09:15:05] mistym: has joined #ruby
[09:17:36] dhjondoh: has joined #ruby
[09:18:52] blackmesa: has joined #ruby
[09:19:42] alphaatom: has joined #ruby
[09:19:50] ponga: has joined #ruby
[09:25:07] anisha: has joined #ruby
[09:25:13] bronson: has joined #ruby
[09:26:28] devoldmx: has joined #ruby
[09:27:46] Macaveli: has joined #ruby
[09:30:13] M4l4: has joined #ruby
[09:30:46] futilegames: has joined #ruby
[09:31:55] nateberkopec: has joined #ruby
[09:33:14] dmolina: has joined #ruby
[09:33:51] Bellthoven: has joined #ruby
[09:35:47] FooMunki: has joined #ruby
[09:37:38] mistym: has joined #ruby
[09:37:38] mistym: has joined #ruby
[09:38:20] beast: has joined #ruby
[09:39:05] frog0909: has joined #ruby
[09:39:43] timonv: has joined #ruby
[09:41:45] peterhil`: has joined #ruby
[09:41:52] quazimodo: has joined #ruby
[09:42:26] Jet4Fire: has joined #ruby
[09:43:04] bakedb: has joined #ruby
[09:43:35] flughafen: hi Jet4Fire
[09:43:51] flughafen: is ee estonia?
[09:45:35] gregf_: oops . wrong chat :/
[09:46:33] adaedra: Because we're not funny?
[09:46:46] puria: has joined #ruby
[09:47:42] VaibhavRajput: has joined #ruby
[09:48:47] vleis: has joined #ruby
[09:53:40] apeiros: #serious-ruby
[09:55:07] pandaant: has joined #ruby
[09:55:19] vle: has joined #ruby
[09:56:24] VaibhavRajput: has left #ruby: ()
[09:56:31] shevy: anyone has a good use case for TracePoint ?
[09:56:45] rsc___: has joined #ruby
[09:56:48] M4l4: has joined #ruby
[09:57:46] apeiros: debugging?
[09:58:06] dionysus69: has joined #ruby
[09:59:03] waka: has joined #ruby
[09:59:13] kfrz: has joined #ruby
[09:59:35] shevy: dunno yet, just noticed it from this here: https://bugs.ruby-lang.org/issues/11777 TracePoint.new(:raise)
[10:00:22] shevy: at first I thought it had to do with set_trace_var
[10:02:04] armyriad: has joined #ruby
[10:03:14] dhjondoh: has joined #ruby
[10:03:33] rodfersou: has joined #ruby
[10:07:12] Tempesta: has joined #ruby
[10:08:55] graffix222: has joined #ruby
[10:09:00] baweaver: has joined #ruby
[10:09:44] dhjondoh: has joined #ruby
[10:09:45] sepp2k: has joined #ruby
[10:09:53] platzhirsch: has joined #ruby
[10:09:54] colegatron: has joined #ruby
[10:10:18] M4l4: has joined #ruby
[10:11:17] blub: hi yorickpeterse
[10:16:57] dhjondoh: has joined #ruby
[10:17:11] monthy: has joined #ruby
[10:24:26] user1138: has joined #ruby
[10:25:36] huyderman: has joined #ruby
[10:25:39] user1138: has joined #ruby
[10:26:20] rideh: has joined #ruby
[10:26:52] devoldmx: has joined #ruby
[10:29:07] DarkBushido: has joined #ruby
[10:29:14] epochwolf: has joined #ruby
[10:30:10] Apocalypse: has joined #ruby
[10:31:33] root_murdoc: has joined #ruby
[10:32:40] nateberkopec: has joined #ruby
[10:33:48] torpig: has joined #ruby
[10:34:32] atomical: has joined #ruby
[10:37:48] cschneid: has joined #ruby
[10:41:59] crdpink2: has joined #ruby
[10:43:15] epochwolf: has joined #ruby
[10:43:36] hostess: has joined #ruby
[10:43:51] nfk|laptop: has joined #ruby
[10:44:18] rideh: has joined #ruby
[10:45:23] chriscoffee: has joined #ruby
[10:45:49] Ikri: has joined #ruby
[10:47:10] M4l4: has joined #ruby
[10:47:34] dhjondoh: has joined #ruby
[10:49:21] ldnunes: has joined #ruby
[10:50:20] atomical: has joined #ruby
[10:53:02] vikas027: has joined #ruby
[10:53:38] rideh: has joined #ruby
[10:54:12] stamina: has joined #ruby
[10:54:40] DarkBushido: has joined #ruby
[10:56:14] alphaatom: has joined #ruby
[10:57:03] jpfuentes2: has joined #ruby
[10:59:21] rsc___: has joined #ruby
[10:59:36] vikas027: Hello Everyone, I am unable to use net-ldap gem with bind_as . Please help me to figure out what is wrong in this code http://pastebin.com/q8YSWtz6
[10:59:37] ruboto: vikas027, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/903ad3e4d2f6cd9a73bb
[10:59:37] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[10:59:56] kaka_: has joined #ruby
[11:00:27] GGMethos: has joined #ruby
[11:00:29] apeiros: vikas027: lets start with your problem description - how do you figure "something is wrong"?
[11:00:40] fabrice31: has joined #ruby
[11:01:29] vikas027: apeiros: When I run this code, I get "Authentication FAILED." while I can login thru this user on the Windows machine
[11:02:42] dlitvak: has joined #ruby
[11:03:07] apeiros: been a while - might be that your windows machine automatically adds the domain (as in "<domain>\username")
[11:03:50] yfeldblum: has joined #ruby
[11:04:34] vikas027: apeiros: Hmm... it shouldn't be since I tried to use username 'vikas.kumar@TEST.COM' while connecting thru a RDP session as well
[11:04:41] DarkBushido: has joined #ruby
[11:05:13] apeiros: do you only need to know whether password & username are valid?
[11:05:18] dhjondoh: has joined #ruby
[11:05:30] vikas027: apeiros: correct, that is my ultimate goal
[11:05:40] toretore: has joined #ruby
[11:06:43] apeiros: then you can use .bind instead of bind_as. I.e. my code here is just: def self.valid?; !!Net::LDAP.new(*options).bind
[11:07:26] apeiros: and options is roughly: {host: , port:, base:, auth: => {method:, username:, password: }}
[11:07:40] vikas027: apeiros: let me try that
[11:08:09] apeiros: and in username, I have "domain\\" prefixed
[11:08:10] vikas027: apeiros: thanks for the help
[11:08:23] skade: has joined #ruby
[11:08:24] apeiros: so I guess yours might even work, but it's missing the domain
[11:09:46] dlitvak: has joined #ruby
[11:11:43] mistym: has joined #ruby
[11:11:43] mistym: has joined #ruby
[11:12:59] andikr: has joined #ruby
[11:13:06] atomical: has joined #ruby
[11:13:55] dlitvak: has joined #ruby
[11:15:26] araujo: has joined #ruby
[11:15:27] araujo: has joined #ruby
[11:15:54] nixmaniack: has joined #ruby
[11:15:54] nixmaniack: has joined #ruby
[11:16:26] araujo: has joined #ruby
[11:16:27] araujo: has joined #ruby
[11:17:51] joonty: has joined #ruby
[11:19:47] svoop: has joined #ruby
[11:22:39] spk: has joined #ruby
[11:23:47] araujo: has joined #ruby
[11:23:48] araujo: has joined #ruby
[11:24:13] bronson: has joined #ruby
[11:26:20] jschmid1: has joined #ruby
[11:26:58] arup_r: has joined #ruby
[11:27:40] jas02: has joined #ruby
[11:27:44] durstburger: has joined #ruby
[11:28:41] vikas027: apeiros: thanks a ton. All of the ldap.auth options are working fine here - https://dpaste.de/coMU
[11:29:26] arup_r: codeclimate giving error for the months method https://gist.github.com/aruprakshit/daa8b0e05a430685138a error as Assignment Branch Condition size for months is too high. [23.28/20]. How to refactor this ? little hints pease
[11:30:20] apeiros: arup_r: isn't that rails?
[11:30:55] arup_r: No. Refactoring is not related to rails.. I can ask this channel too
[11:31:07] apeiros: ACTION sobs
[11:31:26] adaedra: ACTION pats apeiros 
[11:31:34] apeiros: arup_r: yes. refactoring is totally related to the tools you have available.
[11:31:47] apeiros: arup_r: and rails/not rails is a *friggin huge* difference in tools available.
[11:31:55] adaedra: arup_r: Rails channel will be able to give you Rails solutions that can help you further in your refactoring.
[11:32:14] arup_r: ok.. moving.
[11:32:55] arup_r: I still not convinced to think this question as Rails channel specific .. but I will listen you.. :)
[11:33:26] nateberkopec: has joined #ruby
[11:34:00] stannard: has joined #ruby
[11:35:37] Peg-leg: has joined #ruby
[11:36:00] apeiros: arup_r: I think you're lucky you don't have to i18n that. otherwise the score would be even higher.
[11:36:00] gigetoo: has joined #ruby
[11:36:31] trautwein: shevy, wrong window.. or the ruby debugger displays very strange things ;)
[11:37:01] maesitos: has joined #ruby
[11:38:00] arup_r: which part of the code making rubocop unhappy thinking .. :)
[11:38:26] spt0: has joined #ruby
[11:39:56] norc: has joined #ruby
[11:39:59] norc: Hi folks.
[11:41:25] dhjondoh: has joined #ruby
[11:42:00] blub: hi big norc
[11:42:28] blackmesa: has joined #ruby
[11:43:36] it_tard: has joined #ruby
[11:49:38] nerium: has joined #ruby
[11:49:52] CloCkWeRX: has joined #ruby
[11:51:44] dkam: has joined #ruby
[11:52:29] dlitvak: has joined #ruby
[11:52:31] dhjondoh: has joined #ruby
[11:53:28] robert45: has joined #ruby
[11:53:39] dkam: How would I create an SSL Context which includes SNI? Looks like the C call is SSL_set_tlsext_host_name?
[11:56:28] FooMunki: has joined #ruby
[11:56:40] hackmathics: has joined #ruby
[11:57:46] shevy: arup_r EVERYTHING makes rubocop unhappy
[11:58:02] skade: has joined #ruby
[11:58:20] dhjondoh: has joined #ruby
[12:01:46] dlitvak: has joined #ruby
[12:01:50] jhass: dkam: I would expect that to be a default by now
[12:01:52] jhass: are you sure it's failing because of that?
[12:02:21] dkam: jhass: I figured it out - you set socket.hostname = "blah.com" - that'll set the SSL context for SNI.
[12:02:31] Jet4Fire: has joined #ruby
[12:02:48] hackmathics: has joined #ruby
[12:03:05] dkam: jhass: Ha! Nice to meet you in chat, rather than github issues.
[12:04:02] edwinvdgraaf: has joined #ruby
[12:04:50] dkam: jhass: It wasn't failing - but without provided the context / SNI stuff, the webserver just serves up the default host's certificate.
[12:05:04] Mon_Ouie: has joined #ruby
[12:05:53] jhass: yeah I can imagine, I never tried it outside a HTTPS context I guess, which handles it transparently
[12:06:40] jhass: Interesting, devdocs.io doesn't list Socket#hostname= or OpenSSL::Socket#hostname=
[12:09:15] dkam: It's OpenSSL::SSL::SSLSocket
[12:09:45] jhass: eh, yeah, OpenSSL::Socket is the crystal name :P
[12:09:45] jhass: but either way
[12:09:59] peterhil`: has joined #ruby
[12:10:20] Ropeney: has joined #ruby
[12:10:22] baweaver: has joined #ruby
[12:10:28] DoubleMalt: has joined #ruby
[12:10:54] jhass: http://ruby-doc.org/stdlib-2.2.3/libdoc/openssl/rdoc/OpenSSL/SSL/SSLSocket.html it's missing :/
[12:11:44] dkam: Man, that's some bad documentation. I found it in the source : https://github.com/ruby/openssl/blob/master/lib/openssl/ssl.rb
[12:12:00] shevy: this is not the documentation you are looking for! *jedi-hand-wave*
[12:12:57] jhass: >> class Foo; attr_accessor :foo; end; Foo.new.method(:foo=).source_location
[12:12:58] ruboto: jhass # => ["/tmp/execpad-4a70da31c156/source-4a70da31c156", 2] (https://eval.in/481478)
[12:14:56] alphaatom: has joined #ruby
[12:15:03] jhass: >> require "openssl"; OpenSSL::SSL::SSLSocket.instance_method(:hostname=).source_location
[12:15:04] ruboto: jhass # => nil (https://eval.in/481483)
[12:15:18] jhass: ^ the heck? It's defined in Ruby
[12:17:55] ruid: has joined #ruby
[12:17:56] ruid: has joined #ruby
[12:18:01] sandstrom: has joined #ruby
[12:18:58] vdamewood: has joined #ruby
[12:19:24] cantaberry: has joined #ruby
[12:19:45] dhjondoh: has joined #ruby
[12:22:26] lokulin: has joined #ruby
[12:24:30] danneu: has joined #ruby
[12:25:41] root_murdoc: has joined #ruby
[12:25:58] prestorium: has joined #ruby
[12:27:39] devoldmx: has joined #ruby
[12:27:40] sdothum: has joined #ruby
[12:28:11] puria: has joined #ruby
[12:29:09] karapetyan: has joined #ruby
[12:31:16] jgt1: has joined #ruby
[12:32:45] krzkrzkrz: has joined #ruby
[12:32:55] duckpuppy: has joined #ruby
[12:34:05] nateberkopec: has joined #ruby
[12:34:30] toy: has joined #ruby
[12:37:02] toretore: has joined #ruby
[12:40:26] dlitvak: has joined #ruby
[12:41:01] alphaatom: has joined #ruby
[12:42:06] karapetyan: has joined #ruby
[12:42:24] last_staff: has joined #ruby
[12:44:35] blackmesa: has joined #ruby
[12:44:50] linduxed: has joined #ruby
[12:47:19] toy_: has joined #ruby
[12:51:29] favadi: has joined #ruby
[12:51:38] puria: has joined #ruby
[12:54:23] skweek: has joined #ruby
[12:54:41] dlitvak: has joined #ruby
[12:54:45] joonty: has joined #ruby
[12:55:40] shevy: *another-jedi-hand-wave*
[12:57:34] rgrmatt: has joined #ruby
[12:58:05] jpfuentes2: has joined #ruby
[12:58:42] dkam: has joined #ruby
[13:01:32] Lap64: has joined #ruby
[13:01:46] jackcom: has joined #ruby
[13:02:07] jackcom: has left #ruby: ()
[13:02:31] diegoviola: has joined #ruby
[13:02:53] sandstrom: has joined #ruby
[13:03:06] speaking1ode: has joined #ruby
[13:05:04] synthroid: has joined #ruby
[13:05:09] kaka: has joined #ruby
[13:05:15] tesuji: has joined #ruby
[13:08:53] xet7: has joined #ruby
[13:10:51] CloCkWeRX: has left #ruby: ()
[13:14:22] peterhil`: has joined #ruby
[13:20:45] aryaching: has joined #ruby
[13:20:56] Zarthus: Is it possible to have Resolv::DNS get either an address or a CNAME? When I try to filter those three from each_resource with Resolv::DNS::Resource::IN::ANY the server denies my request ("Please stop asking for ANY") as HINFO (I assume this is a ruby bug and shouldn't really classify as "hardware info", but I haven't read the specification).
[13:21:22] Zarthus: possibly a follow up question: If it is, is there a way to automatically resolve a CNAME to an IP address, or is it correct to recursively resolve this?
[13:22:03] duckpuppy: has joined #ruby
[13:22:04] jhass: ACTION never used resolv, let's experiment a bit
[13:22:06] Zarthus: My initial thought was that this should use bitwase and/or, but that does not seem to be the case.
[13:22:36] nateberkopec: has joined #ruby
[13:22:40] Zarthus: e.g. each_resource('google.com', Resolv::DNS::Resource::IN::A | Resolv::DNS::Resource::IN::AAAA | Resolv::DNS::Resource::IN::CNAME - but that's a flat out syntax error.
[13:23:01] dkam: has joined #ruby
[13:23:03] jhass: I would expect that if you ask for A and get CNAME back, you have two situations, the server knows the target and returns it and it's available somehow, the server doesn't and you have to run another query
[13:23:30] kaka_: has joined #ruby
[13:23:44] Zarthus: each_address (essentially Resolv::DNS::Resource::IN::A and Resolv::DNS::Resource::IN::AAAA) does not return CNAMEs
[13:24:34] sgambino: has joined #ruby
[13:24:45] d0nn1e: has joined #ruby
[13:25:09] GinoManWorks: has joined #ruby
[13:25:46] Macaveli: has joined #ruby
[13:26:43] skweek: has joined #ruby
[13:26:47] bronson: has joined #ruby
[13:26:53] davedev24: has joined #ruby
[13:26:58] Zarthus: as for why I would want to ensure it resolves to an IP address: I'm doing some extra validation with regards to IP ranges (e.g. "somehost.com must resolve to an IP address in 1.1.0.0/16")
[13:27:05] apeiros: syntax error?
[13:27:28] apeiros: that doesn't mean it can't work. it just means you wrote something the wrong way. what precisely is the syntax error?
[13:27:47] Rumbles: has joined #ruby
[13:28:17] Zarthus: `resolve': undefined method `|' for Resolv::DNS::Resource::IN::A:Class (NoMethodError) with: each_resource(name, Resolv::DNS::Resource::IN::A | Resolv::DNS::Resource::IN::AAAA | Resolv::DNS::Resource::IN::CNAME) do |resource|
[13:28:17] Zarthus: you're right, it was a bit vaguely phrased by me
[13:28:26] apeiros: yeah, that's not a syntax error
[13:28:43] Zarthus: it was more or less a guess on my side to see if bitwise operators would work
[13:28:43] mikecmpbll: has joined #ruby
[13:29:29] apeiros: ACTION digs up his code
[13:29:37] apeiros: pretty sure I did multiple lookups in one
[13:30:07] Zarthus: yeah, that would be the approach I would take if I couldn't sort it out
[13:30:33] apeiros: hm, nope. I added a layer on top of getresources
[13:30:36] jhass: Zarthus: getaddresses as well as getresources resolve the CNAME here
[13:30:49] jhass: Zarthus: and fetch_resource provides unfiltered access to the response
[13:32:14] jhass: if you explicitly want to know whether a CNAME exist you can either guess from comparing the name in the response with what you requested or explicitly ask for CNAME, I guess
[13:32:32] shanemcd: has joined #ruby
[13:34:22] Zarthus: seems like getresources pretty much sends multiple requests
[13:34:30] p0wn3d: has joined #ruby
[13:35:05] jhass: fetch_resource even
[13:35:23] Zarthus: is fetch_resource a method made by you?
[13:35:36] jhass: http://devdocs.io/ruby/resolv/dns#method-i-fetch_resource
[13:35:55] ghoti: has joined #ruby
[13:36:05] Zarthus: that site is a lot more informative than the ruby docs
[13:36:07] jhass: and that does requester.request(sender, tout) which from the look of it already resolves any CNAME chain
[13:36:11] InvGhost: has joined #ruby
[13:36:38] dhjondoh: has joined #ruby
[13:37:02] jhass: for what it's worth http://ruby-doc.org/stdlib-2.2.3/libdoc/resolv/rdoc/Resolv/DNS.html#method-i-fetch_resource
[13:40:02] nhhagen: has joined #ruby
[13:42:23] brendan-: has joined #ruby
[13:42:26] Zarthus: yep, this worked. (and as of why I couldn't find fetch_resource: Google tends to bring me to outdated docs)
[13:44:35] lurch_: has left #ruby: ()
[13:45:53] puria: I get this error when installing ruby 2.2.3 using rbenv: http://pastebin.com/2cQBMdGD
[13:45:53] ruboto: puria, we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[13:45:58] skakri: has joined #ruby
[13:46:00] blackmesa: has joined #ruby
[13:46:24] apeiros: given that rbenv is said to be the least popular ruby manager, we sure get a lot of questions about it???
[13:46:40] apeiros: soooo??? either it isn't unpopular or it's unpopular because it raises so many questions?
[13:47:32] jhass: apeiros: or it just causes the most problems?
[13:47:45] yorickpeterse: omg but shims are so helpful
[13:48:11] apeiros: ACTION admits that he has no idea how any manager other than rvm works - and even with rvm only a faint idea
[13:48:32] jhass: rvm & chruby have the same approach
[13:48:52] arup_r: short question: How to get [[1,2], [ [3,4], [5,6]]] -> [[1,2], [3,4], [5,6]] ? [[1,2], [ [3,4], [5,6]].flatten(1) ] is wrong as per my intentation.. What other tool is there ? :)
[13:48:55] jhass: they're essentially a shell function which fixes up your $PATH and stuff to the Ruby, yeah
[13:48:56] apeiros: that is, user install and control all via env vars?
[13:49:21] apeiros: arup_r: those two look identical?
[13:49:32] apeiros: oh, your second one is fucked
[13:49:35] jhass: rbenv adds a static directory to your $PATH and provides wrappers which it rewrites (or who delegate?) to the currently active ruby
[13:49:42] apeiros: arup_r: properly create the array in the first place, I'd say
[13:49:50] puria: I get this error when I try to install ruby using rbenv: https://gist.github.com/anonymous/dbd0ebccc648e25a734b
[13:49:54] apeiros: arup_r: because I *bet* you used <</push where you should have used concat
[13:50:16] arup_r: hum.. need to use concat
[13:50:23] arup_r: thanks.. your bet is correct
[13:51:42] apeiros: ACTION mumbles something about treating symptoms instead of causes???
[13:52:09] dlitvak: has joined #ruby
[13:53:22] shmoon: has joined #ruby
[13:53:29] shmoon: hey needed some help with webrick ?
[13:53:50] nixmaniack: has joined #ruby
[13:53:53] shmoon: I run a small app on webrick on my web server but then I'm unabe to access it with http://ip:3000/ is it not supposed to work like that ?
[13:54:23] apeiros: if you start the server under port 3000 and listening on that interface, then yes, it's supposed to work like that
[13:54:40] jhass: puria: you need to apply this patch: https://github.com/ruby/ruby/commit/801e1fe46d83c856844ba18ae4751478c59af0d1.diff
[13:55:04] shmoon: but it doesnt apeiros , it doens't accept my connections
[13:55:08] shmoon: i tried port 80 too
[13:55:18] shmoon: is webrick not supposed to run for public clients on a remote webs erver (linode) ?
[13:55:36] apeiros: shmoon: well, *did you start it* under those properties?
[13:55:59] shmoon: yup, $ sudo ruby yo.rb -p 3000
[13:56:29] apeiros: shmoon: and for which interface does it listen? 0.0.0.0 is all interfaces??? otherwise it's specific.
[13:56:32] dkam: has joined #ruby
[13:56:52] apeiros: i.e. if you start it bound to 127.0.0.1, it won't accept connections on your external ip
[13:57:04] jhass: well, :: is all interfaces too :P
[13:57:22] apeiros: jhass: oh, good point. should remember that. shorter to type :)
[13:57:42] jhass: localhost is shorter to type too! ::1 or [::1] in the worst case
[13:57:54] durstburger: has joined #ruby
[13:58:00] dionysus69: has joined #ruby
[13:58:10] apeiros: localhost isn't all interfaces
[13:58:19] apeiros: or not necessarily. usually it's 127.0.0.1
[13:58:24] jhass: er, I should say loopback
[13:58:42] jhass: 127.0.0.1 == ::1
[13:58:54] apeiros: mhm, but 0.0.0.0 != 127.0.0.1
[13:58:59] root_murdoc: has joined #ruby
[13:59:06] jhass: no, 0.0.0.0 == ::
[13:59:21] apeiros: good. then we talk the same again now :)
[13:59:44] teoric: has joined #ruby
[14:00:09] goodcodeguy: has joined #ruby
[14:00:16] jhass: even multicast is shorter, but I can never remember them
[14:00:24] shmoon: can i pass the interface when i start it ?
[14:00:29] root_murdoc: has joined #ruby
[14:00:41] jhass: ff02::1,2,3 or so
[14:00:42] jhass: shmoon: probably
[14:00:42] apeiros: shmoon: that depends on the code in your yo.rb
[14:01:07] apeiros: neither ruby nor webrick care about what arguments you pass to your script
[14:01:12] apeiros: only your script does.
[14:01:40] shmoon: $ sudo ruby yo.rb -p 3000 -o 0.0.0.0 - no luck :/
[14:01:53] apeiros: and since we don't know anything about your script - except for its name - how should we be able to tell?
[14:01:55] shmoon: my script is simple, http://pastie.org/10616111
[14:02:06] apeiros: aha??? there we go.
[14:02:17] apeiros: I'd refer you to the sinatra docs then.
[14:02:19] bigmac: can you search for a value or key in a hash with regex?
[14:02:19] bigmac: "string123".scan(/string[0-9]{1,3}/)
[14:02:25] apeiros: pretty sure they tell how to
[14:02:36] bigmac: when i attempt this on a hash i get a regex error
[14:02:36] nerium: has joined #ruby
[14:02:38] apeiros: bigmac: Hash#each and all of Enumerable are your friends.
[14:02:40] bigmac: so i assume you cant
[14:02:49] ljarvis: bigmac: Enumerable#find
[14:02:50] apeiros: and no, you can't use .scan, as that's not a method on Hash.
[14:02:59] cdg: has joined #ruby
[14:03:01] bigmac: sorry, the scan was just for example
[14:03:04] jhass: bigmac: Hash#.each_key.grep(/.../)
[14:03:21] ljarvis: that's better
[14:03:44] ljarvis: (if you dont want the value in the same lookup)
[14:03:47] shmoon: apeiros: hmm, http://www.sinatrarb.com/intro.html says by default -o is 0.0.0.0
[14:03:49] apeiros: am I being extra difficult for not giving the solution directly?
[14:04:13] shmoon: not sure what am doing wrong
[14:04:23] shmoon: ok I'll look into it further, np
[14:04:36] shmoon: it works on my localhost, just saying that on my remote server it doesn't
[14:04:43] apeiros: shmoon: when you start the script, what's printed?
[14:05:05] shmoon: apeiros: http://pastie.org/10616118
[14:05:25] shmoon: maye i have to set the environment
[14:05:47] apeiros: why doesn't it have a line like "Listening on ???"?
[14:05:54] alphaatom: has joined #ruby
[14:06:17] shmoon: nope, no lucj with $ RACK_ENV=production ruby yo.rb -p 3000 -o 0.0.0.0 either
[14:06:42] jhass: shmoon: so, do you have a packet filter?
[14:06:43] shmoon: it doesn't :S
[14:07:07] p1k: has joined #ruby
[14:07:34] jhass: ubuntu comes with ufw and fedora comes with firewalld for example
[14:08:00] shmoon: hm dunno much about pakcet filters
[14:08:14] adaedra: what is the output of `sudo iptables -L` ?
[14:08:17] jhass: time to change that!
[14:08:27] p1k: does anyone have an idea how to pass an array to exec params of Ruby-PG
[14:08:36] jhass: shmoon: it's a topic you should know when you provide a server to the internet
[14:08:44] p1k: none of the obvious things I can do in python seem to work - do I need to call a custom encoding method?
[14:08:45] jhass: p1k: what did you try and what's the error?
[14:09:04] shmoon: adaedra: http://pastie.org/10616126
[14:09:12] shmoon: are you talking about iptables/firewall only ?
[14:09:19] adaedra: So yeah, no packet filter
[14:09:24] p1k: jhass: I tried "... v.id IN $1", [[1,2,3]] and other such variations
[14:09:33] dlitvak: has joined #ruby
[14:09:45] adaedra: shmoon: there are multiple ways to manage Linux iptables. iptables (eh), firewalld, ufw, shorewall, ...
[14:09:52] jhass: p1k: that's only answering a quarter of my question (since it only answer half of the first part)
[14:10:18] p1k: jhass: yeah it's a very non-useful error =/ PG::SyntaxError: ERROR: syntax error at or near "$1"
[14:10:27] kp666: has joined #ruby
[14:10:38] jhass: ($1) perhaps?
[14:11:05] p1k: jhass: that works if you query for a single IN value, but [1,2] can't expand correctly into that =/
[14:12:23] rsc___: has joined #ruby
[14:12:52] TomPeed: has joined #ruby
[14:14:22] Xeago: has joined #ruby
[14:15:51] sjohnsen: has joined #ruby
[14:15:54] godzillaenlacasa: has joined #ruby
[14:16:00] nixmaniack: has joined #ruby
[14:16:03] ghormoon: has joined #ruby
[14:16:21] sankaber: has joined #ruby
[14:16:21] halfdan: has joined #ruby
[14:17:59] null__: has joined #ruby
[14:17:59] null__: has joined #ruby
[14:18:11] JDiPierro: has joined #ruby
[14:18:56] jhass: p1k: woah, looks like there's really no decent support for this, the solutions I find are all horrible (building an PG array literal as string)
[14:19:05] platzhirsch: has left #ruby: ()
[14:19:15] irk: has joined #ruby
[14:19:35] bigmac: some one had suggested clandestined gem, for a cluster like hashing... but i dont see any examples for running a server and building the hash
[14:19:35] p1k: jhass: Yeah that's all I'm seeing also - but I just thought "there must be a normal way to do this"
[14:19:40] jhass: p1k: your safest bet is to generate something like ($1, $2, $3) I'd say
[14:19:48] p1k: like PG.encodeArrayParam or something :S
[14:20:30] jhass: p1k: IN (#{1.upto(array.size).map {|i| "$#{i}" }.join(", ")}) something like that, ugh
[14:20:34] Some-body_: has joined #ruby
[14:21:09] pandaant: has joined #ruby
[14:21:20] sphex: has joined #ruby
[14:21:31] apeiros: yupp, expanding the $ vars is the way to go
[14:21:32] Jardayn: has joined #ruby
[14:22:16] apeiros: if your values from your IN clause are the result of another query -> use a subquery. much more performant.
[14:22:21] brainslug: has joined #ruby
[14:23:15] p1k: apeiros: no, single query, so really no encoding method - must string interpolate?
[14:23:30] apeiros: p1k: no, use jhass lass suggestion
[14:23:42] jhass: p1k: don't interpolate the values directly, generate bind params as I've shown
[14:23:56] tsunamie: has joined #ruby
[14:24:09] p1k: jhass: that's interpolating bind params, it's still a hack that the encoder should really handle -_-
[14:24:21] vifino: has joined #ruby
[14:24:22] apeiros: you can use pgarray and use functions to expand that/use it in an IN
[14:24:33] apeiros: but can't tell you from the top of my head how. and it's not necessarily better.
[14:24:50] arup_r: has joined #ruby
[14:24:58] jhass: PG rewrites IN to = ANY(array[])
[14:25:11] apeiros: oh? source?
[14:25:36] jhass: random dude on the internet (stackoverflow), closed the tab
[14:25:36] p1k: i'm looking at rails, it seems to interpolate directly without using params
[14:25:54] p1k: but that might be for cross-compatibility across sql connectors also
[14:25:59] jhass: rails is still a source of bad ideas, I seee
[14:26:32] jhass: but generating bind params makes you pretty much immune to SQLi from that part at least
[14:27:15] apeiros: surprising that AR still is. given how much time tenderlove spent on it
[14:27:23] apeiros: but I guess he won't go over each db driver :)
[14:28:04] apeiros: though, pg and ora driver do the same
[14:28:13] p1k: meh as of 4.23 they are still using pg_type_map_all_string for instantiating AR objects from rows
[14:28:14] apeiros: so maybe that's indeed not a driver-level fault
[14:28:24] devoldmx: has joined #ruby
[14:28:39] p1k: fixed in 5.0 I think, but there's definetly some cross-compatibility stuff they do which is very sub optimal
[14:29:13] apeiros: ACTION has no 5.0 handy
[14:31:49] shevy: jhass hah, I shall immortalize that epic quote about rails in my irc-quotes file!
[14:32:24] akem: has joined #ruby
[14:32:43] jhass: ACTION magnetizes shevy's harddisk
[14:33:24] favadi: has joined #ruby
[14:33:50] PhilK: has joined #ruby
[14:33:54] diegoviola: DateTime.now.strftime("%Y%m%d%H%M%S")
[14:33:54] diegoviola: is there a shorthand for this
[14:34:01] decoponio: has joined #ruby
[14:34:13] blackmesa: has joined #ruby
[14:38:13] dionysus69: has joined #ruby
[14:38:24] darix: that is pretty short imho
[14:39:27] darix: DateTime.now.strftime("%Y-%m-%dT%H:%M:%S")
[14:39:40] darix: to make it a common date format which can be easily parsed
[14:41:07] jhass: that one can be shorter, %FT%T
[14:41:11] ESpiney: has joined #ruby
[14:42:01] hxegon: has joined #ruby
[14:43:09] diegoviola: my client asked me to use the format I just mention though
[14:43:30] symm-: has joined #ruby
[14:43:46] diegoviola: 20151127082853
[14:44:15] _stu_: has joined #ruby
[14:45:00] shevy: if only we could do DateTime['%FT%T'] ... or even a method... DateTime.whatever_the_name_for_the_common_format_is()
[14:45:19] Azulinho: has joined #ruby
[14:45:27] jhass: >> require "time"; Time.now.iso8601
[14:45:28] ruboto: jhass # => "2015-12-07T14:45:27+00:00" (https://eval.in/481629)
[14:45:45] norc: That at least also carries a timezone.
[14:45:48] darix: shevy: well you would still need to tell the DateTime which point in time you refer to
[14:46:00] djcp: has joined #ruby
[14:46:15] darix: norc: well i left out TZ as his original didnt care either. so i assume he normalized timezones on input ;)
[14:46:16] JDiPierro: has joined #ruby
[14:46:21] lukeasrodgers: has joined #ruby
[14:46:36] Papierkorb: has joined #ruby
[14:46:46] norc: darix: Heh. I have made it a habit to include TZ absolutely everywhere, since it makes dealing with cross timezone issues so much easier.
[14:47:01] whippythellama: has joined #ruby
[14:47:03] norc: Price for living in country with daylight saving time.
[14:47:40] asmodlol: has joined #ruby
[14:48:11] Fredrich010: has joined #ruby
[14:48:14] shevy: it saves time!
[14:49:19] kobain: has joined #ruby
[14:51:23] glowcoil: has joined #ruby
[14:51:29] jevs_: has joined #ruby
[14:51:29] benlakey: has joined #ruby
[14:51:52] boxrick1: has joined #ruby
[14:52:13] favadi: has joined #ruby
[14:52:16] roshanavand: has joined #ruby
[14:53:25] elektronaut: has joined #ruby
[14:54:07] Shidash: has joined #ruby
[14:54:15] dlitvak: has joined #ruby
[14:55:06] Fredrich010: has joined #ruby
[14:55:31] cookiez: has joined #ruby
[14:56:01] sankaber: has joined #ruby
[14:56:10] The_Phoenix: has joined #ruby
[14:56:30] rickmasta: has joined #ruby
[14:57:15] malconis: has joined #ruby
[14:57:21] kitallis: has joined #ruby
[14:57:46] leslie: has joined #ruby
[14:57:46] leslie: has joined #ruby
[14:58:57] jpfuentes2: has joined #ruby
[14:59:06] m3_del: has joined #ruby
[15:00:00] stannard: has joined #ruby
[15:00:02] johnny56: has joined #ruby
[15:00:15] chouhoulis: has joined #ruby
[15:00:50] IrishGringo: has joined #ruby
[15:00:57] joonty: has joined #ruby
[15:03:07] hxegon: has joined #ruby
[15:03:20] stannard: has joined #ruby
[15:03:49] babblebre: has joined #ruby
[15:04:06] devbug: has joined #ruby
[15:06:17] dlitvak: has joined #ruby
[15:07:22] dorei: has joined #ruby
[15:09:03] dorei: i want to produce unique filenames for urls, i've used Base64::encode64(url) but the output isnt that suitable for filename
[15:09:25] duckpuppy: has joined #ruby
[15:10:42] banister: has joined #ruby
[15:11:02] cdg: has joined #ruby
[15:11:33] ddubs: has joined #ruby
[15:11:44] mallu: has joined #ruby
[15:14:22] toretore: dorei, md5, sha?
[15:14:40] Synthead: has joined #ruby
[15:14:45] amoeba: has joined #ruby
[15:14:46] adaedra: dorei: hexdigest.
[15:14:51] Meliodas: has joined #ruby
[15:15:01] Authenticator: has joined #ruby
[15:15:15] cdg: has joined #ruby
[15:15:26] adaedra: I guess a good idea would be to generate UUIDs for your files, tho.
[15:16:18] shredding: has joined #ruby
[15:16:58] scottstamp: has joined #ruby
[15:18:33] dorei: wouldnt it be an overkill to use a cryptohash?
[15:19:52] adaedra: md5 is pretty quick, especially for the small string you have.
[15:22:20] malconis: has joined #ruby
[15:22:53] i: has joined #ruby
[15:23:07] nixmaniack: has joined #ruby
[15:23:07] nixmaniack: has joined #ruby
[15:23:14] elliottcable: has joined #ruby
[15:24:29] ElSif: has joined #ruby
[15:25:31] mary5030: has joined #ruby
[15:25:56] darix: adaedra: while uuid based file names might be good. you would need to maintain a hash for url <=> filename no?
[15:25:57] axl_: has joined #ruby
[15:26:24] mary5030: has joined #ruby
[15:29:01] dorei: in my specific case i only want to have url => filename, not both ways
[15:31:09] apeiros: if our filesystems would allow arbitrarily long filenames, you could just use the url itself as name :D
[15:31:18] futilegames: has joined #ruby
[15:31:57] Ishido: has joined #ruby
[15:31:57] mkosaki: has joined #ruby
[15:36:12] zapata: has joined #ruby
[15:37:38] cjbottaro: has joined #ruby
[15:37:47] darix: apeiros: with a s|/|_|g
[15:37:58] darix: dorei: i would use sha256sum on the url and use that
[15:38:52] apeiros: darix: I'd use an encoding system. like % encoding.
[15:39:36] darix: i claim that hashing will probably be faster than url encode the url again ;)
[15:39:51] dhollinger: has joined #ruby
[15:39:55] patdohere: has joined #ruby
[15:40:44] alphaatom: has joined #ruby
[15:41:13] apeiros: given that a couple of hashing algorithms have hardware support, you might even be right
[15:41:22] whippythellama: has joined #ruby
[15:41:31] apeiros: without, I'd say % encoding is faster
[15:41:52] apeiros: % encoding is a single loop with a single jmp
[15:41:58] apeiros: hard to beat that
[15:42:44] tejasmanohar: has joined #ruby
[15:42:49] dorei: maybe base64::encode64 and then removing that illegal character at the end would be faster
[15:42:56] apeiros: only thing which can be expensive is if you don't want to allocate url.bytesize*3 - if you allocate too little, then you may have to realloc.
[15:43:46] apeiros: darix: damn you! now I want to write a % encoder in C and see how it fares against openssl's md5/ssh256
[15:44:20] moeabdol: has joined #ruby
[15:44:26] tenderlove: has joined #ruby
[15:46:13] lubarch: has joined #ruby
[15:47:09] Krazypoloc: has joined #ruby
[15:47:33] Krazypoloc: ACTION pokes head in
[15:48:13] adaedra: ACTION grabs Krazypoloc and throw him???her in the channel
[15:48:30] dorei: Base64::strict_encode64 instead of Base64::encode64 did the trick :)
[15:50:12] PlasmaStar: has joined #ruby
[15:53:37] jhass: apeiros: write it in crystal :P
[15:56:03] tildes: has joined #ruby
[15:56:27] apeiros: jhass: you can translate it easily.
[15:56:40] apeiros: got to way a bit until I can go home and got nothing better to do, so I'll give it a shot :D
[15:57:05] wldcordeiro: has joined #ruby
[15:57:09] stamina: has joined #ruby
[15:57:37] adaedra: apeiros: so, never?
[15:58:03] RegulationD: has joined #ruby
[15:58:22] DexterLB: has joined #ruby
[15:58:23] skade: has joined #ruby
[15:58:44] adaedra: You're always busy!
[15:59:19] yorickpeterse: I think that's called having a jeb
[15:59:30] adaedra: THEY TOOK OUR JEBS
[15:59:49] jpfuentes2: has joined #ruby
[16:00:06] wldcordeiro: has joined #ruby
[16:00:29] gregf: has joined #ruby
[16:02:27] atomical_: has joined #ruby
[16:05:18] hxegon: has joined #ruby
[16:05:19] IrishGringo: has joined #ruby
[16:05:33] asmodlol: has joined #ruby
[16:06:24] TheBloke-: has joined #ruby
[16:06:47] snowy: has joined #ruby
[16:08:37] yorickpeterse: DEY TUK ER JERBS
[16:08:45] baweaver: has joined #ruby
[16:11:15] krzkrzkrz: has joined #ruby
[16:11:46] ethe: has joined #ruby
[16:12:14] supermarin: has joined #ruby
[16:12:39] amit__: has joined #ruby
[16:13:27] djstorm: has joined #ruby
[16:13:31] weemsledeux: has joined #ruby
[16:13:56] amit__: dear folks I have two timestamp values that I want to find the time difference between them within a ruby code? any idea how can i achieve this. here is the paste bin with ruby code within logstash http://pastebin.com/SJStz5RF
[16:13:57] ruboto: amit__, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/83386642c2c258633af7
[16:13:57] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[16:14:50] neonalpine: has joined #ruby
[16:16:05] amit__: dear folks I have two timestamp values that I want to find the time difference between them within a ruby code? any idea how can i achieve this. here is the gist post with my ruby code within logstash https://gist.github.com/83386642c2c258633af7
[16:16:26] ruby-lang801: has joined #ruby
[16:16:38] adaedra: No need to repeat it.
[16:16:48] adaedra: You can use ri:Time to manage times.
[16:16:50] `derpy: class `Time`: Time is an abstraction of dates and times. Time is stored internally as the numb??? ??? http://rubydoc.info/stdlib/core/Time
[16:17:18] asmodlol: has joined #ruby
[16:17:44] wsewolod: has joined #ruby
[16:17:48] darix: amit__: if your time fields are strings then just DateTime.strptime(...) with the right format string
[16:17:53] darix: then you can compare them
[16:19:07] amit__: okay will not repeat it, all thank you for response, new to ruby: I am googling what ri:Time is , and yes my timestamp is a string field with content like: "November 7th 2015, 21:13:44.000"
[16:19:08] `derpy: class `Time`: Time is an abstraction of dates and times. Time is stored internally as the numb??? ??? http://rubydoc.info/stdlib/core/Time
[16:19:34] adaedra: amit__: look at the link from `derpy!
[16:19:46] astrobunny: has joined #ruby
[16:19:49] adaedra: (ri: is just a call to the documentation)
[16:20:20] rcvalle: has joined #ruby
[16:20:24] amit__: adaedra: okay reading the link from `derpy
[16:21:17] adaedra: I should find a better way of handling this.
[16:21:32] ruby-lang837: has joined #ruby
[16:22:09] skade: has joined #ruby
[16:22:13] pdoherty: has joined #ruby
[16:22:58] colegatron: has joined #ruby
[16:23:30] duckpuppy: has joined #ruby
[16:24:29] Gnut: has joined #ruby
[16:24:44] spk: has joined #ruby
[16:26:00] orion: has joined #ruby
[16:26:28] hobodave: has joined #ruby
[16:26:30] orion: Hi. In 2.1.0, how do I spawn a thread at the conclusion of a function without .joining it?
[16:28:00] orion: "Thread.new { ... }" is the very last line of a function, and it fails to run because I'm exiting scope.
[16:28:09] skade: has joined #ruby
[16:28:16] orion: I'm wondering how to run a Thread and just have it go without having to worry about scope.
[16:28:19] ruby-lang078: has joined #ruby
[16:28:43] ruboto: We can't help you without your code, please post it to https://gist.github.com
[16:28:52] ruby-lang078: How to fix NameError: unknown option 'entry_of_telephone_or_email' Code: http://pastebin.com/2q2HBcph
[16:28:53] ruboto: ruby-lang078, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/6eed2ac2b02c4b3bd72f
[16:28:53] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[16:28:59] kp666: has joined #ruby
[16:29:07] devoldmx: has joined #ruby
[16:29:24] sucks: has joined #ruby
[16:29:32] cantaberry: has joined #ruby
[16:29:33] jbrhbr: has joined #ruby
[16:29:54] jhass: ruby-lang078: a cheap and not to clean workaround would be to make it an instance variable
[16:29:56] orion: https://gist.github.com/centromere/6b42938f46d5dddf3568
[16:30:52] orion: I want that thread to just run.
[16:31:07] jhass: orion: so if blocking_poll is called it messes up the state needed for log_code?
[16:31:18] orion: log_code doesn't rely on state.
[16:31:34] jhass: then I don't get what error you're getting
[16:31:47] orion: I'm not getting an error. The thread never runs at all.
[16:31:54] orion: (Without t.join)
[16:31:54] jhass: ah, well, I guess code gets reset
[16:31:57] blackmesa: has joined #ruby
[16:32:18] jhass: that's unlikely
[16:32:31] jhass: set Thread.abort_on_exception = true at the start of your program
[16:32:33] orion: The thing is, I don't /want/ to have to call t.join
[16:32:43] jhass: I suspect you want to make a copy of code
[16:33:06] arup_r: has joined #ruby
[16:33:10] shevy: do not let your threads die and become a zombie!
[16:33:12] jhass: code_to_log = code; Thread.new { doorpi.log_code code_to_log }
[16:33:57] shredding: has joined #ruby
[16:34:19] orion: jhass: I suspect that the code never runs without join because at the conclusion of the loop I leave scope.
[16:34:38] orion: And 't' gets GCd.
[16:34:39] jhass: orion: I suspect your guess is wrong
[16:34:56] jhass: threads shouldn't be subject to GC rules
[16:35:02] skade: has joined #ruby
[16:35:28] jhass: the underlying pthread anyway
[16:35:45] jhass: tried my two suggestions yet?
[16:35:58] karapetyan: has joined #ruby
[16:36:13] arup_r: has joined #ruby
[16:36:48] orion: jhass: Yes. In fact, after trying what you suggested, I replaced line 9 with "t = Thread.new { puts 'foo' }" and it still doesn't run.
[16:37:59] Dimik: has joined #ruby
[16:38:31] alphaatom: has joined #ruby
[16:38:34] asmodlol: has joined #ruby
[16:39:29] apeiros: adaedra: sure. but sometimes I have little time bubbles with nothing to do because like before I had to wait for somebody
[16:39:43] jhass: orion: http://p.jhass.eu/15.rb this prints hi roughly every two seconds for me
[16:39:53] apeiros: anyway, that person came earlier than expected, so I managed to catch my train. but I was almost done, so here it is:
[16:40:08] apeiros: adaedra, darix, dorei, jhass: https://gist.github.com/apeiros/c2660dbfce7ee76e33d3
[16:40:12] troulouliou_div2: has joined #ruby
[16:40:17] apeiros: cheap generated code :)
[16:40:32] jhass: apeiros: in crystal you could've used a macro!
[16:40:44] apeiros: jhass: then go and use a macro!
[16:41:30] toretore: orion, what does "doesn't run" mean exactly?
[16:41:44] nerium: has joined #ruby
[16:42:05] orion: toretore: It means that the code within the block does not execute.
[16:42:17] mary5030: has joined #ruby
[16:42:50] dopie: has joined #ruby
[16:43:03] amit__: dear folks: I am trying to convert this timestamp value into DateTime but not successful any help is appreciated: start="November 7th 2015, 16:35:31.000" end="November 8th 2015, 18:35:31.000" but DateTime.parse(start) results in => #<DateTime: 212313674131/86400,0,2299161> but not a time value ...any idea what is wrong?
[16:43:13] ledestin: has joined #ruby
[16:43:32] jhass: amit__: "not a time value"? What do you expect?
[16:44:03] apeiros: >> start="November 7th 2015, 16:35:31.000"; DateTime.parse(start).iso8601
[16:44:04] ruboto: apeiros # => uninitialized constant DateTime (NameError) ...check link for more (https://eval.in/481716)
[16:44:10] apeiros: >> require 'date'; start="November 7th 2015, 16:35:31.000"; DateTime.parse(start).iso8601
[16:44:11] ruboto: apeiros # => "2015-11-07T16:35:31+00:00" (https://eval.in/481717)
[16:44:17] apeiros: amit__: ^ seems to have time just fine.
[16:44:26] amit__: jhass: start has a string and for me to be able to subtract to time i need them in a format the will work ..
[16:44:36] amit__: apeiros: let me try that
[16:44:43] apeiros: amit__: but note that ::parse should only be used if you *don't know* the format. if you know the format, use ::strptime
[16:44:46] jhass: that sentence didn't parse for me
[16:44:47] jhass: ?xy amit__
[16:44:47] ruboto: amit__, it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[16:45:13] apeiros: I think we have a problem of misunderstanding inspect output
[16:45:38] [Butch]: has joined #ruby
[16:45:42] apeiros: amit__: you realize that what you see in irb/pry is the result of obj.inspect, yes?
[16:46:08] apeiros: and that your result is of type DateTime, which means a date + time, which supports DateTime#- just fine too???
[16:46:42] TheHodge: has joined #ruby
[16:47:31] amit__: I apologize, for my naive questions as I am getting used to ruby terminology. In short I have time stamp as start="November 7th 2015, 16:35:31.000" end="November 8th 2015, 18:35:31.000" and I want to find the elapsed time in hours or minutes between these two time values and i don't know how to do that yet in ruby.
[16:47:38] kobain: has joined #ruby
[16:48:04] apeiros: amit__: first step is to convert it into either a Time or a DateTime instance. you did that using DateTime.parse
[16:48:17] apeiros: amit__: and now you use DateTime#- to find the difference:
[16:48:20] jhass: >> require "time"; start_date = "November 7th 2015, 16:35:31.000"; end_date = "November 8th 2015, 18:35:31.000"; (Time.parse(end_date)- Time.parse(start_date)) / 60
[16:48:21] ruboto: jhass # => 1560.0 (https://eval.in/481723)
[16:48:25] apeiros: &ri DateTime#- @amit__
[16:48:26] `derpy: method `Date#-`: Returns the difference between the two dates if the other is a date object. If t??? ??? http://rubydoc.info/stdlib/date/Date#--instance_method
[16:48:57] apeiros: ACTION still thinks ::parse is the wrong tool, though. use strptime.
[16:49:12] jhass: agreed, I was just too lazy to type up the format string :P
[16:49:48] amit__: apeiros, jhass: that is helpful I guess you gave me the solution, let me try that and see if works for what i am trying in logstash ..thank you!!
[16:51:18] apeiros: there's no constant which notes the max length of ruby strings???
[16:51:18] mary5030: has joined #ruby
[16:51:30] jhass: is there one?
[16:52:56] amit__: apeiros: what is the consequence of using ::parse instead of ::strptime when I already know the format?
[16:53:02] Mon_Ouie: has joined #ruby
[16:53:47] skade: has joined #ruby
[16:54:07] apeiros: amit__: the difference is that with .parse you pray and hope that ruby thinks the same about the format as you
[16:54:32] apeiros: with .strptime you a) get an error if the input does not fit the format, and b) it is using the correct format
[16:54:46] Jackneill: has joined #ruby
[16:55:08] adaedra: May be a bit faster, as there's no detection?
[16:55:14] rodfersou: has joined #ruby
[16:55:47] apeiros: that probably too
[16:55:47] cantaberry: has joined #ruby
[16:55:48] amit__: apeiros: fair enough, I will learn how to use ::strptime thank you for your insight.
[16:55:58] apeiros: and strptime is now implemented in C, fairly fast.
[16:56:28] ta: has joined #ruby
[16:56:54] devyn: has joined #ruby
[16:57:10] apeiros: ok, I guess maximum string length in ruby is LONG_MAX
[16:57:17] maloik_: has joined #ruby
[16:57:55] asmodlol: has joined #ruby
[16:59:43] Ishido: has joined #ruby
[17:00:16] apeiros: havenwood: does rvm use your precompiled ruby by any chance?
[17:00:41] moeabdol: has joined #ruby
[17:00:52] apeiros: require 'rbconfig'; RbConfig::CONFIG["configure_args"] # => " '--prefix=/Users/haven/.rvm/rubies/ruby-2.2.3'???
[17:01:07] shevy: >> RbConfig::CONFIG["configure_args"]
[17:01:08] ruboto: shevy # => " '--prefix=/execpad/interpreters/ruby-2.2.0' '--disable-install-doc'" (https://eval.in/481733)
[17:01:15] shevy: apeiros! you did a require!!!
[17:01:33] apeiros: shevy: that's special because????
[17:01:40] shevy: it works without :)
[17:02:16] apeiros: yeah, I'm ancient. it didn't work without in olden times???
[17:02:18] hobodave_: has joined #ruby
[17:02:20] darix: apeiros: tbh ... sha256 is fast enough. ;)
[17:02:22] apeiros: I noticed because of "LDFLAGS"=>"-L. -L/Users/haven/.sm/pkg/active/lib
[17:02:29] apeiros: darix: nothing is ever fast enough!
[17:02:38] apeiros: I'm 3 times faster than fast enough!!!!!!!!1!elf!
[17:02:47] adaedra: No, but there are things that are too fast.
[17:02:56] devyn: has joined #ruby
[17:03:01] darix: apeiros: that's only because you are bending space and time. ;)
[17:03:09] ruby-lang866: has joined #ruby
[17:03:14] synthroid: has joined #ruby
[17:03:21] ruby-lang352: has joined #ruby
[17:03:58] orion: has left #ruby: ()
[17:04:30] underplank: has joined #ruby
[17:05:04] shevy: are you two the same
[17:05:09] supermarin: has joined #ruby
[17:05:37] apeiros: darix: that's not against the rules! (if you bend those too???)
[17:06:30] ruby-lang866: hu me not same
[17:06:43] SCHAAP137: has joined #ruby
[17:06:44] devbug: has joined #ruby
[17:07:43] devyn: has joined #ruby
[17:08:51] moeabdol: has joined #ruby
[17:09:33] baroquebobcat: has joined #ruby
[17:10:49] nixmaniack: has joined #ruby
[17:10:50] nixmaniack: has joined #ruby
[17:10:53] akem: has joined #ruby
[17:11:00] baweaver: has joined #ruby
[17:12:20] pietr0: has joined #ruby
[17:12:50] c355E3B: has joined #ruby
[17:13:16] govg: has joined #ruby
[17:15:00] saddad: has joined #ruby
[17:19:49] underplank: has joined #ruby
[17:20:26] supermarin: has joined #ruby
[17:20:47] djbkd: has joined #ruby
[17:22:15] mostlybadfly: has joined #ruby
[17:24:08] skade: has joined #ruby
[17:24:29] cdg: has joined #ruby
[17:25:57] devbug: has joined #ruby
[17:27:10] B1n4r10: has joined #ruby
[17:27:22] nerium: has joined #ruby
[17:28:09] snockerton: has joined #ruby
[17:28:15] centrx: has joined #ruby
[17:28:34] bronson: has joined #ruby
[17:28:51] nibbo: has joined #ruby
[17:29:45] joliss: has joined #ruby
[17:29:54] axl_: has joined #ruby
[17:31:35] cats: has joined #ruby
[17:32:07] Macaveli: has joined #ruby
[17:35:32] ogpastaling: has joined #ruby
[17:35:54] yalue: has joined #ruby
[17:36:39] nofxx: has joined #ruby
[17:36:39] nofxx: has joined #ruby
[17:36:48] nixmaniack: has joined #ruby
[17:37:17] sepp2k: has joined #ruby
[17:43:29] mary5030: has joined #ruby
[17:43:34] mary5030_: has joined #ruby
[17:43:49] eljimmy: has joined #ruby
[17:43:53] kirun: has joined #ruby
[17:44:12] supermarin: has joined #ruby
[17:44:47] supermarin: has joined #ruby
[17:45:25] yokel: has joined #ruby
[17:45:43] jpfuentes2: has joined #ruby
[17:47:05] bronson: has joined #ruby
[17:47:52] supermarin: has joined #ruby
[17:47:55] jbrhbr: has joined #ruby
[17:48:58] duckpuppy: has joined #ruby
[17:49:53] Encapsulation: has joined #ruby
[17:50:40] TDJACR: has joined #ruby
[17:50:43] zast: has joined #ruby
[17:51:56] nixmaniack: has joined #ruby
[17:52:16] Caius: has joined #ruby
[17:52:21] j2p2test: has joined #ruby
[17:52:41] SenpaiSilver: has joined #ruby
[17:52:54] bap1313: has joined #ruby
[17:55:43] amit__: dear folks: i am a bit stuck here: end_date = "November 8th 2015, 18:35:31.000"; and here is equivalent parse DateTime command yd = DateTime._strptime(end_date,"%B %d?th? %Y, %H:%M:%S??offset??")
[17:56:02] karapetyan: has joined #ruby
[17:56:19] amit__: what i am missing is how to capture 8(th) the th in the 8th and the offset time after the seconds?
[17:57:21] jpfuentes2: has joined #ruby
[17:57:34] christiandsg: has joined #ruby
[17:59:00] snowy: has joined #ruby
[18:00:33] nixmaniack: has joined #ruby
[18:01:00] pdoherty: has joined #ruby
[18:01:38] lxsameer: has joined #ruby
[18:01:55] lxsameer: has joined #ruby
[18:02:03] colleenmcguckin: has joined #ruby
[18:02:45] howdoicomputer: has joined #ruby
[18:03:39] berserk_ren: has joined #ruby
[18:03:45] baweaver: has joined #ruby
[18:04:44] dotix: has joined #ruby
[18:04:45] dotix: has joined #ruby
[18:04:58] yardenbar: has joined #ruby
[18:05:22] allcentury: has joined #ruby
[18:06:06] apeiros: fascinating. there doesn't seem to be a format which includes the ordinal suffix.
[18:06:46] allcentury: how do I execute ruby in here [again] ?
[18:07:29] n1x: has joined #ruby
[18:07:35] zarubin: has joined #ruby
[18:08:23] apeiros: >> 1+1 # but don't use it for experiments
[18:08:24] ruboto: apeiros # => 2 (https://eval.in/481749)
[18:08:35] snowy: has joined #ruby
[18:09:00] baweaver: has joined #ruby
[18:09:54] allcentury: I won't, can anyone explain to me why #match returns duplicate MatchData results, as an example:
[18:10:44] allcentury: >> str = "mystring123"; matches = str.match(/(mystring)/); puts matches; matches[0] == matches[1]
[18:10:45] ruboto: allcentury # => mystring ...check link for more (https://eval.in/481751)
[18:10:53] apeiros: amit__: ok, the solutions with ordinals are sufficiently ugly that I'd say go with DateTime.parse
[18:11:10] jessemcgilallen: has joined #ruby
[18:11:18] apeiros: allcentury: your full match is identical to your first capturing group
[18:11:32] apeiros: and matches[0] returns the full match, matches[1] returns the first capturing group
[18:11:51] apeiros: &ri MatchData#[] @allcentury
[18:11:52] `derpy: method `MatchData#[]`: Match Reference -- MatchData acts as an array, and may be accessed using the nor??? ??? http://rubydoc.info/stdlib/core/MatchData#%5B%5D-instance_method
[18:11:55] barhum2013: has joined #ruby
[18:12:22] apeiros: allcentury: in general it's a *capital* idea to just go and read the docs when stuff does not behave the way you expected it.
[18:12:42] allcentury: thanks apeiros that makes sense
[18:14:16] apeiros: the remaining question of course is why on earth you have a capturing group which spans the full expression.
[18:14:22] kriskropd: has joined #ruby
[18:14:47] jgt1: has joined #ruby
[18:15:43] sucks: has joined #ruby
[18:16:42] sucks: has joined #ruby
[18:17:30] zarubin: has joined #ruby
[18:17:37] podman: has joined #ruby
[18:17:54] baweaver: has joined #ruby
[18:18:39] hardlin3r: has joined #ruby
[18:19:09] hardlin3r: where is rails channel?
[18:19:16] apeiros: hardlin3r: seriously?
[18:19:18] ruboto: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[18:19:40] apeiros: #ror, #rails, #rubyonrails - and it's mentioned on rubyonrails.org
[18:19:40] hardlin3r: apeiros, thx
[18:19:47] spider-mario: has joined #ruby
[18:19:54] apeiros: ACTION redirects the thanks to drbrain, I suppose???
[18:20:12] hardlin3r: drbrain, yo
[18:20:40] apeiros: ACTION now wonders whether #ruby_on_rails also redirects???
[18:21:48] brunto: has joined #ruby
[18:21:59] EthanAllen: has joined #ruby
[18:22:14] EthanAllen: what is the best way to convince people at work to bring your dog?
[18:23:52] supermarin: has joined #ruby
[18:24:01] j2p2test: work from home
[18:24:33] IrishGringo: has joined #ruby
[18:24:39] hahuang65: has joined #ruby
[18:25:08] EthanAllen: I would like to bring Nigger to work with me. I feel bad that he stays home every day.
[18:25:50] drbrain: !ban EthanAllen !P
[18:25:56] ChanServ: +b EthanAllen!*@*
[18:25:56] ChanServ: ChanServ kicked EthanAllen: is banned from this channel
[18:26:04] moeabdol: has joined #ruby
[18:26:52] djbkd: has joined #ruby
[18:27:08] nixmaniack: has joined #ruby
[18:27:17] belak: has joined #ruby
[18:27:31] mfqr: Confused !P for :P.
[18:28:29] drbrain: similar sentiment
[18:28:58] apeiros: stupid troll is stupid.
[18:29:57] devoldmx: has joined #ruby
[18:30:45] hardlin3r: is ruby dying?
[18:30:58] apeiros: are you a troll?
[18:31:33] hardlin3r: just asking
[18:31:44] apeiros: ok. no. ruby isn't dying. happy now?
[18:31:47] dlitvak: has joined #ruby
[18:31:55] hardlin3r: should i trust you?
[18:32:05] apeiros: I dunno, should I trust you not being a troll?
[18:32:19] hardlin3r: i dunno, how can i prove you?
[18:32:21] lemur: has joined #ruby
[18:32:41] hardlin3r: i know "autovivification" word
[18:33:07] hardlin3r: but it doesnt prove that im not a troll
[18:33:53] apeiros: hardlin3r: define what "a language is dying" means, find numbers for those metrics, figure out yourself. you can't trust anybody in here. we're all biased.
[18:34:54] apeiros: (but then again - why'd you trust those "sources" for your numbers in the internet???)
[18:35:44] hardlin3r: you are right, i cant trust anybody
[18:36:35] jas02: has joined #ruby
[18:36:45] apeiros: which then bears the question: why did you ask in the first place? an answer you can't trust is meaningless???
[18:40:09] drbrain: we're all dying slowly, and so will all we've built
[18:40:12] drbrain: so all languages are dying
[18:41:10] dman777_alter: has joined #ruby
[18:41:21] edwinvdgraaf: has joined #ruby
[18:41:47] RegulationD: has joined #ruby
[18:42:04] qhartman: has joined #ruby
[18:43:42] anisha: has joined #ruby
[18:44:09] yardenbar: has joined #ruby
[18:44:35] amit__: apeiros: that is interesting that it does not include "ordinal suffix" interesting term. Can you please help me make sense if this is right? start_date = "November 7th 2015, 16:35:31.000"; end_date = "November 8th 2015, 18:35:31.000"; (DateTime.parse(end_date)- DateTime.parse(start_date)) / 60
[18:44:56] amit__: apeiros: result of that is => Rational(13, 720) which I cannot make sense out of
[18:45:45] babblebre: has joined #ruby
[18:45:50] dman777_alter: can you do a assignment with a or operation? foo = bob[apple] or foobar
[18:46:09] myztic: has joined #ruby
[18:46:15] hobodave: has joined #ruby
[18:46:29] karapetyan: has joined #ruby
[18:46:30] toretore: >> bar = false; baz = true; foo = bar or baz; foo
[18:46:31] ruboto: toretore # => false (https://eval.in/481797)
[18:46:44] dman777_alter: toretore: thanks
[18:46:49] toretore: >> bar = false; baz = true; foo = bar || baz; foo
[18:46:50] ruboto: toretore # => true (https://eval.in/481798)
[18:46:56] toretore: answer: use ||
[18:47:19] yqt: has joined #ruby
[18:47:52] Mon_Ouie: amit__: DateTime#- works in terms of days. You are dividing an amount of days by 60.
[18:48:55] codelurker: has joined #ruby
[18:49:17] pyoor: has joined #ruby
[18:49:31] toretore: just use Time
[18:49:32] pyoor: Hi all. Is there any built-in methods for getting the cpu usage of a process under windows?
[18:49:44] pyoor: /method/module/
[18:49:59] amit__: Mon_Ouie: (Time.parse(end_date)- Time.parse(start_date)) then yields me => 93600.0 what is this number?
[18:50:32] karapetyan: has joined #ruby
[18:51:00] amit__: Mon_Ouie: never mind that was Time vs DateTime
[18:51:05] Mon_Ouie: Time#- with a Time argument returns the difference in seconds
[18:51:13] Mon_Ouie: Date#- and DateTime#- return difference in days
[18:51:41] amit__: Mon_Ouie: DateTime# yields me Rational(13, 12) which basically means it is 13 hours ahead of UTC right?
[18:52:19] fantazo: has joined #ruby
[18:52:52] dmolina: has joined #ruby
[18:54:15] Mon_Ouie: 13/12 days = 26/24 days, which is 1 day and 2 hours
[18:54:20] j2p2test: pyoor: nothing built in but this looks promising - https://github.com/schneems/get_process_mem
[18:54:36] s00pcan: has joined #ruby
[18:55:10] amit__: Mon_Ouie: hmm mystery solved that makes sense now thank you!!
[18:55:59] aryaching: has joined #ruby
[18:56:18] freerobby: has joined #ruby
[18:57:25] fmcgeough: has joined #ruby
[18:57:29] shanemcd: has joined #ruby
[18:58:22] myztic: has joined #ruby
[18:59:54] nixmaniack: has joined #ruby
[19:00:01] DenSchub: has joined #ruby
[19:00:15] dhollinger: has joined #ruby
[19:00:19] freerobby: has joined #ruby
[19:01:34] dlitvak: has joined #ruby
[19:01:40] beast_: has joined #ruby
[19:04:17] stannard: has joined #ruby
[19:05:22] duckpuppy: has joined #ruby
[19:07:01] jbrhbr: has joined #ruby
[19:07:01] belak: has joined #ruby
[19:07:29] karapetyan: has joined #ruby
[19:07:56] malconis: has joined #ruby
[19:10:24] karapetyan: has joined #ruby
[19:11:01] lapide_viridi: has joined #ruby
[19:11:11] thiagofm: has joined #ruby
[19:13:20] blackmesa: has joined #ruby
[19:13:24] Ad-ever: has joined #ruby
[19:13:47] Ad-ever: http://synflood.at/mirrors/goatse.cx/hello.jpg
[19:13:50] beast_: has joined #ruby
[19:13:51] baweaver: has joined #ruby
[19:14:01] nhhagen: has joined #ruby
[19:14:02] Ad-ever: http://synflood.at/mirrors/goatse.cx/hello.jpg
[19:14:06] Ad-ever: ) F r ; { g i 3 h / [ K f ` E / K ~ * ? b J + W | O k 7 r - o B o O : Q f $ ` | A n [
[19:14:11] Ad-ever: Z l P v ( T @ {
[19:14:12] Ad-ever: I > w V u , g D n 9 g e R T # ) \ V 3 L w Z t & C E i y G Y N y v D g * q k 3 i 9 0 % v
[19:14:12] Ad-ever: o I ; Z P ! * Y |
[19:14:15] Ad-ever: y Q D L g $ n N L W N A j O T @ ^ ] / ( ; = w _ a ~ ^ < H , _ U 3 @ ~ ] w @ n Y ` ] :
[19:14:15] ruboto: +q Ad-ever!*@*
[19:14:15] ruboto: -o ruboto
[19:14:23] Ad-ever: has left #ruby: ()
[19:14:27] Adever: has joined #ruby
[19:14:34] Adever: i think this excited...... GENITAL WARTS! maybe. it is sacd. i think this a game - NFL just this a joke
[19:14:36] Adever: you do you and he who's 23 and is gettingle one partied forbin shit. what does the korn blair witch end old. no then your peace. Raise you so each for preside of 23 and the walk I talking dealing a guy donkey it? i have carpet. if i want pho. Why you run off? he's just invitation. Hi. o god. 23 year olds them like your peace. its too as pressure during with woman right noodle you're talking a
[19:14:38] Adever: I won't think and is over $380 miles from spot in human off a French of random rap on the for married
[19:14:39] Adever: http://synflood.at/mirrors/goatse.cx/hello.jpg
[19:14:40] Adever: good girl. by the basektball album. its ok. 1187songs, 12hrs downloading them sucked to kickin my teeth. spit is been has born
[19:14:40] ruboto: +q Adever!*@*
[19:14:40] ruboto: -o ruboto
[19:15:09] ChanServ: +o havenwood
[19:15:29] adaedra: I turn my eyes away for a second and this happens
[19:15:47] dionysus69: has joined #ruby
[19:17:21] barhum2013: has joined #ruby
[19:17:28] shanemcd: has joined #ruby
[19:18:38] havenwood: +b *!*@122.155.138.106
[19:19:17] drbrain: if only we could forever be free
[19:19:19] houhoulis: has joined #ruby
[19:19:20] adaedra: Notice: If you're backloging right now and quick to click links, be very careful.
[19:19:46] drbrain: don't click anything from synflood.at
[19:20:00] nixmaniack: has joined #ruby
[19:20:06] eam: I mean, it's just hello.jpg right
[19:20:18] eam: probably the most famous image on the internet
[19:20:36] eam: (I didn't click, I'm assuming from the url)
[19:20:39] adaedra: Doesn't mean everyone knows it.
[19:20:41] Mon_Ouie: I would be wary of urls that contain the word "goatse"
[19:20:58] adaedra: And we still aren't unable to unsee.
[19:21:45] adaedra: But that was more for people like me who sometimes click and read the link afterwards
[19:21:47] eam: there are kids old enough to program ruby who weren't yet born when goatse was taken down
[19:21:52] eam: kinda crazy
[19:22:06] zotherstupidguy: how i can run code after `system command` is finished?
[19:22:20] koneko: has joined #ruby
[19:22:26] eam: zotherstupidguy: just put it on the next line. system() returns
[19:22:41] zotherstupidguy: i am not using system() i am using ` `
[19:22:44] zeroDivisible: has joined #ruby
[19:23:02] eam: ok, well, same answer. both system() and backticks block while the subprocess runs
[19:23:49] zotherstupidguy: eam it is not working for me!
[19:23:58] eam: zotherstupidguy: care to share code so we can dig in together?
[19:24:09] djbkd_: has joined #ruby
[19:25:14] amclain: has joined #ruby
[19:25:24] Ox0dea: Wow, it looks like they plan to go ahead and make Strings frozen by default for 2.3.
[19:25:37] Ox0dea: +'foo' for mutable ones. :<
[19:25:51] jbrhbr: works for me ;)
[19:26:17] toretore: i don't get it.. mutable strings aren't really a big source of problems
[19:26:37] duckpuppy: has joined #ruby
[19:27:04] DoubleMalt: has joined #ruby
[19:27:32] Ox0dea: Mutability in general is, to be fair.
[19:27:35] zotherstupidguy: actually `echo 'waait'` doesnt work for me :)
[19:28:10] toretore: zotherstupidguy, gist all your code, then explain what "doesn't work" means exactly
[19:28:12] Ox0dea: zotherstupidguy: Why are you happy about that?
[19:28:15] eam: zotherstupidguy: we need code along with a description of what you see it doing, and what you expect it to do (what does "work" mean?)
[19:28:17] adaedra: Yep, got bitten by it recentrly.
[19:28:59] shevy: zotherstupidguy can be a long command, it returns until it is finished
[19:29:54] shevy: zotherstupidguy I have that via running long `./configure` things such as for ffmpeg
[19:30:27] jhass: >> require "openssl"; OpenSSL::SSL::SSLSocket.instance_method(:hostname=).source_location # Ox0dea want to solve this puzzle for me?
[19:30:28] ruboto: jhass # => nil (https://eval.in/481838)
[19:30:37] zotherstupidguy: https://gist.github.com/zotherstupidguy/825ea4f5193645fdfa3a
[19:30:48] Ox0dea: jhass: It's defined in C?
[19:31:20] jhass: Ox0dea: https://github.com/ruby/ruby/blob/trunk/ext/openssl/lib/openssl/ssl.rb#L256
[19:31:22] shevy: zotherstupidguy, returns # => "wait\n" for me
[19:32:03] toretore: zotherstupidguy, are you expecting it to print "wait" to YOUR stdout?
[19:32:12] eam: jhass: works for me, does eval.in perhaps not have ExtConfig::HAVE_TLSEXT_HOST_NAME?
[19:32:15] eam: >> ExtConfig::HAVE_TLSEXT_HOST_NAME
[19:32:16] ruboto: eam # => uninitialized constant ExtConfig (NameError) ...check link for more (https://eval.in/481839)
[19:32:25] Ox0dea: jhass: Aye, works here as well.
[19:32:26] jhass: eam: I get it locally too
[19:32:33] eam: jhass: I do not!
[19:32:44] jessemcgilallen: has joined #ruby
[19:32:59] toretore: zotherstupidguy, #` ??? String: Returns the standard output of running cmd in a subshell
[19:33:18] eam: jhass: mmmm, I get nil on linux
[19:33:22] baweaver: has joined #ruby
[19:33:40] toretore: that is, stdout is different, and whatever it written to it is the return value of the statement
[19:33:48] jackjackdripper: has joined #ruby
[19:33:54] toretore: puts(`echo hello`)
[19:34:14] zotherstupidguy: toretore what the ri of of #` ?
[19:34:14] jhass: eam: so they override it in C on just linux or something? ugh
[19:34:24] toretore: zotherstupidguy, Kernel
[19:34:35] Ox0dea: jhass: I don't get `nil` and I'm on Arch.
[19:34:35] zotherstupidguy: toretore thanks
[19:34:49] Ox0dea: I think it might be to do with your slightly unorthodox setup?
[19:34:55] jhass: Ox0dea: wat
[19:35:03] ap4y: has joined #ruby
[19:35:16] jhass: shouldn't be even active for that pry
[19:35:29] jhass: let's run a few more experiments
[19:36:08] rakm: has joined #ruby
[19:36:22] Ox0dea: ~ $ uname -a && ruby -e 'require "openssl"; p OpenSSL::SSL::SSLSocket.instance_method(:hostname=).source_location'
[19:36:24] Ox0dea: Linux 0x0 4.3.0-1-ARCH #1 SMP PREEMPT Mon Nov 2 16:52:35 CET 2015 x86_64 GNU/Linux
[19:36:26] Ox0dea: ["/home/dea/.rubies/ruby-trunk/lib/ruby/2.3.0/openssl/ssl.rb", 256]
[19:36:37] eam: I don't see ExtConfig anywhere
[19:37:04] jhass: Ox0dea: heh, so you do use a custom ruby and not the package
[19:37:19] Ox0dea: Oh, sorry.
[19:37:22] jhass: I only have packaged rubies
[19:37:39] Gnut: has joined #ruby
[19:37:44] Ox0dea: Yeah, `nil` on 2.2.3.
[19:37:45] Cohedrin: has joined #ruby
[19:37:49] Ox0dea: Upgrade? :P
[19:38:08] jhass: I'd built a package and I bet it would get nil again :P
[19:38:28] jhass: all my rubies return nil
[19:39:03] ta: has joined #ruby
[19:39:14] jhass: maybe they changed it for 2.3? didn't look yet
[19:39:15] eam: my rvm'd rubies on centos return nil, my rvm'd rubies on osx return values
[19:39:30] nixmaniack: has joined #ruby
[19:40:32] ur5us: has joined #ruby
[19:40:40] jhass: so I guess it's openssl version or something?
[19:40:44] yardenbar: has joined #ruby
[19:41:03] KensoDev: has joined #ruby
[19:41:37] NeverDie_: has joined #ruby
[19:42:04] jhass: https://github.com/ruby/ruby/blob/ruby_2_2/ext/openssl/lib/openssl/ssl.rb#L220 it's not there in 2.2 ... eam how do your OS X rubies < 2.3 return a value at all?
[19:42:26] drbrain: have_macro("SSL_set_tlsext_host_name", ['openssl/ssl.h']) && $defs.push("-DHAVE_SSL_SET_TLSEXT_HOST_NAME")
[19:42:32] tomchapin: has joined #ruby
[19:43:08] drbrain: https://github.com/ruby/ruby/blob/trunk/ext/openssl/lib/openssl/ssl.rb#L255-L257
[19:43:45] jhass: drbrain: yes, but not present in the 2.2 branch?
[19:44:26] drbrain: doesn't seem to be
[19:45:07] jhass: method exists though, I wondered why its #source_location is nil while it's defined in Ruby
[19:45:24] jhass: didn't look at the 2.2 branch there yet
[19:45:35] roshanavand: has joined #ruby
[19:45:37] jhass: now eam says #source_location returns a value for him on OS X regardless of Ruby version?
[19:45:40] drbrain: extconf.rb has the check in 2.2.3
[19:45:40] Ox0dea: It's gotta be that you've got a C method, no?
[19:45:46] drbrain: ??? yes???
[19:46:11] jhass: and in 2.3 they override the C definition or moved it?
[19:46:26] drbrain: https://github.com/ruby/ruby/blob/v2_2_3/ext/openssl/ossl_ssl.c#L101-L106 and https://github.com/ruby/ruby/blob/v2_2_3/ext/openssl/ossl_ssl.c#L2216-L2217
[19:46:27] christiandsg: has joined #ruby
[19:48:50] saddad: has joined #ruby
[19:49:46] drbrain: In 2.3 the definition was moved to ruby
[19:50:37] colleenmcguckin: has joined #ruby
[19:51:06] sh4d0wD: has joined #ruby
[19:51:18] cwong_on_irc: has joined #ruby
[19:53:43] shanemcd: has joined #ruby
[19:54:13] towski_: has joined #ruby
[19:54:14] aryaching: has joined #ruby
[19:55:50] ascarter: has joined #ruby
[19:56:09] duckpuppy: has joined #ruby
[19:56:36] blackmesa: has joined #ruby
[19:56:54] KensoDev_: has joined #ruby
[20:00:37] timonv: has joined #ruby
[20:00:58] Regulati_: has joined #ruby
[20:02:33] kfpratt: has joined #ruby
[20:03:18] thiagofm: has joined #ruby
[20:03:22] berserk_ren: has joined #ruby
[20:05:26] n1x: has joined #ruby
[20:05:59] yfeldblum: has joined #ruby
[20:06:02] DoubleMalt: has joined #ruby
[20:06:33] iamnix: has joined #ruby
[20:07:35] DoubleMalt: has joined #ruby
[20:07:40] kadoppe: has joined #ruby
[20:07:50] dlitvak: has joined #ruby
[20:08:49] shanemcd: has joined #ruby
[20:09:52] speaking1ode: has joined #ruby
[20:11:27] dionysus69: has joined #ruby
[20:16:33] stannard: has joined #ruby
[20:16:46] Ox0dea: xybre Ox0dea: because :: also works on methods which are not consts
[20:17:02] speaking1ode: has joined #ruby
[20:17:05] Ox0dea: Fair, but then why couldn't `.` be an "operator" that delegates to #public_send?
[20:18:04] teoric: has joined #ruby
[20:18:19] imperator: has joined #ruby
[20:18:34] Cork: Anyone know how to handle stderr and stdin with Shell?
[20:19:18] Ox0dea: Cork: Haven't you already been advised to use a better tool?
[20:19:52] Cork: no, i've been told to read the source...
[20:21:17] gusrub: has joined #ruby
[20:21:31] thiagofm: has joined #ruby
[20:21:49] sandstrom: has joined #ruby
[20:22:56] ruby-lang171: has joined #ruby
[20:23:05] havenwood: ruby-lang171: hi
[20:23:13] ruby-lang171: i have a question about IT
[20:23:19] havenwood: ruby-lang171: Ruby-related?
[20:23:23] ruby-lang171: is it possible to make the same wage as someone with a diploma
[20:23:31] ruby-lang171: career question
[20:23:34] ChanServ: -o havenwood
[20:23:46] Ox0dea: ruby-lang171: https://reddit.com/r/cscareerquestions
[20:24:27] ruby-lang171: should i ask a questino there
[20:24:34] shevy: we love questinos
[20:24:36] shevy: also padrinos
[20:24:46] havenwood: ruby-lang171: Or there's the #ruby-offtopic as well.
[20:25:48] djbkd: has joined #ruby
[20:27:28] drbernardi: has joined #ruby
[20:27:39] Azulinho: has joined #ruby
[20:28:04] nixmaniack: has joined #ruby
[20:28:46] joonty: has joined #ruby
[20:29:28] yardenbar: has joined #ruby
[20:29:39] drbernardi: has joined #ruby
[20:30:39] devoldmx: has joined #ruby
[20:30:48] shanemcd: has joined #ruby
[20:32:15] sucks: has joined #ruby
[20:34:08] brunto: has joined #ruby
[20:35:19] berserk_ren: has joined #ruby
[20:38:12] ruby-lang171: has left #ruby: ()
[20:39:04] jetpackjoe: has joined #ruby
[20:39:54] nixmaniack: has joined #ruby
[20:41:03] shanemcd: has joined #ruby
[20:41:37] n_blownapart: has joined #ruby
[20:42:44] nettoweb: has joined #ruby
[20:43:08] atomical: has joined #ruby
[20:43:22] ruby-lang359: has joined #ruby
[20:43:37] ruby-lang359: what is the offtopic channel again
[20:43:42] ruboto: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[20:44:23] dfockler: has joined #ruby
[20:44:34] tomchapin: has joined #ruby
[20:46:52] jetpackjoe: has joined #ruby
[20:46:59] OrbitalKitten: has joined #ruby
[20:47:04] weemsledeux: has joined #ruby
[20:49:22] underplank: has joined #ruby
[20:51:15] shanemcd: has joined #ruby
[20:51:23] berserk_ren: has joined #ruby
[20:51:32] axl__: has joined #ruby
[20:53:08] skweek: has joined #ruby
[20:53:10] n1x: has joined #ruby
[20:55:12] baweaver: has joined #ruby
[20:55:16] Gnut_: has joined #ruby
[20:56:21] dlitvak_: has joined #ruby
[20:56:37] bronson: has joined #ruby
[20:56:46] supermar_: has joined #ruby
[20:57:25] supermar_: has joined #ruby
[20:58:51] gusrub: has joined #ruby
[20:59:04] djbkd: has joined #ruby
[21:03:25] nixmaniack: has joined #ruby
[21:03:56] s00pcan: has joined #ruby
[21:04:16] nixmaniack: has joined #ruby
[21:05:25] hahuang65: has joined #ruby
[21:05:34] supermarin: has joined #ruby
[21:06:30] radgeRayden_: has joined #ruby
[21:07:04] tildes: has joined #ruby
[21:08:08] minimalism: has joined #ruby
[21:09:45] unreal: has joined #ruby
[21:10:20] vikas027: has joined #ruby
[21:10:58] shevy: hmm... perl is weird to configure from sources: sh Configure -des -Dprefix=/usr -Dvendorprefix=/usr ... via python or ruby, I can use the default ./configure --prefix=/usr
[21:11:19] shanemcd: has joined #ruby
[21:11:40] adaedra: ?offtopic shevy
[21:11:40] ruboto: shevy, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[21:13:17] shevy: ?spam adaedra
[21:13:17] ruboto: adaedra, I don't know anything about spam
[21:13:25] supermarin: has joined #ruby
[21:14:01] n1x: has joined #ruby
[21:14:53] nateberkopec: has joined #ruby
[21:15:30] skweek: has joined #ruby
[21:15:52] ascarter: has joined #ruby
[21:16:11] hadees: has joined #ruby
[21:16:16] yardenbar: has joined #ruby
[21:17:05] quazimodo: has joined #ruby
[21:17:06] hadees: How do you pipe in the contents of a file to a rake task? I want to write a rake task that'll run on heroku but use local data so I was thinking of something like heroku run rake foobar < test.csv
[21:17:42] adaedra: And that doesn't work?
[21:18:09] adaedra: Ah wait, `heroku` is a command to run things remotely, isn't it?
[21:18:16] prestorium: has joined #ruby
[21:18:24] hadees: adaedra: yeah so it needs to get piped in
[21:18:39] hadees: it doesn't even work locally or rather I can't figure out how to read in the file line by line
[21:18:44] adaedra: The file is on your local computer or distant one?
[21:18:53] hadees: adaedra: local
[21:19:39] hadees: adaedra: it also isn't actually a csv file, it's a weird formated file with json on each line
[21:19:55] hadees: i justed used csv as an example since I figured it would be easier to understand
[21:20:11] adaedra: I don't know heroku, you'll have to look at the heroku command if you can do that
[21:20:15] ikeie: has joined #ruby
[21:20:25] hadees: adaedra: how would you do it locally?
[21:20:33] ikeie: http://synflood.at/mirrors/goatse.cx/hello.jpg
[21:20:34] hadees: it should work the same
[21:20:45] adaedra: rake foobar < test.csv
[21:20:45] ikeie: http://synflood.at/mirrors/goatse.cx/hello.jpg
[21:20:53] ruboto: +q ikeie!*@*
[21:20:53] ruboto: -o ruboto
[21:21:04] adaedra: let me just take care of that
[21:21:13] adaedra: and don't open links
[21:21:16] hadees: adaedra: what command would read the file in like that in ruby?
[21:21:38] adaedra: !ban ikeie !P Spam
[21:21:42] ChanServ: +b ikeie!*@*
[21:21:42] ChanServ: ChanServ kicked ikeie: Spam
[21:21:45] hadees: adaedra: is there a way to make it look like a file object?
[21:21:51] ruboto: -q ikeie!*@*
[21:21:51] ruboto: -o ruboto
[21:22:00] atomical_: has joined #ruby
[21:22:06] adaedra: hadees: you'd have to have the file on distant machine.
[21:22:22] adaedra: I think the heroko command just runs the file remotely, it won't redirect the input
[21:22:33] adaedra: But I can only make suppositions
[21:22:54] hadees: maybe, i though it would pipe it through
[21:23:09] roshanavand: has joined #ruby
[21:23:39] hadees: adaedra: it looks like heroku should support it, what would the ruby look like
[21:23:44] hadees: for it locally?
[21:23:53] SleepySensei: has joined #ruby
[21:23:56] hadees: adaedra: ARGF?
[21:24:03] adaedra: hadees: the problem is the transmission of the file to the remote.
[21:24:19] adaedra: Do you have just one file to make it read?
[21:24:35] adaedra: You could use DATA
[21:24:37] atomical: has joined #ruby
[21:24:51] waka: has joined #ruby
[21:24:52] hadees: adaedra: yeah just one file
[21:25:07] adaedra: So yeah, putting it in DATA should be ok for running
[21:25:16] freerobby: has joined #ruby
[21:25:17] hadees: oh, at the bottom
[21:25:22] hadees: hmm maybe
[21:25:33] hadees: adaedra: https://github.com/heroku/heroku/pull/811
[21:26:11] djbkd_: has joined #ruby
[21:26:24] adaedra: hadees: mmh, https://github.com/heroku/heroku/issues/256 makes me think it should be working, i don't know
[21:26:31] adaedra: I can't help you much more here
[21:26:47] atomical_: has joined #ruby
[21:26:47] hadees: adaedra: well what I really wanted to make sure is my ruby was right
[21:27:20] hadees: adaedra: https://gist.github.com/hadees/4ca8d5c9f511d0b5fe4d
[21:27:21] someonesusernmae: has joined #ruby
[21:27:30] hadees: that didn't work locally
[21:27:59] adaedra: hadees: this won't work with <, you have to use $stdin or ARGF
[21:28:10] pdoherty: has joined #ruby
[21:28:17] hadees: doh, i thought I was using ARGF
[21:28:20] hadees: that might be the issue
[21:28:37] adaedra: You're using ARGV, which gives you the argument of the command line
[21:28:47] hadees: yeah i just noticed that
[21:30:07] hadees: adaedra: I still can't get ARGF to work
[21:30:27] edwinvdgraaf: has joined #ruby
[21:30:44] hadees: adaedra: https://gist.github.com/hadees/4ca8d5c9f511d0b5fe4d
[21:30:54] dorei: has joined #ruby
[21:31:18] OrbitalKitten: has joined #ruby
[21:31:54] juddey: has joined #ruby
[21:32:35] felixal: has joined #ruby
[21:32:35] nixmaniack: has joined #ruby
[21:33:54] dlitvak: has joined #ruby
[21:34:03] adaedra: hadees: try with $stdin
[21:34:19] adaedra: Seems ARGF is tainted by rake arguments
[21:34:28] Channel6: has joined #ruby
[21:34:51] hadees: adaedra: wooo it works!
[21:34:56] hadees: adaedra: thanks!
[21:35:23] IrishGringo: has joined #ruby
[21:35:42] naftilos76: has joined #ruby
[21:37:56] eam: >> buf = [*?a..?z].join; p=0; size=6; loop { chunk = buf.slice(p, size); puts chunk; break if chunk.length != size; p += size }
[21:37:57] ruboto: eam # => abcdef ...check link for more (https://eval.in/481897)
[21:38:24] eam: is that a good way to step through a byte buffer in fixed length units? could I write that better?
[21:39:06] B1n4r10: has joined #ruby
[21:40:37] barhum2013: has joined #ruby
[21:41:34] helpa: has joined #ruby
[21:43:31] svoop: has joined #ruby
[21:44:20] imperator: has left #ruby: ("Leaving")
[21:44:52] ur5us: has joined #ruby
[21:45:08] lacuna: has joined #ruby
[21:45:08] lacuna: has joined #ruby
[21:46:22] supermarin: has joined #ruby
[21:47:05] bronson: has joined #ruby
[21:48:11] christia1: has joined #ruby
[21:49:43] allcentury: has joined #ruby
[21:50:02] asmodlol: has joined #ruby
[21:51:14] prestorium: has joined #ruby
[21:52:19] platzhirsch: has joined #ruby
[21:53:37] InvGhost: has joined #ruby
[21:54:32] astrostl: has joined #ruby
[21:55:20] Aerillith: has joined #ruby
[21:55:27] sankaber: has joined #ruby
[21:56:26] asmodlol: has joined #ruby
[21:57:37] htmldrum: has joined #ruby
[21:58:22] ramfjord: has joined #ruby
[21:58:26] Bellthoven: has joined #ruby
[22:00:22] ramfjord: sup rubyists - I'm trying to convert database loader script/framework I've been working on to using unix pipes to link together the code that iterates over the data source to the code that inserts the data to the DB
[22:00:42] ramfjord: I've used marshal for serialization in the past, and like it because it's fast and contains all the metadata I could need
[22:00:51] ramfjord: but because it's a binary format, it doesn't have newlines
[22:01:03] ramfjord: I can't process chunks of it at a time
[22:01:21] ramfjord: any recommendations for some other format? Should I just use JSON?
[22:01:49] asmodlol: has joined #ruby
[22:01:50] matrixise: has joined #ruby
[22:02:10] B1n4r10: has joined #ruby
[22:02:11] c355E3B: ramfjord, message pack or proto buf work?
[22:02:15] jeips: has joined #ruby
[22:02:43] ramfjord: c355E3B: I don't want to have to specify the format up front - for a lot of these the structure is inferred from the layout in the database
[22:02:55] ramfjord: only overridden for what differences there are b/n source and db table
[22:03:23] christiandsg: has joined #ruby
[22:03:30] c355E3B: messge pack may work if you dont want to use json then
[22:03:38] c355E3B: http://msgpack.org/index.html
[22:04:20] ramfjord: well, it definitely has IO/streaming unpacking, which is my main requirement
[22:04:28] ramfjord: thanks for the suggestion, I
[22:04:30] ramfjord: 'll take a look
[22:04:50] Anderson69s: has joined #ruby
[22:05:27] finisherr: has joined #ruby
[22:06:44] alexherbo2: has joined #ruby
[22:06:55] zeroDivisible: has joined #ruby
[22:07:28] hxegon: has joined #ruby
[22:07:29] SCHAAP137: has joined #ruby
[22:07:29] nettoweb: has joined #ruby
[22:07:58] hxegon: hey all. Is there a better way to implement multiple ducktype interfaces like this?: https://gist.github.com/anonymous/b32533f1e6f67d78e8bc
[22:08:51] i: has joined #ruby
[22:08:57] shanemcd: has joined #ruby
[22:10:44] supermarin: has joined #ruby
[22:10:49] ramfjord: hxegon: can you provide a little more context? Do you want everything with a #read or #to_a method to have a #csv_to_hash method that uses that?
[22:10:53] colegatron: has joined #ruby
[22:11:05] dlitvak: has joined #ruby
[22:11:14] ramfjord: if so, then using a mixin module will likely be the solution
[22:11:37] prestorium: has joined #ruby
[22:11:39] ramfjord: then instead of re-implementing the method, you would ``include CsvToHash``
[22:11:56] hxegon: ramfjord: good idea, but I'm just talking about a way to do either #read or if that fails with NoMethodError, use #to_a
[22:12:48] underplank: has joined #ruby
[22:12:53] tvw: has joined #ruby
[22:13:30] hxegon: that example works, but it feels like a more idiomatic way should exist
[22:13:33] christia1: has joined #ruby
[22:14:01] ramfjord: hmmm, you could check if csv.respond_to? :read
[22:14:21] ramfjord: eslif csv.respond_to? :to_a
[22:15:20] hxegon: ramfjord: always forget about that
[22:15:35] hxegon: >> ''.respond_to?(:nope) ? ''.nope : ''.to_s
[22:15:37] ruboto: hxegon # => "" (https://eval.in/481913)
[22:16:18] lemur: has joined #ruby
[22:16:33] hxegon: still seems like their should be a better way... :/ guess it will do for now though. Thanks ramfjord
[22:18:59] ramfjord: hxegon: I think the idiomatic way would probably be to define a #csv_to_hash separately on the different base classes that you're using
[22:19:05] jackjackdripper: has joined #ruby
[22:19:53] ramfjord: which I guess would require monkeypatching if you're passing in raw IO objects :/
[22:20:18] ramfjord: though iirc IO#read returns a string, so I'm guessing you're not?
[22:20:54] hxegon: CSV.read returns Array of Arrays, as does CSV::Table#to_a
[22:21:29] jbrhbr: has joined #ruby
[22:21:34] hxegon: picking up someone elses code that blindly #split(',') on string input.
[22:21:51] Rumbles: has joined #ruby
[22:21:52] mary5030: has joined #ruby
[22:22:59] ramfjord: haha, I've definitely been there
[22:23:10] howdoicomputer: has joined #ruby
[22:23:23] ramfjord: I've never ended up using CSV::Table though
[22:23:47] juddey: has joined #ruby
[22:24:03] ramfjord: well, I've always used some kind of headers, so I've expected and Array of Hash format
[22:24:18] hxegon: ramfjord: It's kind of frustrating to use, but way better than any alternative when you need to operate on columns/rows based on headers
[22:24:55] alexherbo2: has joined #ruby
[22:24:59] akem: has joined #ruby
[22:25:21] hxegon: Would it be to bad if I aliased CSV::Table#read to #to_a?
[22:25:47] tomchapin: has joined #ruby
[22:26:34] underplank: has joined #ruby
[22:27:05] hxegon: Actually I'm just going to do that. It's consistent with the way CSV works.
[22:29:16] skade: has joined #ruby
[22:29:27] ramfjord: makes sense
[22:29:30] dwqeqw: has joined #ruby
[22:29:44] ramfjord: could also do csv = csv.to_csv if csv.respond_to?(:to_csv) at the beginning
[22:29:47] ramfjord: or something like that
[22:30:11] ramfjord: but to_a seems like one of those cases where it would be hard to come up with an alternative meaning in the CSV context
[22:30:21] ramfjord: so monkey patching doesn't seem too evil
[22:30:23] dwqeqw: has left #ruby: ()
[22:31:24] yfeldblum: has joined #ruby
[22:31:27] devoldmx: has joined #ruby
[22:31:47] asmodlol: has joined #ruby
[22:34:16] underplank: has joined #ruby
[22:34:49] Coldblackice: has joined #ruby
[22:38:34] rolfb: has joined #ruby
[22:39:29] Musashi007: has joined #ruby
[22:40:59] vF3hNGxc47h8: has joined #ruby
[22:42:02] eam: is this functional? http://ruby-doc.org/core-1.9.3/GC/Profiler.html I'm getting 0.0 from GC::Profiler.total_time and I'm fairly certain I'm exercising the gc
[22:43:37] unreal_: has joined #ruby
[22:44:56] drbrain: >> GC::Profiler.enable; 1_000_000.times { "a".dup.dup.dup.dup }; p GC::Profiler.total_time
[22:44:59] ruboto: drbrain # => (https://eval.in/481919)
[22:45:25] drbrain: >> GC::Profiler.enable; 100_000.times { "a".dup.dup.dup.dup }; GC::Profiler.total_time
[22:45:27] ruboto: drbrain # => 0.02089049499999984 (https://eval.in/481920)
[22:46:09] drbrain: and my computer is 3x faster than ruboto
[22:48:12] iamnix: has joined #ruby
[22:48:18] dorei: >> require 'uri' ; URI::regexp.to_s.size
[22:48:18] phillips1012: has joined #ruby
[22:48:19] ruboto: dorei # => 1459 (https://eval.in/481921)
[22:49:18] eam: yeah hm, that does work - I guess I must just not be hitting the gc at all
[22:50:04] allcentury: has joined #ruby
[22:50:07] pandaant: has joined #ruby
[22:50:37] arooni: has joined #ruby
[22:51:16] drbrain: eam: see also ObjectSpace.count_objects
[22:51:51] freerobby1: has joined #ruby
[22:51:57] eam: I'm trying to debug why this: https://gist.github.com/eam/db9b3e7cd3b42743455b gets slow as it runs. I'm seeing what looks like a linear slowdown as the position advances through the large buf
[22:52:13] eam: there's no gc activity at all it seems
[22:52:17] JDiPierro: has joined #ruby
[22:52:26] ap4y: has joined #ruby
[22:52:38] eam: if I save the value of "pos" and restart the operation with pos = <saved value> the speed of each loop iteration is just as slow
[22:52:56] eam: is slice() O(n) WRT the string size of the source?
[22:53:02] eam: that's very surprising
[22:53:39] eam: 20MB into the file and each slice() operation is taking over 100ms
[22:54:31] KensoDev: has joined #ruby
[22:55:11] devbug: has joined #ruby
[22:55:24] edwinvdg_: has joined #ruby
[22:55:24] drbrain: if you have a UTF-8 string, yes slice becomes O(n)
[22:55:42] eam: ooooooh shoot, is it encoding that's biting me?
[22:55:45] eam: well that's silly
[22:56:13] drbrain: yeah, because a character isn't represented by a fixed number of bytes
[22:56:40] eam: yeah gotcha, I just didn't expect slice to do character ops
[22:57:10] eam: looooool, the entire operation finishes near instantly now that I've switched read for binread
[22:57:13] eam: thanks :)
[22:57:55] NotTheFBI: has joined #ruby
[22:58:05] eam: about 13k iterations in time it was taking to do *one* iteration with character semantics
[22:58:19] eam: which makes sense when the n=55M
[23:00:01] shanemcd: has joined #ruby
[23:03:04] underplank: has joined #ruby
[23:03:39] zeroDivisible: has joined #ruby
[23:05:33] shanemcd: has joined #ruby
[23:05:34] iamnix_: has joined #ruby
[23:06:04] jbrhbr: has joined #ruby
[23:06:26] cajone: has left #ruby: ()
[23:10:17] atomical: has joined #ruby
[23:12:30] m3_del: has joined #ruby
[23:12:38] howdoicomputer: has joined #ruby
[23:13:08] Ropeney: has joined #ruby
[23:13:54] atomical_: has joined #ruby
[23:14:43] floatingpoint: has joined #ruby
[23:15:13] FooMunki: has joined #ruby
[23:15:21] phillips1012: has joined #ruby
[23:15:30] floatingpoint: any thoughts as to why dir.glob("/some/dir/**/*") do |path| .... would hang?
[23:15:46] adaedra: big list of files?
[23:16:08] jessemcgilallen: has joined #ruby
[23:16:13] houhoulis: has joined #ruby
[23:16:37] apeiros: then that. also across filesystems? possibly mounted?
[23:16:48] floatingpoint: yes across mounted fs
[23:17:02] apeiros: s/mounted/remote/, sorry
[23:17:10] eam: floatingpoint: look up 'strace' it will give you a good hint of where time is being spent
[23:17:22] adaedra: floatingpoint: is `find /some/dir` long too?
[23:17:32] diegoviola: has joined #ruby
[23:18:17] floatingpoint: yeah. it's gotta be the NSF mount
[23:18:18] skade: has joined #ruby
[23:18:23] lacuna: has joined #ruby
[23:19:22] eam: Not Fast Storage
[23:20:24] floatingpoint: yeah. this is going to take a while
[23:22:02] mahk: has joined #ruby
[23:23:16] jimmybomb: has joined #ruby
[23:23:39] hakunin: has joined #ruby
[23:24:29] jimmybomb: hey guys, im building a web api, is it okay for one api controller to use multiple services ?, eg ProductController has ProductService and CoffeeService and use them both? or is ths considered as a smell? (is it ok for controller to have some business logic?)
[23:25:04] toretore: ?rails jimmybomb
[23:25:04] ruboto: jimmybomb, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[23:25:21] toretore: (answer is probably yes, it's ok)
[23:25:59] nhhagen: has joined #ruby
[23:26:06] jbrhbr: has joined #ruby
[23:27:06] tomchapin: has joined #ruby
[23:27:58] djbkd_: has joined #ruby
[23:28:33] ascarter: has joined #ruby
[23:28:53] nateberkopec: has joined #ruby
[23:29:51] davedev24: has joined #ruby
[23:29:56] jimmybomb: /msg NickServ VERIFY REGISTER jimmybomb pybzjabeggkr
[23:30:05] platzhirsch: has left #ruby: ()
[23:30:39] jbrhbr: time to change that :)
[23:30:53] jimmybomb: its fine i already registered
[23:32:22] christiandsg: has joined #ruby
[23:33:22] NeverDie: has joined #ruby
[23:36:17] hxegon: all I see is ************
[23:37:13] facereghelp: has joined #ruby
[23:37:40] TheBloke: has joined #ruby
[23:37:44] facereghelp: need some help with some software im trying to figure out/write up.
[23:38:15] facereghelp: i like to write up a facial recognition program, but not in a traditional sense.
[23:38:46] jbrhbr: i also tend to prefer non-traditional faces
[23:39:01] facereghelp: normally, you feed in an image to the program, and it will tell you, this person is X. this person is Y. rather than identify people's face, I want the program to lock that person's face into an instance.
[23:39:01] Tempesta: has joined #ruby
[23:39:29] facereghelp: that way, if this person's face ever shows up again, it'll throw an error saying something like this face is already here.
[23:39:45] shellie_: has joined #ruby
[23:39:48] facereghelp: any ideas/suggestions?
[23:40:11] jbrhbr: ignoring the fact that it's not clear to me what this has to do with ruby, why don't you just resolve it downstream?
[23:40:32] facereghelp: what do you mean?
[23:40:36] jbrhbr: your recognition system outputs the recognized faces no matter what, and your conflict resolution system consumes this info and manages conflicts
[23:40:44] mary5030_: has joined #ruby
[23:40:50] Unicorn|: has joined #ruby
[23:40:59] Coldblackice: has joined #ruby
[23:41:36] facereghelp: I'm afraid I don't understand
[23:41:45] Spami: has joined #ruby
[23:41:45] baweaver: This isn't something that can or should be done in ruby
[23:41:52] facereghelp: http://www.sitepoint.com/detecting-faces-with-ruby-ffi-in-a-nutshell/
[23:41:56] baweaver: I would suggest asking in a Java or C++ channel
[23:43:13] jbrhbr: facereghelp: i'm saying you have two simpler problems, not one weird problem
[23:43:23] exadeci: has joined #ruby
[23:43:24] jbrhbr: you can solve them separately
[23:44:26] TomPeed: has joined #ruby
[23:46:48] CloCkWeRX: has joined #ruby
[23:47:29] bronson: has joined #ruby
[23:47:31] wildlander: has joined #ruby
[23:48:12] wildlander: has joined #ruby
[23:49:07] cmoneylulz: has joined #ruby
[23:50:31] gigetoo: has joined #ruby
[23:51:44] andromedian: has joined #ruby
[23:52:14] mary5030: has joined #ruby
[23:52:46] andromedian: <%= 'results__grid-details-empty' if property.address.blank? %> why this statement works even though the text is on the left of if?
[23:52:50] baweaver: has joined #ruby
[23:53:55] jbrhbr: 'expr1 if expr2' is just valid ruby which evaluates expr1 only if expr2 is true
[23:54:41] andromedian: jbrhbr, thanks for answering is there a link to read more on that?
[23:54:53] Caius: andromedian: because `:return_me if true` is a valid ruby statement, that returns `:return_me`
[23:54:56] ramfjord: similar to the perl idiomatic `expr1 && expr2`
[23:55:09] Caius: Ugh, was scrolled up and didn't see the replies.
[23:55:26] andromedian: Thanks everyone for answering
[23:56:39] underplank: has joined #ruby
[23:57:54] jgt2: has joined #ruby
[23:58:44] D9: has joined #ruby
[23:59:14] kobain: has joined #ruby
[23:59:19] jetpackjoe: has joined #ruby