« Back to channel list

#ruby - 15 November 2017

« Back 1 day Forward 1 day »
[00:01:21] BackEndCoder: has joined #ruby
[00:02:15] jrabe: has joined #ruby
[00:02:41] alveric3: has joined #ruby
[00:05:25] nymous: has joined #ruby
[00:08:01] safetypin: has joined #ruby
[00:08:17] nofxx: has joined #ruby
[00:09:07] cschneid_: has joined #ruby
[00:09:22] nymous: hey folks, i just want to let you know, if someone were interested in, i made my gem to kind of first release point, you might check it here https://github.com/divanikus/salus
[00:10:16] nymous: i didn't released it anywhere yet
[00:10:33] cagomez: has joined #ruby
[00:12:26] cdg: has joined #ruby
[00:12:56] 21WAADFGZ: has joined #ruby
[00:19:07] kryptoz: has joined #ruby
[00:21:37] contradictioned: has joined #ruby
[00:26:12] hahuang65: has joined #ruby
[00:28:00] Technodrome: has joined #ruby
[00:29:57] pragmatism: has joined #ruby
[00:30:21] mim1k: has joined #ruby
[00:33:52] hutch34: has joined #ruby
[00:36:00] kus_ubuntui686: has joined #ruby
[00:37:34] centrx: nymous: interesting
[00:43:00] voodoofish430: has left #ruby: ()
[00:45:06] Technodrome: has joined #ruby
[00:45:14] govg: has joined #ruby
[00:45:27] alfiemax: has joined #ruby
[00:46:08] hutch34: has joined #ruby
[00:46:46] vikaton: has joined #ruby
[00:47:53] rhyselsmore: has joined #ruby
[00:48:57] nymous: centrx: consider it as v0.1.0 quality product, but any suggestions are welcome
[00:49:21] millerti: has joined #ruby
[00:50:43] cschneid_: has joined #ruby
[00:51:31] RickHull: nymous: one thing I like to do in the early days is put a notice at the top of the README, something like *this is alpha software still in development*
[00:54:07] nymous: added a small disclaimer
[00:56:03] hutch34: has joined #ruby
[01:00:07] contradictioned: has joined #ruby
[01:01:02] alveric4: has joined #ruby
[01:01:09] bmurt: has joined #ruby
[01:01:47] shreve: has joined #ruby
[01:02:17] kitsunenokenja: has joined #ruby
[01:03:34] Emmanuel_Chanel: has joined #ruby
[01:05:09] nowhere_man: has joined #ruby
[01:05:55] hutch34: has joined #ruby
[01:08:08] enterprisey: has joined #ruby
[01:11:38] yeticry: has joined #ruby
[01:11:53] alfiemax: has joined #ruby
[01:14:30] chrisgopher: has joined #ruby
[01:14:55] cschneid_: has joined #ruby
[01:15:58] emilford: has joined #ruby
[01:16:16] zenspider: has joined #ruby
[01:16:51] kryptoz: has joined #ruby
[01:18:33] hutch34: has joined #ruby
[01:21:04] bmurt: has joined #ruby
[01:22:12] emilford: has joined #ruby
[01:26:49] Jameser: has joined #ruby
[01:29:00] RickHull: nymous: found a typo: redifine for redefine
[01:29:12] hutch34: has joined #ruby
[01:30:23] aroaminggeek: has joined #ruby
[01:31:00] nymous: oh, thanks, corrected that
[01:31:07] nymous: english is not my native, you know
[01:31:36] hahuang65: has joined #ruby
[01:32:44] nymous: found another one lol
[01:33:03] mjolnird: has joined #ruby
[01:33:40] aroaminggeek: has joined #ruby
[01:34:44] RickHull: no worries :)
[01:34:59] RickHull: what is the closest well-known project in this space?
[01:35:47] RickHull: or, what's the alternative without this?
[01:36:10] aroaminggeek: has joined #ruby
[01:36:12] nymous: idk, usually we have a collector agent like collectd, prometheus exporter, zabbix-aggent or whatever
[01:36:27] nymous: and a bunch of collector scripts
[01:36:49] nymous: https://github.com/scoopex/zabbix-agent-extensions/tree/master/extension-files/tools
[01:36:53] nymous: something like this
[01:37:24] nymous: or this https://github.com/riemann/riemann-tools/tree/master/bin
[01:37:47] nymous: *zabbix-agent
[01:38:08] emilford: has joined #ruby
[01:38:40] nymous: lots of such small projects https://github.com/ryansch/haproxy-collectd-plugin
[01:39:08] hutch34: has joined #ruby
[01:39:51] RickHull: let's say collectd is already a dependency, and most project infrastructure is already using it
[01:40:09] |ifei5good: has joined #ruby
[01:40:14] RickHull: is this useful? or is it more for an environment which is using all kinds of agents?
[01:40:32] nymous: you mean my project?
[01:40:34] RickHull: I am legitimately curious, not trying to be overly skeptical :)
[01:40:49] |ifei5g00d: has joined #ruby
[01:40:51] RickHull: who is the target audience? what does their problem / environment look like?
[01:41:19] nymous: i've made a collectd renderer as well, you may use salus with collectd using plugin::exec
[01:41:37] RickHull: I just picked collectd because I know it's fairly ubiquitous
[01:42:10] RickHull: I'm guessing the target audience is a devops / sysadmin type, who is running a heterogenous environment with many different stacks
[01:42:14] RickHull: but not sure
[01:42:16] nymous: the goal of my project is a simple way to write such additional scripts
[01:42:35] nymous: i mean metrics collector scripts
[01:43:07] RickHull: let's say a devops type is already running collectd on most production nodes, does this solve any problems?
[01:43:08] nymous: poll a thing, get numbers, calc everything and send to collectd or whatever
[01:43:40] nymous: collectd might be extended with external scripts
[01:43:52] nymous: you may try my dsl for writing them
[01:44:22] nymous: other option is to write a full-blown plugin using any supported language
[01:44:23] RickHull: i assume collectd provides a way to write external scripts
[01:44:35] RickHull: or whatever equivalent
[01:45:04] nymous: https://gist.github.com/apeckham/f783aa297516663f5c56
[01:45:06] nymous: like this
[01:45:20] RickHull: ok, yeah, this helps :)
[01:45:43] RickHull: so this gives a friendly, universal interface to accomplish similar, with the ruby DSL?
[01:45:50] emilford: has joined #ruby
[01:45:59] cdg_: has joined #ruby
[01:46:07] nymous: https://www.zabbix.com/documentation/3.4/manual/config/items/userparameters
[01:46:35] emilford: has joined #ruby
[01:46:41] nymous: for example, you might ask redis-server for stats, which are just counters
[01:46:51] nymous: pull them into "counter" metrics in my dsl
[01:47:04] nymous: and get "rate per sec" automagically
[01:47:24] nymous: no special processing required
[01:47:35] RickHull: so I assume collectd and e.g. zabbix have some common functionality -- and though they express it differently, your DSL allows a single expression that works for both?
[01:47:58] nymous: well, i can't guarantee that
[01:48:16] nymous: zabbix is much more complex than many other collectors
[01:48:34] RickHull: I am kind of thinking in terms of a database abstraction layer
[01:48:37] nymous: but for things like graphite, collectd - yeah, most likely
[01:48:43] RickHull: different RDBMS have a lot of common functionality
[01:49:03] RickHull: but a DB abstraction layer usually sacrifices a lot to have a common interface
[01:49:05] hutch34: has joined #ruby
[01:49:19] RickHull: and then allows bypassing to use RDBMS specific instructions
[01:49:20] bougyman: and then some don't.
[01:49:24] nymous: the only problem is that they usually have different naming schemes
[01:49:24] bougyman: like Sequel.
[01:50:26] nymous: my dsl is not that complex, is just several primitives for getting current value or rate per sec from a foreign source
[01:50:26] kryptoz: has joined #ruby
[01:50:47] nymous: like you shouldn't reimplement it again
[01:50:58] RickHull: what does the data flow look like?
[01:51:06] RickHull: i'm assuming the app and the OS are data sources
[01:51:17] RickHull: and some metrics warehouse and graphing thing is the data sink
[01:51:40] s3nd1v0g1us: has joined #ruby
[01:52:10] nymous: salus is invoked somehow, grabs data, calculates metrics and pulls them to renderer objects
[01:52:15] emilford: has joined #ruby
[01:52:30] nymous: renderer can just output it to stdout or file, or send to a graphite server, for example
[01:53:00] nymous: most collector agents like collectd can grab data from stdout
[01:53:19] RickHull: so app to collectd to salus?
[01:53:31] ttrx: has joined #ruby
[01:53:33] nymous: app -> salus -> collectd
[01:53:52] RickHull: sorry, I should kinda know this stuff but it's been a while :)
[01:54:11] nymous: collectd runs salus to grab some data
[01:54:16] nymous: and you define how
[01:54:52] nymous: same with zabbix
[01:55:20] nymous: as with graphite, you might run salus by cron and would send data to graphite by himself
[01:55:43] nymous: actually i didn't made this yet, but you might implement it rather simple
[01:56:09] nymous: current graphite renderer just output data in graphite protocol to stdout
[01:56:18] cdg: has joined #ruby
[01:59:01] hutch34: has joined #ruby
[02:01:00] nymous: you can compare how aphyr have implemented cpu usage collection with mine approach https://github.com/riemann/riemann-tools/blob/master/bin/riemann-health#L97-L116
[02:01:35] gil_: has joined #ruby
[02:01:36] gil_: has joined #ruby
[02:11:40] RickHull: yours is only implemented in the README, right?
[02:13:51] RickHull: found another typo: Absoulte
[02:14:06] emilford: has joined #ruby
[02:15:35] RickHull: also, File.readlines might be useful
[02:16:04] RickHull: I'm guessing you'd want to move some "parsing linux filesystem stuff" into lib/
[02:16:26] RickHull: provide some helpers like Riemann's #linux_cpu
[02:16:32] cschneid_: has joined #ruby
[02:18:43] ResidentBiscuit: has joined #ruby
[02:19:50] nymous: yeah, may be later
[02:20:02] nymous: usually most collectors implement that by their own
[02:20:20] nachoman: has joined #ruby
[02:22:36] RickHull: this should work for the cpu example https://gist.github.com/rickhull/1d27886e99907bab5657ab8eb706ea55
[02:23:22] nymous: well, ok, i have to go off to bed, it's 5 am here already :)
[02:23:44] nymous: no, it won't, name is a string and you are converting it to_i
[02:24:35] nymous: also consider space in /^cpu /, it on purpose, get only all cores stats
[02:24:54] RickHull: ah well, just throwing it out there :)
[02:24:56] nymous: you might change it to /^cpu\d/ to get per core stats
[02:25:06] RickHull: cheers, looks like an interesting project :)
[02:25:31] nymous: but you'll have to add name to metrics in that case
[02:25:44] nymous: check the zabbix example code in the readme
[02:28:11] nymous: anyways, thanks for advices, bye
[02:30:56] mim1k: has joined #ruby
[02:31:55] JsilverT: has joined #ruby
[02:34:55] hutch34: has joined #ruby
[02:34:57] cdg: has joined #ruby
[02:36:00] char_var[buffer]: has joined #ruby
[02:36:56] emilford: has joined #ruby
[02:38:11] centrx: has joined #ruby
[02:40:43] char_var[buffer]: has joined #ruby
[02:42:36] aroaminggeek: has joined #ruby
[02:45:15] c0ncealed: has joined #ruby
[02:45:48] hutch34: has joined #ruby
[02:48:09] ptx0: has joined #ruby
[02:49:49] drowze: has joined #ruby
[02:50:19] fyrril: has joined #ruby
[02:50:41] d^sh: has joined #ruby
[02:51:22] nofxx: has joined #ruby
[02:53:15] emilford: has joined #ruby
[02:53:33] emilford: has joined #ruby
[02:54:23] shreve: has joined #ruby
[02:54:34] guacamole: has joined #ruby
[02:57:19] gizmore|2: has joined #ruby
[03:04:03] LenPayne_: has joined #ruby
[03:07:17] emilford: has joined #ruby
[03:09:29] hutch34: has joined #ruby
[03:09:34] guacamole: has joined #ruby
[03:12:07] Sightes: has joined #ruby
[03:13:56] govg: has joined #ruby
[03:18:03] safetypin: has joined #ruby
[03:18:56] hahuang65: has joined #ruby
[03:22:41] LenPayne_: has joined #ruby
[03:23:37] LenPayne: has joined #ruby
[03:24:32] cschneid_: has joined #ruby
[03:25:59] guest9803: has joined #ruby
[03:35:12] hutch34: has joined #ruby
[03:48:37] imode: has joined #ruby
[03:52:24] Technodrome: has joined #ruby
[03:59:18] motstgo: has joined #ruby
[03:59:56] orbyt_: has joined #ruby
[04:02:40] minimalism: has joined #ruby
[04:08:10] hutch34: has joined #ruby
[04:09:33] knight33: has joined #ruby
[04:11:00] ans: has joined #ruby
[04:16:15] moei: has joined #ruby
[04:19:56] hutch34: has joined #ruby
[04:20:01] hahuang65: has joined #ruby
[04:25:28] hutch34: has joined #ruby
[04:25:57] motstgo: has left #ruby: ("WeeChat 1.9")
[04:26:42] gix-: has joined #ruby
[04:31:22] mim1k: has joined #ruby
[04:36:04] hutch34: has joined #ruby
[04:39:30] Asher: has joined #ruby
[04:40:30] drowze: has joined #ruby
[04:46:24] iamarun: has joined #ruby
[04:50:32] mjolnird: has joined #ruby
[04:52:43] kryptoz: has joined #ruby
[04:55:09] mniip: has joined #ruby
[04:55:31] duderonomy: has joined #ruby
[04:56:04] hutch34: has joined #ruby
[05:07:53] hutch34: has joined #ruby
[05:08:22] apparition: has joined #ruby
[05:18:02] aroaminggeek: has joined #ruby
[05:18:03] enterprisey: has joined #ruby
[05:21:50] hdqn: has joined #ruby
[05:24:45] hdqn: has left #ruby: ()
[05:25:23] hutch34: has joined #ruby
[05:28:26] cdg: has joined #ruby
[05:29:34] mim1k: has joined #ruby
[05:35:29] Exhiled: has joined #ruby
[05:37:34] duderono_: has joined #ruby
[05:39:27] uZiel: has joined #ruby
[05:48:49] war_pigs: has joined #ruby
[05:49:53] rabajaj: has joined #ruby
[05:51:07] AliasSpider: has joined #ruby
[06:02:53] reber: has joined #ruby
[06:04:07] alfiemax: has joined #ruby
[06:05:29] dn`: has joined #ruby
[06:07:33] Dimik: has joined #ruby
[06:10:00] hutch34: has joined #ruby
[06:11:22] reber: has joined #ruby
[06:15:10] quobo: has joined #ruby
[06:15:48] EXCHGR: has joined #ruby
[06:16:27] uZiel: has joined #ruby
[06:16:33] hahuang65: has joined #ruby
[06:17:46] LocaMocha: has joined #ruby
[06:20:11] hutch34: has joined #ruby
[06:25:46] anisha: has joined #ruby
[06:26:05] ruby-lang093: has joined #ruby
[06:27:18] hays_: has joined #ruby
[06:27:41] hays_: looking for a smart/easy way to do true concurrency in ruby
[06:28:43] ruby-lang093: string interpolation or +
[06:29:45] hays_: i guess i mean paralelism
[06:30:20] hutch34: has joined #ruby
[06:35:55] armando: has joined #ruby
[06:37:35] dionysus69: has joined #ruby
[06:37:50] RickHull: hays_: you need multiple processes or jruby/rbx/etc runtime
[06:38:12] RickHull: I think of concurrency as doing different stuff, maybe the same stuff in parallel
[06:39:19] RickHull: parallel implies splitting a single task into homogenous chunks and doing them concurrently
[06:40:01] RickHull: time-splitting a single processor can simulate concurrency, but it's not true concurrency
[06:40:08] hays_: so i've got lets say 20 connections open and i want to basically write asynchronously to all 20 of them
[06:40:31] RickHull: you can do an event loop
[06:40:43] hays_: i think concurrency is fine, but i've had some experiences where i think performance might start to be an issue if i don't actually do some stuff in parallel
[06:40:49] hutch34: has joined #ruby
[06:40:50] RickHull: I like making tiny simple threads that own a connection too
[06:41:10] rabajaj: has joined #ruby
[06:42:38] RickHull: hays_: are you sure you're on a concurrent execution platform? i.e. multiple cpus?
[06:42:58] alfiemax: has joined #ruby
[06:43:14] RickHull: a single MRI process has all its threads on the same cpu
[06:43:33] nowhere_man: has joined #ruby
[06:43:58] hays_: yeah so jruby i think is the best option from what ive read
[06:44:12] hays_: im also looking at celluloid
[06:44:25] RickHull: but if you're just doing concurrent I/O, then you could just have a threaded listener per CPU
[06:44:27] hays_: im having trouble figuring out how to structure the code
[06:44:29] dinfuehr: has joined #ruby
[06:44:59] RickHull: maybe look at https://github.com/ruby-concurrency/concurrent-ruby
[06:45:14] apeiros_: has joined #ruby
[06:47:31] hays_: i think i need listener threads and also sender threads
[06:48:02] hays_: since robust error handling is important. if someone disconnects, i want the listener to re-establish the connection
[06:48:49] cgfbee: has joined #ruby
[06:49:10] RickHull: so you are writing a TCP service?
[06:51:00] hutch34: has joined #ruby
[06:52:11] andikr: has joined #ruby
[06:55:02] hays_: RickHull: more like real time programming. one can imagine maybe 20-40 independent servers , and a requirement to write values to these 20-40 servers every few seconds, but then interleaved with that other commands as well
[06:55:25] hays_: and if you lose a connection to these, you re-establish and keep going
[06:55:58] hays_: but the connection stays alive
[06:56:07] hays_: no its all TCP
[06:56:51] RickHull: ok -- this is the realm of an application server if you want to heavyweight and battle testest
[06:57:12] hays_: this is a very simple bit of code showing how the connection might be made https://github.com/rmodbus/rmodbus#example
[06:57:14] charliesome: has joined #ruby
[06:58:23] epocS60: has joined #ruby
[06:58:54] RickHull: have you looked at TCPServer? do you know how #select works?
[06:59:01] gradio: has joined #ruby
[07:00:31] RickHull: &ri IO.select
[07:00:31] `derpy: http://ruby-doc.org/core-2.4.1/IO.html#method-c-select
[07:00:33] hays_: no and no.. but the program is the client not the server
[07:01:12] hutch34: has joined #ruby
[07:01:33] hays_: that looks like it requires posix
[07:01:48] RickHull: nevermind about select, if you are the TCP client
[07:01:54] RickHull: I misunderstood
[07:02:15] RickHull: it's very easy to create a thread per remote server
[07:02:24] RickHull: or you can use an event loop
[07:03:02] dminuoso: Have you ever tried sleep?
[07:03:14] RickHull: I like blocking I/O with thread-per-socket
[07:03:19] RickHull: and yeah, i love sleeping too
[07:03:37] RickHull: tell the big man upstairs to focus on something else
[07:04:09] dminuoso: You're at least as much awake as matthewd.
[07:10:44] RickHull: argument stack underflow (-1) (SyntaxError)
[07:10:51] RickHull: anyone familiar with this one? ^^
[07:11:13] RickHull: getting it on Travis ruby-head but not ruby-2.4
[07:11:21] hutch34: has joined #ruby
[07:13:32] scientes: has joined #ruby
[07:13:34] hays_: how can i wrap []
[07:13:39] scientes: how do I sort a hash by key
[07:14:03] scientes: do I need to turn it into an array first
[07:14:15] RickHull: hsh.sort_by! { |k, v| k } # maybe?
[07:14:20] hays_: lets say I have an array @foo in a class and i want to wrap it def foo[] I imagine? what are the args
[07:14:28] scientes: http://ruby-doc.org/core-2.4.2/Hash.html no sort_by
[07:14:43] RickHull: there is a way to do it with Enumerable
[07:15:25] RickHull: hays_: def [](key) and def []=(key, value)
[07:16:58] gradio: has joined #ruby
[07:17:38] aufi: has joined #ruby
[07:17:41] jackjackdripper: has joined #ruby
[07:17:42] aroaminggeek: has joined #ruby
[07:19:12] dminuoso: RickHull: Nope its new.
[07:19:15] dminuoso: https://github.com/ruby/ruby/commit/04b3328cd9ba138d717e68d1105ca4620de0a070
[07:19:31] dminuoso: "separate fix-up of sp depth from code generation."
[07:19:38] dminuoso: Gotta love those japanese commit messages.
[07:19:54] duderonomy: has joined #ruby
[07:20:11] dminuoso: Or its not new mmm. But it could be new in 2.4
[07:20:43] RickHull: i suspect it's new in ruby-head
[07:21:01] RickHull: per Travis staying up to date
[07:21:20] RickHull: i'm getting it from minitest/spec
[07:21:31] hutch34: has joined #ruby
[07:22:01] RickHull: gems/minitest-5.10.3/lib/minitest/spec.rb: gems/ruby-head/gems/minitest-5.10.3/lib/minitest/spec.rb:20: argument stack underflow (-1) (SyntaxError)
[07:22:48] hays_: ok I have class member @foo and I am trying to make it so that if I doo bar.foo[0] and an exception is thrown it gets caught
[07:23:40] RickHull: is @foo an array?
[07:23:51] hays_: the problem is that def foo; @foo; end getting wrapped in try block isn't cutting it because its thrown after its out of that code
[07:24:03] RickHull: I like Hash#fetch
[07:24:08] hays_: @foo is an array-like object
[07:24:31] RickHull: @foo[2938402] #=> nil ?
[07:24:45] hays_: nope that throws an exception
[07:24:46] RickHull: under what circumstances does @foo[x] raise?
[07:25:13] hays_: if the number or range is invalid. if there is some other error retrieving the value
[07:25:27] RickHull: def foo(idx)
[07:25:43] RickHull: and use bar.foo(0)
[07:26:02] tsglove2: has joined #ruby
[07:26:11] hays_: that's not great either
[07:26:19] hays_: because foo[0..6] does something important
[07:26:46] RickHull: then you'll have to be prepared for an exception when called with bad indices
[07:26:58] RickHull: or else write foo to not raise an exception when called with bad indices
[07:27:15] hays_: i don't have control over foo. its why im wrapping it
[07:27:36] RickHull: then def []
[07:27:44] RickHull: or else def foo and call with parens
[07:28:16] RickHull: bar.foo(0..6)
[07:31:42] hutch34: has joined #ruby
[07:32:28] dminuoso: RickHull: See, parens are annoying!
[07:32:41] RickHull: parens jus don understan
[07:33:04] dminuoso: I think I need to use set_trace_func to allow things like: myLambda 1
[07:33:10] dminuoso: How awesome would that be?
[07:33:35] mikecmpbll: has joined #ruby
[07:34:48] RickHull: I for one am blown away
[07:34:51] dminuoso: RickHull: Btw, dont you love the fact that fix_stack_depth has 0 comments?
[07:35:03] dminuoso: If only I understood rubys compiler.
[07:35:16] dminuoso: At least its obvious what it does. It fixes stack pointer depth.
[07:35:35] RickHull: it's blowing up on some metaprogramming
[07:35:35] dminuoso: *fix_sp_depgth
[07:35:47] RickHull: so, I'm ok with trusting the process
[07:36:00] RickHull: we're so alpha
[07:40:41] hays_: RickHull: this seems way to painful https://bpaste.net/show/ad9d967dc78a
[07:40:49] hays_: see line 32
[07:41:15] hays_: Regs class needs to have @cl in order to handle the exception
[07:41:18] conta: has joined #ruby
[07:41:37] RickHull: what's the problem?
[07:42:17] hutch34: has joined #ruby
[07:42:17] hays_: it seems like a weird way to structure the whole thing
[07:46:38] michael3: has joined #ruby
[07:47:01] uZiel: has joined #ruby
[07:48:16] RickHull: can you put your finger on it?
[07:50:57] JsilverT: has joined #ruby
[07:52:28] hutch34: has joined #ruby
[07:57:33] dn`: has joined #ruby
[07:57:45] mjolnird: has joined #ruby
[07:59:39] brucebag_: has joined #ruby
[08:00:56] ged: has joined #ruby
[08:01:29] waveprop: has joined #ruby
[08:01:37] andikr: has joined #ruby
[08:02:02] konsolebox: has joined #ruby
[08:02:43] hutch34: has joined #ruby
[08:03:53] biberu: has joined #ruby
[08:04:59] syndikate: has joined #ruby
[08:05:06] kenichi: has joined #ruby
[08:05:12] RickHull: AliasSpider: hi
[08:06:22] mistym: has joined #ruby
[08:06:23] mistym: has joined #ruby
[08:06:30] an: has joined #ruby
[08:07:15] shortdudey123: has joined #ruby
[08:07:58] lembron: has joined #ruby
[08:08:11] minimalism: has joined #ruby
[08:09:42] lembron: hi there, so i dont know anything about ruby specifically -- is it feasable with a bit of hack&slay to hack 'codeclimate' to run its formater on a json stream i provide, instead of its internal data struct? :P
[08:10:26] lembron: like, forking, adding a "render" command, and fill data with STDIN instead of doing the scan https://github.com/codeclimate/codeclimate/blob/master/lib/cc/analyzer/formatters/html_formatter.rb
[08:10:52] lembron: ((its input would be previous generated output of its own json formater, so it should have all needed data))
[08:12:12] baweaver: !spam AliasSpider
[08:12:12] ruby[bot]: +bb AliasSpider!*@*$#ruby-banned *!*@adsl-dyn34.78-99-211.t-com.sk$#ruby-banned
[08:12:12] ruby[bot]: ruby[bot] kicked AliasSpider: is a bannable offense, see http://ruby-community.com/pages/user_rules
[08:12:48] hutch34: has joined #ruby
[08:15:37] ur5us: has joined #ruby
[08:17:09] RickHull: lembron: sounds reasonably reasonable
[08:17:20] RickHull: without any specific knowledge
[08:17:23] hahuang65: has joined #ruby
[08:17:26] Hexafox[I]: has joined #ruby
[08:17:46] scientes: how can I make this program more performant? https://gist.github.com/shawnl/e20cdc842e73167581fcf7c20329ab24
[08:18:13] scientes: it takes 1GB of ram, and 15s
[08:18:15] RickHull: scientes: first add measurements
[08:18:24] RickHull: ok -- can you show those?
[08:18:44] scientes: that is just top + time(1)
[08:19:04] RickHull: probably you can show stats on a per PID basis
[08:19:14] scientes: is there a re2 binding for ruby?
[08:19:16] lembron: ive got ~5 years of php in me, so as long as its not clojure-like brainfu i shall be good :P --- was more about not taping into a ratnest when trying to extract a gazillion sub-dependencies of it or such
[08:19:23] scientes: cause ruby use to have a really slow regexp
[08:19:44] RickHull: scientes: since oniguruma?
[08:19:58] scientes: no before 1.8.7
[08:20:19] RickHull: how long ago was that?
[08:20:29] scientes: *with 1.8.7
[08:20:32] RickHull: it's fair to assume things have improved since then
[08:20:47] guille-moe: has joined #ruby
[08:21:13] baweaver: Since 1.8.7? Massive increases
[08:21:45] baweaver: So what is this program doing exactly?
[08:21:50] scientes: well, is ruby's regexp O(n)?
[08:22:07] scientes: its indexing the apt Contents file, for a command-not-found implemnetation
[08:22:20] scientes: its a 1.2 MB end database
[08:22:26] scientes: and much bigger before the reduction
[08:22:53] hutch34: has joined #ruby
[08:22:55] baweaver: So you're opening each of those files using a popen?
[08:23:00] baweaver: well, reading.
[08:23:10] scientes: its not a real popen, ruby doesn't open a shell
[08:23:14] scientes: its only about 10 files
[08:23:30] baweaver: and what's the match doing there on 13?
[08:23:39] baweaver: looks like tab delimited something, not sure the line format
[08:23:51] scientes: yes its reducing the lines to just what i'm interested in
[08:23:54] baweaver: may be able to get away without using refex there.
[08:24:27] claudiuinberlin: has joined #ruby
[08:24:34] baweaver: Can you shoot us an example of one of the lines you want to match against?
[08:24:35] baweaver: Making sure I understand what all is going on in it
[08:25:12] scientes: usr/lib/gcc-cross/mips64el-linux-gnuabi64/8/adainclude/a-stream.ads devel/gnat-8-mips64el-linux-gnuabi64
[08:25:12] baweaver: Line 9 though could likely be done without regex too
[08:25:36] baweaver: so you're wanting to split it on tabs basically then
[08:25:57] scientes: i'm also kicking about a bunch of the entries
[08:26:01] kryptoz: has joined #ruby
[08:26:03] scientes: that are not executables in the $PATH
[08:26:14] scientes: its a list of files that are available for debian or ubuntu
[08:26:20] scientes: the list of ALL files in the archives
[08:26:33] baweaver: a,b,* = "usr/lib/gcc-cross/mips64el-linux-gnuabi64/8/adainclude/a-stream.ads devel/gnat-8-mips64el-linux-gnuabi64".split("\t")
[08:26:34] scientes: and the package that they belong to
[08:26:34] baweaver: So another way to cheat is set inclusion on path
[08:26:55] baweaver: Load Path beforehand, throw it into a set, and do set includes instead of the regex on L12
[08:27:33] baweaver: >> Set.new(ENV['PATH'])
[08:27:34] scientes: regexp should be O(n), then this wouldn't matter
[08:27:35] ruby[bot]: baweaver: # => uninitialized constant Set (NameError) ...check link for more (https://eval.in/900378)
[08:28:00] scientes: i'm going to try using re2
[08:28:34] baweaver: or just do that. Have fun
[08:29:02] scientes: my bversion that used sed was fast
[08:29:18] scientes: it was just unreadable
[08:30:24] mark_66: has joined #ruby
[08:30:34] baweaver: You do realize capture groups are going to make things slower as well right?
[08:30:43] baweaver: That forces a bunch of assignment behind the scenes
[08:30:55] scientes: how can i write the first without capture groups?
[08:31:17] baweaver: You said you're on 1.8.7?
[08:31:30] baweaver: Ah, good, that makes it easier then
[08:31:48] baweaver: I _think_ this was added around there (goes to look)
[08:32:00] cseder: has joined #ruby
[08:33:07] hutch34: has joined #ruby
[08:33:10] Silthias: has joined #ruby
[08:33:22] baweaver: can't find it right now but there was a recent option that forced Ruby not to use captures
[08:34:46] baweaver: The other big issue is you're redefining the regex for every entry
[08:34:54] baweaver: pull them out into variables above everything
[08:35:05] baweaver: and using match is slower as it returns a MatchData object
[08:35:16] baweaver: line 7 you don't need match
[08:35:26] baweaver: line 12 you don't need it or the capture groups
[08:35:57] baweaver: line 13 could just be line.split("\t") and grab the segments you need
[08:36:34] baweaver: line 9 could be repo.split('_')[1..-2].join('_') or something like it
[08:37:09] scientes: lines 15-19 is the hot code
[08:37:12] scientes: the rest is quite cold
[08:39:01] scientes: removing io.readlines got rid of the crazy memory usage
[08:39:12] scientes: still takes 21 seconds
[08:40:34] baweaver: Starting to suspect you're not really here for advice
[08:40:42] scientes: didn't get that flag
[08:40:45] scientes: still looking
[08:42:25] scientes: bingo, making it match? made it faster
[08:42:29] apeiros: https://gist.github.com/shawnl/e20cdc842e73167581fcf7c20329ab24#file-gistfile1-txt-L15-L19 # <-- those line 15-19?
[08:42:57] scientes: oh my bad, I added RE2 code so it changed the line numbers
[08:43:11] scientes: lines 11-15
[08:43:27] rahul_bajaj: has joined #ruby
[08:43:33] baweaver: You don't even need regex there
[08:43:52] hutch34: has joined #ruby
[08:43:54] apeiros: scientes: if you throw away the result, don't use .match, use =~
[08:44:09] apeiros: also don't use capturing groups if you don't need the captures. (?: … ) are non-capturing groups
[08:45:10] scientes: thanks, the performance is now good
[08:45:28] apeiros: and instead of `enum.each do |item| if item =~ regex then … end end` -> `enum.grep(regex) do |item| … end`
[08:45:45] apeiros: ACTION thinks baweaver's suspicion might have been accurate
[08:45:56] scientes: I am listening to the advice
[08:46:39] aupadhye: has joined #ruby
[08:50:27] scientes: this is what I have now: https://gist.github.com/shawnl/e20cdc842e73167581fcf7c20329ab24 Dropping in RE2 makes it twice as fast
[08:51:42] burgestrand: has joined #ruby
[08:51:48] apeiros: scientes: btw., `putc '\n'` almost certainly does not do what you think/want it to
[08:52:02] johnny56: has joined #ruby
[08:52:11] scientes: oh damn your right
[08:52:29] rabajaj: has joined #ruby
[08:53:15] scientes: ACTION takes off the C hat
[08:53:51] hutch34: has joined #ruby
[08:54:06] apeiros: scientes: : Dir.entries("/var/lib/apt/lists").grep_v(/diff_Index$/).grep(/Contents-#{`dpkg --print-architecture`.chomp}/).each do |repo| …
[08:54:32] apeiros: grep_v is ruby 2.4 iirc
[08:54:51] apeiros: pre 2.4, reject { |v| v =~ /diff_Index$/ }
[08:54:51] scientes: lol, my shell code uses grep v exactly like that too
[08:55:01] elomatreb: 2.3 has grep_v as well
[08:55:08] apeiros: ah, then it's 2.3+
[08:55:54] RickHull: do they operate like dminuoso style? passing along curried functions?
[08:56:42] dminuoso: RickHull: Semantically kind of.
[08:56:49] RickHull: i wonder if there are performance optimizations enabled, or unavailable
[08:57:50] hs366: has joined #ruby
[08:58:19] apeiros: scientes: btw., what's that top level "include Enumerable"?
[08:59:13] dminuoso: RickHull: In my library .grep(a) will be extensionally equivalent to filter(match(a)) and grep_v(a) will be extensionally equivalent to filter(not * match(a))
[08:59:26] scientes: apeiros, gone, but wasn't that requires eons ago?
[09:00:01] apeiros: scientes: no
[09:00:25] apeiros: Enumerable is for classes which define "each"
[09:02:21] kapil___: has joined #ruby
[09:04:00] hutch34: has joined #ruby
[09:06:09] Bish: how do i overload (if that is the correct term)
[09:06:15] Bish: a method, witht he same parameters as super
[09:06:18] dminuoso: RickHull: (notice that incredibly handy composition with not, which is just a function Boolean -> Boolean
[09:06:46] dminuoso: Bish: you use *args, and you call keyword_super
[09:06:56] dminuoso: or *args, &blk and super(*args, &blk)
[09:07:06] dminuoso: If your method wants to take something out, you have to poke into those.
[09:07:06] Bish: and arity of that method will be the same?
[09:07:15] Bish: how does ruby know?
[09:07:22] RickHull: dminuoso: you win this time, I can't keep up
[09:07:40] dminuoso: RickHull: not = -> (e) { !e }
[09:07:53] RickHull: please forgive me until the morn
[09:08:01] apeiros: Bish: overloading is not possible in ruby. it is when you define multiple methods of the same name, which are selected depending on the type of the arguments. e.g. sum(float, float) & sum(int, int)
[09:08:01] dminuoso: RickHull: Are you an ozzy?
[09:08:18] RickHull: hardly, only in spirit
[09:08:46] Bish: apeiros: yeah i know the term was 100% correct
[09:08:50] apeiros: Bish, dminuoso: no, arity won't be the same, but if too few/many arguments are passed, an exception will be raised when super is invoked
[09:09:07] dminuoso: apeiros: Oh I see what you mean. I have some tricks to mimic the same arity though.
[09:09:23] Bish: okay, cool, so if i want the same arity i need some super cool metaprogramming stuff
[09:09:27] apeiros: dminuoso: sure, but IMO what for? just call super and let it raise there.
[09:09:51] Bish: how would i create a proc with arity of n
[09:10:34] Bish: eval i guess?
[09:12:04] dminuoso: Interesting
[09:12:20] andikr: has joined #ruby
[09:12:42] guille-moe: has joined #ruby
[09:12:52] ruby[bot]: Bish: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[09:13:05] ferr: has joined #ruby
[09:13:13] Bish: that textbinding is so useless in this context..
[09:13:28] Bish: i have a sequel mode, and i want to emit an event when a association is added.
[09:13:32] Bish: that doesnt help at all..
[09:13:41] Bish: s/mode/model
[09:13:44] MrBusiness: has joined #ruby
[09:13:45] apeiros: why. do. you. need. to. emulate. arity?
[09:13:51] MrBismuth: has joined #ruby
[09:14:06] Bish: because i dont want people to call the function with different parameters than 1?
[09:14:10] hutch34: has joined #ruby
[09:14:17] Bish: i want good debugging messages if u want to give it more parametersh
[09:14:24] apeiros: then make a method which takes one argument.
[09:14:28] apeiros: no eval. no shenanigans.
[09:14:31] Bish: works in this case.
[09:14:41] Bish: but the next time i have this problem: nope
[09:14:41] duderonomy: has joined #ruby
[09:14:52] apeiros: and why'd that be?
[09:15:09] Bish: because i want to "overload" a function with arity, but dont want to lose the arity?
[09:15:20] apeiros: do you always call super?
[09:15:36] Bish: undefined, yet
[09:18:33] apeiros: IMO this reeks. but well: raise ArgumentError, "wrong number of arguments (#{args.size} for …)" unless args.size.between?(…, …)
[09:18:35] mim1k: has joined #ruby
[09:18:47] Bish: yes, i would do that, i guess
[09:19:01] apeiros: personal opinion: if you don't call super you don't care about arity. if you do call super, let it handle arity.
[09:19:12] apeiros: but that's where we get back to "why"
[09:19:44] apeiros: and that collides with "I have a very vague problem because I might do it like this or maybe not"
[09:19:57] cschneid_: has joined #ruby
[09:20:12] Bish: it's not vague at all, i dont want to change the arity when "overloading"
[09:20:24] Bish: because i like the ruby errormessages it provides when calling with wrong arity
[09:20:37] apeiros: as said, you get that when you call super
[09:20:52] Bish: yeah because i have the wrong arity.
[09:21:08] Bish: oh, it's just an argumenterror, also
[09:21:14] Bish: so it's not different at all..
[09:21:29] Bish: nvm then
[09:23:42] cschneid_: has joined #ruby
[09:24:20] hutch34: has joined #ruby
[09:24:21] ferr: has left #ruby: ("WeeChat 1.9.1")
[09:27:30] mim1k_: has joined #ruby
[09:29:29] marr: has joined #ruby
[09:33:50] danielpclark: has joined #ruby
[09:34:27] hutch34: has joined #ruby
[09:35:19] _main_: has joined #ruby
[09:40:42] gradio: has joined #ruby
[09:43:43] aiguuu: has joined #ruby
[09:44:16] cdg: has joined #ruby
[09:45:03] hutch34: has joined #ruby
[09:45:17] romain_t: has joined #ruby
[09:54:37] vondruch: has joined #ruby
[09:55:04] kies: has joined #ruby
[09:55:13] hutch34: has joined #ruby
[09:58:01] snowy: has joined #ruby
[09:59:47] ur5us: has joined #ruby
[10:02:46] eroux: has joined #ruby
[10:03:28] Beams: has joined #ruby
[10:03:37] reber: has joined #ruby
[10:05:23] hutch34: has joined #ruby
[10:14:21] alfiemax: has joined #ruby
[10:15:35] hutch34: has joined #ruby
[10:18:08] hahuang65: has joined #ruby
[10:21:25] rouge: has joined #ruby
[10:25:41] hutch34: has joined #ruby
[10:25:51] matcouto: has joined #ruby
[10:34:33] mim1k: has joined #ruby
[10:35:31] stamina: has joined #ruby
[10:35:53] hutch34: has joined #ruby
[10:40:51] Silthias: has joined #ruby
[10:44:21] plexigras: has joined #ruby
[10:46:28] hutch34: has joined #ruby
[10:46:32] Silthias1: has joined #ruby
[10:48:33] rouge: has joined #ruby
[10:51:06] kryptoz: has joined #ruby
[10:54:27] lexruee: has joined #ruby
[10:55:37] vondruch: has joined #ruby
[10:56:32] hutch34: has joined #ruby
[11:00:42] ski7777: has joined #ruby
[11:05:45] rouge: has joined #ruby
[11:06:43] hutch34: has joined #ruby
[11:06:44] darix: wow latest 2.5 snapshot tarball is 1.1 MB larger than the previous one
[11:07:15] matcouto: has joined #ruby
[11:07:32] jaruga: has joined #ruby
[11:09:51] darix: spec directory went up by 16M unpacked
[11:13:14] GodFather: has joined #ruby
[11:14:25] hightower2: has joined #ruby
[11:14:34] elphe: has joined #ruby
[11:16:16] InfinityFye: has joined #ruby
[11:16:54] hutch34: has joined #ruby
[11:22:03] conta: has joined #ruby
[11:22:29] apparition: has joined #ruby
[11:26:05] apparition: has joined #ruby
[11:27:05] hutch34: has joined #ruby
[11:29:58] mim1k: has joined #ruby
[11:30:35] tcopeland: has joined #ruby
[11:31:29] guille-moe: has joined #ruby
[11:31:40] conta1: has joined #ruby
[11:31:44] vtx: has joined #ruby
[11:33:17] vtx: hi guys, i am trying to stub out a web request with WebMock. something i’m doing isn’t quite right, because my app seems to be hitting the back end service with a valid request. is there a way i can have WebMock print out the syntax of any requests that are happening during test execution, so i can add them to my tests and stub them out properly?
[11:35:03] xco: has joined #ruby
[11:37:17] hutch34: has joined #ruby
[11:39:08] zanoni: has joined #ruby
[11:41:24] newcoder: has joined #ruby
[11:41:57] Jameser: has joined #ruby
[11:43:43] burgestrand: vtx you can block all requests that aren't mocked out AFAIK
[11:44:33] tvw: has joined #ruby
[11:44:58] dstolfa: has joined #ruby
[11:47:48] hutch34: has joined #ruby
[11:48:18] tvw: has joined #ruby
[11:48:36] matcouto: has joined #ruby
[11:49:28] elphe: has joined #ruby
[11:52:21] workmad3: has joined #ruby
[11:58:00] hutch34: has joined #ruby
[11:59:06] ahrs: has joined #ruby
[12:03:08] Psybur: has joined #ruby
[12:05:48] xco: hi, i want to get a hash that looks like this data = { "a" => 1, "b" => 2, "c" => 3, ... }
[12:06:03] xco: this is what i have so far https://gist.github.com/xcobar/799b6b38660012c1b584b5e7a90f1dde not working, need help :)
[12:08:11] hutch34: has joined #ruby
[12:08:59] Bish: xco: your a.next and b.next do nothing because you dont assign anything
[12:09:06] Bish: it's not a reference.. it's just the number
[12:09:09] tobiasvl: xco: well. your approach is a bit strange. but to try to fix your actual algorithm, try changing `a.next` to `a = a.next` (or a.next!) and `b.next` to `b = b.next`
[12:09:13] tobiasvl: yeah, what Bish said
[12:10:00] xco: oh right! now it works!
[12:10:08] xco: Bish: do you have a better way of doing this?
[12:10:12] xco: how would you do it?
[12:10:44] xco: oh no, sorry
[12:10:52] xco: tobiasvl: how else would you do this? :D
[12:11:05] Bish: >> data = {a:"a",b:1};100.times { data.map{|x| x.map(&:next) }.to_h}
[12:11:21] Bish: >> data = {a:"a",b:1};100.times { data.map{|x| x.map(&:next) }.to_h}
[12:11:22] ruby[bot]: Bish: # => 100 (https://eval.in/900593)
[12:11:28] Bish: >> data = {a:"a",b:1};100.times { data.map{|x| x.map(&:next) }.to_h;data}
[12:11:29] ruby[bot]: Bish: # => 100 (https://eval.in/900594)
[12:11:45] Bish: >> data = {a:"a",b:1};100.times { data = data.map{|x| x.map(&:next) }.to_h;data}
[12:12:23] Bish: and is also wrong af
[12:13:26] Bish: >> data = {a:"a",b:1};100.times { data = {a:data[:a].next,b:data[:b].next} };data
[12:13:27] ruby[bot]: Bish: # => {:a=>"cw", :b=>101} (https://eval.in/900603)
[12:13:30] Bish: this probably makes sense
[12:13:42] Bish: it fills data, and does data = {a.next,b.next} 100 times
[12:14:03] xco: looking
[12:14:31] Bish: "z".next being "aa" btw.
[12:15:27] xco: got it :) thank you
[12:15:47] Bish: you're welcome
[12:17:37] Bish: actually interesting problem, no clue how i would do it beautiful
[12:17:58] Bish: is there some way to call a method 100 times to an object, and have each one input to the next
[12:18:14] hutch34: has joined #ruby
[12:18:38] Bish: so i have a short way to write
[12:18:42] Bish: a.next.next.next
[12:19:14] hahuang65: has joined #ruby
[12:21:10] dinoangelov: has joined #ruby
[12:22:59] Bish: doMultipleTimes = ->(what,times,&b){times.times{ what = b.call(what) }}
[12:23:05] Bish: something like that?
[12:23:35] duckpuppy: has joined #ruby
[12:23:41] cschneid_: has joined #ruby
[12:26:16] apeiros: >> ("a".."z").zip(1..26).to_h # @ xco
[12:26:18] ruby[bot]: apeiros: # => {"a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5, "f"=>6, "g"=>7, "h"=>8, "i"=>9, "j"=>10, "k"=>11, "l"=>12, ...check link for more (https://eval.in/900613)
[12:26:37] xco: apeiros: :o
[12:26:44] elphe: has joined #ruby
[12:27:52] xco: this is nice but i don’t like it because i’d have to know the “index” of the last letter
[12:28:26] hutch34: has joined #ruby
[12:28:29] xco: so i have to know the limit which is “z” and it’s corresponding number “26”
[12:28:47] apeiros: >> ("a".."z").zip(1..9999).to_h # @ xco
[12:28:48] ruby[bot]: apeiros: # => {"a"=>1, "b"=>2, "c"=>3, "d"=>4, "e"=>5, "f"=>6, "g"=>7, "h"=>8, "i"=>9, "j"=>10, "k"=>11, "l"=>12, ...check link for more (https://eval.in/900615)
[12:29:09] apeiros: though honestly, if you don't know how many letters exist in the alphabet, you have other problems :-p
[12:29:30] xco: hahahahha that’s not the point
[12:29:44] xco: the point is to generate keys and values as many as N
[12:29:52] xco: where N is number of element in hash that i want
[12:30:02] matcouto: has joined #ruby
[12:30:11] xco: so the letters “a” and numbers mean nothing :P
[12:30:41] xco: and with the number of letters in my alphabet we have 24 :P
[12:30:48] apeiros: if you *know* that you want N keys
[12:30:57] apeiros: then you KNOW it's 1..N :-p
[12:31:00] Bish: >> (1..100).to_a.map {|x| [x,x]}.to_h
[12:31:01] ruby[bot]: Bish: # => {1=>1, 2=>2, 3=>3, 4=>4, 5=>5, 6=>6, 7=>7, 8=>8, 9=>9, 10=>10, 11=>11, 12=>12, 13=>13, 14=>14, 15=>1 ...check link for more (https://eval.in/900617)
[12:31:26] xco: apeiros: and values?
[12:31:43] Bish: well, what he says is, if the keys do not matter, you want an array
[12:31:47] Bish: sorta, kinda.
[12:31:49] apeiros: xco: well, since you said "a" and "z" mean nothing, you'll have to tell more about the logic for the vlaues
[12:32:13] xco: values should be increments of 1 starting from 1
[12:32:18] apeiros: though actually I think you meant "and keys?", since you use the numbers as the values.
[12:32:33] apeiros: yeah, 1..N
[12:32:38] xco: apeiros: values and keys yes
[12:33:03] cout: has joined #ruby
[12:33:07] jrafanie: has joined #ruby
[12:33:27] yahmds: has joined #ruby
[12:33:31] tcopeland: has joined #ruby
[12:33:35] apeiros: I'll repeat then > xco: well, since you said "a" and "z" mean nothing, you'll have to tell more about the logic for the keys
[12:34:01] apeiros: you only repeated the logic for the values, and that one I gave you already with 1..N
[12:34:21] bob_f: has joined #ruby
[12:34:26] xco: the keys are can be anything random, provided they are unique to hold values upt to N
[12:34:44] apeiros: uh, ok? then…
[12:34:49] xco: makes sense now?
[12:34:50] bob_f: Hi. Is it possible to define metaclass methods via an included module ?
[12:34:59] apeiros: >> n = 99; (1..n).zip(1..n).to_h # there
[12:35:00] ruby[bot]: apeiros: # => {1=>1, 2=>2, 3=>3, 4=>4, 5=>5, 6=>6, 7=>7, 8=>8, 9=>9, 10=>10, 11=>11, 12=>12, 13=>13, 14=>14, 15=>1 ...check link for more (https://eval.in/900618)
[12:35:12] apeiros: the keys are unique
[12:35:35] apeiros: call me crazy but I think your explanation leaves out something important. otherwise I fail to see the point :D
[12:35:52] apeiros: bob_f: yes, though you should use extend.
[12:36:07] xco: excellent try :D @ apeiros
[12:36:12] bob_f: apeiros: I can use extend as well, but I can't make that work either.
[12:36:14] apeiros: >> module X; def wee; "wee!"; end; class A; class << self; include X; end; end; A.wee
[12:36:15] ruby[bot]: apeiros: # => /tmp/execpad-db09813a2fbe/source-db09813a2fbe:7: syntax error, unexpected end-of-input, expecting ke ...check link for more (https://eval.in/900619)
[12:36:36] apeiros: >> module X; def wee; "wee!"; end; end; class A; class << self; include X; end; end; A.wee
[12:36:37] ruby[bot]: apeiros: # => "wee!" (https://eval.in/900620)
[12:36:50] apeiros: bob_f: well, show some code then
[12:37:04] bob_f: Sure, one sec.
[12:38:38] hutch34: has joined #ruby
[12:38:44] bob_f: apeiros: Sorry, I was being stupid - I just want a regular class method here, not a metaclass method.
[12:39:00] Bish: wow zip is cool, never knew what it did
[12:39:38] apeiros: bob_f: hm, mind telling me the difference?
[12:39:58] apeiros: Bish: works like a zipper ;-)
[12:40:29] Bish: yeah well, that name never said me anything
[12:40:32] Bish: then i was like
[12:40:34] apeiros: transpose is the other cool method in that regard. but transpose requires arrays and same length.
[12:40:46] Bish: *looks that one up*
[12:40:56] bob_f: apeiros: I'm trying to define a method in a module that can be called in the class scope of whatever class includes/extends it.
[12:41:10] apeiros: Bish: you can like turn a table 90°
[12:41:22] apeiros: e.g. make columns become rows, and rows become columns
[12:41:46] Bish: [[1,2,3],[4,5,6],[7,8,9]] ?
[12:41:51] apeiros: bob_f: ok. that's a class method. but what's a metaclass method in your opinion?
[12:41:57] Bish: or rather [1,2,3,4,5,6,7,8,9]
[12:42:27] Bish: >> [[1,2,3],[4,5,6],[7,8,9]].transpose
[12:42:28] ruby[bot]: Bish: # => [[1, 4, 7], [2, 5, 8], [3, 6, 9]] (https://eval.in/900621)
[12:42:28] apeiros: >> [[1,2,3],[4,5,6],[7,8,9]].transpose
[12:42:29] JsilverT: has joined #ruby
[12:42:29] ruby[bot]: apeiros: # => [[1, 4, 7], [2, 5, 8], [3, 6, 9]] (https://eval.in/900622)
[12:42:32] bob_f: apeiros: A method defined on the class constructor.
[12:42:38] Bish: oh thats all.
[12:42:44] Bish: dont get when this is useful
[12:43:07] bob_f: apeiros: I think I'm just forgetting that classes are built sooner in Ruby than in Python, so a regular class method can exist before the `end` of the class.
[12:44:28] apeiros: Bish: most common case I use it is when I translate tables, e.g. first_names, last_names, ages = people.transpose; ages.map!(&:to_i); mapped_people = [first_names, last_names, ages].transpose
[12:44:45] apeiros: bob_f: ok, that makes sense.
[12:44:59] apeiros: bob_f: a class method in ruby is just an instance method of the singleton_class
[12:45:13] bob_f: apeiros: Yup, got it.
[12:45:22] bob_f: Thanks for clarifying - having a fuzzy day today ..
[12:45:38] apeiros: and some people call the singleton_class meta class. so I'd assume "metaclass method" to mean the same as class method
[12:46:06] bob_f: apeiros: Yeah, it's really just down to my incorrect assumptions about Ruby's object model.
[12:46:12] apeiros: bob_f: also note that in the module you always have to define the methods as instance methods. include vs. extend determines where those methods end up.
[12:46:40] jokke: hi, anyone here using "rr"? I'm having trouble with doubles bleeding into other tests...
[12:46:55] bob_f: apeiros: Yup, that much I do remember. :)
[12:49:09] hutch34: has joined #ruby
[12:49:56] danielpclark: has joined #ruby
[12:51:42] yusuf34: has joined #ruby
[12:53:44] Bish: apeiros: i see, thanks
[12:54:05] Bish: >> {a:1,b:1}.to_a.transpose.to_h
[12:54:06] ruby[bot]: Bish: # => {:a=>:b, 1=>1} (https://eval.in/900631)
[12:54:21] Bish: hilarious!
[12:55:50] dminuoso: bob_f: The general term is "singleton class". "Metaclass" is internally used to denote singleton classes of class objects themselves.
[12:56:03] aScottishBoat: has joined #ruby
[12:56:10] my123: has joined #ruby
[12:56:10] my123: has joined #ruby
[12:56:30] bob_f: dminuoso: Understood. I've heard the term "singleton class" used for this before, it just always seemed a bit odd, but I'll go with the flow.
[12:56:57] dminuoso: bob_f: What I just said correlates in no way with any convention outside the Ruby source code itself.
[12:59:08] dminuoso: bob_f: My rule of thumb is always: Ruby has no "class methods" or "instance methods". It only has methods, and methods are always on a class or a module.
[12:59:19] hutch34: has joined #ruby
[12:59:35] snowy: has joined #ruby
[13:00:05] Bish: ACTION tries to get a 3 dimensional array and fails
[13:00:15] Bish: in my younger days i did this in c with ease!
[13:00:36] dminuoso: The quirk comes from the fact that modules and classes themselves are ruby objects too. As such if you invoke a method on them, ruby looks in *its* class + ancestory.
[13:00:59] elphe: has joined #ruby
[13:04:01] apeiros: bob_f: re naming - I preferred eigenclass. but since ruby 1.9, there's a method to access it and it's called singleton_class, hence I'd say that's the canonical name in ruby for it.
[13:05:41] alfiemax_: has joined #ruby
[13:06:32] dminuoso: apeiros: Interestingly with all the type theory Im learning, singleton_class fits amazingly well.
[13:07:28] apeiros: my main issue with the term is how easy it's to confuse with singleton pattern
[13:07:36] apeiros: and while the two are related, they aren't the same
[13:07:42] dminuoso: A good intuition is to consider a type a set of possible values. Classes represent that notion -> they form a set of all possible objects constructed from it. And singleton classes have only a single object, thus forming a set with just one element.
[13:07:48] dminuoso: Those are called singleton sets in set theory
[13:08:28] apeiros: oh, didn't know. you happen to know the german term for singleton sets?
[13:09:24] synthroid: has joined #ruby
[13:09:32] hutch34: has joined #ruby
[13:09:49] raynold: has joined #ruby
[13:10:16] vondruch_: has joined #ruby
[13:11:26] matcouto: has joined #ruby
[13:12:43] elomatreb: According to Wikipedia "Einelementige Menge"
[13:12:44] dminuoso: apeiros: Singleton or Einermenge
[13:13:22] dminuoso: But Im not well versed in German terminology.
[13:13:35] apeiros: elomatreb: heh, I'm there right now too :)
[13:13:40] elomatreb: My problem with the Eigenclass term is that it's very inaccessible to someone who doesn't know German
[13:13:46] apeiros: I wondered whether they might be called eigenset. but seems not.
[13:13:52] leah2: it doesnt make sense to germans either :P
[13:14:32] alfiemax: has joined #ruby
[13:14:40] dminuoso: leah2: Just as much as eigenvalues or eigenvectors :P
[13:14:54] leah2: those make slightly more sense, but not much ;)
[13:15:09] apeiros: elomatreb: eh, most technical terms aren't very accessible no matter what. you have to learn what it means anyway.
[13:15:36] apeiros: I didn't learn the meaning of singleton outside of programming either.
[13:15:37] dminuoso: apeiros: Tell me about it. Im advancing beyond beginner levels of category theory - and the terminology becomes quite strange now.
[13:15:56] dminuoso: It's constantly just "accept that its named like this. just do it."
[13:15:58] banisterfiend: has joined #ruby
[13:15:59] elomatreb: Sure, but "metaclass" uses just very common terminology and doesn't require you to learn (parts of) a speaker-hostile language
[13:16:00] leah2: hm, most category theory terms are kinda useful imo :)
[13:16:30] elomatreb: And "singleton" is very clear in it's meaning IMO? "There is only a single one of this"
[13:16:30] leah2: at least in german
[13:16:33] banisterfiend: has joined #ruby
[13:16:52] dminuoso: leah2: ηx for example is pronounced "the component of η at x"
[13:16:56] leah2: fibre, sheaf, quiver
[13:17:01] dminuoso: leah2: what about ring?
[13:17:10] leah2: those have kinda geometric ideas
[13:17:15] dminuoso: No it does not.
[13:17:16] dminuoso: Rings dont.
[13:17:22] leah2: dminuoso: at least for Z_n ring makes lot of sense? ;)
[13:17:34] dminuoso: leah2: but not ethymologically. let me dig it up again
[13:18:07] dminuoso: leah2: https://math.stackexchange.com/a/61505
[13:18:19] dminuoso: based on this (and Ive done some research based on this, it appears to be correct) its mostly just speculation.
[13:19:05] dminuoso: I mean if you poke further into algebraic structures, it becomes a real mess
[13:19:15] dminuoso: Rng (its obvious what they did there, but its completely silly)
[13:19:27] leah2: i like that :D
[13:19:34] dminuoso: What's an rng called in German?
[13:19:34] leah2: and Rig ;)
[13:19:51] hutch34: has joined #ruby
[13:20:22] leah2: some use Ring and Ring mit Eins
[13:20:55] dminuoso: Literally or Ring1 ?
[13:21:01] leah2: literally
[13:21:05] leah2: i've seen R1ng too
[13:21:13] leah2: it depends on the field (hehe) i guess
[13:21:19] dminuoso: Yeah as it does in math.
[13:21:20] leah2: some people always assume unitary rings
[13:21:29] dminuoso: leah2: Ive been battling with the 3 different notations for natural transformations.
[13:21:43] leah2: or two notations for composition? :D
[13:21:43] dminuoso: For the past 2 days.
[13:21:52] dminuoso: Well yeah because horizontal and vertical composition
[13:21:58] dminuoso: Its an inconsistent mess.
[13:22:43] shreve: has joined #ruby
[13:22:51] dminuoso: I can live with it, if special notation is defined somewhere. But a lot of papers just make up their own notation, and expect the reader to deduce the meaning from the context.
[13:23:16] dminuoso: leah2: Did or do you study anything math related?
[13:23:22] leah2: i have a bsc
[13:23:31] dminuoso: Which field?
[13:23:37] leah2: general math
[13:23:43] leah2: then msc in cs
[13:23:44] dminuoso: What is "general math" ?
[13:23:51] leah2: we dont have specialization
[13:24:01] leah2: my thesis was about constructive analysis
[13:24:02] dminuoso: Ah okay. So you just took a variety of courses?
[13:25:08] leah2: did mostly things without applications :D
[13:25:46] dminuoso: leah2: This is why Im studying category theory right now, it has broad implications in (functional) programming. :)
[13:26:13] leah2: we had awodney as a guest lecturer during my time, but i didnt follow the course closely
[13:26:41] dminuoso: Though some bits and juicy pieces came from it. The intuition that a ring is just a monoid in the category of commutative groups is amazing.
[13:26:53] dminuoso: That is about the cleanest definition of a ring (since the topic was raised) Ive ever seen.
[13:29:24] dminuoso: Once Im through with monads from the categorical perspective, I think I should study f-algebras
[13:29:55] hutch34: has joined #ruby
[13:31:18] InfinityFye: has joined #ruby
[13:34:44] Mon_Ouie: has joined #ruby
[13:36:35] kobain: has joined #ruby
[13:39:40] bmurt: has joined #ruby
[13:44:48] hutch34: has joined #ruby
[13:45:56] cdg: has joined #ruby
[13:47:11] Jameser: has joined #ruby
[13:47:41] alfiemax: has joined #ruby
[13:52:43] workmad3: has joined #ruby
[13:52:44] matcouto: has joined #ruby
[13:54:33] banisterfiend: has joined #ruby
[13:55:41] GodFather: has joined #ruby
[13:57:12] kryptoz: has joined #ruby
[13:58:53] banisterfiend: has joined #ruby
[14:01:27] Silthias: has joined #ruby
[14:01:34] cdg: has joined #ruby
[14:02:19] tcopeland: has joined #ruby
[14:02:36] mtkd: has joined #ruby
[14:03:02] jrafanie: has joined #ruby
[14:03:32] yahmds: has joined #ruby
[14:04:45] Silthias1: has joined #ruby
[14:06:03] mson: has joined #ruby
[14:06:06] qqmash: has joined #ruby
[14:13:37] alfiemax: has joined #ruby
[14:14:54] uZiel: has joined #ruby
[14:16:52] veeti: has joined #ruby
[14:17:42] pwnd_nsfw`: has joined #ruby
[14:20:07] hahuang65: has joined #ruby
[14:28:37] d10n-work: has joined #ruby
[14:28:41] vtx: has joined #ruby
[14:33:45] DLSteve_: has joined #ruby
[14:34:10] matcouto: has joined #ruby
[14:34:22] vondruch: has joined #ruby
[14:38:04] bmurt: has joined #ruby
[14:39:39] gnoss: has joined #ruby
[14:42:13] workmad3: has joined #ruby
[14:44:53] oleo: has joined #ruby
[14:45:52] wald0: has joined #ruby
[14:48:27] tcopeland: has joined #ruby
[15:01:35] hutch34: has joined #ruby
[15:02:53] safetypin: has joined #ruby
[15:05:34] conta1: has joined #ruby
[15:07:48] Sylario: has joined #ruby
[15:08:11] polishdub: has joined #ruby
[15:08:57] pwnd_nsfw: has joined #ruby
[15:12:32] mim1k: has joined #ruby
[15:14:43] Rapture: has joined #ruby
[15:15:32] matcouto: has joined #ruby
[15:16:43] cdg: has joined #ruby
[15:16:52] Jameser: has joined #ruby
[15:17:29] apeiros: has joined #ruby
[15:18:41] alfiemax: has joined #ruby
[15:20:22] guille-moe: has joined #ruby
[15:21:12] tacoboy: has joined #ruby
[15:21:50] iamarun: has joined #ruby
[15:21:59] mim1k: has joined #ruby
[15:28:11] chouhoulis: has joined #ruby
[15:31:52] jrafanie: has joined #ruby
[15:33:08] truenito: has joined #ruby
[15:35:30] Torrone: has joined #ruby
[15:37:54] Torrone: Hello, I'm running a rails application on an old version of ruby (1.9.3). I'm doing some stress tests on a server instance and I've noticed that after the test has finished, the % of used memory of ruby processes does not go down. How can I address this issue? Is this due to the ruby version being old or should I check some other factors? Thank you
[15:39:28] jordanm: Torrone: that's just how MRI works, most (any?) memory is not returned to the OS even after GC
[15:41:45] jordanm: Torrone: you will find that's the case with most interpreted languages
[15:41:46] banisterfiend: has joined #ruby
[15:42:09] Torrone: jordanm, I see, I'm trying to find out if I can do anything about the performance issues the application is suffering from, requests take longer and longer to process as their number increases
[15:42:32] apeiros: has joined #ruby
[15:43:55] jordanm: Torrone: there are many reasons for that
[15:44:27] jordanm: Torrone: more concurrent requests == less available resources, more strain on shared data sources
[15:45:14] jordanm: Torrone: also depending on what you are using for your rack server, your application is only going to be able to handle a certain number of requests before requests get queued
[15:45:39] jordanm: Torrone: so it won't even start processing the requests until it has finished current requests and freed a worker and/or thread
[15:46:39] Torrone: jordanm, I know, I'm using Puma + nginx
[15:46:59] jordanm: performance tuning can be a long and complex process, but throwing more servers at it always an option
[15:47:20] jordanm: Torrone: yeah, so you can only handle num_workers * num_threads requests concurrently
[15:47:29] jordanm: before puma will queue requests
[15:49:45] alfiemax: has joined #ruby
[15:51:44] cdg: has joined #ruby
[15:53:55] alfiemax: has joined #ruby
[15:54:00] Dutjub: has joined #ruby
[15:55:02] jolamb: I have a sacreligious question: Is there a setting or an add-on cop for Rubocop to flag "unless" and convert it to "if !"?
[15:58:13] Torrone: jordan, seems like the app is taking way too much CPU, it goes to 100% on a AWS c4.large very quickly
[15:58:51] Torrone: wondering wether or not it's worth upgrading to a newer ruby/rails version to see the difference
[15:59:34] vondruch: has joined #ruby
[15:59:42] Dutjub: has joined #ruby
[16:00:39] rafadc: has joined #ruby
[16:01:21] rabajaj: has joined #ruby
[16:03:19] apeiros: has joined #ruby
[16:03:23] rippa: has joined #ruby
[16:03:38] polishdub: has left #ruby: ()
[16:04:58] fusta: has joined #ruby
[16:06:12] jrafanie: has joined #ruby
[16:07:30] cschneid_: has joined #ruby
[16:08:06] GodFather: has joined #ruby
[16:11:29] cdg: has joined #ruby
[16:13:15] troys: has joined #ruby
[16:14:54] isene: has joined #ruby
[16:17:38] stoopidmunkey: has joined #ruby
[16:20:34] isene: I need to flatten a hash with arrays and write the result to a file. Basically I want to write to the file exactly what I get when I do "puts" of this array: [["0C6000", [nil, "test", nil, "isene"]], ["0C8000", [nil, nil, nil, "isene"]], ["0C8001", [nil, nil, nil, "isene"]]]
[16:20:38] isene: Can I somehow do a puts on that array and capture that output and write to a file?
[16:20:54] hahuang65: has joined #ruby
[16:20:58] cschneid_: has joined #ruby
[16:21:42] john__: has joined #ruby
[16:27:24] jrgriffiniii: has joined #ruby
[16:30:19] ShalokShalom: has joined #ruby
[16:31:30] dinfuehr: has joined #ruby
[16:31:36] jackjackdripper: has joined #ruby
[16:32:04] jrafanie: has joined #ruby
[16:33:24] guille-moe: has joined #ruby
[16:33:38] cagomez: has joined #ruby
[16:34:01] apeiros: has joined #ruby
[16:35:39] apeiros: has joined #ruby
[16:38:26] Devalo: has joined #ruby
[16:41:25] jolamb: isene: look at pp
[16:41:53] jrgriffiniii: has joined #ruby
[16:42:05] jolamb: isene: http://ruby-doc.org/stdlib-2.1.0/libdoc/prettyprint/rdoc/PrettyPrint.html#method-c-format
[16:42:09] jolamb: one way to do it
[16:42:20] jolamb: isene: why not serialize to json or yaml tho?
[16:43:57] Dimik: has joined #ruby
[16:45:13] Illianthe: has joined #ruby
[16:45:37] isene: nevermind - I solved it with this: romlist = romscheme.flatten.join("\n")
[16:47:26] selim: has joined #ruby
[16:48:08] stoopidmunkey: has joined #ruby
[16:49:24] stoopidmunkey: has joined #ruby
[16:51:24] iamarun: has joined #ruby
[16:56:50] rafadc: has joined #ruby
[16:58:30] darkness: has joined #ruby
[16:58:55] rouge: has joined #ruby
[16:59:43] zautomata: has joined #ruby
[17:00:16] Exhiled: has joined #ruby
[17:01:43] apeiros: has joined #ruby
[17:03:33] stoopidmunkey: has joined #ruby
[17:06:04] apeiros: has joined #ruby
[17:07:55] [Butch]: has joined #ruby
[17:10:57] millerti: has joined #ruby
[17:12:07] Torrone: has joined #ruby
[17:16:30] yeticry: has joined #ruby
[17:16:32] synthroid: has joined #ruby
[17:28:26] jrgriffiniii: has joined #ruby
[17:31:22] Technodrome: has joined #ruby
[17:32:00] hahuang65: has joined #ruby
[17:32:56] mtkd: has joined #ruby
[17:34:21] weaksauce: has joined #ruby
[17:35:18] tcopeland: has joined #ruby
[17:36:57] BlaDe^: has joined #ruby
[17:38:58] BlaDe^: hi-- i'm trying to debug an issue right now and really struggling, could somebody take a look? https://pastebin.com/r1GG3mxy
[17:38:58] ruby[bot]: BlaDe^: as I told you already, please use https://gist.github.com
[17:39:57] BlaDe^: whoops: https://gist.github.com/anonymous/51be4401412b12cb2d4798bb02f594fe
[17:41:18] saslam: has joined #ruby
[17:41:21] BlaDe^: wondering how my change could so drastically change the stack trace... am I wrong in my exception handling?
[17:42:21] synthroid: has joined #ruby
[17:46:33] Exhiled: has joined #ruby
[17:46:36] conta2: has joined #ruby
[17:46:52] mr_foto: has joined #ruby
[17:47:16] orbyt_: has joined #ruby
[17:50:41] scientes: has joined #ruby
[17:50:41] scientes: has joined #ruby
[17:53:26] yqt: has joined #ruby
[17:53:36] conta2: has joined #ruby
[17:53:36] nachoman: has joined #ruby
[17:55:19] nadir: has joined #ruby
[17:56:28] kobain: has joined #ruby
[17:58:49] aScottishBoat: has joined #ruby
[17:59:38] kenichi: has joined #ruby
[18:01:01] jamesaxl: has joined #ruby
[18:02:43] brucebag: has joined #ruby
[18:04:10] duckpuppy: has joined #ruby
[18:05:54] ur5us: has joined #ruby
[18:06:56] Rapture: has joined #ruby
[18:10:21] imode: has joined #ruby
[18:14:38] Senecea: has joined #ruby
[18:15:06] cdg: has joined #ruby
[18:15:58] jrafanie: has joined #ruby
[18:16:40] truenito: has joined #ruby
[18:17:47] jrgriffiniii: has joined #ruby
[18:19:50] jamesaxl: has joined #ruby
[18:22:10] tomphp: has joined #ruby
[18:22:23] jolamb: BlaDe^: presumably your @reader.read(1) call is returning nil, this the NoMethodError in the first trace
[18:23:03] jolamb: BlaDe^: The second stack trace is probably because @reader.inspect has a bug - what does "byte!" do here? https://gist.github.com/anonymous/51be4401412b12cb2d4798bb02f594fe
[18:23:04] sagax: has joined #ruby
[18:23:16] BlaDe^: not a clue jolamb :<
[18:23:41] jolamb: BlaDe^: oh wait, I'm misreading that bit
[18:23:50] tAn: has joined #ruby
[18:24:13] jolamb: b = byte! calling the method in line 20
[18:24:59] jolamb: BlaDe^: [139] pry(main)> nil & 0x7F => false
[18:25:52] claudiuinberlin: has joined #ruby
[18:26:12] jolamb: BlaDe^: b is nil because @reader.read(1) is returning nil, you're catching the exception but you're not returning a valid value from inside the rescue block, so the method is returning nil
[18:27:13] konsolebox: has joined #ruby
[18:27:34] jolamb: BlaDe^: what is @reader?
[18:27:41] michael3: has joined #ruby
[18:29:25] jolamb: BlaDe^: let me rephrase - what are you passing in as your reader when you initialize BinaryDecoder|
[18:30:11] banisterfiend: has joined #ruby
[18:31:45] rouge: has joined #ruby
[18:32:48] BlaDe^: jolamb: this is a library i'm using , but haven't written any of the code
[18:33:02] BlaDe^: it's unfortunately broken my product due to (seemingly) having a bug
[18:33:15] BlaDe^: it's been working for 8 months and suddenly is choking on some data but I'm struggling to identify what right now
[18:33:36] Senecea: has joined #ruby
[18:33:45] rouge: has joined #ruby
[18:34:00] lupine: has joined #ruby
[18:35:11] jolamb: BlaDe^: I'm guessing whatever reader it's using isn't blocking, so read(1) when there's no data ready is returning nil
[18:35:53] jolamb: so maybe it needs to be: if (b = @reader.read(1)) b.unpack('C').first
[18:36:18] Exhiled: has joined #ruby
[18:41:09] impermanence: has joined #ruby
[18:41:17] dtzuzu: has joined #ruby
[18:44:56] chrisgopher: has joined #ruby
[18:45:04] Technodrome: has joined #ruby
[18:47:54] lacour: has joined #ruby
[18:48:48] jenrzzz: has joined #ruby
[18:48:49] jenrzzz: has joined #ruby
[18:49:58] guacamole: has joined #ruby
[18:56:32] tAn: has joined #ruby
[18:58:06] aspiers: has joined #ruby
[18:58:35] alfiemax: has joined #ruby
[19:00:38] threh: has joined #ruby
[19:02:43] bmurt: has joined #ruby
[19:06:25] ozzieneher: has joined #ruby
[19:15:44] johnny56_: has joined #ruby
[19:17:50] kanobt61: has joined #ruby
[19:18:34] jenrzzz: has joined #ruby
[19:23:51] jamesaxl: has joined #ruby
[19:26:58] elphe: has joined #ruby
[19:28:31] FrostCandy: has joined #ruby
[19:33:21] Technodrome: has joined #ruby
[19:34:22] kryptoz: has joined #ruby
[19:38:05] JsilverT: has joined #ruby
[19:40:48] rfoust: has joined #ruby
[19:40:52] _sfiguser: has joined #ruby
[19:41:21] Asher: has joined #ruby
[19:41:55] Devalo: has joined #ruby
[19:43:07] SeepingN: has joined #ruby
[19:49:11] urk187: has joined #ruby
[19:55:47] Exhiled: has joined #ruby
[19:56:17] foooobear: has joined #ruby
[20:00:44] konsolebox_: has joined #ruby
[20:03:19] jrafanie_: has joined #ruby
[20:05:05] muelleme: has joined #ruby
[20:06:26] KevinMGranger: has joined #ruby
[20:06:33] ddffg: has joined #ruby
[20:07:07] zautomata: has joined #ruby
[20:08:05] alfiemax: has joined #ruby
[20:08:07] jackjackdripper: has joined #ruby
[20:13:18] scientes: has joined #ruby
[20:14:34] ur5us: has joined #ruby
[20:16:09] jackjackdripper: has joined #ruby
[20:16:26] jamesaxl: has joined #ruby
[20:16:33] mikecmpbll: has joined #ruby
[20:17:20] garyserj: has joined #ruby
[20:18:25] conta: has joined #ruby
[20:18:25] tAn: has joined #ruby
[20:19:16] raynold: has joined #ruby
[20:19:30] ErhardtMundt: has joined #ruby
[20:21:15] romain_t: has joined #ruby
[20:24:19] shtirlic: has joined #ruby
[20:24:28] chouhoulis: has joined #ruby
[20:26:18] Kus: has joined #ruby
[20:26:53] apeiros: has joined #ruby
[20:27:44] mkroman: has joined #ruby
[20:29:42] ozzieneher: has joined #ruby
[20:32:30] claudiuinberlin: has joined #ruby
[20:36:28] GodFather: has joined #ruby
[20:37:18] romain_t: has joined #ruby
[20:38:20] c0ncealed: has joined #ruby
[20:38:41] Devalo: has joined #ruby
[20:41:29] remix2000: has joined #ruby
[20:42:32] Puffball: has joined #ruby
[20:42:41] ShekharReddy: has joined #ruby
[20:44:21] minimalism: has joined #ruby
[20:46:59] ozzieneher: has joined #ruby
[20:47:36] ur5us: has joined #ruby
[20:51:21] orbyt_: has joined #ruby
[20:53:28] cseder: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[21:00:04] tacoboy: has joined #ruby
[21:05:55] matcouto: has joined #ruby
[21:07:12] ozzieneher: has joined #ruby
[21:07:33] Devalo: has joined #ruby
[21:07:56] ltp: has joined #ruby
[21:11:10] cagomez: has joined #ruby
[21:11:25] romain_t: has joined #ruby
[21:12:12] adaedra: hello rubyists
[21:13:04] orbyt_: has joined #ruby
[21:13:39] adaedra: Since people seem to think I disappeared, I'll try to spend a little bit more of time here
[21:14:42] danielpclark: has joined #ruby
[21:14:57] ap4y: has joined #ruby
[21:15:47] RickHull: I think I exposed some kind of bug on ruby trunk (2.5.0-dev) from the last few days
[21:15:58] RickHull: a travis run on ruby-head started failing
[21:17:14] adaedra: You lie, there are no bugs in Ruby, it is perfection. 😇
[21:17:23] RickHull: argument stack underflow with minitest/spec
[21:18:24] RickHull: I've been horsing around with mruby -- working in C is a chore and a half
[21:18:51] chouhoulis: has joined #ruby
[21:19:08] apeiros: adaedra's ghost is haunting #ruby
[21:20:25] Devalo: has joined #ruby
[21:20:57] cagomez: has joined #ruby
[21:21:24] apeiros: adaedra: try this in 2.4: require 'bigdecimal'; 4.fdiv(BigDecimal("2"))
[21:21:30] apeiros: (re "there's no bug in ruby")
[21:22:03] adaedra: apeiros: require 'humour'
[21:22:19] apeiros: LoadError, no such file found
[21:22:28] adaedra: Are you german?
[21:22:43] apeiros: that insult… are you?
[21:23:02] apeiros: (dminuoso didn't see that, right?)
[21:23:31] apeiros: adaedra: anyway, try it :-p
[21:23:55] adaedra: Yeah, it gives almost 0
[21:23:59] Exhiled: has joined #ruby
[21:24:12] apeiros: it gives a value < Float::MIN
[21:24:21] _main_: has joined #ruby
[21:24:51] apeiros: I mean, it's like two wtf's in one
[21:24:58] adaedra: the limits for Float are not the same than for BigDecimal tho, no?
[21:25:08] apeiros: sure, but the result is a float
[21:25:25] RickHull: what does it look like bitwise?
[21:25:49] apeiros: reminds me that I wanted to check whether it's a subnormal
[21:25:59] RickHull: i guess mostly a jumble, mantissa?
[21:26:00] adaedra: that does not seam very normal
[21:26:48] Devalo: has joined #ruby
[21:27:06] apeiros: RickHull: [v].pack("G*").unpack("B*") # => ["0000000000000000000000000000000100000011110000110110001011100000"]
[21:27:08] elphe: has joined #ruby
[21:27:29] apeiros: where v is the result of an Integer#fdiv(BigDecimal) (any fdiv with those two operands returns the same value)
[21:27:33] Devalo: has joined #ruby
[21:28:28] RickHull: looks pretty small to me xD
[21:28:35] ruby[bot]: al2o3-cr: # => /tmp/execpad-e7e632c2de27/source-e7e632c2de27:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/900887)
[21:29:01] al2o3-cr: G double precision
[21:32:25] orbyt_: has joined #ruby
[21:32:59] guacamole: has joined #ruby
[21:33:21] veeti: has joined #ruby
[21:33:40] kobain: has joined #ruby
[21:40:41] cdg: has joined #ruby
[21:42:10] Hexafox[I]: has joined #ruby
[21:43:28] romain_t: has joined #ruby
[21:45:36] al2o3-cr: >> ['foo'].pack 'm'
[21:45:37] ruby[bot]: al2o3-cr: # => "Zm9v\n" (https://eval.in/900890)
[21:45:49] al2o3-cr: >> ['foo'].pack 'm0' #
[21:45:51] ruby[bot]: al2o3-cr: # => "Zm9v" (https://eval.in/900891)
[21:46:39] al2o3-cr: String#pack is very useful.
[21:46:59] Devalo: has joined #ruby
[21:47:01] al2o3-cr: and some under used string directives.
[21:47:07] lupine: but you shouldn't use it for base64
[21:47:24] al2o3-cr: lupine: why not?
[21:48:27] lupine: because it's baselessly obscure
[21:48:33] lupine: even though it's base64
[21:48:41] lupine: (and since that rhymes, you can't argue)
[21:48:51] orbyt_: has joined #ruby
[21:49:04] lupine: pleasure doing business
[21:49:25] _main_: has joined #ruby
[21:50:24] _main_: has joined #ruby
[21:50:27] kitsunenokenja: has joined #ruby
[21:50:41] jrafanie: has joined #ruby
[21:50:53] al2o3-cr: e.g getting the memory address of a string.
[21:52:43] pwnd_nsfw`: has joined #ruby
[21:53:51] apeiros: lupine: tho, Base64.encode64 is just a wrapper around pack :D (but yes, it's much more clear what you're doing)
[21:54:04] al2o3-cr: >> v = "v"; [v].pack('p').unpack1('l!')
[21:54:05] ruby[bot]: al2o3-cr: # => undefined method `unpack1' for "\x9CZq@":String ...check link for more (https://eval.in/900892)
[21:54:11] al2o3-cr: >> v = "v"; [v].pack('p').unpack('l!')
[21:54:12] ruby[bot]: al2o3-cr: # => [1090018028] (https://eval.in/900893)
[21:55:39] ozzieneher: has joined #ruby
[22:00:47] RickHull: do not use pack for
[22:00:58] RickHull: base sixty four; pack's for sure
[22:01:03] RickHull: basically obscure
[22:01:58] al2o3-cr: not anymore.
[22:01:59] Dimik: has joined #ruby
[22:02:30] lexruee: has joined #ruby
[22:03:24] baweaver: Why do you Haiku; When a normal phrase would do; Then none understand
[22:04:14] cdg: has joined #ruby
[22:04:52] pwnd_nsfw: has joined #ruby
[22:05:38] baweaver: RickHull: I can improvise; Making haikus on the fly; Must you ask me why?
[22:06:58] pilne: has joined #ruby
[22:07:21] RickHull: haikus are likely; sources of effluvia; to flood with newlines
[22:10:36] lexruee: has joined #ruby
[22:10:56] ozzieneher: has joined #ruby
[22:12:49] mim1k: has joined #ruby
[22:14:51] cdg_: has joined #ruby
[22:16:12] rfoust: has joined #ruby
[22:22:32] elphe: has joined #ruby
[22:24:32] ap4y: has joined #ruby
[22:31:49] tacoboy: has joined #ruby
[22:32:22] Devalo: has joined #ruby
[22:32:53] guacamole: has joined #ruby
[22:34:44] chouhoulis: has joined #ruby
[22:35:21] alfiemax: has joined #ruby
[22:36:08] rhyselsmore: has joined #ruby
[22:38:42] chouhoul_: has joined #ruby
[22:39:28] Rapture: has joined #ruby
[22:39:30] dviola: has joined #ruby
[22:42:12] Devalo: has joined #ruby
[22:44:27] scientes: has joined #ruby
[22:48:16] charliesome: has joined #ruby
[22:49:49] cdg: has joined #ruby
[22:51:57] kapil___: has joined #ruby
[22:54:21] cdg_: has joined #ruby
[22:54:54] cdg_: has joined #ruby
[22:55:09] eckhardt: has joined #ruby
[23:02:59] mjolnird: has joined #ruby
[23:03:01] cdg: has joined #ruby
[23:05:29] thinkpad: has joined #ruby
[23:15:35] Azure: has joined #ruby
[23:17:12] weaksauce: has joined #ruby
[23:22:35] chouhoulis: has joined #ruby
[23:23:39] aroaminggeek: has joined #ruby
[23:25:02] Freshnuts: has joined #ruby
[23:27:48] veeti: has joined #ruby
[23:29:19] guille-moe: has joined #ruby
[23:33:48] nofxx: has joined #ruby
[23:34:20] Success: has joined #ruby
[23:35:15] mson: has joined #ruby
[23:35:38] eckhardt: has joined #ruby
[23:35:49] kryptoz: has joined #ruby
[23:35:59] naprimer2: has joined #ruby
[23:37:16] Devalo: has joined #ruby
[23:41:20] Devalo: has joined #ruby
[23:42:06] Devalo: has joined #ruby
[23:48:36] Success: has joined #ruby
[23:52:19] Devalo: has joined #ruby
[23:53:16] cdg: has joined #ruby
[23:54:52] ramfjord: has joined #ruby
[23:56:27] dviola: has joined #ruby
[23:58:39] DTZUZU2: has joined #ruby
[23:59:26] veeti: has joined #ruby