« Back to channel list

#ruby - 15 January 2016

« Back 1 day Forward 1 day »
[00:00:00] voidDotClass: is there a break stmt?
[00:00:05] Cohedrin: why not use array.find
[00:00:14] Cohedrin: it does it for you
[00:00:16] nfk|laptop: foobar020, fyi, bash already has built-in remote shell, iirc
[00:00:37] foobar020: Sorry I derped
[00:00:42] foobar020: I'm not looking to do code execution
[00:00:44] Cohedrin: but if you must use break, the keyword is `break`
[00:01:22] jbrhbr: has joined #ruby
[00:02:16] bronson: has joined #ruby
[00:02:25] voidDotClass: Cohedrin, array.find will also loop over the whole array and return all matches
[00:02:31] voidDotClass: whereas i want to break on finding the first match
[00:02:34] foobar020: I have code running on a remote machine I admin. I want all the http requests made by that code to be proxied through my local machine, which is behind a restrictive firewall
[00:02:41] Cohedrin: array.find_all will loop over them al
[00:02:47] Cohedrin: array.find will break at the first match
[00:02:49] Cohedrin: read the code
[00:03:01] voidDotClass: so if i wanted to break in each, what would i do for that?
[00:03:09] foobar020: I figured if I start a reverse tunnel from my local machine to the remote machine, I can bypass the firewall my local machine is behind
[00:03:30] Cohedrin: but if you must use break, the keyword is `break`
[00:03:38] foobar020: Forgive me if my terms are off, learning this as i go
[00:03:39] bnagy: foobar020: do you even need an http proxy?
[00:04:17] foobar020: well, I want the http requests being made with my local IP
[00:04:44] foobar020: I can't think of another way to do that
[00:04:53] nfk|laptop: foobar020, tunnel a port?
[00:05:09] nfk|laptop: i'm confident ssh can do whatever you need
[00:05:18] nfk|laptop: presumably either -R or -L will do the trick
[00:05:28] nfk|laptop: you just need to figure out which one you need and then apply it to the right port
[00:05:32] bnagy: if you have inner I and outer O and you do a reverse tunnel from O:12345 to I:80 then why won't that work?
[00:05:51] binaryplease: has joined #ruby
[00:05:57] bnagy: you'll see the request on I coming from O though
[00:06:02] bnagy: because, like, it does
[00:06:59] crime: has joined #ruby
[00:07:38] foobar020: Okay, I'm assuming a lot of my confusion just comes from lack of knowledge of terminology or how to properly use ssh.
[00:07:58] foobar020: I've tried, from local machine, `ssh -R 80:localhost:80 <remote_user>@<remote_ip>
[00:08:15] foobar020: but I get "Warning: remote port forwarding failed for listen port 80"
[00:08:25] foobar020: ...probably because it's already being used
[00:08:28] bnagy: seems likely, yeah
[00:08:31] zambini: foobar020: Something is already bound to port 80
[00:08:33] foobar020: i am not incredibly knowledgable about this
[00:08:39] crime: jhass: https://gist.github.com/wrq/33f52ac5d087cede6af5 I was bored and wrote this, and it does print out a prime every couple seconds. please advise if this is an acceptable solution
[00:08:40] bnagy: also probably perms
[00:08:46] Cohedrin: foodbar020: Why are you trying to do this? This sounds like a problem with the way of going about it
[00:08:59] zambini: foobar020: Can you make your remote go through something besides port 80?
[00:09:20] asthasr_: has joined #ruby
[00:09:25] bnagy: foobar020: I was envisioning O with a webserver on 80 and you want for some requests O to internally use I as a server for those
[00:09:59] bnagy: in which case you want to reverse tunnel O:12345 to I:80 and have O use for those requests
[00:09:59] ramfjord: has joined #ruby
[00:10:39] agent_white: has joined #ruby
[00:10:58] bnagy: so user hits O:80, does something that makes O want to make a req, which it does using the revtunnel and then responds to user with that info
[00:14:31] foobar020: so the server has an app that uses mechanize to parse various info from a secure website
[00:14:42] foobar020: but that secure website is only accessible to the client IP
[00:14:53] fuzzyfuzz: You want an apache proxy?
[00:14:55] foobar020: the client doesn't have the dependencies necessary to run the parser app
[00:15:05] fuzzyfuzz: With a redirect from plain-text to ssl?
[00:15:15] fuzzyfuzz: *clear-text
[00:15:32] jgt1: has joined #ruby
[00:15:51] foobar020: Those are just words to me at this particular moment in time. I'll look into them but right now I don't know if that's what I want
[00:16:16] foobar020: Sorry I'm not coming into this as well-equipped as I'd like
[00:16:23] foobar020: or knowledgable
[00:17:03] nerfando: has joined #ruby
[00:17:06] kies^: has joined #ruby
[00:18:25] zambini: Is port 80 listened to on your remote machine?
[00:18:47] pawnbox: has joined #ruby
[00:19:48] zambini: What about your local machine? It looks like with your current setup it's going to redirect traffic to your local machine:80
[00:20:32] tomchapin: has joined #ruby
[00:20:53] zambini: or, sorry wrong terminology
[00:20:59] foobar020: well that's the idea (I'm pretty sure anyway). so we have A, B, and C. A is local machine, B is remote machine, C is machine only accessible to A's IP
[00:21:12] zambini: It's going to try opening a tunnel to local machine via port 80
[00:21:43] foobar020: A wants to parse output from C, but doesn't have the dependencies necessary to do so. So I want to open C from B, using A's IP
[00:22:23] foobar020: I see where the current command is wrong, I'm trying to figure out how to make it right I guess
[00:22:29] zambini: Okay, cool. Did you run it as sudo? Port 80 is a privileged port
[00:22:50] blackmesa: has joined #ruby
[00:23:14] fuzzyfuzz: Dude, unless this is for academic purposes, you should check out AMQP.
[00:23:34] foobar020: googling it now
[00:23:52] fuzzyfuzz: AMQP runs on both your nodes, you send your request across AMQP to a listener and yoru listener does a thing.
[00:23:57] ascarter: has joined #ruby
[00:24:04] fuzzyfuzz: Check out Ruby's 'bunny' library and RabbitMQ.
[00:24:18] dlitvak: has joined #ruby
[00:24:18] fuzzyfuzz: You're essentially asking how to build an event bus.
[00:24:24] fuzzyfuzz: And that's what AMQP is.
[00:24:47] zambini: In your setup: B says "A, send this to C and tell me what it says" via requests, not via tunneling
[00:25:32] sinkensabe: has joined #ruby
[00:26:16] scottschecter: has joined #ruby
[00:26:43] ascarter_: has joined #ruby
[00:26:44] CloCkWeRX: has joined #ruby
[00:28:10] freerobby: has joined #ruby
[00:29:10] Rodya_: has joined #ruby
[00:29:18] foobar020: so it's looking like what i really want to do
[00:29:30] foobar020: is route requests through A
[00:29:45] foobar020: can i send an entire request object over this protocol?
[00:30:07] jamw: has joined #ruby
[00:30:17] asthasr__: has joined #ruby
[00:30:54] felltir: has joined #ruby
[00:31:43] mclong: has joined #ruby
[00:32:42] janebootydoe: has joined #ruby
[00:33:25] zambini: Instead of sending the received request, you'll send a message with parameters to A from B, asking it to talk to C and respond
[00:34:19] harai54: has joined #ruby
[00:34:30] foobar020: That makes sense
[00:34:38] dlitvak: has joined #ruby
[00:40:43] jackjackdripper: has joined #ruby
[00:41:29] jackjackdripper1: has joined #ruby
[00:43:59] Guest83269: has joined #ruby
[00:44:03] minimalism: has joined #ruby
[00:46:26] Guest83269: how much to clone this site, seedr.cc
[00:46:34] Guest83269: node cloud torrent site
[00:47:01] Radar: Guest83269: $25k
[00:47:13] pizzaops: Can somebody remind me of the way to test a gem from source while you're working on it, without having to build it every time first? I seem to remember that there's a way, but I can't remember what it is :/
[00:47:22] pizzaops: E.g. if I have an executable in the bin directory that I want to test.
[00:47:35] kies^: has joined #ruby
[00:47:44] Guest83269: 25k jesus thats so much
[00:48:27] graffix222: has joined #ruby
[00:49:09] pawnbox: has joined #ruby
[00:49:34] Darmani: @Radar - Hey boo.
[00:50:28] Radar: Guest83269: $30k now
[00:50:31] Radar: due to inflation
[00:50:32] zambini: pizzaops: pass in `path: /path/to/gem` in your Gemfile (make sure version matches) after building it
[00:50:46] pizzaops: zambini: I'm trying to do the opposite.
[00:50:53] pizzaops: I'm trying to test it *before* building it.
[00:50:57] pizzaops: It looks like you can just bundle exec though.
[00:51:05] Guest83269: Radar seriously ho much to build a clone of that site
[00:51:17] pizzaops: E.g. I don't want to have to build it every time I make a minor change, while I'm developing, to see if it works.
[00:51:20] zambini: Before building it or before 'publishing' it?
[00:51:23] Darmani: I can do it for $12.
[00:51:25] felixdd: has joined #ruby
[00:51:26] Radar: Guest83269: Pay peanuts get monkeys.
[00:51:29] Darmani: and some food stamps.
[00:51:34] pizzaops: Before running gem build.
[00:51:36] pizzaops: Before building it.
[00:51:38] Radar: Guest83269: and I never ever do fixed priced bidding
[00:51:46] pizzaops: zambini: but bundle exec appears to handle it fine
[00:51:46] Radar: Guest83269: It's $250/hr if you want to hire me.
[00:51:46] ReK2: has joined #ruby
[00:52:05] Darmani: @Radar holy shit Radar you worth that much
[00:52:16] Radar: Darmani: Wrote some books about Rails.
[00:52:20] Radar: Darmani: Kind of a Bigg deal.
[00:52:24] Guest83269: 250 you are drunk
[00:52:25] pizzaops: Darmani: ahah, that's roughly what my company charges for my time.
[00:52:34] Darmani: what the fuuuuck
[00:52:35] pizzaops: (Not as a developer)
[00:52:47] Guest83269: consultant lol
[00:52:55] Darmani: @pizzaops - I'm trying to get there fam
[00:53:05] pizzaops: Darmani: I don't get $250/hr. I'm salaries.
[00:53:05] domgetter: Darmani: notice he said "what my company charges" not "what my company pays me"
[00:53:10] pizzaops: s/salaries/salaried
[00:53:16] DLSteve: has joined #ruby
[00:53:18] zambini: pizzaops: rspec not cutting it?
[00:53:22] Darmani: @domgetter - :o good point.
[00:53:24] pizzaops: zambini: I'm sorry?
[00:53:32] zambini: To test your gem
[00:53:34] Guest83269: sounds like agency worker
[00:53:41] pizzaops: zambini: oh, no, rspec is fine, but sometimes I'm just trying a bunch of things.
[00:54:04] pizzaops: So I want to run something, drop a binding.pry in, etc. without having to build over and over
[00:56:01] atomical_: has joined #ruby
[00:56:31] freerobby: has joined #ruby
[00:59:18] sankaber: has joined #ruby
[00:59:22] joonty: has joined #ruby
[01:00:07] northfurr: has joined #ruby
[01:01:11] Radar: Guest83269: I am completely sober. Again: pay peanuts, get monkeys. I am not a monkey, I am expensive.
[01:01:17] Radar: Guest83269: What a monkey does in 10 hours I do in 1.
[01:01:21] Radar: Monkey charges $50/hr
[01:01:25] Radar: Do the math
[01:04:01] El3ktra: has joined #ruby
[01:04:02] El3ktra: has joined #ruby
[01:04:22] felltir: 10x klaxon
[01:04:38] atomical: has joined #ruby
[01:05:15] nfk|laptop: Radar, i don't think anyone's hourly rate is above some $160
[01:05:54] Seich: has joined #ruby
[01:05:58] nfk|laptop: anyway, sleep, tomorrow/today will be hellish, probably
[01:06:09] baweaver: has joined #ruby
[01:06:22] eam: $160/hr is annualized $320k/yr?
[01:06:23] Radar: nfk|laptop: Well, you've met someone who charges that.
[01:06:41] eam: assuming 40hrs/week which contractors generally won't hit
[01:06:51] Radar: Base rate of $150/hr but I add up to $100 if I think the client is going to be troublesome. it's based on a percentage.
[01:07:00] mg^: reminds me of a conversation when I worked at Big Company. Them: "We can pay for 3 FTEs worth people at Outsourcing Firm for the cost of you" Me: "Go ahead and try that out."
[01:07:01] Radar: So 100% chance of client being difficult == $100
[01:07:29] eam: I know a guy who doesn't write code. All he does is computer work at people's home (think geek squad) and his hourly rate is >$100
[01:07:43] atomical_: has joined #ruby
[01:08:17] Mr_Pancake: has joined #ruby
[01:08:27] eam: I think the shop billing rate for a car mechanic or a plumber is around $150/hr
[01:08:27] alphaatom: has joined #ruby
[01:08:31] mg^: I went and worked for Outsourcing Firm for Big Company so they got to pay for me *and* three people because I was not allowed to bill more than 40 hours a week and they needed my skills.
[01:09:11] eam: mg^: hired the people under you?
[01:09:34] eam: seems to be a pretty standard thing for name-brand contractors
[01:09:57] eam: "we've brought on so-and so and his team" and then the name brand so and so gets a percentage
[01:10:05] mg^: more complicated from an HR/international perspective but essentially that
[01:10:16] eam: and then outsources the crapwork to dudes in eastern EU or whatever
[01:11:28] mg^: My overseas team was actually pretty good. Definitely several I'd hire in a heartbeat.
[01:11:43] eam: oh yeah, I absolutely don't mean to denigrate the quality of that kind of outsourcing
[01:12:06] eam: the idiot in this equation is the company who can't recruit competent talent on their own :)
[01:12:11] diegoviola: Radar: where do you find your clients?
[01:13:04] eam: mg^: some of the best international hires we recruited over a decade ago now live and work in my office :)
[01:13:34] mg^: I wish the startup would finish cranking already, I'd love to get some of my old teammates back.
[01:13:57] eam: ah, well, we all went to the same startup years back sooo :D
[01:15:48] mg^: I did the same thing, initially with one other guy and now two from the old Big Company, but we're not bringing enough in yet for us to bring on more
[01:16:03] mg^: but I've got a whole list of potential recruits in my back pocket for when the cash starts rolling in
[01:16:45] eam: sounds about right, thank goodness for CA's employee protections which invalidate noncompetes and non-recruit clauses
[01:20:01] Mr_Pancake: has joined #ruby
[01:20:05] djbkd: has joined #ruby
[01:21:52] bitri: has joined #ruby
[01:25:01] pdoherty: has joined #ruby
[01:25:51] blackmesa: has joined #ruby
[01:26:20] ledestin: has joined #ruby
[01:26:56] Mr_Pancake: has joined #ruby
[01:28:00] nerfando: has joined #ruby
[01:28:47] baweaver: has joined #ruby
[01:29:12] nerfando: has joined #ruby
[01:29:49] Rodya_: has joined #ruby
[01:30:20] nerfando: has joined #ruby
[01:31:29] nerfando: has joined #ruby
[01:32:51] Kryptonical: has left #ruby: ("See ya")
[01:33:06] oz: has joined #ruby
[01:35:54] janebootydoe: has joined #ruby
[01:38:28] krz: has joined #ruby
[01:39:03] casadei: has joined #ruby
[01:40:05] Anderson69s: has joined #ruby
[01:40:47] davedev24: has joined #ruby
[01:40:55] dlitvak: has joined #ruby
[01:41:57] woodruffw: has joined #ruby
[01:43:49] griffindy: has joined #ruby
[01:44:05] chipotle: has joined #ruby
[01:45:41] duckpuppy: has joined #ruby
[01:48:20] iWaffles: has joined #ruby
[01:48:39] pawnbox: has joined #ruby
[01:49:41] n00bDev: has joined #ruby
[01:53:33] dlitvak: has joined #ruby
[01:53:44] Ebok: has joined #ruby
[01:55:34] arthurix: has joined #ruby
[01:55:38] kt2: has joined #ruby
[01:57:56] mistermocha: has joined #ruby
[01:58:12] casadei: has joined #ruby
[01:58:32] Seich: has joined #ruby
[01:58:37] DLSteve: has joined #ruby
[01:58:57] mostlybadfly: has joined #ruby
[01:59:39] b2zeldafreak: has joined #ruby
[02:00:19] lkba_: has joined #ruby
[02:02:02] yeticry_: has joined #ruby
[02:03:51] crdpink: has joined #ruby
[02:05:17] b2zeldafreak: has joined #ruby
[02:07:16] b2zeldafreak: has joined #ruby
[02:07:41] gambl0re: has joined #ruby
[02:07:52] Yzguy: has joined #ruby
[02:08:45] kalopsian: has joined #ruby
[02:09:32] solocshaw: has joined #ruby
[02:09:52] b2zeldafreak: Hi, can anyone point me to a good example (or tutorial) for using Hexagonal or Clean architecture with Rails?
[02:10:23] harly: what's that?
[02:10:24] kt2: has joined #ruby
[02:10:57] b2zeldafreak: Decoupling your business logic from the Rails framework essentially
[02:14:26] RobertBirnie: has joined #ruby
[02:17:11] pizzaops: I don't quite understand why the config.whatever calls inside my hash here return undefined method config. Shouldn't I be able to call a class method anywhere inside the class? E.g. it works outside the initialize method but not inside it. https://gist.github.com/pizzaops/bd0378bfe9ce6795a4cf
[02:18:43] pawnbox: has joined #ruby
[02:18:48] bnagy: pizzaops: if in doubt `p self`
[02:19:40] atomical: has joined #ruby
[02:19:42] pizzaops: But self.class is cronenberg::connection
[02:19:43] bnagy: you can call _instance_ methods anywhere because self is the instance inside instance method bodies
[02:20:15] bnagy: if you want to call something on self.class then do that :)
[02:20:27] pizzaops: Oh I see, the instance is not the class.
[02:20:30] pizzaops: That makes sense.
[02:21:35] welovfree: has joined #ruby
[02:21:36] al2o3-cr: has joined #ruby
[02:22:27] bnagy: _personally_ I often use self.some_method when I do that just to make it clear
[02:22:47] welovfree: Hello guys, what are the prerequisites to start learning Ruby? and what's Ruby on Rails?
[02:22:52] bnagy: because auto-dispatch to self sometimes makes it look like you're calling some keyword or magic or something
[02:23:17] jamw: has joined #ruby
[02:23:35] pizzaops: I changed self to an instance method. It doesn't really matter.
[02:23:42] pizzaops: It will always get the same values since it's reading a config file.
[02:23:53] bnagy: well they're very different, especially for config
[02:24:22] bnagy: but whatever works :) You could also make the config a class or even a singleton and pass it as an initialize param to stuff
[02:24:35] RobertBirnie: has joined #ruby
[02:24:39] pizzaops: Config is a class already, which does some logic around reading env variables or a config file
[02:24:47] pizzaops: Thus Cronenberg::Config.new
[02:24:56] Radar: diegoviola: internet
[02:25:06] Radar: diegoviola: I don't go looking usually. They find me.
[02:25:09] |ifei5good: has joined #ruby
[02:28:10] stannard: has joined #ruby
[02:29:43] houhoulis: has joined #ruby
[02:30:50] Rodya_: has joined #ruby
[02:31:04] welovfree_: has joined #ruby
[02:32:03] al2o3-cr: has joined #ruby
[02:36:54] dlitvak: has joined #ruby
[02:37:50] Darmani: has joined #ruby
[02:37:55] domgetter: has joined #ruby
[02:38:00] jgt1: has joined #ruby
[02:39:43] bb010g: has joined #ruby
[02:41:57] TomPeed: has joined #ruby
[02:43:19] b2zeldafreak: What does the ':' operator do?
[02:46:41] duckpuppy: has joined #ruby
[02:48:24] pawnbox: has joined #ruby
[02:49:15] arescorpio: has joined #ruby
[02:51:12] Ox0dea: There's no such thing.
[02:51:49] sdwrage: has joined #ruby
[02:52:06] Ox0dea: Prefixing an identifier with ':' turns it into a Symbol.
[02:52:35] Ox0dea: And then there's `foo ? if_truthy : if_falsy`, which is a ternary expression.
[02:53:03] Ox0dea: b2zeldafreak: ^
[02:53:07] harly: and the hash alternative. :key => 'value' vs key: 'value'
[02:53:27] peeja: has joined #ruby
[02:53:51] b2zeldafreak: And what is a symbol?
[02:54:29] Ox0dea: A Symbol is essentially a String, except that it compares by identity rather than character-wise.
[02:54:45] dcunit3d: has joined #ruby
[02:55:00] Ox0dea: :foo is always the same Object, whereas two separate instances of the String "foo" will be different objects.
[02:55:04] b2zeldafreak: So is :thisstring representing "thisstring" or some other value?
[02:55:11] Ox0dea: >> [:foo, :foo, 'foo', 'foo'].map(&:object_id) # b2zeldafreak
[02:55:13] ruby[bot]: Ox0dea: # => [450738, 450738, 547466630, 547466620] (https://eval.in/502446)
[02:56:01] b2zeldafreak: Can that run a function?
[02:56:03] Axsuul: has joined #ruby
[02:56:16] harly: they're kinda like constants too.
[02:56:34] harly: >> Symbol.all_symbols.size
[02:56:35] ruby[bot]: harly: # => 2717 (https://eval.in/502447)
[02:56:53] Ox0dea: >> ObjectSpace.each_object(Symbol).count
[02:56:55] ruby[bot]: Ox0dea: # => 0 (https://eval.in/502448)
[02:56:57] Ox0dea: Pop quiz: what happened there?
[02:57:05] harly: >> Symbol.all_symbols[1,5]
[02:57:10] ruby[bot]: harly: # => [:"\"", :"#", :"$", :%, :&] (https://eval.in/502449)
[02:57:43] Ox0dea: >> Symbol.all_symbols.max_by(&:size)
[02:57:45] ruby[bot]: Ox0dea: # => :GETRUSAGE_BASED_CLOCK_PROCESS_CPUTIME_ID (https://eval.in/502450)
[02:58:50] Chewy1121: has joined #ruby
[02:59:02] harly: http://www.randomhacks.net/2007/01/20/13-ways-of-looking-at-a-ruby-symbol/
[02:59:03] Chewy1121: Can anyone help me real quick
[02:59:08] Chewy1121: Oh hey Harly
[02:59:33] Chewy1121: Harly, how can I make a method go back to the prevouise method once it is done?
[02:59:55] harly: by calling it from the previous method :)
[03:00:10] joonty: has joined #ruby
[03:00:25] Chewy1121: I mean as a new method
[03:00:30] Ox0dea: Chewy1121: That'll "just happen".
[03:00:51] Chewy1121: I mean, method 1 runs, then method 2 is called and is run. I want method 1 to run again
[03:01:20] Chewy1121: But I do not want to specify method 1 at the end of method 2
[03:01:34] harly: well, for what you're trying to achieve you can either have method 1 as recursive, or loop in method one based on the result of method 2. but thinking "i want method 2 to jump to method 1" is probably the wrong way to think about it.
[03:01:57] Ox0dea: Chewy1121: Do you want method 1 to resume or start over?
[03:01:58] B1n4r10: has joined #ruby
[03:02:09] Ox0dea: Then you're being crazy.
[03:02:15] harly: method1 { while (some condition) { method2; other stuff; } p 'method 1 done' }
[03:02:36] Chewy1121: Well method 2 is not in method 1
[03:02:40] Chewy1121: Lemme post the code
[03:02:44] |ifei5g00d: has joined #ruby
[03:03:26] Ox0dea: Shield your eyes. This is gonna hurt.
[03:03:42] Chewy1121: https://ghostbin.com/paste/eohwd
[03:03:42] MyMind: has joined #ruby
[03:03:48] yfeldblum: has joined #ruby
[03:04:06] Ox0dea: I toad a so: https://www.youtube.com/watch?v=bhFHIlwCSq0
[03:04:15] Chewy1121: Someone might me in the admin method, alternatively someone might be in the user (cp) method
[03:04:43] Chewy1121: I want both to be able to access the g99 method, and rerun after wards
[03:04:47] atomical_: has joined #ruby
[03:04:50] Ebok: has joined #ruby
[03:04:57] Chewy1121: do i just return g99?
[03:05:02] Chewy1121: in the admin and cp?
[03:05:08] bronson: has joined #ruby
[03:05:41] harly: so g99 is a way to ask the user to enter a new pass?
[03:05:53] Chewy1121: Yes, to update it
[03:06:00] harly: why don't you call it promp_pass
[03:06:06] harly: because g99. that's strange.
[03:06:14] Chewy1121: what is promp?
[03:06:19] Chewy1121: do you mean prompt?
[03:06:25] Chewy1121: Or is promp a thing?
[03:06:30] Chewy1121: Ok, what does that do?
[03:06:31] harly: just a made up name
[03:06:42] Chewy1121: How would that work?
[03:06:51] harly: you could call it prompt_for_pass_and_awkwardly_store_in_globals too
[03:06:56] baweaver: has joined #ruby
[03:07:04] Chewy1121: Well I need to store it in an array
[03:07:20] Chewy1121: (brain fart)
[03:07:42] Chewy1121: I could do everything in the control panel
[03:07:43] atomical_: has joined #ruby
[03:07:59] Chewy1121: But I am trying to keep everything separate
[03:08:34] astrobun_: has joined #ruby
[03:09:11] _Tariq: has joined #ruby
[03:09:39] harly: well. first. all of that code is a bit kind of messy and hard to read. but to answer your specific question in cp and admin you would just call g99 when you want it.
[03:09:41] Ox0dea: What makes somebody name their variables like this?
[03:10:03] Chewy1121: I love it when u get confused like this
[03:10:06] harly: personally I do that with g99() cos the () makes it clearer it's a function call and not some random variable.
[03:10:12] Ox0dea: I'm not confused, I'm worried.
[03:10:31] harly: but first thing. rename every one of those strange values like e50 b3 b4 with what they *represent*
[03:10:34] Chewy1121: Anways, harly. I want people to be able to access the same panel again
[03:11:15] Chewy1121: I figured out how to do it
[03:11:27] harly: figured out *one way* to do it maybe. :)
[03:11:36] ss_much: has joined #ruby
[03:11:45] harly: there's many. the fun bit is picking the right one that's structured well and readable to other people.
[03:12:03] Chewy1121: Well check it, look at line 32
[03:12:11] harly: seriously though. go and rename all your variables to have names that represent what they are. not random letters and numbers.
[03:12:24] Chewy1121: With the case. if they pick pass I can just call g99, then put cp
[03:12:40] Chewy1121: Else if it is in the admin sections Ill just do g99 and then admin
[03:12:45] harly: b3 to password. b4 to unecessary_and_unused_copy_as_a_class_variable_of_entered_password, etc.
[03:13:02] Chewy1121: I luv it like that
[03:13:18] Chewy1121: Plus I don't want to because it would be too long to re write it
[03:13:24] peeja: has joined #ruby
[03:13:27] harly: woulnd't be long at all.
[03:13:34] Chewy1121: I got about 10,000 lines of code already written using those variables
[03:13:48] harly: now i think you're trolling
[03:13:56] Chewy1121: Only like 300
[03:14:05] Chewy1121: But I still don't feel like re writing it
[03:14:21] Chewy1121: Plus they are simple and Easy to understand :D
[03:14:29] Chewy1121: Well for me at least
[03:16:52] LMity: has joined #ruby
[03:17:23] |ifei5good: has joined #ruby
[03:17:40] dcunit3d: has joined #ruby
[03:18:41] pawnbox: has joined #ruby
[03:19:05] shevy: you are still picking silly-short method names?
[03:19:20] shevy: why not do alphabetical names... def a ... def b ... def c
[03:22:16] harly: or use a password generator for them? CrNJhhWp2CnEGxJgA6fR2h2FXW7XsV is particularly nice.
[03:22:48] harly: and with tab completion, you'd only have to enter 2-4 letters probably!
[03:23:40] eam: well, that's a constant
[03:23:49] harly: dang, my method is flawed.
[03:23:56] eam: I mean, you can do it
[03:24:08] harly: stop raining on my parade! *cries*
[03:24:21] eam: AFAIK a method can contain any characters at all
[03:24:24] eam: or none
[03:24:44] eam: it just gets a little awkward to use it
[03:24:55] harly: working on my variable name generator vim plugin now. it's going to be a hit!
[03:31:32] Rodya_: has joined #ruby
[03:31:56] blackgoat: has joined #ruby
[03:32:48] bronson: has joined #ruby
[03:32:50] vdamewood: has joined #ruby
[03:34:33] citrusfizz: has joined #ruby
[03:36:36] ashemark: has joined #ruby
[03:39:02] arthropododo: has joined #ruby
[03:40:31] Radar: hey ashemark
[03:40:52] Radar: How are things today?
[03:41:53] moei: has joined #ruby
[03:41:58] citrusfizz: hello, i have a crazy problem, i'm using activerecord to grab a simple value from a database. i'm then taking that and sending it to slacks API to a channel. in slack you can make text have a link. by doing <http://www.whatever.com|clickhere> so in my command in ruby it looks like this message = "<#{q.url}|clickhere> this should just post "click here" in...
[03:41:59] citrusfizz: ...the slack channel. but it outputs <http://www.whatever.com|clickhere> . the furstrating thing is, i tested it with ab = "http://www.whatever.com" then put in message = <#{ab}|click here> it works fine. so for some reason, it doesn't like my active record db call. what could be the issue?
[03:42:42] Radar: citrusfizz: In Slack, <http://whatever.com|clickhere> is not a link.
[03:42:47] Seich: has joined #ruby
[03:43:58] citrusfizz: if you pass "http://www.whatever.com|click here>" to a slack channel VIA the api, it resolves as "click here" with a link
[03:46:17] Radar: code that is fetching this value from a database please.
[03:46:30] arthropododo: so are people starting to use Ruby in scientific computing yet?
[03:47:02] Radar: helpa is muted here, so I can't !8ball you
[03:47:03] Radar: [14:46:53] <Radar> !8ball
[03:47:03] Radar: [14:46:54] <helpa> Yes ??? definitely.
[03:47:07] Radar: But I can run the command in another channel.
[03:47:14] Radar: HELPA HAS SPOKEN.
[03:47:19] chipotle: so i use sublime text 3 because the last time i tried atom in the pre 1.x days, it was slow as hell. i read a long thread saying they would fix it for 1.x ... is that true? or is it still maddening slow?
[03:47:31] Radar: ?try chipotle
[03:47:31] ruby[bot]: chipotle: Why don't you try it and see for yourself?
[03:47:55] chipotle: i can't at the moment
[03:48:08] Radar: in my experience it's still slow as molasses and Sublime Text 3 wins
[03:48:13] Radar: even MacVim was terrible
[03:49:32] shevy: arthropododo I think it depends on how many people will use ruby there, from my experience, the "normal" ruby user is more likely to use ruby for commandline scripting or rails, rather than for science-related stuff
[03:50:27] harly: mmm, but is the "normal" science programmer likely to use ruby?
[03:51:55] northfurr: has joined #ruby
[03:51:56] terminalrecluse: has joined #ruby
[03:52:43] finisherr: has joined #ruby
[03:52:45] shevy: more likely to use python!
[03:53:39] sankaber: has joined #ruby
[03:53:51] bronson: has joined #ruby
[03:54:38] ashemark: is there a way I could get autocompletion for imported gems in atom?
[03:54:59] citrusfizz: Radar: https://gist.github.com/citrusfizz/2e53be997fa076a9d252
[03:55:14] Radar: citrusfizz: checks out for me.
[03:55:36] kies: has joined #ruby
[03:55:39] Guest96374: has joined #ruby
[03:57:32] sankaber: has joined #ruby
[03:59:32] n00bDev: has joined #ruby
[03:59:55] citrusfizz: what do you mean
[04:00:18] Radar: citrusfizz: Everything you're doing is exactly as I would do it. I don't see what could be wrong.
[04:00:39] Graphettion: has joined #ruby
[04:01:27] citrusfizz: its crazy, if i do output gg.class i get String, q.url.class i get string
[04:01:42] Radar: lowercase s?
[04:01:53] citrusfizz: i meant String
[04:02:47] citrusfizz: is there any trick to getting the value and re-assgining it before i put it in the message? something that not just a pointer
[04:02:54] citrusfizz: i just don't freaking understand this one
[04:04:05] chipotle: arthropododo: my background is a PhD in theoretical physics...we never used ruby. python has a huge headstart on ruby with all its libraries etc for scientific computing. and then there is c/c++
[04:04:35] citrusfizz: maybe something to do with encoding?
[04:05:15] shevy: citrusfizz depends on the encoding, if you have an umlaut then .upcase .downcase may fail depending on your encoding; e. g. I have that sometimes when I use some ISO encoding
[04:05:26] shevy: >> "?".upcase
[04:05:56] arthropododo: shevy , chipotle thanks
[04:06:13] Guest96374: has left #ruby: ("WeeChat 0.4.2")
[04:06:22] yfeldblum: has joined #ruby
[04:06:42] arthropododo: I'm starting a project and since nobody imposed anything might as well try to mix ruby and C++ and see how that works out
[04:07:27] shevy: arthropododo I usually saw the combination of c++ and python there, for instance relion, but also some projects that require cluster computation via openmpi and such, always C++, and always python :)
[04:07:39] baweaver: has joined #ruby
[04:09:03] chipotle: shevy: oh and of course, R
[04:09:54] shevy: I dunno, usually R was more of an addon then, mathematica was also used, but I meant for integrated packages, when the author wrote it in C++, the scripting language that followed with it usually was python
[04:10:28] braincrash: has joined #ruby
[04:11:16] arthropododo: for all those scientific python applications do people generally stick to python 2.x?
[04:12:13] zast: has joined #ruby
[04:13:31] ashemark: has left #ruby: ("WeeChat 1.3")
[04:14:07] ramfjord: has joined #ruby
[04:14:12] jgt1: has joined #ruby
[04:15:09] shevy: I think most did
[04:15:14] shevy: I hate the python2 versus python3 split
[04:16:28] JohnT: has joined #ruby
[04:16:50] kp666: has joined #ruby
[04:17:29] kp666: has joined #ruby
[04:17:52] hxegon: has joined #ruby
[04:18:00] framling: has joined #ruby
[04:18:07] elnur: has left #ruby: ("Leaving")
[04:18:48] pawnbox: has joined #ruby
[04:20:53] _Tariq: shevy: Is there any attempt to remedy the divide?
[04:21:00] _Tariq: Or is the fork going to stay forever?
[04:21:24] shevy: I don't think they'll will remedy much at all, they will probably go the "more and more people will use python 3 and then this will resolve on its own eventually"
[04:24:50] Ox0dea: _Tariq: https://pypi.python.org/pypi/six
[04:25:11] Ox0dea: This thing exists to prevent widespread Python 3 adoption.
[04:26:13] allcentury: has joined #ruby
[04:26:37] _Tariq: I tend to hate change, so I might be rooting for this library
[04:26:51] _Tariq: Maybe Python 2 should turn into its own language
[04:26:56] dfinninger: has joined #ruby
[04:26:57] _Tariq: with its own unique name
[04:27:31] graffix222: has joined #ruby
[04:27:42] Radar: Python 3, you mean?
[04:27:54] Radar: Also: a reminder that #ruby-offtopic exists.
[04:28:05] Radar: Thank you.
[04:29:22] st0opkid: has joined #ruby
[04:30:28] kknight: has joined #ruby
[04:32:35] Rodya_: has joined #ruby
[04:34:08] rippa: has joined #ruby
[04:34:44] Yzguy: has joined #ruby
[04:35:03] baweaver: has joined #ruby
[04:36:15] grassass: has joined #ruby
[04:37:18] tvw: has joined #ruby
[04:40:01] st0opkid: has joined #ruby
[04:40:54] dfinninger: has joined #ruby
[04:41:24] kt2: has joined #ruby
[04:42:36] JohnT: has joined #ruby
[04:47:42] d0nn1e: has joined #ruby
[04:52:05] exadeci: has joined #ruby
[04:52:46] usershell: has joined #ruby
[04:53:09] krz: has joined #ruby
[04:54:47] Ox0dea: 18>> ? #ruby.users.count(&:active?)
[04:54:48] ruby[bot]: Ox0dea: # => /tmp/execpad-70f0df6590c7/source-70f0df6590c7:2: warning: invalid character syntax; use ?\s ...check link for more (https://eval.in/502477)
[04:54:53] Ox0dea: Worth a shot.
[04:56:14] yfeldblum: has joined #ruby
[04:56:41] northfurr: has joined #ruby
[04:56:50] Ox0dea: I sent a literal ^C; ruby[bot] was supposed to say 3. :<
[04:57:12] shevy: I want ruboto back!
[04:57:31] benlieb: has joined #ruby
[04:59:06] Carella: has joined #ruby
[04:59:27] graffix222: has joined #ruby
[04:59:56] arup_r: has joined #ruby
[05:00:39] gix: has joined #ruby
[05:00:44] Darmani: I can't code anymore.
[05:00:49] Darmani: I don't mean ever.
[05:00:51] joonty: has joined #ruby
[05:00:52] Darmani: Just not anymore today.
[05:01:05] Darmani: ACTION cries in a corner
[05:01:26] Ox0dea: All I hear is... oh.
[05:01:38] northfurr: has joined #ruby
[05:01:50] Darmani: What happened to our intellectual conversation? T.T
[05:02:02] Darmani: @Ox0dea - You suck.
[05:02:26] Ox0dea: What happened to the P in PM standing for pterodactyl?
[05:02:27] iateadonut: has joined #ruby
[05:02:46] Darmani: Is that what it stood for?
[05:02:47] shevy: I just read that they showcase the biggest dinosaur in new york soon
[05:02:49] Darmani: I had no idea.
[05:02:53] pawnbox: has joined #ruby
[05:02:57] cornerma1: has joined #ruby
[05:02:57] Ox0dea: *ptarmigan
[05:03:02] Darmani: @shevy - dam for real? What kinda dinosaur?
[05:03:25] shevy: Darmani dunno, only saw it briefly on a TV teleprompter some minutes ago
[05:03:52] chipotle: has joined #ruby
[05:03:53] shevy: Darmani found an article: http://www.theguardian.com/science/2016/jan/14/new-species-gigantic-dinosaur-titanosaur-unveiled-new-york
[05:04:02] Darmani: @shevy - People still watch tv?
[05:04:06] Darmani: What is this 2004?
[05:04:16] hxegon: has joined #ruby
[05:04:19] shevy: think of the children AND THE ELDERLY PEOPLE!
[05:04:48] Darmani: @shevy - NO ONE THINKS OF THEM
[05:04:50] Bloomer: has joined #ruby
[05:04:56] Darmani: @shevy - lulz
[05:05:32] mistermocha: has joined #ruby
[05:06:09] pawnbox_: has joined #ruby
[05:10:13] hxegon: has joined #ruby
[05:10:40] Ox0dea: Darmani: Exercise: find the longest sequence of unique speakers in #ruby history.
[05:11:00] Ox0dea: It's probably 7.
[05:11:19] Radar: [16:00:44] <Darmani> I can't code anymore.
[05:11:25] Radar: Congratulations you have become a programmer.
[05:11:42] Darmani: @Radar - Lmao is that all it took? xD
[05:11:59] usershell: has joined #ruby
[05:12:14] Radar: Darmani: Programming is really all about... well, put it this way: "Yes, yes... use your hate."
[05:12:22] Darmani: @Ox0dea - The longest sequence of unique speakers being people who have only commented like once or twice? How long does the sequence need to be?
[05:12:35] Ox0dea: Darmani: Like, right now, the sequence is three.
[05:12:35] Darmani: @Radar - You sound like the Dark Lord of the Sith.
[05:12:45] Ox0dea: And now it's two.
[05:12:45] Darmani: @Radar - That's who you really are isn't it?
[05:12:49] Radar: Darmani: Maybe.
[05:13:07] harai54: has joined #ruby
[05:13:08] Radar: Darmani: I'd like to think of myself more as a Frank Underwood.
[05:13:27] Darmani: @Radar - Haha ruthless and charming. Good combination lol
[05:13:37] Ox0dea: Did you mean Al Swearengen?
[05:13:38] Darmani: @Ox0dea - I'll get right on it captain.
[05:13:41] Darmani: ACTION salutes
[05:13:41] Ox0dea: http://i.imgur.com/Ufbr5ej.gif
[05:13:41] Radar: It's because of my shockingly good looks (because I'm Australian)
[05:13:56] sankaber: has joined #ruby
[05:14:02] Ox0dea: Can confirm Radar is handsome.
[05:14:07] Darmani: @Radar - Crikey mate, don't get ahead of yourself now =P
[05:14:14] Darmani: @Ox0dea - How do you know? Lol
[05:14:33] Ox0dea: Darmani: Lucky guess.
[05:14:43] dcunit3d: has joined #ruby
[05:14:43] Darmani: @Ox0dea - Riiiiiight =p
[05:16:01] shevy: Darmani it's the looks you get if you have to survive in an alien landscape, the ruggedness
[05:16:29] sigurding: has joined #ruby
[05:16:44] Ox0dea: > Drop bears are carnivorous, tree-dwelling marsupials found throughout Australia.
[05:17:23] Darmani: Lmao I saw a tv show back in the day about Australia, it was a special about all the shit over there that could kill you.
[05:17:31] Darmani: It was like a week long series on NatGeo lmao
[05:17:50] Ox0dea: Well, they must've really pruned the list.
[05:18:19] Darmani: Interesting choice of words.
[05:18:32] Ox0dea: You should learn to English gooder.
[05:18:50] finisherr: has joined #ruby
[05:18:56] Ox0dea: prune (v.intr.): To remove what is superfluous or undesirable.
[05:19:15] Darmani: @Ox0dea - Thank you for that wonderful definition professor.
[05:19:25] Darmani: Does your astounding vocabulary help you sleep at night?
[05:19:32] Ox0dea: Get pruned, mate.
[05:19:33] baweaver: Ox0dea: does whitequark do JSON responses?
[05:19:44] Ox0dea: baweaver: Er, there's an "API".
[05:20:00] baweaver: poking about in the network tab for the endpoints
[05:20:52] pawnbox: has joined #ruby
[05:23:37] baweaver: http://irclog.whitequark.org/ruby/stream
[05:23:43] baweaver: well that's not very pretty at all....
[05:23:44] kalopsian: has joined #ruby
[05:23:50] kknight: has joined #ruby
[05:23:52] Ox0dea: It's pre-prettied. :<
[05:24:07] Yzguy: has joined #ruby
[05:24:07] baweaver: Is there an un-pre-pretty?
[05:24:31] baweaver: hm. Regex time!
[05:24:32] Ox0dea: http://logs.ryanbigg.com/ruby is only available as HTML as well. :/
[05:24:46] Rodya_: has joined #ruby
[05:25:53] Ox0dea: http://logs.ryanbigg.com/ruby?date=2014-01-09 is as far back as it goes.
[05:27:26] Ox0dea: http://irclog.whitequark.org/ruby/2011-11-16 for this'n.
[05:33:25] M-mistake: has joined #ruby
[05:33:44] Xeago: has joined #ruby
[05:36:21] skcin7: has joined #ruby
[05:37:37] Limix: has joined #ruby
[05:38:55] govg: has joined #ruby
[05:39:24] skcin7: has joined #ruby
[05:39:38] Chewy1121: I haz another problemo
[05:39:46] Chewy1121: Good sir! Could you help me out?
[05:41:46] astrobun_: has joined #ruby
[05:43:14] Chewy1121: https://ghostbin.com/paste/e9ajr
[05:43:22] Chewy1121: Can someone help me with this code?
[05:43:38] northfurr: has joined #ruby
[05:44:12] Cohedrin: #1 stop using class variables
[05:44:17] Cohedrin: now that thats out of the way
[05:44:26] Cohedrin: we have no idea what you're trying to do
[05:44:35] Cohedrin: maybe you should explain your problem
[05:44:49] jgt1: has joined #ruby
[05:44:57] kknight: has joined #ruby
[05:45:02] Ox0dea: Cohedrin = Coheed + Excedrin?
[05:45:21] Cohedrin: also, do yourself a favor and get rubocop installed in your editor :+1: https://github.com/bbatsov/rubocop
[05:45:43] Cohedrin: nope, theres litterally no meaning behind it
[05:45:52] Ox0dea: http://i.imgur.com/Ufbr5ej.gif
[05:46:07] Cohedrin: look the name when I was young on a whim, its never taken anywhere so thats my username now
[05:46:30] Cohedrin: I mean, there may be a meaning, not one I'm aware of though
[05:52:51] Chewy1121: Test out the code
[05:52:56] Chewy1121: You will see the problem
[05:53:29] vikas027_: has joined #ruby
[05:53:33] duckpuppy: has joined #ruby
[05:53:43] kalopsian: has joined #ruby
[05:54:09] Cohedrin: You came here asking for help. If you want help, you should tell us what your problem is
[05:55:15] Ox0dea: Chewy1121: Have you come to Ruby from some other language?
[05:58:37] pizzaops: Is there a way to test a class instance method without invoking the initialize method? This method should work on its own, and doing the scaffolding to make the initialize method work at that point doesn't feel necessary.
[05:59:17] Mackerel: has joined #ruby
[05:59:30] Chewy1121: Test out the code
[05:59:31] Kneecaps: has joined #ruby
[05:59:35] Ox0dea: pizzaops: It shouldn't be an instance method if it's not intended to be invoked on instances.
[05:59:41] Chewy1121: It will show you the probelm 10x faster than explaining it
[05:59:46] Chewy1121: But if you really want me too
[06:00:13] pizzaops: @Ox0dea ah...that's true, this method really only need to ever be invoked once per "run" of the application.
[06:00:14] Chewy1121: The puts at the end, where it prints out username, pin, password and rank print out multiple times
[06:00:26] Chewy1121: I dunno how to fix that
[06:01:31] duoi: hi guys, im the cto of a large company. can i use rubies to make my company cloud-aware?
[06:01:35] joonty: has joined #ruby
[06:01:41] bronson: has joined #ruby
[06:02:13] nerium: has joined #ruby
[06:03:04] vikas027: has joined #ruby
[06:03:46] Chewy1121: Retard-Alert
[06:05:08] harly: "scaffolding to make the initialize method work" sounds so compliated.
[06:05:08] Cohedrin: duoi gem install skynet
[06:05:25] Cohedrin: should solve the problem for you
[06:05:43] harly: gitlab.com header message: Microsoft Azure is performing maintenance between 13 Jan 16:00 UTC and 16 Jan 16:00 UTC. This may cause up to 15 minutes of outage.
[06:05:45] harly: lol azure.
[06:05:49] pizzaops: Ox0dea: this ??? https://gist.github.com/pizzaops/7349fe150137b7c5a92f ??? should really just be `@@default_config_location = File.join(Dir.home, '.vcenter.conf')` right? E.g. there's really no need for a method. And it never changes.
[06:06:05] Ox0dea: pizzaops: Make it a constant.
[06:06:11] Ox0dea: It's right there in the name. :P
[06:06:14] duoi: Cohedrin i am more interested in using the "ruby on rains" method i found in yahoo but i am scared of flooding.
[06:06:24] Chewy1121: ox0dea Can you help me with da problemo?
[06:06:26] pizzaops: Ox0dea: is it acceptable to have @@CONSTANTS ?
[06:06:32] Ox0dea: pizzaops: Why, though?
[06:06:40] Ox0dea: Why won't a CONSTANT suffice?
[06:06:48] shevy: he likes the extra @@
[06:06:58] pizzaops: Is CONSTANT accessible inside methods? I thought they weren't for some rason.
[06:07:01] pizzaops: s/rason/reason
[06:07:03] Ox0dea: They are.
[06:07:08] pizzaops: Welp, never mind then.
[06:07:12] pizzaops: Thanks for the advice!
[06:07:16] Ox0dea: Sure thing.
[06:07:20] harly: *submits coding test for job* *feels angst over not spending enough time on it* where to draw the line!
[06:07:26] Cohedrin: duoi Ah I understand. Sounds like what you need is a 10x programmer
[06:07:42] Cohedrin: a 9x programmer is never going to be able to stop the flood from happening
[06:07:47] shevy: a code monkey!
[06:07:56] shevy: a flood monkey!
[06:08:07] harly: a 10x unicorn will solve all your clouds.
[06:08:19] pizzaops: I'm a 10x pizza-eater. What does that get me?
[06:08:33] Cohedrin: 10x unicorn will cause your heroku server to go down
[06:08:38] harly: they're hard to attract. free disgustingly cheapest available pizza every friday is a great way!
[06:08:54] duoi: Cohedrin ok i will put the job advert out now for a 10x cloud-aware ruby on rain junior assistant software developing enginnering associate. thank u for ur help.
[06:09:25] harly: duoi: how about intern with a view to full time?
[06:09:27] pizzaops: And presumably testing the value of `DEFAULT_CONFIG_LOCATION = File.join(Dir.home, '.vcenter.conf')` is unnecessary because I'm just testing Ruby functionality at that point?
[06:09:40] lyjia: has joined #ruby
[06:10:25] duoi: harly don't trust interns with the data (i am cto of a missile defense contractor). we need an experienced 10x programmer with minimum 40 years exp.
[06:10:33] duoi: in ruby on rains.
[06:11:07] pizzaops: Surely you mean boilerstrapjs
[06:11:24] Cohedrin: what are you using the rains for in your missle
[06:11:25] pizzaops: http://html9responsiveboilerstrapjs.com/
[06:12:10] Ox0dea: H9 put me in mind of HQ9+: https://esolangs.org/wiki/HQ9+
[06:12:54] Graphettion: Just use this http://code.divshot.com/geo-bootstrap/
[06:14:20] teoric: has joined #ruby
[06:14:48] shevy: 1995ies are back
[06:16:32] Graphettion: http://vanilla-js.com/ is a great framework too.
[06:16:38] Graphettion: So much great stuff out there.
[06:17:10] yfeldblum: has joined #ruby
[06:17:16] shevy: huh... $stdin.getch for the enter key gives a "\r" ?
[06:18:25] shevy: lol I broke irb... loop { user_input = $stdin.getch; p user_input }
[06:18:44] joneshf-laptop: has joined #ruby
[06:18:45] Ox0dea: SIGKILL it with fire.
[06:18:45] rickmasta: has joined #ruby
[06:19:17] pawnbox: has joined #ruby
[06:19:38] ericfreese: has joined #ruby
[06:19:44] Graphettion: Escape it! http://stackoverflow.com/questions/30426273/dynamic-escape-characters-in-ruby
[06:21:05] Ox0dea: That's not quite sufficient.
[06:21:34] Ox0dea: The arrow keys are "\e[A".."\e[D", for instance.
[06:22:04] shevy: programming is evil
[06:27:40] allcentury: has joined #ruby
[06:28:03] bronson: has joined #ruby
[06:29:54] Chewy1121: I have a question about ISPs
[06:30:05] stannard: has joined #ruby
[06:30:14] Chewy1121: If I have proof that my ISP keeps bottlenecking my connection what do I do
[06:30:45] Chewy1121: I pay for 300 MBPS and I got about 250 and every hour it goes down about 20
[06:31:06] harly: you probably pay for "up to 300 MBPS" :)
[06:31:26] Chewy1121: That might be it
[06:31:58] Chewy1121: Well it is time warnerm doing this shit
[06:33:38] Chewy1121: It was up too 300 mbps
[06:34:34] Cohedrin: pray that google fiber comes to your area
[06:35:56] darkf: has joined #ruby
[06:36:05] aganov: has joined #ruby
[06:37:02] yfeldblum: has joined #ruby
[06:37:24] sigurding: has joined #ruby
[06:39:24] gregf: has joined #ruby
[06:50:44] arup_r: has joined #ruby
[06:51:13] claw: has joined #ruby
[06:51:17] shevy: if I run from ruby something such as "./configure", it may succeed but it may also fail. is there a trivial way to find out if it failed?
[06:52:08] shevy: from within ruby?
[06:53:18] Ox0dea: Er, no, you'll want Kernel#system, then.
[06:53:44] kerunaru: has joined #ruby
[06:53:48] Ox0dea: Whose return value you can use, but which also sets $? appropriately.
[06:54:31] rodfersou: has joined #ruby
[06:54:36] BTRE: has joined #ruby
[06:55:37] Ox0dea: Backticks and %x (same thing) also set $?.
[06:57:44] shevy: let's have a look at $?
[06:58:45] Rodya_: has joined #ruby
[06:59:45] Ox0dea: Can't demo with ruby[bot]. :/
[07:00:54] DirtyFInn: has joined #ruby
[07:03:02] Macaveli: has joined #ruby
[07:03:04] bluOxigen_: has joined #ruby
[07:05:15] rodferso1: has joined #ruby
[07:05:31] DirtyFInn: has left #ruby: ()
[07:05:47] djbkd: has joined #ruby
[07:09:04] Chewy1121: Hey, can someone tell how to fix this problem?
[07:09:04] Chewy1121: https://ghostbin.com/paste/e9ajr
[07:09:15] RandomNickname: has joined #ruby
[07:09:19] Chewy1121: Test the code, it posts the accounts multiple times (same account)
[07:09:20] tmtwd: has joined #ruby
[07:10:15] andikr: has joined #ruby
[07:12:21] dopie: has joined #ruby
[07:12:33] Dimik: has joined #ruby
[07:14:13] lurch_: has joined #ruby
[07:15:09] dionysus69: has joined #ruby
[07:17:28] Chewy1121: has joined #ruby
[07:17:51] akemrir: has joined #ruby
[07:20:09] symm-: has joined #ruby
[07:20:14] bluOxigen: has joined #ruby
[07:20:22] SOLDIERz: has joined #ruby
[07:21:41] norc_: has joined #ruby
[07:22:11] colegatron: has joined #ruby
[07:24:30] shevy: Chewy1121 this is fairly nonsenical really
[07:24:44] shevy: nonsensical
[07:25:04] shevy: Chewy1121 do you really need 3 hashes? why not just one that has all the info?
[07:25:11] jackcom: has joined #ruby
[07:25:29] nacho_: has joined #ruby
[07:26:42] jackcom: i can???t install gruff, i tryed it over 100 times, but i failed finally :(
[07:27:46] Ox0dea: $ xzcat ruby.tsv.xz | cut -f2 | grep -c shevy
[07:27:48] atmosx: jackcom: you need imagemagick
[07:27:54] Ox0dea: You probably didn't want to know that, but there it is. :P
[07:28:14] jackcom: imagemagick
[07:28:20] atmosx: Ox0dea: what is this file?
[07:28:31] Ox0dea: atmosx: The history of #ruby.
[07:28:39] atmosx: Ox0dea: oh
[07:28:42] Ox0dea: Since 2011-11-16, anyway.
[07:28:52] atmosx: cool, irc logs?
[07:28:57] atmosx: I mean from your client
[07:29:00] atmosx: or from the website?
[07:29:06] Ox0dea: http://irclog.whitequark.org/ruby/2011-11-16
[07:29:29] atmosx: Ox0dea: I wonder, what is the file size? uncompressed
[07:29:31] Ox0dea: The longest sequence of unique speakers that isn't 9/11 spam is 13.
[07:29:37] Ox0dea: atmosx: ~150MB
[07:29:43] nanoz: has joined #ruby
[07:30:17] Ox0dea: `xz -9` got it down to 35.
[07:31:04] atmosx: isn't lza the one that has the biggest ratio?
[07:31:08] atmosx: lza2 now or something like that
[07:31:38] Ox0dea: lz4c, it seems.
[07:32:06] Ox0dea: Er, no, lz4 is for speed.
[07:32:35] jackcom: http://paste.ofcode.org/wZiDKSAnnp6mXQ7DRFrzPF <?????? atmosx
[07:32:53] jackcom: i failed after installing imagemagick
[07:32:58] Ox0dea: atmosx: lzma is essentially just an alternate xz format.
[07:33:33] atmosx: jackcom: what system is that?
[07:33:50] atmosx: and imagemagick through brew?
[07:34:09] jackcom: brew install imagemagick
[07:34:26] craysiii: has joined #ruby
[07:35:01] craysiii: has joined #ruby
[07:35:37] atmosx: jackcom: sorry, I use macports. Worked for me on macorts after installing imagemagick and freebsd too
[07:35:52] atmosx: jackcom: but the experience was awful.
[07:36:07] atmosx: I didn't manage to create the graff even after installing it.
[07:36:36] jackcom: what is macports? i don???t know macports.
[07:36:38] atmosx: another imagemagick error came up and I used gcharts or something.
[07:36:48] PedramT: has joined #ruby
[07:36:53] atmosx: jackcom: it's a more flexible (and complicated) solution for osx, similar to brew
[07:36:59] kalopsian: has joined #ruby
[07:37:07] atmosx: macports.org
[07:37:28] jackcom: oh then if use brew, then i don???t need to use macport?
[07:37:31] sinkensabe: has joined #ruby
[07:37:34] joonty: has joined #ruby
[07:37:41] atmosx: try asking the brew channel
[07:37:52] atmosx: and #imagemagick
[07:37:57] jackcom: ok i will be back soon
[07:40:23] jackcom: i must install rubygems too? atmosx ?
[07:41:09] jas02: has joined #ruby
[07:41:22] norc_: Ox0dea: I am genuinely curious about which country you currently reside in.
[07:41:39] Ox0dea: norc_: They've got tools for that.
[07:41:55] norc_: Indeed they do. The most common tool is a social interaction called a question.
[07:42:22] jackcom: `get_type_metrics': unable to read font `(null)' @ error/annotate.c/RenderFreetype/1152: `(null)' (Magick::ImageMagickError) <?????? what???s wrong?
[07:42:24] jackcom: i don???t know
[07:42:29] Ox0dea: https://git.io/vzccN
[07:42:44] Ox0dea: norc_: Judging by my position there, I think I'll probably heed your unspoken suggestion.
[07:43:15] Ox0dea: Who was this benzrf fellow?
[07:43:18] dlitvak: has joined #ruby
[07:43:47] norc_: Ox0dea: ;-)
[07:44:07] Ox0dea: shevy is dominating!
[07:44:37] dn`: has joined #ruby
[07:44:46] norc_: You can give him a price, maybe a "Ruby Certified Chat Expert" certificate.
[07:45:01] LMity: has joined #ruby
[07:45:12] jalnt_: has joined #ruby
[07:45:34] jgt1: has joined #ruby
[07:45:35] jackcom: atmosx: help me
[07:45:40] norc_: From what I hear these certificates carry a lot of weight in businesses.
[07:45:50] firstdayonthejob: has joined #ruby
[07:47:08] pawnbox: has joined #ruby
[07:47:24] Ox0dea: words-insane says that "bossship" (three Ss) is a word.
[07:48:49] norc_: Ox0dea: As a German speaker such things are just common to me. Compound words are one of the basic things in our language. :-)
[07:49:25] Ox0dea: norc_: https://www.youtube.com/watch?v=fHxO0UdpoxM
[07:49:43] norc_: Schlammmassen, Nussschale, Flanelllappen
[07:49:49] norc_: Just to give random examples.
[07:50:11] Ox0dea: There's no words-insane-de. :/
[07:50:30] norc_: That is because you can just compose them yourself.
[07:50:39] norc_: There are no limits for composition here. :-)
[07:51:05] norc_: Donaudampfschifffahrtsgesellschaftsf??hrerb??rostuhlrollenhersteller
[07:51:11] gagrio: has joined #ruby
[07:51:15] ddv: I don't like Germans. They dress weird.
[07:51:25] norc_: At least we don't smell weird.
[07:51:59] solars: has joined #ruby
[07:53:23] aufi: has joined #ruby
[07:54:17] duckpuppy: has joined #ruby
[07:54:17] Ox0dea: $ grep -Eac '(.)\1\1' german.dic
[07:54:21] Ox0dea: norc_: But no quadruples.
[07:54:24] Ox0dea: Welsh has ya there.
[07:56:06] atmosx: jackcom: try installing pkg-config
[07:56:06] norc_: Ox0dea: I do not see a rule that would allow for quadruple consonants.
[07:56:20] norc_: Ox0dea: We have some pretty huge consonant clusters though.
[07:56:30] norc_: Like Borschtsch
[07:56:36] atmosx: jackcom: then: pkg-config --cflags --libs MagickCore
[07:56:53] allcentury: has joined #ruby
[07:56:57] norc_: Ox0dea: Those town names are fucking crazy.
[07:57:05] dionysus69: has joined #ruby
[07:57:27] norc_: Ox0dea: Also you cannot use a dictionary to find such things in German language
[07:57:31] norc_: Because again - composition.
[07:58:34] jackcom: pkg-config ok thanks atmosx
[07:59:22] Ox0dea: norc_: There must be some limit to the madness!
[07:59:32] norc_: Ox0dea: There is only convention but no limit.
[07:59:58] Ox0dea: But, well, it's not as "human-in-the-loop" is considered a word.
[08:00:33] Ox0dea: It matches /^\S+$/, sure, but it's clearly just four words mushed together.
[08:00:51] Ox0dea: I suspect the same "common sense" could well be applied to German.
[08:02:12] jalnt_: has left #ruby: ("Leaving")
[08:03:20] atmosx: YCM returns documention when using python, why not do that for ruby :-(
[08:03:34] Ox0dea: Python has docstrings. :/
[08:03:44] kalopsian: has joined #ruby
[08:04:11] Ox0dea: Clojure too.
[08:04:25] Ox0dea: A function's documentation actually becomes "part" of it.
[08:04:40] webus: has joined #ruby
[08:06:01] jas02: has joined #ruby
[08:06:28] sepp2k: has joined #ruby
[08:07:03] bigkevmcd: has joined #ruby
[08:07:30] skade: has joined #ruby
[08:08:32] TomyWork: has joined #ruby
[08:09:35] blaxter: has joined #ruby
[08:11:52] norc_: Ox0dea: Well, usually you only compound 2 stems together - 3 is pushing it.
[08:12:32] Ox0dea: norc_: So a dictionary is perfectly reasonable.
[08:13:04] norc_: Ox0dea: Except you need to apply all stemming rules for compounding to each word
[08:13:08] norc_: To get any possible variant.
[08:13:41] yfeldblum: has joined #ruby
[08:14:40] hahuang65: has joined #ruby
[08:14:40] norc_: Ox0dea: Thing is you can also stemmed verbal nouns for compounds.
[08:14:49] rdark: has joined #ruby
[08:14:53] Ox0dea: $ wc -l < german.dic
[08:15:05] Ox0dea: >> 1747285 ** 3
[08:15:07] ruby[bot]: Ox0dea: # => 5334469616418374125 (https://eval.in/502512)
[08:15:11] Ox0dea: This'll take a while.
[08:15:14] Macaveli: has joined #ruby
[08:15:38] sandstrom: has joined #ruby
[08:16:41] norc_: Ox0dea: No it should be relatively easy as long as you have a separate dictionary for verbs.
[08:16:51] norc_: Stemming verbs is just removing the "en" suffix.
[08:17:10] norc_: And any non-verbal noun can be just used as is from the dictionary.
[08:17:15] norc_: So yeah, should be doable.
[08:18:03] yardenbar: has joined #ruby
[08:18:30] roshanavand: has joined #ruby
[08:18:38] SCHAAP137: has joined #ruby
[08:18:52] norc_: Nevermind, this is not my topic. :S
[08:19:21] Ox0dea: Linguistics is hard, let's go programming.
[08:20:24] roshanavand: has joined #ruby
[08:20:35] norc_: Currently I am busy trying to install this rather expensive piece of API gateway. But it seems the installer is so bugged that it does not work out of the box.
[08:20:38] norc_: Not very reassuring...
[08:20:39] tubuliferous_: has joined #ruby
[08:20:40] ohaibbq: has joined #ruby
[08:21:00] pawnbox: has joined #ruby
[08:21:15] roshanavand: has joined #ruby
[08:24:18] ur5us: has joined #ruby
[08:24:30] PedramT: has joined #ruby
[08:25:15] roshanav_: has joined #ruby
[08:25:39] pawnbox: has joined #ruby
[08:25:54] jbrhbr: has joined #ruby
[08:26:02] carraroj: has joined #ruby
[08:26:15] Ox0dea: The pain means it's working. /s
[08:26:25] Rodya_: has joined #ruby
[08:26:52] tvw: has joined #ruby
[08:29:45] mark1: has joined #ruby
[08:30:46] ericfreese: has joined #ruby
[08:32:40] arup_r: has joined #ruby
[08:34:09] PedramT: has joined #ruby
[08:35:31] antgel: has joined #ruby
[08:37:33] blackms: has joined #ruby
[08:38:00] djbkd_: has joined #ruby
[08:38:05] PedramT: has joined #ruby
[08:39:50] kalopsian: has joined #ruby
[08:40:10] codecop: has joined #ruby
[08:41:12] sigurding: has joined #ruby
[08:42:31] sandstrom: has joined #ruby
[08:44:46] jackcom: i think that ruby is graph is more cuty and beautiful, but python have Anaconda. if i use Anaconda, then i can excute graph file easily
[08:45:13] jackcom: so i will use Ana??????. :(
[08:45:56] zotherstupidguy: has joined #ruby
[08:49:46] craysiii: has joined #ruby
[08:50:28] craysiii: has joined #ruby
[08:50:58] PedramT: has joined #ruby
[08:52:40] rippa: has joined #ruby
[08:53:48] jas02: has joined #ruby
[08:54:43] avril14th: has joined #ruby
[08:58:30] allcentury: has joined #ruby
[08:58:36] ta: has joined #ruby
[09:02:59] joonty: has joined #ruby
[09:04:07] ljarvis: use whatever works
[09:04:41] kiidbrian: has joined #ruby
[09:05:27] mikecmpbll: has joined #ruby
[09:05:43] joonty: has joined #ruby
[09:07:53] einarj: has joined #ruby
[09:09:09] edwinvdgraaf: has joined #ruby
[09:11:54] edwinvdgraaf: has joined #ruby
[09:12:55] jackcom: ljarvis: thanks for understanding my situation.
[09:13:31] jackcom: but i will study ruby after 10 days.
[09:13:46] Ting_: has joined #ruby
[09:14:41] benjohn: has joined #ruby
[09:16:16] jgt1: has joined #ruby
[09:16:42] sftrabbit: has joined #ruby
[09:17:21] edwinvdg_: has joined #ruby
[09:17:27] Xeago: has joined #ruby
[09:18:03] norc_: Ox0dea: It is not.
[09:18:23] Ox0dea: norc_: Are you sure it's hurting enough?
[09:18:38] norc_: It is hurting so much, that I am about to hurt some people.
[09:18:40] haraigo: has joined #ruby
[09:18:42] framlinqp: has joined #ruby
[09:19:33] norc_: If you hear a news story later tonight with the head line "Tech Salesmen Found in 3 Locations Across Town" you will know.
[09:21:49] sandstrom: has joined #ruby
[09:23:01] pandaant: has joined #ruby
[09:23:45] Ox0dea: I initially read "Salesman", which made the proposition considerably grimmer.
[09:24:18] quaristice: has joined #ruby
[09:25:11] norc_: Ox0dea: I meant to write "Salesman". :-S
[09:25:21] kalopsian: has joined #ruby
[09:25:36] norc_: Blame my hasty typing habit.
[09:26:21] Ox0dea: And also that they're homophones, of course.
[09:26:24] c0m0: has joined #ruby
[09:26:26] Ox0dea: Which is a wart.
[09:28:28] absolutejam: has joined #ruby
[09:29:31] norc_: The added advantage of blaming homophony is that it has nothing to do with me.
[09:29:41] norc_: I like your proposition.
[09:30:15] allcentury: has joined #ruby
[09:30:35] Ox0dea: Homophony, synonymy, antonymy.
[09:30:39] Ox0dea: These are great words.
[09:31:17] carraroj: has joined #ruby
[09:31:18] Ox0dea: "Homonomy" sounds like "I'm onto me".
[09:31:38] norc_: Ox0dea: Here is a quote from a wikipedia article that I find amusing: "The analysis of synonymy, polysemy, and hyponymy and hypernymy is vital to taxonomy and ontology in the information-science senses of those terms"
[09:31:39] Ox0dea: *Homonymy
[09:31:59] Ox0dea: norc_: Is that really real?
[09:32:03] norc_: Yes it is.
[09:32:10] karapetyan: has joined #ruby
[09:32:19] Ox0dea: It feels like it was written by a rapper.
[09:32:39] norc_: A rapper with a PHD in linguistics you mean.
[09:32:47] Ox0dea: There must be some?
[09:32:54] norc_: Evidently so.
[09:35:34] Bish: anyone familiar with the aws gem? im trying to get my bounces/complaints of the SES/SNS service of AWS
[09:35:53] nettoweb: has joined #ruby
[09:36:33] Ox0dea: Bish: I'm not, but I do have something for you if you're still interested in an implicit variable for blocks.
[09:36:40] herbst: has joined #ruby
[09:36:49] Bish: Ox0dea: hit me
[09:37:02] herbst: When i have a struct in a struct. Can i somehow .to_h and get only a hash without embed struct?
[09:37:05] Ox0dea: Bish: https://eval.in/502543
[09:37:25] Ox0dea: It steals _ globally, which is bad, but it's otherwise fantastic. :)
[09:37:26] Bish: and it uses the hell operator
[09:37:40] Bish: i was told it is the "hell-operator"
[09:37:49] Ox0dea: It's "stabby" in my lexicon.
[09:38:13] Ox0dea: herbst: You want the internal Structs to remain Structs, yeah?
[09:38:14] Bish: where did u find this? or did you invent it :D
[09:38:20] Ox0dea: I invented it. :P
[09:38:21] snowy: has joined #ruby
[09:38:33] Ox0dea: Some fella named shockone really liked it, and I told him it was fine to make a gem of it.
[09:38:37] herbst: Ox0dea: no actually i really just want a hash to easily use it in tests
[09:38:50] Ox0dea: herbst: I'm not sure I follow.
[09:38:57] sigurding: has joined #ruby
[09:39:09] herbst: i have structs which may contain structs. and i want them to get a hash
[09:39:26] herbst: one big hash
[09:39:27] Bish: Ox0dea: well, i do like it to, even while not understanding 100% of the code
[09:39:31] minimalism: has joined #ruby
[09:39:50] Bish: the uberscore will be available everywhere, right?
[09:39:59] Ox0dea: Bish: Yeah, it's defined as an instance method on Kernel.
[09:40:04] Ox0dea: Like #puts.
[09:40:22] Ox0dea: So it won't be available in the context of a BasicObject, but that should be okay.
[09:40:50] Ox0dea: I also took it a little further the other day: https://eval.in/502544
[09:40:58] Bish: i will shit bricks if this gets into ruby 2.x
[09:41:19] Bish: gem inc!
[09:41:22] Ox0dea: Bish: We should've been able to chain from the first. :/
[09:41:51] Bish: wow, that reminds me of erlang / prolog
[09:41:58] Ox0dea: It's more like NumPy.
[09:42:05] jamw: has joined #ruby
[09:42:07] Ox0dea: Only a lot better.
[09:42:12] Bish: but you could have this fancy quicksort implementation with it
[09:42:21] Ox0dea: Indeed. :)
[09:42:23] Bish: where [x<pivot]pivot[x>pivot]
[09:42:44] Ox0dea: Well, it absolutely has to be _, but yeah.
[09:43:14] Ox0dea: With NumPy, you say `array[array > 1]`, which looks goofy.
[09:43:24] Bish: but can i remain the father of this idea in the history books? :(
[09:43:34] huyderman: has joined #ruby
[09:45:08] koj: has joined #ruby
[09:45:43] DoubleMalt: has joined #ruby
[09:45:52] dmolina: has joined #ruby
[09:47:18] Tempesta: has joined #ruby
[09:48:27] skade: has joined #ruby
[09:48:34] chipotle: has joined #ruby
[09:48:56] Bish: and it has the same speed as .select if i understand it correctly
[09:50:54] solocshaw: has joined #ruby
[09:50:55] Ox0dea: Well, you'd say `select { |e| e > 1 && e < 4 }` normally, whereas this builds up a reduction over n filtrations, so it's slower.
[09:51:08] Ox0dea: So much quieter, though.
[09:52:57] dwfait: has joined #ruby
[09:53:56] peeja: has joined #ruby
[09:54:21] Bish: man i hope the AIs are not coming as soon and take all our work/lifes(depends)
[09:54:22] Bish: ruby brought so much fun into my worklife!
[09:54:54] jackcom: ruby chart visual is better than python chart visual?
[09:55:13] rodfersou: has joined #ruby
[09:55:22] Bish: irc trolls better than twitter trolls?
[09:55:50] ruby[bot]: "Best" and "better" are subjective. Try to use a different term.
[09:56:09] jackcom: :( i don???t understand you. i don???t decide to use python or ruby. Bish i m not troller
[09:56:18] duckpuppy: has joined #ruby
[09:56:26] shredding: has joined #ruby
[09:56:26] supergeek: has joined #ruby
[09:56:33] Bish: i've read enough of you to know that this is not the case
[09:56:33] Ox0dea: jackcom: You said earlier that Anaconda better suits your needs.
[09:56:49] karapetyan: has joined #ruby
[09:56:57] arup_r: has joined #ruby
[09:57:22] chussenot: has joined #ruby
[09:57:38] jackcom: yeah, but i think that ruby chart is more nice than python
[09:59:03] Xeago: has joined #ruby
[09:59:16] adaedra: this means nothing.
[09:59:31] FernandoBasso: has joined #ruby
[09:59:33] f4cl3y: has joined #ruby
[09:59:51] grasshopper: has joined #ruby
[09:59:57] jackcom: https://github.com/topfunky/gruff vs https://code.google.com/p/graphy/
[10:00:18] Bish: uhhh those are shiiiny
[10:01:33] Bish: wish there was a database as good as ruby, i mean sequel is great, but it's still only an interface to a shitty(imho) old database
[10:02:00] binaryplease: has joined #ruby
[10:02:08] The_Phoenix: has joined #ruby
[10:02:12] Bish: ofcourse i compare apples and pears.
[10:02:21] adaedra: Bish: what database? Sequel is an interface to multiple backends.
[10:02:41] Bish: yeah i mean SQL in general and databases that use it
[10:03:01] Bish: i never felt like there is a general databse you can use for everything, and there might not be one, ofcourse
[10:03:25] Bish: i loved mongodb, but i have a feeling if i used that in real production, it would f me over
[10:03:31] craysiii: has joined #ruby
[10:03:36] adaedra: MySQL and Postgres are pretty widespread.
[10:03:50] craysiii: has joined #ruby
[10:04:01] yfeldblum: has joined #ruby
[10:04:02] Ox0dea: Datomic isn't.
[10:04:14] ziyadb: has joined #ruby
[10:04:22] Ox0dea: Despite time travel as a feature.
[10:04:25] tAn: has joined #ruby
[10:04:56] Bish: yeah but i hate fixed column counts
[10:05:07] adaedra: It's an ongoing debate, but I think that "old database"s as you said is still going strong.
[10:05:21] Bish: yeah, sure, that's why i use mysql too, it always works it's always fast
[10:05:33] craysiii: has joined #ruby
[10:05:38] ljarvis: "it's always fast" orly
[10:05:46] Ox0dea: Give us more keks!
[10:06:00] Bish: but it doesn't feel as comfortable as it should be, but maybe it has to be this way
[10:06:01] adaedra: ACTION inserts billions of lines into Bish's database and removes all indexes
[10:06:17] craysiii: has joined #ruby
[10:06:21] Bish: it always have been fast for me with proper indexing <= better expression?
[10:06:24] adaedra: Database Design is a job, iirc.
[10:06:45] Ox0dea: Administration thereof too.
[10:07:12] ljarvis: that just tells me you dont have much data
[10:07:14] ljarvis: :trollface:
[10:07:27] adaedra: :ljarvisface:
[10:07:32] graffix222: has joined #ruby
[10:07:33] Ox0dea: :dataface:
[10:08:26] adaedra: (I know I started this, but we may move that into -offtopic )
[10:08:34] cpup: has joined #ruby
[10:09:23] chussenot: has joined #ruby
[10:13:21] mclee: has joined #ruby
[10:14:08] marr: has joined #ruby
[10:14:26] oz`: has joined #ruby
[10:19:26] romero: has joined #ruby
[10:24:48] chussenot: has joined #ruby
[10:25:19] platzhirsch: has joined #ruby
[10:27:07] craysiii: has joined #ruby
[10:29:05] Rodya_: has joined #ruby
[10:29:41] dlitvak: has joined #ruby
[10:30:17] chussenot: has joined #ruby
[10:30:58] hayden_: has joined #ruby
[10:31:24] Jackneill: has joined #ruby
[10:31:35] stannard: has joined #ruby
[10:32:42] voidDotClass: has joined #ruby
[10:32:46] DaniG2k: has joined #ruby
[10:32:59] voidDotClass: In writing rspec feature tests, how do i check that visiting / redirects to /#login?
[10:33:07] voidDotClass: i'm writing expect(page).to have_current_path "/#login"
[10:33:15] voidDotClass: but that doesn't work
[10:37:30] ldnunes: has joined #ruby
[10:39:13] gbgdev_: has joined #ruby
[10:40:44] dwfait: has joined #ruby
[10:41:49] kalopsian: has joined #ruby
[10:42:06] techsethi: has joined #ruby
[10:46:21] fsapo: has joined #ruby
[10:48:07] dlitvak_: has joined #ruby
[10:48:08] PedramT: has joined #ruby
[10:48:08] valeri_uF0: has joined #ruby
[10:48:08] _fumk: has joined #ruby
[10:48:10] El3ktra: has joined #ruby
[10:48:10] FooMunki: has joined #ruby
[10:48:10] ta: has joined #ruby
[10:48:11] Snowy_: has joined #ruby
[10:48:11] KillerFox: has joined #ruby
[10:48:18] Hexter: has joined #ruby
[10:48:37] volty: has joined #ruby
[10:49:04] edwinvdgraaf: has joined #ruby
[10:50:26] felixdd: has joined #ruby
[10:51:30] PedramT: has joined #ruby
[10:51:54] edulix_: has joined #ruby
[10:51:58] edulix_: hello people
[10:52:53] ljarvis: voidDotClass: anchors are not visible to the server
[10:53:07] voidDotClass: which server? ljarvis
[10:53:12] usershell: has joined #ruby
[10:53:55] ljarvis: voidDotClass: i.e in rails, you can't read the anchor since it's not sent to the server, and I believe current_path will use the path that the server sees
[10:54:10] toretore: has joined #ruby
[10:54:23] ljarvis: so, you probably want to test it in javascript
[10:54:34] quaristice: has joined #ruby
[10:55:21] agent_white: has joined #ruby
[10:56:21] ljarvis: voidDotClass: anyway, you should just assert what's on the page if it's a feature spec
[10:56:31] ljarvis: i.e expect(page).to include("Login")
[10:56:39] ljarvis: have_content, or w/e it is
[10:57:13] yos7ph: has joined #ruby
[10:57:29] edulix_: I ahave opensuse tumbleweed, I have execute sudo gem install bundle, but still the command bundle is not in the path. I know it is in /usr/lib64/ruby/gems/2.2.0/gems/bundler-1.11.2/exe/bundler, but why it's not automatically in the path?
[10:57:29] abc: has joined #ruby
[10:58:01] Guest97516: Hey, are there equivalents of "puts" and "p" which only print a newline after last argument, instead of after every argument?
[10:58:20] Guest97516: E.g. I would want puts 1,2,3 to print "1 2 3\n" instead of "1\n2\n3"
[10:59:18] volty: >> print 1,2,3; puts
[10:59:19] ruby[bot]: volty: # => 123 ...check link for more (https://eval.in/502576)
[10:59:51] ljarvis: print 1, 2, 3, "\n"
[11:00:12] Guest97516: Yeah, sure, if I'm gonna say "; puts" i could have said ', "\n"' as well... I meant something as convenient as puts and p
[11:00:29] Guest97516: (so that \n does not have to be mentioned explicitly)
[11:00:31] ljarvis: how is that less convenient? because yu don't have you type "\n"?
[11:01:00] dlitvak: has joined #ruby
[11:01:15] ljarvis: I'd probably use print + puts as volty did too (it's a common pattern). I was just providing another option
[11:01:18] TomyWork: Guest97516 make a myputs function (no pun intended, honest)
[11:01:34] ljarvis: function what even is that
[11:01:48] TomyWork: thingy with def in front
[11:01:57] ljarvis: that's a method
[11:01:57] TomyWork: what do you call it?
[11:02:04] TomyWork: for me it's a function
[11:02:07] PedramT: has joined #ruby
[11:02:10] TomyWork: and if it's in a class, it's a member function
[11:02:19] TomyWork: C++ supremacy!
[11:02:31] ljarvis: i feel bad
[11:02:42] RandomNi_: has joined #ruby
[11:02:51] TomyWork: i'm kidding, i dont care about what it's called
[11:02:54] TomyWork: but neither should you :)
[11:03:02] Guest97516: Right, sure. Thanks
[11:03:22] ljarvis: sure I should, I don't want to teach people the wrong thing
[11:03:59] PaulCape_: has joined #ruby
[11:04:03] TomyWork: it's only wrong if anyone cares
[11:04:52] anisha: has joined #ruby
[11:05:38] kerunaru: has joined #ruby
[11:16:01] pawnbox: has joined #ruby
[11:16:23] craysiii: has joined #ruby
[11:16:51] norc_: Ox0dea: Amazing stuff we have. So I just found out about named capture groups.
[11:17:03] Ox0dea: norc_: Hurrah!
[11:17:03] zapata: has joined #ruby
[11:17:08] norc_: Together with whitespace insensitive regular expressions and regex interpolation
[11:17:09] Ox0dea: And also their ability to introduce locals?
[11:17:14] norc_: These things become so fucking readable.
[11:17:33] norc_: Ox0dea: Wait... what?
[11:17:42] tappy: has joined #ruby
[11:18:15] Ox0dea: >> /(?<foo>\w+)/ =~ 'omg'; foo # norc_
[11:18:17] ruby[bot]: Ox0dea: # => "omg" (https://eval.in/502585)
[11:18:22] tappy: How do I do a regex match between two variables. So I need interpolation on both sides of the =~ operator
[11:18:37] Ox0dea: tappy: You just... interpolate.
[11:18:52] norc_: Ox0dea: I am no big fan of magically vivified locals :(
[11:18:57] astrofog: has joined #ruby
[11:18:58] Ox0dea: norc_: Pretty scary.
[11:18:59] konsolebox: has joined #ruby
[11:19:07] norc_: Ox0dea: I was just going to use match_data[:capture_group]
[11:19:08] tappy: Oh dear god. Yes
[11:19:21] Bish: is there a way to pool threads without any gem?
[11:19:25] tappy: Sorry. Dumbest question ever
[11:19:34] norc_: >> foo = 'bar'; /(?<foo>\w+)/ =~ 'omg'; foo
[11:19:35] ruby[bot]: norc_: # => "omg" (https://eval.in/502586)
[11:19:43] norc_: I wonder, does that shadow my old one?
[11:19:57] Bish: i have IO which needs a bit of time, and it blocks the whole main thread, so i would like to start several of them
[11:20:04] norc_: Ox0dea: Not sure whether its shadowed or overridden.
[11:20:06] Ox0dea: Er, no, the old value is definitely gone.
[11:20:16] norc_: Which would be quite relevant because GC.
[11:20:28] Bish: but those are thousands, so if i spawn a thread for every call it would f me over
[11:20:45] norc_: Ox0dea: Okay that whole feature turned from amazing to disgusting in a matter of seconds.
[11:20:59] Ox0dea: norc_: As is only right and proper.
[11:21:06] dlitvak: has joined #ruby
[11:21:07] Ox0dea: In its defense, that's the *only* situation in which it works.
[11:21:14] Ox0dea: And the LHS can't have undergone any interpolation either.
[11:22:00] craysiii: has joined #ruby
[11:22:33] Ox0dea: >> foo = Object.new; id = foo.__id__; /(?<foo>\w+)/ =~ 'omg'; GC.start; ObjectSpace._id2ref(id) rescue $! # norc_
[11:22:35] ruby[bot]: Ox0dea: # => #<RangeError: 0x2066aba0 is recycled object> (https://eval.in/502587)
[11:22:35] norc_: >> foo = 'bar'; -> { /(?<foo>\w+)/ =~ 'omg' }.call; foo
[11:22:37] ruby[bot]: norc_: # => "omg" (https://eval.in/502588)
[11:22:44] norc_: Ox0dea: now that is fucking disgusting.
[11:22:49] craysiii: has joined #ruby
[11:23:10] Ox0dea: Anyway, it does get collected if possible.
[11:23:12] norc_: Ox0dea: Yeah.
[11:23:18] tappy: has left #ruby: ("Leaving")
[11:23:26] norc_: I am not entirely sure whether my last snippet is intended behavior.
[11:23:57] Ox0dea: Er, why not?
[11:23:57] bruce_lee: has joined #ruby
[11:23:58] colegatron: has joined #ruby
[11:24:01] Ox0dea: >> foo = 1; -> { foo = 2 }.call; foo
[11:24:02] ruby[bot]: Ox0dea: # => 2 (https://eval.in/502589)
[11:24:49] norc_: Ox0dea: When you call a proc a block gets created. For that another stack frame is pushed and the EP moves up
[11:24:56] Ox0dea: That's not true.
[11:25:15] norc_: Oh this might just be a method call then
[11:25:28] norc_: Wait what is this.
[11:25:31] norc_: Why is this
[11:25:43] Ox0dea: Procs != blocks.
[11:25:59] Ox0dea: Blocks can be reified into Procs, but the reverse isn't true.
[11:26:12] norc_: >> puts RubyVM::InstructionSequence.compile("foo = 1; -> { foo = 2 }.call; foo").disasm
[11:26:13] ruby[bot]: norc_: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502590)
[11:26:31] norc_: Ox0dea: There. It gets compiled into an actual block.
[11:27:12] norc_: So the inner foo is basically a DASGN_CURR
[11:27:30] norc_: And I vaguely remember that blocks have their own vtable
[11:27:36] norc_: So this is slightly confusing.
[11:28:54] Brando753: has joined #ruby
[11:29:07] norc_: >> puts RubyVM::InstructionSequence.compile("def quux() yield; end; foo = 1; quux { foo = 2 }; foo").disasm
[11:29:09] ruby[bot]: norc_: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502591)
[11:29:13] norc_: That is effectively the same
[11:29:27] dlitvak: has joined #ruby
[11:30:01] prestorium: has joined #ruby
[11:30:03] norc_: Ox0dea: So no, procs/lambda turn into blocks in the VM.
[11:30:13] Rodya_: has joined #ruby
[11:30:30] Ox0dea: norc_: But they *do* have their own scope.
[11:30:38] norc_: Which is confusing.
[11:30:58] sftrabbit: has joined #ruby
[11:31:07] norc_: Ill dig into this tonight after finishing time
[11:31:22] Ox0dea: I suspect it's just that "block" is used as a catch-all term.
[11:31:41] donnoc: has joined #ruby
[11:31:57] norc_: Ox0dea: I dont see how they would be different.
[11:32:04] dlitvak: has joined #ruby
[11:32:06] Ox0dea: >> def m; end; foo = 1; m { foo = 2 }; foo # norc_
[11:32:08] ruby[bot]: Ox0dea: # => 1 (https://eval.in/502592)
[11:32:20] norc_: The block never gets called.
[11:32:44] Ting_: has joined #ruby
[11:32:50] norc_: Ox0dea: It is just easier to invoke a proc than it is to invoke a block.
[11:33:15] CloCkWeRX: has joined #ruby
[11:33:23] Ox0dea: Fair enough, but... how even to invoke a block (other than `yield`)?
[11:33:28] ericfreese: has joined #ruby
[11:33:32] norc_: Turn it into a proc and then use call.
[11:33:38] Ox0dea: That's invoking a Proc. :P
[11:33:43] norc_: Which considering what is happening beneath is super silly.
[11:33:58] CloCkWeRX: has joined #ruby
[11:33:58] norc_: Ox0dea: That was my point though.
[11:34:10] norc_: Ox0dea: You can only yield a block (so it is a bit unelegant)
[11:34:31] norc_: But that is by design because blocks are the only thing in Ruby that are not objects
[11:34:47] norc_: So you have no way to interact with them aside from yield and block_given?
[11:35:00] norc_: (And binding it via &foo argument)
[11:35:29] Ox0dea: norc_: defined?(yield) :P
[11:35:37] Ox0dea: I think we discussed that one?
[11:35:44] norc_: >> defined?(yield)
[11:35:45] ruby[bot]: norc_: # => nil (https://eval.in/502597)
[11:35:55] Ox0dea: It's an alias for `block_given?`.
[11:36:09] Ox0dea: (I'm serious.)
[11:36:22] norc_: By alias you mean alternate way of obtaining the same information?
[11:36:26] norc_: Or do you mean alias?
[11:36:36] Ox0dea: *synonym, then.
[11:36:39] norc_: Fair enough.
[11:36:54] volty: has left #ruby: ("Konversation terminated!")
[11:36:55] norc_: Im not really surprised. Blocks are hacked deeply into Ruby all over the implementations.
[11:37:28] Ox0dea: Which is a shame; they're quite elegant at the surface.
[11:39:16] norc_: Ox0dea: A pure lambda approach would have been better imho.
[11:39:24] norc_: Ox0dea: That would have been fairly easy to implement.
[11:39:41] Ox0dea: norc_: How do you mean?
[11:39:55] Ox0dea: Procs! Procs everywhere?
[11:40:19] norc_: Ox0dea: Indeed. Lets just ignore that they are costly to use.
[11:41:17] norc_: Ox0dea: Just the fact that you are inside a method, and you have no sensible way of referring to a block other than a random "yield" is so random.
[11:41:31] norc_: Ox0dea: Accepting a proc as an argument, and invoking #call on it - that is clean.
[11:41:49] Ox0dea: You're not wrong, but I do think some of the language's appeal would be lost there.
[11:42:46] norc_: Ox0dea: It kind of reminds of one of the worst quirks in JavaScript design regarding "this".
[11:42:48] jamw: has joined #ruby
[11:42:56] norc_: Aside from that part, it is actually a wonderful language.
[11:43:22] Ox0dea: The thing that most reminds me of JS's `this` is the difference between `self` and the default definee.
[11:43:35] Ting_: has joined #ruby
[11:43:36] Ox0dea: Blocks and `yield` are A-okay by my lights.
[11:44:03] sftrabbit: has joined #ruby
[11:44:18] norc_: Ox0dea: "this" is really the same as the first argument of instance methods in Python.
[11:44:37] norc_: Its just as bizarre and feels unpolished.
[11:44:39] voidDotClass: I have a site where most of the functionality is behind different login areas, e.g an admin area, a buyer area, a seller area, etc. how can i write rspec feature tests for it it so for all the features in admin area, it logs in as admin first, then logs out and logs back in as buyer for the buyer features, and so on?
[11:44:45] Macaveli: has joined #ruby
[11:44:54] norc_: Ox0dea: self is quite right, the name can be misleading though.
[11:45:34] Ox0dea: norc_: But the implicit receiver isn't always `self` is the point I meant to make.
[11:46:12] Ox0dea: >> [self, method(define_method(''){}).owner]
[11:46:14] ruby[bot]: Ox0dea: # => [main, Object] (https://eval.in/502598)
[11:46:31] Ox0dea: There `Object` is the "implicit receiver", which in this context is canonically called the default definee.
[11:47:11] cornerman: has joined #ruby
[11:47:35] Ox0dea: It's not even really an asymmetry.
[11:47:49] tomjoro: has joined #ruby
[11:48:18] cornerman: has joined #ruby
[11:49:13] cornerman: has joined #ruby
[11:51:29] cornerman: has joined #ruby
[11:52:18] norc_: Ox0dea: That is another random hack, though Im glad about it.
[11:52:27] norc_: Ox0dea: Otherwise Ruby would look an awful lot like Java.
[11:54:17] dlitvak_: has joined #ruby
[11:54:49] norc_: Ox0dea: Do you know of any simple hack to obtain a new binding?
[11:54:51] aryaching: has joined #ruby
[11:56:20] Ox0dea: norc_: It's really just that `main` isn't a Class, which is indeed The Right Thing.
[11:56:33] Ox0dea: norc_: Er... grab the current one and clear it?
[11:57:00] duckpuppy: has joined #ruby
[11:57:03] norc_: That does not sound like I can do this in a single line in under 80 characters. :-)
[11:57:15] Ox0dea: No, likely not.
[11:57:32] Ox0dea: Bringing Fiddle in is 15 characters alone. ;)
[11:58:15] arup_r: has joined #ruby
[11:59:16] pawnbox: has joined #ruby
[12:00:09] sigurding: has joined #ruby
[12:00:16] kalopsian: has joined #ruby
[12:01:03] arup_r: has joined #ruby
[12:01:04] Ox0dea: norc_: https://eval.in/502608
[12:01:20] Ox0dea: Unless I'm sorely mistaken, you're not the first to ask for such a thing.
[12:02:15] stamina: has joined #ruby
[12:02:17] Ox0dea: Never did get to the bottom of why that shouldn't do the trick. :<
[12:02:18] atomical: has joined #ruby
[12:03:10] djellemah_: has joined #ruby
[12:03:19] Ishido: has joined #ruby
[12:05:01] skade: has joined #ruby
[12:05:09] norc_: Ox0dea: That trick might make named capture groups bearable
[12:05:42] allcentury: has joined #ruby
[12:05:47] Ox0dea: norc_: That went well: https://eval.in/502613
[12:05:59] PaulCapestany: has joined #ruby
[12:06:41] pawnbox: has joined #ruby
[12:06:42] norc_: This has become a familiar picture to me.
[12:07:15] lucasb: has joined #ruby
[12:09:44] Cohedrin: has joined #ruby
[12:11:30] Ox0dea: norc_: There ya go: https://eval.in/502615
[12:11:38] Ox0dea: Just don't call #local_variables on it. :P
[12:11:47] solocshaw1: has joined #ruby
[12:12:04] astrofog: has joined #ruby
[12:12:21] sinkensabe: has joined #ruby
[12:12:27] norc_: Brilliant. Aside from it being completely useless you have still done it! :-)
[12:13:10] Ox0dea: > `eval': wrong argument type Binding (expected binding)
[12:13:31] rodfersou: has joined #ruby
[12:14:02] howdoi: has joined #ruby
[12:14:03] hannelita: has joined #ruby
[12:18:14] wolfedale: has joined #ruby
[12:19:33] Ox0dea: wolfedale: Your nick is an anagram of "wall of DEA".
[12:19:40] Ox0dea: Never mind.
[12:19:49] Ox0dea: *well of DEA
[12:20:01] Ox0dea: *fellow DEA
[12:20:06] Ox0dea: They're onto us!
[12:20:37] bronson: has joined #ruby
[12:21:04] FooMunki: has joined #ruby
[12:21:58] ajf-: has joined #ruby
[12:23:28] wolfedale: I'm having a problem with one of my method.
[12:23:29] techsethi: has joined #ruby
[12:23:35] wolfedale: Open3.popen3("/usr/bin/unzip -o -P pass '#{@rand_dir}#{file}' -d '#{@rand_dir}'") do |stderr ...
[12:23:57] bluOxigen: has joined #ruby
[12:24:17] karapetyan: has joined #ruby
[12:24:29] wolfedale: It works fine but when the file name has: ' it's saying that there is no such file. So for example: Test File.docx works fine. But Test File's.docx it's not :(
[12:24:48] dlitvak: has joined #ruby
[12:24:49] shevy: did you try via "File'" quotes?
[12:25:10] mondok: has joined #ruby
[12:26:08] wolfedale: I tried "#{@rand_dir}#{file}" and `#{@rand_dir}#{file}` but without the good result.
[12:26:47] lucasb: what about split the string into several arguments?
[12:27:21] Ox0dea: Or just escape the single quotes.
[12:27:37] yfeldblum: has joined #ruby
[12:28:17] wolfedale: Ox0dea: I'm not sure if I understand. How I can escape it?
[12:28:35] Ox0dea: wolfedale: It's just as if you're invoking the command like `/usr/bin/foo 'Alice's Secrets.txt'`.
[12:29:02] Ox0dea: The single quote in "Alice's" is terminating the string prematurely.
[12:30:17] lucasb: filename = "Alice';rm -rf /"
[12:30:38] asmodlol: has joined #ruby
[12:30:40] aswen: has joined #ruby
[12:30:56] Rodya_: has joined #ruby
[12:31:31] AlexRussia: has joined #ruby
[12:32:25] norc_: Screw this. Im starting to adopt internal ruby function naming. fix_fck_brk_str_from_dtag is a wonderful method name.
[12:34:37] Meow-J: has joined #ruby
[12:34:57] wolfedale: Ox0dea: I still don't know how to escape #{file} :(
[12:35:55] sdothum: has joined #ruby
[12:36:21] Ox0dea: >> "Alice's Dog's Results.pdf".gsub("'", "\\'") # wolfedale
[12:36:23] ruby[bot]: Ox0dea: # => "Alices Dog's Results.pdfs Dogs Results.pdfs Results.pdf" (https://eval.in/502629)
[12:36:30] Ox0dea: That *should* have done the trick.
[12:36:40] Ox0dea: As you can see, it has gone terribly awry.
[12:37:19] Ox0dea: >> "Alice's Dog's Results.pdf".gsub("'", "\\\\'") # wolfedale
[12:37:20] ruby[bot]: Ox0dea: # => "Alice\\'s Dog\\'s Results.pdf" (https://eval.in/502632)
[12:37:41] K1MOS: has joined #ruby
[12:37:42] Xeago: has joined #ruby
[12:37:46] Ox0dea: There ya go. Backslashes are cruise control for... something.
[12:38:11] kalopsian: has joined #ruby
[12:39:57] myntcake: has joined #ruby
[12:40:13] karapetyan: has joined #ruby
[12:41:02] nfk: has joined #ruby
[12:41:38] aupadhye: has joined #ruby
[12:42:33] wolfedale: sh: -c: line 0: unexpected EOF while looking for matching `''
[12:42:41] dlitvak: has joined #ruby
[12:42:56] wolfedale: But maybe it will be more easy to check if the file has ' and then change it's name by File.rename or something?
[12:43:44] duckpuppy: has joined #ruby
[12:44:21] bweston92: has joined #ruby
[12:44:22] lucasb: just saying that if you pass more than one argument to popen* methods, it skips the shell, thus avoiding all the escaping problems
[12:45:57] Jackneill: has joined #ruby
[12:46:29] Ox0dea: That's definitely the right way to go.
[12:47:03] jhass: what's wrong with the zip gem?
[12:48:05] jhass: or https://github.com/rubyzip/rubyzip actually
[12:48:25] jhass: wolfedale: ^
[12:48:28] Xeago: has joined #ruby
[12:50:18] aryaching: has joined #ruby
[12:50:30] freerobby: has joined #ruby
[12:51:58] ajf-: has joined #ruby
[12:52:44] Ox0dea: wolfedale: If you're hell-bent on it: gsub("'", "'\\\\''")
[12:53:10] Ox0dea: You're right.
[12:54:01] Ox0dea: I mean, it works... for some shells.
[12:54:11] jhass: it's the least proper solution I can imagine, sorry
[12:54:46] Ox0dea: "Hell-bent" connotes negatively, to clarify.
[12:55:14] jhass: honestly, it's the kind of stuff I don't even mention to avoid anybody using it
[12:55:24] jhass: I mean the alternatives are even easier
[12:55:44] jhass: like using the proper interface to spawn the subprocess
[12:56:01] jhass: there's no need to work around a shell here because there's no need to spawn a shell
[12:56:58] ponga: has joined #ruby
[12:57:07] Ox0dea: On the bright side, I think I found a bug?
[12:57:10] Ox0dea: >> 'fooXbar'.sub('X', "\\`\\'")
[12:57:11] ruby[bot]: Ox0dea: # => "foofoobarbar" (https://eval.in/502642)
[12:57:21] Ox0dea: It's treating those like $` and $'.
[12:57:57] jhass: gsub and sub are like split, too many quirks are official API by now
[12:58:02] Madmanden: has joined #ruby
[12:58:20] wolfedale: I think I will go to try rubyzip. I cannot figure out on my method :(
[13:00:52] Ox0dea: wolfedale: Do mind the caveats regarding passwords and overwriting existing files.
[13:01:28] Ox0dea: Those would be the -P and -o flags in your original approach.
[13:02:07] northfurr: has joined #ruby
[13:02:08] Ox0dea: > Zip.on_exists_proc = true
[13:02:14] Ox0dea: >> true.is_a? Proc
[13:02:16] ruby[bot]: Ox0dea: # => false (https://eval.in/502644)
[13:02:53] emilford: has joined #ruby
[13:04:09] chussenot: has joined #ruby
[13:04:24] anisha: has joined #ruby
[13:05:17] djellemah: >>def meth(arg); arg end; meth()
[13:05:18] ruby[bot]: djellemah: # => wrong number of arguments (given 0, expected 1) (ArgumentError) ...check link for more (https://eval.in/502655)
[13:05:20] djellemah: >>def meth(arg); arg end; meth ()
[13:05:21] ruby[bot]: djellemah: # => nil (https://eval.in/502656)
[13:05:40] djellemah: semi-significant whitespace again
[13:06:10] blackwhitejewish: has joined #ruby
[13:06:11] ChanServ: +b blackwhitejewish!*@*
[13:06:11] ChanServ: ChanServ kicked blackwhitejewish: Good bye
[13:06:12] jackjackdripper: has joined #ruby
[13:06:13] ruby[bot]: -b blackwhitejewish!*@*
[13:08:33] decoponio: has joined #ruby
[13:09:35] Ishido: has joined #ruby
[13:11:17] krz: has joined #ruby
[13:11:35] ponga: has joined #ruby
[13:12:04] adaedra: -o adaedra
[13:16:03] Madmanden: has joined #ruby
[13:16:26] ponga: do we have phpbb equivelant in ruby?
[13:16:48] ddv: ponga: no but something way better: discourse
[13:16:59] shevy: don't think so... best ruby forum is probably this one: https://www.ruby-forum.com/
[13:17:52] joonty: has joined #ruby
[13:17:53] aswen: has joined #ruby
[13:18:24] Ox0dea: > Powered by RForum
[13:18:28] Ox0dea: What is that?
[13:18:50] shevy: that strange forum thingy
[13:18:55] ponga: shevy: ddv sorry i wasn't asking for forum to communicate, i was referring if we have a software equivelant of phpbb
[13:19:02] ddv: ponga: try discourse
[13:19:08] Ox0dea: ponga: The markup syntax?
[13:19:20] ponga: ddv: you mean i should try talking to you people?
[13:19:26] ponga: oh wait, there is a thing called discourse?
[13:19:35] Limix: has joined #ruby
[13:19:40] ddv: ponga: https://www.discourse.org
[13:19:46] ponga: god damn it why is everything named to a certain noun to trick me everytime
[13:20:04] sdothum: has joined #ruby
[13:21:42] Ox0dea: "It's written in Python." "Python what? Scales? Python fangs?" "Blood."
[13:23:26] maia: has joined #ruby
[13:25:33] sdothum: has joined #ruby
[13:25:50] maia: Hello. I have a gem that supports 20+ languages, and for each language there are quite a lot of defined constants (arrays and hashes of strings and regexs).
[13:25:56] maia: Is there a way to dynamically require only the languages currently needed, instead of loading all supported languages into memory?
[13:26:31] ponga: wow i never thought of that
[13:26:35] ponga: multilingual gem
[13:26:54] shevy: maia you could try to use load() and only load when the language is needed (the respective .rb files)
[13:27:21] Ox0dea: For which autoload is a thing.
[13:27:38] sdothum: has joined #ruby
[13:27:44] shevy: matz does not approve
[13:28:00] ponga: matz does not approve autoload?
[13:28:12] shevy: I dunno, it was changed at one point again
[13:28:17] lucasb: I saw somewhere that autoload would go away in Ruby 3
[13:28:34] maia: shevy: I thought Kernel#load will load the code on each call, without checking if already loaded?
[13:28:36] shevy: ponga however 4 years ago he said that: https://bugs.ruby-lang.org/issues/5653
[13:29:02] shevy: maia yeah but you can specify which files you need right?
[13:29:11] ponga: maia: can you not deconstruct gem and remove the multilinguals?
[13:29:34] Papierkorb: Try loading the language specific parts from a configuration-esque file, e.g. a YAML file
[13:29:55] usershell: has joined #ruby
[13:29:56] Papierkorb: (If that is possible in your case)
[13:30:04] maia: ponga: well, I???m trying to improve the gem, not to rip it apart. and I don???t like the fact that it requires all supported languages.
[13:30:05] aswen: has joined #ruby
[13:30:25] ta: has joined #ruby
[13:30:35] binaryplease: has joined #ruby
[13:30:36] hanneli: has joined #ruby
[13:30:58] Ox0dea: maia: How do you determine which languages are necessary?
[13:31:03] maia: Papierkorb: oh, so its possible to load from yaml on demand, and only once per session?
[13:31:17] synthroid: has joined #ruby
[13:31:35] Papierkorb: maia: it's code afterall. Something like the internationalizing stuff in rails does.
[13:31:44] Rodya_: has joined #ruby
[13:31:59] maia: Ox0dea: it???s a gem that processes strings. When passing a string to the gem, you pass the language of the string.
[13:32:20] hannelita: has joined #ruby
[13:32:33] maia: So it could happen that all strings are english, but in other use cases the languages could differ.
[13:32:46] aswen: has joined #ruby
[13:32:48] Papierkorb: maia: in that case, beware of multi-threading issues you may have when 'autoloading' that configuration. How big is the overhead anyway?
[13:32:50] ponga: shevy: actually, i became curious, can you manually declare what to use inside a gem?
[13:33:12] ponga: I always thought of require 'thingi' and that's it
[13:33:16] Ox0dea: maia: So then just maintain a Set of the currently loaded languages, and only Kernel#require the requisite files if the Set doesn't yet contain that language, and then insert it so you only load once.
[13:33:37] maia: Papierkorb: it???s not bit at the moment, but it might increase in time (the gem is in early development).
[13:33:43] Ox0dea: ponga: That's it.
[13:33:46] Papierkorb: Just require it? Ruby keeps track of what has been required anyway
[13:33:51] shevy: ponga it is just ruby code, with different .rb files, you can do all the magic inside there the moment you pull in these .rb files (which usually happens by require 'name_here')
[13:33:59] Ox0dea: Papierkorb: True enough.
[13:34:03] shevy: ponga the author of the did-you-mean gem had a trick
[13:34:21] Ox0dea: Papierkorb: `$LOADED_FEATURES.clear` ;)
[13:34:27] shevy: ponga https://github.com/yuki24/did_you_mean look at the extra features
[13:34:31] techsethi: has joined #ruby
[13:34:44] maia: Ox0dea: would your suggestion cause problems when multi-threading?
[13:34:53] Ox0dea: maia: It's overkill. I derped.
[13:34:58] aswen: has joined #ruby
[13:34:59] ponga: shevy: ok this is becoming stupid of me, but isn't # require 'gem' automatically puts all its codes onto memory right away?
[13:35:06] ericfreese: has joined #ruby
[13:35:21] ponga: i always thought that is what is done behind the curtain
[13:35:34] Papierkorb: maia: Just load everything that could be needed AOT on startup. How much is it? Probably much less than 1MiB of memory?
[13:35:51] shevy: ponga depends on the code, you can have code such as: def foo; require 'bar'; end
[13:35:54] Ox0dea: require('foo') is essentially eval(File.read('foo'))
[13:36:14] ponga: Ox0dea: omg that clarifies so many things sir
[13:36:21] Ox0dea: ponga: Happy to help. ^_^
[13:36:36] asmodlol: has joined #ruby
[13:36:37] Papierkorb: maia: That will keep you from hitting interesting multi-threading issues later on. I'd just not load files which you know will never be needed, e.g. because a certain language is not activated for the environment.
[13:37:00] maia: Papierkorb: it could be a few MB. I don???t want to overcomplicate things, but thought there might be a common way to handle localization files, other than requiring them all.
[13:37:29] ponga: so if all 20 languages are included in a single gem, how could he seperate them
[13:37:31] Papierkorb: maia: What are those 'localization files'? You mentioned regexes - So is it actually some kind of language processing?
[13:38:47] ponga: shevy: I looked at it, thnx 'did you mean' looks very helpful
[13:39:06] shevy: he even fixed "def initialize" !
[13:39:09] ponga: Papierkorb: I guess it is, he said its string processing gem
[13:39:13] shevy: I meant "def intialize"
[13:39:31] ponga: shevy: i don't get your joke there sir
[13:39:35] maia: Papierkorb: yes. there???s a constant array storing stop words, a hash storing contractions ('can???t??? => 'can not???), and some language specific rules that are stored as regex (e.g. common ways of displaying a date differ between languages).
[13:39:52] krz: Cant get this quite right. ap ["a", "b", 5, "c", 4, "d", "a1", "a12", 3, 13, 2].sort_by { |x| x.to_s } I want to order the array by int and strings
[13:39:58] shevy: yeah I wanted to mistype it but ended up typing it correctly. But I used to have errors like: class Foo; def intialize and I did not know why this did not work
[13:40:24] krz: in this case the output should be [2, 3, 4, 5, 13, "a", "a1", "a12", "b", "c", "d"]
[13:40:28] krz: Any ideas?
[13:40:30] shevy: ponga it's one of those "extra features" part of his gem, that is not enabled by default
[13:40:48] dwfait: has joined #ruby
[13:40:58] Papierkorb: maia: Then at some point you'll likely have language specific code, so a YML file or something is not a great idea. I wouldn't waste too much thought into this. You could say that users have to require 'the_gem/languages/language_name' themselves for every language they want to support
[13:41:20] duckpuppy: has joined #ruby
[13:41:46] Papierkorb: maia: That's basically the model gems like 'parser' for different versions of ruby do it. Sounds like a fair model to me, and avoids threading issues. As it will be needed, it's also not wasted memory.
[13:41:56] maia: Papierkorb: I guess that???s a very smart suggestion. Thanks a lot.
[13:41:58] ponga: what? you can do # require 'gem/hello/bonjour' ?
[13:41:59] mfb2: has joined #ruby
[13:42:12] ponga: should write this down on my cheatsheet
[13:42:25] allcentury: has joined #ruby
[13:43:27] Papierkorb: ponga: mh? all gems are in the lookup path, when you do require 'the_gem' it thus looks into the paths and will eventually get to the_gem/lib/the_gem.rb and load it. So, yes.
[13:43:34] jamw: has joined #ruby
[13:43:45] shevy: ponga you can even use it for tricks such as: require 'gem/autoinclude' if you are too lazy to do a include Bla
[13:43:52] ponga: Papierkorb: then isn't his problem easily solved by # require 'gem/english' ?
[13:43:58] ponga: only importing what he needs
[13:44:04] shevy: that would work as well
[13:44:06] Papierkorb: ponga: correct, that's what I suggested above
[13:44:20] ponga: then I wonder what all the fuss is about
[13:44:24] shevy: maia can now be on the way to happiness
[13:44:57] dlitvak: has joined #ruby
[13:46:02] Papierkorb: maia: is that gem OSS?
[13:46:05] karapetyan: has joined #ruby
[13:46:06] maia: The suggestion above is very helpful, I just initially hoped there???s a way to require files on demand, without running into threading issues.
[13:46:11] ponga: shevy: my prior saying of the need to switch to python was hindered by an unexpected fact
[13:46:19] ponga: looks like I have to carry on with ruby
[13:46:34] shevy: I thought your whole team consists of snakes
[13:46:43] ponga: shevy: thing was, python is a minority for japanese, ruby is major for them
[13:46:49] maia: Papierkorb: it has a MIT license, so yes.
[13:46:56] shevy: cool, the japanese have got it right
[13:47:15] ponga: and as you know, my target is japanese, so..
[13:47:15] griffindy: has joined #ruby
[13:48:42] arup_r: has joined #ruby
[13:48:43] Ox0dea: krz: How did this happen?
[13:49:13] ponga: shevy: I just never liked python's style anyway, ruby code looks more natural to me
[13:49:48] ponga: I still go 'wtf' at using colon for method
[13:50:20] shevy: for me it is the explicit self that is throwing me off
[13:50:26] shevy: especially when it is not called self
[13:50:40] ponga: shevy: can you give me an example
[13:50:41] stannard: has joined #ruby
[13:50:47] sftrabbit: has joined #ruby
[13:51:15] shevy: ponga http://stackoverflow.com/questions/1984104/python-how-to-avoid-explicit-self/1984121#1984121
[13:51:46] shevy: a new hybrid language between ruby and python would be fun
[13:52:37] ponga: shevy: actually I would want a hybrid between swift and ruby
[13:52:45] Ox0dea: shevy: http://rupy.eu/
[13:52:50] Ox0dea: That idea is kill.
[13:52:55] ponga: legend of zelda afterall?
[13:53:33] Ox0dea: The logo could totally have been a Blue Rupee.
[13:54:00] aswen: has joined #ruby
[13:54:02] ponga: yeah, we missed the granduer chance
[13:55:11] dwfait: has joined #ruby
[13:55:52] sgambino: has joined #ruby
[13:56:02] lipoqil: has joined #ruby
[13:56:02] dlitvak_: has joined #ruby
[13:56:08] ponga: shevy: I read it , um i don't quite get it don't we also have self? what is it mean by its explicit?
[13:56:18] Ox0dea: >> ["a", "b", 5, "c", 4, "d", "a1", "a12", 3, 13, 2].group_by(&:class).values.reverse.map(&:sort).reduce(:+) # krz
[13:56:20] ruby[bot]: Ox0dea: # => [2, 3, 4, 5, 13, "a", "a1", "a12", "b", "c", "d"] (https://eval.in/502670)
[13:56:20] karapetyan: has joined #ruby
[13:56:25] Bish: what's good in swift?
[13:56:32] ponga: Bish: its compiled
[13:56:36] Ox0dea: krz: Not nearly as easy as you might've hoped, indicating that your data is too crazy.
[13:56:46] aswen: has joined #ruby
[13:56:49] Bish: ponga: so you want crystal?
[13:57:00] ponga: Bish: yes I am in that channel
[13:57:06] ponga: oh no this IRC client isn't
[13:57:07] Bish: good for you!
[13:57:09] skade: has joined #ruby
[13:57:12] peeja: has joined #ruby
[13:57:20] ponga: Bish: Im a huge fan of crystal :)
[13:57:49] Bish: i tested it, liked it, but they don't have (good) multithreading yet
[13:57:57] Bish: still, super interesting project
[13:58:00] Jardayn: has joined #ruby
[13:58:05] Bish: llvm is a god sent
[13:58:12] asmodlol: has joined #ruby
[13:58:18] Papierkorb: No threading yet in there, they're working on it though.
[13:58:35] shevy: ponga yeah we have self too but we don't have to pass it like noobs as part of an argument list
[13:58:43] Bish: yep, as soon as it's ready i will try some stuff with it
[13:59:08] Bish: wait, can you actually write a kernel with crystal :D that'd dope
[13:59:15] ponga: shevy: ah yeah true... It has self as an argument in every line..why would they do that?
[13:59:25] K1MOS: has joined #ruby
[13:59:35] Bish: RubyO???
[14:00:02] ponga: ok fine then a hybrid between C# and ruby
[14:00:08] ponga: actually I really like C#
[14:00:10] joonty: has joined #ruby
[14:00:10] Bish: shit i made it worse
[14:00:11] atomical: has joined #ruby
[14:00:17] shevy: ponga I assume because they had no alternative; probably they also did not use @ ... they use @ already for something else, these weird decorator things
[14:00:22] Xeago: has joined #ruby
[14:00:27] Bish: how is c# any different from ruby?
[14:00:52] Bish: i mean.. they both run on the same vm ( ironruby ) so they can do the same stuff?
[14:00:56] Bish: i didn't mean it as i said it
[14:01:10] aswen: has joined #ruby
[14:01:11] ponga: Bish: what? C# runs on ironruby?
[14:01:13] ljarvis: they both run on ironruby, what?
[14:01:14] Bish: i tried c# because i liked monodevelop ( i hate all other ides )
[14:01:24] Bish: yeah that's what i meant, clearly
[14:01:27] ljarvis: c# does not run on ironruby
[14:01:32] Bish: don't act like you don't know what i mean
[14:01:39] ponga: no, I don't
[14:01:48] ponga: Im the mascot of foolishness in this channel
[14:01:53] Bish: ironruby runs on a vm, c# runs on a vm, hey it's the same vm
[14:01:57] ponga: shevy: aren't I shevo?
[14:01:58] ljarvis: ironruby is just a ruby implementation that's integrated with the .NET framework
[14:02:21] shevy: ponga I can't remember! you have been gone for too long a time
[14:02:30] ljarvis: yes you can use ironruby code from c#, is that what you meant?
[14:02:35] ljarvis: this question is incredibly ambiguous
[14:02:54] ponga: C# to me looks like a whole upgrade from horrible Java
[14:03:04] Bish: i said they have the same vm, so there is a possibility they can interact, that was actually the plan with ironruby and .net itself, isn't it?
[14:03:06] ljarvis: yeah c# is actually really nice
[14:03:14] ponga: its like you had a shit experience with a girl, then you meet a totally better girl
[14:03:19] Bish: i tried c# and hated even more than java
[14:03:26] Bish: or should i say
[14:03:28] Bish: HatedItMore()
[14:03:33] ponga: Bish: why?
[14:03:39] ponga: how can you hate something more than java?
[14:03:42] ponga: that's impossible
[14:03:46] ljarvis: ACTION kinda likes java
[14:03:53] shevy: GRAB THE PITCHFORKS!!!
[14:04:02] dionysus69: has joined #ruby
[14:04:08] Bish: i started with sockets, and ended up creating 5 objects until i had a connection
[14:04:13] ponga: shevy: I will ask the north to prepare his alledged hydrogen bomb
[14:04:15] Bish: and then i uninstalled it
[14:04:17] ljarvis: luckily i'm happy enough in life to avoid the hate and instead point it towards php and javascript
[14:04:31] shevy: ponga send in ITF Taekwondo, they be more effective
[14:04:35] Bish: i like php and javascript
[14:04:42] Bish: well javascript more than php
[14:05:04] ponga: and we have who likes php ?
[14:05:16] ponga: shevy: mine got what has this channel turned into?
[14:05:16] kalopsian: has joined #ruby
[14:05:21] sftrabbit: has joined #ruby
[14:05:34] shevy: ponga it is now moderated with happiness and love!
[14:05:49] ruby[bot]: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
[14:06:00] Bish: happiness and love is offtipic :(
[14:06:11] ponga: thanks ruby[bot], I didn't know your AI was so impressive
[14:06:24] ponga: does he run on some sort of NLP?
[14:06:33] ponga: or is he man-driven?
[14:06:39] ljarvis: he's op-driven
[14:06:47] aryaching: has joined #ruby
[14:07:15] ponga: ruby[bot]: hello do you run on weak AI consisted of NLP scripts?
[14:07:39] Papierkorb: ponga: [15:05] <ljarvis> ?ot
[14:07:50] ljarvis: spoil sport
[14:07:58] ponga: Papierkorb: what is ?ot
[14:08:07] ponga: ah ?off-topic, sorry
[14:08:20] pawnbox: ponga: I think s/he/it just catches instances of other languages. :)
[14:08:32] ponga: so ruby[bot] reads the lines and use NLP to check if its off-topic? impressive!!
[14:08:34] pawnbox: Like javascript maybe.
[14:09:34] jhass: ponga: don't drink and IRC
[14:09:50] ponga: jhass: Im not pissed, im just uneducated yet
[14:10:04] ponga: for example, I can't understand what 's/he/it/' is
[14:10:12] hannelita: has joined #ruby
[14:10:13] ponga: s/ is sarcasm righ?
[14:10:15] jhass: it's offtopic at this point
[14:10:23] jhass: don't continue
[14:10:46] peeja: has joined #ruby
[14:11:00] weckl: has joined #ruby
[14:11:14] kt2: has joined #ruby
[14:12:04] shevy: see ponga - love and happiness!
[14:12:17] arup_r: ponga: hi.. hw r u ?
[14:12:21] kalopsian: has joined #ruby
[14:12:27] arup_r: I see u after years.. :)
[14:12:28] ponga: I'm stunned
[14:12:37] ponga: and very sad
[14:13:03] nettoweb: has joined #ruby
[14:13:15] arup_r: ok, but it is 2016..
[14:13:38] ponga: arup_r: hello I'm very confused of many terminologies that appear here
[14:14:15] arup_r: yeah, channel still belongs to 90's :p
[14:15:39] ponga: arup_r: thing is I was experimenting myself with python, didn't like use of : and many things, came back to ruby
[14:16:10] darkf_: has joined #ruby
[14:17:08] arup_r: yeah, like me. My first python program didn't run due to indentation, but my first ruby program ran. So I am still with Ruby..
[14:17:21] duckpuppy: has joined #ruby
[14:18:20] ponga: arup_r: and thankfully ruby is more major than python in ruby, at least it seems so to me
[14:18:25] ponga: * i mean in japan
[14:19:31] dorei: has joined #ruby
[14:20:10] norc_: What kind of encoding is this? ????????????
[14:20:21] norc_: How can I figure this out?
[14:21:08] nanoz: has joined #ruby
[14:21:41] puria: has joined #ruby
[14:21:46] tvw: has joined #ruby
[14:22:32] Bish: norc_: what encoding :o?
[14:24:58] kalopsian: has joined #ruby
[14:24:59] sdwrage: has joined #ruby
[14:25:36] bascht: has joined #ruby
[14:25:40] chussenot: has joined #ruby
[14:26:16] dlitvak: has joined #ruby
[14:26:24] Papierkorb: norc_: store it in a file and use the 'file' utility
[14:26:36] TomPeed: has joined #ruby
[14:26:52] grill: has joined #ruby
[14:26:56] norc_: Papierkorb: It claims UTF-8 Unicode.
[14:27:09] norc_: Then the codepoints would be completely borked though.
[14:27:15] |ifei5g00d: has joined #ruby
[14:30:05] TomyWork: norc_ if you paste it to a file using a text editor chances are your editor saves it as utf-8
[14:30:13] TomyWork: find a better way
[14:30:19] B1n4r10: has joined #ruby
[14:31:05] UtkarshRay: has joined #ruby
[14:31:33] norc_: TomyWork: Nope.
[14:31:51] TomyWork: wel then not
[14:32:35] norc_: [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604] are the codepoints for a string that should be "Beethoven"
[14:32:42] norc_: This is confusing.#
[14:32:49] ponga: norc_: to find out what the letter encoding is, I often just put that onto browser, and do the 'automatic encoding for the webpage'
[14:32:52] Rodya_: has joined #ruby
[14:33:12] TomyWork: that looks like it's close to 2^20 if that helps in any way
[14:33:19] TomyWork: utf-16be maybe?
[14:33:23] rodfersou: has joined #ruby
[14:33:36] wolfedale: jhass: https://gist.github.com/wolfedale/fc4da012b1b037381734 , Now it's working (so far) :-)
[14:33:44] absolutejam: has left #ruby: ("WeeChat 1.3")
[14:33:45] dorei: >> "Beethoven".codepoints
[14:33:47] ruby[bot]: dorei: # => [66, 101, 101, 116, 104, 111, 118, 101, 110] (https://eval.in/502697)
[14:34:20] TomyWork: >> "Beethoven".codepoints.map {|x| x*256}
[14:34:44] norc_: ponga: No luck on that.
[14:34:45] TomyWork: bot doesnt like me
[14:34:53] norc_: >> "Beethoven".codepoints.map {|x| x*256}
[14:34:54] ruby[bot]: norc_: # => [16896, 25856, 25856, 29696, 26624, 28416, 30208, 25856, 28160] (https://eval.in/502698)
[14:34:58] norc_: Works for me!
[14:35:12] norc_: TomyWork: Does not look like utf-16be
[14:35:18] TomyWork: no such luck anyway
[14:35:28] norc_: If its any help the source language is German.
[14:35:40] dorei: probably someweird iso then
[14:36:02] TomyWork: iso-8859-15 if anything
[14:36:03] usershell: has joined #ruby
[14:36:21] TomyWork: and the base latin alphabet exactly maps to utf-8
[14:38:13] TomyWork: >> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].map {|x|x-1024**2}
[14:38:14] ruby[bot]: TomyWork: # => [29, 27, 27, 30, 31, 17, 32, 27, 28] (https://eval.in/502702)
[14:38:48] dorei: > [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].map {|x| x.to_s(16) }
[14:38:54] dorei: >> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].map {|x| x.to_s(16) }
[14:38:56] norc_: TomyWork: It will not work like that.
[14:38:56] ruby[bot]: dorei: # => ["10001d", "10001b", "10001b", "10001e", "10001f", "100011", "100020", "10001b", "10001c"] (https://eval.in/502703)
[14:39:11] norc_: [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].map { |a| a - 1048605 }
[14:39:12] TomyWork: this looks like huffman-encoded or something
[14:39:14] norc_: >> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].map { |a| a - 1048605 }
[14:39:15] ruby[bot]: norc_: # => [0, -2, -2, 1, 2, -12, 3, -2, -1] (https://eval.in/502704)
[14:39:16] TomyWork: could be worse
[14:39:21] TomyWork: could be ebcdic
[14:39:48] norc_: It definitely does not have the same ASCII order of characters.
[14:40:08] dorei: >> [0x1d, 0x1b, 0x1b, 0x1e, 0x1f, 0x11, 0x20, 0x1b, 0x1c].map(&:chr)
[14:40:09] ruby[bot]: dorei: # => ["\x1D", "\e", "\e", "\x1E", "\x1F", "\x11", " ", "\e", "\x1C"] (https://eval.in/502705)
[14:41:14] sinkensabe: has joined #ruby
[14:42:39] TomyWork: >> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].zip("Beethoven".codepoints).map {|(x,y)|x-y-1024**2}
[14:42:40] asmodlol: has joined #ruby
[14:42:41] ruby[bot]: TomyWork: # => [-37, -74, -74, -86, -73, -94, -86, -74, -82] (https://eval.in/502709)
[14:42:54] casadei: has joined #ruby
[14:43:15] TomyWork: (imo that ".map" should be superfluous, but it didnt work on my ruby without it)
[14:43:15] dorei: looks more like a cryptogram, than a encoding issue xD
[14:43:41] TomyWork: a crappy substitution cypher though
[14:43:52] dorei: maybe the numbers have the wrong endianess
[14:43:59] norc_: Well... the input comes from just straight copy pasting out of a PDF file...
[14:44:04] TomyWork: t and v have the same offset, hmmmm
[14:44:12] dorei: or maybe they're ebcdic
[14:44:28] sankaber: has joined #ruby
[14:44:32] dorei: norc_: can you paste that string somewhere in the web?
[14:45:20] TomyWork: >> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].zip("beethoven".codepoints).map {|(x,y)|x-y-1024**2}
[14:45:22] ruby[bot]: TomyWork: # => [-69, -74, -74, -86, -73, -94, -86, -74, -82] (https://eval.in/502710)
[14:45:56] norc_: dorei: Let me think of something
[14:46:27] norc_: TomyWork: Mind the capital B at the beginning of Beethoven.
[14:47:22] TomyWork: norc_ yeah i was trying with lowercase b
[14:47:57] norc_: dorei: Pastie.org seems to timeout when trying to paste this.... :-)))
[14:48:17] norc_: Oh well, usual CloudFlare.
[14:48:36] norc_: dorei: http://pastie.org/10691239
[14:48:40] asmodlol: has joined #ruby
[14:49:00] norc_: That is 2 strings there. The line beneath each contains the bizarre encoding.
[14:49:03] jaiks: has joined #ruby
[14:49:07] stannard: has joined #ruby
[14:51:22] vikas027: has joined #ruby
[14:51:35] sankaber: has joined #ruby
[14:53:13] dmonster: has joined #ruby
[14:53:29] aryaching: has joined #ruby
[14:54:17] stannard: has joined #ruby
[14:54:21] hannelita: has joined #ruby
[14:54:28] mikecmpbll: has joined #ruby
[14:55:05] TomyWork: did anyone actually try ebcdic yet?
[14:55:56] Xeago: has joined #ruby
[14:56:05] norc_: TomyWork: The codepoints make no sense in EBCDIC
[14:57:31] dlitvak_: has joined #ruby
[14:57:57] TomyWork: it still has something like codepoints
[14:58:24] norc_: give me a second
[14:58:33] havenwood: >> Encoding.find 'ebcdic-cp-us'
[14:58:34] ruby[bot]: havenwood: # => #<Encoding:IBM037 (dummy)> (https://eval.in/502712)
[14:58:49] davedev24: has joined #ruby
[14:59:44] dlitvak_: has joined #ruby
[14:59:45] bithon: has joined #ruby
[15:00:04] govg: has joined #ruby
[15:00:15] norc_: TomyWork: I just get Iconv::IllegalSequence for anything so far.
[15:00:40] duckpuppy: has joined #ruby
[15:00:53] eve: has joined #ruby
[15:01:03] workmad3: has joined #ruby
[15:01:16] eve: BigDecimal('-0.5').power(BigDecimal('0.2')) # => Math::DomainError: Zero or negative argument for log
[15:01:16] FernandoBasso: has joined #ruby
[15:02:07] bmalum: has joined #ruby
[15:02:12] norc_: >> Encoding
[15:02:14] ruby[bot]: norc_: # => Encoding (https://eval.in/502713)
[15:02:16] TomyWork: 5th root of -0.5...
[15:02:35] TomyWork: should be fine
[15:02:42] norc_: >> BigDecimal('-0.5').power(BigDecimal('0.2'))
[15:02:54] norc_: >> BigDecimal('-0.5').power(BigDecimal('0.2'))
[15:02:57] TomyWork: but remember, this isnt exact science
[15:03:05] cdg: has joined #ruby
[15:04:07] eve: https://eval.in/502716
[15:04:27] TomyWork: what does wolframalpha say?
[15:04:49] nettoweb: has joined #ruby
[15:04:58] dionysus69: has joined #ruby
[15:05:01] eve: http://www.wolframalpha.com/input/?i=-0.5%5E0.2
[15:05:24] rubyfanfr: has left #ruby: ()
[15:05:38] eve: same as -0.5**0.2 # => -0.8705505632961241
[15:06:24] TomyWork: oh so ** works but power breaks?
[15:06:31] TomyWork: mabye it goes via other types
[15:06:37] eve: TomyWork, no, floats work, bigdecimal don't
[15:06:50] TomyWork: i wouldn't expect either of them to work
[15:06:58] TomyWork: since, you know, 0.2 isnt exactly 1/5
[15:07:13] willv: has joined #ruby
[15:07:15] TomyWork: ...when expressed as floating-point numbers
[15:08:01] norc_: TomyWork: Im starting to get some ideas about this.
[15:08:23] TomyWork: i think it should even be an infinite periodic rational number in base 2...
[15:08:45] norc_: TomyWork: This has to be related to UTF-32 somehow.
[15:09:20] TomyWork: ev_ http://www.wolframalpha.com/input/?i=0.2+in+base+2 i was right
[15:09:23] norc_: Have not found a way to transform it, but it has to.
[15:09:31] TomyWork: it's infinite and periodic in base 2
[15:10:01] chipotle: has joined #ruby
[15:10:11] eve: eh, nice :)
[15:10:31] TomyWork: arbitrary precision is still finite :)
[15:11:25] hxegon: has joined #ruby
[15:11:42] momomomomo: has joined #ruby
[15:12:09] jackcom: has joined #ruby
[15:13:56] eve: still looks like a bug, no?
[15:16:41] gizmore: has joined #ruby
[15:17:20] norc_: TomyWork: Sigh I give up. Every tool keeps telling me this is UTF-8
[15:17:22] kiidbrian: has joined #ruby
[15:17:48] flov: has joined #ruby
[15:17:59] whippythellama: has joined #ruby
[15:18:08] pawnbox: has joined #ruby
[15:18:20] kiidbrian: has joined #ruby
[15:19:48] carraroj: has joined #ruby
[15:21:08] kalopsian: has joined #ruby
[15:22:02] skade: has joined #ruby
[15:22:11] bronson: has joined #ruby
[15:22:26] rodolfowtf: has joined #ruby
[15:24:05] nerfando: has joined #ruby
[15:24:22] pawnbox_: has joined #ruby
[15:25:44] st0opkid: has joined #ruby
[15:26:19] shredding: has joined #ruby
[15:26:38] pawnbox: has joined #ruby
[15:26:57] dlitvak: has joined #ruby
[15:27:22] sftrabbit: has joined #ruby
[15:28:17] dtordable: has joined #ruby
[15:29:13] dn5: has joined #ruby
[15:30:50] kbni: has joined #ruby
[15:30:54] kbni: Hi there.
[15:31:19] dwfait_: has joined #ruby
[15:31:24] Bish: kbni: HI
[15:31:39] matp_: has joined #ruby
[15:31:41] kerunaru: has joined #ruby
[15:32:10] mrtomme: has joined #ruby
[15:32:17] dionysus70: has joined #ruby
[15:33:13] kbni: I'm very new to Ruby, I am just sort of playing with a bit. I was wondering if someone could help me explain some Ruby behavior for me that I am a little miffed by.
[15:33:29] Rodya_: has joined #ruby
[15:33:42] kbni: What exactly is the difference between object do |x| stuff end and object stuff
[15:34:06] yardenbar: has joined #ruby
[15:34:18] gbgdev: has joined #ruby
[15:34:42] Dfoolz: has joined #ruby
[15:34:47] eve: kbni, hi! soo in your case `object` must be a method for this to make sense
[15:35:05] eve: in first case you will be passing a `do ... end` block to it, in second - argument `stuff`
[15:36:07] aryaching: has joined #ruby
[15:36:23] ericfreese: has joined #ruby
[15:36:56] jinie: has joined #ruby
[15:37:26] kbni: ev_, I am using Nokogiri::XML::Builder to play with some XML stuff, and from within a block I can do xml.foo and it just creates a foo tag
[15:37:33] dfinninger: has joined #ruby
[15:37:50] Scient: has joined #ruby
[15:37:52] dlitvak: has joined #ruby
[15:38:03] kbni: ev_, however - if I do @cursor = xml.foo to save that location to my class, when I reference it later on (using self.cursor) it behaves completely differently
[15:38:12] dn5: Is there a way to run a method on any exception/error thrown by script?
[15:38:34] async_prince: has joined #ruby
[15:38:36] aegis3121: has joined #ruby
[15:38:38] veloutin: has joined #ruby
[15:38:42] dannluciano: has joined #ruby
[15:38:42] dn5: Like instead of crashing and displaying error, the script will continue with particular method called
[15:39:27] isene: has joined #ruby
[15:39:44] sonne: has joined #ruby
[15:40:09] eve: kbni, I think you can't use Nokogiri::XML::Builder like that
[15:40:35] gilesww: has joined #ruby
[15:40:52] kbni: is there a xml library that would allow me to dynamically build an xml document? maybe something like lxml/etree in Python?
[15:41:01] grassass: has joined #ruby
[15:41:11] usershell: has joined #ruby
[15:41:24] abyss: has joined #ruby
[15:41:31] ruisantos: has joined #ruby
[15:41:51] ddv: kbni: nokogiri?
[15:42:21] snapcase: has joined #ruby
[15:42:36] Janno: has joined #ruby
[15:42:39] dlitvak: has joined #ruby
[15:43:29] rippa: has joined #ruby
[15:44:19] jamw: has joined #ruby
[15:44:26] cornerman: has joined #ruby
[15:45:55] lucasb: has joined #ruby
[15:47:39] lucasb: >> lambda { block_given? }.call {}
[15:47:41] ruby[bot]: lucasb: # => false (https://eval.in/502737)
[15:47:54] lucasb: ^^ I would have expected this to work
[15:48:10] lucasb: lambda {|&b| b }.call {} # <-- this way works O.o
[15:48:24] dlitvak: has joined #ruby
[15:48:33] al2o3-cr: has joined #ruby
[15:51:53] pawnbox: has joined #ruby
[15:52:44] A124: has joined #ruby
[15:53:59] pawnbox: has joined #ruby
[15:54:16] tjohnson: has joined #ruby
[15:54:29] aryaching: has joined #ruby
[15:55:01] TomyWork: dn5 ruby code is more of a program than a script in that regard
[15:55:28] TomyWork: catching all exceptions and just continuing would be pretty catastrophic to most programs
[15:55:49] Bish: i've seen a lot of those programs ( mine :p )
[15:55:58] kbni: is there a pythondir() equiv
[15:56:21] TomyWork: kbni no idea, but google for load path.
[15:56:31] TomyWork: ruby load path
[15:56:41] Bish: kbni: do you mean pythons "DIR" ?
[15:57:06] Bish: becasue i don't know pythondir()
[15:57:15] kbni: No, dir(object) lists members of an object
[15:57:21] Bish: yeah.. that's what i meant
[15:57:34] Bish: well, you can ready all sorts of metadata of anything in ruby
[15:57:39] Melpaws: has joined #ruby
[15:57:41] asccigcc: has joined #ruby
[15:57:43] Bish: >> 1.methods
[15:57:44] ruby[bot]: Bish: # => [:%, :&, :*, :+, :-, :/, :<, :>, :^, :|, :~, :-@, :**, :<=>, :<<, :>>, :<=, :>=, :==, :===, :[], :in ...check link for more (https://eval.in/502738)
[15:58:10] Bish: for example, all methods of the class "Fixnum", meaning everything a number can do
[15:58:23] shinnya: has joined #ruby
[15:58:32] adaedra: Numeric, rather
[15:58:55] havenwood: kbni: You might like `ls` in the Pry REPL.
[15:59:07] lucasb: kbni: in addition to .methods, there's also local_variables
[15:59:47] havenwood: lucasb: lambda { |&block| block.call; block_given? }.call { puts "Freya's day!" }
[16:01:15] lucasb: havenwood: thanks. but when not using a &block parameter, do you think block_given? should have returned true?
[16:01:33] scepticulous: has joined #ruby
[16:01:37] jbrhbr: has joined #ruby
[16:01:39] havenwood: lucasb: note it returns false there ^
[16:01:53] havenwood: so it's false both time
[16:02:09] lucasb: indeed again. and maybe... I was expecting true both times
[16:02:53] Papierkorb: lucasb: I'd expect yield and block_given? to act in the scope of the current method and not the block..
[16:02:58] Papierkorb: (Which it apparently does)
[16:03:02] kbni: pry looks great, thanks!
[16:03:38] lucasb: Papierkorb: ok, this makes sense. thanks
[16:04:25] lkba: has joined #ruby
[16:05:58] dlitvak: has joined #ruby
[16:06:29] anisha: has joined #ruby
[16:06:31] Vitor: has joined #ruby
[16:06:59] pawnbox: has joined #ruby
[16:08:57] aegis3121: so I've anonymized a bunch from this, but can anyone explain how this code would work? https://gist.github.com/jon2992/b4a92d9dd918b5b98bb4
[16:09:27] Outlastsheep: has joined #ruby
[16:09:30] aegis3121: I'm a bit confused as to how overriding new is...a good plan.
[16:09:34] mchu: has joined #ruby
[16:11:09] karapetyan: has joined #ruby
[16:11:20] sftrabbit: has joined #ruby
[16:13:00] awox: Why does Ruby have so many popular versions?
[16:13:30] jhass: awox: what do you mean?
[16:13:40] jhass: aegis3121: no, it's a quite bad idea
[16:14:05] arup_r: has joined #ruby
[16:14:12] aegis3121: jhass: yea. I've never encountered code like that before and it's a bit off-putting.
[16:14:15] chussenot: has joined #ruby
[16:14:17] bubbys: has joined #ruby
[16:14:24] sftrabbit: has joined #ruby
[16:14:45] jhass: aegis3121: do you know what the term singleton class means in the Ruby context and what extend has to do with it?
[16:15:06] ljames: has joined #ruby
[16:15:07] awox: can I make Ruby use curly braces instead of do/end?
[16:15:31] jhass: awox: what do you mean by make? braces are an almost equal alternative to do/end
[16:15:40] awox: def foo {
[16:15:41] havenwood: awox: When you say "versions" what do you mean?
[16:15:49] jhass: awox: there's no do after def
[16:15:57] aegis3121: jhass: Not as well as I should. My use of extend, as far as I know, is to allow a Module's methods to be Class methods rather than instance methods.
[16:16:06] awox: havenwood, like, 1.9/2.0/2.3.. so many cool versions to chose from. so much more choice than Python. :D
[16:16:27] jhass: aegis3121: if you can invest the time, watch https://www.youtube.com/watch?v=by5fFOBhtPQ
[16:16:46] havenwood: awox: Ruby 2.3 is latest stable. Most folk will be using 2.3 or 2.2 (since 2.3 just came out on Christmas day).
[16:16:56] aegis3121: jhass: thanks, I'll do that.
[16:17:02] podman: has joined #ruby
[16:17:07] jhass: awox: 1.9 is out of official security maintenance, 2.0 will be on 24th February
[16:17:36] lacuna: has joined #ruby
[16:17:36] lacuna: has joined #ruby
[16:17:37] havenwood: awox: So it's 2.1.8, 2.2.4 or 2.3.0 for stable releases that aren't end-of-life soon.
[16:17:57] jhass: with quite big compatibility between them
[16:18:34] jhass: it's more like python 3.3, 3.4, 3.5
[16:18:35] awox: but not completely compatible?
[16:18:45] havenwood: awox: Semantic versioning.
[16:18:50] jhass: I think completely backwards compatible
[16:18:58] awox: hm okies
[16:19:53] awox: is there a way to avoid the @/@@ notation for instance/class variables?
[16:19:59] aryaching: has joined #ruby
[16:20:00] awox: like - can I just use self.foo?
[16:20:18] ljarvis: if you add readers/writers
[16:20:19] jhass: just avoid class variables altogether, 95% of the uses I've seen are better solved by class level instance variables
[16:20:23] TomyWork: if i assign an @@ variable at class scope, will it be shared with a sibling class?
[16:20:28] ruby[bot]: Why don't you try it and see for yourself?
[16:20:30] jhass: self.foo will be a method call
[16:20:36] TomyWork: i.e. a class that's a subclass of the same superclass?
[16:21:31] havenwood: if sys.version_info[0] == 2: snakes!
[16:21:53] bb010g: has joined #ruby
[16:21:55] TomyWork: that's neither python nor ruby
[16:22:02] TomyWork: you have created a monster!
[16:22:13] ericfreese: has joined #ruby
[16:22:39] mostlybadfly: has joined #ruby
[16:24:42] havenwood: Python 2 will be end-of-lifed the year Ruby 3 is released. We welcome the Python 2ers!
[16:25:00] DaniG2k: has joined #ruby
[16:25:09] awox: 2.7 4 lyfe
[16:25:33] adaedra: But 2.7 is not out yet!
[16:25:39] adaedra: (Because we're talking ruby, right?)
[16:26:16] dfinninger: has joined #ruby
[16:26:19] awox: Also, EOL for Python 2.7 is like 2020
[16:26:19] domgetter: has joined #ruby
[16:26:38] havenwood: awox: Right, the year Ruby 3 is due.
[16:27:12] havenwood: 3x as fast as Ruby 2.
[16:27:22] chouhoulis: has joined #ruby
[16:27:26] mark1: has left #ruby: ("PART #RubyOnRails :PART #jquery :PART #reactjs :PART ##javascript :PART #elixir-lang :PONG :asimov.freenode.net")
[16:28:03] havenwood: https://www.youtube.com/watch?v=LE0g2TUsJ4U
[16:28:03] Bish: how did those part messages find it's way into his quit message :o
[16:28:21] st0opkid: has joined #ruby
[16:28:58] awox: Alright, it's like 3 am and I'mnot getting anywhere so It's time for sleep
[16:29:09] awox: thank you for answering my very dumb questions :)
[16:30:53] terminalrecluse: has joined #ruby
[16:30:58] stannard: has joined #ruby
[16:31:31] dfinninger: has joined #ruby
[16:33:00] dn5: has joined #ruby
[16:34:26] Rodya_: has joined #ruby
[16:35:56] haraigoshi: has joined #ruby
[16:37:22] Frem: has joined #ruby
[16:39:13] minimalism: has joined #ruby
[16:39:39] mary5030: has joined #ruby
[16:46:17] amclain: has joined #ruby
[16:46:18] du5tball: has joined #ruby
[16:47:14] jackcom: there is a ruby on that package like gruff is preinstalled. like anaconda in python?
[16:47:17] zast: has joined #ruby
[16:47:26] Limix: has joined #ruby
[16:47:46] du5tball: hi there. i'm just learning ruby and came across public and private today. how long are those keywoards valid? as in, if i define several private functions, is private valid untill i cancel it?
[16:48:47] ghr: du5tball yeah
[16:48:53] bougyman: if I understand your question right: yes.
[16:48:53] jhass: du5tball: depends on whether you pass them an argument or not
[16:49:05] jhass: du5tball: note that def returns a symbol and thus can be an argument
[16:49:11] jhass: they're actually methods btw
[16:49:19] jhass: &ri Module#public Module#private
[16:49:20] `derpy: http://ruby-doc.org/core-2.3.0/Module.html#method-i-public, http://ruby-doc.org/core-2.3.0/Module.html#method-i-private
[16:49:22] ghr: fyi https://github.com/bbatsov/ruby-style-guide#consistent-classes
[16:49:23] du5tball: uh, methods. okay. eh, names
[16:49:36] jackcom: jhass: help me
[16:49:43] du5tball: i'm from python. def -> function
[16:49:55] diegoviola: has joined #ruby
[16:50:09] jhass: .kick jackcom http://ruby-community.com/pages/user_rules#rule_2_7
[16:50:10] ruby[bot]: ruby[bot] kicked jackcom:
[16:50:52] du5tball: "subsequently defined methodS", that's what i was looking for. codecademy doesn't clear this up
[16:51:22] du5tball: they just go "make this public, make this private, and make this public again"
[16:51:27] pdoherty: has joined #ruby
[16:51:28] emilford: has joined #ruby
[16:53:07] jhass: depends on how you use them
[16:55:15] GinoManWorks: has joined #ruby
[16:55:24] Ox0dea: >> public == private # Don't use them like this.
[16:55:25] ruby[bot]: Ox0dea: # => true (https://eval.in/502762)
[16:55:35] du5tball: so, methods return a symbol, which would terminate public / private. from what i understand, i can't prevent ruby from returning something, but could define the return myself. would something like 'return "asdf"' prevent that?
[16:56:09] aegis3121: so you could define a bunch of methods, then decide you want x, y, and z to be private like so -> private :x, :y, :z
[16:56:15] sepp2k: has joined #ruby
[16:56:22] aegis3121: the fact that those return symbols is, more or less, what allows that to work like that, I believe.
[16:56:32] chipotle: has joined #ruby
[16:56:35] du5tball: wait - the methods can be addressed via symbols?
[16:56:42] stannard: has joined #ruby
[16:56:54] jhass: and since method definitions return the symbol of their name, you can write things like private def foo these days
[16:57:07] jhass: which is passing the return value of def foo to the method private
[16:57:17] du5tball: okay, that's weird, but it does make sense
[16:57:30] Ox0dea: Using "return" when you mean "evaluate to" is unnecessarily confusing.
[16:57:46] Ox0dea: Especially in the context of method definition.
[16:57:58] stannard: has joined #ruby
[16:58:03] jhass: mh, yes I usually say have the value or something, my bad
[16:58:12] myntcake: has joined #ruby
[16:58:21] Ox0dea: du5tball: Why weird?
[16:58:49] du5tball: i've never seen "private <method> <method> <method>" somewhere else
[16:58:53] lacuna: has joined #ruby
[16:58:53] lacuna: has joined #ruby
[16:58:54] synthroid: has joined #ruby
[16:59:06] Ox0dea: Nor will you see it in Ruby.
[16:59:15] lucasb: yeah, some confusion here. just to clarify: method definition returns their name as a symbol. method execution returns the last value in their bodies.
[16:59:33] Ox0dea: >> def foo; 42; end
[16:59:34] ruby[bot]: Ox0dea: # => :foo (https://eval.in/502764)
[16:59:46] soahccc: Does anyone know how to gracefully shutdown when using daemons gem? I used to trap the signals but now I saw in the source that you are not supposed to overwrite the trap :S
[16:59:47] Ox0dea: That method definition *evaluates to* :foo, but the foo method *returns* 42.
[17:00:06] Ox0dea: soahccc: Traps can stack, for what that's worth.
[17:01:07] scottschecter: has joined #ruby
[17:02:06] polishdub: has joined #ruby
[17:02:47] lucasb: pedantically, I consider an expression *returning* some value or *evaluating to* some values to be synonyms :)
[17:03:45] soahccc: Ox0dea: oh they do? If I untrap my own hook (returning to default behaviour) the other trap is still there? Or do I have to not "untrap"
[17:03:52] Ox0dea: lucasb: And yet that clearly doesn't hold in the case of Ruby method definitions.
[17:04:15] lucasb: Ox0dea: how come? isn't a method definition an expression in itself?
[17:04:46] ruby-lang042: has joined #ruby
[17:04:56] lucasb: I thought everything in ruby was an expression
[17:05:15] snockerton: has joined #ruby
[17:05:15] Ox0dea: soahccc: The latter.
[17:05:30] shevy: everything in ruby is a cat
[17:06:36] ericfreese: has joined #ruby
[17:06:41] Ox0dea: lucasb: It's certainly quite strange to say that `def foo; 42; end` evaluates to 42.
[17:06:49] Ox0dea: And by "strange" I of course mean wrong. :P
[17:07:10] lucasb: because it doesn't evaluate to 42, it evaluates to :foo
[17:07:16] Ox0dea: >> value = def foo; 42; end; value
[17:07:18] ruby[bot]: Ox0dea: # => :foo (https://eval.in/502773)
[17:07:22] dhollinger: has joined #ruby
[17:07:25] babblebre: has joined #ruby
[17:07:42] Ox0dea: It does evaluate to :foo, yes, but it would be strange to call that its return value.
[17:08:01] lucasb: but it *is* it's return value :)
[17:08:12] webus: has joined #ruby
[17:08:18] Ox0dea: Its return value is the value the method returns, which is 42.
[17:08:24] Ox0dea: It's totally okay for these to be different things.
[17:08:40] zambini: has joined #ruby
[17:09:00] TomyWork: I'm installing some gems to .bundle using "rvm 2.2.1 do bundle install" and then i run my app with "rvm 2.2.1 do ./app.rb". It can't find that new gem. it can find a different gem, though that is also under .bundle
[17:09:20] centrx: has joined #ruby
[17:09:31] TomyWork: i'm a bit confused :)
[17:10:12] TomyWork: "rvm 2.2.1 do bundle exec ./app.rb" works
[17:10:19] TomyWork: but that doesnt work with rerun
[17:10:51] Ox0dea: Way spooky.
[17:10:59] TomyWork: okay, it works if i put rerun outside the bundle exec
[17:11:04] Ox0dea: Try `rvm implode`.
[17:11:05] jhass: TomyWork: make sure to either require "bundler/setup" or bundle exec
[17:11:23] blarghlarghl: has joined #ruby
[17:11:37] TomyWork: i'll use bundle exec
[17:12:37] karapetyan: has joined #ruby
[17:12:48] blarghlarghl: Hi. I'm stuck in Unicode hell. There is an external library that I'm using which accepts a string, and does ... something ... to it. I think it _assumes_ the string is a UTF-16 variant. Then all it does is spit the string back out - but it does _something_ to it again on the way out. Basically I put in "hi" and get back a bunch of Chinese characters. Treating this as a black box - how can I figure out what it's expecting and what it's givin
[17:13:17] blarghlarghl: I've noticed that single character strings work fine - a => a. but "aa" gives me a four-\x-character string back
[17:14:08] soahccc: Ox0dea: hmm I'm afraid thats not how it works :( https://gist.github.com/2called-chaos/4ba85f03853bc88595fd
[17:14:19] usershell: has joined #ruby
[17:14:28] treehug88: has joined #ruby
[17:14:59] Ox0dea: soahccc: That's "undoing" the original, though. There's definitely a way to store the old trap, but I forget the slick approach just now.
[17:16:13] mercerist: has joined #ruby
[17:16:35] Ox0dea: soahccc: Oh, duh. #trap returns the previous handler.
[17:17:09] soahccc: Ox0dea: damn that was to easy :D thanks
[17:17:17] Ox0dea: soahccc: Sure thing. :)
[17:17:21] hahuang65: has joined #ruby
[17:17:33] Mia: has joined #ruby
[17:17:34] Mia: has joined #ruby
[17:17:44] Jackneill: has joined #ruby
[17:18:42] Cork: is there a way to specify rvm gemset in Gemfiles?
[17:19:11] diegoviola: why would you want to do that?
[17:19:18] lucasb: strange, 'protected' doesn't work outside of a class definition, but 'private' and 'public' do.
[17:19:19] diegoviola: use chruby/ruby-install
[17:19:22] diegoviola: don't use gemsets
[17:20:00] Cork: why is that?
[17:20:04] diegoviola: bundler takes care of gems for you
[17:20:26] Cork: ya, but we want to keep them in gemsets so it is easier to see what is in use
[17:20:55] diegoviola: why not just look at your Gemfile for that
[17:21:04] diegoviola: and Gemfile.lock
[17:21:37] atomical: has joined #ruby
[17:21:57] dlitvak: has joined #ruby
[17:22:44] mchu: has joined #ruby
[17:23:10] Cork: found it, you put it in a comment under ruby 'version'
[17:23:12] Cork: ex #ruby-gemset=
[17:23:26] colegatron: has joined #ruby
[17:24:20] jxs_: has joined #ruby
[17:28:43] jhass: blarghlarghl: context would help a lot, what are you using this library for
[17:29:35] B1n4r10: has joined #ruby
[17:31:10] alphaatom: has joined #ruby
[17:31:11] Jardayn: has joined #ruby
[17:32:34] ur5us: has joined #ruby
[17:33:32] agentmeerkat: has joined #ruby
[17:33:34] RobertBirnie: has joined #ruby
[17:35:29] Rodya_: has joined #ruby
[17:36:25] emilford: has joined #ruby
[17:37:47] ico: has joined #ruby
[17:39:29] taq: has joined #ruby
[17:40:05] taq: has left #ruby: ()
[17:40:23] PedramT: has joined #ruby
[17:42:13] mistermocha: has joined #ruby
[17:43:43] burbus: has joined #ruby
[17:43:44] emilford: has joined #ruby
[17:43:54] asmodlol: has joined #ruby
[17:43:55] sonOfRa: has joined #ruby
[17:45:06] jamw: has joined #ruby
[17:45:12] mistermocha: has joined #ruby
[17:45:29] last_staff: has joined #ruby
[17:47:54] rakm: has joined #ruby
[17:49:58] mikecmpbll: has joined #ruby
[17:51:29] sftrabbit: has joined #ruby
[17:52:25] Dimik: has joined #ruby
[17:52:54] mistermocha: has joined #ruby
[17:53:04] jxs_: has joined #ruby
[17:53:13] arup_r: has joined #ruby
[17:54:04] Jardayn: has joined #ruby
[17:54:08] taq: has joined #ruby
[17:56:05] pskosinski_: has joined #ruby
[17:57:00] norc: has joined #ruby
[17:59:24] taq: hello, channel, long time no see :-)
[17:59:50] Ox0dea: Seems it's been forever: http://logs.ryanbigg.com/p/taq
[17:59:53] jbrhbr: has joined #ruby
[18:00:09] SCHAAP137: has joined #ruby
[18:00:33] firstdayonthejob: has joined #ruby
[18:00:36] aegis3121: has joined #ruby
[18:00:59] bronson: has joined #ruby
[18:01:45] lucasb: cool, I was not aware of this alternate irc log site
[18:02:17] taq: seems that I'm older than the channel or I'm old enough to forget the channel I used to chat :-D
[18:02:37] jhass: helpa is not that long in here actually
[18:03:04] Guest18948: has joined #ruby
[18:03:33] jhass: not that _whitelogger_ catched you either apparently http://irclog.whitequark.org/ruby/search?q=nick%3Ataq
[18:03:54] jhass: http://irclog.whitequark.org/ruby-lang/search?q=nick%3Ataq maybe that was you?
[18:04:11] atomical_: has joined #ruby
[18:04:58] taq: jhass, yes :-)
[18:05:01] sftrabbit: has joined #ruby
[18:05:10] lxsameer: has joined #ruby
[18:05:10] lxsameer: has joined #ruby
[18:06:13] taq: jhass, but I used to come here a loooooooong time ago, on a galaxy far, far away :-)
[18:09:32] SHyx0rmZ: has joined #ruby
[18:10:10] dlitvak: has joined #ruby
[18:10:57] radgeRayden: has joined #ruby
[18:14:39] jxs_: has joined #ruby
[18:15:43] konsolebox: has joined #ruby
[18:16:12] karapetyan: has joined #ruby
[18:16:30] konsolebox: has joined #ruby
[18:17:05] iateadonut: has left #ruby: ()
[18:17:08] mondok: has joined #ruby
[18:17:24] sinkensabe: has joined #ruby
[18:17:31] konsolebox: has joined #ruby
[18:17:33] cornerman: has joined #ruby
[18:17:47] _djbkd: has joined #ruby
[18:17:56] Melpaws1: has joined #ruby
[18:18:21] nettoweb: has joined #ruby
[18:18:38] konsolebox: has joined #ruby
[18:19:10] |ifei5good: has joined #ruby
[18:19:43] konsolebox: has joined #ruby
[18:20:47] bruce__lee: has joined #ruby
[18:20:48] konsolebox: has joined #ruby
[18:22:03] TheAnachron: has joined #ruby
[18:22:40] sandstrom: has joined #ruby
[18:22:47] imperator: has joined #ruby
[18:23:48] shadoi: has joined #ruby
[18:24:34] chipotle: has joined #ruby
[18:25:19] imperator: what's wrong with this Comparable snippet? I don't get the warning: https://gist.github.com/djberg96/84db06c46ec3e99e7452
[18:25:53] |ifei5g00d: has joined #ruby
[18:26:31] ur5us: has joined #ruby
[18:26:40] gizmore: imperator: maybe add a "rescue nil"
[18:27:08] rodferso1|lunch: has joined #ruby
[18:27:31] rodfersou: has joined #ruby
[18:27:35] sonOfRa: has joined #ruby
[18:27:37] imperator: oh, I think it has to be: [x,y,z] <=> [other.x, other.y, other.z]
[18:29:16] norc: imperator: That implementation of <=> is faulty btw
[18:29:44] imperator: norc, what should it be?
[18:29:57] norc: imperator: You need to return -1 / 0 / +1 depending on < = >
[18:31:36] arthurix_: has joined #ruby
[18:32:24] cfinley: has joined #ruby
[18:32:35] arthurix: has joined #ruby
[18:36:27] Rodya_: has joined #ruby
[18:39:02] Ox0dea: norc: Just -/0/+, mind.
[18:39:29] Ox0dea: Such that simple subtraction sometimes suffices.
[18:39:39] braincrash: has joined #ruby
[18:39:59] norc: Have not looked at that implementation yet.
[18:40:05] norc: But as you know me, I am about to correct that mistake.
[18:40:17] arthurix: has joined #ruby
[18:41:24] zambini: has joined #ruby
[18:41:38] norc: Okay good to know. :)
[18:42:33] cornerman: has joined #ruby
[18:43:09] Ox0dea: It's just a saner semantics, really.
[18:43:11] djellemah: imperator: http://ruby-doc.org/core-2.2.3/Comparable.html#method-i-3E Your (original) <=> returns a boolean, and comparing a boolean with an integer using < raises an exception. Which gets caught in Comparable#< and triggers the warning.
[18:44:38] arthurix: has joined #ruby
[18:45:11] Ox0dea: norc: Could Fiddle be used to relax the restrictions on unary *, **, and &?
[18:45:30] Ox0dea: Like, just strike the return value type constraint but leave everything else in place?
[18:46:20] dwfait: has joined #ruby
[18:47:55] baweaver: has joined #ruby
[18:48:40] arthurix: has joined #ruby
[18:49:41] Ox0dea: To clarify: https://eval.in/502790
[18:49:54] Ox0dea: We can define unary +, -, ~, and ! to return whatever.
[18:50:49] djellemah: ACTION wonders what fresh outrages Ox0dea is planning ;-)
[18:51:05] treehug88: has joined #ruby
[18:51:21] kith: has joined #ruby
[18:51:23] Ox0dea: djellemah: It's just something I've pondered now and again since writing Lollipops.
[18:51:39] kerunaru: has joined #ruby
[18:52:07] Ox0dea: I revisited it the other day: https://eval.in/501843
[18:52:20] Ox0dea: (Warning: loud.)
[18:52:34] dfinninger: has joined #ruby
[18:52:56] dfinninger: has joined #ruby
[18:53:34] platzhirsch: has left #ruby: ()
[18:54:21] djellemah: Ah. You want moar operators.
[18:54:40] El3ktra: has joined #ruby
[18:54:41] El3ktra: has joined #ruby
[18:55:36] Ox0dea: All teh operators!
[18:56:23] Ox0dea: Mildly surprised that "fresh outrage" appears not to be Shakespearean in origin.
[18:57:14] Ox0dea: djellemah: The operator envy is so stronk: http://www.ozonehouse.com/mark/periodic/
[18:57:45] pietr0: has joined #ruby
[18:58:13] mistermocha: has joined #ruby
[18:59:44] framling: has joined #ruby
[19:00:45] dopie: has joined #ruby
[19:00:45] pdoherty: has joined #ruby
[19:02:04] mchu: has joined #ruby
[19:03:51] djellemah: Andite operators, lol
[19:03:55] grill: yo. are there any methods that check whether if a string is formatted like a file path?
[19:04:51] Ox0dea: > whether if
[19:04:53] cpup: has joined #ruby
[19:05:16] voidDotClass: has joined #ruby
[19:05:40] Ox0dea: grill: You can name a file just about anything in *nix.
[19:05:45] voidDotClass: Trying to get an rspec featue test to pass, when I do 'fill_in '#email', with: 'invalid' , its unable to find the textbox, even though I have it on the page as <input id='email' />
[19:05:46] djellemah: I would be happy with a couple more assignogens in ruby.
[19:05:52] voidDotClass: is my syntax valid?
[19:05:56] kadoppe: has joined #ruby
[19:06:03] Ox0dea: djellemah: Fingers crossed: https://bugs.ruby-lang.org/issues/11939
[19:06:04] baweaver: has joined #ruby
[19:07:45] nb_bez___: has joined #ruby
[19:08:09] replay: has joined #ruby
[19:09:51] gizless: has joined #ruby
[19:10:49] gizmore|2: has joined #ruby
[19:11:23] mfb2: has joined #ruby
[19:11:49] gdrt: has joined #ruby
[19:11:53] imperator: grill, require 'pathname'
[19:12:49] gizmore|3: has joined #ruby
[19:13:10] ramfjord: has joined #ruby
[19:15:44] baweaver: has joined #ruby
[19:16:27] cpup: has joined #ruby
[19:16:52] gizmore: has joined #ruby
[19:16:54] dfinninger: has joined #ruby
[19:16:56] gizmore: has joined #ruby
[19:17:56] zotherstupidguy: has joined #ruby
[19:18:04] arthurix_: has joined #ruby
[19:18:53] arthurix_: has joined #ruby
[19:19:46] gizless: has joined #ruby
[19:20:28] arthurix: has joined #ruby
[19:20:59] allcentury: has joined #ruby
[19:21:07] ivanskie: has joined #ruby
[19:21:10] JohnT: has joined #ruby
[19:22:00] bb010g: has joined #ruby
[19:22:06] atomical: has joined #ruby
[19:22:42] guacamole: has joined #ruby
[19:23:09] braincrash: has joined #ruby
[19:23:12] d0nn1e: has joined #ruby
[19:24:47] dfinninger: has joined #ruby
[19:25:03] arthurix: has joined #ruby
[19:27:01] arthurix_: has joined #ruby
[19:27:38] dfinninger: has joined #ruby
[19:28:58] Gadgetoid: has joined #ruby
[19:29:51] who42: has joined #ruby
[19:30:23] joshua75: has joined #ruby
[19:30:58] grill: does it make more sense to cenclose methods in context, or to create contexts for each method tested (even if the contexts are the same)
[19:31:13] dfinninger: has joined #ruby
[19:31:26] aegis3121: http://betterspecs.org/
[19:31:50] grill: i'm reading this now
[19:32:10] aegis3121: describe blocks are for what you're testing; context blocks are for setting up the "state of the world" before a test; it blocks are for actual assertions
[19:32:58] grill: yes, but can you set up the world and then describe what you're testing?
[19:33:04] Axy: has joined #ruby
[19:33:05] Axy: has joined #ruby
[19:33:06] aegis3121: probably shouldn't
[19:33:07] jgpawletko: has joined #ruby
[19:33:08] grill: or must you say what you're testing and then set up the world
[19:33:45] aegis3121: I believe convention would say "indicate what you're testing" before setting up the scenarios to test it
[19:33:52] grill: the disadvantage the the latter method is that the world would ostensibly need to be set up very similarly multiple times
[19:34:00] aegis3121: Shared contexts are a thing
[19:34:00] choke: has joined #ruby
[19:34:05] aegis3121: Also, leveraging let helps with that
[19:34:11] Melpaws: has joined #ruby
[19:34:17] aegis3121: also, contexts nest
[19:34:23] grill: yes they do
[19:34:27] taq: has joined #ruby
[19:34:48] al2o3-cr: has joined #ruby
[19:34:54] arthurix: has joined #ruby
[19:36:11] aegis3121: So I can't imagine the state of the world is THAT shared between methods. And if it is, you can use a shared context. Shared contexts have the disadvantage of being relatively easy to bloat/obfuscate what's happening with your tests, but they do de-clutter it.
[19:36:21] aegis3121: Everyone's use cases are different :)
[19:36:30] chipotle_: has joined #ruby
[19:37:03] graffix222: has joined #ruby
[19:37:13] Rodya_: has joined #ruby
[19:37:54] snowy: has joined #ruby
[19:38:17] Sirithcam: has joined #ruby
[19:38:33] baweaver: has joined #ruby
[19:38:34] mary5030: has joined #ruby
[19:39:10] yqt: has joined #ruby
[19:39:14] arthurix: has joined #ruby
[19:39:20] norc: Ox0dea: Intuitively I would say no. But you know me....
[19:39:21] mary5030: has joined #ruby
[19:39:30] norc: Let me give you a correct answer in a moment!
[19:39:37] grill: ok. here's a partial example. I have a bunch of nested contexts that jump off parent contexts. http://hastebin.com/aravolemon.dos
[19:40:24] grill: i have several methods that can operate in (and should be tested) within these states. how do I describe multiple methods with shared state?
[19:40:58] tlaxkit: has joined #ruby
[19:41:00] arthurix_: has joined #ruby
[19:42:44] arthurix: has joined #ruby
[19:43:18] djbkd: has joined #ruby
[19:44:02] guacamole: has joined #ruby
[19:44:12] dfinninger: has joined #ruby
[19:44:14] eam: what's the easiest way to search through all classes to find a method matching /poll/ ?
[19:44:52] norc: >> puts RubyVM::InstructionSequence.compile("p(&:c)").disasm
[19:44:53] ruby[bot]: norc: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502795)
[19:44:57] norc: eam: object space.
[19:45:11] atomical: has joined #ruby
[19:45:33] arthurix: has joined #ruby
[19:45:44] norc: eam: Just remember you have to include modules too.
[19:45:55] jamw: has joined #ruby
[19:46:26] gdrt: has left #ruby: ("NedaMise")
[19:46:32] arthurix_: has joined #ruby
[19:46:49] norc: eam: So just ObjectSpace.each_object(Class) gives you what you need.
[19:47:44] arthurix_: has joined #ruby
[19:48:11] mistermocha: has joined #ruby
[19:48:44] synthroid: has joined #ruby
[19:48:48] atomical_: has joined #ruby
[19:49:30] norc: Ox0dea: I would say no.
[19:49:34] eam: well, ObjectSpace.each_object(Class).map { |c| c.methods.grep /poll/ } would give me class methods only, correct?
[19:49:40] eam: I'm after instance methods too
[19:49:47] norc: eam: Dont use methods
[19:50:08] norc: It just tells you whether that class responds to that method.
[19:50:18] norc: eam: http://ruby-doc.org/core-2.3.0/Module.html
[19:50:21] eam: c.instance_methods?
[19:50:24] norc: For example
[19:50:32] Ox0dea: eam: Should do.
[19:50:33] eam: yeah that's what I want
[19:50:39] eam: rad thx
[19:50:50] grebl: has joined #ruby
[19:50:55] PedramT: has joined #ruby
[19:51:20] stannard_: has joined #ruby
[19:51:35] Danishman: has joined #ruby
[19:51:54] arthurix: has joined #ruby
[19:52:13] Ox0dea: norc: That's something very different.
[19:52:17] eam: >> ObjectSpace.each_object(Class).map { |c| match = c.instance_methods.grep /poll/; c unless match.size.zero? }.select {|x| !x.nil?}
[19:52:19] ruby[bot]: eam: # => [] (https://eval.in/502798)
[19:52:43] eam: (it works, I guess there aren't any in that env)
[19:53:03] braincrash: has joined #ruby
[19:54:14] aegis3121: has joined #ruby
[19:54:18] Ox0dea: eam: select { |x| !x.nil? } == compact
[19:54:24] dfinninger: has joined #ruby
[19:54:27] fsfdsf: has joined #ruby
[19:54:29] norc: Ox0dea: No that was just something out of curiosity.
[19:54:59] Ox0dea: norc: Sure, but I thought you were using it to decide that you would say no.
[19:55:25] aegis3121: grill: shared contexts sound like it.
[19:55:49] djellemah: >> ObjectSpace.each_object(Class).reject{|k| k.instance_methods.grep(/to_c/).empty?} #eam
[19:55:50] ruby[bot]: djellemah: # => [Complex, Rational, Bignum, Float, Fixnum, Integer, Numeric, String, NilClass] (https://eval.in/502799)
[19:55:53] mistermocha: has joined #ruby
[19:56:16] norc: Ox0dea: It is pretty disgusting how &:foo in an arg works however looking at the bytecode.
[19:56:36] Ox0dea: norc: It's not an argument, though.
[19:56:47] norc: Precisely..
[19:56:58] norc: It just passes :sym and marks it a special argument.
[19:57:09] norc: Though come to think of it..
[19:57:10] djellemah: norc: I've wondered about that. How does &:itself compare to ->x{x} performance wise?
[19:57:21] norc: djellemah: No idea
[19:57:42] atomical: has joined #ruby
[19:57:50] norc: Ox0dea: Nevermind, that really is the only way to do this.
[19:57:51] Ox0dea: djellemah: Blocks are less expensive than Procs.
[19:57:55] arthurix: has joined #ruby
[19:58:21] lucasb: has joined #ruby
[19:58:54] snowy: has joined #ruby
[19:59:16] Ox0dea: A Proc is essentially just a reified block.
[19:59:19] djellemah: Yeah, but in that case they would both be procs. map{|x| x} would be a block though.
[19:59:28] Ox0dea: &:itself is a Block.
[19:59:34] norc: djellemah: And interestingly, a proc gets converted into a block when being called.
[19:59:59] djellemah: Ok, so there's extra overhead for creation and for calling.
[20:00:06] xxneolithicxx: has joined #ruby
[20:00:07] norc: djellemah: Indeed.
[20:00:37] norc: djellemah: And everytime you bind a block to an argument like def foo(&thing) you incur that penalty.
[20:00:52] norc: Because that also creates a proc based on the block passed.
[20:01:08] El3ktra: has joined #ruby
[20:01:26] norc: djellemah: I think calling should be the same performance however.
[20:02:00] Ox0dea: norc: Not true.
[20:02:02] bhalash: has joined #ruby
[20:02:07] norc: Ox0dea: Why is that?
[20:02:26] bweston92: has joined #ruby
[20:02:43] Ox0dea: norc: https://eval.in/502800
[20:03:02] _djbkd: has joined #ruby
[20:03:03] zcreative: has joined #ruby
[20:03:20] norc: Ox0dea: Point taken.
[20:03:33] arthurix: has joined #ruby
[20:03:57] norc: Ox0dea: The result of your example is probabilistic though if the GC works just before you inspect OS again.
[20:04:13] Ox0dea: norc: The intended demonstration remains. :)
[20:04:26] Ox0dea: Every method takes an implicit block; it would be insane if they were all automatically reified.
[20:05:10] norc: Insanity is the mark of some of our authors.
[20:05:27] mchu: has joined #ruby
[20:05:43] Ox0dea: `&block` at the end of a parameter list is almost always either noise or a little malodorous.
[20:06:48] jackjackdripper: has joined #ruby
[20:06:49] dpg1: has joined #ruby
[20:06:52] CloCkWeRX: has joined #ruby
[20:07:29] dfinninger: has joined #ruby
[20:07:47] soahccc: Ox0dea: I use it a lot when passing or saving the procs in variables rather than just yielding... Or do you mean the "descriptivness" of block?
[20:07:58] Sou|cutter: Ox0dea: I sorta like knowing that methods expect to take blocks sometimes
[20:08:39] norc: >> puts RubyVM::InstructionSequence.compile("def foo(&bar); end; foo {1};").disasm
[20:08:40] ruby[bot]: norc: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502801)
[20:08:54] Sou|cutter: IIRC there's a performance hit for (&block) which makes it less-nice
[20:09:04] norc: >> puts RubyVM::InstructionSequence.compile("def foo(&bar.call(1)); end; foo { |a| };").disasm
[20:09:06] ruby[bot]: norc: # => <compiled>:1: syntax error, unexpected '.', expecting ')' ...check link for more (https://eval.in/502802)
[20:09:06] tubuliferous_: has joined #ruby
[20:09:22] norc: Sou|cutter: That was what I learned a while ago too, but its time to figure out whether that is true, and why.
[20:09:36] Sou|cutter: ACTION nods
[20:09:40] Synthead: is there a way I can make inifile ignore '#' symbols as comments? I have an inifile that uses "InitialProgram=#Internet Explorer 11" ... (facepalm)
[20:09:41] norc: >> puts RubyVM::InstructionSequence.compile("def foo(&bar) bar.call(1)); end; foo { |a| };").disasm
[20:09:43] ruby[bot]: norc: # => <compiled>:1: syntax error, unexpected ')', expecting keyword_end ...check link for more (https://eval.in/502803)
[20:09:47] norc: >> puts RubyVM::InstructionSequence.compile("def foo(&bar) bar.call(1); end; foo { |a| };").disasm
[20:09:49] ruby[bot]: norc: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502804)
[20:10:00] Ox0dea: soahccc: Nah, that's the valid use case I had in mind.
[20:10:10] spider-mario: has joined #ruby
[20:11:41] norc: Ox0dea: Okay I think it is a little misunderstanding. It is not as much the &arg part that is the penalty, but passing a block *and* specifying a &arg
[20:11:42] Psyq: has joined #ruby
[20:11:58] norc: I completely agree that just specifying the parameter should not be relevant.
[20:12:09] saturnmir_mate2: has joined #ruby
[20:12:10] soahccc: Ox0dea: depending on what you are doing you have that a lot (a lot of view related stuff requires to pass the block to capture, etc.)
[20:12:27] bluOxigen: has joined #ruby
[20:12:37] norc: Synthead: Try wrapping the content in "" perhaps? This is just a random guess.
[20:12:41] northfurr: has joined #ruby
[20:13:06] SaturnMir: has joined #ruby
[20:13:15] SaturnMir: what is the best way to test datatype
[20:13:23] Ox0dea: soahccc: Certainly many libraries use it to great effect, but there's a lot of Ruby code out there that uses Proc#call where `yield` would suffice.
[20:13:25] Synthead: norc: the ini file has this originally, unfortunately. I was thinking of doing a .tr('#', '\#') on the file's contents, but this seems kinda smelly
[20:13:48] Synthead: it'd be much better if I could do an IniFile.load("file", comments: :ignore) or something
[20:13:52] fl: has joined #ruby
[20:13:54] Sou|cutter: SaturnMir: Fixnum === 0 # maybe?
[20:14:02] Ox0dea: >> 'foo'.class # SaturnMir
[20:14:04] ruby[bot]: Ox0dea: # => String (https://eval.in/502805)
[20:14:15] grebl: has left #ruby: ()
[20:14:26] djellemah: Synthead: or maybe you can preprocess and convert =# to = . Hopefully that doesn't have unintended consequences.
[20:14:30] Sou|cutter: not quite sure I understand the question
[20:14:30] norc: Synthead: Based on the intro doc of inifile it should accept the Hash symbol in the middle.
[20:14:31] SaturnMir: 0x0dea how does this work if I do 64.class and 429527346982634928.class
[20:14:39] norc: Synthead: What error do you get?
[20:14:40] aegis3121: >> 64.class
[20:14:41] ruby[bot]: aegis3121: # => Fixnum (https://eval.in/502806)
[20:14:50] dlitvak: has joined #ruby
[20:15:03] SaturnMir: so integer == fixnum == bignum ?
[20:15:07] Synthead: norc: no error, but the value for this item is blank after it's parsed via IniFile
[20:15:23] Synthead: norc: I actually want a "#Internet Explorer 11" value
[20:15:27] jackjackdripper: has joined #ruby
[20:15:29] SaturnMir: in terms of 64 == integer and 12416482763482453 == integer
[20:15:34] norc: Synthead: Just double quote the string.
[20:15:36] norc: SaturnMir: That should work.
[20:15:42] norc: And sorry, mistab.
[20:15:59] Synthead: norc: right, but this ini file is user input (I don't control it)
[20:16:02] Nuru: has joined #ruby
[20:16:03] SaturnMir: 64.class == Integer ?? or 64.class == Integer.class
[20:16:15] norc: Synthead: Then have your users provide you with a valid ini file
[20:16:16] norc: It is that simple.
[20:16:25] lucasb: n.is_a?(Integer)
[20:16:31] Synthead: norc: tell that to citrix :p
[20:16:40] norc: Synthead: Tell citrix to fuck off.
[20:16:50] norc: From me.
[20:16:55] Synthead: ACTION sighs
[20:17:16] Synthead: thanks for your help, anyway
[20:17:19] norc: Synthead: Preprocess the file before you stuff it into inifile.
[20:17:34] Synthead: norc: that's what I was thinking, but that seems like code smell
[20:17:43] norc: Synthead: The code smell is on citrix side.
[20:17:44] Synthead: not like a # in there isn't already
[20:18:02] Synthead: agreed, but that doesn't inherently mean that I must write smelly code
[20:18:08] norc: In fact there is a lot of smell on citrix side.
[20:18:14] norc: But lets not get into that.
[20:18:19] Synthead: as mentioned, if there was a comments: :ignore to IniFile or something, it'd be a lot better, I think
[20:18:34] norc: Synthead: Feel free to fork the repo.
[20:18:40] Darmani: has joined #ruby
[20:18:42] Synthead: I prefer to find solutions than blaming people and doing nothing about it
[20:18:56] polishdub: has joined #ruby
[20:19:02] norc: I enjoy blaming people for things.
[20:19:05] Darmani: @Synthead - Blaming people is so much easier bro
[20:19:14] Limix: has joined #ruby
[20:19:17] Synthead: also exhausting
[20:19:27] soahccc: SaturnMir: that might also be interesting :) https://gist.github.com/2called-chaos/998020a21ab2da4fb787
[20:19:28] norc: You need to practice on throwing rocks at your colleagues.
[20:19:29] norc: Dont use your voice.
[20:19:33] Darmani: @Synthead - Why take responsibility when you can make others responsible for your problems?
[20:19:51] Darmani: ACTION waves to norc
[20:20:00] norc: ACTION throws a rock at Darmani 
[20:20:00] Synthead: Darmani: until someone takes responsibility, regardless of who, progress is not being made
[20:20:13] Darmani: ACTION catches rock
[20:20:19] Darmani: thanks man. Is this your pet rock?
[20:20:38] Darmani: @Synthead - You do realize everything I said just now was sarcasm?
[20:21:18] Synthead: @Citrix: https://i.imgur.com/j9HapU7.jpg
[20:22:11] mistermocha: has joined #ruby
[20:25:39] Ox0dea: soahccc: https://eval.in/502808 :P
[20:25:49] djellemah: Synthead: https://github.com/TwP/inifile/blob/master/lib/inifile.rb you can specify what characters to use as comments in the opts
[20:26:54] yfeldblum: has joined #ruby
[20:27:15] sdwrage: has joined #ruby
[20:27:53] gizmore: has joined #ruby
[20:28:28] lucasb: in [*a], if a = 42, then it simply returns [42]
[20:28:39] emilford: has joined #ruby
[20:28:46] lucasb: if a is an instance of a class that has to_a return 42, it errors
[20:28:58] lucasb: Ox0dea: ^^ I saw this in your paste
[20:29:29] dtordable: has joined #ruby
[20:30:04] mchu: has joined #ruby
[20:30:25] Sdwrage_: has joined #ruby
[20:31:09] Ox0dea: lucasb: Ah, that wasn't the greatest example. [*foo] is just Array(foo). I was trying to demonstrate that the * unary operator invokes #to_a.
[20:31:21] Ox0dea: https://eval.in/502811
[20:31:39] Ox0dea: And that, alas, it must return an Array, as you point out.
[20:32:35] Cohedrin: has joined #ruby
[20:32:47] blarghlarghl: has left #ruby: ()
[20:33:41] lucasb: anyway, I just thought the different behaviour was not very orthogonal
[20:33:46] lucasb: Ox0dea: thanks for the snippet
[20:34:01] musl: has joined #ruby
[20:34:05] Ox0dea: lucasb: Sure, but which different behavior?
[20:34:30] lucasb: a = 42; [*a] #=> returns [42]
[20:34:38] lucasb: a = C.new; [*a] #=> errors
[20:34:51] lucasb: when the C class has the to_a method returning 42
[20:34:59] Ox0dea: I see how you mean.
[20:34:59] emilford: has joined #ruby
[20:35:00] ico: has joined #ruby
[20:35:16] lucasb: I mean, there's one layer of indirection between the two examples
[20:35:39] Ox0dea: There is. :<
[20:35:40] lucasb: but intuitively, I would expect both to behave the same
[20:36:02] Ox0dea: lucasb: Well, mind that C.new isn't returning 42.
[20:36:22] lucasb: yeah, I understand that :)
[20:36:47] bweston92: has joined #ruby
[20:37:06] ruby[bot]: norc: # => undefined local variable or method `a' for main:Object (NameError) ...check link for more (https://eval.in/502812)
[20:37:12] ruby[bot]: norc: # => [1] (https://eval.in/502813)
[20:37:27] norc: >> puts RubyVM::InstructionSequence.compile("[*1]").disasm
[20:37:29] ruby[bot]: norc: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502814)
[20:38:07] govg: has joined #ruby
[20:38:11] bhalash: has joined #ruby
[20:38:20] Rodya_: has joined #ruby
[20:38:39] Ox0dea: norc: Array(foo) invokes foo's #to_a, but Array(42) doesn't try to invoke Fixnum#to_a; what's going on there?
[20:39:30] dlitvak: has joined #ruby
[20:39:35] norc: I suspect a VM optimization going on here
[20:39:45] Ox0dea: Where is the method resolution ending up?
[20:39:51] Ox0dea: There's no Object#to_a.
[20:40:18] norc: >> puts RubyVM::InstructionSequence.compile("a = Object.new; [*a]").disasm
[20:40:20] ruby[bot]: norc: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/502815)
[20:40:43] norc: Ox0dea: https://github.com/ruby/ruby/blob/trunk/insns.def#L530
[20:41:10] Ox0dea: You got there quick. :P
[20:41:40] tubuliferous_: has joined #ruby
[20:41:45] norc: Need to ask apeiros whether we can get some kind of shortcut for RubyVM::InstructionSequence.compile(a).disasm
[20:41:54] kith: has joined #ruby
[20:42:00] norc: It is just so annoying to type without pry autocompletion.
[20:42:24] djellemah: ACTION edits his .pryrc
[20:43:15] lucasb: norc: any easy way to get a list of all ruby vm ops?
[20:43:27] Ox0dea: >> RubyVM::INSTRUCTION_NAMES # lucasb
[20:43:28] ruby[bot]: Ox0dea: # => ["nop", "getlocal", "setlocal", "getspecial", "setspecial", "getinstancevariable", "setinstancevaria ...check link for more (https://eval.in/502816)
[20:43:44] norc: Got there first damn.
[20:43:51] norc: I would not trust that constant thoguh.
[20:44:03] norc: https://github.com/ruby/ruby/blob/trunk/insns.def
[20:44:04] norc: This is what I use.
[20:44:05] atomical_: has joined #ruby
[20:44:18] lucasb: thanks norc and Ox0dea
[20:44:31] lucasb: but... they are so few :)
[20:44:40] Guest27: has joined #ruby
[20:44:47] norc: lucasb: That is the whole point of a bytecode virtual machine.
[20:44:50] norc: Keep it small.
[20:45:38] norc: lucasb: Also the original intel 8086 had less instructions!
[20:46:00] dlitvak_: has joined #ruby
[20:46:55] norc: Ox0dea: imho this int2fix is such a horrid name - and it is splattered across all C code...
[20:46:59] arthurix: has joined #ruby
[20:47:04] akem: has joined #ruby
[20:47:12] Ox0dea: $ python -c 'import dis; print(len(dis.opmap))'
[20:47:14] norc: I mean it makes perfect sense, but when I just read "fix" it just looks like a hack.
[20:47:40] Ox0dea: ??\_(???)_/??
[20:47:45] Ox0dea: norc: Seems fine to me.
[20:47:46] norc: Ox0dea: I once submitted a PIP!
[20:47:52] Ox0dea: Did it win?
[20:48:17] craysiii: has joined #ruby
[20:48:17] lucasb: a PEP you mean?
[20:48:17] norc: Recommending the removal of whitespace, explaining in a few paragraphs how the whole language just causes brain cancer.
[20:48:23] norc: Oh PEP yes sorry.
[20:48:29] norc: Was about 7 years ago.
[20:48:44] norc: They thought I was trolling. :S
[20:48:46] Ox0dea: I thought you meant a PyPI package.
[20:48:57] norc: No. The Python Enhancement P...something.
[20:49:01] Ox0dea: Proposal.
[20:49:25] Ox0dea: I think your PEP should've won. :P
[20:49:29] craysiii: has joined #ruby
[20:49:55] norc: I still wonder whether a carriage return without a newline is relevant for indentation...
[20:50:17] norc: s/newline/linefeed/
[20:50:20] SaturnMir: http://pastebin.com/KPWAjYLj -- does this convert integer.to_s(2) to twos compliment correctly?
[20:50:21] ruby[bot]: SaturnMir: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/0f14f4c273b66ae2edaf
[20:50:21] ruby[bot]: SaturnMir: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[20:50:42] Ox0dea: SaturnMir: No.
[20:50:57] Ox0dea: It's just sticking a hyphen on the front for negatives.
[20:51:17] SaturnMir: 0x0dea it is removing a hyphen
[20:51:30] last_staff1: has joined #ruby
[20:51:31] SaturnMir: -4.to_s(2) yields -100
[20:51:51] Ox0dea: I don't see a removed hyphen.
[20:51:54] speakingcode: has joined #ruby
[20:52:04] SaturnMir: 0x0dea oh damn -.- I see now. Really sorry
[20:52:27] SaturnMir: I am stuck on how to get a proper binary value as a string on ruby.
[20:52:51] hexchat_: has joined #ruby
[20:52:52] Ox0dea: SaturnMir: Ruby has arbitrary-precision integers, so you'll need to self-impose a maximum.
[20:53:00] norc: Ox0dea: Honestly the thing I just hated about python is how massively inconsistent the stdlib is about where the receiver goes. Sometimes its rec.meth(a, b), sometimes its a.meth(rec, b), sometimes its a.meth(b, rec)
[20:53:20] SaturnMir: 0x0dea uhm... (I am new to ruby as you can probably tell)
[20:53:23] akem2: has joined #ruby
[20:53:28] grip: ruby has a concept of default arugments, right? e.g. some_method(some_var="")
[20:53:35] norc: grip: Yes, exactly like that.
[20:54:03] grip: why am I getting an error then? ArgumentError: wrong number of arguments
[20:54:07] norc: grip: We also have keyword arguments (which really have not found much popular use because Hashes are often used instead)
[20:54:13] norc: grip: Show us your code.
[20:54:20] blackgoat: has joined #ruby
[20:54:20] grip: I am not using ruby 2
[20:54:30] atomical: has joined #ruby
[20:54:37] Ox0dea: SaturnMir: On, say, a 32-bit system, -1 in binary is 32 1s.
[20:54:40] norc: grip: Show us your code.
[20:54:45] PedramT: has joined #ruby
[20:54:55] djellemah: >> "%b" % 237 # SaturnMir
[20:54:56] ruby[bot]: djellemah: # => "11101101" (https://eval.in/502817)
[20:55:00] grip: sec. i will make an example
[20:55:03] SaturnMir: 0x0dea would I be able to get a maximum by doing log(integer value)/log16 + 1
[20:55:10] Ox0dea: >> '%b' % -1 # djellemah
[20:55:12] ruby[bot]: Ox0dea: # => "..1" (https://eval.in/502818)
[20:55:16] akem: has joined #ruby
[20:55:21] SaturnMir: djellemah -- that is not 2s comp though
[20:55:32] Ox0dea: SaturnMir: You can just use modulus.
[20:55:46] Ox0dea: >> (-1 % 2 ** 32).to_s 2 # SaturnMir
[20:55:48] ruby[bot]: Ox0dea: # => "11111111111111111111111111111111" (https://eval.in/502819)
[20:56:08] Ox0dea: Yay, arithmetic! ^_^
[20:56:50] norc: 19>> def f(a=1) a; end; f()
[20:56:51] ruby[bot]: norc: # => 1 (https://eval.in/502820)
[20:59:21] SaturnMir: so 32 is maxima? 0x0dea ??
[20:59:42] Ox0dea: SaturnMir: That depends on what you're doing.
[20:59:48] Ox0dea: You can choose an arbitrary maximum.
[21:00:00] SaturnMir: how would I best obtain that?
[21:00:03] Ox0dea: Remember that a signed 32-bit integer's range is -2^32..2^31-1.
[21:00:18] Ox0dea: In case that was the source of your confusion in "I think..."
[21:03:25] SaturnMir: I have got ...111101 for (int)-3 ... that is correct right? 0x0dea
[21:03:55] joonty: has joined #ruby
[21:04:06] Ox0dea: SaturnMir: Yep.
[21:04:17] Ox0dea: Now, are you sure you need to be doing this in Ruby? :P
[21:04:31] djellemah: >> ("I needed this a month ago".hash % 36**10).to_s 36
[21:04:32] ruby[bot]: djellemah: # => "s25u3" (https://eval.in/502821)
[21:05:22] SaturnMir: I just found this easiest to prototype in ;) I am actually trying to get pixeldata from bitmaps...but I am new to the entire concept of stuff like bitmasking and things...so I wanted to suss out how to handle binary first.
[21:07:35] SaturnMir: 0x0dea...so if I set my maxima to 4 (bits)...and enter 12... I get an output of 1100 which would be -8+4=-4... so is this the overflow?
[21:07:54] SaturnMir: like when you go over the max of int 32 and it wraps backaround
[21:08:28] TomPeed: has joined #ruby
[21:08:54] karapetyan: has joined #ruby
[21:09:25] scottschecter: has joined #ruby
[21:09:31] jayne_: has joined #ruby
[21:09:54] sftrabbit: has joined #ruby
[21:11:11] nfk|laptop: has joined #ruby
[21:11:22] TomPeed: has joined #ruby
[21:11:25] chipotle: has joined #ruby
[21:11:35] Ox0dea: SaturnMir: Just so. The high bit being on indicates negative, and then you interpret the rest as usual.
[21:11:52] cdg: has joined #ruby
[21:12:29] SaturnMir: 0x0dea so overflow is detected as being true if foo > 0 but (foo % 2 ^^ 32).to_s(2)[0].eql?"1"
[21:12:37] nfk|laptop: for the first time in my life I hope i have gotten my math wrong, i mean, i knew i was signing up for a a lot but if i did my math right the trivial algorithm i'm still struggling to get right is gonna have complexity that's not that bad until you consider it's 200**<some 4 digit number)
[21:13:02] Ox0dea: SaturnMir: I think that should suffice for your purposes, yep.
[21:13:18] Ox0dea: Happy to help. :)
[21:13:20] imperator: has left #ruby: ("Leaving")
[21:13:25] nfk|laptop: i don't know how much that turns out to be but i expect too much even if every one of those was a basic x86 instructions (they aren't)
[21:13:42] rolfb: has joined #ruby
[21:14:06] Yzguy: has joined #ruby
[21:15:13] govg: has joined #ruby
[21:16:24] snowy: has joined #ruby
[21:17:41] fl: has joined #ruby
[21:17:58] mistermocha: has joined #ruby
[21:18:14] djellemah: >> 0.to_s(37)
[21:18:15] ruby[bot]: djellemah: # => invalid radix 37 (ArgumentError) ...check link for more (https://eval.in/502822)
[21:20:04] bensarz: has joined #ruby
[21:20:56] carraroj: has joined #ruby
[21:21:41] mistermocha: has joined #ruby
[21:22:46] emilford: has joined #ruby
[21:24:05] Ox0dea: djellemah: https://eval.in/502828
[21:25:04] synthroid: has joined #ruby
[21:26:12] theery: has joined #ruby
[21:26:17] casadei: has joined #ruby
[21:26:18] djellemah: Ox0dea: lol nice.
[21:26:30] Ox0dea: djellemah: It's only wrong for 0 and 1. :<
[21:27:01] renderful: has joined #ruby
[21:27:20] snowy: has joined #ruby
[21:27:22] mostlybadfly: has joined #ruby
[21:27:32] Ox0dea: Relevant: http://cowbirdsinlove.com/43
[21:27:35] Melpaws1: has joined #ruby
[21:27:41] ruby-n00by: has joined #ruby
[21:28:49] djellemah: Hmm, I never thought about whether numbers can be represented in base 0 or 1. Kinda defeats the purpose is my intuitive reaction.
[21:29:40] djbkd: has joined #ruby
[21:29:58] mistermocha: has joined #ruby
[21:30:02] jbrhbr: has joined #ruby
[21:30:11] djellemah: () in ruby, rust, ocaml, lisp denotes unit/nil/empty . Now I'm curious. What other languages?
[21:30:31] ruby-n00by: i'm having issues with gem on OSX 10.10.5. i've installed rbenv with homebrew. 'which gem' points to my custom version in my /Users/ directory, however, when i try to run 'gem update --system' i get a permissions error telling me i can't write to the system gem directory. any ideas on PATH changes or anything similar?
[21:31:47] emilford: has joined #ruby
[21:32:13] Ox0dea: djellemah: Haskell.
[21:32:58] mistermocha: has joined #ruby
[21:33:02] jbrhbr: has joined #ruby
[21:34:25] Cohedrin: has joined #ruby
[21:34:46] Ox0dea: ruby-n00by: `gem which rubygems`
[21:34:49] snowy: has joined #ruby
[21:35:22] Cohedrin: has joined #ruby
[21:35:29] bronson: has joined #ruby
[21:35:34] ruby-n00by: Ox0dea: that seems to be pointing to my system directory. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb
[21:36:15] Sdwrage_: has joined #ruby
[21:36:58] Ox0dea: ruby-n00by: Well, there it is.
[21:37:35] mistermocha: has joined #ruby
[21:38:24] jbrhbr1: has joined #ruby
[21:39:07] Rodya_: has joined #ruby
[21:40:52] emilford: has joined #ruby
[21:41:05] Melpaws: has joined #ruby
[21:41:16] K1MOS: has joined #ruby
[21:42:20] Chewy1121: has joined #ruby
[21:42:30] asthasr_: has joined #ruby
[21:42:52] victortyau: has joined #ruby
[21:44:11] flappynerd: has joined #ruby
[21:45:01] theery: has joined #ruby
[21:45:03] Yzguy: has joined #ruby
[21:46:01] preyalone: has joined #ruby
[21:46:17] choke: has joined #ruby
[21:46:36] jamw: has joined #ruby
[21:46:37] astron: has joined #ruby
[21:47:06] BSaboia: has joined #ruby
[21:47:51] gruz0: has joined #ruby
[21:48:07] KensoDev: has joined #ruby
[21:48:38] baweaver: has joined #ruby
[21:48:42] mattfromseattle: has joined #ruby
[21:49:26] mistermocha: has joined #ruby
[21:49:56] emilford: has joined #ruby
[21:50:33] asccigcc: has joined #ruby
[21:51:30] edwinvdgraaf: has joined #ruby
[21:52:20] Chewysourus: has joined #ruby
[21:52:32] Chewysourus: Can anyone help me?
[21:52:42] aegis3121: You haven't asked a question yet.
[21:52:54] Chewysourus: That was a question
[21:52:59] mistermocha: has joined #ruby
[21:53:06] Chewysourus: https://ghostbin.com/paste/e9ajr
[21:53:14] demophoon: Chewysourus: don't ask to ask, just ask your question
[21:53:21] FernandoBasso: has joined #ruby
[21:53:24] Chewysourus: Test out this code and tell me how I can fix it
[21:53:27] Chewysourus: https://ghostbin.com/paste/e9ajr
[21:53:49] aegis3121: I'm fairly certain most people here don't appreciate being told to do something. Is there a specific question you have?
[21:54:36] solars: has joined #ruby
[21:55:18] fl: has joined #ruby
[21:55:22] Chewysourus: How can I fix my code, https://ghostbin.com/paste/e9ajr, it puts out the hash multiple times of the same key/value
[21:55:46] scottschecter_: has joined #ruby
[21:55:49] dlitvak: has joined #ruby
[21:55:55] Chewysourus: But the thing is, I have 3 hashs and I need 1 key and value from one of them, and 2 values of the other ones
[21:56:11] treehug88: research 'hash of hashes'
[21:56:30] last_staff: has joined #ruby
[21:56:49] Chewysourus: I know what that is
[21:57:12] Chewysourus: Unfortunatly it will not help me because it wouldn't exactly work in the .each mthod
[21:57:21] Chewysourus: I would still be doing the same thing
[21:57:30] treehug88: it would be much prettier
[21:57:30] Chewysourus: And still be getting the same result
[21:57:44] Chewysourus: But I am trying to keep this simple
[21:58:00] treehug88: if you program the same bug, then yes :) hash of hashes is simpler than the parallel hashes you're using mpw
[21:58:38] Chewysourus: Not really, not for me. I would have to go through out all my code and change a shit ton of stuff
[21:58:38] cpup: has joined #ruby
[21:59:00] treehug88: ah, tradeoffs :)
[21:59:01] emilford: has joined #ruby
[21:59:15] Chewysourus: The three hashs do not only represent the display. I have them set up to 800 different lines of code.
[21:59:47] astron: has joined #ruby
[21:59:59] Chewysourus: So can anyone actually help me?
[22:00:51] dlitvak: has joined #ruby
[22:00:58] demophoon: Chewysourus: what is stopping you from nesting hashes?
[22:02:16] Chewysourus: Is nesting multi dim hashs?
[22:02:33] Sdwrage_: has joined #ruby
[22:02:42] Chewysourus: Is nesting, 'multi dimensional hashs'.
[22:03:06] Chewysourus: The 800 lines of code that I would have to change
[22:03:08] tubuliferous_: has joined #ruby
[22:04:24] kerunaru: has joined #ruby
[22:04:30] Chewysourus: So again like before, can anyone actually help me and not just tell me to nest them
[22:04:36] Chewysourus: Nesting them won't fix it.
[22:07:54] baweaver: has joined #ruby
[22:08:06] mistermocha: has joined #ruby
[22:08:09] emilford: has joined #ruby
[22:10:51] stannard: has joined #ruby
[22:11:47] speakingcode: has joined #ruby
[22:12:27] kalopsian: has joined #ruby
[22:12:44] Ox0dea: You seem way more knowledgeable than your code would suggest.
[22:13:54] ur5us: has joined #ruby
[22:15:28] Cohedrin: if you change to nested hashes you'll have to change 800 lines of code?
[22:15:47] Cohedrin: no one can help you at this point. That's a huge code smell, debugging it would be a fulltime job
[22:17:12] Chewysourus: https://ghostbin.com/paste/e9ajr
[22:17:15] emilford: has joined #ruby
[22:17:22] Chewysourus: First person to figure this out gets a dollar
[22:17:32] Chewysourus: Nesting is not an option
[22:17:36] eam: most of us probably already have a dollar
[22:18:02] scottschecter: has joined #ruby
[22:18:03] Cohedrin: oh its you again
[22:18:09] Cohedrin: mr run my code and debug it for me
[22:18:32] eam: you know, since you're so dead set on not nesting hashes, perhaps you could take a cue from perl and the magic $; variable?
[22:19:01] eam: I don't think ruby implements it, but we could easily add support by monkeypatching Hash
[22:19:27] crikiit: has joined #ruby
[22:19:47] Martiini: has joined #ruby
[22:24:21] Ox0dea: >> $; = 'x'; 'fooxbarxbaz'.split # eam
[22:24:22] ruby[bot]: Ox0dea: # => ["foo", "bar", "baz"] (https://eval.in/502847)
[22:24:41] Ox0dea: $, = 'x'; %w[foo bar baz].join
[22:24:45] Ox0dea: >> $, = 'x'; %w[foo bar baz].join
[22:24:46] ruby[bot]: Ox0dea: # => "fooxbarxbaz" (https://eval.in/502849)
[22:26:16] emilford: has joined #ruby
[22:26:46] dlitvak: has joined #ruby
[22:26:55] zambini: has joined #ruby
[22:28:02] rkoller: has joined #ruby
[22:28:08] Melpaws: has joined #ruby
[22:28:21] queequeg1: has joined #ruby
[22:28:38] kerunaru: has joined #ruby
[22:30:08] dlitvak: has joined #ruby
[22:30:26] bb010g: has joined #ruby
[22:34:11] Xeago: has joined #ruby
[22:34:13] karapetyan: has joined #ruby
[22:35:07] al2o3-cr1: has joined #ruby
[22:35:24] emilford: has joined #ruby
[22:35:57] amclain: has joined #ruby
[22:37:52] Ox0dea: "I wanted a scripting language that was more powerful than Perl, and more object-oriented than Python." -- matz
[22:37:56] yfeldblum: has joined #ruby
[22:37:57] karapetyan: has joined #ruby
[22:38:36] Ox0dea: > I used too much I guess. I shouldn't have inherited $_, $&, and the other, ugly style variables.
[22:39:06] shevy: https://github.com/ruby/ruby/blob/trunk/ChangeLog#L28
[22:39:14] shevy: "format exact number more exactly"
[22:39:35] shevy: oh wow Ox0dea he must have heard you:
[22:39:37] shevy: https://github.com/ruby/ruby/blob/trunk/ChangeLog#L38
[22:39:49] shevy: "variable.c (rb_f_global_variables): add $1..$9 only if $~ is set."
[22:39:59] Rodya_: has joined #ruby
[22:40:02] shevy: oh wait... still not at $10 haha
[22:40:14] Ox0dea: It's a very good start.
[22:40:45] shevy: I guess the design decision must be along the lines of either "humans only have 10 fingers" OR "a keyboard has only 10 numbers"
[22:41:39] symm-: has joined #ruby
[22:42:55] bruce__lee: has joined #ruby
[22:43:25] jamw: has joined #ruby
[22:44:07] bruce_lee: \(^_^)/ @all
[22:44:30] emilford: has joined #ruby
[22:44:52] bruce_lee: I would like to make a commandLine-script run like "./myScript.rb option_01 option_02"
[22:45:09] bruce_lee: how can I add tab-completion for the options?
[22:45:24] choke: has joined #ruby
[22:45:25] Ox0dea: &ri Readline
[22:45:25] `derpy: http://ruby-doc.org/stdlib-2.3.0/libdoc/readline/rdoc/Readline.html
[22:45:28] Ox0dea: bruce_lee: ^
[22:45:31] bruce_lee: I guess there's a gem, but I can't find one, I'm pretty new to ruby...
[22:45:47] shevy: that's ok, you are bruce lee
[22:45:52] zenlot: has joined #ruby
[22:46:10] Ox0dea: bruce_lee: Oh, sorry. You'll have to write a bash or zsh completion script for that.
[22:46:35] Ox0dea: Command-line tab completion is handled by the shell, not your program.
[22:46:45] gbgdev: has joined #ruby
[22:46:47] firstdayonthejob: has joined #ruby
[22:47:10] psyq_: has joined #ruby
[22:47:37] shevy: bruce_lee you can use "complete -F" if you use bash
[22:47:47] Ox0dea: shevy: https://git.io/vzccN Do you remember anything about this benzrf character?
[22:48:01] shevy: bruce_lee this is the one I use to tab-complete all registered cookbooks http://pastie.org/pastes/10691590/text
[22:48:14] shevy: benzrf... that is vaguely familiar, some dude who was here on #ruby?
[22:48:20] Prominent: has joined #ruby
[22:48:52] shevy: bruce_lee in your case, you just determine what options are available for your script, then assemble that in the shell script function
[22:49:22] bruce_lee: shevy: your link doesn't work
[22:50:07] shevy: bruce_lee hmm... pastie seems to lag ... how about https://gist.github.com/shevegen/2c0cc81dbcf06ba06c03
[22:50:41] dlitvak: has joined #ruby
[22:50:59] shevy: Ox0dea, I got an IRC quote!
[22:51:06] shevy: 2014 ... <benzrf> EXPLODE UR MindfulMonk
[22:51:14] shevy: the latter was an IRC nick on #ruby
[22:51:26] Melpaws: has joined #ruby
[22:51:45] shevy: an even better quote: https://gist.github.com/shevegen/1ca53b81399d50b17f12
[22:51:53] shevy: he always mis-completed on IRC :D
[22:52:31] Ox0dea: That's great.
[22:52:34] shevy: RubyPanther I remember... he seems to have vanished years ago
[22:52:57] Ox0dea: shevy: Did you do something weird to rack up so many messages?
[22:53:07] Ox0dea: Some kind of script gone haywire? :P
[22:53:14] shevy: oh wow 3162 fowl ... he went to nim a few years ago
[22:53:34] emilford: has joined #ruby
[22:53:36] shevy: no, I just keep some things
[22:53:59] shevy: July 2015
[22:54:04] shevy: <Master44> why would you not include the last item btw?
[22:54:04] shevy: <sevenseacat> when you dont want the last item
[22:54:25] Ox0dea: Er... I was referring to the leaderboard.
[22:54:56] shevy: just talking about the quotes pushes me above!
[22:55:14] Ox0dea: Fair enough.
[22:55:14] shevy: funny that the numbers interest you :P
[22:55:20] Ox0dea: There's [k-. :(
[22:55:34] bruce_lee: shevy: thanks, your shellscript solves my issue
[22:55:36] pdoherty: has joined #ruby
[22:55:50] shevy: bruce_lee \o/
[22:56:00] Ox0dea: shevy: I wanted to find the longest sequence of unique speakers. Had to get all the messages as a prerequisite.
[22:56:43] shevy: bruce_lee the only problem I have had was to get in-directory files completion, and commandline options work at the same time... there is probably some simple shell solution but I don't know what that is
[22:56:54] Sou|cutter: PSA last day for early bird registration for Mountain West Ruby Conference
[22:59:18] dlitvak: has joined #ruby
[22:59:36] dpg1: has joined #ruby
[22:59:39] sepp2k: has joined #ruby
[22:59:48] scottschecter: has joined #ruby
[22:59:54] pawnbox: has joined #ruby
[23:00:49] snowy: has joined #ruby
[23:01:30] stannard_: has joined #ruby
[23:02:45] emilford: has joined #ruby
[23:03:54] karapetyan: has joined #ruby
[23:04:13] jackcom: has joined #ruby
[23:05:36] dopie: has joined #ruby
[23:06:59] TomPeed: has joined #ruby
[23:11:27] blur3d: has joined #ruby
[23:11:56] Pupeno: has joined #ruby
[23:11:57] emilford: has joined #ruby
[23:12:16] pawnbox: has joined #ruby
[23:17:10] chouhoulis: has joined #ruby
[23:20:33] ivanskie: has joined #ruby
[23:20:56] northfurr: has joined #ruby
[23:23:25] colegatron: has joined #ruby
[23:24:31] pawnbox: has joined #ruby
[23:24:49] usershell: has joined #ruby
[23:25:28] atomical: has joined #ruby
[23:28:29] Moblin: has joined #ruby
[23:32:32] mistermocha: has joined #ruby
[23:33:46] kalopsian: has joined #ruby
[23:36:50] pawnbox: has joined #ruby
[23:37:04] bronson: has joined #ruby
[23:37:54] Moblin: has joined #ruby
[23:37:58] Yzguy: has joined #ruby
[23:38:19] scottschecter: has joined #ruby
[23:40:18] lucasb: has joined #ruby
[23:43:06] mchu: has joined #ruby
[23:43:33] jackcom: i have success by installing imagemagick and gs on mac
[23:43:39] jackcom: so i can use gruff
[23:44:18] Mon_Ouie: has joined #ruby
[23:45:26] baweaver: has joined #ruby
[23:45:32] zeroDivisible: has joined #ruby
[23:47:42] theery: has joined #ruby
[23:47:43] Xeago: has joined #ruby
[23:49:18] pawnbox: has joined #ruby
[23:52:26] alem0lars: has joined #ruby
[23:54:15] northfurr: has joined #ruby
[23:57:39] davedev24: has joined #ruby