DouweM

Activity Graph

Page 1 of 33 | Next »

2014-07-02

[16:56:44] DouweM: yes you are!
[16:58:43] DouweM: there's a bunch of pros, a lot of intermediates and a lot of newbies, so you'll fit in just right :P
[17:00:00] DouweM: ++ doesn't exist in Ruby, use += 1
[17:46:00] DouweM: Pulpie: feature bloat?
[17:46:39] DouweM: okay so I didn't follow this whole discusstion but you're saying ++ is a core feature of OOP?
[17:46:50] DouweM: because that's preposterous
[17:47:48] DouweM: Pulpie: say what, written in C++?
[17:48:41] DouweM: Pulpie: MRI is implemented in C
[17:48:51] DouweM: which still has nothing to do with Ruby being or not being a clone of C
[17:50:05] DouweM: "influenced by" is far from a clone. still no reason to include the 1-char optimization ++
[17:50:40] DouweM: this is such a bikeshedding issue
[17:50:54] DouweM: eam how so?
[17:51:20] DouweM: ah right, I'e read that actually
[17:52:06] DouweM: I thought eam was saying you shouldn't even use i++ as an operation on its own
[17:52:13] DouweM: it can definitely get confusing when inline with other stuff
[17:54:08] DouweM: Pulpie: like i++ ;)
[17:55:05] DouweM: Pulpie: it means more than that. https://en.wiktionary.org/wiki/bikeshedding
[18:05:49] DouweM: why would you need a heredoc here?
[18:06:26] DouweM: jottr: that's just how irb prints it
[18:06:41] DouweM: jottr: or rather, what String#inspect returns
[18:07:21] DouweM: jottr: that's not strange
[18:08:58] DouweM: yeah, using a fixture file is better
[18:13:08] DouweM: Pulpie: that's just variable scope
[18:14:41] DouweM: jottr: for sure! RSpec has nothing to do with Rails per se
[18:14:50] DouweM: Pulpie: what are you having trouble with? variables defined in if being aailable outside them?
[18:15:43] DouweM: Pulpie: but you would think it made sense for a variable to be set to nil before, to be available inside the if and overwritable inside the if?
[18:16:21] DouweM: Pulpie: I mean, you need that to do conditional variable assigment. So why would there be a difference between those?
[18:16:25] DouweM: Pulpie: variables refer to objects
[18:19:57] DouweM: because accoring to the syntax tree, it's assigned to
[18:20:54] DouweM: Pulpie: all assignment is the same to the parser, it doesn't evaluate the conditional
[18:21:43] DouweM: Pulpie: it does during evaluation, obviously
[18:22:31] DouweM: why would it need to parse twice?
[18:22:58] DouweM: and how would you implement this in practice? you'd specialcase a pointless literal `false`, but what would you do for anything else that could be the condition?
[18:23:10] DouweM: during parsing it keeps track of variables that may be assigned
[18:25:15] DouweM: the separate step of specifying the type and assigning null which you need in, say, C before an if-statement wouldn't make sense in Ruby, so this is the only logical way you can have assignment inside if/else and use the variable outside
[18:37:04] DouweM: pas mal, et toi?
[18:42:32] DouweM: nope, good evening agent_white
[18:43:19] DouweM: that works :)
[18:44:36] DouweM: jhass: lol
[18:44:43] DouweM: jhass: that's a pretty good idea

2014-06-24

[01:07:20] DouweM: et09: how would that work?
[01:07:43] DouweM: MIME type is a property of the file, not of the URL per se
[01:08:04] DouweM: extension may hint at it, but the URL doesn't necessarily have an extension and the extension isn't necessarily correct
[01:11:46] DouweM: hmm, you could do a HEAD request and hope the server properly implements it. It'd still be downloading, but you won't need the entire file
[01:11:57] DouweM: (I thought you meant no downloading at all, just parsing the URL somehow)
[01:17:18] DouweM: cheaper for the server no, cheaper for the connection and the client yes

2014-06-23

[11:54:17] DouweM: I'd go with HTTParty

2014-06-22

