« Back to channel list

#ruby - 19 March 2015

« Back 1 day Forward 1 day »
[00:00:33] baweaver: Facebook and Twitter at least go with the man page route
[01:05:15] zenspider: just expanded debride to run on .erb files and ran it against the seattle.rb site and actually found some dead code! :D
[01:11:12] chovy: can someone tell me how I can use this response?
[01:11:13] chovy: https://gist.github.com/chovy/6f4685f2f7809e7cdb9a
[01:11:20] chovy: i want to do like response.email
[01:11:44] havenwood: chovy: Have you tried that?
[01:11:45] zenspider: chovy: what have you tried?
[01:11:51] chovy: well i tried response.email
[01:12:07] chovy: puts r.admin_contacts.email
[01:12:29] chovy: `<main>': undefined method `email'
[01:12:39] zenspider: there is no admin_contacts
[01:12:41] chovy: r.admin_contacts produces that result in the gist
[01:13:04] zenspider: well... you didn't run the code you said above
[01:13:10] zenspider: otherwise `<main>' wouldn't show up
[01:13:24] zenspider: you prolly ran puts r.admin_contacts email
[01:13:32] chovy: puts r.admin_contacts
[01:13:50] zenspider: gist some actual code and output
[01:14:03] zenspider: I flunked mindreading 101
[01:15:19] chovy: https://gist.github.com/chovy/6f4685f2f7809e7cdb9a
[01:15:20] zenspider: speaking of gists... my latest debride endevour: https://gist.github.com/zenspider/d9c3d48593710be73cb1
[01:15:39] zenspider: chovy: that's all fine. and it doesn't show your problem
[01:16:01] zenspider: so again, flunked mindreading 101
[01:23:11] zenspider: chovy: I don't have time to wait 30 minutes for this. you're on your own.
[01:26:42] chovy: zenspider: geez man. how can i say it any easier? how do I access a property like 'email'?
[01:26:51] chovy: i have no idea what that blob is it spit out
[01:27:26] havenwood: chovy: Despite protestations to the contrary zenspider has already read your mind and saw you doing `r.admin_contacts email` instead of the intended `r.admin_contacts.email`. I mean, ahem, nobody can read minds--nothing to see here folk.
[01:27:47] zenspider: chovy: I can't help you if you aren't going to listen
[01:28:06] chovy: zenspider: its ok if you don't know, but you don't need to be a dick about it
[01:28:34] zenspider: that's fresh... bullshit.
[01:28:36] chovy: havenwood: he didn't see anything
[01:28:46] chovy: i wasn't doing r.admin_contacts email
[01:28:47] havenwood: chovy: What code did you run to get the error. The exact line of code.
[01:28:58] zenspider: how can I say it any easier? show us ACTUAL code and the output. if you can't supply such a simple request, why should we bother guessing?
[01:29:20] zenspider: the fact that you pasted `main' above says you're not doing what you say you're doing
[01:29:20] eat_multi: yope, seems r.admin_contacts returns an array
[01:29:31] chovy: https://gist.github.com/chovy/00f87648ca9afefc205d
[01:29:43] chovy: eat_multi: its not an object?
[01:29:50] havenwood: chovy: So that's not the error you showed us earlier.
[01:29:53] zenspider: hey look... totally different. again.
[01:30:04] chovy: wtf is wrong with you two?
[01:30:08] zenspider: so, plural verb implies it returns a collection
[01:30:21] zenspider: wtf is wrong with you?
[01:30:26] zenspider: why can't you be straightforward with us?
[01:30:32] zenspider: why can't you just answer the questions we ask?
[01:30:33] chovy: i thought i was
[01:30:42] chovy: so what do you want to know?
[01:30:45] zenspider: why can't you provide the output we asked for w/o being a prick?
[01:30:51] chovy: i just did
[01:30:58] zerowaitstate: I'm a ruby newbie, so please don't take this the wrong way: Why does Ruby allow reassignment of constants?
[01:30:58] chovy: and all i get is attitude from you.
[01:31:25] zenspider: zerowaitstate: it's a damn good question. because it does. I don't know what else to tell you.
[01:31:29] baweaver: chovy: he's right, posting incomplete code does little good
[01:31:31] zenspider: "constant" is to be taken lightly
[01:31:45] havenwood: chovy: I'm mean no insult when I say it's not the error you showed us earlier. It's just not the same error. :O
[01:31:52] baweaver: though we're flaring up a bit too much here
[01:32:02] zerowaitstate: zenspider: was just curious. Never seen a language that did that before
[01:32:09] zenspider: chovy: I simply asked you to provide ACTUAL code and ACTUAL output. you didn't do that, did you?
[01:32:38] zenspider: zerowaitstate: matz being japanese means some things are labled wierd
[01:32:57] baweaver: zerowaitstate: CONSTANT.freeze
[01:33:06] chovy: zenspider: i did do that. now you're just going on and on
[01:33:09] zenspider: constants are one of those... they're simply a name in a class/module scope
[01:33:18] zenspider: chovy: no, we're not going on and on
[01:33:20] baweaver: >> ABB = 1; ABC.freeze; ABC = 5
[01:33:21] eval-in_: baweaver => uninitialized constant ABC (NameError) ... (https://eval.in/301844)
[01:33:28] zenspider: we already said that you have an array, not an instance of the struct
[01:33:28] baweaver: >> ABC = 1; ABC.freeze; ABC = 5
[01:33:28] eval-in_: baweaver => /tmp/execpad-47b1377fb19f/source-47b1377fb19f:2: warning: already initialized constant ABC ... (https://eval.in/301845)
[01:33:32] zenspider: as you implied before
[01:33:46] zenspider: freeze only freezes the value, not the variable name
[01:33:51] baweaver: chovy: you're posting a partial stack trace
[01:33:52] havenwood: chovy: What code produced this error that you were initially asking about?: chovy: `<main>': undefined method `email'
[01:34:08] zenspider: havenwood: it missed "for Array:blahblah"
[01:34:24] zenspider: chovy: so you probably want ALL the email addresses in the collection
[01:34:41] zenspider: in which case, you'd map the array by calling email on all the instances in the array
[01:35:02] zenspider: like so: r.admin_contacts.map { |contact| contact.email }
[01:35:25] baweaver: or r.admin_contacts.map(&:email) # for shorthand
[01:35:33] chovy: puts r.admin_contacts[0].email
[01:35:35] chovy: that fixed it.
[01:35:41] zenspider: baweaver: hey hey hey now.. baby steps
[01:35:41] chovy: don't know why that was so difficult
[01:35:51] havenwood: chovy: If you're on a Ruby newer than 1.8 drop the: require 'rubygems'
[01:36:04] zenspider: chovy: because you were being difficult and I called you on it and instead of owning up to it you got defensive and became a price.
[01:36:21] baweaver: chovy: you are being a bit of an asshat
[01:36:22] chovy: zenspider: haha.
[01:36:26] chovy: sure sure.
[01:36:28] zenspider: I said I didn't have time to wait after 8 minutes.
[01:36:52] baweaver: anyways, mute list time. Bye
[01:36:55] chovy: i ask a question, you guys want clarification, i give it to you. and the whole time you guys are dicks about it. why even hangout in a help channel if that's how you're going to be?
[01:36:55] zenspider: what'd you do? did you supply the code? no, you acted like a prick.
[01:37:03] zenspider: you did NOT clarify it
[01:37:09] zenspider: you provided WRONG info
[01:37:16] zenspider: https://gist.github.com/chovy/6f4685f2f7809e7cdb9a that is a LIE
[01:37:24] chovy: and the asshat continues
[01:37:53] baweaver: apeiros_: ^^^
[01:37:56] zenspider: the truth continues. too bad you can't se it. have fun with that.
[01:38:06] zenspider: see. ugh. my pinkies are cold.
[01:38:16] baweaver: zenspider: just mute him and move on. Not worth the time.
[01:38:49] chovy: no wonder ruby is dying if this is how it goes
[01:38:54] zenspider: baweaver: I'm hungry. I want to be right because I wasted food time on this jackass. I'm long past being effective since we know he has reading comprehension problems.
[01:39:11] baweaver: Leave it be
[01:39:34] zenspider: yeah. I'm done.
[01:39:47] baweaver: Have a good night mate, take it easy
[01:40:07] baweaver: I've muted him anyways, works well enough for me.
[01:40:22] baweaver: I'm calling it a night too.
[01:40:28] zenspider: ooh... steak and bacon. I'm light on calories today
[01:42:46] havenwood: chovy: It really helps cut to the chase to show the actual code along with the resulting error. It's nice to name the Gist files with appropriate extensions so they syntax highlight and for people who fork them to try locally.
[01:43:17] havenwood: chovy: Adding another file to a Gist so you have one that runs and the error in a separate file is nice.
[01:43:18] chovy: havenwood: yeah. i get that. i didn't show the complete code, he asked for it, i reposted. don't know what the big deal is.
[01:44:21] chovy: he immediately went to insults
[01:44:59] havenwood: chovy: Are you stuck on 1.8 or are you on a more recent Ruby?
[01:45:16] chovy: havenwood: 2.0.0p481
[01:45:20] chovy: i removed the rubygems. thanks
[01:45:29] chovy: its been a few years since i did any ruby. forgot most of it
[01:46:26] eat_multi: r.admin_contacts showed up just like in the gist for me when I ran the snippet, despite it containing an array of structs containing those key/value pairs, kind of weird
[01:46:44] chovy: eat_multi: yeah. its an array. i thought it was an object
[01:46:50] chovy: looping through it works fine.
[01:46:57] havenwood: chovy: When debugging using #p instead of #puts can be really helpful.
[01:47:17] eat_multi: ohhhh, it's puts's fault :3
[01:47:24] eat_multi: I just realized
[01:47:26] havenwood: chovy: Check the difference between say `puts [1, 2]` and `p [1, 2]`.
[01:48:15] chovy: havenwood: yah. that is more intuitive. i would have seen it was an array
[01:49:02] havenwood: >> [1, 2].inspect
[01:49:02] eval-in_: havenwood => "[1, 2]" (https://eval.in/301846)
[01:49:06] eat_multi: yeh, p for debugging, or puts(something.inspect) if you've gotta use $stderr.puts or something
[01:49:35] havenwood: and instead of `STDERR.puts` use `warn` ;)
[01:50:04] eat_multi: hahaha I had absolutely no idea about that
[01:51:19] havenwood: eat_multi: another handy one is `abort 'xox'` shortcut for `warn 'xox'; exit false`
[01:53:56] eat_multi: sweet! more syntactic niceties from the land of ruby
[01:55:00] havenwood: mmm, sweets... food. I'm hungry!
[01:55:11] havenwood: ACTION goes in search of chunky bacon.
[01:56:48] chovy: havenwood: trader joes bacon is good
[01:57:02] chovy: applewood
[02:03:36] Virtual_: Anyone want to go over a ruby noobs code and tell me what sucks?
[02:05:22] Virtual_: Not much it's a simple irc bot
[02:05:57] Virtual_: 100 lines or so
[02:06:11] eat_multi: sounds cool, don't expect any profound improvement suggestions but it'd be cool to see
[02:06:42] Virtual_: it's hosted on www.github.com/Virtual-/roobybot
[02:06:57] Virtual_: I haven't worked on it for a few days been busy, but i'll be doing some more on it tomorrow
[02:08:29] Virtual_: I'm not the strongest programmer really but i'm learning
[02:08:37] jhass: Virtual_: start with some consistent indentation, ruby community standard is 2 spaces, right now you mix tabs and spaces
[02:09:25] jhass: the entire run method seems redundant, I'd just make that toplevel code and also move the constants into that file
[02:09:50] jhass: or rather require the settings file there instead of irc.rb
[02:10:14] Virtual_: what do you mean by toplevel
[02:11:02] jhass: the toplevel is the code outside any module, class or method
[02:11:43] jhass: in Roobybot#initialize, @time is never reused, so don't make it an instance variable
[02:12:02] jhass: in fact I'd skip the variable altogether, just Time.now.month directly
[02:12:20] jhass: probably the same for @ssl
[02:12:37] jhass: it's unused currently not sure about your future plans
[02:12:50] Virtual_: yeah it's unused atm I should have commented it out
[02:13:02] jhass: @s is just not worth the savings, you sacrifice them in clarity, name it @socket
[02:14:04] eat_multi: it looks cool, I'd just say don't abbreviate var names too much, especially if you do it inconsistently
[02:14:24] eat_multi: you have methods: #on_joinchn and #joinchan
[02:14:33] jhass: Virtual_: code should be indented into begin/end blocks
[02:15:44] jhass: you can write hostname, command, channel = message.split (and I'll skip going into that it's rather lacking in correctly parsing an IRC message)
[02:16:24] Virtual_: I did try that originally but I couldn't get it to work right for some reason
[02:16:35] jhass: hostname, command, channel, *message = message.split actually and then message = message.join
[02:17:33] threh: anyone know what the use-cases for rubinius are, exactly?
[02:18:02] eat_multi: yeh, I second the correctly parsing irc messages thing, the two things (non-stylistically) that jumped out at me were that rescue Exception and the treatment of IRC message format
[02:18:04] jhass: Virtual_: don't rescue Exception, rescue specific exceptions, RuntimeError as the most general one (which is also the default if you specify none), don't go higher, you break stuff
[02:19:13] jhass: Virtual_: Ruby community standard is also to use snake_case for variable names, so argOne -> arg_one or better first_argument
[02:21:05] jhass: Virtual_: until condition do -> until condition, the do is not needed and uncommon
[02:23:22] Virtual_: i've made notes so I don't forget something when I come to fix it up tomorrow
[02:23:38] jhass: the channel is also logged, see /topic ;)
[02:24:56] Virtual_: cool well I bookmarked that too
[02:25:12] Virtual_: thanks for helping me out
[02:25:21] jhass: you're welcome
[02:25:29] Virtual_: I'm not an amazing programmer and I knew I must have messed up somewhere
[02:25:41] mozzarella: threh: same use cases as mri, plus also when you want real multithreading with no global lock
[02:25:58] jhass: Virtual_: it's fine, we all start somewhere
[02:26:24] Virtual_: I started with python you see and didn't like it much but there is just something I like about Ruby more
[02:26:41] jhass: anybody who claims their first stuff looked any better is lying either just to you or also to themselves too
[02:27:17] eat_multi: Virtual_: enjoy making roobybot, hope to see it plague this channel some time
[02:27:23] eat_multi: or is that bad advice...
[02:27:49] Virtual_: I usualyl test it out on my own dead channel on rizon not to annoy others haha
[02:27:54] jhass: adding bots to 800+ user channels without op approval is not a good idea ;)
[02:27:55] eat_multi: but the enjoy making it part isn't
[02:28:07] jhass: Virtual_: sure, I do the same
[02:28:18] eat_multi: oh that's responsible, fair
[02:31:03] threh: mozzarella, thanks
[02:33:15] jhass: Virtual_: btw if you get tired of the idiosyncrasies of IRC and want to focus on some awesome commands instead, check https://github.com/cinchrb/cinch
[02:33:33] jhass: if you have fun dealing with them I won't stop you though ;)
[02:33:55] eat_multi: summer looks cool too (for source code reading especially)
[02:34:03] eat_multi: https://github.com/radar/summer
[02:44:22] eat_multi: ^ whelp, too busy looking at the code, just realised how incomplete it is... core class extensions and no tests + dead since last March
[02:45:02] sevenseacat: its in use though
[02:45:08] sevenseacat: the helpa bot here uses it
[02:45:43] sevenseacat: https://github.com/radar/railsbot is helpa, and depends on summer
[02:47:03] jhass: quote "it's all yolo code though" ;)
[02:47:23] sevenseacat: how do we not have a tip for yolo
[02:49:56] eat_multi: ah yolo code
[02:51:41] eat_multi: I like that it's essentially < 200 line irc bot 'framework' that works... I like it a lot
[02:53:09] eat_multi: and it only takes about 3 mins to skim over and get an idea of how it works
[02:53:29] Virtual_: jhass: https://github.com/Virtual-/roobybot/blob/master/irc.rb is this much better indentation wise?
[02:53:48] Virtual_: I'm going to fix the actual parsing of the messages tomorrow
[02:54:16] Virtual_: I need to read the Ruby standard too
[02:54:17] eat_multi: oh hello 100% more readable code
[02:54:45] Virtual_: too used to dat python hah
[02:54:54] jhass: Virtual_: https://github.com/Virtual-/roobybot/blob/master/irc.rb#L51 only minor detail left, the rescue should be indented to the same level as the begin (or def for the implicit begin)
[02:55:22] Virtual_: oh yeah missed that one, i'll fix it in my file now
[02:55:23] eat_multi: and the case statement on 72
[02:55:53] eat_multi: that needs indenting
[02:56:28] jhass: oh yeah, it also seems to miss an end
[02:56:36] Virtual_: I noticed both those too
[02:56:39] eat_multi: haha didn't spot that
[02:57:04] Virtual_: I can tell straight away when I miss an end cos of vim anyway
[02:59:45] Virtual_: so tomorrow I can work on parsing the messages better
[03:01:01] jhass: the fun starts with parsing stuff like MODE really
[03:01:52] Virtual_: I'm doing a irc bot just to learn Ruby and IRC stuff all in one really
[03:02:03] Virtual_: I have loads to make it do yet before I can do fun commands hah
[03:02:10] Virtual_: but doing the connection stuff is fun for me also
[03:03:53] Virtual_: thanks for helping im going to sleep now it's 3am here, i'll be back tomorrow
[03:04:07] eat_multi: sweet, looking forward to see it further along :)
[03:12:22] yuung: for some reason, open-uri's open().status gives me a 401 when i run it with rails' rake test, but a 200 if i do it in irb or rails console
[03:12:52] yuung: inside open() i'm calling an API
[03:33:17] Rubie: http://pastebin.com/tPk7t5C0
[03:42:26] Rubie: hi all: im trying to learn recursion, this problem uses recursion to find all the ways to make change of a certain amount. There is a return on line 9 that I have a question about. There is a recursive call on line 22 in an each block, then a return call outside the each block. I think what happens is when that return is called it brings the parser back into the each block to go the the next element in the array, but I"m not sure. Here
[03:43:06] Rubie: https://gist.github.com/anonymous/c079dfdefc2555ca4f0b
[03:54:08] eam: rubie: the return returns from the current change() method
[03:54:45] Rubie: okay thats what I thought, but wasn't sure
[03:54:49] Rubie: thank you
[03:55:02] eam: think of each method call as a thing on a stack
[03:55:24] eam: every method is another item on this stack -- and a return removes an item from the stack
[03:55:36] Rubie: is that how it works?
[03:55:39] Rubie: under the hood?
[03:55:45] Rubie: interesting
[03:55:54] eam: the data structure that handles nested method calls is literally called a "stack"
[03:55:59] Rubie: that is a good way to think about it
[04:19:03] aarwine: is there anything I can do to better understand why I'm spending so much time in Gem::StubSpecification#name ?
[04:19:20] yuung: what's the difference betweeen a = { b: 'c' } and a = { :b => 'c' }?
[04:19:42] sevenseacat: the former won't work in ruby 1.8 though
[04:19:46] aarwine: is the first valid? b should be defined
[04:20:05] yuung: aarwine, first works; it seems to just conver to the second though
[04:20:12] yuung: sevenseacat, ty
[04:20:32] aarwine: interesting, I thought you'd need a : to signify a symbol or '' for str
[04:21:33] mozzarella: : means symbol
[04:22:17] sevenseacat: when do we get to stop putting 1.8 caveat warnings on things
[04:22:26] aarwine: mozzarella: right, but in this example `a = { b: 'c' }` the : used is to seperate key from value; the : in the second example was for a symbol `a = {:b=>"c"}`
[04:22:50] aarwine: but for some reason, ruby knows b is a symbol in the first
[04:23:03] mozzarella: because : is for symbol
[04:23:24] mozzarella: you can also do
[04:23:24] aarwine: shouldn't it be a = { :b : 'c' }
[04:23:45] mozzarella: >> { 'str': 'wasd' }
[04:23:46] eval-in_: mozzarella => {:str=>"wasd"} (https://eval.in/301892)
[04:24:14] mozzarella: it's a shortcut that only works with symbols
[04:24:23] mozzarella: hence why it's using ':'
[04:24:35] aarwine: I don't like it because it's ambiguous, I don't know if b is a symbol or if b = "hidden string"
[04:24:46] aarwine: but, it's good to know
[04:25:21] aarwine: maybe it will be useful in some underhanded ruby contest :o
[04:27:36] sevenseacat: b cannot be a string in {b: c}
[04:28:09] aarwine: wow, you're right
[04:41:53] enali: self[0] == (c=self[0,1].upcase[0])
[04:42:19] enali: I don't know the necessary of "self[0,1].upcase[0]"
[04:42:41] enali: why not just "self[0].upcase"
[04:42:55] sevenseacat: because that wont change the value of self
[04:43:18] enali: I'm reading the <Ruby Cookbook 2th>, chapter2, Changing the case of a string
[04:43:38] enali: 'self' is string, here
[04:43:58] autojack: I have Ruby 2.0.0 on a MacOS 10.9 laptop. I've been trying to get a simple Tk app to work, but when I run it it just hangs and displays nothing on screen. I tried a very simple test app too - same thing. anyone know what I might be doing wrong? I've written a lot of Ruby but never used Tk.
[04:44:22] autojack: is it possible the MacOS Ruby doesn't have Tk support?
[04:44:23] enali: "self[0].upcase!" will change itself, but "self[0].upcase" not
[04:44:41] autojack: I would think it would give an obvious error if so.
[04:45:46] vdamewood: autojack: It might not be relivent, but OS X does include wish.
[04:46:54] enali: sevenseacat: ???
[04:47:12] autojack: vdamewood: hmm.
[04:47:48] autojack: if I ctrl-c after running the code, it exits in /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/tk.rb:1866:in `mainloop': Interrupt
[04:47:59] autojack: so it seems pretty clear it's loading the Ruby tk.
[04:48:10] autojack: I can try to build a Ruby in rbenv with Tk support explicit.
[04:49:20] vdamewood: that might help. Trying to do a hello with wish might help eliminate Tk itself as the problem.
[04:49:39] vdamewood: err do a hello-world app
[04:52:55] autojack: ok, that seems to result in the same. it just hangs.
[04:52:59] autojack: so that's interesting.
[04:53:06] vdamewood: I'm surprised.
[04:53:37] autojack: the only other thing that might be of interest is, I installed ActiveTCL.
[04:53:56] vdamewood: gist some test cases?
[04:54:11] vdamewood: autojack: hmm... what do you get if you run which tcl wish?
[04:54:33] vdamewood: err tcsh not tcl
[04:54:47] autojack: /usr/bin/wish
[04:55:40] vdamewood: err, oops. tclsh
[04:56:02] autojack: https://gist.github.com/omehegan/96801e0acbbcc67aae2f is the test I just tried.
[04:56:17] autojack: /usr/bin/tclsh
[04:56:57] autojack: so when I run wish on that, I get nothing.
[04:56:57] vdamewood: autojack: That example is wrong. If you use Tk, you use wish, not tclsh.
[04:57:08] vdamewood: Oh... nevermind then.
[04:57:51] autojack: yeah, I did wish foo.tcl.
[04:58:26] vdamewood: I got a bouncing wish icon in my doc, and a window popped up.
[04:59:16] autojack: my dock auto hides.
[04:59:19] autojack: now I see, it's there.
[04:59:34] autojack: I'm surprised the window didn't appear on top of my other windoes.
[04:59:57] autojack: aha, the hello world works too.
[05:00:04] autojack: this is making me feel stupid.
[05:00:30] vdamewood: Let me guess, the postage stamp of a window appeared, but it wasn't quite obvious *where* at first?
[05:00:53] autojack: not even. it didn't become the top window.
[05:00:58] autojack: I'm only on a 15" laptop screen.
[05:01:32] autojack: weird. it appears top left, but underneath my terminal window.
[05:01:38] vdamewood: Though, in my case, the window got placed in some 'empty' space.
[05:02:09] autojack: if I just move iterm to the right and run it again, I can see it even though it doesn't have focus. strange that it appears between iterm and the Chrome window behind it.
[05:02:18] autojack: ok I think my real app code works too.
[05:02:28] autojack: and sorry for all the scroll :)
[05:02:56] vdamewood: I'm surprised I was helpful.
[05:04:05] autojack: sometimes it's the simplest things.
[05:04:42] autojack: 8 years of programming experience, this is a new one on me.
[05:06:38] vdamewood: Well, I might have fallen for it too if my open PDF had been 2cm to the left.
[06:37:09] enali: I think it's a bug.
[06:37:45] enali: s.gsub(/(.{1,8})(\s+|\Z)/, "\\1\n")
[06:38:24] enali: but the s.gsub(/(.{1, 8})(\s+|\Z)/, "\\1\n") will not work
[06:39:02] enali: the only difference is "{1,8}" / "{1, 8}"
[06:39:13] enali: just a space
[06:39:26] sevenseacat: spaces matter in regex.
[06:40:58] enali: yes ,I know that. but I never think this
[06:41:08] enali: will different
[06:47:16] shevy: I am playing some audio file via mplayer
[06:47:28] shevy: now I am wondering if I could put basic functionality into an "app"
[06:47:32] shevy: be it ruby-gnome, or a web interface
[06:47:43] shevy: it just has to work locally though
[06:51:21] flughafen: good morning rubynistas shevy sevenseacat certainty arup_r ;)
[06:51:34] sevenseacat: good afternoon
[06:51:36] arup_r: flughafen: o/
[06:51:45] arup_r: sevenseacat: good morning
[06:52:06] arup_r: sevenseacat: Are you watching cricket today ?
[06:52:08] flughafen: guten tag sevenseacat
[06:52:14] sevenseacat: nope, stuck at work
[06:52:31] flughafen: sevenseacat: no score board?
[06:52:36] flughafen: sevenseacat: do you even like cricket?
[06:53:30] arup_r: flughafen: They won worldcup 4 times
[06:53:39] arup_r: we only 2 times
[06:53:50] arup_r: May be this time we will win.. lets see
[06:54:06] flughafen: ACTION barely even know what the hell happens in cricket
[06:55:21] sevenseacat: flughafen: australia kicks everyone's ass. thats all you need to know.
[06:55:32] flughafen: i bet sevenseacat
[06:55:54] certainty: so there is dale now. I'm wondering why i would use that instead of scheme. i know it is no gc'ed, but i don't think that's a good thing
[06:55:58] flughafen: i bet they train against teams of poisonous animals
[06:56:54] flughafen: holy cow! did you see that? dale was totally offsides. how could the ref not see that? that's going to be a penalty wicket thingie
[06:57:39] arup_r: flughafen: what is `ref` ?
[06:57:55] arup_r: Ok.. you are in football ...
[07:00:44] certainty: so we're waiting for the embargo being lifted today. I hope it's not going to be that bad. I don't want to do a patch day
[07:01:00] flughafen: patch all the things
[07:06:38] arup_r: `patch` means the stuff ... which `nobu` used to accept/reject ?
[07:07:45] arup_r: I'm streaming in office.. Ssshhh! :D
[07:07:55] shevy: flughafen even the koala can do cricket
[07:08:32] shevy: arup_r is your coworker working or not working again
[07:09:09] eam: enali: {} are only significant in the form of {\d+} or {\d+,} or {\d+,\d+}
[07:09:23] eam: enali: otherwise the braces become simple string literals
[07:09:35] arup_r: hehe.. he took his iMac at the corner.. with a 45 degree angle.. so I am not seeing him..
[07:09:38] eam: you are matching the string "{1, 8}"
[07:09:42] arup_r: probably he is also streaming
[07:10:09] eam: not a ruby bug
[07:10:49] flughafen: i want a pet kangaroo
[07:11:02] arup_r: sevenseacat: Why raining there.. ? Is it monsoon there ?
[07:11:12] sevenseacat: not raining here
[07:11:14] arup_r: flughafen: lelelele
[07:11:18] shevy: flughafen be wary, they can out-box you
[07:11:34] shevy: and they kick in illegal zones
[07:11:56] shevy: though they should do well in MMA
[07:12:02] flughafen: i'm a kung fu master
[07:12:58] shevy: fat like a panda
[07:13:14] certainty: btw. is anybody else seeing the results of recent dns-cache poisoning on their servers?
[07:14:01] shevy: the only poisoning I see here is me trying to feed old food to my cat
[07:14:05] flughafen: who would poison my dsn cake?
[07:14:22] certainty: i take that as a no :p
[07:16:30] flughafen: silly hamburgers
[07:17:25] flughafen: burn them on the grill! mauahahaha
[07:19:03] arup_r: MCG is big ground..
[07:20:21] sevenseacat: it seats almost 100,000
[07:22:16] shevy: so many koalas
[07:23:22] arup_r: shevy: When my cat commence business will run well.... I'll plan to make ground like MCG in Germany..
[07:23:31] arup_r: E-commerce
[07:25:31] shevy: hey jhass
[07:25:31] shevy: https://modelviewculture.com/pieces/i-can-text-you-a-pile-of-poo-but-i-cant-write-my-name
[07:25:35] shevy: what do you say to that
[07:25:37] arup_r: I'll then contact flughafen for the official things...
[07:26:13] shevy: that just cracks me up
[07:26:21] shevy: that reads like: "I'll then contact airport for the official things..."
[07:26:58] sevenseacat: arup_r: you need to go through air traffic control
[07:27:55] arup_r: I meant Govt. official things.. for land...
[07:31:55] sevenseacat: i think he missed my joke.
[07:32:02] sevenseacat: granted it wasnt very funny
[07:33:02] shevy: sometimes you are too subtle!
[07:34:51] flughafen: arup_r_: your flight is still on time
[07:42:41] b00^wk: can i have two versions of a gem installed?
[07:42:43] sandelius: Good morning my fellow Rubyists
[07:42:53] sandelius: b00^wk using bundler yes
[07:42:54] certainty: b00^wk: yes
[07:42:59] b00^wk: i know nothing about Ruby to be honest, but i'm struggling with an install
[07:43:12] b00^wk: i need ffi-1.96, but i have ffi-1.9.8
[07:43:27] b00^wk: and i would like to get ffi-1.9.6 somehow, and make it co-exist
[07:43:42] sandelius: b00^wk gem uninstall ffi
[07:43:58] sandelius: gem install ffi -v 1.9.6
[07:44:03] b00^wk: ok, trying
[07:44:09] sandelius: ahh co-exist
[07:44:26] sandelius: b00^wk then don't uninstall it
[07:44:32] b00^wk: already did
[07:44:36] b00^wk: actually, i prob don't care
[07:44:37] sandelius: Use either bundler or e.g RVM
[07:44:45] b00^wk: let me first see if that helps
[07:44:56] b00^wk: ERROR: Could not find a valid gem 'ffi-1.9.6' (>= 0) in any repository
[07:44:58] b00^wk: neeeeeeeeeeeeeeeei
[07:45:00] b00^wk: please help
[07:45:17] sandelius: certainty you sneaky bastard :)
[07:45:18] b00^wk: i really want it
[07:45:23] flughafen: holy cow. relax dude.
[07:45:35] flughafen: this isn't #python, hahaha
[07:45:39] sevenseacat: 1.9.6 does exist
[07:45:40] certainty: imagines the same situation with something different. A: "Pull that cable!" B: "Ok" A: "Wait don't!!!!" B: "Already did -.-" .... earth melts
[07:45:52] b00^wk: certainty, :)
[07:45:54] sandelius: certainty haha :)
[07:46:51] b00^wk: i want that ffi .... sandelius are you going to help ?
[07:47:47] sandelius: b00^wk relax dude, I'm working as well :) Create a file called Gemfile in the root of your project
[07:47:59] sandelius: then run gem install bundler
[07:48:07] b00^wk: err, hold on
[07:48:22] b00^wk: sandelius, ok, i m not quite with you, but here is what I'm doing :
[07:48:24] flughafen: http://lmgtfy.com/?q=how+to+install+specific+version+of+gem
[07:48:26] sandelius: b00^wk Put this at the top of the Gemfile source 'https://rubygems.org'
[07:48:53] b00^wk: where is Gemfile ?
[07:48:57] sandelius: then on the next line add: gem 'ffi', '1.9.6'
[07:48:59] b00^wk: is this my global setting
[07:49:14] sandelius: then run bundle install from the command line. Now you can require it from your project
[07:49:24] b00^wk: my project
[07:49:28] b00^wk: ah, hold on sandelius
[07:49:31] sandelius: b00^wk just for your project
[07:49:35] b00^wk: sandelius, what i'm doing is,
[07:49:49] b00^wk: i'm installing this (awesome) system called redmine, and
[07:49:53] sevenseacat: 'help me! help me! no, hold on'
[07:49:53] b00^wk: this is my project i guess
[07:50:02] b00^wk: and what they said was
[07:50:36] sandelius: any redmine folks here? never used it
[07:50:46] sevenseacat: i used it many moons ago... was a bitch to install
[07:51:28] b00^wk: meineerde> b00^wk: redmine (or more precisely bundler) requires exact versions
[07:51:31] b00^wk: sandelius, ^^
[07:51:49] flughafen: sevenseacat: AMEN
[07:52:01] sandelius: b00^wk then go into your project root and run bundle install
[07:52:10] b00^wk: sandelius, ok, i'm doing it
[07:52:14] b00^wk: project root = redmine root
[07:52:25] sandelius: b00^wk yes.
[07:54:02] b00^wk: Fetching gem metadata from https://rubygems.org/.........
[07:54:12] b00^wk: sandelius, i see it's pulling down ffi 1.9.6 ...
[07:54:35] b00^wk: Depending on your version of ruby, you may need to install ruby rdoc/ri data:
[07:54:35] b00^wk: <= 1.8.6 : unsupported
[07:54:35] b00^wk: = 1.8.7 : gem install rdoc-data; rdoc-data --install
[07:54:36] b00^wk: = 1.9.1 : gem install rdoc-data; rdoc-data --install
[07:54:36] b00^wk: >= 1.9.2 : nothing to do! Yay!
[07:54:42] sandelius: b00^wk goodie
[07:54:44] b00^wk: sandelius, read>
[07:54:53] sandelius: then run rails s
[07:55:08] sandelius: or rake db:create db:migrate db:seed
[07:55:22] b00^wk: let me create paste
[07:55:24] shevy: b00^wk lol
[07:55:56] sandelius: b00^wk breath
[07:56:02] shevy: oh he is from germany
[07:56:06] b00^wk: /usr/local/bin/rake generate_secret_token
[07:56:10] b00^wk: wrong pate
[07:56:18] b00^wk: http://paste.fedoraproject.org/199915/51748142
[07:56:23] b00^wk: sandelius, ^^
[07:56:44] sevenseacat: i'm sure there's a #redmine somewhere
[07:57:14] sandelius: b00^wk now it's ins talled. From here the redmine folks must help you
[07:57:52] b00^wk: but this is seems, project specific .
[07:58:07] b00^wk: i don't understand the difference, but from there install guide it was all like, to /usr/loca/
[07:58:20] b00^wk: like, those sql.so ifaces, etc..
[07:58:29] b00^wk: fine ..:(
[07:58:45] b00^wk: >_______<
[07:59:15] sevenseacat: not sure if this is english
[07:59:52] sandelius: sevenseacat from my end it's swenglish :)
[07:59:57] b00^wk: sandelius, why don't i see any ffi in the project? find . -name ffi*.so
[08:00:14] sevenseacat: because its a gem
[08:00:28] b00^wk: ffi* nothing
[08:01:05] b00^wk: sevenseacat, where does that gem get installed?
[08:01:11] b00^wk: i thought it goes inside the project
[08:01:44] b00^wk: there you are at home
[08:02:41] R1ck: $ /usr/bin/ruby1.9.1 -v
[08:02:41] R1ck: ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
[08:02:44] R1ck: is that normal?
[08:03:27] certainty: i don't think so
[08:03:49] certainty: but it can be normal for your distro (still unexpected)
[08:04:46] sevenseacat: normal enough
[08:04:54] sevenseacat: because system rubies are stupud
[08:05:27] R1ck: it seems.. my ruby install is all sorts of messed up
[08:05:31] certainty: stupud sounds like a spell you can learn in hogwarts
[08:05:34] sevenseacat: its possible.
[08:06:10] R1ck: whats the best way to get ruby 2.2.0? apt-get remove -f ruby and install manually?
[08:06:28] sevenseacat: use something like ruby-install
[08:06:36] sevenseacat: and delete everything system ruby
[08:09:01] certainty: system ruby is a ruby for systems programming?
[08:10:04] R1ck: i'm actually trying to run https://github.com/rvdh/lamernews in unicorn, but "bundle exec rake assets:precompile" results in "rake aborted! LoadError: cannot load such file -- rspec/core"
[08:10:21] R1ck: which I dont understand because the rspec gem is installed
[08:10:42] shevy: certainty it's the bad boy at the /usr prefix
[08:11:09] shevy: R1ck debian changes things
[08:11:36] b00^wk: this sucks nuts
[08:11:46] shevy: I compiled ruby from source into /usr prefix and don't have a problem
[08:12:09] shevy: R1ck first study the output of "gem env"
[08:12:31] b00^wk: sandelius, thanks for your attempt to help,
[08:12:33] shevy: then go into the gem directory and verify which gems are installed; on my system cd /usr/lib/ruby/site_ruby/2.2.0/
[08:12:41] b00^wk: now i'm gonna troll at redmine
[08:12:52] shevy: I have these rspec gems: rspec-3.1.0.gem rspec-core-3.1.6.gem rspec-expectations-3.1.2.gem rspec-mocks-3.1.3.gem rspec-support-3.1.2.gem
[08:13:31] sevenseacat: 'sucks nuts' is such a wonderfully descriptive term.
[08:13:40] R1ck: shevy: thanks, gonna try to reproduce it here locally first (this issue comes up in a docker image)
[08:14:09] R1ck: the original repo references ruby 1.9.3 too, so gonna try to install that first
[08:14:45] shevy: sevenseacat german english rules!
[08:20:39] flughafen: sevenseacat: nein!
[08:28:26] b00^wk: sevenseacat, you really funny
[08:28:55] b00^wk: next time i connect from a server in say, China, you will think my ChinGrish is funny?
[08:30:02] sevenseacat: i'll still probably not have a clue what you're talking about
[08:55:35] flughafen: hi undeadaedra
[10:01:25] shevy: HELLO EVERYBODY
[10:02:23] DaniG2k: jokester: hi
[10:13:03] jlebrech: there's a way to write a string without an end quote, can't remember it tho
[10:13:18] jhass: jlebrech: %(foo) ?
[10:13:32] apeiros_: %, %q and %Q
[10:13:43] apeiros_: % & %Q are like ", %q is like '
[10:13:43] jlebrech: jhass: I mean without something in the end.
[10:13:58] helpa: http://www.zenspider.com/Languages/Ruby/QuickRef.html - Quick reference for the Ruby Language
[10:13:59] shay-: hi, I am new to ruby and want to use log4r in some classes. I think it is a good idea to have a file logging.rb where the log4r logger gets configured. And then include the module in each class which want to use the logger. is there a guide for that? or what is best practise?
[10:14:23] apeiros_: jlebrech: you must misremember. all strings in ruby have delimiters on both ends
[10:14:25] workmad3: jlebrech: there's a way to write individual characters with just a prefix... not whole strings
[10:14:26] jlebrech: when the string is a single woth
[10:14:31] apeiros_: there are symbols, which look like :foo
[10:14:43] eval-in_: workmad3 => "a" (https://eval.in/301995)
[10:14:52] jlebrech: damn, maybe I saw that in another lang
[10:14:57] eval-in_: apeiros_ => :foo (https://eval.in/301996)
[10:15:03] jlebrech: workmad3: +1
[10:15:12] jlebrech: yes it's ?foo
[10:15:21] eval-in_: jhass => /tmp/execpad-0fa0b3fc18f9/source-0fa0b3fc18f9:2: syntax error, unexpected '?' ... (https://eval.in/301997)
[10:15:22] workmad3: jlebrech: ?foo doesn't work.. ?f does
[10:15:29] workmad3: jlebrech: only individual characteros
[10:15:32] workmad3: *characters
[10:15:43] eval-in_: jhass => 102 (https://eval.in/301998)
[10:15:46] jhass: also note ^
[10:15:57] workmad3: jhass: who cares about 1.8 anymore? :)
[10:16:06] eval-in_: undeadaedra => 102 (https://eval.in/301999)
[10:16:15] jhass: oooh, template is fixed? <3
[10:16:17] eval-in_: workmad3 => "f" (https://eval.in/302000)
[10:16:33] apeiros_: workmad3: shevy
[10:16:35] jhass: 10>> RUBY_VERSION
[10:16:35] eval-in_: jhass => /tmp/execpad-5df0b93af832/source-5df0b93af832:4: TypeError: can't modify frozen string (https://eval.in/302001)
[10:16:47] workmad3: apeiros_: I think even shevy has upgraded now ;)
[10:16:56] apeiros_: workmad3: I'm not convinced
[10:17:14] jhass: workmad3: puppet people seem to
[10:17:20] shevy: actually I could only upgrade because of tenderlove
[10:17:27] Musashi007: anyone know where i can go to read about how to make dbs in tables.sql in a ruby app?
[10:17:39] shevy: I would have been with python otherwise :D
[10:18:05] shevy: what is 10 there anyway
[10:18:07] shevy: ruby 1.0 ?
[10:18:17] jhass: Musashi007: that question seems to be rather vague, but check SQLite and the sequel gem
[10:18:27] undeadaedra: eval.in says MRI 1.0
[10:18:39] shevy: well that is ruby 1.0 right? or am I missing something
[10:18:53] shevy: I am sure I can't compile 1.0 :(
[10:19:19] workmad3: shevy: eval.in is a time traveller and brought ruby 10 back from the distant future :)
[10:19:45] jhass: shevy: seriously, I can even remember this coming up at least two times when both of us were around, and you're here longer than me...
[10:19:48] Musashi007: @jhass thanks - that lead me to the pg gem which is what i???m using
[10:20:14] jhass: Musashi007: so is there a real/clear question=
[10:20:35] shevy: jhass what part
[10:21:04] jhass: shevy: that you can prefix eval-in with versions and that it even has 1.0 available
[10:21:12] shevy: I know the part about prefix
[10:21:13] Musashi007: I didn???t have one in paraticular - I feel like I know so little i should do some reading before asking questions
[10:21:16] shevy: I did not know the part about ruby 1.0
[10:21:22] shevy: what's next, ruby 0.9?
[10:21:29] shevy: 09>> RUBY_VERSION
[10:21:48] jhass: 10, 18, 19, 20, 21
[10:21:53] shevy: 10>> RUBY_VERSION.class
[10:21:54] eval-in_: shevy => /tmp/execpad-1c306a062269/source-1c306a062269:2: syntax error (https://eval.in/302008)
[10:22:07] Hanmac1: yeah 10 is a bit funky
[10:22:19] shevy: that gives me back String in irb
[10:22:27] jlebrech: is there a short way of doing [a['a'], a['b'], a['c']].join('-') ?
[10:22:40] jhass: jlebrech: .values_at
[10:22:47] Musashi007: is tables.sql a file that is automatically generated, typically?
[10:23:12] shevy: Musashi007 dunno, bit hard to say from the name alone
[10:23:25] jhass: Musashi007: it's a file that seem to just have come up with without any explanation of what it would do or represent
[10:23:48] shevy: a mysterious file
[10:23:49] Musashi007: ok, it???s not a name used by convention?
[10:24:01] shevy: Musashi007, in what context have you seen it? rails?
[10:24:20] Musashi007: A sinatra app which is interfacing with a postgres database
[10:24:20] shevy: perhaps the folks on #rubyonrails might give another contextual answer
[10:24:39] jhass: no, it's not
[10:24:55] jhass: rails dumps the schema into schema.rb or structure.sql
[10:25:02] jhass: but is the name really important?
[10:25:32] shevy: naming things is important!
[10:25:44] shevy: that's why people in ruby name things like
[10:25:53] shevy: methadone
[10:26:06] Musashi007: jesus christ man
[10:26:15] shevy: https://rubygems.org/gems/methadone almost 100.000 downloads from junkies
[10:26:36] Musashi007: it???s gotten really bad lately
[10:26:37] shevy: though I also have some badly named gems
[10:27:10] Musashi007: that you made ?
[10:28:04] undeadaedra: Or cocaine: ????A small library for doing (command) lines.????
[10:28:19] shevy: Musashi007 yeah. often I try to give a name that hints as to what it does
[10:28:22] shevy: but then the name becomes so long
[10:28:44] shevy: two words tend to be quite ok
[10:28:48] Musashi007: that???s good of you
[10:29:11] workmad3: Musashi007: sounds like it's the file that the app intends you to initialize the database with
[10:29:14] Hanmac1: ACTION prevers to name his gems as cyrptic as possible .. and with less vocals as possible too ;P
[10:29:22] workmad3: Musashi007: the app's README should give you some indication though
[10:29:25] undeadaedra: kjtbgkxdfbjk ?
[10:29:44] shevy: https://rubygems.org/profiles/Hanmac
[10:29:44] workmad3: hanmac1: s/vocals/vowels/?
[10:29:49] shevy: libarchive-ruby
[10:29:50] shevy: two words
[10:29:55] Hanmac1: undeadaedra: hm yeah like that, my current recently rpoject is rwx
[10:29:58] shevy: libacl-ruby: two words
[10:30:01] jhass: oh, I should fetch all single word names of gems as input for my hangman bot!
[10:30:03] Musashi007: @workmad3 there isn???t a readme
[10:30:09] shevy: only rwx is a deviation, one word
[10:30:22] shevy: jhass is the bot already functional?
[10:30:24] workmad3: jhass: yes, you should :)
[10:30:29] jhass: shevy: yes
[10:30:30] Musashi007: @workmad3 tha would make sense though.. thnk you
[10:30:33] shevy: apeiros will ban it eventually :)
[10:30:50] shevy: you could say the bot has an educational approach
[10:30:58] shevy: "it teaches people the names of different ruby gems"
[10:31:18] jhass: the current wordlist is some "words moms should teach their childs" kind of thing
[10:31:20] workmad3: shevy: I'm just waiting for the bot to give 'crack' followed by 'cocaine' ;)
[10:32:00] shevy: that seems legit - crack is an existing gem after all -> https://rubygems.org/gems/crack
[10:32:14] workmad3: shevy: also crack ho
[10:32:22] jhass: also the bot is written in crystal
[10:32:36] shevy: and a gem for safe coding can be found here https://rubygems.org/gems/condom
[10:32:49] shevy: jhass you abandoned ruby! :(
[10:33:05] Musashi007: ya know even the fact that they???re called gems
[10:33:16] shevy: ruby already has crystal https://rubygems.org/gems/crystal
[10:33:32] jhass: shevy: https://github.com/jhass/DeBot/blob/master/bot/src/plugins/hangman.cr does it look any different to you?
[10:33:41] workmad3: shevy: it also has meth https://rubygems.org/gems/meth
[10:33:58] shevy: jhass yeah!
[10:34:00] shevy: @guesses = [] of Char
[10:34:21] jhass: see, 1/90
[10:34:39] shevy: workmad3 I wonder if there is a pattern here. Like, where do the people live that create gems such as these
[10:34:42] Musashi007: you got : https://rubygems.org/gems/crack , i assume?
[10:34:47] shevy: I am going out on a limp and claim that they come from the USA!
[10:35:07] workmad3: jhass: hmm... crystal == ruby with some type annotations?
[10:35:19] jhass: workmad3: not quite
[10:35:32] jhass: workmad3: deeply ruby inspired syntax is more fitting
[10:35:45] jhass: workmad3: compiled though
[10:35:46] shevy: it is ruby but it is not
[10:36:11] workmad3: jhass: fair enough :) I'd also assume that @@classvars are also useful? :)
[10:36:45] jhass: they're scoped to a single class, yeah
[10:37:20] jhass: since the meta model i not quite there yet and no class level instance vars for now
[10:37:41] shevy: would be fun to write in any language, ruby or crystal
[10:37:45] shevy: and get both for free
[10:37:52] jhass: and a constant felt wrong, so I actually use @@vars quite a bit in crystal
[10:38:07] shevy: the second @ is so ugly!
[10:38:18] jhass: shevy: https://github.com/manastech/crystal_ruby/blob/master/sample/test_ruby.cr
[10:38:51] Musashi007: can i ask what a db extension is in here?
[10:38:56] shevy: ruby_extension "test_ruby",
[10:38:59] shevy: why the , ?
[10:39:13] shevy: Musashi007 an extension for a database? :)
[10:39:25] shevy: I'd assume that things stored in a .sql can be put into the interactive psql console
[10:39:31] jhass: shevy: because it's a macro and the whole class is passed as an argument to it :P
[10:39:34] shevy: or you can somehow load that
[10:39:47] jhass: Musashi007: more context
[10:39:57] Musashi007: CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
[10:40:13] jhass: Musashi007: that's a postgresql thing
[10:40:18] workmad3: Musashi007: in postgres, an extension is a way of introducing new types and features into the database... things like uuid generation inside postgres or the entire postgis package for turning pg into a geographically aware db are released as pg extensions
[10:40:18] Musashi007: it???s in that file I was refering to earlier which ap[epars to set up all the tables
[10:40:47] Ankit: anyone is participating in gsoc
[10:40:56] Musashi007: wow thank you
[10:41:42] workmad3: Musashi007: extensions are also installed into the pg server and then activated on a database-by-database case, hence that line in your tables.sql (which, iirc, is for pulling in a stored procedure language)
[10:42:34] Ankit: anyone participating in gsoc?
[10:44:54] Musashi007: so the fact that it???s creating an extension if it doesn???t exist means that the db program will then install that particular extension?
[10:45:32] jhass: mmh, it's more like marking it at active for the current database, but yeah
[10:45:35] workmad3: if the pg server is aware of the extension, it'll install it into that database
[10:45:35] Musashi007: wait - so, this means I can just take this file and load it into postgresql server?
[10:45:47] workmad3: the 'CREATE' is a bit of a misnomer there
[10:45:59] jhass: Musashi007: likely
[10:46:11] jhass: psql db_name < tables.sql
[10:46:42] Musashi007: is it alright for me to be asking db questions here?
[10:46:57] jhass: are you kicked from the channel? ;)
[10:47:16] jhass: we're good in telling people elsewhere, no worries
[10:47:23] jhass: *to go elsewhere I mean
[10:47:46] jhass: so, how do I get a list of all gems?
[10:48:31] workmad3: jhass: there's an API call on rubygems that should get that... they introduced it so that bundler could work a bit quicker :)
[10:49:19] jhass: good thing that rubygems.org has a link to the API docs right on the front page... or rather it would be nice if
[10:51:26] undeadaedra: go rubydoc.info
[10:51:42] jhass: not that kind of API :)
[10:52:02] jhass: workmad3: don't see the endpoint in the API docs :/
[10:55:40] workmad3: jhass: oh drats... they introduced an API for bundler wher bundler could throw a list of gem names and get back a list of dependencies... sorry
[10:55:49] workmad3: jhass: my bad, mis-remembered what they did
[10:56:09] jhass: there must be some way to get a list of of them though :/
[10:56:19] jhass: basically what bundler used previously
[10:57:31] shevy: workmad3 so bundler helped evolve rubygems
[10:57:39] workmad3: jhass: also what gem list -r does
[10:58:06] jhass: mitmproxy time I guess
[10:59:28] shevy: when you guys find a bug in one of your projects, when it is somewhat large... do you sometimes feel that it may be better to rewrite the whole thing?
[10:59:35] shevy: rather than just fix that one little bug
[10:59:54] jhass: if I still call it bug, probably not
[10:59:57] undeadaedra: it depends of the kind of the problem
[11:00:05] undeadaedra: if it???s a conception flaw, maybe
[11:00:10] jhass: what you describe I use the term "design issue" for, I think
[11:03:53] Musashi007: does anyone know the command to end a postgresql statement? I recall there being some specific way to end them but can???t remember what it is
[11:05:34] R1ck: so unicorn is an application server for ruby apps.. how would I run the ruby app on the commandline, just for debugging purposes?
[11:05:50] undeadaedra: R1ck: what kind of app ?
[11:05:52] Musashi007: @wasamasa thanks
[11:06:14] wasamasa: Musashi007: it's a general SQL thing
[11:06:17] R1ck: undeadaedra: it's a website https://github.com/rvdh/lamernews
[11:06:24] undeadaedra: For Rails app (as you talk about unicorn), you have rails console
[11:06:46] undeadaedra: Sinatra is a bit more complicated
[11:06:57] R1ck: I'm afraid I know very little about Rails and ruby as I'm just a poor engineer tasked with getting this thing running
[11:07:13] undeadaedra: What do you want, just to run the application, or have a console to be able to tests objects directly ?
[11:07:17] Ankit: use linuxr1ck
[11:08:05] R1ck: undeadaedra: well, I've made some modifications to app_config.rb and want to see whats happening.. see https://github.com/rvdh/lamernews/blob/master/app_config.rb from line 8
[11:08:17] undeadaedra: Just to run the app, use rackup
[11:08:35] undeadaedra: It will start a server and you will be able to access it through your browser
[11:08:37] R1ck: yes.. that seems to work
[11:08:55] R1ck: well.. "work" :) it generates the same error I'm trying to fix so thats good :P
[11:09:11] withnale_: Does anyone know of something like jeweller or 'bundle gem' but using your own template?
[11:09:22] undeadaedra: withnale_: cp -R
[11:09:47] withnale_: a less low rent solution :)
[11:10:06] undeadaedra: it???s the most flexible though
[11:11:36] R1ck: I fixed my bug \o/
[11:13:59] jlebrech: I need to do a group_by and sum columns in SQL (or an array of hashes), it's so complex in ruby, and i've already figured the sql query. I only need sql temporeraly, would you recommend sqlite and sequel for that?
[11:14:44] canton7: tbh if you've got the sql, there should be some fairly simple corresponding ruby
[11:17:57] shevy: undeadaedra I fixed your bugs
[11:18:32] undeadaedra: So it should work then.
[11:18:33] shevy: your french accent got fixed!!!
[11:18:56] shevy: there used to be Mon_Ouie here
[11:18:59] DaniG2k: does anyone know of a junior/mid-level ruby dev position in London I could apply to by any chance?
[11:19:05] undeadaedra: I don???t think this is something you can fix like that, shevy :)
[11:19:09] shevy: https://github.com/Mon-Ouie
[11:19:22] shevy: undeadaedra look, french rays https://github.com/Mon-Ouie/ray
[11:19:42] shevy: with pics http://mon-ouie.github.io/projects/ray.html
[11:25:13] gregf_: DaniG2k: we did have one but its fill only 3 days back :/
[11:25:19] gregf_: s/fill/filled/
[11:26:04] gregf_: well, not dev tbp. devops
[11:26:35] gregf_: devops can't code properly lol
[11:27:52] gregf_: everywhere ;)
[11:30:25] akky: how can i create custom matchers
[11:30:36] jhass: akky: for?
[11:31:19] akky: expect(some_function).to be_xxxx
[11:31:31] DaniG2k: gregf_: I'm doing devopsy stuff now
[11:31:47] DaniG2k: gregf_: sys-admin & support
[11:31:57] jhass: akky: the answer is rspec
[11:32:03] jhass: to my question
[11:34:27] workmad3: akky: it's rare you need to create a new custom matcher of the form be_xxxx... rspec provides a fairly general form where 'expect(something).to be_foobar' is equivalent to 'expect(something.foobar?).to be true'
[11:34:41] jhass: akky: https://relishapp.com/rspec/rspec-expectations/v/3-2/docs/custom-matchers/define-matcher
[11:36:00] akky: workmad3: can u please refer to some example
[11:37:00] workmad3: akky: expect(response).to be_success
[11:37:00] akky: u may msg me e.g. in query
[11:37:12] workmad3: as a common example from rails controller specs
[11:37:42] workmad3: there's no be_success matcher, rspec just picks up the be_ prefix and checks response.success? for the expectation
[11:38:51] akky: workmad3: i am new to ruby n dont understand u properly pls refer me to some link
[11:40:37] akky: workmad3: ?????
[11:45:37] shevy: undeadaedra you should write more french here
[11:47:28] hs366: evening all !
[11:47:42] shevy: hey hs366
[11:47:47] shevy: were you the C++ guy
[11:48:05] hs366: now im c+by
[11:48:08] shevy: have you been writing more ruby since the last time you were here
[11:48:37] hs366: i still practice and learn
[11:51:03] hs366: i have some problem with extracting some information from hash
[11:51:30] hs366: and as i understand hash is some sort of array
[11:51:51] canton7: not really, no
[11:52:07] shevy: they are similar
[11:52:10] canton7: hashtable? dictionary? lookup? any of those words ring a bell from C++?
[11:52:15] shevy: you could use a hash with keys such as 0,1,2,3,4
[11:52:37] undeadaedra: associative array, too
[11:52:47] hs366: ok got it
[11:52:47] shevy: hs366 you can think of an Array as a simpler data structure; use << to append, and [] to obtain
[11:53:16] shevy: though Hash also has []
[11:53:24] shevy: but you need to know the specific name
[11:53:52] shevy: or perhaps not
[11:54:09] shevy: both respond to [] and both return nil when this key or position does not exist
[11:54:26] undeadaedra: <shevy> but you need to know the specific name
[11:54:33] undeadaedra: in an Array, you need the index
[11:54:55] shevy: undeadaedra yeah but a hash could have 0,1,2,3 as a key too
[11:55:14] hs366: the specific name you mean = the name of k-v ?
[11:55:56] jhass: hs366: an array is an order list of objects, a hash maps a key (which can be any object) to a value
[11:56:10] jhass: (which can also be any object)
[11:56:15] jhass: that's all there is to it
[11:56:49] a5i: how do I update Ruby to 2.x on debian ?
[11:56:50] jhass: in hash literals the key is on the left side of the => and the value is on the right side
[11:56:53] hs366: yeah i got it
[11:57:44] hs366: and if i want to extract this keys or value i should simply go through [] with there respective names yes ?
[11:58:07] canton7: not enough detail. please add more detail.
[11:58:20] shevy: hs366 yeah. you can also use .fetch()
[11:58:51] hs366: aha.. i have to test my code with fetch
[11:58:53] shevy: a5i does debian not allow this? :)
[11:59:10] a5i: I dont now :[
[11:59:22] shevy: I actually think you can, hanmac uses ubuntu
[11:59:25] jhass: hs366: there are no names. a key maps to a value, you pass the key to Hash#[] or Hash#fetch and get the value back
[11:59:36] undeadaedra: a5i: you can use rvm/rbenv to have custom ruby versions
[12:02:44] dblessing: how can I stub a call to IO.read?
[12:03:04] dblessing: i tried `allow(IO).to receive(:read)` but when i run rspec it's still telling me it can't load the file
[12:06:16] jhass: dblessing: try to reproduce in a single file
[12:06:28] jhass: if you manage to, gist it
[12:07:01] sandelius: how do one call a method from a different class in the current class context? I have the method name and the instance of the other class.
[12:08:47] sandelius: do mind me, composition works better here
[12:09:10] dblessing: jhass: https://gist.github.com/dblessing/9f711d11dfe8743c17e9
[12:09:43] jhass: sandelius: good, never do this in production code without a very good reason, but Foo.instance_method(:name).bind(self).call
[12:10:26] jhass: dblessing: I don't think I can download that and reproduce locally
[12:10:46] dblessing: jhass: no, not in that example.
[12:11:07] jhass: make one were that works
[12:13:37] DelphiWorld: i have a ruby on rail app
[12:13:40] DelphiWorld: how to start it?
[12:14:56] undeadaedra: what are you doing with this app ?
[12:14:56] wasamasa: read the README
[12:15:08] DelphiWorld: it's just a open source app gonna try
[12:15:15] DelphiWorld: the README it's empty:)
[12:15:26] undeadaedra: Their website has no doc ?
[12:15:27] wasamasa: hire someone able to read ruby
[12:15:40] wasamasa: I'm not joking
[12:15:41] undeadaedra: Because it depends on the app, they may have a special run process
[12:15:43] DelphiWorld: it's open source
[12:15:53] wasamasa: hiring someone to do work for you is always an option
[12:16:00] undeadaedra: what???s the app, DelphiWorld ?
[12:16:31] DelphiWorld: undeadaedra: a twitter clone on github, let me get it to you
[12:16:58] DelphiWorld: wasamasa: stop kyding
[12:17:10] wasamasa: I don't know what that's even supposed to be
[12:17:19] canton7: I google it. Google didn't think it existed
[12:17:23] DelphiWorld: wasamasa: take your seat and let me
[12:17:34] wasamasa: DelphiWorld: I'm well seated, thank you
[12:17:48] undeadaedra: get a room, you two
[12:18:01] DelphiWorld: undeadaedra: ;)
[12:19:04] DelphiWorld: undeadaedra: https://github.com/tiimgreen/twitter.git
[12:19:52] jhass: looks like unpatched security issues in the dependency tree, but just bin/rails s it
[12:19:54] undeadaedra: No README, no doc, the live version is down, smells good in there.
[12:20:14] canton7: yeah, I wouldn't spend much time with that myself
[12:20:15] jhass: after the usual bundle of course
[12:20:26] undeadaedra: DelphiWorld: should behave like a basic rails app, I advise to read a quick guide on rails to know how to handle it
[12:20:32] wasamasa: bundle exec rails s
[12:33:14] jhass: so, let's see how long until opeiros kills me for this
[12:33:19] jhass: !enable Hangman
[12:33:19] DeBot: jhass: Enabled Hangman.
[12:33:23] jhass: DeBot: !hangman gems
[12:33:24] DeBot: _____ [] 0/12
[12:33:30] DeBot: _____ [e] 1/12
[12:33:34] DeBot: ___t_ [e] 1/12
[12:33:43] DeBot: s__t_ [e] 1/12
[12:33:50] DeBot: s__t_ [ea] 2/12
[12:33:54] DeBot: s__t_ [eau] 3/12
[12:33:56] DeBot: s__t_ [eaui] 4/12
[12:33:59] DeBot: s_ot_ [eaui] 4/12
[12:34:06] DeBot: slot_ [eaui] 4/12
[12:34:06] DeBot: sloth [eaui] 4/12 You won!
[12:34:53] apeiros_: jhass: I think I'll kickban you for introducing this bot here and keep the bot ;-p
[12:35:19] DeBot: kay, can live with that
[12:35:30] workmad3: DeBot: !hangman gems
[12:35:30] DeBot: _____________ [] 0/12
[12:36:00] DeBot: _____e_______ [] 0/12
[12:37:05] DeBot: r____e_____r_ [] 0/12
[12:37:12] DeBot: r____e_____r_ [s] 1/12
[12:37:14] workmad3: jhass: I now want to create a gem called "thequickbrownfoxjumpedoverthelazydog" :)
[12:37:15] DeBot: r____e_____r_ [st] 2/12
[12:37:22] jhass: workmad3: <3
[12:37:26] DeBot: r____e_c___r_ [st] 2/12
[12:37:30] apeiros_: workmad3: you mean to have a 100% 0/12 win?
[12:37:33] DeBot: ru___e_c___r_ [st] 2/12
[12:37:34] workmad3: apeiros_: ya
[12:37:39] DeBot: ru___e_c__ar_ [st] 2/12
[12:37:43] DeBot: ru___e_c__ar_ [std] 3/12
[12:37:44] DeBot: rub_be_c__ar_ [std] 3/12
[12:37:49] DeBot: rubybe_c__ar_ [std] 3/12
[12:37:49] DeBot: rubybe_c__ar_ [std] 3/12
[12:37:56] wasamasa: hahaha, std
[12:38:10] wasamasa: I totally did not intend this to happen
[12:38:14] workmad3: jhass: can you do 'debot: <full guess>'?
[12:38:19] oddmunds: rubybenchmark
[12:38:28] DeBot: rubybe_c__ark [std] 3/12
[12:38:37] undeadaedra: thanks, oddmunds
[12:38:41] jhass: oddmunds: er, was referring to workmad3
[12:38:41] DeBot: rubybe_ch_ark [std] 3/12
[12:38:54] DeBot: rubybe_chmark [std] 3/12
[12:38:55] DeBot: rubybenchmark [std] 3/12 You won!
[12:39:09] jhass: workmad3: should probably do that, but I don't want to allow multiple guesses in one, so need a way to differentiate that nicely
[12:39:29] workmad3: jhass: if it's > 1 character, it's a full guess?
[12:39:54] undeadaedra: so we have a hangman bot in #ruby now
[12:40:11] workmad3: undeadaedra: yes, until apeiros_ gets bored and kicks it out :)
[12:40:30] apeiros_: /nick kingboredbanhammer
[12:41:15] undeadaedra: what are the categories ?
[12:41:21] undeadaedra: DeBot: !help hangman
[12:41:36] undeadaedra: I did not say !help beatles
[12:41:55] jhass: mh, I guess I just allow multiple guesses
[12:42:24] jhass: undeadaedra: just gems and the default (nouns)
[12:42:37] jhass: if you have a nice word list to add ...
[12:42:50] undeadaedra: Hash methods.
[12:43:05] jhass: underscores are not nice
[12:43:20] undeadaedra: by the way, you should space your letters
[12:43:29] undeadaedra: it???s not easy to count linked underscores
[12:43:45] apeiros_: jhass: yeah, core classes & methods
[12:43:46] jhass: just because you use no monospace font
[12:44:19] jhass: space looks ugly though
[12:44:33] jhass: apeiros_: meh, seems too much work to create
[12:44:43] jhass: undeadaedra: yeah
[12:49:52] jhass: I could screw shevy and use some fancy unicode symbol as placeholder
[12:49:59] jhass: would also make _ possible
[12:50:14] shevy: but nobody would be able to guess unicode hangman
[12:50:39] jhass: nah, I'd still limit the words to a-z_
[12:50:52] jhass: and =?! if we want method names I guess
[12:51:15] shevy: how does crystal handle encoding?
[12:51:24] jhass: for now not at all
[12:51:28] jhass: utf-8 or go home
[12:52:08] jhass: that is because nobody sat down and contributed proper encoding support yet
[12:57:41] jhass: mmh, a bit high vertical baseline???
[12:58:04] jhass: ah, there we go
[13:03:31] shevy: line noise
[13:07:02] jhass: Uh, I think I have a new favorite unicode character
[13:07:25] jhass: " misspelling of "BRACKET" in character name is a known defect"
[13:08:26] shevy: I like the snowman
[13:08:34] shevy: that dude would almost be enough incentive to switch
[13:08:59] shevy: I am sure he is necessary in some language too http://www.fileformat.info/info/unicode/char/2603/index.htm
[13:10:58] jhass: ????????? how bad would this be?
[13:11:26] shevy: I have no idea what that is
[13:11:30] shevy: can you make a screenshot?
[13:12:55] jhass: http://cloud.aeshna.de/u/mrzyx/screenshots/screenshot_20150319_141241.png
[13:12:59] jhass: probably not
[13:13:01] shevy: jhass hmm have you been using latex for your ... what was the name... bachelor thesis?
[13:13:20] shevy: now that is a minimal screenshot if I have ever seen one
[13:13:36] shevy: that's like recorded with a potato
[13:13:57] shevy: it's the three . put much together right?
[13:14:03] shevy: I think I can copy/paste that ... into my editor
[13:14:16] shevy: well apparently not from xchat
[13:14:19] shevy: but I can via firefox!
[13:20:56] bradland: elics.map { |i| e = Event.find(i[:id]); "#{i[:count]} [#{e.id}] #{e.name}" } \
[13:20:56] bradland: .each.with_index { |r,i| puts "##{(i+1).to_s.ljust(2)} #{r}" };0
[13:25:55] machty: i have a file-importing ruby process that expands to 512MB mem usage and doesn't seem to contract after that. Is that evidence of a leak, or just that a ruby process will expand to its max and not contract after the fact?
[13:26:28] certainty: bradland: Event.where(id: list_of_ids).then_the_formatting is probably more efficient
[13:27:17] bradland: certainty: this is code that came to me from an analyst. meant to paste it in to a rake task wherein my task is to clean this mess up.
[13:27:39] certainty: bradland: ah i see. have fun :)
[13:34:45] jhass: machty: could be both, I think only 2.2 or 2.1 started giving up allocated memory at all
[13:35:10] machty: jhass: really? is there a term i could google relating to that?
[13:35:15] machty: or a blog post
[13:36:05] jhass: no idea, I would expect "ruby memory allocation" to yield something
[13:36:40] bradland: machty: what ruby version are you running?
[13:36:48] bradland: you can inspect GC activity to see what's being cleaned up.
[13:36:58] bradland: if it tops out at 512 MB and doesn't grow, it's probably fine
[13:37:24] bradland: a good GC doesn't clear out memory unless it needs it for something else
[13:37:30] machty: bradland: what is the actual mechanism limiting it to 512? some Ruby constant? or does a malloc fail and ruby takes that as its queue to GC?
[13:37:34] bradland: otherwise it may have to reload those items to memory unnecessarily
[13:38:16] bradland: i don't have any good resources on GC tuning in newer ruby versions, unfortunately
[13:38:25] bradland: there have been some significant changes, so the old 1.9 stuff doesn't apply
[13:39:17] bradland: in general, you'll want to look in to the 2.1 GC related objects and GC tuning
[13:39:28] bradland: but if it stays at 512 MB, i wouldn't consider it a problem
[13:41:29] jhass: machty: http://samsaffron.com/archive/2014/04/08/ruby-2-1-garbage-collection-ready-for-production seems like a nice article (second google result for me)
[13:42:05] bradland: machty: it's important to understand the goals of garbage collection before tuning
[13:42:12] shevy: drive your car
[13:42:14] shevy: tune it good
[13:42:50] bradland: you don't want the ruby GC removing objects from memory that will probably be needed again
[13:43:12] bradland: in other words, you shouldn't tune the GC to use the minimum amount of memory, you should tune it to use the most efficient amount of memory
[13:52:53] machty: bradland: what does it mean to "probably be needed again"? wouldn't i have a reference to that object somewhere in my code?
[13:56:13] bradland: machty: that samsaffron.com article is pretty good. i'd recommend reading it.
[13:56:37] bradland: it talks about what triggers a GC event, and how tuning the GC can result in increased performance, but possibly increased memory usage.
[13:56:54] bradland: if you're memory constrained in your environment, then you may have to choose different priorities.
[13:58:03] machty: bradland: i am reading it
[13:58:14] machty: i think what you meant was you don't want ruby _sweeping_ young objects
[13:58:16] machty: that i get
[13:58:39] machty: i just thought you were suggesting there was some concept of not wanting to clean up objects you've definitely lost reference to as if they could be re-referenced in the future
[13:59:18] bradland: no, what i'm suggesting is that by setting limits too low, you can cause performance issues
[13:59:20] machty: you don't want ruby _sweeping_ old objects
[13:59:30] machty: at least, not in a minor sweep
[13:59:46] bradland: seems like the new GC instrumentation will be useful to you
[14:06:05] raph_ael: Hi, I manage a ruby mirror, seems that source rsync mirrors do not work anymore
[14:24:05] Karunamon: Hiya folks - Just wondering if anyone has any experience invoking Rspec mid-program
[14:26:07] Karunamon: i'm writing a virtual machine management tool, and I'm using rspec to check the data provided by the user to create a machine beacuse the syntax is really simple.. problem is I have to jump through some silly hoops to make this process work (writing an external file which loads a couple of gems and contains the object i'm testing). Ideally I could just run rspec mid-program and check the status of the tests afterwards
[14:38:54] Karunamon: I'm also wondering what the best way to write a function that checks the state of a string against some external tools. I'd like to be able to write 'something'.is_a_foo?, but extending String feels wrong
[14:58:11] jhass: Karunamon: yeah, avoid core extensions unless they're extremely useful and fit into the domain of the extended object
[14:58:45] jhass: like String#colorize makes sense, String#my_application_has_a_method_name_like_this does not
[15:00:12] apeiros_: I tried to use refinements for that kind of stuff
[15:00:37] apeiros_: but at the moment, I'm quite unhappy about them. they're just way too unflexible. and so out of touch with how ruby works otherwise.
[15:03:25] workmad3: jhass: I've found adding String#sanitize to perform HTML whitelist sanitization quite useful in rails projects
[15:03:54] jhass: yeah, I think that makes sense
[15:04:01] jhass: since you work with the data of string
[15:05:31] jhass: opposed to being lazy about MyStore.has_in_store? thing and want to do thing.is_in_store?
[15:05:48] jhass: with thing being a core class
[15:09:06] certainty: http://openssl.org/news/secadv_20150319.txt so there we have it
[15:09:23] Karunamon: man I can't wait for libressl to seriously take off :(
[15:09:27] jhass: "just" DoS, thankfully
[15:09:46] certainty: jhass: if you have 1.0.2 deployed :)
[15:10:01] jhass: of course I have
[15:10:36] certainty: i was a bit worried about the CVE-2015-0289 and CVE-2015-0292
[15:15:17] jhass: DeBot: !hangman ruby
[15:15:17] DeBot: ?????????????????????????????????????????????????????? [] 0/12
[15:15:23] DeBot: ?????????????????????????????????????????????#?????? [] 0/12
[15:15:27] DeBot: ?????????????????????::??????????????????#?????? [] 0/12
[15:16:13] jhass: DeBot: aeoui
[15:16:13] DeBot: O???e????????????::???i???e??????#?????? [au] 2/12
[15:16:30] plsk: Debot: v
[15:16:40] Karunamon: DeBot: Openssl::
[15:16:40] DeBot: OpenSSL::???i???es???#?????? [au] 2/12
[15:16:50] certainty: how fitting
[15:16:57] gregf_: DeBot: python
[15:16:58] DeBot: OpenSSL::???i???est#?????? [auyh] 4/12
[15:17:00] Karunamon: speak of the devl
[15:17:27] DeBot: OpenSSL::Di???est#?????? [auyh] 4/12
[15:17:32] certainty: DeBot: Digest
[15:17:33] DeBot: OpenSSL::Digest#?????? [auyh] 4/12
[15:17:54] DeBot: OpenSSL::Digest#?????? [auyh=] 5/12
[15:18:21] jhass: uh, right
[15:18:33] jhass: I might have not whitelisted those xD
[15:18:45] certainty: it should be << i think
[15:18:58] Karunamon: If it's not one of those, that method name is awful
[15:19:02] Karunamon: then again, this is openssl we're talking about
[15:19:23] workmad3: jhass: have you changed the _ character you were using?
[15:19:41] jhass: workmad3: yeah
[15:19:47] jhass: since method names can have _
[15:19:49] certainty: too bad for shevy
[15:19:51] jhass: so gems with _ are in now too
[15:20:06] jhass: I should add - too
[15:20:30] jhass: Karunamon: it's <<, only two letter method there
[15:20:47] jhass: alias for update
[15:21:01] workmad3: jhass: ah... it renders weird for me is all :)
[15:21:11] certainty: renders fine for me.
[15:21:24] certainty: who cares about the crazy britains
[15:21:38] jhass: workmad3: yeah, all others I considered rendered worse though
[15:21:44] jhass: if you come across any nice one
[15:22:10] workmad3: certainty: more accurately, who cares about the crazy brit using symbola rather than apple's default emoji fonts because he prefers symbola symbols in his utf-8 command prompt? :)
[15:22:20] jhass: so, =?!<[], anything else in core method names?
[15:23:13] workmad3: jhass: and >
[15:23:28] certainty: workmad3: not so crazy if you don't use apple's stuff
[15:23:38] jhass: what's () though? isn't that a parser rewrite to .call?
[15:23:51] workmad3: jhass: ah, scratch ()... for some reason I thought it could be overridden
[15:24:17] workmad3: jhass: % is possible though
[15:25:01] apeiros_: >> "^*/-+=?![]~%@".chars.sort*""
[15:25:03] eval-in_: apeiros_ => "!%*+-/=?@[]^~" (https://eval.in/302110)
[15:25:12] jhass: _=\?\!\:#<>[]+-@/%~^
[15:25:25] jhass: >> "_=\?\!\:#<>[]+-@/%~^".chars.sort
[15:25:26] eval-in_: jhass => ["!", "#", "%", "+", "-", "/", ":", "<", "=", ">", "?", "@", "[", "]", "^", "_", "~"] (https://eval.in/302111)
[15:25:47] apeiros_: anybody ever tried to implement that elsewhere?
[15:25:59] apeiros_: I wonder how you'd call it, other than .`()
[15:26:02] workmad3: jhass: can't see * in the list you gave (it's in apeiros_'s list)
[15:26:13] jhass: right, thanks
[15:26:28] workmad3: apeiros_: no idea, other than the one on kernel
[15:26:30] jhass: I think we're good now
[15:26:44] apeiros_: jhass: wouldn't you notice when building the wordlist?
[15:27:10] jhass: I don't filter it...
[15:27:20] workmad3: apeiros_: aha... if you override `, then `foobar` in that context will use your override
[15:27:20] jhass: http://maxcdn-docs.devdocs.io/ruby/index.json
[15:28:50] workmad3: apeiros_: https://gist.github.com/workmad3/b46437935e71da161397
[15:29:05] apeiros_: ruby -e 'res = []; ObjectSpace.each_object(Module) { |m| res << m.name; res.concat(m.methods); res.concat(m.instance_methods) }; res.uniq!; res.compact!; res.map!(&:downcase); res.uniq!; puts res.size'
[15:29:12] apeiros_: 1506 values
[15:29:41] apeiros_: "!%&*+-./012:<=>?@[]^_`abcdefghijklmnopqrstuvwxyz|~"
[15:29:46] apeiros_: we omitted |
[15:30:05] apeiros_: funny, only 0-2 are in method names :D
[15:30:14] apeiros_: 3-9 are not method name material
[15:30:26] jhass: how about class names?
[15:30:27] apeiros_: wtf? "."?!?
[15:30:37] apeiros_: jhass: check the code, had that in
[15:30:52] apeiros_: ACTION back in 30
[15:30:56] apeiros_: minutes, that is
[15:30:56] workmad3: apeiros_: that's just core though, not stdlib... otherwise Popen3 would be there
[15:31:02] apeiros_: yes, that's only core
[15:31:14] jhass: I guess I'll do it with the index
[15:31:20] apeiros_: feel free to generate the proper -r line ;-)
[15:31:23] eam: are you guys writing perl here
[15:31:30] Karunamon: ooh, basic question now that i'm thinking about it again -
[15:31:46] Karunamon: what's the way to play with the class signature you get back when messing around in irb?
[15:32:00] workmad3: eam: no, jhass is sorting out the whitelist filter for his new hangman bot :)
[15:32:16] jhass: mh, do we want to guess global names too?
[15:32:27] workmad3: jhass: sure, go for it
[15:33:39] jhass: " !\"\#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz|~???"
[15:33:46] jhass: where's the space coming from oO
[15:34:01] jhass: and the quote
[15:34:25] jhass: $" not that one I mean, the other one
[15:38:04] jhass: okay, keywords will be in too
[15:44:21] evident: hi everybody... I just wanted to install ruby and ruby on rails on my Mac, but I can only call gem as root... how can I fix that, so that I can run gem, bundle, rake etc as normal user?
[15:44:47] jhass: evident: echo "gem: --user-install" > ~/.gemrc
[15:44:48] colorados: try rvmsudo
[15:44:59] undeadaedra: evident: easiest way is rbenv + ruby-install through brew imo
[15:45:59] undeadaedra: well, technically it???s jhass solution :)
[15:46:08] evident: I was hoping to install it all through rvm... I've already installed rvm and can run it normally.
[15:46:20] evident: what does jhass command do?
[15:46:23] jhass: evident: uh, then you shouldn't need mine
[15:46:32] undeadaedra: if you go through rvm, you should be able to install without sudo
[15:46:35] jhass: evident: what does rvm current say?
[15:46:40] undeadaedra: what does `which ruby` reads ?
[15:47:26] evident: well the weird thing is: when I run rvm install ruby, it will download and install everything... after that, I can call gem, bundle etc... but when I open a new terminal, I can't anymore
[15:47:40] evident: which ruby --> /usr/bin/ruby
[15:47:42] undeadaedra: is rvm correctly setup in your shell ?
[15:47:48] undeadaedra: yes, this is not normal
[15:47:57] undeadaedra: it should point to rvm ruby
[15:48:04] workmad3: evident: 'rvm use <version> --default' to automatically activate an rvm ruby on a new shell
[15:48:20] workmad3: replace <version> with the version you want as default, obviously :)
[15:49:17] jlebrech: how do I go through each in an array of hashes and add a vey and value into it?
[15:49:20] evident: this is my rvm info: http://pastebin.com/dNBDZRdq
[15:49:50] undeadaedra: jlebrech: #each on your main array
[15:50:50] undeadaedra: >> Array.new(5) { |i| { k: i } }.each { |e| e[:z] = 'z' }
[15:50:50] eval-in_: undeadaedra => [{:k=>0, :z=>"z"}, {:k=>1, :z=>"z"}, {:k=>2, :z=>"z"}, {:k=>3, :z=>"z"}, {:k=>4, :z=>"z"}] (https://eval.in/302129)
[15:51:10] jlebrech: undeadaedra: ok :)
[15:54:37] evident: anybody an idea what is causing this error in the rvm info?
[15:55:24] jhass: evident: did you try the rvm use 2.2.1 --default suggestion yet?
[15:56:20] evident: yes I did, but no change
[15:56:52] havenwood: evident: rvm get stable && rvm fix-permissions
[15:56:53] evident: still on new terminal no permission on anything
[15:57:33] jhass: evident: did rvm use 2.2.1 --default have any output ?
[15:59:01] evident: yes (I did with 2.2.0 though): Using /Users/FlorianBg/.rvm/gems/ruby-2.2.0
[15:59:13] evident: right now I am running this fix-permissions thign
[16:08:11] havenwood: evident: It wont hurt anything but looking closer at your error I shouldn't have suggested it. You need to select the Ruby. I need coffee.
[16:09:23] colorados: he needs read documentation
[16:09:40] havenwood: colorados: RTFM! \o/
[16:11:07] havenwood: ACTION checks the backlog for the repeated correct answer.
[16:13:50] havenwood: ruby-install and ruby-build names are too similar. i never know if people really mean the one they refer to.
[16:18:34] colorados: i am serious, easier to find info in RTFM than write the question here
[16:18:51] jhass: havenwood: let's add ruby-make
[16:19:11] jhass: and ruby-compile
[16:19:14] havenwood: jhass: ruby-compile ruby-binary
[16:23:54] colorados: if guy use mac, why he don't choose swift?
[16:23:57] arup_r: ACTION in trouble
[16:25:09] havenwood: colorados: OS X folk deploying to GNU/Linux or a BSD.
[16:25:53] havenwood: colorados: Being either not cross-platform or not open source is a poison pill.
[16:26:10] havenwood: colorados: And swift is neither.
[16:28:18] havenwood: colorados: Have you checked out Crystal?: http://crystal-lang.org/
[16:28:46] undeadaedra: <colorados> if guy use mac, why he don't choose swift?
[16:28:57] undeadaedra: swift is for some kind of development
[16:29:55] undeadaedra: People under Windows don???t all do C#, do they?
[16:30:16] colorados: because windows is shit os
[16:30:39] undeadaedra: cool argumentation, I???m totally conviced
[16:32:11] colorados: things such winSxS is really shit
[16:33:24] colorados: craze system folder three
[16:33:46] colorados: windows has a lot of shit
[16:34:07] colorados: crazy size of newly installed
[16:34:15] undeadaedra: everything is crazy
[16:35:12] undeadaedra: that???s a pretty solid argumentation you have here
[16:35:18] undeadaedra: you should sum it all in a blog post
[16:35:39] colorados: its well known things
[16:36:00] undeadaedra: maybe even a book
[16:36:05] undeadaedra: you could sell it millions
[16:36:09] undeadaedra: lol, millions.
[16:36:29] colorados: i present idea to you
[16:39:14] colorados: windows only for scoolboys
[16:39:31] undeadaedra: what is the point you???re trying to reach here?
[16:39:57] colorados: its shit os
[16:41:50] undeadaedra: this is an argument, what point does this arguments help ?
[16:42:37] jhass: undeadaedra: that swift is better than ruby, obviously
[16:42:40] jhass: how can you not see this
[16:43:14] undeadaedra: this I already know, you see
[16:43:27] undeadaedra: since I???m on a mac, I can only do swift.
[16:44:00] jhass: finally, why did you make this so hard
[16:45:27] jhass: Swift on OS X, C# on Windows, Vala on Fedora, Bash script on Arch, QML on OpenSuse
[16:45:36] jhass: every language has its place
[16:45:47] undeadaedra: Predefined cases for everyone
[16:46:14] undeadaedra: And colorados, with its superior knowledge on OSes, manages all of that
[16:46:16] jhass: evident: how's it going?
[16:46:20] undeadaedra: What a time to be alive
[16:48:34] evident: jhass: better... :) Had some issues with the paths in my shell... they weren't set correctly when starting a new zsh... So rvm had some issues
[16:49:20] evident: not everything is working correctly yet, but I have some thigns to test and try :)
[16:53:25] colorados: anf what about hurd
[16:54:00] colorados: is it alive?
[16:54:45] centrx: It's something
[16:55:01] undeadaedra: I hurd they are still on it
[16:55:21] havenwood: colorados: I'd just like to interject for a moment. What you???re referring to as Hurd, is in fact, GNU/Hurd, or as I???ve recently taken to calling it, GNU plus Hurd.
[16:57:28] colorados: i ve never seen hurd so difficult question for me
[16:58:13] a1fa: in two loops, how do you "next" the first loop?
[16:59:04] jhass: a1fa: you can't in ruby, usually there's a better way to write something that would need it anyway
[16:59:11] apeiros_: a1fa: you jump out of the inner loop and call next in the outer.
[16:59:30] apeiros_: a1fa: and what jhass said. there's almost always a better way to do it.
[16:59:38] helpa: http://mywiki.wooledge.org/XyProblem
[16:59:45] helpa: http://mywiki.wooledge.org/XyProblem
[16:59:55] jhass: a1fa: !xy
[16:59:55] helpa: a1fa: http://mywiki.wooledge.org/XyProblem
[16:59:55] apeiros_: bad bot helpa, no botsnack
[17:00:16] undeadaedra: 3 tries, could do better.
[17:00:25] jhass: it's fine, we bot authors can't agree on a way
[17:00:27] apeiros_: 2 tries. jhass did 3rd.
[17:00:37] undeadaedra: It took 3 times for the chan.
[17:00:38] jhass: it was no try, I just demoed!
[17:00:44] apeiros_: jhass: you're not a senior bot dev then.
[17:00:50] jhass: mine does ?foo apeiros
[17:01:06] apeiros_: senior bot dev says "we agreed on my way being best. those who don't use my way are no real bot authors."
[17:01:07] undeadaedra: jhass: it???s because you have the right OS for bot making
[17:01:19] jhass: !give x nick is also common
[17:13:51] jokke: i'm building a rather complex application and i try to split up as much as possible into seperate testable gems
[17:14:20] jokke: however some of the code is so specific to the project that it doesn't make sense to publish it on rubygems
[17:14:38] jokke: now some of the gems depend on others, that aren't published
[17:14:39] apeiros: jokke: you can install gems without publishing them
[17:14:52] apeiros: do you use bundler?
[17:14:54] jokke: but afaik i can't add them as dependencies
[17:14:57] jokke: apeiros: sure
[17:15:11] apeiros: just add them as dependencies and document the git repo
[17:15:30] jokke: apeiros: in the gemspec?
[17:15:32] apeiros: bundler has no issues resolving it, but it requires that you put the dependencies into the Gemfile
[17:15:34] jokke: or in the Gemfile
[17:15:41] jokke: so i did that
[17:15:42] apeiros: we put it in both places
[17:15:51] jokke: apeiros: oh ok
[17:15:59] apeiros: in the gem to ensure that all dependencies are met, and in the gemfile for bundler to resolve it correctly
[17:16:07] apeiros: wish there was a better way, though :)
[17:16:14] jokke: geminabox
[17:16:27] jokke: but i don't have time to set it up here
[17:16:31] apeiros: I'd prefer to be able to just add a git "base" as gem source
[17:17:02] apeiros: e.g. git.example.com/gems, and then it tries to resolve e.g. foo-gem as git.example.com/gems/foo-gem.git first
[17:17:36] apeiros: but yes, geminabox or similar could work too. just never tried that.
[17:29:37] milesmatthias: stupid question, but had trouble googling -- can someone remind me how to define an attribute on a parent class so that every subclass of the parent has that attribute?
[17:30:52] apeiros_: class ParentClass; attr_accessor :foo; end
[17:30:57] apeiros_: milesmatthias: ^
[17:31:13] apeiros_: if that's not what you're looking for - please elaborate what you consider to be an attribute.
[17:32:20] milesmatthias: apeiros_: no, that's what I'm looking for, thanks. I've been trying that which is why I thought I'm going crazy. it's not working for some reason.
[17:33:19] jhass: milesmatthias: !gist
[17:33:19] helpa: milesmatthias: http://gist.github.com - Put your codes online with pretty syntax highlighting and the ability to embed it into other pages.
[17:35:37] apeiros_: milesmatthias: note that all `attr_accessor :foo`does is define two methods for you: `def foo; return @foo; end; def foo=(value); @foo = value; return @foo; end`
[17:38:57] jokke: apeiros_: something with the load path isn't right..
[17:39:35] milesmatthias: apeiros_: yup. problem distracted -- that wasn't actually the issue. that was working all along. sorry to bug everyone. ::resume snarky irc chat:: so how about that left shark, huh?
[17:39:37] jokke: annot load such file -- bsh/persistence/models/asset_property
[17:39:40] jokke: bsh-persistance is a gem
[17:39:44] jokke: which is resolved by bundler via local path for now
[17:41:07] apeiros_: jokke: such things should work. work for us at leas.t
[17:41:15] jokke: never mind...
[17:41:17] jokke: file is missing
[17:41:50] meatherly: does anyone know if you can do this with the ruby openssl library? 'openssl pkcs12 -in cert.p12 -out cert.pem -nodes -clcerts'
[17:42:02] meatherly: would the OpenSSL::PKCS12 class do it?
[17:45:00] jhass: sounds like your on the right path
[17:45:11] jhass: if something can do it, then that one
[17:46:36] jhass: meatherly: maybe to_der returns you what you want already
[17:46:38] jokke: hm nope it still fails with another require
[17:46:49] jokke: require 'bsh/persistence/models/asset'
[17:46:53] jhass: if not you should be able to rebuild a OpenSSL::X509 with the attributes
[17:47:03] jhass: (key, certificate)
[17:47:12] jokke: in bsh-persistence: lib/bsh/persistence/models/asset.rb
[17:47:42] jhass: jokke: bundle exec / require "bundler/setup"?
[17:48:22] jokke: no i didn't require bundler/setup
[17:48:37] jhass: one of those is mandatory for git gems
[17:48:52] jhass: bundle exec just executes the require before doing anything else
[17:50:09] jokke: jhass: it's still a local gem though
[17:50:27] arietis: is there any way to find gems dependent on specified one?
[17:50:31] uptownhr: what does this loopk like ???\xE0\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00"
[17:50:48] undeadaedra: uptownhr: binary data ?
[17:50:51] jhass: jokke: well, you want that anyway
[17:51:04] jhass: jokke: else you loose bundlers main purpose
[17:51:45] havenwood: uptownhr: A caravan of zeros lead by a wonky quote and a 224.
[17:51:53] arietis: oh, found it :) https://github.com/grosser/gem-dependent
[17:51:54] jokke: i still don't understand why the gem lib dir is not in the load path
[17:52:13] uptownhr: how do i convert this into binary bits?
[17:52:18] jhass: jokke: even after bundle exec / bundler/setup ?
[17:52:26] jhass: uptownhr: what are binary bits
[17:52:29] havenwood: >> "\xE0\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00".bytes
[17:52:29] eval-in_: havenwood => [224, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0] (https://eval.in/302146)
[17:52:41] jhass: yes, but in ruby
[17:52:49] jokke: jhass: yeah i required 'bundler/setup'
[17:53:14] jhass: jokke: mmh, and your .lock contains the gem for sure? Do other files work?
[17:53:37] havenwood: uptownhr: Do you know how to convert a Fixnum to base 2?
[17:53:50] jhass: uptownhr: so you can only have a single 0 or 1 in ruby, that string contains a whole lot of them, how would you like them represented?
[17:53:57] jokke: jhass: https://p.jreinert.com/8PpUYn/
[17:54:03] uptownhr: 010101010101 string
[17:54:10] havenwood: uptownhr: http://ruby-doc.org/core/Fixnum.html#method-i-to_s
[17:55:12] uptownhr: so how do i go from ???\xE0\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00??? to int?
[17:55:33] havenwood: uptownhr: Are you familiar with the #map method?
[17:55:49] jhass: >> "\xE0\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00".bytes.map {|b| b.to_s(2) }.join
[17:55:49] eval-in_: jhass => "1110000000000001000000000" (https://eval.in/302147)
[17:55:50] havenwood: uptownhr: Look at eval-in's output above.
[17:55:59] jhass: mmh, I expected that to be longer
[17:56:10] uptownhr: thank you :)
[17:56:47] jokke: uptownhr: alternatively use unpack and to_s(2)
[17:57:15] apeiros_: jhass: binary bits are - of course - the counterpart to unary bits!
[17:57:58] jhass: apeiros_: ah, silly me
[17:58:00] Godd2: 1, 11, 111, 1111, 11111...
[17:58:20] apeiros_: godd2: 0, 00, 000, ???
[17:58:20] jhass: we had an argument recently on how .to_s(1) would look like if it worked
[17:58:22] wallerdev: >> 12.to_s(1)
[17:58:22] eval-in_: wallerdev => invalid radix 1 (ArgumentError) ... (https://eval.in/302148)
[17:58:51] apeiros_: jhass: it's impossible, since numbers don't have leading zeros
[17:59:07] apeiros_: so you can only encode a single value with base 1
[17:59:14] centrx: 12.to_s(1) == 111111111111
[17:59:19] havenwood: 12.to_s(1, 'x') #=> 'xxxxxxxxxxxx'
[17:59:35] Godd2: but if unary 0 is binary 1, then what is binary 0 ?
[17:59:48] jhass: apeiros_: that's pure definition, I can define the symbol to be . and . is 1, .. is 2 etc
[17:59:57] jhass: the problem is rather how to represent 0
[18:00:06] havenwood: jhass: empty string?
[18:00:06] apeiros_: jhass: base 1 means you have a single symbol
[18:00:16] apeiros_: jhass: if you have more than a single symbol, you don't have base 1
[18:00:45] apeiros_: actually, s/symbol/digit/
[18:01:01] apeiros_: stuff like "." and "," and "e" are purely representational
[18:01:35] apeiros_: i.e., 0.1 is just a nice way to write 1*10^-1
[18:02:22] apeiros_: jhass: ah, actually misread you
[18:02:28] Godd2: 0*10^0 + 1*10^-1
[18:02:38] apeiros_: what you suggest is a run-length encoding with a single character
[18:02:43] apeiros_: not sure how that fits into bases.
[18:02:56] jhass: apeiros_: wikipedia says its fine I think
[18:03:08] jhass: http://en.wikipedia.org/wiki/Unary_numeral_system
[18:03:28] apeiros_: jhass: I'm not sure you could call that base 1
[18:03:45] apeiros_: base system relies on digit order and powers
[18:04:04] apeiros_: run length encodings work fundamentally differently
[18:04:34] apeiros_: (and don't forget: bases are still only for representation - see "what base is 'twelve'?")
[18:05:15] jhass: well, it's 1**1 + 1**1 + 1**1... no?
[18:05:19] meatherly: jhass: I guess you can't do it :( http://stackoverflow.com/questions/1735593/whats-the-ruby-openssl-library-equivalent-of-this-command
[18:05:34] apeiros_: jhass: not really. 1 is implicitly ???0001
[18:06:09] meatherly: or it looks like we need a pull request lol j/k.....forget that!!! lol
[18:06:10] jhass: meatherly: I didn't look up what -nodes / -clcerts does, what does it?
[18:06:39] meatherly: nodes: don't encrypt the private keys at all.
[18:06:44] apeiros_: meatherly: wow, that's sad
[18:06:51] meatherly: clcerts: only output client certificates (not CA certificates).
[18:07:06] meatherly: well that's what this is saying https://www.openssl.org/docs/apps/pkcs12.html
[18:08:38] jhass: I still have a hunch that you can use the extracted cert/key to build new instance of X5099
[18:08:54] meatherly: same here. I'll keep searching
[18:08:55] jhass: let me see if I have a pkcs12 file somewhere
[18:12:53] jhass: meatherly: er, I think it's really simple
[18:13:24] jhass: OpenSSL::PKCS12#certificate already returns an OpenSSL::X509
[18:13:31] jhass: which you can just to_pem
[18:13:55] jhass: and you can just to_pem .key too
[18:14:01] meatherly: yeah that's what I was thinking. I'll try it out and see how that works
[18:16:16] jhass: meatherly: 6 years is a lot of time in ruby land, simply discard all results that old
[18:16:57] bradland: elics.each.with_index { |r,i| puts "#%-2s [%s] %s" % [(i+1).to_s, r[:id], r[:name] ] };0
[18:17:09] bradland: is sprintf frowned upon these days?
[18:17:15] bradland: as in, would you shout at me for that code?
[18:17:44] Godd2: bradland I don't think one line of code is enough to shout at someone
[18:17:46] eam: bradland: why would you sprintf instead of #{}?
[18:17:56] bradland: it's so much more compact than #{str.ljust(2)}
[18:18:01] bradland: just an example
[18:18:10] eam: I wouldn't have a beef with it
[18:18:23] bradland: i kind of <3 sprintf
[18:18:24] eam: seems unusual for ruby though
[18:19:32] centrx: It makes sense to separate format from data, can make it clearer, but sometimes not
[18:19:55] bradland: i think that's the root of why i prefer it
[18:20:18] bradland: i know the sprintf format strings, so i really like looking at a format string and being able to easily parse what's going to happen
[18:20:19] jhass: bradland: I'm in the String#% camp
[18:20:30] jhass: sprintf is too C-ish
[18:20:56] bradland: yeah, i should clarify that i'm referring to String#% as sprintf
[18:21:13] bradland: i never use the Kernel#sprintf(format, str) format
[18:21:28] apeiros_: if I don't have the arguments in an array, I actually prefer (s)printf over String#%
[18:21:58] eam: I'd tend to use the sprintf method as well, for clarity
[18:22:04] bradland: ah, i see you can just send them all in as args
[18:22:12] bradland: String#% is hard to google for
[18:22:15] bradland: i'll give sprintf that
[18:22:26] apeiros_: I find `sprintf "template", a, b, c` much less noisy than `print "template" % [a, b, c]`
[18:22:28] jhass: that's why we got symbolhound.com
[18:22:29] eam: if you have an array you can just splat it to sprintf
[18:22:44] xxneolithicxx: looking for some recommendations for modules to expand (pretty print)/ collapse (collapse an entire document down to a single line or as close as i can get it if any nodes arent multiline content)
[18:22:53] bradland: OMG where has symbolhound.com been all my life
[18:22:57] apeiros_: whoops -print
[18:23:05] eam: I feel like I should prefix all my opinions with the disclaimer "I think perl is readable and"
[18:23:23] jhass: xxneolithicxx: reality check: you're in #ruby
[18:23:38] apeiros_: ACTION thinks perl can be pretty readable
[18:23:49] xxneolithicxx: im using ruby..
[18:24:01] jhass: oh you mean reformat?
[18:24:09] apeiros_: and I think you can easily write impenetrable ruby code
[18:24:10] canton7: sounded like an editor question at first
[18:24:17] jhass: collapse sounded editor-ish to me
[18:24:36] bradland: i think he's looking for a minify tool
[18:25:00] bradland: i think middleman has a minify feature?
[18:25:05] bradland: or maybe jekyll
[18:25:07] jhass: does uglifier do html too? gotta check
[18:25:38] bradland: xxneolithicxx: ok, so it's not in middleman core, but this library might be helpful: https://github.com/middleman/middleman-minify-html
[18:25:45] jhass: ah nope, js only
[18:32:09] failshell: do you guys know of a gem that lets you edit .doc/.docx document properties? like changing the font? need to do a mass edit on lots and lots of docs
[18:33:41] wasamasa: failshell: https://github.com/aantix/turkee
[18:33:52] wasamasa: failshell: hire cheap outsourced workers who'll edit your docs!
[18:34:08] bradland: failshell: expect that the two (doc/docx) will probably be supplied by two separate gems
[18:34:23] bradland: docx is XML + some packaging
[18:34:30] failshell: bradland: yup that much i expected
[18:34:31] bradland: so you can actually manipulate manually
[18:34:48] apeiros: failshell: faceless libreoffice might be an option
[18:34:48] bradland: good luck with .doc
[18:35:47] bradland: we evaluated libre/openoffice API + jRuby at one point
[18:35:53] bradland: but we deal with xlsx, not docx
[18:35:57] bradland: so we just use axlsx
[18:36:18] bradland: heh, if only
[18:36:36] failshell: that might kill my fun tool then
[18:37:10] bradland: failshell: you might start here: https://github.com/chrahunt/docx
[18:37:55] bradland: worst case ontario, it has what you need to unpack: https://github.com/chrahunt/docx/blob/master/lib/docx/document.rb
[18:38:08] bradland: you can munge around in the XML from there
[18:38:38] wasamasa: the xml is pretty horrific
[18:38:39] failshell: i was looking at that one earlier. as you said, .doc will be a PITA
[18:39:34] bradland: IMO, don't bother with .doc
[18:39:47] bradland: MS never released specifications for their binary formats (xls and doc)
[18:39:58] wasamasa: I bet they're ashamed of them
[18:40:02] bradland: every single implementation is the result of reverse engineering, and brings with it only pain and suffering
[18:40:07] wasamasa: just like adobe is with psd
[18:40:14] apeiros: I think you can bother with .doc by using faceless libreoffice to convert it to docx
[18:40:19] apeiros: and then deal unified with that
[18:40:27] failshell: yeah that might work too
[18:40:39] failshell: was hoping for something that doesnt need anything external
[18:40:41] bradland: hate to be debbie downer, but don't get your hopes up
[18:40:59] failshell: basically, i want to write a troll that changes the font to comic sans of all docs in a directory hehe
[18:41:08] bradland: as good as libreoffice is, i find it a rare case that it meets end-user expectations
[18:41:39] apeiros: good thing then I managed to avoid doc/docx the last ~10y
[18:41:59] apeiros: we only evaluated using those things, luckily decided against it
[18:42:21] bradland: problem is that people expect to get documents back that are constructed they way they'd construct them
[18:42:25] bradland: picky users :P
[18:42:34] wasamasa: failshell: that's a lot of effort for nothing
[18:43:12] failshell: bradland: you'd think in 2015 we would have solved documents formats.
[18:43:27] bradland: we have (programmers), mostly
[18:43:35] bradland: users have not
[18:43:52] apeiros: there's tons of shit problems which should have been solved by today
[18:43:56] bradland: it's strictly a matter of perspective, but when MS moved to XML, we took a huge leap forward
[18:44:11] apeiros: tbh, I'm very disappointed by the state of affairs RE software
[18:46:11] failshell: see for a docx its easy, once unzipped, there's a file named word/fontTable.xml which contains which font the document uses
[18:46:39] bradland: that's why you'll find gems for docx, but not doc
[18:46:56] bradland: XML = ZOMG, I know this!
[18:47:22] failshell: its prolly the first time in my life im happy seeing XML
[18:48:42] wasamasa: have you taken a look at the xml?
[18:48:46] wasamasa: it's pretty horrific
[18:49:08] bradland: it's a rats nest, but it'll parse fine with XPath
[18:49:22] wasamasa: which is to be expected considering how the document is structured internally, but still
[18:49:32] wasamasa: will be still a pain to work with
[18:49:39] bradland: derp... parse fine with XPath makes no sense :\
[18:50:13] wasamasa: it's a combination of applying properties to selected text and office doing whatever the hell it does
[18:50:22] wasamasa: so it may look right, but is totally weird
[18:50:46] wasamasa: so, yes, if all you want to do is extracting text, that will work
[18:50:49] wasamasa: but manipulation, eh
[18:50:59] bradland: yeah, MS Word doesn't care much about how the XML looks
[18:51:08] bradland: XML is best when you don't look at it lol
[18:51:19] wasamasa: it's the best when you treat it as not human-readable
[18:51:42] wasamasa: in some cases even as binary
[18:51:56] Godd2: Wasn't that the purpose of XML? To be human-readable?
[18:52:03] centrx: HAHAHAHAHA
[18:52:10] Godd2: And then got hi-jacked for serialization?
[18:52:16] bradland: that's a common misconception, IMO
[18:52:27] bradland: XML was meant to be human readable in contrast to binary formats
[18:52:28] wasamasa: it's not even usable for semantic stuff
[18:52:32] bradland: but it wasn't intended to be consumed by humans
[18:52:42] wasamasa: since it's too free regarding representation
[18:52:49] Godd2: Wikipedia: XML is a markup language that defines a set of rules for encoding documents in a format which is both human-readable and machine-readable.
[18:53:23] GaryOak_: human-"readable"
[18:53:44] Godd2: right, that could be interpreted as "yea you can read it if you have to, but we aren't really trying"
[18:53:55] wasamasa: JSON is a lot less silly for just serializing stuff
[19:05:39] eric_lagergren: so, when I install ruby with `sudo pacman -S ruby` I can't use it locally... it always installs it for root
[19:05:43] eric_lagergren: Is there a way to change this...?
[19:05:52] eric_lagergren: (Preferably without installing from source.)
[19:06:26] jhass: eric_lagergren: what do you mean you can't use it locally?
[19:06:31] jhass: works very well over here
[19:06:50] eric_lagergren: I need root permissions to do anything
[19:07:21] jhass: what's the error you're getting otherwise?
[19:08:21] eric_lagergren: https://gist.github.com/EricLagerg/5b836b2d014c4a654d99
[19:08:35] eric_lagergren: But if I use `sudo ...` it works.
[19:08:43] eric_lagergren: and I've already tried uninstalling and then reinstalling ruby.
[19:08:52] jhass: eric_lagergren: how exactly did you install jeykll?
[19:09:00] eric_lagergren: gem install jekyll
[19:09:09] jhass: please, as precise as possible
[19:09:31] jhass: with which user, changing permissions how
[19:09:37] jhass: if at all
[19:09:54] eric_lagergren: yeah, with my normal user account.
[19:10:06] eric_lagergren: I have all my gems in $HOME/.gems
[19:10:13] eric_lagergren: and theoretically it should work...
[19:10:43] eric_lagergren: sorry, $HOME/.gem (without the 's')
[19:11:52] eric_lagergren: here's the directory hierarchy...
[19:12:00] eric_lagergren: https://gist.github.com/EricLagerg/e39633422aa2bdbb7d3c
[19:12:41] jhass: head -n1 $(which jeykll) says what?
[19:12:57] jhass: also which jeykll plain
[19:14:09] eric_lagergren: #!/usr/bin/ruby
[19:14:30] eric_lagergren: uhm, which ever jekyll is the default install..
[19:14:39] eric_lagergren: but, see, it's the same issue with jekyll, sass, etc.
[19:14:47] jhass: that's weird, let me spin but a clean chroot
[19:14:55] jhass: do you have a ~/.gemrc
[19:15:19] apeiros: what bouncer do you folks use? (cross posting this in #ruby-lang)
[19:15:48] jhass: basically first I tried and didn
[19:15:53] jhass: 't lack anything I wanted
[19:16:41] jhass: you can also use weechat as bouncer
[19:16:50] jhass: has a dedicated protocol though afaik
[19:16:54] jhass: so you need a weechat client
[19:17:10] jhass: (which exists for android)
[19:17:44] apeiros: ok, twice znc so far
[19:22:02] apeiros: any recommendation on modules? I think I'd want fail2ban, saslauth, sasl, keepnick, simple_away (cross posting this in #ruby-lang)
[19:22:09] talntid: anyone here have experience with the watchr gem? right when i start it I get this error: /usr/local/rvm/gems/ruby-2.2.0/gems/watchr-0.7/lib/watchr.rb:111:in `handler': uninitialized constant Module::Config (NameError)
[19:23:00] jhass: eric_lagergren: so just tried in a clean chroot (since my ruby setup differs a bit from arch defaults), had to patch up $PATH to include the binary dir, but then working fine here. Can you post your gem env output?
[19:23:41] eric_lagergren: https://gist.github.com/EricLagerg/29bcecec30bdae4bcc25
[19:24:33] eric_lagergren: Sorry, I'm clueless about Ruby but I use a couple Gems :/
[19:25:11] jhass: apeiros: chansaver, saslauth is the deprecated version of sasl I think?
[19:25:54] apeiros: jhass: I understood as saslauth = enable me to log into znc with sasl, and sasl = enable ZNC to log into irc with sasl. maybe just bad reading on my part or bad wording on theirs????
[19:25:54] jhass: oh cyrusauth actually
[19:26:12] jhass: at least wiki redirects there
[19:26:17] jhass: http://wiki.znc.in/Cyrusauth
[19:26:28] bradland: talntid: interesting. i see that Config object referenced in a few locations, but i don't see it defined in the project
[19:26:29] havenn: talntid: The gem hasn't been updated for modern Rubies. It doesn't seem it is being maintained. See all the PRs for RbConfig: https://github.com/mynyml/watchr/pulls
[19:27:00] havenn: bradland: Config is a 1.8 thing.
[19:28:58] bradland: talntid: based on the network graph this is the most up to date: https://github.com/kevinburke/observr
[19:29:07] havenn: or a 1.9.1 thing? anyways, zombie Rubies only. :P
[19:29:21] jhass: eric_lagergren: I'm still confused as to why this is happening, can you try rm -rf ~/.gem; and then posting gem list ?
[19:30:40] eric_lagergren: https://gist.github.com/EricLagerg/f8af27f60d06a5554fe8
[19:31:36] jhass: eric_lagergren: and now, keeping your regular user, gem install jekyll again, see if it works then?
[19:33:18] eric_lagergren: jhass: same error "
[19:35:09] jhass: eric_lagergren: you run that in your home right? not inside an existing project or anything?
[19:35:33] eric_lagergren: nope. Just inside my home
[19:35:58] apeiros: so I see, apt-get still installs at least 6M old versions. *sob*.
[19:36:45] jhass: running out of ideas here, it looks pretty much like my clean chroot except for the added $PATH entries of course
[19:37:10] jhass: nothing unusual in the gem install output either I suppose?
[19:37:15] eric_lagergren: https://gist.githubusercontent.com/EricLagerg/1b69cac1907db58a6c40/raw/2b6bb8ce04fe3c9b946f01a6a1dc7c31c50d6847/gistfile1.txt
[19:37:19] eric_lagergren: nope, nothing unusual
[19:37:22] eric_lagergren: seems to install correctly
[19:39:18] eric_lagergren: is my $GEM_PATH incorrect..? $PATH:/home/eric/.gem/ruby/2.2.0/bin
[19:39:28] jhass: no that's fine
[19:39:30] jhass: same here
[19:39:49] jhass: it's really still at the exact same error?
[19:39:59] jhass: I also had to get nodejs for a execjs runtime
[19:41:35] jhass: okay, last thing to compare is the output of env I guess
[19:42:03] eric_lagergren: https://gist.github.com/EricLagerg/cdafa9554c02ff5835b1
[19:42:22] talntid: thanks guys. that helps :)
[19:42:30] jhass: ah, where's the GEM_PATH=/home/eric/.gem/ruby/2.2.0/bin coming from?
[19:42:33] jhass: try unexporting that
[19:43:06] jhass: oh, I'm sorry, I didn't look close enough when you said that earlier
[19:44:51] eric_lagergren: https://gist.github.com/EricLagerg/e429a0fc2f36a6e53aee
[19:45:08] eric_lagergren: I unexported GEM_PATH
[19:45:14] eric_lagergren: (and it's removed from my path)
[19:46:04] jhass: env no longer lists it, right?
[19:46:17] eric_lagergren: nope. echo $PATH doesn't list it
[19:46:56] jhass: PATH is not all that important here, though I don't see how it even find that jekyll command if that's really the case
[19:47:10] jhass: we care about GEM_PATH, which is actually bogus
[19:47:15] jhass: apeiros: \o/
[19:47:35] eric_lagergren: well, $GEM_PATH has nothing
[19:47:51] eric_lagergren: it's unexported, and I ran `source ~/.bashrc, hash -r`
[19:48:16] jhass: where does gem env get it from though?
[19:48:26] jhass: still lists the bogus one in GEM PATHS
[19:48:45] eric_lagergren: jhass: could you repeat your last ~4 comments after I said, "...ran it several times"
[19:48:56] eric_lagergren: jhass: I accidentally hit ctrl+l in irc :/
[19:49:29] jhass: eric_lagergren: let's try something else and patch it up manually: export GEM_PATH="/home/eric/.gem/ruby/2.2.0"
[19:49:53] jhass: that's the default value, so something is still overriding it if gem env reports anything else without ^ export
[19:50:41] eric_lagergren: jhass: okay, so after I unexported GEM_PATH I removed .gems, reinstalled ruby, reinstalled jekyll, and now GEM_PATH doesn't appear *anywhere* (including gem env) but now I get 'jekyll command not found'
[19:51:09] jhass: eric_lagergren: okay, readd /home/eric/.gem/ruby/2.2.0/bin to $PATH, but not $GEM_PATH
[19:52:22] eric_lagergren: jhass: adding it to path w/o gem_path worked
[19:52:26] eric_lagergren: jhass: thanks <3
[19:53:02] jhass: eric_lagergren: yeah, I guess that's where the confusion came from, me not noticing you did that and you doing that without telling :P
[19:53:14] apeiros__: jhass: mind a pm?
[19:53:18] jhass: apeiros__: nope
[19:53:50] jhass: eric_lagergren: to clarify: GEM_PATH overrides the lookup path for gems (libraries), it's like LD_LIBRARY_PATH or GOPATH, not like PATH
[19:54:45] eric_lagergren: s/gotcja\//gotcja
[19:54:54] eric_lagergren: welp. Apparently I can't type today.
[19:55:14] eric_lagergren: Anyway, thank you so much jhass. You saved me a huuuge headache.
[19:56:59] jhass: eric_lagergren: you're welcome
[19:59:48] elfuego: is there a way in ruby to get value from the cookies hash without the $Version= strings?
[20:00:12] centrx: What cookies hash?
[20:00:42] baweaver: http://api.rubyonrails.org/classes/ActionDispatch/Cookies.html probably
[20:00:59] elfuego: for sinatra
[20:01:09] colorados: eric_lagergren, why your 'GEM_PATH=/home/eric/.gem/ruby/2.2.0/bin contain 'bin'
[20:01:29] colorados: my GEM_PATH is ends with 'gems/ruby-2.2-head'
[20:01:43] colorados: my GEM_PATH ends with 'gems/ruby-2.2-head'
[20:02:08] ramfjord: Hey all, I have two classes: Account and Blah::Account. When I'm in module Blah, is there any way to reference the base Account?
[20:02:19] havenn: ramfjord: ::Account
[20:02:29] colorados: ah, understood, you use system ruby
[20:02:30] ramfjord: interesting - that is wht I'm trying
[20:02:35] ramfjord: error must be somewheere else
[20:04:23] jhass: colorados: yeah, I noticed that finally too and we resolved that, if you read entire backlog ;)
[20:04:28] ramfjord: ahh, just needed parens around it
[20:05:11] eric_lagergren: colorados: no diea.
[20:15:03] GaryOak_: could I use a block to apply the same error handling code to lots of different code?
[20:15:16] apeiros__: GaryOak_: yes
[20:15:18] GaryOak_: I don't want begin rescues all over the place
[20:15:33] baweaver: you do know begin is implied on methods right?
[20:15:44] apeiros__: GaryOak_: using a method might be the better choice
[20:16:25] baweaver: https://gist.github.com/baweaver/f3725bbeda7b4735c53f
[20:16:45] GaryOak_: baweaver: cool I didn't know about that
[20:17:01] baweaver: Now do I occasionally use tap and lambdas for rescue breakpoints? Yeah
[20:17:44] baweaver: nil.tap(&nilHandler(defaults_to: 5)).to_s
[20:17:54] baweaver: hacky? Yeah, probably
[20:18:42] jhass: GaryOak_: http://paste.mrzyx.de/pnwydxc6t another pattern you could do
[20:19:15] GaryOak_: jhass: that's what I had in mind
[20:19:53] baweaver: I still wish Ruby had this built in:
[20:20:04] jhass: ah, sounded more like rescue Foo => e; error_handler.call(e); end;
[20:20:23] baweaver: >> class Object; def pipe; yield self; end; end; nil.pipe { |v| v || 5 }
[20:20:23] eval-in_: baweaver => 5 (https://eval.in/302174)
[20:20:35] baweaver: like tap except returns the value of the block
[20:20:38] baweaver: nice for inlining things
[20:21:09] jhass: havenn: ^ did we just get a usecase for Object#itself w/ a block there?
[20:21:22] baweaver: https://github.com/baweaver/pipeable - gemified that
[20:21:22] havenn: jhass: \o/
[20:21:50] baweaver: jhass: I know it's an identity function, but expand on that?
[20:22:32] jhass: baweaver: https://bugs.ruby-lang.org/issues/10883
[20:23:29] baweaver: Like tap I'd agree the name would make it confusing
[20:23:44] baweaver: itself is an identity function and tap is a K-combinator
[20:24:13] baweaver: I'd agree with the last comment that that might not be straightforward
[20:24:57] sandelius: I just ported a small app from Rails to Sinatra/ActiveRecord. My Rspec test suite is really slow on sinatra. Is Rails, or rspec-rails, doing something special in rails to speed thing up?
[20:25:15] baweaver: probably spring
[20:25:21] baweaver: keeps the entire app going
[20:25:26] jhass: or transactional fixtures
[20:25:42] baweaver: well, if you're on Rails 4.x that is
[20:25:55] baweaver: jhass: what about object.yield?
[20:26:04] baweaver: straightforward with current language
[20:26:28] jhass: dunno, tbh I'm not entirely convinced we need either yet
[20:26:41] baweaver: it's more of a nicety thing
[20:26:51] baweaver: I just don't like intermediate variables in a good chain
[20:26:56] baweaver: but preference really.
[20:30:31] sandelius: baweaver it's not the load time that is slow (spring). I'm using database cleaner and transaction with sinatra
[20:30:58] jhass: maybe try database_rewinder instead
[20:31:12] jhass: database_cleaner can be slow sometimes
[20:31:20] jhass: it's a try out game really
[20:31:41] elfuego: for some weird reason $Version=0 keep showing up in my cookies e.g. 198174979$Version=0
[20:32:00] elfuego: is there a way to prevent this?
[20:32:37] jhass: ask whatever lib you're using to set the cookie
[20:33:39] elfuego: I set the cookie using sinatra on the server, but the client keeps appending $Version=0 to it
[20:34:27] Godd2: what an asshole!
[20:34:52] baweaver: godd2: ????
[20:35:11] Godd2: his client keeps appending $Version=0
[20:35:26] baweaver: ah, seemed oddly out of context
[20:39:40] sandelius: jhass hmm same thing with database_rewinder :/
[20:40:02] jhass: was worth a shot at least
[20:40:20] jhass: you need to start profiling to pin down where time is spent I guess
[20:41:40] sandelius: jhass yeah I'm using -p with rspec and has located the slowest test but the thing is that it's the same as in Rails. This is really weird. When I run siege on both apps the sinatra one kills rails :)
[20:42:31] jhass: sandelius: I meant real profiling, ruby-prof / rbkit stuff
[20:43:11] sandelius: jhass ahh hmm sounds like a fun night :)
[21:10:50] ramfjord: man, I would so love it if ActiveRecord could use the module a class is in to infer the schema of its table
[21:11:35] c-c: would/could?
[21:14:15] ramfjord: maybe I can make a separate inheritor of ActiveRecord::Base for each schema, and define self.table() "schema\." + super ; end
[21:15:13] undeadaedra: Er, it???s not already the case?
[21:16:43] undeadaedra: How did you create your model, ramfjord ?
[21:16:52] ramfjord: undeadaedra: It appears to be taking the first table with the given name in my search_path, ignoring the module
[21:17:08] ramfjord: module Blah ; end
[21:17:21] ramfjord: class Blah::Stat < ActiveRecord::Base ; end
[21:17:33] ramfjord: finds teh stats table in a non-"blah" schema
[21:17:45] undeadaedra: iirc, when you do `rails new model A::B`, it creates the appropriate files to have this behavior
[21:19:54] c-c: also something like #ror or #rubyonrails
[21:20:17] ramfjord: not using rails, but I just tried rails generate in another project and it didn't get the schema
[21:23:01] ramfjord: yeah, c-c I was looking for an activerecord group haha, but I should have tried that
[21:25:17] tona: hi everyone, one fast question into ruby could i create one application for my android phone ?,
[21:25:48] arrubin: tona: Yes.
[21:26:22] tona: ok do you have one example easy to create it like one demo , or how could i find it into google
[21:27:10] c-c: http://ruboto.org/
[21:29:21] tona: sorry for ask again , i am into ruboto, but i dont know how to start it , i need one guideline
[21:30:20] c-c: https://github.com/ruboto/ruboto/wiki/Tutorial:-write-a-gosu-game
[21:30:49] c-c: all this googling, so exhausted, sleep
[21:32:12] benlieb: I'm new to rspec and keep wanting to write: expect myvar.zero? as a shorthand for expect(myvar).to be_zero or expect(myvar.zero?).to be true
[21:32:15] GaryOak_: I was gonna use MacRuby to make a mac app, but apparently it's gone dead
[21:32:18] benlieb: Is there some shorthand for this?
[21:32:39] GaryOak_: benlieb: to eq(0)
[21:32:59] benlieb: GaryOak_: I'm talking about without the to...
[21:33:28] GaryOak_: the expect syntax is pretty short
[21:33:54] benlieb: in the same way that if (x) is short for if (x == true)
[21:34:30] benlieb: and I'm Expecting Brian, is short for I'm expecting Brian to come here...
[21:35:20] benlieb: I just feel like expect(brian) should work like this, but if it doesn't there's probably a good reason
[21:35:42] GaryOak_: I think the idea was to read like a sentence
[21:37:21] benlieb: GaryOak_: Fair enough, but I personally feel that expect(brian) is like a little sentence :)
[21:37:25] benlieb: like "expect delays"
[21:38:08] jhass: I find that incomplete
[21:38:19] jhass: expect brian, expect brian what?
[21:40:41] GaryOak_: I could see how it would be like expect something to be truthy
[21:41:31] benlieb: GaryOak_: right
[21:41:43] GaryOak_: but tests are supposed to be explanatory, and more explicit than your code
[21:42:56] GaryOak_: in minitest you can just do assert(value) and if value is true it will pass
[21:43:00] zenspider: GaryOak_: you might want to look at rubymotion
[21:43:10] zenspider: is truthy, not is true
[21:43:46] shevy: GaryOak_ you are on a mac?
[21:44:17] undeadaedra: rubymotion is a paid option
[21:44:42] zenspider: yup. I hear it isn't bad tho
[21:44:44] GaryOak_: that's weird that it's monthly
[21:45:04] undeadaedra: yes, I heard really good things about it
[21:45:16] zenspider: is it now? huh. well... helps fund the devs since he left apple
[21:45:55] zenspider: wow. and expanded to android now. interesting
[21:46:35] GaryOak_: they provide support for the api I guess for the monthly fee
[21:47:07] GaryOak_: and do support tickets
[21:47:53] zenspider: $15 / mo for no support tickets... seems reasonable to me
[21:48:04] zenspider: esp given how much work has gone into that thing
[21:48:52] GaryOak_: I wonder if they let you build against their codebase, and then just have some API key that you use to build it?
[21:49:04] GaryOak_: It being the app
[21:50:58] rpad: what would be the my rubyish way to make sure a file ends in either .jpg or .html?
[21:51:53] undeadaedra: .ends_with? ???.jpg??? || .ends_with? ???.html???
[21:52:30] undeadaedra: or =~ /\.(jpg|html)\z/
[21:52:33] zenspider: %w[.jpg .html].include? File.extname path
[21:53:06] ericwood: hmm is ends_with? new?
[21:53:24] ericwood: not seeing it in 2.1.5
[21:53:37] centrx: end_with?
[21:53:39] undeadaedra: it???s end_with?, actually
[21:53:43] jhass: ends_with? is Crystal :P
[21:53:50] centrx: Matz-style grammar
[21:53:55] undeadaedra: sorry for the confusion
[21:54:31] zenspider: yup. drives me nuts too
[21:54:44] zenspider: maybe it is something English.rb should fix :)
[21:57:48] shevy: undeadaedra is french
[21:58:46] GaryOak_: it's better than PHP std lib naming
[21:59:13] jhass: what isn't though
[21:59:49] GaryOak_: probably .NET
[21:59:57] GaryOak_: I don't know, I've never really used .NET
[22:01:57] undeadaedra: shevy: yeah, I think I know it now. What does it have to do with it?
[22:02:16] eam: GaryOak_: https://msdn.microsoft.com/en-us/library/k6ethaxs%28v=vs.90%29.aspx
[22:03:27] eam: I worked on an open source vb interpreter, that was my favorite function to implement
[22:03:28] shevy: undeadaedra that you may use any grammar notation
[22:04:02] undeadaedra: shevy: tbf, .end_with? disturbs me, thus my error above
[22:04:09] GaryOak_: eam: https://msdn.microsoft.com/en-us/library/6yah0s4h%28v=vs.90%29.aspx Are you even businessman?
[22:04:21] jhass: my favorite is http://docs.spring.io/spring/docs/2.5.x/api/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.html
[22:04:29] shevy: undeadaedra no the thing there is, that the question must be asked properly. It should be like so: "object, do you end_with? xyz"
[22:04:53] undeadaedra: ah, in this way it makes sense
[22:04:59] shevy: it's the same as you have with: File.exist? versus File.exists?
[22:05:17] shevy: matz added File.exists? after someone said that it should happen years ago, I forgot when
[22:05:25] eam: kinda surprised php doesn't have a standard builtin for a social networking app
[22:05:28] shevy: then I think two years ago or so, it was deprecated again
[22:05:36] undeadaedra: but it is good if we say ???if string.ends_with? %(foo)???, no ?
[22:06:13] shevy: undeadaedra dunno, I guess it depends on the point of view, you could just as easily compose text messages in pseudo-english sentence "if this string ends with a xyz, do that"
[22:06:27] shevy: well that might even be a real sentence
[22:07:18] undeadaedra: so yeah, when not really thinking about it, the ???ends with??? comes more naturally
[22:07:37] undeadaedra: but I didn???t think about turning it into a ???Does it??? question, actually, good one
[22:07:40] zenspider: the argument is that ruby is not english. it ends there.
[22:08:21] shevy: it.ends_there?
[22:08:24] shevy: it.end_there?
[22:08:47] shevy: undeadaedra is that a smiley from right to left?
[22:09:28] shevy: somehow my brain works only with smileys in this direction :D
[22:09:41] shevy: undeadaedra turn the D around
[22:09:56] shevy: I think I can see it now
[22:10:05] shevy: it's like pacman smiling
[22:10:14] zenspider: it's like pacman NOT smiling
[22:10:33] undeadaedra: reverse its mouth
[22:10:41] undeadaedra: turn his smile upside down
[22:11:02] shevy: yeah, like an upset smile
[22:11:49] GaryOak_: it's a tongue licking eyes
[22:12:21] shevy: GaryOak_ I saw something funny lately... I can't tell whether it is real. a moment
[22:12:24] GaryOak_: oh man bring out the unicode!
[22:12:48] undeadaedra: ?? and ?? are also valid iso
[22:12:57] shevy: http://shevegen.square7.ch/EMOJI_MUKERJEE_TYPEWRITER.jpg
[22:13:07] shevy: the name of the image was "mukerjee_typewriter"
[22:13:30] shevy: but it really looks as if someone put smileys onto an old typewriter
[22:13:39] GaryOak_: that would be fun to build
[22:13:54] shevy: I remember we had an old typewriter in the old office. I loved that thing... typing on it was so much more fun than typing on a keyboard
[22:14:10] shevy: the sound alone! click-click-clak
[22:14:15] GaryOak_: We had an old electric calculator with a printer on the top
[22:14:16] undeadaedra: oldest I gave is an Apple II
[22:14:41] shevy: undeadaedra it was funny if you typed on paper directly, if you mistyped, you could edit that with some kind of glue
[22:15:05] shevy: or you just painted white paint over it and let it dry before continuing
[22:15:12] shevy: on second thought, perhaps the typewriter wasn't that great...
[22:15:21] undeadaedra: http://en.wikipedia.org/wiki/Tipp-Ex ?
[22:15:36] shevy: hmm not that modern
[22:15:50] shevy: more like a tube which you could put down onto the paper
[22:16:06] undeadaedra: ???The first product was an innovative correction paper for use with typewriters.???
[22:16:11] undeadaedra: Seems on to me
[22:16:20] undeadaedra: But there may be other products
[22:17:04] shevy: undeadaedra look how cool they were: http://typewriters.byethost4.com/images/collection/tw-royalconvert-1.jpg
[22:17:23] shevy: one of the last ones we had was some electronic typewriter
[22:17:29] shevy: then I think the i386 emerged
[22:19:18] morenoh149: how would I override @object.to_json to detect fields in snake case and make them camelcase
[22:19:46] jhass: morenoh149: define as_json for that class
[22:19:47] ericwood: morenoh149: def to_json; json = super; # do that thing here
[22:20:05] jhass: no, I did not typo with as_
[22:20:09] centrx: morenoh149, override as_json, probably using alias_method_chain
[22:21:13] morenoh149: centrx:you're certain its as_json? I think the current one I'm using is this one http://devdocs.io/ruby/struct#method-i-to_json
[22:22:06] morenoh149: moreover. It's usage is in a rails template file index.html.erb. I'd declare my overload in an erb tag above it's first usage? or does it fit better elsewhere?
[22:23:49] jhass: to_json uses as_json to obtain a representation of your object from which the json should be generated
[22:23:59] jhass: so you return a hash, an array or whatever
[22:24:07] jhass: it's called template method pattern
[22:34:29] chridal: I have this hash hash = {a: 1, b: 2}, I would like to do this foo(hash), and then use it as hash[:a] inside the function.
[22:34:35] chridal: How can I do this?
[22:34:59] chridal: It only works if I do foo(a: 1, b:2), only then am I able to do hash[:a] inside the function
[22:35:00] jhass: def foo(hash); hash[:a]; end; foo(hash)
[22:35:23] chridal: jhass: That doesn't work for me at all. The hash is empty when I get in there.
[22:35:30] helpa: We cannot help you with your problem if you don't show us your code. Please put it on http://gist.github.com and give us the URL so we can see it.
[22:35:35] centrx: code or it didn't happen
[22:36:21] bradland: 1st rule of programming: Yes, it's probably you, not the computer :)
[22:37:45] chridal: jhass: https://gist.github.com/christiandalsvaag/2cfbf37c4da8ccf81d1f/edit
[22:38:01] chridal: Sorry, but Gist was bugged, so I couldn't turn on syntax highlighting.
[22:38:14] bradland: name your files with filename.rb instead of filename.txt
[22:38:56] chridal: I know those functions are humongous. I will refactor it when it works :-)
[22:39:27] bradland: so what are you expecting from the code, and what are you actually getting?
[22:39:59] chridal: Right now, as you can see on line 25, I am passing it directly into the function call. Then it works. But when I try to do Resque.enqueue(AddDeviceToken, new_request) it doesn't.
[22:40:32] chridal: Well, I am expecting to be able to use new_request[:arn] inside of the method that I am calling, when passing `new_request` as a param directly into the function call, not having to list them individually
[22:42:10] jhass: that should work, I think your problem is somewhere else
[22:42:15] bradland: what error are you getting?
[22:42:23] bradland: NoMethod error nil class?
[22:42:50] chridal: No, they're just blank.
[22:42:51] bradland: if you could comment with the error message and stack trace on the gist, that'd be great
[22:42:57] chridal: I tried printing them out inside the method I called, and got nothing.
[22:43:10] bradland: where did you print them?
[22:43:19] bradland: from withing SessionsController#create ?
[22:43:35] bradland: or from within AdDeviceToken::perform ?
[22:43:40] chridal: no, from within AddDeviceToken::perform
[22:43:44] jhass: there's a conceptual problem with this code though
[22:44:10] jhass: resque doesn't guarantee execution order
[22:44:13] jhass: your jobs will race
[22:44:20] chridal: jhass: I know, that's why I am calling it from within remove.
[22:44:31] chridal: Inside of RemoveToken, I actually call AddToken
[22:44:52] jhass: so you're showing us code you're not using
[22:45:01] chridal: No, I'm using that code too.
[22:45:15] chridal: The RemoveToken is not where the problem is at currently.
[22:45:17] willnewby: Hey Peeps, question: how do I run a command with both ruby-prof and bundler? https://gist.github.com/willnewby/59d7692942563a3313bc
[22:45:41] chridal: The problem is just that when I pass that hash, I doesn't work as I expect it to. I get errors from SNS saying that I am not passing the parameters.
[22:46:04] jhass: willnewby: try ruby-prof bundle -- exec ...
[22:46:09] chridal: If I pass it like this Resque.enqueue(AddDeviceToken, a: 1, b:2) etc, it works fine.
[22:46:34] jhass: willnewby: though I think you have to (temporarily) add ruby-prof to your bundle and swap them around
[22:46:39] chridal: The code as it is now works fine. But If I do Resque.enqueue(AddDeviceToken, new_request) (which is what I want to do) it doesn't work.
[22:46:46] bradland: chridal: inspect the value of new_request immediately before line 25
[22:46:57] chridal: bradland: Done. It's fine.
[22:47:03] willnewby: @jhass close but no cigar: https://gist.github.com/willnewby/59d7692942563a3313bc
[22:47:14] bradland: then inspect it again on line 6 of test.rb
[22:47:15] chridal: If I inspect it inside the AddDeviceToken::perform it's gone.
[22:47:31] jhass: willnewby: yeah, so the second suggestion :)
[22:47:32] chridal: bradland: Also done.
[22:47:43] bradland: what value do you get?
[22:47:47] chridal: I tried using binding.pry, but I couldn't get to it.
[22:48:00] willnewby: Oh! I missed that @jhass ??? testing???
[22:48:09] bradland: you tried binding.pry where?
[22:48:11] chridal: bradland: I can try check if it's nil. I just did `puts new_request[:arn]` basically
[22:48:15] bradland: test.rb:6 ?
[22:48:19] chridal: I tried to use it from within ::perform
[22:48:29] bradland: if you've got pry available, i'd drop a binding.pry on line 6
[22:48:33] bradland: and issue the command ls
[22:48:45] bradland: then new_token.inspect
[22:48:48] chridal: I never get to the pry console
[22:48:56] jhass: chridal: are you inlining jobs atm or do you go through redis?
[22:48:57] bradland: oh, this is in Resque, sorry
[22:49:04] chridal: jhass: Redis.
[22:49:07] chridal: bradland: Yes.
[22:49:28] jhass: chridal: pry-remote then
[22:49:33] bradland: i've never seen a vanilla hash disappear when passed as an argument
[22:50:20] chridal: jhass: Will give that a try.
[22:50:36] bradland: what does Resque::enqueue do to parameters? does it serialize them somehow? maybe the keys are no longer symbols.
[22:50:59] jhass: yeah, it to_json them I think
[22:51:14] jhass: but shouldn't make a diff where the literal is defined really
[22:51:16] bradland: i'd log new_token.inspect directly inside AdDeviceToken::perform to see what's in there
[22:51:37] jhass: I think this is racing somewhere and just misinterpretation
[22:53:49] chridal: Not sure how this is going to even work?
[22:54:06] chridal: Trying to use remote-pry, but it doesn't seem like this will work
[22:55:02] chridal: I put `binding.remote_pry` on line 6 of test.rb, then restarted the queue, and then issue `pry-remote` from pty, but I'm not getting to connect to anything.
[22:55:03] jhass: https://github.com/resque/resque/blob/a3845fe4a5bcac0e6107be6f0d494b72c958c3c0/lib/resque/job.rb#L51 -> https://github.com/resque/resque/blob/a3845fe4a5bcac0e6107be6f0d494b72c958c3c0/lib/resque.rb#L173 -> https://github.com/resque/resque/blob/8a8fd83f1f32755734f0068d9f211aeb2fda1f9e/lib/resque/json_coder.rb
[22:55:32] jhass: you id queue a job?
[22:55:50] jhass: ^ is prove for that it just to_jsons btw
[22:55:52] chridal: yes, did queue a job
[22:56:11] chridal: oh, it was just rediculously slow
[22:57:08] chridal: https://gist.github.com/christiandalsvaag/ad6f6de2318335b7ba20
[22:57:14] chridal: hm.. something is wrong here
[22:57:23] willnewby1: @jhass I'll admit, I'm mostly lost, I've added ruby-prof to my bundle and tried "ruby-prof bundle -- exec jekyll build --trace", "ruby-prof -- bundle exec jekyll build --trace" and a whole host of other options. I'm not sure what you mean by "swap them around".
[22:57:48] jhass: bundle exec ruby-prof jekyll build
[22:58:02] jhass: would be my guess
[22:58:42] bradland: willnewby1: bundle exec will always be first
[22:58:57] bradland: that sets up the bundler environment so only binaries and libs within your bundle will be available
[22:59:02] willnewby1: That makes sense!
[22:59:12] willnewby1: I had to run it as: bundle exec ruby-prof `which jekyll` build
[22:59:23] willnewby1: It needed the full path to jekyll??? but it works!
[22:59:32] willnewby1: Thanks @jhass + @bradland !
[22:59:55] chridal: bradland: Is there any way for me to do a new_request.inspect, without using pry? I tried adding it directly to line 6, but there is no output to STDOUT
[23:00:19] bradland: what are you using for logging?
[23:00:24] jhass: chridal: Rails.logger.info
[23:00:26] bradland: i'd write it to my log
[23:00:28] jhass: bradland: it's rails...
[23:02:56] chridal: This is so weird! When I do new_request.inspect, I get {a: 1, b:2, c:3} just like it is supposed to be. So why can't I access them?
[23:03:25] bradland: like jhass said, you've probably misidentified the problem
[23:03:48] bradland: try logging new_request[:a]
[23:05:00] chridal: When doing Rails.logger.info(new_request[:a]) I get nothing.
[23:05:29] bradland: Rails.logger.info(new_request[:a].inspect)
[23:05:50] jhass: + Rails.logger.info(new_request.inspect); Rails.logger.info(new_request.class)
[23:06:40] jhass: actually in your gist it's called new_token...
[23:06:50] jhass: new_request just in the controller
[23:07:09] chridal: I know. That's not the issue, I just typed wrong here, and continued not to confuse you.
[23:07:34] jhass: you should probably unify in your app too
[23:07:43] jhass: it's good to keep consistent names
[23:08:14] chridal: yea, I did that at first, but I felt like new_request didn't make any sense from within Add****, I will probably change it in the first one too
[23:08:51] chridal: new_request[:a].inspect = nil, class is Hash
[23:08:54] jhass: the new_ is contextual, that's okay to differentiate
[23:09:03] jhass: but either it's a token or a request
[23:09:25] chridal: Yes, that's true.
[23:09:29] jhass: .key.inspect ?
[23:09:50] chridal: is that new_request.key.inspect?
[23:10:03] jhass: er, keys.inspect, but yes
[23:11:04] chridal: ["arn", "device_id", "user_id"]
[23:11:13] jhass: there you go
[23:11:19] jhass: json turns it into strings
[23:11:21] chridal: is the problem that they are strings?
[23:11:29] chridal: *bangs forehead*
[23:11:41] jhass: though I have no idea how this ever worked in either version
[23:12:00] chridal: The obscure part was how it works if I just pass it directly in.
[23:12:07] chridal: Oh! Because then there's no .to_json
[23:12:08] jhass: yes, I think it didn't
[23:12:08] bradland: man, i said this like 20 minutes ago! lol
[23:12:15] jhass: of course there is
[23:12:26] chridal: how could it work then?
[23:12:28] jhass: see my links to the resque source earlier
[23:12:33] bradland: indifferent access?
[23:12:34] jhass: I think it didn't
[23:12:42] jhass: nah, it's both literals
[23:12:44] chridal: It does! I'll test it again.
[23:12:50] chridal: to make sure
[23:14:51] chridal: If I pass them like this foo(a: 1, b:2 c:3) they all arrive, and I can do new_request[:a]
[23:15:00] bradland: so the hash keys are accessible as a symbols when you pass a literal directly
[23:15:09] bradland: but not if you assign a hash literal to a variable, and pass the variable in
[23:15:10] chridal: if I pass foo(bar) where bar = {a:1, b:2, c:3} they get turned into strings.
[23:15:13] jhass: that's stupid
[23:15:27] bradland: in your method arguments, you're using an implicit hash though, right?
[23:15:31] chridal: My god. The time I've spent.
[23:15:34] bradland: no curly braces?
[23:15:41] chridal: bradland: Correct.
[23:15:43] bradland: is it possible that has something to do with it?
[23:15:58] chridal: Which is why I think it's not calling .to_json on it
[23:15:59] bradland: try wrapping it with curly braces in the method argument list
[23:16:12] chridal: bradland: Then it will call .to_json, and they will get stringified. Will check.
[23:16:33] bradland: wonder why new_request.inspect was showing symbol keys
[23:16:43] bradland: man, friggin' rails sometimes....
[23:17:07] chridal: Yes, if I pass them inside {} they get stringified.
[23:17:22] bradland: so it has something to do with the implicit hash argument
[23:17:41] bradland: someone smarter than me could probalby tell you why
[23:18:13] chridal: might it be that if you pass it one object, it will call .to_json on it, but there isn't an equivalent function if you pass an implicit hash?
[23:18:25] bradland: i will say this though, a good debugger (pry, byebug, etc) makes this kind of thing a *lot* easier to debug
[23:18:26] jhass: >> require "json"; def test(*args); JSON.load JSON.dump(args); end; hash = {a: 1, b: 2}; test(hash)
[23:18:26] eval-in_: jhass => [{"a"=>1, "b"=>2}] (https://eval.in/302216)
[23:18:35] jhass: >> require "json"; def test(*args); JSON.load JSON.dump(args); end; test(a: 1, b: 2)
[23:18:35] eval-in_: jhass => [{"a"=>1, "b"=>2}] (https://eval.in/302217)
[23:18:42] jhass: you changed something else
[23:18:47] chridal: bradland: Yes, I have both pry and byebug, but weren't able to get a 'hold' of it.
[23:19:27] chridal: jhass: I didn't change anything else.
[23:19:42] jhass: I just proved that what claim is untrue
[23:19:52] chridal: Resque.enqueue(AddDeviceToken, arn: arn, device_id: session.device_id, user_id: user.id )
[23:19:58] chridal: That call works fine.
[23:20:07] chridal: Resque.enqueue(AddDeviceToken, { arn: arn, device_id: session.device_id, user_id: user.id })
[23:20:09] chridal: that one does not.
[23:20:47] bradland: is there a difference in the output of Rails.logger.info(new_token.keys.inspect) between those two?
[23:20:55] chridal: I can only guess that either Resque or Rails does something to them.
[23:21:23] bradland: jhass: posted a method trace. it's just serializing them with JSON.dump/load
[23:23:05] chridal: new_token.keys.inspect is the same in both
[23:24:27] bradland: you see why it would be so hard to believe that they're accessible as symbols when keys.inspect says they're strings in both cases, right?
[23:24:37] jhass: the code is likely just racing and the hash alloc makes the diff
[23:24:58] jhass: have fun in prod
[23:26:00] chridal: Yes, I see how this is obscure.
[23:26:16] chridal: jhass: What should I be doing about this?
[23:26:50] jhass: dunno, if I'm really honest I'm not motivated to dig into
[23:27:02] jhass: the obvious race I pointed out you said you're aware
[23:27:38] chridal: that one I know about. I was thinking about this weird stuff with the hash
[23:27:51] chridal: I should be safe using strings tho?
[23:27:53] jhass: but things like you posting "I get {a: 1, b:2, c:3} just like it is supposed to be" while it's string keys, makes it hard to believe your assertions
[23:28:07] bradland: chridal: http://logicalfriday.com/2012/08/21/rails-callbacks-workers-and-the-race-you-never-expected-to-lose/
[23:28:21] bradland: chridal: http://www.bignerdranch.com/blog/never-use-resque-for-serial-jobs/
[23:28:32] bradland: both of these look to like they contain some good reading on the challenge you're facing
[23:28:46] chridal: jhass: I have been programming for the last 14 hours now.. That's why I made a mistake there.
[23:28:58] jhass: then get some sleep
[23:29:01] chridal: bradland: Thanks! I will make sure to read both of them after I get some sleep.
[23:29:13] bradland: i know that feels bro
[23:29:13] chridal: Yea. I just really HAD to solve this issue. It's been nagging me.
[23:29:35] bradland: went for 37 hours straight once on our first ASP.NET project with a good friend
[23:29:45] bradland: ... the mistakes we make when we're young!
[23:29:52] chridal: Wow! That's crazy.
[23:29:55] bradland: (referring to using ASP.NET, not going 37 hours lol)
[23:29:59] jhass: like starting with ASP.NET? :P
[23:30:06] chridal: I just participated in a hackathon (24 hours), it was crazy.
[23:30:14] bradland: ACTION fistbump jhass
[23:30:17] chridal: At least we won. I was smashed. I can't even imagine doing 37 hours.
[23:30:21] chridal: It would be impossible.
[23:30:31] bradland: code quality suffered
[23:30:41] chridal: You must have some serious code muscle :-D
[23:30:43] bradland: that was back in 2001 or so
[23:30:47] bradland: i was just young
[23:31:01] jhass: well, I'm not better
[23:31:05] jhass: PHP is my first lang
[23:31:21] bradland: were were an ASP (classic) shop
[23:31:31] bradland: when ASP.NET hit (along with webforms), we did 1 project
[23:31:40] bradland: i looked at PHP, but rails had just hit 0.7, and was usable
[23:31:53] chridal: PHP is mine as well.
[23:31:55] bradland: we've been rails ever since
[23:32:04] bradland: although i don't do much rails coding these days
[23:32:34] bradland: the guy i started with in 2001 is still with me though; he's one of my co-founders
[23:32:41] bradland: not a lot of guys that have been doing rails since 0.7
[23:32:45] alphaatom: would you guys consider the codecademy stuff a good starting place for learning ruby, I already have rudimentary knowledge of other programming languages like java, javascript, php etc
[23:32:56] chridal: I still remember trying to use Rails back when I was about 15 (2005). I only knew how to write PHP, and hardly any OOP. Hashes and blocks confused me a lot.
[23:33:07] bradland: AlphaAtom: i've been through a good bit of codeacademy. it's pretty decent.
[23:33:19] bradland: it'd be a good intro
[23:33:50] bradland: coming from ASP, Rails was a real dream
[23:34:07] chridal: I used classes in PHP just to be able to separate my functions into classes so that it would be cleaner. Had no idea what an object was.
[23:34:13] bradland: we used to use the IIS 404 ISAPI as a router lol
[23:34:15] chridal: Is ASP.net still bad?
[23:34:26] bradland: no, it's way, way better
[23:34:36] jhass: chridal: you don't read tdwtf I gather :P
[23:34:54] bradland: when ASP.net first hit, MS tried to do something called WebForms, which everyone (including ASP.net devs) would prefer to forget.
[23:35:03] chridal: jhass: No. What's that? :)
[23:35:14] jhass: http://thedailywtf.com
[23:35:48] chridal: Will leave it open in a tab for tomorrow.
[23:35:55] chridal: Need to crash. I've got code to write in the morning!
[23:36:01] chridal: Thanks for helping out. See you guys. Good night,
[23:38:09] chridal: jhass: Was there any reference in specific oyu were thinking of?
[23:39:32] jhass: nope, just put it into the feed reader
[23:39:41] jhass: it's 90% VB
[23:40:10] chridal: haha. Well, it might be fun.
[23:44:02] chridal: Doesn't seem like the code is racing, from what I can tell.
[23:44:17] jhass: go to bed
[23:44:21] bradland: that's the thing about race conditions
[23:44:25] jhass: tomorrow is another day
[23:44:38] chridal: https://gist.github.com/christiandalsvaag/b1a6e9519dfe8c26311b
[23:44:41] bradland: i 2nd the suggestion to get some sleep
[23:44:59] chridal: I am actually in bed now. I just need to test this for a bit :-P
[23:45:12] jhass: wish I had ops
[23:45:16] jhass: I'd totally kick you now
[23:45:31] chridal: Why should I be kicked tho?
[23:45:38] jhass: so you get some sleep
[23:45:48] chridal: I will sleep now. But should that code race?
[23:46:00] jhass: no, other parts might
[23:46:10] chridal: Now I can sleep.
[23:47:10] alphaatom: as someone new to ruby
[23:47:15] alphaatom: why on earth does unless exist
[23:47:35] chridal: Because it's beautiful.
[23:48:00] jhass: because don't do if is easier to think than if this, I mean not_this
[23:48:33] jhass: give it a chance
[23:48:47] jhass: it'll click after a while
[23:50:46] Godd2: user.log_in unless user.logged_in?
[23:51:57] alphaatom: I suppose, but it just seems to be sugar for if !condition
[23:52:25] jhass: well, on the implementation detail ! is a method call wall unless isn't
[23:52:35] jhass: but that shouldn't be the point
[23:53:15] jhass: in if !condition you evaluate (in your brain when reading the code) condition, then negate the result and use that to say if x
[23:53:25] jhass: unless skips that step
[23:53:51] jhass: "wall" lol, I should get some sleep too
[23:54:00] jhass: "while" I meant
[23:56:45] Godd2: AlphaAtom there are plenty of things that are "just sugar"
[23:57:09] Godd2: remember, the computer doesn't care that we're using Ruby to program ;)
[23:57:16] jhass: ruby has surprisingly few actual keywords
[23:58:00] alphaatom: yeah, I'm not hating or anything, just trying to make sure I understand the language fully, plus its the first language i've ever seen use something like that
[23:58:21] jhass: class, module, if, unless, while, until, yield, return, break, next, retry, rescue, def, end, do, alias, catch, throw, raise is about it I think
[23:58:40] livinded: Can someone point in the the direction of a good example for subclassing Ruby's thread class?