Activity Graph

Page 1 of 42 | Next »


[06:49:14] ljarvis: has joined #ruby
[16:38:59] ljarvis: Quit: WeeChat 2.4


[09:34:36] ljarvis: has joined #ruby
[09:53:45] ljarvis: Quit: WeeChat 2.4


[13:20:44] ljarvis: Read error: Connection reset by peer


[20:55:39] ljarvis: has joined #ruby
[20:55:41] ljarvis: has joined #elixir-lang


[18:46:40] ljarvis: Ping timeout: 272 seconds


[06:48:59] ljarvis: Ping timeout: 248 seconds
[12:36:55] ljarvis: has joined #ruby


[10:12:28] ljarvis: Quit: WeeChat 2.4
[16:04:03] ljarvis: has joined #ruby
[20:58:07] ljarvis: Ping timeout: 246 seconds


[08:21:58] ljarvis: has joined #ruby


[14:17:44] ljarvis: Quit: WeeChat 2.4


[13:45:43] ljarvis: Ping timeout: 258 seconds


[15:18:29] ljarvis: has joined #ruby


[08:00:07] ljarvis: Ping timeout: 246 seconds


[14:45:48] ljarvis: has joined #ruby


[11:19:30] ljarvis: Ping timeout: 255 seconds


[16:49:48] ljarvis: *.net *.split


[01:42:10] ljarvis: Ping timeout: 246 seconds
[01:52:08] ljarvis: has joined #ruby
[11:40:12] ljarvis: Ping timeout: 246 seconds
[11:58:12] ljarvis: has joined #ruby


[08:52:19] ljarvis: Quit: WeeChat 2.4
[16:12:26] ljarvis: has joined #ruby
[16:12:27] ljarvis: has joined #elixir-lang
[16:12:35] ljarvis: Client Quit
[16:12:49] ljarvis: has joined #ruby


[15:42:55] ljarvis: has joined #elixir-lang


[14:40:42] ljarvis: Ping timeout: 246 seconds




[16:28:47] ljarvis: Ping timeout: 245 seconds


[10:16:53] ljarvis: Tuor: just use "path = params[:path] || DEFAULT_CONFIG_FILE_PATH; if path.to_s.empty? # error code; else # normal flow end"
[10:18:18] ljarvis: Bish: what do you mean "check existence of a thing"?
[10:19:26] ljarvis: do you have code?
[10:19:58] ljarvis: ok, I don't really understand the question
[10:23:25] ljarvis: what do you mean check for equality? none of your code is doing that
[10:27:40] ljarvis: &>> h = {}; class Test; def eql?(_); true; end; def hash; 1; end; end; h[Test.new] = 1; h[Test.new] = 1; h.size
[10:27:50] ljarvis: you want #eql? and #hash
[10:28:25] ljarvis: you're not..
[10:28:30] ljarvis: Test.new == Test.new will be false
[10:28:41] ljarvis: &>> h = {}; class Test; def eql?(_); true; end; def hash; 1; end; end; h[Test.new] = 1; h[Test.new] = 1; [h.size, Test.new == Test.new]
[10:29:06] ljarvis: eql? is for hashing
[10:30:13] ljarvis: well eql? is the same as == for a lot of classes, because that makes sense for hashing
[10:31:13] ljarvis: Tuor: either use exceptions and rescue, or simplify with multiple methods
[10:31:27] ljarvis: Bish: ok i dont think i can help
[10:32:18] ljarvis: that sounds like a bad idea
[10:32:47] ljarvis: because [open arms to demonstrate current situation]
[10:33:15] ljarvis: you need to be careful overriding standard operators like that
[10:35:38] ljarvis: my point is that === is a standard operator, and you have to be careful when overriding them. Why do you want == and === to return differently? surely if the DB id refers to the same value then so with the contents?
[10:37:30] ljarvis: ok well i hope someone else can help you
[12:20:01] ljarvis: depends which plan, 30mbps here
[12:31:49] ljarvis: al2o3-cr: no I don't think so


