« Back to channel list

#ruby - 22 July 2017

« Back 1 day Forward 1 day »
[00:00:15] Azure: has joined #ruby
[00:02:34] kkiero: has joined #ruby
[00:03:46] mahlon: has joined #ruby
[00:05:34] frmendes: has joined #ruby
[00:07:18] gothicsouth: has joined #ruby
[00:08:24] frmendes: has joined #ruby
[00:09:52] deep-book-gk_: has joined #ruby
[00:10:37] bronson: has joined #ruby
[00:11:22] deep-book-gk_: has left #ruby: ()
[00:12:34] smulverine: has joined #ruby
[00:14:53] grymmjack: has joined #ruby
[00:15:54] herbmillerjr: has joined #ruby
[00:16:53] jenrzzz: has joined #ruby
[00:17:19] frmendes_: has joined #ruby
[00:18:25] bpmedley: has joined #ruby
[00:18:30] S1kx: has joined #ruby
[00:18:34] bpmedley: has left #ruby: ()
[00:26:34] deep-book-gk_: has joined #ruby
[00:29:27] cdg: has joined #ruby
[00:31:59] AnoHito: has joined #ruby
[00:37:22] ansraliant: has joined #ruby
[00:43:59] deep-book-gk_: has joined #ruby
[00:44:33] deep-book-gk_: has left #ruby: ()
[00:50:18] cagomez: has joined #ruby
[00:58:28] Jameser: has joined #ruby
[00:58:38] gizmore: are there interfaces in ruby?
[01:10:23] rundor: has joined #ruby
[01:11:28] bronson: has joined #ruby
[01:15:06] Arahael: gizmore: Yes and no.
[01:15:21] gizmore: i hope there are not
[01:15:30] gizmore: because i dont memorize them
[01:15:35] gizmore: and i did hardcore ruby!
[01:16:10] Arahael: gizmore: This is a really good explaination: https://stackoverflow.com/a/4439733/52273
[01:16:14] hutch34_: has joined #ruby
[01:16:36] SteenJobs_: has joined #ruby
[01:16:46] bruno-: has joined #ruby
[01:16:47] gizmore: they are using contracts to ensure type safety
[01:16:54] Arahael: That's what interfaces are!
[01:17:19] gizmore: i think php is better than ruby
[01:17:30] Arahael: ACTION doesn't know php.
[01:17:31] SteenJobs_: has joined #ruby
[01:17:39] gizmore: because php offers native type hinting by now, even for primitives
[01:17:52] gizmore: adding contract to your ruby app might be tedious
[01:18:16] gizmore: in php, type hinting is a core feature since 5.4? ... and for primitives since 7.???
[01:18:33] gizmore: i went back to php after excessive ruby hacking
[01:18:43] gizmore: type hinting being one major reason
[01:18:45] guardianx: has joined #ruby
[01:18:55] SteenJobs_: has joined #ruby
[01:19:01] Arahael: gizmore: It's pretty trivial to add such a thing. Python has it too now, btw, but very few people use it.
[01:19:14] gizmore: how to have it in ruby?
[01:19:19] gizmore: with contract decorator?
[01:19:56] Arahael: Sure. Or raise an error if it's not the right type.
[01:20:13] gizmore: check every arg on every function? ;=
[01:20:27] gizmore: write contract for every function? (haha)
[01:20:46] Arahael: Why would you do it for every function?
[01:21:10] gizmore: because i wanna keep control over everything as much as possible in my programms
[01:21:20] gizmore: every user input seems malicous
[01:21:43] Arahael: Mere type checking - not at the level php and ruby allows - won't fix that.
[01:21:48] gizmore: its nice to have type safety for free in a script language
[01:21:57] Arahael: It's not for free.
[01:22:11] Arahael: I note in php, it's a runtime check, and only for a small number of types at that.
[01:22:15] gizmore: yeah... i gotta specify the type
[01:22:21] gizmore: yeah i know
[01:22:37] gizmore: i know php is just fixes patching patched fixes
[01:22:50] gizmore: but the type system is better than in ruby
[01:22:57] Arahael: And it's not impossible to implment the same for ruby, say, similar in https://github.com/beezee/ruby_type_hinting
[01:22:58] enterprisey: has joined #ruby
[01:23:03] gizmore: yeah i know
[01:23:08] Arahael: It's just that it's fairly pointless.
[01:23:09] gizmore: lemme smash that link
[01:23:18] gizmore: in php it gives me
[01:23:24] gizmore: 1) Code completion hints
[01:23:31] gizmore: 2) Expcetions on coding errors
[01:23:46] gizmore: 2) is pretty pointless, admitted
[01:23:55] gizmore: but 1) CodeHints ... "GREAT!
[01:24:09] Arahael: Any decent IDE or text editor should be able to do that. I don't know much about in ruby, but in python, there are IDE's that give quite good code completion hints and the like.
[01:24:21] kculpis: has joined #ruby
[01:24:23] gizmore: in php and ruby its a pita here
[01:24:33] gizmore: i use eclipse only, though
[01:24:36] gizmore: PDT for PHP
[01:24:44] gizmore: Aptana for Ruby
[01:24:59] gizmore: tried jetbrains for ruby... not much better
[01:25:26] Arahael: RubyMine? I was about tos uggest that, though I hadn't tried it.
[01:25:33] gizmore: i tried it
[01:25:38] gizmore: dont remember much
[01:25:45] gizmore: i tried the debugger
[01:25:49] Arahael: If it's anything like PyCharm, though, you would want to have good code docs that includes the argument types.
[01:25:55] gizmore: because i was devinga cli multithread bot
[01:26:07] gizmore: and i wanted to try debugger on Redmine
[01:26:10] gizmore: and it sucked
[01:26:50] Arahael: Whenever I want really good typing, I usually stick with Haskell, C++, or F#.
[01:26:55] gizmore: code completion is non exitant on AptanaStudio maybe... i bet on JetbrainsRedmine it almost is bearable
[01:27:18] Arahael: But usually in dynamic languages I lean more on the tests.
[01:27:27] gizmore: i am afraid of C++ taking too long to dev, especially because i wanted runtime code reload (dll reloading),
[01:27:47] gizmore: but my next framework might be c/++
[01:27:58] Arahael: C and C++ are quite different languages now.
[01:28:06] gizmore: not really
[01:28:11] Arahael: Yes, really.
[01:28:15] gizmore: just put --std=99
[01:28:27] gizmore: kiddings :)
[01:28:44] gizmore: just avoid the class keyword
[01:28:49] gizmore: and disable exceptions
[01:29:11] gizmore: wanna see a c++ app i made?
[01:29:39] gizmore: https://www.wechall.net/download/5/YaBFDbg_tar_bz2
[01:29:53] gizmore: yet another brainfuck debugger... needs gtkmm
[01:30:05] gizmore: its the best brainfuck debugger out there
[01:30:09] bkxd: has joined #ruby
[01:30:10] gizmore: it adds a new instruction
[01:30:12] bkxd_: has joined #ruby
[01:30:16] gizmore: for "Breakpoint"
[01:31:03] gizmore: i wrote it because i couldnt find a brainfuck debugger featuring breakpoints
[01:32:13] Arahael: Nah, I'm good.
[01:33:58] gizmore: i wrote a pretty cool chatbot in ruby
[01:34:26] gizmore: but the syntax is so quirky its hard to get the best out of it
[01:34:51] gizmore: its a bit like bash combined with a round robin hydra
[01:35:53] mim1k: has joined #ruby
[01:36:58] gizmore: another reason i chose php over ruby again is the toolchain
[01:37:13] Nilium: ACTION is writing a wrapper around herbstclient in Ruby just because he felt like it.
[01:37:14] gizmore: in ruby i was using active record, and its bloated
[01:37:49] gizmore: in php i was confident enough todo evertyhing on my own... and meanwhile its better than AR
[01:38:19] Nilium: This monologue could use some work.
[01:38:37] Rodya_: has joined #ruby
[01:38:37] gizmore: how about a small round of codegolf?
[01:38:39] Nilium: Jokes. Slides.
[01:38:45] gizmore: or that,yeah
[01:39:00] Nilium: Maybe an impromptu "I broke my code on stage" moment
[01:39:29] gizmore|2: has joined #ruby
[01:39:34] gizmore|2: [x]`o <--- moves a jokeslide
[01:40:42] gizmore|2: dont tell the guys at RoR, but i got a solution to all their performance problems
[01:41:17] gizmore|2: it's called hyperglobal instance cache, and the 20 lines commit never got pull requested by me
[01:41:19] jackjackdripper: has joined #ruby
[01:41:34] Nilium: Never used Rails.
[01:41:38] cdg: has joined #ruby
[01:41:50] Nilium: Frankly have no interest in it whatsoever.
[01:41:54] gizmore|2: actually it does not have any problems i could solve
[01:42:04] gizmore|2: but my caching system is great
[01:42:17] gizmore|2: it ensures you only operate on one instance of every db row
[01:42:46] gizmore|2: db.findId(1).object_id == db.findId(1).object_id # yields true
[01:42:59] gizmore|2: in active record it is false
[01:43:13] gizmore|2: in my patch it is true ... one row, one instance
[01:43:50] gizmore|2: it has a slight performance overhead, but might safe a bit peak mem
[01:47:30] d^sh: has joined #ruby
[01:47:49] minichiello: has joined #ruby
[01:50:37] dstrunk: has joined #ruby
[01:50:53] ramfjord: has joined #ruby
[01:55:08] Moosashi: has joined #ruby
[01:56:18] charliesome: has joined #ruby
[01:57:28] havenwood: gizmore: use #equal? to check object_id equality
[01:57:39] ramfjord: has joined #ruby
[01:58:06] gizmore: havenwood: you dont get it
[01:58:10] gizmore: you know active record?
[01:58:18] guardianx: has joined #ruby
[01:58:22] gizmore: i filter every instance fetched from the db
[01:58:31] gizmore: and make sure only 1 instance per row exists
[01:58:36] gizmore: the global object cache
[01:58:43] gizmore: 1 instance per row
[01:58:58] havenwood: gizmore: why on earth couldn't you use #equal?
[01:59:08] gizmore: because i want to manipulate the same instance
[01:59:31] gizmore: to avoid race conditions, reduce memory footprint, and remove complexity
[01:59:50] gizmore: like you do:
[02:00:08] havenwood: gizmore: a.equal?(b) if and only if a is the same object as b
[02:00:16] gizmore: you dont get it
[02:00:28] gizmore: imagine you have a big app
[02:00:48] gizmore: somewhere you do some cache = User.find
[02:01:07] gizmore: then somehwhere else manipulate User.where
[02:01:31] gizmore: the cache user from find is the same intance as returned from the where
[02:01:31] havenwood: this seems solidly in #RubyOnRails land, but go on
[02:01:39] gizmore: like i do:
[02:01:45] gizmore: user = Users.find(1)
[02:01:53] gizmore: user2 = Users.find(1)
[02:01:58] gizmore: user2.name='foo'
[02:02:11] gizmore: what is user.name?
[02:02:18] havenwood: user2.changes
[02:02:35] havenwood: user.changed?
[02:02:41] havenwood: I don't get your problem. But it's a Rails problem.
[02:02:46] gizmore: with my patch, user is the same instance as user2
[02:03:07] gizmore: because i filter all results through my cache
[02:03:14] gizmore: it is overhead, but fun
[02:03:43] havenwood: rails could have done singletons for each model instance but they didn't
[02:03:55] gizmore: yeah... i made a patch with 20 lines or something
[02:04:13] gizmore: it cost some overhead, but still fun
[02:04:14] havenwood: gizmore: my point was instead of #object_id twice and a ==, just use #equal?
[02:04:52] gizmore: my ruby is a bit rusty meanwhile
[02:04:56] gizmore: i got back to php
[02:05:03] gizmore: after 2 years of ruby hype
[02:05:11] havenwood: some rubyists ruby gets so rusty it becomes rust
[02:05:23] gizmore: ruby seemed slower than php to me
[02:05:33] gizmore: and i dont like the toolchains
[02:05:50] gizmore: i miss the language syntax sometimes :(
[02:06:01] havenwood: maybe you don't like apps booting? also you might be conflating Ruby with Rails.
[02:06:18] gizmore: well... what else is there as activerecord?
[02:06:25] gizmore: activerecord sucks
[02:06:34] havenwood: PHP doesn't boot a server, it defers to non-web languages for that stuff.
[02:06:35] havenwood: gizmore: Sequel is quite nice and very popular.
[02:06:44] havenwood: gizmore: Give Roda and Sequel a try.
[02:06:50] gizmore: should look at those
[02:06:52] havenwood: http://sequel.jeremyevans.net/
[02:06:57] gizmore: mine is different in terms of:
[02:07:03] havenwood: http://roda.jeremyevans.net/
[02:07:09] gizmore: 1) I declare table columns in a class method
[02:07:40] gizmore: nothing else features this
[02:07:50] gizmore: look at this
[02:07:56] havenwood: gizmore: You really should look at Sequel. It's one of the best-maintained Ruby gems around.
[02:08:10] havenwood: gizmore: Take a look at Roda/Sequel performance.
[02:08:13] havenwood: gizmore: https://www.techempower.com/benchmarks/previews/round15/
[02:08:18] gizmore: https://www.wechall.net/download/5/YaBFDbg_tar_bz2
[02:08:18] ramfjord: has joined #ruby
[02:08:32] gizmore: https://github.com/gizmore/gwf5/blob/master/inc/util/gwf/GWF_User.php
[02:08:38] gizmore: ^ this is my user model
[02:08:51] havenwood: gizmore: Roda + Sequel destroys PHP on Techempower's benchmarks.
[02:09:11] rundor: has joined #ruby
[02:09:17] havenwood: gizmore: It's not as fast as ngx_mruby, but that's another story.
[02:09:22] gizmore: techempower does not even render here
[02:09:24] havenwood: (If you really want speed.)
[02:09:31] bkxd__: has joined #ruby
[02:09:41] havenwood: gizmore: you might have to click on the background
[02:09:50] havenwood: gizmore: i linked the upcoming Round 15 to be fair to Rails
[02:09:51] gizmore: i allowed scripts now
[02:10:00] havenwood: (Rails just got a better Puma setup.)
[02:10:28] gizmore: well... i got tested 50 requests just now
[02:10:33] gizmore: per second! :)
[02:10:39] havenwood: gizmore: But take a look at ngx_mruby if you really want speed. Roda and Sequel let you compose a small, fast API or app quickly.
[02:10:41] gizmore: not bad for php
[02:11:01] havenwood: ~400,000 requests per second for ngx_mruby
[02:11:02] bkxd: has joined #ruby
[02:11:21] gizmore: i am at about 10ms here at localhost
[02:11:30] gizmore: on my vserver i am at 20ms
[02:11:40] gizmore: https://gwf5.gizmore.org
[02:12:04] gizmore: that is a big app already, having lots of modules included (but no data yet)
[02:12:17] bronson: has joined #ruby
[02:12:21] gizmore: timing will surely drop down when there would be data
[02:12:28] gizmore: but not too much, i bet
[02:13:26] gizmore: 400,000 requests for mruby sounds fun... but those numbers are made off numbers
[02:13:44] havenwood: gizmore: https://github.com/matsumotory/ngx_mruby
[02:13:48] gizmore: i have seen go server in microseconds too
[02:14:02] enterprisey: has joined #ruby
[02:14:03] gizmore: but as soon as an idiot adds code, its up to ms
[02:14:18] gizmore: still good bench... let it be 5ms
[02:15:02] gizmore: zero allocation router in go is impressive
[02:15:17] gizmore: 10mikroseconds response time is awesome
[02:17:03] gizmore: there is also a go framework present on that site
[02:17:15] sarbs: has joined #ruby
[02:17:16] duderonomy: has joined #ruby
[02:17:33] gizmore: wow... 200k requests per second Oo
[02:17:37] gizmore: i am at 100
[02:18:41] gizmore: i would have been listed :)
[02:19:14] gizmore: make sure you read " i am at onehundred, instead of onehundredthousand" :(
[02:19:58] digitalnomad: has joined #ruby
[02:20:04] gizmore: i am sure my framework performs much better
[02:22:37] Jameser: has joined #ruby
[02:23:06] gizmore: dude ... 200,000 requests per second has to be a typo
[02:23:21] gizmore: they surely mean 200.0
[02:24:03] runescape07rsps: has joined #ruby
[02:24:12] jenrzzz: has joined #ruby
[02:27:13] Moosashi: has joined #ruby
[02:31:34] hutch34_: has joined #ruby
[02:34:18] Rodya_: has joined #ruby
[02:38:53] __Yiota: has joined #ruby
[02:41:54] eightlimbed: has joined #ruby
[02:42:47] dviola: has joined #ruby
[02:46:31] raspado: has joined #ruby
[02:50:46] bkxd_: has joined #ruby
[02:51:37] bkxd___: has joined #ruby
[02:55:22] jphase: has joined #ruby
[03:00:43] cdg: has joined #ruby
[03:03:15] uZiel: has joined #ruby
[03:07:04] cdg: has joined #ruby
[03:07:11] digitalnomad: has joined #ruby
[03:12:08] jackjackdripper1: has joined #ruby
[03:14:14] bronson: has joined #ruby
[03:16:40] hkdsun: has joined #ruby
[03:24:03] SteenJobs_: has joined #ruby
[03:30:50] bkxd: has joined #ruby
[03:32:17] bkxd__: has joined #ruby
[03:35:00] kies: has joined #ruby
[03:36:24] mim1k: has joined #ruby
[03:42:08] cagomez: has joined #ruby
[03:45:23] gix: has joined #ruby
[03:49:52] raspado: has joined #ruby
[03:54:58] cdg: has joined #ruby
[04:01:01] Moosashi: has joined #ruby
[04:01:14] Jameser: has joined #ruby
[04:03:57] cdg: has joined #ruby
[04:09:13] raspado: has joined #ruby
[04:12:41] bkxd_: has joined #ruby
[04:13:06] bkxd___: has joined #ruby
[04:15:03] bronson: has joined #ruby
[04:16:26] Logicgate: has joined #ruby
[04:16:42] Logicgate: Engineering question:
[04:16:47] Logicgate: So I have a repository for users, but users have privileges and I'm unsure whether or not the user repository should also handle persisting the privileges
[04:16:51] Logicgate: Or should it be a separate repository altogether
[04:16:56] Logicgate: Could one say the privileges are contextually bounded to the users and it's okay to use the users repository to update a users privileges / retrieving them?
[04:21:35] qmr: Logicgate: ?
[04:21:45] qmr: programming is not engineering, please do not conflate the two
[04:22:25] qmr: systems administration is also not engineering. nor is tech support.
[04:22:53] Logicgate: I apologize.
[04:23:05] Logicgate: Development concern maybe?
[04:30:07] milardovich: has joined #ruby
[04:32:28] Logicgate: has left #ruby: ()
[04:33:29] hutch34_: has joined #ruby
[04:34:10] minimalism: has joined #ruby
[04:34:56] RahulT: has joined #ruby
[04:35:33] mim1k: has joined #ruby
[04:35:58] jenrzzz: has joined #ruby
[04:35:58] jenrzzz: has joined #ruby
[04:42:56] NightMonkey: has joined #ruby
[04:51:53] nofxxx: has joined #ruby
[04:54:48] bkxd: has joined #ruby
[04:55:38] bkxd__: has joined #ruby
[05:03:11] tacoboy: has joined #ruby
[05:15:53] bronson: has joined #ruby
[05:16:19] cdg: has joined #ruby
[05:20:05] raspado: has joined #ruby
[05:22:28] pwned: has joined #ruby
[05:24:26] RahulT: has joined #ruby
[05:27:00] guardianxx: has joined #ruby
[05:45:41] tohuw: has joined #ruby
[05:48:44] bkxd: has joined #ruby
[05:48:58] cam27: has joined #ruby
[05:49:06] bkxd_: has joined #ruby
[05:50:58] cagomez: has joined #ruby
[05:58:04] TomyLobo2: has joined #ruby
[06:14:34] hutch34_: has joined #ruby
[06:14:44] minimalism: has joined #ruby
[06:15:31] digitalnomad: has joined #ruby
[06:15:53] minimalism: has joined #ruby
[06:16:43] bronson: has joined #ruby
[06:18:39] jenrzzz: has joined #ruby
[06:22:29] dcluna: has joined #ruby
[06:24:24] milardovich: has joined #ruby
[06:28:18] bkxd__: has joined #ruby
[06:29:23] belmoussaoui__: has joined #ruby
[06:30:04] jenrzzz: has joined #ruby
[06:32:10] bkxd: has joined #ruby
[06:32:50] belmoussaoui__: has joined #ruby
[06:35:35] nhhc: has joined #ruby
[06:35:36] nhhc_: has joined #ruby
[06:38:57] Dimik: has joined #ruby
[06:41:45] normie1: has joined #ruby
[06:49:42] Rr4sT: has joined #ruby
[06:50:44] Ishido: has joined #ruby
[06:51:26] belmoussaoui__: has joined #ruby
[06:52:21] digitalnomad: has joined #ruby
[06:52:52] belmoussaoui__: has joined #ruby
[06:54:14] nocaberi: has joined #ruby
[06:55:06] guardianxx: has joined #ruby
[07:00:17] _whitelogger: has joined #ruby
[07:03:40] charliesome: has joined #ruby
[07:10:05] bkxd_: has joined #ruby
[07:10:18] bkxd___: has joined #ruby
[07:12:46] InfinityFye: has joined #ruby
[07:17:35] bronson: has joined #ruby
[07:20:26] alex``: has joined #ruby
[07:24:13] ltem: has joined #ruby
[07:27:15] belmoussaoui: has joined #ruby
[07:27:55] tAn: has joined #ruby
[07:28:57] hahuang61: has joined #ruby
[07:28:58] milardovich: has joined #ruby
[07:30:32] mudri: has joined #ruby
[07:36:10] djbkd: has joined #ruby
[07:36:40] enterprisey: has joined #ruby
[07:36:46] belmoussaoui: has joined #ruby
[07:39:10] imtar: has joined #ruby
[07:42:07] KeyJoo: has joined #ruby
[07:43:28] enterprisey: has joined #ruby
[07:43:56] newbie36: has joined #ruby
[07:50:30] bkxd: has joined #ruby
[07:51:17] bkxd__: has joined #ruby
[07:51:51] morfin60: interesting
[07:52:01] morfin60: ruby 2.4.1 was fixed?
[07:52:25] morfin60: i mean that uninitialized variables access and other bad things
[07:55:06] apeiros: yes, bad things were fixed in ruby 2.4.1
[07:55:08] ledestin: has joined #ruby
[08:09:13] hutch34_: has joined #ruby
[08:09:40] Ishido: has joined #ruby
[08:12:45] belmoussaoui: has joined #ruby
[08:14:30] tAn: has joined #ruby
[08:17:23] petto: has joined #ruby
[08:18:22] bronson: has joined #ruby
[08:30:00] milardovich: has joined #ruby
[08:32:48] bkxd_: has joined #ruby
[08:32:59] bkxd___: has joined #ruby
[08:35:04] imtar: has joined #ruby
[08:37:51] aupadhye: has joined #ruby
[08:38:20] Ishido: has joined #ruby
[08:41:42] pandaant: has joined #ruby
[08:46:05] belmoussaoui: has joined #ruby
[08:47:04] marr: has joined #ruby
[08:47:49] belmoussaoui: has joined #ruby
[08:57:35] jaruga: has joined #ruby
[09:01:09] ar1a: has joined #ruby
[09:02:30] belmoussaoui: has joined #ruby
[09:03:05] guardianxx: has joined #ruby
[09:10:33] petto: has joined #ruby
[09:11:14] bkxd: has joined #ruby
[09:11:46] bkxd_: has joined #ruby
[09:16:06] pwned: has joined #ruby
[09:16:10] belmoussaoui: has joined #ruby
[09:16:35] matti: has joined #ruby
[09:16:44] high_fiver: has joined #ruby
[09:19:38] bronson: has joined #ruby
[09:21:56] etehtsea: has joined #ruby
[09:22:09] belmoussaoui: has joined #ruby
[09:24:16] hutch34_: has joined #ruby
[09:28:10] belmoussaoui: has joined #ruby
[09:30:44] milardovich: has joined #ruby
[09:30:49] vuoto: has joined #ruby
[09:35:10] ramfjord: has joined #ruby
[09:35:23] mrgrieves: has joined #ruby
[09:36:47] ferr: has joined #ruby
[09:39:16] belmoussaoui: has joined #ruby
[09:39:22] cgfbee: has joined #ruby
[09:51:38] Hanmac: has joined #ruby
[09:55:52] leah2: has joined #ruby
[10:12:42] belmoussaoui: has joined #ruby
[10:20:33] bronson: has joined #ruby
[10:22:47] lxsameer: has joined #ruby
[10:32:03] workmad3: has joined #ruby
[10:40:29] high_fiver: has joined #ruby
[10:50:03] SCHAPiE: has joined #ruby
[11:14:05] roshanavand: has joined #ruby
[11:18:21] lele: has joined #ruby
[11:21:16] bronson: has joined #ruby
[11:23:17] hays: is there a way to select and modify in one sweep
[11:25:22] cadillac_: has joined #ruby
[11:25:43] hutch34_: has joined #ruby
[11:26:32] pavelz_home: has joined #ruby
[11:27:41] oleo: has joined #ruby
[11:31:35] milardovich: has joined #ruby
[11:35:24] ramfjord: has joined #ruby
[11:36:04] uZiel: has joined #ruby
[11:40:02] vuoto: has joined #ruby
[11:46:03] Trynemjoel: has joined #ruby
[11:51:10] _whitelogger: has joined #ruby
[11:51:37] cagomez: has joined #ruby
[11:58:47] RahulT: has joined #ruby
[12:00:42] olivier__: has joined #ruby
[12:03:05] Trynemjoel: has joined #ruby
[12:03:40] GodFather: has joined #ruby
[12:03:48] apparition47: has joined #ruby
[12:09:08] belmoussaoui: has joined #ruby
[12:09:52] Vetaxili: has joined #ruby
[12:09:56] alveric: has joined #ruby
[12:18:31] yeticry_: has joined #ruby
[12:21:49] yeticry: has joined #ruby
[12:22:00] jeffreylevesque_: has joined #ruby
[12:22:06] bronson: has joined #ruby
[12:23:55] mudri: has joined #ruby
[12:24:32] Vetaxili: Hi all. I'm having an issue when using Faraday to post a csv file. It works if all the 'client' code is within one file, but as soon as I split it I get either *undefined method `strip'* or *Unsupported Media Type* http://rubyfiddle.com/riddles/766ab Any ideas?
[12:25:22] Tempesta: has joined #ruby
[12:25:23] im0nde: has joined #ruby
[12:26:06] runescape07rsps: has joined #ruby
[12:31:29] m27frogy: has joined #ruby
[12:32:20] milardovich: has joined #ruby
[12:37:41] herbmillerjr: has joined #ruby
[12:45:12] arcaos: has joined #ruby
[12:50:55] petto: has joined #ruby
[12:52:53] RahulT: has joined #ruby
[12:56:13] Azure: has joined #ruby
[12:59:10] Trynemjoel: has joined #ruby
[13:00:36] Murda: has joined #ruby
[13:05:05] jeffreylevesque_: has joined #ruby
[13:09:33] sleepee: has joined #ruby
[13:13:41] Trynemjoel: has joined #ruby
[13:16:00] fghjb3567: has joined #ruby
[13:19:10] banisterfiend: has joined #ruby
[13:22:55] bronson: has joined #ruby
[13:24:37] flyhigh: has joined #ruby
[13:30:45] milardovich: has joined #ruby
[13:34:31] fghjb3567: has joined #ruby
[13:35:39] ramfjord: has joined #ruby
[13:38:23] petto: has joined #ruby
[13:39:46] ElFerna: has joined #ruby
[13:47:51] Xiti: has joined #ruby
[13:50:00] milardovich: has joined #ruby
[13:50:01] Vetaxili: has joined #ruby
[13:50:55] Vetaxili: I'm having an issue when using Faraday to post a csv file. It works if all the 'client' code is within one file, but as soon as I split it I get either *undefined method `strip'* or *Unsupported Media Type* error http://rubyfiddle.com/riddles/766ab Any ideas?
[13:56:09] mudri: has left #ruby: ("WeeChat 1.9")
[14:01:44] charliesome: has joined #ruby
[14:02:52] charliesome_: has joined #ruby
[14:08:25] t-recx: has joined #ruby
[14:15:00] alex``: has joined #ruby
[14:17:14] hutch34_: has joined #ruby
[14:17:44] flyhigh: has joined #ruby
[14:23:45] bronson: has joined #ruby
[14:24:40] 07EABB6VK: has joined #ruby
[14:34:45] Inoperable: has joined #ruby
[14:38:17] olivier__: has joined #ruby
[14:40:05] iomotoko: has joined #ruby
[14:41:40] olivier__: has joined #ruby
[14:43:13] guardianx: has joined #ruby
[14:43:57] arthurl: has joined #ruby
[14:44:18] ElFerna: has joined #ruby
[14:46:42] cam27: has joined #ruby
[14:47:28] nowhereman: has joined #ruby
[14:47:57] Inoperable: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[14:50:50] arthurl: hi guys- is it possible to sort a hash in ruby?
[14:51:52] charliesome_: has joined #ruby
[14:57:00] romankapitonov: has joined #ruby
[14:58:10] yokel: has joined #ruby
[15:00:53] olivier__: has joined #ruby
[15:02:18] olivier__: has joined #ruby
[15:02:37] ElFerna: has joined #ruby
[15:04:38] weathermaker: has joined #ruby
[15:05:44] Inoperable: has joined #ruby
[15:06:40] ramfjord: has joined #ruby
[15:08:57] alamar: has joined #ruby
[15:15:21] bkxd: has joined #ruby
[15:15:30] milardovich: has joined #ruby
[15:16:05] bkxd_: has joined #ruby
[15:16:58] belmoussaoui: has joined #ruby
[15:17:17] romankapitonov: has joined #ruby
[15:17:40] belmoussaoui: has joined #ruby
[15:18:26] rundor: has joined #ruby
[15:19:27] olivier__: has joined #ruby
[15:20:20] cagomez: has joined #ruby
[15:22:26] havenwood: arthurl: What have you tried?
[15:22:49] arthurl: havenwood disclaimer: I'm not a dev (clearly)- but I feel like i've tried everything
[15:23:13] havenwood: arthurl: If you mean sort by key and return another hash instance: sort.to_h
[15:23:24] vuoto: has joined #ruby
[15:23:36] havenwood: arthurl: You might want to consider whether Hash is the right data structure if you're sorting.
[15:23:54] havenwood: arthurl: But Hashes are ordered.
[15:24:05] havenwood: So technically you can do what it seems you want to.
[15:24:58] bronson: has joined #ruby
[15:26:19] arthurl: havenwood this is what my code and output looks like thus far
[15:26:20] arthurl: https://gist.github.com/alyssenko/168feee33a2d7bf0d8680dcfd186668b
[15:26:31] vuoto: has joined #ruby
[15:26:55] arthurl: and here is the aws doc on the structure http://docs.aws.amazon.com/sdkforruby/api/Aws/RDS/DBSnapshot.html
[15:26:58] vuoto: has joined #ruby
[15:27:22] arthurl: http://docs.aws.amazon.com/sdkforruby/api/Aws/RDS/Client.html#describe_db_snapshots-instance_method
[15:28:01] arthurl: i'd like to sort by snapshot_create_time so i can get the most recent snapshot
[15:29:33] PatrikasZvaigzde: has joined #ruby
[15:30:28] enterprisey: has joined #ruby
[15:32:33] havenwood: arthurl: Consider using #min_by and then not turning it back into a Hash: my_hash.db_snapshots.min_by { |db_snapshot| Date.parse db_snapshot.create_time }.last
[15:33:28] olivier__: has joined #ruby
[15:33:32] havenwood: arthurl: Is it a standard date format? Avoid Date#parse if you can.
[15:33:52] vuoto: has joined #ruby
[15:34:08] arthurl: havenwood according to the AWS docs it's a 'Time' data type
[15:35:19] arthurl: `parse': can't convert Time into String (TypeError)
[15:35:53] havenwood: arthurl: is it iso8601?
[15:36:12] havenwood: arthurl: what does that time string look like?
[15:36:33] havenwood: >> require 'date'; DateTime.iso8601 '2008-09-15T15:53:00' # arthurl
[15:36:34] ruby[bot]: havenwood: # => #<DateTime: 2008-09-15T15:53:00+00:00 ((2454725j,57180s,0n),+0s,2299161j)> (https://eval.in/836242)
[15:36:38] bruno-: has joined #ruby
[15:36:41] hutch34_: has joined #ruby
[15:37:42] arthurl: havenwood it looks like '2017-07-18 06:10:49 UTC'
[15:38:18] konsolebox: has joined #ruby
[15:41:39] bruno-: has joined #ruby
[15:42:35] konsolebox: has joined #ruby
[15:43:12] havenwood: >> require 'date'; DateTime.strptime '2017-07-18 06:10:49 UTC', '%Y-%m-%d %H:%M:%S %Z'
[15:43:14] ruby[bot]: havenwood: # => #<DateTime: 2017-07-18T06:10:49+00:00 ((2457953j,22249s,0n),+0s,2299161j)> (https://eval.in/836243)
[15:44:20] havenwood: &ri DateTime.strptime
[15:44:21] `derpy: http://ruby-doc.org/stdlib-2.4.1/libdoc/date/rdoc/DateTime.html#method-c-strptime
[15:44:46] arthurl: havenwood i'm not sure what i'm looking at :)
[15:45:20] arthurl: so i take it DateTime.strptime is the format i want
[15:45:22] havenwood: arthurl: https://ruby-doc.org/stdlib-2.4.1/libdoc/date/rdoc/DateTime.html#method-i-strftime
[15:47:18] havenwood: arthurl: the format isn't iso8601, jisx0301, rfc3339, rfc2822 or rfc822 so I put together a format string: '%Y-%m-%d %H:%M:%S %Z'
[15:47:32] havenwood: arthurl: Each %-letter is a directive.
[15:48:18] arthurl: right- i think i'm following- just trying to figure out how to tie it back with 'my_hash.db_snapshots.min_by { |db_snapshot| Date.parse db_snapshot.create_time }.last'
[15:48:44] havenwood: my_hash.db_snapshots.min_by { |db_snapshot| DateTime.strptime db_snapshot.create_time, '%Y-%m-%d %H:%M:%S %Z' }.last
[15:51:38] arthurl: i was close :)
[15:51:40] arthurl: hmm still seeing '`parse': can't convert Time into String (TypeError)'
[15:54:32] sleepee: has joined #ruby
[15:56:16] kculpis: has joined #ruby
[16:00:58] PatrikasZvaigzde: has joined #ruby
[16:06:58] AxelAlex: has joined #ruby
[16:07:22] rundor: has joined #ruby
[16:12:08] cdg: has joined #ruby
[16:16:11] havenwood: arthurl: seems you're getting back a Time not a String?
[16:16:34] arthurl: havenwood yes sorry- i thought i said that earlier
[16:16:49] havenwood: so it's already a time, what more to do/
[16:16:50] arthurl: 'according to the AWS docs it's a 'Time' data type'
[16:17:01] AxelAlex: has joined #ruby
[16:18:12] arthurl: well it's still not clear to me on how i go about sorting it
[16:18:14] milardovich: has joined #ruby
[16:18:22] arthurl: my_hash.db_snapshots.min_by { |db_snapshot| Time db_snapshot.create_time }.last gives the same error
[16:19:22] havenwood: arthurl: my_hash.db_snapshots.min_by(&:create_time).last
[16:21:26] arthurl: undefined method `last' for #<Aws::RDS::Types::DBSnapshot:0x007fe7cb3f3ff8> (NoMethodError)
[16:21:37] arthurl: trying 'p my_hash.db_snapshots.min_by(&:snapshot_create_time).last'
[16:23:16] flyhigh: has joined #ruby
[16:24:09] havenwood: arthurl: my_hash.db_snapshots.min_by(&:snapshot_create_time)
[16:24:31] havenwood: arthurl: I thought you'd said it was a Hash, so I was expecting a tuple to be returned. So no #last.
[16:25:34] arthurl: havenwood well i'm storing the response in a hash?
[16:25:46] arthurl: okay so 'p my_hash.db_snapshots.min_by(&:snapshot_create_time)' gives me the OLDEST
[16:25:47] bronson: has joined #ruby
[16:26:07] arthurl: gives me what i need
[16:26:09] havenwood: arthurl: It'd help get answers quicker if you extract a simple testcase example.
[16:26:10] rundor: has joined #ruby
[16:26:24] arthurl: i understand
[16:26:29] havenwood: arthurl: happy coding!
[16:26:33] arthurl: that's easier said than done for someone like me :)
[16:26:37] arthurl: i appreciate your help sir
[16:26:44] havenwood: you're welcome
[16:26:49] A124: has joined #ruby
[16:27:37] belmoussaoui: has joined #ruby
[16:28:36] Ishido: has joined #ruby
[16:29:09] RahulT: has joined #ruby
[16:31:36] roshanavand: has joined #ruby
[16:32:25] ElFerna: has joined #ruby
[16:35:39] olivier__: has joined #ruby
[16:38:48] dstrunk: has joined #ruby
[16:42:45] rundor: has joined #ruby
[16:42:47] armyriad: has joined #ruby
[16:44:27] rundor_: has joined #ruby
[16:50:30] szulak_: has left #ruby: ()
[16:50:33] zachk: has joined #ruby
[16:50:46] SteenJobs_: has joined #ruby
[16:51:11] NightMonkey: has joined #ruby
[16:51:31] z0mbee: has joined #ruby
[16:52:40] ElFerna: has joined #ruby
[16:54:29] ElFerna: has joined #ruby
[16:58:21] Emmanuel_Chanel: has joined #ruby
[17:05:33] quobo: has joined #ruby
[17:07:47] belmoussaoui: has joined #ruby
[17:09:31] grymmjack: has joined #ruby
[17:10:46] digitalnomad: has joined #ruby
[17:12:39] SteenJobs_: has joined #ruby
[17:18:17] oleo: has joined #ruby
[17:20:53] hutch34_: has joined #ruby
[17:21:12] pwned: has joined #ruby
[17:23:20] SteenJobs_: has joined #ruby
[17:25:15] bruno-: has joined #ruby
[17:26:36] bronson: has joined #ruby
[17:35:29] dviola: has joined #ruby
[17:38:24] rundor: has joined #ruby
[17:44:13] cam27: has joined #ruby
[17:47:50] cdg: has joined #ruby
[17:49:33] ledestin: has joined #ruby
[18:03:58] bkxd: has joined #ruby
[18:04:00] bkxd_: has joined #ruby
[18:04:07] romankapitonov: has joined #ruby
[18:13:44] vuoto: has joined #ruby
[18:15:09] vuoto: has joined #ruby
[18:19:03] veex: has joined #ruby
[18:21:19] creaked: has joined #ruby
[18:21:23] rundor: has joined #ruby
[18:21:46] vuoto: has joined #ruby
[18:22:06] SteenJobs_: has joined #ruby
[18:22:19] rundor: has joined #ruby
[18:23:06] rundor: has joined #ruby
[18:23:25] sagax: has joined #ruby
[18:27:26] bronson: has joined #ruby
[18:31:03] romankapitonov: has joined #ruby
[18:32:03] kristofferR: has joined #ruby
[18:34:35] kwesidev: has joined #ruby
[18:36:20] creaked: has joined #ruby
[18:37:44] belmoussaoui: has joined #ruby
[18:37:44] jackjackdripper: has joined #ruby
[18:43:52] cam27: has joined #ruby
[18:46:34] vuoto: has joined #ruby
[18:58:23] AxelAlex: has joined #ruby
[19:01:23] jackjackdripper: has joined #ruby
[19:03:03] Rodya_: has joined #ruby
[19:03:50] NightMonkey: has joined #ruby
[19:06:59] KeyJoo: has joined #ruby
[19:07:16] cdg_: has joined #ruby
[19:07:31] belmoussaoui: has joined #ruby
[19:07:54] romankapitonov: has joined #ruby
[19:08:35] olivier__: has joined #ruby
[19:10:02] olivier__: has joined #ruby
[19:10:14] futilegames: has joined #ruby
[19:10:58] futilegames: has left #ruby: ()
[19:17:47] vuoto: has joined #ruby
[19:20:58] AX31_A13X: has joined #ruby
[19:23:39] rundor: has joined #ruby
[19:24:26] tohuw: has joined #ruby
[19:25:40] S1kx: has joined #ruby
[19:26:16] belmoussaoui: has joined #ruby
[19:27:45] belmoussaoui: has joined #ruby
[19:28:16] bronson: has joined #ruby
[19:31:58] Guest2855: has joined #ruby
[19:37:21] belmoussaoui: has joined #ruby
[19:41:19] emers2n: has joined #ruby
[19:48:35] tAn: has joined #ruby
[19:55:04] belmoussaoui: has joined #ruby
[19:58:01] belmoussaoui: has joined #ruby
[20:01:26] rundor: has joined #ruby
[20:02:16] rundor: has joined #ruby
[20:03:02] rundor: has joined #ruby
[20:03:50] rundor: has joined #ruby
[20:04:40] rundor: has joined #ruby
[20:05:29] RahulT: has joined #ruby
[20:05:32] hutch34_: has joined #ruby
[20:10:02] bruno-: has joined #ruby
[20:12:33] Murda: has joined #ruby
[20:30:57] dstrunk: has joined #ruby
[20:35:11] TheBloke: has joined #ruby
[20:36:30] enterprisey: has joined #ruby
[20:36:49] eb0t: has joined #ruby
[20:37:26] reaVer: has joined #ruby
[20:40:57] belmoussaoui: has joined #ruby
[20:45:52] dionysus69: has joined #ruby
[20:46:26] Moosashi: has joined #ruby
[20:54:41] mathys: has joined #ruby
[20:56:13] bruno-_: has joined #ruby
[21:01:57] high_fiver: has joined #ruby
[21:08:40] Rodya_: has joined #ruby
[21:09:48] cdg: has joined #ruby
[21:12:04] romankapitonov: has joined #ruby
[21:14:43] imtar: has joined #ruby
[21:23:47] digitalnomad: has joined #ruby
[21:27:00] haylon: has joined #ruby
[21:27:15] haylon: has joined #ruby
[21:29:10] bronson: has joined #ruby
[21:33:47] Moosashi: has joined #ruby
[21:33:58] SteenJobs_: has joined #ruby
[21:38:50] SteenJobs_: has joined #ruby
[21:50:11] tAn: has joined #ruby
[21:50:44] firebird: has joined #ruby
[21:56:57] romankapitonov: has joined #ruby
[21:57:28] bkxd: has joined #ruby
[21:57:29] bkxd_: has joined #ruby
[22:00:51] olivier__: has joined #ruby
[22:04:21] GodFather_: has joined #ruby
[22:06:02] tohuw: gsub! will modify the string in place, whereas gsub will create a new string, correct?
[22:08:37] enterprisey: has joined #ruby
[22:11:02] cdg: has joined #ruby
[22:12:25] Hanmac: has joined #ruby
[22:16:35] al2o3-cr: Tohuw: correct
[22:17:09] tohuw: al2o3-cr thanks! Playing around with it a few minutes helped me understand why what I originally wanted to do wouldn't work.
[22:18:42] kkiero: has joined #ruby
[22:25:35] GodFather_: has joined #ruby
[22:29:42] romankapitonov: has joined #ruby
[22:30:22] bronson: has joined #ruby
[22:32:18] high_fiver_: has joined #ruby
[22:35:48] ResidentBiscuit: has joined #ruby
[22:39:55] bruno-: has joined #ruby
[22:41:48] hutch34_: has joined #ruby
[22:43:16] jaruga: has joined #ruby
[22:48:19] brent__: has joined #ruby
[22:50:12] deep-book-gk_: has joined #ruby
[22:50:14] LiquidInsect: has joined #ruby
[22:51:34] deep-book-gk_: has left #ruby: ()
[23:00:12] cdg: has joined #ruby
[23:02:08] ramfjord: has joined #ruby
[23:04:36] tAn: has joined #ruby
[23:08:00] ecuanaso: has joined #ruby
[23:09:51] SteenJobs_: has joined #ruby
[23:12:55] hutch34_: has joined #ruby
[23:18:24] Emmanuel_Chanel: has joined #ruby
[23:22:39] armyriad: has joined #ruby
[23:24:12] veex: has joined #ruby
[23:27:36] milardovich: has joined #ruby
[23:27:37] cadillac_: has joined #ruby
[23:31:14] bronson: has joined #ruby
[23:33:18] kiltzman: has joined #ruby
[23:34:29] ruby[bot]: -b Guest62604!*@*$#ruby-banned
[23:34:59] Moosashi: has joined #ruby
[23:36:19] armyriad: has joined #ruby
[23:40:56] imtar: has joined #ruby
[23:41:48] RahulT: has joined #ruby
[23:42:30] alveric1: has joined #ruby
[23:42:48] sleepee: has joined #ruby
[23:49:52] Bhootrk_: has joined #ruby