« Back to channel list

#ruby - 16 December 2017

« Back 1 day Forward 1 day »
[00:00:06] nymous: not what?
[00:00:50] ltp: has joined #ruby
[00:01:01] al2o3-cr: ... is variadic in lua
[00:01:27] al2o3-cr: a shit ton of artiy
[00:01:35] eckhardt: has joined #ruby
[00:02:15] guardianx: has joined #ruby
[00:02:18] jrabe: has joined #ruby
[00:03:28] nymous: what about perl? it doesn't have function prototypes at all
[00:03:36] nymous: perl5 at least
[00:03:50] stephh: has joined #ruby
[00:04:58] nymous: start your funcs with things like my (arg, arg, arg) = @_;
[00:05:03] nymous: kind of fun actually
[00:05:35] al2o3-cr: never dabbled in perl
[00:06:18] nymous: oh, it's a cool language
[00:06:41] Riddell: has joined #ruby
[00:06:56] al2o3-cr: probably is
[00:07:43] alex``: has joined #ruby
[00:08:09] nymous: it doesn't have OOP, but you can act like it is
[00:08:26] nymous: you can bless vars lol
[00:08:48] nymous: i bless you to became an array
[00:08:56] al2o3-cr: lua doesn't have OOP but too can act like it
[00:09:23] cadillac_: has joined #ruby
[00:09:26] al2o3-cr: lua is cool
[00:09:57] ar: nymous: oh, but perl5 *does* have subroutine signatures. since 5.20
[00:10:24] nymous: i have less experience with lua than with perl
[00:11:02] nymous: ar: damn, my book was about 5.8, and i think I have ended writting anything complex at the time of 5.14 or so
[00:11:27] al2o3-cr: with lua there is only one container and that is tables. (oh and chairs lol)
[00:11:52] ar: nymous: it's still experimental
[00:13:06] al2o3-cr: if you ever pop in #lua don't mention 5.3
[00:13:10] nymous: anyways i have used black magic of perl to make Ansys CFX macroses look like OO programs
[00:13:15] nymous: that was fun
[00:14:19] al2o3-cr: nymous: what black magic?
[00:14:45] stephh: has joined #ruby
[00:15:04] nymous: well, look at https://www.sharcnet.ca/Software/Ansys/16.2.3/en-us/help/cfd_post/i1305070.html
[00:15:19] nymous: see how their macro looks like
[00:16:09] al2o3-cr: nymous: you got the ruby love?
[00:17:13] nymous: their macroses are strange mix of perl code and CFX definition langauge
[00:17:36] al2o3-cr: nymous: you code ruby?
[00:17:43] nymous: i made it fully perl with OO like objects with methods and stuff
[00:18:16] al2o3-cr: nymous: yeah, but ruby right?
[00:18:17] nymous: the black magic was in evaluation of perl code into CFX definitions via kernel hack
[00:18:49] eckhardt: has joined #ruby
[00:19:00] al2o3-cr: ACTION i'll speak that brick wall instead, i might get more sense out of it
[00:19:23] nymous: i'm a sysadmin, i code many languages on demand
[00:19:34] nymous: yes, i currently more in love with ruby
[00:20:01] al2o3-cr: i'm sure that's a keyword in python
[00:20:18] al2o3-cr: nymous: may i ask why?
[00:20:29] nymous: why what?
[00:20:40] al2o3-cr: forget it :)
[00:20:45] mim1k: has joined #ruby
[00:20:46] nymous: i'm in love with ruby you mean?
[00:21:04] nymous: because of it's dynamical nature
[00:21:24] al2o3-cr: perl's dynamic
[00:21:33] nymous: it's kind of perl on steroids
[00:22:03] nymous: perl is not OO, in ruby everything is OO
[00:22:07] al2o3-cr: yeah, it's been to gym alright.
[00:22:39] nymous: with reflections, monkey patching etc
[00:22:55] nymous: and also the syntactic sugar
[00:23:00] al2o3-cr: yeah refinements are a thing now.
[00:23:31] nymous: but unfortunately it's not that fast
[00:23:42] al2o3-cr: nymous: compared to what?
[00:23:42] nymous: in some cases perl is ten times faster
[00:23:52] nymous: even in simple scripts
[00:24:06] nymous: i mean without loads of gems
[00:24:26] nymous: loads of CPAN modules makes perl suffer too
[00:24:36] DmitryBochkarev: has joined #ruby
[00:24:45] al2o3-cr: nymous: what ruby version you using?
[00:25:04] DTZUZO: has joined #ruby
[00:25:29] al2o3-cr: nymous: ok.
[00:25:39] uZiel: has joined #ruby
[00:25:40] nymous: something what we have in a base distro
[00:26:01] nymous: 2.1.5p273 on my servers
[00:26:12] al2o3-cr: i'll pull a moony in front of the queen if perl is 10x faster hahaha
[00:26:18] nymous: 2.4.2p198 at my pc
[00:27:02] nymous: perl is really fast in filtering text files, something near to grep or so
[00:27:21] al2o3-cr: show me proof now
[00:27:46] nymous: i've tried to write a ruby code for same task, it was 2-4x times slower
[00:27:51] eb0t: has joined #ruby
[00:27:56] al2o3-cr: show me proof?
[00:28:19] nymous: well, that's just my experience, i can't generate you a 70 GB text file on demand
[00:28:44] al2o3-cr: course you can
[00:29:06] DmitryBochkarev: has joined #ruby
[00:29:31] nymous: well, i can generate it up to 15 TB, but that's commercial stuff, i can't share it
[00:30:04] al2o3-cr: well generate 70gb then
[00:30:56] nymous: it doesn't really matter though
[00:32:20] al2o3-cr: well prove perl is 10x faster then ruby
[00:32:34] al2o3-cr: in a simple script with 70gb data
[00:33:10] al2o3-cr: test on 2.1 if you want
[00:33:28] bkxd: has joined #ruby
[00:33:46] Mudstart: has joined #ruby
[00:34:58] nymous: well, generating 70 gb file would take really long
[00:35:13] nymous: i might try 5 gb or so
[00:35:50] Mudstart: has joined #ruby
[00:37:04] al2o3-cr: not that long on a decent ssd
[00:37:46] bkxd_: has joined #ruby
[00:38:12] leitz: Is there a way to capitalize the first character of each string that comes from an array.join() This isn't working: "Traits: #{character.traits.join(', ').capitalize}"
[00:38:58] leitz: Tried "each" in there as well. Each array item is a lower case string.
[00:39:16] al2o3-cr: leitz: what does character.traits return?
[00:41:41] leitz: al2o3-cr, an array of two strings.
[00:41:42] al2o3-cr: leitz: you probably wan character.traits.map(&:captitalize).join(', ')
[00:41:47] alfiemax: has joined #ruby
[00:42:49] leitz: al2o3-cr, that works, though I'm going to have to study it to understand it.
[00:43:40] al2o3-cr: >> ["foo", "bar"].map(&:capitalize)
[00:43:41] ruby[bot]: al2o3-cr: # => ["Foo", "Bar"] (https://eval.in/920057)
[00:44:05] al2o3-cr: >> ["foo", "bar"].map { |string| string.capitalize }
[00:44:07] ruby[bot]: al2o3-cr: # => ["Foo", "Bar"] (https://eval.in/920058)
[00:44:40] al2o3-cr: leitz: it's short hand for latter.
[00:45:01] leitz: al2o3-cr, so the & is a placeholder for each item in the array?
[00:45:02] al2o3-cr: basically it's Symbol#to_proc
[00:45:31] al2o3-cr: >> :capitalize.to_proc
[00:45:32] ruby[bot]: al2o3-cr: # => #<Proc:0x4103dc98(&:capitalize)> (https://eval.in/920060)
[00:45:42] al2o3-cr: >> :capitalize.to_proc.yield("a")
[00:45:43] ruby[bot]: al2o3-cr: # => "A" (https://eval.in/920061)
[00:45:52] leitz: Hmmmm...going to have to let this one sink in.
[00:47:16] c0dy: has joined #ruby
[00:47:19] al2o3-cr: perl is 10x faster, i'm still laughing my tits off
[00:48:01] leitz: Glad I missed that one.
[00:48:10] alfiemax: has joined #ruby
[00:50:39] johnpaul: has joined #ruby
[00:52:44] jxv: has joined #ruby
[00:52:46] leitz: And my tests failed; yay!
[00:53:58] leitz: Glad the code change was detected by the tests. Can't say that's a great code coverage tool but it's nice.
[00:56:06] dinfuehr: has joined #ruby
[00:56:18] nymous: 5GB JSON file
[00:56:35] nymous: same task - just count how many keys an object have
[00:56:41] d^sh: has joined #ruby
[00:56:45] nymous: perl: 0m42.859s
[00:56:51] nymous: ruby: 1m37.418s
[00:58:09] al2o3-cr: 1) that no where near 10x faster 2) show me how you tested?
[00:58:15] leitz: Yeah, but I wouldn't touch Perl with al2o3-cr 's keyboard.
[00:58:22] nymous: https://gist.github.com/divanikus/332a55d83f0fc86b492d77f058943fd5
[00:59:10] nymous: well, 10x was just a figure of speech
[00:59:24] nymous: but as you see, perl is kind of faster, at least 2x
[00:59:48] charliesome: has joined #ruby
[01:00:13] al2o3-cr: show me the benchmarks
[01:00:22] nymous: the link above
[01:00:27] nymous: run with time
[01:01:11] nymous: i do not have time to code anything more complex
[01:01:18] nymous: it's 4 am here already
[01:02:14] nymous: time ./test.pl < mybig.json > /dev/null
[01:02:24] nymous: that's how i've tested it
[01:04:35] jdawgaz: has joined #ruby
[01:05:25] nymous: ok, it might just mean that perl's json parser is faster, but i've tried a gem with native binary, it was also slower than perl's
[01:05:45] nymous: on more complex actions than this one i got even worse performance
[01:05:53] jxv: has joined #ruby
[01:06:52] al2o3-cr: use perl then
[01:07:14] nymous: for such task - yes, it might be worth it
[01:07:24] mikecmpbll: has joined #ruby
[01:08:00] nymous: even though ruby code is cleaner and less crippled
[01:08:18] al2o3-cr: how did you generate that 5gb json?
[01:08:32] nymous: it's a dump of elasticsearch index
[01:08:51] nymous: elasticsearch index is 90 gb or so
[01:09:08] nymous: it's just an extract
[01:09:54] nymous: we can now use jq for that, so...
[01:10:35] leitz: I'm pretty sure Matz doesn't claim Ruby to be the fastest language. Fun, however....
[01:11:25] nymous: i'm agree with Matz on saying that ruby allows you to write clean working code faster than others
[01:11:44] havenwood: Here's an interesting JSON benchmark: https://github.com/kostya/benchmarks#json
[01:12:04] nymous: or something like, what he was intended to create when he was planning ruby
[01:13:06] nymous: for many tasks ruby is just fast enough
[01:15:44] QualityAddict: has joined #ruby
[01:16:05] milardovich: has joined #ruby
[01:17:05] webguynow: has joined #ruby
[01:18:26] alfiemax: has joined #ruby
[01:20:00] leitz: Ruby is the one language that makes me want to read the refernece material.
[01:20:16] leitz: And eventaully learn to spell reference.
[01:25:48] babblebre: has joined #ruby
[01:31:31] jdawgaz: has joined #ruby
[01:32:16] jdawgaz: has joined #ruby
[01:32:47] nymous: would that be a bad design or too much magic? https://gist.github.com/divanikus/556ce02db0272545aa9077c1e92a779d
[01:33:06] jdawgaz: has joined #ruby
[01:33:51] jdawgaz: has joined #ruby
[01:34:40] jdawgaz: has joined #ruby
[01:35:04] bmurt: has joined #ruby
[01:35:30] jdawgaz: has joined #ruby
[01:36:23] leitz: Later, all.
[01:36:59] milardovich: has joined #ruby
[01:40:31] havenwood: just got back - and bad timing, since i wanted to show how to make that gist faster
[01:46:35] havenwood: nymous: you want the first word of each line?
[01:46:45] havenwood: nymous: will the lines always start with a non-whitespace char?
[01:47:12] nymous: i'm not quite following
[01:47:25] jdawgaz: has joined #ruby
[01:47:38] nymous: are you about json?
[01:47:55] havenwood: nymous: I was asking about the smartctl command output you're parsing
[01:48:25] stephh: has joined #ruby
[01:48:52] nymous: it prints something like that /dev/sda -d sat # /dev/sda [SAT], ATA device
[01:49:13] havenwood: nymous: for example, this would return an array of lines that started with non-whitespace chars: `sudo smartctl --scan-open`.scan /^\S+/
[01:49:21] nopolitica: has joined #ruby
[01:49:50] nymous: yeah, nicer, thanks
[01:49:59] nymous: *looks nicer
[01:50:10] havenwood: just because of the Regexp I used it'd not match lines that started with whitespace
[01:50:21] havenwood: but yeah, it's more concise and a lot faster and uses less memory
[01:50:43] havenwood: nymous: #scan is handy
[01:58:20] eckhardt: has joined #ruby
[02:01:17] k0mpa: has joined #ruby
[02:01:36] alfiemax: has joined #ruby
[02:02:58] jdawgaz: has joined #ruby
[02:03:21] stephh: has joined #ruby
[02:04:32] stephh: has joined #ruby
[02:07:08] noobineer: has joined #ruby
[02:08:17] steph__: has joined #ruby
[02:12:12] kryptoz: has joined #ruby
[02:15:48] shinnya: has joined #ruby
[02:17:14] jxv: has joined #ruby
[02:23:15] jdawgaz: has joined #ruby
[02:30:10] milardovich: has joined #ruby
[02:31:00] bkxd: has joined #ruby
[02:31:49] bkxd: has joined #ruby
[02:33:17] houhoulis: has joined #ruby
[02:41:06] ramfjord: has joined #ruby
[02:41:22] xco: has joined #ruby
[02:42:36] gizmore|2: has joined #ruby
[02:43:20] d^sh: has joined #ruby
[02:45:28] milardovich: has joined #ruby
[02:47:32] Technodrome: has joined #ruby
[02:52:52] alfiemax: has joined #ruby
[02:56:43] ramfjord: has joined #ruby
[02:57:21] uZiel: has joined #ruby
[03:00:18] cadillac_: has joined #ruby
[03:09:07] bkxd_: has joined #ruby
[03:10:10] bkxd_: has joined #ruby
[03:11:25] trolltoll: has joined #ruby
[03:18:08] bmurt: has joined #ruby
[03:29:25] stephh: has joined #ruby
[03:30:10] konsolebox: has joined #ruby
[03:30:11] jdawgaz: has joined #ruby
[03:30:12] meesles: has joined #ruby
[03:30:47] charliesome: has joined #ruby
[03:31:07] Jameser: has joined #ruby
[03:43:25] babblebre: has left #ruby: ()
[03:49:22] mtkd: has joined #ruby
[03:50:20] cdg: has joined #ruby
[03:50:52] nopolitica: has joined #ruby
[03:51:30] JJonah: has joined #ruby
[03:55:52] jdawgaz: has joined #ruby
[03:56:32] bmurt: has joined #ruby
[03:56:42] jdawgaz: has joined #ruby
[03:57:10] kryptoz: has joined #ruby
[04:01:27] eckhardt: has joined #ruby
[04:01:38] bkxd: has joined #ruby
[04:05:51] faces: has joined #ruby
[04:09:37] priodev: has joined #ruby
[04:22:44] alfiemax: has joined #ruby
[04:23:26] gix: has joined #ruby
[04:24:19] kryptoz: has joined #ruby
[04:42:56] cloaked1: has joined #ruby
[04:42:57] bkxd: has joined #ruby
[04:45:30] plexigras: has joined #ruby
[04:48:08] nofxx: has joined #ruby
[04:48:53] twrk: has joined #ruby
[04:50:13] LocaMocha: has joined #ruby
[04:51:18] mostlybadfly: has joined #ruby
[04:51:41] nopolitica: has joined #ruby
[04:53:45] LocaMocha: has joined #ruby
[04:54:05] bkxd_: has joined #ruby
[05:03:12] ShekharReddy: has joined #ruby
[05:03:33] bkxd: has joined #ruby
[05:10:31] cschneid_: has joined #ruby
[05:14:06] astronavt: has joined #ruby
[05:14:24] alfiemax: has joined #ruby
[05:14:34] jamesaxl: has joined #ruby
[05:17:24] eb0t: has joined #ruby
[05:17:28] milardovich: has joined #ruby
[05:18:20] pastorinni: has joined #ruby
[05:20:10] oncall-pokemon: has joined #ruby
[05:30:48] ozzloy_: has joined #ruby
[05:30:52] Kero_: has joined #ruby
[05:31:17] char_var[buffer]: has joined #ruby
[05:31:39] [reed]: has joined #ruby
[05:31:39] [reed]: has joined #ruby
[05:32:18] char_var[buffer]: has joined #ruby
[05:34:47] dreamthese: has joined #ruby
[05:36:06] bkxd_: has joined #ruby
[05:36:56] bkxd_: has joined #ruby
[05:39:33] bkxd: has joined #ruby
[05:46:03] shinnya: has joined #ruby
[05:49:41] Azure|dc: has joined #ruby
[05:52:33] nopolitica: has joined #ruby
[05:53:16] gix: has joined #ruby
[05:53:44] bkxd: has joined #ruby
[05:58:03] kapil___: has joined #ruby
[05:58:21] nathani1: has joined #ruby
[05:58:24] ahrs: has joined #ruby
[06:01:24] bkxd: has joined #ruby
[06:03:25] spider-mario: has joined #ruby
[06:15:00] alfiemax: has joined #ruby
[06:17:20] anisha: has joined #ruby
[06:26:21] rippa: has joined #ruby
[06:30:32] anisha: has joined #ruby
[06:34:14] dionysus69: has joined #ruby
[06:35:02] blindMoe: has joined #ruby
[06:35:55] kryptoz: has joined #ruby
[06:35:56] blindMoe: Spending time tonight upgrading rubocop on one of my apps and am running into an error where it says that this line should be delimited by `[` and `]`. I am not sure what it is asking for, anyone mind helping? %w(jpg jpeg gif png)
[06:37:24] blindMoe: seems like it wants %w[jpg jpeg gif png] but I have never used %w[ before
[06:42:06] Nilium: Stuff like %w, %r, etc. can be done with [, {, (, etc.
[06:42:23] Nilium: rubocop likely wants you to only use []
[06:44:12] Emmanuel_Chanel: has joined #ruby
[06:49:21] enterprisey: has joined #ruby
[06:50:32] cdg: has joined #ruby
[06:53:07] jnollette: has joined #ruby
[06:53:10] nopolitica: has joined #ruby
[06:53:13] aiguuu: has joined #ruby
[06:53:50] alfiemax: has joined #ruby
[07:02:28] KeyJoo: has joined #ruby
[07:02:41] DmitryBochkarev: has joined #ruby
[07:24:23] reber: has joined #ruby
[07:37:12] minimalism: has joined #ruby
[07:37:27] dinfuehr: has joined #ruby
[07:41:02] _aeris_: has joined #ruby
[07:45:35] FiendKing04: has joined #ruby
[07:47:44] n13z: has joined #ruby
[07:56:25] cadillac_: has joined #ruby
[08:07:23] n13z_: has joined #ruby
[08:09:01] alex``: has joined #ruby
[08:09:45] Puffball: has joined #ruby
[08:15:44] n13z: has joined #ruby
[08:23:34] peelz_: has joined #ruby
[08:24:24] craysiii: https://gist.github.com/craysiii/2e73564cb46dee10195fc78f3e4bfb8f So i'm trying to integrate typheous into a gem of mine, and im on windows. when i run "gem install typheous" it installs just fine, but when i add it to my gemspec and run "bundle install" bundler says it could not find a compatible version. what am i missing here?
[08:25:49] claudiuinberlin: has joined #ruby
[08:26:57] peelz_: has left #ruby: ()
[08:30:38] therealGent: has joined #ruby
[08:31:10] dviola: has joined #ruby
[08:47:57] Exhiled: has joined #ruby
[08:48:31] blindMoe: has joined #ruby
[08:48:31] blindMoe: has joined #ruby
[08:49:16] cadillac_: has joined #ruby
[08:49:28] Azure: has joined #ruby
[08:52:29] alfiemax: has joined #ruby
[08:52:38] eblip: has joined #ruby
[08:54:57] nopolitica: has joined #ruby
[08:55:02] d^sh: has joined #ruby
[08:56:23] burgestrand: has joined #ruby
[08:57:59] blindMoe: has joined #ruby
[08:58:00] blindMoe: has joined #ruby
[09:02:20] konsolebox: has joined #ruby
[09:25:42] Riddell: has joined #ruby
[09:29:01] cadillac_: has joined #ruby
[09:30:24] blindMoe: has joined #ruby
[09:30:24] blindMoe: has joined #ruby
[09:31:49] clemens3: has joined #ruby
[09:39:58] marr: has joined #ruby
[09:44:54] tvw: has joined #ruby
[09:55:30] nopolitica: has joined #ruby
[09:55:36] alfiemax: has joined #ruby
[09:59:23] tomphp: has joined #ruby
[10:04:17] tomphp: has joined #ruby
[10:06:17] alfiemax: has joined #ruby
[10:09:36] blindMoe: has joined #ruby
[10:09:37] blindMoe: has joined #ruby
[10:20:19] _aeris_: has joined #ruby
[10:24:04] blindMoe: has joined #ruby
[10:24:04] blindMoe: has joined #ruby
[10:24:40] uZiel: has joined #ruby
[10:25:35] alfiemax: has joined #ruby
[10:31:46] enterprisey: has joined #ruby
[10:35:05] mikecmpbll: has joined #ruby
[10:42:33] mikecmpb_: has joined #ruby
[10:48:29] iamarun: has joined #ruby
[10:50:27] JaccoP: has joined #ruby
[10:51:51] TomyLobo: has joined #ruby
[10:56:35] nopolitica: has joined #ruby
[10:56:42] al2o3-cr: has joined #ruby
[10:57:11] yeticry: has joined #ruby
[10:58:51] despai: has joined #ruby
[11:00:39] RougeT430: has joined #ruby
[11:01:38] blindMoe: has joined #ruby
[11:01:38] blindMoe: has joined #ruby
[11:02:51] bhaak: has joined #ruby
[11:10:57] jnyw: has joined #ruby
[11:13:01] yeticry: has joined #ruby
[11:14:31] alfiemax: has joined #ruby
[11:19:56] elisaado: apeiros: it works now!
[11:20:08] elisaado: I'm using a database lol
[11:25:41] RougeT430: has joined #ruby
[11:27:20] hfp_work: has joined #ruby
[11:37:30] ldepandis: has joined #ruby
[11:38:16] GodFather: has joined #ruby
[11:38:31] workmad3: has joined #ruby
[11:43:12] nopolitica: has joined #ruby
[11:46:57] mikecmpbll: has joined #ruby
[11:48:35] blindMoe: has joined #ruby
[11:48:35] blindMoe: has joined #ruby
[11:53:30] Rr4sT: has joined #ruby
[11:57:11] _whitelogger: has joined #ruby
[11:57:46] uZiel: has joined #ruby
[11:59:36] d^sh: has joined #ruby
[12:00:05] amatas: has joined #ruby
[12:00:44] jdawgaz: has joined #ruby
[12:02:09] sameerynho: has joined #ruby
[12:03:17] selim: has joined #ruby
[12:11:36] amatas: has joined #ruby
[12:14:05] alfiemax: has joined #ruby
[12:17:36] bkxd: has joined #ruby
[12:25:02] blindMoe: has joined #ruby
[12:25:02] blindMoe: has joined #ruby
[12:25:45] alfiemax: has joined #ruby
[12:26:48] AJA4350: has joined #ruby
[12:27:06] remix2000: has joined #ruby
[12:28:01] alfiemax: has joined #ruby
[12:37:30] mikecmpb_: has joined #ruby
[12:39:11] bkxd_: has joined #ruby
[12:41:18] mikecmpbll: has joined #ruby
[12:42:25] Ishido: has joined #ruby
[12:44:19] VladGh: has joined #ruby
[12:46:29] blindMoe: has joined #ruby
[12:46:29] blindMoe: has joined #ruby
[13:05:26] moei: has joined #ruby
[13:07:57] vtx: has joined #ruby
[13:16:22] zautomata: has joined #ruby
[13:19:22] Jameser: has joined #ruby
[13:20:09] bmurt: has joined #ruby
[13:22:09] despai: has joined #ruby
[13:26:37] jdawgaz: has joined #ruby
[13:27:00] DTZUZO: has joined #ruby
[13:28:16] uZiel: has joined #ruby
[13:28:25] vtx_: has joined #ruby
[13:32:36] mikecmpbll: has joined #ruby
[13:34:33] leitz: has joined #ruby
[13:34:39] dinfuehr: has joined #ruby
[13:41:03] shaileshg: has joined #ruby
[13:47:00] vichib: has joined #ruby
[13:52:15] zanshin: has joined #ruby
[13:55:34] vichibit: has joined #ruby
[13:58:50] herbmillerjr: has joined #ruby
[14:00:41] dinfuehr: has joined #ruby
[14:01:08] jerryskye: has joined #ruby
[14:04:29] Rutix: has joined #ruby
[14:04:29] Rutix: has joined #ruby
[14:06:01] alex``: has joined #ruby
[14:09:01] kapil___: has joined #ruby
[14:12:29] charliesome: has joined #ruby
[14:13:15] JaccoP: has joined #ruby
[14:16:00] remix2000: has joined #ruby
[14:20:37] xco: has joined #ruby
[14:21:08] blindMoe: has joined #ruby
[14:21:09] blindMoe: has joined #ruby
[14:23:55] c0dy: has joined #ruby
[14:32:37] blindMoe: has joined #ruby
[14:32:37] blindMoe: has joined #ruby
[14:37:48] ahrs: has joined #ruby
[14:42:21] Guest76443: has joined #ruby
[14:54:02] _aeris_: has joined #ruby
[14:58:19] Guest76443: I'm looking for a regexp for the following string: "London, the 12.12.17". The result should be: "London 12.12.17". This regexp "^\w*" gives me "London" and "\d.{1,9}" gives me "12.12.17" How can I combine them together?
[14:58:50] despai: has joined #ruby
[14:59:58] oleo: has joined #ruby
[14:59:59] oleo: has joined #ruby
[15:02:28] dminuoso: &ri MatchData Guest76443
[15:02:28] `derpy: Guest76443: http://ruby-doc.org/core-2.4.1/MatchData.html
[15:02:56] dminuoso: You can also use gsub with magical \ things
[15:04:35] dminuoso: Or actually.. gsub wont help you that much.
[15:04:59] dminuoso: You can also use .delete depending on what you do
[15:07:46] charliesome: has joined #ruby
[15:08:34] sameerynho: has joined #ruby
[15:09:06] tokudan[m]: has joined #ruby
[15:14:45] tokudan[m]: hi, i got a problem with data validation in ruby where i need to verify that a value has a specific type. Problem is that the "case" is too intelligent and instead of comparing the values, tries to check if that variable has a specific class: https://gist.github.com/tokudan/a3b2ac29d195bdddf560004d2c252027
[15:16:48] blindMoe: has joined #ruby
[15:16:48] blindMoe: has joined #ruby
[15:18:00] tokudan[m]: do I have to use a mapping of :string => String in a hash just to be able to use value.kind_of? or is there any way of making case or a similar construct work there?
[15:18:18] uZiel: has joined #ruby
[15:20:40] dminuoso: tokudan[m]: case uses ===
[15:21:20] dminuoso: tokudan[m]: case foo; when blah; ...; when quux; end first tests: `blah === foo`, then `quux === foo` until something matches.
[15:22:27] rippa: has joined #ruby
[15:22:46] tokudan[m]: ok, so how can I check if the class I've been given in the variable requirement is the class String?
[15:23:05] dminuoso: tokudan[m]: you can use a different form of case (or if/elsif)
[15:23:39] dminuoso: tokudan[m]: https://gist.github.com/dminuoso/989f99bfd7683b22b58b9e10e4af6083
[15:24:46] blindMoe: has joined #ruby
[15:24:46] blindMoe: has joined #ruby
[15:25:16] tokudan[m]: it works if i use case when required == String
[15:26:12] dminuoso: Err. I meant to use == sorry.
[15:26:15] dminuoso: Too much JS recently.
[15:26:34] tokudan[m]: thanks for the help dminuoso :)
[15:26:47] quobo: has joined #ruby
[15:26:50] dminuoso: tokudan[m]: That code you just showed me is a code smell.
[15:26:58] dminuoso: You shouldn't want to do this.
[15:28:42] tokudan[m]: hmm... basically I'm digging into JSON there and just use it to ensure I've got some reasonable data back. e.g. a string where i expect a string. a float where i expect a float, etc.
[15:29:45] tokudan[m]: and the function I'm writing is roughly "get me the data from that path and ensure it's a Float" and if it isn't, just give me back a default float
[15:30:20] tokudan[m]: i don't have a better idea to write that
[15:33:13] dminuoso: tokudan[m]: Fair enough. That's probably one of the few spots to be explicitly checking for classes. :)
[15:34:08] dminuoso: tokudan[m]: Though you could just describe the layout as some sample data, and check that the type structure amtches
[15:35:15] tokudan[m]: i tried that... it's a nightmare with this data source :(
[15:36:32] tokudan[m]: besides i had one of the data node suddenly contain a string somewhere instead of an integer.
[15:42:03] JaccoP: has joined #ruby
[15:42:10] nicesignal: has joined #ruby
[15:52:29] xco: has joined #ruby
[15:58:51] goepsilongo: has joined #ruby
[16:00:35] mtkd: has joined #ruby
[16:05:02] despai: has joined #ruby
[16:05:50] mikhael_k33hl: has joined #ruby
[16:06:02] mikhael_k33hl: Anyone using Jenkins? May I ask for how you built your piple for ruby CI?
[16:16:35] blindMoe: has joined #ruby
[16:16:35] blindMoe: has joined #ruby
[16:24:11] alfiemax: has joined #ruby
[16:25:17] RougeT430: https://gist.github.com/CodePint/24eea7a630d0bd6be0a9bb6719065b39
[16:25:24] RougeT430: can anyone give me a hand with this again
[16:25:32] herbmillerjr: has joined #ruby
[16:25:47] RougeT430: trying to assign the result of attack_choice to a variable
[16:32:22] blindMoe: has joined #ruby
[16:32:22] blindMoe: has joined #ruby
[16:34:06] dminuoso: RougeT430: Please edit your gist and give the file a suffix for syntax highlighting.
[16:34:15] chocoelho: has joined #ruby
[16:35:00] mikecmpb_: has joined #ruby
[16:36:19] havenwood: RougeT430: #puts returns `nil`, no matter what it printed
[16:37:32] RougeT430: i think ive sorted help from a friend. ive updated syntax too
[16:39:59] mikecmpbll: has joined #ruby
[16:40:59] nofxx1: has joined #ruby
[16:43:26] dminuoso: This must be how World of Warcraft started.
[16:45:07] webguynow: has joined #ruby
[16:47:23] coderphive: has joined #ruby
[16:56:21] QualityAddict: has joined #ruby
[16:57:02] riceandbeans: What do you guys think of the design of this?
[16:57:03] riceandbeans: https://github.com/motdotla/digitalocean/blob/master/lib/digitalocean.rb
[16:57:41] riceandbeans: I look at it and hate the single file aspect and feel like I'd rather it broken into a file for each major section of the API, but also I want to do something similar but make it more generic
[16:58:14] riceandbeans: I want to make something supporting multiple backends, but maybe single file for each of the entire backends is better, :\ I don't know
[16:59:36] dminuoso: that extend self is making me cry.
[17:00:28] dminuoso: riceandbeans: Abstract that URL away...
[17:00:38] blindMoe: has joined #ruby
[17:00:38] blindMoe: has joined #ruby
[17:01:12] dminuoso: riceandbeans: https://github.com/motdotla/digitalocean/blob/master/lib/digitalocean.rb#L67-L87 this is just.. no.
[17:03:08] dminuoso: riceandbeans: Do you know what `class << self` does ?
[17:03:15] riceandbeans: dminuoso: and please don't take this as me shitting on someone else's code, because I know my code will look like shit to plenty of people, but I wanted a nice example to base something on, and I saw that and didn't like it
[17:03:30] riceandbeans: some kind of horrifying inheritance?
[17:04:03] dminuoso: Oh this is not your code?
[17:04:13] riceandbeans: No, this is someone else's
[17:04:23] amatas: has joined #ruby
[17:05:32] riceandbeans: I had this one gem to do something, it did like 75% of what I wanted, but the missing part irked me, and they stopped supporting it, so I was going to do my own thing with it, but I figured I'd make it generic and support various providers, and then I looked around for other rest clients in ruby that I'd used, so I looked at vultr because the gem works fine for my use and I looked at the code and it
[17:05:38] riceandbeans: was exactly like the above
[17:06:09] riceandbeans: I kind of wanted to probe the water and see if it was just me disliking the style used or if it was generally frowned upon, because I'd rather do best practice
[17:06:26] riceandbeans: so, the one I thought looked a little better to model on is this
[17:06:28] tomphp: has joined #ruby
[17:06:54] riceandbeans: https://github.com/coinbase/coinbase-ruby/blob/master/lib/coinbase/wallet/client.rb
[17:07:43] riceandbeans: I don't know that inheriting NetHTTPClient is really necessary, but it basically has no external dependencies and mostly works
[17:11:26] riceandbeans: dminuoso: what do you think of that one in comparison for style?
[17:24:27] ski7777: has joined #ruby
[17:28:22] RickHull: has joined #ruby
[17:32:45] stephh: has joined #ruby
[17:33:26] orbyt_: has joined #ruby
[17:35:59] troys: has joined #ruby
[17:37:08] jerryskye: has joined #ruby
[17:42:36] jdawgaz: has joined #ruby
[17:43:15] ur5us: has joined #ruby
[17:43:22] Exhiled: has joined #ruby
[17:43:41] leitz: How do you convert a BSON::Document to a hash? So far doc.to_hash doesn't seem to work.
[17:48:19] dminuoso: leitz: https://github.com/mongodb/bson-ruby/blob/master/lib/bson/document.rb#L35
[17:48:22] dminuoso: It already is a hash.
[17:49:01] dminuoso: leitz: But if you wanted a real honest hash, it's called #to_h
[17:49:04] dionysus69: has joined #ruby
[17:49:07] leitz: dminuoso, give me a minute to put up the gist.
[17:50:41] jdawgaz: has joined #ruby
[17:51:06] RickHull: leitz: hey! I've been busy: https://github.com/rickhull/traveller_rpg
[17:51:58] dminuoso: Does it use combinators?
[17:52:13] RickHull: AFAICT it's 99% accurate to actual gameplay, modulo the variety of traveller rulesets
[17:52:50] leitz: Here's the code: https://gist.github.com/LeamHall/c66d7e22b437f1af200af291c9fe3c57
[17:52:59] leitz: RickHull, cool! Let me go look.
[17:53:24] dminuoso: People having trouble with monogo deserve their problems.
[17:53:26] stephh: has joined #ruby
[17:54:50] RickHull: leitz: I need to update the README regarding chargen output
[17:54:56] RickHull: but just clone master and `rake chargen`
[17:55:04] RickHull: or `HUMAN=1 rake chargen`
[17:56:04] leitz: RickHull, that looks cool!
[17:56:17] leitz: Mind if I share the URL on the Traveller forum?
[17:56:45] xco: has joined #ruby
[17:56:52] dminuoso: leitz: If its public on github its fair game. ;p
[17:56:58] leitz: dminuoso, I'm using MongoDB for a couple reasons. Mostly for fun though.
[17:57:05] RickHull: not just yet
[17:57:21] dminuoso: leitz: There are no valid reasons to use mongodb.
[17:57:24] leitz: Yeah, but he'll get pestered with questions, RFEs, and old codgers griping a bout this or that.
[17:57:33] leitz: dminuoso, I disagree.
[17:57:56] dminuoso: leitz: Anything mongodb can do, other solutions do it better without antifeatures.
[17:58:32] RickHull: dminuoso: what are the top 3 alternatives? couchdb? rethink?
[17:58:40] RickHull: if you want a flexible document thingie
[17:59:32] dminuoso: RickHull: CouchDB, Postgres
[17:59:38] leitz: In this case I prefer MongoDB. At least I'm not using Ruby 1.8.7.
[17:59:49] leitz: For the moment, anyway.
[18:00:26] mlkkk: has joined #ruby
[18:00:36] dminuoso: RickHull: Since 9.4 postgres has become really attractive because you can do full object-oriented databases without rigid schemas :)
[18:00:54] dminuoso: With all the amazing stability and concurrency you have learned to love.
[18:01:15] RickHull: <3 postgres
[18:01:53] RickHull: my last job, we had implemented a crazy flexcolumn thing in ruby to make mysql more friendly to KV style additions
[18:02:30] RickHull: I kept my distance from it and my fingers crossed... ;)
[18:02:53] alfiemax: has joined #ruby
[18:03:02] ar: @dminuoso by "object-oriented databases" you mean, "table with jsonb as a single column"?
[18:03:20] ar: dminuoso: that's kind of an antipattern, really
[18:04:08] dminuoso: ar: realistically more as a kind of hybrid.
[18:06:11] vtx: has joined #ruby
[18:08:16] nadir: has joined #ruby
[18:08:59] dviola: has joined #ruby
[18:10:35] leitz: The key issue is that Character expects a hash and gets a BSON doc which is a hash. However, it's not allowing access to the values.
[18:11:40] leitz: Here's where it should get printed out. https://github.com/LeamHall/CT_Character_Generator/blob/master/lib/presenter_default.rb
[18:19:07] tomphp: has joined #ruby
[18:20:16] trolltoll: has joined #ruby
[18:22:32] ltem: has joined #ruby
[18:25:24] vichib: has joined #ruby
[18:26:04] gnufied: has joined #ruby
[18:26:18] vichib: has joined #ruby
[18:29:23] yqt: has joined #ruby
[18:32:35] leitz: Okay, figured it out.
[18:32:58] leitz: Operator Error. :)
[18:33:14] lytol_: has joined #ruby
[18:39:16] leitz: dminuoso, I won't disagree that there are great options for data storage. MongoDB solves a few problems for me: it has classes I can take for free and I like to learn. That pushes my brain to stay young while the rest of me ages.
[18:39:52] leitz: It was potentially an unsupported project at work so I got to show my management that I'd pitch in as needed. I'm not really a DBA or a coder by title.
[18:40:16] leitz: And, near to my heart is that it has a certification. Always good for large corp job searches.
[18:40:18] apeiros_: has joined #ruby
[18:42:36] tomphp: has joined #ruby
[18:44:58] jerryskye: has joined #ruby
[18:48:26] miskatonic: has joined #ruby
[18:50:09] stephh: has joined #ruby
[18:59:17] xavrix: has joined #ruby
[18:59:46] guille-moe: has joined #ruby
[18:59:58] craysiii: what difference is there, if any, between doing "gem install <gem>" and placing that gem inside a gemspec and doing "bundle install" ?
[19:01:55] riceandbeans: dminuoso: did you see the last code link I put up?
[19:02:59] havenwood: craysiii: bundler just uses rubygems to install the gem in the same place it would be if you manually installed it
[19:04:21] craysiii: okay, so riddle me this: i am trying to add a gem to my gem's dependencies. I can install it via "gem install typhoeus", but adding it to my gemspec and running bundle install results in an error, "Could not find gem 'typheous x64-mingw32'
[19:04:41] craysiii: yes im on windows :(
[19:04:56] havenwood: craysiii: windows 10?
[19:05:20] havenwood: craysiii: have you considered using the Windows Subsystem for Linux (WSL)?
[19:06:09] craysiii: i have considered it, didn't enjoy it much
[19:06:52] havenwood: they keep patching it to make it more useable - maybe it'll end up nice
[19:07:10] craysiii: i hope so, i just didnt want to introduce even more uncertainty between the platforms i use
[19:09:58] despai: has joined #ruby
[19:10:14] havenwood: craysiii: what version is your bundler?
[19:12:57] riceandbeans: ruby on windows is weird, I used it before to muck with the registry
[19:16:52] uZiel: has joined #ruby
[19:17:42] RickHull: craysiii: you may need to specify the "binary gem" in the Gemfile -- but I wouldn't expect rubygems to operate much differently in this regard
[19:18:00] RickHull: or there may be a platform directive that could help
[19:18:14] craysiii: sorry havenwood rickhull just had some people stop by for a moment, will answer soon :)
[19:18:58] RickHull: almost anyone else is better than I am with bundler -- I'm just stabbing in a somewhat educated direction ;)
[19:25:13] wopi: has left #ruby: ("WeeChat 1.3")
[19:25:30] alfiemax: has joined #ruby
[19:28:38] ShekharReddy: has joined #ruby
[19:36:55] tomphp: has joined #ruby
[19:38:20] astronavt: has joined #ruby
[19:38:38] astronavt: has joined #ruby
[19:40:39] tokudan[m]: has left #ruby: ("User left")
[19:42:56] xco: has joined #ruby
[19:48:01] stephh: has joined #ruby
[19:49:02] SuperLag: has joined #ruby
[19:49:11] linetrace: has joined #ruby
[19:50:08] linetrace: Suggestions on preferred OAuth gem(s) to use these days?
[19:50:58] linetrace: Use case is auth for a JSON API, not being used w/Rails
[19:51:18] linetrace: (OAuth client, not server)
[19:54:18] RickHull: has joined #ruby
[19:55:50] c0ncealed: has joined #ruby
[19:59:08] Hanmac: has joined #ruby
[19:59:13] _sfiguser: has joined #ruby
[20:01:35] stephh: has joined #ruby
[20:01:57] bradleyprice: has joined #ruby
[20:09:44] alfiemax: has joined #ruby
[20:09:54] JaccoP: has joined #ruby
[20:11:30] milardovich: has joined #ruby
[20:12:22] TinkerTyper: has joined #ruby
[20:12:54] Dimik: has joined #ruby
[20:14:27] milardov_: has joined #ruby
[20:15:42] milardov_: has joined #ruby
[20:15:50] rrutkowski: has joined #ruby
[20:20:38] uZiel: has joined #ruby
[20:20:46] rrutkowski: has joined #ruby
[20:25:55] rrutkowski: has joined #ruby
[20:27:07] bkxd: has joined #ruby
[20:27:53] bkxd: has joined #ruby
[20:29:56] ur5us: has joined #ruby
[20:33:34] stephh: has joined #ruby
[20:33:41] rrutkowski_: has joined #ruby
[20:39:04] craysiii: havenwood Bundler version 1.15.4
[20:39:18] craysiii: https://gist.github.com/craysiii/2e73564cb46dee10195fc78f3e4bfb8f
[20:40:51] bkxd_: has joined #ruby
[20:41:20] LocaMocha: has joined #ruby
[20:48:55] jxv: has joined #ruby
[20:49:03] johnpaul: has joined #ruby
[20:49:34] drewmcmillan: has joined #ruby
[20:54:06] RickHull: craysiii: what's in the binance Gemfile / Gemfile.lock ?
[20:54:23] isec: has joined #ruby
[20:54:31] RickHull: you can also try `gem install binance` to see what happens there
[20:55:14] despai: has joined #ruby
[20:55:21] stephh: has joined #ruby
[20:56:15] craysiii: rickhull ive updated the gist with the Gemfile
[20:56:49] RickHull: ok -- is there any different behavior with `gem install binance` ?
[20:57:24] craysiii: let me test
[20:59:23] mostlybadfly: has joined #ruby
[21:00:40] quobo: has joined #ruby
[21:02:41] craysiii: wow i'm feeling some shame now... i had it misspelled in the gemspec. could have sworn i checked that over and over again
[21:04:47] RickHull: ha, I see -- it happens... mystery solved! xD
[21:05:07] RickHull: ty-fo-ee-us
[21:05:31] nfsnobody: has joined #ruby
[21:09:33] RickHull: they should call it typo-eus xD
[21:10:13] mtkd: has joined #ruby
[21:12:11] chocoelho: has joined #ruby
[21:17:14] stephh: has joined #ruby
[21:17:59] sammi`_: has joined #ruby
[21:22:11] bkxd: has joined #ruby
[21:23:27] orbyt_: has joined #ruby
[21:23:29] despai: has joined #ruby
[21:27:27] tomphp: has joined #ruby
[21:29:54] sameerynho: has joined #ruby
[21:31:05] rrutkowski: has joined #ruby
[21:33:37] bkxd_: has joined #ruby
[21:37:48] cadillac_: has joined #ruby
[21:38:59] stephh: has joined #ruby
[21:42:53] mikecmpbll: has joined #ruby
[21:48:54] stephh: has joined #ruby
[21:49:04] Azure: has joined #ruby
[22:05:13] rrutkowski: has joined #ruby
[22:08:30] rrutkowski: has joined #ruby
[22:11:00] KrzaQ: I have a question about my solution to yesterday's advent of code puzzle. With .lazy, it takes ~60 seconds on my computer to compute, without it's about 30% faster, but eats like 10 gigs of ram. Am I doing something horrendously wrong?
[22:11:02] KrzaQ: https://github.com/KrzaQ/AdventOfCode2017/blob/master/day15/main.rb
[22:11:44] stephh: has joined #ruby
[22:15:55] cloaked1: has joined #ruby
[22:15:55] cloaked1: has joined #ruby
[22:18:35] bkxd: has joined #ruby
[22:25:56] Technodrome: has joined #ruby
[22:26:27] eckhardt: has joined #ruby
[22:28:57] tomphp: has joined #ruby
[22:30:44] ur5us: has joined #ruby
[22:34:25] stephh: has joined #ruby
[22:38:22] despai: has joined #ruby
[22:42:32] RickHull: that sounds reasonable, depending on the problem. lazy computation usually means consuming less space, and there ideally is no time tradeoff
[22:42:50] RickHull: but depending on the computation, there can be a time tradeoff
[22:43:53] bkxd: has joined #ruby
[22:44:23] z3uS: has joined #ruby
[22:45:08] GodFather: has joined #ruby
[22:47:58] GodFather: has joined #ruby
[22:48:58] TinkerTyper: has joined #ruby
[22:50:05] k0mpa: has joined #ruby
[22:50:38] Technodrome: has joined #ruby
[22:53:28] stephh: has joined #ruby
[22:58:22] Danishman: has joined #ruby
[22:58:51] RyanMcCoskrie: has joined #ruby
[22:58:57] eckhardt: has joined #ruby
[23:00:11] bkxd_: has joined #ruby
[23:01:18] pastorinni: has joined #ruby
[23:06:38] johnpaul: has joined #ruby
[23:07:41] iszak: has joined #ruby
[23:07:41] iszak: has joined #ruby
[23:09:21] alfiemax: has joined #ruby
[23:14:23] bkxd: has joined #ruby
[23:15:07] mtkd: has joined #ruby
[23:15:30] uZiel: has joined #ruby
[23:15:39] stephh: has joined #ruby
[23:16:13] eckhardt_: has joined #ruby
[23:16:22] mikecmpbll: has joined #ruby
[23:17:39] jxv: has joined #ruby
[23:20:46] jenrzzz: has joined #ruby
[23:20:47] jenrzzz: has joined #ruby
[23:24:01] kies: has joined #ruby
[23:24:58] d^sh: has joined #ruby
[23:32:26] banisterfiend: has joined #ruby
[23:32:44] RyanMcCoskrie: has joined #ruby
[23:38:12] mikecmpb_: has joined #ruby
[23:40:15] stephh: has joined #ruby
[23:55:09] bradleyprice: has joined #ruby
[23:56:31] stephh: has joined #ruby
[23:57:21] tomphp: has joined #ruby