[13:47:16] ljarvis: Ping timeout: 246 seconds
[13:53:47] ljarvis: Ping timeout: 240 seconds
[17:55:21] ljarvis: jack479: [a-z0-9][a-z0-9-][a-z0-9] ? :)
[17:56:07] ljarvis: add a + after the second char class
[18:10:47] ljarvis: A-z isn't really unusual
[18:11:07] ljarvis: well, i guess it is unusual, just not really something i'd expect to fail
[18:11:31] ljarvis: i was thinking you meant a-9 or something, which would raise an error (i think)


[08:46:16] ljarvis: use double quotes everywhere
[09:13:55] ljarvis: use double quotes everywhere and don't worry about it
[12:40:45] ljarvis: https://ruby-doc.org/stdlib-2.3.3/libdoc/resolv/rdoc/Resolv/ResolvError.html "Indicates a failure to resolve a name or address."
[12:52:54] ljarvis: adac: who knows? there's a *lot* of reasons an address might not resolve
[12:53:20] ljarvis: most of which are indistinguishable
[12:53:33] ljarvis: does the URL resolve in your browser?
[12:53:55] ljarvis: (assuming it's something you can view in a browser)
[21:26:40] ljarvis: al2o3-cr: wat
[21:26:58] ljarvis: oh, the pizza thing?
[21:27:29] ljarvis: havenwood being all fancy
[21:33:15] ljarvis: ACTION vomits 
[21:34:36] ljarvis: that's an oxymoron


[14:24:32] ljarvis: has joined #elixir-lang
[14:25:12] ljarvis: Client Quit
[14:26:45] ljarvis: has joined #ruby
[15:12:25] ljarvis: &>> {:blah=>"blah", :foobar=>{:lalala=>"lalala", :lipsum=>"lipsum"}}.map { |k, v| v.is_a?(Hash) ? v.map { |vk, vv| ["#{k}_#{vk}", vv] } : [[k, v]] }.flatten(1).to_h
[15:14:33] ljarvis: it's lazy tbh, I hope it's not production code ;)
[15:15:24] ljarvis: yeah, reduce doesn't work for me because you're not really reducing, and each_with_object is nice except that you *always* want to append to this new enumerable object you've created, so it seems superfluous to me
[15:17:38] ljarvis: ACTION runs
[15:20:20] ljarvis: there's always someone.. (agree though)
[15:21:18] ljarvis: you can remove the is_a?(Hash) too if you're creative
[15:21:22] ljarvis: but I think we've done enough damage
[15:22:17] ljarvis: "Ruby flap_map"
[15:24:41] ljarvis: it creates less objects so it's better for large data
[15:35:58] ljarvis: mustmodify: "\u200B"
[15:41:45] ljarvis: folks, please consider joining #ruby-offtopic for non-Ruby discussion to avoid discouraging new joiners from asking questions
[15:42:19] ljarvis: no worries, do continue your nice conversation though :)
[15:43:01] ljarvis: -o ljarvis


[19:39:12] ljarvis: *.net *.split


[00:07:06] ljarvis: *.net *.split
[00:15:50] ljarvis: has joined #ruby


[13:43:51] ljarvis: Bish: do you have an example?
[13:43:55] ljarvis: it sounds awfully confusing
[13:46:49] ljarvis: does it work?



[02:07:40] ljarvis: Ping timeout: 256 seconds
[02:08:33] ljarvis: has joined #ruby
[02:46:50] ljarvis: *.net *.split
[02:47:51] ljarvis: has joined #ruby


[12:25:50] ljarvis: *.net *.split
[12:27:28] ljarvis: has joined #ruby
[15:01:21] ljarvis: *.net *.split
[15:03:12] ljarvis: has joined #ruby


[22:14:40] ljarvis: has joined #ruby


[13:59:48] ljarvis: Remote host closed the connection


[07:26:47] ljarvis: has joined #ruby


[11:27:21] ljarvis: *.net *.split


