« Back to channel list

#ruby - 17 June 2015

« Back 1 day Forward 1 day »
[00:00:08] failshell: has joined #ruby
[00:00:23] tedstriker: has joined #ruby
[00:00:51] ItSANgo: has joined #ruby
[00:01:28] nitenq: ok thanks
[00:01:42] zenspider: argh... acm won't cache the pdf in the reading list. I need to save it off to queue it.
[00:01:47] zenspider: this is why I left the acm
[00:02:13] zenspider: that, and they're seemingly not editing papers anymore. crap getting through
[00:02:21] zenspider: chrisseaton: thanks for the read.
[00:03:52] allcentury: has joined #ruby
[00:04:02] GPrime: has joined #ruby
[00:04:52] endash: has joined #ruby
[00:04:52] fabrice31: has joined #ruby
[00:08:46] CloCkWeRX: has joined #ruby
[00:12:27] dgutierrez1287: has joined #ruby
[00:15:24] bgmarx: has joined #ruby
[00:15:37] Scroff: has joined #ruby
[00:15:53] Ox0dea: >> [].map
[00:15:54] ruboto: Ox0dea # => #<Enumerator: []:map> (https://eval.in/382746)
[00:15:59] scottschecter: has joined #ruby
[00:16:01] Ox0dea: zenspider: Why not do the same for Enumerator::Lazy?
[00:16:14] bronson: has joined #ruby
[00:16:20] Casty: has joined #ruby
[00:16:22] Ox0dea: >> [].lazy.enum_for(:map)
[00:16:23] ruboto: Ox0dea # => #<Enumerator::Lazy: #<Enumerator::Lazy: []>:map> (https://eval.in/382747)
[00:17:36] Pisuke: has joined #ruby
[00:19:42] havenwood: >> [1, 2, 3].lazy.enum_for(:map).to_a
[00:19:43] ruboto: havenwood # => [] (https://eval.in/382748)
[00:19:53] svf: has joined #ruby
[00:19:57] swgillespie: has joined #ruby
[00:20:29] havenwood: >> [1, 2, 3].lazy.map(&:itself).to_a
[00:20:30] ruboto: havenwood # => [1, 2, 3] (https://eval.in/382749)
[00:20:43] baweaver: has joined #ruby
[00:22:09] wallerdev: has joined #ruby
[00:22:31] Ox0dea: Was that intended to demonstrate that Lazy#map without a block *should* fail?
[00:23:11] jcaho: has joined #ruby
[00:23:33] gambl0re: has joined #ruby
[00:24:33] prettiestPony11: has joined #ruby
[00:24:56] apoplexy: has joined #ruby
[00:25:31] havenwood: Ox0dea: Just meant to show that `enum_for(:map)` doesn't actually map in that case.
[00:26:08] Ox0dea: Yeah, I guess that's why it works as it does now.
[00:26:09] kahunaio: has joined #ruby
[00:26:15] Ox0dea: Thunks are tricky.
[00:26:36] Pisuke: has joined #ruby
[00:26:47] CBke: has joined #ruby
[00:28:14] dgutierrez1287: has joined #ruby
[00:30:35] jack_rabbit: has joined #ruby
[00:30:47] charliesome: has joined #ruby
[00:30:47] x1337807x: has joined #ruby
[00:33:07] luckyme: has joined #ruby
[00:33:25] Musashi007: has joined #ruby
[00:33:32] CrazyHorse18: has joined #ruby
[00:34:22] vikaton: has joined #ruby
[00:34:24] MVPhelp: has joined #ruby
[00:34:35] robustus: has joined #ruby
[00:37:50] j4cknewt: has joined #ruby
[00:37:54] allcentury: has joined #ruby
[00:37:59] kahuna_: has joined #ruby
[00:39:17] dgutierrez1287: has joined #ruby
[00:40:49] krisquigley: has joined #ruby
[00:42:40] drewo: has joined #ruby
[00:46:02] nikhgupta: has joined #ruby
[00:48:13] pygospa: has joined #ruby
[00:48:27] baweaver: has joined #ruby
[00:48:35] cntrx: has joined #ruby
[00:49:14] dgutierrez1287: has joined #ruby
[00:49:48] nikhgupta: has joined #ruby
[00:50:49] jenrzzz: has joined #ruby
[00:54:27] fujimura: has joined #ruby
[00:54:41] platzhirsch: has joined #ruby
[00:54:47] platzhirsch: has left #ruby: ()
[00:55:27] mrmargolis: has joined #ruby
[00:56:38] pygospa: has joined #ruby
[00:56:58] Akagi201: has joined #ruby
[00:57:52] Lexun: has joined #ruby
[00:58:22] x1337807x: has joined #ruby
[00:59:17] nikhgupta: has joined #ruby
[01:00:05] simplyianm: has joined #ruby
[01:00:17] zacts: has joined #ruby
[01:00:19] JoshGlzBrk: has joined #ruby
[01:00:34] aaeron: has left #ruby: ()
[01:00:38] houhoulis: has joined #ruby
[01:01:22] nikhgupta: has joined #ruby
[01:02:47] failshell: has joined #ruby
[01:05:40] nikhgupta: has joined #ruby
[01:06:16] bootstrappm: is ruby-install supposed to symlink the binaries if run as root?
[01:06:24] bootstrappm: it didn't for me and I had to do it manually which I found annoying
[01:06:53] nikhgupta: has joined #ruby
[01:07:51] nonparfumee: has joined #ruby
[01:08:00] aaeron: has joined #ruby
[01:08:10] baweaver: has joined #ruby
[01:08:21] havenwood: bootstrappm: you can `--system` to install to /usr/local
[01:08:44] bootstrappm: ruby-install --system ruby ?
[01:08:49] havenwood: bootstrappm: yup
[01:08:50] bootstrappm: perfect, thanks
[01:08:55] nikhgupta: has joined #ruby
[01:09:09] havenwood: bootstrappm: you're welcome
[01:11:08] simplyianm: has joined #ruby
[01:11:17] nikhgupta: has joined #ruby
[01:11:42] bkxd: has joined #ruby
[01:12:04] nikhgupta: has joined #ruby
[01:12:05] dfockler: has joined #ruby
[01:13:12] JCOE: has joined #ruby
[01:13:19] nikhgupta: has joined #ruby
[01:14:05] nikhgupta: has joined #ruby
[01:15:32] prettiestPony11: has joined #ruby
[01:16:05] amclain: has joined #ruby
[01:19:30] jtdoncas: has joined #ruby
[01:21:11] CpuID: has joined #ruby
[01:21:38] Adran: has joined #ruby
[01:21:44] Parker0: has joined #ruby
[01:23:44] nikhgupta: has joined #ruby
[01:24:51] evanjs: has joined #ruby
[01:24:56] Ox0dea: has left #ruby: ("WeeChat 1.3-dev")
[01:27:02] jpfuentes2: has joined #ruby
[01:30:59] jwilson_: has joined #ruby
[01:31:12] bruno-: has joined #ruby
[01:33:43] idafyaid: has joined #ruby
[01:33:43] idafyaid: has joined #ruby
[01:36:41] _gautam_: has joined #ruby
[01:37:55] workmad3: has joined #ruby
[01:37:58] drocsid: has joined #ruby
[01:38:42] nitenq: how can I use a sudo command with ``
[01:40:11] Aeyrix: `sudo <x>
[01:40:28] Rollabunna: has joined #ruby
[01:41:03] nitenq: not wroking
[01:41:09] x0F: has joined #ruby
[01:41:14] Aeyrix: irb(main):004:0> puts `sudo whoami`
[01:41:15] sevenseacat: thats not helpful.
[01:41:17] Aeyrix: Are you sure?
[01:41:22] nitenq: ???sudo: no tty present and no askpass program specified???
[01:41:23] sevenseacat: define 'not working'
[01:41:37] sevenseacat: ok, so you're running it from a script somewhere
[01:41:51] datanoise: has joined #ruby
[01:41:59] sevenseacat: good to know this kind of stuff when you ask the initial question :P
[01:42:32] Oog: has joined #ruby
[01:42:44] Aeyrix: ACTION wanders off to not get involved in security semantics.
[01:43:23] nitenq: can I use system instead of `` ?
[01:43:38] Aeyrix: Why do you need sudo?
[01:43:47] tkuchiki: has joined #ruby
[01:43:52] nitenq: cause my command is only working as a sudo
[01:43:57] Aeyrix: What's the command?
[01:44:10] tkuchiki_: has joined #ruby
[01:44:27] Aeyrix: Fio does not need to run as root.
[01:44:30] nitenq: sudo fio conf.fio
[01:44:44] nitenq: it does cause i want to write in /etc/
[01:44:48] northfurr: has joined #ruby
[01:45:04] Aeyrix: Is this running on a system that anyone other than you has access to?
[01:45:31] Aeyrix: Modify sudoers to allow that user to execute `fio` without inputting a password.
[01:45:54] Aeyrix: <user> ALL=(ALL) NOPASSWD: fio
[01:45:59] al2o3-cr: nitenq: this might work: `echo 'yourpassword' | sudo -S command`
[01:46:07] Aeyrix: al2o3-cr: Not anymore.
[01:46:13] Aeyrix: sudo no longer takes input from stdin like that.
[01:46:22] eam: since when?
[01:46:25] al2o3-cr: ah, didn't test
[01:46:28] Aeyrix: Since the last time I tried about a year ago.
[01:47:18] yeticry: has joined #ruby
[01:47:23] al2o3-cr: Aeyrix: it does, just tested it
[01:47:38] al2o3-cr: Aeyrix: arch
[01:47:41] Aeyrix: The fuck?
[01:47:46] Aeyrix: Tested on Debian a year ago. Didn't work.
[01:47:54] Aeyrix: Repeatedly didn't work, because it's a fucking stupid flag that shouldn't exist.
[01:48:00] eam: Aeyrix: did you have one of the configs set that require a terminal?
[01:48:02] al2o3-cr: ah, not got debian to test on :(
[01:48:14] Aeyrix: The fact it exists is kind of disappointing. It shouldn't.
[01:48:33] Aeyrix: Anyway, my suggestion of modifying the sudoers file is more secure.
[01:48:38] eam: why not?
[01:48:40] Aeyrix: Allowing only su execution of that specific binary.
[01:48:53] eam: Aeyrix: it's fine
[01:49:04] Aeyrix: i'm trying to give serious advice here, eam
[01:49:06] Aeyrix: and you're joking around
[01:49:07] eam: any password auth is bad, but supplying the secret via a fd is fine
[01:49:36] nitenq: hum I can???t really do it that way
[01:49:53] nitenq: strange thing is that I have the exact same error when I try to write in /tmp
[01:50:14] eam: nitenq: share the error
[01:50:16] Aeyrix: That's because there's no tty.
[01:50:26] Aeyrix: Because, you know, you're running it from a script.
[01:50:33] nitenq: Aeyrix: even if I don???t run it from a script
[01:50:33] Aeyrix: It can't take or provide user input.
[01:50:36] bootstrappm: nitenq can you elaborate on why you can't really do it that way?
[01:50:39] Aeyrix: nitenq: wait, what
[01:50:39] eam: Aeyrix: that's not necessarily true
[01:50:50] Aeyrix: eam: please stop getting into semantic debates with me, it's tiring
[01:50:53] eam: sudo can access your terminal from within backticks
[01:51:00] eam: Aeyrix: your advice is simply wrong, that's all
[01:51:02] nitenq: http://pastebin.com/AhfybKB1
[01:51:02] Aeyrix: bootstrappm: Writing to /etc.
[01:51:03] ruboto: nitenq, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/874abf4488a0f07563e8
[01:51:03] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[01:51:10] Aeyrix: That bot is great.
[01:51:20] JCOE: has joined #ruby
[01:51:49] Aeyrix: nitenq: ls -l /tmp/conf-readwrite-1g.1.0
[01:51:52] eam: if he's running a script from the commandline then backticks and sudo in backticks will properly prompt for his password
[01:52:01] nitenq: that???s right Aeyrix
[01:52:22] Aeyrix: eam: And yet, it doesn't.
[01:52:31] Aeyrix: He pasted the error above.
[01:52:34] eam: Aeyrix: yes due to some other issue, so perhaps don't mislead him
[01:52:37] Aeyrix: ???sudo: no tty present and no askpass program specified???
[01:53:10] nitenq: no it???s still not working, I deleted the /tmp/conf-readwrite-1g.1.0 and I still have the same error
[01:53:23] wookiehangover: has joined #ruby
[01:53:23] Aeyrix: Wait why did you delete it?
[01:53:24] x0F: has joined #ruby
[01:53:26] allcentury: has joined #ruby
[01:53:51] fabrice31: has joined #ruby
[01:54:16] nitenq: cause it have been created by the root user
[01:54:46] RickHull: has joined #ruby
[01:54:47] Aeyrix: That is probably gonna happen when you're running a command with `sudo`.
[01:54:55] eam: nitenq: the easy answer is to run your entire script as root, and drop privs where you don't need them
[01:55:02] RickHull: can ARGF play nice with option parsers?
[01:55:18] malconis: has joined #ruby
[01:55:25] nitenq: Aeyrix: and I don???t run it anymore cause you told me that fio doesn???t need to be root
[01:55:25] eam: there are a few gems that make temporarily giving up root easy
[01:55:27] RickHull: i'm trying to use ARGF with slop, and slop is detecting / consuming a flag, but ARGF still sees it after Slop.parse
[01:55:47] RickHull: i.e. ARGF interprets a slop command line option as a file to be processed
[01:55:53] Aeyrix: nitenq: It really depends what you're doing. I didn't have the context that you're trying to modify a file in /etc, for instance.
[01:56:13] Aeyrix: You just kind of told us that it wasn't working. It's hard to diagnose an issue without the full picture.
[01:56:24] Aeyrix: For instance, your /etc/sudoers file is probably going to have a line that says `requiretty`.
[01:56:53] nobitanobi: has joined #ruby
[01:56:59] Aeyrix: I didn't know that before, because that's not default as far as I can remember.
[01:58:30] RickHull: ljarvis: what about slopv4 and ARGF?
[01:58:39] eam: there are two (mostly redundant) flags for that now, requiretty and visiblepw -- both are set by default to foil tty-less sudo
[01:59:07] eam: the latter is only invoked in the PAM stack
[01:59:15] RickHull: ljarvis: (wrt https://github.com/leejarvis/slop#no-more-parse )
[02:00:07] serivichi: has joined #ruby
[02:00:24] duderonomy: has joined #ruby
[02:01:42] Aeyrix: imo just setuid bit if you want maximum ease
[02:02:36] RickHull: ljarvis: working around this by manipulating ARGV before accessing ARGF
[02:03:05] Aeyrix: Where's Ox0
[02:03:15] eam: RickHull: seems like maybe not using ARGF magic would be in order, in that case
[02:03:31] RickHull: eam: i'm usually not a fan
[02:03:39] RickHull: but in this case, ARGF is what i want
[02:04:37] eam: RickHull: there's a #replace method it seems
[02:04:53] RickHull: hm, for slop?
[02:04:58] eam: on ARGF
[02:05:31] simplyianm: has joined #ruby
[02:06:11] MatthewsFace: has joined #ruby
[02:06:15] jenrzzz: has joined #ruby
[02:06:31] RickHull: oh, on ARGV
[02:07:23] eam: on ARGF - I suspect on ARGV it may differ in behavior
[02:07:26] RickHull: i'm not sure it helps. a feature of slopv4 is that it doesn't touch ARGV. and ARGF assumes all non-files have been removed from ARGV
[02:07:31] eam: >> ARGF.class
[02:07:32] ruboto: eam # => ARGF.class (https://eval.in/382756)
[02:07:37] eam: what an odd implementation
[02:08:08] RickHull: ARGF is definitely a weirdo
[02:08:23] eam: it's weird in perl too
[02:08:46] mdz_: has joined #ruby
[02:08:59] RickHull: i don't see ARGF.replace
[02:09:13] RickHull: e.g. http://ruby-doc.org/core-2.1.1/ARGF.html
[02:09:19] justintv90: has joined #ruby
[02:09:44] eam: oh, I misread
[02:09:49] eam: that's a bummer
[02:10:20] eam: RickHull: but, whatever arg parser you're using should give you an array of what's left
[02:10:29] RickHull: oh, good call
[02:10:33] RickHull: ARGV.replace opts.arguments
[02:10:40] eam: yeah something like that
[02:10:45] _seanc_: has joined #ruby
[02:10:53] RickHull: thanks, i think that's it!
[02:11:37] RickHull: funnily enough, i would not have figured out ARGV.replace without your prompting ;)
[02:12:03] RickHull: otherwise i was trying to figure out how to make ARGF operate on opts.arguments
[02:12:16] eam: my eyes saw ARGF since that's the doc I was reading and I was like "how odd, what class is that, that's a descriptor kinda, but with #replace"
[02:12:21] eam: I'm still not sure what kind of class it is
[02:13:03] RickHull: some perlisms are best not questioned. the answer may raise more questions than it's worth ;)
[02:16:18] RazorX: has joined #ruby
[02:19:02] cj: how do I cat the value in a variable to a file with ruby?
[02:20:39] havenwood: cj: File.write 'example.txt', value
[02:20:42] tkuchiki_: has joined #ruby
[02:21:39] havenwood: cj: http://ruby-doc.org/core/IO.html#method-c-write
[02:21:49] drocsid: has joined #ruby
[02:21:57] eam: >> %w{perlisms can be neat, for example finding the words between the two words}.select {|x| true if (x == "for")..(x == "words") }
[02:21:58] ruboto: eam # => ["for", "example", "finding", "the", "words"] (https://eval.in/382759)
[02:22:18] datanoise: has joined #ruby
[02:22:41] havenwood: eam: Some sort of pseudo-IO Object that's neither a Module nor a Class. :O
[02:23:07] eam: it tells me it's a class, but yeah how would I work with that name?
[02:23:27] havenwood: >> ARGF.is_a? Class
[02:23:28] ruboto: havenwood # => false (https://eval.in/382760)
[02:23:41] havenwood: >> ARGF.instance_of? Class
[02:23:41] ruboto: havenwood # => false (https://eval.in/382761)
[02:23:43] eam: >> ARGF.class
[02:23:43] ruboto: eam # => ARGF.class (https://eval.in/382762)
[02:24:21] imperator: has joined #ruby
[02:25:02] eam: >> RealClassName = ARGF.class; class RealClassName; def stuff; "hello world"; end; end; ARGF.stuff
[02:25:03] fujimura: has joined #ruby
[02:25:03] ruboto: eam # => "hello world" (https://eval.in/382763)
[02:26:43] eam: I can't imagine why it would be special like that
[02:27:27] mattp_: has joined #ruby
[02:29:03] endash: has joined #ruby
[02:29:49] krisquigley: has joined #ruby
[02:30:11] zenguy_pc: has joined #ruby
[02:31:25] imperator: havenwood, don't suppose you know C do you?
[02:31:46] darkf: has joined #ruby
[02:32:27] havenwood: imperator: probably not enough to be of use, whatcha asking about?
[02:32:42] imperator: https://github.com/djberg96/win32-xpath/issues/1
[02:34:35] sross07: has joined #ruby
[02:35:33] stardiviner: has joined #ruby
[02:36:10] iamninja: has joined #ruby
[02:39:27] araujo_: has joined #ruby
[02:40:39] jxpx777: has joined #ruby
[02:40:54] aeze: has joined #ruby
[02:44:44] havenwood: imperator: So `expected 'const wchar_t * __restrict__' but argument is of type 'unsigned int'` then it blows up on?: (wchar_t*)ruby_xmalloc(MAX_WPATH);
[02:46:21] revath: has joined #ruby
[02:46:38] arescorpio: has joined #ruby
[02:47:57] havenwood: imperator: Yeah, I dunno. O.o?
[02:47:57] zenspider: >> def ARGF.woot; p :woot!; end; ARGF.woot
[02:47:58] ruboto: zenspider # => :woot! ...check link for more (https://eval.in/382764)
[02:48:46] Yiota: has joined #ruby
[02:51:51] failshell: has joined #ruby
[02:51:56] nonparfumee: has joined #ruby
[02:54:54] ellisTAA: has joined #ruby
[02:55:07] quazimodo: I need to find a memory leak in one of our prod servers
[02:55:59] quazimodo: rbtrace -p 97967 -e 'load "/Users/robertmatesic/Projects/rails/randwick/scripts/heap_dump.rb"' <- always hangs
[02:56:05] imperator: havenwood, looks to me like it's choking on https://github.com/djberg96/win32-xpath/blob/master/ext/win32/xpath.c#L59
[02:56:12] sevenseacat: I hope the guys can help you.
[02:57:13] quazimodo: heap dump looks like
[02:57:18] quazimodo: https://gist.github.com/siassaj/a82ec6a64d692f8f1140
[02:57:19] drewo: has joined #ruby
[02:57:31] quazimodo: that thread executes just fine if I do ruby -e
[02:57:38] quazimodo: but rbtrace, no matter what, hangs
[02:57:42] tkuchiki_: has joined #ruby
[02:58:14] quazimodo: anyone savvy on this?
[02:58:55] GPrime: has joined #ruby
[02:59:09] quazimodo: rbtrace -p 97967 -e "puts 'hi';" does work
[03:00:06] quazimodo: rbtrace -p 97967 -e "puts 'hi'; puts 'hi'; puts 'hi'; <- hangs
[03:00:11] _gautam_: has joined #ruby
[03:00:22] zenspider: are you requiring rbtrace in the production server process?
[03:00:44] corehook: has joined #ruby
[03:01:15] tvw: has joined #ruby
[03:01:23] quazimodo: zenspider: not sure, let me see
[03:01:46] quazimodo: zenspider: no
[03:01:56] quazimodo: am I meant to?
[03:02:16] zenspider: I don't think it is possible to just magically connect to a pid and know what its doing
[03:02:19] pl1ght: has joined #ruby
[03:02:27] zenspider: look at the doco on https://github.com/tmm1/rbtrace
[03:02:34] bb010g: has joined #ruby
[03:03:23] fujimura: has joined #ruby
[03:04:48] lkba_: has joined #ruby
[03:04:49] jxpx777: has joined #ruby
[03:07:08] yfeldblum: has joined #ruby
[03:07:08] pontiki: has joined #ruby
[03:08:05] revath: has joined #ruby
[03:08:43] Randroid: has joined #ruby
[03:08:46] dwithers: has joined #ruby
[03:08:56] bootstrappm: has left #ruby: ()
[03:09:31] Zackio: has joined #ruby
[03:09:42] djbkd: has joined #ruby
[03:09:51] Cache_Money: has joined #ruby
[03:09:58] Cust0sLim3n: has joined #ruby
[03:09:59] quazimodo: ok its included now
[03:10:19] Randroid: has left #ruby: ()
[03:10:32] psye: has joined #ruby
[03:11:00] Randroid: has joined #ruby
[03:11:42] braincrash: has joined #ruby
[03:12:06] hahuang65: has joined #ruby
[03:12:12] Randroid: has left #ruby: ()
[03:12:13] pyon: has joined #ruby
[03:12:16] imperator: ACTION doesn't get what it doesn't like
[03:12:40] Randroid: has joined #ruby
[03:13:10] Randroid: has left #ruby: ()
[03:14:06] dwithers1: has joined #ruby
[03:14:26] Randroid: has joined #ruby
[03:15:12] cirn0: has joined #ruby
[03:16:06] Randroid: has left #ruby: ()
[03:16:27] Randroid: has joined #ruby
[03:17:31] Randroid: has left #ruby: ()
[03:17:33] zenspider: imperator: what's up?
[03:18:08] imperator: zenspider, not much, just trying to figure out why devkit hates my swprintf :)
[03:18:11] imperator: what you up to?
[03:18:32] zenspider: trying to write a new language compiler in scheme :)
[03:19:28] krz: has joined #ruby
[03:19:34] gianlucadv: has joined #ruby
[03:20:34] bruno-: has joined #ruby
[03:21:25] imperator: alrighty then ;)
[03:21:48] zenspider: it's going fine, I just don't understand the runtime's load path system
[03:22:07] zenspider: ie, the language part is REALLY clean and easy... making it go? not so much
[03:24:06] zenspider: ah. ok. figured it out. painfully
[03:25:05] corehook: has joined #ruby
[03:25:06] quazimodo: is the following statement correct: on a single cpu machine, ruby threads behave as most any other languages threads?
[03:25:27] quazimodo: but on a machine with more cpus, then MRI ruby's threading is severly limited
[03:26:36] zenspider: I don't bother with such BS
[03:26:43] workmad3: has joined #ruby
[03:27:29] arup_r: has joined #ruby
[03:27:53] krz: has joined #ruby
[03:28:14] jwaldrip: has joined #ruby
[03:31:22] imperator: quazimodo, https://ninefold.com/blog/2014/11/25/threads/
[03:33:01] zenspider: yet another website I have to close because they pop up over the text I'm trying to read. GAWD I hate this stupid trend
[03:33:39] Yiota: has joined #ruby
[03:33:48] fedexo: has joined #ruby
[03:34:27] at0m: has joined #ruby
[03:35:39] at0m: can anyone tell me actually what does the eval do in ruby.. thanks
[03:35:49] tkuchiki_: has joined #ruby
[03:36:17] sevenseacat: evaluates code.
[03:36:43] at0m: can i say it can only used in metaprogramming
[03:36:49] shevy: at0m it interpretes what you pass it in like eval "5+5"
[03:37:01] shevy: which will give you back 10
[03:37:09] Cache_Money: has joined #ruby
[03:37:39] mdz_: has joined #ruby
[03:37:50] at0m: how is block differ from method and function?
[03:37:57] shevy: dunno if it is used only in metaprogramming alone ... take irb
[03:38:09] shevy: it has the file called workspace.rb, among other files, with content such as: @binding = eval("proc{binding}.call",
[03:38:41] shevy: blocks are like an additional optional/free argument you can get for every method
[03:39:08] shevy: they are used in e. g. File.open() {} to close the file handle again after you finished manipulating that file
[03:39:12] at0m: then why we not only use block why method?
[03:41:20] Rollabunna: has joined #ruby
[03:41:47] shevy: can you rephrase that question
[03:41:51] shevy: I am unsure what you are asking
[03:42:04] shevy: a block is associated with a method
[03:42:08] shevy: do you see the {} ?
[03:42:20] shevy: File.open() <--- this is the method {} <--- this is the associated block for that method
[03:42:37] at0m: means why we not only use block , since block and method can do same piece of work.
[03:42:45] nitenq: has joined #ruby
[03:42:46] shevy: that does not make sense?
[03:42:50] shevy: "only use block"
[03:42:51] Oog: has joined #ruby
[03:42:56] shevy: how can you use it without the method?
[03:43:13] at0m: ohooo i got it.
[03:43:19] shevy: even proc/lambdas have a method called .call()
[03:43:22] at0m: it was little misconception
[03:43:46] shevy: blocks just give you additional flexibility
[03:43:51] shevy: you don't have to use them if you don't like them
[03:45:07] at0m: shevy can you give little introduction of yield. and how's differ from lambda
[03:45:09] krz: has joined #ruby
[03:45:13] kfpratt: has joined #ruby
[03:45:32] at0m: i know that by using yield our code become shot.. but i want something more/
[03:45:59] shevy: forget about lambdas here
[03:46:06] shevy: with yield you only access the content of a block. that's it
[03:46:18] gix: has joined #ruby
[03:46:28] shevy: I think you need to test it with code
[03:46:41] at0m: and lambda?
[03:46:50] shevy: at0m look here for yield: http://apidock.com/ruby/Kernel/block_given%3F
[03:46:53] shevy: understand yield first
[03:47:26] shevy: lambda, dunno... you have to ask someone who uses them. I still try to find a compelling use case where I need to use them, and where they fit into the rest of my code; you can grep through the source of rack though, rack makes use of lambdas/procs a lot
[03:47:54] shock_one: has joined #ruby
[03:49:03] bigkevmcd: has joined #ruby
[03:49:32] attlasbot: has joined #ruby
[03:50:07] at0m: shevy: i have gone through tut. of code acedmy but when sometimes i start thinking those thing i got confused??
[03:50:28] at0m: it seems all are doing same thing..
[03:50:35] tkuchiki_: has joined #ruby
[03:50:38] shevy: you just have to use them in code
[03:50:56] shevy: lambda/procs are almost the same yes; difference being in regards to mandatory versus non-mandatory arguments
[03:51:13] shevy: and a block, now that's different right? it's attached to a method
[03:51:53] at0m: i am talking about whole cocept of ruby. it is easy but i don't know how to get it in heart all concept
[03:52:16] shevy: yeah there are lots of concepts
[03:52:21] CpuID: has joined #ruby
[03:52:22] shevy: you should use what you like
[03:52:31] shevy: do you have to know all about lambdas?
[03:53:08] Scroff: has joined #ruby
[03:53:13] serivich: has joined #ruby
[03:53:21] at0m: i got lambda thanks
[03:53:26] jxpx777: has joined #ruby
[03:53:46] shevy: so you understand lambdas
[03:53:48] shevy: but not blocks
[03:53:50] shevy: that is weird :)
[03:55:34] at0m: no no i have gone through both and i think i didn't understand anyone of them at that time.
[03:55:54] Usaur: has joined #ruby
[04:01:09] balazs: has joined #ruby
[04:02:42] snockerton: has joined #ruby
[04:02:52] Channel6: has joined #ruby
[04:03:05] ozialien: has joined #ruby
[04:06:56] uris: has joined #ruby
[04:06:59] Pisuke: has joined #ruby
[04:07:01] bronson: has joined #ruby
[04:12:44] aridere: has joined #ruby
[04:12:52] balazs: has joined #ruby
[04:15:15] bronson: has joined #ruby
[04:18:39] zenspider: blocks/procs are lovely, but they definitely take some getting used to
[04:18:45] krisquigley: has joined #ruby
[04:18:45] pragmatism: has joined #ruby
[04:18:59] jwaldrip: has joined #ruby
[04:25:29] dwithers2: has joined #ruby
[04:27:08] CloCkWeRX: has joined #ruby
[04:27:30] dwithers3: has joined #ruby
[04:28:41] CloCkWeRX1: has joined #ruby
[04:30:41] kahuna_: has joined #ruby
[04:30:45] dwithers4: has joined #ruby
[04:30:49] skade: has joined #ruby
[04:31:45] krz: has joined #ruby
[04:32:28] chris1: has joined #ruby
[04:32:35] dwithers: has joined #ruby
[04:35:27] northfurr: has joined #ruby
[04:38:10] digifiv5e: has joined #ruby
[04:38:21] davedev24: has joined #ruby
[04:39:28] jesterfraud_work: has joined #ruby
[04:39:36] jesterfraud_work: what's the pattern behind generating hooks?
[04:40:02] jesterfraud_work: I have a module I include that I want to change the behaviour in one model, but it's an additive change, so I figure a hook is probably the most DRY way to do it
[04:40:09] yfeldblum: has joined #ruby
[04:40:33] failshell: has joined #ruby
[04:42:06] jesterfraud_work: I want a pre-method hook
[04:42:17] jesterfraud_work: or a post-method, haven't decided yet, but I figure it'd be really similar
[04:44:01] RegulationD: has joined #ruby
[04:47:28] revath: has joined #ruby
[04:47:39] saadq: has joined #ruby
[04:48:15] otherj: has joined #ruby
[04:48:50] jesterfraud_work: I've done this, any feedback? https://gist.github.com/anonymous/d396bc7b4e92177e9de0
[04:48:50] aeze: has joined #ruby
[04:49:10] ZergCoder: has joined #ruby
[04:49:49] shevy: hooks are weird
[04:50:20] shevy: I am still trying to understand them but it did not yet make click for me :( http://www.sitepoint.com/hitchhikers-guide-to-metaprogramming-classmodule-hooks/
[04:52:41] jesterfraud_work: shevy: I'm trying to build my own
[04:52:49] jesterfraud_work: it didn't succeed, either, those are instance methods
[04:55:42] imperator: jesterfraud_work, perhaps https://github.com/deleteman/Conditionator ?
[04:58:06] Oog: has joined #ruby
[04:58:43] Hanmac: has joined #ruby
[04:59:54] northfurr: has joined #ruby
[05:01:07] imperator: i thought ruby-core was going to add some kind of support for that at some point, but i don't know if they ever did
[05:03:26] krz: has joined #ruby
[05:03:46] ottlikg: has joined #ruby
[05:04:38] jenrzzz: has joined #ruby
[05:06:05] Cust0sLim3n: has joined #ruby
[05:06:08] shock_one: has joined #ruby
[05:06:41] Spami: has joined #ruby
[05:06:44] konsolebox: has joined #ruby
[05:08:13] volsus: has joined #ruby
[05:08:35] yeticry: has joined #ruby
[05:11:28] tkuchiki_: has joined #ruby
[05:13:55] tkuchiki_: has joined #ruby
[05:14:38] closer: has joined #ruby
[05:15:12] j4cknewt: has joined #ruby
[05:15:30] workmad3: has joined #ruby
[05:16:02] datanoise: has joined #ruby
[05:16:28] coffee__cup: has joined #ruby
[05:21:59] closer: has joined #ruby
[05:24:37] revath: has joined #ruby
[05:24:52] Deck-: has joined #ruby
[05:26:38] rht: has joined #ruby
[05:26:53] Deck-: has joined #ruby
[05:27:15] tkuchiki_: has joined #ruby
[05:27:38] neanderslob: has joined #ruby
[05:28:58] ramfjord: has joined #ruby
[05:29:25] agilenav: has joined #ruby
[05:30:27] aganov: has joined #ruby
[05:32:00] agilenav: has joined #ruby
[05:32:42] agilenav: has joined #ruby
[05:38:24] tagrudev: has joined #ruby
[05:39:51] konsolebox: has joined #ruby
[05:40:42] neanderslob: has joined #ruby
[05:41:27] Deck-: has joined #ruby
[05:41:29] neanderslob_: has joined #ruby
[05:41:59] shevy: flughafen!
[05:42:13] Rollabunna: has joined #ruby
[05:42:15] shevy: will today be the day of great flights to happen?
[05:43:39] dhruvsrivastava: has joined #ruby
[05:45:14] shock_one: has joined #ruby
[05:45:21] alex88: has joined #ruby
[05:45:44] DoubleMalt: has joined #ruby
[05:47:51] flughafen: shevy: there will be no flughafening todayu
[05:51:16] balazs: has joined #ruby
[05:51:23] Xeago: has joined #ruby
[05:52:49] agent_white: has joined #ruby
[05:53:12] sandstrom: has joined #ruby
[05:55:20] swgillespie: has joined #ruby
[05:57:36] crankharder: has joined #ruby
[05:58:03] michaeldeol: has joined #ruby
[06:01:02] ascarter: has joined #ruby
[06:01:03] chussenot: has joined #ruby
[06:01:54] chinmay_dd: has joined #ruby
[06:02:15] arup_r: has joined #ruby
[06:02:32] last_staff: has joined #ruby
[06:03:33] certainty: yow flughafen
[06:04:30] corehook: has joined #ruby
[06:05:45] x0F: has joined #ruby
[06:06:14] revath: has joined #ruby
[06:06:54] yardenbar: has joined #ruby
[06:06:54] konsolebox: has joined #ruby
[06:07:36] krisquigley: has joined #ruby
[06:07:51] flughafen: hows' ti going certainty
[06:07:55] corehook: has joined #ruby
[06:07:55] flughafen: i wrote ruby last night!
[06:08:13] anisha: has joined #ruby
[06:08:41] certainty: flughafen: not too bad. I didn't write ruby in week now
[06:08:47] certainty: puppet doesn't count
[06:08:50] attlas__bot: has joined #ruby
[06:09:02] certainty: actually i didn't do any programming xD
[06:09:16] davedev24_: has joined #ruby
[06:09:50] flughafen: are you going to have to do any python with salt
[06:09:51] certainty: that sucks :)
[06:10:21] certainty: flughafen: likely. At least for orchestration it's almost in here. I'd like to do the entire shift and do CM as well
[06:10:32] certainty: i have to talk some more though to make it happen
[06:11:28] corehook: has joined #ruby
[06:11:39] certainty: also i'd love to work further on the matasano challenges. Too few time :(
[06:13:23] MatthewsFace: has joined #ruby
[06:13:49] AndroidLoverInSF: has joined #ruby
[06:15:27] atomi: has joined #ruby
[06:16:13] flughafen: i haven't looked at those
[06:16:40] certainty: i only started. I had them on my list for a while and finally got around to actually start
[06:16:45] certainty: i'm doing them in haskell though
[06:16:47] certainty: http://cryptopals.com/
[06:17:25] keen__________: has joined #ruby
[06:18:10] revath: has joined #ruby
[06:18:19] quazimodo: do we have a 'object orientation design' channel in irc?
[06:18:24] coffeecup__: has joined #ruby
[06:18:29] quazimodo: where I can ask about abstract patterns and idesa
[06:18:29] flughafen: i don't think so?
[06:18:32] AndroidLoverInSF: has joined #ruby
[06:18:45] quazimodo: whether or not the ideas scale well etc
[06:18:51] quazimodo: I need to find a pro
[06:19:07] quazimodo: someone to mentor me *without* violating my trust with sexual harassment later
[06:19:13] atomi: has joined #ruby
[06:20:09] mike___1234: has joined #ruby
[06:20:30] unshadow: has joined #ruby
[06:20:30] certainty: i don't even
[06:20:57] sevenseacat: that was entirely irrelevant.
[06:21:59] ramfjord: has joined #ruby
[06:22:01] atomi: has joined #ruby
[06:22:06] skysploit: has joined #ruby
[06:25:12] flughafen: my package is still at dhl....
[06:25:16] flughafen: for mroe than a week now
[06:25:24] shevy: flughafen it's time to move on to new adventures
[06:25:35] shevy: so the airport failed. let's build something grand else
[06:25:37] sevenseacat: maybe theyre waiting for you to fly it to yourself.
[06:28:47] sinkensabe: has joined #ruby
[06:29:14] flughafen: i'm tempted to just go get it myself, but from what I heard from a coworker, the place has no customer thing for me to pick it up
[06:29:23] failshell: has joined #ruby
[06:30:14] Cust0sLim3n: has joined #ruby
[06:31:48] shevy: simply go through the backdoor
[06:32:45] RegulationD: has joined #ruby
[06:33:54] sandelius: has joined #ruby
[06:34:50] kiki_lamb: has joined #ruby
[06:35:25] corehook: has joined #ruby
[06:35:39] balazs: has joined #ruby
[06:35:40] allomov: has joined #ruby
[06:36:01] imperator: oh, hell, mingw has some sort of non-conforming version of swprintf
[06:37:06] freezevee: has joined #ruby
[06:38:05] gluten_hell_: has joined #ruby
[06:38:14] freezevee: how do you keep settings in a separate file ? For example If you want to save 100 links, its titles and the language of the websites, is it sane to save them in a module as constant Hashes or yaml files ?
[06:38:41] sevenseacat: seems like thats what a database would be for
[06:39:37] neanderslob: has joined #ruby
[06:39:40] solars: has joined #ruby
[06:39:43] shevy: freezevee you can keep it in a Hash, and then save it in a yaml file
[06:40:29] shevy: freezevee, for instance: YOUR_YAML_FILE_HERE = 'bla.yml'; File.open(YOUR_YAML_FILE_HERE, "w") {|f| YAML.dump(your_hash_data_here, f) }
[06:40:45] freezevee: shevy: what is more common ? I did it with a config.rb file and calling them as Config::Links::GOOGLE[:url] for example
[06:40:52] psye: has joined #ruby
[06:41:08] shevy: how do you update config.rb
[06:41:16] freezevee: sevenseacat: 100 was a brave number, I am only having 10 of them
[06:41:27] roolo: has joined #ruby
[06:41:37] freezevee: shevy: what do you mean? it's simple RSS feeds so I am not going to update them all the time
[06:41:39] shevy: sevenseacat keeps a database of mice in the environment
[06:42:07] shevy: freezevee I have no idea what you mean. I don't think I ever updated a .rb file dynamically in such a way
[06:42:46] GnuYawk: has joined #ruby
[06:42:47] GnuYawk: has joined #ruby
[06:42:56] freezevee: shevy: I don't need to update it
[06:43:14] Scroff: has joined #ruby
[06:43:15] shevy: if you hardcoded it anyway then you can just keep it in a .rb file
[06:43:19] shevy: *hardcode
[06:43:20] AnoHito_: has joined #ruby
[06:43:57] Paradox: has joined #ruby
[06:44:52] datanoise: has joined #ruby
[06:45:47] freezevee: shevy: the application is a simple RSS parser, meaning that ruby fetches the RSS data and then I display them on a simple html
[06:45:53] freezevee: a fun project
[06:46:56] freezevee: shevy: so I am looking for somewhere to save 10 links with a title and a language, like GOOGLE = { title: "Google", url: "http://...", lang: "en" }
[06:47:07] jenrzzz: has joined #ruby
[06:47:07] shevy: yes, a hash you have there
[06:47:21] freezevee: and I am reading that either yaml or an .rb module is the same
[06:47:21] tkuchiki_: has joined #ruby
[06:47:28] alex88: has joined #ruby
[06:47:36] shevy: ruby needs to put the yaml data into ruby data anyway
[06:47:50] kiki_lamb: has joined #ruby
[06:48:16] freezevee: shevy: what is more common in these situations ? I've seen only Rails where there are database.yml and other .yml files for configurations
[06:48:49] freezevee: shevy: it works as a module but should I leave it as is or change it to yaml ?
[06:48:56] Rubie: has joined #ruby
[06:48:58] freezevee: I am just looking for the best practice
[06:49:00] fabrice31: has joined #ruby
[06:49:08] freezevee: to use now and on future projects
[06:49:25] ReK2: has joined #ruby
[06:49:25] ReK2: has joined #ruby
[06:49:54] ndrei: has joined #ruby
[06:51:31] shevy: you are putting so much thought into this
[06:51:38] shevy: put the stuff into a .rb file
[06:51:40] shevy: end of story
[06:51:46] ruboto: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[06:52:25] edwinvdgraaf: has joined #ruby
[06:52:33] shevy: for my larger projects, I tend to have a directory called configuration/
[06:52:35] drewo: has joined #ruby
[06:52:42] shevy: where every individual user-togglable option becomes a yaml file
[06:52:52] shevy: base_dir.yml
[06:52:57] shevy: or something like that
[06:53:06] strixd: has joined #ruby
[06:53:30] shock_one: has joined #ruby
[06:53:39] auzty: has joined #ruby
[06:54:00] strixd: has joined #ruby
[06:54:58] strixd: has joined #ruby
[06:55:06] yaw: has joined #ruby
[06:55:15] pyon: has joined #ruby
[06:55:18] svoop: has joined #ruby
[06:56:52] freezevee: shevy: all right
[06:56:56] rdark: has joined #ruby
[06:58:40] chussenot: has joined #ruby
[06:59:19] araujo: has joined #ruby
[07:01:09] Oog: has joined #ruby
[07:03:49] Tolnaiz: has joined #ruby
[07:04:02] j4cknewt: has joined #ruby
[07:04:16] workmad3: has joined #ruby
[07:05:33] kalusn: has joined #ruby
[07:05:47] Tolnaiz: has left #ruby: ("["Textual IRC Client: www.textualapp.com"]")
[07:05:50] skade: has joined #ruby
[07:05:59] langlands: has joined #ruby
[07:06:15] hubcaps: has joined #ruby
[07:07:27] edwinvdgraaf: has joined #ruby
[07:09:01] AlexRussia: has joined #ruby
[07:09:54] fabrice31: has joined #ruby
[07:13:04] dmolina: has joined #ruby
[07:13:28] krz: has joined #ruby
[07:14:54] quazimodo: Leaked 12790 STRING objects of size 99558/39688 at: /Users/robertmatesic/.rvm/gems/ruby-2.1.5/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql/database_statements.rb:168
[07:14:58] quazimodo: is that worrying
[07:16:41] quazimodo: that happened in about 3 minutes
[07:17:09] apeiros: how is that size information supposed to be read? o0
[07:17:20] shevy: your objects try to break free
[07:18:10] Iskarlar: has joined #ruby
[07:18:34] apeiros: if they're truly leaked, I'd say this is worrying, yes. question is whether the tool you use is correct.
[07:19:15] andikr: has joined #ruby
[07:22:17] Tolnaiz: has joined #ruby
[07:23:25] dhjondoh: has joined #ruby
[07:25:00] Zai00: has joined #ruby
[07:25:12] nitenq: has joined #ruby
[07:25:55] ta: has joined #ruby
[07:26:15] antgel: has joined #ruby
[07:26:22] alex88: has joined #ruby
[07:27:22] msgodf: has joined #ruby
[07:27:22] unshadow: has joined #ruby
[07:27:42] Mon_Ouie: has joined #ruby
[07:27:50] livathinos: has joined #ruby
[07:28:35] sinkensabe: has joined #ruby
[07:29:15] k3asd`: has joined #ruby
[07:29:55] ylla: has joined #ruby
[07:31:12] konsolebox: has joined #ruby
[07:31:35] quazimodo: apeiros: yep
[07:31:47] quazimodo: apeiros: we ran GC.start prior to dumping the heap several times
[07:32:07] jenrzzz: has joined #ruby
[07:32:10] quazimodo: not sure what tool analysed the heap dumps
[07:32:30] quazimodo: i find it very strange that samething like postgresql database_statements file would have a leak
[07:32:39] quazimodo: something so wel tested
[07:32:44] quazimodo: prolific etc
[07:32:55] svoop: has joined #ruby
[07:33:13] yfeldblum: has joined #ruby
[07:33:35] rbowlby: has joined #ruby
[07:34:07] RickHull: has left #ruby: ()
[07:35:37] yfeldblum: has joined #ruby
[07:35:51] MatthewsFace: has joined #ruby
[07:36:21] svoop: has joined #ruby
[07:37:43] sinkensabe: has joined #ruby
[07:37:46] yfeldblum: has joined #ruby
[07:38:56] fusillicode: has joined #ruby
[07:38:58] fusillicode: has left #ruby: ()
[07:40:12] sandstrom: has joined #ruby
[07:40:52] apeiros: quazimodo: indeed
[07:41:36] tkuchiki_: has joined #ruby
[07:41:50] shredding: has joined #ruby
[07:42:53] corehook: has joined #ruby
[07:42:58] edwinvdgraaf: has joined #ruby
[07:43:14] Rollabunna: has joined #ruby
[07:43:27] nitenq: has left #ruby: ()
[07:43:36] sandstrom: has joined #ruby
[07:46:33] Scroff: has joined #ruby
[07:50:14] Rubie: has joined #ruby
[07:50:33] sinkensabe: has joined #ruby
[07:52:31] Randroid: has joined #ruby
[07:52:38] fabrice31_: has joined #ruby
[07:53:36] fabrice31: has joined #ruby
[07:56:35] krisquigley: has joined #ruby
[07:57:39] sinkensabe: has joined #ruby
[07:58:32] chussenot: has joined #ruby
[07:58:53] Forgetful_Lion: has joined #ruby
[07:59:10] allomov: has joined #ruby
[07:59:25] senayar: has joined #ruby
[08:00:17] LMity: has joined #ruby
[08:00:36] bayed: has joined #ruby
[08:01:29] fusillicode: has joined #ruby
[08:01:32] fusillicode: has left #ruby: ()
[08:01:40] mikecmpbll: has joined #ruby
[08:03:50] konieczkow: has joined #ruby
[08:05:04] jenrzzz: has joined #ruby
[08:05:06] haxrbyte: has joined #ruby
[08:05:28] codecop: has joined #ruby
[08:05:28] codecop_: has joined #ruby
[08:08:04] Stan: has joined #ruby
[08:09:13] bruno-: has joined #ruby
[08:09:21] yqt: has joined #ruby
[08:09:41] msgodf: has joined #ruby
[08:09:51] skade: has joined #ruby
[08:10:12] yqt: has joined #ruby
[08:10:23] revath: has left #ruby: ()
[08:12:18] simplyianm: has joined #ruby
[08:13:27] senayar: has joined #ruby
[08:13:59] Hounddog: has joined #ruby
[08:15:50] shevy: trying to compare languages and productivity is very hard
[08:16:58] Scroff: has joined #ruby
[08:17:42] Iskarlar: has joined #ruby
[08:18:06] failshell: has joined #ruby
[08:18:13] michael_mbp: has joined #ruby
[08:18:28] doerteDev: has joined #ruby
[08:18:31] yaw: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[08:18:44] chinmay_dd: has joined #ruby
[08:19:03] Caius: has joined #ruby
[08:19:10] bruno-: has joined #ruby
[08:20:54] bmalum: has joined #ruby
[08:21:39] RegulationD: has joined #ruby
[08:21:51] w1xz: has joined #ruby
[08:22:04] shevy: like trying to clone mediawiki or phpBB
[08:23:09] charliesome: has joined #ruby
[08:23:21] tomphp: has joined #ruby
[08:24:33] quimrstorres: has joined #ruby
[08:25:37] maxshelley: has joined #ruby
[08:26:12] lkba: has joined #ruby
[08:26:21] x44x45x41x4E: has joined #ruby
[08:27:15] dfockler: has joined #ruby
[08:27:16] TheHodge: has joined #ruby
[08:28:16] Iskarlar: has joined #ruby
[08:28:57] dmolina: has joined #ruby
[08:29:02] agent_white: has joined #ruby
[08:29:57] fabrice31: has joined #ruby
[08:30:19] konieczkow: has joined #ruby
[08:31:44] dumdedum: has joined #ruby
[08:31:57] dmolina: has left #ruby: ()
[08:35:52] atomx: has joined #ruby
[08:36:01] atomx: hello what is the process of getting jruby for linux
[08:36:07] atomx: hello what is the process of getting jruby for linux
[08:36:36] ljarvis: atom_: http://jruby.org/getting-started
[08:36:59] atomx: there only i get the package to download when typed jruby -v it says not found?
[08:37:25] ljarvis: you installed it?
[08:37:27] apeiros: "Run JRuby: The JRuby startup script lives in the "bin" directory. Run "bin/jruby -v" to confirm it."
[08:37:32] shock_one: has joined #ruby
[08:37:40] apeiros: I mean??? it stands like *right fing there*
[08:37:56] allomov: has joined #ruby
[08:38:12] aapole: has joined #ruby
[08:38:37] krz: has joined #ruby
[08:38:39] chussenot: has joined #ruby
[08:38:42] apeiros: but I guess reading a 3 step guide is just 2 steps too much???
[08:39:18] ljarvis: it's a lot of steps to try and keep concentration
[08:39:32] yorickpeterse: ad hominem ad hominem ad hominem!
[08:39:48] atomx: i used sudo apt-get jruby
[08:40:12] KrzaQ: has joined #ruby
[08:40:25] Pupeno: has joined #ruby
[08:40:38] atomx: to install
[08:40:51] atomx: i think that packge is for linux
[08:40:57] ljarvis: you think?
[08:41:06] yorickpeterse: ljarvis: most distros actually ship jruby
[08:41:10] ljarvis: where did you get that idea? did you read it? did you just guess it?
[08:41:15] ljarvis: yorickpeterse: wot
[08:41:28] sevenseacat: do they ship it any better than they ship MRI ruby?
[08:41:31] atomx: ok then how to install it after download
[08:41:37] yorickpeterse: https://packages.debian.org/stable/ruby/jruby lol 1.5
[08:41:38] ljarvis: shots fired
[08:41:57] ljarvis: atom_: read the instructions
[08:42:03] fabrice31_: has joined #ruby
[08:42:07] ljarvis: it literally tells you exactly what to do
[08:42:23] yorickpeterse: 1.5 is from 2010
[08:42:30] ljarvis: impressive
[08:42:38] jhass: so stable
[08:42:49] undeadaedra: Debian, what did you expect?
[08:42:51] ljarvis: such up to date
[08:42:57] yorickpeterse: lol, even unstable has 1.5
[08:43:04] shevy: undeadaedra oh you have your old nick back again
[08:43:05] yorickpeterse: I suppose it's just not maintained because that _is_ pretty odd
[08:43:07] ljarvis: cutting edge
[08:43:16] shevy: debian is slow, we know that
[08:43:27] undeadaedra: shevy: "old". "adaedra" is the original one.
[08:43:28] yorickpeterse: Because they do have MRI 2.2
[08:43:37] jhass: https://www.archlinux.org/packages/community/any/jruby/ <3
[08:43:43] jcaho: has joined #ruby
[08:43:48] allomov: has joined #ruby
[08:43:51] atomx: m using ubuntu
[08:44:04] atomx: no archlinux
[08:44:11] corehook: has joined #ruby
[08:44:12] Scrofff: has joined #ruby
[08:44:25] langlands: has joined #ruby
[08:44:33] fabrice31_: has joined #ruby
[08:44:34] apeiros: `apt-get install jruby` installs a jruby for me just fine. but it's a horribly old version as yorickpeterse already pointed out
[08:44:52] undeadaedra: atom_: I don't think that was for you. Did you do what ljarvis gave you?
[08:44:57] apeiros: so IMO stick with that "getting started" page
[08:45:14] undeadaedra: https://svnweb.freebsd.org/ports/head/lang/jruby/ ??? 1.7.15 :(
[08:45:26] negev: has joined #ruby
[08:45:48] yorickpeterse: if only all distros would use a universal package manager and repository
[08:45:58] yorickpeterse: life would be a heck of a lot easier for us puny users
[08:46:05] nikhgupta: has joined #ruby
[08:46:17] jhass: philosophies are just too different
[08:46:43] yorickpeterse: You mean everybody thinks they're a special snowflake
[08:46:51] yorickpeterse: "ooooh nooo we're Canonical we can use our own fork of apt"
[08:46:56] negev: hi, i want to run ruby via apache. doesn't seem like there's a clean way to do this. don't want to run rails as my app is very very simple and rails is needless bloat. i'm currently using Erubis to execute the ruby scripts as cgi's, but struggling with basic issues like being able to pull in other scripts as subtemplates. can anyone point me at a more elegant solution?
[08:47:31] yorickpeterse: negev: typically ruby apps use Rack and have a proxy (apache/nginx) in front of it
[08:47:32] apeiros: negev: the common way to run ruby is via rack
[08:47:36] ljarvis: negev: the solution would be to use an app
[08:47:38] yorickpeterse: CGI is pretty rarely used nowadays
[08:47:47] apeiros: and via apache the common solution to run rack apps is passenger
[08:47:52] yorickpeterse: negev: http://rack.github.io/
[08:47:53] Siyfion: has joined #ruby
[08:48:23] yorickpeterse: hm, whatever happened to Rack 2.0? I recall reading ideas and what not about it a few years back
[08:48:38] krz: i have an array %w[a b c]. how do i replace a (the first element) with z? whts the best way to go about this?
[08:48:44] ljarvis: one can dream
[08:48:49] ljarvis: krz: foo[0] = 'z'
[08:48:52] bmalum: has joined #ruby
[08:50:05] maloik: yorickpeterse: no clue, maybe now is a good time to check with tenderlove about that considering the recent CVE
[08:50:18] maloik: I didn't read anything about it other than his gist or github issue
[08:50:21] marr: has joined #ruby
[08:50:50] davedev24_: has joined #ruby
[08:51:18] Abhijit: has joined #ruby
[08:52:59] workmad3: has joined #ruby
[08:53:25] yorickpeterse: I think the initial idea was from raggi IIRC
[08:54:48] ruby-lang478: has joined #ruby
[08:54:51] yorickpeterse: oh hrm, I think it was a secret gist
[08:54:53] yorickpeterse: so I can't find it
[08:55:19] maloik: yea I'm not sure about the history of it all, his gist was the only I read I think
[08:55:53] revath: has joined #ruby
[08:55:57] revath: has left #ruby: ()
[08:56:19] bluish: has joined #ruby
[08:57:30] yorickpeterse: in unrelated news, I hate the word "Serializable"
[08:57:32] yorickpeterse: it's a PITA to type
[08:57:52] nir0: has joined #ruby
[08:57:54] undeadaedra: lot of english words are a PITA to type
[08:58:29] yorickpeterse: "fuck" is pretty easy :D
[08:58:46] krz: ty ljarvis
[08:59:00] maloik: reminds me of that 'chaos' poem that was on HN the other day
[08:59:02] tedstriker: has joined #ruby
[08:59:10] yorickpeterse: "include Fuck" "The Fuck module does X and Y ...."
[08:59:17] DEA7TH: has joined #ruby
[08:59:26] maloik: (I know I know, it's a classic, but it was getting shared more because of HN)
[08:59:37] yorickpeterse: maloik: eh, which one?
[08:59:37] lkba_: has joined #ruby
[08:59:39] nir0: hi guys! how do i make a PATCH request? like Net::HTTP.post_form and Net::HTTP.get
[08:59:42] maloik: let me check
[09:00:02] nir0: Net::HTTP.patch results in NoMethod
[09:00:03] maloik: Internal Server Error
[09:00:03] platzhirsch: has joined #ruby
[09:00:20] Igorshp: has joined #ruby
[09:00:26] maloik: I guess HN broke it
[09:00:31] valkyrka: has joined #ruby
[09:01:02] maloik: aha here it is yorickpeterse: http://ncf.idallen.com/english.html
[09:01:02] Cust0sLim3n: has joined #ruby
[09:01:02] undeadaedra: ?? Engineering ?? is a hard one :(
[09:01:09] maloik: (you need to read it out loud)
[09:01:10] platzhirsch1: has joined #ruby
[09:01:19] apeiros: nir0: hm, Net::HTTP::Patch exists
[09:01:47] nir0: apeiros: right, but it needs to be chained i think like .new.patch
[09:01:52] maloik: what's super weird is that I actually know how to pronounce them, despite not being a native speaker
[09:01:58] apeiros: nir0: so I guess it's the long winded way - create an Net::HTTP::Patch request instance and use that with Net::HTTP
[09:02:26] tkuchiki_: has joined #ruby
[09:02:26] apeiros: nir0: no. let me find that example using a request object???
[09:03:18] apeiros: nir0: http://ruby-doc.org/stdlib-2.2.2/libdoc/net/http/rdoc/Net/HTTP.html - go to "How to use Net::HTTP"
[09:03:28] apeiros: there's an example code using Net::HTTP.start
[09:03:49] apeiros: instead of `request = Net::HTTP::Get.new uri`, you'd probably just `request = Net::HTTP::Patch.new uri ???`
[09:04:21] apeiros: ACTION loves the simple and easy-to-guess and -understand API of net/http</sarcasm>
[09:04:49] jenrzzz: has joined #ruby
[09:04:52] Outlastsheep: HTTP's a pain to work with in my experience.
[09:05:27] Outlastsheep: Especially in one of the rare cases where a request only works with specific languages and their libraries for no explicit reason.
[09:06:32] mikecmpb_: has joined #ruby
[09:07:01] arup_r: has joined #ruby
[09:07:11] nir0: apeiros: so req = Net::HTTP::Patch.new(uri)?
[09:07:23] alex88_: has joined #ruby
[09:07:32] apeiros: probably you want more arguments to it than just the URI
[09:07:58] fabrice31: has joined #ruby
[09:08:29] nir0: apeiros: sure, i'll try follow that
[09:08:52] apeiros: alternatively use another lib than net/http
[09:11:08] terlar: has joined #ruby
[09:11:11] yorickpeterse: https://github.com/nahi/httpclient is a decent library
[09:14:51] fabrice31: has joined #ruby
[09:15:27] Siyfion: has joined #ruby
[09:15:28] jhass: I like faraday, it's rack from the other side
[09:15:53] jhass: can just swap in whatever client lib works best
[09:15:54] yorickpeterse: We moved away from it due to a bunch of problems we had in the past
[09:16:12] yorickpeterse: lemme see what it actually was
[09:16:20] workmad3: has joined #ruby
[09:16:43] fabrice31_: has joined #ruby
[09:17:07] yorickpeterse: now if I could only remember the repository where I comitted by rant about Faraday
[09:17:51] yorickpeterse: would be nice if I could search Git commits across repositories on Github :/
[09:18:16] jhass: rantdatabase.com ... could be a fun project
[09:18:25] yorickpeterse: it's called twitter.com/yorickpeterse
[09:18:42] jhass: as if 140 chars is anywhere near enough
[09:18:58] stamina: has joined #ruby
[09:19:48] jhass: also fun stats! average amount of swear words, amount of hours invested into a project deemed wasted etc etc
[09:20:16] yoongkang: has joined #ruby
[09:20:40] undeadaedra: I also rant on twitter time to time. If I need more than 140 characters, I do multiple tweets.
[09:20:49] shevy: who is the major potty mouth on #ruby
[09:21:07] yorickpeterse: oh shoot, we actually still use Faraday in some places
[09:21:21] yorickpeterse: shevy: I had stats for this, don't think I ported them to my new website
[09:21:58] shevy: undeadaedra do you at least rant in french?
[09:22:05] yorickpeterse: they were generated using pistg
[09:22:06] alphaatom: has joined #ruby
[09:22:19] fujimura: has joined #ruby
[09:22:34] undeadaedra: to respond correctly, my twitter is in French, so I rant in French.
[09:22:51] undeadaedra: But now, I have a blog to rant in English and with as many characters as I want! \o/
[09:22:56] yorickpeterse: https://web.archive.org/web/20150101051627/http://downloads.yorickpeterse.com/irc-stats/ I guess this works
[09:23:11] yaw: has joined #ruby
[09:23:18] shevy: omg is this a psychedeliv kermit frog shaking it up
[09:23:22] shevy: *psychedelic
[09:23:27] apeiros: hypnotoad!
[09:23:57] apeiros: "Dates on this page are in the format %Y-%m-%d, I'll have none of your retarded US formats." <3
[09:23:58] shevy: oh naughty comments https://web.archive.org/web/20150104091930/http://downloads.yorickpeterse.com/irc-stats/ruby-lang.html
[09:23:59] fabrice31: has joined #ruby
[09:24:13] shevy: #7 apeiros "most core bang"
[09:24:35] shevy: that is from #ruby-lang ?
[09:24:35] jhass: apeiros's faithful follower, apeiros_, kicked about 13 people.
[09:24:42] shevy: yeah, double team
[09:24:59] apeiros: ACTION ^5 apeiros_
[09:25:07] senayar: has joined #ruby
[09:25:14] shevy: "workmad3 brings happiness to the world. 30.6% lines contained smiling faces."
[09:25:20] fantazo: has joined #ruby
[09:25:43] shevy: and analysis of smileys
[09:25:54] shevy: with a top ten of different smileys
[09:26:03] apeiros: "yorickpeterse is a very aggressive person. He/She attacked others 38 times" - unexpected :o)
[09:26:14] shevy: :) is by far the most popular smiley it seems
[09:26:16] yorickpeterse: that's /rslap for ya
[09:26:29] shevy: zenspider has a tendency to use ":/" smileys
[09:26:47] shevy: oh... apeiros uses the long smiley... ";-)"
[09:26:59] multi_io: has joined #ruby
[09:27:06] undeadaedra: we don't have stats in this channel?
[09:27:07] shevy: lol "apeiros is the channel sheriff with 58 deops."
[09:27:17] agent_white: smiley so just means to smiley is so big is goes off the page
[09:27:27] shevy: well, those stats were quite fun to read
[09:27:57] agent_white: ACTION fixes irc autocomplete
[09:28:02] yorickpeterse: https://gist.github.com/YorickPeterse/9ddf195600090077bfa8 <- the impact of replacing active_model_serializers
[09:28:10] apeiros: oh wow, apeiros+apeiros_ only make it to rank 4 anymore. success, I guess?
[09:28:20] apeiros: (I did want to cut back my irc time)
[09:28:25] yorickpeterse: no more activesupport \0/
[09:28:39] tekacs: has joined #ruby
[09:30:43] agent_white: Any fancy tui libraries to checkout? I used ncursesw last but wondering what's out there.
[09:31:07] znz_jp: has joined #ruby
[09:31:57] shevy: tui? terminal user interface?
[09:32:23] shevy: not sure... you know of highline already and io-console?
[09:32:40] shevy: I guess ncurses is as fancy as you can be hmm might be more projects based on it
[09:33:12] zotherstupidguy: has joined #ruby
[09:33:46] fabrice31: has joined #ruby
[09:34:06] agent_white: shevy: Yup I've checked out both! But yeah seems like the wrappers seem to be best.
[09:35:04] ljarvis: lol at those irc stats
[09:35:14] flughafen: i had problems getting ncurses to work well. i wanted an ncurses window for my cuucumber tests
[09:37:16] shevy: I hate the API
[09:37:37] shevy: it often is so that the API in ruby projects, based on C, is just a 1:1 direct mapper
[09:39:06] Rubie: has joined #ruby
[09:39:14] agent_white: shevy: Me too :( And that's why I wondered why there wasn't.
[09:39:25] agent_white: At least fix the coords to be cartesian!
[09:42:21] fabrice31_: has joined #ruby
[09:43:59] Rollabunna: has joined #ruby
[09:44:28] shevy: it's the same with ruby-gnome
[09:44:39] shevy: you can almost literally use the official C API docu as example
[09:44:49] shevy: feels like coding in C with a handicap :)
[09:45:30] krisquigley: has joined #ruby
[09:46:15] agent_white: Yeah exactly! :P
[09:46:31] ndrei: has joined #ruby
[09:46:32] lkba: has joined #ruby
[09:46:36] skade: has joined #ruby
[09:47:02] agent_white: I'd like to write a ncurses-like library for Ruby someday... even python has some terminal ui libraries out there!
[09:47:09] fabrice31: has joined #ruby
[09:47:23] arup_r: has joined #ruby
[09:48:44] nir0: has left #ruby: ()
[09:50:40] hackeron: has joined #ruby
[09:51:43] c0m0: has joined #ruby
[09:52:18] wasamasa: another one?
[09:53:06] wasamasa: https://www.ruby-toolbox.com/search?utf8=%E2%9C%93&q=curses
[09:53:39] shevy: lots of crap in that list
[09:53:59] shevy: tic-tac-toe
[09:54:40] fabrice31: has joined #ruby
[09:56:38] chthon: has joined #ruby
[09:56:54] ndrei: has joined #ruby
[09:57:10] flughafen: i want a terminal version of crysis
[09:57:14] fusillicode: has joined #ruby
[09:57:16] fusillicode: has left #ruby: ()
[09:57:58] s2013: has joined #ruby
[09:59:16] skade: has joined #ruby
[09:59:37] platzhirsch1: flughafen: what a name
[09:59:42] fujimura_: has joined #ruby
[09:59:56] flughafen: platzhirsch1: dir auch
[10:00:01] Oog: has joined #ruby
[10:00:09] platzhirsch1: the correct form is: du mich auch
[10:00:26] flughafen: tiling wm > kde > no x > gnome
[10:00:31] undeadaedra: stop mit Deutsch, danke
[10:00:43] flughafen: undeadaedra: i like it when you speak deutsch to me
[10:00:45] terlar: has joined #ruby
[10:01:28] undeadaedra: no, no you don't
[10:01:39] flughafen: ACTION needs to walk his dog
[10:01:41] intinig: has joined #ruby
[10:02:51] decoponio: has joined #ruby
[10:03:31] bnagy: agent_white: https://github.com/jamescook/rb_termbox I use the Go version of this, it's good
[10:03:38] undeadaedra: Mein Deutsch ist so schelcht :(
[10:03:51] Cust0sLim3n: has joined #ruby
[10:03:58] bnagy: much simpler than ncurses, but less frills ( no drop-down menus etc etc )
[10:03:59] dreinull75: has joined #ruby
[10:04:11] bnagy: looks like there's also an ffi binding
[10:05:32] shock_one: has joined #ruby
[10:05:42] agent_white: bnagy: Ooo... I'll look into it! Thank you :D
[10:06:43] failshell: has joined #ruby
[10:07:27] yoongkang: has joined #ruby
[10:08:08] alex88_: has joined #ruby
[10:10:18] jmferreira: has joined #ruby
[10:10:25] bigkevmcd: has joined #ruby
[10:10:30] RegulationD: has joined #ruby
[10:11:24] tvw: has joined #ruby
[10:11:53] Casty: has joined #ruby
[10:12:43] Zai00: has joined #ruby
[10:15:55] shevy: undeadaedra almost perfect... "schelcht" -> should be "schlecht"; in France, mal, right?
[10:16:08] shevy: malaise... malaire... malbaguette
[10:16:12] corehook: has joined #ruby
[10:16:40] _ixti_: has joined #ruby
[10:16:41] undeadaedra: in this context, ?? mauvais ?? will be better, but yes, in general case ?? mal ?? is right
[10:19:56] jds: has joined #ruby
[10:21:08] undeadaedra: Biggest problem I have with german now is trying not to mix with swedish
[10:21:15] Rollabunna: has joined #ruby
[10:22:38] Palmer11: has joined #ruby
[10:23:41] j4cknewt: has joined #ruby
[10:23:50] ndrei: has joined #ruby
[10:25:34] mister_solo: has joined #ruby
[10:25:39] futilegames: has joined #ruby
[10:26:32] lkba_: has joined #ruby
[10:29:16] TvL2386: has joined #ruby
[10:30:51] ottlikg: has joined #ruby
[10:31:17] TvL2386: hi guys, just reading about the SystemTimer gem (https://rubygems.org/gems/SystemTimer/versions/1.2.3).... It seems to be working with blocked system calls as well... It seems like a good way to create timeout facilities if it's not built-in the code you're calling... Anybody got experience on this?
[10:36:42] arup_r: has joined #ruby
[10:37:42] revath: has joined #ruby
[10:40:49] _jesterfraud: has joined #ruby
[10:42:17] hakunin: has joined #ruby
[10:46:08] sdothum: has joined #ruby
[10:46:46] zotherstupidguy: "Versions are to Software what Subversion is to Git." this is a qoute in almost-sinatra project, i dont understand it! what does it mean?
[10:46:51] sandstrom: has joined #ruby
[10:47:38] rodfersou: has joined #ruby
[10:48:11] DoubleMalt: has joined #ruby
[10:48:43] jhass: zotherstupidguy: you'll understand it soon enough, just keep it in mind
[10:49:14] fusillicode: has joined #ruby
[10:49:16] fusillicode: has left #ruby: ()
[10:50:27] gluten_hell_: has joined #ruby
[10:51:32] fgo: has joined #ruby
[10:51:49] wasamasa: what do they suggest using instead, git revisions all the time?
[10:51:55] wasamasa: no git tags ever?
[10:52:10] ndrei: has joined #ruby
[10:53:38] zotherstupidguy: wasamasa you use git tags?
[10:53:48] wasamasa: zotherstupidguy: yup
[10:53:57] wasamasa: zotherstupidguy: and I tag them with the version left in the file header
[10:54:19] qwertme: has joined #ruby
[10:54:23] wasamasa: zotherstupidguy: it's for emacs packages as there's two package archives with versioning they wander to
[10:54:51] dzejrou: has joined #ruby
[10:55:45] zotherstupidguy: wasamasa i can't follow such strict workflow, i will almost always forget to do all a long series of steps
[10:56:11] mwlang: has joined #ruby
[10:56:22] wasamasa: fix a bug, commit the change, change the last digit of the version, commit the version bump, tag, push code and tag
[10:56:29] mwlang: does Nokogiri turn "2015-06-03T16:47:14" into Time values?
[10:57:03] workmad3: wasamasa: there's rake tasks that can handle the entire bump/commit/tag/push process too :D
[10:57:19] wasamasa: workmad3: I don't use rake for non-ruby things
[10:57:29] wasamasa: zotherstupidguy: http://semver.org/
[10:57:42] zotherstupidguy: yea i know semver
[10:57:43] GitGud: has joined #ruby
[10:57:43] ChanServ: +b *!*@gateway/web/cgi-irc/kiwiirc.com/ip.
[10:57:43] ChanServ: ChanServ kicked GitGud: 3d good bye
[10:57:47] workmad3: wasamasa: there's probably make tasks too :P
[10:58:04] denver: has joined #ruby
[10:58:10] zotherstupidguy: its kinda bad that there are no repository for common rake tasts :)
[10:58:16] tedstriker: has joined #ruby
[10:59:03] workmad3: but yeah, it's not a complicated process in all honesty... I used to have to deal with something like a 25 step release process for a mobile app :(
[10:59:10] tkuchiki_: has joined #ruby
[10:59:10] mwlang: nvm, I figured it out ??? it???s the ???nori??? gem converting strings to Time (it uses Nokogiri to parse the XML files)
[10:59:17] wasamasa: zotherstupidguy: http://zenhabits.net/doing/
[10:59:27] workmad3: which included getting a physical USB dongle plugged into the machine in order to activate the licence for a proprietary compiler
[10:59:49] wasamasa: that doesn't sound very zen-like :P
[10:59:55] workmad3: wasamasa: it really wasn't :P
[11:00:06] questions: has joined #ruby
[11:00:27] fujimura: has joined #ruby
[11:00:29] ahmetkapikiran: has joined #ruby
[11:00:50] workmad3: wasamasa: I managed to automate and script about half of it at one point... in perl :D
[11:00:55] questions: hi. if its not too much trouble I have a really noob question to ask. i'm learning ruby and I just wanted to know in the >require field at the top of every ruby code i see. does the require thing have to be in teh same directory or does it have to be an installed gem ?
[11:01:18] questions: ok thank you so much
[11:01:31] workmad3: Questions: it needs to be visible in any of the directories you see if you print out $LOAD_PATH
[11:01:44] wasamasa: you usually go for require_relative inside gems
[11:01:44] workmad3: Questions: which doesn't include the current directory by default
[11:01:48] questions: so to see that i go ruby $LOAD_Path
[11:01:49] ndrei: has joined #ruby
[11:01:55] questions: on terminal ?
[11:02:12] workmad3: Questions: ruby -e "puts $LOAD_PATH" would show it to you
[11:02:21] workmad3: Questions: but it can be modified at run-time too
[11:02:21] questions: ah i see. thank you
[11:02:24] nikhgupta: has joined #ruby
[11:02:41] questions: workmad3:ah so you mean. before i run my program there could be a clause that changes it to the directory of the program right?
[11:03:23] jhass: Questions: workmad3 single quotes, no?
[11:03:26] workmad3: Questions: it's an array, so you could add to it... but it's generally not recommended to play with it much
[11:03:31] workmad3: jhass: yeah, I just realised that
[11:03:36] questions: workmad3: ah i see
[11:03:42] workmad3: jhass: otherwise bash decides that $LOAD_PATH is an env var :D
[11:03:54] Cust0sLim3n: has joined #ruby
[11:04:05] questions: one day i will be able to participate in these conversation
[11:04:08] questions: and make jokes
[11:04:31] workmad3: Questions: ruby -e 'puts $LOAD_PATH' <-- that's what jhass was meaning
[11:04:38] questions: oh i know that
[11:04:51] agent_white: Like... what did the pirate say on his birthday?
[11:05:01] questions: require gems ?
[11:05:04] agent_white: AYYYYYYEEEMAYEY!
[11:05:15] questions: i meant ruby jokes
[11:05:26] questions: i can make java jokes though!
[11:05:29] agent_white: He was a rubyist, too, of course!
[11:05:33] workmad3: agent_white: what do you call a pirate with 2 hands and 2 legs?
[11:05:40] s2013: has joined #ruby
[11:05:42] agent_white: workmad3: I dunno what?!
[11:05:43] workmad3: agent_white: n00b
[11:05:49] questions: why can't java programmers get women?
[11:05:54] agent_white: workmad3: What did the baby computer call it's father?
[11:05:56] questions: because they treat them like objects !
[11:06:03] agent_white: Questions: ohsnahp
[11:06:11] workmad3: agent_white: go on
[11:06:15] jhass: ACTION senses #ruby-offtopic territory
[11:06:19] allomov: has joined #ruby
[11:06:23] dEPy: has joined #ruby
[11:06:25] questions: looks like i'll fit in with the community
[11:06:27] agent_white: ACTION shrugs
[11:06:53] workmad3: agent_white: maybe 0xDADA? :D
[11:06:56] agent_white: Questions: Keep the jokes coming. Then make a ruby bot to tell us jokes!
[11:07:09] agent_white: workmad3: YES!
[11:07:32] questions: aw you guys
[11:07:35] questions: such gems <3
[11:07:49] agent_white: I spose 0XDEADBEEF wouldn't come first :P
[11:07:53] questions: did you see what i did there?
[11:07:55] skade: has joined #ruby
[11:07:55] questions: funny right?
[11:08:05] workmad3: ACTION watches the channel tumbleweeds
[11:08:15] questions: i thought it was funny
[11:08:51] workmad3: undeadaedra: awesome... none of those are valid hex digits :D
[11:09:05] questions: they all are tho
[11:09:17] questions: i thought hex was 0-9 A-F
[11:09:35] questions: i forgot my digital systems i guess :P
[11:09:49] workmad3: Questions: correct... so NOSORRY doesn't fit hex :P
[11:10:00] questions: i was looking at DEADBEEF
[11:10:11] diegoviola: has joined #ruby
[11:10:26] workmad3: Questions: heh :) DEADBEEF is a classic hex pattern ;)
[11:10:26] platzhirsch: has joined #ruby
[11:10:39] diegoviola: I want to parse strings in ruby, like if a string contains the word foo and bar I want to do something else, what method can I use for this?
[11:10:44] undeadaedra: let me find something
[11:11:27] workmad3: Questions: https://en.wikipedia.org/wiki/Hexspeak has an entry on DEADBEEF
[11:11:43] jhass: diegoviola: that's a bit generic...
[11:11:55] revath: has joined #ruby
[11:12:00] undeadaedra: 0xcafebabe and 0xfeedface are magics used by OS X's binaries
[11:12:32] simplyianm: has joined #ruby
[11:12:36] diegoviola: jhass: how so?
[11:12:47] questions: well nice meeting u guys
[11:12:49] nofxx: has joined #ruby
[11:12:49] nofxx: has joined #ruby
[11:13:01] jhass: diegoviola: well, it's "I have a string and want to do something depending on some of its contents" in other words
[11:13:01] Akagi201: has joined #ruby
[11:13:01] questions: i'll see u later! :)
[11:13:36] diegoviola: jhass: I want to check if a word exist in a string
[11:13:45] jhass: .include?
[11:14:06] workmad3: diegoviola: sounds like a job for... REGULAR EXPRESSIONS! https://xkcd.com/208/
[11:14:07] revath1: has joined #ruby
[11:14:14] CloCkWeRX: has joined #ruby
[11:14:19] withnale____: has joined #ruby
[11:14:46] jhass: so far nothing detailed that would require them
[11:15:08] jhass: though I do expect additional requirements to suddenly appear out of this
[11:17:30] ndrei: has joined #ruby
[11:17:53] allcentury: has joined #ruby
[11:18:20] yoongkang: has joined #ruby
[11:19:38] senayar: has joined #ruby
[11:20:57] kalusn: has joined #ruby
[11:23:26] Question: has joined #ruby
[11:23:40] Question: hello there
[11:23:42] Question: i have a question
[11:23:52] Question: but it may not be related to ruby
[11:24:06] shevy: great nick
[11:24:08] Question: is there a way in windows to hide a window programmatically ?
[11:24:26] Question: ok lets say in ruby
[11:24:30] Question: i want to hide a window
[11:24:32] shevy: it's the windows API
[11:24:34] Question: what would i do ?
[11:24:40] shevy: that depends on what you use
[11:24:40] Question: theres such a thing ?
[11:24:49] shevy: ruby-gnome you can use .show and .hide
[11:25:23] Question: so if i hide a window, will its icon be on the taskbar ?
[11:25:25] undeadaedra: Question: you mean any window open of another program?
[11:25:42] shevy: Question normally yes
[11:26:09] Question: so like, lets say i have paint open while i run my ruby script
[11:26:15] shevy: in ruby-gnome this happens through Gtk::Statusbar -> http://ruby-gnome2.osdn.jp/it/hiki.cgi?Gtk%3A%3AStatusbar
[11:26:17] Question: i want to hide the paint window at one point
[11:26:23] undeadaedra: Yeah, you need to go through Win32 api calls
[11:26:29] Question: windows 32 ?
[11:26:32] shevy: you have to look up the API Question
[11:26:34] Question: can it be on windows 64?
[11:26:38] Question: oh i will dw
[11:26:41] undeadaedra: shevy: ruby-gnome won't help for other programs though
[11:26:42] shevy: you must look at the windows API
[11:26:44] Question: just getting it clear on the scope of this
[11:26:49] undeadaedra: Question: Win32 is the generic name
[11:26:49] bnagy: it gets a lot harder with modern windows
[11:26:55] Question: so its a good investment or not
[11:26:56] bnagy: because of UAC :/
[11:27:06] shevy: Question http://stackoverflow.com/questions/2122506/how-to-create-a-hidden-window-in-c
[11:27:38] shevy: good investment? to spend time with windows? come on Question :D
[11:27:46] Question: i mean like ok
[11:27:51] bnagy: Question: basically you're going to be looking mostly at C examples, unless imperator has something magic
[11:27:54] Question: i'm trying to set up a framework of something
[11:28:04] Question: that requires hiding of the windows
[11:28:08] Question: thats why i'm asking :P
[11:28:27] bnagy: yeah but hiding windows belonging to other processes is considered dodgy now
[11:28:39] bnagy: so it requires more privileges etc
[11:28:42] Iskarlar: has joined #ruby
[11:28:43] chinmay_dd: has joined #ruby
[11:29:02] undeadaedra: I guess just reducing them should be ok
[11:29:20] undeadaedra: But heh, this is Windows API domain, not Ruby
[11:29:23] bnagy: Question: anyway, this is probably not going to be easy / quick
[11:29:43] shevy: go collect information into a local textfile Question
[11:29:49] shevy: one day you have all necessary info together
[11:30:22] bnagy: Question: https://github.com/bnagy/ruby-kernel there's a few bits
[11:30:53] bnagy: but mainly just has examples of the kind of scaffolding you'll need, you're going to need to do slightly different stuff
[11:31:31] bnagy: but with that general approach and some C examples you should have a chance
[11:31:54] Question: well its harder because i'm trying to implement all this in java
[11:32:02] Question: and dont ask
[11:32:07] Question: boss wants me to
[11:32:08] shock_one: has joined #ruby
[11:32:11] bnagy: ytf are you here then?
[11:32:12] Question: so its not my doing
[11:32:22] bnagy: nothing to do with it
[11:32:23] Question: why are you so angry
[11:32:50] bnagy: jruby uses FFI, so you can do it in jruby fine
[11:32:55] Question: thank you for your help people. didnt mean to anger anyone with jruby
[11:33:01] Question: has left #ruby: ()
[11:33:01] bnagy: doing it in java is a whole different kettle of fish
[11:33:09] izzol: has joined #ruby
[11:33:16] bnagy: and has nothing at all to do with ruby :)
[11:33:22] jhass: bnagy: they left ;)
[11:33:31] izzol: Is it possible to split the long commands which I have on the Open3.popen3() ?
[11:33:39] diegoviola: I want to create a bot, do I have to parse the input to give responses or what?
[11:33:44] jhass: izzol: yes, press enter
[11:33:59] jhass: diegoviola: usually
[11:33:59] shevy: diegoviola obviously you have to let the bot respond to commands made in a channel
[11:34:10] izzol: jhass: oh, I didn't even thing this is possible. Thanks :_)
[11:34:12] shevy: >> puts 'hey diegoviola I respond to leading >> '
[11:34:13] ruboto: shevy # => hey diegoviola I respond to leading >> ...check link for more (https://eval.in/383158)
[11:34:24] krisquigley: has joined #ruby
[11:34:34] sdothum: has joined #ruby
[11:34:47] quimrstorres: has joined #ruby
[11:34:56] ldnunes: has joined #ruby
[11:35:05] jhass: diegoviola: IRC bot? take a look at cinch and its examples
[11:35:13] fabrice31: has joined #ruby
[11:35:23] diegoviola: jhass: not an irc bot
[11:36:06] diegoviola: just some program on my computer that responds back to commands, so just a regular program
[11:36:21] jhass: alright then I'll stay as vague as you do
[11:36:31] diegoviola: sorry for being vague
[11:36:42] apeiros: diegoviola: unless you want it to respond randomly, then yes, obviously you'll have to parse the input
[11:38:13] apeiros: well, I guess some alternatives would not qualify as parsing. e.g. use a hash to look up the response directly from the input.
[11:38:43] bnagy: pretty sure Eliza didn't count as parsing
[11:39:19] jhass: didn't it extract keywords?
[11:39:34] diegoviola: String#include? parses only for exact words, how do I parse for words regardless if the word is being downcased or not?
[11:39:46] diegoviola: s/words/strings/
[11:39:59] maxshelley: has joined #ruby
[11:40:09] diegoviola: or is that Array#include? I'm confused
[11:40:13] jhass: you could do .downcase.include? for example
[11:40:54] zotherstupidguy: has joined #ruby
[11:41:00] al2o3-cr: has joined #ruby
[11:42:06] ahmetkapikiran: has joined #ruby
[11:42:09] startupality: has joined #ruby
[11:42:28] dgutierrez1287: has joined #ruby
[11:42:43] apeiros: String#include? doesn't parse at all
[11:43:07] apeiros: (neither does Array#include?)
[11:43:25] iamninja: has joined #ruby
[11:43:29] droidburgundy: has joined #ruby
[11:44:28] undeadaedra: You need a parser to parse.
[11:44:29] diegoviola: String#include? returns true or false if the string contains a given character, isn't that parsing?
[11:44:31] s2013: has joined #ruby
[11:44:51] nikhgupt: has joined #ruby
[11:44:52] diegoviola: so what is it doing to determine if the string contains a character? is it not parsing?
[11:45:10] diegoviola: undeadaedra: I know
[11:45:15] jhass: ACTION fetches popcorn
[11:45:37] apeiros: diegoviola: https://en.wikipedia.org/wiki/Parsing
[11:45:41] ljarvis: diegoviola: what are you trying to do?
[11:45:45] apeiros: no. string comparison is not parsing.
[11:45:56] undeadaedra: ACTION steals some of jhass's popcorn
[11:46:06] apeiros: ACTION snatches the rest of jhass' popcorn
[11:46:22] revath1: has left #ruby: ()
[11:46:32] jhass: I need that for all the definitions of parsing to come!
[11:46:53] mclee: has joined #ruby
[11:46:54] undeadaedra: ACTION gets an ULTRA-JUMBO box of popcorn for #ruby
[11:47:24] bnagy: it's always popcorn tiem here :/
[11:47:39] bnagy: which idiot merged the other channel?
[11:47:57] apeiros: ACTION points at jhass
[11:48:06] ljarvis: ACTION points at jh 
[11:48:11] diegoviola: #ruby-lang requires invite? wat/
[11:48:14] undeadaedra: ACTION points at popcorn
[11:48:37] ljarvis: diegoviola: there is no ruby-lang
[11:48:40] tkuchiki: has joined #ruby
[11:49:09] Soda: has joined #ruby
[11:49:39] jhass: we actually just renamed it to #ruby-offtopic
[11:49:42] diegoviola: ljarvis: my employer wants me to write a program that parses user input and give responses based on that input, but they're being vague at best, they mention they need a bot for their clients and they say words like NLP, machine learning and so on
[11:50:04] diegoviola: ljarvis: and I don't think that means anything
[11:50:20] bnagy: NLP and ML definitely mean things
[11:50:24] ljarvis: diegoviola: where will this be used?
[11:50:29] ljarvis: i.e what kind of bot? irc?
[11:50:44] diegoviola: ljarvis: no IRC at all
[11:51:01] wasamasa: diegoviola: have they ever played with chatterbots?
[11:51:03] diegoviola: ljarvis: they want it for their web site, I have to write the HTML / CSS for that
[11:51:11] skade: has joined #ruby
[11:51:15] diegoviola: wasamasa: not sure, I don't think so
[11:51:23] Iskarlar: has joined #ruby
[11:51:36] wasamasa: diegoviola: this is the best you'll get: http://www.cleverbot.com/
[11:51:44] Abhijit: has joined #ruby
[11:51:54] diegoviola: wasamasa: they want something like that
[11:52:02] Abhijit: has left #ruby: ()
[11:52:08] wasamasa: diegoviola: it doesn't even know about something like established context
[11:52:24] wasamasa: diegoviola: so, you can respond with something more or less fitting, but that's it
[11:52:44] j4cknewt: has joined #ruby
[11:52:59] strixd: has joined #ruby
[11:53:02] wasamasa: diegoviola: fooling someone with randomly bad responses into believing it's a human is hard
[11:53:09] diegoviola: wasamasa: right
[11:53:42] apeiros: my cleverbot instance graduated from the academy of gallifrey
[11:53:50] diegoviola: I asked a person here yesterday why they're doing this at all, wouldn't it be easier if they just have some tracking code that they can look for information based on the tracking code?
[11:54:12] ljarvis: diegoviola: isn't it your place to suggest that?
[11:54:14] strixd: has joined #ruby
[11:54:14] aapole: has joined #ruby
[11:54:23] workmad3: wasamasa: cutting edge in conversation bots is now able to convince people that it's a human with learning disabilities btw :D
[11:54:33] wasamasa: workmad3: yeah, I've seen the turing test news
[11:54:42] msgodf: has joined #ruby
[11:54:46] wasamasa: workmad3: it's disappointing that pretending to be a teenage boy is sufficient
[11:54:54] diegoviola: ljarvis: I don't understand your question?
[11:55:20] ljarvis: you're wondering why your employer is doing it?
[11:55:32] Ox0dea: has joined #ruby
[11:55:58] diegoviola: ljarvis: yes, and I already asked them why, they didn't know how to respond
[11:56:10] dg-ratiodata: has joined #ruby
[11:56:15] workmad3: wasamasa: it's also a bit disappointing that it took about 60 years to get to that point
[11:56:19] ljarvis: that's quite the bsiness
[11:56:22] bnagy: diegoviola: maybe they're a bot?
[11:56:51] diegoviola: ljarvis: they said something along the lines of "Uhm... well, this is what we want, and our customers also want it, so uhm... yes, we can't do full-text-search, we need something that appears as human but isn't"
[11:57:05] Marsupermammal: has joined #ruby
[11:57:14] workmad3: diegoviola: tell them that what they want isn't possible
[11:57:38] wasamasa: diegoviola: point them to eugene
[11:57:39] workmad3: diegoviola: because what they're asking for is currently beyond the cutting edge of AI research
[11:57:52] diegoviola: workmad3: I think they will eventually realize it's not possible
[11:57:59] wasamasa: workmad3: well, if it's on a very specific topic, it can work better
[11:58:03] jhass: tell them full text search is a lot easier
[11:58:05] ljarvis: it's your job to tell them
[11:58:06] ljarvis: don't wait
[11:58:13] wasamasa: workmad3: like the support agents on certain company websites
[11:58:33] droidburgundy: has joined #ruby
[11:58:36] workmad3: wasamasa: sure, the more restrictive the domain, the better these things get :)
[11:58:48] wasamasa: workmad3: which come with cute animations and redirect you to the respective support site, but eh, it's easier to make a better search function for your website
[11:59:28] RegulationD: has joined #ruby
[12:00:12] workmad3: wasamasa: you can also get quite far if you're willing to create an RDF ontology and set up inference rules with it nowadays, so that there's more semantic relevance between queries... but that's a fair bit of effort to go through too :D
[12:00:29] workmad3: *between queries and suggestions
[12:01:01] workmad3: again, the more limited the domain, the better (and the easier to model your ontology)
[12:01:41] HotCoder: has joined #ruby
[12:01:57] workmad3: that's not exactly a conversation bot though :D
[12:04:09] bkxd: has joined #ruby
[12:04:36] evanjs: has joined #ruby
[12:04:42] dopie: has joined #ruby
[12:04:55] ndrei: has joined #ruby
[12:08:24] treehug88: has joined #ruby
[12:08:59] shum: has joined #ruby
[12:09:02] revath: has joined #ruby
[12:09:05] Xeago: has joined #ruby
[12:10:09] fgo: has joined #ruby
[12:12:16] corehook: has joined #ruby
[12:12:38] Ox0dea: >> [1, 2i, 3.14].all?(Numeric)
[12:12:39] ruboto: Ox0dea # => wrong number of arguments (1 for 0) (ArgumentError) ...check link for more (https://eval.in/383186)
[12:12:44] Ox0dea: I fixed that. :)
[12:12:53] skade: has joined #ruby
[12:13:23] Ox0dea: You don't think it makes sense?
[12:13:28] apeiros: hm? you added a literal for imaginaries?
[12:13:37] Ox0dea: No, Ruby's had that for a while now.
[12:13:54] ljarvis: grep is fine with me
[12:13:56] Ox0dea: I added case equality to Enumerable#any?, #all?, #none?, and #one?.
[12:14:10] Ox0dea: Right, it's the predicate form of #grep.
[12:14:28] Ox0dea: I was surprised it hadn't been implemented yet.
[12:14:28] apeiros: hm, yeah, why not?
[12:14:29] fgo_: has joined #ruby
[12:14:39] ljarvis: but yeah looks good
[12:14:41] pepperbreath: has joined #ruby
[12:15:12] Cust0sLim3n: has joined #ruby
[12:15:47] hoov: has joined #ruby
[12:17:14] but3k4: has joined #ruby
[12:17:30] Ox0dea: https://gist.github.com/0x0dea/fe313cd4b0518cd190db
[12:17:39] Ox0dea: That was some pretty scary C.
[12:17:46] Ox0dea: I don't think I got it quite right.
[12:18:03] heftig: >> wat = Object.new; Array.send(:define_method, "all?") { |x=wat,&blk| if wat.equal? x; super(&blk); else; super() { |i| x === i }; end }; [1, 2i, 3.14].all?(Numeric)
[12:18:04] ruboto: heftig # => true (https://eval.in/383188)
[12:18:29] yorickpeterse: https://github.com/blog/2023-a-closer-look-at-europe
[12:18:31] yorickpeterse: "The most active countries in Europe are Germany, the United Kingdom, and France, but if we look at users per capita we see a different story -- Sweden, Finland, and the Netherlands lead the way. London, Paris and Stockholm top the list of European cities most active on GitHub."
[12:18:33] yorickpeterse: hup holland hup
[12:18:35] yorickpeterse: also the UK is a country now?
[12:19:34] Rollabunna: has joined #ruby
[12:20:19] fabrice31: has joined #ruby
[12:20:42] ta: has joined #ruby
[12:21:09] dorei: has joined #ruby
[12:23:23] allomov: has joined #ruby
[12:23:32] centrx: has joined #ruby
[12:24:40] dopieee: has joined #ruby
[12:25:43] shevy: ruled by a benevolent dictator
[12:26:20] shevy: this here is even cooler:
[12:26:23] shevy: "Around 32 million people visit GitHub each month, and most of this traffic comes from outside of the United States (74% in fact)."
[12:27:04] Ox0dea: heftig: Your approach doesn't work for Enumerable.
[12:27:23] heftig: Ox0dea: it was just enough to pass your testcase
[12:27:31] Ropeney: has joined #ruby
[12:27:44] shevy: heftig : Ox0dea: 1 : 0
[12:27:55] Ox0dea: shevy: Erm... https://gist.github.com/0x0dea/fe313cd4b0518cd190db
[12:28:23] shevy: nice colours
[12:28:52] Ox0dea: Anybody familiar enough with MRI to tell me how I've gone about this all wrong?
[12:28:54] Rubie: has joined #ruby
[12:29:21] Master44: has joined #ruby
[12:30:20] sarkyniin: has joined #ruby
[12:30:30] Hounddog: has joined #ruby
[12:30:37] imanzarrabian: has joined #ruby
[12:30:45] alphaatom: has joined #ruby
[12:30:55] st1gma: has joined #ruby
[12:31:07] Marsupermammal: has joined #ruby
[12:31:47] Ox0dea: https://github.com/ruby/ruby/blob/trunk/enum.c#L1046-L1073
[12:31:54] bmn: has joined #ruby
[12:31:57] Ox0dea: That shit is just plain scary, but I think I more or less figured it out.
[12:31:59] alphaatom: has joined #ruby
[12:32:51] ldnunes: has joined #ruby
[12:33:14] alphaatom: has joined #ruby
[12:34:57] fabrice31_: has joined #ruby
[12:35:31] ringarin: has joined #ruby
[12:35:39] revath: has joined #ruby
[12:36:31] Rapier-: has joined #ruby
[12:37:07] jxpx777: has joined #ruby
[12:37:28] tkuchiki: has joined #ruby
[12:38:14] michael_mbp: has joined #ruby
[12:39:10] diegoviola: has joined #ruby
[12:39:52] Guest19245: has joined #ruby
[12:40:17] ponga: has joined #ruby
[12:41:29] coderhs: has joined #ruby
[12:42:10] symm-: has joined #ruby
[12:42:14] qwertme: has joined #ruby
[12:43:40] ht__: has joined #ruby
[12:44:13] krisquigley: has joined #ruby
[12:45:29] Ox0dea: heftig: https://gist.github.com/0x0dea/8120823ed2e9a8f8dab8
[12:46:10] iwishiwerearobot: has joined #ruby
[12:47:37] iainjames88: has joined #ruby
[12:47:41] iainjames88: has left #ruby: ()
[12:48:07] jwaldrip: has joined #ruby
[12:48:17] penzurx: has joined #ruby
[12:49:12] fujimura: has joined #ruby
[12:49:51] veinofstars: has joined #ruby
[12:50:13] yorickpeterse: JSON API, HAL and Siren: the SOAP of JSON
[12:50:37] centrx: That title is webscale
[12:50:37] yorickpeterse: and none of them work if you don't have a concept of a resource (e.g. aggregated data that consists out of multiple tables/resources/etc)
[12:50:47] yorickpeterse: BUT OMG HYPERLINKS IN JSON
[12:51:34] failshell: has joined #ruby
[12:52:32] aryaching: has joined #ruby
[12:52:55] apeiros: yorickpeterse: can't you consider the aggregate to be a resource itself?
[12:53:08] iwishiwerearobot: has joined #ruby
[12:53:10] lfox: has joined #ruby
[12:53:13] yorickpeterse: Adding IDs/links to that is a bit pointless since you can't view it on its own
[12:53:21] yorickpeterse: it's aggregated as in "average rating of X over the past 12 months"
[12:53:27] yorickpeterse: that's not really a resource, at least not in the REST sense
[12:53:41] apeiros: I guess it'd be parametrized, so the params would serve as ID, no?
[12:54:21] apeiros: and afaik REST has a concept of generated resources too, like searches (I'm not to deep in there, so not sure)
[12:54:59] skade: has joined #ruby
[12:55:14] krz: has joined #ruby
[12:55:25] Papierkorb: has joined #ruby
[12:56:16] heftig: Ox0dea: that would behave differently from the C version in case of all?(nil) or all?(false)
[12:56:39] yorickpeterse: apeiros: this is an API that just spits out statistics, not sure how IDs/links/etc would even be useful there
[12:59:28] Hanmac1: has joined #ruby
[12:59:33] Hanmac1: >> Gem::Specification.select {|s| s.dependent_gems.empty? && !s.default_gem? && s.homepage !~ /rvm/ }.map(&:name)
[12:59:34] ruboto: hanmac1 # => ["minitest"] (https://eval.in/383225)
[13:00:05] sandstrom: has joined #ruby
[13:00:18] thelastinuit: has joined #ruby
[13:00:20] cajone: has joined #ruby
[13:00:37] revath: has joined #ruby
[13:00:56] spyderman4g63: has joined #ruby
[13:01:16] cajone: has left #ruby: ()
[13:01:16] abyss: I have file: http://pastebin.com/whhQ2U04 and second file id_to_change_uniq is the list of numbers to change. I write small script in ruby and I'd like to for each line which contains one of the number from id_to_change_uniq to increase about 1000. But my script doesn't work. Why?;)
[13:01:18] ruboto: abyss, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/cfa6b29b3d41a3ec20b7
[13:01:18] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[13:01:20] shock_one: has joined #ruby
[13:01:45] aapole: has joined #ruby
[13:01:46] mikecmpb_: has joined #ruby
[13:02:17] abyss: this is my script: https://gist.github.com/anonymous/34c76808b15f9eb0b80b
[13:02:48] Oog: has joined #ruby
[13:03:03] havenwood: has joined #ruby
[13:03:23] wildroman2: has joined #ruby
[13:03:53] failshell: has joined #ruby
[13:04:26] mikecmpb_: has joined #ruby
[13:05:03] fabrice31: has joined #ruby
[13:05:35] apeiros: abyss: readability tip - you can shorten this: (line =~ /INSERT INTO/) || (line =~ /DELETE/) || (line =~ /UPDATE/) || (line =~ /INSERT_ID/)
[13:05:52] apeiros: to this: line =~ /INSERT INTO|DELETE|UPDATE|INSERT_ID/
[13:06:52] alexherbo2: has joined #ruby
[13:07:09] abyss: apeiros: ok, thank you. But something doesn't work even there;)
[13:07:27] zenguy_pc: has joined #ruby
[13:07:43] InternetFriend: has joined #ruby
[13:07:44] mdz_: has joined #ruby
[13:07:46] nikhgupta: has joined #ruby
[13:08:02] shevy: is there a simple (does not have to be 100% fool-proof) way in ruby to determine whether something is a binary file, like a .mp3 file, or a text file, like plain code in a .rb file?
[13:08:12] shock_one: has joined #ruby
[13:09:56] revath: has joined #ruby
[13:10:57] yorickpeterse: shevy: don't think so, you'd need proper MIME type detection
[13:11:02] yorickpeterse: because technically everything is binary
[13:11:23] rindolf: has joined #ruby
[13:11:28] qwertme: has joined #ruby
[13:11:28] mujou: has joined #ruby
[13:11:51] arup_r: has joined #ruby
[13:11:57] lxsameer: has joined #ruby
[13:12:06] sevenseacat: has joined #ruby
[13:12:43] zenguy_pc: has joined #ruby
[13:13:13] griffindy: has joined #ruby
[13:13:21] abyss: ok I suppose I didn't chomp the \n from lines in array
[13:13:22] apeiros: abyss: sorry. RL disrupted
[13:13:28] apeiros: abyss: define "doesn't work"
[13:13:49] abyss: apeiros: yeah, my english isn't good :(
[13:14:07] penzur: has joined #ruby
[13:14:20] apeiros: I'm sure even with bad english you can do better than "doesn't work". but it seems you found your problem.
[13:15:04] al2o3-cr: shevy: the gem filemagic does it
[13:15:43] jmferreira: shevy: i guess you could look for some control characters that exist on most binary files but are rare or non-existent on text files. 0x00 comes to mind.
[13:15:52] abyss: apeiros: sorry. I described what script should to do. And script just freeze I suppose because it doesn't nothing because I didn't chomp lines so even the first if didn't work
[13:15:56] enebo: has joined #ruby
[13:16:26] zenguy_pc: has joined #ruby
[13:16:41] Xeago: has joined #ruby
[13:16:47] abyss: apeiros: File.readlines("id_to_change_uniq").chomp doesn't work, should I do file.each and then chomp?
[13:17:15] al2o3-cr: abyss: you can't chomp on an array
[13:17:17] whippythellama: has joined #ruby
[13:17:33] casadei: has joined #ruby
[13:17:35] allcentury: has joined #ruby
[13:17:40] djellemah: shevy: http://www.darwinsys.com/file might help. You'd have to shell out to it though.
[13:17:52] shevy: al2o3-cr I can not find such a gem
[13:18:02] alphaatom: has joined #ruby
[13:18:14] shevy: jmferreira I could binread on it and scan for that "0x00"? that would it be?
[13:18:18] al2o3-cr: shevy: gem i ruby-filemagic
[13:18:34] Ox0dea: shevy: Why not just calculate the percentage of characters that are English vowels?
[13:18:35] shevy: al2o3-cr aha
[13:18:40] shevy: Ox0dea no
[13:18:47] Ox0dea: Non-English text?
[13:19:01] sgambino: has joined #ruby
[13:19:22] shevy: hmm filemagic looks bigger than what I require
[13:19:22] al2o3-cr: shevy: Then: require 'filemagic'; FileMagic.new.file(file) # returns simlilar output as file
[13:19:24] michaeldeol: has joined #ruby
[13:19:39] dblessing: has joined #ruby
[13:19:39] abyss: al2o3-cr: can't: private method `chomp' called for #<Array:0x7f8924a30110>
[13:19:41] Ox0dea: shevy: Do you just not realize that my suggestion would actually work?
[13:19:50] shevy: "Audio file with ID3 version 2.4.0, unsynchronized frames, contains: MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, Stereo"
[13:20:05] shevy: Ox0dea please man
[13:20:17] darkf_: has joined #ruby
[13:20:23] livathinos: has joined #ruby
[13:20:30] revath: has joined #ruby
[13:20:33] shevy: do they classify files somehow?
[13:20:39] nikhgupta: has joined #ruby
[13:20:43] shevy: like I mean, this is an "audio file" I suppose
[13:20:53] shevy: but what makes a file an audio file exactly, is that specified anywhere?
[13:21:13] al2o3-cr: abyss: something like your_arr.map(&:chomp)
[13:21:18] phutchins: has joined #ruby
[13:21:22] shevy: NoMethodError: undefined method `binary?' for File:Class
[13:21:30] axl_: has joined #ruby
[13:21:38] abyss: al2o3-cr: oh, I get it
[13:22:09] nikhgupta: has joined #ruby
[13:22:12] al2o3-cr: shevy: ptool as binary?
[13:22:27] pikos: has joined #ruby
[13:23:23] erts: has joined #ruby
[13:23:45] mister_solo: has joined #ruby
[13:23:51] JakFrist: has joined #ruby
[13:24:18] Abhijit: has joined #ruby
[13:24:42] nikhgupta: has joined #ruby
[13:25:13] tao_: has joined #ruby
[13:25:40] mister_s_: has joined #ruby
[13:28:36] jlast: has joined #ruby
[13:28:41] zotherstupidguy: has joined #ruby
[13:29:00] startupality_: has joined #ruby
[13:29:06] Janusz1: has joined #ruby
[13:29:21] apeiros: abyss: "doesn't work" again. drop that. it's useless.
[13:30:25] abyss: ok, I revised script and now it looks like this: https://gist.github.com/anonymous/918cd60ee21471bd8477 Now lines are matched but in lines 14 and 15 I increase id about 1000 and I change this line and I set puts line in 12 line to compare, but the line remains the same... So gsub doesn't change anything
[13:30:48] abyss: apeiros: I threw it out:)
[13:31:18] Guest11186: has joined #ruby
[13:31:22] platzhirsch: has left #ruby: ()
[13:31:35] senayar: has joined #ruby
[13:31:37] apeiros: ,'#{newID}'
[13:31:46] vdamewood: has joined #ruby
[13:31:47] apeiros: single quotes don't interpolate. you must use double quotes
[13:32:04] apeiros: but "#{expr}" is an (IMO) bad way to write expr.to_s
[13:33:05] yorickpeterse: Yeah, use %Q{expr}
[13:33:05] mrmargolis: has joined #ruby
[13:33:15] yorickpeterse: %Q{#{expr}} :3
[13:33:39] apeiros: %Q{#{%{#{"#{expr}}}}}
[13:33:56] apeiros: oh, missing "
[13:33:57] mwlang: has joined #ruby
[13:33:57] Janusz1: Hi. I have problem with encoding, I am using Base64.decode64 in my puppet, and then I am getting variable with encoding ASCII-8BIT, but I need it in utf, so I do .encode("UTF-8") and getting error: Detail: "\xC3" from ASCII-8BIT to UTF-8, could someone help me with it?
[13:34:04] apeiros: %Q{#{%{#{"#{expr}"}}}}
[13:34:05] abyss: and why this isn't increase that id about 1000?;)
[13:34:15] musgravejw: has joined #ruby
[13:34:25] JoshL: has joined #ruby
[13:34:34] apeiros: Janusz1: so you have binary data in your base64 encoded blob
[13:34:46] apeiros: Janusz1: and utf-8 is not suitable for binary data
[13:34:52] apeiros: oh, wait???
[13:34:52] Janusz1: apeiros: I have string in germany language
[13:34:54] tkuchiki: has joined #ruby
[13:35:06] apeiros: you use encode? wrong tool. force_encoding.
[13:35:11] apeiros: encode will *translate*
[13:35:17] mwlang: So I have a gem that???s converting time strings into DateTime, but unfortunately it???s doing so as a UTC time: #<DateTime: 2015-06-03T16:47:14+00:00 ((2457177j,60434s,0n),+0s,2299161j)> How do I easily shove that DateTime instance to the correct timezone?
[13:35:18] apeiros: you can't translate binary to utf-8.
[13:35:26] undeadaedra: "in germany language"
[13:35:31] nonparfumee: has joined #ruby
[13:35:33] InternetFriend: has joined #ruby
[13:35:36] mwlang: (for example, I want to place it in the +05:00 timezone.
[13:35:44] apeiros: undeadaedra: pssht, you francian
[13:35:48] nikhgupt: has joined #ruby
[13:36:05] devdazed: has joined #ruby
[13:36:15] davedev24_: has joined #ruby
[13:36:18] yorickpeterse: mwlang: DateTime#new_offset can be used to set the time offset
[13:36:22] mwlang: I know I could just re-instantiate with the values of the current DateTime instance, but I was hoping to just say zone = ???EST??? or something similar.
[13:36:27] yorickpeterse: time offset != timezone
[13:36:31] undeadaedra: apeiros: ssh, you'll wake my head-cutting urges.
[13:36:48] malconis: has joined #ruby
[13:37:06] mwlang: yorickpeterse: hmmm???.just setting the offset should be good enough
[13:37:08] yorickpeterse: mwlang: though DateTime#new_offset works with zone names
[13:37:29] dionysus69: has joined #ruby
[13:37:34] abyss: ok. Because here I get nil: ID = line.split(' ').find {|item| IDS.include? item }
[13:37:36] yorickpeterse: >> require 'date'; DateTime.now
[13:37:37] ruboto: yorickpeterse # => #<DateTime: 2015-06-17T13:37:37+00:00 ((2457191j,49057s,326756519n),+0s,2299161j)> (https://eval.in/383282)
[13:37:43] yorickpeterse: >> require 'date'; DateTime.now.new_offset('EST')
[13:37:44] ruboto: yorickpeterse # => #<DateTime: 2015-06-17T08:37:43-05:00 ((2457191j,49063s,914759691n),-18000s,2299161j)> (https://eval.in/383283)
[13:37:45] revath: has joined #ruby
[13:38:05] nikhgupta: has joined #ruby
[13:38:11] ndrei: has joined #ruby
[13:38:30] mwlang: That???s actually changing the time. I need it to stay 16:47, but with new offset.
[13:38:52] Siyfion: has joined #ruby
[13:39:17] undeadaedra: Time is changing all the time :o
[13:39:55] Janusz1: apeiros: thank you
[13:40:27] maloik: mwlang: then the gem parsing the strings is probably doing it wrong?
[13:40:33] maloik: which gem are you using?
[13:40:41] mwlang: maloik: nori
[13:41:24] maloik: and what does the string look like?
[13:41:35] jwaldrip: has joined #ruby
[13:41:55] yorickpeterse: mwlang: then you'll need to append it to the input before parsing
[13:42:13] hinbody: has joined #ruby
[13:42:15] mrgrieves: has joined #ruby
[13:42:18] yorickpeterse: because it's impossible to find out what the zone is for "2015-06-01 14:51:38"
[13:42:25] yorickpeterse: unless somewhere it's stated that everything is always in zone X
[13:42:42] yorickpeterse: (something something always just include the zone/offset in the output)
[13:44:00] mwlang: yorickpeterse: looking at the source, they???re calling DateTime.parse(x) where x, in my case was "2015-06-03T16:47:14"
[13:44:07] nikhgupt: has joined #ruby
[13:44:22] mwlang: I guess I???ll just re-instantiate it from the values.
[13:44:32] abyss: apeiros: I found a mistake in my script the line I trying to change looks like: SET INSERT_ID=2151098/*!*/; I wanted to increase that number about 1000. But ofcourse when I do split(' ') I divide it by space so it mistakes because I'm looking for the figures... Do you have any idea how to achieve that? Catch that number and change it? In id_to_change_uniq I have numbers that I wanted to increase.
[13:45:01] abyss: So the task should be easy, find each line in ID array increase about 1000
[13:45:13] abyss: and change in each line
[13:45:15] Rubie: has joined #ruby
[13:45:17] apeiros: abyss: so you want "SET INSERT_ID=2151098/*!*/;" to change to "SET INSERT_ID=2161098/*!*/;" ?
[13:45:20] RegulationD: has joined #ruby
[13:45:27] mrgrieves: hi, in a string of a number of words what can I used to remove the left side of the string from a "key" word?
[13:45:29] sdothum: has joined #ruby
[13:46:10] apeiros: abyss: I'd change the structure of your script. first check whether line =~ /INSERT INTO|DELETE|UPDATE|INSERT_ID/
[13:46:28] apeiros: abyss: then find the id in the string. and don't just test whether it is in there - get which id is in there too.
[13:46:37] mrgrieves: ie "Hello world, my name is daniel" what can I use to delete everything before name so I end up with "name is daniel"
[13:46:42] apeiros: abyss: and then you can directly gsub. no need to extract it
[13:46:58] abyss: apeiros: yes. Thank you for your understanding;) But somewhere in the file ther could be lines like: UPDATE assignmentuser SET state='YToxOntpOjIzNTM7Y' WHERE userid='2151098/' and I wanted to change this to userid='2161098' as well
[13:47:03] apeiros: mrgrieves: see String#[], String#sub and String#gsub
[13:47:14] apeiros: mrgrieves: whoops, String#[]=, not #[]
[13:47:47] apeiros: abyss: yes. that'd still work with the way I suggested.
[13:47:52] revath: has joined #ruby
[13:47:52] mrgrieves: apeiros: cheers
[13:47:54] freerobby: has joined #ruby
[13:47:55] abyss: apeiros: I will try;)
[13:48:00] abyss: thank you very much
[13:48:38] apeiros: if your list of id's is large, and your script is too slow - there's ways to go about it a bit differently to improve performance
[13:48:43] abyss: apeiros: to find the id I should use match, yes?
[13:48:52] msnyon: has joined #ruby
[13:48:55] Zackio: has joined #ruby
[13:48:56] apeiros: abyss: just use .find instead of .any?
[13:48:58] abyss: apeiros: yes, there's 30000 ids
[13:49:09] apeiros: it'll return which number was found, and not just whether a number was found
[13:49:28] apeiros: yeah, I'd expect your approach to be quite slow then
[13:50:03] Oog: has joined #ruby
[13:50:23] kriskropd: has joined #ruby
[13:50:51] NeverDie: has joined #ruby
[13:52:58] endash: has joined #ruby
[13:53:00] Starface: has joined #ruby
[13:53:02] Starface: wl Try you Luck Here http://tinyurl.com/p2vb8po
[13:53:39] dfockler: has joined #ruby
[13:53:47] northfurr: has joined #ruby
[13:53:50] havenwood: !kick Starface no spam
[13:53:52] ruboto: ruboto kicked Starface: spam
[13:53:52] ruboto: -o ruboto
[13:54:27] undeadaedra: He tried his luck
[13:54:44] corehook: has joined #ruby
[13:54:46] abyss: apeiros: 651 match 651727 as well :(
[13:55:18] DashNine: has joined #ruby
[13:55:57] lordkryss: has joined #ruby
[13:56:14] abyss: now I have something like this: https://gist.github.com/anonymous/05f67b7f40c695bd0d67
[13:56:21] apeiros: abyss: so you need to improve your regex
[13:56:32] paulcsmith: has joined #ruby
[13:57:09] mikecmpb_: has joined #ruby
[13:57:24] apeiros: abyss: I'll be offline for ~30min, I'll help you a bit after that.
[13:57:33] evanjs: has joined #ruby
[13:57:35] abyss: apeiros: OK. Thank you very much.
[13:57:42] revath: has joined #ruby
[13:58:28] Hanmac1: what the heck is "Aeon ball" ?
[13:58:37] abyss: btw: wen I do: ID = IDS.find { |w| line =~ /^#{w}$/ } then nothing is matched;)
[13:59:11] mwlang: It ain???t pretty, but it works: https://gist.github.com/mwlang/f4b0bbcb48269da1b6f4
[14:00:29] skade: has joined #ruby
[14:01:28] sandstrom: has joined #ruby
[14:02:19] freerobby: has joined #ruby
[14:03:39] olistik: has joined #ruby
[14:03:40] abyss: apeiros: I did: ID = IDS.find { |w| line =~ /\b#{w}\b/ } and it looks like probably works ;) Do you think that script is ok?
[14:04:13] RegulationD: has joined #ruby
[14:04:13] abyss: and how to write this changes in file, lol - please answer when you back
[14:04:57] imperator: has joined #ruby
[14:05:05] Cust0sLim3n: has joined #ruby
[14:05:59] fabrice31_: has joined #ruby
[14:06:03] alphaatom: has joined #ruby
[14:06:18] dhjondoh: has joined #ruby
[14:06:59] abyss: And I still can't increase about 1000 in whole text. The whole text is intact:/ (I compare first puts line with the last)
[14:07:18] alphaatom: has joined #ruby
[14:07:21] shinnya: has joined #ruby
[14:07:52] olistik: has left #ruby: ()
[14:08:03] viuo: has joined #ruby
[14:08:10] revath: has joined #ruby
[14:08:26] catphish: has joined #ruby
[14:08:31] alphaatom: has joined #ruby
[14:08:47] pontiki: has joined #ruby
[14:09:02] pontiki: hello, all o/
[14:09:52] __butch__: has joined #ruby
[14:10:09] lfox: has joined #ruby
[14:10:25] LMity: has joined #ruby
[14:10:59] Scroff: has joined #ruby
[14:11:05] imperator: "cast to pointer from integer of different size" - i guess NUM2OFFT was the wrong choice
[14:12:04] imperator: what's the proper NUM2xxx where the lhv is uintptr_t ?
[14:12:15] pontiki: a general question: Kernel#Array() will usually do the job of turning something into an array. But when you give it a hash, it dutifully turns the hash into an array. But what if you just want to make a hash into an array with a single hash member?
[14:12:19] ascarter: has joined #ruby
[14:12:35] pontiki: but do so while not necessarily knowing you're getting a hash passed to you?
[14:12:52] pontiki: are back to having to do type checking on this?
[14:12:58] [H]unt3r: has joined #ruby
[14:13:08] imperator: h = {}; a = [h]?
[14:13:14] aryaching_: has joined #ruby
[14:13:40] sepp2k: has joined #ruby
[14:13:53] pontiki: imperator: more like: def xxx(z); Array(z).each {...}; end
[14:14:04] jhass: well http://api.rubyonrails.org/classes/Array.html#method-c-wrap exists for a reason...
[14:14:11] catphish: can anyone point me in the right direction of how I might use this ioctl in ruby? #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params)
[14:14:16] olistik_: has joined #ruby
[14:14:33] olistik_: has left #ruby: ()
[14:15:36] volty: has joined #ruby
[14:16:29] pontiki: so i guess the answer is yes
[14:16:35] catphish: in C it's called as "ioctl(fd, DMX_SET_FILTER, filter)" - i have no problem with the the string param, but the integer part is kind confusing
[14:16:56] InternetFriend: has joined #ruby
[14:17:10] jhass: catphish: printf it and just copy it over :P
[14:17:16] railsraider: has joined #ruby
[14:17:36] catphish: jhass: actually yes :)
[14:18:09] catphish: printf("%x") for the win here i think
[14:18:48] dopie: has joined #ruby
[14:18:58] catphish: well it's 0x403c6f2b
[14:19:16] Igorshp: has joined #ruby
[14:19:19] catphish: i guess i could have calculated that with reference to _IOC but it's a rabbit hole
[14:19:19] kfpratt: has joined #ruby
[14:19:36] jhass: tbh I do it all the time
[14:19:47] jhass: just not worth the rabbit hole most of the time
[14:20:55] fgo_: has joined #ruby
[14:21:02] datanoise: has joined #ruby
[14:21:26] catphish: well it didn't throw an EINVALID :)
[14:22:03] sepp2k: has joined #ruby
[14:22:03] shevy: https://en.wikipedia.org/wiki/Perl_6
[14:22:05] shevy: the perl logo
[14:22:09] shevy: someone took LSD and other drugs
[14:23:02] abyss: apeiros: Ok. I had to add gsub! then I can see the changes;) This is ok? How I can now write this to file? How to expedite the whole script? Thank you.
[14:23:10] momomomomo: has joined #ruby
[14:23:23] Iskarlar: has joined #ruby
[14:23:59] mary5030: has joined #ruby
[14:24:37] dopie: has joined #ruby
[14:24:39] mary5030: has joined #ruby
[14:25:41] kies: has joined #ruby
[14:25:53] bruno-: has joined #ruby
[14:26:04] yoongkang: has joined #ruby
[14:26:38] Zai00: has joined #ruby
[14:26:53] fabrice31: has joined #ruby
[14:26:59] InternetFriend: has joined #ruby
[14:27:16] yaw: has joined #ruby
[14:28:27] Iskarlar_: has joined #ruby
[14:28:54] zudochkin: has joined #ruby
[14:30:29] quimrstorres: has joined #ruby
[14:30:35] j4cknewt: has joined #ruby
[14:30:43] apeiros: abyss: File.write(path, content)
[14:30:58] startupality: has joined #ruby
[14:31:28] simplyianm: has joined #ruby
[14:31:50] olistik: has joined #ruby
[14:31:51] sohrab: has joined #ruby
[14:32:25] simplyianm: has joined #ruby
[14:32:38] apeiros: abyss: yes, ID = IDS.find { |w| line =~ /\b#{w}\b/ } is better. but you should not use constants (variables which start with an uppercase letter are constants).
[14:32:57] segfalt: has joined #ruby
[14:33:57] gambl0re: has joined #ruby
[14:34:02] Iskarlar: has joined #ruby
[14:34:52] volty: perl 6 went functional (the examples, of shevy's link above)
[14:35:54] yorickpeterse: Perl 6 is anything but a functional language
[14:35:54] _blizzy_: has joined #ruby
[14:35:54] shevy: perl went crazy
[14:36:01] quimrstorres: has joined #ruby
[14:36:29] volty: of, course, yorickpeterse, the mine was about those constructs
[14:36:45] ponga: { |w| line =~ /\b#{w}\b/ } looked like all gibberish for a second , it took me a moment to understand what it is ..
[14:37:58] fujimura: has joined #ruby
[14:37:59] ottlikg: has joined #ruby
[14:38:36] volty: look at quicksort, it seems almost haskell :)
[14:38:54] hinbody: has joined #ruby
[14:39:23] alphaatom: has joined #ruby
[14:39:49] volty: construct -- (create by linking linguistic units; "construct a sentence"; "construct a paragraph")
[14:39:53] jenrzzz: has joined #ruby
[14:40:03] yorickpeterse: I know what "construct" means...
[14:40:12] shevy: ponga well regexes are never really pretty
[14:40:28] apeiros: I find regexen very pretty :)
[14:40:38] alphaatom: has joined #ruby
[14:40:39] shevy: I try to avoid them when possible, if it is for simple things like "if string.include? substring" or string.start_with? or string.end_with?
[14:41:00] sanguisdex: has joined #ruby
[14:41:20] volty: nothing more elegant then regexens ??? and the elegance stays in their power & solution
[14:42:08] shevy: I get horny when I see things like /([A-Za-z\d-]*_{0,1}[_a-z]*)[_-]{1,20}([A-Za-z_\d.]*[-a-z]*[\d]*)/
[14:42:18] corehook: has joined #ruby
[14:42:25] apeiros: shevy scares me
[14:42:26] sharpmachine: has joined #ruby
[14:42:44] Aria: ACTION eyebrows.
[14:42:49] yorickpeterse: http://emailregex.com/ yes, very elegant
[14:42:57] raellear: has joined #ruby
[14:43:00] shevy: I scare myself when I notice a mirror!
[14:43:01] raellear: has left #ruby: ()
[14:43:07] apeiros: yorickpeterse: curious to see a more elegant solution :)
[14:43:14] yorickpeterse: and of course there's this:
[14:43:15] volty: you could subst with descriptive variables, but I find it more useful just commenting below when you have difficulty to grasp it
[14:43:17] yorickpeterse: >> require 'uri'; URI.regexp
[14:43:18] ruboto: yorickpeterse # => / ...check link for more (https://eval.in/383312)
[14:43:40] canton7: that page looks suspect
[14:43:41] tkuchiki: has joined #ruby
[14:43:45] claw: has joined #ruby
[14:43:50] canton7: it's not explaining the limitations of the shorter regexes, for starters
[14:45:10] shevy: the longer the prettier
[14:45:21] Rubie: has joined #ruby
[14:45:26] shevy: ponga look at what you have started man
[14:45:27] st1gma: has joined #ruby
[14:45:31] ta: has joined #ruby
[14:45:31] wasamasa: maybe I should simplify my mail regex
[14:45:44] yorickpeterse: I have the perfect Email regex
[14:45:45] francoi__: has joined #ruby
[14:45:49] wasamasa: or maybe not as there's no stage with mail verification
[14:46:03] ponga: damn shevy what have i done
[14:46:12] ruboto: yorickpeterse # => /\S+@\S+/ (https://eval.in/383313)
[14:46:24] nfk: has joined #ruby
[14:46:31] yorickpeterse: >> 'foo@localhost'.match(/\S+@\S+/)
[14:46:33] ruboto: yorickpeterse # => #<MatchData "foo@localhost"> (https://eval.in/383314)
[14:46:34] serivich: has joined #ruby
[14:46:37] yorickpeterse: >> 'foo@localhost.butts'.match(/\S+@\S+/)
[14:46:38] ruboto: yorickpeterse # => #<MatchData "foo@localhost.butts"> (https://eval.in/383315)
[14:46:53] yorickpeterse: >> 'foo12378213+wat@localhost.butts'.match(/\S+@\S+/)
[14:46:54] ruboto: yorickpeterse # => #<MatchData "foo12378213+wat@localhost.butts"> (https://eval.in/383316)
[14:47:02] shevy: what is it with your local butt
[14:47:05] volty: now I remember what I wanted to ask. Is it possible to define new character class using single letter (like '\d') ?
[14:47:16] pontiki: >> "Agent Orange <hello.ktty@gmail.com>".match(/\S+@\S+/)
[14:47:17] ruboto: pontiki # => #<MatchData "<hello.ktty@gmail.com>"> (https://eval.in/383318)
[14:47:24] rippa: has joined #ruby
[14:47:28] pontiki: that is beautiful
[14:47:39] canton7: >> '" "@example.com'.match(/\S+@\S+/)
[14:47:40] ruboto: canton7 # => #<MatchData "\"@example.com"> (https://eval.in/383319)
[14:47:45] mrmargol_: has joined #ruby
[14:48:02] canton7: >> '"a b"@example.com'.match(/\S+@\S+/)
[14:48:03] ruboto: canton7 # => #<MatchData "b\"@example.com"> (https://eval.in/383320)
[14:48:04] shevy: ponga look at them go man, they are testing ruboto's abilities to match via MatchData
[14:48:11] canton7: there we go ^
[14:48:13] canton7: spaces are valid :)
[14:48:37] roolo: has joined #ruby
[14:48:45] Ropeney: has joined #ruby
[14:48:50] catphish: jhass: that didn't work, the constant doesn't match up in strace, maybe i copied it wrong, or ruby is modifying it for some reason
[14:49:03] olistik: has joined #ruby
[14:49:23] catphish: unfortunately, strace seems to resolve the constant to its name, so its hard to check how its wrong
[14:49:24] ogpastaling: has joined #ruby
[14:50:15] canton7: I think that's a lesson for everyone: don't try and validate email addresses yourself. you will fail :)
[14:50:42] apeiros: canton7: I still do :)
[14:50:44] catphish: there are as many email validation regexes as there are programs that process email addresses ;)
[14:50:49] jhass: catphish: mmh, shouldn't there some strace option so it doesn't?
[14:50:52] happyface: has joined #ruby
[14:50:53] quimrstorres: has joined #ruby
[14:50:54] sevenseacat: lol, regex for email.
[14:51:08] bougyman: wait, you're in ruby.
[14:51:08] catphish: jhass: you'd think so, but i can't find it, only a guy asking for it on a mailing list :(
[14:51:13] apeiros: because if nobody does, nobody can rely on somebody else's work either
[14:51:15] GarethAdams: has joined #ruby
[14:51:19] quimrstorres: has joined #ruby
[14:51:32] ponga: shevy: let them have fun
[14:51:37] catphish: from my C program: ioctl(3, DMX_SET_FILTER, 0x7fff424e0d90) = 0
[14:51:37] ponga: ACTION looks away
[14:51:51] catphish: from ruby: ioctl(7, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS, 0x7ffda7ff8680) = -1 EINVAL (Invalid argument)
[14:52:18] catphish: jhass: maybe i fat fingered it somehow, its not really clear how i could have messed that up
[14:52:34] kahuna_: has joined #ruby
[14:53:32] Zai00: has joined #ruby
[14:53:53] agent_white: has joined #ruby
[14:54:01] simplyianm: has joined #ruby
[14:54:57] bougyman: i generally use Mail::Address for email parsing.
[14:55:40] axl_: has joined #ruby
[14:55:51] apeiros: I think I started out with that. but I really should writing down why I don't use stuff???
[14:56:10] Guest54855: has joined #ruby
[14:56:24] Guest54855: has left #ruby: ()
[14:56:36] fgo_: has joined #ruby
[14:57:30] catphish: it's working now, i was misreading the strace :)
[14:57:40] sharpmachine: has joined #ruby
[14:58:16] The_Phoenix: has joined #ruby
[14:58:53] agent_white: has joined #ruby
[15:00:18] mrmargolis: has joined #ruby
[15:00:31] veinofstars: has joined #ruby
[15:00:49] rbennacer: has joined #ruby
[15:02:18] droidburgundy: has joined #ruby
[15:03:55] qwertme: has joined #ruby
[15:03:55] agent_white: has joined #ruby
[15:04:36] antgel: has joined #ruby
[15:06:03] freerobby: has joined #ruby
[15:07:11] bruno-: has joined #ruby
[15:07:13] snockerton: has joined #ruby
[15:07:59] flughafe1: has joined #ruby
[15:10:06] dgutierrez1287: has joined #ruby
[15:10:21] senayar: has joined #ruby
[15:10:55] sanguisdex: has joined #ruby
[15:12:12] arup_r: has joined #ruby
[15:12:18] InternetFriend: has joined #ruby
[15:12:57] arup_r: has joined #ruby
[15:14:25] codemonkey010101: has joined #ruby
[15:14:26] ericmeds: are there any gems to check what percentage of a codebase is documented
[15:14:35] chouhoul_: has joined #ruby
[15:15:00] jhass: yard has that inbuilt
[15:15:06] apeiros: yupp, yard
[15:15:15] apeiros: maybe rdoc has something too by now
[15:15:36] yorickpeterse: YARD has done that for years
[15:15:42] DaniG2k: has joined #ruby
[15:15:49] Senjai: Morning ruby
[15:15:50] yorickpeterse: oh wait, read that as "maybe yard has something too by now"
[15:15:55] catphish: what's the best (fastest) way to compare a specific byte of a string with an Fixnum of its char value?
[15:16:01] apeiros: yorickpeterse: :-p
[15:16:03] yorickpeterse: ljarvis: YARD itself is fine, the HTML output is meh
[15:16:08] yorickpeterse: But so is rdoc output
[15:16:11] yorickpeterse: and tomdoc output
[15:16:22] mleung: has joined #ruby
[15:16:32] ljarvis: yorickpeterse: I don't like YARD or Rdoc for actually writing docs, though rdoc is significantly nicer imo
[15:16:34] ericmeds: What is Ruby best practices for in code documentation
[15:16:41] ljarvis: agreed the output is meh
[15:16:51] apeiros: catphish: probably .getbyte
[15:16:51] Xeago: has joined #ruby
[15:17:10] yorickpeterse: I kinda dislike both
[15:17:11] catphish: apeiros: if that method exists then it's exactly what i want :)
[15:17:13] apeiros: catphish: if you have to do it repeatedly, there might be other ways
[15:17:16] yorickpeterse: e.g. due to having to prefix every line with #
[15:17:17] ascarter: has joined #ruby
[15:17:42] ljarvis: there's always =begin
[15:17:51] ericmeds: should every method be documented in Ruby?
[15:17:51] yorickpeterse: https://github.com/YorickPeterse/aeon/blob/master/sketches/array.aeon#L2-L18 <- e.g. something like this (basically Python docblocks minus the """) would be much nicer
[15:18:06] francois_: has joined #ruby
[15:18:15] shevy: I like Baguette
[15:18:20] ljarvis: I hate docs inside method bodies
[15:18:32] ljarvis: ACTION shakes fist at python
[15:18:32] yorickpeterse: ljarvis: there's actually a really good reason to do it this way
[15:18:37] undeadaedra: ACTION slaps shevy 
[15:18:39] ljarvis: sure I don't doubt that
[15:18:47] yorickpeterse: makes it easier to associate (technically) and it actually stays with the method
[15:18:50] ljarvis: the reason won't make me like it, that I know
[15:18:51] undeadaedra: You could also have XML documentation like Microsoft does :D
[15:18:58] yorickpeterse: at the cost of moving the method name further away from the body
[15:19:02] yorickpeterse: but you can always just fold the comments
[15:19:18] ericmeds: so YARD can tell me what percentage of the code is documented?
[15:19:32] olistik: has left #ruby: ()
[15:19:39] ericmeds: yorickpeterse: and should we document every single function like you would in Python?
[15:19:59] umgrosscol: has joined #ruby
[15:20:04] ljarvis: why would it be different?
[15:20:22] yorickpeterse: document where it makes sense
[15:20:30] sharpmachine: has joined #ruby
[15:20:31] ljarvis: ^ for every language
[15:20:52] cirn0: has joined #ruby
[15:21:01] undeadaedra: ericmeds: it tells you stats when you compile doc, and you can ask it exactly what is left to document.
[15:23:36] chouhoulis: has joined #ruby
[15:23:53] mister_solo: has joined #ruby
[15:24:18] fgo: has joined #ruby
[15:24:40] tsvenson|afk: has joined #ruby
[15:29:12] Xeago: has joined #ruby
[15:30:06] segfalt: has joined #ruby
[15:31:23] apoplexy: has joined #ruby
[15:31:51] kfpratt: has joined #ruby
[15:32:10] Cache_Money: has joined #ruby
[15:32:28] momomomomo: has joined #ruby
[15:34:41] Kricir: has joined #ruby
[15:34:51] sharpmachine: has joined #ruby
[15:34:55] Senjai: ericmeds: If you're developing a library, every public method should be documented
[15:35:15] Senjai: On an internal project, there's usually some room for flexibility
[15:35:45] ericmeds: right - potentially the more complex methods should deserve proper comments/docs
[15:35:58] Senjai: ericmeds: Well, see, thats the thing
[15:36:03] ericmeds: but not sure where the line should be
[15:36:05] rcvalle: has joined #ruby
[15:36:20] ericmeds: for an internal project
[15:36:31] Senjai: ericmeds: We document libraries because it has to be used by people that may be stupid, or cannot read source code. Or that the source code itself is unusually complex
[15:36:40] Senjai: ericmeds: In a perfect world, your code should be self documeting
[15:36:56] ericmeds: right - straight forward enough to be read and understood
[15:37:01] Senjai: And that you typically want people to use your library, so making it easier to do so is a form of promotion
[15:37:34] Senjai: Usually the documentation for most open source libraries are so terrible, I end up just keeping their source open in a tmux window
[15:38:04] shevy: I focus on working examples first
[15:38:12] shevy: when examples work, it's 30% of the deal
[15:38:18] shevy: that's how I learned ruby-gnome
[15:38:19] zotherstupidguy: has joined #ruby
[15:38:33] shevy: if I would have started from the wiki, I would have given up on it soon enough again
[15:38:48] Senjai: I disagree, there should have to be very few examples. You dont need to have examples for how to use every class, just a basic one of how the library functions in the readme, and the rest can be documented.
[15:39:10] Senjai: Thor is a great example of where documentation is really the only way you understand things, or reading the source
[15:39:20] Senjai: Arel is largely a unicorn, despite it being used everywhere
[15:39:36] nikhgupta: has joined #ruby
[15:39:43] ericmeds: Senjai: what are your recommendations for a super small development team with the potential to grow
[15:39:54] francois_: has joined #ruby
[15:39:54] Senjai: Arel is extreeeeemmely useful for development. Yest 99% of active record users dont use it because its unclear how.
[15:39:58] ericmeds: id imagine doc???ing as much as possible but the problem is where is that line
[15:40:04] ericmeds: how do you even make the recommendation
[15:40:10] Senjai: ericmeds: lol, with the potential to grow?
[15:40:22] ericmeds: so it wouldnt be only a few guys for long for example
[15:40:24] Senjai: ericmeds: 100% spec coverage, self documenting code
[15:40:30] Senjai: ericmeds: Which is what we do
[15:40:38] Senjai: ericmeds: We dont document internal stuff
[15:40:47] Senjai: It's documented by specs and properly named and encapsulated objects
[15:40:47] phat4life: ericmeds: use rubocop, simple-cov
[15:41:01] phat4life: metric_fu is helpful as well
[15:41:13] Senjai: SimpleCov is great, we dont use robocop though, specifically because we have a number of clients with code bases that began outside of our firm
[15:41:34] Senjai: With simplecov you can have a build fail if coverage is less than a certain %
[15:41:36] phat4life: Senjai: you can always configure rubocop to ignore certain directories
[15:41:42] Senjai: on jenkins at least
[15:41:50] Senjai: phat4life: Its totally not worth it :P
[15:41:55] Senjai: phat4life: We get a lot of rescue projects
[15:42:04] phat4life: with have rubcop running in a pre commit hook, but its really fucking annoying
[15:42:11] ericmeds: phat4life: thanks was looking into simplecov also for test coverage
[15:42:14] Senjai: phat4life: rm -rf .git/hooks
[15:42:18] Senjai: phat4life: ftw
[15:42:47] Senjai: ericmeds: Writing good tests is necessary for the team. Code thats hard to test is hard to use
[15:42:48] phat4life: ericmeds: are you using docker or vagrant
[15:42:51] Senjai: as a rule of thumb
[15:43:03] Oog: has joined #ruby
[15:43:18] ericmeds: phat4life: vagrant for now
[15:43:19] phat4life: we use ansible to provision our vagrant dev envronment, which has redis, mysql, a few other things
[15:43:24] Senjai: phat4life: I only have a pre-commit hook for binding.pry's :P, and one for gerrit
[15:43:37] phat4life: ansible is god mode
[15:43:39] mclee: has joined #ruby
[15:43:44] Senjai: I heard good things about ansible, but I still prefer the vanilla setup
[15:43:52] Senjai: Ubuntu with things set up properly + git lcone
[15:43:52] ericmeds: yeah part of what ive done is implement a framework for integration testing etc and now im onto unit testing coverage
[15:43:57] InternetFriend: has joined #ruby
[15:44:14] phat4life: our rails app depneds on jenkins servers, redis, mysql, slanger, pusher, so it a complicated dev environment
[15:44:24] phat4life: to its eaiser to have that running on vagrant
[15:44:33] phat4life: and ansible is the way to go
[15:44:39] phat4life: makes deployments easy as well
[15:45:08] yorickpeterse: heh, ansible for deployments
[15:45:17] nikhgupta: has joined #ruby
[15:45:17] Senjai: phat4life: redis, mysql are apt-get installs, jenkins shouldn't be on every dev box, pusher is an ENV setting that can be used by sharing a development .env with DotEnv
[15:45:20] yorickpeterse: ACTION shakes cane while mumbling "you kids never learn!"
[15:45:30] phat4life: Senjai: for us it makes sense
[15:45:39] yorickpeterse: ACTION is actually working on a new deploy tool for $WORK
[15:45:40] phat4life: because the rails app creates, destroys jenkisn projects
[15:45:46] mikecmpbll: i've never used any provisioning tools yet. we hardly ever provision new servers or dev machines and it takes me about 15 mins to do it myself.
[15:45:49] Senjai: phat4life: LOL WHAT
[15:45:57] Senjai: phat4life: That's your problem.
[15:46:04] Senjai: phat4life: Why is rails coupled to jenkins?
[15:46:23] Senjai: Unless its job is to.. manage jenkins
[15:46:41] keen__________: has joined #ruby
[15:46:48] veinofstars: has joined #ruby
[15:46:58] phat4life: Senjai: its used to managed jenkins which is used for company wide projects
[15:47:11] Senjai: That's fair then.
[15:47:19] Senjai: I prefer.. scripts and things
[15:47:19] phat4life: we trigger jobs, manage them
[15:47:28] Senjai: phat4life: Why not just use jenkins to manage jenkins though
[15:47:40] Senjai: Application specific things can be done with cron, or queues
[15:47:40] phat4life: Senjai: the rails app is for internal non techical users
[15:47:50] phat4life: Senjai: most of the jenkins jobs just but static content in s3
[15:47:51] Senjai: So jenkins is like a task runner?
[15:48:11] dorei: isn't jenkins just a modern version of crond?
[15:48:17] phat4life: all jenkins does is compile js, static contect from sourc control
[15:48:27] phat4life: Senjai: the rails app is just a front end for jenkins
[15:48:45] ddarkpassenger: has joined #ruby
[15:48:50] blackmesa: has joined #ruby
[15:48:53] yorickpeterse: heh, our jenkins does a shit ton
[15:49:03] phat4life: we have 11k jenkins jobs
[15:49:11] phat4life: with with probably 300+ builds
[15:49:15] Senjai: yorickpeterse: Same, but we have like, a build with parameters thing, that makes it pretty simple.
[15:49:19] yorickpeterse: precompile assets, package Gems, package apps, trigger deploys, build Linux binaries for PhantomJS and other things, build Rubinius binaries/nightlies, etc
[15:49:25] undeadaedra: "a shit ton" ??? and in imperial measurements?
[15:49:37] yorickpeterse: undeadaedra: metrics only
[15:49:39] Senjai: yorickpeterse: lol at the phantomjs, I hate how they're so slow to release binaries on linux
[15:49:40] phat4life: Senjai: creating jenkins projects sometimes only works with xml
[15:49:45] undeadaedra: yorickpeterse: good.
[15:49:47] phat4life: with all the plugins and shit
[15:50:14] yorickpeterse: Senjai: meh, I just started up a beefy EC2 instance and 30 minutes later I had my CentOS binary
[15:50:15] Senjai: phat4life: I'll ask if I can show our tool for setting up jenkins projecst, at the minute its closed source, but not for any particular reason I dont think
[15:50:24] shevy: is the tech world becoming smarter and smarter every year?
[15:50:31] ruby-lang515: has joined #ruby
[15:50:36] Senjai: shevy: yes and no
[15:50:48] yorickpeterse: shevy: No, it thinks it becomes smarter every year but it stays roughly the same
[15:50:48] Senjai: shevy: The % of smart people in the industry is relatively constant
[15:50:53] yorickpeterse: once in a while it makes a small jump
[15:50:55] Senjai: there is just more people in th eindustry
[15:51:00] Senjai: yorickpeterse: I win :P
[15:51:01] yqt: has joined #ruby
[15:51:04] shevy: yorickpeterse now that is a very confusing statement :D
[15:51:41] phat4life: there are a lot of shit rails devs being churned out by places like dev boot camp
[15:51:44] shevy: I am just trying to notice the differences to like 1995
[15:51:46] Senjai: shevy: See, there is this thing called javascript, that can allow people to call themselves software engineers, without actually knowing anything about building anything outside of a browser frontend
[15:51:55] phat4life: shevy: the barrier of entry for rails devs is pretty low
[15:52:23] Senjai: phat4life: Yeah, but if it wasn't for that, I wouldnt be here so..
[15:52:33] Senjai: As I got picked up by this company being self taught
[15:52:40] francois_: has joined #ruby
[15:52:41] phat4life: Senjai: dev bootcamp?
[15:52:47] phat4life: ah self taught
[15:52:54] dorei: i think that programming and software engineering are like two different skills
[15:52:55] shevy: can you code in ruby Senjai?
[15:53:04] phat4life: i feel like the self taught ones, can be really good at what they do
[15:53:15] Senjai: shevy: I've been writing ruby, rails, javascript, etc for the past two years
[15:53:22] sharpmachine: has joined #ruby
[15:53:43] Senjai: 99% of the people here are self taught. Sure they have degrees, but they all say they were useless
[15:53:54] yorickpeterse: I'm the only dirty dropout at the office
[15:53:56] Senjai: about 50% of our office has degrees
[15:54:03] Darkwater: I don't even have a degree (yet) lol
[15:54:10] Senjai: yorickpeterse: Right, and you're kind of awesome at the things so.
[15:54:11] yorickpeterse: I'm also the coolest one that the office, may or may not be related
[15:54:19] yorickpeterse: ( ???_???) ( ???_???)>??????-??? (??????_???)
[15:54:33] Darkwater: square sunglasses
[15:54:36] Senjai: How i picture yorickpeterse : http://www.hercampus.com/sites/default/files/2013/10/15/boone_2.jpg
[15:54:37] yorickpeterse: I kid, I have no idea what I'm doing 99% of the time
[15:54:47] icebourg: has joined #ruby
[15:54:53] Senjai: Google driven development
[15:55:00] luckyme: has joined #ruby
[15:55:29] yorickpeterse: http://i.kinja-img.com/gawker-media/image/upload/s--2pfvDNpi--/c_fit,fl_progressive,q_80,w_320/oed0pq8pt9n7yplwzogf.jpg basically
[15:55:40] jlebrech: has joined #ruby
[15:56:00] sandstrom: has joined #ruby
[15:56:04] yorickpeterse: http://starecat.com/content/wp-content/uploads/two-states-of-every-programmer-i-am-god-i-have-no-idea-what-im-doing.jpg this is pretty accurate too
[15:56:06] shevy: how I picture yorick http://shevegen.square7.ch/yorick_in_training.jpg
[15:56:28] shevy: the dog is cute
[15:56:33] olistik: has joined #ruby
[15:56:35] yorickpeterse: my crotch isn't that clearly visible
[15:56:40] phat4life: Senjai: the problem i have, is that i would like to see devs be able to read code; like, most of the devs i know, if i show them a recursive function, ask them what it does, they cant
[15:56:41] yorickpeterse: or bulge or w/e that is
[15:56:43] Sembei: has joined #ruby
[15:56:46] shevy: they just stuffed it up
[15:56:55] shevy: have you seen Ronal the Barbarian? that animated movie?
[15:57:03] Xeago: has joined #ruby
[15:57:07] Senjai: phat4life: Recursion is a pretty verbose thing for people new to the industry.
[15:57:10] phat4life: Senjai: a lot of self taught devs have gaps in more computer science stuf
[15:57:23] shevy: they overdid it with the jokes... but I still found some non-overdone things funny, like the invisible potion
[15:57:27] phat4life: maybe dynamic programming
[15:57:30] Senjai: I cant say I fully understand it beyond a function that just calls itself. There's many different ways to recurse over things
[15:57:41] Senjai: phat4life: You have a ton of gaps for sure. The thing is, you should.
[15:57:56] Senjai: phat4life: Having a web developer that has spent 2 years learning math instead of engineering is a waste of time
[15:58:04] Senjai: phat4life: Except in the most exceptional of cases
[15:58:05] phat4life: i love math :(
[15:58:10] phat4life: i don't get to use enough math
[15:58:12] Agoldfish: has joined #ruby
[15:58:23] Senjai: phat4life: That's fine, but its not the most important thing in a devs toolkit (for this part of the industry)
[15:58:24] shevy: you are not a real person phat4life
[15:58:25] djdarkbeat: has joined #ruby
[15:58:27] yorickpeterse: if all you do is poop CRUD apps then yeah, it's pretty pointless
[15:58:29] Senjai: now if it was game dev, that's a different story
[15:58:49] sdothum: has joined #ruby
[15:58:59] ndrei: has joined #ruby
[15:59:13] Senjai: yorickpeterse: Even complex apps. The hardest thing for a developer to learn is how to manage complexity, everything else is details
[15:59:28] phat4life: shevy: shadertoy.com
[15:59:29] towski_: has joined #ruby
[15:59:48] phat4life: Senjai: yes! managing complexity is hard for inexperienced devs
[15:59:53] shevy: dunno what that is
[16:00:00] yorickpeterse: Not sure, I think writing good Git commit messages is still the #1 hardest thing
[16:00:01] shevy: but I wanted to create 3D objects via ruby programmatically!
[16:00:01] phat4life: shevy: webgl shader sandbox
[16:00:06] phat4life: shevy: its all just math
[16:00:09] phat4life: but cool as hell
[16:00:11] ZOMGITSABEAR: puts "Is it true that 3 + 2 < 5 - 7?"
[16:00:11] ZOMGITSABEAR: puts 3 + 2 < 5 - 7
[16:00:19] ZOMGITSABEAR: output = true on bottom line?
[16:00:19] yorickpeterse: "fixed stuff" diffstat: 1293812039819023 additions
[16:00:28] ZOMGITSABEAR: false, i mean
[16:00:30] Senjai: yorickpeterse: HAHAHAHAHAAHA so true
[16:00:31] shevy: dragon = Dragon.new
[16:00:32] phat4life: shevy: yeah 3d graphics with ruby is not a good idea
[16:00:33] ZOMGITSABEAR: how does that work
[16:00:35] Senjai: I stand corrected
[16:00:38] shevy: dragon.colour = 'red'
[16:00:48] yorickpeterse: >> 3 + 2 < 5 - 7
[16:00:49] ruboto: yorickpeterse # => false (https://eval.in/383350)
[16:00:51] shevy: dragon.render :to_png
[16:01:04] ZOMGITSABEAR: nop but i mean
[16:01:15] ZOMGITSABEAR: the output on the second line is true of false
[16:01:20] yorickpeterse: >> (3 + 2 < 5) - 7
[16:01:21] ruboto: yorickpeterse # => undefined method `-' for false:FalseClass (NoMethodError) ...check link for more (https://eval.in/383354)
[16:01:23] ZOMGITSABEAR: yet you're putting in a string of numbers
[16:01:34] ZOMGITSABEAR: how does ruby know to automatically put true or false in there
[16:01:37] ZOMGITSABEAR: as the output
[16:01:38] mrmargolis: has joined #ruby
[16:01:44] ZOMGITSABEAR: that's what i'm trying to learn
[16:01:48] yorickpeterse: ZOMGITSABEAR: can you gist it? It's a bit hard to make up from IRC directly
[16:02:09] diegoviola: has joined #ruby
[16:02:15] ZOMGITSABEAR: yorickpeterse: well, the input is a string of numbers as a mathmatical formula.
[16:02:20] ZOMGITSABEAR: the output is true or false
[16:02:29] ZOMGITSABEAR: how does ruby know to use true or false as the output
[16:02:45] sharpmachine: has joined #ruby
[16:02:46] momomomomo: has joined #ruby
[16:02:53] ruboto: We can't help you without your code, please post it to https://gist.github.com
[16:03:02] ZOMGITSABEAR: for reference: http://learnrubythehardway.org/book/ex3.html
[16:03:16] Yiota: has joined #ruby
[16:03:33] Senjai: ZOMGITSABEAR: Comparison operators like > < <= >= == and so on return true or false
[16:03:41] jhass: are zed failed to explain string interpolation prior that example?
[16:03:51] ZOMGITSABEAR: i didn't finish high school. math is hard for me
[16:04:05] ZOMGITSABEAR: i get lesser than, greater than
[16:04:10] volty: comparison yields boolean, + and - have precedence, so the last evaluated is comparison
[16:04:20] ZOMGITSABEAR: but it returns true or false based entirely upon using < or >?
[16:04:31] jlast: has joined #ruby
[16:04:36] jhass: ZOMGITSABEAR: do you understand method calls yet?
[16:04:45] ZOMGITSABEAR: i just sarted 2 days ago
[16:04:45] abyss: apeiros: ok. Thank you.
[16:04:48] Synthead: has joined #ruby
[16:04:48] jhass: "foo".upcase #=> "FOO" ?
[16:04:48] Senjai: ZOMGITSABEAR: Is 5 less than 10?
[16:04:58] ellisTAA: has joined #ruby
[16:04:59] Senjai: ZOMGITSABEAR: Right, so yes means what in code?
[16:05:11] Senjai: yes means true :P
[16:05:11] jhass: ZOMGITSABEAR: < is method calls too, 5.<(4)
[16:05:22] Senjai: jhass: I think thats too much for now :P
[16:05:23] ellisTAA: can anyone recommend a fun open source ruby project that i can participate in?
[16:05:31] Senjai: EllisTAA: I need help in cancancan
[16:05:34] Senjai: there is TONS to do
[16:05:50] Senjai: https://github.com/cancancommunity/cancancan/issues
[16:05:57] ZOMGITSABEAR: i remember reading about a site where users requested a project and programmers could make the project
[16:06:00] drewo: has joined #ruby
[16:06:10] yorickpeterse: I've seen it before and every time I forget the name
[16:06:27] ZOMGITSABEAR: also, quick question before i go back to studying
[16:06:31] ellisTAA: cancan looks cool
[16:06:36] ellisTAA: any others?
[16:06:37] yorickpeterse: I do recall a lot of stuff tagged as "beginner" on it was really _not_ for beginners
[16:06:48] Zai00: has joined #ruby
[16:06:50] ZOMGITSABEAR: how is it that some programmers can make upwards of $100k+
[16:06:52] Senjai: EllisTAA: There are no others, there is only cancan
[16:07:01] spaceghostc2c: ZOMGITSABEAR: Magic.
[16:07:07] yorickpeterse: ZOMGITSABEAR: by negotiating good contracts
[16:07:11] Senjai: EllisTAA: Even writing test applications to verify certain issues would be extremely helpful
[16:07:16] ZOMGITSABEAR: no but i mean, are programmers a precious commodity or something?
[16:07:17] yorickpeterse: and working for companies that can afford it
[16:07:22] ellisTAA: what are test applications?
[16:07:22] aapole: has joined #ruby
[16:07:32] yorickpeterse: Expertise can be worth a lot of money
[16:07:34] spaceghostc2c: ZOMGITSABEAR: There's way more work than developers that are worthwhile.
[16:07:45] Senjai: EllisTAA: I sample rails application that reproduces a bug, that is uploaded to github so bugfixers can pull it down and fix it right away
[16:07:46] spaceghostc2c: So experienced and savvy developers are worth a lot.
[16:07:47] ZOMGITSABEAR: is programming as a career a good choice?
[16:07:47] pepperbreath1: has joined #ruby
[16:07:50] Senjai: without haveing to try and reproduce it
[16:08:05] Senjai: I cant type today.
[16:08:16] ellisTAA: ok i???ll start reading cancan source code
[16:08:19] jhass: if your only motivation is money, I'm not sure
[16:08:24] Senjai: EllisTAA: https://github.com/CanCanCommunity/cancancan/issues/214 is a good one
[16:08:42] spaceghostc2c: ZOMGITSABEAR: For as long as the pay is high, the benefits are substantial, and the perks are hard to count, yes.
[16:08:46] ZOMGITSABEAR: my motivation is fulfilling work that challenges me, and allows me to have a comfortable lifestyle
[16:08:58] Senjai: They pretty much wrote the code that causes the error, try putting that into a dummy rails app and uploading it. Then if you want, you can follow what gets called from where and try to fix it if you like :)
[16:09:06] Scroff: has joined #ruby
[16:09:07] jhass: if you have at least some fun doing, it's fine
[16:09:15] yorickpeterse: ZOMGITSABEAR: if you can stand sitting behind a computer ~9 hours a day yelling at it, sure
[16:09:24] Senjai: undeadaedra: At the moment, yeah. I got plans to make it a lot better
[16:09:24] ZOMGITSABEAR: i know with sysadmin, it's a high stress job
[16:09:28] malconis: has joined #ruby
[16:09:30] ZOMGITSABEAR: is programming high stress?
[16:09:36] yorickpeterse: varies from company to company
[16:09:40] spaceghostc2c: ZOMGITSABEAR: Some people just work like 4-8 hours a day and step away after work.
[16:09:44] undeadaedra: Senjai: what will you call it? cancancancan?
[16:09:50] spaceghostc2c: undeadaedra: cannotcannot
[16:09:54] dfockler: has joined #ruby
[16:09:58] Senjai: undeadaedra: Nope, cancancan version 2 :)
[16:10:13] ZOMGITSABEAR: thanks for all the help, guys
[16:10:17] ZOMGITSABEAR: i really appreciate it
[16:10:40] spaceghostc2c: ZOMGITSABEAR: Anyone mid-level or better shouldn't be making less than six figures working in a tech hub in the US.
[16:10:42] undeadaedra: Is there a bear in here?
[16:10:51] ZOMGITSABEAR: i am a bear, yes
[16:10:55] ogpastaling: has joined #ruby
[16:11:01] undeadaedra: Brown or white?
[16:11:09] ZOMGITSABEAR: good question
[16:11:19] yorickpeterse: ACTION only makes 5 figures :<
[16:11:28] undeadaedra: I just remember that I'm not allowed to ask this in my country
[16:11:32] dfockler: I don't live in a tech hub
[16:11:35] yorickpeterse: Then again I don't live in a third world country such as the US
[16:11:44] Senjai: yorickpeterse: LOL! Canada here
[16:11:46] ZOMGITSABEAR: >third world country
[16:11:54] jhass: it's true
[16:11:56] undeadaedra: sorry, fourth
[16:12:03] yorickpeterse: Isn't Canada just the US but with the guns replaced with maple syrup?
[16:12:13] ZOMGITSABEAR: i mean, i know shit is bad here, but third world? c'mon
[16:12:14] shevy: and colder weather
[16:12:21] shevy: actually they also have lots of guns
[16:12:25] Senjai: Yes, + public health care and services that actually work
[16:12:33] shevy: stolen from europe!!!
[16:12:35] ZOMGITSABEAR: canadians love their hunting and sport shooting
[16:12:37] yorickpeterse: except the giant potholes in Toronto
[16:12:39] ZOMGITSABEAR: just don't have full auto
[16:12:50] ZOMGITSABEAR: alright, i'm getting distracted. i need to go back to studying
[16:12:52] shevy: do they have polar bears in Canada?
[16:12:56] nateberkopec: has joined #ruby
[16:12:58] ZOMGITSABEAR: i'll be back in here with more questions, most likely. hahaha
[16:13:02] undeadaedra: shevy: only positive ones.
[16:13:35] pikos: has joined #ruby
[16:13:49] bruno-: has joined #ruby
[16:14:21] duoi: has joined #ruby
[16:14:21] duoi: has joined #ruby
[16:19:39] francois_: has joined #ruby
[16:20:35] mwlang: Shouldn???t the US be like the 9000th world country? I mean, it???s only ~400 years old???surely more than three countries have come before...
[16:20:47] sharpmachine: has joined #ruby
[16:21:01] InternetFriend: has joined #ruby
[16:21:12] ZOMGITSABEAR: https://www.youtube.com/watch?v=liAbljP1W2Y
[16:21:17] startupality: has joined #ruby
[16:21:55] fantazo: has joined #ruby
[16:22:11] Senjai: 3.5 minutes for 29 specs *facepalm*
[16:22:19] undeadaedra: Are we a majority of non-US people in here? This discussion goes relatively well, for something criticising the US
[16:22:26] jokke: mwlang: it's probably over 9000
[16:22:49] ZOMGITSABEAR: over... 9000!?
[16:22:49] mwlang: heh???US citizens have thick skin.
[16:22:57] jokke: ZOMGITSABEAR: :)
[16:23:04] Senjai: undeadaedra: Possibly, but I would imagine US people in #ruby could be a little more aware of their own advantages and disadvantages.
[16:23:10] jokke: over ninethousaaaaaaand!?
[16:23:11] Senjai: Compared to like, youtube
[16:23:26] undeadaedra: Senjai: possible.
[16:23:31] ZOMGITSABEAR: smell that, guys?
[16:23:31] mwlang: ???and we???re getting a new President next year no matter what, soooo???all is well here. :-)
[16:23:35] ZOMGITSABEAR: smells like... freedom
[16:23:38] railsraider: has joined #ruby
[16:23:39] Senjai: mwlang: If you guys get Trump...
[16:23:41] NeverDie: Vote for Donald Trump
[16:23:42] Senjai: I will lol
[16:23:44] Senjai: all the way
[16:23:49] phat4life: i almost got job in Germany (i live in the us)
[16:23:53] jokke: mwlang: or a president..ine?
[16:23:54] alex88: has joined #ruby
[16:23:55] ZOMGITSABEAR: donald trump is rucking freetarded
[16:24:07] NeverDie: All the more reason to vote for him.
[16:24:08] undeadaedra: mwlang: we're going to get a new president in some time too. But this scares me.
[16:24:09] phat4life: I wish the USA's health care system was like germanies
[16:24:17] Senjai: ZOMGITSABEAR: And other presidents aren't?
[16:24:18] ZOMGITSABEAR: bernie sandrs, guys
[16:24:20] mwlang: only way I???ll vote for Trump is if he shaves his head. :-)
[16:24:25] ZOMGITSABEAR: he's the best shot
[16:24:32] ZOMGITSABEAR: read up on him
[16:24:33] phat4life: ZOMGITSABEAR: ive vote for him
[16:24:36] jokke: phat4life: that would be considered communism!
[16:24:37] ZOMGITSABEAR: make your vote count
[16:24:38] phat4life: er, i would
[16:24:57] phat4life: its funny, because if you make over 55k in germany, you can get private insurance
[16:24:59] Senjai: We should probably get this off politics though forreals.
[16:25:07] undeadaedra: Communism? In my USA? No way!
[16:25:40] undeadaedra: Could you fuck this poor yeah far away?
[16:26:13] jhass: into #ruby-offtopic you mean?
[16:26:30] dfockler: why does receiving a block need the & sign?
[16:26:31] ZOMGITSABEAR: that makes a lot of sense, guys
[16:26:37] jhass: dfockler: it doesn't
[16:26:43] fujimura: has joined #ruby
[16:26:48] jhass: assigning it to a variable does
[16:26:52] ZOMGITSABEAR: which youtube videos do you guys recommend?
[16:26:58] ZOMGITSABEAR: this one looks promising https://www.youtube.com/watch?v=Dji9ALCgfpM
[16:27:03] phat4life: jhass: does the & create a proc?
[16:27:16] jhass: some say so some say otherwise
[16:27:19] Senjai: ZOMGITSABEAR: Let's not derail the channel :P
[16:27:23] Senjai: phat4life: it calls to_proc
[16:27:25] _djbkd: has joined #ruby
[16:27:26] jhass: I'd say from a users perspective it does
[16:27:30] Senjai: phat4life: on the symbol
[16:27:32] mwlang: oh, this is the Ruby channel? Ah???if they???d written our voting booth???s system in Ruby???.:-)
[16:27:40] cndiv: has joined #ruby
[16:27:47] Senjai: phat4life: &:thing is semantic suguar for :thing.to_proc iirc
[16:27:49] ZOMGITSABEAR: i meant youtube video tutorials
[16:27:49] dfockler: jhass: so def take_block(&blk) can be def take_block(blk) ?
[16:27:56] jhass: dfockler: no
[16:27:59] ZOMGITSABEAR: i linked a video tutorial on ruby
[16:28:00] phat4life: Senjai: gotcha
[16:28:04] jhass: dfockler: but def take_block
[16:28:16] mwlang: sorry, I???ve been working 9.5 hours w/o a break. :-o
[16:28:37] quimrstorres: has joined #ruby
[16:28:52] Senjai: >> thing = ->{}; thing.is_a?(Proc)
[16:28:53] ruboto: Senjai # => true (https://eval.in/383356)
[16:28:57] Senjai: phat4life: ^
[16:29:16] skade: has joined #ruby
[16:29:30] mwlang: it???s been a long time since I had to hit 4 different deadlines (four clients) in relatively same space.
[16:29:44] mrmargol_: has joined #ruby
[16:29:50] mwlang: (I don???t recommend it)
[16:29:53] phat4life: mwlang: we had 40 clients launch on a single day
[16:29:57] phat4life: multiple times
[16:30:04] eam: mwlang: better than not hitting the deadlines ;)
[16:30:11] Senjai: LOL, TIL you can assign things to lambda
[16:30:29] mwlang: phat4life: hope you had a team. :-)
[16:30:37] jhass: dfockler: to make it clear, all methods implicitly take a block, def foo(&blk) just "captures" any passed one and assigns it to blk
[16:30:49] imperator: ACTION despises stabby lambda in ruby
[16:30:49] sharpmachine: has joined #ruby
[16:30:55] ZOMGITSABEAR: what exactly is an integer?
[16:31:00] jhass: a whole number
[16:31:15] ZOMGITSABEAR: and the name for a number with a decimal place is...?
[16:31:22] elaptics: imperator: what is wrong with stabby lambda's?
[16:31:32] Senjai: imperator: why?
[16:31:37] undeadaedra: >> [1, 1.1].map(&:class)
[16:31:38] ruboto: undeadaedra # => [Fixnum, Float] (https://eval.in/383357)
[16:31:42] dfockler: jhass: ok, so that allows you to use the block as a variable within the method instead of actually running the block?
[16:31:54] bricker: has joined #ruby
[16:31:58] undeadaedra: ah, yes, silly Fixnum >_>
[16:32:04] Senjai: >> Fixnum.superclass
[16:32:05] ruboto: Senjai # => Integer (https://eval.in/383358)
[16:32:06] jhass: not sure where the "instead of" is coming from, but yes
[16:32:17] nikhgupt: has joined #ruby
[16:32:17] mwlang: eam: true, dat.
[16:32:29] imperator: gimmick shoehorned into core by the FP proponents, looks like poo, never see it used in production code
[16:32:41] nobitanobi: has joined #ruby
[16:32:43] Senjai: imperator: We use it all the time
[16:32:47] elaptics: imperator: you haven't seen my production code then :)
[16:32:48] dfockler: jhass: I was thinking of passing a block and yielding is that incorrect?
[16:32:59] rbowlby: has joined #ruby
[16:33:01] Senjai: imperator: IMO its better than saying lambda explicitly
[16:33:05] phat4life: dfockler: yield all the things!
[16:33:09] jhass: dfockler: perhaps? that question is a bit vague
[16:33:09] imperator: should probably switch languages if you want FP then
[16:33:19] pikos: has left #ruby: ("...")
[16:33:22] Senjai: imperator: Lambdas aren't just for FP
[16:33:24] dfockler: jhass: I'm understand it vaguely :P
[16:33:30] dfockler: understanding
[16:33:36] jhass: I guess ;)
[16:33:37] Senjai: We have Procs, lambdas are just stricter procs (kind of)
[16:33:37] imperator: phat4life, got smp?
[16:34:09] ZOMGITSABEAR: so let's say you've got a ine that says something like puts num_one.to_s
[16:34:13] ZOMGITSABEAR: what is that and what does it do
[16:34:13] imperator: i tried to learn ocaml at one point....jeesh
[16:34:18] mwlang: You know???.I???d like to read a good in-depth article on Procs vs. Lambdas???I don???t quite grok their differences.
[16:34:23] ZOMGITSABEAR: i know it's to a string, but what does that mean
[16:34:27] imperator: it's fast, but gawd, that syntax, could not deal
[16:34:31] Senjai: ZOMGITSABEAR: Convert num_one to a string, pass that string to the puts function
[16:34:38] Senjai: puts will print it to stdout, usually the terminal
[16:35:05] ZOMGITSABEAR: but what is a string
[16:35:19] Senjai: ZOMGITSABEAR: Sorry dude, you should pick up a book, thats the basic of basics :P
[16:35:20] ZOMGITSABEAR: gotcha. now i know ruby
[16:35:25] wasamasa: ACTION feels uneasy about allcaps nicks
[16:35:25] diegoviola: has joined #ruby
[16:35:29] Senjai: ZOMGITSABEAR: I recommend programming ruby, by the pragprog guys
[16:35:54] elaptics: imperator: do you just pass lambda as-is in methods then? i.e. method_name lambda { puts "hi" } instead of method_name -> { puts "hi" }
[16:36:00] undeadaedra: ZOMGITSABEAR: Strings are a basic programming structure, almost any language has it.
[16:36:17] Senjai: any modern language
[16:36:22] _djbkd: has joined #ruby
[16:36:47] Senjai: wasamasa: I wouldnt mention that, if he doesnt know what a string is I wouldnt want to bother him with the intricacies around strings vs character arrays, or the subtle differences between languages
[16:36:51] imperator: has left #ruby: ("Leaving")
[16:37:02] evanjs: has joined #ruby
[16:37:16] Senjai: ZOMGITSABEAR: https://pragprog.com/book/ruby4/programming-ruby-1-9-2-0
[16:37:42] towski_: has joined #ruby
[16:38:06] alphaatom: has joined #ruby
[16:38:10] jhass: ah bad URL :D
[16:38:25] wasamasa: damn these slugs
[16:38:34] dfockler: so like `map { do stuff }` is passing the block as an argument to map?
[16:38:38] quimrstorres: has joined #ruby
[16:38:53] Guest250: has joined #ruby
[16:38:59] erts: has joined #ruby
[16:39:05] jhass: dfockler: "as an argument" implies there's another way, which there isn't, but yes
[16:39:13] Blizzy: has joined #ruby
[16:39:13] jhass: every method has this implicit block argument
[16:39:16] axl__: has joined #ruby
[16:39:58] ZOMGITSABEAR: ok, i'll read that book
[16:40:03] ZOMGITSABEAR: downloading now
[16:40:46] dfockler: jhass: so the implicit block argument allows methods to yield?
[16:40:58] olistik: has joined #ruby
[16:41:03] toretore: has joined #ruby
[16:41:07] jhass: yield invokes the block passed via the implicit block argument
[16:41:17] dfockler: and the `&` is just making the block argument explicit
[16:41:22] jhass: pretty much
[16:41:32] jhass: it remains optional though
[16:41:47] elaptics: dfockler: usually because there's no guarantee a block will have been passed you'll see code like yield if block_given?
[16:42:39] nateberkope: has joined #ruby
[16:42:50] bobby1: has joined #ruby
[16:43:12] pontiki: has joined #ruby
[16:43:15] rgs_: has joined #ruby
[16:43:18] mello_: has joined #ruby
[16:43:18] railsraider: has joined #ruby
[16:43:24] drew0: has joined #ruby
[16:43:26] rodferso2: has joined #ruby
[16:43:27] nikhgupt`: has joined #ruby
[16:43:33] dmolina1: has joined #ruby
[16:43:41] Dopagod: has joined #ruby
[16:43:44] whippythellama_: has joined #ruby
[16:43:49] j4cknewt_: has joined #ruby
[16:43:56] [yalue]: has joined #ruby
[16:44:58] Xeago: has joined #ruby
[16:45:02] jacaho0: has joined #ruby
[16:45:04] corehook: has joined #ruby
[16:45:18] MatthewsFace: has joined #ruby
[16:46:47] cats: has joined #ruby
[16:46:53] _djbkd: has joined #ruby
[16:48:04] drizz: has joined #ruby
[16:48:26] freerobby: has joined #ruby
[16:50:54] sharpmachine: has joined #ruby
[16:51:29] bgmarx: has joined #ruby
[16:51:35] JoshGlzBrk: has joined #ruby
[16:52:04] ellisTAA: has joined #ruby
[16:52:17] skade: has joined #ruby
[16:53:07] Spami: has joined #ruby
[16:53:25] alphaatom: has joined #ruby
[16:53:56] j416: has joined #ruby
[16:54:02] krisquigley: has joined #ruby
[16:54:15] dg-ratiodata: has joined #ruby
[16:55:08] towski_: has joined #ruby
[16:55:46] Alina-malina: has joined #ruby
[16:56:10] deric_skibotn: has joined #ruby
[16:56:32] cirn0: has joined #ruby
[16:56:48] lkba: has joined #ruby
[16:58:13] Scroff: has joined #ruby
[16:59:07] bootstrappm: has joined #ruby
[17:00:06] otherj: has joined #ruby
[17:00:28] nikhgupt: has joined #ruby
[17:01:02] josh: has joined #ruby
[17:03:28] fabrice31: has joined #ruby
[17:04:17] Scrofff: has joined #ruby
[17:04:20] episage: has joined #ruby
[17:04:38] episage: green_url = e.find_element(:css => "cite").text
[17:04:49] torpig: has joined #ruby
[17:04:56] Xeago: has joined #ruby
[17:05:07] episage: find_element may raise an exception sometimes, how can I get the text of the elem or nil in case it throws?
[17:05:18] wallerdev: has joined #ruby
[17:05:23] episage: its selenium
[17:05:34] nikhgupta: has joined #ruby
[17:05:58] GPrime: has joined #ruby
[17:06:06] bnagy: blah = blah rescue nil
[17:06:14] lfox: has joined #ruby
[17:06:24] pontiki: nothing will rescue you from the blahs
[17:06:25] bnagy: but I hate doing that :< It's giving in to shitty code
[17:06:30] BTRE: has joined #ruby
[17:06:49] InternetFriend: has joined #ruby
[17:06:55] nikhgupta: has joined #ruby
[17:07:10] dseitz: has joined #ruby
[17:07:54] francois_: has joined #ruby
[17:08:12] jhass: find_elements().first ?
[17:08:30] episage: jhass: but its not too nice coz code gets bloated with if
[17:08:47] episage: and sometimes i want to get property different to text
[17:08:55] episage: bnagy: hmm ok thanks for advice, im gonna give it
[17:08:59] nikhgupta: has joined #ruby
[17:09:00] jhass: episage: why not capybara?
[17:09:07] jhass: wraps that stuff up in a nicer API + more
[17:09:56] sinkensabe: has joined #ruby
[17:10:09] jhass: and eh, inline rescue giving you nil or find_elements().first giving you nil... where's the diff?
[17:10:20] hsps_: has joined #ruby
[17:10:58] ellisTAA: has joined #ruby
[17:11:11] tomphp: has joined #ruby
[17:11:57] lkba: has joined #ruby
[17:12:58] postmodern: has joined #ruby
[17:13:21] ramfjord: has joined #ruby
[17:14:38] tomphp_: has joined #ruby
[17:15:05] sharpmachine: has joined #ruby
[17:16:17] tcrypt: has joined #ruby
[17:16:26] whippythellama_: has joined #ruby
[17:17:53] dg-ratiodata: has joined #ruby
[17:18:59] mikecmpbll: has joined #ruby
[17:19:51] j0n3: has joined #ruby
[17:21:12] _ixti_: has joined #ruby
[17:25:54] slackbotgz: has joined #ruby
[17:26:13] rbennacer: has joined #ruby
[17:27:44] fgo: has joined #ruby
[17:28:02] sharpmachine: has joined #ruby
[17:28:18] rushed: has joined #ruby
[17:28:19] episage: has joined #ruby
[17:28:55] gianlucadv: has joined #ruby
[17:29:48] BanzaiJoe: has joined #ruby
[17:30:22] rbowlby_: has joined #ruby
[17:30:54] episage_: has joined #ruby
[17:31:20] ht__: has joined #ruby
[17:32:02] nikhgupta: has joined #ruby
[17:32:32] momomomomo: has joined #ruby
[17:33:37] s2013: has joined #ruby
[17:34:52] sharpmachine: has joined #ruby
[17:36:34] mister_solo: has joined #ruby
[17:37:29] GayBoner: has joined #ruby
[17:37:59] GayBoner: what kind of stuff should people be here for?
[17:38:45] c-c: read topic
[17:38:55] slash_nick: gemstones... mainly rubies
[17:38:59] aaeron: has joined #ruby
[17:39:22] jhass: !kick GayBoner http://ruby-community.com/pages/user_rules#rule_2_10
[17:39:22] helpa: jhass: No.
[17:39:25] ruboto: ruboto kicked GayBoner:
[17:39:25] ruboto: -o ruboto
[17:39:25] GayBoner: has joined #ruby
[17:39:56] jhass: GayBoner: one minute to change your nick, see kick reason
[17:39:59] fusillicode: has joined #ruby
[17:40:05] fusillicode: has left #ruby: ()
[17:40:12] episage: has joined #ruby
[17:40:37] jpfuentes2: has joined #ruby
[17:41:05] bgmarx: has joined #ruby
[17:41:20] jhass: !ban GayBoner !T 1w http://ruby-community.com/pages/user_rules#rule_2_10
[17:41:20] ChanServ: +b GayBoner!*@*
[17:41:20] ChanServ: ChanServ kicked GayBoner: http://ruby-community.com/pages/user_rules#rule_2_10
[17:41:45] AndroidLoverInSF: has joined #ruby
[17:41:47] Outlastsheep: Makes you wonder how those people even get by on IRC.
[17:41:59] Outlastsheep: With such a nick you're bound to get banned in most places.
[17:42:08] jhass: ACTION shrugs
[17:42:29] segfalt: has joined #ruby
[17:43:08] bougyman: maybe it's sarcastic
[17:43:43] jhass: nah, kid trying to offend people, that's all, don't worry about it
[17:43:53] volsus: has joined #ruby
[17:44:02] Outlastsheep: Whatever it is, it's gone now.
[17:44:15] Outlastsheep: ACTION goes back to work.
[17:44:20] hal_9000: what does Outlastsheep mean anyway? :)
[17:44:47] failshell: has joined #ruby
[17:44:50] cirn0: has joined #ruby
[17:45:34] TvL2386: hi guys, anybody familiar with rabbitmq and bunny?
[17:45:42] ruboto: Just ask your question, if anyone has or can, they will respond.
[17:45:55] Outlastsheep: hal_9000: Oh, one sec...
[17:46:01] RegulationD: has joined #ruby
[17:46:29] corehook: has joined #ruby
[17:46:39] Outlastsheep: My original name was 'Fiestaguy', which turned into 'Fiestasheep' after I discovered my new favourite animal (They're so fluffy and adorable! ^w^) Then someone gifted me the horror game 'Outlast' on Steam.
[17:46:42] lkba_: has joined #ruby
[17:47:08] hal_9000: ah, it all makes sense
[17:47:40] Outlastsheep: I changed my AFK-Nick to 'Outlastsheep' (As-in 'playing outlast'.) I was playing the game so often (and thus used this nick so often) the people in an IRC Channel I staff started knowing me as 'Outlastsheep' rather than 'Fiestasheep' And thus I kept this name.
[17:47:51] alphaatom: has joined #ruby
[17:48:00] Outlastsheep: Besides, I've stuck with 'Fiesta' for 4 years now. Nice to get a change now and then.
[17:48:12] TvL2386: alrighty: I'm thinking of replacing our proprietary MQ stuff (implementing RPC) with a standard using RabbitMQ and the bunny gem. I'm implementing the RPC server pattern but think it's a bit too complex and would like to make it simpler by hiding the nasty stuff... Not sure how to do that though... I was wondering if anybody ever tried to do the same thing
[17:48:12] luksaur: has joined #ruby
[17:48:45] aaeron: has joined #ruby
[17:49:05] jackjackdripper: has joined #ruby
[17:50:44] rgs: has joined #ruby
[17:50:49] ndrei_: has joined #ruby
[17:51:01] msgodf: has joined #ruby
[17:53:00] simplyianm: has joined #ruby
[17:53:18] msgodf: has joined #ruby
[17:53:20] bnagy: probably wouldn't do it again, tbh, there are much more mature options off the shelf now
[17:54:07] Senjai: TvL2386: You dont gain much from using Rabbit
[17:54:07] TvL2386: bnagy, like what?
[17:54:30] Senjai: Not in ruby at least
[17:54:59] whippythellama: has joined #ruby
[17:55:04] renderful: has joined #ruby
[17:55:11] failshell: has joined #ruby
[17:55:31] TvL2386: Senjai, the purpose is to replace a legacy MQ "network" of clients/workers... The current infrastructure is heading into a wall due to being old and soon I will run into backporting legacy libs (libzmq v2)
[17:55:55] TvL2386: Senjai, I need to start looking for a replacement and rabbitmq caught my eye
[17:56:10] msgodf: has joined #ruby
[17:56:14] bmalum: has joined #ruby
[17:56:32] TvL2386: it's also in use for mcollective which is doing stuff with puppet (not my project), anyway: we already have rabbitmq and I just thought it would be good to use it
[17:56:58] toretore: TvL2386: what's the reason you want to replace it specifically?
[17:58:05] TvL2386: toretore, because the current MQ infrastructure is made by a single person in the company and is not based on any standards. The workers, clients and broker are all self invented making use of libzmq package, ffi, ffi-rzmq...
[17:58:05] dionysus69: has joined #ruby
[17:58:16] msgodf: has joined #ruby
[17:58:16] mister_solo: has joined #ruby
[17:58:32] Senjai: TvL2386: Sidekiq, Resque
[17:58:34] TvL2386: it's outdated and needs an upgrade... Instead of investing in this proprietary solution, I'd like to adopt standards and not reinvent the wheel
[17:58:40] Senjai: TvL2386: If its super basic you can go with delayed job
[17:58:44] toretore: TvL2386: and what's wrong with it?
[17:59:13] toretore: TvL2386: amqp/rabbitmq is easy, at least if you know how it works already
[17:59:21] bricker: has joined #ruby
[17:59:45] episage: has joined #ruby
[17:59:45] toretore: it's like rails, it does most of the things you want out of the box
[18:00:00] symbol: has joined #ruby
[18:00:08] nikhgupta: has joined #ruby
[18:00:28] msgodf: has joined #ruby
[18:01:04] momomomomo: has joined #ruby
[18:01:25] TvL2386: Senjai, it's not super basic... The workers need to run on certain machines and do things like firewall reload, vpn creation, vm deployment etcetera
[18:01:29] simplyianm: has joined #ruby
[18:01:37] edwinvdgraaf: has joined #ruby
[18:01:40] Senjai: TvL2386: That sounds basic
[18:01:42] TvL2386: toretore, you're not mentioning bunny
[18:01:58] TvL2386: toretore, gonna checkout amqp
[18:02:20] Senjai: What the job does isn't what makes it complex
[18:02:28] Senjai: Do the workers have to be organized into queues?
[18:02:43] Senjai: Do they automatically prioritize things? Do things have to wait for workers to finish their jobs?
[18:02:54] GPrime: has joined #ruby
[18:03:37] aapole: has joined #ruby
[18:03:44] sharpmachine: has joined #ruby
[18:03:46] toretore: TvL2386: amqp is the protocol
[18:03:48] TvL2386: well... these workers run on certain machines and only do a single job. The worker on the firewall is able to install the ruleset and reload. The worker running on a management machine interacts with Cisco to create a vpn account. They are connected to a MQ broker awaiting instructions
[18:04:00] toretore: bunne is a ruby library that implements it
[18:04:06] sohrab: has joined #ruby
[18:04:32] Scroff: has joined #ruby
[18:04:38] aaeron: has joined #ruby
[18:04:38] TvL2386: toretore, yeah I checked... ruby-amqp is an existing lib built around event-machine, but they refer to bunny unless event-machine is a requirement
[18:04:41] krisquigley: has joined #ruby
[18:04:53] theery: has joined #ruby
[18:05:01] toretore: it's the same thing, one uses em one doesn't
[18:05:56] TvL2386: toretore, clear :-)
[18:06:24] Rubie: has joined #ruby
[18:07:02] TvL2386: ah well... time to play with bunny :-)
[18:08:21] casadei: has joined #ruby
[18:09:00] keernel: has joined #ruby
[18:09:29] jwaldrip: has joined #ruby
[18:09:49] diegoviola: I need to make some HTTP calls from sinatra, i.e. hit some API and return/parse json from it, any ideas how?
[18:10:01] diegoviola: I asked on #sinatra but it's quiet over there
[18:10:01] blackmesa: has joined #ruby
[18:10:13] jhass: how would you do it outside sinatra?
[18:10:14] dgutierrez1287: has joined #ruby
[18:10:50] Senjai: diegoviola: Use Net::HTTP
[18:11:02] simplyianm: has joined #ruby
[18:11:04] Senjai: http://ruby-doc.org/stdlib-2.2.2/libdoc/net/http/rdoc/Net/HTTP.html
[18:11:05] dfockler: diegoviola: or one of the plethora of other HTTP client libs
[18:11:29] Senjai: I recommend Net::HTTP over almost everything else
[18:12:09] diegoviola: Senjai: why? because it's part of the stdlib?
[18:12:17] Senjai: No, because it works
[18:12:20] Senjai: and doesnt modify any of your classes
[18:12:25] Senjai: and is flexible
[18:12:52] Spami: has joined #ruby
[18:12:52] rbennacer: has joined #ruby
[18:13:37] symm-: has joined #ruby
[18:14:11] centrx: has joined #ruby
[18:14:26] Senjai: If I had to suggest one to -avoid- it'd be https://github.com/jnunemaker/httparty
[18:14:42] InternetFriend: has joined #ruby
[18:14:44] centrx: Senjai, Why?
[18:14:45] jwaldrip_: has joined #ruby
[18:15:05] centrx: "Requirements...You like to party!"
[18:15:14] diegoviola: Senjai: fair enough, thanks
[18:15:28] fujimura: has joined #ruby
[18:15:37] Senjai: centrx: That's only half of the reason ;)
[18:16:08] phat4life: centrx: red flag
[18:17:14] michael_mbp: has joined #ruby
[18:17:16] Zai00: has joined #ruby
[18:17:33] quimrstorres: has joined #ruby
[18:17:34] vickleton: has joined #ruby
[18:17:54] dfockler: I like rest-client, it has good documentation, and seems to work fine
[18:18:39] failshell: has joined #ruby
[18:19:41] Senjai: I prefer https://github.com/lostisland/faraday when not using net/http
[18:19:45] Senjai: but thats still rare
[18:20:02] phat4life: i have uses faraday
[18:20:06] DroidBur_: has joined #ruby
[18:21:32] Ponyo: has joined #ruby
[18:22:08] Ponyo: Hi there, could someone explain to me why we use a colon infront of the operator in a reduce function? (5..10).reduce(:+) Thanks
[18:22:45] undeadaedra: to make it a symbol
[18:22:59] ruboto: undeadaedra # => Symbol (https://eval.in/383398)
[18:24:14] jphenow: has joined #ruby
[18:24:44] jenrzzz: has joined #ruby
[18:24:48] sharpmachine: has joined #ruby
[18:24:49] Senjai: >> :+.to_proc
[18:24:50] ruboto: Senjai # => #<Proc:0x40608200> (https://eval.in/383401)
[18:24:53] jwaldrip_: has joined #ruby
[18:25:48] Ponyo: thANK YOU :)
[18:25:49] droidburgundy: has joined #ruby
[18:25:57] phat4life: Ponyo: any string can be a symbol, but somtimes you have to do :"mystring-sdfsd"
[18:25:57] Ponyo: Sorry, thank you :)
[18:26:17] symbol: has left #ruby: ("WeeChat 1.1")
[18:26:29] NightsKing: has joined #ruby
[18:26:30] davedev24: has joined #ruby
[18:26:31] Senjai: I hate quoted symbols :P, very rare ly is it ever a necessitry
[18:26:45] phat4life: i hate it too, but sometimes i need a -
[18:27:01] phat4life: like in nokogiri, i had to use lots of :""
[18:27:09] phat4life: because the xml for jenkins is shitty
[18:27:44] micmus: has joined #ruby
[18:28:04] undeadaedra: there isn't a % syntax for symbols?
[18:28:27] phat4life: you mean liek %(a b c d)?
[18:28:36] paulcsmith: has joined #ruby
[18:28:47] Ponyo: Why use a symbol instead of a string?
[18:29:11] Ponyo: Nm, I read :)
[18:29:38] phat4life: Ponyo: symbols are immutable, and a given symbol is guarneteed to always be the same
[18:30:01] x1337807x: has joined #ruby
[18:30:39] cirn0: has joined #ruby
[18:31:09] undeadaedra: phat4life: like %q(text), but that will provide a symbol
[18:31:09] Senjai: >> puts :thing.object_id; puts :thing.object_id
[18:31:10] ruboto: Senjai # => 417458 ...check link for more (https://eval.in/383405)
[18:31:22] ReK2: has joined #ruby
[18:31:33] undeadaedra: we have those for strings, regex, shell commands, array, symbol arrays
[18:31:36] closer: has joined #ruby
[18:31:43] undeadaedra: and surely more I don't know about
[18:31:57] jxpx777: has joined #ruby
[18:32:10] phat4life: wierd that %q works lol
[18:32:12] keernel: has joined #ruby
[18:32:20] undeadaedra: %q = '', %Q = "" iirc
[18:32:26] j4cknewt: has joined #ruby
[18:32:27] arturhoo: has joined #ruby
[18:32:38] phat4life: but is % the same as %Q
[18:32:50] swgillespie: has joined #ruby
[18:32:57] djdarkbeat: has joined #ruby
[18:33:14] undeadaedra: >> a = "world"; [ %(Hello #{a}), %q{Hello #{a}}, %Q|Hello #{a}| ]
[18:33:15] ruboto: undeadaedra # => ["Hello world", "Hello \#{a}", "Hello world"] (https://eval.in/383409)
[18:33:44] djellemah: >> %s(this is a symbol)
[18:33:45] ruboto: djellemah # => :"this is a symbol" (https://eval.in/383410)
[18:34:07] baweaver: has joined #ruby
[18:34:12] jwaldrip_: has joined #ruby
[18:34:14] Senjai: The only % I use often is the one for an array of symbols
[18:34:22] Senjai: >> %i|one two three four|
[18:34:23] ruboto: Senjai # => [:one, :two, :three, :four] (https://eval.in/383411)
[18:34:30] undeadaedra: This one is practical
[18:34:34] Senjai: Just because arrays of constant symbols are annoying
[18:36:49] learath: has joined #ruby
[18:37:08] cornytoad_: has joined #ruby
[18:37:19] ogpastal_: has joined #ruby
[18:37:22] hahuang65: has joined #ruby
[18:37:58] learath: is there a clean/correct way to iterate through an array, and return true if [any|all] array elements return [true|false]
[18:38:41] undeadaedra: any? and all?, iirc
[18:38:42] LiquidInsect: [1,2,3].any?{|number| number == 1}
[18:38:49] LiquidInsect: [1,2,3].all?{|number| number == 1}
[18:39:34] jwaldrip_: has joined #ruby
[18:39:44] Ponyo: When we use a symbol, we don't define it's value, it's existence is all we care about?
[18:40:09] learath: LiquidInsect/undeadaedra: thanks
[18:40:09] davedev24_: has joined #ruby
[18:40:49] LiquidInsect: Ponyo: basically, yes. A symbol is just an identifier
[18:41:18] mdw: has joined #ruby
[18:41:19] otherj: has joined #ruby
[18:41:29] Ponyo: Ok I think that helps finally put them in place. I'm still not sure why reduce needs a symbol and not a string, but at least symbols are making more sense :)
[18:41:37] rbowlby: has joined #ruby
[18:42:28] undeadaedra: because reduce requires a symbol
[18:42:48] undeadaedra: symbols are used as fixed identifiers, such as method names
[18:42:53] baweaver: here's the thing though on that
[18:43:02] baweaver: + is a method on numbers
[18:43:13] baweaver: so symbol to proc makes perfect sense there
[18:43:34] drewo: has joined #ruby
[18:43:40] baweaver: it requires an argument
[18:43:48] diegoviola: I have some code that does res = Net::HTTP.get_response(uri) and I get this back with res.body:
[18:43:50] diegoviola: => "{\n \"type\": \"search_results\",\n \"total\": 1,\n \"results\": [\n {\n \"type\": \"article\",\n \"article_id\": 792488,\n \"url\": \"https://demo360.neoassist.com:80/API/kb/articles/792488.json\",\n \"title\": \"Como fa\xC3\xA7o para comprar um presente?\",\n \"body\": \"Lojas<br>Loja Virtual<br>Produtos com possibilidade de
[18:43:52] diegoviola: troca<br>Vale presente\",\n \"category_id\": \"0\",\n \"search_score\": 38.6152505875\n }\n ]\n}"
[18:44:05] baweaver: One of the shortcomings of being loose with parens
[18:44:18] baweaver: diegoviola: put it in a gist
[18:44:25] diegoviola: how do I get only the body from there? because I need to gsub the hell out of that
[18:44:32] diegoviola: to extract some data from it
[18:44:43] undeadaedra: it looks like JSON data
[18:44:45] jwaldrip_: has joined #ruby
[18:44:49] undeadaedra: you can JSON.parse
[18:45:09] diegoviola: https://gist.github.com/diegoviola/484985907d849e404c0b
[18:45:10] baweaver: then it's just a hash
[18:45:37] djellemah: >> :+.to_proc.call(2,3)
[18:45:38] ruboto: djellemah # => 5 (https://eval.in/383412)
[18:45:51] djellemah: >> '+'.to_proc.call(2,3)
[18:45:52] ruboto: djellemah # => undefined method `to_proc' for "+":String (NoMethodError) ...check link for more (https://eval.in/383413)
[18:46:02] baweaver: the point is it's binary
[18:46:02] Oog: has joined #ruby
[18:46:07] diegoviola: I get this after I JSON.parse() ithttps://gist.github.com/diegoviola/57e33fb14b52182a5079
[18:46:13] diegoviola: I get this after I JSON.parse() it https://gist.github.com/diegoviola/57e33fb14b52182a5079
[18:46:15] baweaver: most functions you use &:name on are unary
[18:46:34] mistnim: has joined #ruby
[18:46:40] undeadaedra: diegoviola: you get a hash, so you can access all members of your result
[18:47:48] baweaver: >> def plus(y) ->x{x+y} end; (1..5).map(&plus(2))
[18:47:49] ruboto: baweaver # => [3, 4, 5, 6, 7] (https://eval.in/383414)
[18:47:54] diegoviola: undeadaedra: so I have to do hash["results"].first to get teh first and so on?
[18:48:09] baweaver: Why don't you try and find out?
[18:48:20] baweaver: you already have it in a REPL
[18:49:22] mdw: hey guys, what is Rails going to do to improve scalability? It seems everyone is ditching Rails once they hit scale (was just reading Parse blog on how the moved to Go from Ruby/Rails). I love Rails when I'm working on side projects (easy to use, convention over configuration, etc) but I'm worried it's going to fade away from relevance if it doesn't address some things.
[18:49:59] jwaldrip_: has joined #ruby
[18:51:02] spider-mario: has joined #ruby
[18:51:22] jackjackdripper: I'm trying to parse long ass json returned by collins and within the json are some arrays I would like to sort the data in that array. so it will come to doing something like parsed["data"]["Data"][0]["ASSET"]["TAG"] I plan to just go through 0 to what ever until end if it returns nil. in which I get NoMethodError: undefined method `[]' for nil:NilClass. any way I can escape this?
[18:51:31] otherj: mdw, this is a pretty tired question
[18:51:38] otherj: mdw, if you can't scale rails you're doing it wrong
[18:51:51] corehook: has joined #ruby
[18:52:02] ruboto: mdw, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[18:52:24] otherj: he's not asking there because he knows he can't troll this there
[18:52:26] mary5030: has joined #ruby
[18:52:34] mdw: otherj i'm not trolling
[18:52:46] mdw: and I don't think your response is very helpful to be honest
[18:53:07] centrx: mdw, "Everyone" is not ditching Rails for scalability
[18:53:28] centrx: mdw, The most common examples of this are giant Top 10 websites that typically use their own custom implementations of things anyway
[18:53:31] otherj: I'm not sure you should expect a "helpful" answer when you ask a trollish question and obviously without doing any research
[18:53:58] mdw: the truth many people are now moving away from Rails and personally I think it's a bit concerning. I've been following Elixir lang (I link Ruby syntax) and Phoenix promises to do what Rails can't.
[18:54:07] mdw: (I like*)
[18:54:24] otherj: ACTION yawns
[18:54:25] centrx: There are a lot of unstated assumptions in what you're saying
[18:54:38] swgillespie: has joined #ruby
[18:54:41] Frem: has joined #ruby
[18:55:31] sandstrom: has joined #ruby
[18:55:50] mdw: well it seems the problem is the one-process per request nature of Rails
[18:56:09] mdw: and things like Eventmachine and JRuby have their own problems
[18:56:28] kadoppe: has joined #ruby
[18:56:32] diegoviola: I don't want to have to do response["results"].first though
[18:56:44] undeadaedra: you don't have to
[18:57:01] Senjai: mdw: Really, I'm pretty sure a lot of people are moving to Rails
[18:57:03] alphaatom: has joined #ruby
[18:57:14] Senjai: Rails can be scaled just fine
[18:57:17] diegoviola: undeadaedra: how else do I get the "body" there
[18:57:28] undeadaedra: depends on what you want to do
[18:57:30] Senjai: If you want websockets, don
[18:57:33] Senjai: don't use rails
[18:57:36] Senjai: Thats a given.
[18:57:43] diegoviola: undeadaedra: access the body from results
[18:57:46] konieczkow: has joined #ruby
[18:57:49] Senjai: You can have that built in a language meant to solve that problem
[18:57:51] Senjai: and use it with rails
[18:57:53] Yiota: has joined #ruby
[18:57:57] undeadaedra: Hashes and Arrays have plenty of methods to iterate and transform data, diegoviola
[18:57:58] mdw: Senjai I live in London, I don't see many Rails contracts (though I guess in the US it's different). I would like to see that change but businesses here want scalability.
[18:58:11] francois_: has joined #ruby
[18:58:20] duderonomy: has joined #ruby
[18:58:33] mdw: Senjai yes, Phoenix does websockets much better than Rails
[18:58:41] diegoviola: undeadaedra: that makes sense
[18:59:09] Senjai: mdw: I dont know man, we have clients that are extremely large and operate just fine.
[18:59:22] Senjai: mdw: Yeah, but you dont need websockets. Very rarely.
[18:59:28] dagda1: has joined #ruby
[18:59:32] Senjai: Unless you're developing like a game or something
[18:59:56] undeadaedra: there's much more to scalability than just rails
[19:00:05] jphenow: has joined #ruby
[19:00:05] mdw: (i'm a mobile app developer usually, and whenever I build side projects for API's I don't care much for the V in the MVC, I just want a headless API).
[19:00:17] CorySimmons: has joined #ruby
[19:00:20] havenwood: mdw: Take a look at Roda, it's lovely: http://roda.jeremyevans.net/
[19:00:28] Scroff: has joined #ruby
[19:00:29] undeadaedra: it's a complex topic, that just can't be discussed just by stating source-less statements and non real-cases
[19:00:57] LiquidInsect: you still have a view then... it's just json instead of html templates
[19:01:04] Senjai: mdw: A json rendering is still a view. also what undeadaedra said
[19:01:21] undeadaedra: and choosing a framework or language should not be just based on scalability, there's also other factors
[19:01:52] Scroff: has joined #ruby
[19:02:11] mdw: undeadaedra well scalability isn't why I chose specifically Rails, but I think it's a limitation which should be overcome and not ignored
[19:02:27] mdw: why not make Rails scale?
[19:02:27] Senjai: mdw: Maybe its just a limitation for you?
[19:02:46] Senjai: mdw: You sound like those mongodb proponents. Mysql isnt web scale, mongo is web scale, use mongo
[19:02:57] miah: lollllllllllllllllllllllllllllllllllllllllllllllllllllllllll
[19:03:52] RegulationD: has joined #ruby
[19:04:28] fabrice31: has joined #ruby
[19:04:30] roger_rabbit: has joined #ruby
[19:04:48] allomov: has joined #ruby
[19:05:19] havenwood: mdw: Here are some "Hello, World" benchmarks of a single route with various Rack adapters: https://github.com/luislavena/bench-micro#readme
[19:05:29] havenwood: mdw: Or 10, 100, 1000, 10000 routes: https://github.com/jeremyevans/r10k
[19:06:11] jhass: ACTION calls the l factory, nightshift time
[19:06:25] mdw: havenwood thanks
[19:06:37] aaeron: has joined #ruby
[19:07:49] pdoherty: has joined #ruby
[19:07:55] Casty: has joined #ruby
[19:08:17] flughafe1: top of the evening to you
[19:08:19] episage: has joined #ruby
[19:09:05] flughafen_: ACTION is tired
[19:09:31] jwaldrip_: has joined #ruby
[19:09:41] alex88: has joined #ruby
[19:10:56] serivich: has joined #ruby
[19:10:58] mdw: havenwood Roda looks great :-) thanks
[19:12:51] micmus: has joined #ruby
[19:12:52] Igorshp: has joined #ruby
[19:13:15] corehook: has joined #ruby
[19:14:42] jwaldrip_: has joined #ruby
[19:14:43] nikhgupta: has joined #ruby
[19:15:15] momomomomo: has joined #ruby
[19:17:40] arup_r: has joined #ruby
[19:18:52] endash: has joined #ruby
[19:23:05] mdw: havenwood this was the blog post that Parse made about moving from Rails to Go
[19:23:05] mdw: http://blog.parse.com/learn/how-we-moved-our-api-from-ruby-to-go-and-saved-our-sanity/
[19:24:13] havenwood: mdw: They could have moved from Rails to Roda. I don't know why they're averse to deploying and tuning the JVM.
[19:26:31] simplyianm: has joined #ruby
[19:27:29] Scrofff: has joined #ruby
[19:28:34] DukeDave: I feel like there is a better way to express this, but my brain can't form it: `Array(options[:except]).any? { |o| o === self }`
[19:29:16] mrmargolis: has joined #ruby
[19:29:41] jphenow: has joined #ruby
[19:30:07] nikhgupta: has joined #ruby
[19:30:19] wallerdev: has joined #ruby
[19:31:16] Senjai: dukedave: === doesnt exist in ruby :P
[19:31:22] Senjai: At least I dont think it does
[19:31:25] Senjai: unless you define it
[19:31:30] jhass: it does but we pretend it doesn't
[19:31:37] edwinvdgraaf: has joined #ruby
[19:31:44] Senjai: jhass: DEAR GOD
[19:31:48] jhass: it's for case/when and nothing else
[19:32:09] Senjai: dukedave: Array.wrap(option[:except]).detect {|x| x == self }
[19:32:15] Senjai: But that still weird code to write
[19:32:16] jhass: .wrap is activesupport
[19:32:28] axl_: has joined #ruby
[19:32:49] jhass: dukedave: I feel this lacks context, can you describe it in words?
[19:32:56] Senjai: Or gist the code around it
[19:32:59] mcclurmc: has joined #ruby
[19:33:07] diegoviola: how I'm supposed to parse this json data? https://gist.github.com/diegoviola/477a246892b567ae9f3b I tried JSON.parse(res.body) and that gives me a hash with an array and a hash... I tried #each like h["results"].each { |x| x["body"] } but then the body comes as an array too
[19:33:09] diegoviola: and I need a string
[19:33:13] diegoviola: what I'm doing wrong here?
[19:33:18] corehook: has joined #ruby
[19:33:34] jhass: ?pry diegoviola
[19:33:34] ruboto: diegoviola, 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
[19:33:42] platzhirsch: has joined #ruby
[19:33:48] sharpmachine: has joined #ruby
[19:34:13] erts: has joined #ruby
[19:34:29] jhass: what do you mean by "the body comes as an array too", how did you verify that claim?
[19:35:15] diegoviola: Oops, it's actually a string, I was wrong
[19:35:22] Xiti: has joined #ruby
[19:36:29] DukeDave: jhass: sure! I want to say, is self 'included' options[:except], where 'included' has the same semantics as ===
[19:36:37] diegoviola: sorry about that
[19:36:43] jhass: dukedave: why === ?
[19:36:52] renderful: has joined #ruby
[19:36:52] k3asd`: has joined #ruby
[19:37:35] renderful: has joined #ruby
[19:37:39] DukeDave: jhass: well I'm not sure what other method I'd use, other than passing in a Proc.
[19:37:53] DukeDave: I think of === as 'does this belong in this bucket'
[19:37:54] Rubie: has joined #ruby
[19:38:06] jhass: now I feel like I lack even more context
[19:39:08] jhass: anyway, alternative, not necessarily superior, just equivalent: Array(options[:except]).grep(self).any?
[19:39:23] jhass: for any more recommendations provide any actual context
[19:40:02] DEA7TH: has joined #ruby
[19:40:12] arooni-mobile: has joined #ruby
[19:40:43] jhass: hrm or did grep do arg === item, I don't even remember
[19:41:18] s2013: has joined #ruby
[19:41:38] ogpastaling: has joined #ruby
[19:42:18] InternetFriend: has joined #ruby
[19:42:22] apeiros: jhass: yes, ary.grep(arg) is arg === item
[19:42:35] jhass: so nvm that
[19:42:39] otherj: has joined #ruby
[19:43:31] Xeago: has joined #ruby
[19:44:08] tvw: has joined #ruby
[19:44:36] juanpaucar: has joined #ruby
[19:44:49] ogpastaling: has joined #ruby
[19:45:45] nonparfumee: has joined #ruby
[19:46:18] Al3ks: has joined #ruby
[19:46:20] rjno: has joined #ruby
[19:46:43] Channel6: has joined #ruby
[19:47:51] jackjackdripper: how can I pass a variable when parsing a hash
[19:48:02] jackjackdripper: say my hash has this structure
[19:48:05] jackjackdripper: parsed["data"]["Data"]["{#number}"]["ASSET"]["TAG"]
[19:48:13] gambl0re: has joined #ruby
[19:48:18] jackjackdripper: #number is supposed to be an array
[19:48:38] gix: has joined #ruby
[19:48:42] jackjackdripper: i want to iterate and get all the tags in that array
[19:49:12] troulouliou_dev: has joined #ruby
[19:49:14] DukeDave: jhass: I'm using it as a filter, where options[:except] lets you define the things to exclude
[19:49:33] Senjai: jackjackdripper: #{number}, not {#number}
[19:49:34] allomov: has joined #ruby
[19:49:50] lfox: has joined #ruby
[19:50:11] diegoviola: I can see the body as string when doing: h["results"].each { |x| p x["body"] } but how do I save this in a variable so I can gsub the body? sorry for the lame question
[19:50:18] baweaver: has joined #ruby
[19:50:36] nikhgupta: has joined #ruby
[19:50:45] jhass: dukedave: yeah, as long as I have no clue what things is and what self is we're not getting anywhere
[19:50:52] AndroidLoverInSF: has joined #ruby
[19:51:31] baweaver: has joined #ruby
[19:51:51] DukeDave: jhass: well I'm intentionally trying to be general, but my specific case is testing if something is a class
[19:52:00] simplyianm: has joined #ruby
[19:52:10] ixti: has joined #ruby
[19:52:21] jhass: dukedave: then I'd strongly prefer .is_a? over using Module#===
[19:52:40] jhass: latter is for usage by case/when, .grep and similar
[19:52:47] levifig: has joined #ruby
[19:52:58] _blizzy_: this is stumping me really hard
[19:52:59] mrmargol_: has joined #ruby
[19:53:12] yorickpeterse: maloik: are pirate costumes still allowed at arrrrcamp?
[19:53:22] jhass: diegoviola: .map? .find? depends
[19:53:33] Senjai: dukedave: We also prefer duck typing against type checking
[19:53:37] dopie: has joined #ruby
[19:53:37] krisquigley: has joined #ruby
[19:53:39] psye: has joined #ruby
[19:53:44] alphaatom: has joined #ruby
[19:53:45] jackjackdripper: srry i'm getting syntax error I'm trying to essentially arrive to this parsed["data"]["Data"][0]["ASSET"]["TAG"] with this parsed["data"]["Data"][#{number}]["ASSET"]["TAG"]
[19:53:49] _blizzy_: I have an array, and the array has hashes. I'm trying to get the hash with the highest 'foo' value. https://gist.github.com/NotBlizzard/0538cb1bacca0d581765
[19:53:54] _blizzy_: IDK where to even start for this one
[19:54:12] jhass: jackjackdripper: drop the #{ } and all is well
[19:54:24] momomomomo: has joined #ruby
[19:54:38] jhass: _blizzy_: .max_by
[19:54:47] yorickpeterse: I'm more a fan of goose typing myself
[19:54:56] ruboto: Badum-Tshh! https://www.youtube.com/watch?v=oShTJ90fC34
[19:55:03] Rubie: has joined #ruby
[19:55:04] dfockler: diegoviola: with map you can do the gsub in the map block
[19:55:15] yorickpeterse: jhass: noooo, that's not the right one
[19:55:18] DukeDave: jhass: yeah, so I originally had `Array(options[:except]).include? self.class`, but that means you can only pass in classes to options[:except], and using is_a? has the same restriction.
[19:55:18] DukeDave: By comparison if I use ===, then you can pass in a class and get the same behavior, or e.g. a string and get === as defined for strings (i.e. equality)
[19:55:20] diegoviola: dfockler: with #map I get a ["string string string string"]
[19:55:25] nikhgupta: has joined #ruby
[19:55:39] al2o3-cr: _blizzy_: a.max_by {|h| h[:foo] }
[19:55:47] dfockler: diegoviola: you've got a collection of items
[19:55:53] _blizzy_: al2o3-cr, jhass, thank you so much
[19:55:55] jhass: diegoviola: well, the json probably is an array because there can be more than one result, perhaps you should handle that?
[19:55:58] yorickpeterse: jhass: http://downloads.yorickpeterse.com/files/rimshot.mp3 use this
[19:56:01] DukeDave: But based on the confusion I'm causing, perhaps === just shouldn't be used for anything other than a case :)
[19:56:24] yorickpeterse: shamelessly stolen from instantrimshot.com
[19:56:39] diegoviola: dukedave: https://gist.github.com/diegoviola/fc73e2f5a457bdb1c9c2
[19:56:52] jhass: yorickpeterse: meh, too lazy
[19:57:21] simplyianm: has joined #ruby
[19:57:21] droidburgundy: has joined #ruby
[19:57:26] DukeDave: diegoviola: was that for someone else?
[19:58:22] diegoviola: sorry, no, just not sure how to handle this
[19:58:40] jhass: dukedave: *shrug* if it works for you it works for you, but maybe document that you use === for functionality there instead of style, for fellow developers sanity
[19:58:51] simplyianm: has joined #ruby
[19:58:57] gambl0re: has joined #ruby
[20:00:02] DukeDave: jhass: yer, I'll just make it an explicit is_a?, rather than sacrifice sanity for generality. Thanks for your input !
[20:00:14] dfockler: diegoviola: not sure what you are wanting
[20:01:15] dfockler: you can do h["results"].map { |x| x["body"].gsub(...) }
[20:01:44] bgmarx: has joined #ruby
[20:02:16] al2o3-cr: diegoviola: body = h[:results].map {|x| x[:body] }.first.gsub(...) ?
[20:02:44] jhass: diegoviola: body = ["ponies", "unicorns", "cats", "dogs"].sample ?
[20:03:22] centrx: One of these things is not like the other things
[20:03:37] jhass: I know, ponies aren't real
[20:04:06] claw: has joined #ruby
[20:04:12] dfockler: Unicorns are the only ones with a horn, that's the difference
[20:04:14] fujimura: has joined #ruby
[20:04:29] jhass: I should've included ponycorns
[20:06:14] yorickpeterse: I suck at writing bios :<
[20:06:25] centrx: You're accepting proposals for your bio?
[20:06:51] yorickpeterse: Sure, go ahead
[20:07:07] apeiros: BIO: yorickpeterse, main ranter of #ruby. nuff said.
[20:07:10] michaeldeol: has joined #ruby
[20:07:40] yorickpeterse: well I did actually include that sorta in the bio
[20:07:54] yorickpeterse: "Yorick is a Ruby programmer from the sunny country of The Netherlands. During the day he works on APIs, web scraping, natural language processing and a lot more. During the night he mainly works on Rubinius and Oga (an XML/HTML parser for Ruby) and occasionally rants in the Ruby IRC channel."
[20:08:13] dopie: has joined #ruby
[20:08:21] evanjs: has joined #ruby
[20:08:50] yorickpeterse: oooh, papercall.io has Vim mode
[20:08:51] jhass: you forgot to highlight your love to the web scaleability of MongoDB
[20:08:56] hakunin_: has joined #ruby
[20:08:59] yorickpeterse: jhass: neg, that's behind us now
[20:09:09] yorickpeterse: although I do still have one MongoDB cluster running :<
[20:09:21] yorickpeterse: which thankfully only has a tiny bit of fairly boring data
[20:09:34] nifoc: has joined #ruby
[20:09:44] yorickpeterse: bah, this Vim mode isn't actually Vim mode
[20:09:57] yorickpeterse: e.g. it doesn't recognize CTRL + {
[20:10:08] yorickpeterse: and it doesn't clearly show Visual mode
[20:10:11] yorickpeterse: 2/10 would not use again
[20:11:00] yorickpeterse: I'd actually throw a pile of money at somebody if they could make a Chromium extension that lets me edit text fields using $EDITOR
[20:11:27] galeido: has joined #ruby
[20:11:32] yorickpeterse: I think the only one I ever found required some Node.js server running or something like that
[20:11:37] quimrstorres: has joined #ruby
[20:12:15] rushed: has joined #ruby
[20:13:11] langlands: has joined #ruby
[20:14:41] nifoc: has joined #ruby
[20:15:46] renderful: has joined #ruby
[20:16:12] treehug88: has joined #ruby
[20:16:24] x1337807x: has joined #ruby
[20:18:07] rcvalle: has joined #ruby
[20:18:42] francois_: has joined #ruby
[20:18:44] nifoc: has joined #ruby
[20:19:58] freerobby: has joined #ruby
[20:20:14] aaeron: has joined #ruby
[20:20:23] Scroff: has joined #ruby
[20:22:31] ellisTAA: has joined #ruby
[20:22:52] baweaver: has joined #ruby
[20:22:58] mdw: has joined #ruby
[20:23:15] blazes816: has joined #ruby
[20:23:46] Xeago: has joined #ruby
[20:25:00] aaeron: has joined #ruby
[20:25:03] blackmes1: has joined #ruby
[20:25:24] ZergCoder: has joined #ruby
[20:25:43] Scrofff: has joined #ruby
[20:25:47] ZergCoder: This may be a stupid question, but can Ruby do everything Python can do and vice-versa?
[20:26:04] bougyman: they're both general purpose programming languages.
[20:26:07] yorickpeterse: conceptually, probably
[20:26:18] ellisTAA: has joined #ruby
[20:26:31] dblessing: has joined #ruby
[20:27:28] joevandyk: if i have data = [{f: 2, g: 3}]; headers = {f: 1, g: 2}; x = []; headers.each { |k, v| x << data[k] }; does make a copy in memory of everything in data?
[20:29:09] cabreraM516: has joined #ruby
[20:30:00] jhass: btw better written with a .map
[20:30:36] rushed: has joined #ruby
[20:30:47] NeverDie: has joined #ruby
[20:31:03] ZergCoder: OK thanks bougyman and yorickpeterse
[20:31:28] ZergCoder: I've gotten familiar with Ruby syntax for the most part and I wanted to start on a personal project
[20:31:38] ZergCoder: I wanted to try making something like this: http://www.kershner.org/scrape but with Ruby
[20:31:45] dopie: has joined #ruby
[20:31:57] sharpmachine: has joined #ruby
[20:32:00] ZergCoder: does anyone have any resources on learning web scraping with Ruby?
[20:32:11] ZergCoder: have any suggestions for*
[20:32:12] nikhgupt: has joined #ruby
[20:32:44] jhass: mechanize is a popular library for it
[20:32:46] dfockler: don't use regexs to parse XML
[20:33:08] jhass: searching for mechanize tutorials should yield a bunch of results
[20:33:33] ZergCoder: cool, thanks
[20:33:57] baweaver: has joined #ruby
[20:34:43] Scroff: has joined #ruby
[20:36:30] nifoc: has joined #ruby
[20:38:27] ixti: has joined #ruby
[20:38:46] cabreraM516: has joined #ruby
[20:39:12] Scrofff: has joined #ruby
[20:39:18] sumark: has joined #ruby
[20:39:26] sharpmachine: has joined #ruby
[20:40:36] jenrzzz: has joined #ruby
[20:41:09] tomphp: has joined #ruby
[20:41:15] ZergCoder: jhass: quick question
[20:41:20] triangles: has joined #ruby
[20:41:23] rbennacer: has joined #ruby
[20:41:31] ZergCoder: is making an image scraper like that difficult with vanilla ruby?
[20:41:41] BanzaiJoe: also searching for regex and parsing xml will get you into Dante's 3rd layer of hell
[20:41:55] wallerdev: has joined #ruby
[20:42:01] Scroff: has joined #ruby
[20:42:05] centrx: ZergCoder, if by vanilla Ruby you include Nokogiri or Mechanize, no it's easy
[20:42:17] bougyman: nokogiri is anything but vanilla ruby
[20:42:24] jhass: ZergCoder: "difficult" is relative, it wouldn't be difficult for me I just wouldn't see why I'd need to make it harder than it could be by using a library
[20:42:29] ZergCoder: oh i meant without any libraries or frameworks
[20:42:39] jhass: there's nothing "impure" about using a library
[20:43:55] bougyman: ZergCoder: a scraper in python without using any libraries would not be any easier or harder, to go back to your initial query.
[20:44:10] centrx: Yeah not sure what the point of re-implementing everything is
[20:44:11] rjno: has joined #ruby
[20:44:17] bougyman: you'd basically write mechanize, and write a parser, instead of using nokogiri and mechanize.
[20:44:21] starfox_sf: has joined #ruby
[20:44:27] Dreamer3: has joined #ruby
[20:44:37] BanzaiJoe: crawl, then stand, then walk, then run, then fly, then invent spaceships
[20:44:58] jwaldrip_: has joined #ruby
[20:45:01] cirn0: has joined #ruby
[20:45:04] RegulationD: has joined #ruby
[20:45:14] ZergCoder: I guess I'm just used to completely writing my projects from my own code so I feel like I get a good grasp of the language
[20:45:16] centrx: Does that include the standard library, do you have to reimplement HTTP and TCP too?
[20:45:21] ZergCoder: although my own projects have been pretty simple
[20:45:26] BanzaiJoe: ZergCoder there are many people writing or rewriting libraries so that the rest of us don't have to reinvent the wheel
[20:45:27] centrx: has joined #ruby
[20:45:28] ZergCoder: I see your guy's point
[20:45:32] deric_skibotn: has joined #ruby
[20:45:42] jhass: *people ;)
[20:45:46] premera: has joined #ruby
[20:45:48] blackmes1: has joined #ruby
[20:46:34] centrx: Robots be with you
[20:46:40] jhass: can rexml parse not well formed html? I never checked
[20:47:17] oorst: has joined #ruby
[20:47:54] yorickpeterse: It can't parse HTML to begin with
[20:48:04] Vile`: has joined #ruby
[20:48:11] x0F: has joined #ruby
[20:48:32] jhass: then there's really no point in doing it library less
[20:48:38] BanzaiJoe: is not well formed html still html... let me mount the meditating stone
[20:48:55] yorickpeterse: jhass: *cough* https://github.com/YorickPeterse/oga *cough*
[20:49:11] jhass: yorickpeterse: does it integrate with mechanize yet? :P
[20:49:15] undeadaedra: mmh, did diegoviola told you he cross-posted his issues to #sinatra?
[20:49:19] ReK2: has joined #ruby
[20:49:45] BiHi: has joined #ruby
[20:49:46] yorickpeterse: jhass: No idea
[20:49:49] jhass: well, the API requests one
[20:50:10] yfeldblum: has joined #ruby
[20:50:30] BanzaiJoe: yorickpeterse you ever see David Baez video on metaprogramming in python 3?
[20:51:04] yorickpeterse: BanzaiJoe: No, I don't really follow the Python world
[20:51:05] sharpmachine: has joined #ruby
[20:51:09] yorickpeterse: I last wrote Python years ago
[20:51:34] dudedudeman: has joined #ruby
[20:51:45] tomphp: has joined #ruby
[20:51:47] dudedudeman: has joined #ruby
[20:51:59] victortyau: has joined #ruby
[20:52:34] BanzaiJoe: he's been PyCon keynote several times, great speaker, he goes off the deep end, seriously, with metaprogramming, it's the kind of video that's great to put up during washing dishes ( https://www.youtube.com/watch?v=sPiWg5jSoZI&ab_channel=NextDayVideo ), it's 3 hours long, so little chucks at a time
[20:52:39] dfockler: what's a pull parser vs a regular parser?
[20:53:12] diegoviola: undeadaedra: sorry about that
[20:53:15] wasamasa: dfockler: guess it's about inversion of control
[20:53:37] jhass: yeah, a pull parser consumes as the user requests data
[20:53:46] undeadaedra: diegoviola: no worries
[20:53:59] yardenbar: has joined #ruby
[20:54:08] undeadaedra: found strange that the discussion moved, that's all :)
[20:54:20] preller_: has joined #ruby
[20:54:22] wasamasa: the pull parser walks down and emits events you can make use of
[20:54:29] yorickpeterse: dfockler: in the case of a pull parser you usually have to advance the parsing process yourself, allowing you to process input as it comes in
[20:54:42] yorickpeterse: a regular parser parses the whole input and then gives you some sort of result based on it
[20:54:46] moshee: has joined #ruby
[20:55:01] yorickpeterse: pull parsers typically use less memory because they (usually) don't keep anything around after they've processed a chunk
[20:55:11] wasamasa: all this xml parsing is confusing the hell out of me
[20:55:25] wasamasa: it should only matter anyways if you're processing huge amounts
[20:55:44] jhass: wasamasa: no worries, have a JSON pull parser: https://github.com/manastech/crystal/blob/master/src/json/pull_parser.cr
[20:55:55] wasamasa: for a one-off parsing task just let your plain old parser return something tree-like you can then dissect as you wish
[20:56:00] dfockler: like processing a stream vs processing a discrete data set
[20:56:07] rbennacer: has joined #ruby
[20:56:08] DEA7TH: has joined #ruby
[20:56:45] jlast: has joined #ruby
[20:56:48] yorickpeterse: DOM: one big massive tree, typically easy to use at the cost of more memory usage
[20:57:12] yorickpeterse: SAX: do everything yourself, typically events are emitted for every node type and you have to construct everything manually. Costs more work, much lower memory usage, more control
[20:57:26] phat4life: what about react
[20:57:28] phat4life: virtual dom
[20:57:31] yorickpeterse: Pull parsing: sorta in the middle of the two. Not as heavy as DOM/tree parsing, not as lightweight as SAX parsing
[20:57:39] wasamasa: phat4life: that's got little to do with that
[20:57:40] undeadaedra: virtual dom = dom, no?
[20:57:41] yorickpeterse: phat4life: unrelated to parsing
[20:58:02] Senjai: yorickpeterse: You know too much about parsing
[20:58:06] yorickpeterse: dfockler: typically SAX parsing is used when you want to process GBs of data
[20:58:15] Alayde_: has joined #ruby
[20:58:16] undeadaedra: you can not know too much about parsing
[20:58:23] wasamasa: phat4life: it's a nice abstraction for frontend programming in a more declarative way
[20:58:24] vudew: has joined #ruby
[20:58:34] yorickpeterse: Senjai: I banged my head against a wall for this for the past year or so :P
[20:58:35] sandstrom: has joined #ruby
[20:58:48] phat4life: i wrote a tokenizer once
[20:58:50] dfockler: yorickpeterse: that makes sense, I'm reading through some of the Oga code
[20:59:09] phat4life: also trees are awesome
[20:59:10] Senjai: yorickpeterse: I will have to pick your brain on things sometime
[20:59:12] yorickpeterse: I still need to write stuff about LL(1) parsing, existing docs are _really_ bad on the subject
[20:59:15] mdz_: has joined #ruby
[20:59:20] phat4life: there are all kinds of trees
[20:59:34] phat4life: red/black trees, quad trees
[20:59:42] phat4life: balanced trees
[20:59:55] phat4life: i dont' have enough trees in my life :|
[20:59:57] yorickpeterse: Senjai: feel free to, I'm in here basically 24/7 anyway
[21:00:13] sharpmachine: has joined #ruby
[21:00:56] phat4life: have you ever recruited someone from irc (ive seen it happen in a different chanel)
[21:01:27] Igorshp: has joined #ruby
[21:02:03] yorickpeterse: I've asked people, but never managed to hire someone
[21:02:10] slumos: has joined #ruby
[21:02:13] yorickpeterse: they either flock to Soundcloud or INRA
[21:02:16] Senjai: phat4life: I was hired from IRC
[21:02:20] yorickpeterse: ACTION looks sternly at ddfreyne
[21:02:30] dfockler: yorickpeterse: :P So you have to write an Xpath parser before you can utilize xpath selectors?
[21:02:46] yorickpeterse: dfockler: If they're written in XPath, yes
[21:02:58] yorickpeterse: Because Ruby doesn't know what "/foo/bar[@x="y"]" means
[21:03:06] allomov: has joined #ruby
[21:03:20] dfockler: what does nokogiri do for that?
[21:03:23] ericmeds: simplecov is confusing - it???s showing like 90% coverage - i know that isn???t accurate
[21:03:48] jhass: dfockler: ask libxml2, which it is a binding to
[21:03:54] bruno-: has joined #ruby
[21:04:28] _djbkd: has joined #ruby
[21:04:36] yorickpeterse: dfockler: delegates all of it to libxml2
[21:04:40] phat4life: sweet who wants to hire me
[21:04:41] undeadaedra: ericmeds: look detailed results, it generates a html report
[21:04:43] yorickpeterse: They have a parser for CSS expressions
[21:04:49] yorickpeterse: they translate that to XPath and then delegate that again
[21:05:06] ericmeds: undeadaedra: yeah it includes the tests in the spec/ dir but shows a high percentage of coverage - is it evaulating the entire app code?
[21:05:09] DEA7TH: has joined #ruby
[21:05:12] Senjai: phat4life: I would go contribute to an open source project in the industry you want to be in
[21:05:17] fabrice31: has joined #ruby
[21:05:27] undeadaedra: ericmeds: code loaded after starting SimpleCov
[21:05:29] Senjai: phat4life: Also, feel free to poke CanCanCan >.> <.<
[21:05:48] phat4life: I have an amazing project i am working on already, however finishing it is difficult because it uses technologies i don't fully understand
[21:06:01] undeadaedra: ericmeds: so you should do the SimpleCov.start in your spec_helper
[21:06:04] idafyaid: has joined #ruby
[21:06:06] dfockler: yorickpeterse: do you think you'll split the xpath parser into another gem?
[21:06:08] ericmeds: yeah I added that
[21:06:18] undeadaedra: and load your code to test *after*
[21:06:18] phat4life: Senjai: i am working on a JS port of milkdrop to webgl
[21:06:23] ericmeds: something just doesnt seem right i dont think we have such great coverage
[21:06:32] skade: has joined #ruby
[21:06:34] undeadaedra: open the report and see
[21:06:37] phat4life: Senjai: webgl is amazing
[21:06:46] undeadaedra: simplecov report is well done
[21:06:48] ericmeds: do I need to set config.eager_load = true in /config/environments/test.rb
[21:06:52] Senjai: phat4life: Sure, except for the javascript part xD
[21:07:00] Senjai: phat4life: Wanting to work in browser games or?
[21:07:11] phat4life: Senjai: maybe
[21:07:24] phat4life: my ultimate goal is to freelance webgl
[21:07:34] yorickpeterse: people can yank the parser out of Oga if they want, but gemifying it will probably do me more harm than good
[21:07:40] phat4life: i might do some backend stuff with sinatra
[21:07:54] nikhgupt: has left #ruby: ("ERC (IRC client for Emacs 24.5.1)")
[21:07:55] phat4life: for one of the projects, or slanger specifically
[21:07:59] undeadaedra: ericmeds: ask #RubyOnRails, they may know better.
[21:08:02] senayar: has joined #ruby
[21:08:02] senayar: has joined #ruby
[21:08:03] phat4life: do any of you use slanger?
[21:08:25] Senjai: phat4life: Just use rails
[21:08:38] phat4life: i need websocket
[21:08:47] nikhgupta: has joined #ruby
[21:08:48] Senjai: phat4life: use elixer or go
[21:08:52] phat4life: rails is over kill
[21:08:54] Senjai: Would not recommend ruby for websockets
[21:09:41] LMity: has joined #ruby
[21:09:56] bougyman: i used EM::Websockets and it's been rock solid.
[21:10:04] bougyman: up and running in a busy prod environment for 6 years.
[21:10:07] Senjai: bougyman: Not saying you cant :P
[21:10:14] Senjai: Just that there are better solutions for it
[21:10:27] bougyman: depending on one's definition of better.
[21:10:35] undeadaedra: ericmeds: when I did it, I put `SimpleCov.start 'rails'` in top of my spec_helper. See SimpleCov documentation, it may have a section for rails.
[21:10:42] shevy: webstandard! http://techcrunch.com/2015/06/17/google-microsoft-mozilla-and-others-team-up-to-launch-webassembly-a-new-binary-format-for-the-web/?ncid=rss&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+Techcrunch+%28TechCrunch%29
[21:10:52] shevy: now all that it takes is to have ruby instead of javascript
[21:10:54] c-c: Senjai: tell me more?
[21:11:06] idafyaid: has joined #ruby
[21:11:14] undeadaedra: shevy: opal is one step towards it
[21:11:18] mrgrieves: has joined #ruby
[21:11:25] ericmeds: undeadaedra: i will check it out
[21:12:19] phat4life: we use it slanger for websockets
[21:12:26] quimrstorres: has joined #ruby
[21:12:29] mrgrieves: hi, what can I do to print the digits on a string like this "application_name_anysize_1223"
[21:12:31] phat4life: and its currently broken, and i have no idea how to fix it :(
[21:12:40] idafyaid: has joined #ruby
[21:12:46] phat4life: well,, its rails -> slanger -> pusher
[21:13:04] Senjai: c-c: bougyman: The erlang VM is well suited to websockets, due to how it organizes erlang processes. Each process can have tons of processes, which is ideal for websockets.
[21:13:10] Nieralyte: has joined #ruby
[21:13:27] tomphp: has joined #ruby
[21:13:52] jhass: mrgrieves: print? you mean you have a string like that and want to extract a substring for the digits?
[21:14:00] c-c: Senjai: that makes 0 sense to me
[21:14:09] c-c: process that has many processes
[21:14:15] c-c: must be some erlang construct
[21:14:16] Senjai: c-c: http://stackoverflow.com/questions/16779162/what-kind-of-virtual-machine-is-beam-the-erlang-vm
[21:14:17] jhass: ?ot c-c Senjai bougyman
[21:14:17] ruboto: c-c, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[21:14:37] bougyman: jhass: my side ended a long time ago.
[21:14:39] datanoise: has joined #ruby
[21:14:50] yorickpeterse: c-c: in Erlang processes are more like coroutines with their own memory
[21:14:53] Senjai: jhass: aye, thats fine
[21:14:56] yorickpeterse: they're not Unix processes
[21:15:00] jhass: bougyman: sorry, have seen you highlighted in the conversation
[21:15:06] bougyman: no worries.
[21:15:11] bougyman: when it gets off-ruby I bail.
[21:15:42] Senjai: To be fair, it didnt go too far off
[21:15:48] Senjai: Use something else, like what?, why?
[21:16:00] Senjai: that's about how far that went
[21:16:19] jhass: (I'm a bit aggressive about it atm, it's too empty ;P)
[21:17:13] x1337807x: has joined #ruby
[21:17:18] jhass: #ruby-offtopic
[21:17:23] c-c: well, writing it in ruby get you donee faster, writing it in erlang makes it run faster
[21:17:24] mrgrieves: jhass: yes, extract the digits
[21:17:38] Senjai: c-c: Writing in elixer gets you done faster and makes it run faster
[21:17:40] yorickpeterse: Just use Ruby and use something else when you actually need it
[21:17:44] Casty: has joined #ruby
[21:17:46] jhass: mrgrieves: for your sample input, .split("_").last would suffice
[21:17:49] Senjai: c-c: Elixer sits on top of erlang
[21:17:58] yorickpeterse: instead of endless bikeshedding about "OMG USE THIS LANGUAGE BECAUSE WEBSCALE"
[21:18:12] bootstrappm: has joined #ruby
[21:18:13] Senjai: yorickpeterse: That's way to occamz razor of you
[21:18:16] c-c: Senjai: is that a ruby interpreter?
[21:19:19] c-c: ok, nevermind, its scala for the erlang vm
[21:19:32] mrgrieves: what I want to do eventually is to have a hash which elements will be application_name_anysize => 1223
[21:19:52] jhass: though I'd actually love to see all the "language X is so much better than Ruby [for Y]"-stuff in #ruby-offtopic instead of here, it's a bit much of it recently ;)
[21:20:07] _djbkd: has joined #ruby
[21:21:17] Senjai: jhass: We get it, your lonely :P
[21:21:27] Senjai: I still use ruby, for like, everything
[21:21:28] jhass: mrgrieves: always good to ask about your actual problem then, .map {|instance| instance.split(/_(?=\d)/) }.to_h
[21:21:33] volty: has joined #ruby
[21:21:38] davedev24_: has joined #ruby
[21:22:38] Xeago: has joined #ruby
[21:24:23] jenrzzz_: has joined #ruby
[21:24:40] j_mcnally: has joined #ruby
[21:24:40] starfox_sf: has joined #ruby
[21:24:57] Guest250: has joined #ruby
[21:25:14] Leef_: has joined #ruby
[21:25:18] mrmargolis: has joined #ruby
[21:25:36] momomomomo: has joined #ruby
[21:26:50] nikhgupta: has joined #ruby
[21:26:55] cabreraM516: has joined #ruby
[21:26:58] momomomomo: has joined #ruby
[21:27:11] episage: whats the best way to create storage class in ruby?
[21:27:26] jhass: what's a storage class?
[21:27:34] Senjai: episage: lol, storage class?
[21:27:48] episage: like i want to store some variables in 1 thing
[21:27:49] Senjai: sorry, the lol was rude, could you explain?
[21:28:06] jenrzzz: has joined #ruby
[21:28:13] episage: a number, string, string , string together
[21:28:16] episage: in 1 thing
[21:28:23] Senjai: MyThing = Struct.new(:number, :string1, :string2, :string3)
[21:28:26] apeiros: episage: what make Array, Hash or Struct unsuitable?
[21:28:41] sharpmachine: has joined #ruby
[21:28:44] episage: apeiros: yeah yeah i see
[21:28:47] episage: Senjai: thanks
[21:29:02] apeiros: episage: ah, or you're also asking for what exists - not just how to build your own?
[21:29:05] jlast: has joined #ruby
[21:29:12] bootstrappm: has joined #ruby
[21:29:14] episage: thats right
[21:29:18] episage: im very new
[21:29:20] episage: started today
[21:29:29] quimrstorres: has joined #ruby
[21:29:46] Senjai: episage: Structs are handy for creating generic containers of data. But for objects that have behavior you could either inherit from a struct, or define a class normally
[21:29:53] apeiros: episage: ok. those 3 classes are standard container classes.
[21:30:11] Senjai: Array and Hash is probably not recommended IMO, for what you described
[21:30:17] Senjai: Best give each "group" of that data a name
[21:30:26] Senjai: if they're related
[21:30:37] apeiros: episage: and Senjai said the rest :)
[21:31:05] GPrime: has joined #ruby
[21:32:34] jhass: episage: to add, don't actually name things number, string1, string2 etc, try to describe what they represent
[21:32:55] jhass: like first_name, last_name, age
[21:33:16] Senjai: Aye in that case, it'd be proper to have Person
[21:33:25] Senjai: and a Person has a first_name, last_name, and a age
[21:33:55] episage: so should I use structs or classes if the 'thing' does not contain logic?
[21:34:05] Senjai: You could, or not.
[21:34:10] Senjai: It's a good use case for structs
[21:34:21] Senjai: Adding logic though, I would suggest moving away from that.
[21:34:22] episage: Ok, I will go for structs then
[21:34:22] renanoronfle: has joined #ruby
[21:34:41] episage: thanks for advice :)
[21:37:18] bronson: has joined #ruby
[21:38:13] baweaver: has joined #ruby
[21:39:48] dagda1: has joined #ruby
[21:40:10] mdw: has joined #ruby
[21:41:28] Guest78: has joined #ruby
[21:42:29] krisquigley: has joined #ruby
[21:42:29] MatthewsFace: has joined #ruby
[21:42:42] keernel: has joined #ruby
[21:43:57] camonz: has joined #ruby
[21:44:33] platzhirsch: has joined #ruby
[21:45:20] milesmatthias: has joined #ruby
[21:47:44] Senjai: Love it when terrible factories are things
[21:49:18] dagda1: has joined #ruby
[21:49:41] pragmatism: has joined #ruby
[21:53:07] lampd1: anyone familiar with sidekiq-status?
[21:53:07] fujimura: has joined #ruby
[21:53:47] ruboto: Don't ask "does anyone use <thing>?". It's better to just state your problem and if anyone has used <thing> they will most likely answer.
[21:54:20] lampd1: wondering if there's a way to use a variable's value to store
[21:54:37] Senjai: come again
[21:54:45] lampd1: i.e. instead of `store vino: 'veritas'` and having your retrieval key be vino; vino would = 1 and your key would be 1
[21:54:49] towski_: has joined #ruby
[21:54:58] ylla: has joined #ruby
[21:55:37] lampd1: https://github.com/utgarda/sidekiq-status for reference
[21:55:48] Senjai: IIRC sidekiq uses redis?
[21:55:59] rbennacer: has joined #ruby
[21:56:03] Senjai: I sitll dont understand your question
[21:56:05] lampd1: yeah; this is a sidekiq plugin
[21:56:15] Senjai: but you can play around with how redis allows you to store values
[21:56:22] lampd1: its not raw redis dude
[21:56:33] lampd1: which is _why_ i asked if anyone is familiar with sidekiq-status ;)
[21:57:28] Senjai: I dont understand any situation where you want 1 as a retreival key
[21:57:39] lampd1: i want to use the value of a variable as a retriveal key
[21:57:47] lampd1: so i can iterate over items and store them dynamically
[21:58:11] mrmargol_: has joined #ruby
[21:58:14] pragmati_: has joined #ruby
[21:58:18] benanne: has joined #ruby
[21:59:03] dopie: has joined #ruby
[21:59:30] edwinvdgraaf: has joined #ruby
[21:59:34] Senjai: store variable.to_sym => value
[21:59:42] bgmarx: has joined #ruby
[22:00:01] Senjai: lampd1: Would that not work?
[22:00:08] Senjai: dont even need the to_sym, really
[22:00:15] lampd1: will try it
[22:00:22] lampd1: ty Senjai; been in C# land :P
[22:01:30] decoponio: has joined #ruby
[22:01:31] Senjai: lampd1: FYI, wasn't a sidekiq specific question ;)
[22:01:46] rbennacer: has joined #ruby
[22:03:50] allcentury: has joined #ruby
[22:03:59] ledestin: has joined #ruby
[22:04:18] michaeldeol: has joined #ruby
[22:04:58] Guest78: has joined #ruby
[22:05:07] s2013: has joined #ruby
[22:07:57] cirn0: has joined #ruby
[22:08:36] _djbkd: has joined #ruby
[22:09:43] Rubie: has joined #ruby
[22:10:27] simplyianm: has joined #ruby
[22:10:46] simplyianm: has joined #ruby
[22:12:18] mkosaki_: has joined #ruby
[22:13:20] dostoyevsky: has joined #ruby
[22:13:26] edwinvdg_: has joined #ruby
[22:13:49] bgmarx_: has joined #ruby
[22:14:27] yqt: has joined #ruby
[22:14:38] dostoyevsky: someone send me a patch on github for my project, to support vagrant...
[22:14:53] ts310: has joined #ruby
[22:15:51] atomi: has joined #ruby
[22:16:04] baweaver: Curious, what do people think of Contracts for Ruby?: http://egonschiele.github.io/contracts.ruby/
[22:16:12] baweaver: Musing on using it for some things.
[22:16:41] simplyianm: has joined #ruby
[22:17:06] Senjai: baweaver: I havent used it.
[22:17:15] Igorshp: has joined #ruby
[22:17:16] Senjai: dostoyevsky: what
[22:17:27] Azure: has joined #ruby
[22:17:32] Senjai: baweaver: I'm not sure I would. I'd just write tests and yard documentation.
[22:18:07] baweaver: Oh I do already
[22:18:09] dostoyevsky: So, does anyone know about vagrant? Would it make sense to support that for something like a memdb?
[22:18:27] Senjai: dostoyevsky: Are you sure you're in the correct channel?
[22:18:46] baweaver: About, yes, but you're going to have to do the legwork here.
[22:18:55] dostoyevsky: Senjai: I expected to join #ruby-lang
[22:19:05] baweaver: If you don't know enough about it to discern that, you haven't read into it enough
[22:19:06] _djbkd: has joined #ruby
[22:19:09] havenwood: dostoyevsky: A gem? Open source, I'm curious if you have a link?
[22:19:16] baweaver: besides, this is a devops topic
[22:19:23] havenwood: Or rather, if it's open source I'm curious.
[22:19:39] dostoyevsky: https://github.com/sck/localmemcache
[22:19:41] Senjai: dostoyevsky: Doesnt sound appropriate for there either
[22:19:53] dostoyevsky: someone send me a patch and I do not know what it's about
[22:20:01] dorei: can I use ConditionVariable outside a mutex.synchronize block?
[22:20:15] baweaver: re Contracts: just another layer of protection allowing for cleaner reasoning for QuickCheck type libraries.
[22:20:17] Senjai: baweaver: It's better than raising ArgumentError I suppose
[22:20:31] baweaver: Yeah, I've used enough Haskell to be fond of the idea
[22:20:39] baweaver: just curious on other thoughts.
[22:20:51] atomi: has joined #ruby
[22:20:54] Senjai: baweaver: But I wouldn't use it in an application I don't think. Given solid tests and yardoc, I wouldnt want to add another library for something like that
[22:20:55] baweaver: QuickCheck is amazing by the way, check it out if you haven't yet.
[22:20:57] bootstrappm: has left #ruby: ()
[22:21:26] rbennacer: has joined #ruby
[22:21:28] baweaver: The big thing on that is that it kills off nil unless you explicitly allow it.
[22:21:31] ZOMGITSABEAR: http://i.imgur.com/f3Fqvv1.png
[22:21:39] havenwood: ZOMGITSABEAR: #ruby-offtopic
[22:21:40] ruboto: fflush, apeiros, banisterfiend, seanstickle, zzak, Radar, Mon_Ouie, Havenn, jhass, sevenseacat, workmad3, miah, Coraline, drbrain, zenspider, Aria, rubyhacker1, slyphon, ljarvis
[22:21:41] Senjai: ?ot ZOMGITSABEAR
[22:21:42] ruboto: ZOMGITSABEAR, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[22:21:55] havenwood: ZOMGITSABEAR: No politics here please.
[22:22:07] ZOMGITSABEAR: i only brought it up because it was discussed here earlier
[22:22:10] ZOMGITSABEAR: won't happen again
[22:22:36] alphaatom: has joined #ruby
[22:22:49] baweaver: Trolls lurk on occasion, I don't tend to check history when something partially inflammatory is posted.
[22:22:51] moted: has joined #ruby
[22:23:07] Senjai: ZOMGITSABEAR: It's a little different when theres an actual conversation going on or not.
[22:23:14] volty: it seems that it depends on the time of the day (when you can discuss politics or not) :)
[22:23:46] apeiros: volty: it does not. but ops don't always see
[22:23:49] alphaatom: has joined #ruby
[22:24:09] phat4life: just clevery inject politics in your ruby gists
[22:24:26] baweaver: I prefer to foldLeft
[22:24:34] dostoyevsky: do you know of any ruby gems that come with a Vagrantfile, is that common these days=
[22:24:39] havenwood: baweaver: ha
[22:24:40] phat4life: isn't inject just an alias for reduce though
[22:24:58] vikaton: has joined #ruby
[22:24:59] baweaver: which is the same as foldLeft in other languages, yeah
[22:25:02] coffee__cup: has joined #ruby
[22:25:03] tkuchiki: has joined #ruby
[22:25:07] Senjai: dostoyevsky: Idk, look. You're asking a lot of weird context lacking questions.
[22:25:38] volty: apeiros: yes, distracted ops don't see :)
[22:26:06] volty: sometimes you inject, and sometimes you reduce, nice to have both names
[22:26:18] phat4life: it really should just be foldleft
[22:26:21] Senjai: Reduce is the correct term I think
[22:26:30] phat4life: foldleft is more precise
[22:26:30] havenwood: dostoyevsky: Hmm, I've seen vagrant boxes for projects, especially when there's complicated setup - but it's not at all a normal thing for a gem to include.
[22:26:40] phat4life: i think ocaml has fold right as well
[22:26:57] baweaver: you need lazy to really get mileage out of foldright
[22:27:10] Senjai: baweaver: why?
[22:27:11] GPrime: has joined #ruby
[22:27:17] j_mcnally: has joined #ruby
[22:27:54] baweaver: http://stackoverflow.com/questions/1446419/how-do-you-know-when-to-use-fold-left-and-when-to-use-fold-right
[22:27:56] volty: Senjai: it depends on what you do, on the result, there are occasions when you get as result (e.g) an array that could be much greater, or other structures
[22:28:17] volty: when the result is a hash I prefer inject
[22:28:23] volty: (to call it)
[22:28:49] baweaver: it'll SO Scala real fast though
[22:29:26] dostoyevsky: I also see that some links to rubyforge.org are not working anymore...
[22:29:47] vikaton: Opal needs to chnage its compilation target
[22:29:52] vikaton: to WebAssembly!
[22:30:33] d10n-work: has joined #ruby
[22:30:57] baweaver: Is that actually defined already or just a spec still?
[22:31:02] havenwood: dostoyevsky: rubyforge has been shut down for a little over a year
[22:31:49] havenwood: it is no more
[22:31:59] dostoyevsky: hmmm... http://localmemcache.rubyforge.org/
[22:32:06] dostoyevsky: that one's still up though
[22:32:57] havenwood: dostoyevsky: https://twitter.com/evanphx/status/399552820380053505
[22:33:15] havenwood: (That was 2014.)
[22:33:39] havenwood: Posted in 2013 regarding May 2014
[22:34:29] edwinvdgraaf: has joined #ruby
[22:34:37] dostoyevsky: yeah, strange... I wonder if I can retire my project somehow, remove it from the public gem repositories, because I think there are some problems with how I organized data back then
[22:35:04] baweaver: just make a major version change then
[22:35:06] workmad3: has joined #ruby
[22:35:08] jhass: you can yank all versions but not delete it
[22:36:47] lfox: has joined #ruby
[22:36:49] _djbkd: has joined #ruby
[22:37:11] jlast: has joined #ruby
[22:37:22] asteros: has joined #ruby
[22:37:36] sharpmachine: has joined #ruby
[22:39:33] Radar: Do we need ban hammer or no?
[22:39:46] Senjai: Radar: Probably a formal warning?
[22:40:10] renderful: has joined #ruby
[22:41:48] havenwood: ACTION dons a tophat
[22:42:34] triangles: Is there anything special I need to do when rendering an ERB template that'll use Unicode characters? I get non-descriptive errors when trying to do it, and can't find any useful results on Google about it
[22:44:15] fgo: has joined #ruby
[22:47:09] dostoyevsky: triangles: http://stackoverflow.com/questions/9695662/how-to-use-utf-8-encoded-data-in-erb-template
[22:48:00] baweaver: Radar: thought troll, apparently regular user I'd never seen continuing a topic that was potential flamebate with no context.
[22:48:41] triangles: dostoyevsky: thanks man
[22:49:17] drujensen: has joined #ruby
[22:50:41] mkosaki: has joined #ruby
[22:50:59] ogpastal_: has joined #ruby
[22:51:32] juanpaucar: Does anybody knows if there issomething like a read-only mode for active record?
[22:51:47] starfox_sf: has joined #ruby
[22:51:57] Casty: has joined #ruby
[22:52:03] Senjai: juanpaucar: MyModel.where(thing: thing).readonly(true)
[22:52:14] Senjai: juanpaucar: Also, #rubyonrails
[22:52:16] baweaver: #RubyOnRails
[22:52:23] baweaver: gah, too slow again
[22:52:29] Senjai: baweaver: goml ;)
[22:52:41] juanpaucar: sorry guys, i couldn't find it before
[22:52:48] qwertme: has joined #ruby
[22:52:48] tkuchiki: has joined #ruby
[22:53:32] dostoyevsky: are there more pure ruby job offers these days, or is still just rails?
[22:54:27] michaeldeol: has joined #ruby
[22:54:28] MatthewsFace: has joined #ruby
[22:54:28] Radar: dostoyevsky: Depends on where you're talking about.
[22:54:29] baweaver: Apple does some SysAdmin work in Ruby
[22:54:33] dorei: https://gist.github.com/egwspiti/6adaac61230cc2607eb3 is there a way to implement wait_ready without using sleep?
[22:55:21] Senjai: dorei: I would assume without the sleep, the thread would be nonblocking and execute immediately, so waiting would have no effect
[22:55:21] baweaver: https://github.com/lgierth/promise.rb
[22:55:39] baweaver: Javascript experience \o/
[22:56:05] dorei: senayar: is sleep the only way for the thread to block?
[22:56:07] arescorpio: has joined #ruby
[22:56:24] Senjai: baweaver: Can't you just http://ruby-doc.org/core-2.2.2/Thread.html#method-i-value ?
[22:56:29] neanderslob: has joined #ruby
[22:56:34] Senjai: dorei: For this, yes, because the code executes so quickly
[22:56:47] jhass: dorei: not with a timeout in a thread safe way
[22:56:49] Senjai: dorei: You can do large file IO, wait on network connections, etc. Sleep is the easiest way to force a wait state
[22:56:53] rbowlby_: has joined #ruby
[22:56:58] dmolina: has joined #ruby
[22:57:09] baweaver: Promises are just a cleaner way to do async type code in general
[22:57:20] jhass: well, for specific cases but a general solution...
[22:57:44] drujensen: has left #ruby: ()
[22:58:00] jhass: dorei: timeout less wait would be with a ConditionVariable (or just joining the thread)
[22:58:02] dorei: so, sleeping and checking is the only way to see if a "result" is available?
[22:58:15] drujensen: has joined #ruby
[22:58:50] Senjai: dorei: Check first, start thread, Thread.join will block until that thread is done, check
[22:59:24] jhass: dorei: oh, actually ConditionVariable#wait takes a timeout
[22:59:36] jhass: dorei: so that would be better IMO
[22:59:48] dorei: can I use CondtionVariable outside mutex.synchronize block?
[22:59:51] milesmatthias: has joined #ruby
[22:59:58] jhass: signal yes, wait, no
[23:00:09] lynx_eyes: has joined #ruby
[23:00:14] swgillespie: has joined #ruby
[23:00:48] jhass: hence Monitor can be useful which packages both but is a bit slower since it's possibly reentrant
[23:00:59] dorei: Monitor ?
[23:01:08] jhass: yes, another class
[23:01:15] havenwood: http://ruby-doc.org/stdlib/libdoc/monitor/rdoc/Monitor.html
[23:01:16] dorei: oh, let me check it
[23:01:43] milesmat_: has joined #ruby
[23:01:56] dorei: i dont understand it :(
[23:02:09] havenwood: We should add to those docs...
[23:02:40] dorei: i dont want mutual exclusion, i want to be notified when a calculation is ready without having to do something sleep 1 and check if it's ready
[23:02:52] havenwood: episage: hi
[23:03:00] Senjai: dorei: Thread.join on all threads you care about
[23:03:00] BanzaiJoe: juanpaucar there's ROM though I know that doesn't really answer your question
[23:03:16] Senjai: dorei: Thread.join will wait until all the threads you care about are finished
[23:03:28] episage: how to exclude a particular field in a struct from serialization to yaml?
[23:03:31] episage: SerpSnippet = Struct.new(:blue_text, :green_url, :description, :desc_normal, :desc_ad, :is_ad, :index_total, :index_normal, :index_ad, :web_element)
[23:03:38] dorei: senjai: maybe it doesnt finish after the calculation is done
[23:03:48] episage: I want to exclude :web_element
[23:03:48] Senjai: episage: override to_yaml
[23:03:58] Senjai: But I wouldnt suggest that
[23:04:08] Senjai: Instead I would define a method that would return the attributes you want to serialize
[23:04:19] Senjai: dorei: Well, then I would need a lot more context :P
[23:04:34] episage: Senjai: Ok, I will try that
[23:05:02] dorei: it could be done with something like queue.pop on the thread that should wait, and queue.push on the thread that does the calculation
[23:05:23] Senjai: dorei: You're starting to get into mailboxes
[23:05:29] Senjai: dorei: Use Celluloid
[23:05:29] jhass: dorei: sounds liek you want a promise indeed
[23:05:56] Senjai: https://github.com/celluloid/celluloid
[23:06:05] fabrice31: has joined #ruby
[23:07:08] Senjai: dorei: Specifically: https://github.com/celluloid/celluloid/wiki/Futures
[23:07:19] Senjai: Which yes, is a type of promise
[23:07:23] shevy: anyone happens to know of a ruby alternative to the python youtube-dl? I need no fancy things, only the ability to download a video to local
[23:07:47] drbrain: shevy: I imagine JWZ's perl version is the best one
[23:07:47] Senjai: shevy: Nope, I wouldn't imagine the source is extensive though
[23:08:02] francois_: has joined #ruby
[23:08:06] shevy: Senjai yeah I guess I could extract it
[23:08:09] cirn0: has joined #ruby
[23:08:10] shevy: I just feel so lazy right now :-)
[23:08:13] drbrain: youtube adds lots of obfuscation to make downloading difficult
[23:09:00] al2o3-cr: ah shit load in fact
[23:09:13] Senjai: But it's just that, obfuscation
[23:09:45] dfockler: the last time I looked at doing that, they were loading the video in segments via AJAX
[23:10:12] Xeago: has joined #ruby
[23:10:27] kaleido: has joined #ruby
[23:10:29] startupality: has joined #ruby
[23:10:38] volty: shevy's going to write YTUnobfuscate gem
[23:10:53] Ropeney: has joined #ruby
[23:11:04] Senjai: volty: soyouwanttoyoutubeeh.rb
[23:11:09] drbrain: I'd wrap the perl version in Process.spawn
[23:11:20] Senjai: drbrain: HAHAHA, yeah, thats the best solution
[23:11:20] al2o3-cr: shevy: heres a ruby wrapper against youtube-dl https://github.com/layer8x/youtube-dl.rb
[23:11:38] jenrzzz: has joined #ruby
[23:11:49] shevy: well that is useless
[23:11:55] shevy: in that case I can already use youtube-dl
[23:12:08] volty: Senjai: donotneedtubes.rb
[23:12:08] Yiota: has joined #ruby
[23:12:28] al2o3-cr: shevy: fine.
[23:13:03] shevy: al2o3-cr no worries I appreciate the gesture, I just wondered whether I could just use ruby without python
[23:13:48] Senjai: I wouldnt obfuscate it.
[23:13:51] volty: I'm fine with Firefox's download helper. If I needed to download something programatically I would have tried to command firefox
[23:13:56] Senjai: I would just be like NOSHITZGIVEN
[23:14:20] Senjai: volty: phantomjs? or selenium?
[23:14:37] Senjai: ACTION googles firefoxs download helper
[23:14:59] jhass: http://paste.mrzyx.de/pfzxy6y8n cheap promise just because I'm bored
[23:15:19] Igorshp: has joined #ruby
[23:15:20] swgillespie: has joined #ruby
[23:15:28] Senjai: That paste site..
[23:15:30] volty: Senjai: thx a lot. I didn't know it existed.
[23:15:35] Jarboe: has joined #ruby
[23:16:31] thomcom: has joined #ruby
[23:16:49] Senjai: jhass: "cheap promise"
[23:16:56] Senjai: story of my life with you
[23:17:31] volty: can you also ??click?? on pages' elements (filtered) with selenium?
[23:17:50] jhass: pretty much the entire point of it :P
[23:17:53] Senjai: volty: If you're curious. Look at the selenium driver for Capybara
[23:17:56] volty: that's wonderful. going to buy 5 more hd's
[23:18:31] dorei: okie, futures is what i need, but what from what i understand, it's available only on Actor objects
[23:18:47] volty: Senjai: thx, I take a note to see it later.
[23:18:50] jhass: dorei: see my paste, no warranties though ;)
[23:19:32] Senjai: dorei: Making any class an actor is very very easy
[23:19:45] Senjai: dorei: The celluloid wiki is kind of crappy, but its a VERY good library
[23:19:52] Senjai: if you stick with it
[23:20:15] dorei: jhass: thanx, i'll give it a try :)
[23:20:25] episage: Senjai: I actually decided to do: "WebSerpSnippet = SerpSnippet < Struct.new(:web_element)"
[23:20:32] episage: but it does not work
[23:20:38] episage: it says ndefined method `new' for nil:NilClass (NoMethodError)
[23:20:45] episage: undefined*
[23:20:51] danman: has joined #ruby
[23:21:00] episage: is it possible to extend a stuct?
[23:21:08] jhass: episage: Remove " SerpSnippet <"
[23:21:23] Senjai: WebSerpSnippet < Struct.new
[23:21:34] Senjai: class WebSerpSnippet < Struct.new
[23:21:42] jhass: that style is discouraged
[23:21:51] jhass: WebSerpSnippet = Struct.new
[23:21:53] mary5030: has joined #ruby
[23:21:58] jhass: you create a class you never use
[23:22:06] jhass: just to subclass it
[23:22:16] Senjai: jhass: I showed him the = before.
[23:22:23] baweaver: has joined #ruby
[23:22:45] Senjai: I've used class MyThing < Struct.new in certain scenarios, I don't think there is an issue with it
[23:23:00] jhass: probably not, it's just kinda useless
[23:23:14] jhass: Struct.new creates you a perfectly fine class
[23:23:17] Senjai: Depends, if you dont need to define #initialize, and you only need one or two... formatting methods or something
[23:23:20] Senjai: its totally fine
[23:23:23] jhass: and even takes a block that's instance_eval'd in it
[23:23:31] Senjai: right, the block approach
[23:23:34] episage: hmm but if I have "SerpSnippet = Struct.new(:blue_text)" and i want to exten this to have one extra field named "web_element"
[23:23:36] Senjai: kind of forgot about that
[23:24:02] episage: the WebSerpSnippet < Struct.new will dont do anything
[23:24:17] sharpmachine: has joined #ruby
[23:24:38] jhass: episage: probably not worth the inheritance, just WebSerpSnippet = Struct.new(:blue_text, :web_element)
[23:24:47] Senjai: Heading out
[23:24:49] Senjai: Night guys
[23:24:58] episage: Senjai: cu, thanks for help
[23:25:22] episage: jhass: I actually shortened it. In real this is that long: SerpSnippet = Struct.new(:blue_text, :green_url, :description, :desc_normal, :desc_ad, :is_ad, :index_total, :index_normal, :index_ad)
[23:25:35] blue_deref: has joined #ruby
[23:25:45] episage: can you tell how to extend this?
[23:26:00] jhass: I'm not sure, why you need both?
[23:26:07] jhass: or how about composition?
[23:26:18] quimrstorres: has joined #ruby
[23:26:19] jhass: WebSnippet = Struct.new(:snippet, :element)
[23:26:38] jhass: WebSnippet.new(SerpSnippet.new(...), web_element)
[23:26:39] episage: I need the first to serialize it using YAML because when i serialize it with a web_element i get a lot of rubbish in output
[23:26:46] michael_mbp: has joined #ruby
[23:27:12] shevy: why isn't openstruct used more often?
[23:27:22] jhass: shevy: because it's slow as hell
[23:27:23] simplyianm: has joined #ruby
[23:27:26] asteros: has joined #ruby
[23:27:27] havenwood: shevy: slow, that's a lot of method missings
[23:28:03] finisherr: has joined #ruby
[23:28:29] jhass: episage: would the composition approach I showed work for you?
[23:28:42] episage: jhass: im about to try it :)
[23:29:06] havenwood: https://bugs.ruby-lang.org/issues/11252
[23:29:10] havenwood: https://github.com/yuki24/did_you_mean
[23:29:26] havenwood: ^ trying out did_you_mean gem
[23:29:43] gambl0re: has joined #ruby
[23:29:58] edwinvdg_: has joined #ruby
[23:30:04] havenwood: 'Matz hope to integrate "did_you_mean" gem to Ruby 2.3'
[23:30:24] RickHull: has joined #ruby
[23:30:58] simplyianm: has joined #ruby
[23:31:28] krisquigley: has joined #ruby
[23:31:56] RickHull: i'm having an issue with incomplete stack traces. when an exception is thrown in a gem i am using, i don't get any of that gem's stack trace. the topmost stack entry is the calling code, calling into the gem
[23:32:10] RickHull: incidentally, i authored that (private) gem
[23:32:14] _djbkd: has joined #ruby
[23:33:31] jhass: any backtrace shortening rails shenigans possible?
[23:33:42] j_mcnally: has joined #ruby
[23:33:47] RickHull: the gem itself is tiny, a wrapper around fog
[23:34:08] jhass: does the issue appear in using fog directly?
[23:34:22] RickHull: not that i've seen
[23:34:42] vkgfx: has joined #ruby
[23:34:49] AndroidLoverInSF: has joined #ruby
[23:35:06] RickHull: let me see if i can generate an exception in irb, requiring the gem
[23:35:10] vkgfx: hey i've got a question about monkey patching a class in a framework i'm working with (vagrant) if anyone has cycles to spare
[23:35:24] jhass: does it appear if you copy your gem to a application local directory (and possibly patch up $LOAD_PATH so it's found) ?
[23:35:50] RickHull: jhass: literally the .gem ?
[23:36:01] jhass: RickHull: the contents of the lib dir
[23:36:05] jhass: ?anyone vkgfx
[23:36:05] ruboto: vkgfx, Just ask your question, if anyone has or can, they will respond.
[23:36:12] jhass: though #vagrant might be your better bet
[23:36:37] vkgfx: i've tried in there but there aren't any developers atm
[23:36:41] vkgfx: let me make a gist of what i'm doing
[23:37:00] RickHull: jhass: in irb, i get the exception and proper stack trace both with and without -Ilib
[23:37:32] RickHull: and I can see from the stack trace that it is using the repo in the first case and the installed gem in the second
[23:37:40] vkgfx: vagrant executes shell commands from a provisioner by calling "sudo" in its communications object
[23:37:48] vkgfx: i want to overload sudo to fix an option
[23:37:49] vkgfx: https://gist.github.com/anonymous/9329c24a2a8972a34418
[23:38:01] vkgfx: vagrant detects an error that doesn't actually exists and shuts down
[23:38:20] vkgfx: there's currently no way to make it stop doing that and so after a few days of this i'm ready to just monkey patch it out
[23:38:37] vkgfx: except i did that and it didn't change the communicator class
[23:38:41] _blizzy_: has joined #ruby
[23:38:51] jhass: RickHull: in the app with the problem, I'd rescue the exception and but a binding.pry into the rescue clause, then explore the exception, whether it's somehow a proxy (obj.class === obj == false), has things monkey patched (.method(:backtrace).source_location) etc.
[23:38:51] vkgfx: i should point out that sudo is not a real method, it's an alias to the execute method
[23:39:02] RickHull: jhass: oh, in the calling code, it does require 'activesupport/inflector'
[23:39:15] RickHull: i can repro this in the calling code, but not irb
[23:39:22] RickHull: so i am narrowing down the calling code
[23:40:23] jhass: vkgfx: alias or alias_method?
[23:40:50] vkgfx: let me check
[23:40:57] RickHull: jhass: the calling code is ultimately `rake`
[23:41:04] RickHull: i think that is related
[23:41:13] vkgfx: https://github.com/mitchellh/vagrant/blob/d7eaf503298014a93e1faa8da88947bc7d32ba58/plugins/communicators/winrm/communicator.rb line 146
[23:41:18] vkgfx: alias_method
[23:41:24] jhass: RickHull: might be, what I said above should help in finding the offender regardless
[23:41:37] RickHull: the Rakefile requires a lot of lib files, and the one lib file that I can repro the error with
[23:41:45] RickHull: it repros when called via `rake`
[23:41:48] fujimura: has joined #ruby
[23:41:51] RickHull: but not ruby lib/foo.rb
[23:42:13] wallerdev: has joined #ruby
[23:42:32] jhass: vkgfx: alias_method copies the target, it doesn't delegate and it doesn't truly alias
[23:42:45] jhass: vkgfx: so override execute and recall alias_method to catch all
[23:43:15] jhass: ?pry RickHull
[23:43:15] ruboto: RickHull, 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
[23:43:19] jhass: seriously, give it a try
[23:43:25] vkgfx: jhass: thanks i'll try it out
[23:43:58] jenrzzz: has joined #ruby
[23:44:13] RickHull: jhass: looks like a rake "feature" from here. I have a two line Rakefile, require 'my-gem'; MyGem.some_method(:bad_arg)
[23:44:38] RickHull: rake -T, and the exception is thrown with bad stack trace
[23:44:40] jhass: RickHull: --trace ?
[23:44:55] episage: jhass: works!
[23:45:05] jhass: episage: great
[23:45:14] episage: I've got another question
[23:45:16] jhass: episage: composition is to prefer over inheritance anyway ;)
[23:45:17] episage: class GCrawler < Struct.new(:serp)
[23:45:31] RickHull: jhass: nailed it, thanks
[23:45:33] jhass: GCrawler = Struct.new(:serp) you mean
[23:45:34] episage: how can I use the :serp inside GCrawler class?
[23:46:02] jhass: episage: if you got logic and a single attribute, just forget about Struct for that instance
[23:46:03] episage: I mean new class with extra field
[23:46:09] podman: has joined #ruby
[23:46:21] jhass: class GCrawler
[23:46:28] jhass: def initialize(serp)
[23:46:37] jhass: @serp = serp
[23:46:58] episage: serp gets updated as I call methods in GCrawler
[23:47:11] episage: so I should keep it updated and accessible to world
[23:47:13] vkgfx: jhass: that's not doing it. i get the feeling that it's not overwriting anything in the "real" communicator class that's running
[23:47:38] vkgfx: maybe there's some fundamental misunderstanding i have about how vagrant fits together, because i've done some patching before and this just doesn't work
[23:47:45] jhass: vkgfx: perhaps load order issues? your patch being loaded first?
[23:48:11] jhass: or vagrant actually invoking itself so the process doesn't even see your patch?
[23:48:16] vkgfx: i'm not certain. the only helpful discussion i've found of this is here: https://stackoverflow.com/questions/27572392/monkeypatching-vagrant-plugin
[23:48:20] episage: jhass: i think u answered that acually :)
[23:48:25] jhass: that's definitely getting into #vagrant territory here :/
[23:48:39] jhass: sometimes it just means hanging out 24-48h on a channel
[23:48:55] jhass: repeating the question every 6-12h
[23:49:23] vkgfx: one other hope i have is using the vagrant plugin that connects to a domain (what i'm doing with my provision script) and monkey patching it
[23:51:33] jpfuentes2: has joined #ruby
[23:52:17] cirn0: has joined #ruby
[23:55:34] GPrime: has joined #ruby
[23:56:47] andywojo: has joined #ruby
[23:58:16] quazimodo: has joined #ruby