[23:36:10] DouweM: n_blownapart: == and != are methods implemented to check value equality, not identity equality
[23:36:43] DouweM: != and == evalutating to the opposite makes sense, right
[23:37:20] DouweM: n_blownapart: just like ==
[23:37:30] DouweM: n_blownapart: why would the one use identity and the other value?

2014-06-16

[09:35:05] DouweM: Nilium: how would you have that work?
[09:35:09] DouweM: jhass: yeah exactly
[09:35:40] DouweM: Nilium: swallowing is asking for trouble
[09:43:33] DouweM: Hanmac: I'm out of the loop, what changed in 2.0 to make that valid? why wasn't it before?
[09:44:34] DouweM: ah, what changed is the :: resolution
[09:44:35] DouweM: yeah, sure
[09:44:40] DouweM: wasn't aware that didn't work before. nice

2014-06-15

[12:04:23] DouweM: that's heredoc string notation
[12:04:30] DouweM: http://blog.jayfields.com/2006/12/ruby-multiline-strings-here-doc-or.html
[12:05:23] DouweM: Noob101: check that blogpost, it describes it. it's a way to make multiline strings
[12:09:16] DouweM: Noob101: multiline strings
[12:11:17] DouweM: Noob101: not needing to escape quotes or the string delimiter I guess? A lot of languages have heredoc syntax, I guess whether to include it in Ruby was mostly by default
[12:11:32] DouweM: Noob101: not a conscious decision. but as I say, it's useful because you don't need to escape.
[12:14:13] DouweM: Noob101: that's the name for that EOS notation (EOS can be anything, btw). see https://en.wikipedia.org/wiki/Here_document
[12:33:38] DouweM: Noob101: chances are it's the program you're running irb from
[12:33:58] DouweM: like, the terminal emulator. black background, white text, command prompt and stuff?
[12:34:08] DouweM: that's run.exe
[12:34:45] DouweM: apeiros: I doubt that'll work
[12:34:53] DouweM: apeiros: but what do I know, don't use windows either
[12:35:17] DouweM: apeiros: nice, I had no idea
[12:35:48] DouweM: apeiros: ah, right...
[12:36:05] DouweM: Noob101: tried puts `cls` ?
[12:36:29] DouweM: apeiros: right
[12:37:15] DouweM: Noob101: your name is extremely apt, by the way :P
[12:37:31] DouweM: mordof1: that's definitely male
[12:38:20] DouweM: mordof1: what the.
[12:38:41] DouweM: Noob101: screenshot!
[12:39:20] DouweM: it would be so windows if the female sign were the clear sequence
[12:39:50] DouweM: if `cls` returns \f, why does puts \f become the female sign :/
[12:39:55] DouweM: that makes no sense at all
[12:40:17] DouweM: Noob101: a website can't make a screenshot. only your system can
[12:41:18] DouweM: apeiros: I;m jealous
[12:42:10] DouweM: apeiros: yeah I know. I'm currently on a 27" Cinema Display and my 15" MBP on a stand. I should definitely get an extra display
[12:42:47] DouweM: apeiros: heh
[12:42:55] DouweM: what size are the screens and how are they arranged?
[12:43:36] DouweM: certainty: beautiful
[12:43:57] DouweM: apeiros: what's your workflow as in what do you use each screen for?
[12:44:35] DouweM: nwkr: not bad
[12:46:29] DouweM: honestly I have no idea what I'd use 2 large displays for, let alone 4
[12:53:12] DouweM: certainty: do networks like hbo where you need a seperate subscription run ads? I'm not from the US so I have no idea
[12:54:20] DouweM: certainty: yeah, probablu
[19:52:53] DouweM: read/eval/print/loop. irb is a Ruby repl
[19:53:21] DouweM: I think he means to refer to that line
[19:53:59] DouweM: AlexRussia: wth are you trying to do with line 609?
[19:55:23] DouweM: AlexRussia: right, I see your chance. what are you trying to accomplish?
[19:55:38] DouweM: AlexRussia: you're gonna need to be more specific
[19:55:50] DouweM: yeah as apeiros said, string doesn't have #split!
[19:57:41] DouweM: AlexRussia: What bug? And how is your change supposed to fix it?
[19:59:36] DouweM: AlexRussia: +1 on akerl, but I'm still curious why you made theh change you made
[20:00:06] DouweM: and a raising one because there's no such thing as String#split!
[20:00:08] DouweM: AlexRussia: typo
[20:00:29] DouweM: heh, as far as ops go that's a pretty yes one :P
[20:02:01] DouweM: so, get it in your path
[20:02:57] DouweM: AlexRussia: there is no split! method on String. I have no idea what you're trying to do
[20:03:09] DouweM: kith: alternative as in? what's your goal?
[20:03:22] DouweM: AlexRussia: original uses split, you use split!
[20:03:50] DouweM: kith: all right. no there's no alternative, and why would you want one?
[20:04:04] DouweM: AlexRussia: jesus man, learn to read. split is not the same thing split!
[20:04:24] DouweM: kith: heh, no there's no alternative. just pay :P
[20:04:43] DouweM: AlexRussia: ...
[20:04:57] DouweM: kith: why not learn Swift? It's Ruby-ish and a lot more comfortable to write than ObjC
[20:05:07] DouweM: kith: and doesn't require a license like RM
[20:05:24] DouweM: kith: as in comfort of use, Ruby-ish
[20:05:40] DouweM: kith: definitely higher level than C
[20:05:49] DouweM: kith: released as in you can write in it now
[20:05:57] DouweM: kith: but it's not ready for production
[20:06:12] DouweM: kith: but it's a really nice language
[20:07:19] DouweM: kith: the hardest part of a new language is the standard library, which you'll need to learn anyway, whether you use RubyMotion, Objective-C or Swift
[20:07:55] DouweM: kith: just go with swift, using a first party language is much easier to get support with etc
[20:08:02] DouweM: kith: help online, all that jazz
[20:08:38] DouweM: AlexRussia: line 609 is now a no-op. or rather, it's an op but you're throwing away the result
[20:09:04] DouweM: AlexRussia: my mistake, didn't see the assignment
[20:09:40] DouweM: akerl: the difference is that he's assigning to path, so the check on 612 now uses the array as well
[20:09:51] DouweM: akerl: which is a definite difference, and what fixes the bug
[20:10:17] DouweM: I'm surprised to agree with AlexRussia that there was indeed a bug that this does indeed fix
[20:10:25] DouweM: akerl: I mean the second include check, with the subbed user bin dir
[20:10:32] DouweM: akerl: that used to use the string, now uses the array
[20:10:47] DouweM: akerl: still not sure how that fixes anything, but it's a definite change
[20:11:14] DouweM: I was reading yet an older diff
[20:11:17] DouweM: I have no idea what's up anymore
[20:11:30] DouweM: akerl: disregard anything I said :P
[20:12:23] DouweM: akerl: no no, check the changed code, I think there's indeed a bug there and that AlexRussia has fixed it
[20:12:30] DouweM: He was just very bad at conveying to us what was up
[20:12:48] DouweM: https://gist.github.com/AlexTalker/f5c47b168d3ba33b5e60#file-installer-rb-L609 vs https://github.com/ruby/ruby/blob/trunk/lib/rubygems/installer.rb#L609
[20:12:58] DouweM: akerl: the sub on line 612 is new
[20:13:27] DouweM: akerl: replacing the written out home path by ~, so it'll check the right thing in the user's path
[20:14:18] DouweM: is that so? is the code on ruby/ruby old then?
[20:14:29] DouweM: why doesn't the ruby/rubt code have the sub?
[20:14:36] DouweM: akerl: apparently I'm still looking at old code
[20:14:57] DouweM: akerl: I don't see the sub on https://github.com/ruby/ruby/blob/trunk/lib/rubygems/installer.rb#L609
[20:15:07] DouweM: did AlexRussia add the sub? because the sub makes sense
[20:15:45] DouweM: I'm getting more confused by the minute
[20:16:32] DouweM: which makes sense right? because HOME and ~ are equiv, we should check both
[20:16:42] DouweM: disregarding the windows check for the moment
[20:16:58] DouweM: the sub isn't in the actual rubygems right? it's not in the linked installer.rb
[20:17:18] DouweM: what do you mean "Excep that doesn't"? I feel like I'm missing something
[20:17:55] DouweM: AlexRussia: I know. I know what it does. Did you add that sub in that place or was it already there? Because I don't see it in the code on GitHub
[20:20:05] DouweM: akerl: we want to expand what's in PATH, really, not user_bin_dir
[20:20:31] DouweM: akerl: if user_bin_dir is /home/whatevs, PATH could contain either /home/whatevs/yolo/bin and ~/yolo/bin
[20:20:47] DouweM: akerl: without the replace ~/yolo/bin wouldn't match and we'd get the warning
[20:21:16] DouweM: akerl: allowed though right? apparently AlexRussia has that
[20:21:29] DouweM: akerl: how would you go about it?
[20:21:32] DouweM: akerl: agree on the windows check
[20:21:37] DouweM: but you acknowledge the bug?
[20:22:33] DouweM: RubyPanther: is that so? I had no idea
[20:22:55] DouweM: RubyPanther: I'm not saying it's a good idea, but I can see what AlexRussia is trying to fix
[20:24:24] DouweM: AlexRussia: fix your PATH and you should be all right
[20:25:07] DouweM: Mon_Ouie: haha
[20:25:32] DouweM: akerl: yeah I would've gone with that approach as well
[20:25:53] DouweM: AlexRussia: you're not sharing your PATH anyway, who cares
[20:27:02] DouweM: if adding to PATH automatically expands, how did you end up with ~ in there?
[20:27:28] DouweM: akerl: ah
[20:27:45] DouweM: akerl: hehe
[21:36:18] DouweM: influenced by I'm pretty sure
[21:36:24] DouweM: also that
[21:37:02] DouweM: well there's really just two guys on the internet, you and everyone else, so in fact I'm co-author of everything
[21:37:38] DouweM: of course, I am everyone, including eraw