[11:15:54] ljarvis: i dun golfed some ruby https://twitter.com/lee_jarvis/status/944157086904127488 can anyone find any other wins?
[11:18:37] ljarvis: yeah i scrubbed my history so will need to rebuild it oops
[11:24:44] ljarvis: here's an annotated version though :D https://gist.github.com/leejarvis/0d3f029754f0cf7cb9b54fb8942a62d5



[21:55:07] ljarvis: i want an imac pro
[21:56:26] ljarvis: the new $5k machines apple just released
[21:56:49] ljarvis: oh totally, i could never justify that thing
[21:56:59] ljarvis: 5k is the base price, too..
[21:57:16] ljarvis: i heard apple only can do upgrades, but yeah
[21:57:38] ljarvis: apeiros: you have a mac pro atm?
[21:57:50] ljarvis: apeiros: i've heard that's not true (final config)
[21:58:15] ljarvis: apeiros: you can send it back to apple to upgrade *some* parts, but meh..
[21:58:40] ljarvis: i <3 my macbook pro
[21:58:56] ljarvis: i have a 2014
[21:58:58] ljarvis: it's awesome
[21:59:05] ljarvis: i dont want one of the new ones
[22:00:05] ljarvis: im surprisingly attached to the magsafe port
[22:00:11] ljarvis: it's the little things
[22:00:43] ljarvis: nice. How's that monitor? have been considering it for a while (although wont work with this machine)
[22:01:19] ljarvis: yeah that's a nice bonus
[22:01:54] ljarvis: that's bad :/
[22:02:05] ljarvis: al2o3-cr: nope
[22:02:32] ljarvis: i use linux enough in my servers, where it's meant to be used :D
[22:03:57] ljarvis: fwiw im an ex-linux user who stage-3'd gentoo for ~5 years, i loved it but don't regret moving to macs
[22:04:44] ljarvis: i just don't want to hack around with my local machine anymore, i want to open it and everything work, which is what macos (generally) gives me
[22:06:32] ljarvis: well because ios
[22:07:26] ljarvis: not having a tv = winning
[22:08:05] ljarvis: leitz: nice :)
[22:08:51] ljarvis: i have a tv but no cable, and i seldom use it
[22:15:02] ljarvis: so today was the first day i couldn't fit an adventofcode challenge into my lunch break :(
[22:17:48] ljarvis: er yes, wow where did that day go
[22:18:13] ljarvis: the description alone took most of my time to get my head around :/
[22:20:18] ljarvis: they've been fairly easy up to yesterday i found :)
[22:20:55] ljarvis: well, easy enough to fit into ~40 minutes lunch (+ actual lunch)
[22:21:11] ljarvis: didn't do last years, but going through 2015 and prob last years at some point too, just for fun
[22:23:35] ljarvis: yeah i had planned on just going whilst i could fit them into lunch breaks
[22:23:45] ljarvis: no more :)


[20:14:12] ljarvis: yes, your indenting is just bad
[20:14:44] ljarvis: clean that up and then re-paste it :-)
[20:16:33] ljarvis: RougeT430: once you've repasted, take a look at this method and see if you can tell what's wrong: https://gist.github.com/CodePint/a6f33d989176fa96940b1d23e293c9be#file-rand01-rb-L24-L28
[20:16:43] ljarvis: same with `ask_sides`
[20:21:44] ljarvis: that looks the same
[20:23:09] ljarvis: https://gist.github.com/anonymous/675c5efb2124503ba722c61f3e7a26d7
[20:23:15] ljarvis: no dont make the vars start with @
[20:24:33] ljarvis: RougeT430: i just fixed the indenting is all
[20:24:41] ljarvis: no other changes yet
[20:25:17] ljarvis: you might have to reformat it in sublime, it might just be making it look nice without making changes on disk
[20:25:40] ljarvis: anyway, indenting problems aside, take at look at the `ask_rolls` method. What's it meant to do?
[20:27:10] ljarvis: RougeT430: "return the value to the function" -- explain that to me a bit. Is `ask_rolls` method to return the value?
[20:29:32] ljarvis: is that what you want?
[20:29:53] ljarvis: right, you want to return it from the method, right?
[20:30:15] ljarvis: yep, or the `nil` on the next line, since that means the method will return nil
[20:30:41] ljarvis: well exactly
[20:30:53] ljarvis: so you remove it
[20:30:58] ljarvis: now do the same with `ask_sides` which has the same issue, and run your code
[20:34:08] ljarvis: no rush, shout if you need help
[20:40:33] ljarvis: yep, hint: you call them in both ask_loop AND roll_dice
[20:40:54] ljarvis: I would recommend asking for them both in ask_loop and then pass them into the roll_dice method as arguments
[20:44:21] ljarvis: RougeT430: you have to call the method to get the result ;)
[20:45:26] ljarvis: well also method you only want 1 result, so you need to store it in a variable. Definitely makes sense
[20:45:39] ljarvis: s/method/because/
[20:45:45] ljarvis: words are hard today


