« Back to channel list

#ruby - 25 April 2016

« Back 1 day Forward 1 day »
[00:00:08] benzrf: (py3, that is)
[00:00:15] matp_: has joined #ruby
[00:02:00] Ox0dea: >>> 'ß'.upper().lower()
[00:02:17] Ox0dea: Surely that should've been a no-op?
[00:02:20] jaguarmagenta: has joined #ruby
[00:02:22] brent__: has joined #ruby
[00:02:59] Arahael: Ox0dea: no, that's correct. python doesn't take locale into consideration.
[00:03:10] Ox0dea: arahael: Shouldn't it?
[00:03:14] Arahael: benzrf: but locale!
[00:03:24] Arahael: Ox0dea: how can it, without the locale?
[00:05:21] pawnbox: has joined #ruby
[00:05:49] bkxd: has joined #ruby
[00:08:31] crime: has joined #ruby
[00:10:31] binaryplease1: has joined #ruby
[00:12:20] _Tariq: has joined #ruby
[00:13:02] tAn: has joined #ruby
[00:14:22] _Tariq: I am building a web server for a class, and every time the user goes to a website, I send them a Header telling the browser to create a new cookie with certain characteristics
[00:14:40] _Tariq: But Chrome adds a new cookie value, called rack.session.
[00:14:57] _Tariq: So the web server's cookie gets messed up...
[00:15:36] _Tariq: Also, when people go to a page, they send me their cookie, I process it in memory, and then send them a new cookie with new updated values...
[00:15:42] _Tariq: This is how I get "rack.session"
[00:17:59] doublemalt__: has joined #ruby
[00:18:00] _Tariq: What should I do with rack.session? Just don't process it?
[00:18:30] arescorpio: has joined #ruby
[00:19:27] _Tariq: Well, I guess that worked then. Thanks Rubby Duckies.
[00:19:40] w1lson: has joined #ruby
[00:19:55] IrishGringo: has joined #ruby
[00:20:19] flashpoint9: has joined #ruby
[00:20:58] moeabdol: has joined #ruby
[00:21:53] blackmesa: has joined #ruby
[00:26:10] crime: has joined #ruby
[00:28:38] davedev24: has joined #ruby
[00:31:09] droptone: question: I'm trying to figure out how to best organize this hash. The associations are like this (using example names): "Account" has one value, which has an array "patients", and under patients there are two arrays that belong to patients, "billable_items" and "products"
[00:31:37] droptone: so starting with "patients", I need patients to be an array, where each entry has two sub-arrays, "billiable_items" and "products"
[00:31:47] SilverKey: has joined #ruby
[00:32:38] droptone: what's the best way to design that?
[00:35:56] william3: has joined #ruby
[00:36:35] tmtwd: has joined #ruby
[00:36:40] jaguarma_: has joined #ruby
[00:38:01] davedev24: has joined #ruby
[00:38:05] benlieb: has joined #ruby
[00:39:47] JoshGlzBrk: has joined #ruby
[00:40:51] jdawgaz: has joined #ruby
[00:41:20] pawnbox: has joined #ruby
[00:41:21] _Tariq: droptone: { account: [ patient_one: { billiable_items: "foo", products: "bar" }, patient_two: { billable_items: "alpha", products: "beta" } ] }
[00:41:45] _Tariq: At least, that's what your spec claimed for it to be
[00:41:52] _Tariq: Is this what you want?
[00:42:10] _Tariq: And sorry for the actual ruby code, I couldn't think how to explain it using pseudocode
[00:42:12] smathy: [] and [] instead of "foo" and "bar" - but yeah, what _Tariq said.
[00:42:15] droptone: That sounds fine _Tariq, thank you.
[00:42:29] Polysics: has joined #ruby
[00:42:34] smathy: droptone, but, hashes of arrays of hashes scream out "write some classes" to me.
[00:42:36] droptone: Think I've got it here, I know it's a basic question but for some reason I couldn't wrap my head around it, think I got it.
[00:42:56] droptone: right smathy, I'm trying to replicate the database structure here in a hash to test dumping it to a big var.
[00:43:00] droptone: I might write out some classes.
[00:45:24] skweek: has joined #ruby
[00:47:20] ur5us: has joined #ruby
[00:48:45] jaguarmagenta: has joined #ruby
[00:49:19] bkxd: has joined #ruby
[00:53:16] djbkd: has joined #ruby
[00:54:28] RegulationD: has joined #ruby
[00:57:30] william3: has joined #ruby
[01:02:34] weemsledeux: has joined #ruby
[01:02:40] zacstewart: has joined #ruby
[01:05:06] jaguarma_: has joined #ruby
[01:05:58] northrup: has joined #ruby
[01:06:58] wilbert: has joined #ruby
[01:09:20] diegoaguilar: has joined #ruby
[01:09:26] jdawgaz: has joined #ruby
[01:11:28] hxegon: has joined #ruby
[01:14:59] Moosashi: has joined #ruby
[01:15:30] tAn: has joined #ruby
[01:15:52] skade: has joined #ruby
[01:16:09] swills: has joined #ruby
[01:18:37] Spami: has joined #ruby
[01:18:39] Spami: has joined #ruby
[01:19:27] Dry_Lips: has joined #ruby
[01:19:28] Dry_Lips: has joined #ruby
[01:19:35] baweaver: has joined #ruby
[01:23:14] Rodya_: has joined #ruby
[01:23:28] terminalrecluse: has joined #ruby
[01:23:41] nando293921: has joined #ruby
[01:26:46] blackmesa: has joined #ruby
[01:27:25] bonhoeffer: has joined #ruby
[01:28:26] CloCkWeRX: has joined #ruby
[01:32:30] ur5us: has joined #ruby
[01:38:37] newjersey: has joined #ruby
[01:38:56] freerobby: has joined #ruby
[01:39:36] jrafanie: has joined #ruby
[01:41:03] bronson: has joined #ruby
[01:43:31] framling: has joined #ruby
[01:44:02] Polysics: has joined #ruby
[01:48:23] yfeldblum: has joined #ruby
[01:51:02] gh: has joined #ruby
[01:53:57] djbkd: has joined #ruby
[01:55:22] freerobby: has joined #ruby
[01:57:54] sdothum: has joined #ruby
[02:00:36] GriffinHeart: has joined #ruby
[02:03:29] Acontius: has joined #ruby
[02:03:36] aspiers_: has joined #ruby
[02:04:15] sdothum: has joined #ruby
[02:05:13] A124: has joined #ruby
[02:06:26] diegoaguilar: has joined #ruby
[02:09:15] moeabdol: has joined #ruby
[02:09:26] flashpoint9: has joined #ruby
[02:10:29] GriffinHeart: has joined #ruby
[02:11:43] statelesscode: has joined #ruby
[02:18:09] tAn: has joined #ruby
[02:20:47] Madplatypus: has joined #ruby
[02:21:59] rkazak: has joined #ruby
[02:23:00] chagel: has joined #ruby
[02:23:17] Tref: has joined #ruby
[02:25:18] JBlazeCoder21: has joined #ruby
[02:25:44] Tref: has joined #ruby
[02:27:54] bklane: has joined #ruby
[02:28:25] northrup: has joined #ruby
[02:29:31] william3: has joined #ruby
[02:29:57] tvon: has joined #ruby
[02:30:06] jaguarmagenta: has joined #ruby
[02:33:56] mlakewood: has joined #ruby
[02:34:38] SilverKey: has joined #ruby
[02:36:37] Ebok: has joined #ruby
[02:37:53] Moosashi: has joined #ruby
[02:39:36] GriffinHeart: has joined #ruby
[02:43:13] jaguarma_: has joined #ruby
[02:43:42] solocshaw: has joined #ruby
[02:44:33] lxsameer: has joined #ruby
[02:44:44] ur5us: has joined #ruby
[02:45:17] william3: has joined #ruby
[02:45:35] Polysics: has joined #ruby
[02:45:48] droptone: Question: I have an empty array, and I want to go to the next spot in the array, even if empty
[02:45:55] droptone: is there a method for that, like .next or some such?
[02:47:23] emilford: has joined #ruby
[02:49:06] Ox0dea: droptone: To what end?
[02:49:50] droptone: to the end of knowing I'm specifically at the next point in the array since it's an array of hashes that hold specific values
[02:50:02] droptone: so I can ensure that everything I'm assigning are landing on the next array index
[02:50:28] droptone: some of the values are arrays and I can't just dump via <<
[02:50:37] Ox0dea: How come?
[02:50:57] droptone: well I'm working on a workaround right now
[02:51:02] droptone: but there isn't such a method?
[02:52:16] Ox0dea: It's still not clear to me what sort of method you're looking for.
[02:52:29] Ox0dea: It sounds like you want something like `a[a.size + 1] = foo`, but that can't be right.
[02:54:45] djbkd: has joined #ruby
[02:55:07] droptone: Ok, so here's my situation.
[02:55:16] RegulationD: has joined #ruby
[02:55:19] droptone: I have an app that is getting more customers and I need to speed it up.
[02:55:30] droptone: The basic gist of the app, oversimplified, is this:
[02:55:40] droptone: 1) Get data from remote API provider
[02:56:13] droptone: 2) Analyze said data, looping through objects returned from API and comparing aspects of those objects, such as last_updated timestamp, to the last_updated timestamp I have on file for that specific object
[02:56:27] droptone: 3) If needed, push data to second remote API
[02:56:49] droptone: it works as designed but is too slow, and I profiled it and, after analyzing the profile output and discussing it in here and elsewhere
[02:57:10] droptone: determined that a large amount of my speed issues revolve around the ActiveRecord MySQL queries that are occurring
[02:57:17] droptone: the MySQL DB lives on an Amazon RDS instance
[02:58:08] droptone: As it stands now, after retrieving the data, when looping through the data returned from the API for analysis, on every iteration it is making a MySQL query to load the record on file for that object
[02:58:31] yardenbar: has joined #ruby
[02:58:44] droptone: the consenus is that it could be sped up dramatically by making a single query to load the needed MySQL data ahead of time, in one big query, and storing it in a hash
[02:58:57] droptone: so I'm attempting to do that.
[02:59:15] droptone: The issue is, I'm using Rails 4.2.x as the front end and some of the data lives in child tables
[02:59:17] Arahael: droptone: You could also consider uploading a table containing your "local" timestamps and doing the comparison in SQL.
[02:59:43] droptone: well, there's other data besides the timestamp that's analyzed, but fair point arahael, thank you
[02:59:48] baweaver: has joined #ruby
[03:00:17] droptone: but the issue is, I'm trying to design this hash so that record "patient", which has subrecord "billitems" and "prods", both of which belong_to patients
[03:00:34] Arahael: droptone: Also, while I am somewhat biased against ORMs, I don't like them - ORMs do have a big advantage: When you learn the ORM thoroughly, you can do some quite good whole-program optimisations by just focusing on the ORM.
[03:00:38] droptone: I need the big hash that stores the database entries to be lined up properly
[03:01:01] droptone: what I mean is, say I have an array "patients", and each patient has a table of "billitems" and a table of "prods"
[03:01:27] Arahael: droptone: I'm really not sure how you'd do it in mySQL. In Postgresql, I'd suggest returning the results as XML or Json given that you want a heirachial format.
[03:01:53] droptone: I need to design the hash that way so I don't have to re-query or further analyze, so I can just load a given patient from the array based on specific criteria and I know that that index also contains the proper billitems and prods
[03:02:04] droptone: both of which are arrays of their own
[03:02:09] Arahael: droptone: (postgresql has native support for json and xml)
[03:02:17] Arahael: droptone: Also, native support for arrays. :)
[03:02:35] droptone: so it's like, patients is an array, and for every patient I have an array of billitems and an array of prods
[03:02:53] Arahael: Sounds like a suboptimal schema, though. :/
[03:03:06] droptone: arahael: I'm going to try some things before blowing away our RDS environment, last I checked RDS doesn't support postgres
[03:03:28] droptone: ok, what would be a more optimal schema?
[03:03:48] droptone: than a patient which has a table of billitems unique to that patient and a table of prods unique to that patient?
[03:03:55] Arahael: droptone: Fairly sure AWS does support it. But anyway. Consider creating a new mysql view that allows an easier (and more efficient) activerecord use.
[03:04:17] droptone: oh never mind, it does support postgres
[03:04:23] droptone: that's good
[03:04:26] p1k: has joined #ruby
[03:04:28] Arahael: droptone: Or even a temporary table that is created at the start with some complex SQL, do your processing, then drop the table
[03:04:29] droptone: it was maria it doesn't support
[03:04:31] droptone: but I suppose maria is just mysql
[03:04:33] berserk_ren: has joined #ruby
[03:04:52] Arahael: droptone: maria is a fork of mysql. Just as bad (I'm biased...), but not exactly the same anymore.
[03:05:11] droptone: Well right now all I need is to know how to create this hash to store these values
[03:05:16] droptone: in a logical manner
[03:05:28] droptone: this should be simple, not sure why it's escaping me
[03:05:36] Arahael: droptone: However, if you're only looking at performance, mysql is probably quite adequate. I'd worry about changing the database another day when you optimise/refactor another aspect of your system.
[03:06:11] Arahael: droptone: Don't fall in the trap of changing the whole system while trying to optimise a small part: You risk scope creap and never, ever finishing the task.
[03:06:15] droptone: I mean I suppose I could just dump the tables independently then perform logic after the fact to line them up
[03:06:43] droptone: I"m not changin the whole system, I'm just dumping the DBs ahead of time instead of querying the records one at a time as needed to see if I get a performance boost
[03:06:58] Arahael: droptone: Sure. Dump the tables, do your processing, and say that the processing is accurate up to the dump point.
[03:07:15] droptone: which brings me back to my question regarding a logical manner to structure this hash
[03:07:44] william3: has joined #ruby
[03:07:44] droptone: patients is an array, and each patient has both its own values as well as an array of "billitems" and an array of "prods"
[03:07:48] mjuszczak: has joined #ruby
[03:08:23] Arahael: droptone: If it's just a quick test to see a performance improvemet, I'd just consider doing it naively. Hash of hashes, of arrays, whatever.
[03:08:33] SilverKey: has joined #ruby
[03:08:41] Arahael: droptone: That's a PITA in terms of maintenance or refactoring, but it's a start.
[03:08:43] droptone: um, right, I'm just asking the best way to structure this hash
[03:08:58] droptone: patients is an array, each patient has an array of "billitems" and an array of "prods
[03:09:09] droptone: and also each patient has its own values
[03:09:14] Arahael: droptone: Your focus is on *algorithmic* and *architectural* changes, really, as far as performance is concerned.
[03:09:49] Arahael: So ,consider the structure that best fits your algorithms.
[03:09:57] ssiris: has joined #ruby
[03:10:10] droptone: the structure that best fits my algorithms is the one described
[03:10:15] Arahael: droptone: Then use it.
[03:10:18] pawnbox: has joined #ruby
[03:10:26] droptone: I'm asking how it would be written
[03:10:38] droptone: all good, I've got it, thank you
[03:10:41] pawnbox_: has joined #ruby
[03:11:11] Arahael: It's shit in terms of maintenance and refactoring, but you can do that *after* understanding that the time invested is worth it.
[03:14:16] jdawgaz: has joined #ruby
[03:14:27] wilbert: has joined #ruby
[03:15:50] w1lson: has joined #ruby
[03:16:25] bkxd: has joined #ruby
[03:18:22] braincrash: has joined #ruby
[03:19:45] rbennacer: has joined #ruby
[03:21:18] rbennacer: has joined #ruby
[03:21:23] tAn: has joined #ruby
[03:21:29] isxek: has joined #ruby
[03:24:06] janebootydoe2: has joined #ruby
[03:24:29] bradleyprice: has joined #ruby
[03:29:39] tildes: has joined #ruby
[03:33:01] w1lson: has joined #ruby
[03:34:46] Tref: has joined #ruby
[03:37:31] jaguarmagenta: has joined #ruby
[03:37:48] gix: has joined #ruby
[03:40:51] william3: has joined #ruby
[03:42:58] bronson: has joined #ruby
[03:43:53] juanca_: has joined #ruby
[03:44:06] rickmasta: has joined #ruby
[03:45:32] Devalo: has joined #ruby
[03:45:50] aspiers_: has joined #ruby
[03:46:39] Trynemjoel: has joined #ruby
[03:47:22] Polysics: has joined #ruby
[03:47:50] jaguarma_: has joined #ruby
[03:48:57] elifoster: has joined #ruby
[03:48:58] Cohedrin: has joined #ruby
[03:50:40] pawnbox: has joined #ruby
[03:51:44] baweaver: has joined #ruby
[03:52:17] x77686d: has joined #ruby
[03:55:33] djbkd: has joined #ruby
[03:57:23] moeabdol: has joined #ruby
[04:00:07] Trynemjoel: has joined #ruby
[04:00:55] LoneHerm_: has joined #ruby
[04:02:34] bklane: has joined #ruby
[04:08:19] moeabdol: has joined #ruby
[04:08:26] kareeoleez: has joined #ruby
[04:10:02] william3: has joined #ruby
[04:10:03] kareeole_: has joined #ruby
[04:12:03] rbennacer: has joined #ruby
[04:13:05] rbennacer: has joined #ruby
[04:16:17] northrup: has joined #ruby
[04:17:06] stardiviner: has joined #ruby
[04:18:10] Es0teric: has joined #ruby
[04:20:20] stannard: has joined #ruby
[04:22:14] rbennacer: has joined #ruby
[04:23:20] hackeron: apeiros: no, not solved yet :( - asked manufacturer for more details and examples
[04:23:23] tAn: has joined #ruby
[04:23:31] rbennacer: has joined #ruby
[04:24:00] lkba: has joined #ruby
[04:24:00] bluOxigen: has joined #ruby
[04:24:44] brianpWins: has joined #ruby
[04:25:24] hxegon: has joined #ruby
[04:27:13] Yithar: has joined #ruby
[04:27:16] william3: has joined #ruby
[04:28:46] zzak: has joined #ruby
[04:30:16] astrobunny: has joined #ruby
[04:31:12] Dimik: has joined #ruby
[04:33:22] rbennacer: has joined #ruby
[04:33:37] p1k: has joined #ruby
[04:35:52] zacstewart: has joined #ruby
[04:36:41] Macaveli: has joined #ruby
[04:37:39] Yiota: has joined #ruby
[04:39:17] LoneHerm_: has joined #ruby
[04:44:57] Dimik1: has joined #ruby
[04:45:32] rbennacer: has joined #ruby
[04:50:04] tax: has joined #ruby
[04:50:48] Polysics: has joined #ruby
[04:51:48] Moosashi: has joined #ruby
[04:52:42] noService: has joined #ruby
[04:56:05] RegulationD: has joined #ruby
[04:56:15] djbkd: has joined #ruby
[04:56:23] jaguarmagenta: has joined #ruby
[04:56:40] jdawgaz: has joined #ruby
[04:57:08] terminalrecluse: has joined #ruby
[04:58:58] p1k: has joined #ruby
[05:03:23] GriffinHeart: has joined #ruby
[05:07:49] yfeldblum: has joined #ruby
[05:09:59] navneet: has joined #ruby
[05:13:01] flashpoint9: has joined #ruby
[05:14:11] Cohedrin_: has joined #ruby
[05:16:51] navneet_: has joined #ruby
[05:18:37] navneet__: has joined #ruby
[05:18:46] baweaver: has joined #ruby
[05:20:24] Ropeney: has joined #ruby
[05:21:25] tristanp: has joined #ruby
[05:22:00] axion_: has joined #ruby
[05:23:29] Devalo: has joined #ruby
[05:23:41] saneax: has joined #ruby
[05:25:28] tAn: has joined #ruby
[05:27:50] SilverKey: has joined #ruby
[05:29:27] agit0: has joined #ruby
[05:29:44] william3: has joined #ruby
[05:31:11] navneet: has joined #ruby
[05:33:53] baweaver: has joined #ruby
[05:37:11] yardenbar: has joined #ruby
[05:37:18] oliver__: has joined #ruby
[05:39:08] pawnbox: has joined #ruby
[05:43:33] chagel: has joined #ruby
[05:43:42] djbkd: has joined #ruby
[05:44:07] noServic1: has joined #ruby
[05:44:46] bronson: has joined #ruby
[05:46:47] lxsameer: has joined #ruby
[05:47:06] moeabdol: has joined #ruby
[05:49:14] Moosashi: has joined #ruby
[05:51:34] moeabdol: has joined #ruby
[05:52:12] Polysics: has joined #ruby
[05:54:24] GriffinHeart: has joined #ruby
[05:55:25] noService: has joined #ruby
[05:56:00] ramfjord: has joined #ruby
[05:56:20] PedramT: has joined #ruby
[05:57:48] bkxd: has joined #ruby
[05:59:27] PedramT: has joined #ruby
[05:59:50] solars: has joined #ruby
[06:00:13] mgorbach: has joined #ruby
[06:01:59] bluOxigen: has joined #ruby
[06:02:28] kareeoleez: has joined #ruby
[06:03:40] mark_66: has joined #ruby
[06:04:45] kareeoleez: has joined #ruby
[06:18:05] Chagel_: has joined #ruby
[06:18:57] r0bby_: has joined #ruby
[06:20:02] DoubleMalt: has joined #ruby
[06:22:04] CausaMortis: has joined #ruby
[06:23:36] pLaToOn: has joined #ruby
[06:23:57] zacstewart: has joined #ruby
[06:24:31] aganov: has joined #ruby
[06:24:43] dionysus69: has joined #ruby
[06:26:20] victortyau: has joined #ruby
[06:26:59] mloy_: has joined #ruby
[06:27:50] yfeldblum: has joined #ruby
[06:28:27] GriffinHeart: has joined #ruby
[06:30:19] william3: has joined #ruby
[06:32:19] victortyau: has joined #ruby
[06:32:44] tubuliferous: has joined #ruby
[06:32:58] xqwztis: has joined #ruby
[06:33:56] last_staff: has joined #ruby
[06:34:46] bkxd: has joined #ruby
[06:35:43] pandaant: has joined #ruby
[06:40:48] tildes: has joined #ruby
[06:40:49] Moosashi: has joined #ruby
[06:42:06] oliver___: has joined #ruby
[06:46:00] Pupeno: has joined #ruby
[06:46:00] Pupeno: has joined #ruby
[06:50:32] Xeago: has joined #ruby
[06:50:45] haraoka: has joined #ruby
[06:51:37] GriffinHeart: has joined #ruby
[06:51:55] william3: has joined #ruby
[06:52:52] codecop: has joined #ruby
[06:52:54] codecop_: has joined #ruby
[06:53:44] Polysics: has joined #ruby
[06:54:10] Moosashi: has joined #ruby
[06:55:11] william3: has joined #ruby
[06:55:29] tAn: has joined #ruby
[06:55:39] andikr: has joined #ruby
[06:56:20] tvw: has joined #ruby
[06:56:44] TomyWork: has joined #ruby
[06:57:36] sphex_: has joined #ruby
[06:59:49] p1k: has joined #ruby
[07:01:19] biberu: has joined #ruby
[07:01:49] tubuliferous: has joined #ruby
[07:03:09] ur5us: has joined #ruby
[07:04:15] Robtop__: has joined #ruby
[07:05:51] mikecmpbll: has joined #ruby
[07:06:02] ur5us: has joined #ruby
[07:07:30] hk238: has joined #ruby
[07:07:38] william3: has joined #ruby
[07:08:31] tessi: has joined #ruby
[07:11:00] bkxd: has joined #ruby
[07:13:19] Devalo: has joined #ruby
[07:15:24] chagel: has joined #ruby
[07:18:00] AlexJakeGreen: has joined #ruby
[07:18:05] gagrio: has joined #ruby
[07:18:22] bluOxigen: has left #ruby: ()
[07:18:45] armyriad: has joined #ruby
[07:21:46] Polysics: has joined #ruby
[07:22:20] tristanp: has joined #ruby
[07:22:54] Xeago: has joined #ruby
[07:26:24] bradleyprice: has joined #ruby
[07:28:26] S1kx: has joined #ruby
[07:28:41] terlar: has joined #ruby
[07:29:21] jaruga___: has joined #ruby
[07:31:00] xqwztis: has joined #ruby
[07:32:14] ur5us: has joined #ruby
[07:34:00] the_drow: has joined #ruby
[07:36:20] skade: has joined #ruby
[07:36:48] ur5us: has joined #ruby
[07:38:34] roelof: has joined #ruby
[07:40:23] roelof: has joined #ruby
[07:41:12] tubuliferous: has joined #ruby
[07:41:29] roelof: I have this puzzle : https://www.codingame.com/ide/4246062ab2f171097e7138af9673311b2fb0e0e
[07:41:45] lsmola: has joined #ruby
[07:42:17] roelof: and this solution : http://lpaste.net/161374
[07:42:21] TheHodge: has joined #ruby
[07:42:34] roelof: Can I improve my solution somehow : http://lpaste.net/161374
[07:43:37] aufi: has joined #ruby
[07:45:02] toretore: has joined #ruby
[07:45:22] edwinvdgraaf: has joined #ruby
[07:45:39] Couch: has joined #ruby
[07:46:21] evidex: has joined #ruby
[07:46:25] tagaulap: has joined #ruby
[07:46:26] CloCkWeRX: has joined #ruby
[07:46:38] Qommand0r: has joined #ruby
[07:46:44] anisha_: has joined #ruby
[07:46:49] bronson: has joined #ruby
[07:47:47] shayan: has joined #ruby
[07:49:31] Elysia: roelof: the challenge link doesn't work / requires authorization, what is the challenge?
[07:50:14] Elysia: roelof: also, you might like 'codewars', challenges made by users that also (once solved or given up) show you other people their solutions. I'm pretty sure it supports ruby
[07:50:18] roelof: Elysia: I apolize. in 2 sentences the challenge is this : Write a program that prints the temperature closest to 0 among input data. If two numbers are equally close to zero, positive integer has to be considered closest to zero (for instance, if the temperatures are -5 and 5, then display 5).
[07:50:57] Elysia: the solutions by other users are not always the best (some of them are incredibly obscure exploiting the language), but it might give you some cool ideas
[07:51:09] Elysia: oh, are you still on about that issue?
[07:51:48] roelof: which isssue, this code solves all cases presented
[07:52:07] roelof: I only want to know if I can do it a "better" way
[07:52:10] Elysia: issue as in question; you came here yesterday with the same thing
[07:52:28] roelof: correct, but now I solved it
[07:52:37] Elysia: took you a while :P
[07:53:13] PedramT: has joined #ruby
[07:53:45] roelof: Elysia: yep, I still need soeme time to find out which function can do the job and I do also not work full time on it
[07:53:48] Elysia: one thing you might be cautious about is that it's often better to reject user input if it doesn't match your criteria (which may not be the feedback you're looking for - but programs that don't account for bad user input aren't well written programs. For this challenge, it might suffice, but personally I'd put a string in the test cases just to mess with users)
[07:54:11] roelof: for me these are challenges to learn ruby and learn how to solve "real" problems
[07:54:58] roelof: you mean something like "1 2 -4 b 8 7 " ??
[07:55:13] Elysia: yeah, b will be 0
[07:55:29] armyriad: has joined #ruby
[07:55:29] Elysia: irb(main):002:0> "b".to_i
[07:56:06] Elysia: I also would not write code as that oneliner on rule 6, write your program full out - preserve your eyes and sanity
[07:56:39] snowy: has joined #ruby
[07:56:51] Elysia: you can just use "puts temp" on line 10
[07:56:57] navneet: has joined #ruby
[07:57:15] Elysia: unless you want "the temperature is #{temp}", but your current code does not do that
[07:57:16] roelof: oke, so something like if .. then temp = temp * - 1 end ?
[07:57:28] Elysia: use newlines
[07:58:16] Elysia: it helps you expand the code in the future (easier to maintain) and it makes it easier to read (catch errors quickly)
[07:58:30] roelof: of course, I was checking if I understand what you mean
[07:58:33] bollullera: has joined #ruby
[07:59:00] Elysia: if you want to chain some more things, there's room for that too (depends on what you want)
[07:59:33] roelof: I like readable code not putting everything on one line
[07:59:50] Elysia: the 'temp' variable might be misleading (is it a temporary variable, or a temperature?)
[07:59:55] roelof: if that can be done with more chaining , no problem
[08:00:13] roelof: a temperature
[08:00:34] Elysia: "1 2 3 4".split.min_by { |x| x.to_i.abs }.to_i # for example if you want to
[08:01:06] Elysia: depends on what you find more pleasant to read, this isn't extremely overkill yet
[08:01:49] marr: has joined #ruby
[08:02:05] mikecmpbll: has joined #ruby
[08:03:02] galuszkak: has left #ruby: ()
[08:03:25] AlexJakeGreen: has joined #ruby
[08:03:57] agent_white: has joined #ruby
[08:04:30] pawnbox: has joined #ruby
[08:04:33] manveru: >> "-1 1".split.min_by { |x| x.to_i.abs }.to_i
[08:04:35] ruby[bot]: manveru: # => -1 (https://eval.in/559041)
[08:05:11] CloCkWeRX: has left #ruby: ()
[08:06:29] terlar: has joined #ruby
[08:06:53] pawnbox: has joined #ruby
[08:07:01] roelof: Elysia: I can do that but then I can check if there is a same number but then positive, like sentence 6
[08:07:04] rrichardsr3: has joined #ruby
[08:07:26] roelof: or can I use @temps for that purpose
[08:09:42] RahulT: has joined #ruby
[08:09:54] tlaxkit: has joined #ruby
[08:11:11] j2k: has joined #ruby
[08:11:16] roelof: Elysia: I did all the changes you wanted but then I run into this problem : http://lpaste.net/161376
[08:12:15] zacstewart: has joined #ruby
[08:15:06] xall: has joined #ruby
[08:16:10] william3: has joined #ruby
[08:16:13] chagel: has joined #ruby
[08:20:19] roelof: Elysia: and the code fails somehow on this string : "42 -5 12 21 5 24". the output is -5 instead of 5
[08:23:36] tristanp: has joined #ruby
[08:24:29] Emmanuel_Chanel: has joined #ruby
[08:24:44] jackdaniel: 42 is the answer
[08:24:56] Emmanuel_Chanel: has joined #ruby
[08:25:00] mrgrieves: has joined #ruby
[08:25:30] william3: has joined #ruby
[08:26:12] skade: has joined #ruby
[08:27:55] roelof: jackdaniel: since when is 42 more near zero then 5 ?
[08:28:06] manveru: a.reduce{|s,v| sa, va = s.abs, v.abs; sa == va ? (s > v ? s : v) : (sa > va ? v : s) }
[08:28:24] manveru: well, was bored during meeting, so there you go :)
[08:29:13] aupadhye: has joined #ruby
[08:29:44] roelof: meetings are always boring
[08:33:16] skol: has joined #ruby
[08:33:54] Chagel_: has joined #ruby
[08:34:02] Gasher: has joined #ruby
[08:35:04] nisstyre_: has joined #ruby
[08:35:20] UglyVendetta: has joined #ruby
[08:35:25] vnt: has joined #ruby
[08:35:45] last_staff1: has joined #ruby
[08:36:17] moeabdol: has joined #ruby
[08:36:24] GriffinHeart: has joined #ruby
[08:37:50] roelof: Everyone thanks for the help and have a nice day
[08:39:52] CalimeroTeknik: has joined #ruby
[08:41:07] Shashikant86: has joined #ruby
[08:44:10] kp666: has joined #ruby
[08:44:41] tomphp: has joined #ruby
[08:44:42] the_drow: has joined #ruby
[08:44:53] skislak: has joined #ruby
[08:45:08] CalimeroTeknik: hi, I'm running while line = socket.gets.strip … end but the loop doesn't exit even after the TCP connection is long gone. how can I make the loop exit when the connection is dead?
[08:45:35] agent_white: has joined #ruby
[08:45:54] xall: has joined #ruby
[08:45:59] pawnbox: has joined #ruby
[08:46:19] atmosx: CalimeroTeknik You have to break it.
[08:47:05] vondruch: has joined #ruby
[08:47:43] CalimeroTeknik: ah, I thought the affectation in the condition would fulfill that role
[08:47:44] bronson: has joined #ruby
[08:48:50] ur5us: has joined #ruby
[08:48:51] william3: has joined #ruby
[08:48:59] atmosx: CalimeroTeknik tbh I have no idea what you'r edoing, but generally speaking to exit a loop you need a break statement.
[08:49:18] atmosx: There are tons of ruby TCP Server examples online you can google it
[08:49:39] CalimeroTeknik: yeah, the question is more about what the socket does when the connection is broken (it's a client socket)
[08:49:53] CalimeroTeknik: I didn't give any info about the socket, sorry
[08:50:08] manveru: CalimeroTeknik: check out IO.select
[08:50:39] manveru: and if you want to detect broken connection you need some kind of heartbeat
[08:50:46] navneet_: has joined #ruby
[08:50:51] igam: has joined #ruby
[08:51:01] xall: has joined #ruby
[08:51:36] CalimeroTeknik: yeah, I see that socket.gets doesn't return even when the connection breaks
[08:51:45] bazz_: has joined #ruby
[08:53:50] jackdaniel: roeolf: it was a joke related to the "Guide to the Galaxy"
[08:54:51] Pupeno: has joined #ruby
[08:55:22] antgel: has joined #ruby
[08:57:16] RegulationD: has joined #ruby
[08:58:34] TvL2386: has joined #ruby
[08:59:59] malcolmva: has joined #ruby
[09:00:33] Pupeno_: has joined #ruby
[09:01:17] nisstyre_: has joined #ruby
[09:02:06] idletask: has joined #ruby
[09:04:32] ayonkhan: has joined #ruby
[09:05:46] todd: has joined #ruby
[09:06:22] william3: has joined #ruby
[09:10:19] Moosashi: has joined #ruby
[09:11:56] shayan: has joined #ruby
[09:13:16] anisha: has joined #ruby
[09:14:44] PedramT: has joined #ruby
[09:18:40] william3: has joined #ruby
[09:24:54] kam270: has joined #ruby
[09:28:07] chagel: has joined #ruby
[09:29:37] gregf_: >> [42, -5, 12, 21, 5, 24].inject() { |x1, x2| (x1 - diff).abs <= (x2 - diff).abs ? x1 : x2 }
[09:29:39] ruby[bot]: gregf_: # => undefined local variable or method `diff' for main:Object (NameError) ...check link for more (https://eval.in/559100)
[09:29:50] gregf_: *scrolls to the bottom*
[09:29:51] mdw: has joined #ruby
[09:30:11] gregf_: >> diff = 0; [42, -5, 12, 21, 5, 24].inject() { |x1, x2| (x1 - diff).abs <= (x2 - diff).abs ? x1 : x2 }
[09:30:12] ruby[bot]: gregf_: # => -5 (https://eval.in/559101)
[09:31:05] Pupeno: has joined #ruby
[09:34:05] Emmanuel_Chanel: has joined #ruby
[09:34:26] malcolmva: has joined #ruby
[09:34:33] william3: has joined #ruby
[09:34:35] Emmanuel_Chanel: has joined #ruby
[09:39:29] ferr: has joined #ruby
[09:41:13] giz|work: has joined #ruby
[09:41:42] PedramT: has joined #ruby
[09:43:35] mikecmpbll: has joined #ruby
[09:45:11] Infra-Red: has joined #ruby
[09:46:11] Pupeno: has joined #ruby
[09:47:34] Fernando-Basso: arahael: That pythong .uper probably has a default locale anyway.
[09:48:50] M-shine: has joined #ruby
[09:48:58] lkba: has joined #ruby
[09:50:19] bollullera: has joined #ruby
[09:50:49] M-mistake: has joined #ruby
[09:50:57] workmad3: has joined #ruby
[09:51:09] M-Kodo: has joined #ruby
[09:51:42] baweaver: has joined #ruby
[09:52:49] bollullera: has left #ruby: ()
[09:53:47] RahulT: has joined #ruby
[09:53:53] blackmesa: has joined #ruby
[09:55:02] william3: has joined #ruby
[09:55:53] Weavel: has joined #ruby
[10:01:02] kits: has joined #ruby
[10:03:27] pawnbox: has joined #ruby
[10:05:16] skade: has joined #ruby
[10:06:39] Pupeno: has joined #ruby
[10:08:57] lxsameer: has joined #ruby
[10:09:38] xall: has joined #ruby
[10:10:45] astrobunny: has joined #ruby
[10:11:24] tvw: has joined #ruby
[10:13:37] CloCkWeRX: has joined #ruby
[10:14:05] shayan: has joined #ruby
[10:16:40] thesheff17: has joined #ruby
[10:21:14] navneet: has joined #ruby
[10:21:37] navneet_: has joined #ruby
[10:22:51] navneet: has joined #ruby
[10:24:00] JBrickley: has joined #ruby
[10:24:34] tristanp: has joined #ruby
[10:26:04] aeterne: has joined #ruby
[10:28:44] jackdaniel: doesn't work
[10:29:32] Chillphill: has joined #ruby
[10:30:17] Chillphill: Does anyone here know Ruby fluently? If so how long did it take you to learn Ruby fluently? Thanks
[10:30:55] tobiasvl: Chillphill: what does "fluently" mean?
[10:35:35] Chillphill: tobiasvl: Sorry if I didn't sound very clear, but I meant to ask how long it took people to become experienced in Ruby.
[10:39:15] bruce_lee: has joined #ruby
[10:39:15] bruce_lee: has joined #ruby
[10:44:41] shredding: has joined #ruby
[10:46:49] moeabdol: has joined #ruby
[10:48:13] idletask: has joined #ruby
[10:49:14] bronson: has joined #ruby
[10:52:14] GodFather: has joined #ruby
[10:53:57] ur5us: has joined #ruby
[10:54:50] malcolmva: has joined #ruby
[10:55:34] pawnbox: has joined #ruby
[10:55:44] william3: has joined #ruby
[10:57:33] aganov: has joined #ruby
[10:59:29] william3: has joined #ruby
[10:59:57] Xeago: has joined #ruby
[11:01:58] nevynxxx: has joined #ruby
[11:03:11] gregf_: Chillphill: theres no time limit as such, unfortunately :/, you 'always' learn new things as you go along because you would've never to use some method/class/module
[11:03:38] rodfersou: has joined #ruby
[11:03:44] gregf_: *never had
[11:03:49] sdothum: has joined #ruby
[11:04:28] gregf_: i doubt if anyone can say they know it all.. but i guess ruby is much more neater than some other languages :)
[11:05:43] elico: has joined #ruby
[11:06:45] sepp2k: has joined #ruby
[11:07:37] yasha_: has joined #ruby
[11:09:50] freerobby: has joined #ruby
[11:11:54] Shashikant86: has joined #ruby
[11:12:32] zacstewart: has joined #ruby
[11:13:19] PedramT: has joined #ruby
[11:14:49] terlar: has joined #ruby
[11:14:59] Devalo: has joined #ruby
[11:15:31] jaguarmagenta: has joined #ruby
[11:17:47] johnmilton: has joined #ruby
[11:18:06] jds_: has joined #ruby
[11:21:38] navneet_: has joined #ruby
[11:22:41] Yiota: has joined #ruby
[11:25:30] william3: has joined #ruby
[11:26:31] Arahael: Fernando-Basso: but you can't change it, can you?
[11:26:51] ur5us: has joined #ruby
[11:27:07] Arahael: Chillphill: i became experienced in ruby in about 5 minutes.
[11:27:21] Chillphill: araheal: ???
[11:27:36] Arahael: Chillphill: mind you. it's 5 minutes worth of experience, but that's what you asked, isn't it?
[11:27:38] ponga: has joined #ruby
[11:29:08] Fernando-Basso: arahael: I don't know. I just assume that most languages run using a default locale unless the programmer explicitly set one.
[11:29:31] Fernando-Basso: It is like encodign, there is always one being used, no mater if it is set explicitly or not.
[11:29:46] Fernando-Basso: But I may be (and often am, more than I would like to) wrong.
[11:30:15] Arahael: Fernando-Basso: arguably. encoding in ruby is a concept, which can be wrong (as i found out recently)
[11:30:41] araujo: has joined #ruby
[11:31:26] Arahael: Fernando-Basso: infact, i recently tried, and failed, to use a (non-ruby) library that tried to guess the encoding of a text file. my mbox file.
[11:31:53] lxsameer: has joined #ruby
[11:31:55] Arahael: Fernando-Basso: it was trying to convert the file to unicode. (ha)
[11:32:36] Fernando-Basso: I don't think it is possible to detect encoding properly.
[11:32:44] Fernando-Basso: At most, a good guess.
[11:33:18] guardian: has joined #ruby
[11:33:20] Arahael: Fernando-Basso: impossible, by point of fact. mbox files contain multiple, specified and unspecified, encodings.
[11:33:32] Fernando-Basso: It is easier if the file really have "non-ascii" chars at the beginning, so the parsers can make more informed and educated guesses.
[11:33:54] Arahael: Fernando-Basso: that was the trap this parser assumed.
[11:34:18] Fernando-Basso: I see. That is why I said "easier", not "guaranteed" :|
[11:34:37] Fernando-Basso: Anyway, this is a subject I want to learn more about.
[11:34:53] Arahael: Fernando-Basso: so, the question is: wjat encoding is used for an mbox file? NONE.
[11:34:54] Fernando-Basso: I know next to nothing about this topic, but it interests me a lot.
[11:35:32] Fernando-Basso: arahael: Okay, but to display the contents, any tool must assume a encodign, even if it the wrong one.
[11:35:38] Arahael: Fernando-Basso: nope.
[11:35:55] ldnunes: has joined #ruby
[11:35:57] p0wn3d: has joined #ruby
[11:36:10] Arahael: Fernando-Basso: the tools assume that the messages are deliminated by short byte sequences, which happen to be ascii.
[11:36:25] Fernando-Basso: Let's say I use nano to open a mbox file. Wiill it NOT assume any encoding and show only zeros and ones as text?
[11:36:39] Arahael: specifically, "FROM " and "\n" are the only tokens you can recognise.
[11:36:45] toretore: ascii is an encoding like any other
[11:36:46] workmad3: Fernando-Basso: chances are nano will assume ASCII, but that doesn't make it correct
[11:37:01] workmad3: Fernando-Basso: or it'll say "You're trying to view a binary file"
[11:37:06] toretore: thus, ascii is the assumed encoding
[11:37:19] Arahael: tercenya: ascii is 7-bit.
[11:37:35] Arahael: tercenya: you can have non-ascii characters in the file.
[11:37:56] workmad3: arahael: mbox stores emails in raw form, right?
[11:38:10] Arahael: workmad3: sort of.
[11:38:19] workmad3: arahael: which means any requirements on encodings will probably track with the email RFCs
[11:38:25] Fernando-Basso: But anyway, to display text, be it wrong or correct, any "file viewer" has to pick an encoding and try to format it to the user using that guessed encoding.
[11:38:29] Arahael: workmad3: sort of.
[11:38:50] toretore: arahael: so i find 01000001 in a file, how do i know what it's supposed to be?
[11:38:56] Arahael: workmad3: some mbox readers and writers (the better ones), will munge the raw email slightly.
[11:39:06] Arahael: toretore: you don't.
[11:39:23] tobiasvl: toretore: that's impossible to know without knowing the encoding.
[11:39:34] Arahael: Fernando-Basso: no, you don't guess.
[11:39:51] Fernando-Basso: Then you open the file to the user and display 01000001 ?
[11:40:04] toretore: right. i can *assume* it's ascii compatible, then it's an a
[11:40:10] Arahael: Fernando-Basso: why would the user do that?
[11:40:13] Arahael: toretore: nope.
[11:40:21] toretore: so to parse bytes as text you must always assume an encoding.
[11:40:25] tobiasvl: Fernando-Basso: in that case you fall back to a default (if "you" is an editor)
[11:40:32] Arahael: toretore: you have no business, as an mbox parser, to care about the character 'a'.
[11:40:44] toretore: arahael: i'm not an mbox parser
[11:40:48] Fernando-Basso: arahael: you save foo.txt with the content asdf. Open it in any text editor and it will display it as asdf.
[11:40:51] toretore: i'm a text parser
[11:40:54] gnufied: has joined #ruby
[11:40:57] Arahael: Fernando-Basso: you'd pass the blob, unchanged, to an email parser.
[11:41:28] nofacade: has joined #ruby
[11:41:50] tobiasvl: there's nothing wrong in assuming what encoding is used, on a general basis. many programs guess/assume encoding. sometimes it will fail horribly of course.
[11:41:53] Fernando-Basso: And if you save ✓ in a text file, many will detect it as utf-8 or something and also display it correctly (and many will not).
[11:42:18] Arahael: but consider that tick here.
[11:42:28] Arahael: how did the irc server cope with that?
[11:42:30] skade: has joined #ruby
[11:42:38] tobiasvl: the server did not
[11:42:45] giz|work: has joined #ruby
[11:43:00] tobiasvl: the irc server did what arahael said you should do with mbox: it passed it on
[11:43:01] Arahael: it did. it handled it fine, it just didn;t interpret it, nor did it need to.
[11:43:10] Arahael: tobiasvl: exactly.
[11:43:10] tobiasvl: wait you are arahael
[11:43:21] Arahael: ACTION checks himself :)
[11:43:45] p0wn3d: has joined #ruby
[11:44:09] Arahael: the irc server makes no assumptions about the client's encodings.
[11:44:23] toretore: everybody's talking past each other because everybody thinks everyone else doesn't understand when in fact everyone does understand
[11:44:24] Fernando-Basso: But the clients do.
[11:44:49] Arahael: Fernando-Basso: indeed.
[11:45:10] workmad3: ah, the mbox RFC is wonderfully underspecified :D https://tools.ietf.org/html/rfc4155
[11:45:29] Arahael: workmad3: it's why i used it as an example. :)
[11:45:46] Arahael: anyway. back to the original point.
[11:46:06] Arahael: there isn't always a(n) encoding.
[11:46:24] workmad3: arahael: what I find really amusing is that it specifies things like using 2 end-of-line delimiters to separate messages, but doesn't specify an encoding in order to determine what an end-of-line delimiter is :)
[11:46:58] CloCkWeRX: has joined #ruby
[11:47:06] Arahael: workmad3: indeed. so you can only assume ascii substrings in an otherwose binary stream.
[11:47:10] chipotle: has joined #ruby
[11:47:30] Arahael: workmad3: and hope/pray that the messages therein don't happen to have those sequences themselves.
[11:48:01] Arahael: workmad3: if they do... you need to second-guess which implementation wrote it!
[11:48:13] Arahael: workmad3: and munge them appropriately.
[11:48:13] Fernando-Basso: arahael: And my point was that a "client" for "something" assumes an encoding when displaying the contents.
[11:48:29] Arahael: Fernando-Basso: ah. but only at the final point.
[11:48:50] workmad3: arahael: I'd disagree... there is always an encoding, otherwise you have no way to interpret the data... in mbox, it seems the encoding is an implicit ASCII with embedded arbitrary data that should probably be encoded in a suitable 7-bit stream
[11:49:02] Mon_Ouie: has joined #ruby
[11:49:14] Arahael: Fernando-Basso: in the presentation layer. *hopefully* at a point where you don't toss away any information.
[11:49:22] workmad3: arahael: sometimes a format is shit about communicating the encoding, but that doesn't mean there isn't one
[11:49:31] Arahael: workmad3: 7-bit? it could easily be 8-bit.
[11:49:37] Fernando-Basso: arahael: Also, I assume by "no encoding" you mean groups of 8 bits as default?
[11:50:28] workmad3: arahael: right, because mbox isn't really fully standardised... but in the 'standard' rfc and default layout, the stream is specified as 7-bit and if the data has a wider width, it should be encoded in a suitable fashion
[11:50:37] Arahael: Fernando-Basso: by "no encoding", i mean, that it's a secret code of gibberish that needs to be faithfully handed over unchanged to someone/thing who understands it.
[11:50:51] Arahael: workmad3: "should".
[11:50:53] Fernando-Basso: arahael: Okay. Got your point then.
[11:51:28] workmad3: arahael: yeah, that comes back to mbox being underspecified, not to there being 'no encoding'... again, there's always an encoding
[11:51:44] Arahael: Fernando-Basso: excellent. all that said... encoding is a *concept*. a useful one perhaps, but none-the-less, a concept.
[11:52:17] Arahael: workmad3: "an" is a singular term.
[11:52:28] workmad3: arahael: and in your 'secret code of gibberish' example, again there's an encoding, but some intermediate system just doesn't care about it and passes it on transparently to some other system that understands it
[11:52:56] Arahael: workmad3: it is essentially a binary stream.
[11:53:04] baweaver: has joined #ruby
[11:53:31] Ox0dea: >> Encoding::BINARY
[11:53:32] ruby[bot]: Ox0dea: # => #<Encoding:ASCII-8BIT> (https://eval.in/559231)
[11:53:36] workmad3: arahael: right... but the encoding specifies how to tell the start/stop of the stream
[11:53:37] DoubleMalt: has joined #ruby
[11:53:42] darkf: has left #ruby: ("Leaving")
[11:53:57] workmad3: (even if it's ad-hoc in a non-standardised container format)
[11:54:14] Arahael: workmad3: yes, but now you're using "encoding" in the sense that we usually refer to it as "protocol".
[11:55:16] ruby-lang450: has joined #ruby
[11:55:38] last_staff1: has joined #ruby
[11:55:44] Carella: has joined #ruby
[11:56:00] Arahael: Ox0dea: that doesn't mean anyhing though! that's just squeezing "unspecified" into ruby's concept of "encoding".
[11:56:58] Arahael: i'm being sent to bed! g'night!
[11:57:02] Ox0dea: arahael: It's a dummy encoding for treating eight bits as a byte; I was mostly being facetious.
[11:57:09] workmad3: arahael: hmm... I see a protocol as related to an encoding along these lines, but I'll admit I'm getting into hazy territory anyway :)
[11:57:15] Arahael: Ox0dea: i was hopig you were :)
[11:57:21] Ox0dea: workmad3: They're very different things.
[11:57:30] Arahael: workmad3: at the end of the day, it's semantics.
[11:57:31] _aeris_: has joined #ruby
[11:57:36] _aeris_: Hello #ruby !
[11:57:55] _aeris_: i found something "strange" with the rand function
[11:58:01] Ox0dea: Let's see it.
[11:58:18] _aeris_: 1000000.times.collect { Math.log2(rand 2**(20*8)) } .minmax => [138.76, 159.99]
[11:58:33] PedramT: has joined #ruby
[11:58:53] navneet: has joined #ruby
[11:59:24] Ox0dea: You think it's "strange" that you got such "round" numbers, or?
[11:59:25] _aeris_: seems only the high part of the range is possible, numbers less than 2**130 never occur
[12:00:02] _aeris_: 100000000.times.collect { Math.log2(rand 2**(20*8)) } .minmax
[12:00:03] _aeris_: => [130.24908712522083, 159.99999999886674]
[12:00:20] jdawgaz: has joined #ruby
[12:00:41] _aeris_: ok, this is not a CSPRNG, but the gap is huge :P
[12:00:53] Ox0dea: Doesn't look that huge to me.
[12:01:06] PedramT_: has joined #ruby
[12:01:30] workmad3: _aeris_: that wouldn't surprise me... the internal state of the prime generator can only store so much entropy, and that entropy isn't going to be in the order of gigabytes required to generate random numbers in such a large range
[12:01:32] roelof: has joined #ruby
[12:02:00] workmad3: *random generator
[12:02:04] workmad3: (dunno why I typed prime there)
[12:02:18] roelof: I have a challenge where I have to convert a text to asci-art. Can someone give me some tips how I can solve this in plain ruby ?
[12:02:30] Ox0dea: &ri Array#transpose roelof
[12:02:30] `derpy: roelof: http://ruby-doc.org/core-2.3.0/Array.html#method-i-transpose
[12:02:31] godzillaenlacasa: has joined #ruby
[12:02:59] apeiros: not having the math readily available, but with random numbers from 0 to 2**160, in a tiny sample size of 1000000, how likely is it to get numbers below 2**130?
[12:03:21] apeiros: because you see, 10-99 has 10 times as many numbers as 0-9
[12:03:56] apeiros: so with rand(100), the likeliness to get a number between 10 and 99 is 10 times as high as getting one from 0-9
[12:03:59] Ox0dea: _aeris_: was getting random numbers between 2**159 and 2**160 just fine.
[12:04:03] _aeris_: apeiros > but you have 100% probability to go up to 2**160
[12:04:08] _aeris_: this is weird
[12:04:29] apeiros: no, you have a 100/(2**80)*1000000 probability
[12:04:31] last_staff1: has joined #ruby
[12:04:38] apeiros: well, actually that's not the correct formula
[12:04:44] roelof: Ox0dea: thanks, I think I need a good look and a lot of thinking how I can convert the 'e' to something like this : http://lpaste.net/161396
[12:04:50] apeiros: but it's a lot closer to the truth than 100%
[12:04:55] PedramT: has joined #ruby
[12:05:10] Shashikant86: has joined #ruby
[12:05:13] _aeris_: Ox0dea > yep, ok with 1 bit gap
[12:05:35] apeiros: actually, you've got 0% chance of getting 2**160
[12:05:48] _aeris_: apeiros > in all my test case, upper bound is targeted, not the lower bound
[12:05:49] blaxter: has joined #ruby
[12:05:50] Ox0dea: _aeris_: rand(2**160) *can* give you 2**160 - 1, but don't hold your breath.
[12:05:52] apeiros: because rand(2**160) is 0-(2**160 - 1)
[12:05:59] shayan: has joined #ruby
[12:06:28] apeiros: anyway, I think your strangeness is almost certainly already explained by ordinary probability calculations.
[12:06:35] _aeris_: sorry i reformulate. all test case give number with arround 160 bits, but no number less than 130 bits
[12:06:39] Ox0dea: roelof: The trick is to convert your "font" to columns rather than rows, piece together your output, then transpose it back into rows for printing.
[12:06:43] yardenbar: Hello, I'm trying to open a SFTP connection, getting "500 Illegal PORT command" exception. reading SE I understand that I need to set the connection to passive mode, however, when I try to access the sftp.passive within a 'do' block, it unavailable. Can I set the passive option using a options hash?
[12:07:01] _aeris_: i always got 159+ bits number, but never 130- bits
[12:07:02] apeiros: _aeris_: yes, do me a favor. calculate the probablity of a number with less than 130 bits to occur in 1e6 tries.
[12:07:12] crime: has joined #ruby
[12:07:28] _aeris_: apeiros > the same probability to have one of 150 bits
[12:07:35] apeiros: _aeris_: no
[12:07:41] apeiros: that's wrong and I just told you why.
[12:08:00] apeiros: with every bit you add, there's twice as many numbers you can get.
[12:08:09] roelof: Ox0dea: oke, I will experiment with it. I get the idea that I need to use convert the char to binary
[12:08:10] _aeris_: ACTION noob ><
[12:08:17] _aeris_: ACTION hurt his fingers
[12:08:20] jinie_: has joined #ruby
[12:08:25] apeiros: _aeris_: ad-hominem is not welcome here
[12:08:25] Ox0dea: roelof: No, that's not strictly necessary.
[12:08:28] Chagel_: has joined #ruby
[12:08:42] apeiros: and saying it when you're wrong too makes you look even worse.
[12:08:47] workmad3: apeiros: ah, good point (it's monday morning, I'm not doing well today)... it's basically the chance of generating 160 bits with 30 leading zeros...
[12:08:56] Ox0dea: apeiros: I believe _aeris_ was referring to themself?
[12:09:16] apeiros: Ox0dea: let's hope so… I didn't understand it that way.
[12:09:25] workmad3: apeiros: he did use `/me`
[12:09:36] Ox0dea: You're way too quick on the defense.
[12:09:38] IrishGringo: has joined #ruby
[12:09:51] PedramT: has joined #ruby
[12:10:17] apeiros: Ox0dea: I'm not on the defense. ad-hominem is something which causes me to kick. but yes, I might have misread the intended meaning.
[12:11:16] Ox0dea: apeiros: Your misreading is precisely to what I was referring, mind.
[12:11:18] norc: has joined #ruby
[12:11:29] norc: has left #ruby: ()
[12:11:31] norc: has joined #ruby
[12:11:33] _aeris_: i refer to me, yep :D
[12:11:33] apeiros: Ox0dea: that's unrelated to defense/offense, though
[12:11:36] norc: Greetings.
[12:11:50] norc: apeiros: I did it! I actually did it!
[12:12:05] roelof: Ox0dea: oke, I think I will to do some experiments to understand what you mean with this : convert your "font" to columns
[12:12:19] blackmesa: has joined #ruby
[12:12:33] norc: apeiros: My boss is considering EDB. (:
[12:12:41] roelof: this schould be a easy challenge from codingame but for the first time I have no clue where to start
[12:12:46] apeiros: EDB = enterprise db = postgres?
[12:12:55] workmad3: _aeris_: btw, a quick calculation shows that 130-bit numbers constitute about 1e-9 of the total number of 160-bit numbers
[12:12:56] apeiros: damn you :D
[12:13:05] apeiros: congrats, I hope for you they'll follow through
[12:13:11] apeiros: now I'm jealous
[12:13:47] adaedra: Go back to your Oracle.
[12:13:49] william3: has joined #ruby
[12:13:58] apeiros: adaedra: I wish. I have to go back to mssql now :<
[12:14:12] adaedra: I hesitated between the two.
[12:14:12] apeiros: tho I'm not yet truly sure which is worse
[12:14:30] apeiros: but who cares whether it's purgatory or inferno. it's just bad.
[12:14:52] adaedra: If I recall, purgatory < inferno
[12:15:12] norc: Interestingly enough this time it is me who calls to move this discussion to #ot
[12:15:17] apeiros: I haven't actually read dante, so I wouldn't know :-|
[12:15:26] apeiros: and yupp, > ot
[12:15:53] apeiros: _aeris_: my apologies for jumping at you. I did misread your comment.
[12:16:16] adaedra: Stop insulting yourself!
[12:17:30] SilverKey: has joined #ruby
[12:17:37] flashpoint9: has joined #ruby
[12:19:04] gagrio: has joined #ruby
[12:19:14] Arahael: adaedra: there's always cockroachDB
[12:19:58] norc: arahael: Discussion was moved to #ruby-offtopic
[12:20:29] william3: has joined #ruby
[12:20:31] norc: Was really smart. First I disrupt the channel by introducing an OT topic, and then I end up being the hero that enforces channel rules.
[12:20:35] norc: apeiros: Do I get a cookie?
[12:20:40] ruby[bot]: here's your cookie: 🍪
[12:21:00] adaedra: ACTION was tempted to `!kick norc 🍪`
[12:21:35] adaedra: We don't need another hero.
[12:22:20] jdawgaz: has joined #ruby
[12:22:57] braincra: has joined #ruby
[12:23:37] synthroid: has joined #ruby
[12:24:33] braincrash: has joined #ruby
[12:24:52] snowy: has joined #ruby
[12:25:00] brendan-: has joined #ruby
[12:25:14] tristanp: has joined #ruby
[12:25:28] _aeris_: apeiros > no problem :)
[12:27:03] braincrash: has joined #ruby
[12:27:36] stardiviner: has joined #ruby
[12:29:01] braincra: has left #ruby: ()
[12:29:05] djcp: has joined #ruby
[12:30:08] senayar: has joined #ruby
[12:31:31] mdw: has joined #ruby
[12:32:55] roelof: Is codewars a good place to practice ruby problems
[12:33:51] benzrf: roelof: probably
[12:33:56] p1k: has joined #ruby
[12:35:03] mdw7: has joined #ruby
[12:36:28] roelof: benzrf: I use codingame but there the easy puzzles are very hard
[12:40:19] navneet_: has joined #ruby
[12:41:17] p0wn3d: has joined #ruby
[12:43:14] Carella: has joined #ruby
[12:48:44] moeabdol: has joined #ruby
[12:51:18] bronson: has joined #ruby
[12:51:35] ChiefAlexander: has joined #ruby
[12:53:09] Tref: has joined #ruby
[12:53:54] opentux: has joined #ruby
[12:54:53] ramortegui: has joined #ruby
[12:54:54] SilverKey: has joined #ruby
[12:55:06] BSaboia: has joined #ruby
[12:56:24] xue: has joined #ruby
[12:56:58] siovene: has joined #ruby
[12:57:38] kareeoleez: has joined #ruby
[12:58:21] tomphp_: has joined #ruby
[12:58:43] RegulationD: has joined #ruby
[12:58:50] ryotarai: has joined #ruby
[12:59:23] CausaMortis_: has joined #ruby
[12:59:28] ejnahc: has joined #ruby
[12:59:31] ChiefAlexander: has joined #ruby
[12:59:44] pietr0_: has joined #ruby
[12:59:48] freerobby: has joined #ruby
[12:59:55] paulgrmn3: has joined #ruby
[13:00:47] Es0teric: has joined #ruby
[13:00:55] eregon: has joined #ruby
[13:01:18] ChiefAlexander: has joined #ruby
[13:01:27] Es0teric: has joined #ruby
[13:01:39] jaruga___: has joined #ruby
[13:02:02] Tempesta: has joined #ruby
[13:02:35] skade: has joined #ruby
[13:03:01] spacemud: has joined #ruby
[13:03:08] zenspider: has joined #ruby
[13:04:21] ryotarai: has joined #ruby
[13:04:54] elusiveother: has joined #ruby
[13:04:54] elusiveother: has joined #ruby
[13:05:09] brianpWins: has joined #ruby
[13:05:20] vondruch: has joined #ruby
[13:05:30] bafbomb: has joined #ruby
[13:05:35] lxsameer: has joined #ruby
[13:05:36] scottschecter: has joined #ruby
[13:05:37] UserInneed: has joined #ruby
[13:05:44] aegis3121: has joined #ruby
[13:05:54] astrobunny: has joined #ruby
[13:06:08] william3: has joined #ruby
[13:06:16] davidcelis: has joined #ruby
[13:06:17] davidcelis: has joined #ruby
[13:06:39] idletask: has joined #ruby
[13:06:52] okdas: has joined #ruby
[13:06:52] okdas: has joined #ruby
[13:06:52] John3: has joined #ruby
[13:07:07] swistak35: has joined #ruby
[13:07:11] mattp_: has joined #ruby
[13:07:32] callen92: has joined #ruby
[13:07:47] IrishGringo: has joined #ruby
[13:08:47] j2k: has joined #ruby
[13:09:28] Edulix: has joined #ruby
[13:09:30] M-shine: has joined #ruby
[13:09:37] RahulT: has joined #ruby
[13:09:59] psmolen: has joined #ruby
[13:11:55] wldcordeiro: has joined #ruby
[13:12:04] dgncn: has joined #ruby
[13:12:07] ldnunes: has joined #ruby
[13:12:33] lkba: has joined #ruby
[13:13:35] diegoaguilar: has joined #ruby
[13:13:44] Ropeney: has joined #ruby
[13:13:49] bazz_: has joined #ruby
[13:13:57] Ox0dea: has joined #ruby
[13:15:26] bluOxigen_: has joined #ruby
[13:15:27] mjuszczak: has joined #ruby
[13:15:44] marens: has joined #ruby
[13:15:50] PedramT: has joined #ruby
[13:16:16] jaguarmagenta: has joined #ruby
[13:16:30] Devalo: has joined #ruby
[13:17:10] crime: has joined #ruby
[13:17:16] isxek: has joined #ruby
[13:17:49] lkba: has joined #ruby
[13:18:45] PedramT_: has joined #ruby
[13:19:23] prestorium: has joined #ruby
[13:19:50] TvL2386: has joined #ruby
[13:20:03] sgambino: has joined #ruby
[13:21:17] j2k: has joined #ruby
[13:22:58] gagrio: has joined #ruby
[13:24:50] ChiefAlexander: has joined #ruby
[13:26:05] marienz: has joined #ruby
[13:26:27] william3: has joined #ruby
[13:27:36] jrafanie: has joined #ruby
[13:27:38] chipotle: has joined #ruby
[13:27:43] PedramT: has joined #ruby
[13:28:11] greister: has joined #ruby
[13:28:23] kriskropd: has joined #ruby
[13:28:38] bradleyprice: has joined #ruby
[13:29:57] lkba: has joined #ruby
[13:30:02] PedramT_: has joined #ruby
[13:30:20] yeticry: has joined #ruby
[13:31:39] polishdub: has joined #ruby
[13:31:56] GodFather: has joined #ruby
[13:32:48] futilegames: has joined #ruby
[13:32:51] platzhirsch: has joined #ruby
[13:33:16] lkba_: has joined #ruby
[13:33:19] PedramT: has joined #ruby
[13:33:26] william3: has joined #ruby
[13:34:32] rodfersou: has joined #ruby
[13:34:38] navneet: has joined #ruby
[13:36:18] vondruch: has joined #ruby
[13:37:31] dionysus69: has joined #ruby
[13:37:31] malconis: has joined #ruby
[13:38:11] emilford: has joined #ruby
[13:39:44] pawnbox: has joined #ruby
[13:39:44] PedramT: has joined #ruby
[13:41:44] tildes: has joined #ruby
[13:41:51] zacstewart: has joined #ruby
[13:42:35] PedramT_: has joined #ruby
[13:44:44] navneet_: has joined #ruby
[13:46:20] william3: has joined #ruby
[13:46:24] PedramT: has joined #ruby
[13:47:38] pawnbox: has joined #ruby
[13:48:19] PedramT: has joined #ruby
[13:48:29] PedramT: has joined #ruby
[13:50:14] Mon_Ouie: has joined #ruby
[13:51:27] cdg: has joined #ruby
[13:54:18] siaW: has joined #ruby
[13:54:24] rbennacer: has joined #ruby
[13:54:41] baweaver: has joined #ruby
[13:55:15] rbennacer: has joined #ruby
[13:55:22] PedramT: has joined #ruby
[13:56:58] SilverKey: has joined #ruby
[13:57:00] cdg: has joined #ruby
[13:57:05] kasisnu: has joined #ruby
[13:57:25] majjoha: has joined #ruby
[13:58:32] allcentury: has joined #ruby
[14:00:03] tristanp: has joined #ruby
[14:01:05] Guest38: has joined #ruby
[14:02:40] agent_white: has joined #ruby
[14:05:21] crime: its 10 oclock, u gotta get up earlier than that, homie
[14:08:11] Fernando-Basso: 11:08 a.m. here.
[14:08:33] Fernando-Basso: These people are getting nowhere in life bahving like this.
[14:09:34] banister: has joined #ruby
[14:09:43] Fernando-Basso: crime: Perhaps we are being unfair. What if this person works on a night shift?
[14:10:38] SilverKey: has joined #ruby
[14:10:55] Fernando-Basso: crime: Another thesis: sie is using UGT.
[14:11:24] benzrf: Fernando-Basso: 'sie' is so ugly, why not just use 'they'?
[14:12:23] crime: excuses are the nails that seal the coffin of failure
[14:12:26] Fernando-Basso: Ugly? Well, then I don't understand the meaning.
[14:12:42] Fernando-Basso: agent_white: Sorry, I didn't mean to sound offensive.
[14:12:43] crime: rise at dawn, code til dusk, die when tests are all green
[14:12:51] crime: p much it
[14:13:27] Fernando-Basso: ACTION looks up “sie”
[14:15:19] Fernando-Basso: benzrf: Thanks for the tip. You are right.
[14:15:52] n008f4g_: has joined #ruby
[14:16:05] zast: has joined #ruby
[14:16:27] jhack: has joined #ruby
[14:16:40] theunraveler: has joined #ruby
[14:17:07] tubuliferous: has joined #ruby
[14:17:54] aspiers_: has joined #ruby
[14:17:59] banister: has joined #ruby
[14:18:33] agent_white: Fernando-Basso: Pardon?
[14:18:45] mlakewood: has joined #ruby
[14:18:47] ramirio: has joined #ruby
[14:19:51] Fernando-Basso: I didn't want to sound offensive when using “sie”. I had a wrong understanding of that word.
[14:20:02] stannard: has joined #ruby
[14:21:10] benzrf: Fernando-Basso: oh, well, it's not *offensive
[14:21:15] benzrf: *offensive*
[14:21:33] benzrf: Fernando-Basso: it's just that it sounds less natural than 'they', in my opinion
[14:21:57] DaniG2k: has joined #ruby
[14:22:21] smathy: has joined #ruby
[14:23:13] Fernando-Basso: Well, it is a relief to know it is not _that_ offsensive at least.
[14:24:11] Fernando-Basso: According to urban dict, it looked like it may sound offenseive at times.
[14:24:55] newjersey: has joined #ruby
[14:25:20] colegatron: has joined #ruby
[14:25:34] Sandman: has joined #ruby
[14:25:58] slackbotgz: has joined #ruby
[14:26:25] xqwzts: has joined #ruby
[14:27:00] theunraveler: has joined #ruby
[14:27:01] crameth: has joined #ruby
[14:27:14] northrup: has joined #ruby
[14:27:26] djellemah: has joined #ruby
[14:27:38] troulouliou_div2: has joined #ruby
[14:27:41] kareeoleez: has joined #ruby
[14:29:24] chipotle: has joined #ruby
[14:29:58] chouhoulis: has joined #ruby
[14:30:03] djellemah_: has joined #ruby
[14:30:55] vishwa: has joined #ruby
[14:31:22] tubuliferous: has joined #ruby
[14:31:23] vishwa: How do you use map with a function that you want to use to modify each value of the array?
[14:31:33] vishwa: is that function supposed to return a value?
[14:32:02] crime: preferred pronouns are so stupid. the english language doesn't change for your feelings. ugh
[14:32:34] itsnwa: has joined #ruby
[14:32:54] kasisnu: has joined #ruby
[14:33:08] hxegon: has joined #ruby
[14:33:20] vishwa: when I use myarr.map { |x| get_only_domain(x) } , what's get_only_domain supposed to return?
[14:34:02] aegis3121: has joined #ruby
[14:36:07] toretore: vishwa: are you talking about mutating myarr?
[14:36:18] twistedbot^^: has joined #ruby
[14:36:24] callen92: has joined #ruby
[14:36:52] vishwa: toretore: yes, I want to modify myarr
[14:38:05] twistedbotYYY: has joined #ruby
[14:38:05] blackmesa: has joined #ruby
[14:38:27] twistedbotYYY: has joined #ruby
[14:38:43] rkazak: has joined #ruby
[14:39:59] toretore: vishwa: use map! instead of just map
[14:47:08] noway_: has joined #ruby
[14:48:55] geek876: has joined #ruby
[14:49:35] nemoNoboru: has joined #ruby
[14:50:40] Tref: has joined #ruby
[14:51:21] rippa: has joined #ruby
[14:51:50] geek876: Guys, I have 2 string variables, time 2016-04-25 15:47:34 and msec = 199000. I want to format time from these two. Will doing this work ? Time.at(time, msec).strftime("%Y-%m-%dT%H:%M:%S.%L%z") ?
[14:51:56] Polysics_: has joined #ruby
[14:51:56] vishwa: toretore: is there a way to find which particular variable caused an error? I use backtrace but
[14:52:05] vishwa: i dont think bt gives you the variable
[14:55:19] dsimon: vishwa, the backtrace should show the method name that caused the problem, is that not enough to narrow it down?
[14:56:44] ptierno: has joined #ruby
[14:56:45] ptierno: has joined #ruby
[14:57:46] vishwa: dsimon: it hasn't been so far
[14:58:03] vishwa: anyway, another question: are there any ruby libraries to expand shortened urls?
[14:58:49] dsimon: http://lmgtfy.com/?q=ruby+library+expand+shortened+urls
[14:59:19] WaqasA: has joined #ruby
[14:59:23] robbyoconnor: has joined #ruby
[14:59:55] alecs: has joined #ruby
[15:00:18] RegulationD: has joined #ruby
[15:01:03] tuxiano: has joined #ruby
[15:01:14] tuxiano: has left #ruby: ()
[15:01:18] vishwa: dsimon: hah, much appreciated
[15:01:52] dsimon: sorry, that was a bit snarky of me
[15:02:38] Devalo: has joined #ruby
[15:02:45] chipotle: has joined #ruby
[15:03:19] andikr: has joined #ruby
[15:03:57] PedramT: has joined #ruby
[15:05:17] vondruch: has joined #ruby
[15:05:38] adaedra: Just a bit.
[15:08:03] GodFather: has joined #ruby
[15:12:01] DaniG2k_: has joined #ruby
[15:12:16] elifoster: has joined #ruby
[15:13:12] x77686d: has joined #ruby
[15:13:24] zacstewart: has joined #ruby
[15:13:50] aspiers_: has joined #ruby
[15:16:46] geek876: sorry, I am new with ruby. I have a function like this Time.strptime("2016-04-19 22:17:41,079000", "%F %T,%N"), how do i pass variables to it so that 2016-04-19 for example is a variable t and so it time and millisec ?
[15:17:02] jaguarmagenta: has joined #ruby
[15:17:18] machty: i'd like to spin up a quick server that just barfs the request payload so that i can debug/test webhooks. is there a one-liner httpd esque thing i could use in ruby or what's the easiest way to do this?
[15:18:09] RegulationD: has joined #ruby
[15:19:19] ChiefAlexander: has joined #ruby
[15:21:23] ironcamel: machty: maybe whip up a quick sinatra app http://www.sinatrarb.com
[15:21:33] PedramT_: has joined #ruby
[15:22:49] PedramT_: has joined #ruby
[15:22:58] troulouliou_div2: has joined #ruby
[15:23:24] Shashikant86: has joined #ruby
[15:23:26] xqwzts: I have an assert failure problem in a test suite. The asserts fail when run in one test method and pass when in individual test methods. Can someone please take a look? https://gist.github.com/sumproxy/5da24716ffe456c288dec44c4107e22e
[15:24:04] edwinvdgraaf: has joined #ruby
[15:24:13] moeabdol: has joined #ruby
[15:24:35] ironcamel: require sinatra; get '/*' { request.body }
[15:25:39] Shashikant86: has joined #ruby
[15:26:39] ur5us: has joined #ruby
[15:27:52] Shashikant86: has joined #ruby
[15:28:38] Regulati_: has joined #ruby
[15:29:13] kareeoleez: has joined #ruby
[15:29:30] bradleyprice: has joined #ruby
[15:30:12] crime: has joined #ruby
[15:30:26] JBlazeCoder21: has joined #ruby
[15:30:27] sharkman: has joined #ruby
[15:30:30] Frem: has joined #ruby
[15:30:46] sharkman: what does, def [](k); @hash[k.to_s]; end
[15:30:54] moeabdol: has joined #ruby
[15:31:18] freerobby: has joined #ruby
[15:31:20] dionysus69: has joined #ruby
[15:31:34] nando293921: has joined #ruby
[15:31:38] hxegon: sharkman looks up the stringified version of k on @hash
[15:32:09] hxegon: I'm guessing the #to_s is to make sure :symbol calls still work.
[15:33:03] fmcgeough: has joined #ruby
[15:33:10] sharkman: hxegon i understand the .to_s part, the part that i dont understand is really the def[]
[15:33:15] sharkman: sorry got disconected. hxegon i understand the .to_s part, the part that i dont understand is really the def[]
[15:33:45] ironcamel: it is defining a [] operator
[15:33:54] PedramT: has joined #ruby
[15:33:57] hxegon: sharkman if you def[] on an object, than you can do object[] like arrays and hashes can
[15:33:58] n008f4g_: has joined #ruby
[15:34:38] sharkman: sorry i dont understand, can you point me to an example online somewhere or further explanation i can see
[15:34:42] Carella: has joined #ruby
[15:35:52] PedramT_: has joined #ruby
[15:36:18] hxegon: >> class Foo; def[](bar); bar; end; end; Foo.new["arbitrary input"]
[15:36:37] hxegon: > class Foo; def[](bar); bar; end; end; Foo.new["arbitrary input"]
[15:36:59] solars: has joined #ruby
[15:37:18] hxegon: Did the bot change? anyway sharkman that would return "arbitrary input".
[15:37:24] adaedra: hxegon: you need to be registered and authenticated.
[15:37:32] platzhirsch: has joined #ruby
[15:37:53] sharkman: ah okay thanks hxegon i think i get it now
[15:38:30] aspiers_: has joined #ruby
[15:38:40] adaedra: sharkman: when you do object[...], you actually call the [] method on it.
[15:38:46] hxegon: np sharkman
[15:39:07] goodroot: has joined #ruby
[15:40:43] davedev24: has joined #ruby
[15:41:18] dhollinger: has joined #ruby
[15:42:00] Xeago: has joined #ruby
[15:43:11] ramfjord: has joined #ruby
[15:43:25] GodFather: has joined #ruby
[15:43:49] [Butch]: has joined #ruby
[15:45:03] bradleyprice: has joined #ruby
[15:48:48] berserk_ren: has joined #ruby
[15:49:27] SCHAAP137: has joined #ruby
[15:49:40] Coldblackice_: has joined #ruby
[15:49:44] SilverKey: has joined #ruby
[15:51:10] shevy: sharky shark
[15:52:21] amclain: has joined #ruby
[15:52:51] IrishGringo: has joined #ruby
[15:53:09] mwlang: has joined #ruby
[15:55:30] norc: has joined #ruby
[15:55:31] baweaver: has joined #ruby
[15:55:54] CausaMortis_: has joined #ruby
[15:55:58] TomyLobo: has joined #ruby
[15:56:25] hobodave: has joined #ruby
[15:57:12] n008f4g_: has joined #ruby
[15:57:41] kristofferR: has joined #ruby
[16:00:23] tAn: has joined #ruby
[16:01:38] Xeago: has joined #ruby
[16:01:43] hobodave_: has joined #ruby
[16:03:28] mlakewood: has joined #ruby
[16:04:27] mjuszczak: has joined #ruby
[16:06:46] synthroid: has joined #ruby
[16:07:27] tristanp: has joined #ruby
[16:07:42] VeryBewitching: has joined #ruby
[16:09:26] cschneid: has joined #ruby
[16:10:01] cschneid: whats the current-hotness for debuggers? Running ruby 2.2 - just want the classic command line debugger
[16:10:46] norc: cschneid, byebug
[16:11:20] Pupeno: has joined #ruby
[16:11:21] Pupeno: has joined #ruby
[16:11:32] norc: cschneid, pry-byebug might be something to look at too.
[16:12:03] benlieb: has joined #ruby
[16:12:27] sneakerhax: has joined #ruby
[16:12:45] bluOxigen: has joined #ruby
[16:13:00] igam: cschneid: perhaps you could implement swank for ruby, then you could debug your ruby programs with slime?
[16:13:30] karapetyan: has joined #ruby
[16:13:52] wilbert: has joined #ruby
[16:14:11] EdwardIII: has joined #ruby
[16:18:29] crime: "just implement swank"
[16:18:52] shevy: everyone wants a big fat debug IDE
[16:19:20] noService: has joined #ruby
[16:19:21] crime: yeah, only 3k lines of dense common lisp written over years by many different developers, forming the backbone of one of most powerful debuggers ever conceived
[16:19:48] crime: and thats just swank. slime is huge
[16:19:50] marr: has joined #ruby
[16:20:05] SilverKey: has joined #ruby
[16:20:07] weemsledeux: has joined #ruby
[16:21:17] aspiers_: has joined #ruby
[16:21:21] cschneid: norc: thanks. igam... sounds ... fun :)
[16:26:17] diegoaguilar: has joined #ruby
[16:26:22] RegulationD: has joined #ruby
[16:27:42] william3: has joined #ruby
[16:28:42] sgambino: has joined #ruby
[16:29:27] bluOxigen_: has joined #ruby
[16:29:36] ghoti: has joined #ruby
[16:29:52] tAn: has joined #ruby
[16:30:31] igam: shevy: slime/swank is not that big/fat. And swank has been ported to R and scheme, so it's possible and shouldn't be to hard to port to ruby too.
[16:30:53] wldcordeiro: has joined #ruby
[16:31:48] igam: The only thing is that it would rely heavily on introspection, so you would have to know this part of ruby very well. (And unfortunately, I'd expect also a few variants depending on the version of ruby).
[16:32:34] cschneid: what's a swank.
[16:33:13] cschneid: classic hyper-interactive lisp programming it seems?
[16:33:13] norc: It is very dangerous.
[16:33:16] norc: But delicious.
[16:35:05] igam: cschneid: swank is the CL backend to slime, the Superior Lisp Interaction Mode for Emacs.
[16:35:14] igam: slime includes sldb, the slime debugger.
[16:36:09] shayan: has joined #ruby
[16:36:11] igam: https://common-lisp.net/project/slime/
[16:36:25] igam: https://common-lisp.net/~crhodes/swankr/
[16:36:36] igam: https://github.com/ecraven/mit-scheme-swank
[16:37:07] igam: the last two would give you example and an idea of the complexity of what you'd have to do in Ruby to integrate with slime.
[16:37:33] igam: swank.scm is only 1594 sloc.
[16:37:36] mikecmpbll: has joined #ruby
[16:38:10] igam: swankr is more modular: https://gitlab.common-lisp.net/crhodes/swankr/tree/master
[16:38:36] perlgod: has joined #ruby
[16:39:01] dsimon: seconding byebug, it's super neat
[16:39:40] rbennacer: has joined #ruby
[16:40:11] PaulCapestany: has joined #ruby
[16:41:00] sarbs: has joined #ruby
[16:41:37] mfb2: has joined #ruby
[16:42:28] JBlazeCoder21: has joined #ruby
[16:45:06] kareeoleez: has joined #ruby
[16:46:15] Authenticator: The default JSON library doesn't seem to handle ASCII-8BIT strings, but Oj does. Is there a setting in the default library that I'm missing?
[16:46:48] Gasher: has joined #ruby
[16:46:55] ramfjord: has joined #ruby
[16:47:39] mfb2_: has joined #ruby
[16:47:54] davedev24: has joined #ruby
[16:47:59] Xeago: has joined #ruby
[16:48:54] crime: Authenticator: cursory google brought me to this: https://github.com/JoshCheek/seeing_is_believing/issues/46
[16:48:58] crime: maybe it will help?
[16:49:33] Emmanuel_Chanel: has joined #ruby
[16:49:53] nemoNoboru: has joined #ruby
[16:49:53] Yiota_: has joined #ruby
[16:49:58] Emmanuel_Chanel: has joined #ruby
[16:50:42] navneet: has joined #ruby
[16:51:03] xxneolithicxx: has joined #ruby
[16:51:05] antgel: has joined #ruby
[16:53:43] Spami: has joined #ruby
[16:54:27] bronson: has joined #ruby
[16:54:30] apeiros: Authenticator: json is specified to be utf-8
[16:54:40] symm-: has joined #ruby
[16:54:42] apeiros: Authenticator: if you do ascii-8bit in your json, it isn't json. simple as that.
[16:54:49] Authenticator: crime: Yeah, that looks similar.
[16:55:22] mfb2: has joined #ruby
[16:55:36] makufiru: has joined #ruby
[16:56:20] crime: Authenticator: glad I could help, hope u get ur bug fixed <3
[16:56:35] makufiru: has left #ruby: ()
[16:56:39] roelof: has joined #ruby
[16:56:59] crime: apeiros is always right btw, he knows everything, i can vouch
[16:57:07] Authenticator: crime: Well, with Ape's answer I might just doc the other end (which accepts ascii-8bit JSON strings) as broken, and skip it. :D
[16:57:20] amclain_: has joined #ruby
[16:57:42] crime: yeah, it's weird that that happened, probably some sort of tooling issue on the other end. who know
[16:57:54] roelof: why is row not known here. when I do a put row in the loop row has contents : http://lpaste.net/161417
[16:58:10] shinnya: has joined #ruby
[16:58:13] apeiros: roelof: a block has its own lexical scope
[16:58:30] apeiros: you can assign nil to row before the block, then it'll work since the block will close over it
[16:58:34] Authenticator: The odd thing is that it's a Tomcat server and it's normally pretty picky about every bit.
[16:58:55] roelof: oke, I will try that, thanks, apeiros
[16:59:21] amclain: has joined #ruby
[16:59:32] giz|work: has joined #ruby
[17:01:13] ChiefAlexander: has joined #ruby
[17:01:40] Cohedrin: has joined #ruby
[17:02:31] Frem: has joined #ruby
[17:02:36] Infra-Red: has joined #ruby
[17:03:48] roelof: anyone a tip how I can make this work : http://lpaste.net/161418
[17:04:14] roelof: the characters are all messed up after reading in
[17:04:45] apeiros: seems you forgot the newlines
[17:05:54] roelof: the part that reads in is given in the challenge , see the code : http://lpaste.net/161419
[17:06:48] apeiros: roelof: tell me in your words, in english, step by step what the code does
[17:07:10] roelof: it seems that it reads in colums where I need to have it in rows
[17:07:58] apeiros: that's not what I asked for.
[17:08:32] SilverKey: has joined #ruby
[17:10:08] roelof: I know, I was typing a idea when you asked another question
[17:10:40] roelof: apeiros: here is the whole challenge. http://lpaste.net/161420 . I think that is more clear then that I try to explain everything
[17:10:45] SilverKey: has joined #ruby
[17:10:49] apeiros: I don't care about that
[17:11:26] nofxx: has joined #ruby
[17:11:35] apeiros: > roelof: tell me in your words, in english, step by step what the code does
[17:11:43] apeiros: this is what I'm asking from you
[17:11:44] shevy: roelof!!!
[17:12:12] roelof: the code reads the asci code string colum by colum
[17:12:17] mfb2: has joined #ruby
[17:12:20] roelof: shevy: yes
[17:12:27] apeiros: roelof: that's not step by step
[17:12:30] freerobby: has joined #ruby
[17:12:40] apeiros: and it's not what the code actually does either.
[17:13:32] roelof: apeiros: are we still talking about this : http://lpaste.net/161419
[17:13:55] apeiros: yes, even though I've no idea why you created another paste.
[17:14:31] shevy: roelof on gist pasties you can highlight via numbers alone btw
[17:15:27] alecs: has joined #ruby
[17:15:59] roelof: oke, h is the height of the letter. so for the height of the letter do (line 1)
[17:16:12] roelof: apeiros: is this what you mean ?
[17:16:27] apeiros: and height is columns or rows?
[17:16:33] firstdayonthejob: has joined #ruby
[17:16:37] al2o3-cr: ACTION deary me
[17:16:51] apeiros: I think you should buy a new dictionary then ;-)
[17:17:31] roelof: oke, then it are the rows, I always mixed them up
[17:17:37] jackjackdripper: has joined #ruby
[17:17:47] jaguarmagenta: has joined #ruby
[17:17:48] apeiros: but let's go on, ok, for the number of rows there are, do what?
[17:18:05] jackjackdripper: has joined #ruby
[17:18:05] roelof: read a line and put it into row
[17:18:08] ssiris: has joined #ruby
[17:18:18] apeiros: what part reads the line?
[17:18:29] jackjackdripper1: has joined #ruby
[17:18:36] roelof: gets.chomp , apeiros ?
[17:18:54] shevy: he returns a question to a question :)
[17:19:06] apeiros: roelof: how many methods do you see in gets.chomp?
[17:19:25] crime: i love this conversation so far
[17:19:25] apeiros: ok, what's the first and what does it do?
[17:19:38] roelof: gets which reads and chomp which deletes the newline
[17:19:39] shevy: crime apeiros is like a surgeon, he gets to the nasties
[17:19:53] apeiros: roelof: great. "deletes the newlines"
[17:19:57] freerobby: has joined #ruby
[17:20:02] apeiros: rememer how I told you that you seem to lack the newlines?
[17:20:14] crime: one of my all-time favorite books is the little schemer, that's what apeiros reminds me of
[17:20:19] apeiros: +b, finding where it belongs to is left as an exercise
[17:20:22] replay: has joined #ruby
[17:20:23] crime: guiding but not condescending
[17:20:32] tildes: has joined #ruby
[17:20:33] shevy: hmm I don't know that book... title reminds me of a kids book :P
[17:20:44] crime: it teaches scheme socratically
[17:20:50] crime: absolutely fantastic read
[17:20:57] replay: has joined #ruby
[17:20:59] roelof: so I schould delete the chomps part , apeiros ?
[17:21:04] crime: little schemer -> seasoned schemer -> reasoned schemer
[17:21:12] apeiros: roelof: so now you know that your newlines are not in row. if you print the rows without adding newlines back in, your result will happen
[17:21:37] apeiros: roelof: I don't know what you should do. after all, I don't know what goal you want to achieve. I just tell you why you get what you get. and that it is in no way weird.
[17:22:06] crime: its like these damn computers only do what I tell them to
[17:22:19] roelof: I m trying to find out how I can convert a character to the responding asci character in the row variable
[17:22:21] apeiros: hate them for that. do what I mean, not what I tell you to :D
[17:22:41] hxegon: That feeling when a SaaS your project is relying on can't even get password resets right: https://i.imgur.com/7s8APdU.gif
[17:23:00] apeiros: roelof: moment, phone
[17:23:06] aspiers_: has joined #ruby
[17:24:04] Pupeno: has joined #ruby
[17:25:14] theunraveler: has joined #ruby
[17:25:20] KensoDev: has joined #ruby
[17:25:22] crime: i've noticed a lot of websites will let me reset passwords to passwords that dont meet the spec of the original password they wanted
[17:25:55] crime: but hey, they want to run bug bounty programs, cool. I gotta pay rent and eat anyways
[17:26:10] hxegon: crime I should try that with sites that have dumb restrictions like "first character must be a capital letter", or "only alphanumeric characters please :D"
[17:26:39] hxegon: like my bank... :|
[17:26:43] crime: yeah, just make one up, forget your password to your email, and like nine times out of ten it's just a textarea and they check to make sure the old password was correct
[17:26:58] crime: well, banks SHOULD 2fa anyways so it wouldnt matter
[17:27:14] crime: i actually hate the web
[17:27:30] blackmesa: has joined #ruby
[17:28:16] roelof: apeiros: so I thougth if I could "convert" it to look like the columns I just could count lines and compose the requested character
[17:28:39] hxegon: crime At this rate I'm not too far off.
[17:28:57] pawnbox: has joined #ruby
[17:29:37] ljames: has joined #ruby
[17:29:41] crime: we should start over. html was a mistake. css made it worse. js has literally driven people to a rabid insanity. i feel like dante, tbh
[17:29:51] [Butch]_: has joined #ruby
[17:30:14] pawnbox: has joined #ruby
[17:30:18] hxegon: At least the flash nightmare is coming to an end, although I'm sure "legacy" software will continue to beat that horse.
[17:30:48] crime: I mean, AS3 suffered from all the same issues modern JS does.
[17:31:12] crime: prototypal inheritance still blows ass, V8 is a nightmare of "oh well it's not terrible if it's really fast, right?"
[17:31:15] crime: and deeper we go
[17:31:43] edwinvdgraaf: has joined #ruby
[17:32:10] crime: then of course people absolutely lose their shit at the mere *thought* of onboarding Dart VM into chrome for fear of fragmentation. its like, look around! the entire web is already fragmented. it sucks
[17:32:31] swills: has joined #ruby
[17:33:02] moeabdol: has joined #ruby
[17:33:21] hxegon: I wish there was a Joker-esque character IRL that was like "For every 24 hours that a sane JS replacement isn't implemented on all major browsers, a hospital will explode."
[17:34:38] hxegon: as a wise man once said about the JS VMs, "A lot of PHD bodies have been thrown on that burning pile of shit."
[17:34:53] JagaJaga: has joined #ruby
[17:35:08] hxegon: whoops, just realized this isn't offtopic.
[17:36:54] Carella: has joined #ruby
[17:37:42] djbkd: has joined #ruby
[17:37:54] mfb2: has joined #ruby
[17:38:41] mdw: has joined #ruby
[17:40:03] last_staff: has joined #ruby
[17:40:41] Xeago: has joined #ruby
[17:41:55] baweaver: has joined #ruby
[17:42:17] pikajude: has joined #ruby
[17:42:17] pikajude: has joined #ruby
[17:42:33] baweaver: has joined #ruby
[17:43:20] bradleyprice: has joined #ruby
[17:44:21] amclain: has joined #ruby
[17:44:55] bradleyprice: has joined #ruby
[17:45:14] User458764: has joined #ruby
[17:45:20] baweaver: has joined #ruby
[17:46:25] baweaver: has joined #ruby
[17:46:57] Devalo: has joined #ruby
[17:49:52] navneet: has joined #ruby
[17:52:10] AnoHito: has joined #ruby
[17:52:13] baweaver: has joined #ruby
[17:52:52] apeiros: roelof: yeah, sure. converting to columns isn't a bad idea. but that's not part of what you've shown.
[17:53:44] roelof: correct , that part I schould make code myself
[17:54:09] tubuliferous: has joined #ruby
[17:54:16] roelof: I thought about using transpose but then I have to convert row first to a array
[17:54:27] apeiros: transpose is a good idea, yes
[17:54:35] apeiros: and yes, converting the line to an array is the precondition
[17:54:43] apeiros: it's only 1 method call away ;-)
[17:55:29] roelof: 1 method ? I thought about using 2 . split and transpose
[17:55:30] sarlalian: has joined #ruby
[17:55:46] shayan: I am attempting a beginner Ruby question, where I am creating a loop for numbers 1 through 20. In this exercise, I must use the “next” keyword so that you skip to the next iteration if the number ‘i’ is odd. What are some ways I can skip to the next iteration if the number ‘i’ is odd?
[17:55:49] apeiros: I meant 1 method to convert a line to an array
[17:56:00] apeiros: split works. there's an easier one: chars
[17:56:35] roelof: oke, I will google about chars. I have not used or learned it on rubymonk
[17:57:00] apeiros: don't use google
[17:57:04] apeiros: use the docs
[17:57:08] apeiros: &ri String#chars
[17:57:08] `derpy: http://ruby-doc.org/core-2.3.0/String.html#method-i-chars
[17:57:12] mfb2: has joined #ruby
[17:57:28] ule: has left #ruby: ()
[17:58:17] adaedra: USE THE DOCS
[17:58:20] roelof: apeiros: oke, I will try that part and look how it looks like then
[17:58:31] roelof: thanks so far for the help
[17:59:14] baweaver: has joined #ruby
[17:59:54] ramfjord_: has joined #ruby
[18:00:38] weemsledeux: has joined #ruby
[18:01:50] y2mq37: has joined #ruby
[18:02:11] blaix: has joined #ruby
[18:02:22] roelof: apeiros: sorry, first problem, When I use this code : http://lpaste.net/161421. I see this error : no implicit conversion of String into Array (TypeError)
[18:03:02] apeiros: you've three problems
[18:03:12] vishwa: has joined #ruby
[18:03:33] apeiros: problem 1 is that you don't paste your actual code. seriously - don't. ever. do. that.
[18:03:40] roelof: apeiros: oops, that is not good
[18:03:52] roelof: apeiros: this is the actual code
[18:03:53] _djbkd: has joined #ruby
[18:04:15] apeiros: no. it isn't. this code would get you a NoMethod error
[18:04:32] apeiros: it's .chars, not .char
[18:04:37] roelof: wierd, when I use it on codingame I see the output as pasted
[18:04:52] _djbkd: has joined #ruby
[18:05:03] roelof: yep, when I use chars I see output
[18:06:17] roelof: because the docs sayed it was a array , I could use transpose to switch to a column layout
[18:06:24] symm-: has joined #ruby
[18:06:30] apeiros: that'd be your 2nd problem
[18:06:36] newjersey: has joined #ruby
[18:06:45] apeiros: you should run the code locally and inspect `row`.
[18:07:10] kasisnu: has joined #ruby
[18:07:17] roelof: oke, then I have to figure out how I can do this locally
[18:07:28] djbkd: has joined #ruby
[18:07:42] roelof: I will experiment with that the next few hours I think so again thanks
[18:08:11] Ox0dea: roelof: After all this time, you don't have a local install? :(
[18:08:47] mdw7: has joined #ruby
[18:10:25] jmignault: has joined #ruby
[18:10:53] _djbkd: has joined #ruby
[18:12:29] roelof: I have a local install of ruby
[18:12:43] roelof: not a local install of this problem
[18:13:00] roelof: I use the debug of the codingame site
[18:13:35] roelof: I think the biggest problem will be how I can locally use the input of the asci characters
[18:13:42] roelof: on the site is given
[18:13:59] tomphp: has joined #ruby
[18:14:26] karapetyan: has joined #ruby
[18:15:32] vishwa: has joined #ruby
[18:16:02] moss: has joined #ruby
[18:16:16] Infra-Red: has joined #ruby
[18:18:59] Ox0dea: roelof: You... don't know how to provide input to your program?
[18:20:06] djbkd: has joined #ruby
[18:21:42] nofxx: has joined #ruby
[18:23:55] flashpoint9: has joined #ruby
[18:24:15] roelof: Yes, I could use the same code
[18:24:16] blaxter: has joined #ruby
[18:25:02] roelof: the asci-characters are given in that site as a text. I have to input them as rows
[18:28:58] cdg: has joined #ruby
[18:29:17] tomphp: has joined #ruby
[18:29:18] Cohedrin_: has joined #ruby
[18:29:39] kristofferR: has joined #ruby
[18:30:36] anisha: has joined #ruby
[18:31:37] roelof: oke, chars gives this as output : "[\"#\", \" \", \"#\", \" \", \"#\", \"#\", \" \", \" \", \" \", \"#\", .....] so every # has one place in the array
[18:31:45] tomphp: has joined #ruby
[18:32:07] axisys: has joined #ruby
[18:32:17] ferr: has joined #ruby
[18:33:47] roelof: then split gives I think a better output : "[\"#\", \"#\", \"##\", \"##\", \"##\", \"###\", \"#\", \"##\", \"#\", .... ]
[18:35:31] pawnbox: has joined #ruby
[18:35:52] roelof: but on both cases the orginal ending is gone so I think I have to store the input
[18:35:55] djbkd: has joined #ruby
[18:36:08] dopieee: has joined #ruby
[18:36:20] blackmesa: has joined #ruby
[18:36:24] shevy: roelof are you sure that output is right?
[18:36:58] roelof: I did p row.split.inspect so I think so
[18:36:59] shevy: looks like a stringified array
[18:37:57] Ox0dea: roelof: You don't need to explicitly #inspect when you use #p.
[18:38:06] Ox0dea: `p foo` is `puts foo.inspect`.
[18:38:31] adaedra: not exactly
[18:38:49] adaedra: it's closer to foo.tap { |foo| puts foo.inspect }
[18:39:18] adaedra: so you can `p` anywhere and still get the value.
[18:39:24] moss: hi. i'm writing a puppet facter script to check if an interface is using dhcp or not. i want to exclude the loopback device but can't figure out how to do so. Here is what I've written so far: https://dpaste.de/8ysk
[18:40:07] naftilos76: has joined #ruby
[18:42:23] tomphp: has joined #ruby
[18:42:44] Pupeno: has joined #ruby
[18:42:44] Pupeno: has joined #ruby
[18:43:20] roelof: oke, when I use this code : http://lpaste.net/1681767042581004288 . I see the output I paste into the paste
[18:43:28] roelof: that looks promosing
[18:43:44] iamvery: has joined #ruby
[18:44:02] thegunbuster: has joined #ruby
[18:44:03] thegunbuster: has joined #ruby
[18:45:01] smathy: adaedra, TIL - nice.
[18:45:02] Dimik1: has joined #ruby
[18:45:20] Ox0dea: roelof: How come that looks promising?
[18:45:42] roelof: I can see where the orginal input is ending
[18:45:49] kasisnu: has joined #ruby
[18:46:06] roelof: So I hope I can now make the conversion from row to columns
[18:46:22] noService: has joined #ruby
[18:46:24] mfb2: has joined #ruby
[18:47:01] mfb2: has joined #ruby
[18:50:31] finisherr: has joined #ruby
[18:50:56] Ishido: has joined #ruby
[18:52:28] shayan: has joined #ruby
[18:52:38] pawnbox: has joined #ruby
[18:52:55] roelof: shevy: when I use chars instead of split I see this : ["#", " ", "#", " ", "#", "#", " ", " ", " ", "#", "#", " ", "#", "#", " ", " ", "#", "#", "#", " ", "#", " ", " ", " ", " ", "#", "#", " ", "#", " ", "#", " ", "#", "#", "#", " ", " ", "#", " ", " ", "#", " ", "#", " ", "#", "#", "#", " ", "#", " ", "#", " ", "#", " ", "#", " ", " ", "#", " ", " ", "#", " ", " ", " ", " ", " ", "#", " ", "#", " ", "#", " ", "#", "#", " ", " ", " ",
[18:55:16] roelof: Time to sleep now. Maybe I get tomorrow a idea how I can compose the characters back
[18:55:47] crime: i p anywhere i want
[18:55:54] crime: the world is my object
[18:56:04] tomphp: has joined #ruby
[18:56:42] bronson: has joined #ruby
[18:56:47] DotKite: has joined #ruby
[18:57:27] n008f4g_: has joined #ruby
[18:57:45] DotKite: Anyone know how to use the eratosthenes sieve in the Prime class? ruby-doc.org isn't very clear
[18:57:45] jackjackdripper: has joined #ruby
[18:58:33] roelof: oke, to use transpose I have to take care that all rows are all arrays
[18:58:34] shevy: roelof yeah that looks more like an Array now
[18:59:06] shevy: roelof I don't entirely understand why you must split on every character. can't you just output per line? if you match the desired output format (on that line)
[18:59:08] crime: DotKite: thats an internal thing, I think.
[18:59:20] antgel: has joined #ruby
[18:59:33] weaksauce: DotKite Prime.each do |prime| puts prime end
[19:00:06] roelof: shevy: I think you are right if I look at the docs of transpose
[19:00:29] crime: Prime.each takes arguments to choose which prime generator it uses DotKite
[19:00:56] crime: so you could do Prime.each(9999, Prime::TrialDivision) {|n| p n}
[19:01:02] PedramT: has joined #ruby
[19:01:32] weaksauce: DotKite you can pass in the generator type to each if you want.
[19:01:57] Ox0dea: roelof: Without #transpose, you're going to be doing nasty string slicing and unnecessary arithmetic to pull the right pieces of each character out of the font.
[19:02:40] Ox0dea: With #transpose, you essentially get to just jam the characters together column-wise, then #tranpose them back out and you've got the desired output.
[19:02:58] perlgod_: has joined #ruby
[19:03:50] wldcordeiro: has joined #ruby
[19:04:23] roelof: Ox0dea: so I have to use transpose two times ?
[19:04:36] william3: has joined #ruby
[19:04:53] aspiers_: has joined #ruby
[19:04:58] moss: anyone??
[19:05:10] emilford: has joined #ruby
[19:05:16] speaking1ode: has joined #ruby
[19:05:54] mikecmpbll: has joined #ruby
[19:06:23] diegoviola: has joined #ruby
[19:06:27] roelof: Ox0dea: or do you mean something else with : tranpose them back
[19:07:16] tomphp: has joined #ruby
[19:08:00] norc: has joined #ruby
[19:08:50] Ox0dea: roelof: What does #transpose do?
[19:08:53] hxegon: has joined #ruby
[19:09:34] norc: Ox0dea o7
[19:09:53] baweaver: has joined #ruby
[19:10:18] nando293921: has joined #ruby
[19:10:25] _whitelogger: has joined #ruby
[19:11:52] norc: Ox0dea, given a string A, what do you reckon would be the fastest way to determine whether any element in a list of strings starts with A?
[19:12:11] norc: My intuition kinda suggests some proper hash map, but what do I know..
[19:12:23] mostlybadfly: has joined #ruby
[19:12:33] Ox0dea: norc: The only unorthodox approach that comes to mind would be to get tricksy with a regex.
[19:13:07] norc: Ox0dea, the problem is that it is still extremely expensive since it has to be applied against every element of the list.
[19:13:17] norc: My list is large, which makes this unfeasible.
[19:13:26] tomphp: has joined #ruby
[19:13:33] Ox0dea: norc: Then #find and #start_with? is probably your best bet. :/
[19:14:03] norc: Ox0dea, I forgot one tiny detail. A is an element of the same list.. and I have to test this for any element.
[19:14:24] norc: I do not want some O(n2) complexity just for accessing, and another O(n) for the string length n.
[19:14:59] Ox0dea: norc: Might be you're looking for a Bloom filter or the like.
[19:15:02] norc: Maybe packing this into a tree would improve this, since it might reduce access time to O(1)
[19:15:12] mfb2: has joined #ruby
[19:15:45] norc: Ox0dea, possible. Bloom tests for actual member though, doesnt it?
[19:16:02] Ox0dea: norc: I mean, they're malleable?
[19:16:16] nanoz: has joined #ruby
[19:16:19] Ox0dea: You can parameterize the search however you please, really; it's essentially just bitsets.
[19:16:35] tAn: has joined #ruby
[19:16:45] drusepth: has joined #ruby
[19:17:18] norc: Ox0dea, heck this is actually a classic problem to be solved with a simple hash table.
[19:18:12] mfb2: has joined #ruby
[19:18:18] norc: I can guarantee that the strings are at least 6 characters long and 12 at most.
[19:18:42] Cohedrin: has joined #ruby
[19:18:42] norc: Or. Bloom. I dont know..
[19:18:45] jaguarmagenta: has joined #ruby
[19:18:57] weaksauce: how large is large norc
[19:18:58] norc: That is the price for being a school dropout rather than someone who spent 5 years studying CS...
[19:19:08] SilverKey: has joined #ruby
[19:19:28] Ox0dea: norc: Using an arbitrarily deep Hash as a "tree" would work pretty well.
[19:19:33] norc: weaksauce, currently Im working with lists between 100,000 and 200,000 (sizes where the naive solution just takes half an hour to calculate)
[19:19:52] Ox0dea: Then you'd just test `h['f']['o']['o']` for non-nility.
[19:19:58] weaksauce: perhaps build up a trie?
[19:20:22] iamvery: has joined #ruby
[19:20:34] norc: Ox0dea and weaksauce both concluding that I really just want a tree.
[19:21:59] weaksauce: norc https://github.com/tyler/trie
[19:22:23] Ox0dea: Overkill.
[19:22:51] tAn: has joined #ruby
[19:23:46] drusepth: that feel when you're re-running everything for logs to ask a question and everything magically starts working
[19:23:49] drusepth: thanks guys
[19:23:49] weaksauce: Ox0dea h['f']['o']['']
[19:24:03] Ox0dea: norc: https://eval.in/559451
[19:24:14] weaksauce: Ox0dea h['f']['o']['o'] would error if there was no ['f']['o'] element
[19:24:20] Ox0dea: weaksauce: I got dis.
[19:24:58] GinoMan2440: has joined #ruby
[19:25:12] anisha: has joined #ruby
[19:25:34] Ox0dea: norc: It might be that you'd want to use a sentinel so that you don't have to treat the empty Hash as false, but that's otherwise trees for free.
[19:25:53] elifoster: has joined #ruby
[19:26:19] norc: Ox0dea, have you digged into ruby Hash? What mechanism does it use for access?
[19:26:23] norc: Object#hash?
[19:26:33] Ox0dea: norc: Well, yeah... :P
[19:26:34] norc: *dug even.
[19:26:50] Ox0dea: #eql? comes into it as well if the #hash values collide.
[19:26:50] norc: Ox0dea, I have to ask. Tons of things dont make any sense at all in the implementation.
[19:27:08] norc: Ever since I fell into the super super() trap, I no longer trust Ruby.
[19:27:13] karapetyan: has joined #ruby
[19:27:19] Ox0dea: That's documented, though.
[19:27:32] Ox0dea: As is `super &nil`, I'd imagine.
[19:27:42] norc: You just started another wtf moment.
[19:27:44] norc: What is super &nil
[19:27:54] whippythellama: has joined #ruby
[19:27:58] norc: asm>> &nil
[19:27:59] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/559452
[19:28:08] norc: asm>> super &nil
[19:28:11] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/559453
[19:28:18] norc: asm>> super
[19:28:20] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/559454
[19:28:45] Ox0dea: It's for explicitly not passing along your block.
[19:28:55] norc: The headache.
[19:28:59] norc: Is real.
[19:29:27] Infra-Red: has joined #ruby
[19:29:39] finisherr: has joined #ruby
[19:30:37] jdawgaz: has joined #ruby
[19:31:13] norc: Ox0dea, 6 hours into my compiler (really hard to find the time for it) by the way. Lexing and parsing done (and damn, stay the fuck away from the C++ parser/scanner from bison/flex), I can generate sexp expressions now.
[19:31:28] norc: Code generation started now.
[19:31:43] Fernando-Basso: has joined #ruby
[19:32:09] Ox0dea: norc: Sexps are just the best.
[19:32:32] crime: (funcall #'agree (get-topic))
[19:32:39] Ox0dea: McCarthy tried to preempt a half-century of syntax flamewars. :/
[19:32:54] norc: crime, out of lazyness mine are in immediate Ruby parseable form.
[19:33:38] crime: I've realized that that's what academia actually is. Whitepaper flame wars
[19:33:53] crime: thats how smart people talk shit
[19:33:58] norc: Though if I use llvm, code generation is so unbelievable simple. You do not even have to know what you are doing.
[19:34:00] crime: they write a paper
[19:35:01] ule: has joined #ruby
[19:35:20] ule: Hey guys.. I'm trying to find something similar with CodeSniffer for Rails
[19:35:25] Polysics: has joined #ruby
[19:35:36] jeff1: has joined #ruby
[19:35:39] Es0teric: has joined #ruby
[19:35:44] ule: I know there is one called something like Tendle
[19:35:46] norc: ?rubyonrails ule
[19:35:46] ruby[bot]: norc: I don't know anything about rubyonrails
[19:35:49] norc: &rubyonrails ule
[19:35:52] crime: ule: rubocop?
[19:35:56] ule: could be ruby doesn't matter
[19:36:04] norc: ule, rubocop but do not use it.
[19:36:08] ule: crime: No.. it starts with T
[19:36:11] ule: but I can't remember the name
[19:36:14] norc: It leads to really horrible tendencies.
[19:36:29] ule: yeah.. like 80 chars per line maximum
[19:36:32] djbkd: has joined #ruby
[19:36:34] ule: totatlly agree
[19:36:45] norc: ule, things like that can be configured, but the problem is a different one.
[19:37:08] ule: sure.. but first I need to remember the name of the gem
[19:37:17] norc: Either you work alone, in which case you should not need it. If you work together, specify the coding guidelines and reject PRs if ppl do not follow it.
[19:37:31] norc: It is how everybody in the serious world does it.
[19:37:33] ule: tailor!!
[19:37:50] crime: i was about to write ruby to find every gem name that starts with t
[19:37:59] crime: i think i still will
[19:38:04] Ox0dea: Why would you need to write Ruby?
[19:38:07] ramfjord: has joined #ruby
[19:38:09] jdawgaz: has joined #ruby
[19:38:13] crime: i write ruby all the time
[19:38:21] crime: its like this thing i do
[19:38:23] ule: https://github.com/turboladen/tailor
[19:38:32] Ox0dea: $ gem search ^t | wc -l
[19:38:42] ule: wtf lol
[19:38:58] ule: thanks guys.. found it.. gonna learn how to use this tool now
[19:39:21] Ox0dea: crime: Still gonna write it in Ruby?
[19:39:34] mfb2: has joined #ruby
[19:39:42] norc: Ox0dea, struct f { void : 0 } f; I think this might be valid C++ grammar. o_o
[19:39:55] Ox0dea: norc: Yikes.
[19:40:11] norc: Semantic checks will choke on this for sure, but grammar wise it should be fine. :D
[19:40:14] allcentury: has joined #ruby
[19:40:32] mfb2: has joined #ruby
[19:40:53] adaedra: It looks fine
[19:40:57] adaedra: should even be valid C
[19:41:19] adaedra: But here we #include <offtopic>
[19:41:50] al2o3-cr: has joined #ruby
[19:43:18] jeff1: has joined #ruby
[19:44:18] crime: Ox0dea: yes, gisting now
[19:44:25] shevy: long live #include "ruby.h" !
[19:44:32] Ox0dea: crime: I'm excited.
[19:44:54] crime: https://gist.github.com/anonymous/64f0a8cb59982671fef44a75887b89c0
[19:45:01] jdawgaz: has joined #ruby
[19:45:02] crime: no ur not
[19:45:04] shevy: hmmmmm https://github.com/ruby/ruby/blob/trunk/ChangeLog#L11
[19:45:15] crime: ur just gonna golf w/e I write and then I feel stupid
[19:45:26] Ox0dea: That's a shell script.
[19:45:29] crime: but thats why i come here anyways
[19:45:31] crime: it counts
[19:45:45] Ox0dea: ACTION gives crime a gold star.
[19:45:58] crime: im gonna print that out irl and frame it
[19:46:10] Ox0dea: That's counterfeiting.
[19:46:28] crime: you can photocopy us currency for historical and educational purposes
[19:46:57] rikai: has joined #ruby
[19:46:59] shevy: pictures of love
[19:47:15] shevy: or a matz muscles t-shirt!
[19:47:21] JakFrist: has joined #ruby
[19:47:28] crime: i want to arm-wrestle matz
[19:47:52] crime: i emailed him to ask if he would but he wouldnt so i just assume its because he'd get rekt
[19:48:04] mfb2: has joined #ruby
[19:48:06] shevy: perhaps at some conference you could challenge him
[19:48:14] crime: ya know i thought about that
[19:48:24] crime: the thing about conferences is that you have to pay to get in to most of them
[19:48:26] shevy: where is the next conference where matz will be at?
[19:48:36] crime: doesnt seem very FLOSS to me, i never go
[19:48:39] shevy: havenwood tell me, you know these things
[19:48:41] beawesomeinstead: has joined #ruby
[19:49:07] jeff1: has joined #ruby
[19:49:18] Fernando-Basso: I watch conferences in youtube. Would it help me more if I were present?
[19:49:32] Fernando-Basso: I mean, would I learn more by being there?
[19:49:44] norc: Fernando-Basso, if I was the guy earning money from them it would help if you were.
[19:49:55] weaksauce: Fernando-Basso possibly? more so making connections or being able to do the 1-1 sessions if they have any
[19:50:09] Fernando-Basso: What helps for me is getting my butt in the char and the fingers on the keyboard.
[19:50:16] n008f4g_: has joined #ruby
[19:50:34] Fernando-Basso: Sorry, I didn't mean to offend chars.
[19:50:39] crime: they seem like such a huge scam to me. why should i pay organizers for paying the conference hall? if they gave a shit about open source they'd just pay it and let me in
[19:50:47] crime: esp if they're just gonna put it on youtube afterwards
[19:50:49] freerobby: has joined #ruby
[19:50:49] Ox0dea: Fernando-Basso: It's okay; uint8_ts are superior.
[19:51:18] mfb2: has joined #ruby
[19:51:54] Fernando-Basso: weaksauce, Yeah, that could perhaps be worth my while.
[19:51:58] jeff1: has joined #ruby
[19:52:36] Yiota: has joined #ruby
[19:53:03] baweaver: has joined #ruby
[19:53:08] crime: there's a gem called 'fuck' and more surprisingly, it actually does stuff
[19:53:13] mfb2: has joined #ruby
[19:53:19] shevy: Fernando-Basso always depends on who will talk, how good any presentations will be, how good a talker you got... tenderlove's presentations are funny. But I think, the only ones I really watch are from matz
[19:53:34] crime: tenderlove is the cringiest presented I've ever seen
[19:53:47] mikecmpbll: has joined #ruby
[19:53:57] hobodave: has joined #ruby
[19:54:02] Fernando-Basso: shevy, But still, any "learning" difference being there and being home while watching?
[19:54:02] crime: shevy, you should watch sandi metz. Nothing is Something is a great talk about ruby/smalltalk parallels
[19:54:13] ule: I started watching youtube videons on 2X speed.. I can see 3 conferences in the same timeframe
[19:54:21] ule: only possible from my chair here
[19:55:01] Fernando-Basso: shevy, Well, being there might be more memorable.
[19:55:52] lemur: has joined #ruby
[19:56:26] weaksauce: crime sandy is good stuff. also advi does some pretty good talks
[19:56:26] aspiers_: has joined #ruby
[19:56:41] cabargas: has joined #ruby
[19:57:19] SCHAAP137: has joined #ruby
[19:57:25] crime: avdi's blog has deterred me from wanting to hear avdi's voice
[19:57:54] ChiefAlexander: has joined #ruby
[19:57:59] mfb2: has joined #ruby
[19:58:12] crime: yeah, the long hair, stud belt, weird pseudo-cali-midwest accent. irl cringing
[19:58:48] mlakewood: has joined #ruby
[19:59:19] Moosashi: has joined #ruby
[19:59:24] Ox0dea: crime: How old're you?
[19:59:44] jdawgaz: has joined #ruby
[20:00:26] tAn: has joined #ruby
[20:00:49] crime: Ox0dea.thoughts["irc"]["crime"].call
[20:00:53] dionysus69: has joined #ruby
[20:00:55] crime: what r u thinking
[20:01:13] skade: has joined #ruby
[20:01:22] perlgod: has joined #ruby
[20:01:33] yfeldblum: has joined #ruby
[20:01:39] Ox0dea: # => 3562
[20:01:54] crime: that explains it, you're a Fixnum
[20:02:02] crime: u dont respond to thoughts
[20:02:12] norc: We can coerce him into something else if you prefer.
[20:02:17] Ox0dea: >> 0x0dea.methods.size
[20:02:18] ruby[bot]: Ox0dea: # => 133 (https://eval.in/559458)
[20:02:23] adaedra: What's happening here?
[20:03:01] crime: thats cheating, since Ox0dea ~= 0x0dea
[20:03:07] crime: thats a bug
[20:03:15] Ox0dea: Blame the relevant RFCs.
[20:03:23] Ox0dea: It's a stupid limitation.
[20:03:28] norc: crime, hold on. I can fix that. PR incoming...
[20:04:27] crime: so im trying to listen to avdi and he just said that trying to model object reality is hubristic
[20:04:51] crime: which is a self-admission that he doesn't even exist in the real world and only the in the fantasy world where he thinks he knows what he's talking about
[20:05:20] crime: https://www.youtube.com/watch?v=IgbHzFb1hGw at 40:01
[20:05:48] emilford: has joined #ruby
[20:05:49] Ox0dea: This is why I asked your age, for what that's worth.
[20:05:58] Ox0dea: The Dunning-Kruger is strongest in the very young.
[20:06:16] crime: than he used the word hermeneutics, clearly a thesaurus 'what would make me sound smart' move
[20:06:33] cpup: has joined #ruby
[20:06:52] crime: Ox0dea: I dont pride myself with the illusion that I'm superior to anybody
[20:07:00] Ox0dea: http://i.imgur.com/Ufbr5ej.gif
[20:07:02] wilbert: has joined #ruby
[20:07:19] crime: I just dont mind calling people out doing exactly that
[20:07:36] crime: avdi's blog is littered with those little "well gee I'm so smart" tidbits
[20:08:02] william3: has joined #ruby
[20:08:45] norc: Ox0dea, I do think of myself as being superior than everybody else. But this is not based on competency, because I am not very competent. That is just my attitude towards humans in general...
[20:08:53] norc: That is not Dunning-Kruger, is it?\
[20:09:16] Ox0dea: norc: I think that's a God complex?
[20:09:24] adaedra: Well at least you noticed it.
[20:10:03] shinnya: has joined #ruby
[20:10:15] crime: I'm not suffering from Dunning-Kruger, I'm just mean and snarky.
[20:10:31] norc: Ox0dea, that does not sound too bad..
[20:10:38] Ox0dea: norc: Being God a shit.
[20:11:42] ule: How can I do something like this?
[20:11:44] ule: 3.times.('1'..'9').to_a.sample
[20:12:00] ule: actually I want letters
[20:12:09] ule: 3.times.('A'..'Z').to_a.sample
[20:12:39] BTRE: has joined #ruby
[20:12:44] norc: ule, what is the 3.times supposed to do?
[20:13:15] ule: generate a random string with 3 chars
[20:13:22] crime: just ('A'..'Z').sample(3)
[20:13:34] GasherL: has joined #ruby
[20:13:38] crime: you are sampling three times and throwing away the first two values
[20:13:44] ule: crime: NoMethodError: undefined method `sample' for "A".."Z":Range
[20:13:52] crime: just ('A'..'Z').to_a.sample(3)
[20:14:12] ule: ok but now I need to convert it back to a string
[20:14:23] ule: concatenating all elements
[20:14:35] crime: ('A'..'Z').to_a.sample(3).join
[20:14:39] Ox0dea: crime: No.
[20:14:44] Ox0dea: That won't ever have duplicates.
[20:14:55] ule: crime: worked thanks!
[20:15:12] crime: how is that?
[20:15:14] Ox0dea: >> [1].sample 3
[20:15:15] ruby[bot]: Ox0dea: # => [1] (https://eval.in/559460)
[20:15:21] crime: thats weird
[20:15:22] Ox0dea: That's just how sampling works.
[20:15:26] Ox0dea: It's not a repeated sampling.
[20:15:48] crime: so then Array.new(3) {('A'..'Z').to_a.sample} ?
[20:15:56] norc: >> (0...3).map { (65 + rand(26)).chr }.join
[20:15:57] ruby[bot]: norc: # => "WNJ" (https://eval.in/559461)
[20:16:11] crime: >> Array.new(25) {('A'..'Z').to_a.sample}
[20:16:12] ruby[bot]: crime: # => ["N", "K", "U", "K", "C", "K", "E", "W", "U", "R", "Y", "E", "I", "D", "U", "O", "G", "H", "M", "L", ...check link for more (https://eval.in/559462)
[20:16:29] pietr0: has joined #ruby
[20:16:38] cdg: has joined #ruby
[20:16:44] lemur: you do realize that avdi is on this channel right?
[20:17:04] blackgoat: has joined #ruby
[20:17:10] crime: tis a big channel
[20:17:33] baweaver: so you make 25 instances of that array.
[20:17:45] Ox0dea: Wicked smaht.
[20:17:59] norc: (For good measure)
[20:18:06] Ox0dea: crime: And you grill Avdi. The fucking nerve.
[20:18:07] crime: isnt the argument the SIZE of the array?
[20:18:15] Ox0dea: crime: We're talking about the one in the block.
[20:18:36] crime: it golfs tho
[20:18:41] tomphp: has joined #ruby
[20:18:55] baweaver: Methinks you're a few strokes shy of a full par there.
[20:19:05] cpup: has joined #ruby
[20:19:29] crime: >> a = ('A'..'Z').to_a; Array.new(10){a.sample}
[20:19:30] ruby[bot]: crime: # => ["D", "M", "B", "H", "R", "R", "G", "R", "D", "J"] (https://eval.in/559464)
[20:19:41] norc: Bah! That is two statements.
[20:19:47] norc: Better memoize inline!
[20:19:47] norc: Array.new(3) { (@_||=('A'..'Z').to_a).sample}
[20:20:16] k8k8k: has joined #ruby
[20:20:16] norc: Actually.
[20:20:24] crime: thats perl
[20:20:33] norc: >> Array.new(3) { ($_||=('A'..'Z').to_a).sample}
[20:20:34] ruby[bot]: norc: # => ["I", "U", "G"] (https://eval.in/559465)
[20:20:35] norc: That is perl.
[20:21:12] k8k8k: that's ruby not perl you faggot
[20:21:20] norc: >> (0...3).map { (65 + rand(26)).chr }.join
[20:21:21] ruby[bot]: norc: # => "MEV" (https://eval.in/559466)
[20:21:21] baweaver: !troll k8k8k
[20:21:22] ruby[bot]: +bb k8k8k!*@*$#ruby-banned *!*@gateway/web/freenode/ip.104.174.121.37$#ruby-banned
[20:21:22] ruby[bot]: ruby[bot] kicked k8k8k: is a bannable offense, see http://ruby-community.com/pages/user_rules
[20:21:49] crime: death by peer review, i guess
[20:22:21] norc: Oh that is neat.
[20:22:29] norc: Just learned that you can also create an array like this:
[20:22:37] norc: >> [*"A".."B"]
[20:22:38] ruby[bot]: norc: # => ["A", "B"] (https://eval.in/559467)
[20:22:48] norc: Granted.. not the best example..
[20:23:05] william3: has joined #ruby
[20:23:08] norc: >> *"A".."B"
[20:23:10] ruby[bot]: norc: # => /tmp/execpad-f4ebc63d80c3/source-f4ebc63d80c3:2: syntax error, unexpected .., expecting &. or :: or ...check link for more (https://eval.in/559468)
[20:23:14] adaedra: !badnick k8k8k
[20:23:31] blaix: has joined #ruby
[20:23:35] crime: that could be katekatekay tho
[20:23:52] baweaver: anyways, that's enough of that
[20:24:43] crime: how can I complete the puzzle we were doing without using perl magic and without 2 statements, without copying the array?
[20:24:54] crime: seems like its possible
[20:25:06] avdi: crime: that Avdi character is a total fraud. I hear he smells like feet.
[20:25:11] ledestin: has joined #ruby
[20:25:16] crime: never smelt him
[20:25:21] Ox0dea: You're missin' out.
[20:25:22] norc: crime, check my last snippet in that discussion?
[20:25:45] crime: norc, missed it, thats slick tho
[20:25:48] baweaver: avdi: Thought he smelled like Tapas
[20:25:56] norc: crime, courtesy of SO.
[20:26:29] eam: luckily we don't need to argue over self worth, we can simply refer to a neutral, objective measure: $$$$$
[20:26:32] baweaver: Might read up on ruby splatting some time later, there are more tricks you can use splat for.
[20:26:59] crime: if I had to guess what avdi smelled like, it'd be whatever scent of Axe body spray is selling right now, maybe with like Mtn Dew zest
[20:27:11] djbkd: has joined #ruby
[20:27:21] baweaver: >> head, *tail = [1,2,3,4]; "head #{head} tail #{tail}"
[20:27:22] ruby[bot]: baweaver: # => "head 1 tail [2, 3, 4]" (https://eval.in/559470)
[20:27:25] moei: has joined #ruby
[20:27:32] norc: >> (0...3).map { (?a.ord + rand(26)).chr }.join
[20:27:33] ruby[bot]: norc: # => "ofa" (https://eval.in/559471)
[20:27:38] norc: crime, for readability points
[20:27:52] crime: that ? throws me off, whats happening there
[20:28:03] ruby[bot]: norc: # => "a" (https://eval.in/559472)
[20:28:09] crime: oh, character literal
[20:29:15] norc: >> ?????:??
[20:29:16] ruby[bot]: norc: # => /tmp/execpad-7fe7be2951f8/source-7fe7be2951f8:2: warning: string literal in condition ...check link for more (https://eval.in/559474)
[20:29:18] norc: Fun things you can do with that.
[20:31:45] baweaver: anyways, let's avoid the personal attacks / comments crime
[20:31:46] tomphp: has joined #ruby
[20:31:51] baweaver: ACTION just read through the past chat logs
[20:33:15] Pupeno: has joined #ruby
[20:33:25] shevy: crime yeah the ? can be confusing, I remember it for when before the lonely operator came to be
[20:33:34] shevy: foo.?what?.?is_going_on?
[20:33:48] crime: but asking my age isn't inappropriate?
[20:34:08] william3: has joined #ruby
[20:34:19] baweaver: Ox0dea: let's keep age out of it
[20:34:25] Ox0dea: baweaver: Nonsense.
[20:34:25] crime: not what i meant
[20:34:32] adaedra: You don't have to answer, technically.
[20:34:34] shevy: HOW OLD ARE YOU ALL
[20:34:36] crime: Ox0dea: <3
[20:34:39] Ox0dea: crime: <3
[20:34:45] adaedra: 7 years old in average.
[20:35:00] apeiros: always been, always will be
[20:35:04] shevy: I don't think I can trust the internet answers there
[20:35:04] Ox0dea: The median age of the planet probably is right up around 42.
[20:35:11] shinnya: has joined #ruby
[20:35:14] 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!
[20:35:34] crime: >> a = ('A'..'Z').to_a;Array.new(10){nil}.collect{a.sample}
[20:35:35] ruby[bot]: crime: # => ["L", "S", "N", "K", "E", "Z", "B", "Q", "G", "S"] (https://eval.in/559491)
[20:35:43] crime: still 2 statements though
[20:36:08] Ox0dea: The hell?
[20:36:18] crime: trying to solve mystery
[20:36:25] adaedra: >> Array.new(10) {('A'..'Z').sample)
[20:36:26] ruby[bot]: adaedra: # => /tmp/execpad-9d01fe6286ea/source-9d01fe6286ea:2: syntax error, unexpected ')', expecting '}' ...check link for more (https://eval.in/559496)
[20:36:33] crime: that copies it
[20:36:33] adaedra: >> Array.new(10) {('A'..'Z').sample}
[20:36:34] ruby[bot]: adaedra: # => undefined method `sample' for "A".."Z":Range (NoMethodError) ...check link for more (https://eval.in/559497)
[20:36:38] Ox0dea: We'll get there.
[20:36:44] adaedra: .... it's late.
[20:36:49] crime: I did that same thing and they all yelled at me
[20:37:07] adaedra: that copies what, the original range?
[20:37:15] baweaver: makes a new array n times
[20:37:16] crime: yeah, each time the block is called
[20:37:25] adaedra: yeah, right.
[20:37:27] Ox0dea: >> 10.times.reduce('') { |s| s << rand(65..90) }
[20:37:28] ruby[bot]: Ox0dea: # => "LQCNFEARVO" (https://eval.in/559499)
[20:37:49] mfb2_: has joined #ruby
[20:37:56] adaedra: Can you stop yelling?
[20:38:01] Ox0dea: Not my department.
[20:38:33] adaedra: But I'm sorry, I was kind of looking by bits, didn't catch everything.
[20:38:50] crime: that wouldnt work for arbitrary arrays though
[20:39:07] adaedra: Arbitrary arrays?
[20:39:22] crime: [:symbol, 454545, "a string"]
[20:39:39] crime: idk what im trying to solve anymore actuall
[20:41:04] crime: does ruby have like a cascade operator so I could do like a = [4,5,6] ..other stuff, and a would get bound to the array and then I could call methods on a without a semicolon?
[20:41:25] nfk: has joined #ruby
[20:41:26] Ox0dea: &ri #tap crime
[20:41:26] `derpy: crime: http://ruby-doc.org/core-2.3.0/Object.html#method-i-tap
[20:41:44] Yiota: has joined #ruby
[20:41:56] baweaver: >> 1.tap { 'foo' }
[20:41:57] ruby[bot]: baweaver: # => 1 (https://eval.in/559524)
[20:42:11] adaedra: Object#tap <3
[20:43:07] baweaver: >>class Object;def pipe;yield(self) end end; 1.pipe { |v| v * 5 }
[20:43:09] ruby[bot]: baweaver: # => 5 (https://eval.in/559533)
[20:43:19] Es0teric: has joined #ruby
[20:43:25] baweaver: (granted not a great example of why that'd be useful)
[20:43:41] adaedra: I've made a pipe method earlier, not sure I should release it in the wild.
[20:43:53] crime: >> a = ('A'..'Z').to_a.tap {|o| Array.new(10) {o.sample}}
[20:43:55] ruby[bot]: crime: # => ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", ...check link for more (https://eval.in/559535)
[20:43:55] Ox0dea: crime: That'll give you back the receiver, though, as baweaver demonstrated. You probably want something more like #instance_eval.
[20:44:00] Ox0dea: Toldja so.
[20:44:01] crime: shit, yep
[20:44:02] Es0teric: has joined #ruby
[20:44:29] banister: has joined #ruby
[20:44:36] rdark: has joined #ruby
[20:44:46] lomex: has joined #ruby
[20:44:53] baweaver: >>class Object;def pipe;yield(self) end end; ('A'..'Z').to_a.pipe {|o| Array.new(10) {o.sample}}
[20:44:55] ruby[bot]: baweaver: # => ["D", "R", "U", "P", "C", "S", "M", "P", "B", "F"] (https://eval.in/559538)
[20:45:23] crime: more than one statement though
[20:45:46] Ox0dea: >> rand(36**10).to_s(36).upcase
[20:45:47] ruby[bot]: Ox0dea: # => "69X0OYL1QC" (https://eval.in/559541)
[20:46:00] Ox0dea: Small odds of getting all letters. :/
[20:46:55] Ox0dea: >> 26/36r ** 10
[20:46:56] ruby[bot]: Ox0dea: # => (13/1828079220031488) (https://eval.in/559548)
[20:46:58] crime: >> a = ('A'..'Z').to_a.instance_eval{|o| Array.new(10){o.sample}}
[20:47:00] ruby[bot]: crime: # => ["Q", "S", "E", "H", "X", "R", "F", "E", "Y", "L"] (https://eval.in/559549)
[20:47:01] Ox0dea: *Way* small.
[20:47:06] bazz_: has left #ruby: ("Leaving")
[20:47:20] ruby[bot]: here's your cookie: 🍪
[20:47:55] baweaver: >> rand(36**10).to_s(36).upcase.delete '0-9'
[20:47:57] ruby[bot]: baweaver: # => "OONNIXGO" (https://eval.in/559555)
[20:48:28] Ox0dea: Looks like the start of a Pokémon battle.
[20:48:45] Yiota_: has joined #ruby
[20:48:59] tomphp: has joined #ruby
[20:49:18] crime: subtle, love it
[20:51:08] Pupeno: has joined #ruby
[20:51:09] Pupeno: has joined #ruby
[20:51:14] jdawgaz: has joined #ruby
[20:52:52] Guest00-ru: has joined #ruby
[20:53:09] infernix: has joined #ruby
[20:54:33] alexherbo2: has joined #ruby
[20:55:49] Moosashi: has joined #ruby
[20:55:59] tax: has joined #ruby
[20:56:23] mfb2: has joined #ruby
[20:57:22] sharkman: has joined #ruby
[20:58:00] bobbycvi: has joined #ruby
[20:58:34] bronson: has joined #ruby
[20:58:49] hoylemd_: has left #ruby: ()
[21:01:04] jdawgaz: has joined #ruby
[21:01:15] allcentury: has joined #ruby
[21:02:17] Moosashi: has joined #ruby
[21:02:19] baweaver: has joined #ruby
[21:02:41] mfb2: has joined #ruby
[21:03:48] yfeldblum: has joined #ruby
[21:06:32] FernandoBasso: has joined #ruby
[21:06:46] mfb2: has joined #ruby
[21:07:28] mdw: has joined #ruby
[21:07:50] emilford: has joined #ruby
[21:08:08] wedgwood: has left #ruby: ("Goodbye")
[21:10:06] tAn: has joined #ruby
[21:10:12] Zarthus_: has joined #ruby
[21:10:43] ddfreyne_: has joined #ruby
[21:12:16] pawnbox: has joined #ruby
[21:12:23] moeabdol1: has joined #ruby
[21:12:25] Billias: has joined #ruby
[21:12:51] Guest54-ru: has joined #ruby
[21:12:54] tAn: has joined #ruby
[21:14:12] cpup: has joined #ruby
[21:14:22] karapetyan: has joined #ruby
[21:15:55] mfb2: has joined #ruby
[21:17:54] edwinvdgraaf: has joined #ruby
[21:19:17] jaguarmagenta: has joined #ruby
[21:19:24] Tass_: has joined #ruby
[21:19:56] Tasser: has joined #ruby
[21:20:02] emilford: has joined #ruby
[21:22:43] cpup: has joined #ruby
[21:23:22] GinoMan2440: has joined #ruby
[21:24:05] tAn: has joined #ruby
[21:25:57] ixti: has joined #ruby
[21:26:36] GinoMan2440_: has joined #ruby
[21:28:39] Rodya_: has joined #ruby
[21:30:45] yfeldblum: has joined #ruby
[21:33:32] stannard_: has joined #ruby
[21:35:13] Fernando-Basso: has joined #ruby
[21:36:21] rht: has joined #ruby
[21:38:10] ejnahc: has joined #ruby
[21:38:51] stannard: has joined #ruby
[21:41:56] ur5us: has joined #ruby
[21:45:21] chipotle: has joined #ruby
[21:46:11] Devalo: has joined #ruby
[21:46:24] wldcordeiro: has joined #ruby
[21:47:17] sepp2k: has joined #ruby
[21:47:59] al2o3-cr1: has joined #ruby
[21:48:57] Xeago: has joined #ruby
[21:49:30] diegoaguilar: has joined #ruby
[21:49:36] symm-: has joined #ruby
[21:50:05] Xeago: has joined #ruby
[21:50:12] speakingcode: has joined #ruby
[21:50:53] pawnbox: has joined #ruby
[21:51:17] Dimik: has joined #ruby
[21:51:36] howdoicomputer: has joined #ruby
[21:51:50] spider-mario: has joined #ruby
[21:52:05] mfb2_: has joined #ruby
[21:52:57] aclearman037: has joined #ruby
[21:54:02] mfb2__: has joined #ruby
[21:55:52] mfb2: has joined #ruby
[21:58:50] Spami: has joined #ruby
[21:59:50] flashpoint9: has joined #ruby
[22:00:01] nando293921: has joined #ruby
[22:00:22] bradleyprice: has joined #ruby
[22:00:29] n008f4g_: has joined #ruby
[22:01:08] ChiefAlexander: has joined #ruby
[22:01:20] BSaboia: has joined #ruby
[22:01:56] [Butch]: has joined #ruby
[22:02:05] mlakewood: has joined #ruby
[22:02:38] Azure: has joined #ruby
[22:02:51] tAn: has joined #ruby
[22:03:10] mfb2: has joined #ruby
[22:03:38] dh64: has joined #ruby
[22:03:44] deadnull: has joined #ruby
[22:03:50] aibot__: has joined #ruby
[22:04:23] w1lson: has joined #ruby
[22:04:40] drbrain: has joined #ruby
[22:04:47] sarlalian: has joined #ruby
[22:05:18] dostoyevsky: has joined #ruby
[22:05:48] droptone: has joined #ruby
[22:06:00] deadnull: has joined #ruby
[22:06:07] Cohedrin_: has joined #ruby
[22:08:47] arthurnn: has joined #ruby
[22:11:05] kasisnu_: has joined #ruby
[22:12:14] swills: has joined #ruby
[22:15:32] crystal77: has joined #ruby
[22:16:00] karapetyan: has joined #ruby
[22:16:19] flashpoint9: has joined #ruby
[22:18:00] todd: has joined #ruby
[22:20:42] boboc: has joined #ruby
[22:22:23] SilverKey: has joined #ruby
[22:23:19] edwinvdgraaf: has joined #ruby
[22:26:50] edwinvdgraaf: has joined #ruby
[22:27:04] Rodya_: has joined #ruby
[22:29:31] ensyde: has joined #ruby
[22:30:37] shayan: has joined #ruby
[22:30:53] aspiers_: has joined #ruby
[22:32:19] crime: has joined #ruby
[22:34:31] mjuszczak: has joined #ruby
[22:36:49] tax: has joined #ruby
[22:37:00] rbennacer: has joined #ruby
[22:37:13] baweaver: has joined #ruby
[22:37:29] zenlot6: has joined #ruby
[22:37:41] rickmasta: has joined #ruby
[22:41:33] w1lson: has joined #ruby
[22:41:43] jenrzzz: has joined #ruby
[22:41:43] jenrzzz: has joined #ruby
[22:43:03] weemsledeux: has joined #ruby
[22:43:17] rbennacer: has joined #ruby
[22:45:45] flashpoint9: has joined #ruby
[22:46:13] Rodya_: has joined #ruby
[22:46:24] stannard: has joined #ruby
[22:50:37] kam270: has joined #ruby
[22:50:48] kasisnu: has joined #ruby
[22:51:14] mikecmpbll: has joined #ruby
[22:56:59] arescorpio: has joined #ruby
[22:57:05] skade: has joined #ruby
[22:57:29] IrishGringo: has joined #ruby
[22:59:17] guest789: has joined #ruby
[22:59:53] rodfersou: has joined #ruby
[23:00:31] bronson: has joined #ruby
[23:02:15] GodFather: has joined #ruby
[23:03:19] mfb2: has joined #ruby
[23:03:24] guest789: Hello, I am new to ruby. I have a need to construct a date in ISO format. I have g_date:2014-09-09 g_time:12:01:56 g_msec:456. How do i contruct a date out of it ? Ideally using Time.at ?
[23:04:02] mfb2: has joined #ruby
[23:06:03] darix: guest789: Time#strftime
[23:06:18] darix: and for parsing
[23:06:38] n008f4g_: has joined #ruby
[23:06:53] guest789: thanks darix. I am absolutely new to ruby. Could you please elaborate ?
[23:07:25] blackwell: has joined #ruby
[23:07:55] darix: http://rakeroutes.com/blog/parsing-dates-and-times-from-strings/
[23:08:28] JBlazeCoder21: has joined #ruby
[23:08:43] baweaver: darix: the bot is handy
[23:08:50] baweaver: &ri Time#strftime
[23:08:51] `derpy: http://ruby-doc.org/core-2.3.0/Time.html#method-i-strftime
[23:09:08] crime: dang baweaver, that socratic delegation, its like ur a real teacher
[23:09:42] blackmes1: has joined #ruby
[23:10:10] benlieb: has joined #ruby
[23:11:04] wuieoo: has joined #ruby
[23:11:12] crime: just bored
[23:11:48] crime: and yet, not bored enough to do anything productive
[23:12:00] wuieoo: i are jap and can't prorource the rerrer r
[23:12:18] Radar: !troll wuieoo
[23:12:20] ruby[bot]: +bb wuieoo!*@*$#ruby-banned *!*@gateway/web/freenode/ip.172.56.40.240$#ruby-banned
[23:12:21] ruby[bot]: ruby[bot] kicked wuieoo: is a bannable offense, see http://ruby-community.com/pages/user_rules
[23:13:34] tAn: has joined #ruby
[23:14:07] CausaMortis: has joined #ruby
[23:14:12] aclearman037: has joined #ruby
[23:14:35] Radar: crime: so it seems
[23:15:38] crime: do u ever feel that way?
[23:15:45] RahulT: has joined #ruby
[23:15:59] Es0teric: has joined #ruby
[23:16:13] aclearman037: has joined #ruby
[23:20:05] jaguarmagenta: has joined #ruby
[23:20:32] DotKite: has joined #ruby
[23:21:49] Radar: Yes. Then I go for bike rides / hikes instead.
[23:23:50] S1kx: has joined #ruby
[23:25:46] crime: thats a good idea
[23:26:00] krasnus: has joined #ruby
[23:27:01] DotKite: I am trying to implement a prime gap function. I decided to use an enumerator, but when I call my gap function more than once it is as if it isn't creating a new enumerator when I call the gap function more than once. Here is the paste http://pastebin.com/YmnMz9Lr
[23:27:03] ruby[bot]: DotKite: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/7e8669de9b03369d743cb52e23dbeff9
[23:27:03] ruby[bot]: DotKite: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[23:27:39] DotKite: well the paste is now in https://gist.github.com/7e8669de9b03369d743cb52e23dbeff9
[23:28:36] flashpoint9: has joined #ruby
[23:29:47] CausaMortis_: has joined #ruby
[23:30:09] x77686d: has joined #ruby
[23:32:52] guest789: would anyone know what format is this time 2014-04-07T000:00:00-00:00
[23:33:57] baweaver: ISO 8601 UTC
[23:34:06] baweaver: https://en.wikipedia.org/wiki/ISO_8601
[23:35:30] pawnbox: has joined #ruby
[23:35:36] Arahael: that's not iso 8601, though could be a typo.
[23:35:40] Xentil: has joined #ruby
[23:35:49] bkxd: has joined #ruby
[23:35:55] guest789: arahael: I am confused too
[23:36:03] guest789: this is for elasticsearch
[23:36:15] Arahael: iso 8601 has a maximum of 2 digits in the hours column, for a max value of 24.
[23:36:35] guest789: T000:00:00-00:00, not sure how i would represent hh:mm:ss,SSS
[23:36:37] Arahael: guest789: elasticsearch uses iso8601.
[23:37:09] Arahael: guest789: ah. use a . for decimal seconds, not comma.
[23:37:13] siaW: has joined #ruby
[23:37:15] guest789: arahael: With milliseconds
[23:37:31] heyimwill: has joined #ruby
[23:37:36] Arahael: guest789: but some broken parsers deal with milliseclnds poorly.
[23:37:42] Arahael: *milliseconds.
[23:37:45] smathy: The three digit hour is more concerning there.
[23:38:06] crime: maybe its iso 8601 but on a planet with a longer orbit
[23:38:08] smathy: I'd rather be some milliseconds off than an order of magnitude of hours.
[23:38:20] smathy: crime, longer rotation.
[23:38:25] crime: you meant what i knew
[23:38:33] guest789: https://github.com/shivaken/fluent-plugin-better-timestamp/blob/master/lib/fluent/plugin/out_better_timestamp.rb see line 42.
[23:38:38] guest789: trying to understand that
[23:39:07] smathy: guest789, that's a standard parser for ISO 8601
[23:39:26] smathy: ...where did you get the three digit hours or "-00:00" part from that?
[23:39:38] freerobby: has joined #ruby
[23:39:41] Radar: That's a timezone.
[23:40:04] smathy: Oh, heh :)
[23:40:15] Radar: "2016-04-26T09:40:11+10:00"
[23:40:15] smathy: I'm not used to seeing a colon there.
[23:40:18] nando293921: has joined #ruby
[23:40:21] Radar: Looks familar to the one that they provided, no?
[23:40:34] guest789: smathy. On line 42, what should be time ?
[23:40:41] Arahael: Radar: still, that has only 2-digits in the hours part.
[23:40:50] guest789: specifically, what format ?
[23:41:14] Radar: guest789: where did you get the time from?
[23:41:22] smathy: guest789, YYYY-MM-DDThh:mm:ss.milisecZ
[23:41:51] paulgrmn3: has joined #ruby
[23:42:10] guest789: can I do Time.at('2014-10-10 10:20:30', record[@msec_key].to_i * 1000).strftime("%Y-%m-%dT%H:%M:%S.%L%z")
[23:42:31] Arahael: guest789: you're totally ignoring all of us.
[23:43:00] guest789: Radar: This is for fluentd.
[23:43:02] smathy: guest789, sorry, as Radar mentioned, the %z is the zone offset, although I'd expect just three or four digits without a semi colon like +1000 -0600 or -600
[23:43:18] Arahael: smathy: the semicolon is optional.
[23:43:23] smathy: ...but he's probably right that the ... ^ that.
[23:44:46] rodfersou: has joined #ruby
[23:44:55] guest789: this is so complicated...sorry
[23:45:05] Arahael: but anyway, why help him - we all asked about the 3-digit hour, and he's ignored us. it must be significant, because hree times he mentioned it.
[23:45:37] guest789: arahael: I did not ignored it. I myself don't know sorry...
[23:46:17] Arahael: guest789: well, where. did. you. get. it. from?
[23:46:26] guest789: i got it from here https://github.com/uken/fluent-plugin-elasticsearch
[23:46:31] guest789: see time_key section
[23:46:42] Arahael: guest789: you cut*pasted that line here?
[23:46:46] Devalo: has joined #ruby
[23:47:31] guest789: {"@timestamp":"2014-04-07T000:00:00-00:00"}
[23:47:52] Arahael: right. yeah, that looks wrong.
[23:48:40] al2o3-cr: >> require 'time'; Time.parse(Time.now.to_s).iso8601
[23:48:41] ruby[bot]: al2o3-cr: # => "2016-04-25T23:48:40+00:00" (https://eval.in/559581)
[23:49:22] Radar: >> require 'time'; Time.parse("2014-04-07T000:00:00-00:00")
[23:49:23] ruby[bot]: Radar: # => 2014-04-07 00:00:00 UTC (https://eval.in/559582)
[23:49:30] Radar: Seems valid according to Time.parse
[23:49:54] chipotle: has joined #ruby
[23:50:16] crime: >> require 'time'; Time.parse("2014-04-07T123:23:23-23:23")
[23:50:17] ruby[bot]: crime: # => 2014-04-12 03:23:23 -2323 (https://eval.in/559583)
[23:50:30] crime: >> require 'time'; Time.parse("2014-04-07T023:23:23-23:23")
[23:50:31] ruby[bot]: crime: # => 2014-04-07 23:23:23 -2323 (https://eval.in/559584)
[23:50:56] mjuszczak: has joined #ruby
[23:51:35] crime: we should just all use UTC milliseconds
[23:51:42] crime: would be way easier to deal with
[23:52:23] Radar: "meet me at the cafe at 1461628331409037
[23:52:27] Radar: Sure sounds good lets do it
[23:52:47] deadnull: has joined #ruby
[23:52:54] crime: i'd prefer it
[23:53:07] Radar: xkcd.com/927
[23:54:06] crime: einstein said time was relative, what if we only described time relatively?
[23:54:13] crime: lets meet at cafe tomorrow
[23:54:22] SilverKey: has joined #ruby
[23:54:52] Radar: what even is tomorrow
[23:55:00] crime: doesnt matter, thats for u to decide
[23:55:10] crime: its implementation specific
[23:55:22] Radar: I can't have a serious discussion with you if you're going to abbreviate a three-letter word into a single letter.
[23:55:38] crime: maybe its a stylistic choice
[23:56:05] ryanneufeld: has joined #ruby
[23:56:10] smathy: I think he's assuming that.
[23:56:39] crime: radar we can just not be serious then
[23:56:47] crime: lets keep it casual until u r ready
[23:56:57] fsapo: has joined #ruby
[23:56:59] crime: i mean, i wasnt serious anyways
[23:57:23] ryanneufeld: can someone help me figure out why this isn't working for me https://gist.github.com/ryanneufeld/11b83ba96fd80b56d06951117961571f
[23:57:45] ryanneufeld: basically what I'm trying to do is take an envvar which is a string, and make it a boolean
[23:57:56] RegulationD: has joined #ruby
[23:57:56] ryanneufeld: so i can pass it into ansible correctly
[23:58:04] flashpoint9: has joined #ruby
[23:58:09] ryanneufeld: I found this http://drawingablank.me/blog/ruby-boolean-typecasting.html
[23:58:19] ryanneufeld: I'm not a ruby dev
[23:58:49] smathy: ryanneufeld, that's a lot of lines to do that.
[23:59:28] ryanneufeld: well, in any other language, i'd have it beat, but ruby mystifies me
[23:59:33] ryanneufeld: I'm well open to suggestions