« Back to channel list

#ruby - 02 March 2016

« Back 1 day Forward 1 day »
[00:00:17] justbleed: has joined #ruby
[00:01:34] toretore: has joined #ruby
[00:04:52] Ropeney: has joined #ruby
[00:05:24] diegoviola: has joined #ruby
[00:07:26] Trynemjoel: has joined #ruby
[00:13:46] freerobby: has joined #ruby
[00:17:13] bhaak: has joined #ruby
[00:19:36] lvn: has joined #ruby
[00:20:25] vikaton: has joined #ruby
[00:21:18] A124: has joined #ruby
[00:23:51] solocshaw: has joined #ruby
[00:25:21] baweaver: has joined #ruby
[00:28:03] tAn: has joined #ruby
[00:28:55] haylon: has joined #ruby
[00:28:59] LoneHerm_: has joined #ruby
[00:33:22] blackmesa: has joined #ruby
[00:33:41] benlieb: has joined #ruby
[00:35:28] duckpupp1: has joined #ruby
[00:38:30] _wwwbukolaycom: has joined #ruby
[00:38:40] baroquebobcat: has joined #ruby
[00:40:59] jayc0b0: has joined #ruby
[00:42:52] trosborn: has joined #ruby
[00:43:06] lemur: has joined #ruby
[00:45:25] graydot: has joined #ruby
[00:46:53] baweaver: has joined #ruby
[00:49:29] jgpawletko: has joined #ruby
[00:51:59] mikeiniowa: has joined #ruby
[00:53:00] solocshaw: has joined #ruby
[00:54:00] fmcgeough: has joined #ruby
[00:54:08] amclain_: has joined #ruby
[00:55:35] DLSteve: has joined #ruby
[00:55:56] eregi: has joined #ruby
[00:59:18] djbkd: has joined #ruby
[00:59:30] j3r0: has joined #ruby
[01:00:40] djbkd: has joined #ruby
[01:02:10] freerobby: has joined #ruby
[01:03:48] wldcordeiro: has joined #ruby
[01:04:08] darkf: has joined #ruby
[01:04:16] tenderlove: has joined #ruby
[01:04:16] ensyde_: has joined #ruby
[01:05:31] LoneHerm_: has joined #ruby
[01:05:36] lele: has joined #ruby
[01:05:56] ready: has joined #ruby
[01:11:28] Cohedrin: has joined #ruby
[01:16:24] baweaver: has joined #ruby
[01:17:21] DmitryBochkarev: has joined #ruby
[01:17:23] sp4rrow: has joined #ruby
[01:20:16] podman: has joined #ruby
[01:20:19] Xiti: has joined #ruby
[01:22:47] sudoubuntu: has joined #ruby
[01:22:53] matp: has joined #ruby
[01:23:43] Graphettion: has joined #ruby
[01:24:42] griffindy: has joined #ruby
[01:31:32] dlitvak: has joined #ruby
[01:31:54] spuk: has joined #ruby
[01:33:06] deuxclique: has joined #ruby
[01:34:52] jesterfraud: has joined #ruby
[01:36:14] duckpupp1: has joined #ruby
[01:39:19] htmldrum: has joined #ruby
[01:43:23] Respek: has joined #ruby
[01:44:15] aryaching: has joined #ruby
[01:44:46] chouhoulis: has joined #ruby
[01:47:14] B4daBing73: has joined #ruby
[01:50:28] cdg: has joined #ruby
[01:53:49] idefine: has joined #ruby
[01:54:38] tAn: has joined #ruby
[01:54:53] robbyoconnor: has joined #ruby
[01:55:46] duckpupp1: has joined #ruby
[01:56:36] mattwildig: has joined #ruby
[01:57:49] idefine: has joined #ruby
[01:57:52] ljames: has joined #ruby
[01:58:54] sgambino: has joined #ruby
[02:03:45] rodolfowtf: has joined #ruby
[02:05:14] freerobby: has joined #ruby
[02:05:38] jenrzzz: has joined #ruby
[02:06:54] hxegon: has joined #ruby
[02:07:59] aryaching: has joined #ruby
[02:08:19] mattwildig: has joined #ruby
[02:09:08] lvn: has joined #ruby
[02:09:15] Maletor: has joined #ruby
[02:11:07] Maletor: has joined #ruby
[02:14:44] unreal_: has joined #ruby
[02:16:32] eregi: has joined #ruby
[02:22:07] Respek: has joined #ruby
[02:24:14] safe: has joined #ruby
[02:26:53] freerobby: has joined #ruby
[02:30:34] chagel: has joined #ruby
[02:31:53] blackmesa: has joined #ruby
[02:35:44] jottr: has joined #ruby
[02:37:22] uglybandersnatch: has joined #ruby
[02:38:12] goodcodeguy: has joined #ruby
[02:39:37] idefine: has joined #ruby
[02:40:35] lessless: has joined #ruby
[02:41:01] lessless: hello folks! is it possible to receive a pair a values inside the block?
[02:41:09] DLSteve: has joined #ruby
[02:44:53] jottr_: has joined #ruby
[02:46:29] statelesscode: has joined #ruby
[02:47:56] epitron: lessless: yep
[02:48:16] Ox0dea: lessless: Certainly. Anything you can say in a method signature can be said in a block signature.
[02:48:17] lessless: epitron, I mean current and next
[02:48:29] lessless: sorry, for being unclear
[02:48:35] epitron: lessless: each cons
[02:48:36] Ox0dea: lessless: I think you might want each_cons(2)?
[02:49:25] tenderlove: has joined #ruby
[02:51:07] lessless: I do not have control over the over the method enumerable method itself - it's a 'ActionView::FormBuilder#collection_check_boxes' - it takes a block and returns a collection of checkboxes. And I need to wrap each pair of checkboxes into a div
[02:53:59] Ox0dea: #each_slice, then.
[02:55:19] gigetoo: has joined #ruby
[02:58:26] deuxclique: has joined #ruby
[02:59:03] deuxclique: has joined #ruby
[03:02:17] postmodern: has joined #ruby
[03:02:45] x77686d: has joined #ruby
[03:04:20] shevy: wheee https://github.com/ruby/ruby/blob/trunk/ChangeLog#L3 "lib/fileutils.rb: use keyword arguments instead of option hashes"
[03:05:46] Rodya_: has joined #ruby
[03:10:41] shanemcd: has joined #ruby
[03:11:49] aaeron: has joined #ruby
[03:13:23] chouhoulis: has joined #ruby
[03:13:29] kriskropd: has joined #ruby
[03:14:56] ericn81: has joined #ruby
[03:17:06] kies^: has joined #ruby
[03:17:42] chouhoulis: has joined #ruby
[03:19:12] sudoubuntu: has joined #ruby
[03:20:07] mostlybadfly: has joined #ruby
[03:20:19] bronson: has joined #ruby
[03:20:34] robbyoconnor: has joined #ruby
[03:21:05] DmitryBochkarev: has joined #ruby
[03:21:43] astrofog: has joined #ruby
[03:23:35] duncannz: has joined #ruby
[03:25:00] rodolfowtf: has joined #ruby
[03:26:39] freerobby: has joined #ruby
[03:27:28] zotherstupidguy: has joined #ruby
[03:30:31] duncannz: has joined #ruby
[03:30:32] krz: has joined #ruby
[03:31:05] jhack: has joined #ruby
[03:33:16] blackmesa: has joined #ruby
[03:36:41] stardiviner: has joined #ruby
[03:37:10] havenwood: shevy: nice
[03:42:51] pawnbox: has joined #ruby
[03:44:14] deuxcliq_: has joined #ruby
[03:44:40] rdavila: has joined #ruby
[03:46:21] chagel: has joined #ruby
[03:50:09] devbug: has joined #ruby
[03:51:36] eregi: has joined #ruby
[03:52:54] DmitryBochkarev: has joined #ruby
[03:53:39] LoneHermit: has joined #ruby
[03:55:24] DmitryBochkarev: has joined #ruby
[03:56:39] tAn: has joined #ruby
[03:57:21] adgtl: has joined #ruby
[03:57:21] adgtl: has joined #ruby
[03:58:11] rdavila: has joined #ruby
[03:58:45] sneakerhax: has joined #ruby
[03:59:19] leksster: has joined #ruby
[04:00:18] krz: has joined #ruby
[04:00:20] x77686d: has joined #ruby
[04:00:35] baweaver: has joined #ruby
[04:01:41] william3: has joined #ruby
[04:02:20] chagel: has joined #ruby
[04:03:08] floatingpoint: has joined #ruby
[04:07:53] pdoherty: has joined #ruby
[04:08:28] makenoise: has joined #ruby
[04:10:14] zast: has joined #ruby
[04:12:38] pawnbox: has joined #ruby
[04:13:28] jottr: has joined #ruby
[04:14:41] braincrash: has joined #ruby
[04:15:07] gix: has joined #ruby
[04:15:54] aupadhye: has joined #ruby
[04:16:34] howdoi: has joined #ruby
[04:17:16] chagel: has joined #ruby
[04:22:14] bronson: has joined #ruby
[04:22:16] chagel: has joined #ruby
[04:24:03] lpvb: has joined #ruby
[04:24:49] aupadhye: has joined #ruby
[04:26:34] rodolfowtf: has joined #ruby
[04:31:43] dlitvak: has joined #ruby
[04:32:27] queequeg1: has joined #ruby
[04:33:30] DmitryBochkarev: has joined #ruby
[04:34:43] blackmesa: has joined #ruby
[04:36:51] chouhoul_: has joined #ruby
[04:39:04] DmitryBochkarev: has joined #ruby
[04:40:23] rizenine: has joined #ruby
[04:45:27] nachoman: has joined #ruby
[04:47:19] elifoster: has joined #ruby
[04:49:27] plonk_: has joined #ruby
[04:49:27] plonk_: has joined #ruby
[04:50:23] InternetFriend: has joined #ruby
[04:55:01] LoneHermit: has joined #ruby
[04:55:50] sarlalia1: has joined #ruby
[04:56:00] Rodya_: has joined #ruby
[04:56:11] arlek: has joined #ruby
[04:56:12] dopamean_: has joined #ruby
[04:58:58] aaeron: has joined #ruby
[04:59:20] godzillaenlacasa: has joined #ruby
[05:03:04] nachoman: has joined #ruby
[05:03:06] pawnbox: has joined #ruby
[05:04:54] djbkd: has joined #ruby
[05:08:23] cdg: has joined #ruby
[05:08:38] djbkd: has joined #ruby
[05:10:18] pawnbox: has joined #ruby
[05:11:08] epitron: "Reduce system calls by activating the `did_you_mean` gem before requiring the gem. Activating the gem puts the gem on the load path, where simply requiring the file will search every gem that's installed until it can find a gem that contains the `did_you_mean` file."
[05:11:14] epitron: hey, that's a neat trick!
[05:11:27] epitron: probably still loads all the gemspecs in the universe though
[05:11:28] drbrain: ↑ is what bundler does
[05:12:03] makenoise: has joined #ruby
[05:13:43] epitron: doh. it only reduces the system calls from 3400 to 3300
[05:14:19] pawnbox: has joined #ruby
[05:15:01] tenderlove: has joined #ruby
[05:15:08] anaeem1_: has joined #ruby
[05:17:00] aryaching: has joined #ruby
[05:18:41] harryh: has joined #ruby
[05:20:47] adgtl: has joined #ruby
[05:20:47] adgtl: has joined #ruby
[05:24:26] pawnbox: has joined #ruby
[05:25:43] makenoise: has joined #ruby
[05:25:44] wilbert: has joined #ruby
[05:27:55] anaeem1__: has joined #ruby
[05:29:57] thevaliantx: has joined #ruby
[05:31:13] chagel: has joined #ruby
[05:31:48] htmldrum: has joined #ruby
[05:32:14] anaeem1_: has joined #ruby
[05:34:32] ur5us: has joined #ruby
[05:35:09] Rodya_: has joined #ruby
[05:35:48] dextertzu: has joined #ruby
[05:36:03] blackmesa: has joined #ruby
[05:37:21] mattwildig: has joined #ruby
[05:40:01] eregi: has joined #ruby
[05:42:17] Chagel_: has joined #ruby
[05:42:33] fullofcaffeine: has joined #ruby
[05:42:59] shevy: epitron is that a non-default behaviour?
[05:45:09] fullofcaffeine: has joined #ruby
[05:45:16] robbyoconnor: has joined #ruby
[05:49:18] eregi: has joined #ruby
[05:53:02] aupadhye: has joined #ruby
[05:56:17] mary5030: has joined #ruby
[05:56:38] deuxclique: has joined #ruby
[05:57:39] sq271: has joined #ruby
[05:59:48] tAn: has joined #ruby
[06:04:11] Rodya_: has joined #ruby
[06:04:29] sp4rrow: has joined #ruby
[06:09:29] fulgore_: has joined #ruby
[06:10:16] Rodya_: has joined #ruby
[06:10:45] trosborn: has joined #ruby
[06:11:03] nk121: has joined #ruby
[06:12:37] JohnBat26: has joined #ruby
[06:12:56] Uber|Dragon: has joined #ruby
[06:13:32] nk121: what does "dup" in "can't dup NilClass" mean?
[06:13:58] Uber|Dragon: it means the object you are trying to dup is nil
[06:14:02] czerasz: has joined #ruby
[06:14:16] nk121: what does the wrod "dup" mean
[06:14:29] Uber|Dragon: duplicate the object
[06:14:59] Uber|Dragon: http://apidock.com/ruby/Object/dup
[06:15:01] nk121: cool, thx
[06:15:56] shevy: damn it ... IceDragon watch out, Uber|Dragon is there ready for a duel
[06:16:04] shevy: and then there is Fire-Dragon-DoL
[06:16:12] brianpWins: has joined #ruby
[06:16:45] Uber|Dragon: haha I've been Uber|Dragon on irc (and beyond) for 20 years :P
[06:17:00] Uber|Dragon: do the other dragons blow fire in real life?
[06:17:38] shevy: I think they only make it to dragonhood on IRC
[06:17:52] Uber|Dragon: then the battle shall be short my friend :)
[06:17:54] bronson: has joined #ruby
[06:18:02] soujen: has joined #ruby
[06:20:06] soujen: has joined #ruby
[06:22:00] LoneHerm_: has joined #ruby
[06:22:54] Rodya_: has joined #ruby
[06:24:54] fullofcaffeine: has joined #ruby
[06:25:34] pawnbox: has joined #ruby
[06:34:14] dlitvak_: has joined #ruby
[06:34:19] devbug_: has joined #ruby
[06:34:37] shevy: yeah... IceDragon is old and grumpy ... not good duel material
[06:36:01] ur5us: has joined #ruby
[06:36:42] chagel: has joined #ruby
[06:37:18] aganov: has joined #ruby
[06:37:41] Mon_Ouie: has joined #ruby
[06:38:04] adgtl: has joined #ruby
[06:38:10] dionysus69: has joined #ruby
[06:38:54] blackmesa: has joined #ruby
[06:39:01] aufi: has joined #ruby
[06:40:21] dopie: has joined #ruby
[06:41:36] snockerton: has joined #ruby
[06:44:54] norc: nk121: Just beware of semantic differences between #dup and #clone across all the classes.
[06:45:30] norc: Also the fact that both will create a shallow copy.
[06:46:34] norc: (Clone will also copy over the objects singleton class and frozen state, where as dup does not)
[06:47:00] nk121: awesome, thanx norc. (fyi, someone also added that as a comment to the above linked page)
[06:47:16] norc: Oh brilliant.
[06:47:18] norc: Nevermind me then. :)
[06:47:52] norc: nk121: Does not mention the shallow copy bit though. :p
[06:47:57] norc: So I was not entirely useless.
[06:48:01] norc: Oh no it does!
[06:48:05] norc: I am absolutely useless.
[06:48:19] nk121: no worries, its absolutely reinforced in my head now at least :P
[06:50:15] tvw: has joined #ruby
[06:51:19] YaknotiS: has joined #ruby
[06:52:51] intrigueD: has joined #ruby
[06:53:51] pandaant: has joined #ruby
[06:54:13] shevy: I have used .dup quite a bit but I can not remember that I ever used .clone so far
[06:54:58] djbkd: has joined #ruby
[06:56:01] baweaver: has joined #ruby
[06:59:20] cibs: has joined #ruby
[07:00:20] ledestin: has joined #ruby
[07:03:17] jenrzzz: has joined #ruby
[07:03:41] dopie: has joined #ruby
[07:04:31] Guest73204: has joined #ruby
[07:04:38] solars: has joined #ruby
[07:05:00] Tobias|: has joined #ruby
[07:08:17] x77686d: has joined #ruby
[07:09:48] skade: has joined #ruby
[07:11:21] adgtl: has joined #ruby
[07:13:01] codecop: has joined #ruby
[07:14:33] scepticulous: has joined #ruby
[07:17:10] lxsameer: has joined #ruby
[07:20:26] htmldrum: has joined #ruby
[07:22:19] lvn: has joined #ruby
[07:25:47] andikr: has joined #ruby
[07:28:01] baweaver: has joined #ruby
[07:31:04] chagel: has joined #ruby
[07:33:00] jas02: has joined #ruby
[07:34:03] tAn: has joined #ruby
[07:34:39] last_staff: has joined #ruby
[07:34:42] mlehrer: has joined #ruby
[07:38:14] mattwildig: has joined #ruby
[07:38:21] hahuang65: has joined #ruby
[07:38:40] robbyoconnor: has joined #ruby
[07:38:45] firstdayonthejob: has joined #ruby
[07:40:17] blackmesa: has joined #ruby
[07:42:32] ruby-lang608: has joined #ruby
[07:44:13] sarlalia1: has joined #ruby
[07:44:23] m4rCsi: has joined #ruby
[07:44:28] PaulCape_: has joined #ruby
[07:45:05] sarlalia1: has joined #ruby
[07:45:22] MuffinPimp: has joined #ruby
[07:45:34] uglybandersnatch: has joined #ruby
[07:45:55] gaf_: has joined #ruby
[07:46:06] Morrolan: has joined #ruby
[07:46:51] robbyoconnor: has joined #ruby
[07:48:10] robbyoconnor: has joined #ruby
[07:49:32] ziyadb: has joined #ruby
[07:49:58] moeabdol: has joined #ruby
[07:53:26] karapetyan: has joined #ruby
[07:54:26] anisha: has joined #ruby
[07:58:47] rkoller: has joined #ruby
[08:01:16] skade: has joined #ruby
[08:01:33] ruby-lang697: has joined #ruby
[08:01:38] atmosx: has joined #ruby
[08:02:12] LoneHerm_: has joined #ruby
[08:03:12] flughafen: hi ruby-lang697
[08:03:52] astrofog: has joined #ruby
[08:04:18] biberu: has joined #ruby
[08:06:00] KKK4LIFE: has joined #ruby
[08:06:04] KKK4LIFE: why are you voting for president trump?
[08:07:16] mary5030_: has joined #ruby
[08:07:40] apeiros: !badnick KKK4LIFE
[08:07:40] ruby[bot]: +bb KKK4LIFE!*@*$#ruby-banned *!*@172.58.17.26$#ruby-banned
[08:07:41] ruby[bot]: ruby[bot] kicked KKK4LIFE: is not suitable for this channel, see http://ruby-community.com/pages/user_rules
[08:07:42] ruby[bot]: -b Lovich!*@*$#ruby-banned
[08:08:04] steffkes: has joined #ruby
[08:08:59] robbyoconnor: has joined #ruby
[08:09:24] TomyWork: has joined #ruby
[08:10:07] PaulCapestany: has joined #ruby
[08:11:56] cpup: has joined #ruby
[08:16:51] norc: So YAML.load() does not seem to trigger autoloading constants. Is this a bug?
[08:17:06] toretore: has joined #ruby
[08:17:36] norc: Oh. https://bugs.ruby-lang.org/issues/3511
[08:21:46] ruby-lang921: has joined #ruby
[08:23:28] tjbiddle: has joined #ruby
[08:23:59] bronson: has joined #ruby
[08:24:50] ruby-lang980: has joined #ruby
[08:25:18] hayden_: has joined #ruby
[08:29:09] the_drow: has joined #ruby
[08:30:10] antgel: has joined #ruby
[08:33:16] lee0417: has joined #ruby
[08:33:49] hololeap: has joined #ruby
[08:34:09] Hounddog: has joined #ruby
[08:36:01] karapetyan: has joined #ruby
[08:37:29] skade: has joined #ruby
[08:37:30] mark1: has joined #ruby
[08:37:33] mark1: has left #ruby: ()
[08:37:40] vdamewood: has joined #ruby
[08:37:55] tulak: has joined #ruby
[08:38:29] mark1: has joined #ruby
[08:39:31] Amnez777: has joined #ruby
[08:40:04] jenrzzz: has joined #ruby
[08:40:29] TomyWork: lately I don't think very highly of instantiating classes on deserialization :)
[08:40:31] karapetyan: has joined #ruby
[08:41:05] blackmesa: has joined #ruby
[08:42:11] Hanmac: i think thats one of the reasons why Autoloading is such an un-liked feature that matz wanted to remove it (or deprecate it) in the past
[08:42:21] hahuang61: has joined #ruby
[08:43:40] czerasz: has joined #ruby
[08:46:34] adgtl: has joined #ruby
[08:48:54] scope: has joined #ruby
[08:49:04] scope: hi guys anyone online
[08:49:08] scope: need a little help
[08:50:10] xpt: scope: Usually asking specific question helps fo achieve answer.
[08:50:17] scope: haha sorry
[08:50:29] scope: im trying to add some design to ROR
[08:50:43] scope: i have 3 files i have created a html file which sets the canvas
[08:50:51] scope: a css file and a js file
[08:51:07] scope: i cant for the life of me figure out where they go i have so far placed them in assets
[08:51:12] scope: i get this error message
[08:51:14] scope: Asset was not declared to be precompiled in production. Add `Rails.application.config.assets.precompile += %w( matrix.css )` to `config/initializers/assets.rb` and restart your server
[08:51:18] tranvuong: has joined #ruby
[08:52:27] scope: its supposed to be a raining code style background
[08:52:51] dlitvak: has joined #ruby
[08:54:09] baweaver: has joined #ruby
[08:54:16] xpt: scope: try asking this question on #rubyonrails
[08:54:50] Gasher: has joined #ruby
[08:55:00] scope: thanks anyway
[08:56:13] mja: has joined #ruby
[08:57:19] Xeago: has joined #ruby
[08:57:37] Xeago: has joined #ruby
[08:58:36] Freeaqingme: has joined #ruby
[09:01:58] Xeago: has joined #ruby
[09:02:51] rdark: has joined #ruby
[09:06:08] norc: has joined #ruby
[09:07:10] mja: hi, guys! I'm using BigDecimal to parse some financial data in form of numbers. I have some cases where the user has the ability to enter data. How could I raise error if the data is some characters, or a string but not a number? I mean, how the parsing of the input into BigDecimal could fail?
[09:07:44] snowy: has joined #ruby
[09:08:07] tjbiddle: has joined #ruby
[09:08:56] norc: mja: Are you perhaps looking for a gem like highline?
[09:09:30] marr: has joined #ruby
[09:10:48] mja: norc: let me check out
[09:11:00] norc: mja: Anyway. A simple regex will solve your issue.
[09:11:34] norc: This should be enough for you I think /\a[+-]?\d+\.?\d*\Z/
[09:12:02] mja: norc: yeah, but I want to avoid of the overhead. Let's say I use something like Float("asd"), it will fail and raise exception.
[09:12:13] norc: (highline just greatly simplifies the cli interaction with the user)
[09:12:21] troulouliou_div2: has joined #ruby
[09:12:33] norc: mja: Just test against the regex I mentioned above and raise and error if it does not match
[09:13:26] mja: norc: okay, thanks. I'll check and the gem that you mentioned
[09:14:48] Haris: has joined #ruby
[09:16:56] Hanmac: mja for financial stuff you might checkout the "money" gem
[09:17:08] ferr: has joined #ruby
[09:17:54] tomphp: has joined #ruby
[09:18:47] mja: hanmac: thanks, I'll do it
[09:20:00] trosborn: has joined #ruby
[09:20:05] tomphp: has joined #ruby
[09:22:01] htmldrum: has joined #ruby
[09:26:38] lee0417: hi guys, when learning meta programming, I found a concept that said `Class` is the object of itself. How to implement that concept?
[09:27:32] trosborn: has joined #ruby
[09:27:56] william3: has joined #ruby
[09:27:58] norc: lee0417: I do not understand your question. Can you rephrase it?
[09:28:01] sepp2k: has joined #ruby
[09:28:12] norc: Or lets settle some things first.
[09:28:49] Chagel_: has joined #ruby
[09:29:00] norc: >> Class.ancestors
[09:29:01] ruby[bot]: norc: # => [Class, Module, Object, Kernel, BasicObject] (https://eval.in/528563)
[09:29:13] lee0417: I mean when create a new class we can do this: `Person = Class.new`
[09:29:20] lee0417: then it said that
[09:29:40] norc: lee0417: That pattern is quite commonly used to create exception classes in Ruby by the way. :)
[09:30:46] norc: lee0417: I still do not understand your question. What do you mean by "is the object of itself" ?
[09:31:11] lee0417: thank norc for your patience
[09:31:53] whiteline: has joined #ruby
[09:31:58] lee0417: I mean when looking about object model in ruby, I have the concept said that: class `Class` is the object of itself
[09:32:07] astrofog: has left #ruby: ("Leave")
[09:32:10] adaedra: you mean an instance?
[09:32:14] lee0417: so I don't understand how to implement that concept
[09:32:29] adaedra: >> Class.class
[09:32:30] ruby[bot]: adaedra: # => Class (https://eval.in/528564)
[09:32:38] lee0417: yep. that's right
[09:32:43] lee0417: Class.class => Class
[09:32:44] adaedra: But this is done in the interpreter, you won't reproduce it in Ruby
[09:32:55] lee0417: how did they implement that concept
[09:33:10] adaedra: Look at the Ruby code?
[09:33:48] chagel: has joined #ruby
[09:35:52] lee0417: sorry. because I haven't reached to the point where I can understand the underhood of Ruby code
[09:36:12] lee0417: so I ask you guys to get an overview (high level) of that concept
[09:36:22] norc: lee0417: The problem is you have to dive under the hood to really understand whats happening.
[09:36:36] norc: Or simply accept that Class.class => Class
[09:38:06] adaedra: Are you writing your own language or something?
[09:38:51] Xeago: has joined #ruby
[09:38:56] n008f4g_: has joined #ruby
[09:39:04] mattwildig: has joined #ruby
[09:39:51] blackmesa: has joined #ruby
[09:40:30] lee0417: no. I just learning metaprogramming in ruby then got that concept
[09:40:39] norc: adaedra: Mind my asking, do you happen to remember which doc in Ruby had the ancestor diagrams of the core classes?
[09:41:02] adaedra: norc: nope
[09:41:07] norc: lee0417: This particular bit does not have much to do with metaprogramming - at least it should not be relevant to you.
[09:41:17] adaedra: lee0417: you don't need to know under the hood how it is done to do metaprogramming
[09:42:00] lee0417: @norc: that ancestor is just how ruby lookup chaining method.
[09:42:06] htmldrum: has joined #ruby
[09:42:15] lee0417: so if you understand that you can draw your own diagram
[09:43:11] norc: lee0417: Give me a second to find this for you.
[09:43:29] adaedra: norc: did you mean this? http://ruby-doc.org/core-2.3.0/Class.html
[09:43:32] Couch: has joined #ruby
[09:43:32] tranvuong: has joined #ruby
[09:43:42] AbdulR3hman: has joined #ruby
[09:43:47] norc: adaedra: Oh yeah.
[09:43:51] norc: That is a bit limited.
[09:45:11] norc: http://i.stack.imgur.com/XDHjA.jpg
[09:45:17] norc: That looks a bit more comprehensive.
[09:46:51] Gasher: has joined #ruby
[09:47:06] lee0417: @norc: thank u so much
[09:47:18] adaedra: There's surely a tool that dumps a graph from a Ruby project. Should not be hard to do with ObjectSpace and graphviz.
[09:47:54] BtcBen: has joined #ruby
[09:48:08] Fire-Dragon-DoL: mhhh I was sleeping, shevy I've been Fire-Dragon-DoL since 15 years! :P
[09:49:24] lee0417: @adaedra: graph tool? do you remember its name?
[09:49:25] uglybandersnatch: has joined #ruby
[09:50:03] adaedra: lee0417: never seen such a tool; i was just saying that there is probably one somewhere
[09:51:06] pawnbox: has joined #ruby
[09:51:30] AbdulR3hman: morning, is there a way to extract a gem spec from current enviroment and installing it using the same spec on a different machine?
[09:53:31] Jardayn: has joined #ruby
[09:54:06] ur5us: has joined #ruby
[09:54:37] Hanmac: AbdulR3hman: depending how different this machines are, this is not an easy way to do it
[09:54:41] DoubleMalt: has joined #ruby
[09:54:41] jeanlinux: has joined #ruby
[09:55:10] gigetoo: has joined #ruby
[09:56:10] antgel: has joined #ruby
[09:57:45] chagel: has joined #ruby
[09:57:59] william3: has joined #ruby
[09:58:59] nrsky: has joined #ruby
[09:59:56] william3: has joined #ruby
[10:00:23] Xeago: has joined #ruby
[10:00:31] skade: has joined #ruby
[10:03:26] eregi: has joined #ruby
[10:03:28] SCHAAP137: has joined #ruby
[10:04:27] dgncn: has joined #ruby
[10:04:38] darkf: has joined #ruby
[10:05:40] platzhirsch: has joined #ruby
[10:06:51] ur5us: has joined #ruby
[10:07:46] evidex: has joined #ruby
[10:14:41] joonty: has joined #ruby
[10:17:49] vdamewood: has joined #ruby
[10:18:33] chouhoulis: has joined #ruby
[10:19:16] mfaeh: has joined #ruby
[10:20:16] vasilakisFiL: has joined #ruby
[10:20:18] adgtl: has joined #ruby
[10:20:27] djbkd: has joined #ruby
[10:21:48] darkf_: has joined #ruby
[10:22:11] pydave6367: has joined #ruby
[10:23:34] araujo: has joined #ruby
[10:24:30] trosborn: has joined #ruby
[10:25:12] ready: has joined #ruby
[10:25:38] InternetFriend: has joined #ruby
[10:26:46] karapetyan: has joined #ruby
[10:26:54] bronson: has joined #ruby
[10:30:33] supplication: has joined #ruby
[10:31:43] karapetyan: has joined #ruby
[10:31:49] AbdulR3hman: hanmac: windows to windows
[10:32:41] karapetyan: has joined #ruby
[10:32:53] darkf_: has joined #ruby
[10:33:23] pawnbox: has joined #ruby
[10:33:41] binaryplease: has joined #ruby
[10:36:46] william3: has joined #ruby
[10:37:34] norc: >> ObjectSpace.each_object(Class).find { |a| a.name == "fatal" }
[10:37:35] ruby[bot]: norc: # => fatal (https://eval.in/528631)
[10:37:36] norc: What is this?
[10:38:32] dgncn: has joined #ruby
[10:43:37] FooMunki: has joined #ruby
[10:45:42] dgncn: has joined #ruby
[10:46:15] Hanmac: norc: like its said something very "fatal" ;P hm i dont know why it has such a hidden class, but its for that cases for exceptions from the C-side which should not be catchable ... a fatal error does exit the entire ruby programm/interpreter
[10:47:17] [gmi]: has joined #ruby
[10:48:13] dgncn: has joined #ruby
[10:48:27] norc: hanmac: Fair enough. Ill have to look into that later today.
[10:48:30] norc: >> DidYouMean::ClassNameChecker::ClassName
[10:48:31] ruby[bot]: norc: # => private constant DidYouMean::ClassNameChecker::ClassName referenced (NameError) ...check link for more (https://eval.in/528636)
[10:48:40] norc: Funny things lying around.
[10:49:16] croberts: has joined #ruby
[10:49:31] volty: has joined #ruby
[10:49:34] pawnbox_: has joined #ruby
[10:51:04] uglybandersnatch: has joined #ruby
[10:52:28] william3: has joined #ruby
[10:54:19] jaruga: has joined #ruby
[10:54:55] Xeago: has joined #ruby
[10:55:19] baweaver: has joined #ruby
[10:56:01] jeanlinux: has joined #ruby
[10:56:23] darkf: has joined #ruby
[10:57:29] InternetFriend: has joined #ruby
[10:58:52] j3r0: has joined #ruby
[11:05:52] karapetyan: has joined #ruby
[11:06:28] norc: adaedra: The exercise was worth it. I learned that there is one core class that does not derive from Object -> Delegator. :)
[11:06:49] norc: (Well and SimpleDelegator of course)
[11:07:23] quaristice: has joined #ruby
[11:08:31] UtkarshRay: has joined #ruby
[11:11:00] f4cl3y: has joined #ruby
[11:15:04] trinaldi: has joined #ruby
[11:19:01] sdothum: has joined #ruby
[11:19:28] chouhoulis: has joined #ruby
[11:24:40] hayden_: has joined #ruby
[11:26:49] rodfersou: has joined #ruby
[11:28:01] pawnbox: has joined #ruby
[11:30:44] Xeago: has joined #ruby
[11:32:41] ldnunes: has joined #ruby
[11:34:13] karapetyan: has joined #ruby
[11:36:04] mlehrer: has joined #ruby
[11:37:28] pawnbox: has joined #ruby
[11:38:18] nettoweb: has joined #ruby
[11:38:21] maximski: has joined #ruby
[11:38:56] LoneHerm_: has joined #ruby
[11:39:40] harryh: has joined #ruby
[11:39:54] mattwildig: has joined #ruby
[11:40:48] maximski: i recently updated a gem in a project gemfile to use the github repository to fetch the gem but it still uses the old gem version (using rbenv), any idea why that might be?
[11:41:26] nettoweb: has joined #ruby
[11:41:49] lipoqil: has joined #ruby
[11:43:14] maximski: sorry, was my bad, already found the issue
[11:45:43] cassioscabral: has joined #ruby
[11:52:05] Ishido: has joined #ruby
[11:53:54] Mon_Ouie: has joined #ruby
[11:54:43] ghormoon: has joined #ruby
[11:54:43] csmb: has joined #ruby
[11:54:43] Kruppe: has joined #ruby
[11:54:43] hadronzoo: has joined #ruby
[11:54:43] jpterry: has joined #ruby
[11:55:56] ghormoon: has joined #ruby
[11:57:31] skade: has joined #ruby
[11:57:31] Foren: has joined #ruby
[11:57:59] allcentury: has joined #ruby
[12:00:00] GreyHands: has joined #ruby
[12:00:33] UtkarshRay: has joined #ruby
[12:02:27] jeanlinux: has joined #ruby
[12:03:49] vondruch: has joined #ruby
[12:04:28] william3: has joined #ruby
[12:05:03] adgtl: has joined #ruby
[12:06:07] schickung: has joined #ruby
[12:10:36] Aviio: has joined #ruby
[12:11:32] dlitvak: has joined #ruby
[12:15:00] harryh: i have an array pages = [{ order: 1 }, { order: 2 }, ...] and need to get the element where order == currentPage.order + 1, or order == 1 if it reaches the final page. im trying to use .select, but idk a clean way to do it, since .select returns an empty array if no elements are found, it seems, so `nextPage = foo.select{ |f| f.order == current.order+1 } || foo.select{ |f| f.order == 1 }` doesn't work. is there a clean way to do this?
[12:15:00] harryh: here's my gist for reference https://gist.github.com/hedgerh/0d7f31b6686c417d58b0
[12:15:22] harryh: new to ruby from js, so not sure of the ins and outs. any help is really appreciated.
[12:17:42] harryh: think i got it, actually
[12:18:09] harryh: foo.select{ |f| f.order == current.order+1 || f.order == 1 }
[12:18:17] harryh: thanks anyway :D
[12:19:43] harryh: that didnt work. brings up both results
[12:19:54] dlitvak: has joined #ruby
[12:20:57] FooMunki: has joined #ruby
[12:21:21] chouhoulis: has joined #ruby
[12:22:06] gregf: has joined #ruby
[12:22:36] binaryplease: has joined #ruby
[12:22:57] moeabdol1: has joined #ruby
[12:24:36] Aviio_: has joined #ruby
[12:26:16] blackmesa: has joined #ruby
[12:27:37] Tempesta_: has joined #ruby
[12:27:58] norc: harryh: By the way, no need to annotate multiple versions in your gist. Just update it, and others will see previous "attempts" in the revision history. :)
[12:28:37] UtkarshRay: has joined #ruby
[12:28:58] bronson: has joined #ruby
[12:31:16] harryh: norc: i never even realized there was a revision history for gists ha :p id rather just annotate to make it easier for someone to glance over since its a one liner though. TIL
[12:31:29] apeiros: harryh: position the faster test first
[12:31:39] apeiros: as a general advice
[12:32:10] apeiros: gists can even be forked/cloned. they're git repos.
[12:33:02] norc: harryh: Id say the best solution depends on what you are actually trying to do.
[12:33:17] harryh: yeah. so any suggestions? im starting to think im going to need to do the first select, check to see if it's empty, then do the next
[12:33:33] nocontrol: has joined #ruby
[12:33:35] Aviio_: Hi all - Anybody got experience with puppet?
[12:34:03] harryh: im building a portfolio site for someone in middleman. he's going to be able to set an `order` variable for each page to dictate the order they are listed
[12:34:04] norc: Aviio_: Ask your question instead of asking whether there is experienced people around.
[12:34:30] nocontrol: I am trying to do a ping sweep => write results to the (postgre) database and it works fine in a frequency of 1 second repeats, but after some time it piles up somehow and fails https://gist.github.com/chrisvel/e1474c66fef6de1fda10
[12:35:11] nocontrol: This is the problem I see "error_message"=>"could not obtain a connection from the pool within 5.000 seconds (waited 5.005 seconds); all pooled connections were in use"
[12:35:48] apeiros: a wild indentation appears
[12:35:50] harryh: at the bottom of each project page, there's a "Next Project" button that leads to the next project. so the fact that the client gets to set an order variable makes me not want to go on array size or anything
[12:35:58] apeiros: ACTION uses advanced reading skills
[12:36:00] norc: nocontrol: Sounds like heroku.
[12:36:02] apeiros: it's not very effective…
[12:36:19] Aviio_: So I have some puppet files that ive been provided with, I have a manifest named cleanup.pp and a module which is stored in a 'cleanup' directory named config.pp ( https://github.com/Aviio/SecGen/tree/directory_change/modules/build/puppet ) but when I try and provision them through vagrant I get an error ( Error: Could not find class cleanup::config for debian-607-x64-vbox4210 on node debian-607-x64-vbox4210 ), i
[12:36:19] Aviio_: f I go onto the box both of the files are present and in the proper folders
[12:36:25] norc: nocontrol: ActiveRecord?
[12:36:47] norc: nocontrol: The problem is quite obvious though. You have only a limited set of pooled connections and no queueing mechanis,.
[12:36:49] nocontrol: norc: just a vagrant ubuntu server on puma
[12:37:16] nocontrol: norc: I see and it's logical... because it might open 255 connections at once
[12:37:43] nocontrol: norc: but do you have any idea how to overcome this ?
[12:37:52] norc: nocontrol: I dont even know which part is being pooled.
[12:37:56] norc: nocontrol: You need to provide more information
[12:38:05] norc: A full stack trace would be helpful
[12:38:06] openstruct: has joined #ruby
[12:38:16] nocontrol: norc: https://gist.github.com/chrisvel/e1474c66fef6de1fda10 the last lines from 19+
[12:38:24] norc: Aviio_: Sounds like an actual puppet problem. Try #puppet
[12:38:37] Aviio_: norc: cool, cheers
[12:38:39] norc: nocontrol: I asked for a stack trace.
[12:38:42] harryh: looking at each_with_object now
[12:38:47] harryh: oh, deprecated
[12:38:50] Suntzu: has joined #ruby
[12:39:08] norc: harryh: use .with_index and .with_object
[12:39:16] nocontrol: norc: there's nothing useful there unfortunately
[12:39:24] norc: nocontrol: Can I be the judge of that?
[12:40:02] norc: nocontrol: also, what is Node?
[12:40:19] nocontrol: norc: it's model that stores IP Adresses
[12:40:25] norc: model based on which class?
[12:40:33] bob_f: has joined #ruby
[12:40:45] nocontrol: norc: the problem is strictly related to this iteration and opening 255 connections to postgres every 1 sec
[12:40:56] norc: Sequel? Datamapper? AR?
[12:41:46] norc: Then tell me.
[12:41:50] norc: Seriously.
[12:41:52] nocontrol: ActiveRecord
[12:41:54] norc: I asked ActiveRecord and you said no.
[12:42:01] norc: Stop wasting my time.
[12:42:10] nocontrol: sorry, the no goes to your previous question
[12:42:17] nocontrol: it's activeRecord
[12:43:30] norc: nocontrol: Well, next time provide such details and dont force me to ask you every single bit about your application.
[12:43:33] sgambino: has joined #ruby
[12:44:14] nocontrol: anything to suggest ?
[12:44:20] dstarh: has joined #ruby
[12:44:44] norc: nocontrol: Increase your pool size or introduce some other buffering mechanism.
[12:45:11] krz: has joined #ruby
[12:45:14] william3: has joined #ruby
[12:45:20] norc: nocontrol: The latter is probably the better option.
[12:45:36] karapetyan: has joined #ruby
[12:46:36] norc: nocontrol: I would use a Thread pool, a Queue and a worker that takes data from the queue and writes it to the database.
[12:46:55] norc: While the queue is being filled from each worker thread in the pool.
[12:47:21] nocontrol: norc: this is how it works
[12:47:40] nocontrol: norc: I've tried with Threads too but it doesn't change that connections pile up quickly
[12:47:56] norc: nocontrol: No you are not using a Queue.
[12:48:22] nocontrol: norc: I don't know what do you mean by "Queue", I used a Threads pool before
[12:48:29] nocontrol: If it's the same ?
[12:48:40] norc: nocontrol: https://en.wikipedia.org/wiki/Queue_(abstract_data_type)
[12:48:48] norc: &ri Queue nocontrol
[12:48:48] `derpy: nocontrol: http://ruby-doc.org/core-2.3.0/Queue.html
[12:48:58] nocontrol: this sounds good
[12:49:07] norc: nocontrol: And you should use threads because there is no reason to use processes.
[12:49:18] nocontrol: the previous one here
[12:49:52] nocontrol: told me to use Processes
[12:50:01] nocontrol: because Threads make no sense at all
[12:50:20] flughafen: has joined #ruby
[12:50:29] norc: nocontrol: I would not use external commands to begin with. I would just use worker threads using net-ping
[12:51:26] nocontrol: norc: not a problem, this is another thing
[12:51:37] Vingador: has joined #ruby
[12:51:50] nocontrol: norc: thanks for the queue thing, it may solve the issue actually
[12:52:02] norc: nocontrol: Though the more I look at it I do not think a queue is the solution.
[12:52:05] norc: Your problem lies elsewhere.
[12:52:23] Xeago: has joined #ruby
[12:52:36] godzillaenlacasa: has joined #ruby
[12:52:40] mattwildig: has joined #ruby
[12:52:44] nocontrol: norc: 255 INSERTs to the db every 1 sec, what else ?
[12:53:06] norc: nocontrol: That is not an issue. The way the code flows this would just use a single database connection.
[12:53:09] norc: At a time.
[12:53:22] norc: nocontrol: Is this a production server? Are there other jobs running?
[12:54:03] norc: What is your connection pool size?
[12:54:03] nocontrol: no just a vagrant ubuntu server 14.04 on my laptop
[12:54:37] nocontrol: norc: pool: 5
[12:54:59] norc: nocontrol: gist your model.
[12:55:11] norc: And the stack trace I asked for a while ago.
[12:55:14] nocontrol: but the first ones work fine, I see pings in the console happening and persisted to the db, but after 20-25 seconds it fails
[12:55:39] InternetFriend: has joined #ruby
[12:57:00] nocontrol: norc: https://github.com/chrisvel/networkify the whole project
[12:57:34] norc: nocontrol: and the stack trace. dont make me ask again.
[12:57:38] jgpawletko: has joined #ruby
[12:57:46] nocontrol: norc: https://github.com/chrisvel/networkify/blob/master/db/schema.rb
[12:58:24] yardenbar: has joined #ruby
[12:58:29] KervyN: has joined #ruby
[12:59:47] nocontrol: norc: https://gist.github.com/chrisvel/56b6b1ee9262823ada76
[13:00:30] norc: nocontrol: And this is why I wanted the stacktrace, you could have saved us both a lot of time if you had pasted it right at the beginning when I asked for it.
[13:00:45] norc: You completely hid the fact that you are using sidekiq jobs here.
[13:03:09] nocontrol: norc: I didn't hide this actually, sorry :)
[13:03:28] vondruch: has joined #ruby
[13:03:55] norc: nocontrol: You did not even mention that you are running this from sidekiq jobs to begin with.
[13:04:02] synthroid: has joined #ruby
[13:04:39] nocontrol: I would like to see why theoretically this is wrong
[13:05:15] nocontrol: I got similar errors with Threads and the worst part is that after some time IF I don't end the processes manually by Ctrl+c, it freezes the vm
[13:05:44] adgtl: has joined #ruby
[13:05:44] vasilakisfil_: has joined #ruby
[13:05:50] norc: nocontrol: As I said, I wouldnt use shell ping but do it all in Ruby, that would not be an issue then.
[13:05:52] nocontrol: it might be that the persistance of items to the db is slow so they pile up and overflow
[13:05:54] william3: has joined #ruby
[13:05:56] norc: nocontrol: No.
[13:06:11] norc: nocontrol: Do you have other sidekiq jobs running?
[13:06:24] nocontrol: norc: but the problem is not the shell ping but the connections to the db
[13:06:44] norc: nocontrol: You said you had issues with freezing with threads etc, that was just my response to that.
[13:06:56] nocontrol: norc: https://github.com/chrisvel/networkify/blob/master/Procfile.dev
[13:07:25] nocontrol: norc: clockwork starts a job with the ping sweep
[13:07:45] nocontrol: norc: as I decrease the frequency it's more likely for it to fail
[13:07:55] johnmilton: has joined #ruby
[13:07:56] norc: nocontrol: There you go. Multiple concurrent workers.
[13:08:06] norc: nocontrol: You have more concurrent workers than your connection pool size.
[13:08:25] nocontrol: norc: possibly more than 5
[13:08:32] karapety_: has joined #ruby
[13:08:49] nocontrol: norc: but why? the ping sweep completes in 1.3sec
[13:08:59] schickung: has joined #ruby
[13:09:00] norc: nocontrol: If you have 6 concorrent jobs..
[13:09:01] nocontrol: norc: the iteration happens every 5 sec or more
[13:09:18] nocontrol: norc: is there any way to wait for the termination of the previous ones ?
[13:09:35] johnmilton: has joined #ruby
[13:09:38] duckpupp1: has joined #ruby
[13:09:40] nocontrol: norc: and what wound be the cons If I increased the number of concurrent workers to 10 or 15 ?
[13:10:29] norc: nocontrol: Just resources. But if you have 10 concurrent workers which all use the database, it means they all need to be able to gain access within the timeout duration which is 5 seconds.
[13:10:46] norc: If you cannot guarantee that, increase your connection pool size to have enough for your jobs and web users.
[13:11:09] norc: nocontrol: Or better yet, use your redis queue that you already have!
[13:11:28] norc: nocontrol: Pump the data you need to write back into redis and have another sidekiq job write them to the database maybe.
[13:12:14] nocontrol: norc: the first suggestion makes sense
[13:12:25] nocontrol: norc: the second one.. I don't get it at all :(
[13:13:12] norc: nocontrol: If your actual jobs dont use the database, you are basically wasting database connections on your jobs for just inserting node data.
[13:13:22] makenoise: has joined #ruby
[13:13:40] norc: nocontrol: So if you have 10 concurrent workers all doing their ping sweep, they would all feed the data back into redis.
[13:14:59] norc: nocontrol: and next time, start with the stack trace... ;-)
[13:15:31] nocontrol: norc: they use the database. Actually the workflow is: Start Job => Do a ping sweep and append data to a hash/array => iterate array and persist them to the db
[13:15:56] nocontrol: norc: this happens every 5 sec and I want to decrease it to 1 sec
[13:16:20] nocontrol: norc: the ping sweep takes 1.2seconds in shell alone, so I am pretty close
[13:16:42] nocontrol: norc: so I need the database in order to write the data and then show them in the frontend
[13:17:06] norc: nocontrol: So?
[13:17:09] IrishGringo: has joined #ruby
[13:17:26] karapetyan: has joined #ruby
[13:17:33] shanemcd: has joined #ruby
[13:17:47] terlar: has joined #ruby
[13:17:50] nocontrol: norc: it makes sense what you're saying because If the first one takes 5.5 seconds, the first and second ones will finish after the third begins
[13:18:27] nocontrol: norc: so there's a "line" where each one ends and another one or two or three start
[13:18:28] norc: nocontrol: Just write the data back into your redis queue.
[13:18:38] nocontrol: norc: I don't get it what redis have to do
[13:18:56] norc: nocontrol: Do you know what redis is?
[13:19:01] nocontrol: norc: I only use redis for sidekiq
[13:19:10] nocontrol: norc: so far a key/value pair storage
[13:19:27] nocontrol: in the form of hashes
[13:19:39] nocontrol: but how could this help me ?
[13:22:03] norc: nocontrol: You can simply take a redis list and push/pop from it.
[13:22:06] chouhoulis: has joined #ruby
[13:22:35] nocontrol: norc: so to use it as a database storage ?
[13:22:39] norc: More like a message broker.
[13:24:56] shanemcd: has joined #ruby
[13:25:02] mfaeh: has joined #ruby
[13:25:39] norc: nocontrol: One other solution - is to prevent overlapping jobs to begin with.
[13:25:41] norc: nocontrol: https://github.com/mhenrixon/sidekiq-unique-jobs
[13:26:30] nocontrol: norc: I don't like using one gem for each problem
[13:26:40] nocontrol: norc: do you think it's a problem of postgres finally ?
[13:26:45] norc: nocontrol: You surely like using sidekiq for something its not meant for.
[13:26:54] nocontrol: norc: why should Redis work and PostgreSQL not ?
[13:27:15] nocontrol: or should I try using something like Mongodb ?
[13:27:16] norc: nocontrol: The issue is you have multiple concurrent processes which try to make use of a limited connection pool.
[13:27:33] norc: nocontrol: redis would work because it all works on the same connection.
[13:28:10] norc: nocontrol: Your whole job design smells a bit funny though.
[13:28:22] nocontrol: norc: it's a hobby project for learning purposes
[13:28:43] tristanp: has joined #ruby
[13:28:43] nocontrol: norc: to keep a ping sweeper on the background running as a job
[13:28:55] norc: nocontrol: If you want to learn, then use the right tools. ;-)
[13:28:57] nocontrol: norc: and update live with websockers later
[13:29:23] nocontrol: norc: but it's not a problem for this project only
[13:29:27] emilkarl: has joined #ruby
[13:29:43] nocontrol: norc: what If I had a website with several http requests to the db at once ?
[13:29:49] nocontrol: norc: whould they fail ?
[13:30:05] norc: nocontrol: Usually you have a set up with multiple http workers, each of which contains a connection pool.
[13:30:08] nocontrol: norc: in this case they should be way more than just 255/second
[13:30:23] norc: nocontrol: But you are correct that this can become a problem.
[13:30:34] norc: Which is why building robust websites that can handle hundreds of users is not trivial.
[13:30:42] nocontrol: norc: so raise the workers amount or the pool size ? or both ?
[13:30:50] _rsc`: has left #ruby: ()
[13:30:52] norc: nocontrol: In your case I would seriously say neither.
[13:31:15] norc: nocontrol: You are using sidekiq in a way its not meant to, and are trying to remedy your issues by scaling resources up.
[13:31:44] jottr: has joined #ruby
[13:32:31] nocontrol: norc: but except redis, you're not suggesting anything else ?
[13:32:59] norc: [14:25] <norc> nocontrol: One other solution - is to prevent overlapping jobs to begin with.
[13:33:51] Azulinho: has joined #ruby
[13:34:21] nocontrol: norc: with the gem you suggested ?
[13:34:36] william3: has joined #ruby
[13:34:38] norc: nocontrol: just dont use sidekiq for this.
[13:34:43] norc: You dont need sidekiq.
[13:34:53] norc: You just want cronjobs.
[13:35:17] aclearman037: has joined #ruby
[13:35:19] nocontrol: at least I have some information to deal with
[13:35:34] norc: nocontrol: in fact sidekiq does not even offer you the resolution to do something every second.
[13:35:55] chagel: has joined #ruby
[13:35:55] nocontrol: norc: but it lets you manage workers and jobs
[13:36:40] schickung: has left #ruby: ()
[13:38:31] norc: nocontrol: Its for a different problem domain.
[13:38:45] norc: nocontrol: You just want for something to happen periodically every n timeslots.
[13:39:12] norc: While sidetiq (a sidekiq plugin of sorts) allows for something, its more designed to integrate the concept of cron into an existing sidekiq infrastructure.
[13:39:37] eregi: has joined #ruby
[13:40:24] nocontrol: norc: I don't get it but most possibly I need to read a bit more
[13:41:57] dionysus69: has joined #ruby
[13:42:32] goodcodeguy: has joined #ruby
[13:42:46] fmcgeough: has joined #ruby
[13:43:25] Pandorian: has joined #ruby
[13:44:40] aclearman037: has joined #ruby
[13:45:05] jaruga: has joined #ruby
[13:47:17] snowy: has joined #ruby
[13:47:19] darkf_: has joined #ruby
[13:47:54] shanemcd: has joined #ruby
[13:48:04] InternetFriend: has joined #ruby
[13:48:06] william3: has joined #ruby
[13:48:44] vdamewood: has joined #ruby
[13:53:16] aryaching: has joined #ruby
[13:53:33] makenoise: has joined #ruby
[13:56:03] ESpiney: has joined #ruby
[13:56:06] skade: has joined #ruby
[13:58:09] sudoubuntu: has joined #ruby
[13:58:29] asahi: has joined #ruby
[13:58:45] crystal77: has joined #ruby
[13:59:38] asahi: hello, I'm trying to upgrade my ruby to 2.2.4 but am getting this message BUILD FAILED (Ubuntu 14.04 using ruby-build 20160228-1-g5297dbc)
[13:59:58] asahi: I'm using rbenv
[14:03:39] ramortegui: has joined #ruby
[14:04:48] chouhoulis: has joined #ruby
[14:07:12] chouhoulis: has joined #ruby
[14:09:15] vasilakisfil_: has joined #ruby
[14:09:30] cdg: has joined #ruby
[14:09:53] cdg: has joined #ruby
[14:10:04] nocontrol: norc: I raised the clockwork to 10 seconds but it still fails. So it might be something else
[14:10:48] nocontrol: norc: could not obtain a connection from the pool within 5.000 seconds (waited 5.001 seconds); all pooled connections were in use but the pool is 10 and my clockwork frequency is 20 secons
[14:12:26] grn: has joined #ruby
[14:12:36] shanemcd: has joined #ruby
[14:13:12] malconis: has joined #ruby
[14:13:29] vondruch: has joined #ruby
[14:15:16] jaruga: has joined #ruby
[14:17:59] haylon: has joined #ruby
[14:18:00] alphaatom: has joined #ruby
[14:18:21] jmignault: has joined #ruby
[14:19:36] justbleed: has joined #ruby
[14:21:33] m0rph: has joined #ruby
[14:23:28] hxegon: has joined #ruby
[14:23:45] sgambino: has joined #ruby
[14:24:51] decoponio: has joined #ruby
[14:29:48] Macaveli: has joined #ruby
[14:30:36] jhack: has joined #ruby
[14:30:53] ralsh: has joined #ruby
[14:31:25] bronson: has joined #ruby
[14:31:29] kerunaru: has joined #ruby
[14:32:10] m0rph: has joined #ruby
[14:35:22] babblebre: has joined #ruby
[14:36:57] norc: nocontrol: How long are your jobs alive?
[14:37:13] fullofcaffeine: has joined #ruby
[14:38:31] emilkarl: has joined #ruby
[14:38:59] norc: nocontrol: Remember that ping configured like that might timeout after 4s.
[14:39:13] pawnbox: has joined #ruby
[14:39:18] norc: nocontrol: And I dont know what your queue looks like.
[14:39:40] nerium: has joined #ruby
[14:40:15] apeiros: "could not obtain a connection from the pool within 5.000 seconds" sounds like you're having threads which check out connections and don't return them
[14:40:23] apeiros: or that you have too many concurrent threads with a too small pool
[14:40:27] nocontrol: norc: well I added ActiveRecord::Base.connection.close before each iteration ends and it doesn't throw any more errors
[14:40:49] apeiros: pool size should be > number of concurrently active threads
[14:40:58] nocontrol: norc: but the strange thing is that it takes 1.2sec to ping and possibly 2-3 seconds to persist to the db
[14:41:19] norc: apeiros: Careful where you tread on, he has an abusive usage of sidekiq. :S
[14:41:29] nocontrol: norc: and I see things as done: 29.851 sec
[14:42:19] norc: nocontrol: Which brings us all the way back.
[14:42:37] nocontrol: apeiros: is it indeed abusive ?
[14:42:49] norc: nocontrol: Stop using this shell ping, stop using 255 concurrent processes.
[14:43:04] norc: Stop using sidekiq when you should be using whenever.
[14:43:10] shanemcd: has joined #ruby
[14:43:41] nocontrol: norc: regarding the shell ping, I've also tried nmap
[14:43:56] nocontrol: and I've used threads and processes
[14:44:02] norc: nocontrol: https://rubygems.org/gems/net-ping/versions/1.7.8
[14:44:11] norc: Do it in pure Ruby. Consider timeouts too.
[14:44:20] nocontrol: it shouldn't have a problem with 255 concurrent processes, it's not that much finally
[14:44:37] nocontrol: norc: the shell ping ends itself in 1 second
[14:44:51] nocontrol: whether the client replies back or not
[14:45:03] norc: nocontrol: Also on another thing:
[14:45:04] norc: host[1] == 0 ? true : false
[14:45:08] norc: Look at this carefully.
[14:45:26] DmitryBochkarev: has joined #ruby
[14:45:43] norc: If you have trouble seeing whats wrong there, you might want to stop for a second using so many complex pieces of Ruby.
[14:45:44] nocontrol: you're talking about 0 that could be mistakenly considered as nil ?
[14:46:32] nocontrol: I feel something's leaking
[14:46:49] nocontrol: that's why it throws errors and it takes so much time to end a job
[14:47:06] nachoman: has joined #ruby
[14:47:20] nocontrol: but I am also confused because apeiros said I am abusing sidekiq
[14:47:25] norc: No I said.
[14:47:34] apeiros: reading. how does it work.
[14:48:33] apeiros: I don't know whether your use of sidekiq is abusive. I didn't read the backlog (and don't have the time to). but norc certainly has experience and if I were you I'd listen to them.
[14:48:44] jhack: has joined #ruby
[14:49:01] Respek: has joined #ruby
[14:49:05] nocontrol: norc: it shouldn't have a problem with concurrent shell commands though except If it does somehow because of O/S limitations
[14:49:25] hxegon: has joined #ruby
[14:51:07] norc: nocontrol: Do me a favour and use threads with the net-ping gem.
[14:51:41] nocontrol: I will but tell me something first
[14:52:07] nocontrol: norc: why does this iteration work fine IF you run it from shell like ruby and not within rails ?
[14:52:38] nocontrol: If you run it by using ruby something.rb which iterates the pings (actually ping sweeps) then everything works fine
[14:52:57] nocontrol: so to exclude things first, I don't believe shell ping has anything to do here
[14:53:18] nocontrol: I am focusing between sidekiq workers and posgres connections
[14:53:29] norc: nocontrol: postgres is not your problem that much I can guarantee.
[14:53:48] nocontrol: which finally worked ok in terms of persisting stuff after I added ActiveRecord::Base.connection.close
[14:54:03] bmalum: has joined #ruby
[14:54:06] nocontrol: and means that the connections are leaking, staying open for some reason
[14:54:24] norc: nocontrol: The advantage you gain with threads for example, is that you can timeout the entire thread. That gives you hard limits so you will not exceed your connection pool size as easily.
[14:54:25] nocontrol: and jobs take a long time to end
[14:54:34] Xeago: has joined #ruby
[14:54:37] nocontrol: norc: nice hint
[14:54:39] norc: nocontrol: The connections are not leaking.
[14:55:27] norc: nocontrol: your jobs are just overlapping.
[14:55:37] rippa: has joined #ruby
[14:55:39] nocontrol: norc: what's the difference between threads and processes ? aren't they on a O/S level both ?
[14:55:39] jokester: has joined #ruby
[14:56:56] Hammy_Work: has joined #ruby
[14:57:21] apeiros: a thread shares the address space of the common process
[14:57:24] norc: nocontrol: Threads are very lightweight in comparison. They also share the same address space.
[14:57:43] apeiros: whether threads are an OS level construct depends on your runtime.
[14:58:12] imgoinhungry: has joined #ruby
[14:58:16] myntcake: has joined #ruby
[14:58:18] apeiros: mruby/cruby as of 1.9 has OS thread backed threads, but does its own scheduling.
[14:58:58] floatingpoint: has joined #ruby
[14:59:07] norc: nocontrol: Just keep in mind that threads require careful coding when working with shared resources *because* you are in the same address space.
[15:00:07] nocontrol: norc: https://github.com/chrisvel/networkify/blob/63e4ccea7e17035dcd9d97e51ca33d661c1dbc0c/app/services/networkify_service.rb
[15:00:17] nocontrol: norc: this is my previous attempt using threads
[15:00:28] yorickpeterse: The easiest way to use threads is to not share any mutable data
[15:00:29] nocontrol: take a look in line 24 If you want
[15:00:52] apeiros: if Node.where(ipaddress: node[0]) # that's always true
[15:00:59] yorickpeterse: https://github.com/chrisvel/networkify/blob/63e4ccea7e17035dcd9d97e51ca33d661c1dbc0c/app/services/networkify_service.rb#L33 this will race
[15:01:00] norc: nocontrol: First, Hash is not thread safe.
[15:01:24] norc: Ah. Beat me to it.
[15:01:34] yorickpeterse: also I remember something about backticks causing a stop-the-world so the threading might not help as much here
[15:01:56] norc: nocontrol: Also try to use Net::Ping::ICMP if you can. :)
[15:02:01] apeiros: yorickpeterse: what? I rather doubt that…
[15:02:04] yorickpeterse: threads.each { |t| t.join } can just be threads.each(&:join) but it's a small detail
[15:02:07] nocontrol: I am walking an advanced knowledge path here and I believe I should stop and read a bit more
[15:02:07] apeiros: backticks should be threadable IO
[15:02:20] yorickpeterse: apeiros: IIRC it uses fork or something, though I might be mixing it up with rbx
[15:02:33] yorickpeterse: and fork requires a STW while it's forking, but it's been a while
[15:03:00] apeiros: that's possible. but should only concern initiation.
[15:03:01] shanemcd: has joined #ruby
[15:03:03] Xeago: has joined #ruby
[15:03:11] adgtl: has joined #ruby
[15:03:12] apeiros: i.e. a long running backtick command should be threadable
[15:03:15] testuser123: has joined #ruby
[15:03:28] testuser123: why!!!!!!!!!!
[15:03:31] yorickpeterse: testuser123: because
[15:03:56] apeiros: testuser123: 42
[15:04:45] nocontrol: norc: so to close this discussion and don't bother you anymore do you suggest three things that I should look at ?
[15:05:00] nocontrol: norc: is Threads all I want ?
[15:05:03] adgtl: has joined #ruby
[15:05:06] testuser123: has left #ruby: ()
[15:05:21] unl0ckd: has joined #ruby
[15:06:12] unl0ckd: has joined #ruby
[15:06:22] norc: nocontrol: Use Net::Ping::ICMP as well.
[15:06:26] moeabdol: has joined #ruby
[15:06:38] nocontrol: norc: it needs root privileges
[15:06:43] asahi: has left #ruby: ()
[15:06:51] nocontrol: norc: I am trying to keep things simple
[15:07:16] nocontrol: norc: I tried nmap also which is great but it's too heavy for the usage I want
[15:07:23] InternetFriend: has joined #ruby
[15:07:49] norc: nocontrol: All you want is to do this every N seconds right?
[15:10:21] norc: nocontrol: I would then use Net::Ping::External instead - and make sure you specificy a timeout on that ping.
[15:10:22] allcentury: has joined #ruby
[15:10:31] norc: nocontrol: Replace the entire sidekiq/redis with just whenever
[15:10:40] norc: (whenever is just a fancy way of using cron)
[15:10:58] treehug88: has joined #ruby
[15:11:07] hxegon: has joined #ruby
[15:11:09] nocontrol: sidekiq is much stronger than cron
[15:11:21] norc: Do you really need a scalable high performance key/value store with a complex gem for asynchronous background processing?
[15:11:30] norc: I thought you just want to do the same job every n seconds.
[15:12:26] norc: sidekiq is not stronger, its for different problems.
[15:12:30] joonty: has joined #ruby
[15:12:45] vasilakisfil_: has joined #ruby
[15:13:37] poguez_: has joined #ruby
[15:14:06] volty: has joined #ruby
[15:14:12] nocontrol: norc: I've been using it in work for scheduling jobs so I feel like I know how it works
[15:14:23] nocontrol: or at least I did before speaking here !
[15:15:00] nocontrol: I could easily remove sidekiq and redis, I 'm just using tools "I believe" I knew
[15:15:02] x77686d: has joined #ruby
[15:15:21] asahi: has joined #ruby
[15:15:26] paul98: has joined #ruby
[15:15:28] norc: nocontrol: Lets say you have some computationally expensive task that is triggered from your users.
[15:15:56] paul98: hey, trying to install gem foodcrtic but get the following error, http://pastebin.centos.org/40676/ i've installed other gems ok just this one seems to be a issue.
[15:16:21] norc: nocontrol: That could drain your resources and if not done asynchronously would lead to a rather unresponsive website.
[15:16:51] norc: nocontrol: So these tasks are moved into background asynchronously. With only a preset amount of workers you limit the strain on your system resources.
[15:17:04] nocontrol: norc: understood
[15:17:14] norc: nocontrol: Its also great when you want for a specific thing to happen at a specific time.
[15:17:27] norc: nocontrol: Say a user unsubscribes at a given date - sidekiq helps you do this too.
[15:17:53] Infra-Red: has joined #ruby
[15:18:47] norc: nocontrol: For things that need to run periodically it is just oversized, and sidekiq will not make any guarantees that it will actually run at that time.
[15:19:13] nocontrol: and why is that? about guarantees ?
[15:19:20] nocontrol: it is supposed to be a professional tool
[15:19:29] norc: nocontrol: Because the queue might be filled with thousands of jobs.
[15:19:29] nocontrol: so I could wait more from it
[15:19:38] paul98: nvm sorted :)
[15:19:47] nocontrol: norc: sidekiq's queue ?
[15:19:56] norc: nocontrol: The redis list it works on, yes.
[15:20:09] vasilakisfil_: has joined #ruby
[15:21:33] nocontrol: norc: so you suggest to remove sidekiq/redis
[15:21:50] nocontrol: norc: but will I still have ActiveJobs ?
[15:21:59] jas02: has joined #ruby
[15:23:14] jottr: has joined #ruby
[15:25:15] B1n4r10: has joined #ruby
[15:27:03] podman: has joined #ruby
[15:27:46] eregi: has joined #ruby
[15:28:08] uglybandersnatch: has joined #ruby
[15:30:57] vikas027: has joined #ruby
[15:31:09] norc: nocontrol: why do you want activejob?
[15:31:18] vikas027: has left #ruby: ()
[15:31:23] nocontrol: because it's a job ?
[15:31:26] aegis3121: has joined #ruby
[15:31:30] norc: nocontrol: Just use whenever.
[15:31:41] norc: Seriously, you need to simplify things.
[15:32:09] nofacade: has joined #ruby
[15:32:25] norc: nocontrol: whenever, rails runner - that is all you need to make this happen.
[15:32:35] norc: nocontrol: Further assistance you can find in #rubyonrails - I gotta catch a train now.
[15:33:01] nocontrol: norc: I changed it back to threads with net-ping https://github.com/chrisvel/networkify/blob/master/app/services/networkify_service.rb
[15:33:29] norc: nocontrol: you need to protect your hash against mutual access with a mutex.
[15:34:00] mary5030: has joined #ruby
[15:34:04] norc: Anyway Im gone for an hour.
[15:34:14] vasilakisfil__: has joined #ruby
[15:34:14] dhollinger: has joined #ruby
[15:34:16] ss_much: has joined #ruby
[15:35:11] mary5030: has joined #ruby
[15:36:10] shanemcd: has joined #ruby
[15:36:28] nocontrol: norc: thank you
[15:38:09] kies^: has joined #ruby
[15:38:21] platzhirsch: has left #ruby: ()
[15:39:23] jeanlinux: has joined #ruby
[15:41:36] Internet1riend: has joined #ruby
[15:41:36] rdavila: has joined #ruby
[15:42:14] zast: has joined #ruby
[15:42:55] pandaant: has joined #ruby
[15:46:11] shanemcd: has joined #ruby
[15:49:45] Scott2619: has joined #ruby
[15:49:51] Scott2619: Hi Can somebody help me please
[15:50:04] Scott2619: I am trying to open 2 files one with keywords and one with a list of product numbers and descriptions
[15:50:14] Scott2619: I want to see if one of the keywords are in the descriptions
[15:50:21] Scott2619: I have done this so far
[15:50:21] Scott2619: https://gist.github.com/scott2619/9a8b0af0db5f628e2d52
[15:50:28] kalopsian: has joined #ruby
[15:50:42] Scott2619: but its not working as the description is always the same
[15:50:51] droidburgundy: has joined #ruby
[15:51:37] arup_r: has joined #ruby
[15:52:29] treehug88: has joined #ruby
[15:53:41] norc: has joined #ruby
[15:54:20] norc: has joined #ruby
[15:54:20] norc: has joined #ruby
[15:54:50] norc: ast>> "$2147483648"
[15:54:52] ruby[bot]: norc: I have parsed your code, the result is at https://eval.in/528850
[15:54:54] norc: asm>> "$2147483648"
[15:54:54] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/528851
[15:54:56] shinnya: has joined #ruby
[15:55:12] norc: asm>> $2147483648
[15:55:14] ruby[bot]: norc: I have disassembled your code, the result is at https://eval.in/528852
[15:55:15] norc: whops. :=
[15:55:30] norc: asm>> $2147483647
[15:55:38] norc: Silly timeouts. Nevermind this.
[15:56:06] blackmesa: has joined #ruby
[15:56:11] hogetaro_: has joined #ruby
[15:56:17] adgtl_: has joined #ruby
[15:56:22] makenoise: has joined #ruby
[15:56:40] norc: I dont even know how I can debug this. It just crashes with a Ruby exception and no stack trace. :S
[15:57:21] eljimmy: has joined #ruby
[15:57:33] norc: Mmm, well I think I nailed it down. Looks like it crashes during compilation.
[15:58:01] Scott2619: can anyone help or point me in the right direction please?
[16:00:30] baroquebobcat: has joined #ruby
[16:01:05] volty: Scott2619: something like this: IO.readlines('keywords.txt').map(&:chomp) && IO.readlines('prods.txt').map { |ln| ln[/\w+$/].split }
[16:01:17] b|ackwolf: what is the space convention in ruby zen?
[16:01:51] Ox0dea: Two spaces. No hard tabs. No exceptions.
[16:02:10] Sonja: has joined #ruby
[16:02:11] Aviio: has joined #ruby
[16:02:22] Scott2619: volty: I need it to print out the prnum of the line it matched also
[16:02:23] Sonja: i have a regex problem
[16:02:31] yorickpeterse: b|ackwolf: triangular
[16:02:41] Sonja: i'm trying to count the number of times vowels touch: http://i.imgur.com/hX4DAYB.png
[16:02:50] Sonja: i expected an array of 4 and of 2. but it gave me 4 and 1
[16:03:58] volty: Scott2619: that should solve your prob. as for the your code you test with include? instead of regexp. so do regex or convert to array.
[16:04:24] Sonja: let me try
[16:04:31] flughafen_: has joined #ruby
[16:04:39] volty: adding prnum, though it won't be a oneliner
[16:04:57] jaruga: has joined #ruby
[16:05:37] Scott2619: volty: that's find how do I add the prnum of the descripion it found?
[16:06:01] blackgoat: has joined #ruby
[16:06:11] malcolmva: has joined #ruby
[16:07:14] volty: go back to your code and instead if description.include? keyword do description =~ /\b#{keyword}/b/
[16:07:15] Scott2619: volty: fine*
[16:07:38] blackmesa: has joined #ruby
[16:07:51] neuraload: has joined #ruby
[16:09:00] eregi: has joined #ruby
[16:10:14] treehug88: has joined #ruby
[16:10:33] n008f4g_: has joined #ruby
[16:10:40] aegis3121: has joined #ruby
[16:11:45] Scott2619: volty: that doesn't work because description is always the same thing for some reason
[16:12:03] dionysus69: has joined #ruby
[16:12:20] adgtl: has joined #ruby
[16:13:06] tvw: has joined #ruby
[16:14:02] jimeh_: has joined #ruby
[16:14:05] knowtheory_: has joined #ruby
[16:14:05] ckrailo_: has joined #ruby
[16:14:16] Aviio_: has joined #ruby
[16:14:20] deepak___: has joined #ruby
[16:14:37] artmann_: has joined #ruby
[16:15:01] _whitelogger_: has joined #ruby
[16:15:10] Ox0dea: Scott2619: https://eval.in/528853
[16:15:14] voker57_: has joined #ruby
[16:15:16] Ox0dea: Something like that, anyway.
[16:15:19] ddfreyne_: has joined #ruby
[16:15:20] kalleth_: has joined #ruby
[16:15:35] kellabyte: has joined #ruby
[16:15:37] cookiez: has joined #ruby
[16:15:37] modin: has joined #ruby
[16:15:37] Eleeleth: has joined #ruby
[16:15:39] kellabyte: has joined #ruby
[16:15:39] Apocalyp-: has joined #ruby
[16:15:40] ohcibi_: has joined #ruby
[16:15:43] kellabyte: has joined #ruby
[16:15:43] techietrash_: has joined #ruby
[16:15:43] Eleeleth: has joined #ruby
[16:15:49] sgambino: has joined #ruby
[16:16:22] adgtl: Is this correct way to spawn million threads in Ruby https://gist.github.com/2a07d5dd5a9ac727d8d4 ?
[16:16:32] johnny56: has joined #ruby
[16:16:45] shanemcd: has joined #ruby
[16:16:52] apeiros: I'd use Array.new
[16:16:55] adgtl: I am trying to run something similar as here https://gist.github.com/51e34e6c5feaa1e79b9c
[16:17:05] crayfishx: has joined #ruby
[16:17:08] Mekkis_: has joined #ruby
[16:17:08] apeiros: and I'd also wonder why I'd have to spawn a million thread. as that almost certainly makes little to no sense.
[16:17:09] adgtl: apeiros: it never completes
[16:17:21] apeiros: it's quite possible that your OS says "no".
[16:17:25] adgtl: I have to reduce million number to like 10000, then yes
[16:17:42] apeiros: you'll have to set the limits of your OS appropriately. if it even allows limits that high.
[16:17:55] adgtl: apeiros: just POC.. wanted to know whether OS allows Ruby to spawn million threads
[16:18:14] adgtl: apeiros: on erlang, yes, it allows me to run million processes at once
[16:18:14] apeiros: well, I guess you've gotten an answer to your question?
[16:18:16] kapowaz: has joined #ruby
[16:18:27] apeiros: erlang doesn't use OS backed threads for its processes.
[16:18:33] adgtl: apeiros: nope.. wondering.. what's major difference there
[16:19:22] Scott2619: 0x0dea: thanks that works what is the first line doing? I have never seen it before?
[16:19:36] adgtl: apeiros: so you mean.. Ruby's threads are OS backed threads?
[16:19:54] jeanlinux: has joined #ruby
[16:19:54] apeiros: reading… how does it work. really, what's up today?
[16:20:01] apeiros: adgtl: read the backlog. I don't like to repeat myself.
[16:20:18] jevs: has joined #ruby
[16:20:18] the-undefined_: has joined #ruby
[16:20:36] Infra-Red: has joined #ruby
[16:21:09] jeanlinux: has joined #ruby
[16:21:14] adaedra: apeiros: reading is so 20th century.
[16:21:25] apeiros: yeah. 2016 is the year of the goldfish.
[16:21:46] ramblinpeck: has joined #ruby
[16:22:47] apeiros: »<<„°>
[16:23:30] arup_r: One more question, I didn't able to answer.. is "Give an example of a Ruby data type that is not normally thought of as an object, but supports the true statement "Everything in Ruby is an object." Accept that it's a true statement and support it with an example and remember case-sensitivity."
[16:23:34] arup_r: what should it be?
[16:23:39] arup_r: I need to know for future
[16:24:01] arup_r: I know the answr as `block` .. but the question i didn't get
[16:24:09] apeiros: "not normally". I guess I'm not in the target audience.
[16:24:13] evidex: has joined #ruby
[16:24:19] apeiros: a block ain't an object. not even in ruby.
[16:24:23] jeanlinux: has joined #ruby
[16:24:26] symm-: has joined #ruby
[16:24:44] apeiros: you can turn a block into an object using &blockarg syntax. but then it becomes a Proc.
[16:25:02] apeiros: ACTION master pedant in training
[16:25:16] Ox0dea: I suspect that's the case-sensitivity they had in mind.
[16:25:22] Ox0dea: There's no Block class, for instance.
[16:25:23] arup_r: apeiros: you are in target audience .. haha
[16:25:41] arup_r: yeah, so what should be the reasoning.. ? That's why I was confused..
[16:25:44] jaruga: has joined #ruby
[16:25:49] tjohnson: has joined #ruby
[16:26:24] apeiros: every object can be used in conditional statements. every object is true-ish except nil & false. no idea which one they think is not normally thought of as an object.
[16:26:39] apeiros: a common mistake is to think 0, "", [] and/or {} are false-ish
[16:26:56] Ox0dea: arup_r: After some though, I bet they want you to focus on methods.
[16:27:04] volty: they are just nullish & emptish :)
[16:27:24] apeiros: and given some languages don't have numbers as proper objects, my guess would probably have been 0
[16:27:37] apeiros: but seriously, that question IMO sucks because it's highly subjective.
[16:27:46] htmldrum: has joined #ruby
[16:28:00] Ox0dea: It's really not, though; they're either looking for the difference between "block" and "Proc" or "method" and "Method".
[16:28:09] apeiros: oh wait, "datatype". well… then numbers are probably not what they're looking for as those are used in most languages for conditionals.
[16:28:25] apeiros: Ox0dea: how do you figure?
[16:28:37] Ox0dea: apeiros: It feels like I'm applying common sense?
[16:29:21] mjc_: has joined #ruby
[16:29:22] apeiros: IMO it makes little sense. but well, what do I know by which logic they consider something as "not normally considered an object".
[16:29:58] Ox0dea: Oh, yes, I see whence you're coming now; I guess they probably do have Fixnum and the like in mind.
[16:30:01] antgel: has joined #ruby
[16:30:04] apeiros: also I'm troubled by "supports the true statement" - what precisely is that supposed to mean? "is true-ish" is what I interpreted it as.
[16:30:26] volty: >> nil.nil? "true-ish" : "false-ish"
[16:30:27] ruby[bot]: volty: # => /tmp/execpad-a18f347accef/source-a18f347accef:2: syntax error, unexpected ':', expecting keyword_end ...check link for more (https://eval.in/528865)
[16:30:34] Ox0dea: Well done.
[16:30:38] volty: >> nil.nil? ? "true-ish" : "false-ish"
[16:30:40] ruby[bot]: volty: # => "true-ish" (https://eval.in/528866)
[16:31:10] jeanlinux: has joined #ruby
[16:32:13] apeiros: eh, I'll remain at "this question sucks because subjective"
[16:32:40] volty: I didn't quite followed. going to try to catch up
[16:32:40] apeiros: next question probably is whether lambdas or procs are better.
[16:32:53] diegoviola: has joined #ruby
[16:33:23] bronson: has joined #ruby
[16:34:39] baroquebobcat: has joined #ruby
[16:34:52] Mattx: has joined #ruby
[16:35:01] hamed_r: has joined #ruby
[16:35:05] Mattx: Hey guys! How do I print a Time in a different time zone?
[16:35:22] jeanlinux: has joined #ruby
[16:35:51] volty: "not normally considered an object", I hate these vague quantifiers. Or considered, or not considered. If there's normally, there should be also abnormally.
[16:36:04] Mattx: I want something like this, Time.parse("2016-03-02 13:31:06 -0300").to_zone "+5"
[16:36:09] volty: s/should be/must be/
[16:36:58] apeiros: Ox0dea: method/proc might fit the bill. it just feels pointless to think about them in a context related to conditions. assuming "supports true statement" is really "is true-ish"
[16:37:13] kies^: has joined #ruby
[16:37:52] volty: "supports the true statement" does not has sense. "supports the frog's singing" could do well as well
[16:38:03] rodolfowtf: has joined #ruby
[16:38:27] volty: subject, object, verb action. Who 'supports'?
[16:39:53] heyimwill: has joined #ruby
[16:40:09] volty: apeiros: on what are your comments? which source/text?
[16:42:24] m0rph: has joined #ruby
[16:42:42] m0rph: has left #ruby: ()
[16:43:11] IrishGringo: has joined #ruby
[16:43:21] Infra-Red: has joined #ruby
[16:43:44] Ox0dea: apeiros: Hm? I don't see how conditionals come into it.
[16:43:48] cpup: has joined #ruby
[16:45:06] rodolfowtf: has joined #ruby
[16:45:21] volty: could you be so kind and put a line about what's the topic/context ? (I apologize but really not sure if I am too tired | fuzzy)
[16:45:28] arup_r: One more question: There are (at least) three different variations in the syntax for defining the when clauses of a case statement. (yes/no) .. I said no and it is wrong. lol .
[16:47:08] adgtl: Ruby threads are not OS threads, then why there is limit to number of threads it can run at at time?
[16:47:54] yorickpeterse: Ruby threads _are_ OS threads
[16:47:55] eam: adgtl: ruby threads are OS threads
[16:48:02] volty: could be ruby's own limit. have you found the upper limit?
[16:48:05] eam: at least, on modern rubies
[16:48:34] yorickpeterse: The limit is there because of the Global Interpreter Lock
[16:48:48] volty: as I thought
[16:48:50] yorickpeterse: which exists to prevent shitty C code from wrecking everything
[16:49:02] ljames: what's the simplest way to enumerate through an Array, finding an element that meets a condition and get its index, followed by performing a second test starting the found index until the test succeeds and then stopping, returning a second index? optionally, drop items between those 2 indexes from the array. is there a simple way of doing this, or should I just each_with_index?
[16:49:08] eam: yorickpeterse: ruby has a limit? that's kinda odd
[16:49:22] yorickpeterse: eam: There's not a limit in the number of threads you can start
[16:49:31] yorickpeterse: However MRI can only run 1 Ruby thread at a time
[16:49:35] eam: oh, sure
[16:49:44] adaedra: ljames: should be doable combining some Array#index
[16:49:44] aegis3121: ljames http://docs.ruby-lang.org/en/2.0.0/Array.html#method-i-find_index ?
[16:50:01] Ox0dea: ljames: Perhaps you want the flip-flop operator?
[16:50:11] eam: I think adgtl is actually running into OS thread limits (NPROC and the like)
[16:50:13] aegis3121: First index, then a slice from there to the end to find the second?
[16:50:26] ljames: thanks adaedra, aegis3121. and flip flop might jsut work for it, thanks Ox0dea, will try
[16:50:31] eam: erlang doesn't actually use threads
[16:51:26] adgtl: has joined #ruby
[16:51:26] adgtl: has joined #ruby
[16:51:26] adaedra: Ox0dea: haha, I was looking for this one the other day but couldn't remember the name, thanks
[16:52:06] _whitelogger: has joined #ruby
[16:52:10] apeiros: Ox0dea: "which support the true statement"
[16:52:39] ljames: flip flop might just be the most elegant way to do this, thanks
[16:52:40] Ox0dea: apeiros: That's in reference to the statement that immediately follows about everything being an object in Ruby.
[16:53:33] apeiros: Ox0dea: ooooh dear
[16:54:23] apeiros: is this just me as a non-native speaker or is that question awfully phrased?
[16:54:23] volty: me too, finally - behind arup_r's comments
[16:54:50] apeiros: Ox0dea: in that case, I'd throw in Class/Module into the mix. similarly uncommon as proper objects.
[16:54:54] krasnus: has joined #ruby
[16:55:00] volty: neither Ox0dea is infallible :)
[16:55:29] Ox0dea: apeiros: I do concede that it's a shitty question, but it does strike me as pretty obvious that they're referring to numbers being objects in Ruby.
[16:55:36] the_drow: has joined #ruby
[16:55:39] apeiros: so IMO all datatypes which are primitives in other languages (true/false/nil/fixnum), and all datatypes which are not commonly objects (class/module/method/proc) are eligible
[16:56:12] Ox0dea: Sure, but that the question explicitly mentions case-sensitivity seems like they're after the difference between, say, "integer" and "Integer".
[16:56:35] augcesar: has joined #ruby
[16:57:29] arup_r: I am way too confused.. :)
[16:57:34] apeiros: I assumed that they referred to the answer being case sensitive. which would probably apply to all class names.
[16:57:37] arup_r: but thanks to all
[16:58:14] arup_r: I was checking why I got negetatives... and thought to ask you also if you understand what they asked me..
[16:58:36] naftilos76: has joined #ruby
[16:58:57] Ox0dea: The questions you're being given are open to interpretation, and yet they want concrete answers.
[16:59:04] Ox0dea: It's like MyMathLab for Ruby. :(
[16:59:20] asahi: has left #ruby: ()
[16:59:23] hogetaro: has joined #ruby
[17:00:07] volty: a 'shortcut' for Array#include?, something operator-like ?
[17:00:27] diegoviola: has joined #ruby
[17:01:35] paul98_: has joined #ruby
[17:02:31] nando293921: has joined #ruby
[17:03:01] apeiros: eam: told adgtl actually already. another OS limit for ruby threads are afaik filehandles (not sure, iirc it's either 1 or 2 handles per thread)
[17:03:34] Ox0dea: volty: Nope. In the past, people have tried to get an `in` operator like Python's, but it's never come to fruition.
[17:03:36] apeiros: volty: nope. not in standard ruby.
[17:03:37] htmldrum: has joined #ruby
[17:03:45] shanemcd: has joined #ruby
[17:04:05] Ox0dea: volty: ActiveSupport provides Object#in?, but I think it's ugly.
[17:04:12] volty: pity, thx.
[17:04:23] apeiros: given that in? has to always delegate, it's IMO an anti-pattern.
[17:04:35] volty: Ox0dea: I'm far away from Active, and will stay so for a while
[17:05:08] Ox0dea: volty: There are plenty of diamonds in that rough. :P
[17:05:37] arup_r: has left #ruby: ()
[17:05:57] volty: where diamonds there are too many light paths :)
[17:06:01] evenix: has joined #ruby
[17:06:12] evenix: weird.. how come I'm getting a unexpected tLABEL error on jruby 1.7.12 ruby 1.9.3
[17:06:23] evenix: I thought tLABEL error were fixed from 1.9.2 to 1.9.3
[17:06:59] eam: apeiros: yeah. With 1m threads he's going to at least run into pid_max limits -- as that's generally set to 65k or so
[17:07:19] Hanmac: has joined #ruby
[17:07:22] eam: tid is limited by pid_max
[17:07:41] amclain: has joined #ruby
[17:08:44] eam: "why aren't my pids ever more than 5 digits wide" etc
[17:09:03] KensoDev: has joined #ruby
[17:10:39] marxarelli: has joined #ruby
[17:10:45] apeiros: eam: interesting. good to know.
[17:11:08] jottr_: has joined #ruby
[17:11:19] apeiros: evenix: do you expect an answer from the info you've given?
[17:11:41] momomomomo: has joined #ruby
[17:11:41] stannard: has joined #ruby
[17:12:13] evenix: apeiros: what additional information do you need?
[17:12:34] evenix: I made it pretty straightfoward
[17:12:44] evenix: what's a tLabel? e.g: def get_user_profile(user_id, fields: nil, quota_user: nil, user_ip: nil, options: nil, &block)
[17:12:56] rodfersou|lunch: has joined #ruby
[17:12:57] evenix: what error I'm getting? syntax error, unexpected tLABEL
[17:13:07] evenix: what else can I add @apeiros feel free to share
[17:13:29] evenix: because I don't see what else you expect my answer to have
[17:13:39] evenix: question*
[17:13:55] [Butch]: has joined #ruby
[17:14:03] idefine: has joined #ruby
[17:14:16] Ox0dea: evenix: The interpreter you're using doesn't support keyword arguments.
[17:15:10] Uber|Dragon: has joined #ruby
[17:15:19] B1n4r10: has joined #ruby
[17:15:27] evenix: 0x0dea: Thanks. You mean my version of jruby? I looked into it and it seem that jruby 1.7.12 using >=1.9.3 is supposed to have an update that fixes it :/
[17:15:36] benlieb: has joined #ruby
[17:16:20] eregi: has joined #ruby
[17:16:29] evenix: Maybe I can try to update the ruby -v of my interpreter? .. it seem that the app was set to use 1.9.3
[17:16:39] Ox0dea: evenix: Keyword arguments is a 2.0+ thing.
[17:17:19] apeiros: evenix: with syntax errors? always code.
[17:17:26] apeiros: but I see you & Ox0dea already figured
[17:17:44] evenix: Ox0dea: Ok thanks.
[17:18:06] evenix: apeiros: yes thx
[17:19:57] niksrc: has joined #ruby
[17:20:20] Rodya_: has joined #ruby
[17:21:28] rodolfowtf: has joined #ruby
[17:22:39] Gasher: has joined #ruby
[17:22:56] fullofca_: has joined #ruby
[17:23:14] Ishido: has joined #ruby
[17:25:17] justbleed: has joined #ruby
[17:25:40] shanemcd: has joined #ruby
[17:27:43] morbid_ape: has joined #ruby
[17:27:47] morbid_ape: hi everyone burn all jews in oven
[17:27:49] morbid_ape: death to infidels
[17:27:54] havenwood: !troll morbid_ape
[17:27:54] ruby[bot]: +bb morbid_ape!*@*$#ruby-banned *!*@85-76-140-22-nat.elisa-mobile.fi$#ruby-banned
[17:27:54] ruby[bot]: ruby[bot] kicked morbid_ape: is a bannable offense, see http://ruby-community.com/pages/user_rules
[17:27:56] ruby[bot]: -bb $a:hiter_loves_ruby$#ruby-banned RaeCarruth!*@*$#ruby-banned
[17:29:58] baweaver: has joined #ruby
[17:31:33] Morrolan: has joined #ruby
[17:33:40] Aviio_: oh wow, im super trolled right now
[17:33:58] JohnBat26: has joined #ruby
[17:33:59] Ox0dea: Aviio_: Did the bad man rustle your Jonathans?
[17:35:32] baroquebobcat: has joined #ruby
[17:35:53] Aviio: has joined #ruby
[17:36:07] Aviio: Super rustled
[17:36:14] Aviio: I thought this was a safe space
[17:36:18] Aviio: [Triggered]
[17:36:20] makenoise: has joined #ruby
[17:38:19] krobzaur: has joined #ruby
[17:38:29] baroquebobcat: has joined #ruby
[17:39:42] Ishido: has joined #ruby
[17:42:09] adaedra: Aviio: it's ok, it's gone now
[17:45:17] shanemcd: has joined #ruby
[17:45:24] hiljusti: has joined #ruby
[17:45:48] Ishido: has joined #ruby
[17:45:56] shanemcd: has joined #ruby
[17:46:42] momomomomo: has joined #ruby
[17:47:42] troulouliou_div2: has joined #ruby
[17:48:01] rodfersou: has joined #ruby
[17:48:12] m0rph: has joined #ruby
[17:48:45] malconis: has joined #ruby
[17:48:51] crystal77: has joined #ruby
[17:49:00] blandflakes: has joined #ruby
[17:49:23] m0rph: has left #ruby: ()
[17:51:17] nando293921: has joined #ruby
[17:53:46] DexterLB: has joined #ruby
[17:53:58] B4daBing73: has joined #ruby
[17:54:42] aclearman037: has joined #ruby
[17:55:07] Oog: has joined #ruby
[18:01:21] humblespoon: has joined #ruby
[18:01:31] humblespoon: I'm trying to initialize some instance variables but I'm not sure what I'm doing wrong. They are coming out nil https://eval.in/528915
[18:02:28] JohnBat26: has joined #ruby
[18:03:12] gizmore: has joined #ruby
[18:03:36] thevaliantx: has joined #ruby
[18:04:31] dhollin3: has joined #ruby
[18:04:51] firstdayonthejob: has joined #ruby
[18:05:23] ddv: humblespoon, because in_words is an instance method
[18:05:40] jxs_: has joined #ruby
[18:05:48] ddv: humblespoon, you are not creating an instance
[18:05:55] norc: has joined #ruby
[18:05:58] kgirthofer: has joined #ruby
[18:06:02] norc: Ox0dea, are you around?
[18:06:25] Ox0dea: norc: I am. What news?
[18:06:27] humblespoon: ddv: oooohhh. Ok I think I see what you mean
[18:06:31] stannard: has joined #ruby
[18:06:51] kgirthofer: hey all - I'm updating an old gem on a new machine, and I went t hrough and updated all the names and everything, and now when I run gem build gem_name.gemspec it is erroring out that it cant find the old named items... where am I missing?
[18:07:13] _whitelogger: has joined #ruby
[18:07:31] kgirthofer: While executing gem ... (Gem::InvalidSpecificationException)
[18:07:31] kgirthofer: ["lib/old_gem_name/chef.rb", "lib/old_gem_name/chef/version.rb",
[18:07:41] norc: Ox0dea, I just found the time to debug the NREF bug (when $n with n > (2**30 + x)) and would like you to take a quick glance at my conclusion.
[18:07:42] deuxclique: has joined #ruby
[18:07:53] atomical: has joined #ruby
[18:07:54] kgirthofer: and that's after I moved them from lib/old_gem_name to lib/new_gem_name
[18:08:02] Ox0dea: norc: What's the bug? I couldn't get it to cause a crash.
[18:08:06] stannard: has joined #ruby
[18:09:25] dougsko: has joined #ruby
[18:09:47] Ox0dea: kgirthofer: You've got stale files still in git.
[18:09:51] deuxclique: has joined #ruby
[18:10:05] norc: Ox0dea, let me find the most generic way to provoke this error.
[18:10:26] pdoherty: has joined #ruby
[18:11:29] Ox0dea: norc: It only ever causes the parser to emit a warning, as best I can tell.
[18:11:45] norc: Ox0dea, screw it. Just execute $1073741824
[18:11:49] douglascorrea: has joined #ruby
[18:11:51] norc: Ox0dea, what architecture are you on?
[18:12:02] norc: MRI 2.3.0 ?
[18:12:05] norc: OSX/Linux?
[18:12:06] vikas027: has joined #ruby
[18:12:12] Ox0dea: Hey, yeah, that is an error.
[18:12:20] deuxclique: has joined #ruby
[18:13:01] amargherio: has joined #ruby
[18:13:26] norc: Ox0dea, https://github.com/ruby/ruby/blob/trunk/numeric.c#L2377-L2381
[18:13:38] norc: this is basically what triggers the error (and why you dont get to see a stack trace)
[18:13:39] binaryplease: has joined #ruby
[18:13:44] norc: It happens during compilation at
[18:14:24] vikas027: has left #ruby: ()
[18:14:37] norc: https://github.com/ruby/ruby/blob/v2_3_0/compile.c#L1651
[18:15:52] Ox0dea: norc: It can't be rescued...
[18:16:02] jeanlinux: has joined #ruby
[18:16:40] norc: Ox0dea, remember that this is still during compilation so things tend to be fatal there.
[18:16:46] Ox0dea: https://git.io/v2Dwn
[18:16:52] norc: Ox0dea, as far as I can tell is that https://github.com/ruby/ruby/blob/trunk/parse.y#L7814 this is just wrong.
[18:17:19] norc: Simply because the N of your reference gets lshifted twice.
[18:17:25] norc: before being passed to FIX2INT
[18:17:39] vdamewood: has joined #ruby
[18:17:41] norc: or rather it gets lshifted already before being passed.
[18:18:36] Ox0dea: norc: Gotta love the comment.
[18:18:44] Ox0dea: You can tell they were like, "Should we even bother?"
[18:18:47] atmosx: has joined #ruby
[18:19:28] norc: I was actually surprised to find a comment at all.
[18:19:40] Ox0dea: It does look like some architectures are getting snubbed.
[18:19:51] Ox0dea: They only have access to half as many numeric variables as they ought to.
[18:20:06] dougsko: anyone have experience with the parallel gem? im trying to get a simple cummulative sum working but i keep getting the wrong answer. this example demonsrtates the problem: https://gist.github.com/anonymous/021b1d3cc9509b8d8c14
[18:20:36] kalopsian: has joined #ruby
[18:21:07] norc: Ox0dea, most annoying part was figuring out which damn code actually raised that error
[18:21:24] shanemcd: has joined #ruby
[18:21:27] joonty: has joined #ruby
[18:21:29] shadoi: has joined #ruby
[18:21:30] Ox0dea: norc: That damned "%s" for "big" and "small".
[18:21:41] Blaguvest: has joined #ruby
[18:22:14] norc: Ox0dea, indeed. I was staring at my damn screen for like 5 minutes when I could not find the "too small to converto to `int'" string
[18:22:54] norc: But plenty such strings for other types like unsigned int and what not.
[18:23:03] eric2: has joined #ruby
[18:23:14] spider-mario: has joined #ruby
[18:23:32] skade: has joined #ruby
[18:24:02] norc: Ox0dea, considering the "do as others do" this significantly lowers the bar for contributors though. "Do whatever you fancy, and use macros. Lots of macros"
[18:24:09] jeanlinux: has joined #ruby
[18:24:32] Ox0dea: norc: And mix tabs and spaces however the guy before you did. :(
[18:24:50] norc: set ts=8
[18:24:51] norc: and be done
[18:25:46] norc: Ox0dea, I loved whitespace mixing in Python. Had one nasty one that actually parsed and executed without an error - except the behavior was just completely buggy.
[18:26:11] Ox0dea: norc: I could swear the Ruby source files used to contain modelines.
[18:26:30] xMopxShell: has joined #ruby
[18:27:38] norc: Ox0dea - Im guessing the reason you do not see any is emacs users. They keep deleting vim modelines for giggles, and vim users do the same for emacs modelines.
[18:27:54] Ox0dea: norc: Ha. That'd certainly do it.
[18:28:04] elifoster: has joined #ruby
[18:29:14] norc: ACTION wishes Ruby had MSVC project files
[18:29:23] norc: Perhaps with QMake!
[18:29:41] djbkd: has joined #ruby
[18:30:56] norc: kgirthofer, have you committed the rename change to git?
[18:31:41] norc: ACTION is just guessing that you used the bundle template that uses `git ls-files' for spec.files
[18:32:21] norc: kgirthofer, of course sharing the gemspec would be the best
[18:33:09] openstruct: has joined #ruby
[18:33:24] Rodya_: has joined #ruby
[18:33:52] AlexRussia: has joined #ruby
[18:34:54] vdamewood: has joined #ruby
[18:34:56] dionysus69: has joined #ruby
[18:35:25] bronson: has joined #ruby
[18:35:40] rodolfowtf: has joined #ruby
[18:36:09] douglascorrea: has joined #ruby
[18:36:36] ShellFu: has joined #ruby
[18:37:31] rodolfowtf: has joined #ruby
[18:38:39] baweaver: has joined #ruby
[18:39:31] rodolfowtf: has joined #ruby
[18:40:54] ReK2: has joined #ruby
[18:41:07] rodolfowtf: has joined #ruby
[18:41:34] Infra-Red: has joined #ruby
[18:41:50] blackmesa: has joined #ruby
[18:42:55] tao_: has joined #ruby
[18:43:56] cassioscabral: has joined #ruby
[18:45:07] kuroro: has left #ruby: ()
[18:45:07] damonkelley: has joined #ruby
[18:45:21] jeanlinux: has joined #ruby
[18:45:36] ShellFu: Question, in trying to stick with single responsibility I am trying to determine the following: In a method that queries a database, the query hits many tables. Should the query be broken into small methods like, fetch_user, fetch_id, and assemble in ruby? Granted the method as it stands only performs a query. However, I am trying to determine where to draw the line.
[18:46:20] rodolfowtf: has joined #ruby
[18:47:04] [Butch]: has joined #ruby
[18:47:52] Timberwo|f: has joined #ruby
[18:47:55] apeiros: shellfu: depends on the details. but usually it's not a problem to write an sql query touching multiple tables.
[18:48:12] apeiros: and if it's a common case, you can abstract the multiple tables away by using db views.
[18:48:20] dlitvak: has joined #ruby
[18:48:33] rodolfowtf: has joined #ruby
[18:49:29] sneakerhax: has joined #ruby
[18:50:03] fullofcaffeine: has joined #ruby
[18:50:04] rodolfowtf: has joined #ruby
[18:50:16] norc: shellfu, personally I dislike having to deal with databases at all when writing Ruby code unless I absolutely cannot avoid it - so I always opt for an ORM to deal with the pain for me.
[18:50:48] hiljusti: has joined #ruby
[18:50:58] ShellFu: So single responsibility is still considered unbroken so long as the method only executes the query, and I'm parsing elsewhere. Ok cool. I just wanted to know where to call it good, as if I broke the query up I risk running a class over too many lines.
[18:51:44] htmldrum: has joined #ruby
[18:51:50] ShellFu: Yeah I am trying to do away with this piece of the puzzle, but until this database is deprecated I cannot. I will look into ORMs per your suggestion. I just can assemble a query pretty quickly, but perhaps that is me being lazy.
[18:52:01] shanemcd: has joined #ruby
[18:52:27] openstruct: Speaking of DB views - this gem is golden for versioning them, https://github.com/thoughtbot/scenic
[18:53:11] freerobby: has joined #ruby
[18:53:21] kalopsian: has joined #ruby
[18:53:32] hxegon: has joined #ruby
[18:53:53] hahuang61: has joined #ruby
[18:54:31] kgirthofer: norc, thanks that was it - git.
[18:54:38] kgirthofer: didn't think about that - appreciated
[18:55:20] sp4rrow: has joined #ruby
[18:57:43] bronson: has joined #ruby
[18:57:48] sp4rrow: has joined #ruby
[18:58:04] Mattx: Hey guys! How do I print a Time in a different time zone?
[18:58:07] Mattx: I want something like this, Time.parse("2016-03-02 13:31:06 -0300").to_zone "+5"
[18:58:13] troulouliou_div2: has joined #ruby
[18:58:15] Mattx: Or whatever else equivalent to this
[19:00:27] openstruct: Time.new(2002, 10, 31, 2, 2, 2, "+02:00") #=> 2002-10-31 02:02:02 +0200
[19:00:31] DroidBur_: has joined #ruby
[19:01:00] shanemcd: has joined #ruby
[19:01:22] openstruct: Or something like: Time.utc(2000,"jan",1,20,15,1) #=> 2000-01-01 20:15:01 UTC
[19:01:46] inukshuk_: has joined #ruby
[19:02:12] openstruct: The documentation for Time is pretty thorough.
[19:02:47] drbrain: Mattx: use https://rubygems.org/gems/tzinfo
[19:02:56] sarlalia1: has joined #ruby
[19:03:05] openstruct: Why use a gem when Ruby can do it?
[19:03:09] drbrain: Time can convert from ENV['TZ'] to UTC
[19:03:17] drbrain: it can't convert to arbitrary time zones in a safe way
[19:03:46] openstruct: Gotcha - I've only ever converted to UTC.
[19:03:58] binaryplease1: has joined #ruby
[19:04:18] drbrain: If you're OK with setting ENV['TZ'] to the time zone you need then ruby can do it
[19:04:29] nullwarp: has joined #ruby
[19:04:38] binaryplease1: has joined #ruby
[19:05:20] y2mq37: has joined #ruby
[19:06:46] shanemcd: has joined #ruby
[19:06:54] B1n4r10: has joined #ruby
[19:07:19] blackmesa: has joined #ruby
[19:07:32] nettoweb: has joined #ruby
[19:08:37] baweaver: has joined #ruby
[19:08:53] jenrzzz: has joined #ruby
[19:09:40] blandflakes: has joined #ruby
[19:10:01] spider-mario: has joined #ruby
[19:11:25] PlasmaStar: has joined #ruby
[19:11:34] ur5us: has joined #ruby
[19:12:30] nullwarp: has joined #ruby
[19:14:05] joonty: has joined #ruby
[19:14:36] Guest34101: has joined #ruby
[19:14:41] pawnbox: has joined #ruby
[19:15:25] relic: has joined #ruby
[19:15:56] Dimik: has joined #ruby
[19:16:16] relic: well.....this is boring
[19:17:00] pawnbox: has joined #ruby
[19:17:02] Uber|Dragon: I guess everyone is happyily testing
[19:17:10] drbrain: or deploying
[19:17:54] sarlalia1: has left #ruby: ("WeeChat 0.4.2")
[19:19:11] jenrzzz: has joined #ruby
[19:23:05] Infra-Red: has joined #ruby
[19:23:24] codecop: has joined #ruby
[19:25:00] BtcBen: has joined #ruby
[19:25:26] ramfjord: has joined #ruby
[19:26:54] Infra-Red: has joined #ruby
[19:27:33] relic: has joined #ruby
[19:27:44] norc: Uber|Dragon, I wish I could even test this damn library Im writing. :(
[19:28:21] relic: whats it for?
[19:29:23] norc: relic, it interfaces with telco equipment to do magic.
[19:29:41] anisha: has joined #ruby
[19:30:25] norc: And I think I need to rewrite some parts of it to make mocking even possible.
[19:30:29] sp4rrow: has joined #ruby
[19:31:01] snockerton: has joined #ruby
[19:32:11] snockerton: anyone know if it's possible to set pry-remote binding IP to something other than 127.0.0.1 so it's truly remote?
[19:32:40] fullofcaffeine: has joined #ruby
[19:32:42] s2013: has joined #ruby
[19:33:05] norc: snockerton, from the looks of it just pass a different host/port to remote_pry?
[19:33:49] jenrzzz_: has joined #ruby
[19:33:52] Es0teric: has joined #ruby
[19:34:05] norc: snockerton, https://github.com/Mon-Ouie/pry-remote/blob/master/lib/pry-remote.rb#L373-L375
[19:34:30] drbrain: snockerton: looks like --server=
[19:34:32] pdoherty: has joined #ruby
[19:34:34] bronson: has joined #ruby
[19:34:44] drbrain: --help should show it
[19:35:22] snockerton: yea i saw the --help
[19:35:25] snockerton: for the client
[19:35:27] binaryplease1: has joined #ruby
[19:35:32] b|ackwolf: has joined #ruby
[19:35:51] snockerton: but binding.remote_pry in my code needs an arg or something
[19:35:59] norc: snockerton, look at the link I showed you...
[19:36:02] norc: ACTION sighs
[19:36:05] snockerton: yea trying that
[19:36:16] snockerton: just noticed it was a Server object
[19:36:41] norc: snockerton, and technically its object.remote_pry (as you can see the method is defined on class Object)
[19:37:03] norc: Which might be important to notice since you can just pry into objects directly too.
[19:37:38] snockerton: ah interesting
[19:41:15] Infra-Red: has joined #ruby
[19:41:28] baroquebobcat: has joined #ruby
[19:46:01] TomyLobo: has joined #ruby
[19:46:06] j0n3: has joined #ruby
[19:46:07] Rodya_: has joined #ruby
[19:50:34] Infra-Red: has joined #ruby
[19:54:10] jenrzzz: has joined #ruby
[19:56:59] jenrzzz: has joined #ruby
[19:58:51] mfb2: has joined #ruby
[20:00:56] nb_bez___: has joined #ruby
[20:02:28] aweis: has joined #ruby
[20:02:37] openstruct: has joined #ruby
[20:03:51] pawnbox: has joined #ruby
[20:04:56] sgambino: has joined #ruby
[20:06:12] wald0: has joined #ruby
[20:07:51] treehug88: has joined #ruby
[20:08:30] last_staff: has joined #ruby
[20:08:49] FooMunki: has joined #ruby
[20:09:12] makenoise: has joined #ruby
[20:10:19] Hanmac: "Members of Congress did something almost unheard of at Tuesday’s hearing on the brewing battle over encryption between Apple and the FBI: their job." XD http://www.theguardian.com/commentisfree/2016/mar/01/congress-showed-willing-fight-fbi-encryption-finally
[20:10:23] mhb: has joined #ruby
[20:13:33] jenrzzz: has joined #ruby
[20:14:12] nettoweb: has joined #ruby
[20:14:53] joonty: has joined #ruby
[20:16:13] dhollinger: has joined #ruby
[20:19:39] fullofcaffeine: has joined #ruby
[20:21:18] QORRiE: has joined #ruby
[20:21:43] nerium: has joined #ruby
[20:22:08] shanemcd: has joined #ruby
[20:22:56] supplication: has joined #ruby
[20:23:34] dlitvak: has joined #ruby
[20:23:40] patrick99e99: has joined #ruby
[20:23:52] baweaver: has joined #ruby
[20:25:04] pawnbox: has joined #ruby
[20:25:19] lvn: has joined #ruby
[20:27:09] Ilgazer: has joined #ruby
[20:28:05] decoponyo: has joined #ruby
[20:33:46] stannard: has joined #ruby
[20:33:59] baweaver: has joined #ruby
[20:34:38] hahuang61: has joined #ruby
[20:34:46] jeanlinux: has joined #ruby
[20:35:09] circ-user-hoVeW: has joined #ruby
[20:35:09] Ilgazer: do you have using sinatra?
[20:35:37] jenrzzz: has joined #ruby
[20:36:08] nettoweb: has joined #ruby
[20:36:35] schickung: has joined #ruby
[20:39:43] Guest34101: has joined #ruby
[20:40:03] lemur: has joined #ruby
[20:41:05] Ilgazer: has left #ruby: ("Konversation terminated!")
[20:41:50] agent_white: has joined #ruby
[20:42:26] djbkd: has joined #ruby
[20:44:11] idefine: has joined #ruby
[20:44:14] patrick99e99: Hey ruby friends... I am a little confused about something.. I've got some xml that has some unicode characters that I need to remove.. and I am a little confused.. if I see \u0034 .. how do I know if that number is hex or oct ?
[20:44:30] patrick99e99: will \u always be hex?
[20:45:00] shevy: u will always be my hex!
[20:45:30] patrick99e99: U+omg would be oct?
[20:45:55] Ox0dea: Codepoints are always expressed in hexadecimal.
[20:50:56] rodferso1: has joined #ruby
[20:51:22] trosborn: has joined #ruby
[20:53:49] norc: apeiros, first time I worked with MySQL for real today. I ended discovering such a damn shitty quirk, it makes Oracle fun in comparison.
[20:54:23] norc: Did you know how MySQL works with collation and German unicode with unique constraints?
[20:54:28] norc: It is so laughable.
[20:56:47] diego4: has joined #ruby
[20:57:08] diego4: has joined #ruby
[20:57:27] davejlong: has joined #ruby
[20:58:04] tobiasvl: MySQL is horrible
[20:58:10] SCHAAP137: has joined #ruby
[20:58:43] snowy: has joined #ruby
[21:00:17] apeiros: norc: do tell?
[21:00:22] apeiros: been a while since I used mysql
[21:01:24] norc: apeiros, plain database with a table with a unique varchar column. insert "ß" and "ss" and watch the unique violation error throw into your face.
[21:01:30] norc: This is with the default utf8 setting.
[21:01:45] evenix: has joined #ruby
[21:01:58] norc: Or it was "ß" and "s" - cant remember. Either way, its downright horrible.
[21:02:36] Hanmac: norc it depends on what collation you use ... there is a difference between "unicode" and "general" ...
[21:02:55] norc: hanmac, that particular bit is collated the same with both utf8_unicode_ci and utf8_general_ci
[21:03:00] norc: hanmac, funny eh?
[21:03:05] spiette: has joined #ruby
[21:03:09] sgambino: has joined #ruby
[21:03:14] norc: You basically have to specifically set utf8_bin for collation.
[21:03:54] norc: hanmac, but good luck even figuring out that issue when you are importing a dump and it just tells you "duplicate error for key weise"
[21:04:08] Hanmac: norc i know the problem
[21:04:19] Hanmac: i prefer unicode if possible
[21:04:43] norc: hanmac, I would prefer the builtin utf8 charset had utf_bin by default since that has no impact on data.
[21:06:11] fullofcaffeine: has joined #ruby
[21:07:25] shevy: https://github.com/ruby/ruby/blob/trunk/ChangeLog#L6
[21:07:37] shevy: "* vm_eval.c (vm_call0_body): calling method_missing method is method_missing()."
[21:07:42] shevy: hanmac translate this for me please
[21:08:07] apeiros: norc: hm, I'm actually not sure whether that's an insensible thing to do by mysql
[21:08:11] blandflakes: has joined #ruby
[21:08:26] antranigv: has joined #ruby
[21:09:19] makenoise: has joined #ruby
[21:09:25] Hanmac: shevy: https://github.com/ruby/ruby/commit/be8005b977a2044534cef7c468a07fbc34f6b3d2 this and next commit are about method_missing
[21:09:32] davedev24: has joined #ruby
[21:09:32] norc: apeiros, what is your reasoning?
[21:09:46] despai: has joined #ruby
[21:10:05] apeiros: norc: it depends on details I'd have to research. but assume you had a case insensitive unique constraint, you'd want "foo" and "FOO" to collide too.
[21:10:24] apeiros: s/collide/cause a constraint violation/
[21:11:04] gguggi: has joined #ruby
[21:12:36] apeiros: as said, it depends on specifics, but if the unique constraint is supposed to adhere to the collation, and the collation specifies ß and ss to be equivalent (which might be bad since there's words which have a differing meaning depending on whether written with ss or ß), then it's sensible (the collation defining ss and ß to be equivalent might not be sensible, but that's not mysql's fault)
[21:13:41] aswen: has joined #ruby
[21:13:49] norc: apeiros, except their entire reasoning is based on DIN 5007-1 - which talks about *sorting* not lexical equivalence.
[21:14:28] norc: apeiros, and all the other databases have this notion of collation too. its about how things are sorted depending on your locale generally. ;-)
[21:14:32] morochena: has joined #ruby
[21:14:47] sp4rrow: has joined #ruby
[21:15:00] norc: I dont know.
[21:15:42] apeiros: again, depends on the specifics. it might not be sensible :)
[21:16:16] apeiros: one thing I'd want to cause a violation: "ä" and "ä"
[21:16:41] apeiros: if you can't spot the difference - don't worry ;-) it's both "ä", but once C and once D normalization
[21:16:51] davejlong: has joined #ruby
[21:16:53] norc: apeiros, just google for "collation problem mysql" - the advantages gained (namely slightly faster searches involving collated characters) are hardly worth the trouble so many users get when dealing with unicode.
[21:17:01] davejlong: has joined #ruby
[21:17:32] norc: apeiros, honestly I would simply normalize this on the application level.
[21:17:41] norc: apeiros, a full text search engine can take care of any collation
[21:17:47] antranigv: greetings all, I'm new here, interested in learning Ruby, mostly cz my fav open source project is in Ruby :))
[21:17:49] norc: and at the database I just have plain codepoints.
[21:17:57] norc: Hello antranigv :)
[21:18:11] apeiros: the codepoints differ for those two ;-)
[21:18:22] norc: apeiros, not after my application normalizes the input
[21:18:26] norc: so the database only sees one variant.
[21:18:29] apeiros: [228] vs [97, 776]
[21:18:38] antranigv: can you guys help me doing this little script in Ruby, I just wanted to have a general idea https://bpaste.net/show/72c2e1029699
[21:18:43] antranigv: hey norc ! ^^
[21:18:44] Coldblackice: has joined #ruby
[21:18:45] apeiros: yeah, sure. if you can control all venues values come from.
[21:19:21] antranigv: or just any guide will be good as well, heh :))
[21:19:24] apeiros: and sadly I've had to deal with more situations where that was not the case than the other way round :-/ (because the db is such an awesome place to interface between apps… :<)
[21:19:44] norc: apeiros, I constantly get shit for one of my applications constantly breaking things at work - with comments like "you dont test your application"
[21:19:57] s2013: has joined #ruby
[21:20:26] norc: apeiros, and the issue is always the tables my rails app has no control over, so I cannot have migrations for them - so I cannot test it. Having no control over all "venues" is no excuse for bad design.
[21:20:37] norc: It just calls for placing the control where its needed imho.
[21:21:19] apeiros: you understood the point about "no control", yes?
[21:21:28] joonty: has joined #ruby
[21:22:00] norc: apeiros, well I understand your point about db being abused for interfacing between apps.
[21:22:09] norc: But in the end the real issue is that you dont encapsulate your data behind APIs.
[21:22:31] kalleth: has joined #ruby
[21:22:37] apeiros: how exactly do you encaspulate data behind APIs when those other apps do not use them?
[21:23:03] apeiros: and don't get me wrong - that's precisely what I'd want. but I have no say about that.
[21:23:17] norc: Honestly I feel perfectly where you are coming from, Im in the same boat at times.
[21:24:13] apeiros: so that part you said about "proper design" - I have to put that into the db at times. one of the ways being constraints.
[21:25:30] norc: apeiros, I should apologize. I recently wrote a huge stack of pl/perl functions for our postgresql database, because the admin from the other dept was an idiot and would not let me write custom hooks for our radius server, so Im basically processing logs in triggers as they come in..
[21:25:37] norc: So I should know better than to advertise perfect design.
[21:25:55] apeiros: ACTION does that too
[21:25:57] norc: Im sorry.
[21:26:25] apeiros: heh, I'm fully on your side. as said - don't get me wrong. IMO you're totally right.
[21:26:33] apeiros: but some places simply don't allow for it :(
[21:26:49] shanemcd: has joined #ruby
[21:28:01] apeiros: with the current project, we will actually try to enforce going via the API. but honestly, I think it's only a question of time until somebody says "but doing this 'simply' on the db is easier/faster/better"
[21:28:01] ready: has joined #ruby
[21:29:01] norc: apeiros, every time its short sighted since it drastically reduces maintainability, testability and scalability.
[21:29:23] norc: So they get the spotlight for finding a cheap solution, and you get the blame when it all blows up and you cant maintain your systems.
[21:29:25] norc: Its an ugly world.
[21:30:18] mdw: has joined #ruby
[21:30:56] uglybandersnatch: has joined #ruby
[21:31:36] douglasc_: has joined #ruby
[21:31:36] norc: We have this rushed Rails framework in use that we have hired an external dev company to help with - and honestly I already feel pretty embarassed about the code already, since it barely has tests, is just hacked together because well - results needed to be produced in short time.
[21:31:57] norc: Dont even want to show that code to them.
[21:32:30] norc: So yeah, when Im off the job I just dream of a better world. Maybe this normal at my age, I am relatively young. ;-)
[21:32:34] dougsko: has left #ruby: ()
[21:32:53] Cohedrin: has joined #ruby
[21:32:56] apeiros: norc: precisely @ spotlight & blame
[21:33:29] apeiros: and same @ dream of a better world :D
[21:35:50] f4cl3y: has joined #ruby
[21:36:06] deuxclique: has joined #ruby
[21:36:13] fostertheweb: has joined #ruby
[21:38:58] jenrzzz: has joined #ruby
[21:40:06] dlitvak: has joined #ruby
[21:41:20] davejlong: has joined #ruby
[21:42:17] fullofcaffeine: has joined #ruby
[21:42:19] BTRE: has joined #ruby
[21:42:59] norc: apeiros, at times I wonder whether Im just better off looking for a different place to work at.
[21:43:44] norc: Though based on everything I have learned I should know that its very likely that most places work like that.
[21:43:59] atomical_: has joined #ruby
[21:44:42] trosborn: has joined #ruby
[21:44:47] zeroDivisible: has joined #ruby
[21:44:54] n008f4g_: has joined #ruby
[21:45:11] theunraveler: has joined #ruby
[21:46:31] kirillzh: has joined #ruby
[21:47:55] idefine: has joined #ruby
[21:48:02] last_staff: has joined #ruby
[21:49:08] kirillzh: has joined #ruby
[21:51:14] eregi: has joined #ruby
[21:57:26] moos3: has joined #ruby
[21:57:29] spiette: has left #ruby: (":q!")
[22:00:45] FernandoBasso: has joined #ruby
[22:01:46] czerasz: has joined #ruby
[22:02:06] dlitvak: has joined #ruby
[22:02:40] idefine: has joined #ruby
[22:03:01] baweaver: has joined #ruby
[22:03:11] Spami: has joined #ruby
[22:04:05] canton7: has joined #ruby
[22:05:20] idefine_: has joined #ruby
[22:05:32] tAn: has joined #ruby
[22:06:08] al2o3-cr: has joined #ruby
[22:06:43] idefine: has joined #ruby
[22:07:44] s2013: has joined #ruby
[22:07:55] harryh: has joined #ruby
[22:08:17] leksster: has joined #ruby
[22:08:49] Ropeney: has joined #ruby
[22:09:03] mdw: has joined #ruby
[22:09:46] Vingador: has joined #ruby
[22:10:12] Spami: has joined #ruby
[22:10:20] LoneHerm_: has joined #ruby
[22:10:25] tvw: has joined #ruby
[22:10:54] tAn: has joined #ruby
[22:11:22] idefine: has joined #ruby
[22:12:09] idefine_: has joined #ruby
[22:13:42] supplication: has joined #ruby
[22:15:56] trinaldi: has joined #ruby
[22:18:26] volty: has joined #ruby
[22:19:41] jottr_: has joined #ruby
[22:21:01] Dragooon: has joined #ruby
[22:21:23] diego2: has joined #ruby
[22:21:27] dlitvak: has joined #ruby
[22:22:09] joonty: has joined #ruby
[22:23:14] sp4rrow: has joined #ruby
[22:23:27] idefine: has joined #ruby
[22:24:18] Mia: has joined #ruby
[22:24:18] Mia: has joined #ruby
[22:25:47] mattwildig: has joined #ruby
[22:26:04] IrishGringo: has joined #ruby
[22:27:04] postmodern: has joined #ruby
[22:27:12] Jardayn: has joined #ruby
[22:27:47] diego2: has joined #ruby
[22:27:50] hahuang61: has joined #ruby
[22:28:38] Axy: has joined #ruby
[22:28:38] Axy: has joined #ruby
[22:32:25] workmad3: has joined #ruby
[22:33:22] danjam: has joined #ruby
[22:35:04] Noxilex: has joined #ruby
[22:35:40] baweaver: has joined #ruby
[22:35:57] danjam1: has joined #ruby
[22:36:11] humblespoon: so I defined a method for Fixnum to convert numbers to words, but when I use a number that's 1 billion or larger, it says my method is not defined (possibly to do with the BigNum class?) I don't quite understand what's happening https://eval.in/529069
[22:36:35] humblespoon: and if I can get my method to work with BigNum easily
[22:37:32] apeiros: humblespoon: define it on Integer instead of Fixnum
[22:37:32] workmad3: has joined #ruby
[22:38:00] apeiros: and yes, larger integers are Bignum, not Fixnum. but all are Integer.
[22:38:46] humblespoon: apeiros: awesome that worked! Thanks for explaining the difference :D
[22:39:48] idefine: has joined #ruby
[22:40:42] zenlot_away: has joined #ruby
[22:42:08] Guest34101: has joined #ruby
[22:44:23] danjam1: humblespoon: if you wanted to get really crazy you could extend it to works on floats too and put the methods on Numeric :P
[22:44:26] elifoster: has joined #ruby
[22:44:48] fostertheweb: has joined #ruby
[22:45:01] humblespoon: danjam1: I'm a bit scared playing with more than one class at once @_@ haha
[22:45:20] humblespoon: danjam1: just getting the hang of this now
[22:45:40] danjam1: cool, looks like a fun project
[22:46:29] stannard: has joined #ruby
[22:46:29] mlehrer: has joined #ruby
[22:46:57] humblespoon: danjam1: thanks, a bit time-consuming but satisfying to get it done haha
[22:47:51] mustmodify: has joined #ruby
[22:48:04] mustmodify: > puts 'hello'
[22:48:09] mustmodify: >> puts 'hello'
[22:48:10] ruby[bot]: mustmodify: # => hello ...check link for more (https://eval.in/529086)
[22:48:11] dlitvak: has left #ruby: ("ta luego")
[22:48:30] mustmodify: ok great. Can someone tell me why this is NOT matching? I'm feeling pretty stupid.
[22:48:31] amclain: has joined #ruby
[22:48:58] mustmodify: >> "+12345678901" =~ /\+\d{11}/
[22:48:59] ruby[bot]: mustmodify: # => 0 (https://eval.in/529088)
[22:49:20] apeiros: 0 means it did match
[22:49:25] apeiros: nil means no match
[22:49:28] mustmodify: apeiros: I got that
[22:49:49] mustmodify: back to the console to figure out what I messed up over here.
[22:50:51] mustmodify: >> sip_endpoint="+12345678901"; sip_endpoint =~ /\+1\d{11}/
[22:50:52] ruby[bot]: mustmodify: # => nil (https://eval.in/529090)
[22:51:02] duckpupp1: has joined #ruby
[22:51:28] binaryplease: has joined #ruby
[22:51:49] mustmodify: well, thanks for listening everyone. :P
[22:52:04] apeiros: I assume that "oh" & "d'oh" means you figured your mistake?
[22:52:17] benlieb: has joined #ruby
[22:52:18] mustmodify: yes. There's an extra number in my regex.
[22:52:31] mustmodify: I kept looking past it, I guess.
[22:52:32] apeiros: general tip: don't forget your anchors.
[22:52:59] mustmodify: apeiros: good advice. In this case I already know it's validated but I'll probably add them anyway.
[22:55:42] sp4rrow: has joined #ruby
[22:57:46] merqlove: has joined #ruby
[22:57:59] kirillzh: has joined #ruby
[22:58:52] hiljusti: has joined #ruby
[22:59:47] pdoherty: has joined #ruby
[23:00:12] idefine: has joined #ruby
[23:00:42] jenrzzz_: has joined #ruby
[23:01:13] mustmodify: >> "a" !=~ /a/
[23:01:14] ruby[bot]: mustmodify: # => true (https://eval.in/529093)
[23:01:19] mustmodify: I would have expected that to be false...
[23:02:14] BSaboia: has joined #ruby
[23:02:15] apeiros: negated =~ is !~
[23:02:35] apeiros: ast>> "a" !=~ /a/
[23:02:35] mustmodify: apeiros: OK, but then what does !=~ do? :P
[23:02:36] ruby[bot]: apeiros: I have parsed your code, the result is at https://eval.in/529094
[23:02:46] apeiros: guess why I did ^
[23:03:12] fullofcaffeine: has joined #ruby
[23:03:33] drbrain: "a" !=~ /a/ is seen as ("a" != (~ /a/))
[23:04:58] idefine: has joined #ruby
[23:05:19] snowy: has joined #ruby
[23:06:12] nando293921: has joined #ruby
[23:07:46] uglybandersnatch: has joined #ruby
[23:09:02] chouhoulis: has joined #ruby
[23:09:44] flappynerd: has joined #ruby
[23:09:54] flappynerd: can I rescue multiple exception types with the same handler?
[23:10:06] flappynerd: rescue FooException, BarException => e
[23:10:21] flappynerd: or must I have a separate rescue line for each?
[23:11:23] Mia: has joined #ruby
[23:11:23] Mia: has joined #ruby
[23:11:24] apeiros: flappynerd: if you'd just tried that ;-)
[23:11:24] intrigueD: has joined #ruby
[23:11:46] jenrzzz: has joined #ruby
[23:12:53] solocshaw: has joined #ruby
[23:13:47] coffeecupp: has joined #ruby
[23:13:49] last_staff: has joined #ruby
[23:14:21] deuxclique: has joined #ruby
[23:15:21] flappynerd: is there any reason I can't put a begin/rescue/end blog inside a rescue handler?
[23:15:46] flappynerd: e.g. I'd like to attempt to log some info about the exception, but if that logging in turn fails, I want to at least fail gracefully and not throw another exception
[23:15:53] mattwildig: has joined #ruby
[23:16:58] Papierkorb: has joined #ruby
[23:17:04] deuxcliq_: has joined #ruby
[23:17:20] apeiros: >> x=nil; begin; raise "foo"; rescue => e; begin; raise "bar"; rescue => e; x = e; end; end; x
[23:17:21] ruby[bot]: apeiros: # => #<RuntimeError: bar> (https://eval.in/529097)
[23:17:59] rideh: has joined #ruby
[23:18:15] flappynerd: I mean, I figured it didn't seem like it would be a problem, but might as well ask
[23:19:16] Ox0dea: >> [~//, $_='', ~//]
[23:19:17] ruby[bot]: Ox0dea: # => [nil, "", 0] (https://eval.in/529098)
[23:19:20] Ox0dea: That's fun.
[23:20:10] flappynerd: has left #ruby: ("Leaving")
[23:20:22] trosborn: has joined #ruby
[23:20:59] Guest683: has joined #ruby
[23:21:57] [gmi]: has joined #ruby
[23:25:00] idefine: has joined #ruby
[23:26:10] jgpawletko: has joined #ruby
[23:27:21] Gasher: has joined #ruby
[23:27:54] uglybandersnatch: has joined #ruby
[23:29:46] idefine: has joined #ruby
[23:31:28] makenoise: has joined #ruby
[23:33:20] bjensen82: has joined #ruby
[23:33:45] idefine: has joined #ruby
[23:33:52] idefine: has joined #ruby
[23:33:59] bjensen82: Heres something I dont understand... 1135.61 * 100 # => 113560.99999999999. Why?
[23:35:10] makenoise: has joined #ruby
[23:35:34] johnmilton: has joined #ruby
[23:38:16] mustmodify: they haunt us.
[23:39:13] bjensen82: it must be a bug, right?
[23:39:47] mallu: has joined #ruby
[23:39:50] bjensen82: 111.61 * 100 # => 11161.0 OK!
[23:41:56] jenrzzz: has joined #ruby
[23:42:39] duckpuppy: has joined #ruby
[23:42:51] Ox0dea: bjensen82: http://floating-point-gui.de/
[23:42:52] kirillzh: has joined #ruby
[23:44:35] mary5030: has joined #ruby
[23:44:58] mallu: Can someone please help me ? http://pastebin.com/fc6tau9D
[23:44:58] ruby[bot]: mallu: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/d8d06a6803b0463fc382
[23:44:58] ruby[bot]: mallu: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[23:45:10] mustmodify: has left #ruby: ()
[23:45:24] baweaver: has joined #ruby
[23:45:53] Spami: has joined #ruby
[23:46:16] Ox0dea: apeiros: Why not just have ruby[bot] post the raw link?
[23:47:45] hololeap: has joined #ruby
[23:50:29] hightower6: has joined #ruby
[23:50:46] trosborn: bjensen82: I’m not the most qualified to help you, but basically your problem is you are using each as an iterator when in fact is is an enumerator. if you want to do a nested loop I think you need to use something like a while loop.
[23:51:01] hightower6: Hey, is there a way to achieve the effect of 'include', but include the module at a particular point in the ancestors chain, not at the end?
[23:51:15] deuxclique: has joined #ruby
[23:51:23] Ox0dea: hightower6: There's #prepend for sticking it at the front.
[23:51:31] bjensen82: trosborn: i think your referencing the wrong person :-)
[23:51:41] trosborn: oops I meant mallu hah
[23:52:15] deuxclique: has joined #ruby
[23:52:18] atomical: has joined #ruby
[23:52:22] Ox0dea: hightower6: And then there's this if you *really* want arbitrary module injection: https://github.com/banister/remix
[23:52:31] Ox0dea: (And can swallow having to drop back to 1.8 or so. :P)
[23:52:37] hxegon_: has joined #ruby
[23:53:09] hightower6: Ox0dea, right, but which array would I prepend to? When I call .include() in a class to include a module, the array with the list of ancestors is not obvious / explicitly used
[23:53:09] Ox0dea: mallu: I think you probably want #zip.
[23:53:16] hxegon_: If I want to check that something isn't 0, 0.0, '', or nil, is there a less magic/clearer way than #to_f#zero?
[23:53:34] Ox0dea: hightower6: Huh?
[23:53:58] Ox0dea: The return value of #ancestors is generated dynamically; modifying that Array in-place has no bearing on the actual hierarchy.
[23:54:13] hightower6: Ox0dea, the advice you gave me (.prepend) is for arrays, not for what I asked about
[23:54:24] Ox0dea: &ri Module#prepend @hightower6
[23:54:24] `derpy: hightower6: http://ruby-doc.org/core-2.3.0/Module.html#method-i-prepend
[23:54:41] Ox0dea: Have faith, friend.
[23:55:25] hightower6: Ox0dea, cool, seems it's not there in 1.9.3 though. But using a newer ruby in my case isn't a problem so it'll work
[23:55:32] hightower6: Ox0dea, thanks++
[23:55:34] toretore: has joined #ruby
[23:55:35] Ox0dea: Happy to help.
[23:56:10] mallu: Ox0dea: Can you please elaborate on zip?
[23:56:51] Uber|Dragon: has joined #ruby
[23:56:57] eregi: has joined #ruby
[23:57:01] Ox0dea: mallu: Perhaps you should clarify what you're trying to do.
[23:57:11] devbug: has joined #ruby
[23:57:52] mallu: Ox0dea: I am trying to tag unique ID for each elements in an array
[23:58:08] LoneHermit: has joined #ruby
[23:58:23] Ox0dea: mallu: And the indices don't serve that purpose?