[21:00:18] ljarvis: Ober: sure
[21:02:09] ljarvis: hai, i've been super busy at work
[21:03:43] ljarvis: still at loco2.com
[21:04:58] ljarvis: hah, indeed
[21:05:15] ljarvis: thats when you stahp
[21:05:34] ljarvis: anyone else doing adventofcode this year?
[21:11:54] ljarvis: which locations?
[21:44:09] ljarvis: why did i click that link


[02:28:28] ljarvis: has joined #ruby-offtopic


[10:49:57] ljarvis: exploding hashes are the worst


[07:27:21] ljarvis: NotImplementedError seems perfect for this if it's something derived classes are meant to implement
[07:28:39] ljarvis: well now if that's how we thought about ruby code all of our code would be awful
[07:29:05] ljarvis: so they used a too generic exception for their use-case
[07:39:37] ljarvis: Right, I agree it's not optimal, but also Ruby does not have good tools for defining these sort of interfaces. Having nothing and raising NoMethodError is definitely not enough
[07:41:25] ljarvis: that's not a bad shout


[13:14:41] ljarvis: MarkBilk_: I don't really understand your question. t and s will be the same value, so why would you do t = "#{s}" ?
[13:15:22] ljarvis: looks like it
[13:15:38] ljarvis: t = s.dup # MarkBilk_, now you can change them independantly


[16:13:23] ljarvis: ule: TRUE_VALUES = Set.new %w(true yes 1 t); TRUE_VALUES.include?(value.to_s) -- same with false
[16:15:20] ljarvis: ule: if you're using rails, just use `ActiveRecord::Type::Boolean.new.cast(value)`
[16:18:26] ljarvis: ule: what rails version?
[16:18:45] ljarvis: ule: maybe try `ActiveRecord::ConnectionAdapters::Column.value_to_boolean(value)`
[16:18:50] ljarvis: and then upgrade your rails version
[16:23:16] ljarvis: ule: dont do that
[16:23:34] ljarvis: if you dont want to use rails stuff, use my first solution
[16:23:40] ljarvis: e.g. TRUE_VALUES = Set.new %w(true yes 1 t); TRUE_VALUES.include?(value.to_s)
[16:23:55] ljarvis: and then opposite for false
[16:23:58] ljarvis: everything else = nil


[08:56:52] ljarvis: slima: (Q1 & Q2).any? # where Q2 is foo or bar or foo1 etc
[08:59:30] ljarvis: who knows, when there's little info one has to make assumptions
[09:18:18] ljarvis: you can do as dminuoso suggested
[09:18:29] ljarvis: preds.any? { |e| Q1.include?(e) }


[08:43:18] ljarvis: does anyone here use postgresql on rds?


[08:39:18] ljarvis: kapil___: what do you think?
[08:41:47] ljarvis: you're correct


[10:19:06] ljarvis: not AR? what?
[10:19:56] ljarvis: it's perfectly supported
[10:20:50] ljarvis: but .limit(0) in AR is *not* equivalent to setting no limit
[12:11:59] ljarvis: dont use try if you can use &. -- they also do very different things