« Back to channel list

#ruby - 18 June 2015

« Back 1 day Forward 1 day »
[00:00:51] robbyoconnor: has joined #ruby
[00:02:34] bkxd: has joined #ruby
[00:03:09] bricker: has joined #ruby
[00:06:08] _blizzy_: has joined #ruby
[00:06:32] sharpmachine: has joined #ruby
[00:07:52] blackmesa: has joined #ruby
[00:09:24] episage: how to execute a method in ruby which from inside the class?
[00:09:37] episage: @parse_serp does not work
[00:09:52] RickHull: the @ indicates an ivar, a variable not a method
[00:11:05] baweaver: has joined #ruby
[00:11:13] episage: RickHull: so it must be w/o @
[00:11:19] episage: yeah, works now
[00:11:33] episage: ruby is cool
[00:11:59] cabreraM516: has joined #ruby
[00:12:10] saadq: has joined #ruby
[00:12:29] cabreraM516: has joined #ruby
[00:12:32] bkxd: has joined #ruby
[00:13:22] sevenseacat: has joined #ruby
[00:14:20] rbowlby: has joined #ruby
[00:15:02] davec_: has joined #ruby
[00:15:40] jpfuentes2: has joined #ruby
[00:16:35] fgo: has joined #ruby
[00:16:39] rbowlby_: has joined #ruby
[00:19:11] GitGud: has joined #ruby
[00:20:01] GitGud: has joined #ruby
[00:22:10] andywojo: Does anyone use ruby not for rails / web, but purely as a sysadmin tool for automation / scripts?
[00:22:14] pontiki: has joined #ruby
[00:22:16] andywojo: It's awesome.
[00:22:44] mozzarella: I use it primarily for scripts
[00:22:55] mozzarella: but I must admit that I've used rails a few times
[00:23:12] mozzarella: I don't like webdev though
[00:23:28] growlove: has joined #ruby
[00:23:52] pontiki: you don't like moving and displaying data?
[00:23:52] workmad3: has joined #ruby
[00:24:48] miah: i only use ruby for sysadmin / script / tools kinda stuff.
[00:24:50] pontiki: good choice :)
[00:24:57] episage: how to conver struct to CSV file?
[00:25:09] volty: andy I can't imagine something better than Ruby for sysadmin. There's a book around, google (or emule, or torrent)
[00:25:21] episage: emule still lives?
[00:25:30] episage: its soooo oldd
[00:25:50] pontiki: volty: the awesome command line one?
[00:26:06] miah: i used to have that 'ruby for sysadmins' book; it was alright. i think that 'working with unix processes' was better though
[00:26:10] ayonkhan: has joined #ruby
[00:26:34] charliesome: has joined #ruby
[00:26:43] volty: pontiki: are you asking about the book's name (sorry, I am quite fuzzy) ?
[00:26:56] miah: http://www.jstorimer.com/products/working-with-unix-processes
[00:26:59] pontiki: yeah, i can't think of the full title
[00:27:07] quimrstorres: has joined #ruby
[00:27:10] miah: http://www.amazon.com/Practical-System-Administration-Experts-Source/dp/1590598210
[00:27:18] AndroidLoverInSF: has joined #ruby
[00:28:18] volty: ??Everyday scripting with Ruby??, Pragmatic programmers
[00:28:31] pontiki: "build awesome command line applications in ruby" dave copeland
[00:28:37] shazaum_: has joined #ruby
[00:29:13] volty: file:///home/volty/_links/books/prog/ruby/pdf/Ruby for System Administration, Apress (2007).pdf
[00:29:29] volty: (though the link won't work :) )
[00:29:57] x1337807x: has joined #ruby
[00:30:40] pontiki: that looks like it would be good intro, too
[00:31:08] theery: has joined #ruby
[00:31:41] miah: ah ya, everyday scripting. it was better than the practical systems admin w/ ruby book
[00:31:57] dgutierrez1287: has joined #ruby
[00:32:20] theery: has joined #ruby
[00:32:46] volty: pity I know enough (for what I need) and won't read them. Though I read something and if I remember well miah is right
[00:32:51] miah: build awesome command line apps was alright too.
[00:33:18] robustus|Off: has joined #ruby
[00:33:20] miah: i just picked up https://pragprog.com/book/atcrime/your-code-as-a-crime-scene
[00:33:31] pontiki: everyone seems to want to learn rails (which i don't mind so much) but a book like that, about learning ruby to solve your own problems, i think is a much better into to the language
[00:33:37] simplyianm: has joined #ruby
[00:34:04] volty: pontiki: absolutely !
[00:34:16] andywojo: I'm really awesome at ruby sysadmin type scripts, like I've done some pretty gnarly automation working with large datasets and complex stuff but... I cannot for the life of me wrap my head around rails / webdev
[00:34:24] pragmatism: has joined #ruby
[00:34:26] pontiki: learning how to systematically and *practically* solve problems is the essence of programming and the craft of software, to me
[00:34:32] miah: i have written a bunch of nagios/sensu checks. started out with mixlib-shellout and such but i've learned option parser pretty well now
[00:34:33] CloCkWeRX: has joined #ruby
[00:34:56] miah: thor is neat too, used that a few times
[00:35:02] volty: so many people think that programming could be learn the way they learned their phones, touching & clicking
[00:35:08] pontiki: i've been using thor a lot lately
[00:35:12] miah: but option parser is stdlib so its easy to grab
[00:35:24] pontiki: just basically good to know
[00:36:06] pontiki: copeland's gems are kinda nifty, too, but i've moved away from them
[00:36:08] cabreraM516: has joined #ruby
[00:36:22] miah: which ones?
[00:36:27] pontiki: methadone and GLI
[00:36:40] miah: oh i used gli while reading the book
[00:36:42] miah: but never again
[00:37:20] pontiki: for the scripts i've done that are that multi-command thing, i like thor better
[00:37:40] miah: i usually just 'bundle gem <foo>' and work from there
[00:37:43] stardiviner: has joined #ruby
[00:37:48] miah: otherwise methadone looks neat
[00:38:21] miah: i am hacking some ldap management tools, have a ton of cli options and environment variables to deal with
[00:38:35] pontiki: ACTION nods
[00:38:53] miah: been hard to be... concise? with option parser
[00:39:04] pontiki: i decided methadone put too much emphasis on testing via the command line
[00:39:44] miah: i just write units with minitest
[00:40:09] oorst: has joined #ruby
[00:40:44] miah: argv is just an array, easy to pass in what you want without actually having to ./foo.rb
[00:41:10] episage: Is it possible to convert a struct to an array?
[00:41:25] pontiki: if you write a to_a method for it
[00:41:34] volty: everything could be converted to an array
[00:42:07] episage: ok but there is no automatic mechanism so i have to write to_a as pontiki sugessted
[00:42:26] miah: http://ruby-doc.org/core-2.2.0/Struct.html#method-i-to_a
[00:42:31] pontiki: there's already one in the Struct class, if you just want the instance vars, you should be set
[00:42:33] fujimura: has joined #ruby
[00:42:48] mcclurmc_: has joined #ruby
[00:43:03] nietzschette: has joined #ruby
[00:43:03] pontiki: a hash seems more useful than an array, tho
[00:43:18] duderonomy: has joined #ruby
[00:43:42] milesmatthias: has joined #ruby
[00:43:58] volty: if you need the keys
[00:44:13] nietzschette: I usually just use numbers to identify, so I don't really need hashes
[00:44:26] miah: interesting
[00:44:32] pyon: has joined #ruby
[00:44:36] pontiki: how are you creating the Struct?
[00:45:37] wallerdev: has joined #ruby
[00:46:16] nietzschette: with great ambiguity
[00:46:20] amclain: has joined #ruby
[00:48:50] Akagi201: has joined #ruby
[00:50:47] nietzschette: has left #ruby: ("Leaving")
[00:52:38] jenrzzz: has joined #ruby
[00:55:23] dstarh: has joined #ruby
[00:56:07] blackmesa: has joined #ruby
[00:59:04] episage: miah: pontiki : thanks guys, you saved a lot of my time :) <33
[00:59:32] LMity: has joined #ruby
[01:01:03] luckyme: has joined #ruby
[01:03:01] allomov: has joined #ruby
[01:03:54] mary5030: has joined #ruby
[01:04:07] musgravejw: has joined #ruby
[01:05:23] lkba: has joined #ruby
[01:07:01] fabrice31: has joined #ruby
[01:07:06] jenrzzz: has joined #ruby
[01:07:08] simplyianm: has joined #ruby
[01:08:12] swills: has joined #ruby
[01:09:02] luckyme: has joined #ruby
[01:11:14] bronson: has joined #ruby
[01:14:38] Rubie: has joined #ruby
[01:14:46] Cust0sLim3n: has joined #ruby
[01:16:30] episage: how to disable printing "UTC" in Time.now.utc?
[01:16:37] episage: (at the end)
[01:17:32] BanzaiJoe: has joined #ruby
[01:17:33] sharpmachine: has joined #ruby
[01:19:57] avahey: has joined #ruby
[01:19:57] Oog: has joined #ruby
[01:20:21] krisquigley: has joined #ruby
[01:20:54] al2o3-cr: episage: #strftime
[01:21:00] tkuchiki: has joined #ruby
[01:21:06] episage: al2o3-cr: thx
[01:21:07] episage: time.strftime("%Y-%m-%d %H-%M-%S")
[01:21:34] al2o3-cr: >> t = Time.now; t.strftime("%F %T")
[01:21:35] ruboto: al2o3-cr # => "2015-06-18 01:21:34" (https://eval.in/383464)
[01:21:49] theery: has joined #ruby
[01:22:02] tkuchiki_: has joined #ruby
[01:24:07] Radar: Time.now.utc.to_s.gsub(" UTC", "")
[01:24:18] miah: was going to suggest that
[01:24:23] Radar: I am trolling.
[01:24:28] miah: but using tr =)
[01:24:54] bgmarx: has joined #ruby
[01:25:44] ponga: has joined #ruby
[01:25:53] MatthewsFace: has joined #ruby
[01:26:09] al2o3-cr: tr is faster than gsub right?
[01:27:29] mrmargolis: has joined #ruby
[01:27:55] quimrstorres: has joined #ruby
[01:27:59] dstarh: has joined #ruby
[01:28:14] ItSANgo: has joined #ruby
[01:28:43] Yzguy: has joined #ruby
[01:29:18] bruno-: has joined #ruby
[01:30:29] miah: https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code
[01:30:37] _whitelogger: has joined #ruby
[01:31:20] al2o3-cr: hmm, quite a bit faster :)
[01:31:45] BanzaiJoe: lol, did the double fist pump for victory, then realized I forgot what I was trying to do
[01:32:21] nahtnam: has joined #ruby
[01:33:14] al2o3-cr: ACTION gotta start using tr
[01:33:27] miah: check this out
[01:33:28] miah: https://github.com/DamirSvrtan/fasterer
[01:33:56] fgo: has joined #ruby
[01:34:02] nofxx: has joined #ruby
[01:34:14] al2o3-cr: miah: awesome :)
[01:34:21] drewo: has joined #ruby
[01:34:22] veinofstars: has joined #ruby
[01:35:24] postmodern: why am i getting uninitialized constant JSON::Iconv
[01:35:36] postmodern: with the json gem 0.4.3
[01:35:42] postmodern: under ruby-2.1.6
[01:36:04] al2o3-cr: because it doesn't exist?
[01:36:35] BanzaiJoe: I'm cornfused.....
[01:36:55] BanzaiJoe: Time.at(someNumber) is class Time. Assign it to a variable -> class Time
[01:37:25] BanzaiJoe: add a variable of Time to Time.at(someNumber) get type error.... I'm innocent , go easy on me
[01:37:47] postmodern: miah, al2o3-cr, http://pastebin.com/Q36UWj4J
[01:37:48] ruboto: postmodern, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/8e56e087758b553f78b6
[01:37:48] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[01:37:50] Rubie: has joined #ruby
[01:38:28] BanzaiJoe: >> a = Time.at(100); a + Time.at(777);
[01:38:29] ruboto: BanzaiJoe # => time + time? (TypeError) ...check link for more (https://eval.in/383467)
[01:38:49] BanzaiJoe: what am I thinking incorrectly?
[01:39:33] mozzarella: time != duration
[01:39:45] miah: isnt that a wicked old version? 0.4.3 is from 2007?
[01:39:50] shevy: now = Time.now # => 2015-06-18 03:39:40 +0200
[01:39:52] mozzarella: doesn't make sense to add two times together
[01:39:58] shevy: now + 5 # => 2015-06-18 03:39:45 +0200
[01:40:01] shevy: we added 5 seconds
[01:40:11] shevy: to a class Time object
[01:40:15] BanzaiJoe: ahhhhhh, gotcha, thank you
[01:40:45] miah: 0.4.3 isn't even tagged in json github
[01:40:48] shevy: but if we add now + now
[01:40:55] shevy: we will get "TypeError: time + time?"
[01:40:56] BanzaiJoe: my brain is still recovering
[01:41:04] BanzaiJoe: let's not add now + now ;)
[01:41:19] shevy: hmm there must be some way to convert this into seconds
[01:41:35] shevy: .to_i perhaps?
[01:41:43] Aeyrix: I can't tell if you're doing incremental teaching
[01:41:45] shevy: or perhaps not, I have no idea
[01:41:47] Aeyrix: or if you're actually asking a question
[01:41:50] Aeyrix: because to_i is what you want
[01:41:57] Aeyrix: it converts time to a unix timestamp
[01:42:00] shevy: I am extending our collective minds Aeyrix
[01:42:05] Aeyrix: which is seconds since Jan 1 1970
[01:42:14] shevy: we are like the BORG now
[01:42:15] BanzaiJoe: you can Time.mktime and subtract it
[01:42:38] shevy: see? ^^^ he is becoming smarter and smarter by the second
[01:42:43] shevy: soon he will teach us
[01:42:46] BanzaiJoe: ba-doomp-doomp
[01:43:35] renderful: has joined #ruby
[01:44:06] shevy: I need some way to assess how many non-bots download gems
[01:45:00] shevy: would it be logical to assume that if you add a gem that states "useless for others", 30.000 downloads would happen
[01:45:35] eam: a much harder challenge is to figure out how to do a time delta with subsecond precision, without losing precision
[01:45:40] milesmatthias: has joined #ruby
[01:46:10] eam: I'm not sure if Time can do it
[01:46:40] eam: ah yes it can
[01:47:04] elektronaut: yeah, it takes floats
[01:47:09] eam: elektronaut: floats can't do it
[01:47:14] BanzaiJoe: http://ruby-doc.org/core-2.2.2/Time.html
[01:47:17] eam: it'll take two separate subtractions
[01:47:52] jpfuentes2: has joined #ruby
[01:47:59] eam: if you use floats for time intervals you'll quickly notice that the times don't add up
[01:49:09] dgutierrez1287: has joined #ruby
[01:49:18] drewo: has joined #ruby
[01:49:20] pontiki: Time, the Avenger
[01:49:27] eam: >> t = Time.now;sleep 0.1; t2 = Time.now; sec_delta, nsec_delta = t2.sec - t.sec, t2.nsec - t.nsec
[01:49:28] ruboto: eam # => [0, 100470638] (https://eval.in/383471)
[01:50:26] eam: lots of time values which are valid as absolute nsec, but not valid as base 2 fractions of 1 sec
[01:50:46] drdave: has joined #ruby
[01:51:05] fgo: has joined #ruby
[01:52:20] drdave: has joined #ruby
[01:52:51] eam: oh, actually #sec doesn't give you time_t so that won't even do it, uhhhh
[01:53:32] eam: I guess you use t.to_i and t.nsec
[01:53:45] eam: that's somewhat incongruent
[01:55:13] eam: ah it's got tv_sec and tv_usec for the direct timeval values -- that's what you need
[01:56:41] Rubie: has joined #ruby
[01:57:30] RegulationD: has joined #ruby
[01:58:47] darkf: has joined #ruby
[01:59:11] s2013: has joined #ruby
[02:03:08] NeverDie: has joined #ruby
[02:04:31] LarryLv: has joined #ruby
[02:04:54] NeverDie: has joined #ruby
[02:05:03] LarryLv: has left #ruby: ()
[02:08:32] dgutierrez1287: has joined #ruby
[02:08:35] laurentide: has joined #ruby
[02:08:58] arya_: has joined #ruby
[02:09:37] penzur: has joined #ruby
[02:12:07] drdave: does anyone know of an alternative to rplot to do basic graphic in ruby?
[02:12:27] drdave: something that would preferably also use libplot or have a very similar syntax?
[02:12:33] workmad3: has joined #ruby
[02:13:14] drdave: trying to get an old codebase running and have to give up on trying to install rplot???
[02:13:30] datanoise: has joined #ruby
[02:13:57] balazs: has joined #ruby
[02:16:23] RickHull: https://github.com/pioz/rplot ?
[02:17:28] x1337807x: has joined #ruby
[02:18:21] RickHull: https://packages.debian.org/jessie/ruby-gsl # might be interesting
[02:18:42] drdave: RickHull: rplot is the one used by the code...
[02:18:47] drdave: but it seems terminally broken...
[02:18:50] sharpmachine: has joined #ruby
[02:18:57] drdave: or more exactly, the install is...
[02:19:18] drdave: i spent a while trying to figure why it wasn???t detecting the lib and i???m about to give up
[02:20:50] RickHull: did you install the prereqs?
[02:20:54] drdave: i???ll have a look at ruby-gsl, but i???m afraid it???s more science functions than graphics...
[02:20:57] eggoez: has joined #ruby
[02:21:26] drdave: oh, i did??? but for whatever reason, it just won???t find them??? looked at the extconf.rb and it is definitely looking at the right lib dir
[02:22:01] drdave: i???m starting to suspect that the routine it is looking for might not even exist any more (libplot doc tells me it is legacy but still provided???)
[02:22:18] jpfuentes2: has joined #ruby
[02:23:52] fgo: has joined #ruby
[02:23:55] hahuang65: has joined #ruby
[02:25:00] j4cknewt: has joined #ruby
[02:26:06] jwaldrip_: has joined #ruby
[02:26:23] hahuang65: has joined #ruby
[02:28:17] fujimura: has joined #ruby
[02:28:32] quimrstorres: has joined #ruby
[02:29:54] ItSANgo: has joined #ruby
[02:30:13] A205B064: has joined #ruby
[02:31:46] ItSANgo__: has joined #ruby
[02:31:58] sdwrage: has joined #ruby
[02:33:38] Oog: has joined #ruby
[02:34:58] jtdoncas: has joined #ruby
[02:36:01] ItSANgo: has joined #ruby
[02:38:06] ItSANgo: has joined #ruby
[02:38:50] volsus: has joined #ruby
[02:40:52] ItSANgo: has joined #ruby
[02:41:59] kahuna_: has joined #ruby
[02:42:07] kLooaa: has joined #ruby
[02:42:14] kLooaa: Do you realize that basically after age 20 your body starts rotting, being worse and worser at everything? and that includes your brain too? you will eventually be stupid and naive just like children. or worse - you can get alzheimer's disease. If you are alive now, I guarantee you that you will die eventually. And it can be really painful dying. Just read news or statistics how many people die in what ways DAILY. You will become one of them eventually. One
[02:42:15] kLooaa: of that statistics number. nothing more.
[02:43:04] platzhirsch: has left #ruby: ()
[02:43:11] kahuna_: kLooaa: dont you think that's looking at the cup as half empty?
[02:43:25] kLooaa: kahuna_: thats looking at reality
[02:43:37] kLooaa: without purple glasses on
[02:43:45] kahuna_: kLooaa: reality is how you precieve it
[02:44:19] kLooaa: I perceive it without FILTERS and brainwashing
[02:44:26] kLooaa: im external oberver
[02:44:42] kLooaa: and I look at people, they suffer
[02:45:02] RickHull: brainwashing prevents alzheimers. you just gotta hose it down every once in a while
[02:45:05] kahuna_: And others enjoy an incredible life
[02:45:44] francoi__: has joined #ruby
[02:46:32] milesmatthias: has joined #ruby
[02:46:34] ItSANgo: has joined #ruby
[02:46:44] kLooaa: kahuna_: until they have horrible accident or get old
[02:46:47] kLooaa: its only temporary
[02:46:51] shevy: well you always have filters, all the time
[02:46:54] kLooaa: eventually all humans end very badly
[02:47:05] kLooaa: shevy: I destroyed filters
[02:47:09] shevy: your own perception filters information or how your own brain tricks you; remember those eye-tricks about 3D vs. 2D sketches
[02:47:15] RickHull: no shevy, kLooaa is beyond filters
[02:47:34] RickHull: he perceives reality directly and is here to tell us about it
[02:47:43] shevy: he is a limited system
[02:47:48] shevy: without food he could not even type
[02:48:01] kLooaa: shevy: Yes but I was talking about THINKING filters
[02:48:10] kLooaa: not seeing filters
[02:48:31] shevy: illusions
[02:48:59] kLooaa: people are optimistic
[02:49:01] shevy: the river of DNA goes on and on
[02:49:05] kLooaa: so they see bad things as good
[02:50:12] RickHull: what bad things do you see as good, kLooaa?
[02:50:25] kLooaa: RickHull: NOT ME. humans
[02:50:33] RickHull: what are you then?
[02:50:45] ItSANgo: has joined #ruby
[02:51:18] kLooaa: RickHull: observer
[02:51:50] RickHull: do you have blood? is it pumped by a heart?
[02:52:17] shevy: he is a pessimist
[02:52:26] shevy: so he has a filter that downgrades input
[02:52:51] idafyaid: has joined #ruby
[02:52:52] idafyaid: has joined #ruby
[02:52:57] kLooaa: RickHull: I hate it
[02:53:13] kLooaa: shevy: input is so shitty, doesnt need to downgrade it more
[02:53:36] shevy: but you filter it, all the time
[02:53:51] shevy: you don't have all objective information given to you in the first case
[02:53:57] shevy: like if you are short-sighted
[02:54:02] shevy: and everything is a blur
[02:54:04] drdave: does anyone have experience using mkmf?
[02:54:04] ItSANgo: has joined #ruby
[02:54:04] kLooaa: I have much more than others
[02:54:14] drdave: this is driving me a bit bonkers???
[02:54:17] kLooaa: others just ignore their death and suffering
[02:54:52] drdave: lib most definitely have binding (i created a test C project that links and uses it fine), but ???have_library(???lib???, ???func???) returns false for anything but main
[02:55:11] drdave: any tip on how i could debug that?
[02:55:30] drdave: (i suppose the only explanation is that somehow it is not finding the right library)
[02:55:56] kLooaa: drdave: Do you realize that basically after age 20 your body starts rotting, being worse and worser at everything? and that includes your brain too? you will eventually be stupid and naive just like children. or worse - you can get alzheimer's disease. If you are alive now, I guarantee you that you will die eventually. And it can be really painful dying. Just read news or statistics how many people die in what ways DAILY. You will become one of them eventua
[02:55:57] kLooaa: lly. One of that statistics number. nothing more.
[02:56:10] ruboto: +q kLooaa!*@*
[02:56:10] ruboto: -o ruboto
[02:56:56] psye: has joined #ruby
[02:57:00] ItSANgo: has joined #ruby
[02:57:48] hoelzro: drdave: which OS are you on? what library is mkmf failing to find?
[02:58:01] drdave: hoelzro: OSX and libplot
[02:58:08] drdave: it???s definitely there...
[02:58:11] hoelzro: drdave: is libplot installed to /usr/local?
[02:58:21] drdave: and it actually finds it (or at least returns true for the ???main??? binding)
[02:58:37] hoelzro: that's probably why
[02:58:54] Spami: has joined #ruby
[02:59:03] drdave: if it did not find it at all, i would indeed suspect a path issue (but i???m setting it)
[02:59:08] hoelzro: I'm not an OS X expert, but I'm guessing /usr/local/include is not in the default ld search path
[02:59:18] hoelzro: drdave: it finds main because main is a symbol in the test program
[02:59:22] hoelzro: it doesn't come from libplot
[02:59:23] drdave: I have a LIB_DIRS = [ ???/usr/local/lib???] in there
[02:59:38] drdave: shouldn???t it only look for main *in* the library?
[02:59:46] drdave: i thought that was what the doc said...
[02:59:47] ItSANgo: has joined #ruby
[03:00:24] drdave: otherwise what would be the point of have/find_library(???lib???, nil)?
[03:00:29] hoelzro: drdave: usually how those programs work is they compile something like this:
[03:00:45] hoelzro: #include <mylib.h> int main(void) { void *sym = {{symbol_name}}; return 0 }
[03:00:56] hoelzro: where symbol_name is the second argument to have_library
[03:01:37] drdave: i???m looking at mkmf log now...
[03:02:06] kahuna_: has joined #ruby
[03:02:13] RobertBirnie: has joined #ruby
[03:02:22] mdz_: has joined #ruby
[03:03:03] ItSANgo: has joined #ruby
[03:03:56] kLooaa: has left #ruby: ()
[03:04:32] drdave: hmn. i???m starting to suspect a 32/64 bit thing...
[03:04:54] damien1: has joined #ruby
[03:05:21] ItSANgo: has joined #ruby
[03:05:39] krz: has joined #ruby
[03:05:40] Cache_Money: has joined #ruby
[03:05:44] RobertBirnie: has joined #ruby
[03:05:47] arooni-mobile: has joined #ruby
[03:05:51] shevy: oh sevenseacat you are here, lookie:
[03:06:02] shevy: It is now verified through scientific methods, that cat videos are good for the people: http://www.eurekalert.org/pub_releases/2015-06/iu-npv061615.php
[03:06:28] fujimura: has joined #ruby
[03:06:35] shevy: "the most popular sites for viewing cat videos were Facebook, YouTube, Buzzfeed and I Can Has Cheezburger"
[03:07:01] damien1: Hey guys, I'm trying to regex "'s" out of a string. So far I have str.gsub(/\'+s/, "") but that doesn't work. can anyone help?
[03:08:10] eam: damien1: why the + after the single quote?
[03:08:29] eam: damien1: also, are you saying str = str.gsub() or are you just saying str.gsub() ?
[03:08:45] shevy: >> "abcdef'shij's".tr("'s",'')
[03:08:46] ruboto: shevy # => "abcdefhij" (https://eval.in/383485)
[03:08:52] shevy: let me test
[03:08:54] shevy: >> "sabcdef'shij's".tr("'s",'')
[03:08:55] ruboto: shevy # => "abcdefhij" (https://eval.in/383486)
[03:08:58] shevy: ah yes, damn
[03:09:14] ponga: what's this tr is faster than gsub ?
[03:09:23] krisquigley: has joined #ruby
[03:09:47] shevy: .gsub is slowest
[03:09:51] eam: it oughta be
[03:09:52] shevy: .delete and .tr will be faster
[03:09:54] shevy: >> "sabcdef'shij's".gsub(/'s/,'')
[03:09:55] ruboto: shevy # => "sabcdefhij" (https://eval.in/383487)
[03:09:58] shevy: damien1 that works? ^^^
[03:10:03] ponga: tr does similar job as gsub?
[03:10:10] haasn: has joined #ruby
[03:10:11] shevy: not completely
[03:10:11] eam: ponga: different mechanics
[03:10:15] shevy: .gsub is the most powerful one
[03:10:19] shevy: .delete is the simplest
[03:10:23] shevy: .tr is somewhere in between
[03:10:31] shevy: there is also .sub
[03:10:52] ponga: so gsub is versatile one
[03:11:30] eam: yeah gsub uses regex, the others do not
[03:11:32] Ox0dea: has joined #ruby
[03:11:38] haasn: I'm not very familiar with ruby. I found a project on the internet that I would like to modify, but I can't figure out how to test my changes. I can use `gem build project.gemspec` in order to successfully build the project (and I can also use `rake` to.. do something. There's a Rakefile. Seems to be some kind of test framework?), but I can't figure out how to run the project now that I've build it (and
[03:11:40] haasn: produced a .gem file)
[03:11:45] damien1: shevy: unfortunately it doesn't.. O.o
[03:11:57] damien1: I must have mistyped something
[03:12:06] haasn: Is it possible to run the project without having to install it first?
[03:12:08] braincrash: has joined #ruby
[03:12:09] shevy: did it not remove all 's in the example string above
[03:12:29] shevy: haasn you have built a .gem file
[03:12:33] houhoulis: has joined #ruby
[03:12:33] shevy: that is like an archive
[03:12:36] shevy: now you must install it
[03:12:36] eam: haasn: run rake -T
[03:12:42] shevy: e. g. gem install ./name-of-gem-file-here.gem
[03:13:15] ponga: thank you shevo i was going to tell him exact same thing
[03:13:23] baweaver: has joined #ruby
[03:13:29] eam: well that's not entirely true
[03:13:31] penzur: has joined #ruby
[03:13:37] eam: odds are it has tests he can run before installing the gem
[03:13:38] haasn: eam: Ah, useful; there's `rake build`, `rake install`, `rake install:local`, `rake release` and `rake spec`; but apparently nothing like `rake run` :(
[03:13:56] eam: haasn: spec is a testing framework, give that a spin
[03:14:41] haasn: eam: Yeah that seems to work well enough, I guess what I should be doing is modifying the spec file to add tests for the new functionality I'm adding, so I can test it through `rake spec`?
[03:14:51] damien1: shevy: it works in IRB, but not in my .rb file.. can I pastebin?
[03:14:59] shevy: damien1 gist
[03:15:06] shevy: not pastebin :D
[03:15:15] shevy: btw if it works in IRB
[03:15:20] shevy: then it should work in your .rb file
[03:15:23] haasn: I would still just really like the ability to just say ???hey, run this file for me please??? without having to install it into my global/local environment, sort of like running `make && ./binary` but not `make install` in a traditional C program
[03:15:45] shevy: haasn you can provide the path to ruby via e. g. ruby -r
[03:15:52] eam: haasn: rspec will run the tests on your local source tree
[03:16:53] eam: RUBYLIB=/path/to/your/sources/lib whatever.rb
[03:17:10] bmalum: has joined #ruby
[03:17:13] haasn: eam: That works exactly as expected, thanks
[03:17:20] mdz_: has joined #ruby
[03:17:26] eam: haasn: if you come from C, consider RUBYLIB as ruby's equiv to LD_LIBRARY_PATH
[03:18:03] haasn: Right, makes sense. Incidentally, does ruby have something like Cabal's ???sandboxes???? where I can just say eg. ???cabal sandbox init??? and then get a virtual local environment into which I can ???cabal install??? dependencies without cluttering up my system
[03:18:11] haasn: (and even ???cabal install??? the local program itself)
[03:18:20] eam: yes, bundler and rvm are common tools for that in development
[03:18:50] bruno-: has joined #ruby
[03:18:56] eam: rvm will help you manage multiple rubies (different versions per project perhaps) and bundler manages gemsets, you'll create a Gemfile for a project outlining exactly the gems to use
[03:19:20] damien1: shevy: https://gist.github.com/damienr74/7f999ebd4416c35496fe
[03:19:27] sharpmachine: has joined #ruby
[03:19:31] Ox0dea: Is rvm no longer catching flak for mucking about with the standard utilities?
[03:19:39] maknz: has joined #ruby
[03:19:44] eam: Ox0dea: I hope not
[03:20:27] ItSANgo: has joined #ruby
[03:20:32] Ox0dea: It does it well enough as to rarely present a problem, but redefining `cd` is still unnecessarily invasive.
[03:20:33] jenrzzz: has joined #ruby
[03:20:41] eam: yeah it's ugly
[03:21:11] eam: (but I feel the same way about bundler and gem so ... :)
[03:21:33] mois3x: has joined #ruby
[03:22:12] ItSANgo: has joined #ruby
[03:22:21] eam: if I had my way I'd do away with gems entirely and rely on $:
[03:22:31] claptor: has joined #ruby
[03:23:03] eam: but, you know, Sustrik's Law
[03:23:03] drdave: hoelzro: think i fixed it!
[03:23:13] hoelzro: yeah? how'd you do it?
[03:23:40] drdave: hoelzro: for future reference, problem came from PoS rvm trying to install 32bits and the lib being 64bits only
[03:24:06] drdave: no idea why it wouldn???t install in 64??? but rebuilding the lib to have both seems to have done the trick
[03:24:13] drdave: thanks for holding my hand through it...
[03:24:15] ramfjord: has joined #ruby
[03:24:51] hoelzro: I didn't do much, I'm afraid
[03:25:05] drdave: without pointing out that the ???main??? returning true was meaningless, it???d still be there
[03:25:26] drdave: the log was a mess to read, but the mention of warning regarding incompatible binary did put me on the track
[03:25:42] swgillespie: has joined #ruby
[03:26:50] ellisTAA: has joined #ruby
[03:27:08] drdave: now i just have to make sense of the mess of gem directories on osx, but that???s the easy part
[03:27:28] damien1: Can anyone help me troubleshoot removing a "'s" in a string? https://gist.github.com/damienr74/7f999ebd4416c35496fe
[03:28:42] ItSANgo__: has joined #ruby
[03:28:45] Ox0dea: Ruby's test suite contains 2,236,237 assertions.
[03:28:50] Ox0dea: That's a lot.
[03:29:13] iamse7en: has joined #ruby
[03:29:20] swgillespie: has joined #ruby
[03:29:32] ponga: >> "string".delete("s")
[03:29:33] ruboto: ponga # => "tring" (https://eval.in/383488)
[03:29:40] nietzschette: has joined #ruby
[03:29:41] freerobby: has joined #ruby
[03:29:59] ponga: does this suit you?
[03:30:00] Ox0dea: >> 'strings'.delete('s')
[03:30:01] ruboto: Ox0dea # => "tring" (https://eval.in/383489)
[03:30:15] penzur: has joined #ruby
[03:30:43] eam: damien1: @@passage = @@passage.tr()
[03:30:52] eam: damien1: OR, you can say @@passage.tr!()
[03:31:22] eam: the version with a ! modifies its receiver, the version without returns a new string with the changes (which you're ignoring)
[03:31:27] datanoise: has joined #ruby
[03:32:08] damien1: eam: now it removes any "s"
[03:32:21] haasn: eam: Hmm, unfortunately the RUBYLIB= trick does not work on my server (the machine that I was going to test it on), it only works locally. On the server, it complains about require not being able to find 'json', even though both bundler and gem agree that json is installed just fine; *and* the program works fine when I run it normally (after gem install)!
[03:32:46] eam: damien1: yeah, tr "abc", "" will remove any a, b or c
[03:32:54] eam: damien1: you'll need gsub to remove patterns
[03:33:29] damien1: eam: I used to have that, but still couldn't make it work
[03:33:36] eam: damien1: share the code?
[03:33:36] Ox0dea: haasn: Which version of Ruby is your server running?
[03:33:46] penzur: has joined #ruby
[03:34:02] eam: haasn: what Ox0dea said, I would guess you have something playing with your environment there
[03:34:07] ItSANgo__: has joined #ruby
[03:34:12] haasn: Ox0dea: 1.8.7 and nothing else
[03:34:35] damien1: .gsub(/\'s/, "")
[03:34:43] damien1: eam: .gsub(/\'s/, "")
[03:34:45] haasn: (The machine on which it works has 1.9, 2.0, 2.1 and 2.2)
[03:34:58] eam: damien1: same rules as with tr() and tr!(), gsub() and gsub!()
[03:35:18] damien1: eam: yeah that was good too haha
[03:36:35] penzur: has joined #ruby
[03:36:40] damien1: eam: Ohh i had "'+s"
[03:37:03] eam: you know, we were talking about gsub being slower than tr, but a good implementation of gsub can be extremely faster than tr in certain datasets
[03:37:29] damien1: thanks y'all <3
[03:37:54] eam: because gsub doesn't necessarily have to examine every character in the source string, but tr does
[03:38:24] penzur: has joined #ruby
[03:38:52] armyriad: has joined #ruby
[03:40:22] closer: has joined #ruby
[03:41:03] tkuchiki: has joined #ruby
[03:42:18] CloCkWeRX: has joined #ruby
[03:44:36] Ox0dea: haasn: You have to explicitly require 'rubygems' on 1.8.7.
[03:45:03] Ox0dea: I take it you're doing that?
[03:45:30] eam: supporting 1.8.7 warms my heart
[03:45:37] gix: has joined #ruby
[03:45:44] Ox0dea: It's like compiling your C programs with -ansi -pedantic.
[03:46:09] eam: it's like compiling your C programs with a pre-ansi k&r compiler
[03:46:27] eam: sorta the same language, but not really
[03:46:44] Ox0dea: The only differences are syntactic ones, no?
[03:47:03] eam: I mean, is there a different kind?
[03:47:52] eam: making a joke, but there's all kinds of crazy changes. Scoping behavior, methods change behavior, added, removed, etc
[03:48:20] eam: and new syntaxes
[03:48:46] haasn: How can I figure out what constants something defines? Specifically, Socket::Constants. I can't seem to find documentation on this anywhere
[03:49:22] Ox0dea: haasn: Socket::Constants.constants
[03:49:41] Ox0dea: Totally unintuitive, I know. :P
[03:49:48] jack_rabbit: has joined #ruby
[03:50:06] michaeldeol: has joined #ruby
[03:50:50] haasn: Ah, that works - thanks. Strange that ruby-doc doesn't list them anywhere!
[03:50:57] haasn: (Or maybe I just can't find them)
[03:50:58] arquebus: has joined #ruby
[03:51:21] mgorbach: has joined #ruby
[03:51:40] eam: haasn: it's a method on Module
[03:52:08] eam: navigating rubydocs are a bit of a pain as they're organized by class so it's hard to find things implemented by a superclass
[03:52:35] haasn: Yeah, and also the documentation for the thing that actually needs it (in this case, class IPAddr), doesn't contain so much as a *link* to the definition of the AF_* constants
[03:52:51] Oog: has joined #ruby
[03:53:03] haasn: just literally says ???family = Socket::AF_UNSPEC??? and that's it. Not clickable either. :(
[03:53:13] musgravejw: has left #ruby: ("Leaving")
[03:53:23] eam: haasn: ruby culture isn't very doc oriented, it's very experimentation oriented. Lots of folks rely on stuff like tab completion for API discovery
[03:53:41] haasn: Ah, okay. That's the complete opposite of what I'm used to :)
[03:54:12] mistym: has joined #ruby
[03:54:12] haasn: (And doesn't make a lot of sense either, how does experimentation scale to anything past hobby projects?)
[03:54:18] nietzschette: searching the source code is just as good as docs
[03:54:51] haasn: nietzschette: That's actually what I was trying to do, but I can't find a ???source code??? link on this page: http://ruby-doc.org/stdlib-1.9.3/libdoc/socket/rdoc/Socket.html
[03:54:52] eam: nietzschette: I don't really agree, but it is easier to read ruby than most other languages
[03:54:53] haasn: Did I just miss it?
[03:55:54] saadq: has joined #ruby
[03:56:07] stryek: has joined #ruby
[03:56:18] eam: haasn: there's a gem called 'pry' that'll help: http://pryrepl.org/
[03:56:23] nietzschette: I wrote a program - metasearch I called it - to scan every file in every lower directory for a key word and return an array of instances of that word. I use it quite often
[03:56:38] haasn: I'm wondering about what's more idiomatic: The code I'm editing does stuff like Logger.new(config['logfile']), but as I understand it those parentheses are redundant? Why not just write Logger.new config['logfile'] ?
[03:56:56] eam: haasn: no parens is common
[03:57:13] saadq: Is there a way to automatically install needed gems when running a ruby program that requires them through terminal?
[03:57:47] balazs: has joined #ruby
[03:58:13] eam: method parens aren't redundant with precedence parens, oddly enough
[03:58:18] havenwood: saadq: In Pry to install then require you can: gem-install foo
[03:58:36] eam: f(x) is different from f((x)) for various expressions of x
[03:58:56] haasn: eam: that seems odd, what kind of expressions ???x??? trigger this?
[03:59:06] havenwood: saadq: Or do you mean something else by from the terminal? Maybe say more about what you mean?
[03:59:11] haasn: (stuff like this reminds me of php's crazy parser)
[03:59:27] eam: >> def f(x); x; end; f((not true))
[03:59:29] ruboto: eam # => false (https://eval.in/383490)
[03:59:33] eam: >> def f(x); x; end; f(not true)
[03:59:34] ruboto: eam # => /tmp/execpad-67f20c74064c/source-67f20c74064c:2: syntax error, unexpected keyword_true, expecting '( ...check link for more (https://eval.in/383491)
[03:59:38] nietzschette: could you write a gem installation method in a rescue block?
[04:00:00] surs: has joined #ruby
[04:00:07] haasn: eam: As a non-ruby programmer, that makes no sense to me. Isn't ???not true??? a valid expression on its own?
[04:00:15] eam: pretty sure it's a bug
[04:00:16] sleungcy: has joined #ruby
[04:00:47] Ox0dea: saadq: You should consider whether you really want to install arbitrary dependencies.
[04:00:48] havenwood: >> def f(x); x; end; f(not(true))
[04:00:49] ruboto: havenwood # => false (https://eval.in/383492)
[04:01:20] workmad3: has joined #ruby
[04:01:58] eam: >> def f(x); x; end; f (not true)
[04:01:59] ruboto: eam # => false (https://eval.in/383493)
[04:02:19] eam: (because those parens are precedence parens, not method parens)
[04:02:51] eam: paren-less method call
[04:03:08] Koshian: has joined #ruby
[04:03:21] serivich: has joined #ruby
[04:03:27] Ox0dea: >> p(! true)
[04:03:28] ruboto: Ox0dea # => false ...check link for more (https://eval.in/383494)
[04:03:48] Ox0dea: So the problem is the precedence of the "not" keyword.
[04:03:50] icebourg: has joined #ruby
[04:04:07] Ox0dea: Which should only be used for control flow and ideally not at all.
[04:04:13] eam: not quite, it's a parser bug but precedence isn't why
[04:04:21] eam: >> [true and false]
[04:04:22] ruboto: eam # => /tmp/execpad-1eb8f8b10250/source-1eb8f8b10250:2: syntax error, unexpected keyword_and, expecting ']' ...check link for more (https://eval.in/383495)
[04:04:40] eam: common to all the bool keywords
[04:05:10] Ox0dea: >> [(true and false)]
[04:05:11] ruboto: Ox0dea # => [false] (https://eval.in/383496)
[04:05:52] Ox0dea: Does anyone know of a parser that's scarier than MRI's?
[04:06:12] hubcaps: has joined #ruby
[04:07:21] eam: I generally prefer the keywords to the symbols for readability (in perl) but I avoid them in ruby
[04:09:41] ledestin: has joined #ruby
[04:11:08] tkuchiki: has joined #ruby
[04:11:58] bronson: has joined #ruby
[04:12:16] eam: >> x = methods.sample; send x, *Array.new(method(x).arity.abs) { ObjectSpace.each_object.to_a.sample }
[04:12:17] CalvinnHobbes: has joined #ruby
[04:12:17] ruboto: eam # => undefined method `found_spec' for class `Object' (NameError) ...check link for more (https://eval.in/383497)
[04:13:03] eam: hm bad luck
[04:14:15] nietzschette: I got bored and started piping several instances of IRB into each other. to test it, I type 5 into the first
[04:14:22] nietzschette: I got 5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555. . . . .
[04:15:08] nietzschette: I'm wondering if it would be possible map interpretors as some sort of AI?
[04:16:09] nietzschette: give each instance a set of associations of keywords
[04:16:28] nietzschette: anyone have any experience with that sort of thing?
[04:17:17] joneshf-laptop: has joined #ruby
[04:17:37] eam: nietzschette: sounds like you want a megahal
[04:17:42] AndroidLoverInSF: has joined #ruby
[04:18:03] starfox_sf: has joined #ruby
[04:18:47] nietzschette: interesting search results
[04:19:34] j4cknewt: has joined #ruby
[04:20:04] eam: popular markov chain bot
[04:20:10] eam: there's a ruby gem for it I think
[04:20:53] saadq: havenwood: Sorry here's an example: http://pastebin.com/xshifYMr
[04:20:53] ruboto: saadq, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/143fd0bc1e48d3544c49
[04:20:54] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[04:21:41] saadq: but yeah I basically have a file named title.rb with this code: https://gist.github.com/anonymous/143fd0bc1e48d3544c49
[04:21:52] saadq: When I run `ruby test.rb`
[04:22:03] saadq: is there a way to make that mechanize gem install before the program runs automatically?
[04:22:55] eam: saadq: possibly, but you probably shouldn't
[04:23:32] nietzschette: I have mech on another computer. . . .
[04:23:37] saadq: Okay, was just curious if there was something everyone did that I was unaware of
[04:23:38] eam: anything you do has good odds of breaking different environments
[04:24:32] tkuchiki: has joined #ruby
[04:24:34] havenwood: saadq: You could cut it into a gem so the dependencies install along with the script. Or you can specify the deps in a Gemfile or gem.deps.rb file and run `gem i -g` to install.
[04:25:25] nietzschette: I just find it funny you want mechanize to install automatically
[04:25:28] haasn: (pastebin.com has ads!?)
[04:25:37] nietzschette: I mean, do you even USE a keyboard?
[04:25:46] saadq: That was just an example
[04:25:55] drocsid: has joined #ruby
[04:26:01] saadq: so when most people create something in Ruby that has dependencies, do they usually expect the user to manually install those dependencies itself?
[04:26:08] saadq: themselves*
[04:26:14] auzty: has joined #ruby
[04:26:33] havenwood: saadq: They usually create a gem so the deps install along with the gem.
[04:26:51] saadq: Oh, I see that's basically what I was asking about haha thanks
[04:26:51] havenwood: saadq: Or, a Gemfile for easy installation.
[04:27:12] havenwood: saadq: http://guides.rubygems.org/make-your-own-gem/
[04:27:28] tkuchiki: has joined #ruby
[04:27:30] nietzschette: I'm almost ready to write a gem!
[04:27:35] saadq: Thanks havenwood and everyone else
[04:27:36] kp666: has joined #ruby
[04:27:40] drocsid: I installed rvm and have been trying to run a script I wrote from my crontab. Similar to /usr/local/rvm/rubies/ruby-2.2.1/bin/ruby /home/user/script/create_indices.rb . When I login I can run the script fine. It looks like the error I'm getting from cron is /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:i
[04:27:45] drocsid: +n `require': cannot load such file -- elasticsearch (LoadError)
[04:28:22] drocsid: looks like it is having issues with the gem when I'm not logged in. I'm no ruby expert, does anybody know what's going on?
[04:28:24] havenwood: drocsid: Cron drops your env, you'll probably want to use wrappers: https://rvm.io/deployment/cron
[04:29:08] havenwood: drocsid: See: rvm help wrapper
[04:29:14] drocsid: havenwood: thanks
[04:29:18] havenwood: drocsid: no prob
[04:29:41] towski__: has joined #ruby
[04:30:00] vikaton: has joined #ruby
[04:30:23] krz: has joined #ruby
[04:31:21] lxsameer: has joined #ruby
[04:31:22] lxsameer: has joined #ruby
[04:32:41] nisstyre: has joined #ruby
[04:33:48] kahuna_: has left #ruby: ()
[04:35:06] c0ncealed: has joined #ruby
[04:35:12] milesmatthias: has joined #ruby
[04:35:17] Musashi007: has joined #ruby
[04:35:20] havenwood: saadq: For resolving and installing app deps, try creating a `gem.deps.rb` file with the content `gem 'mechanize'` and run `gem i -g`.
[04:35:35] havenwood: saadq: echo "gem 'mechanize'" >> gem.deps.rb && gem i -g
[04:36:04] havenwood: saadq: Then if you shipped to someone else they type `gem i -g` and get the exact same gem versions
[04:36:28] saadq: thanks, I'll def read up on gems too to get a better understanding
[04:36:38] havenwood: saadq: It creates a gem.deps.rb.lock file that you check into git for apps, so all other devs use the same versions you're on
[04:37:00] havenwood: saadq: RubyGems, which ships with Ruby, can do this now. The traditional way has been to use the Bundler gem.
[04:37:11] havenwood: saadq: I'd suggest reading up on RubyGems!
[04:37:22] havenwood: http://guides.rubygems.org/
[04:37:38] saadq: appreciate it dude
[04:37:44] havenwood: saadq: you're welcome
[04:38:16] ramfjord: has joined #ruby
[04:38:40] havenwood: saadq: `gem.deps.rb` is the new name for `Gemfile`, which you'll probably see in most projects
[04:39:24] dgutierrez1287: has joined #ruby
[04:39:27] Cust0sLim3n: has joined #ruby
[04:40:38] Rager: I've got a method not acting the way I think it should
[04:40:48] Rager: how would I use reflection to find out what the interface is?
[04:41:03] ruboto: Rager, Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting ???binding.pry??? directy in your source code. Visit https://pryrepl.org/ or get it now with gem install pry pry-doc
[04:41:27] havenwood: Rager: gem install pry pry-doc
[04:41:42] havenwood: Rager: Then use `pry` instead of `irb` for your REPL.
[04:41:49] mleung: has joined #ruby
[04:42:57] havenwood: Rager: Try: ls method_you_want_to_look_at
[04:43:21] Rager: no way to use some class to enumerate the declared args or whatnot?
[04:43:33] Rager: I'll try pry
[04:43:33] shadoi: has joined #ruby
[04:43:41] fabrice31: has joined #ruby
[04:43:43] havenwood: Rager: There are ways, absolutely.
[04:44:00] danman: has joined #ruby
[04:44:25] yfeldblum: has joined #ruby
[04:44:51] havenwood: Rager: I'm not quite clear on what you're wanting to do, but you can get at what Pry is showing. It makes it easy.
[04:45:24] mleung_: has joined #ruby
[04:45:49] havenwood: >> 5.public_methods(false).last 5
[04:45:50] ruboto: havenwood # => [:bit_length, :zero?, :odd?, :even?, :succ] (https://eval.in/383499)
[04:45:54] nietzschette: I'll often just insert puts "#{some value or expression}"
[04:46:02] nietzschette: throughout my code
[04:46:09] havenwood: nietzschette: use `p` instead of `puts` for debugging
[04:47:19] havenwood: nietzschette: obj.inspect will save some headache when the puts output makes you cry
[04:47:38] havenwood: >> puts [1, 2, 3]
[04:47:39] ruboto: havenwood # => 1 ...check link for more (https://eval.in/383500)
[04:47:42] havenwood: >> p [1, 2, 3]
[04:47:43] ruboto: havenwood # => [1, 2, 3] ...check link for more (https://eval.in/383501)
[04:48:08] fedexo: has joined #ruby
[04:48:32] havenwood: nietzschette: ^ so there #puts first prints `1` while #p prints `[1, 2, 3]`.
[04:49:03] havenwood: nietzschette: So litter your code with p instead of puts. ;)
[04:49:07] nietzschette: but puts("#{[1,2,3]}") issame
[04:49:36] c0ncealed: has joined #ruby
[04:49:38] nietzschette: but it is less to type so there's that
[04:49:38] havenwood: >> puts [1, 2, 3].inspect
[04:49:39] ruboto: havenwood # => [1, 2, 3] ...check link for more (https://eval.in/383502)
[04:50:11] havenwood: nietzschette: there are a few reasons. you only use p for debugging, so easy to spot them. they handle other inspect cases. etc.
[04:50:27] havenwood: nietzschette: it's what it's for
[04:50:42] unshadow: has joined #ruby
[04:50:44] luckyme: has joined #ruby
[04:51:09] dg-ratiodata: has joined #ruby
[04:51:17] serivichi: has joined #ruby
[04:51:37] eam: when you're first learning ruby you'll end up with p everywhere
[04:51:50] datanoise: has joined #ruby
[04:51:54] Ox0dea: And when you're learning Ruby's C codebase, you end up with dp() everywhere.
[04:53:36] petruchito: has joined #ruby
[04:53:47] Ox0dea: charliesome: Any chance eval.in will ever support trunk?
[04:54:34] charliesome: Ox0dea: hmm, probably not. it moves too quickly
[04:54:42] Ox0dea: That it does.
[04:54:48] charliesome: Ox0dea: in the past I've put preview releases of MRI on eval.in
[04:56:10] Spami: has joined #ruby
[04:56:33] Oog: has joined #ruby
[04:58:17] krisquigley: has joined #ruby
[04:59:57] Hanmac: has joined #ruby
[05:00:31] skade: has joined #ruby
[05:02:18] petruchito: hi all, i'm playing with ruby's GC here, just wondered does GC_DEBUG and RGENGC_CHECK_MODE is working in ruby_2_2 branch?
[05:04:13] al2o3-cr: hehe this megahal is awesome :)
[05:04:25] nietzschette: i know, right?
[05:04:50] al2o3-cr: just made a plugin for my bot it's gone crazy :D
[05:05:52] dg-ratiodata: has joined #ruby
[05:06:06] petruchito: im getting core dumped trying to `make` with those features enabled, from generic.erb
[05:07:01] AndroidLoverInSF: has joined #ruby
[05:08:26] catcher: has joined #ruby
[05:16:53] nietzschette: I bet I could make a random comic book generator with chatterbots and rubysdl
[05:18:12] eam: like jerkcity?
[05:20:09] Cust0sLim3n: has joined #ruby
[05:20:18] arooni-mobile: has joined #ruby
[05:22:44] mleung: has joined #ruby
[05:23:02] nietzschette: eam, I don't even know what's going on with this site
[05:24:14] nietzschette: jerkcity does not pass turning test
[05:25:23] revath: has joined #ruby
[05:26:05] revath: has left #ruby: ()
[05:27:32] djbkd_: has joined #ruby
[05:28:07] bronson: has joined #ruby
[05:28:18] lokulin: has joined #ruby
[05:29:11] alphaatom: has joined #ruby
[05:30:03] nietzschette: https://github.com/jasonhutchens/sooth
[05:30:15] ndrei: has joined #ruby
[05:31:18] ItSANgo__: has joined #ruby
[05:32:08] dg-ratiodata: has joined #ruby
[05:33:03] gianlucadv: has joined #ruby
[05:35:33] alphaatom|pc: has joined #ruby
[05:35:54] sophiedeziel: has joined #ruby
[05:37:39] yardenbar: has joined #ruby
[05:39:05] qiukun: has joined #ruby
[05:39:27] drewo: has joined #ruby
[05:39:38] qiukun: after using method(), have i call the method by call()?
[05:42:25] spinozahacker: has joined #ruby
[05:43:38] eam: qiukun: yes
[05:43:38] Ox0dea: qiukun: send()
[05:43:48] spinozahacker: Hey, I just deleted /usr/bin/ruby from my Mac, how do I reinstall ruby?
[05:44:16] Ox0dea: qiukun: Never mind; I misunderstood your question.
[05:44:21] eam: >> method(:puts).call "hello world"
[05:44:23] ruboto: eam # => hello world ...check link for more (https://eval.in/383510)
[05:44:47] eam: well, send works too
[05:45:27] al2o3-cr: can also use [] or .()
[05:45:48] qiukun: so the usual way to call is a hack?
[05:45:57] RickHull: spinozahacker: homebrew maybe. otherwise see the options here: https://www.ruby-lang.org/en/downloads/
[05:46:12] spinozahacker: homebrew requires ruby to instal
[05:46:12] eam: qiukun: unclear what distinction you're drawing
[05:46:48] eam: spinozahacker: you can use the osx recovery stuff I think
[05:46:56] Ox0dea: spinozahacker: RickHull gave you an else branch, mate.
[05:47:14] eam: you probably want to install apple's ruby there
[05:47:35] RickHull: where do you get apple's ruby?
[05:47:41] eam: with osx?
[05:47:55] qiukun: eam: see, after we use method to get a method in order to pass it around
[05:48:13] qiukun: eam: we lost the abiity to call it by the usual syntax
[05:48:27] RickHull: eam: right, but he deleted it
[05:48:34] sophiedeziel: the question you might not want anybody to ask: why did you delete it?
[05:48:39] nickfausnight: has joined #ruby
[05:48:40] eam: RickHull: yes, OSX has recovery tools for restoring missing system files of any kind
[05:48:43] qiukun: so send and call is general, the usual syntax is a hack
[05:48:45] spinozahacker: apple's ruby is just older ruby as far as I know
[05:48:59] Ox0dea: qiukun: No, they're just not symmetric.
[05:49:09] eam: spinozahacker: yes, but compatibility is pretty important
[05:49:10] RickHull: eam: spinozahacker: then yeah, try osx recovery tools
[05:49:16] ndrei: has joined #ruby
[05:49:26] RickHull: if you want newer ruby, i'd look at rvm / rbenv / chruby
[05:49:45] qiukun: Ox0dea: quite annoying
[05:49:48] GnuYawk: has joined #ruby
[05:50:07] spinozahacker: it's an infinite loop haha. rvm requires homebrew which requires ruby
[05:50:15] workmad3: has joined #ruby
[05:50:22] RickHull: restore your system :)
[05:50:35] spinozahacker: Yeah, i'll do it. Thanks guys!
[05:50:40] spinozahacker: has left #ruby: ()
[05:52:41] RickHull: has left #ruby: ()
[05:55:15] bnagy: they left :(
[05:55:39] bnagy: ports doesn't require ruby :(
[05:55:52] bnagy: top advice guys _b
[05:56:52] tkuchiki: has joined #ruby
[05:56:58] Ruinside: has joined #ruby
[05:57:00] tkuchiki: has joined #ruby
[05:57:14] spider-mario: has joined #ruby
[05:58:45] nietzschette: what's the name of that constant you declare to capture the lines of required modules?
[06:00:34] alphaatom|pc: has joined #ruby
[06:01:09] balazs: has joined #ruby
[06:01:46] mcclurmc: has joined #ruby
[06:06:24] ahmetkapikiran: has joined #ruby
[06:07:11] shevy: nietzschette constant? sure?
[06:07:15] AndroidLoverInSF: has joined #ruby
[06:07:37] nietzschette: could have been a global variable
[06:07:38] shevy: I know of a global variable, an array, $LOAD_PATH - I think $: or so is the alias
[06:08:22] Ruinside: has joined #ruby
[06:09:01] alphaatom: has joined #ruby
[06:10:15] alphaatom: has joined #ruby
[06:10:25] Norrin: has joined #ruby
[06:10:57] pepperbreath1: has left #ruby: ()
[06:12:07] Norrin: has left #ruby: ("Dueces")
[06:13:11] certainty: shevy: wow, I couldn't guess what he/she might mean and tried. You're some kind of mindreader
[06:13:39] certainty: s/and tried/, and I have really tried/
[06:14:16] nietzschette: google couldn't even catch my meaning
[06:14:34] bmalum: has joined #ruby
[06:14:52] tagrudev: has joined #ruby
[06:15:08] Ox0dea: >> global_variables.group_by { |g| eval(g.to_s).class }.map { |c, a| [c, a.size] }
[06:15:09] ruboto: Ox0dea # => (eval):1: warning: variable $= is no longer effective ...check link for more (https://eval.in/383531)
[06:15:10] rht: has joined #ruby
[06:15:15] futilegames: has joined #ruby
[06:15:18] rbowlby: has joined #ruby
[06:15:41] Ox0dea: >> ARGF.class
[06:15:43] ruboto: Ox0dea # => ARGF.class (https://eval.in/383532)
[06:15:52] RazorX: has joined #ruby
[06:15:59] Ox0dea: What's up with that?
[06:18:20] Ox0dea: >> [File < 10, ARGF.class < IO]
[06:18:21] ruboto: Ox0dea # => compared with non class/module (TypeError) ...check link for more (https://eval.in/383534)
[06:18:29] Ox0dea: >> [File < IO, ARGF.class < IO]
[06:18:30] ruboto: Ox0dea # => [true, nil] (https://eval.in/383535)
[06:19:04] Ox0dea: I know ARGF is magic, but it's pretty weird that it doesn't inherit anything from IO.
[06:19:42] keen__________: has joined #ruby
[06:19:56] al2o3-cr: why is it not set to a constant
[06:20:09] sigurding: has joined #ruby
[06:20:10] nietzschette: ARGV.class => ARGV.class
[06:20:42] Ox0dea: nietzschette: ARGV is just an Array.
[06:20:56] Ox0dea: ARGF contains all of the "file-like" arguments supplied on the command line.
[06:21:03] nietzschette: sorry, replace V with F
[06:21:43] nietzschette: it has many methods in common with IO
[06:22:00] flughafen: shevy: nothing is taking off right now. burn me down! i'm worthless
[06:22:02] Ox0dea: Indeed it does, and yet it's apparently having them all defined bespoke.
[06:22:07] sharpmachine: has joined #ruby
[06:22:25] Ox0dea: flughafen: You're actually an airport?
[06:22:36] flughafen: flughafen is germnan for airport
[06:23:07] Ox0dea: >> "Germ#{0.0/0}"
[06:23:08] francoi__: has joined #ruby
[06:23:08] ruboto: Ox0dea # => "GermNaN" (https://eval.in/383537)
[06:23:16] eam: I'm on a train, now we just need someone in an automobile
[06:24:05] nietzschette: ARGF.kind_of?(Object) => true <= *emits sigh of relief*
[06:24:12] flughafen: germanphobe
[06:24:16] shevy: flughafen I have faith in you. One day you will the world that you are FINISHED
[06:24:22] shevy: *will show to the world
[06:24:50] corehook: has joined #ruby
[06:24:50] eam: GermNaN is what you get when you drop the bread on the floor
[06:25:18] shevy: certainty well I sort of ignored the word "constant" there, and reduced the question to "obtain lines of required modules", which to my brain only made sense in the way as "how to get all loaded modules in ruby", which is a question that is quite often asked here actually
[06:26:02] sandstrom: has joined #ruby
[06:26:05] shevy: eam admit it - you like german stuff. like beer from bavaria: look at them! http://whyfiles.org/wp-content/uploads/2010/10/old_men_lederhosen.jpg
[06:26:18] hahuang65: has joined #ruby
[06:26:31] eam: shevy: I *am* german stuff
[06:26:34] shevy: they wear so silly things... but the beer is cool. and brezels are also ok (once you have beer that is; without beer they are dry)
[06:27:08] Hanmac1: has joined #ruby
[06:27:33] Hanmac1: apeiros & shevy checkout the new "NameError#receiver" method ;P
[06:27:54] shevy: what is that
[06:28:00] shevy: I can't keep up with how quickly ruby changes
[06:28:07] shevy: #receiver what does it receive
[06:28:18] eam: I had a weihenstephaner with dinner last night
[06:28:22] Ox0dea: It returns the receiver of the method that couldn't be resolved.
[06:29:47] Ox0dea: `42.foo rescue $!.receiver` is 42 in trunk.
[06:30:52] shevy: my brain does not yet understand that
[06:31:02] shevy: a method that could not be resolved? what does that mean?
[06:31:13] Ox0dea: >> 42.foo
[06:31:14] ruboto: Ox0dea # => undefined method `foo' for 42:Fixnum (NoMethodError) ...check link for more (https://eval.in/383538)
[06:31:24] shevy: so it works on NoMethodError?
[06:31:28] datanoise: has joined #ruby
[06:31:30] Ox0dea: >> NoMethodError < NameError
[06:31:31] ruboto: Ox0dea # => true (https://eval.in/383539)
[06:31:41] shevy: and it returns NoMethodError?
[06:32:08] shevy: and that is useful because ... ?
[06:32:19] eam: well what if 42 is x
[06:32:21] fabrice31: has joined #ruby
[06:32:34] Ox0dea: It'll return x?
[06:32:42] nietzschette: x is not a constant
[06:32:43] eam: right I'm explaining for shevy
[06:33:11] eam: you might want the error raised to explain which receiver object didn't have the method
[06:33:31] Ox0dea: shevy: NameError#receiver's raison d'??tre is to make it easier for the did_you_mean gem to do its thing.
[06:34:57] chinmay_dd: has joined #ruby
[06:34:58] Ox0dea: It's a lot cleaner than method_missing.
[06:35:31] eam: what's ruby's worst feature
[06:36:01] nietzschette: ambiguity about what's an object and what's a pointer
[06:36:22] moretti: has joined #ruby
[06:36:43] nietzschette: or that's it's best feature
[06:38:09] Ox0dea: eam: The flip-flop operator seems to have exactly one (questionable) use case.
[06:38:51] bnagy: @@classvars
[06:38:52] atomx: has joined #ruby
[06:38:54] eam: how about nearly arbitrary characters as string delimiters with %
[06:39:15] ndrei: has joined #ruby
[06:39:16] bnagy: flip-flop is awful but it's too confusing to ever be used in real-world code
[06:39:26] hahuang65: has joined #ruby
[06:39:35] shevy: eam hard question. method_missing can be useful sometimes. I use it to simulate LPC in one project, where methods never fail but instead, when they don't exist, return false
[06:39:53] shevy: I dislike @@vars as well. dunno if they are the worst though
[06:40:13] shevy: arbitrary characters don't affect me much because I just use ... %w() !
[06:40:19] shevy: and others use.... %w[]
[06:40:28] shevy: those are the two most commonly used variants
[06:40:37] shevy: everyone else is an unbeliever
[06:40:37] Ox0dea: eam: Have you ever actually seen somebody use a delimiter that confused you?
[06:40:44] shevy: hanmac did
[06:40:46] nietzschette: you could also search ruby source for that method and dynamically GIVE it to the object when the error is raised
[06:40:51] eam: I have myself, yes
[06:40:59] shevy: that is eam's dark perl past
[06:41:08] Ox0dea: eam: Which was it?
[06:41:15] shevy: admit that it was _
[06:41:24] crdpink2: has joined #ruby
[06:41:25] shevy: _ = %w _ a b c _
[06:41:45] shevy: SyntaxError
[06:42:34] eam: >> % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%%% %%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%% %%%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %%%%% %%%% % %%%%%%% %%%% % %
[06:42:35] ruboto: eam # => /tmp/execpad-ec0a6f6d5ba1/source-ec0a6f6d5ba1:4: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/383553)
[06:42:43] eam: whoooa ruboto
[06:42:53] bjornar: has joined #ruby
[06:43:20] Ox0dea: eam: It strips trailing whitespace.
[06:43:25] shevy: does not work!
[06:43:34] eam: >> % %%%%%%% %%%% % %%%%% %%%% # shorter
[06:43:35] ruboto: eam # => "%" (https://eval.in/383554)
[06:43:45] eam: I just went over the irc char limit
[06:44:05] Xeago: has joined #ruby
[06:44:09] shevy: what happened to the other %
[06:44:39] eam: >> "#{%}#{%}#{%}#{%}#{%} }}}}}}}}}}"
[06:44:40] ruboto: eam # => " " (https://eval.in/383555)
[06:45:20] nEosAg: has joined #ruby
[06:45:29] eam: I like that one because of the asymmetry
[06:45:45] nEosAg: trying to install ruby on centos 6.2 x86_64
[06:46:07] nEosAg: error: Failed dependencies: libz.so.1(ZLIB_1.2.2)(64bit) is needed by ruby-2.1.2-1.el6.x86_64
[06:46:20] shevy: http://www.zlib.net/zlib-1.2.8.tar.gz
[06:46:27] eam: I'm gonna say my least favorite feature of ruby is how block scoped variables are declared
[06:46:41] shevy: just give them a longer name
[06:46:42] nEosAg: but rpm -ql zlib gives /lib64/libz.so.1 /lib64/libz.so.1.2.3
[06:46:43] nietzschette: why isn't zlib already everywhere?
[06:46:44] svoop: has joined #ruby
[06:46:45] bronson: has joined #ruby
[06:46:55] shevy: perhaps because centos is incompetent
[06:47:00] shevy: that is a centos ruby-package right
[06:47:14] krisquigley: has joined #ruby
[06:47:15] eam: no one ever uses ; inside ||
[06:47:15] nietzschette: I'd say the GLI is my least favorite
[06:47:31] shevy: nEosAg not sure how many people here use centos :)
[06:47:33] eam: they totally should use the same syntax as methods
[06:47:45] nEosAg: ruby-2.1.2-1.el6.x86_64.rpm got from some site
[06:48:01] eam: nEosAg: are you mixing up your repos?
[06:48:15] eam: you need to use the ruby built for that particular centos version
[06:48:16] nEosAg: eam : like?
[06:48:21] bnagy: nietzschette: not a ruby feature, that's an implementation decision :P
[06:48:24] simplyaubs: has joined #ruby
[06:48:41] fabrice31: has joined #ruby
[06:48:53] Cust0sLim3n: has joined #ruby
[06:48:59] nEosAg: eam : i am using same ..centos 6 64 bit
[06:49:06] eam: 6 dot what?
[06:49:19] eam: is that what your rpm was built for?
[06:49:22] hubcaps: has joined #ruby
[06:49:22] hubcaps: has joined #ruby
[06:49:30] eam: rpm -qpi ruby-2.1.2-1.el6.x86_64.rpm
[06:49:36] nEosAg: ok let me check
[06:49:52] tvw: has joined #ruby
[06:50:09] andikr: has joined #ruby
[06:50:15] eam: I'm assuming it's from epel, those are all pretty broken
[06:50:37] eam: shevy: rhel/centos is the only linux distro worth using
[06:50:58] flughafen: eam: i'll disagree. suse is the best suse is the best suse is the best suse is the best
[06:51:01] nEosAg: sorry for typo
[06:51:08] eam: flughafen: hmm german you say? :)
[06:51:15] shevy: I have followed gobolinux appdirs. all who do not use appdirs are not worthy to be used
[06:51:25] dg-ratiodata: has joined #ruby
[06:51:47] nEosAg: eam : can you share any trusted source for ruby rpms
[06:51:48] eam: and that's my train stop, night all
[06:51:52] flughafen: eam: i might work for a certain company ;)
[06:51:55] eam: nEosAg: there isn't a good one
[06:52:03] eam: build your own ruby
[06:52:09] eam: flughafen: aha ;)
[06:52:16] jmhmccr: has joined #ruby
[06:52:32] flughafen: microsoft is the best linux distro
[06:53:11] ndrei: has joined #ruby
[06:53:32] flughafen: microsoft is the best linux distro
[06:55:46] f3lp: has joined #ruby
[06:55:56] bruno-: has joined #ruby
[06:56:38] fabrice31_: has joined #ruby
[06:56:51] nEosAg: has joined #ruby
[06:57:13] nEosAg: sorry got disconnected
[06:57:14] shevy: nEosAg URL for ruby is ftp://ftp.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.xz
[06:57:34] nEosAg: shevy ..i have built it from source
[06:57:40] balazs: has joined #ruby
[06:57:43] nEosAg: *i have to
[06:57:55] shevy: compiling from source would be ideal
[06:57:59] shevy: you may have to get some other things though
[06:58:03] spacemud: has joined #ruby
[06:58:03] shevy: upgrading zlib for instance
[06:58:10] nEosAg: like gcc-c++
[06:58:23] shevy: perhaps, not sure how crippled centos is by default
[06:58:27] nEosAg: my box is messed up with multiple glibc
[06:58:39] nEosAg: its pretty much crippled
[06:58:47] shevy: there are often ways to uncripple
[06:58:56] shevy: on debiant, you can use apt-get to get all required dev-packages for instance
[06:59:03] shevy: not debiant :)
[06:59:07] nEosAg: i know ..its on my laptop
[06:59:25] shevy: dunno... the biggest hurdle is to find out the name of the package in question
[06:59:34] shevy: I hate that different distributions given different names
[06:59:44] nEosAg: but to convince to my seniors on my production m/c is another nightmare
[06:59:50] iwishiwerearobot: has joined #ruby
[07:00:30] nietzschette: debian is sweet
[07:00:35] nEosAg: does smartpm will help
[07:00:55] Ox0dea: nietzschette: Are you a Debian user?
[07:01:27] Ox0dea: Will you be switching to Devuan when it's ready?
[07:01:50] shevy: I heard that debian wants to perform reproducible builds
[07:01:57] shevy: https://wiki.debian.org/ReproducibleBuilds
[07:03:43] lokulin: has joined #ruby
[07:05:35] gambl0re: has joined #ruby
[07:06:07] solars: has joined #ruby
[07:06:43] fabrice31: has joined #ruby
[07:06:50] nietzschette: I'll try it. I've got an old junk computer I used to test OS builds.
[07:07:30] cyong: has joined #ruby
[07:07:36] nietzschette: I like apt-get though. it's as easy as ruby gems
[07:08:00] mister_solo: has joined #ruby
[07:08:08] dhjondoh: has joined #ruby
[07:10:45] renderful: has joined #ruby
[07:11:01] ndrei: has joined #ruby
[07:11:02] Ox0dea: pacaur ??ber alles.
[07:11:10] charliesome: has joined #ruby
[07:12:57] sdwrage: has joined #ruby
[07:15:05] dhjondoh: has joined #ruby
[07:15:10] mike___1234: has joined #ruby
[07:15:51] antgel: has joined #ruby
[07:17:08] Oog: has joined #ruby
[07:18:08] Macaveli: has joined #ruby
[07:18:08] wildroman2: has joined #ruby
[07:19:16] sandstrom: has joined #ruby
[07:19:43] yfeldblum: has joined #ruby
[07:20:03] strixd: has joined #ruby
[07:20:45] ndrei: has joined #ruby
[07:25:39] anisha: has joined #ruby
[07:26:39] corehook: has joined #ruby
[07:26:43] wildroman2: has joined #ruby
[07:29:01] Iskarlar: has joined #ruby
[07:30:01] GnuYawk: has joined #ruby
[07:31:49] ta: has joined #ruby
[07:32:18] posixpascal: has joined #ruby
[07:32:28] skade: has joined #ruby
[07:34:00] kalusn: has joined #ruby
[07:34:58] pyon: has joined #ruby
[07:34:58] konsolebox: has joined #ruby
[07:35:24] Xeago: has joined #ruby
[07:39:00] workmad3: has joined #ruby
[07:39:37] dgutierrez1287: has joined #ruby
[07:39:53] Rubie: has joined #ruby
[07:40:13] corehook: has joined #ruby
[07:41:37] pwnz0r: has joined #ruby
[07:43:07] corehook_: has joined #ruby
[07:43:30] dumdedum: has joined #ruby
[07:44:14] francoi__: has joined #ruby
[07:44:15] GitGud: has joined #ruby
[07:46:05] lkba: has joined #ruby
[07:46:09] haraoka: has joined #ruby
[07:46:38] GitGud: has joined #ruby
[07:47:23] corehook: has joined #ruby
[07:47:53] sandstrom: has joined #ruby
[07:47:56] francoi__: has joined #ruby
[07:48:09] aganov: has joined #ruby
[07:48:31] RegulationD: has joined #ruby
[07:48:43] Dopagod: has joined #ruby
[07:48:43] Dopagod: has joined #ruby
[07:50:29] agent_white: has joined #ruby
[07:50:29] GitGud: has joined #ruby
[07:50:36] tomaz_b: has joined #ruby
[07:51:11] pyon: has joined #ruby
[07:51:16] agent_white: Today you are you, this is truer than true, there is noone alive who is youer than you.
[07:51:17] Scroff: has joined #ruby
[07:51:22] bigkevmcd: has joined #ruby
[07:51:33] mister_solo: has joined #ruby
[07:51:45] dg-ratiodata: has joined #ruby
[07:51:57] jhass: - The 8 ball
[07:52:13] agent_white: jhass: It always told me "try again" :(
[07:52:28] tomphp: has joined #ruby
[07:52:30] Scroff: has joined #ruby
[07:53:05] jhass: make a better one
[07:53:45] bigkevmcd: has joined #ruby
[07:54:36] undeadaedra: >> ["Try again"].sample
[07:54:37] ruboto: undeadaedra # => "Try again" (https://eval.in/383582)
[07:54:42] pleiosaur: has joined #ruby
[07:55:02] agent_white: jhass: I could write a "fortune" program in ruby for terminals... but it'd be Dr.Seuss quotes :D
[07:55:15] skade: has joined #ruby
[07:55:29] langlands: has joined #ruby
[07:55:36] allomov: has joined #ruby
[07:56:10] _blizzy_: has joined #ruby
[07:56:44] livathinos: has joined #ruby
[07:57:12] jhass: apparently I did a python version https://gist.github.com/jhass/2762698
[07:57:39] ndrei: has joined #ruby
[07:57:42] roolo: has joined #ruby
[07:58:47] revath: has joined #ruby
[07:59:21] senayar: has joined #ruby
[08:00:22] alem0lars__: has joined #ruby
[08:00:41] ahmetkapikiran: has joined #ruby
[08:01:58] agent_white: That's actually a good idea for a lil project. I haven't programmed in... 3-4 months. Need some good lil starter stuff to work on :D
[08:02:04] darkf: has joined #ruby
[08:02:16] bkxd: has joined #ruby
[08:02:39] agent_white: jhass: I'll fork it. There's an issue that it doesn't include the fortune "It'
[08:02:50] agent_white: "It's 5 o'clock somewhere." :P
[08:02:53] ta: has joined #ruby
[08:02:57] keernel: has joined #ruby
[08:02:58] mikecmpbll: has joined #ruby
[08:03:51] maloik: yorickpeterse: pirate costumes are encouraged!
[08:04:48] agent_white: has joined #ruby
[08:05:20] rdark: has joined #ruby
[08:05:47] workmad3: has joined #ruby
[08:07:02] valkyrka: has joined #ruby
[08:07:34] dhjondoh: has joined #ruby
[08:08:07] krisquigley: has joined #ruby
[08:08:35] abyss: I have a script: https://gist.github.com/anonymous/386e9f03f859cdb4c692 It for each line check if line contain one of the figure in ids array if yes do this between if and else if not then just print line... The question is, how I can expedite this script. I have about 3M lines and 30k id in array...
[08:08:59] Xeago: has joined #ruby
[08:09:16] Hounddog: has joined #ruby
[08:09:17] alex88: has joined #ruby
[08:09:42] sevensea_: has joined #ruby
[08:09:54] dionysus69: has joined #ruby
[08:10:18] zenguy_pc: has joined #ruby
[08:10:29] dumdedum: has joined #ruby
[08:11:00] bnagy: abyss: you need to check each of 3M lines for 30k values?
[08:11:27] bnagy: that's just going to be slow, I'm afraid
[08:11:50] c0m0: has joined #ruby
[08:11:57] bnagy: you could try making the match into a single regexp
[08:12:07] bnagy: although I kind of threw up in my mouth suggesting it
[08:12:13] bnagy: there's Regexp.union
[08:13:08] bnagy: or you could sort your ids into ranges, possibly
[08:13:31] ljarvis: I love Ruby, but it's really not a good fit for your job
[08:13:40] bnagy: I don't know if regexp unions will do that for you.. they might, actually
[08:14:54] bnagy: abyss: not creating your regexps in the read path will help, as well, those are expensive
[08:14:55] jenrzzz: has joined #ruby
[08:14:58] abyss: the files that I want to modify looks like this one: http://pastebin.com/whhQ2U04 but unfortunatelly UPDATE or INSERT can be divided into few lines.
[08:14:58] ruboto: abyss, as I told you already, please use https://gist.github.com
[08:15:26] ljarvis: ruboto: <3
[08:15:41] jhass: abyss: for starters you can avoid matching each line twice by passing a block to gsub
[08:16:26] stardiviner: has joined #ruby
[08:16:37] bnagy: well that's post-match, though, so it's a suboptimisation :P
[08:16:43] arup_r: has joined #ruby
[08:17:15] michael_mbp: has joined #ruby
[08:17:22] bnagy: well the if is what's guaranteed to run 3 million times
[08:17:30] bnagy: I don't know how many times the gsub will run
[08:17:32] jhass: I'm saying don't do the if
[08:18:30] bnagy: oic.. yeah that's probably good
[08:18:40] bnagy: can reuse the block then as well
[08:18:53] fabrice31_: has joined #ruby
[08:18:56] bnagy: I think pre-creating the regexes is going to be big, though
[08:19:05] bnagy: followed by combining them
[08:19:17] jhass: regexp = /\b(#{Regexp.union(ids)})\b/; ... file2.write(line.gsub(regexp) { $1.to_i+1000 })
[08:19:37] abyss: I'm using ruby 1.8 btw;)
[08:19:38] ddfreyne: yorickpeterse: SoundCloud > your company
[08:19:43] jhass: abyss: well, don't
[08:19:53] jhass: abyss: just upgrade. now.
[08:19:55] ddfreyne: abyss: Upgrade!!!
[08:20:00] sevensea_: lol ruby1.8
[08:20:17] abyss: yeah, the system I do this is old
[08:20:27] jhass: doesn't matter. upgrade.
[08:20:43] ljarvis: all together now
[08:20:56] undeadaedra: eh, maybe you're talking with someone in the past!
[08:21:05] undeadaedra: see any dinosaurs?
[08:21:45] k3asd`: has joined #ruby
[08:22:23] bnagy: >> Regexp.union %w(10 20 30 40 50 60) # boo :(
[08:22:24] ruboto: bnagy # => /10|20|30|40|50|60/ (https://eval.in/383588)
[08:22:39] jhass: after you upgraded, reading larger chunks than a line should help too
[08:22:42] bnagy: hoped it would be able to build ranges
[08:22:56] dhjondoh: has joined #ruby
[08:23:03] bnagy: guess I still don't know what the internal engine builds
[08:23:19] marr: has joined #ruby
[08:23:31] jhass: bnagy: pretty sure Regexp.union is just a Regexp.new(args.join("|"))
[08:23:38] sharpmachine: has joined #ruby
[08:24:30] ndrei: has joined #ruby
[08:24:34] bnagy: but that should compile into something inside the regexp engine, no?
[08:24:49] j4cknewt: has joined #ruby
[08:24:53] jhass: uh perhaps but you'll never see that version
[08:25:02] tkuchiki: has joined #ruby
[08:27:15] dmolina: has joined #ruby
[08:28:40] ta: has joined #ruby
[08:29:24] abyss: to sum it up, first I should using newer ruby but second I should somehow put regexp = /\b(#{Regexp.union(ids)})\b/; ... file2.write(line.gsub(regexp) { $1.to_i+1000 }) in my code, yes?
[08:29:49] Ropeney: has joined #ruby
[08:30:25] jhass: well, that should be faster, yes, albeit it might bloat memory too much, we're not sure yet
[08:30:49] jhass: 3) read larger chunks than a line, I'd try 64Kb or 128Kb
[08:30:56] last_staff: has joined #ruby
[08:31:04] Oog: has joined #ruby
[08:31:04] Xeago: has joined #ruby
[08:32:07] bnagy: going to have some issues then I think at the chunk borders
[08:32:20] bnagy: nothing insurmountable, but needs to be done
[08:32:44] jhass: now I want to write an optimized parser for that in crystal but it's no fun without the data :/
[08:32:53] Ropeney: has joined #ruby
[08:33:16] Ropeney: has joined #ruby
[08:33:20] Xeago_: has joined #ruby
[08:34:11] Pupeno: has joined #ruby
[08:34:15] jhass: I mean you don't need much, flag to check whether you're inside the word boundary, consume digits into a temp buffer, replace digits if match else write input to target
[08:34:30] chussenot: has joined #ruby
[08:34:35] jhass: use BufferedIO and done
[08:35:29] Zai00: has joined #ruby
[08:35:54] workmad3: has joined #ruby
[08:35:54] Rarikon: has joined #ruby
[08:37:37] nEosAg: has joined #ruby
[08:38:33] senayar: has joined #ruby
[08:38:39] chussenot: has joined #ruby
[08:39:27] DEA7TH: has joined #ruby
[08:40:26] GPrime: has joined #ruby
[08:40:36] Stan: has joined #ruby
[08:40:56] GitGud: has left #ruby: ("Leaving")
[08:41:10] abyss: jhass: I don't know what you mean with that chunks sorry:(
[08:41:33] Xeago: has joined #ruby
[08:41:50] bnagy: abyss: try the other stuff first
[08:42:28] bnagy: when you're checking 30k things per line the cost of reading one line is not the first thing you optimise
[08:42:54] zotherstupidguy: has joined #ruby
[08:44:48] quimrstorres: has joined #ruby
[08:45:23] mdih: has joined #ruby
[08:45:41] jhass: well, my thought by increasing the chunk size is more less transitions Ruby <-> C <-> Oniguruma
[08:46:18] iwishiwerearobot: has joined #ruby
[08:46:18] ljarvis: all that glorious memory
[08:46:32] bnagy: jhass: not saying it's a bad idea :)
[08:46:51] bnagy: tbh I would just read everything into memory. :D
[08:47:00] chussenot: has joined #ruby
[08:47:12] bnagy: who cares about code for poor people with < 16G RAM?
[08:47:33] yorickpeterse: ddfreyne: boooo
[08:47:57] ljarvis: bnagy: yeah but then Ruby will shit itself when it tries to do anything with all of it :D
[08:48:33] bnagy: jruby! \o/
[08:49:01] bnagy: I used to love running jruby -Xmx 100g :P
[08:49:30] apeiros: that's a nice home computer you have :D
[08:49:36] haxrbyte: has joined #ruby
[08:49:44] fabrice31: has joined #ruby
[08:49:44] ljarvis: a nice home supercomputer
[08:50:01] bnagy: it actually has more ram than ssd :/
[08:50:30] ljarvis: how does that even get used
[08:50:42] bnagy: running 100 windows VMs
[08:50:49] ljarvis: mother of god
[08:50:58] haxrbyte_: has joined #ruby
[08:51:18] bnagy: not at the same time as jruby, obvs ^_^
[08:51:26] edwinvdgraaf: has joined #ruby
[08:51:43] apeiros: I guess I should ask what hardware our VM hosts use
[08:51:57] undeadaedra: computer hardware.
[08:52:12] apeiros: imaginary hardware
[08:52:21] sepp2k: has joined #ruby
[08:52:22] bnagy: true story - when I first set it up I found a bunch of kvm kernel bugs due to unneccessary lock contention
[08:52:28] subtwo: has joined #ruby
[08:52:41] bnagy: just nobody had run across it before :/
[08:52:56] Mia: has joined #ruby
[08:52:56] Mia: has joined #ruby
[08:53:06] jenrzzz: has joined #ruby
[08:53:10] bnagy: anyway, those boxes are old now :`( new moar tin
[08:54:41] GreatSUN: has joined #ruby
[08:54:50] GreatSUN: short question onto documentation
[08:55:11] GreatSUN: if you have a method def test(var1, var2, &block)
[08:55:12] devyn: has joined #ruby
[08:55:25] GreatSUN: would you document &block?
[08:55:46] GreatSUN: as a param?
[08:55:51] undeadaedra: depends on what you use for documentation
[08:55:57] undeadaedra: yard has tags for yield
[08:56:17] GreatSUN: aha? ok, I didn't see that
[08:56:19] undeadaedra: http://www.rubydoc.info/gems/yard/file/docs/Tags.md#yield
[08:57:20] mister_solo: has joined #ruby
[08:57:21] lee-jon: has joined #ruby
[08:57:30] fabrice31_: has joined #ruby
[08:59:01] balazs: has joined #ruby
[08:59:13] fgo: has joined #ruby
[08:59:18] rindolf: has joined #ruby
[08:59:31] khebbie: has joined #ruby
[08:59:31] Al3ks: has joined #ruby
[08:59:39] romain_t: has joined #ruby
[08:59:41] LMity: has joined #ruby
[08:59:41] agent_white: has joined #ruby
[08:59:55] skade: has joined #ruby
[09:00:21] Oog: has joined #ruby
[09:00:50] giuseppesolinas: has joined #ruby
[09:06:00] withnale_: has joined #ruby
[09:06:36] workmad3: has joined #ruby
[09:06:48] dhjondoh: has joined #ruby
[09:07:14] abyss: jhass, bnagy: ok thank you, I will try to do different approach
[09:08:25] apeiros: abyss: still working on your problem from yesterday?
[09:09:23] yh: has joined #ruby
[09:09:27] apeiros: GreatSUN: btw., don't use &block if you don't pass the block on to another method. use yield/block_given? instead.
[09:09:51] yh: Hi guys, can anyone recommend a good way of storing data in memory across multiple invocations of a Ruby application?
[09:09:54] abyss: apeiros: yes;) Now the script is too slow;) I have something like this: https://gist.github.com/anonymous/8e8bb7f376fce8d3cef1 Unfortunatelly I had cut off checking by INSERT UPDATE etc because INSERTS UPDATES can be divided into few lines, not only one:(
[09:10:25] abyss: *I had to cut off
[09:10:38] yorickpeterse: yh: yes: don't store it in memory
[09:10:43] apeiros: abyss: are all numbers which can occur in the file IDs?
[09:10:58] yorickpeterse: yh: when the process dies so does the memory, so you have to store it externally somewhere
[09:11:02] yorickpeterse: that can either be a file, a database, etc
[09:11:21] abyss: apeiros: sorry I don't know what you're asking about :(
[09:11:42] apeiros: abyss: in your "dump-to-database-test-1" file, are there numbers in it which are not IDs?
[09:11:42] abyss: but I checking each line if contain one of the figure in ids array
[09:12:33] abyss: dump-to-database-test-1 is the file after changing it's outcome
[09:12:41] msgodf: has joined #ruby
[09:13:11] apeiros: abyss: right. correction: in your "test.sql" file, are there numbers in it which are not IDs?
[09:13:30] yh: yorickpeterse: ah, was thinking stuff like POSIX shm_open
[09:14:51] abyss: apeiros: yes, there are. File looks like this one: https://gist.github.com/anonymous/4f80127d871bf60c771a but ofcourse in that extract there's no updates/insert divided to many lines (but in main files there are)
[09:15:28] bnagy: yh: I don't know if it's debian specific, but those create a /dev/shm automatically
[09:15:31] jas02: has joined #ruby
[09:15:44] bnagy: for osx a regular user can mount a ramdisk
[09:16:31] yh: bnagy: is that a problem?
[09:16:37] apeiros: abyss: so you just hope that you don't accidentally change another number?
[09:16:42] bnagy: no, it's good
[09:16:45] yorickpeterse: yh: IIRC Ruby has some stuff in stdlib for in-memory storage that can be backed up to a file/loaded from it
[09:16:52] yorickpeterse: lemme see if I can find it
[09:17:22] bmalum: has joined #ruby
[09:17:23] abyss: so I need to change everything in SET INSERT_ID and insert/updates/deletes that contain some of the figure from ids array, but updates/insert can be divided into few lines
[09:17:27] abyss: apeiros: yes;)
[09:17:35] apeiros: abyss: that sounds very brittle
[09:17:41] yorickpeterse: Ah yes found it
[09:17:43] yorickpeterse: http://ruby-doc.org/stdlib-2.2.2/libdoc/pstore/rdoc/PStore.html
[09:17:48] yorickpeterse: probably not webscale though
[09:17:58] bnagy: probably not anything-scale
[09:18:37] bnagy: anyway I thought pstore persisted to disk, aren't we talking about persisting to ram?
[09:18:45] edwinvdg_: has joined #ruby
[09:18:50] svoop: has joined #ruby
[09:19:01] apeiros: abyss: SET INSERT_ID always has this form: "SET INSERT_ID=<number>"?
[09:19:02] migbar: has joined #ruby
[09:19:10] abyss: apeiros: yeah, but I presume that it unlikely to ease the pain;)
[09:19:16] abyss: apeiros: yes
[09:19:28] apeiros: abyss: btw., you can edit gists. that way they have a revision and we can see how the file changed
[09:19:35] apeiros: instead of pasting a new gist every time
[09:19:46] roshanavand: has joined #ruby
[09:19:46] abyss: oh, I didn't know that, thank you.
[09:19:48] hectortrope: has joined #ruby
[09:19:55] apeiros: abyss: do the others have a fixed format too?
[09:20:08] abyss: apeiros: but I need to log in?
[09:20:16] roshanavand: has joined #ruby
[09:20:19] apeiros: abyss: or keep the browser session open, yes
[09:20:35] apeiros: at least I think anonymous can edit during a session
[09:21:31] timonv: has joined #ruby
[09:21:42] abyss: apeiros: INSERT INTO, DELETE, UPDATE always begin the same, but the rest is arbitrary I mean for example it can be divided into separe lines etc
[09:21:58] Ox0dea: abyss: Sounds like you need a SQL parser.
[09:22:30] apeiros: abyss: can you make 3 examples of UPDATE which differ a lot in your opinion?
[09:22:33] jhass: abyss: maybe we're approaching this in a completely wrong way. Why do you have to change the IDs?
[09:23:19] mgeek: has joined #ruby
[09:23:28] mgeek: Hey, have you heard about WebAssembly?
[09:23:59] jhass: abyss: and why do you need to do it on the dump opposed to say importing it into a (temporary) DB and changing the data there?
[09:24:09] jhass: ?ot mgeek
[09:24:10] ruboto: mgeek, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[09:24:13] Hanmac1: its very fun when someones who has NO exp with html are working on something like joomla ;P
[09:24:19] ZOMGITSABEAR: has joined #ruby
[09:24:23] jhass: hanmac1: ^ too
[09:24:58] mgeek: Suddenly, we keep ##ruby clean, lol ok.
[09:25:17] jhass: nah, you can do whatever you ant in ##ruby :P
[09:25:19] Hanmac1: recently i found that they put the <input> inside <label> elements ... that this doesnt work had no one tested before it seems ;P
[09:25:36] abyss: apeiros: it's how the divided line can looks like: https://gist.github.com/anonymous/25c29a297de2c61d350e
[09:25:37] mgeek: Actually, I was gonna ask if WebAssembly will provide Ruby and what you think about it.
[09:25:40] bigkevmcd: has joined #ruby
[09:25:50] ZOMGITSABEAR: what is ##ruby?
[09:25:51] apeiros: mgeek: didn't jhass just tell you to ask that in #ruby-offtopic?
[09:26:14] mgeek: apeiros: No, this is a difference question.
[09:26:36] multi_io: has joined #ruby
[09:27:03] Copperfield: has joined #ruby
[09:27:31] apeiros: mgeek: ok. true, I only read until webassembly and sighed there :)
[09:27:38] abyss: jhass: I have databases old database which shouldn't be restored unfortunately the client spot this after few days so into that database some operations has been done. Now I have the right database from 1.06.2015
[09:27:55] railsraider: has joined #ruby
[09:28:00] jhass: mgeek: I think opal will be able to draw some optimizations from it, maybe someone gets mruby to run but I don't think MRI will happen
[09:28:01] apeiros: mgeek: I doubt full ruby is suitable for webassembly. but mruby might be a good fit.
[09:28:05] abyss: now everything from 1.06.2015 to today I need move to that database from 1.06.2015
[09:28:18] apeiros: eh, seems jhass shares my opinion :D
[09:28:22] tkuchiki: has joined #ruby
[09:28:33] ZOMGITSABEAR: has left #ruby: ()
[09:29:09] jhass: abyss: I'm sorry but I'm not sure I follow
[09:29:18] apeiros: abyss: oy, what's ^M again? I'm not a vim/emacs/whatevereditorthatis user
[09:29:21] jhass: your explanation seems to assume some application context
[09:29:25] abyss: apeiros: oh, now I see you asked about that sql that changing something in my opinion. Do you need more examples?
[09:29:48] jhass: abyss: and again, why is importing to a temporary DB not an option?
[09:29:59] GitGud: has joined #ruby
[09:30:06] GitGud: people here are such gems <3
[09:30:08] apeiros: abyss: would be good. especially ones which differ in your opinion (but same type of query - that is, all should be e.g. INSERTs)
[09:30:21] zotherstupidguy: has joined #ruby
[09:30:38] GitGud: i'm going to learn ruby
[09:31:58] abyss: apeiros: new lines, I can remove it. Don't worry about that:)
[09:32:09] apeiros: abyss: ^M is \n? ok
[09:32:31] wasamasa: and ^J is \r
[09:32:38] abyss: apeiros: yes
[09:32:41] zudochkin: has joined #ruby
[09:33:36] abyss: jhass: I didn't say that:) Each option is ok if I able to restore the data;)
[09:33:51] apeiros: temporary db sounds actually like an excellent way
[09:34:00] apeiros: that way you can manipulate the data using sql
[09:34:11] apeiros: then dump again
[09:34:13] apeiros: and import that
[09:34:52] abyss: jhass: but it will not so easy because customers set up again theirs accounts because they didn't know about issue. So I will have duplicates.
[09:34:57] starfox_sf: has joined #ruby
[09:35:13] jhass: abyss: and you don't have by editing the dump because...?
[09:35:59] abyss: yeah, but it's about 20000 inserts and something about similar with deletes and updates:( restoring binlog to clear database and do something on it is almost I suppose impossible.
[09:36:34] abyss: jhass: yeah, I will edit dump instead of binlog, it would be easier. Great idea.
[09:36:40] Hanmac1: has left #ruby: ()
[09:36:46] sdothum: has joined #ruby
[09:36:46] quimrstorres: has joined #ruby
[09:37:14] startupality: has joined #ruby
[09:37:19] RegulationD: has joined #ruby
[09:37:20] jhass: no, I better bail from this, sorry for wasting your time
[09:37:31] jhass: but I just don't get what your issue is and what you're doing at all
[09:37:33] jhass: not a single bit
[09:37:49] dionysus69: has joined #ruby
[09:38:19] lee-jon: has joined #ruby
[09:38:48] yorickpeterse: "Get autosacling group" ok I need more sugar in my tea
[09:39:06] apeiros: ACTION puts sugar in yorickpeterse's tea
[09:39:17] abyss: jhass: sorry, my english isn't so good, maybe I didn't catch something... But you and apeiros ease my pain because I didn't sink in that I can do it by restore binlog, dump that data from binlog, increase ids, and then merge this. Thank you.
[09:39:30] undeadaedra: ACTION puts tea in yorickpeterse's sugar
[09:40:10] Squarepy: has joined #ruby
[09:44:47] skade: has joined #ruby
[09:45:39] codecop: has joined #ruby
[09:45:49] mojsmiesznynick: has joined #ruby
[09:47:20] vondruch_: has joined #ruby
[09:47:57] ndrei: has joined #ruby
[09:48:26] kayloos: has joined #ruby
[09:49:39] kayloos: has joined #ruby
[09:50:53] rikkipitt: has joined #ruby
[09:50:54] kayloos: has joined #ruby
[09:51:31] fabrice31: has joined #ruby
[09:51:32] dEPy: has joined #ruby
[09:51:59] sigurding: has joined #ruby
[09:52:12] bmalum: has joined #ruby
[09:52:36] x44x45x41x4E: has joined #ruby
[09:54:44] lavros: has joined #ruby
[09:55:05] Oog: has joined #ruby
[09:55:42] shevy: please don't spit in each other's tea
[09:55:50] lordkryss: has joined #ruby
[09:56:06] arup_r: shevy: why so ?
[09:56:26] undeadaedra: ACTION steals shevy tea
[09:58:03] bmalum: has joined #ruby
[09:58:12] Cust0sLim3n: has joined #ruby
[09:59:21] Igorshp: has joined #ruby
[10:00:24] kitallis: is there a library that can detect mime types of remote files without having to download the entire thing?
[10:00:40] kitallis: mimemagic does it, but for remote, you have to feed it the entire blob
[10:00:51] kitallis: something like fastimage but for any file
[10:01:08] yorickpeterse: If it's over HTTP you can do a HEAD request and check the Content-Type header
[10:01:14] kitallis: fastimage is clever because it only partially reads the file, header
[10:01:34] unshadow: has joined #ruby
[10:01:38] jhass: kitallis: some file formats you can only recognize by looking at the last few bytes
[10:01:41] undeadaedra: but file format information are not always at beginning of file
[10:01:56] ndrei: has joined #ruby
[10:02:07] kitallis: yeah, I meant fastimage does that, because images usually have it in the header (I believe)
[10:02:49] undeadaedra: because image file formats usually have information in the first bytes, yes
[10:03:13] camonz: has joined #ruby
[10:03:15] undeadaedra: but there's no determined ???header??? format, each file format choose how to format information
[10:03:51] gheegh: has joined #ruby
[10:04:38] fujimura: has joined #ruby
[10:04:48] froots_0xff: has joined #ruby
[10:06:10] stamina: has joined #ruby
[10:06:23] Papierkorb: has joined #ruby
[10:06:44] dgutierrez1287: has joined #ruby
[10:07:04] allomov: has joined #ruby
[10:07:45] Jimtemp: has joined #ruby
[10:08:24] migbar: has joined #ruby
[10:08:25] j_mcnally: has joined #ruby
[10:08:39] allomov: has joined #ruby
[10:09:39] fujimura: has joined #ruby
[10:10:09] Oog: has joined #ruby
[10:11:20] atomical_: has joined #ruby
[10:11:42] x44x45x41x4E: has joined #ruby
[10:13:24] bruno-: has joined #ruby
[10:14:21] anisha: has joined #ruby
[10:15:14] lavros: has joined #ruby
[10:16:15] scx: has joined #ruby
[10:16:32] yaw: has joined #ruby
[10:16:35] scx: what is the best way to implement singleton class in ruby?
[10:16:53] platzhirsch: has joined #ruby
[10:16:54] yorickpeterse: include Singleton
[10:17:02] vondruch: has joined #ruby
[10:17:09] yorickpeterse: http://ruby-doc.org/stdlib-2.2.0/libdoc/singleton/rdoc/Singleton.html
[10:18:45] bruno-: has joined #ruby
[10:21:12] konieczkow: has joined #ruby
[10:22:25] Oog: has joined #ruby
[10:22:56] Oog: has joined #ruby
[10:23:45] senayar: has joined #ruby
[10:26:04] sharpmachine: has joined #ruby
[10:26:31] migbar: has joined #ruby
[10:26:38] hakunin: has joined #ruby
[10:26:53] fabrice31: has joined #ruby
[10:28:16] califerno: has joined #ruby
[10:29:30] mandarinkin: has joined #ruby
[10:30:29] fgo: has joined #ruby
[10:30:39] jmferreira: has joined #ruby
[10:30:57] ndrei: has joined #ruby
[10:31:51] scx: yorickpeterse: Is it necessary to use Mysingletonclass.instance.mymethod? Why just not use Mysingletonclass.mymethod?
[10:32:51] apeiros: scx: with the latter you'd have to ensure it's instantiated before the first call
[10:33:21] apeiros: but sure, you can do it: `MySingleton = MySingletonClass.instance` now you can use `MySingleton.my_method`
[10:33:37] apeiros: alternatively you can delegate
[10:33:40] galeido: has joined #ruby
[10:35:17] lxsameer: has joined #ruby
[10:35:26] segfalt: has joined #ruby
[10:35:51] datanoise: has joined #ruby
[10:36:06] dg-ratiodata: has joined #ruby
[10:36:22] skade: has joined #ruby
[10:36:45] ndrei: has joined #ruby
[10:37:01] zudochkin: has joined #ruby
[10:37:45] hakunin: has joined #ruby
[10:38:03] startupality: has joined #ruby
[10:38:39] mister_solo: has joined #ruby
[10:40:21] tedstriker: has joined #ruby
[10:40:22] lee-jon: has joined #ruby
[10:40:41] mister_solo: has joined #ruby
[10:41:12] zudochkin: has joined #ruby
[10:41:51] lee-jon: has joined #ruby
[10:42:21] yh: has joined #ruby
[10:42:40] Iskarlar: has joined #ruby
[10:43:18] ahmetkapikiran: has joined #ruby
[10:45:40] khebbie: has joined #ruby
[10:49:19] ljarvis: it's sad that I never really thought to assign the instance to a constant
[10:49:23] ljarvis: although I rarely use singleton
[10:51:53] arup_r: has joined #ruby
[10:52:38] lee-jon: has joined #ruby
[10:53:01] ylla: has joined #ruby
[10:53:45] roshanavand: has joined #ruby
[10:54:08] roshanavand: has joined #ruby
[10:54:37] ponga: has joined #ruby
[10:54:57] apeiros: ljarvis: actually using const_missing it could even be initialized lazily
[10:55:33] sigurding: has joined #ruby
[10:55:34] shock_one: has joined #ruby
[10:56:21] romain_t: has joined #ruby
[10:56:32] lee-jon: has joined #ruby
[10:57:04] chinmay_dd: has joined #ruby
[10:58:07] DEA7TH: has joined #ruby
[10:59:40] dzejrou: has joined #ruby
[10:59:57] rodfersou: has joined #ruby
[11:00:40] ndrei: has joined #ruby
[11:00:57] balazs: has joined #ruby
[11:03:07] Siyfion: has joined #ruby
[11:03:10] GreatSUN: apeiros: thanks for mentioning, in this case I am passing it on into another method
[11:03:20] wookiehangover: has joined #ruby
[11:04:15] fabrice31: has joined #ruby
[11:04:55] zotherstupidguy: has joined #ruby
[11:07:03] NeverDie: has joined #ruby
[11:10:49] ponga: has joined #ruby
[11:11:31] senayar: has joined #ruby
[11:12:48] zotherstupidguy: has joined #ruby
[11:13:19] Rubie: has joined #ruby
[11:14:22] wookiehangover: has joined #ruby
[11:15:13] dgutierrez1287: has joined #ruby
[11:15:43] Macaveli: has joined #ruby
[11:16:36] rodferso1: has joined #ruby
[11:17:03] wldcordeiro_: has joined #ruby
[11:17:50] scx: I want to use OptionParser with subcommands. Is it good example or I should search something else?: https://gist.github.com/rkumar/445735
[11:17:54] symm-: has joined #ruby
[11:18:05] zacts: has joined #ruby
[11:18:05] zacts: has joined #ruby
[11:18:21] mister_solo: has joined #ruby
[11:18:57] ljarvis: scx: thor is good for this kind of thing
[11:19:21] krz: has joined #ruby
[11:20:06] k3asd`: has joined #ruby
[11:20:45] zenguy_pc: has joined #ruby
[11:20:53] _blizzy_: has joined #ruby
[11:20:58] bnagy: wat thor?
[11:21:52] skade: has joined #ruby
[11:22:08] ponga: has left #ruby: ()
[11:22:15] bnagy: huh, looks cool. :)
[11:22:42] erts: has joined #ruby
[11:22:48] WeebleWobble: has joined #ruby
[11:23:33] jgpawletko: has joined #ruby
[11:23:34] agent_white: Using Curses in ruby, should I have the executable initialize the Curses stuff (init_screen,start_color,nonl,cbreak,noecho... etc.) ?
[11:23:36] starfox_sf: has joined #ruby
[11:23:49] WeebleWobble: Is Starfox Command worth buying
[11:23:52] agent_white: I'm just writing a simple inventory app, pretty much.
[11:23:55] jhass: ?ot WeebleWobble
[11:23:55] ruboto: WeebleWobble, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[11:24:01] WeebleWobble: I heard it was coming out for Virtual Console on the Wii U video game system
[11:24:04] WeebleWobble: i'm asking starfox_sf
[11:24:23] WeebleWobble: the animal voices in Starfox Command seem really off and horrible
[11:24:37] WeebleWobble: also is Starfox Command compatible with the Nintendo WiFi network
[11:24:42] WeebleWobble: fuck you jhass
[11:24:57] jhass: !ban WeebleWobble !T 1w troll
[11:24:58] ChanServ: +b WeebleWobble!*@*
[11:24:58] ChanServ: ChanServ kicked WeebleWobble: troll
[11:25:11] Wobble: has joined #ruby
[11:25:11] ChanServ: +b *!*@41-222-227-173.access.macrolan.co.za
[11:25:11] ChanServ: ChanServ kicked Wobble: troll
[11:25:30] agent_white: I wish there were more examples of Curses programs, other than ones from 3 years ago D:
[11:25:54] bnagy: surely you can find older ones than that, did you even try??
[11:26:07] agent_white: bnagy: Do I dare to? ;)
[11:26:14] RegulationD: has joined #ruby
[11:26:30] agent_white: Is it OK to initialize ncurses stuff in the binary, rather than in the first/main object I create?
[11:26:35] bnagy: srsly though, just read C apps, probably
[11:26:54] sharpmachine: has joined #ruby
[11:27:09] agent_white: bnagy: Yeah this is my second go-round of attempting ncurses in Ruby. Just trying to get it right. It _does_ seem most initialize ncurses in main().
[11:27:24] agent_white: That way the screen is setup, as well as its modifiers...
[11:27:37] rodfersou: has joined #ruby
[11:27:37] agent_white: ACTION solved his own question, with bnagy's help
[11:27:37] ljarvis: termbox <3
[11:27:55] bnagy: agent_white: ^^ I still +1 termbox
[11:28:19] Macaveli: has joined #ruby
[11:28:29] ndrei: has joined #ruby
[11:28:30] agent_white: bnagy: Only thing that worries me is the last commit being from over a year ago :(
[11:28:50] bnagy: the ruby stuff? It's probably a binding
[11:28:51] agent_white: Curses, though turned into a gem, has last update from 8 days ago.
[11:28:59] agent_white: https://github.com/jamescook/rb_termbox/commits/master
[11:29:10] bnagy: I only update bindings when they're broken *shrug*
[11:29:25] bnagy: or when upstream changes API or something
[11:29:52] agent_white: Ah true... but I'm still very new to programming. Haven't touched code in 4 months as-is, and before I was still new :D
[11:30:14] agent_white: So whatever is most reliable without me tinkering in the back-end is awesome.
[11:30:22] bnagy: I seem to recall there was an ffi binding as well, imvho I would look at that first, but w/e
[11:30:33] agent_white: I did use ncursesw before.
[11:30:36] bnagy: if you want nice menu-ey stuff curses is probably richer anyway
[11:30:46] agent_white: But checking out just curses this time.
[11:31:29] agent_white: Yeah... TBH I'm honestly tempted to just go straight to coding it in C to avoid it all. I need a good excuse to learn it/crack open K&R anyways.
[11:33:18] bnagy: hahahah hahah
[11:33:26] bnagy: ACTION cries
[11:34:02] agent_white: I've wanted to learn it for a long time :)
[11:34:21] shevy: agent_white still fighting with ncurses?
[11:34:25] agent_white: Classes in my university (at least... when I go back) are taught in C/C++.
[11:34:30] agent_white: shevy: Nope! Just starting :D
[11:34:39] undeadaedra: int main() { int problem_count = 99; }
[11:34:42] shevy: its name was wisely chosen
[11:34:48] agent_white: undeadaedra: But a bitch ain't one?
[11:35:03] undeadaedra: #include <bitch.h>
[11:35:21] agent_white: Ruby and C are languages I want to put into my coffee in the morning.
[11:35:42] apeiros: agent_white, undeadaedra: please don't.
[11:36:04] agent_white: apeiros: I'm good. Mom's spaghetti has filled my tummy quite enough.
[11:36:32] shevy: that b....!
[11:36:34] agent_white: bnagy: Why not C, though? It birthed Ruby, afterall?
[11:36:37] bronson: has joined #ruby
[11:36:44] apeiros: agent_white: I'm referring to your bitch joke. that's stuff for your regulars table, not here.
[11:37:07] agent_white: apeiros: I'm not sure what you mean. But I won't continue it.
[11:37:36] shevy: agent_white what will you actually build with curses?
[11:38:05] shevy: I tried the tic-tac-toe-example; that gem does not seem to work
[11:38:42] agent_white: shevy: Basically just a minor inventory system :) I mix my own liquids for vaporizors/electronic cigs, so just making a simple recipe calculator and inventory-of-flavors thingy.
[11:39:34] agent_white: Ones out there require me to run Windows in some VM, so I'd rather just have it in a terminal here. :P
[11:39:36] diegoviola: has joined #ruby
[11:40:49] commondream: has joined #ruby
[11:41:31] diegoviola: I'm trying to consume an API over HTTP / JSON, and I get a hash with an array that contains the hash, after I JSON.parse(res.body) I see lots of \r\n and so on
[11:41:37] diegoviola: should I get rid of those?
[11:42:14] undeadaedra: We must get rid of CRLF at once.
[11:42:26] Darkwater: s/\r\n/\n/g
[11:42:32] diegoviola: I'm also not sure why I get => ["type", "article_id", "url", "title", "body", "category_id", "search_score"] for j["results"][0].keys
[11:42:51] undeadaedra: what do you expect?
[11:43:13] agent_white: undeadaedra: I have markers in vim because I spent a few hours tryin to debug code with CRLF in it.
[11:43:14] diegoviola: shouldn't I get symbols instead?
[11:43:19] diegoviola: like :title, :body, and so on?
[11:43:23] ahmetkapikiran: has joined #ruby
[11:43:28] Darkwater: only if you set json to use symbols
[11:43:37] undeadaedra: hash keys can be anything, not only symbols
[11:43:55] diegoviola: how do I get symbols instead?
[11:43:56] ljarvis: but in json they can only be strings
[11:44:04] ljarvis: diegoviola: when you parse it, check the json docs
[11:44:21] ljarvis: >> JSON.parse("{'foo' => 'bar'}", symbols: true)
[11:44:22] ruboto: ljarvis # => uninitialized constant JSON (NameError) ...check link for more (https://eval.in/383714)
[11:44:29] ljarvis: >> require 'json'; JSON.parse("{'foo' => 'bar'}", symbols: true)
[11:44:30] ruboto: ljarvis # => 757: unexpected token at '{'foo' => 'bar'}' (JSON::ParserError) ...check link for more (https://eval.in/383715)
[11:44:59] undeadaedra: >> JSON.parse(%({"foo": "bar"}), symbols: true)
[11:45:00] ruboto: undeadaedra # => uninitialized constant JSON (NameError) ...check link for more (https://eval.in/383716)
[11:45:11] undeadaedra: >> require 'json'; JSON.parse(%({"foo": "bar"}), symbols: true)
[11:45:12] ruboto: undeadaedra # => {"foo"=>"bar"} (https://eval.in/383717)
[11:45:19] ljarvis: oh I use a hash rocket LOL
[11:45:26] ljarvis: meh that's not the option name. It was a long shot
[11:45:30] Darkwater: oh no, it's because json doesn't accept ''
[11:45:35] ljarvis: symbolize_names
[11:45:38] undeadaedra: yeah, json is stupid
[11:45:46] undeadaedra: ljarvis: Active Support, iirc
[11:45:53] ljarvis: require 'json'; JSON.parse(%({"foo": "bar"}), symbolize_names: true)
[11:45:56] yorickpeterse: yay 2nd aeron chair
[11:46:00] Darkwater: yeah that should work
[11:46:00] yorickpeterse: ACTION feels posh
[11:46:01] ljarvis: >> require 'json'; JSON.parse(%({"foo": "bar"}), symbolize_names: true)
[11:46:02] ruboto: ljarvis # => {:foo=>"bar"} (https://eval.in/383718)
[11:46:06] Darkwater: 5 tries later
[11:46:09] chussenot: has joined #ruby
[11:46:11] ljarvis: yorickpeterse: you need two chairs?
[11:46:16] yorickpeterse: one at home, one at the office
[11:46:31] ljarvis: my chair is shit
[11:46:36] yorickpeterse: peasant coworkers are all jelly
[11:46:39] undeadaedra: twist: working from home
[11:46:59] ljarvis: my sofa is quite comfy
[11:47:15] yorickpeterse: I pity your neck
[11:47:17] ljarvis: yorickpeterse: jesus fuck they're expensive
[11:47:30] yorickpeterse: my back is worth more than an aeron
[11:47:31] ljarvis: yeah I'll sit on my soap box
[11:48:04] bnagy: yorickpeterse: are you still talking about your chairs??
[11:48:10] bnagy: man it's been days o_0
[11:48:41] bnagy: you should try a swift dose of buddhism :P
[11:48:52] ljarvis: or a swift dose of stfu
[11:49:15] Iskarlar: has joined #ruby
[11:50:49] shevy: do weight-lifting against your bad back yorickpeterse!
[11:50:53] yorickpeterse: oh hm, I should totally take a photo to show off
[11:51:16] bnagy: kids these days, it's all aerons, Rust and monads :<
[11:51:30] nateberkopec: has joined #ruby
[11:51:42] aridere: has joined #ruby
[11:52:46] phutchins: has joined #ruby
[11:53:13] edwinvdgraaf: has joined #ruby
[11:53:47] chipotle: has joined #ruby
[11:54:05] droidburgundy: has joined #ruby
[11:54:07] yorickpeterse: my chair is pretty monadic though
[11:54:12] bnagy: . o O ( he knows my weak spot )
[11:54:13] yorickpeterse: no side effects too
[11:54:22] yorickpeterse: besides a higher social status
[11:55:21] ldnunes: has joined #ruby
[11:55:26] Al3ks: has joined #ruby
[11:56:13] arturhoo: has joined #ruby
[11:56:23] shock_one: yorickpeterse: you know that if your chair is monadic, you can't get out of it, right? However, if you're sitting on a chair on a chair, you can join those two.
[11:56:46] senayar: has joined #ruby
[11:56:47] svoop: has joined #ruby
[11:57:43] francoi__: has joined #ruby
[11:58:20] bnagy: we have now reached Peak Bay Area Humour
[11:58:33] yorickpeterse: http://downloads.yorickpeterse.com/images/move_aside_peasants.jpg
[11:58:36] x44x45x41x4E: has joined #ruby
[11:58:37] Cust0sLim3n: has joined #ruby
[11:58:49] edwinvdg_: has joined #ruby
[11:58:51] yorickpeterse: shock_one: this chair and I will be one
[12:01:05] ItSANgo__: has joined #ruby
[12:01:17] arturhoo: has joined #ruby
[12:01:20] centrx: has joined #ruby
[12:03:13] zudochkin: has joined #ruby
[12:03:42] shevy: love letters to a chair
[12:03:56] shevy: the monitor is quite far away though
[12:04:01] yorickpeterse: well, it's probably the only thing that gets to touch my butt ~9 hours a day
[12:04:13] yorickpeterse: my monitor is just a voyeur
[12:04:34] yorickpeterse: but yeah, I pulled it closer a bit
[12:04:45] yorickpeterse: My previous chair was a bit less long (forward wise)
[12:04:50] yorickpeterse: So I could sit closer to it
[12:04:51] undeadaedra: ( ???? ???? ????)
[12:05:08] yorickpeterse: "oh aeron you're so big"
[12:05:17] but3k4: has joined #ruby
[12:05:21] shock_one: Speaking of monads, can anybody explain me how the Y combinator works? I've been trying to understand it for hours, and now can even write it from the top of my head, but I still don't get all those bindings. https://gist.github.com/shockone/47431c0096964abe14d1
[12:05:41] yorickpeterse: shock_one: they work by donating money to crappy startups
[12:06:18] micmus: has joined #ruby
[12:06:51] yoongkang: has joined #ruby
[12:07:49] charliesome: has joined #ruby
[12:07:51] yorickpeterse: shock_one: but what part is confusing you in this Gist?
[12:08:13] endash: has joined #ruby
[12:09:08] abyss: apeiros: jhass guys I think operating on binlog will be easier, because it's hard to do something or merge inserts only (and some inserts don't have autoincrement fileds:/). I need updates and deletes as well...
[12:10:02] shock_one: Let's start from the simplest question: line 9 and the function passed on the lines 11-13 are identical (because if you wrap the former one in a function and call it, you'll get the same result). How can I define it in one place and then use twice?
[12:11:00] shock_one: yorickpeterse: also, I know that somewhere we pass a parameter which is never used. Where is that?
[12:11:55] diegoviola: #map always returns an array, no?
[12:12:00] shock_one: diegoviola: yes.
[12:12:27] diegoviola: I thought it was the same as each, that it just printed the result instead
[12:12:31] hoov: has joined #ruby
[12:12:42] yorickpeterse: shock_one: all params are used
[12:13:07] serivichi: has joined #ruby
[12:13:41] shock_one: yorickpeterse: correct. But on one of the iterations one of the params is not.
[12:13:43] yorickpeterse: You also can't re-use any functions here, since they all do different things (as far as I can tell)
[12:14:20] yorickpeterse: shock_one: per jshint all params are used
[12:14:23] endash: has joined #ruby
[12:14:24] yorickpeterse: so I'm fairly sure they are :P
[12:14:26] mengu: has joined #ruby
[12:15:38] shock_one: yorickpeterse: I've updated the gist to better show the identical functions.
[12:16:17] hildgrim: has joined #ruby
[12:16:55] apeiros: diegoviola: Array#map, Enumerable#map and Hash#map do. other than that - it's an ordinary method and returns whatever the implementor makes it return???
[12:17:12] tsvenson: has joined #ruby
[12:17:16] allomov: has joined #ruby
[12:17:27] denver: has joined #ruby
[12:17:41] shock_one: yorickpeterse: It calls itself recursively, right? On one of the iterations f is not evaluated. Which f is that?
[12:18:37] hildgrim: Stupid question; how can i manage to combine strings in arrays like this http://pastebin.com/9q2NDNjE
[12:18:38] ruboto: hildgrim, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/3a5b956709c1880def3c
[12:18:38] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[12:18:52] yorickpeterse: shock_one: how do you know it's not evaluated?
[12:19:01] ndrei: has joined #ruby
[12:19:04] shock_one: hildgrim: a.zip(b).map(&:join)
[12:19:22] hildgrim: shock_one: aha! .zip!
[12:19:26] hildgrim: thank you very much
[12:19:52] shock_one: hildgrim: beware that arrays must be of the same length.
[12:20:06] diegoviola: apeiros: ok ty
[12:20:11] Xeago: has joined #ruby
[12:20:29] shock_one: yorickpeterse: I've read a couple of tutorials, and they say there is a point when the parameter is not evaluated.
[12:20:29] hildgrim: shock_one: aha :(
[12:21:19] yorickpeterse: shock_one: looking at this Gist I can only think that those tutorials are full of shit
[12:21:26] konieczkow: has joined #ruby
[12:21:28] yorickpeterse: unless I'm blind all parameters are being used
[12:21:40] shock_one: yorickpeterse: and it's a big deal, because otherwise it would evaluate infinitely.
[12:22:31] milesmatthias: has joined #ruby
[12:22:34] yorickpeterse: https://gist.github.com/shockone/47431c0096964abe14d1#file-y-js-L3 here on line 3 if x <= 1 it will unwind the call stack
[12:22:47] abyss: apeiros: do you have maybe idea how to change this updates with couples lines?
[12:23:06] apeiros: abyss: still waiting for your examples
[12:23:36] apeiros: because IMO with the file modification approach, you should change completely how you go about it. but that depends on your actual input.
[12:23:37] lessless: has joined #ruby
[12:24:10] j4cknewt: has joined #ruby
[12:24:10] abyss: apeiros: yeah? I gave one. OK, I'm going to paste some. I will give in one file some examples with long updates and normal in one file.
[12:24:21] diegoviola: what happened with #ruby-lang?
[12:24:25] apeiros: one is not sufficient. the question is how regular your input is
[12:24:28] apeiros: diegoviola: it got merged
[12:24:33] diegoviola: apeiros: finally
[12:24:41] ahmetkapikiran_: has joined #ruby
[12:25:17] diegoviola: I will not believe that until they add a redirect #ruby-lang > #ruby
[12:25:17] failshell: has joined #ruby
[12:25:42] Rapier-: has joined #ruby
[12:25:52] apeiros: diegoviola: that is in place for weeks now.
[12:26:04] apeiros: a redirect
[12:26:08] diegoviola: #ruby-lang: Cannot join channel (+i) - you must be invited
[12:26:09] jhass: diegoviola: it doesn't happen if you're already in the target channel
[12:26:11] diegoviola: I'm getting this
[12:26:19] diegoviola: hrm, let's see
[12:26:21] diegoviola: has left #ruby: ("WeeChat 1.2")
[12:26:23] diegoviola: has joined #ruby
[12:26:47] quimrstorres: has joined #ruby
[12:27:12] dhjondoh: has joined #ruby
[12:27:20] lessless: folks, how to get an array of associated record ids?
[12:27:34] apeiros: lessless: context.
[12:27:36] shock_one: lessless: what is that?
[12:27:39] lessless: this.get('model.association_ids') returns nothing
[12:27:48] sharpmachine: has joined #ruby
[12:27:48] apeiros: lessless: wrong channel?
[12:27:54] apeiros: ruby doesn't have `this`
[12:28:01] jhass: lessless: welcome to the Ruby programming language channel
[12:28:08] jhass: your sample looks like ember.js
[12:28:20] micmus: has joined #ruby
[12:29:35] micmus: has joined #ruby
[12:30:11] abyss: apeiros: https://gist.github.com/anonymous/64514e6991b57a8b294c this is better example?
[12:30:37] senayar: has joined #ruby
[12:30:37] senayar: has joined #ruby
[12:31:28] startupality: has joined #ruby
[12:32:00] hildgrim: has left #ruby: ()
[12:32:30] abyss: apeiros: the file is not regular at all. But there is always something between begin and commit. And I need to chagne id = '11446' (in that long update) for example if this id is in my array.
[12:33:41] chinmay_dd: has joined #ruby
[12:34:11] startupality: has joined #ruby
[12:34:40] yh: has joined #ruby
[12:35:53] stardiviner: has joined #ruby
[12:36:28] lee-jon: has joined #ruby
[12:37:27] skade: has joined #ruby
[12:37:46] apeiros: abyss: from where do you have your id's list then?
[12:37:54] apeiros: I mean from where do you know which id's you have to increment?
[12:38:50] chussenot: has joined #ruby
[12:39:13] dumdedum: has joined #ruby
[12:39:53] abyss: I put everything to separate file and I did something like this: awk -F'=' '/INSERT_ID/ {print $2}' binlog-restore-20150614-1230-slice|sed 's/\/\*\!\*\/\;//g' > id_to_change so I put everything from INSERT_ID=figure and put to file
[12:39:53] edwinvdgraaf: has joined #ruby
[12:41:34] abyss: each number from SET INSERT_ID=number should be increased.
[12:42:48] yh: has joined #ruby
[12:42:55] spyderman4g63: has joined #ruby
[12:43:06] ahmetkapikiran: has joined #ruby
[12:43:45] apeiros: ok. that gets me back to regularity. I doubt it's irregular. you have a couple of tables. and it'll always be `INSERT INTO <table> (<columns>) VALUES (<values>)`
[12:43:45] veinofstars: has joined #ruby
[12:44:06] apeiros: and IMO you should collect all the different tables and how their INSERT/UPDATE queries look like
[12:44:21] apeiros: and figure which of their columns are ID columns which need replacement
[12:44:45] apeiros: because then you can process the file much more efficiently
[12:48:08] davedev24_: has joined #ruby
[12:48:11] zudochkin: has joined #ruby
[12:48:11] jefus: has left #ruby: ("Leaving")
[12:48:21] guillaume-rb: has joined #ruby
[12:48:33] francoi__: has joined #ruby
[12:48:53] sgambino: has joined #ruby
[12:48:55] Xeago: has joined #ruby
[12:49:20] abyss: apeiros: you mean I should extract all insert/update/delete and then do something with this file?
[12:51:03] apeiros: I mean you should figure out the pattern. and use that. instead of hoping that you don't accidentally change the wrong number.
[12:51:31] yh: has joined #ruby
[12:51:32] apeiros: abyss: how many tables do you insert into/update in that file?
[12:51:33] abyss: previously it was impossible because I didn't know that I can extract binlog for separate database. So I needed all begin use somedatabase commit, now I can do that bacause I found an option in mysqlbinlog ;)
[12:51:59] langlands: has joined #ruby
[12:52:29] edwinvdg_: has joined #ruby
[12:52:45] abyss: 10290 - inserts, update- 25922, delete - 1482
[12:54:17] abyss: but it will be more because it's binlog from last week
[12:54:25] Xeago: has joined #ruby
[12:54:33] valkyrka: has joined #ruby
[12:56:24] jlast: has joined #ruby
[12:56:24] haxrbyte: has joined #ruby
[12:56:25] ponga: has joined #ruby
[12:56:39] troulouliou_dev: has joined #ruby
[12:57:16] griffindy: has joined #ruby
[12:58:00] zudochkin: has joined #ruby
[12:58:01] haxrbyte: has joined #ruby
[12:58:24] haxrbyte: has joined #ruby
[12:59:16] apeiros: abyss: I don't ask for the number of *records*
[12:59:20] apeiros: I ask for the number of *tables*
[12:59:36] techsethi: has joined #ruby
[13:00:02] apeiros: like "user", "codes" etc.
[13:00:07] segfalt: has joined #ruby
[13:00:32] evanjs: has joined #ruby
[13:01:42] abyss: apeiros: oh, ok, sorry 114 tables for the first database, 5 for second, 123 for next, 26 for next database.
[13:01:44] ZOMGITSABEAR: has joined #ruby
[13:02:15] balazs: has joined #ruby
[13:02:25] Cust0sLim3n: has joined #ruby
[13:02:37] k3asd`: has joined #ruby
[13:03:07] apeiros: ok, that sounds like a bit of work :)
[13:03:15] apeiros: I'm a bit busy atm, sorry
[13:03:33] msnyon: has joined #ruby
[13:04:27] abyss: apeiros: ok, thank you for your help:)
[13:04:32] haxrbyte: has joined #ruby
[13:04:46] brettnem: has joined #ruby
[13:05:10] brettnem: I have two gems that both declare ???Cassandra???. Is there anyway I can use them at the same time?
[13:05:11] Akagi201: has joined #ruby
[13:05:12] DexterLB: has joined #ruby
[13:05:23] sarkyniin: has joined #ruby
[13:05:38] jhass: if you're lucky it works
[13:05:46] wahben: has joined #ruby
[13:05:47] jhass: but there's no general yes
[13:05:48] nonparfumee: has joined #ruby
[13:05:50] mdz_: has joined #ruby
[13:06:05] chussenot: has joined #ruby
[13:06:08] zudochkin: has joined #ruby
[13:06:09] Palmer11: has joined #ruby
[13:06:29] langlands: has joined #ruby
[13:06:59] sandstrom: has joined #ruby
[13:07:13] brettnem: well, it doesn???t work
[13:07:39] brettnem: is there an easy way to explicity declare the gem so one could be like Cassandra1 and the other could be Cassandra2?
[13:07:56] jhass: still asking for luck, but require "gem_a"; Cassandra2 = Cassandra; Object.const_remove(:Cassandra); require "gem_b"
[13:08:20] jhass: if that doesn't work swap them around
[13:08:22] brettnem: that is an interesting idea
[13:08:29] jhass: but it's brittle and may break at any point
[13:08:37] charliesome: has joined #ruby
[13:08:41] brettnem: what makes that brittle?
[13:08:44] brettnem: seems to make sense?
[13:08:59] jhass: the gem might very well have a Cassandra::Foo somewhere
[13:09:00] DefV: That's considering Cassandra gem doesn't use Cassandra constant
[13:09:08] wahben: Hey anyone knows how to suppress these warnings? "warning: assigned but unused variable - e". I'm using ruby 2.2.2p95
[13:09:15] haxrbyte: has joined #ruby
[13:09:20] ljarvis: yes, use the variable or dont assign it
[13:09:31] lee-jon: has joined #ruby
[13:09:36] NeverDie: has joined #ruby
[13:09:40] apeiros: brettnem: you could collect all files the gem loads and use a custom loader
[13:09:44] wahben: In a Gem I don't control
[13:10:05] wahben: ugh.. alright. well thanks! and have a nice day.
[13:10:09] apeiros: e..g module Isolated; end; Isolated.module_eval(File.read(file), file, 1)
[13:10:11] ljarvis: (we have lots of gem deps that throw off warnings that are just as frustrating)
[13:10:13] InternetFriend: has joined #ruby
[13:10:15] wahben: has left #ruby: ()
[13:10:26] brettnem: apeiros: I???m kinda new to ruby, is there some reading material on that?
[13:10:32] apeiros: not really
[13:10:33] ljarvis: wahben: fwiw.. you could submit a pull request to fix the warning in the gem
[13:10:48] x44x45x41x4E: has joined #ruby
[13:11:00] dhjondoh: has joined #ruby
[13:11:12] apeiros: brettnem: sadly, the only real answer is "this will not work". everything else are desperate tries.
[13:11:48] jhass: brettnem: open an issue with either gem to change their namespace
[13:12:19] brettnem: seems odd that namespaces are global yet not in any way regulated (shrug)
[13:12:26] starfox_sf: has joined #ruby
[13:12:38] thelastinuit: has joined #ruby
[13:14:03] CloCkWeRX: has joined #ruby
[13:14:13] commondream: has joined #ruby
[13:14:14] apeiros: brettnem: I agree. but seems most people think something akin to java's reverse-dns style namespaces was "too bothersome" :-/
[13:15:04] RegulationD: has joined #ruby
[13:15:07] yorickpeterse: everything in Java is too bothersome
[13:15:56] livathinos: has joined #ruby
[13:16:11] yqt: has joined #ruby
[13:17:42] jpfuentes2: has joined #ruby
[13:18:17] camonz: has joined #ruby
[13:18:30] brettnem: apeiros: seems like there should at least be some sort of registry for namespaces.. (shrug) so devs can be sure they arn???t stepping on someone else without knowing every namespace in existance
[13:18:46] apeiros: brettnem: again, I agree.
[13:18:47] brettnem: and who gets to ???win??? the ???cassandra??? namespace
[13:18:58] undeadaedra: namespaces are derived from gem name, no?
[13:19:02] apeiros: gem names and used namespaces currently don't need to correspond the slightest.
[13:19:10] brettnem: heh, I don???t think they are undeadaedra
[13:19:13] apeiros: undeadaedra: that's only a convention
[13:19:21] undeadaedra: no, they don't need to, but it's usually the case
[13:19:40] brettnem: it???s just like 90% less confusing when they do, I???ve seen plenty of gems where they arn???t even close
[13:19:56] brettnem: if I want to fix this myself
[13:20:09] brettnem: can I like, find/replace inside the gem? or is it more complicated than that?
[13:20:31] catphish_: has joined #ruby
[13:21:02] havenwood: has joined #ruby
[13:21:25] apeiros: brettnem: it is more complicated than that. but search/replace should cover 99% of the cases.
[13:21:35] apeiros: more complicated: stuff like const_get and friends
[13:21:43] brettnem: oh hell I don???t even use that 1%
[13:21:46] rbennacer: has joined #ruby
[13:22:55] catphish_: does anyone know if it's possible to get field types (or any other raw result data) with mysql2?
[13:23:19] catphish_: ie before all the casting to a nice ruby hash
[13:23:44] revath: has joined #ruby
[13:23:44] mister_solo: has joined #ruby
[13:23:57] coderhs: has joined #ruby
[13:24:06] serivich: has joined #ruby
[13:26:54] bmalum: has joined #ruby
[13:26:59] dblessing: has joined #ruby
[13:27:45] yh: If a gem writes to a file "foo.txt", where will that file be?
[13:27:50] yh: The same directory that executed ruby ?
[13:27:54] rbennacer: has joined #ruby
[13:27:59] yh: (This gem is being required by a script)
[13:28:10] lee-jon: has joined #ruby
[13:28:15] zenguy_pc: has joined #ruby
[13:28:24] sharpmachine: has joined #ruby
[13:28:47] mdz_: has joined #ruby
[13:28:48] allomov: has joined #ruby
[13:29:10] coderhs: has joined #ruby
[13:29:18] startupality_: has joined #ruby
[13:29:22] commondream: has joined #ruby
[13:29:51] jphenow: has joined #ruby
[13:30:16] devdazed: has joined #ruby
[13:30:18] yorickpeterse: The current working directory
[13:31:13] DroidBur_: has joined #ruby
[13:31:30] charliesome: has joined #ruby
[13:31:36] zudochkin: has joined #ruby
[13:31:53] malconis: has joined #ruby
[13:32:01] quimrstorres: has joined #ruby
[13:32:33] mrmargolis: has joined #ruby
[13:33:45] Tempesta: has joined #ruby
[13:33:57] malconis: has joined #ruby
[13:34:21] yorickpeterse: lol, I like recruiter Emails
[13:34:31] yorickpeterse: especially their signatures that state "YOU MAY NOT DISCLOSE THIS BLA BLABLA "
[13:34:40] undeadaedra: Generic signatures
[13:34:51] yorickpeterse: oh really? I wasn't aware your made up laws are automatically applied the moment I read this Email
[13:34:53] hinbody: has joined #ruby
[13:35:03] yorickpeterse: "and you are strongly advised to check for the latest viruses on its receipt."
[13:35:09] undeadaedra: I don't have those kind of mails :(
[13:35:10] apeiros: brettnem: problem is more when/if the gem uses that 1% ;-)
[13:35:18] yorickpeterse: I hate how they just ignore my website though
[13:35:26] yorickpeterse: " Although I appreciate the interest I am not interested in job offers at the moment."
[13:35:31] yorickpeterse: I might have to put that in a <marquee> after all
[13:35:42] undeadaedra: marquee still works?
[13:36:00] jhwhite: has joined #ruby
[13:36:02] yorickpeterse: Of course it does
[13:36:33] yorickpeterse: it's still part of HTML 5.1
[13:36:50] bmalum: has joined #ruby
[13:36:50] undeadaedra: I thought this thing was burried
[13:37:44] chinmay_dd: has joined #ruby
[13:37:50] agent_white: has joined #ruby
[13:38:30] dstarh: has joined #ruby
[13:39:36] dede: has joined #ruby
[13:39:37] ryba: has joined #ruby
[13:40:20] JoshL: has joined #ruby
[13:40:27] Marsupermammal: has joined #ruby
[13:40:57] ta: has joined #ruby
[13:41:39] enebo: has joined #ruby
[13:43:53] chussenot: has joined #ruby
[13:44:01] shevy: how dare you undeadaedra
[13:44:03] shevy: <marquee>baguette</marquee>
[13:44:36] Rubie: has joined #ruby
[13:45:09] edwinvdgraaf: has joined #ruby
[13:45:42] atomical: has joined #ruby
[13:46:56] undeadaedra: ACTION burries shevy 
[13:47:23] sevenseacat: has joined #ruby
[13:49:17] last_staff: has joined #ruby
[13:51:51] Iskarlar: has joined #ruby
[13:52:09] tomphp_: has joined #ruby
[13:53:58] fmcgeough: has joined #ruby
[13:54:16] axl_: has joined #ruby
[13:54:32] DaniG2k: has joined #ruby
[13:55:29] InternetFriend: has joined #ruby
[13:56:48] senayar: has joined #ruby
[13:57:11] galeido: has joined #ruby
[13:58:54] Xeago: has joined #ruby
[13:59:17] paulcsmith: has joined #ruby
[14:01:06] atomx: has joined #ruby
[14:01:10] haxrbyte_: has joined #ruby
[14:01:23] jwilson_: has joined #ruby
[14:01:34] ebarrett: has joined #ruby
[14:02:28] pandaant: has joined #ruby
[14:02:58] commondream: has joined #ruby
[14:03:17] mrmargolis: has joined #ruby
[14:03:25] casadei: has joined #ruby
[14:04:43] drdave: has joined #ruby
[14:05:10] lupine: has joined #ruby
[14:05:14] Mojo_Nixon: has joined #ruby
[14:05:27] dhjondoh: has joined #ruby
[14:06:02] yh: has joined #ruby
[14:07:17] centrx: The synergy is blowing up.
[14:07:24] commondream: has joined #ruby
[14:09:58] mrmargolis: has joined #ruby
[14:10:11] d10n-work: has joined #ruby
[14:11:26] dopie: has joined #ruby
[14:15:02] dmmoody: has joined #ruby
[14:15:38] Kricir: has joined #ruby
[14:15:52] kaleido: has joined #ruby
[14:15:57] RegulationD: has joined #ruby
[14:16:33] chussenot: has joined #ruby
[14:16:35] startupality: has joined #ruby
[14:17:22] charliesome: has joined #ruby
[14:18:23] Regulati_: has joined #ruby
[14:18:39] edwinvdg_: has joined #ruby
[14:20:25] atomical: has joined #ruby
[14:21:25] mrmargolis: has joined #ruby
[14:21:37] tkuchiki: has joined #ruby
[14:22:14] konieczkow: has joined #ruby
[14:22:43] shinnya: has joined #ruby
[14:22:53] decoponio: has joined #ruby
[14:23:02] InternetFriend: has joined #ruby
[14:23:25] jonathanwallace: has joined #ruby
[14:24:24] veleno: has joined #ruby
[14:24:33] lkba: has joined #ruby
[14:24:44] lkba: has joined #ruby
[14:24:45] veleno: hello. a program is crashing without telling which line number it crashes to. it only says: ???W, [2015-06-18 16:23:07 #4362] WARN -- : NoMethodError: undefined method `[]' for #<Splayd:0x007fe9c0afa350>???
[14:24:48] glcx: has joined #ruby
[14:24:49] abyss: apeiros: I've changed if to: if ( line !~ /thread_id|BEGIN|COMMIT|end_log_pos/ ) && ( id = ids.find { |w| line =~ /\b#{w}\b/ } ) It should ease a pain a little;)
[14:24:52] ta: has joined #ruby
[14:25:24] havenwood: veleno: Link to the code?
[14:26:09] dorei: has joined #ruby
[14:26:12] renderful: has joined #ruby
[14:26:36] mary5030: has joined #ruby
[14:27:25] veleno: havenwood: https://gist.github.com/vschiavoni/753982f4fa31cc56f0e6
[14:27:33] mary5030: has joined #ruby
[14:28:26] tedstriker: has joined #ruby
[14:28:51] flughafen_: has joined #ruby
[14:28:53] revath: has joined #ruby
[14:28:55] juanpaucar: has joined #ruby
[14:29:04] datanoise: has joined #ruby
[14:29:30] ljarvis: veleno: @splayd is nil
[14:29:31] fgo: has joined #ruby
[14:29:42] ljarvis: its actually undefined
[14:29:42] hahuang65: has joined #ruby
[14:29:47] ljarvis: (ivar values default to nil)
[14:30:00] veleno: but which line ?
[14:30:03] veleno: i don???t see it..
[14:30:04] revath: has left #ruby: ()
[14:30:24] jhass: bah, tab indentation
[14:30:52] chouhoulis: has joined #ruby
[14:30:55] ljarvis: tbh it could be any line, but @splayd isn't instantiated in some instances
[14:31:10] jhass: empty parens, 1kloc file, @@class_vars, $globals....
[14:31:10] ljarvis: the code is just really hard to read, which is why you're having trouble
[14:31:12] jhass: ACTION closes tab
[14:31:22] veleno: jhass: i agree
[14:31:35] segfalt_: has joined #ruby
[14:32:09] Iskarlar: has joined #ruby
[14:32:53] veleno: the auth(..) method initialized @splayd at line 163
[14:32:53] ljarvis: on top of that, there are SO many race conditions
[14:32:58] ljarvis: veleno: kill it with fire
[14:33:14] veleno: ljarvis: that???s also one option???.
[14:33:38] yorickpeterse: ljarvis: ehm, I think I found a nice bug in Slop
[14:34:01] ljarvis: ACTION intrigued
[14:34:35] yorickpeterse: https://gist.github.com/YorickPeterse/77ade5f3f566eeb6fd17 if you run this with "ruby test.rb --version" you get /home/yorickpeterse/.gem/ruby/2.2.0/gems/slop-4.1.0/lib/slop/parser.rb:105:in `try_process': unknown option `--version' (Slop::UnknownOption)
[14:34:41] yorickpeterse: it works fine if you remove the "puts"
[14:34:47] yorickpeterse: so Slop#to_s apparently poops itself
[14:35:08] yorickpeterse: which is wack because it shouldn't even be called
[14:35:23] yorickpeterse: oh hm, seems to break in "parse" even
[14:35:24] ljarvis: why wouldn't it be called?
[14:35:30] yorickpeterse: because of the exit
[14:35:46] yorickpeterse: maybe I have the dumbz though
[14:36:19] dmmoody: has joined #ruby
[14:36:29] ljarvis: that error is definitely weird
[14:36:36] yorickpeterse: haha what the fuck, this gets even better
[14:36:46] yorickpeterse: if you do "puts Slop.parse { .... }" it gives a basic output
[14:36:47] droidburgundy: has joined #ruby
[14:36:51] j_mcnally: has joined #ruby
[14:36:55] yorickpeterse: If you define your own options and all that, it will still give the basic output
[14:37:01] apeiros: hrm, so how do you meaningfully benchmark an asynchronous job queue server? :)
[14:37:04] yorickpeterse: if you do "opts = Slop.parse { ... }; puts opts" you get teh full output
[14:37:10] yorickpeterse: that makes....no sense
[14:37:23] ljarvis: you found the best feature!
[14:37:29] ljarvis: it is no bug!
[14:37:35] ljarvis: please 2 report
[14:38:04] ljarvis: apeiros: you.. dont!
[14:38:07] yorickpeterse: https://gist.github.com/YorickPeterse/7e69b1a3a64ea175e20f lol run this
[14:38:20] yorickpeterse: oooooooho wait
[14:38:22] apeiros: ljarvis: but??? but??? that's not an option!
[14:38:27] yorickpeterse: I think it's the fucking block that gets passed to "puts"
[14:38:47] yorickpeterse: fuck you parse.y
[14:38:58] Hanmac1: has joined #ruby
[14:39:01] ljarvis: puts (Slop.parse) ...
[14:39:07] yorickpeterse: ACTION breaks out the slapping rod and looks sternly at yorickpeterse
[14:39:16] yorickpeterse: dang it, I was hoping it was the parse.y one
[14:39:17] apeiros: yorickpeterse: dude! learn precedence! ;-p
[14:39:27] ljarvis: I guess also Slop.parse really shouldn't allow no args and no block
[14:39:29] apeiros: {} and do/end differ there
[14:39:34] ljarvis: since it's pointless
[14:39:44] apeiros: foo bar {} --> foo(bar {})
[14:39:53] apeiros: foo bar do ??? end --> foo(bar) do ??? end
[14:39:57] yorickpeterse: apeiros: I'm aware of the difference, just didn't take it into account here
[14:39:58] rippa: has joined #ruby
[14:40:01] Hanmac1: shevy & apeiros you guys always disliked $SAFE right? because "$SAFE=2 to 4 are obsolete" ;P
[14:40:18] icebourg: has joined #ruby
[14:40:28] shevy: wat is going on
[14:40:31] apeiros: hanmac1: I didn't dislike $SAFE itself. I only found it underdocumented and hence barely useful.
[14:40:36] shevy: the language is changing faster than my underwear
[14:40:53] yorickpeterse: shevy: stop being a 4 year old then
[14:40:55] Hanmac1: shevy "once a year"? ;P
[14:41:06] yorickpeterse: or get diapers
[14:41:42] shevy: well there was another change not so long ago
[14:42:09] shevy: Nobuyoshi Nakada: * error.c (name_err_receiver): add NameError#receiver method. [Feature #10881]
[14:42:16] shevy: also today
[14:42:48] yorickpeterse: ljarvis: https://github.com/leejarvis/slop/commit/e7521a65b01560ac997ccb907d33e4b3795533a7 hnnggg y u no release dis
[14:42:52] simplyianm: has joined #ruby
[14:43:36] ljarvis: yorickpeterse: I can push a release if you want it now
[14:44:55] ruv: has joined #ruby
[14:45:00] ljarvis: yorickpeterse: have at it
[14:45:07] yorickpeterse: ???(????????)???
[14:45:09] yorickpeterse: (??????????)???
[14:45:13] yorickpeterse: (???????????????????????????)???
[14:45:17] yorickpeterse: (??????????????????)???
[14:45:18] dmmoody: has joined #ruby
[14:45:20] ljarvis: https://rubygems.org/gems/slop
[14:45:22] yorickpeterse: wow, I have a lot of those
[14:45:23] ljarvis: for this version: 0
[14:45:27] ljarvis: BE THE FIRST
[14:45:44] ljarvis: maybe you weren't the first
[14:45:51] ljarvis: maybe next time
[14:46:01] umgrosscol: has joined #ruby
[14:46:02] Rubie: has joined #ruby
[14:46:03] ljarvis: also lol at skewed download counts
[14:46:27] InternetFriend: has joined #ruby
[14:46:52] dgutierrez1287: has joined #ruby
[14:47:07] ljarvis: 4.1 only got 15k downloads, prolly due to people being mad i dropped support for pre Ruby 2
[14:47:38] floodP: has joined #ruby
[14:47:42] yorickpeterse: https://tommorris.org/posts/9317 also this is great
[14:47:43] michaeldeol: has joined #ruby
[14:47:47] floodP: anybody has experience with Savon?
[14:47:48] yorickpeterse: 38. Bitcoin is a technical fix for a societal problem.
[14:47:53] yorickpeterse: 39. apt-get install bitcoin-qt solves the usability problems of Bitcoin. (I???m not making this one up.)
[14:48:21] DaniG2k: Solr or Elastic? which to use
[14:48:35] floodP: how to set SOAP 1.2 in Savon 2?
[14:48:48] yorickpeterse: DaniG2k: that's like asking whether to turn left or right
[14:49:00] yorickpeterse: DaniG2k: do research, see what fits your use cases, experiment, etc
[14:49:22] ringarin: has joined #ruby
[14:49:25] ljarvis: failing that, eenie meenie miney mo
[14:49:29] DaniG2k: yorickpeterse nah its not that drastic. its like asking whether to go left at a 45 degree angle or left at a 47 degree angle
[14:49:35] shevy: whether to turn left or right, now that is easier
[14:49:38] DaniG2k: ljarvis: yeah more like that I think
[14:49:45] shevy: I don't even know what is Solr or Elastic
[14:49:59] shevy: he could write a third project :)
[14:50:01] bougyman: search tools.
[14:50:05] ta: has joined #ruby
[14:50:07] DaniG2k: they are search engines that use Lucene as a base
[14:50:07] bougyman: elasticsearch
[14:50:08] shevy: https://xkcd.com/927/
[14:50:28] bougyman: ES is pretty nice.
[14:50:36] bougyman: I used solr before, too, it was less friendly to use.
[14:50:36] shevy: actually, that xkcd should also mention the problem of standards that are substandard quality
[14:51:08] platzhirsch: has joined #ruby
[14:51:20] DaniG2k: bougyman: problem with elastic is that the docs are terrible
[14:51:46] DefV: I think the ES docs are pretty exhaustive
[14:51:57] axl_: has joined #ruby
[14:51:59] DefV: I prefer those above the Solr ones
[14:52:10] bougyman: the ELK docs are quite complete
[14:53:32] DaniG2k: maybe I'm dumb :'(
[14:54:13] DaniG2k: but reading this doesn't help me understand how i can send updated objects to be indexed, nor how i can integrate the search itself
[14:54:16] DaniG2k: https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-rails
[14:54:34] bougyman: i'm not interested in reading anything -rails
[14:54:45] bougyman: I thought we were talking about ruby integration
[14:54:55] thelastinuit: has joined #ruby
[14:54:57] platzhirsch1: has joined #ruby
[14:55:05] DaniG2k: well, i was thinking of using it with rails
[14:55:08] bougyman: and that has nothing to do with the elasticsearch docs.
[14:55:16] bmalum: has joined #ruby
[14:55:25] DaniG2k: these are the Elasticsearch docs: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/_ruby_on_rails.html
[14:55:34] DaniG2k: non-existent
[14:56:01] bougyman: https://www.elastic.co/guide/en/elasticsearch/client/ruby-api/current/_the_ruby_client.html
[14:56:08] bougyman: that one shows you how to index, query, and search data
[14:56:08] vdamewood: has joined #ruby
[14:56:24] danzilio: has joined #ruby
[14:56:36] Xeago: has joined #ruby
[14:57:11] ogpastaling: has joined #ruby
[14:57:16] DaniG2k: maybe I should write my own full text search engine
[14:57:20] senayar: has joined #ruby
[14:57:21] senayar: has joined #ruby
[14:57:24] DaniG2k: https://imgs.xkcd.com/comics/standards.png
[14:58:08] yorickpeterse: oh hm, TIL anonymous classes aren't really so anonymous
[14:58:23] yorickpeterse: e.g. constants are apparently not local to the Class.new { ... } block
[14:58:41] yorickpeterse: >> Class.new { A = 10 }; Class.new { A = 5 }
[14:58:43] ruboto: yorickpeterse # => /tmp/execpad-ea4779f7ff29/source-ea4779f7ff29:2: warning: already initialized constant A ...check link for more (https://eval.in/383835)
[14:58:59] jhass: oh, interesting
[14:59:22] JakFrist: has joined #ruby
[14:59:28] phizzbuzz: has joined #ruby
[15:00:09] yorickpeterse: ....but using const_set works
[15:00:11] undeadaedra: because block does not changes constant scope
[15:00:19] endash: has joined #ruby
[15:00:27] yorickpeterse: undeadaedra: depends on how the block is evaluated
[15:00:30] startupality: has joined #ruby
[15:00:34] droidburgundy: has joined #ruby
[15:00:54] gambl0re: has joined #ruby
[15:01:07] yorickpeterse: oh hm interesting, seems it doesn't even do that when using instance_eval/instance_exec
[15:01:09] Xeago: has joined #ruby
[15:01:09] jhass: >> [Class.new {|c| c::A = 1 }::A; Class.new {|c| c::A = 2 }::A]
[15:01:10] ruboto: jhass # => /tmp/execpad-9a4a59e7b2c7/source-9a4a59e7b2c7:2: syntax error, unexpected ';', expecting ']' ...check link for more (https://eval.in/383840)
[15:01:12] starfox_sf: has joined #ruby
[15:01:17] jhass: >> [Class.new {|c| c::A = 1 }::A, Class.new {|c| c::A = 2 }::A]
[15:01:18] ruboto: jhass # => [1, 2] (https://eval.in/383841)
[15:01:20] bougyman: yorickpeterse: it puts the constant on Class
[15:01:22] paulcsmith: has joined #ruby
[15:01:30] bougyman: Class::A shows it, even.
[15:04:02] preyalone: has joined #ruby
[15:04:19] startupality: has joined #ruby
[15:05:02] jwilson_: has joined #ruby
[15:05:22] edwinvdgraaf: has joined #ruby
[15:06:34] ta: has joined #ruby
[15:06:56] [H]unt3r: has joined #ruby
[15:07:11] ljarvis: it puts the lotion on the class
[15:07:39] mikecmpb_: has joined #ruby
[15:09:32] haxrbyte: has joined #ruby
[15:09:43] LMity: has joined #ruby
[15:10:01] momomomomo: has joined #ruby
[15:12:18] Rollabunna: has joined #ruby
[15:13:49] yh: has joined #ruby
[15:16:19] lee-jon: has joined #ruby
[15:16:45] bhorn1: has joined #ruby
[15:17:47] bhorn1: Hey guys, I'm looking into creating guis with Ruby. Does anyone have any recommendations on what to use in terms of libraries to get started?
[15:17:52] snockerton: has joined #ruby
[15:18:55] ljarvis: bhorn1: what kind of gui?
[15:19:22] apeiros: .gsub(/(?!\A)^/, ' ') # indent all but the first line :D
[15:19:41] zudochkin: has joined #ruby
[15:19:51] bhorn1: A relatively simple user-friendly front end with different pages of buttons to perform various tasks from opening webpages to running scripts in the background.
[15:19:56] ahmetkapikiran: has joined #ruby
[15:19:57] ljarvis: Ruby isn't great at this stuff. Shoes is popular but it's more of a toy. I would probably lean on java tools via jruby (the latest version of shoes does this)
[15:20:06] Spami: has joined #ruby
[15:21:11] aryaching: has joined #ruby
[15:21:24] ljarvis: bhorn1: well, check out shoes. Otherwise I'd go swing/jwt
[15:22:17] bhorn1: ljarvis: I'm very familiar with java/swing, I've just been tasked recently with using ruby to do this instead. I generally agree with your opinion but am not well versed enough in Ruby to construct a very good argument for my case.
[15:22:29] bhorn1: ljarvis: Thank you for your input, though!
[15:22:36] jhass: ACTION still has to play with ruby-gir
[15:22:48] ljarvis: bhorn1: you could still do it in Ruby, just using swing :)
[15:22:55] phat4life: bhorn1: why not scala instead
[15:23:02] mandarinkin: has joined #ruby
[15:23:20] rbowlby: has joined #ruby
[15:23:21] ljarvis: but yeah bit pointless if you know java better..
[15:23:29] phat4life: still jvm though
[15:24:19] bhorn1: phat4life: I say why not java instead, personally. Like I said I've just been tasked by a higher up to attempt to use ruby instead.
[15:24:28] bhorn1: Thanks a ton for your input, though guys! Have a good day.
[15:24:41] phat4life: meh, use the right tool for the right job
[15:24:46] metalic: has joined #ruby
[15:24:59] phat4life: i can only imagine pain later on trying to do gui stuff with ruby
[15:25:01] ljarvis: or the right tool for the wrong job
[15:25:35] phat4life: my company was like that, once one team did everything in ruby, the whole company was like, lets rewrite EVERYTHING to ruby
[15:26:04] jhass: I think GUIs could be great with Ruby, if somebody sat down and wrote an API actually utilizing its powers (and with a result that doesn't look like a kids toy...)
[15:26:12] ljarvis: pretty much yep
[15:26:24] shock_one: yorickpeterse: ho-ho, I found a picture of a man sitting on a chair on a chair. https://hsto.org/files/4df/1f2/cf3/4df1f2cf33604c98bd5d21da8424da87.jpg
[15:26:32] bhorn1: Yeah, I see the potential it's just not something that's relevant at this point in time I feel.
[15:26:42] Marsupermammal: has joined #ruby
[15:26:54] phat4life: just use qt
[15:26:58] krowv: has joined #ruby
[15:27:16] ljarvis: just cut your foot off with an axe
[15:27:34] phat4life: what other gui libraries are there
[15:27:44] quazimodo: has joined #ruby
[15:27:44] undeadaedra: Qt's not so bad itself
[15:27:48] jhass: Gtk, WxWidgets, Tk (*cough*)
[15:27:50] shock_one: phat4life: HTML.
[15:28:12] kaleido: html5 ftw?
[15:28:13] phat4life: i guess desktop apps are less relavant
[15:28:18] jhass: the enlightment stuff
[15:28:31] jordanm: has joined #ruby
[15:28:50] phat4life: do it in flash heueueueu
[15:29:24] undeadaedra: mmh, too bad I don't have rslap anymore
[15:29:34] ItSANgo__: has joined #ruby
[15:29:53] Rubie: has joined #ruby
[15:30:20] michaeldeol: has joined #ruby
[15:30:20] Hanmac1: ACTION point at rwx for wxWidgets in ruby for phat4life
[15:30:27] chinmay_dd: has joined #ruby
[15:30:36] sharpmachine: has joined #ruby
[15:30:48] phat4life: interesting
[15:30:53] jhass: is it usable "already"?
[15:31:03] dr-richard: has joined #ruby
[15:32:44] Hanmac1: jhass: it does have specs and samples ... for the most stuff its "usable" ... but need to be build from source because the gem is not updated for long
[15:32:49] cumorris: has joined #ruby
[15:33:10] jpfuentes2: has joined #ruby
[15:33:35] jhass: release early, release often! ;P
[15:34:58] j4cknewt: has joined #ruby
[15:35:05] JoshL: has joined #ruby
[15:36:21] sandstrom: has joined #ruby
[15:37:17] yoongkang: has joined #ruby
[15:37:21] startupality: has joined #ruby
[15:38:10] freerobby: has joined #ruby
[15:38:52] rbennacer: has joined #ruby
[15:39:18] athos_diddy: has joined #ruby
[15:40:22] athos_diddy: good afternoon, can someone check my comments and just tell me if I clearly understand immutability and hash table corruption? https://gist.github.com/genericlady/4ac464c1f2b71d4984c2
[15:41:10] haxrbyte: has joined #ruby
[15:41:16] paulcsmith: has joined #ruby
[15:41:33] commondream: has joined #ruby
[15:42:15] athos_diddy: even simpler immutability means it's id won't change. it's static?
[15:42:42] jhass: athos_diddy: okay, from the start
[15:42:59] jhass: {foo: bar} is equivalent to {:foo => bar}
[15:43:11] jhass: it's using the symbol :foo as key
[15:43:27] jhass: that you defined a local variable named foo too doesn't matter with this syntax
[15:43:50] jhass: where it would matter is if you did {foo => bar}
[15:44:01] apeiros: athos_diddy: hash table corruption happens when the hash value of a key changes
[15:44:12] apeiros: athos_diddy: and the hash value of a key is a product of its value
[15:44:14] nikhgupta: has joined #ruby
[15:44:15] phat4life: aren't there certina cases where foo: bar becomes ambiguous
[15:44:35] mdih: has joined #ruby
[15:44:46] jhass: phat4life: perhaps your thinking about keyword arguments and accepting an options argument too?
[15:44:52] apeiros: athos_diddy: when a hash-table performs a lookup, it does so by calculating the hash value of the key, that number is used to find a "bucket"
[15:44:57] jhass: elsewhere I can't imagine
[15:45:12] apeiros: athos_diddy: with a different hash value, it'll find a different bucket - so the correct one can't be found anymore.
[15:45:16] starfox_sf: has joined #ruby
[15:45:54] apeiros: >> key = "hello"; hash = {key => "value"}; key.upcase!; hash["HELLO"]
[15:45:55] ruboto: apeiros # => nil (https://eval.in/383857)
[15:46:11] apeiros: and now after rehashing:
[15:46:16] apeiros: >> key = "hello"; hash = {key => "value"}; key.upcase!; hash.rehash; hash["HELLO"]
[15:46:17] ruboto: apeiros # => nil (https://eval.in/383858)
[15:46:26] apeiros: ACTION swears :D
[15:46:33] Senjai: Good morning ruby
[15:46:47] Senjai: apeiros: lolwhat
[15:46:51] apeiros: oh dear, right, string keys are special cased
[15:47:01] Senjai: apeiros: Isnt key copied?
[15:47:05] apeiros: of course, *the only* key which is special cased
[15:47:08] apeiros: Senjai: no
[15:47:22] apeiros: Senjai: except for - drumrolls - string keys. they are copied and frozen.
[15:47:33] Senjai: That's what I thought :P
[15:47:37] Senjai: It kinda makes sense, no?
[15:47:48] droidburgundy: has joined #ruby
[15:48:18] rcvalle: has joined #ruby
[15:48:30] Senjai: I would probably rather have it copy over than just be a reference. Specifically because it's -hard- in ruby to understand when things are actually passed by value vs by reference
[15:48:33] athos_diddy: apeiros thank you
[15:48:43] apeiros: athos_diddy: new example, using a non-special-cased key:
[15:48:49] apeiros: >> k = ["some", "array"]; h = {k => "value"}; h[k] # normal
[15:48:50] ruboto: apeiros # => "value" (https://eval.in/383859)
[15:48:54] athos_diddy: i just copied it and am saving it to my wiki i'm going to go over and i'll regist
[15:49:06] apeiros: >> k = ["some", "array"]; h = {k => "value"}; k << "change"; h[k] # won't work because k.hash changed
[15:49:07] ruboto: apeiros # => nil (https://eval.in/383860)
[15:49:18] BanzaiJoe: has joined #ruby
[15:49:25] apeiros: k = ["some", "array"]; h = {k => "value"}; k << "change"; h.rehash; h[k] # finds it again because the hash h updates all .hash values for all keys
[15:49:26] wookiehangover: has joined #ruby
[15:49:31] apeiros: >> k = ["some", "array"]; h = {k => "value"}; k << "change"; h.rehash; h[k] # finds it again because the hash h updates all .hash values for all keys
[15:49:32] ruboto: apeiros # => "value" (https://eval.in/383861)
[15:49:38] Senjai: apeiros: TIL.
[15:49:42] Senjai: Hope I never have to run into that
[15:49:51] nb_bez___: has joined #ruby
[15:49:55] apeiros: athos_diddy: anyway, in short: you should just not use objects as keys which you mutate
[15:49:58] Senjai: Generally shouldn't be mutating things
[15:50:01] apeiros: Hash#rehash is expensive
[15:50:36] dionysus69: has joined #ruby
[15:50:49] bmalum: has joined #ruby
[15:50:51] athos_diddy: apeiros would this be different in the case of fp
[15:51:02] apeiros: what's fp got to do with this?
[15:51:38] apeiros: also, don't use abbreviations without introducing them.
[15:51:41] athos_diddy: nothing i guess i'm just wondering if it has a similar caveat when using their version of hash tables which would be object literals?
[15:52:02] apeiros: ACTION assumes fp = functional programming
[15:53:04] endash: has joined #ruby
[15:53:05] apeiros: a hash table in fp doesn't work differently. I doubt the problem arises, though, since strict fp does not allow mutable objects. so you can't have mutable keys to begin with.
[15:53:21] dionysus69: has joined #ruby
[15:54:20] athos_diddy: funny i guess the work around in rails is to always rehash. possibly in one of the functions in ActionPack since this will interface with model and view
[15:54:35] apeiros: totally and utterly no
[15:54:44] apeiros: if you use Hash#rehash you almost certainly did something wrong.
[15:54:50] Senjai: athos_diddy: NOOO
[15:54:56] yh: has joined #ruby
[15:54:58] Senjai: athos_diddy: You can exist in life without ever using rehash
[15:55:02] Senjai: and still have
[15:55:09] towski_: has joined #ruby
[15:55:19] apeiros: I'm not even sure there are valid use-cases for rehash
[15:55:28] Senjai: apeiros: Beyond cus ruby?
[15:55:29] happyface: has joined #ruby
[15:55:37] apeiros: Senjai: ??que?
[15:55:42] Senjai: athos_diddy: What was this originally meant to solve?
[15:55:49] Senjai: apeiros: Just that in ruby, everything is mutable.
[15:55:57] apeiros: Senjai: so?
[15:56:07] apeiros: just because it *can* be mutated, doesn't mean *it will be*
[15:56:11] Senjai: apeiros: I'm not saying it should be there, I'm just saying thats probably why
[15:56:16] athos_diddy: i'm solidfying my understand of proper data structures in Ruby
[15:56:16] apeiros: also, not everything is mutable.
[15:56:35] undeadaedra: What's #rehash?
[15:56:38] apeiros: Senjai: I understand why it exists.
[15:56:40] michaeldeol: has joined #ruby
[15:56:44] athos_diddy: a practical example could be a counted collection of objects
[15:56:51] SHyx0rmZ: has joined #ruby
[15:56:54] apeiros: Senjai: what I say is that I don't think there's any case where it's correct to actually use it.
[15:57:08] Senjai: apeiros: Ok, that's fair.
[15:57:26] athos_diddy: the key should be immutable not a mutable object that is pointing to a number
[15:57:38] athos_diddy: i can gist an example
[15:57:41] apeiros: or put differently: I think if you use #rehash, I'm convinced there's a better solution without using #rehash :)
[15:57:54] Senjai: which is why I'm asking what problem you're trying to solve
[15:58:05] athos_diddy: Senjair it's an abstract lesson
[15:58:06] apeiros: undeadaedra: Hash#rehash
[15:58:16] jbisnett: has joined #ruby
[15:58:25] mandarinkin: has joined #ruby
[15:58:25] Senjai: athos_diddy: But .. no.
[15:58:28] apeiros: undeadaedra: "Rebuilds the hash based on the current hash values for each key." (straight from the docs ;-p)
[15:58:36] apeiros: athos_diddy: yes, gist
[15:58:44] undeadaedra: wuuuuuuuuuuuuuuuuuuuut
[15:58:56] ta: has joined #ruby
[15:59:09] athos_diddy: ok give me a second, thank you
[15:59:13] finisherr: has joined #ruby
[15:59:14] jbisnett: does anyone know how one would go about linking a custom memory allocation suite into ruby?
[16:00:13] apeiros: Kernel.trap("INT") do Thread.new do ??? end; end # <-- sooo sad that this is necessary???
[16:00:34] Senjai: apeiros: ? :( what
[16:00:45] apeiros: Senjai: can't use mutexes and other stuff in trap context
[16:00:52] drewvanstone: has joined #ruby
[16:00:58] ndrei: has joined #ruby
[16:01:14] Senjai: Orly. You're just full of the TIL's today :)
[16:01:24] drewo: has joined #ruby
[16:01:27] apeiros: s/today/everyday/
[16:01:29] apeiros: just listen!
[16:01:51] Senjai: Nah not errday. Some days you're totally lurker apeiros
[16:02:14] apeiros: you're just reading the wrong places at those days :-p
[16:02:47] undeadaedra: apeiros, the ruby god
[16:02:54] Senjai: I'm in every channel that matters! Am I not in a channel that matters?
[16:03:02] x44x45x41x4E: has joined #ruby
[16:03:06] wpp: has joined #ruby
[16:03:20] undeadaedra: you're not in #matter
[16:03:32] Senjai: undeadaedra: I think I'll pass on that one ;)
[16:03:56] apeiros: because, you know, marshall matters!
[16:03:57] Senjai: Registered : Oct 20 06:51:13 2005 (9y 34w 5d ago)
[16:04:01] Senjai: apeiros: You're old mang
[16:04:26] Senjai: I only got 4 years 17 weeks
[16:04:28] apeiros: I'm not old
[16:04:32] apeiros: I'm ancient
[16:04:50] dfockler: has joined #ruby
[16:04:56] undeadaedra: Time to use some carbon 14
[16:04:57] apeiros: I'm the source of all that is. don't they teach you kids philosophy anymore?
[16:05:16] DroidBur_: has joined #ruby
[16:05:20] apeiros: ok, granted, I'm only the male aspect, otherwise I'd be apeiron :)
[16:05:24] Senjai: ACTION trying to picture what apeiros would be like in '05
[16:05:38] danzilio: has joined #ruby
[16:05:56] zudochkin: has joined #ruby
[16:06:05] jhwhite: has joined #ruby
[16:06:24] Senjai: http://33.media.tumblr.com/6d861dba8aefeef4504b86269d32cb44/tumblr_mpj64d2YP71rvr23uo1_250.gif
[16:06:50] dzejrou: has joined #ruby
[16:08:04] apeiros: 00.000.000.005?
[16:08:18] sarkyniin: has joined #ruby
[16:08:20] dfockler: IRC thinks that's a weird IP address
[16:08:37] diegoviola: has joined #ruby
[16:08:37] apeiros: irc became sentient? when did that happen? :D
[16:08:47] dfockler: when it underlined that ip address
[16:09:02] apeiros: ok, athos_diddy's second is up. getting dinnger.
[16:09:29] athos_diddy: have a good dinner will u be back
[16:09:51] athos_diddy: ok! great! ty
[16:10:09] ta: has joined #ruby
[16:10:55] gregf: has joined #ruby
[16:11:15] tkuchiki: has joined #ruby
[16:11:20] diegoviola: has joined #ruby
[16:12:32] piet_: has joined #ruby
[16:12:41] startupality: has joined #ruby
[16:12:54] Senjai: dfockler: Doesnt underline it for me
[16:12:59] mleung: has joined #ruby
[16:13:12] jackjackdripper: has joined #ruby
[16:13:13] dfockler: I guess just my IRC client is sentient
[16:15:28] yqt: has joined #ruby
[16:16:51] veinofstars: has joined #ruby
[16:17:55] paulcsmith: has joined #ruby
[16:18:10] bgmarx: has joined #ruby
[16:18:45] jackjackdripper1: has joined #ruby
[16:19:14] Al3ks: has joined #ruby
[16:19:54] yh: has joined #ruby
[16:20:08] zenguy_pc: has joined #ruby
[16:20:51] The_Phoenix: has joined #ruby
[16:21:06] adamjleonard: has joined #ruby
[16:21:47] jbisnett: has anyone tried linking a different malloc to ruby?
[16:21:55] apoplexy: has joined #ruby
[16:22:44] undeadaedra: what do you mean?
[16:23:03] konieczkow: has joined #ruby
[16:23:04] undeadaedra: ruby has been linked to different malloc implementations as it works on different systems
[16:23:05] sharpmachine: has joined #ruby
[16:24:39] jbisnett: im trying to link doug lea's malloc in and its building but failing tests apparently randomly
[16:24:40] Xeago: has joined #ruby
[16:24:51] dagda1_: has joined #ruby
[16:26:02] DrShoggoth: has joined #ruby
[16:26:16] jbisnett: i also have a custom malloc im trying to link in but it seems like ruby is overwriting its headers
[16:26:42] gkra: has joined #ruby
[16:27:04] mrmargolis: has joined #ruby
[16:27:31] mleung: has joined #ruby
[16:27:35] jbisnett: i tried configuring with jemalloc but i cant figure out how that works
[16:28:02] shock_one: has joined #ruby
[16:28:13] simplyianm: has joined #ruby
[16:28:36] mallu: has joined #ruby
[16:29:54] mallu: I have a hash like this. https://dpaste.de/qeSH. Can you please tell me how to get dev password for janitor
[16:29:56] jas02: has left #ruby: ()
[16:31:39] apeiros: mallu: what have you tried?
[16:32:18] ZOMGITSABEAR: you guys know anyone that needs sysadmin work, web design, or help with a project?
[16:32:19] mallu: test['dev']['janiotor']['password']
[16:32:42] apeiros: mallu: apart from the typo, that looks correct
[16:32:55] ZOMGITSABEAR: sorry, wrong channel
[16:33:26] apeiros: mallu: is your paste a config file? or actual output from your hash?
[16:33:39] mallu: test['dev']['janitor']['password']
[16:33:39] mallu: NoMethodError: undefined method `[]' for nil:NilClass
[16:33:43] spider-mario: has joined #ruby
[16:34:46] michaeldeol: has joined #ruby
[16:35:35] apeiros: mallu: is your paste a config file? or actual output from your hash?
[16:35:49] mallu: aperios: it is an actual hash from a databag
[16:36:02] mallu: I should say from a json file
[16:36:04] mwlang: has joined #ruby
[16:36:15] apeiros: mallu: my nick is not aperios. use tab completion for nicks.
[16:36:32] apeiros: mallu: how did you generate that output?
[16:37:53] mwlang: I may need to find a SOAP channel to ask this, but hopefully there are other SOAP users lurking here: Doesn???t the SOAP protocol disallow two different variations of the same-named complex data type within the same namespace?
[16:38:22] Notte: has joined #ruby
[16:38:35] mister_solo: has joined #ruby
[16:38:47] tkuchiki: has joined #ruby
[16:38:57] wookiehangover: has joined #ruby
[16:39:22] Narzew: has joined #ruby
[16:40:50] cndiv: has joined #ruby
[16:40:57] mdw: has joined #ruby
[16:42:07] kb3ien: has joined #ruby
[16:42:44] hectortrope: has joined #ruby
[16:42:45] Spami: has joined #ruby
[16:43:12] kb3ien: I'm trying to make a ruby on rails app, running under Apache use a proxy for its outgoing connections. Setenv http_proxy http://127.1:8888 in the virtualhost file isn't doing the trick. Is there a better way?
[16:43:21] RobertBirnie: has joined #ruby
[16:43:45] dblessing: has joined #ruby
[16:44:14] guillaume-rb: has joined #ruby
[16:44:32] pwnz0r: has joined #ruby
[16:45:10] kb3ien: its using passenger
[16:46:12] mwlang: kb3ien: since it???s an outgoing connection, you???re presumably using Faraday, mechanize, HTTPClient, RestClient, or similar, right?
[16:47:19] Senjai: mwlang: Thank you for not wanting to party hard
[16:47:34] kb3ien: the call is generated thusly : req = Net::HTTP::Post.new(uri.request_uri)
[16:47:46] havenwood: ye ole Net::HTTP
[16:47:58] Senjai: Net::HTTP fo lyfe
[16:48:13] kb3ien: more like the death of me.
[16:48:24] mwlang: Senjai: :-)
[16:49:33] lessless: has joined #ruby
[16:49:52] xxneolithicxx: has joined #ruby
[16:50:14] mwlang: kb3ien: I???d suggest using a gem that abstracts the Net::HTTP stuff away. Faraday???s been my go-to choice of late and it???s easy to tell it how to proxy: http://www.intridea.com/blog/2012/3/12/faraday-one-http-client-to-rule-them-all provides a decent intro.
[16:50:19] diego3: has joined #ruby
[16:50:25] diego3: has joined #ruby
[16:50:30] kb3ien: Is there no environment variable that will be honoured ?
[16:50:32] Senjai: Faraday is great, but I would still suggest Net::HTPP
[16:50:35] Senjai: Net::HTTP*
[16:50:43] Senjai: Especially if you don't understand the things just yet
[16:51:02] kb3ien: Can it take a proxy argument. I want to edit as little of this code as I can, for future maintainers.
[16:51:30] havenwood: kb3ien: Are you exporting the http_proxy env?
[16:51:46] havenwood: "Net::HTTP will automatically create a proxy from the http_proxy environment variable if it is present."
[16:52:34] dfockler: https://gist.github.com/dfockler/9823cfeba71b8fcf7f7c Why doesn't the first syntax work with yield?
[16:52:39] mwlang: kb3ien: http://docs.ruby-lang.org/en/2.0.0/Net/HTTP.html#method-c-Proxy
[16:53:07] mwlang: dfockler: try output << yield(element)
[16:53:09] havenwood: http://docs.ruby-lang.org/en/2.2.0/Net/HTTP.html#class-Net::HTTP-label-Proxies
[16:53:28] glcx: has joined #ruby
[16:53:34] wookiehangover: has joined #ruby
[16:53:46] dfockler: mwlang: that's on there and it works, just wondering why the other way didn't
[16:54:08] havenwood: kb3ien: Check?: ENV['http_proxy']
[16:54:50] fabrice31: has joined #ruby
[16:55:26] kb3ien: I've been down that road, but will try again.
[16:55:28] mwlang: dfockler: I think operator precedence???without the parentheses, ruby wants to handle ???output << yield??? first, but then doesn???t know what to do with element next.
[16:55:48] ramfjord: has joined #ruby
[16:56:18] mwlang: dfockler: sorry for the quick fire answer???I actually didn???t read the whole gist. :-p
[16:56:32] Fooster: has joined #ruby
[16:56:47] dfockler: no it's cool, it's wasn't a real problem I was having anyways
[16:56:52] bootstrappm: has joined #ruby
[16:56:54] athos_diddy: i'm having problems trying to corrupt the hash table with my example https://gist.github.com/genericlady/de9e73a686efc775266f
[16:57:44] mister_solo: has joined #ruby
[16:57:54] athos_diddy: recently i was practicing data structures and have been building counted collections. so i'm reading what Yuki said about corruption and i'm wanting to understand what's the best way to build this counted collection
[16:58:15] sinkensabe: has joined #ruby
[16:58:59] athos_diddy: originally i just used structs as keys and it's easy to compare and update it's value. using an immutable object as a key i find it more difficult to build the counted collection
[16:59:09] athos_diddy: a word counter would be simpler to keep count of
[16:59:18] athos_diddy: but this is more complex
[17:00:11] Xeago: has joined #ruby
[17:01:25] jlast: has joined #ruby
[17:01:25] bmalum: has joined #ruby
[17:01:39] freerobby: has joined #ruby
[17:01:52] dfockler: athos_diddy: well you aren't actually putting the brick object into the backpack
[17:02:11] francois_: has joined #ruby
[17:02:14] revath: has joined #ruby
[17:02:22] postmodern: has joined #ruby
[17:02:48] pietr0: has joined #ruby
[17:04:28] chinmay_dd: has joined #ruby
[17:05:04] athos_diddy: i'm putting what it was containing which is a hash
[17:05:15] athos_diddy: an object is like a pointer to something, right
[17:05:30] ogpastal_: has joined #ruby
[17:06:07] claw: hey there
[17:06:27] jhass: athos_diddy: no, the object is the something, a variable is the pointer
[17:06:44] AndroidLoverInSF: has joined #ruby
[17:06:45] claw: i have a hash with 10 keys. how can i get a new hash with only 3 of them ? (nice ruby magic way)
[17:07:18] mister_s_: has joined #ruby
[17:07:27] dfockler: claw: depends on your criteria for the 3 key value pairs
[17:07:30] jhass: claw: activesupport by any chance?
[17:07:53] jhass: (are you inside Rails for example)
[17:08:04] claw: no jhass no activesupport
[17:08:32] jhass: >> {a: 1, b: 2, c: 3, e: 4}.select {|k, v| %i[a b c].include? k }
[17:08:33] ruboto: jhass # => {:a=>1, :b=>2, :c=>3} (https://eval.in/383879)
[17:08:35] Cust0sLim3n: has joined #ruby
[17:09:33] claw: i guess thats fine jhass thanks
[17:09:45] livathinos: has joined #ruby
[17:09:56] wallerdev: has joined #ruby
[17:10:48] dfockler: athos_diddy: in jafrog's example she is mutating the value that the reference in the hash is pointing to
[17:11:00] wookiehangover: has joined #ruby
[17:11:40] dfockler: so the hash of the reference has changed when you go to check for it again
[17:13:19] dfockler: it comes down to how ruby is calculating the hash value of the object you want to store in the hash
[17:13:32] dfockler: and whether that hash value can change
[17:14:06] rushed: has joined #ruby
[17:14:14] qwertme: has joined #ruby
[17:14:40] wallerdev: has joined #ruby
[17:14:46] symm-: has joined #ruby
[17:16:32] ndrei: has joined #ruby
[17:16:40] athos_diddy: jhass thank you for clarifying
[17:16:48] athos_diddy: dfockler thank you for the explanation
[17:18:32] kb3ien: seems that it does follow the bidding of the setenv, but it did not until after I did ` bundle exec rake` first. Not sure why.
[17:18:44] krisquigley: has joined #ruby
[17:19:01] jackjackdripper: has joined #ruby
[17:19:04] mwlang: boy, I???m glad I never think to use mutable objects as hash keys. :-)
[17:19:11] Spami: has joined #ruby
[17:19:28] _djbkd: has joined #ruby
[17:19:41] sharpmachine: has joined #ruby
[17:19:52] dfockler: hopefully it would never come up
[17:20:43] havenwood: kb3ien: well, that's odd - hrm
[17:21:54] kb3ien: The bigger issue, for now, is that I want to use an external cache for these requests, most of which are HTTPS are are therefore implemented as a CONNECT rather than a GET or POST.
[17:22:47] kb3ien: I'm assuming that there is no way simpler that to edit the https: and change it to http: ?
[17:23:09] danzilio: has joined #ruby
[17:23:11] kb3ien: again. simple code changes that anyone can maintain.
[17:23:45] dmolina: has joined #ruby
[17:23:48] sarmiena_: has joined #ruby
[17:23:52] chinmay_dd: has joined #ruby
[17:24:11] Fooster_: has joined #ruby
[17:24:24] sarmiena_: is there a standard way of doing a net::http post for multipart data without loading an entire attachment into memory?
[17:24:44] simplyianm: has joined #ruby
[17:24:51] sarmiena_: i???m transferring video data & don???t have gigs of ram on the machine to spare
[17:25:33] droidburgundy: has joined #ruby
[17:25:58] chridal: Any way to avoid the INSANELY annoying automatic string escaping in Ruby?
[17:26:05] Senjai: chridal: What
[17:26:13] chridal: Hang on. I'll gist it.
[17:26:21] nikhgupt: has joined #ruby
[17:26:21] nofxx: has joined #ruby
[17:26:46] Senjai: sarmiena_: I'm going to go with yes. I believe you can send chunks
[17:27:08] sarmiena_: Senjai: i found the documentation for reading in chunks, but haven???t found anything about sending in chunks :/
[17:27:23] Senjai: sarmiena_: or read in chunks, sorry. Is this a web form?
[17:27:29] mrmargol_: has joined #ruby
[17:27:35] chridal: Senjai: https://gist.github.com/christiandalsvaag/21d32f9bd9be17510144
[17:27:47] chridal: It's so damn annoying I am nearly exploding
[17:27:51] chridal: Long day at work, and now this shit.
[17:27:51] Senjai: chridal: lol, that's because of inspect man
[17:27:59] kb3ien: no its gone back to no proxy.
[17:28:03] chridal: Senjai: Say what?
[17:28:04] Senjai: chridal: Dude, chill. Pry automatically calls #inspect on everything
[17:28:05] sarmiena_: Senjai: no. i???m uploading videos from my raspberry pi to flickr account. some videos are about 1GB, but pi only has 1GB total
[17:28:14] chridal: Senjai: Still doesn't work in staging
[17:28:16] sarmiena_: so i can???t load the whole video into memory to send
[17:28:17] Senjai: chridal: In order to display a string to the screen, it escapes it
[17:28:18] aphprentice: has joined #ruby
[17:28:23] jhass: chridal: are you building JSON with string concatenations? ...
[17:28:24] Senjai: chridal: JSON iteself is a string
[17:28:37] chridal: jhass: I believe I have to? Have a look at the result I need
[17:28:41] Senjai: chridal: In order for JSON to be parsed, quotes have to be escaped
[17:28:51] chridal: notice that the inner "aps" needs to be wrapped in " "
[17:29:11] jhass: ah, give whoever designed that API a huge slap from me
[17:29:18] Senjai: chridal: padded_message = { "APS_SANBOX" => inner }.to_json
[17:29:25] denver: has joined #ruby
[17:29:26] kb3ien: wondering if its easier to use `ip` commands to reroute the traffic.
[17:29:29] jhass: anyway, you want {"APNS_SANDBOX" => inner.to_json }.to_json
[17:29:32] MatthewsFace: has joined #ruby
[17:29:35] edwinvdg_: has joined #ruby
[17:29:37] Senjai: jhass: Dont need inner.to_json
[17:29:44] chridal: that one is going to escape into escape hell though
[17:29:47] jhass: eh, well, removing the one above of course
[17:29:49] chridal: and lead to three x \\\
[17:30:04] kb3ien: needs more \.
[17:30:07] jhass: chridal: note that pry calls .inspect
[17:30:14] jhass: chridal: compare with puts
[17:30:17] Senjai: chridal: Is this an API that has to accept a string of json as a value, in a string of json?
[17:30:19] chridal: aha! So that's why that was happening.
[17:30:28] chridal: Senjai: Correct
[17:30:29] Senjai: chridal: I SAID that...
[17:30:36] chridal: Senjai: I noticed
[17:30:41] Senjai: jhass: People just listen to you more I suppose :P
[17:30:43] chridal: but this is causing three \\\
[17:30:47] sdothum: has joined #ruby
[17:30:52] chridal: That's the part I was confused about
[17:30:56] jhass: Senjai: nah, it's the repetition
[17:31:21] andikr: has joined #ruby
[17:31:29] Senjai: My favorite is when people define inspect methods on objects
[17:31:38] chridal: So { APNS_SANDBOX: inner }.to_json should produce the wanted output?
[17:31:41] mwlang: Senjai: nah, it???s not that???.jhass has the annoying habit of chiming in after you???ve done did said your piece and start reading instead of typing.
[17:31:45] jhass: chridal: yeah
[17:31:52] kb3ien: iptables. whatever.
[17:31:55] chridal: Will have a go! Thanks.
[17:32:04] chridal: any way to have pry not do .inspect?
[17:32:10] jhass: mwlang: heh
[17:32:23] jhass: chridal: use puts
[17:32:40] Lexun: has joined #ruby
[17:32:52] chridal: Thanks. Will try.
[17:32:59] Senjai: jhass: Pry still calls inspect on the string
[17:33:04] Senjai: chridal: No, this is how pry works
[17:33:06] Lexun: has left #ruby: ()
[17:33:15] jhass: Senjai: no, on the nil returned by puts
[17:33:20] jackjackdripper: has joined #ruby
[17:33:21] Senjai: chridal: If you want to see the raw format, write it out to a file
[17:33:22] RegulationD: has joined #ruby
[17:33:24] Senjai: jhass: Ah, right
[17:33:36] chridal: I guess the reason I am so pissed is I couldn't properly test this without pushing through CI to staging ...
[17:33:41] chridal: bad environment atm
[17:33:45] adamjleonard: has joined #ruby
[17:33:46] balazs: has joined #ruby
[17:33:55] chridal: because to_json
[17:33:57] Senjai: chridal: That's a you problem, not a String/JSON/Rails/ActiveSupport problem though :P
[17:34:11] Senjai: The odds of you finding a bug in to_json is extreeeeemeely rare.
[17:34:12] constantinexvi: has joined #ruby
[17:34:15] chridal: is in active_support and I couldn't require it
[17:34:25] tfitts: has joined #ruby
[17:34:35] chridal: shouldn't that be possible outside of rails btw? in a .rb file?
[17:34:38] Senjai: chridal: You can use Oj manually without active support
[17:34:44] Senjai: chridal: JSON.dump
[17:34:51] Senjai: I believe JSON is stdlib
[17:35:01] Senjai: http://ruby-doc.org/stdlib-2.0.0/libdoc/json/rdoc/JSON.html
[17:35:04] chridal: aha. So JSON.dump(insert_json_here) will produce the same?
[17:35:07] chridal: as to_json?
[17:35:19] jhass: uh, require "json" adds to_json methods, no?
[17:35:20] Senjai: http://ruby-doc.org/stdlib-2.0.0/libdoc/json/rdoc/JSON.html#method-i-dump
[17:35:25] tcrypt: has joined #ruby
[17:35:25] Senjai: JSON.dump(hash)
[17:35:29] jhass: >> require "json"; {a: 1}.to_json
[17:35:31] ruboto: jhass # => "{\"a\":1}" (https://eval.in/383924)
[17:35:55] tfitts: Given this array [["A1DTX7RSSYHHWC", 17], ["A2YPCK6GWDEH36", 18], ["A1X9E31IPCZV5I", 19]] is there a one-line way to turn it into a hash such that hash["A1X9E31IPCZV5I"] returns 19
[17:35:55] Senjai: chridal: If I had the choice, I'd use Oj though
[17:35:59] chridal: Hold my cyanide while I kick myself in the face.
[17:36:07] Senjai: ?gist tfitts
[17:36:07] ruboto: tfitts, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[17:36:09] jhass: tfitts: call .to_h on it
[17:36:32] tfitts: jhass: I knew I was missing something easy/obvious, thanks
[17:39:20] k3asd`_: has joined #ruby
[17:39:21] sarmiena_: So any insight on doing chunked multi part post via net::http to avoid loading the entire file from disk?
[17:39:26] DrShoggoth: has joined #ruby
[17:40:08] dopie: has joined #ruby
[17:41:20] Senjai: sarmiena_: You didnt answer my question
[17:41:21] commondream: has joined #ruby
[17:41:23] Senjai: sarmiena_: Is this a web form?
[17:41:36] sarmiena_: Senjai: you must have missed it :) i did. sec lemme scroll up
[17:41:49] sarmiena_: ???no. i???m uploading videos from my raspberry pi to flickr account. some videos are about 1GB, but pi only has 1GB total???
[17:42:18] mikecmpbll: has joined #ruby
[17:42:35] failshell: has joined #ruby
[17:43:25] sinkensabe: has joined #ruby
[17:43:36] jhass: sarmiena_: I googled and I'd guess the first result being https://github.com/nicksieger/multipart-post is not without reason...
[17:43:43] bgmarx: has joined #ruby
[17:44:10] sarmiena_: yeah i saw that. but it???s pretty old and based on old ruby version. so wondering if there???s a more standard way of doing this
[17:44:27] sarmiena_: ???before i plugin an old non-maintained gem
[17:44:31] segfalt: has joined #ruby
[17:46:18] sharpmachine: has joined #ruby
[17:46:28] psye: has joined #ruby
[17:47:00] chouhoul_: has joined #ruby
[17:47:01] dgutierrez1287: has joined #ruby
[17:47:20] lkba: has joined #ruby
[17:49:00] slackbotgz: has joined #ruby
[17:49:03] Senjai: sarmiena_: IIRC You use start
[17:49:07] Senjai: and you can take over how the request is sent
[17:49:09] Senjai: from there
[17:49:15] Senjai: You might need to do some source diving
[17:49:25] s2013: has joined #ruby
[17:49:50] lav: has joined #ruby
[17:50:52] jhass: http://stackoverflow.com/a/30087289/2199687 looks interesting, I wonder if it works for S3 too
[17:52:28] dopie: has joined #ruby
[17:52:59] Notte: has joined #ruby
[17:53:43] konieczkow: has joined #ruby
[17:56:15] jlast: has joined #ruby
[17:56:17] duderonomy: has joined #ruby
[17:56:39] jackjackdripper: has joined #ruby
[17:57:58] qwertme: has joined #ruby
[17:58:27] lav: is there any ffi tut. on ruby?
[17:58:40] jacaballero: has joined #ruby
[17:59:05] dfockler: lav: the github wiki on the ffi lib is decent, unless you are looking for something more specific
[18:00:02] Cust0sLim3n: has joined #ruby
[18:00:22] ramfjord: has joined #ruby
[18:00:40] sarmiena_: jhass: couple questions about that SO answer. how is the file being chunked? i see the line that says req.body = f.read, but how big is that chunk by default?
[18:00:42] Ruinside: has joined #ruby
[18:01:26] jhass: right, that's a bit weird
[18:01:32] nym: has joined #ruby
[18:01:33] nofxxx: has joined #ruby
[18:02:17] nofxx: has joined #ruby
[18:02:26] jhass: no idea, I don't think it's a fully working sample
[18:03:38] luckyme: has joined #ruby
[18:04:18] stylus: has joined #ruby
[18:05:08] jackjackdripper: has joined #ruby
[18:05:18] Ruinside: Hello Room:)
[18:05:27] sarmiena_: yeah i can follow the concept, but don???t see how the chunking is actually happening. is it per byte? per kilobyte? and also the fact that it appears to open up a new connection every time seems wasteful if you???re doing this thousands of times
[18:05:57] sarmiena_: not aiming these questions directly at you. just questions i have hehe
[18:06:04] Al3ks: has joined #ruby
[18:06:04] Ruinside: Anyone having trouble installing Rails on Mac os 10.10.3?
[18:06:36] wookiehangover: has joined #ruby
[18:06:41] sarmiena_: Ruinside: what error are you getting? and how are you trying to install it?
[18:07:27] nofxx: There;s this nice gem, stringex, for the #to_url method. Very useful but I'm going to call it 2, at most 3 times in all the project. And the gem only works as string ext, was going to suggest a more functional approach: Stringex.to_url("") instead of "".to_url. I mean why have that in all my strings? Am I beign too methodical/systematic?
[18:08:03] sandstrom: has joined #ruby
[18:08:17] DrShoggoth: has joined #ruby
[18:10:54] paulcsmith: has joined #ruby
[18:12:09] Lexun: has joined #ruby
[18:13:40] swgillespie: has joined #ruby
[18:14:47] pietr0: has joined #ruby
[18:15:21] ericmeds: what is recommended for measuring code documentation?
[18:15:29] sdwrage: has joined #ruby
[18:15:32] jackjackdripper: has joined #ruby
[18:15:45] michael_mbp: has joined #ruby
[18:15:50] lkba_: has joined #ruby
[18:16:15] Casty: has joined #ruby
[18:16:24] sarmiena_: this looks promising: https://gist.github.com/sasimpson/1112739
[18:16:26] hahuang65: has joined #ruby
[18:16:47] hahuang65: has joined #ruby
[18:17:09] Senjai: ericmeds: Yard, yeah
[18:17:15] adamjleonard: has joined #ruby
[18:18:09] jackjackdripper1: has joined #ruby
[18:19:09] uptownhr: has joined #ruby
[18:20:02] x1337807x: has joined #ruby
[18:22:07] davedev24: has joined #ruby
[18:22:53] Nowaker: has joined #ruby
[18:24:03] whippythellama: has joined #ruby
[18:24:09] SebastianThorn: ruby is great, meet a guy today that thought my code was psudo-code :)
[18:26:10] nofxx: SebastianThorn, that's the idea. Also a sign it's good code =D
[18:26:11] InternetFriend: has joined #ruby
[18:26:37] jbisnett: does anyone one know how to link jemalloc with ruby
[18:27:02] vdamewood: has joined #ruby
[18:27:35] andywojo: has joined #ruby
[18:27:38] wookiehangover: has joined #ruby
[18:28:23] SebastianThorn: nofxx: nofx fan? (the band)
[18:29:50] jackjackdripper: has joined #ruby
[18:30:25] Xeago: has joined #ruby
[18:30:27] commondream: has joined #ruby
[18:32:13] j4cknewt: has joined #ruby
[18:33:25] Agoldfish: has joined #ruby
[18:34:54] arescorpio: has joined #ruby
[18:35:20] nofxx: SebastianThorn, yeah, sex, drugs & punk rock teenages. Nowdays code is included in drugs =P
[18:35:30] chouhoulis: has joined #ruby
[18:36:18] SebastianThorn: nofxx: im gonna see them next friday, but it seems as my merch has been lost in the mail :(
[18:37:24] tennis_: has joined #ruby
[18:38:48] miah: jealous. would <3 to see nofx
[18:40:13] miah: ericmeds: rdoc can; rdoc -C1
[18:40:41] jpfuentes2: has joined #ruby
[18:41:03] miah: rdoc will show you all the code that needs docs, as well as a summary
[18:42:41] nonparfumee: has joined #ruby
[18:43:44] adamjleonard: has joined #ruby
[18:44:03] fabrice31: has joined #ruby
[18:44:26] lkba: has joined #ruby
[18:44:49] Xiti: has joined #ruby
[18:45:55] bgmarx: has joined #ruby
[18:46:25] dagda1: has joined #ruby
[18:46:44] Xiti: has joined #ruby
[18:47:47] bronson: has joined #ruby
[18:48:45] mdw: has joined #ruby
[18:49:12] podman: has joined #ruby
[18:50:45] Stany: has joined #ruby
[18:51:01] Frem: has joined #ruby
[18:51:51] MasterPiece: has joined #ruby
[18:52:24] havenwood: has joined #ruby
[18:52:48] jackjackdripper: has joined #ruby
[18:53:09] shadoi: has joined #ruby
[18:53:46] revath: has joined #ruby
[18:53:53] kirun: has joined #ruby
[18:54:50] francoi__: has joined #ruby
[18:55:53] simplyianm: has joined #ruby
[18:56:01] _blizzy_: has joined #ruby
[18:57:22] jackjackdripper1: has joined #ruby
[18:58:36] jhwhite: has joined #ruby
[18:59:23] pragmatism: has joined #ruby
[19:00:38] krisquigley: has joined #ruby
[19:00:40] jphenow: has joined #ruby
[19:00:50] mikecmpbll: has joined #ruby
[19:01:15] s2013: has joined #ruby
[19:01:55] codecop_: has joined #ruby
[19:02:14] simplyianm: has joined #ruby
[19:02:32] lkba_: has joined #ruby
[19:02:38] lkba_: has joined #ruby
[19:03:37] crdpink: has joined #ruby
[19:04:16] last_staff: has joined #ruby
[19:04:58] TheHodge: has joined #ruby
[19:07:23] vikaton: has joined #ruby
[19:08:47] revath: has joined #ruby
[19:08:56] commondream: has joined #ruby
[19:10:15] kahuna_: has joined #ruby
[19:10:46] micmus: has joined #ruby
[19:11:37] perrier: has joined #ruby
[19:13:13] wookiehangover: has joined #ruby
[19:13:24] Casty: has joined #ruby
[19:13:48] iamninja: has joined #ruby
[19:17:11] shadoi: has joined #ruby
[19:18:52] y0da: has joined #ruby
[19:20:30] ramfjord: has joined #ruby
[19:20:37] Xeago: has joined #ruby
[19:21:24] bgmarx: has joined #ruby
[19:24:14] diegoviola: has joined #ruby
[19:24:35] Axilla: has joined #ruby
[19:24:41] perrier: has joined #ruby
[19:25:09] davedev24_: has joined #ruby
[19:28:00] freerobby: has joined #ruby
[19:29:34] centrx: has joined #ruby
[19:35:34] simplyianm: has joined #ruby
[19:36:14] finisherr: has joined #ruby
[19:37:03] lkba: has joined #ruby
[19:37:22] ndhamecom: has joined #ruby
[19:37:58] Yiota: has joined #ruby
[19:39:53] InternetFriend: has joined #ruby
[19:40:04] rbowlby: has joined #ruby
[19:41:01] GitGud: has joined #ruby
[19:41:16] wookiehangover: has joined #ruby
[19:41:58] mistergibson: has joined #ruby
[19:42:01] mengu: has joined #ruby
[19:42:58] uptownhr: has joined #ruby
[19:44:37] davedev24_: has joined #ruby
[19:44:58] [H]unt3r: has joined #ruby
[19:45:07] symm-: has joined #ruby
[19:46:45] DLSteve: has joined #ruby
[19:47:24] k3asd`: has joined #ruby
[19:48:09] kahuna_: has joined #ruby
[19:48:51] skade: has joined #ruby
[19:49:06] j_mcnally: has joined #ruby
[19:50:47] simplyianm: has joined #ruby
[19:50:58] axl_: has left #ruby: ()
[19:53:03] workmad3: has joined #ruby
[19:54:25] Mojo_Nixon: has joined #ruby
[19:54:31] konieczkow: has joined #ruby
[19:55:10] roger_rabbit: has joined #ruby
[19:56:41] jmignault: has joined #ruby
[19:57:18] jpfuentes2: has joined #ruby
[20:00:17] bmalum: has joined #ruby
[20:00:28] skade: has joined #ruby
[20:00:31] jbisnett: does anyone know what my cause an "uninitialized constant TOPLEVEL_BINDING" error. I'm currently trying to link a memory allocator to ruby and I am getting that error when linking miniruby
[20:00:54] danzilio: has joined #ruby
[20:01:15] simplyianm: has joined #ruby
[20:02:17] PaulCapestany: has joined #ruby
[20:02:48] sandelius: has joined #ruby
[20:03:01] danzilio: has joined #ruby
[20:03:42] fgo: has joined #ruby
[20:04:24] momomomomo: has joined #ruby
[20:05:06] jphenow: has joined #ruby
[20:05:18] _djbkd: has joined #ruby
[20:05:34] yorickpeterse: https://github.com/opal/opal/issues/941 well
[20:06:15] Morrolan: has joined #ruby
[20:07:14] jackjackdripper: has joined #ruby
[20:07:15] __butch__: has joined #ruby
[20:07:56] finisherr: has joined #ruby
[20:08:48] wookiehangover: has joined #ruby
[20:09:05] freerobby: has joined #ruby
[20:09:43] jhass: ?ot yorickpeterse
[20:09:44] ruboto: yorickpeterse, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[20:09:50] momomomomo_: has joined #ruby
[20:09:53] edwinvdgraaf: has joined #ruby
[20:10:03] jhass: yorickpeterse: and this time I mean, it's not the place and it will not go anywhere to discuss it
[20:10:23] swgillespie: has joined #ruby
[20:10:25] jhass: anybody that responds to this topic in this channel will be removed until 8am CET
[20:10:57] Xeago: has joined #ruby
[20:10:59] edwinvdgraaf: has joined #ruby
[20:11:31] yorickpeterse: this channel turned sour pretty quickly
[20:11:54] jhass: it's prone to shitstorm, sorry but being hard is the only way
[20:11:56] jpfuentes2: has joined #ruby
[20:12:07] yorickpeterse: ehm no, with all due respect this is called censorship
[20:12:11] apeiros: yorickpeterse: jhass wants to avoid that #ruby catches on the shitstorm. and he offers an alternative venue.
[20:12:12] jhass: if you want to discuss join #ruby-offtopic, last word
[20:12:46] skade: has joined #ruby
[20:13:32] paulcsmith_: has joined #ruby
[20:14:27] ramfjord: has joined #ruby
[20:14:42] zudochkin: has joined #ruby
[20:16:21] sinkensabe: has joined #ruby
[20:16:42] freerobby: has joined #ruby
[20:17:19] rbennacer: has joined #ruby
[20:17:41] ndrei: has joined #ruby
[20:18:17] athos_diddy: apeiros did you ever respond this irc client only goes back 300 lines
[20:18:24] peter_paule: has joined #ruby
[20:18:33] athos_diddy: turned off join\leave
[20:18:56] ruboto: I don't know anything about logs
[20:18:57] apeiros: athos_diddy: my last status was that you wanted to gist something - did I miss that?
[20:19:10] yorickpeterse: there's irclog.whitequark.org
[20:19:19] yorickpeterse: which is logging this channel
[20:19:21] athos_diddy: yeah i was getting one together
[20:19:40] athos_diddy: someone responded but i had to run out and could use a little more clarity
[20:19:45] jhass: !fact mk logs You can find a log of this channel at http://irclog.whitequark.org/ruby/
[20:19:46] ruboto: jhass, I will remember that logs is You can find a log of this channel at http://irclog.whitequark.org/ruby/
[20:20:23] athos_diddy: https://gist.github.com/genericlady/de9e73a686efc775266f
[20:20:33] terlar: has joined #ruby
[20:20:47] pragmatism: has joined #ruby
[20:20:55] yorickpeterse: athos_diddy: oh hey, you're coding again?
[20:21:11] apeiros: athos_diddy: remind me - we were discussing Hash and #rehash, right?
[20:21:25] apeiros: phew, brain isn't dead yet :D
[20:21:29] athos_diddy: i can repost the chat in a gist i saved where we left off
[20:22:07] apeiros: backpack.hash_key? # <- that should be .has_key?, right?
[20:22:27] InternetFriend: has joined #ruby
[20:23:02] athos_diddy: ah yes my point is that sure a word counter is easy you can turn a string to a key and point to an integer, voila counted collection of words
[20:23:18] athos_diddy: but if it's something more complex that's mutable what should we do
[20:24:07] Iskarlar: has joined #ruby
[20:24:28] momomomomo: has joined #ruby
[20:25:02] weaksauce: has joined #ruby
[20:25:16] apeiros: athos_diddy: if it's mutable, the question is what do you want the key to be
[20:25:21] apeiros: the current state? or the object itself
[20:25:31] bhorn1: Why, when attempting to use the RGBA values to change the color of the background of a gui, does it not return the proper color?
[20:25:51] bhorn1: Nevermind fixed.
[20:26:14] apeiros: i.e., `key = [1,2,3]; {key => "one two three"}; key << 4` - do you want key still to refer to "one two three"? or should that now be key to another value?
[20:27:12] athos_diddy: yes i want it to still point to [1,2,3] in this case
[20:27:45] athos_diddy: well i don't know if i want to or not i suppose both have different answers
[20:27:57] eggoez: has joined #ruby
[20:28:04] Senjai: athos_diddy: Again, whats the problem you're trying to solve
[20:28:31] apeiros: athos_diddy: but it never pointed to [1,2,3], it pointed to "one two three"
[20:28:36] dfockler: I was testing Struct and it has the same hash regardless of the value of the fields in the object
[20:28:37] Senjai: found the gist
[20:28:38] ldnunes: has joined #ruby
[20:29:07] Ponyo: Hi there, I'm playing with classes and instances in Ruby as a training lesson in Classes and class inheritance. https://gist.github.com/FuzzySunshine/e9f2bf673c91a0398306 I'm wondering if there is an easy way in the class Spades to call Deck's initialize when it's initialize but with players 4 instead of players 2?
[20:29:07] konieczkow: has joined #ruby
[20:29:18] apeiros: dfockler: um, then something went wrong
[20:29:28] apeiros: dfockler: struct's hash depends on class & values
[20:29:42] ndrei: has joined #ruby
[20:29:54] dfockler: well I was changing an Object generated from a struct
[20:30:04] GBrawl: has joined #ruby
[20:30:15] dfockler: so not exactly the Struct itself
[20:30:18] apeiros: yes, that should change its hash
[20:30:53] apeiros: >> S = Struct.new(:a, :b); x = S.new(1, 2); h1 = x.hash; x.a = 20; h2 = x.hash; [h1, h2]
[20:30:54] ruboto: apeiros # => [91319188, 1012531762] (https://eval.in/383980)
[20:31:03] apeiros: dfockler: different hashes. same object.
[20:31:52] athos_diddy: what a brilliant way to use an irc bot
[20:31:57] athos_diddy: that was cool
[20:32:25] jhass: Ponyo: sure, just call super inside Spades initialize, it's a normal method after all
[20:32:43] athos_diddy: so the actual hash is never pointing to the value
[20:32:44] Ponyo: oh ok, that's where super comes into this, thanks!
[20:32:50] fabrice31: has joined #ruby
[20:32:51] athos_diddy: it's the variable holding the hash
[20:32:52] apeiros: dfockler: I'm curious - want to gist your code? maybe we can figure why the hash didn't change for you?
[20:32:52] yfeldblum: has joined #ruby
[20:32:56] athos_diddy: which you can use for comparisons
[20:32:58] mdw: has joined #ruby
[20:33:06] athos_diddy: and that should be fine and not lead to corruption
[20:33:19] apeiros: athos_diddy: since ruby (sadly) calls the class Hash - do you mean the key's .hash value?
[20:33:51] startupality: has joined #ruby
[20:33:52] athos_diddy: it's the variable holding the Struct
[20:34:28] dfockler: ahhh apeiros you're right, error on my part
[20:34:49] qwertme: has joined #ruby
[20:36:41] chussenot: has joined #ruby
[20:36:41] maknz: has joined #ruby
[20:36:45] apeiros: athos_diddy: heh, now I'm confused. let me read your gist (mind you, I'm slightly tired with a bit of a headache, but I hope I can still give you the information you need to figure out how all works together)
[20:37:02] commondream: has joined #ruby
[20:39:02] slash_nick: has joined #ruby
[20:39:08] slash_nick: has joined #ruby
[20:39:20] inspiron: has joined #ruby
[20:39:21] valeriansaliou: has joined #ruby
[20:39:57] apeiros: athos_diddy: I see a few misconceptions. let me think how to best unravel them.
[20:40:10] Ponyo: I'm confused about class inheritance and instance variables, https://gist.github.com/FuzzySunshine/63719c97463dd37d6ae0 shouldn't an instance variable defined by the super be accessible by what called it? I'm getting undefined local variable when I try to inherit the class and run it's functions locally. Error code at the bottom. Thanks
[20:40:12] athos_diddy: apeiros line 17 should that never be done? brick is a variable (pointing or holding) a struct. In the example it is being used a key pointing to a hash
[20:40:12] inspiron: i did a: sudo gem uninstall the_gem and it ran. when i type: the_gem at the console it says /usr/bin/the_gem: No such file or directory... How does it sill now about it? how can I completely remove all traces of it
[20:40:39] athos_diddy: thank you yes i know i'm missing something
[20:40:49] apeiros: athos_diddy: it's viable and makes sense. what you should not do is change any attribute of brick later in the code.
[20:40:52] kb3ien: has joined #ruby
[20:41:12] athos_diddy: because that would be bad right?
[20:41:28] athos_diddy: it lead to corruption
[20:41:35] apeiros: athos_diddy: if we had the time, the best would probably be to implement a tiny hash class ourselves. that'd explain everything. but not sure I'll stay awake long enough.
[20:41:38] athos_diddy: so it's this case i was wondering if we should rehash
[20:42:04] athos_diddy: tomorrow when you wake up i can just show you the project on my github
[20:42:12] apeiros: well, lets do it anyway
[20:42:37] athos_diddy: https://github.com/genericlady/xrogue
[20:42:58] athos_diddy: i'm just working on understanding the caveats of the language and best practice for data collections
[20:43:01] apeiros: thought it'd go in that direction from the structs' contents ;-)
[20:43:06] athos_diddy: how to build an interface for it and why I am doing so
[20:43:17] apeiros: ah, that's not language related. hash tables work like that in every language :)
[20:43:29] athos_diddy: yes i'm trying to understand that
[20:43:43] athos_diddy: i'm learning the baseline of programming
[20:43:58] apeiros: you understand arrays?
[20:44:01] jhass: Ponyo: take a look at the line mentioned in the error, line 19
[20:44:15] jhass: Ponyo: hands is twice there, but it's not the same in both
[20:44:28] apeiros: you also understand arrays of arrays?
[20:44:31] Senjai: I wouldn't get to caught up on this stuff athos_diddy. If you're just learning its probably best to not worry about the low level deets. Unless you want to become an apeiros
[20:44:42] athos_diddy: can we call them 2d arrays
[20:44:44] athos_diddy: is that appropriate
[20:44:44] Senjai: It's usually better to just make things in the beginning :P
[20:44:46] yorickpeterse: ooooooh, apeiros got served
[20:44:53] railsraider: has joined #ruby
[20:44:56] Senjai: yorickpeterse: apeiros knows way too much
[20:45:04] pwnz0r: has joined #ruby
[20:45:08] akkad: has joined #ruby
[20:45:09] athos_diddy: it's best to know all
[20:45:11] francoi__: has joined #ruby
[20:45:26] Senjai: athos_diddy: Not when you're first starting out it isnt
[20:45:26] apeiros: athos_diddy: not really. 2d arrays are often considered to be "rectangles", i.e. all arrays have the same size. that's not necessarily the case with arrays of arrays.
[20:45:34] athos_diddy: i'm not first starting out
[20:45:39] athos_diddy: this is what i'm up to
[20:45:55] Senjai: You said your learning the basics of programming
[20:46:16] Senjai: Oh, so you already know how to program then?
[20:46:18] athos_diddy: being a language po9lygot
[20:46:24] mhb: has joined #ruby
[20:46:25] athos_diddy: i know ruby and js
[20:46:28] yorickpeterse: wait, there's the perfect article for this
[20:46:36] yorickpeterse: http://zedshaw.com/2015/06/16/early-vs-beginning-coders/
[20:46:41] athos_diddy: i learned ruby the first year, then went into JS.. now back to ruby
[20:46:53] athos_diddy: i've been diving pretty deep past few months
[20:47:00] TvL2386: has joined #ruby
[20:47:40] x1337807x: has joined #ruby
[20:48:10] tomphp: has joined #ruby
[20:48:16] athos_diddy: i'd call myself intermediate
[20:48:24] allomov: has joined #ruby
[20:48:33] x1337807x: has joined #ruby
[20:48:35] Ponyo: jhass: oh you are very right, thank you for that
[20:49:06] Ponyo: Thanks that works well
[20:49:25] x1337807x: has joined #ruby
[20:49:35] krisquigley: has joined #ruby
[20:50:16] wildroman2: has joined #ruby
[20:51:05] apeiros: damn ruby's #hash being randomly seeded
[20:51:09] Papierkorb: has joined #ruby
[20:51:27] crdpink2: has joined #ruby
[20:52:20] yorickpeterse: hrmpf: the bane of talk proposals: "is this too nerdy y/n"
[20:52:42] Senjai: yorickpeterse: What?
[20:52:45] BanzaiJoe: always no, dive, dive, dive!
[20:53:11] yorickpeterse: Senjai: trying to write down a talk proposal for Arrrrcamp, unsure if it's too hardcore or not
[20:53:25] Senjai: yorickpeterse: What's your topic?
[20:53:55] athos_diddy: yorickpeterse good article
[20:54:23] yorickpeterse: Senjai: I want to focus on parsing/performance in the context of Oga and such, since that's what I've been doing mostly in the past year or so
[20:54:29] BanzaiJoe: yorickpeterse isn't Arrrrcamp more hardcore to start with?
[20:54:32] yorickpeterse: Not specifically Oga, but it would involve some bits related to it
[20:54:38] yorickpeterse: BanzaiJoe: No idea, never went there
[20:54:45] crdpink2: has joined #ruby
[20:55:01] workmad3: has joined #ruby
[20:55:27] Senjai: yorickpeterse: I dont think parsing would be too bad.
[20:56:19] apeiros: athos_diddy: work in progress: https://gist.github.com/apeiros/13bc322e93707a41f653
[20:56:36] railsraider: has joined #ruby
[20:56:55] athos_diddy: age_of_people is considered a hash table?
[20:57:02] yorickpeterse: if only I could get my shit on Rbx before then I could do a pretty interesting talk on that
[20:57:10] yorickpeterse: since that has so far been at least 2 years of work
[20:57:17] yorickpeterse: if it wasn't for fkn openssl
[20:57:24] yorickpeterse: You fix one Gem and another 5 broken ones pop up
[20:57:41] apeiros: athos_diddy: yes, a crude emulation of a hash table
[20:58:17] yorickpeterse: https://github.com/aws/aws-sdk-ruby/issues/455#issuecomment-102407069 (??????????)?????? ?????????
[20:58:17] rbowlby: has joined #ruby
[20:58:55] undeadaedra: respect tables
[20:59:04] yorickpeterse: Hm, I should probably dig into this again tomorrow
[20:59:11] crdpink: has joined #ruby
[20:59:46] ledestin: has joined #ruby
[20:59:55] simplyianm: has joined #ruby
[20:59:59] rbowlby_: has joined #ruby
[21:00:09] mrmargolis: has joined #ruby
[21:00:50] failshell: has joined #ruby
[21:01:28] athos_diddy: i didn't even know find could use a block
[21:01:58] athos_diddy: this is like what i was doing
[21:01:59] j_mcnally: has joined #ruby
[21:02:12] Ox0dea: athos_diddy: Every method takes an implicit block, and most of the ones that could make use of it do so.
[21:02:17] ascarter: has joined #ruby
[21:02:26] athos_diddy: ok good to remember
[21:03:00] apeiros: athos_diddy: if there's something in the example you can't follow, you tell me
[21:03:26] apeiros: athos_diddy: updated https://gist.github.com/apeiros/13bc322e93707a41f653
[21:04:35] pragmatism: has joined #ruby
[21:04:51] athos_diddy: but what if john was a struct.. in this case it's just a string
[21:04:51] DukeDave: Does the '+' appended to this filename have some special meaning? https://github.com/sstephenson/sprockets/blob/1566cd10486b677d52d93c74f489ad7a8d2acd79/lib/sprockets/asset.rb#L146
[21:05:15] athos_diddy: so should we not do that?
[21:05:15] DukeDave: ACTION thought such modifiers were supposed to go on the mode string, not the filename
[21:05:25] apeiros: athos_diddy: it works the same. a hash value is calculated from the struct's value.
[21:05:37] athos_diddy: so the question is
[21:05:41] athos_diddy: should we never do that?
[21:05:50] rjno: has joined #ruby
[21:05:54] athos_diddy: because Yuki talked about data corruption
[21:06:01] DukeDave: Ah, I see, it moves the file after, nvm
[21:06:02] apeiros: we can do that, it's ok and there's plenty of cases where that's making a lot of sense
[21:06:02] athos_diddy: because that is in fact a mutable object
[21:06:16] apeiros: you can make it immutable by using .freeze e.g.
[21:06:40] apeiros: what you should not do is change any value in the struct
[21:06:55] apeiros: because from what you can see from the emulation - if you change the value, the hash changes too
[21:07:12] apeiros: but the associated value is already stored in a bucket, using the old hash value
[21:07:15] athos_diddy: i know i'll end up using this in real world cases possibly with rails
[21:07:16] kerrizor: has joined #ruby
[21:07:21] rbowlby: has joined #ruby
[21:07:26] apeiros: so it can never be found with the new hash value. it'll look in the wrong bucket
[21:07:41] bgmarx: has joined #ruby
[21:07:58] athos_diddy: so if just write a function with logic comparing equality we are fine
[21:08:09] athos_diddy: since it's flexible with changes
[21:08:15] apeiros: what rehash does is remove all key/value pairs from all buckets, and then put them back into the correct bucket according to their current .hash value
[21:08:16] jackjackdripper: has joined #ruby
[21:08:20] athos_diddy: this could be considered polymorphism?
[21:08:31] athos_diddy: if we start talking about subtype poly?
[21:08:57] athos_diddy: rehash will update all the keys of the collection
[21:09:08] athos_diddy: this can be considered garbage collection
[21:09:10] apeiros: re rehash: yes. which is why it is expensive
[21:09:16] apeiros: no, nothing is collected
[21:09:24] athos_diddy: expensive meaning less profit.. system overhead
[21:09:24] nickfausnight: has joined #ruby
[21:09:33] athos_diddy: principals of programming
[21:09:34] commondream: has joined #ruby
[21:09:56] fgo: has joined #ruby
[21:10:26] yorickpeterse: Senjai: so re parsers, what would you be interested in learning about them?
[21:10:36] yorickpeterse: other than "how they work" because that's too abstract
[21:10:53] undeadaedra: AbstractParser
[21:11:12] Senjai: yorickpeterse: Generally that is what you'd want to know. There's a large number of concepts that come into play with parsing.
[21:11:18] lostcuaz_km: has joined #ruby
[21:11:21] phizzbuzz: has joined #ruby
[21:11:23] athos_diddy: apeiros merci! that was awesome
[21:11:28] apeiros: athos_diddy: expensive as in overhead, lots of CPU cycles
[21:11:40] athos_diddy: ok cpu cycles got it
[21:11:42] Senjai: Going through how a parser would be able to find a value in a dom tree, even a simple one would be worth knowing
[21:12:03] Senjai: I bet there's also lots to learn specifically about recursion, and lookup optimization as well
[21:12:17] Senjai: Speaking from someone who knows very little aobut parsing
[21:12:38] athos_diddy: wow so i wonder how it would look if the key was an immutable string pointing to a hash containing the struct and another hash
[21:12:42] yorickpeterse: Yeah, though that I can't all fit in ~30 minutes
[21:12:49] yorickpeterse: though I intend to spread that out over some articles
[21:12:52] ramfjord: has joined #ruby
[21:12:55] yorickpeterse: once I get to it...next year or something :P
[21:13:01] sgambino: has joined #ruby
[21:13:19] yorickpeterse: I really hope cloning picks up in the coming decade, having a few clones of myself wouldn't be a bad idea
[21:13:19] athos_diddy: i think i may avoid that rabbit hole and practice rails for a possible interview... and learn more about polymorphism. thank you everyone for the help today
[21:13:20] apeiros: athos_diddy: you're welcome. I hope it helped your understanding
[21:13:37] athos_diddy: it helped greatly and i saved the discussion earlier and i'm about to save this gist example too!
[21:14:06] Senjai: yorickpeterse: You should be able to keep it at a high leve right? possibly?
[21:14:09] tomphp: has joined #ruby
[21:14:17] yorickpeterse: oh sure, but that means I can't go into too many details
[21:14:41] yorickpeterse: which is part of the art of writing a good talk, but at the same time stupid difficult
[21:14:42] Senjai: How you store data once parsed and how lookups are done on that data is pretty interesting. Specifically if there's a lot of ways to do it wrong
[21:15:04] yorickpeterse: actually the storing of results is the boring part :P
[21:15:13] Senjai: yorickpeterse: The best thing I could learn from parsing, is the ability to write more configuration files in different ways for my programs and not be terrible at interpreting them
[21:16:04] Senjai: though I'd probably just use the standard formats, unless it was for like a game, or something more involved
[21:16:09] ascarter_: has joined #ruby
[21:16:09] Senjai: like toml or something
[21:16:26] dagda1: has joined #ruby
[21:16:52] miah: environment variables ftw
[21:17:13] dopie: has joined #ruby
[21:17:25] miah: http://12factor.net/config =)
[21:17:49] Senjai: miah: Moreso about more involved applications then web apps
[21:18:07] Senjai: We also use Dotenv for our projects
[21:18:12] chinmay_dd: has joined #ruby
[21:18:20] miah: chpst =)
[21:18:41] hakunin: has joined #ruby
[21:18:56] yorickpeterse: 12factor is decent except for the logging chapter
[21:18:59] yorickpeterse: that one is utter bullshit
[21:19:12] subtwo: has joined #ruby
[21:19:21] yorickpeterse: "It should not attempt to write to or manage logfiles. Instead, each running process writes its event stream, unbuffered, to stdout."
[21:19:25] yorickpeterse: STDOUT?????!!!
[21:19:28] lostcuaz: has joined #ruby
[21:19:30] yorickpeterse: At _least_ use STDERR
[21:19:31] yorickpeterse: or just use Syslog
[21:19:56] griffindy: has joined #ruby
[21:21:32] phutchins: has joined #ruby
[21:21:48] Senjai: yorickpeterse: The only problem I have with every log aggregator ever is the sorting of incoming events by timestamp
[21:21:54] Senjai: otherwise I just use paralell
[21:22:07] Senjai: ssh into all the boxes, paralell tail dem things
[21:22:09] mrmargol_: has joined #ruby
[21:22:24] yorickpeterse: sorting by timestamp?
[21:22:30] yorickpeterse: You mean services not sorting them?
[21:22:50] momomomomo: has joined #ruby
[21:22:53] Senjai: Yeah, that and I think there are issues with some services and log entires > 1 line
[21:23:08] danzilio: has joined #ruby
[21:23:10] nietzschette: has joined #ruby
[21:25:03] endash: has joined #ruby
[21:25:10] yorickpeterse: Hm, we use logentries.com and it sorts things just fine
[21:25:20] yorickpeterse: We don't have multi-line log messages though
[21:25:31] Senjai: Aye, we would need it to be delimited by newline.
[21:25:45] Senjai: Which is not something current services do well
[21:25:46] miah: syslog has limitations
[21:25:50] Senjai: as we log on a per request basis
[21:25:51] ndrei: has joined #ruby
[21:25:54] miah: its pretty horrible imho
[21:25:59] yorickpeterse: Senjai: Ah, you're logging entire Rails logs?
[21:26:10] yorickpeterse: miah: Sure, but everything else is worse
[21:26:11] miah: the key part about that is, to not make the app handle writing the log to disk
[21:26:27] Senjai: yorickpeterse: If we used an aggregator, yes
[21:26:46] Senjai: At the moment we simply tail our boxes. Most of our clients only have 2 - 10 boxes
[21:26:52] Senjai: and not all of them are web facing
[21:26:55] miah: we ship logs with kafka
[21:27:10] miah: its much better than syslog =)
[21:27:31] camilasan: has joined #ruby
[21:27:51] Senjai: miah: We actually havent looked into kafka
[21:28:00] miah: heka + kafka
[21:28:05] Senjai: miah: That might actually be pretty decent
[21:28:12] miah: its awesome
[21:28:18] miah: the only part not awesome is elasticsearch
[21:28:25] LMity: has joined #ruby
[21:28:30] Senjai: miah: I'm just going to add you to my list of people worth talking to.
[21:28:30] miah: because of their 'roll your own' distributed system that breaks all the time
[21:29:31] nofxx: miah, was going to ask that... kibana/logstash experience is great, when it comes to ES its just pain and agony
[21:29:40] yorickpeterse: the complexity of systems like kafka scares the crap out of me
[21:29:43] camilasan: has joined #ruby
[21:29:45] micmus: has joined #ruby
[21:29:47] nofxx: but it's java, I would be surprise if it was good.
[21:30:07] miah: the problem is they didnt use like, raft or something. they built their own 'disco' iirc
[21:30:30] jpfuentes2: has joined #ruby
[21:30:33] yorickpeterse: miah: I think they recently fixed most of their issues
[21:30:38] miah: and it has problems; https://aphyr.com/posts/323-call-me-maybe-elasticsearch-1-5-0
[21:30:47] yorickpeterse: at least after aphyr got his hands on it
[21:30:48] workmad3: has joined #ruby
[21:30:49] miah: they fixed _some_ of their issues for _certain_ cases
[21:31:01] miah: i dont think 1.6.0 is _quite_ there yet
[21:31:04] yorickpeterse: Granted we ditched ES a while ago
[21:31:07] yorickpeterse: haven't really kept up since
[21:31:15] yorickpeterse: We stopped using it prior to 1.0
[21:31:20] miah: i was reading the changelog the other day, we havent updated to it yet
[21:31:37] nofxx: those services I too damn expensive... and the limit is a slap in the face: 10gb/month. But it'll not drop the old ones to get you the new ones.
[21:31:40] miah: its certainly gotten better. but i think it still has a ways to go
[21:31:58] yorickpeterse: nofxx: which services?
[21:32:12] nofxx: yorickpeterse, use something for text search?
[21:32:18] nofxx: yorickpeterse, log aggregrators
[21:32:26] yorickpeterse: logentries isn't that bad
[21:32:31] yorickpeterse: though their interface is a bit dodgy
[21:32:36] yorickpeterse: typical JS app: shits itself half the time
[21:32:43] miah: i work for a bank, we're not going to ship our logs offsite..
[21:32:49] nofxx: yorickpeterse, they at least drop the old ones if I happen to overflow my limit?
[21:33:00] yorickpeterse: nofxx: not sure, haven't had that problem yet
[21:33:06] yorickpeterse: we only log a few GB/month
[21:33:16] nofxx: yorickpeterse, gonna check it out.
[21:33:30] yorickpeterse: I'm not super stoked about logentries, the main reason we use it is due to its alerting system
[21:33:46] jackjackdripper1: has joined #ruby
[21:34:12] jackjackdripper2: has joined #ruby
[21:34:15] yorickpeterse: miah: oh yeah, that makes sense
[21:34:20] yorickpeterse: we don't really log sensitive information
[21:34:31] yorickpeterse: mostly stuff like "Alice edited user #12381923" and such
[21:34:41] miah: we're working on ensuring that heka filters that stuff out
[21:34:57] kadoppe: has joined #ruby
[21:36:15] sharpmachine: has joined #ruby
[21:36:22] yorickpeterse: welp, in the mean time I managed to whip together an excerpt it seems
[21:36:48] yorickpeterse: oh the wonders of paper and pen
[21:37:07] yorickpeterse: I really need a better fountain pen though
[21:37:50] ogpastaling: has joined #ruby
[21:37:59] Rubie: has joined #ruby
[21:38:08] omegahm: has joined #ruby
[21:38:40] davedev24: has joined #ruby
[21:39:35] Casty: has joined #ruby
[21:40:17] startupality: has joined #ruby
[21:40:30] commondream: has joined #ruby
[21:41:27] ljarvis: yorickpeterse: u see dis? https://github.com/seppo0010/rsedis
[21:41:57] yorickpeterse: Yeah, saw it on /r/rust
[21:42:13] yorickpeterse: it's not complete unless its author is just as sketchy as antirez
[21:42:21] ljarvis: build redis "to learn rust" :|
[21:42:25] ljarvis: hah, antirez is awesome
[21:42:55] paulcsmith__: has joined #ruby
[21:43:06] yorickpeterse: https://github.com/seppo0010/rsedis/blob/master/response/src/lib.rs#L32-L37 lol
[21:43:24] yorickpeterse: I think it's worse than I can actually read that for the most part
[21:43:37] ljarvis: yep that'll do it
[21:44:00] ljarvis: what's [..], slice coerce?
[21:44:40] yorickpeterse: Hm, that I'm not sure about actually
[21:45:24] ljarvis: apart from that I can read it
[21:45:32] ljarvis: though it's really not pleasant
[21:45:38] yorickpeterse: you have become one with Rust young padawan
[21:45:57] yorickpeterse: unwrap() you must
[21:46:06] ljarvis: I haven't actually found a use for it yet, so I would be just re-writing something way less epic than redis
[21:46:14] ljarvis: do you even try!
[21:46:25] yorickpeterse: Funny enough I might actually have to port over ruby-ll to Rust at some point
[21:46:31] yorickpeterse: rust-peg sucks since it requires nightly builds
[21:46:41] yorickpeterse: and the only real other alternative is a parsing combinator, not a generator
[21:46:45] A205B064: has joined #ruby
[21:46:58] yorickpeterse: I can never get a break from all this yak shaving :<
[21:47:30] ljarvis: I have too much unfinished crap to deal with new things :(
[21:48:08] pragmatism: has joined #ruby
[21:48:30] yorickpeterse: Currently my list is: Oga (usualy stuff), OpenSSL/Digest multi-threading crap on Rubinius, proglang in Rust, fixing the Socket lib for Rubinius
[21:48:32] yorickpeterse: I think that's all
[21:48:37] yorickpeterse: which is like 5 years worth of work
[21:48:48] yorickpeterse: and 1512930812093 blog posts
[21:48:57] crdpink2: has joined #ruby
[21:49:00] Mojo_Nixon: has joined #ruby
[21:49:11] ljarvis: I need to get back on track with Mechanize, and then finish my proglang also
[21:49:12] RobertBirnie: has joined #ruby
[21:49:48] yorickpeterse: In other news, https://gist.github.com/YorickPeterse/4fcd870cf7877d9e7905 comments on this summary would be appreciated
[21:49:49] jamesaxl: has joined #ruby
[21:49:55] ljarvis: eh "finish" = get it good enough to not suck
[21:50:35] ljarvis: yorickpeterse: I'm not sure I'd agree with your first sentence, though I might be biased because I spent months and months writing parsers
[21:50:51] platzhirsch: has joined #ruby
[21:51:06] ljarvis: I like the idea of exploring different algs
[21:51:11] jgpawletko: has joined #ruby
[21:51:16] yorickpeterse: ljarvis: you've obtained the status of "person who knows parsing"
[21:51:24] yorickpeterse: which is like 1% of the total programmer population :P
[21:51:40] ljarvis: I thought it was popular
[21:52:01] ljarvis: although.. i have always struggled to find really good docs
[21:52:03] ljarvis: so maybe not
[21:52:07] yorickpeterse: From what I gather it's the opposite: people treat it as a black box
[21:52:48] ljarvis: people end up avoiding hand writing parsers because they're lazy or don't know how to do it. Or, they know exactly how to do it and they know how mind numbing and time consuming it is
[21:53:02] ljarvis: I *love* writing hand-written parsers, but i'm weird as fuck so *shrug*
[21:53:13] yorickpeterse: heh, I'm too lazy for that
[21:53:16] yorickpeterse: ain't got no time fo that
[21:53:25] ljarvis: see point 1
[21:54:18] ljarvis: I enjoy it. I have a crap load of things I've built with relation to parsing that I haven't released though :( relapse (the only ruby related project) seriously needs to gtfo
[21:54:26] yorickpeterse: why write a parser when you can write code to generate a parser? :P
[21:54:47] platzhirsch: has left #ruby: ()
[21:54:56] yorickpeterse: (answer: because that takes a few months and makes you hate yourself)
[21:55:07] ljarvis: parser generators suck at fine grained error reporting
[21:55:10] ljarvis: and im just a parser nerd
[21:55:17] yorickpeterse: and hate all those academic nuts out there who only upload .ppt files that don't explain shit
[21:55:29] yorickpeterse: ljarvis: actually LL(1) has pretty good error reporting
[21:55:30] simplyianm: has joined #ruby
[21:55:38] yorickpeterse: LALR is just a joke
[21:55:43] ljarvis: there's a lot of pretenciousness when you dig deep enough
[21:56:01] ljarvis: pretentiousness*
[21:56:06] bougyman: CREATE INDEX CONCURRENTLY idx_measurement_readings_compound ON measurement_readings USING btree (asset_id, measurement_tag_type_id, reported_at);
[21:56:18] ljarvis: wrong window yo
[21:56:24] yorickpeterse: bougyman: CREATE INDEX
[21:56:33] ljarvis: CONCURRENTLY
[21:56:38] yorickpeterse: oh shit you're right
[21:56:40] ljarvis: ^ my favourite thing
[21:56:43] Aria: Parsers? Marpa.
[21:56:51] yorickpeterse: I recently had our DB shit itself
[21:57:00] yorickpeterse: because in Sequel I use :concurrent instead of :concurrently
[21:57:05] yorickpeterse: so did my tests
[21:57:07] yorickpeterse: so they passed just fine
[21:57:15] ljarvis: I've done it before too
[21:57:17] ljarvis: I did it once
[21:57:20] ljarvis: then scared myself
[21:57:22] yorickpeterse: it worked fine for weeks
[21:57:25] yorickpeterse: then suddenly it raced
[21:57:31] ljarvis: did it win?
[21:57:41] yorickpeterse: (as in, for weeks it didn't do it concurrently without problems, then somehow it got stuck)
[21:58:05] chussenot: has joined #ruby
[21:58:19] ljarvis: add_index, algorithm: :concurrently <- my jam
[21:59:05] j4cknewt: has joined #ruby
[21:59:34] yorickpeterse: now for the hardest part of a talk: the title
[22:00:58] workmad3: has joined #ruby
[22:01:06] skade: has joined #ruby
[22:02:36] undeadaedra: Use GitHub project name generator.
[22:03:00] i831533: has joined #ruby
[22:03:22] yorickpeterse: "How about turbo-octo-bear." k
[22:03:36] yorickpeterse: "How about north-american-happiness." oooooooh
[22:03:51] yorickpeterse: "How about massive-hipster." hahahahaha
[22:03:54] undeadaedra: I got one with '-yolo-swag' once
[22:04:05] __butch__: has joined #ruby
[22:04:17] yorickpeterse: "How about spawncamping-sansa." somebody was salty
[22:05:08] rbowlby: has joined #ruby
[22:07:16] workmad3: has joined #ruby
[22:07:23] nietzschette: Is there a list somewhere of ENV keys by OS?
[22:08:01] mengu: has joined #ruby
[22:08:07] shevy: don't think so
[22:08:14] shevy: isn't ENV typically empty anyway?
[22:08:18] yorickpeterse: nietzschette: No, because the list is not fixed
[22:08:27] bougyman: ENV should always be populated.
[22:08:29] yorickpeterse: But you can get the currently set env variables using just ENV.keys
[22:08:34] bougyman: but you never know what will be in it.
[22:08:36] yorickpeterse: (their names that is)
[22:08:46] ruboto: shevy # => {"LIBC_FATAL_STDERR_"=>"1", "LANG"=>"en_US.UTF-8", "HOME"=>"/tmp/execpad-c918369fc6bc"} ...check link for more (https://eval.in/384003)
[22:11:21] yorickpeterse: boom, proposal sent
[22:11:22] wildroman2: has joined #ruby
[22:12:26] ruurd: has joined #ruby
[22:12:46] yorickpeterse: even have my eyes set on a pirate costume :D
[22:13:11] rbowlby_: has joined #ruby
[22:13:51] zenguy_pc: has joined #ruby
[22:14:15] yorickpeterse: well, if I could actually find it that is
[22:14:27] nietzschette: um, is it close to Halloween in your timezone?
[22:16:02] undeadaedra: Define 'close'
[22:16:14] undeadaedra: at ??12 months, it is
[22:19:27] keernel: has joined #ruby
[22:20:19] Senjai: yorickpeterse: I can sees proposal?
[22:21:34] fabrice31: has joined #ruby
[22:22:50] keernel1: has joined #ruby
[22:24:30] ruurd: has joined #ruby
[22:28:01] Pupeno: has joined #ruby
[22:28:35] jenrzzz: has joined #ruby
[22:30:18] xxneolithicxx: has joined #ruby
[22:30:35] icebourg: has joined #ruby
[22:33:26] zenguy_pc: has joined #ruby
[22:38:14] tercenya: has joined #ruby
[22:38:27] krisquigley: has joined #ruby
[22:38:30] ogpastaling: has joined #ruby
[22:40:16] DEA7TH: has joined #ruby
[22:41:04] dgutierrez1287: has joined #ruby
[22:41:11] jackjackdripper: has joined #ruby
[22:41:17] kb3ien: Well the efforts to get ruby (passenger) to use http_proxy are largely not working. I'm okay with modifying the code as all the requests that I care about originate in one .rb file.
[22:41:32] jfarmer: has joined #ruby
[22:41:52] cndiv: has joined #ruby
[22:41:52] cndiv: has joined #ruby
[22:42:10] jackjackdripper1: has joined #ruby
[22:42:39] segfalt: has joined #ruby
[22:42:39] danman: has joined #ruby
[22:43:08] Jarboe: has joined #ruby
[22:43:34] kb3ien: I've copied the file from '/usr/local/lib/ruby/gems/2.0.0/gems/ebsco-discovery-service-api-1.0.4/lib/ebsco-discovery-service-api.rb
[22:43:48] mgorbach: has joined #ruby
[22:43:53] RobertBirnie: has joined #ruby
[22:44:56] kb3ien: ' to /var/www/local_gems/ebsco-discovery-service-api-1.0.4/lib/ , updated the Gemfile with the path thusly "gem "ebsco-discovery-service-api", "1.0.4" , :path => '/var/www/local_gems/ebsco-discovery-service-api-1.0.4/lib/' -- but it's notworking should not there be a *.gem file involved ?
[22:45:24] commondream: has joined #ruby
[22:46:36] tcrypt: has joined #ruby
[22:46:38] kb3ien: because the error is now "uninitialized constant Blacklight::ArticlesHelperBehavior::EDSApi" , which the the Controller define in that file.
[22:46:48] kb3ien: has left #ruby: ()
[22:47:22] eam: has joined #ruby
[22:47:29] ericmeds: has joined #ruby
[22:47:37] PaulCapestany: has joined #ruby
[22:49:11] blaines: has joined #ruby
[22:49:37] nwhirschfeld: has joined #ruby
[22:50:26] axisys: has joined #ruby
[22:50:29] stonith: has joined #ruby
[22:50:44] tomphp: has joined #ruby
[22:50:46] ozzloy: has joined #ruby
[22:50:46] ozzloy: has joined #ruby
[22:50:49] atomi: has joined #ruby
[22:50:56] sivoais: has joined #ruby
[22:51:12] edwinvdgraaf: has joined #ruby
[22:51:20] failshell: has joined #ruby
[22:51:53] sharpmachine: has joined #ruby
[22:51:54] zenspider: you left before getting a response... idgi
[22:52:16] matp_: has joined #ruby
[22:52:57] mahlon: has joined #ruby
[22:53:38] existensil: has joined #ruby
[22:53:39] jackjackdripper: has joined #ruby
[22:53:44] ogpastaling: has joined #ruby
[22:54:05] jackjackdripper2: has joined #ruby
[22:54:25] crdpink2: has joined #ruby
[22:54:42] swgillespie: has joined #ruby
[22:54:49] dfockler: they were on here earlier
[22:54:50] nietzschette: Scope resolution, maybe?
[22:55:11] nietzschette: I'm not one of the gurus
[22:55:17] yaw: has joined #ruby
[22:55:21] A205B064: has joined #ruby
[22:55:26] yaw: has left #ruby: ()
[22:55:29] _phwelo: has joined #ruby
[22:55:38] michaelreid: has joined #ruby
[22:55:53] s2013: has joined #ruby
[22:56:21] j_mcnally: has joined #ruby
[22:56:37] jackjackdripper1: has joined #ruby
[22:56:54] bigmac_: has joined #ruby
[22:57:22] Igorshp: has joined #ruby
[22:57:25] arcanez: has joined #ruby
[22:58:02] arcanez: is there an easy/short way to take { :foo => 'bar', :baz => 'quux' } and make a string "foo=bar baz=quux"
[22:58:34] arcanez: params.each_pair { |k,v| s += "#{k}=#{v} " } seems wrong
[22:59:03] sarkyniin: has joined #ruby
[22:59:40] jfarmer: That example code doesn't produce the example output you just gave.
[22:59:46] nietzschette: each_pair{|k, v| "#{k}=#{v}"}.join(" ")
[22:59:51] jfarmer: the space at the end
[23:00:21] nietzschette: wait, i'm off my face
[23:00:29] sanguisdex: has joined #ruby
[23:00:49] chipotle: has joined #ruby
[23:01:16] jfarmer: nietzschette No, that works.
[23:02:06] jfarmer: params.each_pair { |k,v| "#{k}=#{v}" }.join(" ")
[23:02:21] jfarmer: Although if you're actually using that query string, you should escape the keys and values.
[23:02:38] marienz: has joined #ruby
[23:03:27] jfarmer: require "cgi"; params.each_pair { |k,v| "#{CGI.escape(k)}=#{CGI.escape(v)}" }.join(" ")
[23:03:31] arcanez: params.to_query.gsub('&', '')
[23:03:37] arcanez: since I have rails available
[23:03:38] nietzschette: you could hash.to_a.collect{|x| x.collect{|y| y.join('=')}}.join(' ')
[23:03:41] mary5030: has joined #ruby
[23:03:41] arcanez: but I think i just insulted someone
[23:03:53] jfarmer: That's not really escaping. :)
[23:04:11] arcanez: escaping, who needs that :)
[23:04:19] phizzbuzz: has joined #ruby
[23:04:35] workmad3: has joined #ruby
[23:05:00] jhass: what's wrong with .map {|k, v| "#{k}=#{v}" }.join(" ") ...
[23:05:27] nietzschette: does a hash mix in enumerator?
[23:05:32] centrx: Enumerable
[23:05:57] centrx: I mean yes
[23:06:00] simplyianm: has joined #ruby
[23:06:08] Rubie: has joined #ruby
[23:06:08] jpfuentes2: has joined #ruby
[23:06:08] _djbkd: has joined #ruby
[23:06:08] symm-: has joined #ruby
[23:06:08] Agoldfish: has joined #ruby
[23:06:08] MatthewsFace: has joined #ruby
[23:06:08] Spami: has joined #ruby
[23:06:08] jwilson_: has joined #ruby
[23:06:08] datanoise: has joined #ruby
[23:06:08] Akagi201: has joined #ruby
[23:06:08] ZOMGITSABEAR: has joined #ruby
[23:06:08] iwishiwerearobot: has joined #ruby
[23:06:08] Rarikon: has joined #ruby
[23:06:08] RazorX: has joined #ruby
[23:06:08] alphaatom|pc: has joined #ruby
[23:06:08] surs: has joined #ruby
[23:06:08] closer: has joined #ruby
[23:06:08] sumark: has joined #ruby
[23:06:09] cats: has joined #ruby
[23:06:09] MEATCHICKEN: has joined #ruby
[23:06:09] systemd0wn: has joined #ruby
[23:06:09] RTG`: has joined #ruby
[23:06:09] scottstamp: has joined #ruby
[23:06:09] S_Walker: has joined #ruby
[23:06:09] WillAmes: has joined #ruby
[23:06:09] quarcu_: has joined #ruby
[23:06:09] avelldiroll: has joined #ruby
[23:06:09] mr_rich101: has joined #ruby
[23:06:09] aytch: has joined #ruby
[23:06:09] unreal: has joined #ruby
[23:06:09] TinkerTyper: has joined #ruby
[23:06:09] Kharma: has joined #ruby
[23:06:09] mrsolow: has joined #ruby
[23:06:09] fold: has joined #ruby
[23:06:09] thomas: has joined #ruby
[23:06:09] gregf_: has joined #ruby
[23:06:09] tdy: has joined #ruby
[23:06:09] EnergyCoffee: has joined #ruby
[23:06:09] mansel: has joined #ruby
[23:06:09] oz: has joined #ruby
[23:06:09] zz_Outlastsheep: has joined #ruby
[23:06:09] ccooke: has joined #ruby
[23:06:09] Steve_Jobs: has joined #ruby
[23:06:09] nfsnobody: has joined #ruby
[23:06:09] maloik: has joined #ruby
[23:06:09] tomaw: has joined #ruby
[23:06:09] eshy: has joined #ruby
[23:06:09] tris: has joined #ruby
[23:06:10] cibs: has joined #ruby
[23:06:15] jfarmer: not each_pair, but map
[23:06:23] jfarmer: silly me, was on autopilot
[23:07:22] arcanez: each_pair doesn't return does it? map does
[23:07:44] jhass: each_pair should be an alias to .each which returns the receiver
[23:07:45] cats: has joined #ruby
[23:07:45] unreal: has joined #ruby
[23:08:00] swgillespie: has joined #ruby
[23:08:03] Akagi201: has joined #ruby
[23:08:16] jfarmer: arcanez Every function in Ruby returns something.
[23:08:17] lkba: has joined #ruby
[23:08:28] arcanez: well right, but not the result of the block
[23:08:32] jfarmer: But in this case, it's not returning what we want. Yes, correct.
[23:08:46] jfarmer: map is what you want
[23:09:49] jfarmer: You want to go: {"foo" => "bar", "baz" => "quux"} ---map---> ["foo=bar", "baz=quux"] ---join---> "foo=bar baz=quux"
[23:10:11] simplyianm: has joined #ruby
[23:11:00] scx_: has joined #ruby
[23:11:02] jfarmer: Also, you probably want to sort the key/value pairs in a consistent order
[23:11:23] elektronaut: hashes are ordered in ruby 1.9+
[23:11:26] arcanez: is map an alias for collect (or vice versa)
[23:11:28] jfarmer: So I might consider params.map { |k,v| ... }.sort.join("&")
[23:11:34] jfarmer: Yes, they're aliases of each other
[23:11:40] GPrime: has joined #ruby
[23:11:42] jenrzzz: has joined #ruby
[23:11:54] jfarmer: elektronaut That's true but not why you'd want to sort the query string.
[23:12:06] jfarmer: You'd want to sort it for two reasons:
[23:12:14] jhass: I don't think it's a query string
[23:12:20] gkra: has joined #ruby
[23:12:24] arcanez: it's "not"
[23:12:26] jhass: I mean it would be invalid
[23:12:28] jfarmer: Well, regardless
[23:12:46] jfarmer: Let's call it a "waffle string" then, whatever.
[23:13:07] jhass: it's not like arcanez couldn't tell us what it is ;P
[23:13:09] jfarmer: 1. to_waffle(params1) == to_waffle(params2) if and only if params1 == params2
[23:13:15] alphaatom|pc: has joined #ruby
[23:13:17] jfarmer: you want that invariant to hold
[23:13:35] arcanez: jhass: really bad, is what it is :)
[23:13:44] jfarmer: Hashes are ordered and will give you the key/value pairs back in a consistent order, but Hash equality == is order-agnostic.
[23:14:16] nietzschette: hsh.keys.zip(hsh.values).collect{|t| t.join("=")}.join(' ')
[23:14:30] nietzschette: should work if they're ordered
[23:14:33] jhass: nietzschette: why is that superior?
[23:14:50] jfarmer: nietzschette You can just do hash.to_a to get back an array of key/value pairs
[23:15:01] northfurr: has joined #ruby
[23:15:10] jfarmer: http://cl.ly/image/3O3q2F3l0f2D
[23:15:40] jhass: >> {a: :b}.map {|i| i }
[23:15:42] ruboto: jhass # => [[:a, :b]] (https://eval.in/384023)
[23:15:57] jhass: it's already yielded as an array if that's what the zip is about
[23:15:59] scx: has joined #ruby
[23:19:23] Channel6: has joined #ruby
[23:19:33] tkuchiki: has joined #ruby
[23:19:35] jhass: uh, I hope we didn't scare them away
[23:19:45] jfarmer: arcanez u scared?
[23:19:54] atomical_: has joined #ruby
[23:20:26] arcanez: no, I'm here :)
[23:21:30] d5sx43: has joined #ruby
[23:21:30] volty: has joined #ruby
[23:22:44] arcanez: though I think you'd be scared seeing some of this code
[23:22:50] arcanez: that I have to deal with
[23:23:54] atomical: has joined #ruby
[23:24:26] fulgore_: has joined #ruby
[23:25:03] arcanez: the new code has gotten better.. but the old code.. is old code
[23:25:21] arcanez: I won't mention I started on perl (and we have perl devs) so some of our ruby is perlish
[23:25:30] Senjai: arcanez: Can't be worse than some of the stuff I have to deal with
[23:26:37] simplyianm: has joined #ruby
[23:26:53] arcanez: I imagine there is always someone that has it worse
[23:27:08] arcanez: being stuck on ruby 1.9.3 and rails 2 isn't fun
[23:27:42] elektronaut: hah. i still have 5 projects stuck on 1.8.7 / rails 2
[23:28:28] elektronaut: hopefully 2015 will be the year i can finally retire 1.8.7 from production
[23:28:29] arcanez: sucks when you google for how to do something in AR and you find the 3/4 results.. then realize you can't do that in 2 :(
[23:28:47] et09: has joined #ruby
[23:28:55] et09: how do i get comprehensive class info/derivation etc. for a variable?
[23:29:01] fgo: has joined #ruby
[23:29:27] elektronaut: fortunately, there's not that much you can do in 2, so it's easy to keep in your head
[23:29:33] elektronaut: although i'm getting rusty on that
[23:30:14] jfarmer: arcanez You....really should upgrade.
[23:30:26] renderful: has joined #ruby
[23:30:26] arcanez: not my decision sadly
[23:30:42] Senjai: arcanez: Tell the person who can make the decision if they dont they're stupid
[23:30:52] Senjai: Rails 2 is just .. no
[23:31:00] jfarmer: There are maybe more effective ways to convince them, haha.
[23:31:02] paulcsmith__: has joined #ruby
[23:31:03] arcanez: I can't imagine how many 2isms we have though
[23:31:19] jfarmer: But Rails 2 is not just out of date ??? it's obsolete.
[23:31:28] jfarmer: There's no support for it, there are almost certainly security holes
[23:31:35] Ox0dea: Is it possible to simulate -> lambdas in Ruby 1.0?
[23:31:38] Senjai: jfarmer: 1.8 is terribly scary
[23:32:10] arcanez: is there a backcompat layer or way to find incompatible things in your code before you upgrade 2->3 or 2->4?
[23:32:29] elektronaut: there was a gem, i can't remember what it's called
[23:32:44] jfarmer: arcanez Maybe. This is something that most people dealt with 3-4 years ago.
[23:33:08] elektronaut: rails_upgrade
[23:34:26] francois_: has joined #ruby
[23:35:01] zenspider: everything is obsolete pretty much as soon as its published
[23:35:18] arcanez: zenspider: I think it's more that there aren't any security patches provided
[23:36:08] Musashi007: has joined #ruby
[23:36:09] kb3ien: has joined #ruby
[23:36:22] elektronaut: there's rails LTS at least
[23:36:44] kb3ien: I'm still stumped forcing a ruby on rails app to consistently use a proxy.
[23:36:49] elektronaut: haven't tried it. but i imagine there's quite a few projects still stuck on rails 2 out there.
[23:37:40] eggoez: has joined #ruby
[23:38:23] kb3ien: I did the 'SetEnv http_proxy http://127.1:8888' thing in the VirtualHost ; I told apache to use a shell script that injected that into the environment, but seems that apache doesnt actually launch roby directly most of the time, but rather users Passenger. How does one make Passenger set the http_proxy env var ?
[23:38:32] commondream: has joined #ruby
[23:38:53] FernandoBasso: has joined #ruby
[23:38:56] blue_deref: has joined #ruby
[23:39:12] Senjai: kb3ien: Could always use Nginx :P
[23:39:16] zenspider: argh. I have a rails/AR default_scope question... and MAN i don't want to go to #rubyonrails to ask it. :P
[23:40:28] kb3ien: Ah, well its taken me long enough to learn apache well enough for everything I use. I'd hate to switch. how does one set the environment for Passenger ?
[23:41:18] kb3ien: actually I did set the env by editing /etc/apache2/mods-enabled/passenger.conf to use a wrapper too.
[23:41:37] luckyme: has joined #ruby
[23:42:26] simplyianm: has joined #ruby
[23:43:31] kb3ien: I did confirm that the ENV['http_proxy'] is set by the ruby-wrapper I wrote : I envoked it and ran STDOUT.puts ENV['http_proxy'] and got the expected value.
[23:43:57] swgillespie: has joined #ruby
[23:44:56] Ropeney: has joined #ruby
[23:45:12] Yiota: has joined #ruby
[23:45:35] dmolina: has joined #ruby
[23:46:16] sdothum: has joined #ruby
[23:46:36] zenspider: that was relatively painless
[23:47:11] uptownhr: has joined #ruby
[23:48:08] arcanez: Senjai: ++ for nginx
[23:48:26] arcanez: is passenger still a good thing to use?
[23:48:34] Senjai: kb3ien: Apache is terrible, so is passenger @_@
[23:49:02] mdw: has joined #ruby
[23:49:28] kb3ien: Passenger is terrible. Might not the problem be in NET::Http , which is also none too clean ?
[23:49:53] et09: what's betterthanpassenger
[23:50:24] Senjai: et09: unicorn, mostly
[23:50:49] axl_: has joined #ruby
[23:50:50] Senjai: et09: Ruby thrives in a process based model, threads are highly overrated
[23:50:50] quazimodo: has joined #ruby
[23:50:59] Senjai: It works swimmingly with nginx
[23:51:21] et09: passenger runs them in threads?
[23:51:36] Senjai: and each unicorn 'master' acts as a load balancer, that can kill each sub process if it fails
[23:51:39] et09: i have severalpassenger procs on the server
[23:51:41] Senjai: or eats too much memory
[23:52:05] et09: what about "Raptor" passenger
[23:52:09] failshell: has joined #ruby
[23:53:03] bougyman: nginx in front of a pile of thins never did me wrong.
[23:53:09] failshell: has joined #ruby
[23:53:17] bougyman: i'm on the fence about unicorn. with a good config it can be tame enough.
[23:53:20] uptownhr: has joined #ruby
[23:54:15] Senjai: https://github.com/freerunningtech/frt-opsworks-cookbooks/blob/master/unicorn/templates/default/unicorn.conf.erb
[23:54:26] Senjai: https://github.com/freerunningtech/frt-opsworks-cookbooks/blob/master/unicorn/templates/default/nginx_unicorn_web_app.erb
[23:54:44] Senjai: bougyman: What do you use in place of unicorn?
[23:54:48] datanoise: has joined #ruby
[23:54:57] bougyman: Senjai: thins
[23:55:10] bougyman: at the dayjob I have to work with unicorn.
[23:55:17] bougyman: but I suggest thin and use thin for all my own stuff.
[23:55:43] Senjai: bougyman: So on one server, you have one thin?
[23:55:49] bougyman: unicorn is not a well behaved unix process.
[23:55:50] Senjai: Or several behind nginx?
[23:56:02] bougyman: no, you missed my statement "nginx in front of a pile of thins"
[23:56:04] icebourg: has joined #ruby
[23:56:07] bougyman: those thins can be on one or many servers.
[23:56:11] bougyman: and many per server, of course.
[23:56:12] Senjai: Oh I thought you meant things
[23:56:17] _blizzy_: has joined #ruby
[23:56:22] elektronaut: yeah, i read that as well. damn brain autocorrect.
[23:56:30] bougyman: passenger is a non-starter because I never put the web app on the same box as the web server (nginx)
[23:56:33] Senjai: I've never had issues with with managing unicorn
[23:56:49] CloCkWeRX: has joined #ruby
[23:57:08] Senjai: bougyman: Ah, see, we use ELB for load balancing, sometimes with HAProxies, but we always have nginx running on serving boxes
[23:57:13] CloCkWeRX: has left #ruby: ()
[23:57:56] jpfuentes2: has joined #ruby
[23:58:10] bougyman: we have one nginx and multiple app servers.
[23:58:22] bougyman: no need for a proxy in front of nginx, it's never seen load.
[23:58:27] bougyman: we have redundancy, of course.
[23:58:33] bougyman: but nothing that has to balance.
[23:59:09] bougyman: that nginx serves quite a few apps, too.
[23:59:17] bougyman: nginx is a pretty good proxy, really.
[23:59:35] NeverDie: has joined #ruby