« Back to channel list

#ruby - 04 November 2017

« Back 1 day Forward 1 day »
[00:00:37] jrabe: has joined #ruby
[00:00:59] cagomez: has joined #ruby
[00:08:38] ahurst: has joined #ruby
[00:09:18] live__: has joined #ruby
[00:11:01] cdg: has joined #ruby
[00:12:36] jhack: has joined #ruby
[00:15:08] jhack: has left #ruby: ()
[00:16:38] tcopeland: has joined #ruby
[00:17:16] rivalomega: has joined #ruby
[00:17:57] enterprisey: has joined #ruby
[00:18:07] Renich_: has joined #ruby
[00:19:54] rivalome_: has joined #ruby
[00:22:15] Renich_: has joined #ruby
[00:22:59] Rodya_: has joined #ruby
[00:25:32] Renich_: has joined #ruby
[00:38:01] Rodya_: has joined #ruby
[00:42:12] _whitelogger: has joined #ruby
[00:47:01] kaitlyn: has joined #ruby
[00:48:09] goyox86: has joined #ruby
[00:49:50] Rodya_: has joined #ruby
[00:50:27] milardovich: has joined #ruby
[00:53:23] jhack: has joined #ruby
[00:54:29] Technodrome: has joined #ruby
[00:54:37] orbyt_: has joined #ruby
[00:57:28] mson: has joined #ruby
[01:07:37] mim1k: has joined #ruby
[01:11:38] borodin: has joined #ruby
[01:13:29] s3nd1v0g1us: has joined #ruby
[01:13:52] alnewkirk: has joined #ruby
[01:17:04] sucks_: has joined #ruby
[01:18:55] apparition: has joined #ruby
[01:23:02] alnewkirk: has joined #ruby
[01:23:14] cam27: has joined #ruby
[01:24:20] Tempesta: has joined #ruby
[01:24:21] Tempesta: has joined #ruby
[01:28:51] quiller: has joined #ruby
[01:29:14] pb122: has joined #ruby
[01:36:46] alnewkirk: has joined #ruby
[01:36:47] Rodya_: has joined #ruby
[01:37:53] bdonnahue: has joined #ruby
[01:40:02] eclm: has joined #ruby
[01:44:28] milardovich: has joined #ruby
[01:45:02] mjolnird: has joined #ruby
[01:45:18] noobineer: has joined #ruby
[01:45:57] alnewkirk: has joined #ruby
[01:48:06] jenrzzz: has joined #ruby
[01:58:25] yabbes: has joined #ruby
[01:59:38] alnewkirk: has joined #ruby
[02:00:27] jenrzzz: has joined #ruby
[02:00:42] Rodya_: has joined #ruby
[02:01:53] cdg: has joined #ruby
[02:02:23] jottr: has joined #ruby
[02:08:22] d^sh: has joined #ruby
[02:08:49] alnewkirk: has joined #ruby
[02:11:06] ahrs: has joined #ruby
[02:16:35] alfiemax: has joined #ruby
[02:17:25] Rodya_: has joined #ruby
[02:18:17] ResidentBiscuit: has joined #ruby
[02:21:01] neo95: has joined #ruby
[02:22:35] alnewkirk: has joined #ruby
[02:29:40] alan_w: has joined #ruby
[02:30:31] oleo2: has joined #ruby
[02:34:47] soloscshaw: has joined #ruby
[02:36:24] alnewkirk: has joined #ruby
[02:42:49] alan_w: has joined #ruby
[02:42:58] Rodya_: has joined #ruby
[02:46:28] Rodya_: has joined #ruby
[02:49:21] ahurst: has joined #ruby
[02:50:06] alnewkirk: has joined #ruby
[02:56:23] Rodya_: has joined #ruby
[02:57:18] gizmore|2: has joined #ruby
[02:57:36] oleo2: has joined #ruby
[03:00:02] dopie: has joined #ruby
[03:00:23] dopie: hey guys how can I put this epoch format into a readable date / time format?
[03:00:25] dopie: 1509989400000
[03:00:47] oleo2: has joined #ruby
[03:00:48] dopie: milliseconds
[03:02:37] jackjackdripper: has joined #ruby
[03:03:52] alnewkirk: has joined #ruby
[03:04:06] oleo2: has joined #ruby
[03:04:16] elomatreb: dopie: Divide by 1000 to turn it into a regular unix timestamp and use Time.at and strftime?
[03:04:58] ramfjord: has joined #ruby
[03:08:09] mim1k: has joined #ruby
[03:09:35] havenwood: >> Time.at(1509989400000/1000r).to_s
[03:09:36] ruby[bot]: havenwood: # => "2017-11-06 17:30:00 +0000" (https://eval.in/892786)
[03:10:03] havenwood: >> 1000r.class
[03:10:04] ruby[bot]: havenwood: # => Rational (https://eval.in/892787)
[03:11:04] shinnya: has joined #ruby
[03:11:58] havenwood: dopie: Time#at also takes microseconds as a second argument - if you want to give seconds then microseconds.
[03:12:54] havenwood: RickHull: A handy thing about Rational is they can handle accurate nanosecond values since Epoch, unlike Float.
[03:13:12] havenwood: "IEEE 754 double is not accurate enough to represent the number of nanoseconds since the Epoch."
[03:13:45] RickHull: I like more handy support for rationals. floats for decimals is usually not what people actually want
[03:13:57] havenwood: RickHull: aye
[03:14:32] RickHull: floats are good for geometry, scientific computing, umm...
[03:14:34] nofxx1: has joined #ruby
[03:15:33] RickHull: >> Math::PI.to_r
[03:15:34] ruby[bot]: RickHull: # => (884279719003555/281474976710656) (https://eval.in/892788)
[03:15:42] RickHull: wrong, it's 22/7
[03:17:38] alnewkirk: has joined #ruby
[03:17:52] enterprisey: has joined #ruby
[03:21:21] Rodya_: has joined #ruby
[03:24:30] alex``: has joined #ruby
[03:25:33] uZiel: has joined #ruby
[03:27:22] bruce_lee: has joined #ruby
[03:27:23] bruce_lee: has joined #ruby
[03:27:42] troulouliou_div2: has joined #ruby
[03:29:03] kies: has joined #ruby
[03:31:01] Rodya_: has joined #ruby
[03:31:22] alnewkirk: has joined #ruby
[03:40:22] Xiti: has joined #ruby
[03:42:56] ramfjord: has joined #ruby
[03:45:12] alnewkirk: has joined #ruby
[03:49:46] eb0t: has joined #ruby
[03:49:59] eblip: has joined #ruby
[03:50:07] alexertech: has joined #ruby
[03:58:57] alnewkirk: has joined #ruby
[03:59:02] govg: has joined #ruby
[04:01:25] redondos: has joined #ruby
[04:03:14] jottr: has joined #ruby
[04:06:06] mr_rich101: has joined #ruby
[04:06:37] mim1k: has joined #ruby
[04:12:41] alnewkirk: has joined #ruby
[04:13:42] Sammichmaker: has joined #ruby
[04:17:22] cdg: has joined #ruby
[04:20:46] wolakkk: has joined #ruby
[04:26:22] alnewkirk: has joined #ruby
[04:26:23] Ryzokuken: has joined #ruby
[04:28:11] podlech: has joined #ruby
[04:31:41] Rodya_: has joined #ruby
[04:39:52] ramfjord: has joined #ruby
[04:40:06] alnewkirk: has joined #ruby
[04:43:44] AnoHito: has joined #ruby
[04:43:48] AnoHito_: has joined #ruby
[04:44:18] AnoHito: has joined #ruby
[04:44:36] gix: has joined #ruby
[04:49:18] alnewkirk: has joined #ruby
[04:54:11] _whitelogger: has joined #ruby
[04:58:26] alnewkirk: has joined #ruby
[05:00:09] |ifei5good: has joined #ruby
[05:01:17] milardovich: has joined #ruby
[05:05:12] jackjackdripper: has joined #ruby
[05:08:30] banisterfiend: has joined #ruby
[05:12:11] alnewkirk: has joined #ruby
[05:13:18] RickHull: http://ryanbigg.com/2017/11/how-require-loads-a-gem
[05:13:59] RickHull: it occurs to me, wouldn't it be much simpler and more efficient to specify the gem/package and not just the filename?
[05:14:12] RickHull: simpler on the back-end rather than searching
[05:14:49] RickHull: from('foo').require('stuff') # or w/e
[05:15:32] RickHull: from('stdlib').require('set')
[05:17:17] RickHull: this also prevents the problem of one gem clobbering another
[05:17:27] RickHull: in terms of dir names
[05:20:14] matthewd: Yes.. though the search could also be avoided by remembering which files are in which gems
[05:22:20] texasmynsted: has joined #ruby
[05:25:54] jackjackdripper: has joined #ruby
[05:25:57] alnewkirk: has joined #ruby
[05:28:19] RickHull: drbrain: surely this has been proposed before...
[05:29:23] RickHull: it seems like it could be pretty easily supported on an optional / transitional basis
[05:29:39] RickHull: notwithstanding filesystem layout hurdles
[05:30:08] matthewd: That's quite the "notwithstanding"
[05:30:22] RickHull: just a SMOP ;)
[05:30:32] RickHull: small matter of programming
[05:30:57] RickHull: i'm guessing you could give each gem its own lib
[05:31:04] RickHull: symlink them all into the pit of despair
[05:31:19] RickHull: and stop doing naked requires for gems in ruby 3.0
[05:31:40] alfiemax: has joined #ruby
[05:33:53] Rodya_: has joined #ruby
[05:34:37] matthewd: "could", yes -- but you're pretty fundamentally redefining how ruby loads code
[05:36:11] matthewd: And you don't need to go that far; track files in gems, and that's all you need... if you're prepared to give up current load order
[05:37:18] milardovich: has joined #ruby
[05:37:19] LocaMocha: has joined #ruby
[05:38:48] guacamole: has joined #ruby
[05:39:43] alnewkirk: has joined #ruby
[05:42:45] waveprop: do folks unit test client-side code such as jquery and (shudders) react?
[05:48:53] alnewkirk: has joined #ruby
[05:53:00] RickHull: i would hope so
[05:55:41] c0ncealed: has joined #ruby
[05:55:45] RickHull: google says https://medium.com/powtoon-engineering/a-complete-guide-to-testing-javascript-in-2017-a217b4cd5a2a
[05:58:02] k3rn31: has joined #ruby
[05:58:06] RickHull: i think code loading in javascript is 10x gnarlier than ruby/require
[06:00:35] RickHull: what about https://en.wikipedia.org/wiki/WebAssembly ?
[06:01:44] RickHull: i wonder what languages and code loadings will be viable
[06:02:38] alnewkirk: has joined #ruby
[06:04:03] jottr: has joined #ruby
[06:08:10] RickHull: the compiler output is e.g. a single html file -- so i don't think it adds any runtime loading semantics beyond js, if at all
[06:09:48] waveprop: thanks RickHull
[06:10:13] neo95_: has joined #ruby
[06:10:33] Azure: has joined #ruby
[06:10:59] baweaver: If it's code and it runs you should probably test it
[06:11:33] waveprop: agreed. didn't learn this until today
[06:11:48] waveprop: now i'm doing it
[06:11:59] baweaver: that said, I think it's an interesting assertion that React is scary and jQuery isn't :P
[06:12:27] RickHull: isn't jquery in javascript: the good parts?
[06:12:47] RickHull: my copy is like 5 years old
[06:12:50] waveprop: baweaver: fair enough. my fear is due to my ignorance of React. jquery is very easy to use
[06:13:23] waveprop: RickHull: i don't have that book yet
[06:13:25] baweaver: larger applications with jquery will switch that opinion pretty quick :)
[06:13:47] baweaver: One piece of advice though I never really took to heart as a Junior: code more, read less
[06:14:05] havenwood: Spaghetti code isn't messy when it's a single, uncooked noodle.
[06:14:09] waveprop: ha. i believe you. and i'll take you up on that advice
[06:14:14] baweaver: you could read every book out there but until you practically apply it it's going to suck
[06:14:44] baweaver: Not to say you shouldn't read books, but remember to actually do something with the info :)
[06:15:03] waveprop: well, i started writing web apps with naked javascript and procedural php (coming from bash) many years ago, they were of course horrid
[06:15:26] baweaver: Everyone starts somewhere
[06:15:29] waveprop: eventually i collected books, and they help
[06:15:40] waveprop: just agreeing with you.
[06:15:42] baweaver: though you want to know the dark secret of Senior level code and how it's different than Junior?
[06:15:57] baweaver: It's boring
[06:16:09] waveprop: the code? or the secret
[06:16:14] baweaver: It doesn't try and be clever or use every edge feature, it's just boring
[06:16:25] alnewkirk: has joined #ruby
[06:16:29] RickHull: I've found that I generally don't understand something -- truly understand it -- until I've implemented it
[06:16:33] waveprop: mhm i see what you mean
[06:16:53] dionysus69: has joined #ruby
[06:17:00] RickHull: so it's worthwhile to implement interesting things, at least make a spike, no need to follow thru once you appreciate it
[06:17:14] waveprop: yeah i have to implement it several times incorrectly, then find writings by someone who knows what they're doing, and then implement it again
[06:17:25] baweaver: Do note though that I'm also frequently wrong on things :P
[06:17:26] baweaver: havenwood can speak to that one XD
[06:18:35] baweaver: Note though I do a lot of Javascript as of late and I fully admit it's a mess
[06:18:50] baweaver: mainly around excess tooling because reasons
[06:19:35] baweaver: mostly that JS was never intended to be as big as it is so they never thought of a module system, and not everyone agrees on exactly how that should work
[06:22:36] RickHull: lacking a filesystem on the runtime platform makes things tough, it seems
[06:24:01] RickHull: it does seem that the script/js target should be built, and have one of those per page
[06:24:12] RickHull: i think that's how most webpack things work right?
[06:24:20] RickHull: what's the top couple nowadays?
[06:24:33] RickHull: node.js? browserify?
[06:24:37] baweaver: Webpack, Browserify, and Rollup tend to be the top 3
[06:24:46] baweaver: Webpack took the lead though
[06:24:51] baweaver: Browserify is the simplest
[06:25:38] RickHull: once you're building-slash-compiling a single js file target, it seems you're not too far from WebAssembly
[06:26:55] claudiuinberlin: has joined #ruby
[06:28:02] alfiemax: has joined #ruby
[06:28:52] RickHull: i "learned" javascript back when it was dhtml and revolved around DOM manipulation. due to the goofy object model, strange type decisions, annoyance with the DOM, I've found js distasteful
[06:29:11] RickHull: but I did read js the good parts, and I like coffeescript
[06:29:24] baweaver: ES6 has been a nice addition
[06:29:32] baweaver: Typescript above it if you want some extras
[06:30:09] alnewkirk: has joined #ruby
[06:30:44] AnoHito: has joined #ruby
[06:30:55] baweaver: If you combine that with Ramda you get some great stuff
[06:31:34] RickHull: reading about those testing frameworks, it's straight ruby spec stuff :)
[06:31:46] baweaver: Pretty much
[06:31:53] baweaver: Pivotal made Jasmine which was basically RSpec
[06:32:07] baweaver: then Mocha/Chai/Sinnon were the same but they migrated a bit differently
[06:32:14] baweaver: BDD QUnit does much of the same
[06:32:29] baweaver: which is what Ember uses
[06:32:37] baweaver: which is basically Rails in JS XD
[06:33:11] RickHull: I love it when the new gen does the best 80% of the old gen :)
[06:40:10] Azure: has joined #ruby
[06:41:11] RickHull: interesting comments here https://github.com/WebAssembly/design/issues/1126
[06:43:26] RickHull: I forgot about Opal til just now
[06:43:56] alnewkirk: has joined #ruby
[06:48:31] RickHull: looks interesting more than useful https://github.com/opal/opal
[06:51:15] konsolebox: has joined #ruby
[06:54:23] dinfuehr: has joined #ruby
[06:57:40] alnewkirk: has joined #ruby
[07:02:26] snickers: has joined #ruby
[07:06:48] nopoliti1: has joined #ruby
[07:09:14] rippa: has joined #ruby
[07:16:13] banisterfiend: has joined #ruby
[07:18:20] jarnalyrkar: has joined #ruby
[07:20:34] alnewkirk: has joined #ruby
[07:22:53] alveric1: has joined #ruby
[07:23:02] michael1: has joined #ruby
[07:23:39] blackwind_123: has joined #ruby
[07:28:56] ramfjord: has joined #ruby
[07:32:44] alfiemax: has joined #ruby
[07:34:19] alnewkirk: has joined #ruby
[07:34:35] Dimik: has joined #ruby
[07:35:15] Rodya_: has joined #ruby
[07:48:00] alnewkirk: has joined #ruby
[07:51:10] _whitelogger: has joined #ruby
[07:59:05] reber: has joined #ruby
[08:00:21] uZiel: has joined #ruby
[08:01:31] nadir: has joined #ruby
[08:01:45] alnewkirk: has joined #ruby
[08:05:05] jottr: has joined #ruby
[08:05:08] ramfjord: has joined #ruby
[08:09:15] anonymus88: has joined #ruby
[08:11:15] Hexafox[I]: has joined #ruby
[08:11:58] anonymus88: could anyone describe me the difference between singleton_class.methods and singleton_methods of a class?
[08:14:12] matthewd: anonymus88: singleton_methods are the methods provided to the instance by the singleton class
[08:14:28] matthewd: singleton_class.methods are the methods on the singleton class itself
[08:14:42] matthewd: singleton_methods is more closely related to singleton_class.instance_methods
[08:15:31] alnewkirk: has joined #ruby
[08:16:52] anonymus88: so C.methods = C.singleton_class.instance_methods
[08:17:45] cdg: has joined #ruby
[08:18:03] alex``: has joined #ruby
[08:20:19] ^mtkd: has joined #ruby
[08:20:43] ramfjord: has joined #ruby
[08:22:36] ju5t: has joined #ruby
[08:29:19] alnewkirk: has joined #ruby
[08:35:10] enterprisey: has joined #ruby
[08:36:25] Rodya_: has joined #ruby
[08:39:25] jenrzzz: has joined #ruby
[08:41:08] ramfjord: has joined #ruby
[08:46:04] uZiel: has joined #ruby
[08:47:39] alnewkirk: has joined #ruby
[08:54:04] milardovich: has joined #ruby
[08:59:58] c0ncealed: has joined #ruby
[09:03:44] alfiemax_: has joined #ruby
[09:10:06] alfiemax_: has joined #ruby
[09:10:17] jottr: has joined #ruby
[09:13:34] jphase: has joined #ruby
[09:14:32] chouhoulis: has joined #ruby
[09:17:23] nowhereman: has joined #ruby
[09:29:48] milardovich: has joined #ruby
[09:33:11] alfiemax: has joined #ruby
[09:34:17] ski4x7: has joined #ruby
[09:36:54] isec: has joined #ruby
[09:37:10] Rodya_: has joined #ruby
[09:39:59] ski7777: has joined #ruby
[09:42:56] apeiros_: has joined #ruby
[09:51:02] nardul: has left #ruby: ("WeeChat 1.0.1")
[09:51:49] troulouliou_div2: has joined #ruby
[09:54:49] blackbaba: has joined #ruby
[09:59:47] TvL2386_: has joined #ruby
[10:01:17] blackbaba: has joined #ruby
[10:03:51] alfiemax: has joined #ruby
[10:17:18] heftig: has joined #ruby
[10:21:45] milardovich: has joined #ruby
[10:22:27] FahmeF_: has joined #ruby
[10:22:56] oetjenj: has joined #ruby
[10:23:45] cdg: has joined #ruby
[10:24:13] michael1: has joined #ruby
[10:29:58] FahmeF_: has joined #ruby
[10:33:03] marr: has joined #ruby
[10:33:12] jenrzzz: has joined #ruby
[10:38:13] Rodya_: has joined #ruby
[10:43:35] conta: has joined #ruby
[10:45:00] Sembei: has joined #ruby
[10:48:17] mikecmpbll: has joined #ruby
[10:50:14] uZiel: has joined #ruby
[10:52:18] Technodrome: has joined #ruby
[11:00:44] blackwind_123: has joined #ruby
[11:01:52] blackbaaba: has joined #ruby
[11:03:11] Technodrome: has joined #ruby
[11:04:06] blackbaaba_: has joined #ruby
[11:05:54] blackbaba_: has joined #ruby
[11:06:42] alfiemax: has joined #ruby
[11:07:30] dionysus69: has joined #ruby
[11:09:25] raatiniemi: has joined #ruby
[11:13:25] milardovich: has joined #ruby
[11:14:12] FahmeF: has joined #ruby
[11:16:14] milardovich: has joined #ruby
[11:17:32] Technodrome: has joined #ruby
[11:20:15] blackwind_123: has joined #ruby
[11:27:03] biberu: has joined #ruby
[11:29:23] selim: has joined #ruby
[11:35:16] uZiel: has joined #ruby
[11:38:51] Rodya_: has joined #ruby
[11:39:00] FahmeF_: has joined #ruby
[11:46:24] karapetyan: has joined #ruby
[11:47:05] snickers: has joined #ruby
[11:47:49] blackbaba: has joined #ruby
[11:47:51] uZiel: has joined #ruby
[11:49:29] gheegh: has joined #ruby
[12:05:14] Psybur: has joined #ruby
[12:11:24] AnoHito_: has joined #ruby
[12:21:25] ramfjord: has joined #ruby
[12:21:47] darkmorph: has joined #ruby
[12:23:18] michael1: has joined #ruby
[12:23:54] _aeris_: has joined #ruby
[12:24:41] Technodrome: has joined #ruby
[12:25:13] GodFather: has joined #ruby
[12:27:49] uptownjimmy: has joined #ruby
[12:29:56] FahmeF: has joined #ruby
[12:33:43] alfiemax: has joined #ruby
[12:38:56] alfiemax: has joined #ruby
[12:39:34] Rodya_: has joined #ruby
[12:43:05] guille-moe: has joined #ruby
[12:44:34] Psybur: has joined #ruby
[12:50:43] pskosinski: Any tip why gem update fails? https://paste.fedoraproject.org/paste/MTD4TBDRnj98hwlBAtP14w
[12:52:14] pskosinski: Oh damn, nvm
[12:57:29] halt-: has joined #ruby
[12:59:39] Psybur: has joined #ruby
[13:03:35] naprimer: has joined #ruby
[13:03:48] anonymus88: has joined #ruby
[13:05:04] chmurifree: has joined #ruby
[13:08:01] tomphp: has joined #ruby
[13:09:29] InfinityFye: has joined #ruby
[13:12:19] yqt: has joined #ruby
[13:15:37] dopie: has joined #ruby
[13:17:31] dkam: has joined #ruby
[13:19:57] c0ncealed: has joined #ruby
[13:20:07] dkam_: has joined #ruby
[13:21:07] FahmeF: has joined #ruby
[13:22:16] phlebas_: has joined #ruby
[13:23:11] tomphp: has joined #ruby
[13:26:19] alfiemax: has joined #ruby
[13:29:47] im0nde: has joined #ruby
[13:36:41] alnewkirk: has joined #ruby
[13:40:23] Rodya_: has joined #ruby
[13:43:24] michael4: has joined #ruby
[13:43:36] dopie: has joined #ruby
[13:46:30] ta: has joined #ruby
[13:47:46] agent_white: has joined #ruby
[13:54:46] alfiemax: has joined #ruby
[13:57:17] ramfjord: has joined #ruby
[13:58:02] chouhoulis: has joined #ruby
[13:58:16] jsilver: has joined #ruby
[13:58:54] jsilver: has joined #ruby
[13:58:56] alfiemax_: has joined #ruby
[13:59:08] oleo2: has joined #ruby
[14:08:55] DLSteve: has joined #ruby
[14:12:40] dextrey: has joined #ruby
[14:15:12] quobo: has joined #ruby
[14:17:35] Psybur: has joined #ruby
[14:17:43] leah2: has joined #ruby
[14:19:50] quuxman: has joined #ruby
[14:21:07] Quentinius: has joined #ruby
[14:24:02] dionysus69: has joined #ruby
[14:29:00] guille-moe: has joined #ruby
[14:29:50] lxnr: has joined #ruby
[14:30:01] banisterfiend: has joined #ruby
[14:30:05] banisterfiend: has joined #ruby
[14:35:18] _sfiguser: has joined #ruby
[14:35:51] _aeris: has joined #ruby
[14:37:09] Technodrome: has joined #ruby
[14:38:48] sepp2k: has joined #ruby
[14:41:27] Rodya_: has joined #ruby
[14:42:57] minimalism: has joined #ruby
[14:45:42] nikhgupta: has joined #ruby
[14:47:55] garyserj: has joined #ruby
[14:51:28] alfiemax: has joined #ruby
[14:51:46] guille-moe: has joined #ruby
[14:55:39] [[thufir]]: has joined #ruby
[14:57:54] darkmorph: has joined #ruby
[15:04:30] dionysus69: has joined #ruby
[15:10:11] ledestin: has joined #ruby
[15:15:15] mson: has joined #ruby
[15:17:10] xsdg: has joined #ruby
[15:19:17] johno84: has joined #ruby
[15:31:05] banisterfiend: has joined #ruby
[15:33:13] mtkd: has joined #ruby
[15:38:05] steffes: has joined #ruby
[15:38:55] Psybur: has joined #ruby
[15:39:00] Mia: has joined #ruby
[15:39:00] Mia: has joined #ruby
[15:41:02] ahrs: has joined #ruby
[15:41:34] kaitlyn: has left #ruby: ()
[15:42:03] Rodya_: has joined #ruby
[15:42:15] chouhoulis: has joined #ruby
[15:42:52] michael1: has joined #ruby
[15:45:19] lxnr: has joined #ruby
[16:03:15] troulouliou_div2: has joined #ruby
[16:18:50] shinnya: has joined #ruby
[16:18:55] troulouliou_div2: has joined #ruby
[16:19:00] GodFather: has joined #ruby
[16:19:52] GodFather: has joined #ruby
[16:21:25] lxnr: has joined #ruby
[16:23:37] yqt: has joined #ruby
[16:31:39] charliesome: has joined #ruby
[16:37:14] swills: has joined #ruby
[16:37:14] swills: has joined #ruby
[16:37:22] swills_: has joined #ruby
[16:38:01] malice: has joined #ruby
[16:38:33] malice: Hi! Given a string(i.e. "hello"), how can I call a function with the same name, probably passing some arguments?
[16:38:47] malice: i.e. (call_function :hello 2) would be equivalent to hello(2)
[16:38:57] Papierkorb: What's your use-case?
[16:38:58] malice: umm, call(function(:hello, 2), sorry for my lisp there
[16:39:42] malice: Papierkorb: actually partially curious if you can do that. I'd get input from user and execute the function if it exists. I am aware that it's a terrible idea.
[16:40:03] malice: I've seen send, wondering if I can avoid eval.
[16:40:40] Papierkorb: This is ruby, you can do almost anything. Inclduing what you want. `Object#public_send` if you want to call only public methods, or `Object#send` if you want to call "anything" regardless if it's public or not. Always prefer the former if possible.
[16:42:21] Papierkorb: malice: Other solutions for real-world stuff would be using a Hash going from the string to a Proc you can call (Like `{ "foo" => ->(x, *y){ x.foo(*y) } }`), or using a `case` statement. I'd prefer the latter, but both are better than `#send` if you can avoid it :)
[16:42:25] malice: I see. Thanks!
[16:43:24] mikhael_k33hl: has joined #ruby
[16:44:05] banisterfiend: has joined #ruby
[16:44:11] mikhael_k33hl: Anyone here read the Pragmatic Programming Ruby? Foreword seems to be for third edition in the fourth edition
[16:44:28] malice: Papierkorb: Yeah, I know. I'd go with hash probably, or better yet - something more sophisticated like Command pattern
[16:44:52] malice: I don't really like the "case" because it's hard to change the behavior of your commands
[16:45:13] malice: or at least I don't know any
[16:45:16] Papierkorb: malice: Don't overcomplicate simple things. If e.g. a `case` or a Hash does the job, why make it more complicated?
[16:45:18] goyox86: has joined #ruby
[16:46:00] Papierkorb: Yes that's the good thing about `case`: It's more static.
[16:49:52] goyox86: has joined #ruby
[16:51:27] DLSteve: has joined #ruby
[16:51:54] lxnr: has joined #ruby
[16:55:16] memo1: has joined #ruby
[16:55:47] memo1: has left #ruby: ()
[16:55:58] memo1: has joined #ruby
[16:56:41] alfiemax: has joined #ruby
[17:03:18] Xiti: has joined #ruby
[17:04:51] jphase: has joined #ruby
[17:08:13] imode: has joined #ruby
[17:11:08] webguynow: has joined #ruby
[17:14:04] troulouliou_div2: has joined #ruby
[17:19:02] conta1: has joined #ruby
[17:22:37] chouhoulis: has joined #ruby
[17:23:33] alnewkirk: has joined #ruby
[17:25:26] oncall-pokemon: has joined #ruby
[17:31:15] guille-moe: has joined #ruby
[17:32:10] PaulCape_: has joined #ruby
[17:34:21] lxnr: has joined #ruby
[17:37:29] alnewkirk: has joined #ruby
[17:37:56] weird_error: has joined #ruby
[17:39:27] jottr: has joined #ruby
[17:39:46] jottr: has joined #ruby
[17:42:54] enterprisey: has joined #ruby
[17:49:08] PaulCapestany: has joined #ruby
[17:51:01] ss_much: has joined #ruby
[17:51:11] alnewkirk: has joined #ruby
[17:52:41] cam27: has joined #ruby
[17:54:47] orbyt_: has joined #ruby
[18:00:42] ResidentBiscuit: has joined #ruby
[18:01:34] Rodya_: has joined #ruby
[18:02:41] Azure: has joined #ruby
[18:04:58] alnewkirk: has joined #ruby
[18:07:48] enterprisey: has joined #ruby
[18:09:50] eb0t: has joined #ruby
[18:14:48] TinkerTyper: has joined #ruby
[18:16:20] darix: Papierkorb: because more LOC == better ;)
[18:18:41] alnewkirk: has joined #ruby
[18:26:13] goyox86: has joined #ruby
[18:29:35] alfiemax: has joined #ruby
[18:32:04] jenrzzz: has joined #ruby
[18:32:05] jenrzzz: has joined #ruby
[18:32:24] alnewkirk: has joined #ruby
[18:34:53] Qommand0r: has joined #ruby
[18:37:02] [[thufir]]: has joined #ruby
[18:38:10] michael1: has joined #ruby
[18:40:59] konsolebox: has joined #ruby
[18:41:27] guacamole: has joined #ruby
[18:41:33] alnewkirk: has joined #ruby
[18:43:44] Rodya_: has joined #ruby
[18:48:18] dinfuehr: has joined #ruby
[18:50:36] waveprop: Lines Of Coin
[18:52:20] tomphp: has joined #ruby
[18:55:01] nikhgupta: has joined #ruby
[18:55:18] alnewkirk: has joined #ruby
[18:56:49] dinfuehr: has joined #ruby
[18:57:28] RickHull: has joined #ruby
[18:59:45] meadmoon: has joined #ruby
[18:59:58] jenrzzz: has joined #ruby
[18:59:59] jenrzzz: has joined #ruby
[19:04:27] Rodya_: has joined #ruby
[19:06:17] millz: has joined #ruby
[19:08:08] nikhgupta: has joined #ruby
[19:08:30] millz: hi friends
[19:09:04] alnewkirk: has joined #ruby
[19:09:24] Dimik: has joined #ruby
[19:09:59] uneeb: has joined #ruby
[19:10:20] dviola: has joined #ruby
[19:10:37] nikhgupta1: has joined #ruby
[19:12:47] hdeshev: has joined #ruby
[19:15:19] guille-moe: has joined #ruby
[19:17:02] conta: has joined #ruby
[19:19:10] kapil___: has joined #ruby
[19:20:26] guille-moe: has joined #ruby
[19:26:58] sucks: has joined #ruby
[19:27:26] alnewkirk: has joined #ruby
[19:27:41] banisterfiend: has joined #ruby
[19:28:20] apeiros_: has joined #ruby
[19:29:39] nikhgupta1: has joined #ruby
[19:31:40] nikhgupta2: has joined #ruby
[19:35:49] Rodya_: has joined #ruby
[19:49:44] milardovich: has joined #ruby
[19:50:20] alnewkirk: has joined #ruby
[19:50:24] banisterfiend: has joined #ruby
[19:51:10] Psybur: has joined #ruby
[19:54:31] michael1: has joined #ruby
[19:55:00] banisterfiend: has joined #ruby
[19:58:49] cdg: has joined #ruby
[20:03:27] postmodern: has joined #ruby
[20:04:07] alnewkirk: has joined #ruby
[20:06:11] banisterfiend: has joined #ruby
[20:11:47] ur5us: has joined #ruby
[20:20:59] guacamole: has joined #ruby
[20:21:30] memo1: has joined #ruby
[20:22:27] alnewkirk: has joined #ruby
[20:24:23] tomphp: has joined #ruby
[20:24:30] gigetoo: has joined #ruby
[20:35:19] Rodya_: has joined #ruby
[20:36:12] alnewkirk: has joined #ruby
[20:38:32] dviola: has joined #ruby
[20:43:27] milardovich: has joined #ruby
[20:45:45] jsilver: has joined #ruby
[20:47:16] charliesome: has joined #ruby
[20:48:31] dznet: has joined #ruby
[20:49:56] alnewkirk: has joined #ruby
[20:53:05] dznet: has left #ruby: ("Leaving")
[20:54:34] m27frogy: has joined #ruby
[20:55:36] Psybur: has joined #ruby
[21:01:57] jottr: has joined #ruby
[21:02:35] [[thufir]]: has joined #ruby
[21:03:43] alnewkirk: has joined #ruby
[21:06:40] synstack_: has joined #ruby
[21:06:40] synstack_: has joined #ruby
[21:07:41] mtkd: has joined #ruby
[21:12:43] banisterfiend: has joined #ruby
[21:12:56] Technodrome: has joined #ruby
[21:17:24] alnewkirk: has joined #ruby
[21:20:08] guille-moe: has joined #ruby
[21:21:05] banisterfiend: has joined #ruby
[21:22:43] Puffball: has joined #ruby
[21:24:36] tomphp: has joined #ruby
[21:27:05] marr: has joined #ruby
[21:29:01] mikecmpbll: if i can see that there's a variable (Float) existing in ObjectSpace, is there any way i can see somehow what is referencing it?
[21:29:04] cschneid_: has joined #ruby
[21:29:19] mikecmpbll: i.e. maybe there's an instance variable in an instance of Foo class that holds a reference to the float
[21:29:32] mikecmpbll: that would be the kind of info that would really help me debug this :D
[21:30:05] apeiros: I don't think vanilla ruby provides a way :(
[21:30:30] apeiros: vanilla ruby can help you figure out when stuff starts to be referenced via objspace, but afaik, that's about it
[21:31:08] alnewkirk: has joined #ruby
[21:32:11] [[thufir]]1: has joined #ruby
[21:35:17] mikecmpbll: okay thanks apeiros :)
[21:35:59] apeiros: well… sorry :-(
[21:36:19] apeiros: you might be able to pull something off using dprobes. but I got no experience to provide support with that.
[21:41:57] guille-moe: has joined #ruby
[21:47:18] Lyubo1: has joined #ruby
[21:49:29] alnewkirk: has joined #ruby
[21:57:37] quobo: has joined #ruby
[22:00:20] RickHull: what about hooking into some GC methods?
[22:00:36] RickHull: (wild stab)
[22:01:01] Emmanuel_Chanel: has joined #ruby
[22:02:14] RickHull: there might be something fruitful in here http://ruby-doc.org/core-2.4.2/GC.html
[22:02:30] guacamole: has joined #ruby
[22:03:11] RickHull: this looks interesting https://ruby-hacking-guide.github.io/gc.html
[22:03:14] alnewkirk: has joined #ruby
[22:06:19] k3rn31_: has joined #ruby
[22:07:47] raynold: has joined #ruby
[22:08:51] Technodrome: has joined #ruby
[22:09:09] RickHull: i'm guessing the GC reference tracking is internal to the runtime
[22:09:12] houhoulis: has joined #ruby
[22:10:20] mikecmpbll: RickHull : interesting, though not sure i've any way of getting at that info
[22:10:25] cschneid_: has joined #ruby
[22:10:29] mikecmpbll: (object references)
[22:11:04] mikecmpbll: the memory_profiler gem tracks where it was initialised, but i can't for the life of me work out why it's being held on to.
[22:11:18] RickHull: paste some code / examples?
[22:11:43] RickHull: may be more trouble than it's worth
[22:12:42] RickHull: two difficult avenues that might not pay off could be 1. try to hack GC / ObjSpace stuff to tell you what you want 2. try to distill your behavior to a simpler test case
[22:13:12] mikecmpbll: yeah, i'm working on the latter
[22:13:43] _aeris_: hello #ruby !
[22:14:10] apeiros: moin _aeris_
[22:14:14] RickHull: aloha _aeris_
[22:14:16] _aeris_: i hit a very trick behavior with Kernel.exec… I don't understand at all the problem :'(
[22:14:18] _aeris_: https://git.imirhil.fr/aeris/ssh-ident/src/master/lib/ssh-ident/agent.rb#L25
[22:14:42] RickHull: what is the symptom?
[22:14:56] _aeris_: I develop a SSH client to isolate ssh-agent, and I use exec to invoke real SSH with custom parameter
[22:15:32] _aeris_: when I run a SSH command with "-N" and then I put the ssh command in background
[22:15:40] _aeris_: my terminal is totaly borked
[22:16:01] RickHull: what is -N ? and how are you putting it in background?
[22:16:10] _aeris_: only some key press lead to a letter print
[22:16:13] _aeris_: like if a process swallow input
[22:16:27] _aeris_: ssh server -N &
[22:16:38] _aeris_: after that, input/output is borked
[22:16:59] alnewkirk: has joined #ruby
[22:17:39] _aeris_: 1 letter out of 2 or 3 is printed on the term after that, the other "vanished" somewhere
[22:18:05] _aeris_: I debug a lot this night, but seems it's exec :(
[22:18:18] tomphp: has joined #ruby
[22:18:40] RickHull: can you confirm the behavior without ruby code?
[22:19:09] _aeris_: no, native SSH command, no trouble
[22:19:13] RickHull: also put some debug print statements before the exec to confirm exactly what is being execd
[22:19:41] _aeris_: that's what I do
[22:19:46] _aeris_: the command is good
[22:19:53] _aeris_: the same run outside ruby is ok
[22:20:09] RickHull: paste some examples with output and such if you can
[22:20:53] mim1k: has joined #ruby
[22:21:03] _aeris_: I notice a "mesg: ttyname failed: Ioctl() inappropriate ioctl for device" too
[22:22:42] _aeris_: https://paste.imirhil.fr/?02ff03e6377bc47f#87t4dzM5JbAXUFyqRtn6/dEBvt5hZFuhOa0gDhkgt1k=
[22:22:46] _aeris_: here is the debug
[22:24:03] _aeris_: https://paste.imirhil.fr/?5b6c4eaccb84dd7e#qR9eC3xEld/Xb3nngjG5uOqRgdWlBwVA6kkqBQsPSog=
[22:24:09] guacamole: has joined #ruby
[22:24:10] _aeris_: and here is the output
[22:24:41] _aeris_: the last line is what I got when I try to write "testtesttesttest"
[22:24:48] miromanyth: has joined #ruby
[22:25:33] miromanyth: Anyone try writing a roguelike in Ruby?
[22:26:09] alnewkirk: has joined #ruby
[22:26:16] RickHull: https://robots.thoughtbot.com/announcing-write-yourself-a-roguelike
[22:26:49] RickHull: _aeris_: the last paste -- is that showing naked ssh or your ruby-wrapped ssh?
[22:27:00] _aeris_: ruby-wrapped
[22:27:29] dviola: has joined #ruby
[22:27:51] RickHull: _aeris_: I probably can't help much further, maybe someone else can
[22:28:04] tomaw_: has joined #ruby
[22:28:45] miromanyth: RickHull, Thanks!
[22:28:56] RickHull: i would maybe try testing without `&` -- that may not be the best way to keep your tunnel going
[22:29:19] _aeris_: hum… seems i have the trouble with naked ssh in some case…
[22:30:13] RickHull: _aeris_: this might be interesting: https://github.com/rickhull/public/blob/master/etc/profile.d/ssh-agent.sh
[22:30:42] RickHull: it's my uber minimal version of keychain for maintaining the ssh-agent sock details
[22:31:09] _aeris_: ssh-ident allow multiple agent
[22:31:13] _aeris_: 1 per identity
[22:31:35] RickHull: yeah, I haven't messed with that ever
[22:31:40] _aeris_: so your personal key is not mixed with work key, even when SSH agent forward
[22:31:57] RickHull: my thing is pretty much a hack -- only tested on debian
[22:32:07] _aeris_: (and you can split your ssh config too)
[22:32:08] RickHull: i wonder why ssh-agent doesn't do what I'm doing by default though
[22:32:28] _aeris_: all seems good, but i have some trouble with io when wrapped :'(
[22:32:48] _aeris_: i have another trouble with this wrapper and Popen3.capture3
[22:32:56] _aeris_: seems stderr is never closed
[22:32:56] zapata: has joined #ruby
[22:33:21] cdg: has joined #ruby
[22:33:55] RickHull: I ran into this before too -- it's something to do with strict tty/shell behavior and that ssh only seems like a remote terminal
[22:35:23] _aeris_: seems exec "swallow" io
[22:35:25] _aeris_: (or at least is not totally transparent from the outside)
[22:35:31] miromanyth: has left #ruby: ("Leaving")
[22:38:20] RickHull: consider this, there is a STDOUT/STDERR on the server; but I don't think these are maintained in the tunnel back to your client
[22:38:43] RickHull: I may be barking up the wrong tree (english idiom :)
[22:39:38] _aeris_: with -N, there is no stdout/err open
[22:39:55] alnewkirk: has joined #ruby
[22:40:01] RickHull: i think what I ran into was: when invoking a remote process, that process has to explicitly close STDERR or else something wrapping it does
[22:40:14] RickHull: or else the remote process and tunnel just hang
[22:40:16] RickHull: something like that
[22:40:31] RickHull: sorry, these are fuzzy memories :)
[22:40:32] _aeris_: even running "ssh some-host true" hang capture3…
[22:40:57] _aeris_: ssh process is really destroyed, but capture3 hangs on e.read
[22:41:03] RickHull: yes, I think this is by design / spec
[22:41:29] RickHull: try true 2>&1 maybe? i think there was some other shell way to close STDERR explicitly
[22:42:22] RickHull: I had all this notated and figured out, in code and docs, 2 employers ago :/
[22:42:25] _aeris_: native ssh comman doen's hang :( only the wrapped one
[22:45:10] lacour: has joined #ruby
[22:45:27] RickHull: also, are you using -v -vv -vvv etc ?
[22:45:48] _aeris_: but no difference with or without…
[22:47:10] _aeris_: seems I found a better guilty guy !
[22:47:21] _aeris_: with -o ControlMaster, no trouble !
[22:50:09] _aeris_: hum… no reproductible /o\
[22:51:23] Technodrome: has joined #ruby
[22:53:41] phlebas_: has joined #ruby
[22:53:45] alnewkirk: has joined #ruby
[22:56:36] troulouliou_dev: has joined #ruby
[22:57:04] ivanskie: has joined #ruby
[22:57:48] milardovich: has joined #ruby
[22:58:44] chouhoulis: has joined #ruby
[23:02:51] alnewkirk: has joined #ruby
[23:03:33] dkam_: has joined #ruby
[23:04:06] [[thufir]]: has joined #ruby
[23:06:27] charliesome: has joined #ruby
[23:07:01] thinkpad: has joined #ruby
[23:08:30] [[thufir]]1: has joined #ruby
[23:10:13] mtkd: has joined #ruby
[23:13:32] ledestin: has joined #ruby
[23:15:44] Technodrome: has joined #ruby
[23:16:37] alnewkirk: has joined #ruby
[23:19:27] cdg: has joined #ruby
[23:19:57] [[thufir]]: has joined #ruby
[23:20:04] jenrzzz: has joined #ruby
[23:20:04] jenrzzz: has joined #ruby
[23:22:02] eckhardt: has joined #ruby
[23:22:45] [[thufir]]: has joined #ruby
[23:24:50] darkmorph: has joined #ruby
[23:25:47] alnewkirk: has joined #ruby
[23:30:03] goyox86: has joined #ruby
[23:30:19] Asher: has joined #ruby
[23:30:48] goyox86: has joined #ruby
[23:32:55] duderonomy: has joined #ruby
[23:34:41] goyox86: has joined #ruby
[23:34:50] ahrs: has joined #ruby
[23:39:36] alnewkirk: has joined #ruby
[23:40:19] RickHull: what's a slick way to determine if X is a power of N (both integers)? e.g. is 5 a power of 2?
[23:40:31] RickHull: Math.log(x, n) surely helps
[23:41:50] apeiros: what's wrong with Math.log?
[23:42:17] RickHull: >> [Math.log(5, 2), Math.log(8, 2)]
[23:42:18] ruby[bot]: RickHull: # => [2.321928094887362, 3.0] (https://eval.in/893070)
[23:42:25] RickHull: what's the test?
[23:42:49] apeiros: either % 1 == 0, or base ** result.round == value
[23:42:56] Technodrome: has joined #ruby
[23:43:25] RickHull: ooh, % 1 == 0
[23:43:26] apeiros: I'd probably use the latter to avoid issues with floats
[23:43:36] RickHull: the latter is decidedly not slick
[23:43:56] xtexx: has joined #ruby
[23:44:31] RickHull: >> [Math.log(5, 2), Math.log(8, 2)].map(&:to_r)
[23:44:32] ruby[bot]: RickHull: # => [(5228517251457905/2251799813685248), (3/1)] (https://eval.in/893071)
[23:45:42] RickHull: i wonder though, once the Math.log value has been reified as a float
[23:45:51] RickHull: can't you lose precision and not get your clean integer back?
[23:45:57] RickHull: is that the same problem with % 1 == 0 ?
[23:46:15] apeiros: conversion to float is lossy except for values representable by float.
[23:47:10] RickHull: I'm not sure how to apply that to Math.log(x, n)
[23:47:24] guacamole: has joined #ruby
[23:47:26] AnoHito: has joined #ruby
[23:47:55] RickHull: one way to read your last statement is that the result of Math.log(x, n) is not generally representable by a float
[23:48:01] RickHull: but yet that's what it returns
[23:48:24] apeiros: Math.log returns a float
[23:48:47] apeiros: it might not be precise enough for % 1 to be zero, even though it should be
[23:49:57] apeiros: >> ((0.1 + 0.2) - 0.3) % 1 == 0
[23:49:58] ruby[bot]: apeiros: # => false (https://eval.in/893073)
[23:50:43] elomatreb: Any way to get it to return Rationals? I feel like it should do that if one or more of the arguments are Rationals
[23:50:47] apeiros: hence I'd use the **round approach. less brittle wrt float approximations.
[23:51:01] apeiros: no. no way to get it to return rationals.
[23:52:11] apeiros: you'd have to implement it yourself and even then afair log is an infinite series expansion (I hope I translated that correctly)
[23:52:33] apeiros: been a while since I learned how to do log by hand. so I might be wrong :)
[23:52:46] johno84: has joined #ruby
[23:53:21] alnewkirk: has joined #ruby