2014-06-13

[12:58:02] DouweM: TheLarkInn: if they're on different models, obviously the one on the model you're calling the method on. post your code
[13:07:11] DouweM: sevenseacat: it's the song that started electronic dance music (EDM)
[13:07:45] DouweM: kabana: you may want to work on your variable names ;)
[13:08:46] DouweM: kabana: sure, but it doesn't hurt to start clean indented and legible :P
[13:23:12] DouweM: TheLarkInn: I'm not aware of such a gem... But if the filtering is the same for all three models and their structure is alike, why not use inheritance and select for the parent model?
[13:23:27] DouweM: TheLarkInn: I'm of course assuming that's appropriate for the models in question. Otherwise I have no idea
[13:24:55] DouweM: benzrf: not much bra. how's the haskell stuffs going?
[13:26:45] DouweM: TheLarkInn: in that case, no clue. I agree it would be useful to have a collection of mixed models
[13:28:52] DouweM: yeah I recognize the problem
[13:31:44] DouweM: olivier_bK: with XPath you can use comment() as selector
[13:33:14] DouweM: you can't that I'm aware of, so use XPath :)

2014-06-12

[15:23:26] DouweM: that sounds like #tap, but that's different from what you mentioned before
[15:25:45] DouweM: what's the difference between that and parentheses around the experession?
[15:26:51] DouweM: yeah I guess that's useful instead of having a hundred open parentheses on the left
[15:37:08] DouweM: damn, this channel has a lot of young regulars
[15:37:42] DouweM: lemur: young as in I'm starting to feel old at 20
[15:38:21] DouweM: Hanmac: haha
[15:39:14] DouweM: lemur: oh definitely not, but there's a lot of <20 here
[15:39:42] DouweM: more than I'd expected anyway, although that makes little sense as I was here when I was <20 as well
[15:40:07] DouweM: it just furhter confirms the idea that I'm not a unique snowflake :P
[15:40:12] DouweM: lemur: artist in what?
[15:40:38] DouweM: sdelmore1: there's not a stdlib class like that, no
[15:40:48] DouweM: lemur: pretty
[15:41:40] DouweM: makes sense
[15:42:21] DouweM: lemur: cool
[15:43:39] DouweM: lemur: damn, nice
[15:45:45] DouweM: lemur: synopsis?
[15:51:56] DouweM: lemur: opened in tabs, will check out once I've finished this ep of orange is the new black :P

