« Back to channel list

#ruby - 10 June 2017

« Back 1 day Forward 1 day »
[00:00:59] cschneid_: has joined #ruby
[00:03:03] xerx: has joined #ruby
[00:07:30] RubyLearner: has joined #ruby
[00:08:17] dtcristo: has joined #ruby
[00:11:46] RubyLearner: Is "raising an exception" the same as "creating an object of one of Exception descendants" ? If not, how exactly is it different?
[00:14:53] centrx: rubyLearner: raising an exception is actually activating it, causing the program to terminate unless the exception is caught by a rescue
[00:15:19] centrx: rubyLearner: creating an Exception object is just like creating any other object
[00:18:30] RubyLearner: centrx when you say “exception is caught by a rescue” do you mean “the exception object is caught by a rescue”? I would like to understand the underlying mechanics of it, in a more concrete, less abstract way. The idea of “exception” is always so abstract, I'd like to know what actually happens.
[00:20:48] ekinmur: has joined #ruby
[00:23:47] swills: has joined #ruby
[00:24:17] centrx: rubyLearner: Easier said than done
[00:24:27] centrx: rubyLearner: You can look at the C source code for Kernel#raise and follow that
[00:24:31] Rodya_: has joined #ruby
[00:24:53] centrx: rubyLearner: It's not particularly unique to Ruby, so you could look up how it's done in a more basic learning programming language
[00:28:13] DLSteve: has joined #ruby
[00:28:14] minimalism: has joined #ruby
[00:33:59] t-recx: has joined #ruby
[00:38:52] bvcosta: has joined #ruby
[00:43:09] roamingdog: has joined #ruby
[00:45:37] enterprisey: has joined #ruby
[00:46:56] Jameser: has joined #ruby
[00:47:56] __Yiota: has joined #ruby
[00:49:09] tolerablyjake: has joined #ruby
[00:54:34] ascarter_: has joined #ruby
[00:58:34] jenrzzz: has joined #ruby
[01:00:31] ResidentBiscuit: has joined #ruby
[01:07:23] RubyLearner: centrx is this correct to say? → “If the program commits a transgression, ruby saves an Exception object at $!”
[01:07:37] bkxd: has joined #ruby
[01:07:58] centrx: rubyLearner: If an error occurs
[01:08:52] elomatreb: You can define your own error classes and raise it anywhere in your code
[01:09:19] RubyLearner: centrx mm ok... is this process that I described a description of “raising an exception”? is it the “raising of the exception” the creation of that object and its saving in $! ?
[01:09:57] elomatreb: raise first instantiates the class you give it, and saves where it occurs. It then goes up the method call stack to find a matching rescue block, if it reaches the top without finding one your program exist and prints a stack trace
[01:10:16] d^sh: has joined #ruby
[01:14:00] elomatreb: I.e. there is little special about the Error/Exception object itself, it's only used to indicate what error occured and where
[01:14:10] amclain: has joined #ruby
[01:14:18] al2o3-cr: rubyLearner: fuck me, you got me thinking now cock sparrow
[01:14:44] RubyLearner: elomatreb: but what if I call raise and there's already an exception in $! ?
[01:15:19] RubyLearner: al2o3-cr hahaha man, I got myself thinking so much my head might explode
[01:15:28] elomatreb: I think if you call `raise` without an argument it defaults to re-raise what's in $!, otherwise it will override it
[01:16:18] uZiel: has joined #ruby
[01:19:32] al2o3-cr: rubyLearner: if it moves like water...
[01:19:44] enterprisey: has joined #ruby
[01:25:20] Rodya_: has joined #ruby
[01:28:37] ekinmur: has joined #ruby
[01:29:40] ruby[bot]: al2o3-cr: # => 1471 (https://eval.in/815046)
[01:32:27] d3d1rty: has joined #ruby
[01:32:51] al2o3-cr: >> Process.kill(9, $$)
[01:32:56] ruby[bot]: al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[01:32:57] bvcosta: has joined #ruby
[01:33:15] br0d1n: has joined #ruby
[01:34:35] dcluna: has joined #ruby
[01:34:55] ruby[bot]: al2o3-cr: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[01:42:36] DarthGandalf: has joined #ruby
[01:43:50] herbmillerjr: has joined #ruby
[01:43:52] roamingdog: has joined #ruby
[01:46:34] charliesome: has joined #ruby
[01:50:13] ascarter: has joined #ruby
[01:51:08] gizmore: has joined #ruby
[01:52:37] mim1k: has joined #ruby
[01:56:06] uZiel: has joined #ruby
[01:58:14] olivier__: has joined #ruby
[02:03:58] xall: has joined #ruby
[02:12:07] olivier__: has joined #ruby
[02:20:24] genpaku: has joined #ruby
[02:23:08] olivier__: has joined #ruby
[02:26:07] Rodya_: has joined #ruby
[02:27:02] bvcosta: has joined #ruby
[02:30:00] arescorpio: has joined #ruby
[02:33:23] cjhowe7: has joined #ruby
[02:34:48] _kaffeine_: has joined #ruby
[02:34:52] cschneid_: has joined #ruby
[02:43:42] enterprisey: has joined #ruby
[02:44:41] roamingdog: has joined #ruby
[02:46:23] ResidentBiscuit: has joined #ruby
[02:52:01] benlieb: has joined #ruby
[02:53:17] Jameser: has joined #ruby
[02:53:18] bmurt: has joined #ruby
[02:56:06] bkxd: has joined #ruby
[03:07:41] Bock: has joined #ruby
[03:09:49] ResidentBiscuit: has joined #ruby
[03:11:05] agent_white: has joined #ruby
[03:11:18] DeeJayh: has joined #ruby
[03:11:36] __Yiota: has joined #ruby
[03:14:10] kies: has joined #ruby
[03:17:51] Ryzokuken: has joined #ruby
[03:19:54] Esf: has joined #ruby
[03:20:04] ma0: has joined #ruby
[03:21:27] bvcosta: has joined #ruby
[03:22:27] gix: has joined #ruby
[03:24:57] Esf: has joined #ruby
[03:26:11] jellycode: has joined #ruby
[03:27:05] Rodya_: has joined #ruby
[03:27:17] Esf: has joined #ruby
[03:27:29] jellycode: Hi there. Does anybody know ruby and another language (C#, Java, or JS) well enough to port this encryption class from Travis CI to any other language? https://github.com/travis-ci/travis.rb/blob/dc6d47614d630fecf8220d4df78f5c747a6d9680/lib/travis/client/repository.rb
[03:28:52] jellycode: The issue is that in order to encrypt a string for travis, one has to install ruby language, then install the travis client gem, and then they can encrypt the string. It feels like an excessive dependency chain for something so simple.
[03:29:37] Esf: has joined #ruby
[03:30:05] jellycode: There's no magic with encryption like this, it's just hard for someone who doesn't do ruby.
[03:30:16] jellycode: The encryption is actually done in this class: https://github.com/travis-ci/travis.rb/blob/dc6d47614d630fecf8220d4df78f5c747a6d9680/lib/travis/tools/ssl_key.rb
[03:31:04] Esf: has joined #ruby
[03:31:33] ineb: simple rsa encryption
[03:31:37] ineb: can be done in any language
[03:31:45] ineb: by using openssl
[03:32:22] SeepingN: has joined #ruby
[03:33:06] hahuang65: has joined #ruby
[03:34:38] username1: has joined #ruby
[03:36:55] ineb: even works in bash
[03:37:00] ineb: echo "foo" |openssl rsautl -encrypt -pubin -inkey key -out >(base64)
[03:38:18] ledestin: has joined #ruby
[03:40:27] user__: has joined #ruby
[03:41:29] Esf: has joined #ruby
[03:42:13] gothicsouth: has joined #ruby
[03:42:57] Esf: has joined #ruby
[03:43:50] Esf: has joined #ruby
[03:45:24] segmond: has joined #ruby
[03:47:39] ascarter: has joined #ruby
[03:50:53] nowhere_man: has joined #ruby
[03:51:00] SeepingN: has joined #ruby
[03:51:42] bmurt: has joined #ruby
[03:53:09] mim1k: has joined #ruby
[03:53:27] xall: has joined #ruby
[03:57:11] _whitelogger: has joined #ruby
[04:02:23] ascarter: has joined #ruby
[04:15:26] roamingdog: has joined #ruby
[04:17:10] bkxd: has joined #ruby
[04:23:52] dc4: has joined #ruby
[04:24:22] olivier__: has joined #ruby
[04:26:02] chopin: has joined #ruby
[04:26:33] speakingcode: has joined #ruby
[04:27:50] Rodya_: has joined #ruby
[04:30:27] chopin: has joined #ruby
[04:34:45] speakingcode: has joined #ruby
[04:39:15] jenrzzz: has joined #ruby
[04:40:02] mim1k: has joined #ruby
[04:40:42] htb: has joined #ruby
[04:48:22] htb: Hi all, I am trying to install some ruby app (http://orgmode.org/worg/blorgit.html); I used rvm to setup an isolated environment and I am getting errors running rake: I get a "LoadError: cannot load such file -- blorgit" when running rake new (as per the instructions) and I get another error when adding -I (Mustermann::CompileError: regular expression should not contain ^: "^\\/.search"). Could anyone give me pointers to debug this?
[04:50:03] zenspider: hello fellow emacs user... :P
[04:50:50] ascarter: has joined #ruby
[04:53:52] zenspider: htb: so... that project hasn't had a commit in 5 years. some stuff has changed in that time.
[04:54:13] zenspider: it is expecting the load path to have "." in it, which it doesn't by default anymore
[04:54:32] zenspider: that's why it isn't finding the file... also, it doesn't have proper project directory structure set up, which is odd
[04:54:35] xerx: has joined #ruby
[04:55:04] zenspider: also, it seems to be flat out MISSING files: LoadError: cannot load such file -- /Users/ryan/xxx/blorgit/backend/active_file/init.rb
[04:56:27] htb: I have a backend/active_file/init.rb file after the git clone and submodule init
[04:57:17] zenspider: ah. I skipped that step. my fault.
[04:57:33] mkillebrew: has left #ruby: ()
[04:57:35] htb: when I do 'rake -I . new' from the root blorgit folder, I get the Mustermann regexp error. Did you get past that already?
[04:58:00] zenspider: this is pretty horribly written tho
[04:58:16] zenspider: you're gonna have to slow down
[04:59:04] zenspider: it doesn't like the way I'm running emacs server??
[04:59:39] zenspider: nope. I'm done. this is too horrible
[05:00:02] zenspider: can you gist the actual error you're seeing?
[05:00:58] AnoHito: has joined #ruby
[05:01:14] zenspider: I think what you're seeing is shitty dependency management. this hasn't changed in 5 years, but the other projects have.
[05:01:29] zenspider: and since the instructions just say "install this shit willy nilly" you wind up with the latest versions
[05:02:56] htb: https://gist.github.com/anonymous/81ad36ad1295b9e78621fc8303a461e0
[05:03:50] htb: if the software doesn't look good (or too obsolete), I'll look for something else, thanks for the help anyway
[05:04:27] AnoHito_: has joined #ruby
[05:04:38] zenspider: htb: go to line 45 of blorgit.rb and remove the anchor there
[05:04:44] zenspider: then do it for the others
[05:05:07] user__: has joined #ruby
[05:05:24] zenspider: hopefully you won't have too much shit to deal with
[05:06:36] htb: thanks a lot that gets me through the first step. I am not sure what I disabled there, I am illeterate in ruby
[05:07:16] zenspider: it's just regular expressions. pretty much the same in all real languages
[05:07:39] zenspider: they don't want you to have "^" in the regexp anymore. the blog software is ancient so it hasn't been updated
[05:07:59] zenspider: you could for the project and send a PR back to the author, but I doubt they'd bother. maybe file an issue asking about it
[05:09:15] bvcosta: has joined #ruby
[05:10:23] htb: the get/post anchors is what i don't understand I think (I guess it responses to http requests). I'll play with it for a while, see if I can get it to a working state.
[05:16:09] roamingdog: has joined #ruby
[05:21:55] AnoHito: has joined #ruby
[05:28:36] Rodya_: has joined #ruby
[05:33:15] code2Learn: has joined #ruby
[05:44:42] hahuang65: has joined #ruby
[05:49:15] bkxd: has joined #ruby
[05:54:54] rohitpaulk: has joined #ruby
[05:59:12] cjhowe7: has joined #ruby
[06:02:06] charliesome: has joined #ruby
[06:03:43] bvcosta: has joined #ruby
[06:04:16] hamid: has joined #ruby
[06:08:39] vincent: has joined #ruby
[06:12:27] dionysus69: has joined #ruby
[06:19:57] ascarter: has joined #ruby
[06:29:03] olivier__: has joined #ruby
[06:29:11] Rodya_: has joined #ruby
[06:36:44] Xakotu: has joined #ruby
[06:36:59] konsolebox: has joined #ruby
[06:38:03] tvw: has joined #ruby
[06:38:57] TomyLobo: has joined #ruby
[06:42:00] shengquangang: has joined #ruby
[06:43:04] shengquangang: has left #ruby: ()
[06:43:07] Ishido: has joined #ruby
[06:48:13] _whitelogger: has joined #ruby
[07:01:53] keyjoo_: has joined #ruby
[07:08:13] cfec0b8d: has joined #ruby
[07:10:51] belmoussaoui: has joined #ruby
[07:11:25] SeepingN_: has joined #ruby
[07:13:25] bkxd: has joined #ruby
[07:26:44] zapata: has joined #ruby
[07:28:30] roamingdog: has joined #ruby
[07:29:54] latemus: has joined #ruby
[07:30:03] Rodya_: has joined #ruby
[07:32:31] symm-: has joined #ruby
[07:32:32] charliesome: has joined #ruby
[07:33:18] symm-: irb causes a strange increase in power usage... all the more strange since cpu usage stays negligible
[07:40:05] oleo: has joined #ruby
[07:43:34] spectrum: has joined #ruby
[07:45:28] hahuang65: has joined #ruby
[07:46:44] hutch34_: has joined #ruby
[07:49:16] nunchuck: has joined #ruby
[07:50:42] muelleme: has joined #ruby
[07:50:45] ascarter: has joined #ruby
[07:52:35] vincent: has joined #ruby
[07:53:45] bkxd: has joined #ruby
[07:56:17] cjhowe7: has joined #ruby
[07:57:07] cjhowe7: has joined #ruby
[07:57:18] nhhc: has joined #ruby
[08:01:43] cjhowe7: has joined #ruby
[08:02:06] Axsuul: has joined #ruby
[08:02:49] godel_: has joined #ruby
[08:06:08] CacoS: has joined #ruby
[08:12:49] stormbytes: has joined #ruby
[08:16:39] mathys: has joined #ruby
[08:26:49] marr: has joined #ruby
[08:27:13] mathys_: has joined #ruby
[08:28:01] dasher^0_o: has joined #ruby
[08:30:37] vincent: has joined #ruby
[08:30:49] Rodya_: has joined #ruby
[08:31:58] patarr: has joined #ruby
[08:33:01] prubini87: has joined #ruby
[08:35:09] prubini87: Can anyobody enlighten me, please? I need to manage 2 processes running at the same time in a console window, one is a socket connection (read/write) and the other is the user input/output. Does anyone have a tip or, very so much better an example of how to go about hangling this??
[08:35:21] mathys: has joined #ruby
[08:37:25] belmoussaoui: has joined #ruby
[08:40:10] prubini87: has joined #ruby
[08:47:16] prubini87: has joined #ruby
[08:48:57] nofxxx: has joined #ruby
[08:50:44] lxsameer: has joined #ruby
[08:54:07] ascarter: has joined #ruby
[08:55:01] prubini87: has joined #ruby
[08:56:12] jenrzzz: has joined #ruby
[09:04:15] nanoz: has joined #ruby
[09:04:15] nanoz: has joined #ruby
[09:06:24] mathys: has joined #ruby
[09:09:07] prubini87: has joined #ruby
[09:09:53] mathys_: has joined #ruby
[09:15:15] muelleme: has joined #ruby
[09:17:57] blackwind_123: has joined #ruby
[09:21:22] govg: has joined #ruby
[09:23:54] bkxd: has joined #ruby
[09:25:22] ur5us: has joined #ruby
[09:27:16] naftilos76: has joined #ruby
[09:31:32] Rodya_: has joined #ruby
[09:32:00] Ishido: has joined #ruby
[09:37:26] ddffg: has joined #ruby
[09:42:09] SaschaVoid: has joined #ruby
[09:46:20] hahuang65: has joined #ruby
[09:54:45] brent__: has joined #ruby
[09:55:35] ascarter: has joined #ruby
[09:55:35] mikecmpbll: has joined #ruby
[09:59:05] Fira_: has joined #ruby
[10:02:57] Fira_: has joined #ruby
[10:07:34] patarr: has joined #ruby
[10:09:11] bkxd: has joined #ruby
[10:16:39] AnoHito_: has joined #ruby
[10:20:10] AnoHito: has joined #ruby
[10:20:52] jenrzzz: has joined #ruby
[10:24:03] roshanavand: has joined #ruby
[10:24:40] Azure: has joined #ruby
[10:27:05] bvcosta: has joined #ruby
[10:32:18] Rodya_: has joined #ruby
[10:37:35] godel: has joined #ruby
[10:38:00] S1kx: has joined #ruby
[10:39:07] Ishido: has joined #ruby
[10:48:10] bkxd: has joined #ruby
[10:51:26] oleo: has joined #ruby
[10:52:16] cschneid_: has joined #ruby
[10:55:16] James123: has joined #ruby
[10:58:16] quobo: has joined #ruby
[11:04:49] vuoto: has joined #ruby
[11:07:57] James123: Any ideas on how to replace a character in an string only if it doesn't occur at the beginning of it?
[11:10:04] bkxd: has joined #ruby
[11:10:29] marr: has joined #ruby
[11:13:06] howdoi: has joined #ruby
[11:18:34] jrgifford: has joined #ruby
[11:22:39] mikecmpbll: has joined #ruby
[11:26:42] nowhere_man: has joined #ruby
[11:30:15] _whitelogger: has joined #ruby
[11:30:26] nowhere_man: has joined #ruby
[11:33:05] Rodya_: has joined #ruby
[11:41:13] roamingdog: has joined #ruby
[11:43:57] zenspider: "hangling"! I love it!
[11:44:35] zenspider: James123: do the simplest thing that could possibly work. exactly what you described. nothing more.
[11:44:51] devyn: has joined #ruby
[11:47:10] hahuang65: has joined #ruby
[11:51:04] LightStalker: has joined #ruby
[11:54:53] Fernando-Basso: has joined #ruby
[11:55:09] ekinmur: has joined #ruby
[11:59:37] ascarter: has joined #ruby
[12:00:44] ekinmur: has joined #ruby
[12:01:27] bkxd: has joined #ruby
[12:04:33] rohitpaulk: has joined #ruby
[12:09:57] nanoz: has joined #ruby
[12:13:38] bvcosta: has joined #ruby
[12:29:26] ekinmur: has joined #ruby
[12:30:31] babykosh: has joined #ruby
[12:33:46] Rodya_: has joined #ruby
[12:42:00] muelleme: has joined #ruby
[12:45:29] mjuszczak: has joined #ruby
[12:46:48] Tempesta: has joined #ruby
[12:47:31] roamingdog: has joined #ruby
[12:49:44] jhass: has joined #ruby
[12:53:48] petruff2: has joined #ruby
[12:54:57] ekinmur: has joined #ruby
[12:57:36] rohitpaulk: has joined #ruby
[13:01:08] ascarter: has joined #ruby
[13:02:21] olivier__: has joined #ruby
[13:05:58] cdg: has joined #ruby
[13:06:20] mjuszczak: has joined #ruby
[13:07:03] symm-: has joined #ruby
[13:07:30] jakew: has joined #ruby
[13:07:42] bvcosta: has joined #ruby
[13:08:14] jakew: has joined #ruby
[13:08:34] jakew: has joined #ruby
[13:08:35] muelleme: has joined #ruby
[13:10:03] kobain: has joined #ruby
[13:10:20] rippa: has joined #ruby
[13:11:26] weathermaker: has joined #ruby
[13:15:30] ruurd: has joined #ruby
[13:20:33] roamingdog: has joined #ruby
[13:21:20] olivier__: has joined #ruby
[13:24:30] dasher00: has joined #ruby
[13:25:03] Esf: has joined #ruby
[13:26:06] roamingdog: has joined #ruby
[13:30:30] olivier__: has joined #ruby
[13:34:29] Rodya_: has joined #ruby
[13:40:49] olivier__: has joined #ruby
[13:40:53] vincent: has joined #ruby
[13:41:09] MarkBilk: has joined #ruby
[13:47:12] psychicist__: has joined #ruby
[13:48:50] weathermaker: has joined #ruby
[13:48:57] hahuang65: has joined #ruby
[13:50:52] quobo: has joined #ruby
[13:51:07] workmad3: has joined #ruby
[13:53:28] chouhoulis: has joined #ruby
[13:54:20] Fira_: has joined #ruby
[13:54:38] roamingdog: has joined #ruby
[13:55:01] Fira_: has joined #ruby
[13:55:36] mikecmpb_: has joined #ruby
[14:01:58] bvcosta: has joined #ruby
[14:02:06] konsolebox: has joined #ruby
[14:03:06] MarkBilk: has joined #ruby
[14:03:25] olivier__: has joined #ruby
[14:03:36] DLSteve: has joined #ruby
[14:05:48] cdg_: has joined #ruby
[14:09:12] TheHodge: has joined #ruby
[14:10:02] vincen___: has joined #ruby
[14:17:24] nertzy: has joined #ruby
[14:17:25] cyclonis: has joined #ruby
[14:17:55] cyclonis: is then a gem for encoding in UTF-16 ?
[14:18:03] swills: has joined #ruby
[14:22:56] dionysus69: has joined #ruby
[14:27:13] _whitelogger: has joined #ruby
[14:30:02] speakingcode: has joined #ruby
[14:30:22] cyclonis: good morning all
[14:32:40] muelleme: has joined #ruby
[14:33:35] davic: has joined #ruby
[14:35:21] Rodya_: has joined #ruby
[14:36:55] HoloIRCUser5: has joined #ruby
[14:43:11] olivier__: has joined #ruby
[14:44:18] username1: has joined #ruby
[14:45:52] cpruitt: has joined #ruby
[14:46:39] ascarter: has joined #ruby
[14:47:23] ltem: has joined #ruby
[14:47:28] weathermaker: has joined #ruby
[14:53:11] cadillac_: has joined #ruby
[14:54:07] psychicist__: has joined #ruby
[14:55:34] blackwind_123: has joined #ruby
[14:56:00] bvcosta: has joined #ruby
[14:58:36] cyclonis: has joined #ruby
[15:09:22] cjhowe7: has joined #ruby
[15:09:22] olivier__: has joined #ruby
[15:09:53] sepp2k: has joined #ruby
[15:11:44] BTRE: has joined #ruby
[15:18:48] Miron: has joined #ruby
[15:26:37] HoierM: has joined #ruby
[15:28:56] belmoussaoui: has left #ruby: ()
[15:33:05] robouk: has joined #ruby
[15:33:47] dasher00: has joined #ruby
[15:35:45] iomotoko: has joined #ruby
[15:36:01] Rodya_: has joined #ruby
[15:45:55] SuperLag: has joined #ruby
[15:46:25] HoloIRCUser5: has left #ruby: ()
[15:49:44] hahuang65: has joined #ruby
[15:49:58] bvcosta: has joined #ruby
[15:50:14] segmond: has joined #ruby
[15:53:13] Esf: has joined #ruby
[16:00:52] zacts: has joined #ruby
[16:01:08] charliesome: has joined #ruby
[16:01:13] SuperLag: has joined #ruby
[16:01:14] segmond: has left #ruby: ()
[16:04:14] chalkmonster: has joined #ruby
[16:06:26] hutch34_: has joined #ruby
[16:14:51] ruby-lang645: has joined #ruby
[16:16:55] mjuszczak: has joined #ruby
[16:17:06] ruby509: has joined #ruby
[16:17:14] Ryzokuken: has joined #ruby
[16:17:59] robouk: has joined #ruby
[16:18:32] lxsameer: has joined #ruby
[16:18:38] dionysus70: has joined #ruby
[16:19:10] bkxd: has joined #ruby
[16:19:26] misctech: has joined #ruby
[16:21:18] misctech: has left #ruby: ("Leaving")
[16:21:51] Esf: has joined #ruby
[16:22:14] iloveitaly: has joined #ruby
[16:23:02] username1: has joined #ruby
[16:23:26] jellycode_: has joined #ruby
[16:28:07] gothicsouth: has joined #ruby
[16:28:18] ekinmur: has joined #ruby
[16:29:29] belmoussaoui_: has joined #ruby
[16:31:30] chalkmonster: has joined #ruby
[16:33:30] texasmynsted: has joined #ruby
[16:33:38] ddffg: has joined #ruby
[16:34:27] Fira__: has joined #ruby
[16:36:43] Rodya_: has joined #ruby
[16:38:12] DLSteve: has joined #ruby
[16:39:46] Murda: has joined #ruby
[16:41:23] beccamorgan: has joined #ruby
[16:43:56] br0d1n: has joined #ruby
[16:43:59] bvcosta: has joined #ruby
[16:46:27] arup_r: has joined #ruby
[16:51:56] roamingdog: has joined #ruby
[16:54:49] SaschaVoid: has joined #ruby
[16:55:48] red_menace: has joined #ruby
[16:58:14] dionysus69: has joined #ruby
[17:01:53] hutch34_: has joined #ruby
[17:02:21] bvcosta: has joined #ruby
[17:14:42] username1: has joined #ruby
[17:17:44] hutch34_: has joined #ruby
[17:20:11] rohitpaulk: has joined #ruby
[17:36:48] xzhao: has joined #ruby
[17:37:41] Rodya_: has joined #ruby
[17:38:16] belmoussaoui: has joined #ruby
[17:40:00] bvcosta: has joined #ruby
[17:43:47] username1: has joined #ruby
[17:44:48] gothicsouth: has joined #ruby
[17:47:43] kith: has joined #ruby
[17:49:24] chatts: has joined #ruby
[17:50:33] hahuang65: has joined #ruby
[17:53:45] t-recx: has joined #ruby
[17:56:59] bkxd: has joined #ruby
[18:04:59] leonthemisfit: has joined #ruby
[18:04:59] leonthemisfit: has joined #ruby
[18:05:31] joelwallis: has joined #ruby
[18:07:39] cdg: has joined #ruby
[18:09:54] symm-: has joined #ruby
[18:12:28] tvw: has joined #ruby
[18:12:42] User220: has joined #ruby
[18:13:55] hutch34_: has joined #ruby
[18:14:12] User220: has left #ruby: ()
[18:15:52] jcao219: has joined #ruby
[18:17:40] __Yiota: has joined #ruby
[18:21:53] keyjoo_: has joined #ruby
[18:23:48] igniting: has joined #ruby
[18:25:27] __Yiota: has joined #ruby
[18:26:53] perniciouscaffei: has joined #ruby
[18:32:44] stormbytes: has joined #ruby
[18:34:21] bvcosta: has joined #ruby
[18:38:15] Rodya_: has joined #ruby
[18:43:33] bkxd: has joined #ruby
[18:48:45] roamingdog: has joined #ruby
[18:50:15] al2o3-cr: has joined #ruby
[18:52:46] username1: has joined #ruby
[19:00:30] armyriad: has joined #ruby
[19:04:11] gizmore: has joined #ruby
[19:09:52] milardovich: has joined #ruby
[19:11:42] milardovich: has joined #ruby
[19:12:22] NightMonkey: has joined #ruby
[19:16:20] Ishido: has joined #ruby
[19:16:37] swills: has joined #ruby
[19:18:13] HoierM: has joined #ruby
[19:20:49] mjuszczak: has joined #ruby
[19:25:15] bkxd: has joined #ruby
[19:25:26] cdg: has joined #ruby
[19:32:03] patr0clus: has joined #ruby
[19:38:43] roamingdog: has joined #ruby
[19:39:00] Rodya_: has joined #ruby
[19:39:28] roamingdog: has joined #ruby
[19:40:18] roamingdog: has joined #ruby
[19:41:05] roamingdog: has joined #ruby
[19:41:55] roamingdog: has joined #ruby
[19:46:07] segy_: has joined #ruby
[19:49:15] cjhowe7: has joined #ruby
[19:51:25] Puffball: has joined #ruby
[19:51:38] hahuang65: has joined #ruby
[19:52:10] JoshS: has joined #ruby
[19:53:13] RubyLearner: has joined #ruby
[19:56:49] RubyLearner: https://thepasteb.in/p/Y6hkBokLwXjh7
[19:57:15] shinnya: has joined #ruby
[20:01:57] blackwind_123: has joined #ruby
[20:03:41] Mendel: has joined #ruby
[20:04:23] apeiros: rubyLearner: I think it's close and a good first understanding
[20:04:55] apeiros: some corrections: there are no assumptions. exceptions are raised when something is wrong
[20:05:15] jottr: has joined #ruby
[20:05:28] apeiros: (of course, as all other code too, the code which detects a case where an exception is raised can have a bug)
[20:05:42] apeiros: then: rescue is not "in the local scope"
[20:06:22] apeiros: calling a method creates a stack. i.e. foo calls bar calls baz -> your stack is foo > bar > baz. exceptions unwind this stack until it finds a wrapping begin/rescue
[20:06:56] apeiros: the ultimate begin/rescue is rubys interpreter itself, which will cause the application to exit with the error message you usually see in case of "unhandled" exceptions
[20:07:42] apeiros: also, raise can create an exception object, but it doesn't have to. you can pass an exception object directly: raise MyExceptionClass.new("message")
[20:07:56] solocshaw: has joined #ruby
[20:08:55] RubyLearner: apeiros: is the “method stack” that you say the same thing as the backtrace that is saved in the Exception object?
[20:14:39] RubyLearner: mmm ok, so the interpreter will search the backtrace saved in the Exception object for a rescue clause
[20:15:01] apeiros: kinda. it doesn't exactly use the backtrace for the search.
[20:15:12] apeiros: but that's the route/way it takes
[20:15:50] RubyLearner: The backtrace tells the interpreter where to go? Or do they just happen to hold the same stack trace?
[20:17:12] apeiros: I'm actually not entirely sure about the details. but I think the thing in the exception is a copy of the actual thing used.
[20:17:15] matthewd: Somewhere in between. Do you have any other-language experience we might help you compare/contrast?
[20:17:27] prubini87: has joined #ruby
[20:17:47] bawsky: has joined #ruby
[20:17:58] apeiros: since the actual thing is "live", when the stack is being unwinded, it changes. so the exception would no longer accurately depict the origin if didn't copy before unwind.
[20:18:06] RubyLearner: matthewd: mmm not unfortunately
[20:18:14] matthewd: Yeah, the exception's backtrace is a representation of the VM's actual call stack state at the time the exception occurred
[20:18:39] bawsky: Got a problem involving the need for non-blocking requests... Can someone help? Details in a sec
[20:18:42] apeiros: also the actual thing might contain more/different information related to implementation details of the VM
[20:18:58] matthewd: Most notably, the exception's backtrace is mutable.. your power to mutate the real stack is somewhat more limited :)
[20:19:23] apeiros: the thing in the exception contains what you can actually see in your ruby code
[20:19:44] apeiros: matthewd: I really wish it was frozen
[20:20:07] matthewd: rubyLearner: Consider that the VM is always tracking where you called from, because even absent an exception, it has to go back there when you return
[20:20:08] apeiros: I've been bitten too often by well-intended libraries which tried to "tidy up" the backtrace and in turn made my bugsearch multiple times more annoying.
[20:21:21] matthewd: apeiros: I'm pretty torn.. a nontrivial library can leave the backtrace awful to read for "normal" use -- but if you do need to care about parts it's hiding, yeah, not fun
[20:21:51] apeiros: I't be nice if ruby made it obvious and kept a frozen copy available
[20:22:31] apeiros: like "Exception foo in bar\n[POSTPROCESSED BACKTRACE, ORIGINAL IN $!.original_backtrace]\n…tidied backtrace…"
[20:22:40] apeiros: wrt, I'm glad they introduced Exception#cause
[20:22:46] apeiros: that was another source of frustration
[20:23:48] apeiros: "has been" is better to indicate it no longer is?
[20:24:07] RubyLearner: I'm still trying to wrap my mind around what you guys wrote... thanks, I'm starting to get a few internal eurekas in my mind... How did you guys learn this? Do you suggest some resource where I can learn Ruby in this level of detail? Because the abstraction kinda puzzles me too much, I only feel clarified when I actually see it happening in my mind
[20:24:59] bawsky: I am maintaining an app in which users may have a MMR (aka a number defining his ability in a game) and may invite/be invited to teams ONLY if they are not much higher than the highest MMR on team or much lower than the lowest.
[20:24:59] bawsky: The problem is that I get the MMR value from an external API and the value may change at any time (therefore storing locally is not reliable).
[20:25:00] bawsky: The external API used to support batch calls (I send a bunch of player ids, get their MMRs and bam I'm set). The problem is that it does not support batch calls anymore and now I am kinda lost about my options...
[20:25:09] bawsky: May someone help? :/
[20:25:29] prubini87: has joined #ruby
[20:25:49] bawsky: I am referring specifically to League of Legend's API - it used to support batch calls on v2, but v2 is going to be deprecated (and with that, batch calls)
[20:26:13] apeiros: rubyLearner: I already had a good understanding of the callstack when I learned my first lang with exceptions, so the way they work seemed natural to me. somewhat "the way I'd have done it"
[20:26:25] bkxd: has joined #ruby
[20:26:32] cdg: has joined #ruby
[20:26:37] matthewd: rubyLearner: I personally prefer to learn one abstraction layer at a time -- accept that "and then it just does stuff", then return later to try to understand how that part works in turn [where it'll be building on yet another abstraction, etc]
[20:26:46] apeiros: and to understand the callstack - well, I had years of time. I started around age 8 ;-) no idea when what understanding formed in my mind.
[20:26:59] roamingdog: has joined #ruby
[20:28:00] apeiros: bawsky: store a value and a vector and extrapolate?
[20:28:09] apeiros: only query if the data is "too old"
[20:28:20] apeiros: alternatively - do the batch client side
[20:28:34] apeiros: i.e. dozens of individual mmr queries
[20:28:44] RubyLearner: matthewd: I like that suggestion a lot.. .I might be too stubborn.. because I'm reading a ruby book and whenever I don't fully understand something, I start googling for ages, it takes too much time. I would love to find a book or webite that just told me everything haha.
[20:29:05] apeiros: you can also ease the burden by querying only the strongest and weakest few players of the team
[20:29:38] elomatreb: I found it helpful to understand the need for exceptions, look at languages like C where you have to carefully check for special error return codes all the time
[20:29:54] RubyLearner: apeiros: wow, you started early.. I wish I was that smart to get into programming at an early age.. it's a fascinating universe
[20:30:28] elomatreb: Then you can see Exceptions are a formalization of that mechanic that is designed to keep you from confusing an error value with an actual return code
[20:30:47] matthewd: rubyLearner: I'd like to confidently say "horses for courses, go with whatever learning style feels like it suits you"... but I worry that there's always another abstraction layer, and then another -- you have to stop at some point, or you'll end up learning subatomic physics instead of programming ;)
[20:31:03] apeiros: elomatreb: eh, there's a point in that. the issue is, it's a kind of "if you have that other additional knowledge, you'll understand this additional knowledge" :D
[20:31:19] elomatreb: To understand exceptions, you must first understand the universe
[20:31:32] apeiros: but it's a good point and I think it becomes stronger with "revisit things you learned once you have alternative perspectives"
[20:31:35] prubini87: Does anyone know a good-for-dummies, concise tutorial on concurrency? Something not overcomplicated, for a starter hehehe :S
[20:31:48] RubyLearner: elomatreb hahahaha
[20:32:20] elomatreb: apeiros: I like learning/understanding by understanding the history/reasons for creation of something
[20:32:23] apeiros: rubyLearner: ruby is your first language?
[20:32:25] RubyLearner: matthewd yeah, it's definitely a trap I fall into all the time... you feel this urge to “get it”, but it's like water, it seems haha
[20:32:29] apeiros: elomatreb: yeah, same
[20:32:41] apeiros: elomatreb: trying to build my own language helped tremendously there
[20:33:11] apeiros: you suddenly have to question things you took for granted, or always thought "wow that sucks" and suddenly understood, why it was not improved.
[20:33:26] RubyLearner: apeiros: yes.. I did some webdesign before, playing here and there with javascript trying to fix bugs, not really programming
[20:34:21] apeiros: rubyLearner: ok. I think elomatreb's advice is something you should remember for later then. it's a good idea to learn more than one language. it helps understand why the other language works the way it works :)
[20:34:35] bawsky: apeiros: I'm looking at client side being the first option - and then sending the data to the backend to do the dirty job (a problem is that a player may have up to two different MMRs and I still need to grab the highest; we even have a class for treating that case...)
[20:34:49] prubini87: has left #ruby: ()
[20:35:00] RubyLearner: also, I have this urge to write everything I study, I use this great tool called Workflowy for that... I definitely solidifies the knowledge, but it also is a trap, it sucks a lot of time
[20:35:18] apeiros: rubyLearner: well, can't have your cake and eat it too
[20:35:25] apeiros: I think writing everything is a good choice.
[20:35:39] bawsky: alternatively, I guess I'll probably do it serverside anyway and use the "too old or not" approach.
[20:36:23] matthewd: rubyLearner: To that end, I'd say your approximation is pretty well close enough... I'd just refine it to note that the backtrace is a *representation* of the call stack. So it's not technically the thing that's driving the unwinding (looking for rescue clauses), but the distinction is unlikely to matter.
[20:37:35] nesoi: has joined #ruby
[20:37:36] prubini87: has joined #ruby
[20:39:33] t-recx: has joined #ruby
[20:39:46] Rodya_: has joined #ruby
[20:41:20] marius: has joined #ruby
[20:43:19] bawsky: has joined #ruby
[20:45:06] jenrzzz: has joined #ruby
[20:45:06] jenrzzz: has joined #ruby
[20:45:40] ruurd: has joined #ruby
[20:48:29] RubyLearner: thanks a lot guys.. tremendously helpful.. for those of you who like to write and take notes on stuff you study, I'd really recommend this tool “Workflowy”.. it's a pretty awesome outliner I've been using for years to try to organize my brain.. helps a lot to memorize stuff :)
[20:49:27] apeiros: -q nesoi!*@*
[20:49:32] apeiros: -o apeiros
[20:54:13] nesoi: I have some old code that uses Time.parse, that worked on an old system but isn't working. Could someone take a look and perhaps offer a hint? https://gist.github.com/anonymous/4d311c1351dca51cc61fbdc83a2b0f86
[20:54:53] apeiros: nesoi: you don't need to parse a Time object
[20:55:05] apeiros: parse means translate a String to Time. you already have Time.
[20:55:08] nesoi: apeiros: I want it as a string
[20:55:16] apeiros: that's not what parse does.
[20:55:30] nesoi: so why would that code have worked before?
[20:55:50] nesoi: worked = it's comparing values in a database which are string
[20:55:59] apeiros: you're mistaken
[20:56:15] olivier__: has joined #ruby
[20:56:17] apeiros: and your own code tells you that you are mistaken.
[20:56:25] apeiros: puts r.last_updated_at.class -> Time
[20:56:57] nesoi: right I know it's originally a Time, but in the DB it's a varchar and is human-readable as time
[20:57:04] apeiros: it worked because it converted your Time to a String and parsed that String converting it back to the Time it was before. hurray for useless waste of CPU cycles :)
[20:57:30] apeiros: nesoi: I doubt that. but even if, you're doing it terribly wrong.
[20:57:57] apeiros: also, if it really is, then the output you showed us is misleading.
[20:58:05] nesoi: that's the current output
[20:58:29] nesoi: hm. maybe the input data format changed? have to see
[20:58:31] apeiros: so is r.last_updated_at from the database?
[20:58:44] nesoi: yeah it's supposed to be
[20:58:46] matthewd: What Active Record version is this, and where did `r` come from?
[20:58:50] apeiros: because if it is, "but in the DB it's a varchar" is simply wrong.
[20:59:02] apeiros: nesoi: well then ^
[20:59:29] apeiros: (and it'd be rather stupid to have last_updated_at as varchar tbf)
[21:00:02] nesoi: I'm not specifying the activerecord version. actually r came from an api call, not a db. and the API has changed so the format could have changed… nevermind, I'm unprepared and need to research it more. thanks for the hints!
[21:00:11] Rodya_: has joined #ruby
[21:00:39] creshiem: has joined #ruby
[21:05:45] SaschaVoid: has joined #ruby
[21:08:21] solocshaw: has joined #ruby
[21:13:43] Fysicus: has joined #ruby
[21:15:00] nertzy: has joined #ruby
[21:16:11] agent_white: has joined #ruby
[21:16:41] belmoussaoui__: has joined #ruby
[21:17:54] Fira_: has joined #ruby
[21:21:13] tobbie: has joined #ruby
[21:23:13] bkxd: has joined #ruby
[21:25:33] username1: has joined #ruby
[21:26:32] chopin: has joined #ruby
[21:31:11] SaschaVoid: has joined #ruby
[21:32:56] Puffball: has joined #ruby
[21:33:46] faelkle: has joined #ruby
[21:33:47] faelkle: has joined #ruby
[21:36:16] hahuang65: has joined #ruby
[21:36:39] ddffg: has joined #ruby
[21:37:49] marr: has joined #ruby
[21:43:50] dasher00: has joined #ruby
[21:47:57] otherj: has joined #ruby
[21:54:25] dzodzo: has joined #ruby
[21:54:37] segy: has joined #ruby
[21:57:46] banisterfiend: has joined #ruby
[21:58:48] ur5us: has joined #ruby
[22:02:44] olivier__: has joined #ruby
[22:03:42] gothicsouth: has joined #ruby
[22:04:12] mjuszczak: has joined #ruby
[22:07:13] cfec0b8d: has joined #ruby
[22:10:45] ahrs: has joined #ruby
[22:21:36] ruby[bot]: -b *!*@ip1f11f87f.dynamic.kabel-deutschland.de$#ruby-banned
[22:42:14] nadir: has joined #ruby
[22:48:12] br0d1n: has joined #ruby
[22:48:54] Fira_: has joined #ruby
[22:59:18] segy: has joined #ruby
[22:59:58] nkts: has joined #ruby
[23:04:55] hutch34_: has joined #ruby
[23:05:41] Rodya_: has joined #ruby
[23:11:13] chat_: has joined #ruby
[23:13:51] Rodya_: has joined #ruby
[23:22:41] ddffg: has joined #ruby
[23:23:12] jcao219: has joined #ruby
[23:37:06] hahuang65: has joined #ruby
[23:40:29] belmoussaoui: has joined #ruby
[23:42:02] vincent_: has joined #ruby
[23:42:29] muelleme: has joined #ruby
[23:49:02] alveric3: has joined #ruby
[23:55:27] username1: has joined #ruby
[23:59:55] bvcosta: has joined #ruby