« Back to channel list

#ruby - 03 June 2016

« Back 1 day Forward 1 day »
[00:00:16] roamingdog: has joined #ruby
[00:01:30] arescorpio: has joined #ruby
[00:02:11] roamingd_: has joined #ruby
[00:03:29] jas02: has joined #ruby
[00:05:44] maletor3: getting into ruby folds. how does this look? https://gist.github.com/maletor/ef903a286877846a2ab78f78ad4fc175
[00:06:13] mooe: has joined #ruby
[00:07:47] jphase: has joined #ruby
[00:08:25] blackgoat: has joined #ruby
[00:12:38] magikid: has joined #ruby
[00:15:21] certainty: has joined #ruby
[00:16:09] David_H_Smith: has joined #ruby
[00:16:23] UserInneed: has joined #ruby
[00:16:54] rkazak: has joined #ruby
[00:17:23] David_H_Smith: has joined #ruby
[00:17:50] rickmasta: has joined #ruby
[00:18:10] hahuang65: has joined #ruby
[00:18:38] allcentury: has joined #ruby
[00:19:02] janebootydoe: has joined #ruby
[00:20:43] mwlang: has joined #ruby
[00:23:36] SilverKey: has joined #ruby
[00:24:17] lightt: has joined #ruby
[00:25:23] mattwashere: has joined #ruby
[00:28:04] jenrzzz: has joined #ruby
[00:28:04] jenrzzz: has joined #ruby
[00:28:05] flashpoint9: has joined #ruby
[00:28:44] JesseH: has joined #ruby
[00:30:39] jottr_: has joined #ruby
[00:34:08] gregf: has joined #ruby
[00:34:27] whathappens: has joined #ruby
[00:34:53] duckpuppy: has joined #ruby
[00:39:40] edwardly: has joined #ruby
[00:39:40] edwardly: has joined #ruby
[00:43:07] nankyokusei: has joined #ruby
[00:44:29] roundabout22: has joined #ruby
[00:45:59] martee: has joined #ruby
[00:47:57] shevy: looks quite heavy
[00:50:14] lightt: has joined #ruby
[00:50:26] SilverKey: has joined #ruby
[00:51:53] whathappens: has joined #ruby
[00:53:22] whathapp_: has joined #ruby
[00:55:23] Ropeney: has joined #ruby
[00:57:26] fedexo: has joined #ruby
[00:57:38] jas02: has joined #ruby
[01:05:17] e4xit_: has joined #ruby
[01:06:15] jphase: has joined #ruby
[01:08:11] skweek: has joined #ruby
[01:08:52] webnanners: has joined #ruby
[01:12:02] tAn: has joined #ruby
[01:16:06] certainty: has joined #ruby
[01:17:24] mikecmpbll: has joined #ruby
[01:22:03] hiennaj: has joined #ruby
[01:23:11] Vingador: has joined #ruby
[01:23:13] lightt: has joined #ruby
[01:23:14] roamingdog: has joined #ruby
[01:24:09] roamingdog: has joined #ruby
[01:24:12] Asher: has joined #ruby
[01:24:43] Vingador: has joined #ruby
[01:25:08] Vingador: has joined #ruby
[01:25:53] hutch34_: has joined #ruby
[01:29:31] beilabs: has joined #ruby
[01:35:10] cd83x: has joined #ruby
[01:35:57] gtsai: has joined #ruby
[01:36:56] duckpuppy: has joined #ruby
[01:37:59] jaguarmagenta: has joined #ruby
[01:39:24] tmtwd: has joined #ruby
[01:39:40] Yiota: has joined #ruby
[01:39:40] twistedpixels: has joined #ruby
[01:39:40] twistedpixels: has joined #ruby
[01:40:24] ryan_notabot: has joined #ruby
[01:42:00] ryan_notabot: has joined #ruby
[01:48:37] whathappens: has joined #ruby
[01:49:29] twistedpixels: has joined #ruby
[01:49:29] twistedpixels: has joined #ruby
[01:51:51] jas02: has joined #ruby
[01:53:42] Yiota: has joined #ruby
[01:54:18] blackjid: has joined #ruby
[01:54:40] dtoast: has joined #ruby
[01:57:01] renderful: has joined #ruby
[01:57:17] blackjid: has joined #ruby
[02:00:09] Pupeno: has joined #ruby
[02:00:24] grassass: has joined #ruby
[02:00:36] noobsu: has joined #ruby
[02:00:43] coffeecupp: has joined #ruby
[02:01:03] yfeldblum: has joined #ruby
[02:01:42] yfeldblum: has joined #ruby
[02:01:48] blackjid: has joined #ruby
[02:02:58] Yiota: has joined #ruby
[02:03:47] blackjid: has joined #ruby
[02:04:32] elifoster: has joined #ruby
[02:06:42] jphase: it seems my "rails g controller welcome index" command just hangs after creating a new project and trying to add "gem 'foundation-rails'" to my Gemfile and running bundle. Anyone know what I could be doing wrong?
[02:07:17] blackjid: has joined #ruby
[02:07:59] blaxter: has joined #ruby
[02:10:44] beilabs: has joined #ruby
[02:11:17] mwlang: has joined #ruby
[02:11:17] blackjid: has joined #ruby
[02:11:27] agent_white: has joined #ruby
[02:11:52] lightt: has joined #ruby
[02:12:18] blackjid: has joined #ruby
[02:13:47] blackjid: has joined #ruby
[02:16:50] certainty: has joined #ruby
[02:19:32] Corrosive_: has joined #ruby
[02:30:03] wazzat: has joined #ruby
[02:30:09] cd83x: has joined #ruby
[02:30:51] p0p0pr37_: has joined #ruby
[02:32:47] jottr_: has joined #ruby
[02:37:35] Yiota: has joined #ruby
[02:37:52] jancel: has joined #ruby
[02:38:30] chouhoul_: has joined #ruby
[02:38:38] Yiota: has joined #ruby
[02:39:42] Yiota: has joined #ruby
[02:40:27] aupadhye: has joined #ruby
[02:44:03] nankyokusei: has joined #ruby
[02:45:31] Zighuatl: has joined #ruby
[02:45:58] jas02: has joined #ruby
[02:46:58] Zighuatl: has joined #ruby
[02:47:25] Zighuatl: has left #ruby: ()
[02:47:45] Zighuatl: has joined #ruby
[02:48:12] Zighuatl: has joined #ruby
[02:49:12] mattwashere: has joined #ruby
[02:50:59] Yiota: has joined #ruby
[02:52:39] chippy: has joined #ruby
[02:55:17] Es0teric: has joined #ruby
[02:55:36] Zighuatl: has joined #ruby
[02:57:10] harai: has joined #ruby
[02:58:41] ledestin: has joined #ruby
[03:03:00] lightt: has joined #ruby
[03:05:12] gtsai: has joined #ruby
[03:05:34] postmodern: has joined #ruby
[03:05:52] devbug: has joined #ruby
[03:08:26] fedexo: has joined #ruby
[03:09:06] RobertBirnie: has joined #ruby
[03:10:34] Spami_: has joined #ruby
[03:13:34] tAn: has joined #ruby
[03:14:14] ryann: has joined #ruby
[03:15:01] cpup: has joined #ruby
[03:16:30] adgtl: has joined #ruby
[03:16:31] adgtl: has joined #ruby
[03:17:01] braincrash: has joined #ruby
[03:17:35] certainty: has joined #ruby
[03:19:10] SilverKey: has joined #ruby
[03:20:59] k3rn31: has joined #ruby
[03:21:30] zel: has joined #ruby
[03:21:50] flopsec: has joined #ruby
[03:24:34] cd83x: has joined #ruby
[03:26:10] Noxilex: has joined #ruby
[03:27:37] Yiota: has joined #ruby
[03:29:03] maletor3: has joined #ruby
[03:30:48] nando293921: has joined #ruby
[03:32:45] cpup: has joined #ruby
[03:35:00] nando293921: has joined #ruby
[03:35:50] duncannz: has joined #ruby
[03:37:42] duckpuppy: has joined #ruby
[03:38:41] jaguarmagenta: has joined #ruby
[03:39:01] davep3rrett: has joined #ruby
[03:40:12] jas02: has joined #ruby
[03:43:01] Es0teric: has joined #ruby
[03:43:44] alxgsv: has joined #ruby
[03:45:42] illusionmedic: has joined #ruby
[03:46:18] Dimik: has joined #ruby
[03:51:27] jerematic: has joined #ruby
[03:53:31] d0nn1e: has joined #ruby
[03:54:33] gix: has joined #ruby
[03:59:37] mattwashere: has joined #ruby
[04:02:08] Pupeno: has joined #ruby
[04:02:30] darkxploit: has joined #ruby
[04:04:10] mattwashere: has joined #ruby
[04:05:02] wazzat: has joined #ruby
[04:05:05] k3rn31: has joined #ruby
[04:06:09] lightt: has joined #ruby
[04:07:00] hutch34_: has joined #ruby
[04:08:02] darkxploit: has joined #ruby
[04:08:37] jetpackjoe: has joined #ruby
[04:10:13] yfeldblum: has joined #ruby
[04:12:09] onechr: has joined #ruby
[04:13:39] jenrzzz: has joined #ruby
[04:13:39] jenrzzz: has joined #ruby
[04:15:00] darkxploit: has joined #ruby
[04:18:20] wazzat: has joined #ruby
[04:18:23] certainty: has joined #ruby
[04:18:38] cd83x: has joined #ruby
[04:19:39] ElFerna: has joined #ruby
[04:20:00] zapata: has joined #ruby
[04:21:38] devbug_: has joined #ruby
[04:25:28] jetpackjoe: has joined #ruby
[04:25:59] yfeldblum: has joined #ruby
[04:26:09] sid_fules: has joined #ruby
[04:27:18] pkrnj: has joined #ruby
[04:27:38] ensyde: has joined #ruby
[04:29:55] maletor3: has joined #ruby
[04:33:38] jottr_: has joined #ruby
[04:34:33] jas02: has joined #ruby
[04:35:12] ElFerna: has joined #ruby
[04:37:43] darkxploit: has joined #ruby
[04:37:52] ElFerna: has joined #ruby
[04:41:21] darkxploit: has joined #ruby
[04:42:02] dgynn: has joined #ruby
[04:44:50] nankyokusei: has joined #ruby
[04:45:42] LoneHerm_: has joined #ruby
[04:46:40] darkxploit: has joined #ruby
[04:47:16] arooni: has joined #ruby
[04:47:58] emilkarl: has joined #ruby
[04:50:11] noobsu: has joined #ruby
[04:50:18] darkxploit: has joined #ruby
[04:51:07] arifba: has joined #ruby
[04:52:24] arifba: how can i use case insensitivity in string.delete()?
[04:53:06] Radar: arif__: use a regular expression
[04:53:29] Radar: >> "HELLO WORLD".gsub(/hello/i, "hi")
[04:53:30] ruby[bot]: Radar: # => "hi WORLD" (https://eval.in/582316)
[04:56:13] darkxploit: has joined #ruby
[04:58:13] wazzat: has joined #ruby
[04:59:07] arifba: thanks! i'm trying to insert consonants inside / / but it doesn't seem to work
[04:59:14] arifba: "Chicken Nuggets".gsub(/^aeiou/i, "")
[04:59:41] arifba: for instance, here i want to delete all uppercase and lowercase consonants from "Chicken Nuggets"
[05:00:01] arifba: maybe i'm being thick
[05:00:04] darkxploit: has joined #ruby
[05:03:07] tpendragon: has joined #ruby
[05:04:04] aguynamedben: has joined #ruby
[05:04:16] kareeoleez: has joined #ruby
[05:05:53] ishe_ua: has joined #ruby
[05:07:39] Radar: >> "Chicken Nuggets".gsub(/^aeiou/i, "")
[05:07:40] ruby[bot]: Radar: # => "Chicken Nuggets" (https://eval.in/582317)
[05:07:50] Spami: has joined #ruby
[05:07:57] Radar: arif__: that checks for the characters aeiou at the beginning of that string
[05:08:15] Radar: >> "Chicken Nuggets".gsub(/[^aeiou]/i, "")
[05:08:16] ruby[bot]: Radar: # => "ieue" (https://eval.in/582318)
[05:08:21] Radar: That might be what you're after
[05:09:43] czerasz: has joined #ruby
[05:09:58] arifba: thanks a ton! also, is it possible to get the same result using the .delete method?
[05:10:18] Radar: [14:53:06] <Radar> arif__: use a regular expression
[05:11:19] arifba: got it. thanks
[05:12:20] pawnbox: has joined #ruby
[05:12:55] cd83x: has joined #ruby
[05:13:20] tildes_: has joined #ruby
[05:13:24] Devalo: has joined #ruby
[05:14:06] wazzat: has joined #ruby
[05:18:01] Devalo: has joined #ruby
[05:19:08] certainty: has joined #ruby
[05:21:00] emilkarl: has joined #ruby
[05:21:37] dionysus69: has joined #ruby
[05:24:07] darkxploit: has joined #ruby
[05:24:40] dtoast: has joined #ruby
[05:28:35] jas02: has joined #ruby
[05:28:51] sauvin: has joined #ruby
[05:30:47] maletor3: has joined #ruby
[05:32:19] pawnbox: has joined #ruby
[05:35:32] aguynamedben: has joined #ruby
[05:37:41] kgrz: has joined #ruby
[05:38:12] jas02: has joined #ruby
[05:38:29] duckpuppy: has joined #ruby
[05:39:25] jaguarmagenta: has joined #ruby
[05:39:27] grassass: has joined #ruby
[05:44:15] ksmutthu: has joined #ruby
[05:44:57] craigp: has joined #ruby
[05:46:07] jaguarmagenta: has joined #ruby
[05:46:15] tomphp: has joined #ruby
[05:50:34] wazzat: has joined #ruby
[05:51:18] ddffg: has joined #ruby
[05:52:39] pawnbox: has joined #ruby
[05:54:15] jerematic: has joined #ruby
[05:54:39] hellcode: has joined #ruby
[06:00:17] Macaveli: has joined #ruby
[06:04:32] noobsu: has joined #ruby
[06:05:30] pawnbox: has joined #ruby
[06:06:39] codecop: has joined #ruby
[06:06:44] n1x-nz: has joined #ruby
[06:07:09] cd83x: has joined #ruby
[06:08:15] fenre: has joined #ruby
[06:08:34] kraken: has joined #ruby
[06:08:57] krakenr: What's the point of a Struct when I could just use a hash? Are there any advantages?
[06:10:02] fenre: has joined #ruby
[06:10:05] tpendragon: has joined #ruby
[06:10:07] aguynamedben: has joined #ruby
[06:10:54] darkxploit: has joined #ruby
[06:11:59] certainty: has joined #ruby
[06:18:18] scepticulous: has joined #ruby
[06:20:30] kareeoleez: has joined #ruby
[06:22:06] aufi: has joined #ruby
[06:24:29] andikr: has joined #ruby
[06:26:30] skweek: has joined #ruby
[06:27:05] sid_fules: has joined #ruby
[06:31:33] maletor3: has joined #ruby
[06:32:27] freija_: has joined #ruby
[06:34:30] jottr_: has joined #ruby
[06:36:06] arifba: has joined #ruby
[06:37:13] neanderslob: has joined #ruby
[06:37:14] arifba: can someone take a look? -- https://gist.github.com/anonymous/c0c4300baf806b2be472b72dca041a8b
[06:37:49] arifba: i'm trying to access the variable 'name' outside the loop? is there an alternative way of doing it other than initializing the variable at the very beginning?
[06:37:50] simplon: has joined #ruby
[06:37:53] CausaMortis: has joined #ruby
[06:38:47] apeiros: arif__: not with this kind of loop
[06:38:56] apeiros: and this kind of variable
[06:39:23] arifba: could you please give an example what kind of loop/variable that'd work with?
[06:40:07] apeiros: while/until loops don't use a block argument and thus don't introduce a new scope for local variables
[06:40:19] dtoast: quick, timezones.
[06:40:23] apeiros: as for other variable types: please learn ruby for those. a quick explanation won't do.
[06:41:30] arifba: but while/until loops check for the condition at the beginning of the loop and won't work in this case
[06:41:50] apeiros: of course it will work. you just have to arrange your code accordingly.
[06:43:09] Spami_: has joined #ruby
[06:43:41] blackjid: has joined #ruby
[06:44:04] arifba: i'm confused. i'd be more than glad if you could kindly rearrange this particular code using while or any other loop that doesn't use a block argument
[06:44:11] aguynamedben: has joined #ruby
[06:44:37] yfeldblum: has joined #ruby
[06:44:51] apeiros: valid = false; until valid; …
[06:45:19] last_staff: has joined #ruby
[06:45:41] nankyokusei: has joined #ruby
[06:45:54] ur5us: has joined #ruby
[06:46:23] apeiros: ACTION afk for ~10min
[06:47:17] karmatr0n: has joined #ruby
[06:48:16] coffeecupp: has joined #ruby
[06:52:43] tAn: has joined #ruby
[06:57:54] djbkd: has joined #ruby
[06:58:05] kareeole_: has joined #ruby
[07:00:55] edwinvdgraaf: has joined #ruby
[07:01:18] cd83x: has joined #ruby
[07:01:23] jerematic: has joined #ruby
[07:02:27] TomyWork: has joined #ruby
[07:02:50] Madplatypus: has joined #ruby
[07:05:08] CloCkWeRX: has joined #ruby
[07:05:52] biberu: has joined #ruby
[07:09:01] terlar: has joined #ruby
[07:10:32] Couch: has joined #ruby
[07:11:11] Es0teric: has joined #ruby
[07:15:37] tpendragon: has joined #ruby
[07:16:01] norc_: has joined #ruby
[07:16:15] aguynamedben: has joined #ruby
[07:16:45] blackjid: has joined #ruby
[07:17:21] Macaveli_: has joined #ruby
[07:17:36] noobsu: has joined #ruby
[07:29:05] last_staff: has joined #ruby
[07:30:37] mdw: has joined #ruby
[07:31:30] mdw7: has joined #ruby
[07:32:17] maletor3: has joined #ruby
[07:33:04] Xentil: has joined #ruby
[07:33:22] darkxploit: has joined #ruby
[07:33:47] dtoast: has joined #ruby
[07:34:54] Mia: has joined #ruby
[07:34:54] Mia: has joined #ruby
[07:34:56] beilabs: has joined #ruby
[07:36:18] coffeecupp: has joined #ruby
[07:39:18] duckpuppy: has joined #ruby
[07:39:20] mark_66: has joined #ruby
[07:42:32] apeiros: moin adaedra
[07:44:23] sid_fules: has joined #ruby
[07:45:41] blackgoat: has joined #ruby
[07:46:18] jaruga___: has joined #ruby
[07:46:55] jaruga___: has joined #ruby
[07:48:08] karmatr0n: has joined #ruby
[07:49:19] harai: has joined #ruby
[07:49:44] duncannz: has joined #ruby
[07:51:12] iamvery: has joined #ruby
[07:53:17] arifba: has joined #ruby
[07:53:44] watersoul: has joined #ruby
[07:55:24] arifba: is there a way to whitelist characters from regex?
[07:55:28] cd83x: has joined #ruby
[07:55:49] sepp2k: has joined #ruby
[07:55:50] arifba: for instance, i'm using /[^a-z]/i to make sure that a string contains only alphabets
[07:56:11] arifba: here, i'd like to whitelist \s so the string can be of multiple words
[07:57:22] arifba: here's the code: https://gist.github.com/anonymous/ffffd5e7dcf67a71f365106f1d0dea44
[07:58:15] apeiros: arif__: add it to the character class
[07:58:20] apeiros: i.e. [^a-z\s]
[07:58:34] domgetter: has joined #ruby
[07:58:48] apeiros: ([…] in a regex is called "character class", and it's unrelated to classes in OO)
[07:59:18] apeiros: also note that a-z will break for anything international
[07:59:29] apeiros: \p{L} is better for that
[07:59:34] zacsek: has joined #ruby
[08:00:16] domgetter: I only parse strings that speak American!
[08:00:20] apeiros: and given your usecase, I don't think you want \s, you want just a space.
[08:00:40] apeiros: domgetter: since spanish is the majority in america, you'd still fail :-p
[08:02:06] jerematic: has joined #ruby
[08:03:58] ocbtec: has joined #ruby
[08:05:03] wnd: has joined #ruby
[08:08:25] harai54: has joined #ruby
[08:09:12] arifba: has joined #ruby
[08:10:29] arifba: soo regarding my last question, i did some googling and settled with /[^\p{L} ]/i
[08:10:39] arifba: would this work now?
[08:10:47] arifba: or can it be improved further?
[08:11:32] arifba: and how do you even reply to someone on this chat?
[08:12:40] apeiros: "would this work" - fire up irb (or better yet, install pry and fire up pry), and just test it
[08:13:00] apeiros: and you reply to somebody by starting the line with their nick
[08:13:03] liri: hi apeiros
[08:13:09] liri: did you manage to glance at : https://gist.github.com/mateuszef/0f8e373ad9e6770207f10c75e4134b64
[08:13:18] apeiros: conventionally you'll only do that in your initial reply. further lines it's implied.
[08:13:24] moeabdol: has joined #ruby
[08:13:47] apeiros: liri: ah, that ominous problem from yesterday with multiple occurrences of the same module in ancestry?
[08:14:17] liri: isn't it peculiar, that the order in which you include module causes differences in ancestors list?
[08:14:35] apeiros: it actually makes sense
[08:14:40] moeabdol1: has joined #ruby
[08:14:45] pawnbox: has joined #ruby
[08:14:59] apeiros: I didn't know it was possible to do it. but seems I have to update my knowledge wrt module inclusion
[08:15:44] liri: why having two times included the same module makes a sense ?
[08:15:56] liri: I had following problem
[08:16:10] Devalo: has joined #ruby
[08:16:39] liri: my code was structured like in the sample below, so include at the top level first, then include at class level.
[08:16:59] apeiros: say you have class A, and B < A, and you included M first in B, then in A
[08:17:01] liri: it caused, that ancestors list was in following order: A, Object, M, PP::ObjectMixin, Kernel, BasicObject]
[08:17:13] apeiros: if a method of A relies on a method of M, it would not be possible
[08:17:16] liri: and then I required active_record.
[08:17:41] liri: which modified Object, and caused that method try in M was shadowed by method try in Object, patched by active_record.
[08:18:06] apeiros: hence it makes sense that it is possible to still inject the module into A's ancestry (which of course means it'll appear a second time in B's ancestry)
[08:18:49] apeiros: well, welcome to the world of why it's bad to patch core classes
[08:19:11] liri: yes, but talking about your sample.
[08:20:05] norc: apeiros: oh but patching core classes is useful. Especially if you mount method_missing everywhere.
[08:20:11] norc: ACTION smiles
[08:20:29] liri: having class A, and B < A, where both A and B include M, B.ancestors shows: [B, A, M, Object, PP::ObjectMixin, Kernel, BasicObject]
[08:20:39] apeiros: norc: useful isn't congruent with good ;-)
[08:20:46] liri: shouldnt it be [B, M, A, M, Object, PP::ObjectMixin, Kernel, BasicObject]
[08:21:13] liri: Or M can't be duplicated in ancestos list then, [B, M, A, Object, PP::ObjectMixin, Kernel, BasicObject]
[08:21:28] norc: liri: The method name is a bit bad. What it really returns is the order in which Ruby looks your methods up.
[08:21:54] liri: so if module M is included in B, shouldnt lookup be B, M , A ....
[08:22:05] apeiros: liri: as we've learnt: not necessarily. it depends on the order you included M
[08:22:05] liri: instead of B, A, M ...
[08:22:27] apeiros: i.e. B, M, A, M -> included M in B first, then in A (which seems exceptional to me)
[08:22:54] apeiros: and B, A, M -> included in A first, including it in B after that won't matter since ruby detects M's presence in the ancestry and won't include it again, not even in a different place.
[08:22:57] liri: yeah it would be strange, to do it, first in sublcass and afterwards in base class.
[08:23:40] apeiros: there's also Module#prepend
[08:23:53] liri: ah, ok now I understand.
[08:23:57] norc: apeiros: Have you seen what prepend does under the hood?
[08:24:03] norc: It is downright disgusting.
[08:24:05] liri: yeah I know about it :) but don't want to mix it :)
[08:24:05] apeiros: norc: I haven't even used it yet
[08:24:23] norc: apeiros: It duplicates classes, injects them into the superclass chain
[08:24:26] apeiros: norc: more disgusting than refinements?
[08:24:45] lightt: has joined #ruby
[08:24:51] norc: apeiros: Don't get me started on refinements.
[08:24:56] liri: So if someone uses include at top level in some file, it is going to be messy sooner or later.
[08:25:21] apeiros: patching Object by any other means than refinements is by definition messy.
[08:25:45] norc: apeiros: See, *this* is why I want a builtin casting mechanism.
[08:25:57] norc: apeiros: So you can just derive from Object and downcast whenever you need to.
[08:26:15] apeiros: what would that give you?
[08:26:30] einarj: has joined #ruby
[08:26:35] apeiros: you can always copy all data from any object into a blank object…
[08:26:45] jaguarmagenta: has joined #ruby
[08:26:58] norc: apeiros: except then you have to delegate all methods to object...
[08:27:11] apeiros: and you can always rebind methods. well, ok: often. I still don't get why it requires ancestry to rebind :-/
[08:27:12] norc: This is what inheritance solves. ;-)
[08:27:46] apeiros: norc: so still - what does downcasting to object give you?
[08:27:55] norc: apeiros: not downcasting to object
[08:28:03] norc: (that you could only do with BasicObject)
[08:28:20] norc: apeiros: downcasting *from* object to your custom object class MyObject < Object
[08:28:30] wazzat: has joined #ruby
[08:28:30] apeiros: wouldn't that rather be "upcasting"? :)
[08:28:50] apeiros: well, you can do that
[08:28:52] norc: apeiros: nope. up-casting is casting an object to its supertype.
[08:28:53] marr: has joined #ruby
[08:29:13] apeiros: I wonder why we have reversed notions of the direction…
[08:29:31] apeiros: down -> simpler type, =~ "up" in the ancestry
[08:29:41] apeiros: anyway, here's your downcast:
[08:30:17] norc: apeiros: https://gist.github.com/norc/0930d1d17bd7afc47fb7f55578c627b5
[08:30:32] apeiros: class Object; def downcast(to_class); casted = to_class.allocate; instance_variables.each do |ivar| casted.instance_variable_set(ivar, instance_variable_get(ivar)) end; casted; end; end
[08:31:03] norc: That copies the object.
[08:31:19] norc: If you had meaningful information in your singleton class that would be missed.
[08:31:22] apeiros: if we want to be pedantic: it creates a new object and copies the contents ;-)
[08:31:40] apeiros: begs the question of whether that'd be good or bad
[08:31:42] norc: apeiros: my solution actually coerces it :D
[08:31:43] apeiros: after all, you do cast
[08:32:02] sid_fules: has joined #ruby
[08:32:15] apeiros: your solution is reminiscent of evil.rb :)
[08:32:20] norc: apeiros: my usecase is still when you have a library that returns an object of some class B that is not under your control.
[08:32:35] norc: apeiros: I wrote it myself though.
[08:32:52] norc: Took me just 16 seg faults (I counted!)
[08:33:01] apeiros: I doubt it's a good idea to switch classes of object being instances of classes you don't control
[08:33:07] maletor3: has joined #ruby
[08:33:19] apeiros: it does look cool, though :D
[08:33:59] norc: That could be a new metric for time spent to write Ruby code.
[08:34:07] kareeole_: has joined #ruby
[08:34:32] Corrosive__: has joined #ruby
[08:35:11] norc: apeiros: heck. looks like I should port evil.rb to Ruby 2.3 then
[08:35:28] haxrbyte: has joined #ruby
[08:36:23] staticfox`: has joined #ruby
[08:36:42] pawnbox: has joined #ruby
[08:36:49] ELCALOR_: has joined #ruby
[08:36:49] akitada_: has joined #ruby
[08:36:49] lipoqil_: has joined #ruby
[08:36:51] meinside_: has joined #ruby
[08:37:32] raeoks: has joined #ruby
[08:37:38] borkdude: has joined #ruby
[08:37:46] CoderPuppy: has joined #ruby
[08:37:46] webhat_: has joined #ruby
[08:38:03] web_nanners: has joined #ruby
[08:38:13] tabakhase__: has joined #ruby
[08:38:14] heinrich5991_: has joined #ruby
[08:38:16] TvL: has joined #ruby
[08:38:17] dr_Poggs: has joined #ruby
[08:38:19] LucasTT: has joined #ruby
[08:38:20] apeiros: norc: heh, why not? would get you some fame
[08:38:29] nemish: has joined #ruby
[08:38:29] bougyman_: has joined #ruby
[08:38:32] Sthebig_: has joined #ruby
[08:38:32] Sthebig_: has joined #ruby
[08:38:37] Apocalyp-: has joined #ruby
[08:38:48] irick_: has joined #ruby
[08:38:53] pbruna: has joined #ruby
[08:39:18] kaspergrubbe: has joined #ruby
[08:39:18] johnny56_: has joined #ruby
[08:39:19] jokke: has joined #ruby
[08:39:19] dionyziz: has joined #ruby
[08:39:19] sash_: has joined #ruby
[08:39:19] bodgix: has joined #ruby
[08:39:20] axisys_: has joined #ruby
[08:39:20] shortdudey123_: has joined #ruby
[08:39:22] st1gma: has joined #ruby
[08:39:22] camilasan: has joined #ruby
[08:39:22] zel: has joined #ruby
[08:39:22] sash_: has joined #ruby
[08:39:22] zel: has joined #ruby
[08:39:24] plantigrade: has joined #ruby
[08:39:30] sepp2k: has joined #ruby
[08:39:32] bodgix: has left #ruby: ()
[08:39:39] chippy: has joined #ruby
[08:39:44] mrsolo: has joined #ruby
[08:39:44] majoh: has joined #ruby
[08:39:49] nibbo: has joined #ruby
[08:40:17] Omni_: has joined #ruby
[08:40:19] manveru: has joined #ruby
[08:40:25] chrismytton: has joined #ruby
[08:40:29] halfdan: has joined #ruby
[08:40:48] lacce: has joined #ruby
[08:40:49] beilabs: has joined #ruby
[08:41:02] modin: has joined #ruby
[08:41:03] amitchellbullard: has joined #ruby
[08:41:06] rc0r: has joined #ruby
[08:42:57] gizmore: has joined #ruby
[08:43:12] TheHodge: has joined #ruby
[08:43:14] jottr_: has joined #ruby
[08:46:34] nankyokusei: has joined #ruby
[08:47:28] weckl: has joined #ruby
[08:47:52] [diecast]: has joined #ruby
[08:48:33] deepak: has joined #ruby
[08:48:38] digitalfiz: has joined #ruby
[08:48:44] kapowaz: has joined #ruby
[08:48:53] certainty: has joined #ruby
[08:49:05] DukeDave: has joined #ruby
[08:49:06] karmatr0n: has joined #ruby
[08:49:43] jhill: has joined #ruby
[08:49:46] cd83x: has joined #ruby
[08:50:09] mroth: has joined #ruby
[08:50:45] goeast: has joined #ruby
[08:50:49] elliottcable: has joined #ruby
[08:51:08] ckrailo: has joined #ruby
[08:51:11] jpinnix_______: has joined #ruby
[08:52:13] jmhmccr: has joined #ruby
[08:52:44] incomprehensibly: has joined #ruby
[08:52:54] knowtheory: has joined #ruby
[08:53:15] vcoinminer: has joined #ruby
[08:53:23] deeprave: has joined #ruby
[08:53:35] joonty: has joined #ruby
[08:53:39] rflot: has joined #ruby
[08:54:16] Pupeno: has joined #ruby
[08:54:41] symm-: has joined #ruby
[08:55:04] karioleez: has joined #ruby
[08:56:13] ijij_: has joined #ruby
[08:57:29] acalewin: has joined #ruby
[09:02:51] jerematic: has joined #ruby
[09:03:13] startupality: has joined #ruby
[09:05:22] err_ok: has joined #ruby
[09:05:25] Infra-Red: has joined #ruby
[09:06:06] coffeecupp: has joined #ruby
[09:06:31] edwinvdgraaf: has joined #ruby
[09:06:35] skolman_: has joined #ruby
[09:07:47] darkxploit: has joined #ruby
[09:09:38] craigp: has joined #ruby
[09:10:20] aphprentice: has joined #ruby
[09:10:32] Hates_: has joined #ruby
[09:10:44] braderhart: has joined #ruby
[09:11:08] Spami_: has joined #ruby
[09:12:03] hayden__: has joined #ruby
[09:12:28] swgillespie: has joined #ruby
[09:12:46] angiebadillo: has joined #ruby
[09:14:11] shevy: I liked evil.rb
[09:14:22] der-landgraf: has joined #ruby
[09:14:24] shevy: I think you could shapechange from one class to another clas at runtime with it too right?
[09:14:30] Guest70615: has joined #ruby
[09:14:30] Guest70615: has joined #ruby
[09:15:12] edwinvdgraaf: has joined #ruby
[09:15:29] certainty: has joined #ruby
[09:16:04] norc: Yes it did, and it even did some checks to ensure the cast was safe.
[09:16:46] Majost: has joined #ruby
[09:16:51] jcp: has joined #ruby
[09:17:32] jimcroft: has joined #ruby
[09:18:37] mitsuhiko: has joined #ruby
[09:19:54] grvgr: has joined #ruby
[09:20:37] shadowshell: has joined #ruby
[09:20:46] ketherah: has joined #ruby
[09:20:50] chorgi: has joined #ruby
[09:22:42] solocshaw: has joined #ruby
[09:24:41] JohnBat26: has joined #ruby
[09:27:41] sid_fules: has joined #ruby
[09:28:14] workmad3: has joined #ruby
[09:29:06] karioleez: has joined #ruby
[09:29:42] arne: has joined #ruby
[09:30:17] arne: question, if you have an application of any kind sinatra/ror whatever, and you have several daemons running paralell
[09:30:28] arne: how do you let those communicate?
[09:30:39] norc: arne: same way you would do any kind of IPC.
[09:30:44] arne: that is?
[09:30:53] norc: arne: Sockets, Unix Domain Sockets, Pipes, Message Brokers
[09:31:07] arne: database as an interface is considered dirty, right?
[09:31:15] norc: arne: That depends!
[09:31:28] arne: because til' now i was pretty happy with that
[09:31:33] norc: arne: A database could be considered an inter-server communication tool.
[09:31:47] tomphp: has joined #ruby
[09:32:17] arne: im doing that in like forever, and never had problems with it
[09:32:18] norc: arne: What kind of information do these servers need to communicate to each other?
[09:32:41] arne: right now im writing a daemon with several programs that do NOT require a database connection
[09:32:52] arne: and they need to be controlled by a web application
[09:32:54] bkxd: has joined #ruby
[09:33:14] arne: and since having database tables just for communciation sounds like a stupid idea
[09:33:20] norc: That it does indeed.
[09:33:22] arne: i thougt maybe im asking here
[09:33:42] norc: arne: Are all these applications written in Ruby?
[09:33:46] arne: well what protocol do i use for IPC is there a standard
[09:33:53] maletor3: has joined #ruby
[09:35:08] norc: arne: The traditional solutions are: Sockets, Unix Domain Sockets and Pipes.
[09:35:17] arne: yeah i meant how do i format the messages
[09:35:23] arne: sure i could do json or something
[09:35:25] norc: arne: You could also use something like Drb perhaps, but I have no prior experience to tell you how much headache that might give you.
[09:35:26] linduxed: has left #ruby: ("WeeChat 1.3")
[09:35:58] `derpy: http://ruby-doc.org/stdlib-2.3.0/libdoc/drb/rdoc/DRb.html
[09:36:10] arne: but im surprised you cannot google this stuff very easily
[09:36:20] norc: arne: Just google for "interprocess communication ruby"
[09:36:43] arne: wow dafuq is drb, that looks weird
[09:36:58] arne: how did i never hear of that
[09:37:06] norc: It is not particularly popular.
[09:37:10] norc: But has been around for a long while.
[09:37:32] arne: but it kinda feels scary
[09:37:44] arne: i would rather use serialized data, i think
[09:37:51] norc: arne: DRb handles serialization for you.
[09:37:54] norc: That is one of its beauties.
[09:38:19] arne: so it's like advanced RPC?
[09:38:33] norc: It is more.
[09:38:36] arne: i call object's methods from another server?
[09:38:41] norc: arne: You can even transfer objects.
[09:39:02] norc: arne: but yes in a nutshell.
[09:39:21] arne: haha, that's great, so you could write an application
[09:39:31] arne: that looks like all local but is distributed
[09:39:42] arne: and with metaprogramming you could do that quite seemingly
[09:39:47] norc: arne: DRb stands for "distributed ruby" - now you know why.
[09:39:53] arne: like h4x0r.crack_those_hashes
[09:39:57] duckpuppy: has joined #ruby
[09:40:19] arne: and haxor could have 0..infinity servers in background
[09:40:24] arne: cool stuff
[09:40:29] norc: arne: depending on *what* you need to communicate perhaps signals might be enough.
[09:40:42] arne: like syscall signals?
[09:40:46] norc: Yes very much so.
[09:40:55] arne: hm, can you have payloads with them?
[09:41:11] arne: or is it more like "i-put-a-file-at-/tmp/' signal
[09:41:54] norc: arne: well POSIX signals can carry payload...
[09:42:22] joonty: has joined #ruby
[09:42:55] arne: didn't know, i can send data with sigkill?
[09:43:06] arne: while being pretty useless
[09:43:08] norc: arne: No but with sigqueue
[09:43:33] norc: arne: http://pubs.opengroup.org/onlinepubs/007908775/xsh/sigqueue.html
[09:43:54] norc: arne: but that is another topic. Back to your thing.
[09:43:55] cd83x: has joined #ruby
[09:44:08] ruby-lang764: has joined #ruby
[09:44:10] norc: arne: another technique is message brokering with something like ACMQ
[09:44:32] norc: (RabbitMQ is a popular implementation)
[09:44:48] arne: norc: thanks alot
[09:45:43] arne: oh that reminds me of amazons sqs
[09:45:54] norc: Indeed. :)
[09:45:59] sid_fules: has joined #ruby
[09:46:55] norc: And if you want something like DRb but interoperate with other languages even, then CORBA is your friend.
[09:47:05] arne: nah ruby is the way to go
[09:47:16] arne: most beautiful ( and slow :3 ) language
[09:47:24] arne: wish it wasn't
[09:47:49] norc: Ruby 3.0 will finally do JIT, that will improve on the performance greatly.
[09:47:59] norc: (hopefully)
[09:48:08] arne: wow, that's great
[09:48:24] arne: how comes, did MRI even have a VM?
[09:48:28] arne: im not an expert on that field
[09:48:32] norc: Yes it does since 2.0.
[09:48:41] arne: but how do you jit an interpreter
[09:48:46] arne: so bytecode is a thing now in ruby
[09:48:53] norc: Has been for a long while already.
[09:48:55] norc: You can even look at it.
[09:49:04] norc: asm>> a = 1 + 1; puts a
[09:49:05] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/582432
[09:49:15] arne: yeah i looked at rbx during that time
[09:49:24] arne: but sticked to MRI agian when having too many problems
[09:49:44] Tempesta: has joined #ruby
[09:49:50] norc: arne: And since 2.3 you can finally load bytecode directly (so you can precompile your applications to improve startup times)
[09:50:02] arne: well but i have to do that by hand, right?
[09:50:21] arne: no rbc files, pythonstyle
[09:50:43] norc: &ri RubyVM::InstructionSequence.load_from_binary
[09:50:43] `derpy: http://ruby-doc.org/core-2.3.0/RubyVM/InstructionSequence.html#method-c-load_from_binary
[09:51:11] arne: would be great for minimal obfscusfufication i cannot write that word
[09:51:19] arne: obscurfication
[09:51:22] noobsu: has joined #ruby
[09:51:28] norc: Well that is the one thing its not meant for. ;-)
[09:51:35] norc: Well. Okay, "minimal".
[09:51:43] arne: yeah that's why i added that :)
[09:51:47] Hanmac: obscurfication is so obscure that no one can type it right at the first try XD
[09:52:10] norc: arne: The VM bit also has a debugging advantage by the way.
[09:52:33] arne: will ruby have an option to precompile who files? i think that'd be gr8
[09:52:44] norc: arne: Since Ruby allows you to inspect bytecode there are some corner cases where looking at bytecode can reveal some strange behaviour you may be experiencing.
[09:52:53] arne: well actually that could be done with an gem..
[09:52:58] skade: has joined #ruby
[09:52:59] norc: arne: That it has had for a while.
[09:53:03] johnmilton: has joined #ruby
[09:53:14] norc: &ri RubyVM::InstructionSequence.compile_file
[09:53:14] `derpy: http://ruby-doc.org/core-2.3.0/RubyVM/InstructionSequence.html#method-c-compile_file
[09:53:27] arne: and how do you start a compiled file?
[09:53:34] arne: but MRI is not LLVM, right?
[09:53:56] Spami: has joined #ruby
[09:53:59] Spami: has joined #ruby
[09:54:28] norc: arne: nope.
[09:54:34] norc: arne: Ruby has its own VM.
[09:54:44] arne: so does RBX but they use llvm
[09:55:00] arne: for jit and stuff
[09:55:19] Vingador: has joined #ruby
[09:56:08] sid_fules: has joined #ruby
[09:56:37] dtoast: has joined #ruby
[09:56:55] norc: arne: Currently developers are expecting a 3x performance boost with Ruby 3x3
[09:57:12] norc: (Yes the name 3x3 was probably chosen because of it)
[09:57:20] arne: sounds great
[09:57:27] arne: when will it come (~)
[09:57:42] RedDwarf: has joined #ruby
[09:57:48] arne: last question before you helped me enough :P: can you also run compiled files?
[09:57:56] klaas_: has joined #ruby
[09:58:01] norc: arne: http://ruby-doc.org/core-2.3.0/RubyVM/InstructionSequence.html#method-c-load_from_binary
[09:58:12] norc: ruby-lang764: you need to be identified with nickserv
[09:58:25] arne: well one method is named "compile file"
[09:58:31] arne: the second is called load method form binary
[09:58:57] blingrang: a == "test" ? return a : return "b" < why won't this work?
[09:59:01] norc: arne: First you compile a file into an iseq stream, you then serialize that iseq stream using to_binary
[09:59:11] norc: arne: and that binary bit can be load_from_binary
[09:59:28] jhass: has joined #ruby
[09:59:29] arne: ah, so only thing left to be taken care of is require
[09:59:42] arne: right? or will it even include requires
[10:00:03] arne: :O require is a method
[10:00:07] norc: arne: well no.
[10:00:20] arne: thought it's a keyword
[10:00:23] toretore: has joined #ruby
[10:00:24] norc: arne: An iseq stream is basically just bytecode. You can eval() it.
[10:00:26] arne: the more you laern
[10:00:39] arne: but the bytecode will create classes and shit?
[10:00:45] norc: arne: hopefully. ;-)
[10:00:51] norc: asm>> class A; end
[10:00:52] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/582464
[10:01:05] norc: arne: as you can see, the class definition translates to bytecode commands that create a class.
[10:01:10] ICantCook: has joined #ruby
[10:01:44] sauvin_: has joined #ruby
[10:01:57] Bish: >> RubyVM::InstructionSequence.compile("def test puts 'test' end").disasm.to_binary
[10:01:58] ruby[bot]: Bish: # => <compiled>:1: syntax error, unexpected tSTRING_BEG, expecting ';' or '\n' ...check link for more (https://eval.in/582469)
[10:02:30] norc: >> RubyVM::InstructionSequence.compile("def test; puts 'test' end").disasm.to_binary
[10:02:31] ruby[bot]: norc: # => undefined method `to_binary' for #<String:0x41901a14> (NoMethodError) ...check link for more (https://eval.in/582470)
[10:02:37] norc: >> RubyVM::InstructionSequence.compile("def test; puts 'test' end").to_binary
[10:02:37] ruby[bot]: norc: # => "YARB\x02\x00\x00\x00\x03\x00\x00\x00\x91\x02\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x0 ...check link for more (https://eval.in/582471)
[10:02:54] Gasher: has joined #ruby
[10:03:00] noobsu: has joined #ruby
[10:03:01] norc: Bish: the disasm is just disassembling into a human readable form. :)
[10:03:08] karioleez: has joined #ruby
[10:03:18] norc: (Which is what my asm>> does)
[10:03:33] Bish: i get it
[10:03:35] jerematic: has joined #ruby
[10:04:13] skade: has joined #ruby
[10:04:16] norc: Bish: If you are really interested into the internals of Ruby there is a superb book, "Ruby Under a Microscope"
[10:05:45] shinnya: has joined #ruby
[10:05:49] heftig: has joined #ruby
[10:05:55] lirimaery: has joined #ruby
[10:06:15] contradictioned: has joined #ruby
[10:06:15] ohcibi: has joined #ruby
[10:06:19] kalleth: has joined #ruby
[10:06:21] Rush: has joined #ruby
[10:06:40] soahccc: has joined #ruby
[10:07:09] lirimaery: /msg NickServ VERIFY REGISTER lirimaery gsshvkjdevmz
[10:07:26] RushPL: has joined #ruby
[10:07:29] norc: lirimaery: I think... you might have made a typo there..
[10:07:35] MyMind: has joined #ruby
[10:07:41] lirimaery: how to use it ? :)
[10:07:47] norc: [12:07] <lirimaery> /msg NickServ VERIFY REGISTER lirimaery gsshvkjdevmz
[10:07:57] Guest91763: has joined #ruby
[10:08:34] ruby[bot]: lirimaery: I have disassembled your code, the result is at https://eval.in/582484
[10:08:42] bastelfreak: has joined #ruby
[10:08:46] lirimaery: thanks you are really nice to me
[10:08:55] [diecast]: has joined #ruby
[10:09:01] nyuszika7h: has joined #ruby
[10:09:01] darix-: has joined #ruby
[10:09:16] bkxd_: has joined #ruby
[10:09:20] deepak: has joined #ruby
[10:09:24] digitalfiz: has joined #ruby
[10:09:28] kapowaz: has joined #ruby
[10:09:46] DukeDave: has joined #ruby
[10:10:12] karmatr0n: has joined #ruby
[10:10:16] FastJack_: has joined #ruby
[10:10:22] jhill: has joined #ruby
[10:10:49] mroth: has joined #ruby
[10:11:23] elliottcable: has joined #ruby
[10:11:32] bauruine: has joined #ruby
[10:11:44] Noxilex: has joined #ruby
[10:11:46] jpinnix_______: has joined #ruby
[10:11:47] ckrailo: has joined #ruby
[10:11:54] terlar: has joined #ruby
[10:12:35] jmhmccr: has joined #ruby
[10:12:55] twistedpixels_: has joined #ruby
[10:12:55] twistedpixels_: has joined #ruby
[10:13:03] mesamoo: has joined #ruby
[10:13:06] incomprehensibly: has joined #ruby
[10:13:09] knowtheory: has joined #ruby
[10:13:13] ujjain: has joined #ruby
[10:13:13] ujjain: has joined #ruby
[10:13:29] thelacce: has joined #ruby
[10:13:33] vcoinminer: has joined #ruby
[10:13:39] deeprave: has joined #ruby
[10:14:00] rflot: has joined #ruby
[10:14:00] electrostat_: has joined #ruby
[10:14:08] drbrain: has joined #ruby
[10:14:28] SuperTux88: has joined #ruby
[10:14:30] zyzioziom: has joined #ruby
[10:15:00] ksmutthu_: has joined #ruby
[10:16:07] ijij_: has joined #ruby
[10:16:26] bnjf: has joined #ruby
[10:17:08] renderful: has joined #ruby
[10:18:05] acalewin: has joined #ruby
[10:20:52] der-land1: has joined #ruby
[10:21:09] infernix: has joined #ruby
[10:21:49] tristanp: has joined #ruby
[10:22:16] solocshaw1: has joined #ruby
[10:25:10] contradictioned: has joined #ruby
[10:25:10] ohcibi: has joined #ruby
[10:25:12] soahccc: has joined #ruby
[10:25:14] kalleth: has joined #ruby
[10:25:31] Rush: has joined #ruby
[10:25:42] PaulePanter: has joined #ruby
[10:25:43] cbrad: has joined #ruby
[10:26:12] RushPL: has joined #ruby
[10:27:01] Guest91763: has joined #ruby
[10:27:33] bauruine: has joined #ruby
[10:28:25] AlexJakeGreen: has joined #ruby
[10:29:29] Hobbyboy|BNC: has joined #ruby
[10:29:40] err_ok: has joined #ruby
[10:31:00] SuperTux88: has joined #ruby
[10:34:25] aphprentice: has joined #ruby
[10:34:35] Hates_: has joined #ruby
[10:34:38] maletor3: has joined #ruby
[10:34:45] braderhart: has joined #ruby
[10:35:27] gingray: has joined #ruby
[10:35:30] sid_fules: has joined #ruby
[10:35:52] hayden__: has joined #ruby
[10:36:16] shevy: webchatters :)
[10:36:22] swgillespie: has joined #ruby
[10:36:42] angiebadillo: has joined #ruby
[10:38:28] cd83x: has joined #ruby
[10:41:23] Majost: has joined #ruby
[10:41:27] jcp: has joined #ruby
[10:42:13] jimcroft: has joined #ruby
[10:43:26] mitsuhiko: has joined #ruby
[10:43:35] c355E3B: has joined #ruby
[10:45:01] grvgr: has joined #ruby
[10:45:11] craigp: has joined #ruby
[10:45:33] blaxter: has joined #ruby
[10:45:34] zacsek: has joined #ruby
[10:45:37] majjoha: has joined #ruby
[10:45:40] whiteline: has joined #ruby
[10:45:43] iceden: has joined #ruby
[10:45:44] Insti: has joined #ruby
[10:45:48] shadowshell: has joined #ruby
[10:46:01] ketherah: has joined #ruby
[10:46:02] chorgi: has joined #ruby
[10:47:29] nankyokusei: has joined #ruby
[10:49:28] theozaurus: has joined #ruby
[10:49:48] TomyWork: has joined #ruby
[10:49:48] flopsec: has joined #ruby
[10:49:48] webhat_: has joined #ruby
[10:49:48] fenre: has joined #ruby
[10:49:48] jrafanie: has joined #ruby
[10:49:48] tw1sted: has joined #ruby
[10:49:48] eljimador: has joined #ruby
[10:49:48] Antiarc: has joined #ruby
[10:49:49] M-shine: has joined #ruby
[10:49:49] hypnosb: has joined #ruby
[10:49:49] forgot: has joined #ruby
[10:49:49] mame3: has joined #ruby
[10:49:49] KillerFox: has joined #ruby
[10:50:55] DaniG2k: has joined #ruby
[10:54:43] theozaurus: Hi All, I'm trying to figure out if I can get a couple of consumers of an enumerable to execute in the order that I want. Check out: https://gist.github.com/theozaurus/354c755470b1ef7e1c34234c90567f9e . I can't work out how to properly deal with the stream within class A. Any help would be really appreciated!
[10:56:15] norc: theozaurus: Use .zip? :)
[10:56:39] theozaurus: Oooh, let me have a play
[10:56:50] norc: theozaurus: oh wait that wont really help with what you are doing.
[10:57:13] norc: theozaurus: https://gist.github.com/theozaurus/354c755470b1ef7e1c34234c90567f9e#file-lazy_stream-rb-L7
[10:57:14] theozaurus: Do you mean to zip processors with processors then feed each one
[10:57:28] norc: theozaurus: instead of calling it with list, you have to iterate over the list and call each processor with each item.
[10:58:16] theozaurus: Yeah, I was hoping to avoid that so that B would have an easy interface
[10:58:38] norc: theozaurus: that is however exactly what you asked for.
[10:58:59] haxrbyte: has joined #ruby
[10:59:24] norc: Your desired output could be formulated as: I want to iterate over my list, and each element should then be passed to every processor.
[10:59:39] norc: Which is just another way of saying @processors.each { |p| list.each { |element| p.call(element) } }
[10:59:43] theozaurus: Haha, okay let me rephrase my question. Leaving B the same, how can I modify A to get to my desired output
[11:00:01] norc: list.each { |element| @processors.each { |p| p.call(element) } }
[11:00:10] norc: theozaurus: ^-
[11:00:35] theozaurus: Sorry, my example is too contrived. So that will work, but in reality it's a calculation I'm doing. Let me modify
[11:01:07] norc: theozaurus: that we call an XY problem.
[11:02:31] darkxploit: has joined #ruby
[11:03:57] norc: theozaurus: Matrix#transpose // Array.zip (they are the same thing effectively) -- it sounds a lot like its what you want.
[11:04:03] norc: *Array#zip
[11:04:06] rodfersou: has joined #ruby
[11:04:23] jerematic: has joined #ruby
[11:05:33] hk238: has joined #ruby
[11:05:57] sid_fules: has joined #ruby
[11:06:40] Bish: >> RubyVM::InstructionSequence.load_from_binary(RubyVM::InstructionSequence.compile("def test; yield; end").to_binary).eval;test { puts "whopdidu" }
[11:06:41] ruby[bot]: Bish: # => whopdidu ...check link for more (https://eval.in/582575)
[11:06:57] theozaurus: norc: https://gist.github.com/theozaurus/354c755470b1ef7e1c34234c90567f9e
[11:07:14] norc: Bish: :)
[11:08:05] theozaurus: Okay, it's a little more realistic now. Essentially I am expecting a huge stream of things and I don't want to run through it multiple times, but I also don't want my processors to be side affect free.
[11:09:22] bodgix: has joined #ruby
[11:09:50] theozaurus: * I also want my processors to be side affect free
[11:12:29] Fernando-Basso: has joined #ruby
[11:14:55] Bish: ruby with jit would be so awesome
[11:15:09] moeabdol1: has joined #ruby
[11:15:17] apeiros: use jruby?
[11:15:44] Bish: well my guess is im using c extensions everyhwer
[11:16:18] hiyosi: has joined #ruby
[11:18:13] theozaurus: I've tried to clarify my question and stuck it on so: http://stackoverflow.com/questions/37612961/listen-to-lazy-enumerable
[11:20:02] norc: theozaurus: Currently busy with things. But if nobody responds Ill absolutely get back to you. :)
[11:23:08] theozaurus: norc: Thanks!
[11:23:23] lightt: has joined #ruby
[11:24:59] gizmore: has joined #ruby
[11:25:11] jaguarmagenta: has joined #ruby
[11:26:23] [spoiler]: has joined #ruby
[11:29:34] johnmilton: has joined #ruby
[11:30:01] harai54: has joined #ruby
[11:30:35] k3rn31: has joined #ruby
[11:30:43] lacce: has joined #ruby
[11:31:36] Hyuk: has joined #ruby
[11:32:15] blandflakes: has joined #ruby
[11:32:25] shevy: Bish one day! all the good things will come to us. we need more C gurus
[11:32:33] cd83x: has joined #ruby
[11:32:53] AlexJakeGreen: has joined #ruby
[11:33:32] sid_fules: has joined #ruby
[11:35:20] maletor3: has joined #ruby
[11:35:27] norc: theozaurus: Have you a) had performance problems and b) profiled your code to determine that particular code to be problematic?
[11:35:57] norc: If not you are wasting time on a premature optimization.
[11:36:33] theozaurus: It's a system designed to process millions of events so I want to make sure my architecture is sensible.
[11:36:50] jespada: has joined #ruby
[11:37:28] Jamo_: has joined #ruby
[11:37:32] norc: Fair enough.
[11:37:34] jamon_: has joined #ruby
[11:37:58] norc: theozaurus: Do you want to roll your own, or is something like eventmachine a possibility?
[11:39:32] Jamo_: has joined #ruby
[11:40:24] theozaurus: I don't think I need a reactor loop to do what I want. I'm hoping that there is a primitive I can take advantage of which will save the complexity of EM.
[11:40:44] duckpuppy: has joined #ruby
[11:41:45] xlegoman: has joined #ruby
[11:41:49] jamo: has joined #ruby
[11:42:13] karapetyan: has joined #ruby
[11:44:42] snowy: has joined #ruby
[11:45:01] sdothum: has joined #ruby
[11:45:07] ddffg: has joined #ruby
[11:45:17] allcentury: has joined #ruby
[11:48:09] electrostat: has joined #ruby
[11:49:29] certainty: has joined #ruby
[11:50:20] chrisseaton: norc: I don't think anyone is actually working on a jit though are they?
[11:50:52] ldnunes: has joined #ruby
[11:51:02] chrisseaton: It would be great but someone with the skills actually needs to do the work and nobody seems to want to do it
[11:51:12] norc: chrisseaton: It will be some outside solution.
[11:51:22] norc: chrisseaton: https://github.com/rubyomr-preview/rubyomr-preview
[11:52:13] chrisseaton: I'm not sure OMR has demonstrated any useful speed up yet
[11:52:39] norc: chrisseaton: RuJIT has.
[11:52:42] norc: at least.
[11:52:52] skade: has joined #ruby
[11:55:02] tvw: has joined #ruby
[11:56:33] rodferso1: has joined #ruby
[11:57:11] Hanmac: has joined #ruby
[11:57:11] zyzioziom: has joined #ruby
[11:57:39] tlaxkit: has joined #ruby
[11:57:42] gnufied: has joined #ruby
[11:58:29] maucar: has joined #ruby
[11:59:13] kgrz_: has joined #ruby
[12:04:16] kgrz: has joined #ruby
[12:05:07] jerematic: has joined #ruby
[12:05:53] romistrub: has joined #ruby
[12:05:57] Ishido: has joined #ruby
[12:06:46] romistrub: can somebody please explain to me why my code never reaches inside the 'each' at line 168
[12:06:47] romistrub: https://gist.github.com/anonymous/ae63011651aee0500f0d9237fe2a76c4
[12:06:54] nettoweb: has joined #ruby
[12:08:29] chrisseaton: I think we should write a jit in Ruby, the both MRI and Rubinius could use it
[12:08:41] apeiros: romistrub: put this on top of your code: `Thread.abort_on_exception = true`
[12:08:56] apeiros: by default, threads die silently in case of an exception
[12:09:05] apeiros: above makes your whole app crash loudly
[12:09:06] romistrub: apeiros: nice to see you again; will do
[12:09:10] romistrub: oh, really!
[12:09:13] Lildirt: has joined #ruby
[12:09:22] apeiros: I'm always here? (just not always on-keyboard)
[12:09:30] jhass: ?styleguides
[12:09:30] ruby[bot]: here are three popular styleguides, you should read and follow at least one: https://github.com/styleguide/ruby https://github.com/bbatsov/ruby-style-guide https://github.com/thoughtbot/guides/tree/master/style/ruby
[12:09:31] romistrub: Is that a question? :P
[12:09:35] beilabs: has joined #ruby
[12:09:36] Pumukel: has joined #ruby
[12:10:19] Pupeno: has joined #ruby
[12:10:42] chouhoulis: has joined #ruby
[12:11:27] synthroid: has joined #ruby
[12:11:27] solars: has joined #ruby
[12:12:00] chouhoulis: has joined #ruby
[12:12:07] romistrub: apeiros: magical! it works now :)
[12:12:39] certainty: has joined #ruby
[12:12:44] mc_fail: hi floks, is it possible to force having space after argument in OptionParser for ruby 2.3 ?
[12:12:48] pontiki: has joined #ruby
[12:14:07] mc_fail: for example, if user has passed -l value the program should consider -l = value, if user has passed -lvalue - program should throw an error
[12:14:26] uncertainty: has joined #ruby
[12:15:10] apeiros: romistrub: funny - it should have crashed, but in doing so, it also should have given you the chance to figure where and why…
[12:15:18] apeiros: but all the better if it just magically works now
[12:15:32] mc_fail: i don't see any related examples in http://ruby-doc.org/stdlib-2.3.1/libdoc/optparse/rdoc/OptionParser.html
[12:15:52] jhass: option parser probably just doesn't support what you want then
[12:16:28] evidex: has joined #ruby
[12:17:03] rbr: has joined #ruby
[12:17:44] sdothum: has joined #ruby
[12:19:21] nullwarp: has joined #ruby
[12:25:30] romistrub: So I'm building a custom Ruby HTTP server and need a hosting site for it. Can DigitalOcean do that?
[12:26:02] romistrub: apeiros: it did crash, haha, then I figured out why it crashed and fixed it. Just skipped that step in the explanation.
[12:26:08] romistrub: apeiros: awesome, thanks
[12:26:11] apeiros: romistrub: aha!
[12:26:34] synthroid: has joined #ruby
[12:26:44] cd83x: has joined #ruby
[12:27:11] xlegoman: has joined #ruby
[12:28:03] certainty: has joined #ruby
[12:29:13] duoi: has joined #ruby
[12:29:15] karmatr0n: has joined #ruby
[12:30:43] duoi: has joined #ruby
[12:31:23] synthroid: has joined #ruby
[12:32:01] Pupeno: has joined #ruby
[12:32:08] goeast: has joined #ruby
[12:32:25] darkxploit: has joined #ruby
[12:32:54] ArgartellO: has joined #ruby
[12:34:02] deadnull_: has joined #ruby
[12:34:07] certainty: has joined #ruby
[12:35:49] bruce_lee: has joined #ruby
[12:36:04] maletor3: has joined #ruby
[12:36:07] duckpuppy: has joined #ruby
[12:36:17] norc: apeiros: If code magically works that should be crashing, that would be worrying more than the segmentation fault screen from Ruby I regularly get.
[12:36:25] wazzat: has joined #ruby
[12:36:37] norc: Well okay, the seg fault screen does not worry me anymore... at all...
[12:37:44] apeiros: you're fearless
[12:39:21] fmcgeough: has joined #ruby
[12:40:38] norc: Actually I fear a great many things. Tigers, bombs exploding near me, "Hello Kitty"...
[12:41:35] flashpoint9: has joined #ruby
[12:41:59] davedev24: has joined #ruby
[12:42:07] norc: If only I had a VT100 that I could plug into my brain, I would be able to reprogram myself to remove fear.
[12:43:32] adaedra: You shouldn't, fear is sometimes useful.
[12:44:40] rubito: has joined #ruby
[12:45:22] r_rios: has joined #ruby
[12:45:54] shevy: tigers are very useful!
[12:45:56] Pupeno: has joined #ruby
[12:46:10] haxrbyte: has joined #ruby
[12:46:42] noobsu_: has joined #ruby
[12:47:00] norc: adaedra: You think? I always thought standing on a street and not running away when a car approaches could be the better solution. Sadly I have no prior experience to draw from.
[12:47:11] norc: So this is just a theory.
[12:47:41] adaedra: Don't worry, many people experienced before you.
[12:48:18] nankyokusei: has joined #ruby
[12:48:54] rubito: has left #ruby: ()
[12:50:03] norc: Doesn't the scientific method require me to be skeptical of other peoples findings? Repeating other peoples experiments is important, perhaps their experiments had some fundamental flaws.
[12:50:40] solocshaw1: has joined #ruby
[12:53:09] hutch34_: has joined #ruby
[12:55:17] irbedded: has joined #ruby
[12:55:37] sid_fules: has joined #ruby
[12:55:45] Infra-Red: has joined #ruby
[12:56:22] darkxploit: has joined #ruby
[12:56:47] sash_: has joined #ruby
[12:56:47] sash_: has joined #ruby
[12:58:00] karmatr0n: has joined #ruby
[12:58:17] ramortegui: has joined #ruby
[13:01:02] Infra-Red: has joined #ruby
[13:01:55] jhass: shouldn't you be the observer in your experiments, not the actor?
[13:02:19] Tempesta: has joined #ruby
[13:04:29] tildes: didn't some scientists in the good old days conduct experiments on themselves too, such as tasting radioactive substances, conducting electric current to their brain, etc?
[13:05:51] jerematic: has joined #ruby
[13:06:07] jhass: more than necessary I imagine, given the difficulty of writing up your results after some of that
[13:06:27] kies: has joined #ruby
[13:07:15] tildes: this was probably more common back in the days, when scientific publishing took place either in latin, or through hand-written letters
[13:07:34] tildes: (or both of course)
[13:07:58] ChiefAlexander: has joined #ruby
[13:10:01] aegis3121: has joined #ruby
[13:10:32] sdothum: has joined #ruby
[13:12:28] camilasan: has joined #ruby
[13:13:11] shevy: I pity those old folks - they had no ruby
[13:13:22] dcluna: has joined #ruby
[13:13:29] sdothum: has joined #ruby
[13:13:40] kareeole_: has joined #ruby
[13:13:57] solars: has joined #ruby
[13:17:32] hutch34: has joined #ruby
[13:17:36] Devalo: has joined #ruby
[13:19:28] rippa: has joined #ruby
[13:20:42] k3rn31: has joined #ruby
[13:21:07] cd83x: has joined #ruby
[13:23:39] sdothum: has joined #ruby
[13:24:34] sid_fules: has joined #ruby
[13:25:07] GodFather: has joined #ruby
[13:25:38] malconis: has joined #ruby
[13:25:49] theozaurus: has joined #ruby
[13:25:59] jaguarmagenta: has joined #ruby
[13:26:11] Macaveli: has joined #ruby
[13:30:31] norc: jhass: You see, that was just darwinism at work. Over time only the good scientists survived, which brought us the technical revolution.
[13:31:55] d0lph1n98: has joined #ruby
[13:32:37] wazzat: has joined #ruby
[13:33:28] millerti: has joined #ruby
[13:35:34] ips|malc: has joined #ruby
[13:35:35] roamingdog: has joined #ruby
[13:36:32] freerobby: has joined #ruby
[13:36:54] maletor3: has joined #ruby
[13:39:56] Hyuk: has joined #ruby
[13:41:40] jerematic: has joined #ruby
[13:42:28] allcentury: has joined #ruby
[13:42:33] JakFrist: has joined #ruby
[13:42:47] ZeroeSparticus: has joined #ruby
[13:45:44] sid_fules: has joined #ruby
[13:45:54] crystal77: has joined #ruby
[13:47:22] frem_: has joined #ruby
[13:50:03] futilegames: has joined #ruby
[13:50:38] SilverKey: has joined #ruby
[13:52:16] sid_fules: has joined #ruby
[13:52:46] mattwashere: has joined #ruby
[13:54:06] solocshaw1: has joined #ruby
[13:56:22] CJKinni: has joined #ruby
[13:59:28] chouhoulis: has joined #ruby
[14:00:18] certainty: has joined #ruby
[14:00:29] hutch34_: has joined #ruby
[14:02:49] JakFrist: has joined #ruby
[14:03:27] flughafen_: has joined #ruby
[14:04:17] CustosLimen: so I have this: https://github.com/asciidoctor/docbookrx
[14:04:27] CustosLimen: I don't get how I run the stuff in specs though
[14:04:42] vondruch: has joined #ruby
[14:04:45] cemerick: has joined #ruby
[14:04:45] jhass: https://github.com/asciidoctor/docbookrx/blob/master/Rakefile#L3
[14:04:48] cemerick: AFAICT, rvm has set up my environment properly (GEM_HOME, etc point to ~/.rvm/...), but `bundle install` fails with "There was an error while trying to write to `/gems/ruby/2.3.0`"
[14:04:53] cemerick: any suggestions?
[14:04:54] yfeldblum: has joined #ruby
[14:05:09] vondruch: has joined #ruby
[14:05:13] banister: has joined #ruby
[14:06:30] norc: cemerick: mmm, is it possible that its actually trying to install to /gems ? (off the root of your filesystem)
[14:06:43] CamCam2: has joined #ruby
[14:06:59] cemerick: norc: that certainly looks like what it's trying to do, but I can't begin to speculate as to why
[14:07:00] norc: cemerick: strace could be helpful
[14:07:31] yfeldblum: has joined #ruby
[14:07:33] jhass: cemerick: or rvm info for starters
[14:08:58] cemerick: jhass: yeah, it looks pretty sane AFAICT https://gist.github.com/cemerick/b7999599f54c4ede415ebf067bf188c2
[14:09:47] wilsonc91: has joined #ruby
[14:09:50] jhass: how about bundle config?
[14:09:52] palms: has joined #ruby
[14:13:08] comforte: has joined #ruby
[14:13:29] comforte: does anyone know a script that's a python and a ruby script?
[14:13:56] Yiota: has joined #ruby
[14:14:01] norc: comforte: ;
[14:14:17] jhass: cemerick: so you found something in bundle config?
[14:14:18] cemerick: jhass: good call, thank you very much. I never would have figured that out (I touch ruby every ~5 years or so :-)
[14:14:38] cemerick: the sudden radio silence is a dead giveaway I guess!
[14:14:49] Yiota: has joined #ruby
[14:14:54] jhass: comforte: and now?
[14:15:07] cemerick: project-specific gem paths? Is that, um, typical?
[14:15:13] comforte: how about: puts "I am a ruby script"\nprint "I am a python script"
[14:15:21] comforte: how could I dispatch between the two? =)
[14:15:23] cd83x: has joined #ruby
[14:15:25] norc: cemerick: it can be if you have set it up that way.
[14:15:30] floatingpoint: has joined #ruby
[14:15:41] cemerick: norc: deliciously tautological ;-P
[14:15:53] norc: cemerick: Heh. It could be useful for deployments.
[14:16:01] jhass: comforte: print("I'm a ruthon script!\n")
[14:16:12] norc: jhass: I see what you did there.
[14:16:29] apeiros: google "polyglot ruby python" could help
[14:16:41] agent_white: has joined #ruby
[14:17:11] agit0: has joined #ruby
[14:17:18] apeiros: moin agent_white
[14:17:33] norc: cemerick: Though other than that I prefer gem_home to manage multiple gemsets at the same time.
[14:17:37] cemerick: norc: there's no .bundle/config in the source repo, so it must have been generated locally at some point?
[14:17:59] jhass: yes, you typically don't check in .bundle/config
[14:18:06] jhass: that'd be against its point
[14:18:20] jhass: so also yes, must've run bundle --path /gems ... at some point
[14:18:42] cemerick: must've been some monkey rolling his head across the keyboard .... at some point
[14:18:43] jhass: I actually use bundle --path vendor/bundle over gemsets these days
[14:19:11] prestorium: has joined #ruby
[14:19:16] norc: jhass: for other reasons than deployment?
[14:19:26] cemerick: I was thrashing away trying to get started with the project last week, so anything's possible
[14:19:38] cemerick: anyway, thanks again very much for your help, jhass & norc
[14:19:52] jhass: norc: deployment does --deployment
[14:19:59] jhass: so it's also frozen
[14:20:09] jhass: which I don't want in dev of course
[14:20:28] norc: jhass: Can you elaborate what motivations you have for using a local bundle over a gemset?
[14:20:33] jhass: has the advantage of a rm -rf foo and the project is gone
[14:20:39] nettoweb: has joined #ruby
[14:20:46] symm-: has joined #ruby
[14:20:53] jhass: and I don't need a gemset manager
[14:21:05] jhass: chruby and (in my case) pacman and done
[14:22:13] jhass: I mean all newer programming package managers already operate that way by default
[14:22:15] norc: Ah. Well so far I only use gem_home to switch between my rails5 gemset (I really want the rails5 binstub) and evertyhing else.
[14:22:37] joonty: has joined #ruby
[14:24:36] RobertBirnie: has joined #ruby
[14:26:54] qasaur: has joined #ruby
[14:29:13] zacsek: has joined #ruby
[14:29:49] ZeroeSparticus: has joined #ruby
[14:30:14] Yiota: has joined #ruby
[14:31:04] Yiota: has joined #ruby
[14:31:13] rbr: has joined #ruby
[14:31:58] Yiota: has joined #ruby
[14:32:36] kgrz: has joined #ruby
[14:32:43] Yiota: has joined #ruby
[14:33:28] shevy: I just found https://libraries.io/rubygems/pry/sourcerank - that's quite nice, for gem authors too, to see whether their gems are up to "common standards" or whether they are not
[14:33:33] palms: has joined #ruby
[14:33:38] Yiota: has joined #ruby
[14:33:47] certainty: has joined #ruby
[14:34:03] SilverKey: has joined #ruby
[14:34:39] goeast_: has joined #ruby
[14:34:40] Yiota: has joined #ruby
[14:34:59] shevy: though it is biased :P
[14:35:00] Yiota: has joined #ruby
[14:37:11] cdg: has joined #ruby
[14:37:37] maletor3: has joined #ruby
[14:40:37] smathy: has joined #ruby
[14:40:49] Gasher: hello, I'm trying to make multi-dimensional hashes and I don't know how to add them
[14:41:12] Gasher: how to add anything to a subhash
[14:42:32] flughafen_: has joined #ruby
[14:42:36] smathy: Gasher, h[:foo][:bar] = 1
[14:42:54] smathy: ...or h[:foo] = { bar: 1 } if you're adding the whole sub-hash
[14:43:02] tildes: assuming h = {}; h[:foo] = {}
[14:43:25] tildes: because you still need to initialize the hashes, for [] call to work
[14:43:51] mwlang: has joined #ruby
[14:44:09] Gasher: yeah I know
[14:44:12] Gasher: and that didn't really work
[14:44:25] Gasher: but I do I need to initialise the subhash?
[14:44:51] Gasher: ah, I think that's what went wrong
[14:45:04] sphex: has joined #ruby
[14:46:14] Gasher: YUS, works, thanks
[14:46:26] tildes: Gasher: glad to hear that :)
[14:46:29] Yiota: has joined #ruby
[14:46:50] Gasher: all that hashception can get really confusing
[14:47:16] apeiros: it's often an anti-pattern to deeply nest basic collection classes (like hash or array)
[14:47:32] apeiros: instead of using proper classes
[14:47:55] Gasher: it's just 2 dimensional, I don't think it's that bad
[14:48:04] apeiros: that said, ruby recently added Hash#dig and Array#dig, which help with that kind of structure.
[14:48:23] shevy: dig up the zombies
[14:48:34] SilverKey: has joined #ruby
[14:48:51] apeiros: Gasher: depends - do you have to handle whether a subhash exists or not in more than 1 place?
[14:49:08] nankyokusei: has joined #ruby
[14:49:20] apeiros: then you might be fine
[14:50:11] Gasher: I'm building a package manager, and some things (like node for example) use more than one executable (node and npm)
[14:50:22] zyzioziom: has joined #ruby
[14:50:43] Gasher: that's kinda problematic and the 2-dimensional hash solved it
[14:50:45] chouhoulis: has joined #ruby
[14:52:18] Pupeno: has joined #ruby
[14:53:20] tildes: Gasher: why do you want to build your own?
[14:54:39] Dimik: has joined #ruby
[14:54:54] zyzioziom1: has joined #ruby
[14:55:58] pawnbox: has joined #ruby
[14:55:58] Bish: is there a short for .find( |x| x == 'something' )
[14:56:00] Gasher: tildes; I'm tired of outdated soft in ubuntu repo
[14:56:19] Gasher: too lazy to build/install everything myself
[14:56:22] Bish: or better: find( |x| x.something == 'something' )
[14:56:36] Bish: sorry, bad brackets, should be curled ofc
[14:56:40] Gasher: and things like arch are too unstable
[14:57:15] ChiefAlexander: has joined #ruby
[14:57:20] jokke: has joined #ruby
[14:57:33] tildes: Bish: do you run that method on an Enumerable, such as Array object?
[14:57:38] Bish: >> [{x:"yes"},{x:"can you make this shorter"}].find { |x| x.x == "yes" }
[14:57:39] ruby[bot]: Bish: # => undefined method `x' for {:x=>"yes"}:Hash (NoMethodError) ...check link for more (https://eval.in/582790)
[14:57:47] Bish: >> [{x:"yes"},{x:"can you make this shorter"}].find { |x| x[:x] == "yes" }
[14:57:48] ruby[bot]: Bish: # => {:x=>"yes"} (https://eval.in/582791)
[14:57:52] Bish: like this
[14:58:17] Bish: tildes: well both would be interesting i guess
[14:58:24] moredhel: has joined #ruby
[14:58:24] Bish: im writing these things way to lot
[14:58:33] kies: has joined #ruby
[14:58:40] Bish: would be helpful to have a generic proc literal for that
[14:58:46] moeabdol: has joined #ruby
[14:58:47] Bish: not lust &:method
[14:59:36] jhass: Gasher: http://www.toastball.net/toast/ http://linuxbrew.sh/
[15:00:23] Gasher: jhass; I know, I know
[15:00:35] Gasher: started working on mine before I've heard of them
[15:00:38] jhass: or just pacstrap :P
[15:00:54] Gasher: and I might create a distro, so it'll be more useful in the future
[15:01:57] jhass: or xdg-app or whatever it's called now
[15:02:07] moredhel: has joined #ruby
[15:02:12] Bish: write a ruby script which handles everything with package distribution over p2p
[15:02:20] Bish: that'd be gr8
[15:02:50] jhass: oh yeah, use a DHT for the package index and torrent to download the packages
[15:03:01] neanderslob: has joined #ruby
[15:03:02] kareeoleez: has joined #ruby
[15:03:04] neanderslob_: has joined #ruby
[15:03:04] jhass: you'll be on the news frontpages in no time
[15:03:22] jhass: distributed hash table?
[15:03:23] Bish: jhass: negatively or positely?
[15:03:30] jhass: Bish: who cares
[15:03:38] apeiros: all pr is good pr
[15:03:42] jhass: a blockchain works too of course
[15:03:42] Bish: like "how a newby programmer trojanified 100k linux users by implementing an insecure DHT"
[15:03:46] fedexo: has joined #ruby
[15:04:02] Bish: jhass: i even thought about that one to make it FULLY decentraliced
[15:04:22] Bish: you could make a cryptocurrency where proof of work is reading sourcecode
[15:04:23] neanderslob: has joined #ruby
[15:04:36] Bish: like, checking if this code is correct/not trojanified
[15:04:48] Bish: so you have both DHT package managing and a currency
[15:05:08] Bish: from now on if that idea ever gets implemented im the father in spirit of that idea @ irc-logs
[15:06:01] hutch34_: has joined #ruby
[15:06:41] suchness: has joined #ruby
[15:06:44] jhass: how do you prove you've verified it?
[15:06:58] van: has joined #ruby
[15:07:02] jhass: instead of just saying "yeah, totally spent 6 hours here, all legit
[15:07:03] Bish: multiple people do it. if most people say "this is code has a buffer overflow"
[15:07:08] suchness: Can anyone explain to me why my "variable" is not getting set here: http://pastie.org/private/jtvckqrcqoop3eg4ngqja ?
[15:07:17] jhass: Bish: so I just get a botnet that yells all good
[15:07:25] Bish: :D yeah that is a problem
[15:07:34] Bish: but reputation systems etcpp could make that better
[15:07:43] Bish: you could.. for example introduce new packagaes at 0 % reputation
[15:07:48] jhass: so... gpg?
[15:07:50] Bish: and people will get notified when installing
[15:07:56] Bish: i never used gpg i don't know
[15:08:08] Bish: atleast it's doable, i think
[15:08:11] Bish: not for me, ofc
[15:08:14] Bish: but a genius maybe
[15:08:17] suchness: Ok I am crossposting
[15:08:48] l1meon: has joined #ruby
[15:08:55] jhass: suchness: you do understand that attr_accessor creates a method, called variable= ?
[15:08:56] Bish: the fuck does block[]
[15:09:03] jhass: Bish: call it
[15:09:07] jhass: &ri Proc#[]
[15:09:07] `derpy: No results
[15:09:11] suchness: has left #ruby: ()
[15:09:12] suchness: has joined #ruby
[15:09:18] mattwashere: has joined #ruby
[15:09:28] suchness: Yes I realize that, which is why I would expect instance eval to set it
[15:09:30] jhass: Bish: anyway, it's an alias
[15:09:34] cd83x: has joined #ruby
[15:09:41] suchness: but variable is not set
[15:09:42] Bish: weird alias
[15:09:53] cemerick: has joined #ruby
[15:10:12] jhass: suchness: so, you also understand that variable assignment is not the same, that x.foo = bar and foo = bar are fundamentally different?
[15:10:21] jhass: *variable assignment and method calls
[15:10:33] karmatr0n: has joined #ruby
[15:10:43] suchness: Hold on let me get my head around what you are saying
[15:10:50] scepticulous: has joined #ruby
[15:10:54] Bish: make it an instance variable and it should work, amiright?
[15:11:02] pawnbox: has joined #ruby
[15:11:06] jhass: suchness: x.foo = bar is just syntax sugar for x.foo=(bar)
[15:11:15] Devalo: has joined #ruby
[15:11:17] minimalism: has joined #ruby
[15:11:19] suchness: So I suppose then the real question is
[15:11:24] jhass: so, that also means variable assignment has to win over method calls
[15:11:26] CJKinni`: has joined #ruby
[15:11:33] jhass: self.variable = "something"
[15:11:34] suchness: Is there any way to make it so I do not need to call self.variable=
[15:11:45] jhass: a common pattern is to leave out the =
[15:11:49] jhass: variable "foo"
[15:11:50] apeiros: @variable =
[15:11:54] apeiros: unless you want to go through the accessor
[15:12:12] jhass: the other pattern is to yield self do |x| x.variable = "foo"
[15:12:15] l1meon: hello, I have a question, how can I know the proxy anonymity level, using net/http ? I'm making a proxy checker, and I dont know how can I find the anonymity level. Can somebody help me?
[15:12:18] apeiros: right, or what jhass describes, create a "DSL setter"
[15:12:25] suchness: jhass: And what, define a method variable(value) that sets it?
[15:12:41] suchness: jhass: I like that, I think that's a clean solution
[15:12:49] suchness: Excellent, thanks!
[15:13:04] jhass: l1meon: I don't think there's any such thing as a well defined "proxy anonymity level"
[15:13:11] apeiros: suchness: usually you'll define it as `def variable(*value); if value.size == 1; @value = value.first; end; @value; end`
[15:13:18] jhass: not even getting into why (free) proxies are more harm than good even
[15:13:26] apeiros: otherwise reading won't be possible, or setting it to nil won't be possible
[15:13:46] suchness: apeiros: That's a good tip, I can see how that would be useful, thanks!
[15:14:01] apeiros: suchness: up to you what you do with value.size > 1, tho :)
[15:15:01] Pupeno: has joined #ruby
[15:15:18] suchness: apeiros: Oh don't worry, I will make it magical
[15:15:33] aries_liuxueyang: has joined #ruby
[15:16:21] mattwashere: has joined #ruby
[15:16:29] l1meon: jhass: well I know, but I've read about that proxies sends or not some headers which determines the anonymity, not literally but in sense that the server know's your real Ip and dont know, and I dont know how to get theese headers throug net/http, I've tried return all headers but the only I get to check for proxy is the "Via", others like 'X-forwarded-for' doesnt show up
[15:16:51] crystal77: has joined #ruby
[15:17:14] jhass: l1meon: they send it to the remote server, not the client
[15:18:06] Gasher: <Bish> write a ruby script which handles everything with package distribution over p2p
[15:18:10] pawnbox: has joined #ruby
[15:18:15] Gasher: thanks for the great idea :)
[15:18:19] l1meon: jhass: so is there a way to get them? if so, how can I do it?
[15:18:45] jhass: l1meon: I suggest you read up on how HTTP in general and HTTP proxies in detail work, worth your time
[15:19:33] jhass: l1meon: pull out netcat and successfully write a HTTP request by hand and get a response, then one through a proxy
[15:20:14] sid_fules: has joined #ruby
[15:21:10] l1meon: jhass: is ok if use this? https://github.com/Hood3dRob1n/RubyCat
[15:21:10] GodFather: has joined #ruby
[15:22:26] jhass: I don't a real reason to but sure
[15:22:40] wrkrcoop: has joined #ruby
[15:23:02] jhass: *don't see
[15:23:04] troulouliou_div2: has joined #ruby
[15:24:22] ksmutthu: has joined #ruby
[15:24:28] l1meon: jhass: ok, I'll try, thanks
[15:26:42] jaguarmagenta: has joined #ruby
[15:27:17] craigp: has joined #ruby
[15:34:15] domgetter: has joined #ruby
[15:35:13] theozaurus: has joined #ruby
[15:35:20] dgynn: has joined #ruby
[15:35:48] palms: has joined #ruby
[15:35:53] Yiota: has joined #ruby
[15:36:40] hutch34: has joined #ruby
[15:36:41] edwinvdgraaf: has joined #ruby
[15:38:10] webnanners: has joined #ruby
[15:38:26] maletor3: has joined #ruby
[15:38:37] goeast: has joined #ruby
[15:38:41] cd83x: has joined #ruby
[15:40:12] edwinvdg_: has joined #ruby
[15:41:34] Mia: has joined #ruby
[15:41:35] Mia: has joined #ruby
[15:41:43] bkxd: has joined #ruby
[15:42:03] David_H_Smith: has joined #ruby
[15:42:46] johnzorn`: has joined #ruby
[15:42:46] David_H_Smith: has joined #ruby
[15:47:04] Infra-Red: has joined #ruby
[15:48:18] ironcamel: why does my $LOAD_PATH not include my gem path (the path where gems are installed). is that expected?
[15:49:16] bougyman_: has joined #ruby
[15:50:04] ironcamel: this is making it so ruby can't see gems i installed
[15:50:15] jhass: ironcamel: yes, rubygems hooks require and adds the gem's load_paths to it
[15:50:38] jhass: no, that's not the right cause for that symptom
[15:50:46] jhass: using bundler perhaps?
[15:51:18] ironcamel: jhass: https://gist.github.com/ironcamel/ae3c3abb68d5434bf6e8a13eb3cb34f7
[15:51:21] babblebre: has joined #ruby
[15:51:42] ironcamel: jhass: when i use bundler it works. i can bundle install; bundle exec foo.rb;
[15:51:48] norc: has joined #ruby
[15:51:53] jhass: yes, doesn't invalidate what I said so far
[15:52:04] Pupeno: has joined #ruby
[15:52:08] jhass: so what doesn't work? real context and no fake values please
[15:52:14] ironcamel: but i don't want to jump through that hoop
[15:52:15] Xentil: has joined #ruby
[15:52:25] [Butch]: has joined #ruby
[15:52:51] ironcamel: irb(main):001:0> require 'json'
[15:52:51] ironcamel: LoadError: no such file to load -- json
[15:53:05] ironcamel: i have gem installed it, and it is in my gem path
[15:53:16] ironcamel: but why isn't my gem path in my load path?
[15:53:26] jhass: you're using 1.8
[15:53:30] ironcamel: is that why?
[15:53:32] jhass: you have to start with require "rubygems"
[15:53:41] ironcamel: interesting ...
[15:53:44] RobertBirnie: has joined #ruby
[15:53:44] jhass: or just use a supported Ruby version
[15:53:56] domgetter: ironcamel: that's a very old version of Ruby
[15:53:56] ironcamel: that fixed it, thanks jhass
[15:54:05] dionysus69: has joined #ruby
[15:54:06] ironcamel: i was googling everything trying to figure this out
[15:54:16] jhass: yes, we moved past that issue 6 years ago
[15:54:23] ironcamel: domgetter: i know. but i am stuck with centos 6. this is for work.
[15:55:37] fowl: has joined #ruby
[15:56:07] goeast: has joined #ruby
[15:56:11] domgetter: You can't petition for an upgrade? You could point out that Ruby 1.8 is EOL, Ruby 1.9 is EOL, and that 2.0 will be EOL soon, and that you need Ruby 2.1+, but be prepared for them saying that other itnernal products depend on that version of Ruby
[15:57:17] ironcamel: i tried that domgetter. the response i got was that supposedly redhat/centos backports security fixes for all the software in their repos
[15:57:39] ironcamel: that's basically what you are paying for when you pay redhat
[15:58:15] ironcamel: seems like that would require hordes of developers to support all that old software
[15:58:18] jhass: yes, you pay for pain ;)
[15:58:27] skolman__: has joined #ruby
[15:59:19] mattwashere: has joined #ruby
[15:59:28] glcx: has joined #ruby
[15:59:28] glcx: has joined #ruby
[16:00:22] domgetter: ironcamel I don't know much about RedHat, but aren't there packages you can use or something? This list has more modern versions of Ruby available: https://access.redhat.com/products/Red_Hat_Enterprise_Linux/Developer/#dev-page=5
[16:01:30] roamingdog: has joined #ruby
[16:01:40] ironcamel: i'm stuck with what centos 6 provides out of the box, which is ruby 1.8.7 :(
[16:02:02] ironcamel: for this particular project
[16:02:22] whathappens: has joined #ruby
[16:02:35] aegis3121: has joined #ruby
[16:02:51] tAn: has joined #ruby
[16:03:36] Xentil2: has joined #ruby
[16:03:48] shevy: you poor man
[16:04:04] ironcamel: it's not so bad. i get to use 2.3 for most everything else.
[16:04:05] shevy: if there is one distribution that is slower than debian stable, it must be centos
[16:04:23] bougyman: what do you mean by slow?
[16:04:28] mleung: has joined #ruby
[16:04:30] domgetter: shevy I dunno, I think Herd is the slowest. HEYOOOO
[16:04:38] shevy: debian usually lags behind releases
[16:05:51] amclain: has joined #ruby
[16:06:12] bougyman: oh, slow to update software?
[16:06:25] shevy: to change to more recent software, yeah
[16:06:32] Xentil: has joined #ruby
[16:06:43] shevy: I think the current ruby in debian stable is 2.1.x something
[16:09:43] maletor3: has joined #ruby
[16:10:02] crst: has joined #ruby
[16:10:26] mattwashere: has joined #ruby
[16:10:31] goeast_: has joined #ruby
[16:10:40] shevy: ironcamel my dream system would be to have multiple versions of everything running side by side, on a 10TB hdd, for the last 30 years!
[16:10:49] Cohedrin: has joined #ruby
[16:10:50] shevy: then I could use ruby 1.0 too
[16:11:20] crst: Hi, how can I convert a string into a unix server friendly string?
[16:12:06] gtsai: has joined #ruby
[16:12:09] ironcamel: my dream system would have the latest bleeding version of everything. that's why i run arch linux at home.
[16:12:22] domgetter: crst: What do you mean by "unix server friendly"?
[16:13:47] crst: domgetter: i.e. - instead of whitespaces, removal of strange characters like à ä ñ
[16:13:59] kies: has joined #ruby
[16:14:26] crst: like good a filename
[16:14:33] crst: on a unix server
[16:15:53] PlasmaStar: has joined #ruby
[16:16:06] jancel: has joined #ruby
[16:16:27] Xentil2: has joined #ruby
[16:16:35] smathy: gsub /\W/, '_'
[16:17:00] domgetter: >> " - instead of whitespaces, removal of strange characters like à ä ñ".gsub(/ /, "-").gsub(/[^a-zA-Z0-9,-]/, '')
[16:17:01] ruby[bot]: domgetter: # => "---instead-of-whitespaces,-removal-of-strange-characters-like---" (https://eval.in/582834)
[16:17:33] domgetter: Of course, you'd want to specify all the characters you want to keep around
[16:18:14] duoi: has joined #ruby
[16:18:14] duoi: has joined #ruby
[16:19:54] alfiemax: has joined #ruby
[16:20:43] alfiemax: is it possible to stream a large file instead of loading the entire thing into memory?
[16:21:39] crst: domgetter: thank you that's very nice! I just broke the function with a `/` . Is there no ruby module? It should really include any possible bad character.
[16:22:20] Xentil: has joined #ruby
[16:23:25] Bish: norc: when will ruby get rid of GIL
[16:23:32] Bish: and have native threads :3
[16:23:40] domgetter: crst: "I just broke the function with a `/`" I don't know what you mean by this. "any possible bad character" Ruby doesn't know every possible bad character for every possible situation, since any character can be made to be bad
[16:23:50] norc: Bish, native threads we have had since 1.9
[16:23:59] norc: Bish, and the GIL really has no meaningful impact that you will know about.
[16:24:03] domgetter: Bish: Rubinius and JRuby have no GIL
[16:24:35] Bish: domgetter: rubinius isn't faster, and i hate everything java.. even if its just the vm
[16:24:35] norc: Bish, all the GIL really does is protect the inner workings of Ruby so it wont crash, you can do multithreading just fine with it.
[16:24:38] Bish: and c extensions
[16:24:58] Bish: norc: MRI multithreading doesn't feel native :/
[16:25:12] domgetter: Bish I didn't say Rubinius was faster :)
[16:25:15] Bish: like when i spawn 128 threads to do something my cores aren't equally ded
[16:25:31] norc: Bish, it depends on what you are doing.
[16:25:36] Bish: domgetter: yeah but where is the benefit from using rubinius, i love rubinius but it doesn't work for me
[16:25:37] norc: Bish, are you I/O bound?
[16:25:49] Bish: like sockets.
[16:25:51] norc: Bish, that is why.
[16:26:02] Bish: I/O fucks up my threads?
[16:26:13] Bish: fucks up => blocks ?
[16:26:30] domgetter: Bish: No, I/O just doesn't use the computation resources of your computer to their fullest extent
[16:26:43] domgetter: since the threads are waiting around for more information from the network or drive
[16:26:44] norc: No, but if you have 128 I/O bound threads, what kind of conclusion about your CPU does that allow for? ...
[16:27:03] Bish: *tests with calculations*
[16:27:13] Bish: gimme a good example what i can calculate
[16:27:23] domgetter: Bish: If you're on MRI, you won't peg your cores
[16:27:40] Bish: yeah and why is that?
[16:27:45] domgetter: Because Ruby has a GIL
[16:28:09] domgetter: more specifically, because MRI has a GIL
[16:28:11] crst: domgetter: I just put a / in the string and the function broke. I know there's a lot of possibilities for bad characters, that's why I was looking for a module, i.e. to change filenames for unix servers that they're not causing any problem.
[16:28:32] Bish: domgetter: well norc says otheriwse
[16:28:46] snowy: has joined #ruby
[16:28:46] norc: domgetter, that is nonsense.
[16:29:09] norc: domgetter, the GIL just protects some inner workings of Ruby to prevent actual crashes (not just race conditions).
[16:29:35] norc: domgetter, as a result *some* methods are actually atomic, but those are corner cases.
[16:30:12] chippy: has joined #ruby
[16:31:10] PlasmaStar: has joined #ruby
[16:31:20] Xentil2: has joined #ruby
[16:31:53] certainty: has joined #ruby
[16:32:26] JesseH: has joined #ruby
[16:32:27] crst: domgetter: I'm sorry a " was causing it to break not a /
[16:32:32] domgetter: norc: I'm going to have to disagree with you. I have a 4 core machine, and just ran 4.times { threads << Thread.new { loop { 1+1 } } }; threads.first.join and it only used 25% of my processor
[16:33:16] k3rn31: has joined #ruby
[16:34:03] mtkd: has joined #ruby
[16:34:24] norc: domgetter, great. You discovered that all the high performance multi threaded Ruby applications obviously do not bring any performance benefit at all. Go tell the developers of Thin, Typhoeus, Puma and the thousands of other projects.
[16:34:26] norc: They must have missed it.
[16:35:07] domgetter: norc: what are you talking about? They fork the process. I was talking about why threading won't peg cpus
[16:35:34] norc: They dont. The three examples I mentioned are threading based.
[16:36:27] nanoz: has joined #ruby
[16:36:27] solocshaw1: has joined #ruby
[16:36:49] wrkrcoop: has left #ruby: ()
[16:37:18] domgetter: norc: https://github.com/typhoeus/typhoeus/blob/d9e6dce92a04754a2276c94393dad0f3a5c06bdd/spec/support/localhost_server.rb#L60
[16:37:21] deadnull_: has joined #ruby
[16:37:30] harai54: has joined #ruby
[16:37:41] norc: domgetter, https://github.com/typhoeus/typhoeus/blob/d9e6dce92a04754a2276c94393dad0f3a5c06bdd/spec/support/localhost_server.rb#L75
[16:37:54] shevy: ack I saw an at_exit there
[16:37:55] norc: domgetter, also
[16:38:13] norc: domgetter, why are you picking a SERVER from a SPEC as proof that Typhoeus is process based?
[16:39:00] tjohnson: has joined #ruby
[16:39:05] norc: perhaps typhoeus is actually process based idk.
[16:39:09] norc: but threading works.
[16:39:17] domgetter: norc: I have provided proof that Threads cannot peg a multi-core cpu on multiple modern versions of Ruby. Do you have a code snippit that proves otherwise?
[16:39:51] sid_fules: has joined #ruby
[16:39:52] kies: has joined #ruby
[16:40:37] kgrz: has joined #ruby
[16:40:56] domgetter: I'm also open to my methodology being shown insufficient. Perhaps I didn't use Thread correctly, or I didn't set an environment variable or configuration setting somewhere
[16:41:45] norc: domgetter, sorry have had a bad day.
[16:41:51] norc: domgetter, it is a valid question.
[16:43:02] Bish: peace and happiness all over the world!
[16:43:27] sepp2k: has joined #ruby
[16:43:34] shevy: welcome to #php!
[16:43:42] norc: asm>> 1+1
[16:43:43] Bish: is php nice and friendly?
[16:43:44] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/582854
[16:44:07] shevy: Bish I don't remember... I never stayed for too long on #php ... I think the online docs are good though
[16:44:47] domgetter: I always liked how the php docs had lots of examples
[16:44:56] norc: domgetter, I think this is actually a corner case where you hit the GIL.
[16:45:11] norc: domgetter, the reason is quite simple though, you don't do much, and the overhead of simply running that loop is protected by the GIL.
[16:45:22] Bish: those are big corners :D
[16:45:38] domgetter: norc: ah, okay. So is there something else I can run in those threads that won't "hit the GIL"?
[16:45:49] norc: domgetter, yeah let me just come up with something sensible.
[16:46:05] domgetter: fair enough
[16:46:46] Bish: but if i+=1 hits the gil, nearly everything hits the gil
[16:47:36] domgetter: Bish: not necessarily. Math operations are dealt with slightly differently than other method calls for efficiency, if I remember correctly. So it's possible they interact with the GIL differntly as well
[16:48:33] zyzioziom: has joined #ruby
[16:49:40] duoi: has joined #ruby
[16:50:04] nankyokusei: has joined #ruby
[16:50:40] norc: domgetter, 10.times { threads << Thread.new { 100_000.times { File.open("/dev/zero").read(10_000) } } }
[16:50:50] norc: domgetter, it is a contrived example, but it works.
[16:51:03] djbkd: has joined #ruby
[16:52:36] norc: domgetter, so yeah, if you are CPU bound and use a lot of ruby core functionality then the GIL will hurt you.
[16:53:04] domgetter: norc: I just ran that, and it only pegged one core again. Did I do something wrong?
[16:53:06] nando293921: has joined #ruby
[16:53:09] Bish: so GIL is a bad thing.
[16:54:06] norc: Bish, yes but not as much as people make it out to be.
[16:54:41] agit0: has joined #ruby
[16:54:50] norc: domgetter, on my system that hits both CPUs at about 50%. Which ruby are you using, and which operating system are you on?
[16:55:13] domgetter: norc: so even on your system it's not pegging the cpu's?
[16:55:32] norc: domgetter, as it shouldn't because it is I/O bound.
[16:56:12] norc: domgetter, but you can use the data and do calculations with it.
[16:56:15] neanderslob: has joined #ruby
[16:56:35] neanderslob_: has joined #ruby
[16:56:35] toretore: ruby code is not going to "peg all cpus" no matter the code in question
[16:56:36] domgetter: norc: My claim is that because of the GIL, it is impossible to use MRI/YARV and ruby Threads to use all cores as much as possible on a machine
[16:57:33] norc: domgetter, here is some reality for you. When your system runs between 1,000 and 20,000 threads concurrently at any given second, any trivial code without a carefully prepared environment wont prove much.
[16:57:54] neanderslob: has joined #ruby
[16:57:55] Pupeno: has joined #ruby
[16:58:00] domgetter: norc: I think we're talking past each other.
[16:58:25] fowl: has joined #ruby
[16:58:39] domgetter: There is no test you can provide in which Ruby will peg all the cpus using only one ruby process and Threads
[16:58:40] norc: domgetter, what is your operating system, which ruby and ruby version are you using?
[16:58:50] domgetter: (unless you only have one core)
[16:59:25] bougyman: domgetter: you mean MRI, right?
[16:59:30] domgetter: bougyman: yes
[16:59:33] bougyman: cause that can be done with jruby and rubinius.
[16:59:56] bougyman: oic, you prefaced it with MRI/YARV
[17:00:01] freerobby: has joined #ruby
[17:00:32] domgetter: I'm on Win7 with Ruby 2.2.3 and 4 cores, and a VPS with Centos7, Ruby 2.3.1 and 2 cores. On neither machine am I able to utilize 100% of all cores at once using a single Ruby process and Ruby Threads
[17:02:45] firstdayonthejob: has joined #ruby
[17:03:19] norc: domgetter, I think MRI has no native thread support on windows.
[17:03:39] hahuang65: has joined #ruby
[17:04:27] domgetter: norc: and I'm claiming that that's irrelevant to what I'm saying. YARV's GIL is the culprit here. That's why the test failed on my CentOS box.
[17:04:37] norc: domgetter, well my test is succeeding,
[17:04:46] cwenner: has joined #ruby
[17:04:47] domgetter: no, by your own words, the test failed
[17:04:56] jackjackdripper: has joined #ruby
[17:05:00] domgetter: You said that you were only using 50% of your 2-core machine's cpu usage
[17:07:03] norc: domgetter, https://gist.github.com/norc/e1cc53bfef7e399013b5f5e86278022c
[17:07:08] norc: did a bit of adjusting, but basically the same snippet.
[17:07:11] codecop: has joined #ruby
[17:07:18] norc: 10.times { threads << Thread.new { 1_000_000.times { a = File.open("/dev/zero"); a.read(10_0000); a.close } } }
[17:07:21] norc: That will peg your CPUs.
[17:08:24] sid_fules: has joined #ruby
[17:08:42] Pupeno: has joined #ruby
[17:09:01] Bish: doesn't for me
[17:09:05] Bish: about 2,3 cores
[17:09:19] Bish: of 4 (or 8 with hyperthreading)
[17:09:33] JJM: has joined #ruby
[17:10:49] sid_fules: has joined #ruby
[17:11:19] Bish: with rubinius it's easily making all go red
[17:11:27] Bish: while being 1/100 as fast as mri :D
[17:12:00] c0mrad3: has joined #ruby
[17:12:43] Bish: the world of beautfil code really lacks of a good multiprocessor thing
[17:12:50] nando293921: has joined #ruby
[17:12:56] Bish: ACTION hopes for crystal even though thats not interpreted
[17:14:08] Bish: or mri, which would be gr8
[17:14:48] domgetter: norc: that did cause my laptop (Linux Mint w/ 2.3.1 and 4 cores) to use 60-70% of my total cpu, so that does prove my claim wrong.
[17:15:16] domgetter: is it because of the amount of resulting system calls that the kernel can make outside of ruby?
[17:15:39] cpup: has joined #ruby
[17:15:40] sid_fules: has joined #ruby
[17:16:05] norc: domgetter, the GIL just protects bits and pieces from Ruby internals. So if your code spends most of its time outside (say waiting for I/O or in another C extension) it wont notice the GIL.
[17:16:53] Bish: but adding 2 integers is as basic as it gets
[17:17:32] domgetter: Bish: calling the "+" method on a Ruby object isn't the same as writing 1 + 1 in C
[17:17:38] norc: Bish, you are repeatedly calling a block.
[17:17:45] beilabs: has joined #ruby
[17:17:50] norc: Bish, and *that* is far more expensive than the 1+1
[17:17:56] norc: And a lot of that is protected by the GIL.
[17:18:21] Bish: domgetter: i get that, it still should do it as fast as its can
[17:18:38] Bish: not as fast ruby can, but as fast as the cpu can
[17:18:39] norc: asm>> 1+1
[17:18:40] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/582885
[17:18:41] Bish: and that doesn't happen
[17:19:01] norc: Bish, https://github.com/ruby/ruby/blob/trunk/insns.def#L1374-L1425
[17:19:07] norc: there, that is what a simple + costs you in Ruby.
[17:19:11] nando293921: has joined #ruby
[17:19:17] Bish: i get all that.
[17:19:33] Bish: but still, my pc should do it, with all it has
[17:19:46] toretore: Bish: it doesn't work because of the gil, it's that simple
[17:19:50] Bish: not being able to peg the cpu with stupid shit is stupid
[17:19:55] Coldblackice: has joined #ruby
[17:20:03] norc: Bish, you can peg it with stupid shit.
[17:20:05] toretore: ruby code -> lock the gil -> 1 cpu
[17:20:08] ZeroeSparticus: has joined #ruby
[17:20:14] dhk: has joined #ruby
[17:20:14] Bish: norc: show me code that does
[17:20:22] norc: Bish, my example from above.
[17:20:26] norc: Bish, or do some heavy math.
[17:20:30] Bish: well doesn't work dude.
[17:20:37] norc: Bish, what operating system?
[17:20:39] norc: What ruby version?
[17:20:46] Bish: ruby 2.3.1p112
[17:20:58] Bish: Linux bank 4.1.15-gentoo-r1 #3 SMP
[17:20:59] domgetter: Bish: it worked in the sense that it used more than one core of your machine
[17:21:03] sid_fules: has joined #ruby
[17:21:07] Bish: yeah that is right
[17:21:08] Yiota: has joined #ruby
[17:22:01] norc: Bish, the thing is a simple loop { 1+1 } will actually spend most of its time executing the block, and most of that is GIL protected.
[17:22:16] Bish: that all doesn't matter
[17:22:23] norc: Bish, so if you do heavy math for example then you wont be GIL constraint, unless you make great use of some ruby objects like Arrays
[17:23:03] wilsonc91: has joined #ruby
[17:23:10] Bish: well, if i was about to build a interpreter
[17:23:11] chrisseaton: norc: that's not right - the gil isn't released while MRI is interpreting math operations
[17:23:19] Bish: i would soooo avoid having a gil
[17:23:25] Bish: no matter what it costs
[17:23:46] norc: chrisseaton, oh?
[17:23:50] domgetter: norc: I still contend that the reason your example uses more than one core is because of the system calls which the kernel does outside of the Ruby process
[17:24:01] domgetter: But I coule be wrong
[17:24:24] Bish: like what syscall? read?
[17:24:31] norc: domgetter, so? If a mutual exclusion lock was held, then another thread couldn't do the same.
[17:24:57] Bish: gil sucks eod :D
[17:25:10] toretore: norc: the kernel is not restricted by mri's gil
[17:25:27] norc: toretore, except while the syscall is being executed your thread that called is not.
[17:26:03] Bugboy1028: has joined #ruby
[17:26:06] wtiger: has joined #ruby
[17:26:14] norc: toretore, and if your thread held a lock before the syscall was made, it still does even if the kernel gets preempted for another thread.
[17:26:24] Bish: how can ruby devs be happy with that
[17:26:27] Bish: or python or whatever
[17:26:31] Bish: is pypy actually good?
[17:26:35] wtiger: I'm a newbie ruby/rails developer, should I use a ruby version manager?
[17:26:46] Bish: wtiger: pretty much opinion based
[17:26:47] toretore: wtiger: yes, use chruby/ruby-install
[17:26:48] sid_fules: has joined #ruby
[17:26:57] wtiger: toretore: why?
[17:26:58] domgetter: wtiger: I do. I like rvm. Others like rbenv or chruby
[17:26:59] Bish: imho not.
[17:27:07] norc: wtiger, most operating systems dont ship modern versions of ruby
[17:27:13] toretore: wtiger: just do as i say, and you will be less frustrated
[17:27:14] norc: wtiger, that is reason enough for ruby-install at least.
[17:27:23] Bish: toretore: i was frustrated.
[17:27:33] toretore: norc: i'm not sure what you're getting at here..
[17:27:38] mattwashere: has joined #ruby
[17:27:44] toretore: norc: re: kernel and gil
[17:27:51] domgetter: wtiger it relieves a lot of headache involved with installing Ruby, and it provides safe ways to hop between different versions of gems as well
[17:28:17] Bish: opinions opinions.
[17:28:29] norc: toretore, say thread A acquires the gil through whatever mechanism and then makes a syscall - if thread b then tries to acquire the gil it will block..
[17:28:32] toretore: norc: especially that something might be preempting the linux kernel :P
[17:28:56] jancel: has joined #ruby
[17:28:57] norc: toretore, nested interrupts are possible and they happen.
[17:29:01] toretore: norc: ok, and?
[17:29:05] norc: toretore, you have NMIs too.
[17:29:12] norc: there is so many things that constantly interrupt even the kernel.
[17:29:35] toretore: but that's not very relevant in this discussion about the gil afaict
[17:30:20] norc: toretore, you just said the kernel is not restricted by mri's gil. But the code calling the kernel is.
[17:30:55] toretore: norc: i'm still not sure what the point you're trying to get at is
[17:31:20] domgetter: nroc: aren't there times where a thread just made a syscall, and then a different thread gets loaded, but the original syscall can continue on?
[17:31:40] norc: domgetter, sure. The kernel can get preempted just like anything else.
[17:31:49] norc: domgetter, which is whats happening.
[17:31:53] toretore: norc: i think the point about your code that distributed cpu time across cores was that said cpu time was spent in the kernel and not in mri
[17:31:59] deadnull_: has joined #ruby
[17:32:15] norc: toretore, sure.
[17:32:22] toretore: so, as you said, contrived
[17:32:38] certainty: has joined #ruby
[17:32:42] norc: toretore, waiting on I/O is not contrived when you are looking at sockets.
[17:33:01] chrisseaton: norc: but MRI releases the gil while making syscalls!
[17:33:08] toretore: and the fact remains that ruby code run with one mri process will not run on multiple cpus simultaneously
[17:33:19] wtiger: norc: ruby-install?
[17:33:20] toretore: which was the point being made in the first place
[17:33:22] postmodern: has joined #ruby
[17:33:36] mikeliss: has joined #ruby
[17:33:49] toretore: norc: that i/o concurrency works well in mri is another matter
[17:33:54] Bish: wtiger: if you're using ubuntu have 2 choices, take a version manager like rvm or use a ppa(im prefering that)
[17:34:13] bougyman: those aren't the only two choices.
[17:34:13] wtiger: Bish: i'm on manjaro
[17:34:15] Bish: or you stick to a good operating system / good distro
[17:34:21] toretore: norc: and you can "trick" it into clocking some cpu time by using lots of i/o
[17:34:21] Bish: bougyman: tell me the third
[17:34:26] wtiger: why would I need different versions of ruby?
[17:34:37] Yiota: has joined #ruby
[17:34:40] Bish: wtiger: you want the new version, ubuntu doesn't ship new
[17:34:56] bougyman: Bish: /opt/ruby-<version>/
[17:35:00] wtiger: Bish: hmm
[17:35:08] wtiger: manjaro does though :)
[17:35:11] Bish: bougyman: ? whats that supposed to mean
[17:35:21] Bish: wtiger: well thats great then!
[17:35:22] mikeliss: I have a feeling this is ruby-related and I'm not a Ruby programmer, so perhaps somebody can help. I just installed the Travis CI command line tool using the instructions they provided (sudo gem install travis -v 1.8.2 --no-rdoc --no-ri), but after that I can't find the travis executible on my path. I get this error: bash: /usr/bin/travis: No such file or directory. Feels like maybe my ruby or gem configuration is wrong or some
[17:35:23] mikeliss: thing. Any ideas?
[17:35:28] Bish: just use the one of your system
[17:37:45] domgetter: wtiger: but the answer to your question "should I use a ruby version manager" is definitely yes, regardless of which one you choose
[17:37:45] wtiger: another problem
[17:38:02] shevy: wtiger how many ruby versions will you need?
[17:38:04] chouhoulis: has joined #ruby
[17:38:20] hutch34: has joined #ruby
[17:38:27] wtiger: shevy: for now, think the latest gonna be enough
[17:39:17] TomyLobo: has joined #ruby
[17:40:02] norc: chrisseaton, okay.
[17:40:08] jhass: wtiger: you don't need a ruby version manager until you need another ruby version, latest until then is indeed fine. When you'll need it, since you're on a Arch derivative, I can recommend https://gist.github.com/jhass/8839655bb038e829fba1 ;)
[17:40:27] Spami: has joined #ruby
[17:41:33] wtiger: jhass: duly noted :P
[17:42:23] wtiger: another problem, i accedintally ran sudo gem install ____ one time, and now all my gems default install to /usr/lib/.. in place of .gem/ruby/2.3.0
[17:42:32] bkxd: has joined #ruby
[17:42:36] wtiger: if I don't use sudo, it complains about file permission error
[17:42:42] pepee: has joined #ruby
[17:45:03] SilverKey: has joined #ruby
[17:46:09] mattwash_: has joined #ruby
[17:47:00] moeabdol: has joined #ruby
[17:47:01] David27: has joined #ruby
[17:49:41] moei: has joined #ruby
[17:56:02] aegis3121: has joined #ruby
[17:57:04] chouhoulis: has joined #ruby
[17:57:40] flashpoint9: has joined #ruby
[17:57:44] AlexRussia: has joined #ruby
[17:57:59] crystal77: has joined #ruby
[17:58:38] Yiota: has joined #ruby
[18:00:06] wtiger: has left #ruby: ("WeeChat 1.5")
[18:01:19] crystal77: has joined #ruby
[18:02:08] palms: has joined #ruby
[18:03:22] floatingpoint: has joined #ruby
[18:03:35] gizmore: has joined #ruby
[18:03:43] nofacade: has joined #ruby
[18:06:23] Dimik: has joined #ruby
[18:09:42] ChiefAlexander: has joined #ruby
[18:12:13] smathy: I still prefer using a version manager because I then have more flexibility when doing an upgrade.
[18:14:13] Devalo: has joined #ruby
[18:17:00] kirun: has joined #ruby
[18:19:08] dhk: has joined #ruby
[18:19:29] Pupeno: has joined #ruby
[18:20:22] moeabdol: has joined #ruby
[18:21:29] jancel: has joined #ruby
[18:23:02] joonty: has joined #ruby
[18:23:43] cdg: has joined #ruby
[18:23:52] yfeldblum: has joined #ruby
[18:27:39] l1meon: has joined #ruby
[18:28:56] MrBusiness3: has joined #ruby
[18:29:10] hutch34_: has joined #ruby
[18:29:45] Yiota: has joined #ruby
[18:31:26] Pupeno: has joined #ruby
[18:31:41] thermistor: has joined #ruby
[18:33:16] SCHAAP137: has joined #ruby
[18:33:22] certainty: has joined #ruby
[18:33:47] miqlas-H: has joined #ruby
[18:34:49] zyzioziom: has joined #ruby
[18:34:57] miqlas-H: I have some problems to get Ruby compiled on Haiku. Have somebody time to help me?
[18:34:57] multi_io: has joined #ruby
[18:36:39] bruce_lee: \(^_^)/ @all
[18:36:44] sid_fules: has joined #ruby
[18:37:23] bruce_lee: how can I check if file_1 is "newer" than file_1
[18:37:52] bruce_lee: something like comparing latest modification_time
[18:38:07] strncat: has joined #ruby
[18:38:17] strncat: has left #ruby: ()
[18:38:19] nanoz: has joined #ruby
[18:38:24] vdamewood: has joined #ruby
[18:38:37] terrabl: has joined #ruby
[18:38:49] terrabl: Hey guys I am having some trouble implementing CSS and JS on my html.erb files in Rails. The gist included (https://gist.github.com/anonymous/6b4262524ad96ccd48dd) has all of the files that I believe would be necessary for you to understand the problem. In application.html I changed the original stylesheet and javascript link tags to be 'default' instead of 'application' because that is what I read to do on a SO question. If you have
[18:38:50] durrellchamorro: has joined #ruby
[18:38:51] terrabl: I attempted to read up on the asset pipeline and I think I understand but I am always getting a 404 error when I try to load up default.js and default.css
[18:39:22] Zarthus: ?rubyonrails
[18:39:25] Zarthus: !rubyonrails
[18:39:30] Zarthus: ¯\_(ツ)_/¯
[18:39:37] Zarthus: There's a #rubyonrails channel
[18:39:41] Zarthus: you might wanna knock there
[18:39:50] blockchan: has joined #ruby
[18:40:01] terrabl: Lol I just got redirected here from anotehr channel
[18:40:10] terrabl: How would I get there?
[18:40:13] Zarthus: your problem sounds rails related
[18:40:17] Zarthus: /join #rubyonrails
[18:40:23] durrellchamorro: has left #ruby: ()
[18:40:27] terrabl: it for sure is
[18:40:29] terrabl: thanks guys
[18:41:55] Yiota: has joined #ruby
[18:43:23] binaryplease1: has joined #ruby
[18:43:27] thejamespinto: has joined #ruby
[18:43:53] tvw: has joined #ruby
[18:43:56] durrellchamorro: has joined #ruby
[18:44:17] bruce_lee: the following perl would check the modification-dates and be true if $pendingFile is "newer" than $drawingDataFile: if (-M $pendingFile < -M $drawingDataFile) {
[18:44:27] bruce_lee: what is the equivalent in ruby?
[18:44:29] domgetter: bruce_lee: File#stat
[18:44:55] ur5us: has joined #ruby
[18:46:10] howdoi: has joined #ruby
[18:48:13] bruce_lee: domgetter: thank you
[18:48:31] nando293921: has joined #ruby
[18:50:53] nankyokusei: has joined #ruby
[18:51:46] dunpeal: has joined #ruby
[18:51:49] SilverKey: has joined #ruby
[18:53:35] benzrf: has left #ruby: ("WeeChat 1.5")
[18:53:44] dunpeal: How do people make sure RVM always uses a particular version?
[18:54:09] dunpeal: i.e. in a project managed by RVM, how do I ensure `ruby` calls the right Ruby interpreter I'd like to use?
[18:54:31] d0nn1e: has joined #ruby
[18:55:12] domgetter: dunpeal: a call to `ruby` will be whichever one is set to be the one used by rvm at that time. do `rvm list` to see which one is current, and which one is default
[18:56:32] dunpeal: domgetter: right, but here's the thing: `rvm list` shows two versions, 2.2.3 and 2.3.1, and whenever I start a new bash, 2.2.3 is current, even though 2.3.1 is the default.
[18:56:45] dunpeal: how can I make it so 2.3.1 is always current?
[18:57:01] nando293921: has joined #ruby
[18:57:05] jancel: has joined #ruby
[18:58:20] domgetter: dunpeal: This StackOverflow answer says it's possible you're loading rvm twice, so you can check for that: http://stackoverflow.com/a/5605028
[18:59:14] domgetter: Try the other answers in there too, perhaps
[19:00:01] maloik: has joined #ruby
[19:00:02] Yiota: has joined #ruby
[19:00:04] dunpeal: domgetter: hm. I'm loading rvm in .bashrc, on a multi-window setup
[19:00:14] dunpeal: (using GNU screen)
[19:00:48] domgetter: dunpeal did you put in that echo to see if it's being loaded twice?
[19:01:18] N1njturt1e: has joined #ruby
[19:01:28] dunpeal: domgetter: I'm loading it in a function. The first time I run `rvm`, it loads the script.
[19:02:56] domgetter: dunpeal If it were me, I'd try the echo thing as a sanity check
[19:03:09] dunpeal: domgetter: it's only loaded once, though in an unusual way.
[19:03:23] braincrash: has joined #ruby
[19:03:45] domgetter: right, and if that's true, then the echo would only appear once. but I don't know if it only appears once, because you didn't try it yet
[19:04:06] Zackio: has joined #ruby
[19:04:13] boboc: has joined #ruby
[19:04:45] dunpeal: domgetter: I did :) it's not.
[19:05:14] domgetter: oh okay. hmm... you said you're using screen. what shell?
[19:06:08] domgetter: echo $SHELL will show you if you're not sure
[19:06:15] boboc: guys i have a sample rails app, i have installed nginx and puma to test a droplet on digital ocean to try to deploy a sample app. i have added the 'bind tcp://0.0.0.0:9292' setting in puma.rb and 'server 127.0.0.1:9292' in the nginx upstream directive but when i access a route from the rails app it doesn't work. puma was started and it shows it is listening on tcp://0.0.0.0:9292. Any idea what the problem is? thanks
[19:06:52] domgetter: boboc: for rails questions, try ##rubyonrails
[19:07:05] boboc: domgetter: thanks
[19:07:09] terlar: has joined #ruby
[19:07:38] N1njturt1e: has joined #ruby
[19:13:14] tildes_: has joined #ruby
[19:18:54] shinnya: has joined #ruby
[19:19:05] fowl: has left #ruby: ("Leaving")
[19:24:51] dunpeal: domgetter: /bin/bash
[19:24:54] smathy_: has joined #ruby
[19:25:23] domgetter: dunpeal: yea, I'm not sure. Is there a reason you're loading rvm in an unusual way?
[19:30:25] biberu: has joined #ruby
[19:30:48] shevy: you people need to have less problems!
[19:31:02] vinleod: has joined #ruby
[19:31:20] domgetter: shevy No risk, no reward!
[19:31:44] abshak3: has joined #ruby
[19:33:40] abshak3: has left #ruby: ()
[19:33:41] maletor3: has joined #ruby
[19:33:42] sid_fules: has joined #ruby
[19:34:09] certainty: has joined #ruby
[19:35:19] Zarthus: 99 bugs in the code. take one down, patch it around. 123 bugs in the code.
[19:35:41] dionysus69: has joined #ruby
[19:35:54] devbug: has joined #ruby
[19:37:59] zeroDi: has joined #ruby
[19:38:26] N1njturt1e: has joined #ruby
[19:41:15] pawnbox_: has joined #ruby
[19:42:00] r_rios: has joined #ruby
[19:42:29] ddffg: has joined #ruby
[19:42:45] sumobob: has joined #ruby
[19:43:13] bkxd: has joined #ruby
[19:43:32] hutch34: has joined #ruby
[19:44:21] ebernhardson: has joined #ruby
[19:44:33] ebernhardson: is it possible to share scope from outside a def into it? for example: https://repl.it/CYL7
[19:44:43] Fernando-Basso: has joined #ruby
[19:44:44] ebernhardson: or will i have to wrap it all into a class or something to have instance vars
[19:45:04] arooni: has joined #ruby
[19:45:06] xlegoman: has joined #ruby
[19:46:04] ruby271: has joined #ruby
[19:47:09] floatingpoint: has joined #ruby
[19:51:13] tinnvec: has joined #ruby
[19:52:11] karmatr0n: has joined #ruby
[19:52:34] dhk: has joined #ruby
[19:52:48] ouroboros_buddha: has joined #ruby
[19:53:00] Zackio: has joined #ruby
[19:55:07] jenrzzz: has joined #ruby
[19:55:39] tinnvec: has joined #ruby
[19:55:46] symm-: has joined #ruby
[19:56:05] postmodern: has joined #ruby
[19:56:42] ljames: has joined #ruby
[19:56:48] tinnvec: has joined #ruby
[19:57:28] kareeoleez: has joined #ruby
[19:58:00] whathappens: has joined #ruby
[19:58:15] ironcamel: ebernhardson: you can make it @foo = false in the outside scope
[19:58:47] mattwashere: has joined #ruby
[19:59:15] abshak3: has joined #ruby
[19:59:20] ur5us: has joined #ruby
[19:59:30] abshak3: has left #ruby: ()
[19:59:41] abshak3: has joined #ruby
[20:00:05] abshak3: Anyone there?
[20:00:23] wilsonc91: has joined #ruby
[20:00:35] Madplatypus: has joined #ruby
[20:00:56] kareeoleez: has joined #ruby
[20:01:24] jhass: abshak3: 'sup?
[20:02:47] abshak3: so the thing is
[20:02:57] abshak3: even though i love ruby
[20:03:14] abshak3: i can't seem to find ANY practical uses of it
[20:03:32] abshak3: the language is the best i have seen
[20:03:53] abshak3: except rails it is never used
[20:04:07] abshak3: and i use nodejs for web
[20:04:15] abshak3: so what should i do?
[20:04:40] karmatr0n: has joined #ruby
[20:05:02] djbkd: has joined #ruby
[20:05:05] abshak3: should i continue to learn?
[20:05:06] scepticulous: has joined #ruby
[20:05:39] fishy123: has joined #ruby
[20:06:28] davedev24: has joined #ruby
[20:07:03] futilegames: has joined #ruby
[20:08:51] aegis3121: Personally, I use it for writing scripts to automate things on my home computer. I would much rather write ruby scripts than bash
[20:09:17] hxegon: or if you need to process data, it's actually quite nice
[20:09:34] abshak3: I use ruby scripts too
[20:09:37] arooni_: has joined #ruby
[20:10:00] abshak3: I am currently learning metaprogramming in ruby
[20:10:17] abshak3: and I don't see myself using it anywhere
[20:10:27] abshak3: it is a great concept and I am having fun
[20:10:28] kent\n: has joined #ruby
[20:10:28] kent\n: has joined #ruby
[20:10:32] hxegon: You should avoid metaprogramming most of the time actually
[20:10:51] hxegon: It can help you short term, but long term it makes maintinence issues
[20:10:57] jrafanie: has joined #ruby
[20:10:57] hxegon: In my experience.
[20:11:00] adaedra: It can makes things harder to understand
[20:11:07] chouhoul_: has joined #ruby
[20:11:09] hxegon: what adaedra said
[20:11:10] adaedra: It's a nice trick to know, but it's easy to abuse
[20:11:20] hxegon: And there is usually a better way to do it
[20:11:21] abshak3: but I should learn it right?
[20:11:30] adaedra: Some of it is nice, but too much of it is Rails^W bad
[20:11:36] dcluna: has joined #ruby
[20:11:36] adaedra: Yeah, knowing it is good
[20:11:46] adaedra: Knowing when to use it too
[20:12:04] abshak3: ok tell me this
[20:12:21] joonty: has joined #ruby
[20:12:21] Omni_: has joined #ruby
[20:12:26] blockchan: has joined #ruby
[20:12:34] abshak3: my friend knows python,MEAN stack, and C/C++,Java
[20:12:52] abshak3: i know ruby,MEAN C/C++ C#
[20:13:04] abshak3: i do know python as much as he knows ruby
[20:13:10] abshak3: which is beginner level
[20:13:36] abshak3: during a job interview wouldn't they favour him
[20:13:47] freerobby: has joined #ruby
[20:13:51] adaedra: Depends on the job interview
[20:13:54] buddhabrot: has joined #ruby
[20:14:27] abshak3: But generally though
[20:14:30] blackgoat: has joined #ruby
[20:14:40] abshak3: python has numpy,pandas and the like
[20:14:50] adaedra: Is that a trick question to ask us which language is better?
[20:15:05] abshak3: and in my college any jobs looking for ruby are usually focused on rails
[20:15:06] shevy: RUBY IS BETTER
[20:15:07] Pupeno: has joined #ruby
[20:15:09] MrBusiness3: has joined #ruby
[20:15:16] adaedra: shevy: shoo.
[20:15:17] shevy: abshak3 your college knows who to pay and who not to pay
[20:15:46] Nilium: Ruby's basically my perl, if that helps explain non-rails usage
[20:15:47] N1njturt1e: has joined #ruby
[20:15:56] Nilium: Since I've never used Rails and don't plan to start.
[20:16:09] abshak3: so ruby is more of a hobby if you don't learn rails
[20:16:21] shevy: abshak3 hah funny - the exact same words were used some time ago :>
[20:16:24] Nilium: No, I use it at work for a lot of stuff.
[20:16:25] adaedra: Sure, Ruby usage in the wild is a lot Rails, but it can also be used for scripting and utilities
[20:16:40] buddhabrot: yeah, and there are other frameworks in Ruby too
[20:16:40] adaedra: Or other programs, really
[20:16:40] hxegon: No interview happens in a vacuum
[20:16:46] buddhabrot: Hanami was getting a lot of press recently
[20:16:55] buddhabrot: and there are a butt-load of micro frameworks
[20:17:05] buddhabrot: like NYNY, Sinatra, Cuba, etc
[20:17:06] hxegon: buddhabrot: excited to maybe try it out this weekend
[20:17:07] Nilium: But it's for tools and scripts, not really huge processes. You _can_ do bigger things in Ruby, but Rails tends to drown things out.
[20:17:11] abshak3: Sinatra is nice too
[20:17:27] hxegon: sinatra is amazing, I have like 3-4 work projects that use it
[20:17:28] adaedra: ACTION does pure-Rack
[20:17:36] shevy: adaedra nerd!
[20:17:39] Nilium: I also do graphics programming in Ruby, but that's more of a because-I-can thing
[20:17:47] adaedra: shevy: shoo again.
[20:17:49] buddhabrot: hxegon: I've been looking for something that isn't Rails but has many-to-many object model support
[20:17:51] buddhabrot: Hanami doesn't
[20:17:57] abshak3: everything in ruby is because you can
[20:17:59] Nilium: Reminds me, I need to update my glfw3 gem
[20:18:12] shevy: abshak3 you seem to be very limited
[20:18:54] adaedra: buddhabrot: Sequel?
[20:19:01] Nilium: Also, I primarily use Go at work anyway, since Ruby wasn't on the table for most things.
[20:19:15] abshak3: shevy: limited??
[20:19:18] hxegon: adaedra, buddhabrot yeah I was going to say use Sequel
[20:19:33] adaedra: Sequel is love
[20:19:49] shevy: abshak3 yeah
[20:19:59] abshak3: explain pls
[20:20:01] hxegon: adaedra: I haven't used it myself, but I've seen some articles on using it with hanami
[20:20:06] shevy: abshak3 just look at what you wrote
[20:20:07] Nilium: Sequel was certainly handy when I was doing a bunch of migrations in our DB ages ago
[20:20:19] johnmilton: has joined #ruby
[20:20:33] abshak3: I am a dumdum, can you spell it out for me/
[20:20:45] adaedra: abshak3: don't worry, I don't see either.
[20:21:00] hxegon: abshak3: You can do pretty much anything you can do with python in ruby
[20:21:24] adaedra: and no one is better than the other — just use what suits you best.
[20:21:33] abshak3: I get it, and that is why i chose ruby over python
[20:21:38] abshak3: coz it suits me better
[20:21:41] hxegon: abshak3: even if ruby doesn't have the library, you can use java libraries with jruby
[20:21:49] shevy: abshak3 https://gist.github.com/shevegen/30f0d15181199ca9bbc0be2bd81e87f0
[20:21:53] abshak3: and i love the object oriented part
[20:21:55] Nilium: Or write your own C extensions.
[20:22:03] hxegon: abshak3: me too
[20:22:08] hxegon: or that Nilium
[20:22:20] Nilium: I think half of my gems are C extensions.
[20:22:28] Nilium: It's unhealthy.
[20:22:42] hxegon: abshak3: for the record, I don't really use rails in my day job
[20:22:52] shevy: depends on how many gems you have
[20:22:55] shevy: it's ok if you have 2 gems!
[20:23:08] tildes_: has joined #ruby
[20:23:25] adaedra: it's ok whatever you do.
[20:23:27] shevy: hanmac probably has half of his gems for C++ code
[20:23:44] abshak3: I just find it weird that ruby is ignored so much
[20:24:01] Hanmac: shevy nearly all of mine are in C++
[20:24:09] abshak3: blogs and articles
[20:24:19] adaedra: it's maturing
[20:24:26] shevy: hanmac aha!
[20:24:29] adaedra: it's past the WOW phase, I would say
[20:24:33] hxegon: wasn't rails top of HN like, yesterday for dropping jquery?
[20:24:47] adaedra: they're dropping jQuery?
[20:24:49] hxegon: but yeah, we've past peak hype
[20:24:55] ironcamel: what was the reason for dropping jquery?
[20:24:57] adaedra: which is a good thing imo.
[20:25:01] Hanmac: shevy: but currently i am a traitor and do java code ;P
[20:25:06] shevy: hanmac for work?
[20:25:23] hxegon: ironcamel: https://github.com/rails/rails/issues/25208
[20:25:24] abshak3: I really hope we get more gems
[20:25:28] Nilium: I converted my office to using Go primarily, so I'm the ultra-traitor
[20:25:31] adaedra: more gems?
[20:25:37] shevy: java for work, python for fun, ruby for love
[20:25:37] adaedra: we already have plenty
[20:25:46] Hanmac: shevy: no for fun, checkout: http://www.slightlymagic.net/wiki/Forge
[20:25:52] hxegon: abshak3: what gem do you wish ruby had?
[20:26:05] abshak3: something like pandas
[20:26:07] shevy: oh... I wanted to write a card-game in ruby too
[20:26:12] adaedra: 119,142 is not enough for you?
[20:26:37] r_rios: I have a question: is it acceptable (i.e. less bad) to use global variables in a Ruby script intended to just run and give a result?
[20:26:39] Nilium: Most gems are unmaintained or dead, so I'm not sure the number's worth anything.
[20:26:57] Nilium: r_rios: If it's just something you run and it exits with a result I don't see a problem.
[20:27:09] shevy: I am trying to rescue some gems but old code (like 2005 and such) is surprisingly tedious to adapt
[20:27:21] Nilium: Some purists might disagree but ultimately the script's self-contained.
[20:27:23] abshak3: numbers alone don't amount for much now, do they?
[20:27:48] abshak3: numpy and pandas
[20:27:51] adaedra: "data analysis ruby" yields some interesting results in google.
[20:27:53] Nilium: shevy: The majority of the problems I have are around 1.8 era gems
[20:27:59] Nilium: And at that point I just go "well this is dead to me"
[20:28:06] hxegon: r_rios: gist the script?
[20:28:07] r_rios: Nilium: Yeah, that's exactly what I was thinking, but I wanted to see if anyone had good arguments against my point
[20:28:09] arooni: has joined #ruby
[20:28:29] postmodern: has joined #ruby
[20:28:46] r_rios: hxegon: I just started writing it
[20:28:46] Nilium: I guess if you wanted to be a real jerk you could try to mmap a file and then in a C extension convince Ruby that the mmap'd file was the global variable's storage or something
[20:28:53] Nilium: I don't know how you'd do it but it sounds like fun
[20:29:19] abshak3: is daru good?
[20:29:27] Nilium: Is that a food?
[20:29:27] r_rios: hxegon: But, to be more specific, the script is going to read a file, select some lines and extract some data out of them
[20:29:30] r_rios: Then exit
[20:29:46] abshak3: daru is what came up when i google "data analysis ruby"
[20:30:01] abshak3: so I hope it's not a food
[20:30:16] adaedra: well, try it with your use cases, that's still the best way
[20:30:27] hxegon: r_rios: what do the global vars contain?
[20:31:09] shevy: abshak3 you can find a lot of websites about precious stones too if you search for ruby :)
[20:31:11] hxegon: r_rios: (to preface, I think it's fine if it's self contained and kept short, but there could be a better way to do it)
[20:31:23] shevy: google is not yet skynet 2.1
[20:31:25] r_rios: hxegon: The splitted file (something like $lines = IO.read('file').split("\n"))
[20:31:41] r_rios: Although maybe I could make it a constant instead
[20:31:49] dionysus69: has joined #ruby
[20:32:17] abshak3: shevy: true
[20:32:25] adaedra: &ri File#each_line r_rios
[20:32:25] `derpy: r_rios: http://ruby-doc.org/core-2.3.0/IO.html#method-i-each_line
[20:32:48] Pupeno: has joined #ruby
[20:32:52] hxegon: there we go, thanks adaedra you nerd
[20:33:18] adaedra: ACTION pats the bot
[20:33:29] chouhoulis: has joined #ruby
[20:33:29] `derpy: ACTION purrs
[20:33:37] shevy: bot sex again
[20:33:58] adaedra: calm down here
[20:33:58] r_rios: Thanks, I imagined there would be a method like that one, but I didn't know what was it
[20:34:09] hxegon: is there somewhere I can make a PR to give it a random chance of saying something sexual?
[20:34:33] adaedra: not really.
[20:34:53] certainty: has joined #ruby
[20:35:08] abshak3: `derpy moans
[20:35:15] hxegon: pretty much lol
[20:35:18] beilabs: has joined #ruby
[20:35:48] hxegon: r_rios: you could also put it in a Struct or something, but it depends on how much effort you want to put into it
[20:35:49] Pupeno: has joined #ruby
[20:35:53] agentmeerkat: has joined #ruby
[20:36:07] shevy: abshak3 lol
[20:36:08] sid_fules: has joined #ruby
[20:36:13] abshak3: thanks guys, I will basically keep using ruby and hissing at the people who don't
[20:36:13] shevy: `derpy quacks.
[20:36:24] wrkrcoop: has joined #ruby
[20:36:33] adaedra: abshak3: well no, let people use what they wish
[20:36:33] r_rios: hxegon: What's the advantage of that over a global (or a constant)?
[20:36:47] hxegon: `derpy calculates the prime factors of a 1000000 digit number
[20:37:02] abshak3: adaedra: of course, but i will still hiss at them
[20:37:08] wrkrcoop: im trying to use Savon to make a soap request, but i can’t seem to figure out where the body goes?? anyon experienced with SOAP able to take a look? http://savonrb.com/version2/
[20:37:15] adaedra: r_rios: I think a better thing to do would be show to show the script in question?
[20:37:26] hxegon: adaedra: he is still mid writing it
[20:37:37] r_rios: Not written yet. I'l just start writing and then ask for suggestions
[20:37:44] rgb-one: has joined #ruby
[20:38:05] adaedra: Personally, for medium to large scripts, I usually wrap in a class so I use instance variables.
[20:38:08] ruby[bot]: rgb-one: # => 2 (https://eval.in/582989)
[20:38:13] hxegon: r_rios: it's hard to say without looking at code, but generally Structs help me with keeping stuff contained and grouped logically without going through the effort of 'making a real class'
[20:38:23] rgb-one: wasn't the name rubot?
[20:38:33] hxegon: used to be
[20:38:35] johnmilton: has joined #ruby
[20:38:41] adaedra: ruboto's been enhanced and has been renamed.
[20:38:49] ruby[bot]: nomnomnomnom
[20:39:11] rgb-one: so Ruboto is now Rubot?
[20:39:19] hxegon: >> puts '?botsnack'
[20:39:20] ruby[bot]: hxegon: # => ?botsnack ...check link for more (https://eval.in/582990)
[20:40:03] hxegon: ircbot quine project: canceled
[20:40:09] minimalism: has joined #ruby
[20:40:36] rgb-one: has left #ruby: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[20:40:45] rgb-one: has joined #ruby
[20:40:51] abshak3: >> puts [1,2,3].map {|x| x+5}.reduce(&:+)
[20:40:58] rgb-one: someone said something to me?
[20:41:04] wrkrcoop: anyone know where my body would go? http://savonrb.com/version2/
[20:41:12] r_rios: I just analyzed my problem again and I decided to make a class
[20:41:42] hxegon: r_rios: :D
[20:41:45] abshak3: why isn't the bot replying ;'(
[20:41:57] r_rios: I'm adapting some code I wrote in an irb session to a script and realized I created a couple of free functions related to the file data
[20:42:15] r_rios: Thanks for the help :)
[20:42:23] adaedra: abshak3: you need to be registered. Also, ruby[bot]'s eval feature is supposed to be for demonstrations.
[20:42:26] hxegon: abshak3: It might not reply to people who aren't registered
[20:42:34] abshak3: r_rios I want to see your code now
[20:45:02] 17WAAPNYJ: has joined #ruby
[20:46:14] adaedra: You know, you can use /nick if you want to change your nick.
[20:46:45] adaedra: (Note however it's considered bad manners to do it too often)
[20:47:14] abshak3: using irc client for the first time
[20:47:24] abshak3: used to webchat
[20:47:40] Es0teric: has joined #ruby
[20:47:49] abshak3: was trying to check out the features and it was being weird
[20:50:35] banister: has joined #ruby
[20:51:12] rgb-one: what client are you using abshak3
[20:51:17] CorOne: has joined #ruby
[20:51:44] nankyokusei: has joined #ruby
[20:52:04] abshak3: i like it so far, except for the nickname thingy
[20:52:30] rgb-one: it doesn't set your nickname on logon?
[20:52:37] adaedra: we're slipping into #ruby-offtopic here.
[20:53:08] rgb-one: ill mention ruby in every sentence to bring it back on ;)
[20:54:16] yqt: has joined #ruby
[20:54:22] haylon: has joined #ruby
[20:54:24] abshak3: why is this?
[20:54:27] codezomb: has joined #ruby
[20:54:35] chouhoulis: has joined #ruby
[20:54:36] abshak3: puts "wtf" if 0
[20:54:46] abshak3: when 0 is clearly false
[20:54:53] jhass: it's clearly is not
[20:54:58] rgb-one: >> puts "wtf" if 0
[20:54:59] ruby[bot]: rgb-one: # => wtf ...check link for more (https://eval.in/583003)
[20:55:06] hxegon: 0 is falsy in JS, but not ruby
[20:55:08] jhass: >> 0.is_a?(FalseClass)
[20:55:09] ruby[bot]: jhass: # => false (https://eval.in/583004)
[20:55:29] jhass: only nil and false are falsey in Ruby
[20:55:35] adaedra: only false and nil are falsy in Ruby
[20:55:43] adaedra: only jhass ninjas me
[20:55:49] jhass: falsy or falsey, I can never decide
[20:55:56] rgb-one: define "falsey"
[20:56:08] jhass: "behaves like false"
[20:56:09] adaedra: considered false; won't go into 'if' branch.
[20:56:18] pontiki: as it's not a real word, i use either spelling
[20:56:31] pontiki: just depends on whether you want to be fancy or not :D
[20:56:32] haylon: ACTION opens google
[20:56:45] rgb-one: thanks haylon
[20:56:46] jhass: ACTION opens offtopic
[20:57:03] rgb-one: and while your at it check out thruthy for me will ya
[20:57:51] hxegon: that might not be a real word, but that is for sure not the right spelling
[20:58:00] jhass: rgb-one: /join #ruby-offtopic ;)
[20:58:14] sartan: has joined #ruby
[20:58:58] rgb-one: lol.. "truthy"
[20:59:04] sartan: hi guys! i'm very new to ruby. when setting a variable eg foo = "bar", and later using a function: def test(); puts(foo); end <-- it seems 'foo' doesn't exist if the variable is defined before the function. $globals are probably pretty awful to use as well. Waht's the best way to address this?
[20:59:16] sartan: as opposed to passing an alphabet soup of variables in function calls
[20:59:32] smathy_: sartan, OOP
[20:59:33] rgb-one: use a class
[20:59:37] babblebre: has joined #ruby
[21:00:01] aegis3121: or a Struct, if a full-blown class is a bit much...
[21:00:33] adaedra: Just be aware of pot-pourri structures
[21:00:37] rgb-one: or specialized functions
[21:00:52] sartan: i miss python :P
[21:00:57] scepticulous: has joined #ruby
[21:01:09] adaedra: I'm pretty sure python has scopes too.
[21:01:23] pontiki: python hasn't gone anywhere
[21:01:29] sartan: it can access variables out of scope if namespaces aren't conflicting
[21:01:39] sartan: the api i'm working with is ruby-only so here i am
[21:02:17] r_rios: abshak3: Took me a little while: https://paste.kde.org/p20loxps0/gdgvic
[21:02:41] r_rios: Not a full fledged script yet, I'm using it from irb as a require
[21:03:13] pontiki: `foo` as you've written it is a local variable. it will be treated as such inside the method `test` and that `foo` inside test will NOT have anything to do with the one you've defined in the outer scope
[21:04:55] JakFrist: has joined #ruby
[21:04:58] cd83x: has joined #ruby
[21:05:15] cd83x: has joined #ruby
[21:06:01] bruce_lee: has joined #ruby
[21:06:01] bruce_lee: has joined #ruby
[21:06:24] sartan: so in py i'd do something like class stuff: foo="bar"; def test(self); print(self.foo).
[21:06:39] sartan: stuff().test()
[21:07:01] shevy: what is that monster
[21:07:13] sartan: trying to analogize what i'm observing ruby inheritance to work like
[21:07:21] sarcas: has joined #ruby
[21:07:49] shevy: well you have to make the variable persistent in ruby somehow
[21:08:01] adaedra: translating lines by lines from a language to another is a good way to end with a bad thing
[21:08:26] gizmore: has joined #ruby
[21:08:28] rgb-one: yea get the idea clear and it will flow
[21:09:01] postmodern: has joined #ruby
[21:09:25] davedev24: has joined #ruby
[21:09:31] gtsai: has joined #ruby
[21:10:08] blockchan: has joined #ruby
[21:10:11] freerobby: has joined #ruby
[21:10:39] antgel: has joined #ruby
[21:11:04] rgb-one: has left #ruby: ("Once you know what it is you want to be true, instinct is a very useful device for enabling you to know that it is")
[21:11:58] freerobby: has joined #ruby
[21:12:30] kareeoleez: has joined #ruby
[21:13:16] k3rn31: has joined #ruby
[21:14:41] sdothum: has joined #ruby
[21:15:17] tAn: has joined #ruby
[21:15:58] andywojo: has joined #ruby
[21:16:21] andywojo: if I have a string = "1 2 3 4 5 6 7", how do I split it to grab the fields 3-7
[21:16:57] andywojo: string.split(" ")[2-8]
[21:16:58] shevy: "1 2 3 4 5 6 7".split(' ')[2..-1] # => ["3", "4", "5", "6", "7"]
[21:17:03] andywojo: something like that but just till the end
[21:17:10] adaedra: use String#split to get the individual parts as an array, then Array#slice to get the needed parts
[21:17:41] adaedra: And Array#join if you want a string again.
[21:17:45] abshak3: has joined #ruby
[21:17:51] shevy: adaedra is better than a bot :)
[21:17:53] ruurd: then join it back together.
[21:18:04] der-landgraf: has joined #ruby
[21:18:10] ruurd: and faster than me
[21:18:10] whathapp_: has joined #ruby
[21:18:18] shevy: `derpy Array#join
[21:18:47] andywojo: perfect, thanks!
[21:18:47] shevy: come on derpy
[21:18:58] adaedra: It does not respond to that
[21:19:04] A124: has joined #ruby
[21:21:16] DadoCe: has joined #ruby
[21:22:44] hutch34_: has joined #ruby
[21:23:41] hxegon: &ri Array#join
[21:23:41] `derpy: http://ruby-doc.org/core-2.3.0/Array.html#method-i-join
[21:25:08] hutch34: has joined #ruby
[21:27:58] bkxd: has joined #ruby
[21:28:00] freerobby: has joined #ruby
[21:28:39] jaguarmagenta: has joined #ruby
[21:28:50] flashpoint9: has joined #ruby
[21:29:26] bmorrison: has joined #ruby
[21:29:44] freerobby: has joined #ruby
[21:31:21] hutch34: has joined #ruby
[21:35:41] certainty: has joined #ruby
[21:36:22] noobsu__: has joined #ruby
[21:38:31] N1njturt1e: has joined #ruby
[21:38:34] der-landgraf: has joined #ruby
[21:40:13] banister: has joined #ruby
[21:42:38] mikeiniowa: has joined #ruby
[21:42:39] skweek: has joined #ruby
[21:43:14] gizless: has joined #ruby
[21:45:19] jokke: i'm a bit lost with celluloid and blocking system calls with backticks
[21:45:24] kgrz: has joined #ruby
[21:45:26] jokke: maybe someone can help
[21:45:34] jokke: https://github.com/jreinert/conquer
[21:46:00] jokke: in example/bar.rb i define some celluloid actors with a dsl
[21:46:06] haylon: has joined #ruby
[21:46:38] jokke: and one of them runs mpc -w current
[21:46:45] jokke: this is a blocking call
[21:47:35] hxegon: Is the problem that it's blocking jokke ?
[21:47:43] haylon: I cannot for the life of me figure out how to get around this issue I'm having with JSON containing \\\\n in it or &. Either the JSON parser chokes at the & ina URL in a block of text, or I end up getting a [] noMethodError
[21:47:48] jokke: if i run the executable on command line everything goes as expected (except that hitting ctrl+c seems to kill only the backtick command)
[21:48:02] haylon: let me put it up on GitHub.
[21:48:18] jokke: but if i pipe the output to dzen2 it won't scroll
[21:48:29] coffeecupp: has joined #ruby
[21:48:47] jokke: hxegon: i think it's part of the problem
[21:49:01] UserInneed: has joined #ruby
[21:49:15] jancel: has joined #ruby
[21:51:12] ledestin: has joined #ruby
[21:51:50] sdothum: has joined #ruby
[21:51:57] hxegon: what does mpc -w do? It's for controlling mpd right?
[21:52:21] haylon: So, I've got this project, called cem_sender, which is supposed to take Custom Alert input from Zabbix, and send it to some goofy Event Management system we've brewed in house. So, when i run my gem using the cli tool, it either get it choking on a & or it tells me noMethodError
[21:52:24] haylon: https://github.com/predatorian3/cem_sender
[21:53:04] haylon: using this commadn to run it
[21:53:05] haylon: https://gist.github.com/predatorian3/7c5bc540c22fa7317ef7569ea908fd39
[21:53:10] jokke: hxegon: in this case it just waits until an event happens (next song for example) and returns the name of the song
[21:53:26] hutch34: has joined #ruby
[21:53:42] Pupeno: has joined #ruby
[21:53:50] jokke: i get Errno::EPIPE: Broken pipe when i kill the process with ctrl-c
[21:53:58] Pupeno: has joined #ruby
[21:54:44] jokke: so it seems the backticks somehow know the output is pipe
[21:54:50] hxegon: jokke: https://stackoverflow.com/questions/7212573/when-to-use-each-method-of-launching-a-subprocess-in-ruby/7263556#7263556
[21:55:06] yfeldblum: has joined #ruby
[21:55:09] hxegon: so backticks are not the way to go here
[21:55:11] haylon: I've updated the Gist to include the errors.
[21:55:12] hxegon: use system
[21:55:36] jokke: hxegon: why?
[21:55:42] jokke: i need to capture the output
[21:56:11] hxegon: err, maybe not system, but backticks block
[21:56:22] jokke: yes. i _want_ it to block
[21:56:55] hxegon: oh, I thought you said it blocking was a part of the problem
[21:57:02] Gasher: has joined #ruby
[21:57:15] jokke: well it might be, yes. But i still need it to block
[21:57:47] jokke: i'll try with IO.popen
[21:58:06] freerobby: has joined #ruby
[21:58:37] n_blownapart: has joined #ruby
[21:59:23] banister: has joined #ruby
[21:59:27] hxegon: alright, see you all later
[21:59:34] jokke: hxegon: bye
[21:59:44] hxegon_AFK: np, good luck jokke
[22:02:59] jokke: ok with IO.popen it's even weirder
[22:03:00] yfeldblum: has joined #ruby
[22:03:02] allcentury: has joined #ruby
[22:04:52] crystal77: has joined #ruby
[22:07:46] art-solopov: has joined #ruby
[22:09:02] jenrzzz: has joined #ruby
[22:09:19] jokke: no. it's the same
[22:10:20] jancel: has joined #ruby
[22:12:23] JJM: has joined #ruby
[22:16:32] jokke: so basically my problem is that `` seem to behave differently depending if output is a pipe or tty
[22:16:49] sdothum: has joined #ruby
[22:16:53] jokke: (as well as IO.popen)
[22:19:07] bkxd: has joined #ruby
[22:20:17] jokke: flush seems to do the trick
[22:20:46] deet_: has joined #ruby
[22:20:50] jokke: celluloid is awesome
[22:20:56] alfiemax: has left #ruby: ("Leaving")
[22:23:40] deet_: Hi. I'm new to Ruby programming. I would like to ask a couple of questions regarding crossplatform games. First, I don't get RubyMotion. All the examples seem to rely on SpriteKit -- what is the point of RubyMotion+SpriteKit vs Swift+SpriteKit. It will not be crossplatform if you use RubyMotion+SpriteKit, correct?
[22:27:18] Pupeno: has joined #ruby
[22:29:48] sneakerhax: has joined #ruby
[22:31:31] hahuang65: has joined #ruby
[22:33:29] Noxilex: has joined #ruby
[22:36:26] certainty: has joined #ruby
[22:38:02] moeabdol: has joined #ruby
[22:38:20] pawnbox: has joined #ruby
[22:40:02] pawnbox_: has joined #ruby
[22:40:05] mattwashere: has joined #ruby
[22:40:08] Mia: has joined #ruby
[22:40:09] Mia: has joined #ruby
[22:40:41] hahuang65: has joined #ruby
[22:40:54] shevy: is anyone here even using that
[22:41:38] bruce_lee: deet_: I'm new to ruby too, the following projects might be interesting for you: mobiruby mruby
[22:43:48] SilverKey: has joined #ruby
[22:45:12] CamCam2: has joined #ruby
[22:46:22] deet_: thx bruce, I will check them out. I've been playing with gosu in the meanwhile
[22:46:57] bruce_lee: deet_: please notice that I'm new to ruby too!
[22:48:45] duncannz: has joined #ruby
[22:52:38] nankyokusei: has joined #ruby
[22:52:49] Yiota: has joined #ruby
[22:52:51] jud: has joined #ruby
[22:54:08] domgetter: has joined #ruby
[22:54:15] xlegoman: has joined #ruby
[22:54:47] deet_: I found this quite helpful: https://leanpub.com/developing-games-with-ruby/read
[22:55:17] vdamewood: has joined #ruby
[22:56:54] hahuang65: has joined #ruby
[22:57:30] mattwashere: has joined #ruby
[22:59:05] drale2k: has joined #ruby
[23:00:11] kareeoleez: has joined #ruby
[23:00:31] tildes_: has joined #ruby
[23:01:05] shazaum: has joined #ruby
[23:01:25] bruce_lee: deet_: depending on your game, maybe apache-cordova can be the right tool, but it has nothing to do with ruby
[23:01:33] skweek: has joined #ruby
[23:01:35] duckpuppy: has joined #ruby
[23:02:13] bruce_lee: rubymotion seems only to be available for apple (osx), it is not free-software or open-source
[23:03:23] bruce_lee: maybe ruby is not the right language to write cross-plattform games, especially if you think about ios and android
[23:03:58] deet_: No, I think gosu has a lot of promise. I've made some sample code and like it so far.
[23:04:01] bruce_lee: guess javascript is the way to go
[23:04:22] bkxd_: has joined #ruby
[23:04:27] deet_: I think if I write a game with ruby+gosu gem it will compile on both
[23:04:34] bruce_lee: ok, as I said, I'm really new to ruby
[23:05:05] JJM: has joined #ruby
[23:07:23] N1njturt1e: has joined #ruby
[23:08:34] felipec: has joined #ruby
[23:08:46] felipec: What's the best way to convert a byte array to a string? Like [76, 111, 103, 105, 110, 32, 83, 101, 115, 115, 105, 111, 110, 32, 49, 0]
[23:11:44] pipework: felipec: #to_s
[23:11:45] pipework: Look into it.
[23:12:21] JesseH: has joined #ruby
[23:12:34] pipework: felipec: More specifically, #chr with a map could be useful
[23:13:07] cdg: has joined #ruby
[23:13:07] felipec: pipework: that almost works... except there's an extra \0
[23:13:19] JesseH2: has joined #ruby
[23:13:48] pipework: felipec: then use inject with chr and map and conditions.
[23:14:16] diegoaguilar: has joined #ruby
[23:14:19] felipec: pipework: why would I do that? [0..-1].to_s works
[23:14:35] pipework: felipec: Because you know your data better than I do.
[23:14:45] havenwood: >> [76, 111, 103, 105, 110, 32, 83, 101, 115, 115, 105, 111, 110, 32, 49, 0].pack 'c*'
[23:14:46] ruby[bot]: havenwood: # => "Login Session 1\x00" (https://eval.in/583025)
[23:15:01] pipework: woo pack, I never remember that
[23:15:10] diegoaguilar: has joined #ruby
[23:16:04] felipec: pipework: it's not my data, that's a typical string representation
[23:16:23] felipec: havenwood: actually [0..-2].pack('c*')
[23:16:23] pipework: felipec: I just didn't know whether your array would contain more than one \0 or not.
[23:16:49] felipec: pipework: a typical string array ends with a \0
[23:17:17] pipework: felipec: huh, didn't know that was a thing 'typically'.
[23:17:21] postmodern: has joined #ruby
[23:18:06] felipec: pipework: it is
[23:18:19] pontiki: in C it is
[23:19:22] nando293921: has joined #ruby
[23:20:10] art-solopov: Has anyone here used Jekyll?
[23:20:24] havenwood: art-solopov: Yes, people here have used Jekyll.
[23:20:26] pontiki: art-solopov: i use it a lot
[23:20:32] roamingdog: has joined #ruby
[23:20:39] pontiki: there's a #jekyll channel in fact
[23:20:46] art-solopov: ...That there is.
[23:21:07] art-solopov: I probably shouldn't attempt at programming questions at 2:30 AM. >_<
[23:21:20] pontiki: best time for them!
[23:21:26] felipec: pontiki: and pretty much everything is written in C, including Ruby
[23:21:47] havenwood: felipec: [110, 111, 109, 0].pack('c*').chomp("\x0")
[23:22:03] havenwood: felipec: Just the reference implementation though as there are many Rubies.
[23:22:04] bmorrison: has joined #ruby
[23:22:26] pipework: pontiki: I can only kinda read c. Most of the time I spent thinking about character arrays was with erlang long ago, it feels.
[23:24:26] art-solopov: pontiki: Haha, okay. =) Would you recommend using a theme for my first-time blog or would you recommend just writing the templates and CSS manually?
[23:25:56] roamingd_: has joined #ruby
[23:29:43] jaguarmagenta: has joined #ruby
[23:31:31] roamingdog: has joined #ruby
[23:35:52] beilabs: has joined #ruby
[23:37:11] certainty: has joined #ruby
[23:37:13] rattatmatt: has joined #ruby
[23:39:00] kies: has joined #ruby
[23:40:51] pawnbox: has joined #ruby
[23:42:42] hahuang65: has joined #ruby
[23:44:13] n1x-nz: has joined #ruby
[23:44:30] www-BUKOLAY-com: has joined #ruby
[23:49:58] ur5us: has joined #ruby
[23:51:24] SilverKey: has joined #ruby
[23:52:06] postmodern: has joined #ruby
[23:54:05] SilverKey: has joined #ruby
[23:54:57] ebernhardson: has left #ruby: ()
[23:55:38] aphprentice: has joined #ruby
[23:55:44] mroth: has joined #ruby
[23:55:52] c355E3B: has joined #ruby
[23:56:28] mitsuhiko: has joined #ruby
[23:56:34] err_ok: has joined #ruby
[23:56:38] jimcroft: has joined #ruby
[23:57:32] knowtheory: has joined #ruby
[23:57:39] grvgr: has joined #ruby
[23:58:48] Ropeney: has joined #ruby