2014-06-11

[14:17:09] DouweM: jheg: you're not suddenly anywhere, you're still in the same scope you were before
[14:17:16] DouweM: you're just calling a method on arr.first
[14:17:46] DouweM: would work, but arr.first.pop is probably better
[14:19:39] DouweM: you're wrong, you want to delete something from ["a",1], not from the entire arr. so of course you need arr.first to get at that ["a", 1] at all
[14:19:49] DouweM: then you can do with that array whatever you want, which is delete the 1
[14:20:05] DouweM: how to get at the 1? first get at the ["a", 1], then get at the 1, so arr.first and then arr.first.last
[14:20:20] DouweM: the way it works makes perfect sense, I think you misunderstand scope
[14:21:12] DouweM: of course you are
[14:21:58] DouweM: you need to get at the first array twice, once because you need to get the entire thing, and then again when you want to get its last element
[14:22:06] DouweM: would it make more sense to you if you assigned arr.first to a variable firs?
[14:22:20] DouweM: like first_array = arr.first, and then first_array.delete(first_array.last0
[14:23:42] DouweM: arr.first and first_array are equivalent, so they should make equal sense to you :)
[14:24:05] DouweM: oh you definitely can, but that's not what you were doing with #delete ;)
[14:25:10] DouweM: right now you're specifying the element you want to destroy, not its index. to get at the index you need arr.first.last
[14:25:31] DouweM: if you know it's at index 1, you can do arr.first.delete_at(1)
[17:25:24] DouweM: mozzarella: :|
[18:54:39] DouweM: so less than or equal? current_storage <= allowed_storage
[18:55:17] DouweM: then it's something else in your code
[21:33:05] DouweM: each_with_index do |number, index|
[21:38:59] DouweM: >> Class.new { def method_missing(m, arg, *args, &block); arg; end }.new.foo({ foo: "bar" })
[21:40:35] DouweM: ericboehs: I do Rails and I've never needed this ;)
[21:40:42] DouweM: ericboehs: what are you going to do with it?
[21:41:07] DouweM: if you only need a single object, apeiros's is better
[21:41:15] DouweM: if for some reason you really want a class, use Class.new
[22:05:06] DouweM: havenwood: [*:a..:c].map.with_index(1) { |*args| args }.to_h ??? slightly shorter ;)
[22:06:10] DouweM: havenwood: I wondered if that'd work but didn't bother trying :P good to know it does
[22:48:14] DouweM: array[array.length/2] then
[23:15:26] DouweM: jheg: you can't use floats for array indexes
[23:15:45] DouweM: yeah it is
[23:16:42] DouweM: why are you messing with + 0.5 anyway? 5/2 == 2, because you're dividing integers. 2 is the "lower median index", 2 + 1 (so len/2+1) is the "higher median index"
[23:16:49] DouweM: no need for +0.5
[23:20:41] DouweM: length / 2 for an odd length is the left side of the median. if you want the right side, use length / 2 + 1
[23:21:48] DouweM: ah damn, I'm confusing things as well I think
[23:22:20] DouweM: it's completely the other way around
[23:22:39] DouweM: if you have 3 numbers, the index of the median is 1, or 3/2, without -1
[23:22:50] DouweM: right. it's with an even length that things get hairy
[23:23:20] DouweM: 4/2 == 2, which is the right side, 4/2-1==1 is the left side
[23:23:29] DouweM: sorry for making this even more confusing :
[23:23:40] DouweM: I was mixing a couple of things up and not really thinking it through
[23:23:57] DouweM: apeiros: for even length, length/2 is the right side, length/2-1 the left side