Activity Graph

Page 1 of 1


[13:50:45] herwin: IPAddr.new('').to_i.to_s(2).count('1')
[13:50:47] herwin: ACTION feels dirty
[13:53:41] herwin: I have a PR/feature request open to make the subnet a bit more accessible from within IPAddr
[13:55:08] herwin: https://github.com/ruby/ruby/pull/1269
[13:57:12] herwin: dminuoso: you mean https://bugs.ruby-lang.org/issues/11210
[13:57:31] herwin: but you can't like it there
[13:57:41] herwin: or I never found the button
[13:58:04] herwin: thumbs-up-emoji is pretty much the same


[14:08:21] herwin: which is often true for PoCs


[23:51:25] herwin: *.net *.split
[23:55:16] herwin: has joined #ruby
[23:57:28] herwin: *.net *.split
[23:59:43] herwin: has joined #ruby


[20:57:35] herwin: Ping timeout: 240 seconds
[20:57:42] herwin: has joined #ruby


[12:36:00] herwin: ainieco: see https://en.wikipedia.org/wiki/Modulo_operation "Result has the same sign as"


[11:23:00] herwin: I think the best way in C is to add them as 64-bit integers


[18:33:52] herwin: are the arrays the same size?


[07:19:45] herwin: fn(x => 100)
[07:20:10] herwin: those keyword arguments are a bit like hashes
[07:26:01] herwin: yes, by using fn(x => 100), like I just said...


[11:02:23] herwin: the easier solution would be to pay someone to fix it for you
[11:07:32] herwin: this feels a bit like asking ``you all speak English, I don't understand this book about quantum physics that is written in English, could someone help me with that?''


[18:29:37] herwin: foo = 'foo'; foo['o'] = 'a'; foo # => 'fao'
[18:29:50] herwin: that's the only string sub I could think of
[18:30:29] herwin: but wouldn't be surprised if it used regex under the hood


[08:17:30] herwin: the future doesn't have any notion of the amount of downloaded bytes
[08:17:36] herwin: or even that it's downloading
[13:43:16] herwin: octomancer: () doesn't create an array, and you need an array here, that's why [] does work
[13:43:33] herwin: (you can skip the parens in the l.slice-line
[13:43:59] herwin: 'puts ("loops %d %d") % (pass_count,loop_count)' is being executed as '(puts("...")) % ...'
[13:44:26] herwin: the puts first, than the sprintf
[13:45:05] herwin: also: http://batsov.com/articles/2013/06/27/the-elements-of-style-in-ruby-number-2-favor-sprintf-format-over-string-number-percent/
[13:45:11] herwin: which makes the code much more readable
[14:12:57] herwin: barx: https://robots.thoughtbot.com/ruby-2-keyword-arguments


[11:38:13] herwin: !string.empty?
[11:39:17] herwin: https://bugs.ruby-lang.org/issues/13303


[08:36:29] herwin: and \. instead of .
[08:36:49] herwin: and probably require something before the dot
[08:37:08] herwin: exactly my idea ;)
[11:33:51] herwin: ledestin: no, it's XLI


[14:08:49] herwin: which results in another rubocop warning
[14:09:01] herwin: assignment in if-statement, or whatever the exact name they use is


[07:57:08] herwin: morfin: are you sure you want to compile 2.3.0, instead of 2.3.4 (the latest 2.3)?
[07:57:20] herwin: the problem might magically disappear


[10:56:16] herwin: I'm not sure if it is intended to be able to parse ruby math expression, but in that case you could just use Ripper to create the AST


[13:10:21] herwin: i wouldn't exactly call it ruby's pessimistic operator
[13:10:58] herwin: it's not an operator of ruby



[12:50:45] herwin: or Etc.getpwnam(username), if you want to keep it inside ruby
[12:50:57] herwin: altough I doubt ruby is the best choice here
[15:23:22] herwin: xco: is it a phone number? a gem like global_phone might be more suitable for this


[00:17:33] herwin: *.net *.split
[00:22:53] herwin: has joined #ruby


[21:21:43] herwin: *.net *.split
[21:21:49] herwin: has joined #ruby



[06:15:23] herwin: iirc it installed documents that are partially generated via javascript/jquery
[06:37:26] herwin: Tempfile#path
[07:14:50] herwin: would using yaml instead of json work?
[07:28:43] herwin: mistnim: maybe use something newer than ruby 1.8
[07:28:48] herwin: and all will be fine
[09:13:46] herwin: I don't really understand that question: if you want to require development dependencies in the executable, wouldn't that make them runtime dependencies?
[13:11:54] herwin: [:a, :b] - [:a] does kind of what you're looking for


[08:35:34] herwin: it's easy to find them: it were tracking cookies
[09:00:30] herwin: Chuck Norris doesn't need breadcrumbs, he has tracking cookies


[08:56:29] herwin: then it still looks like you have to add the product before removing it
[08:56:56] herwin: "def >>; end" would pass this test too
[09:01:04] herwin: so we're rubberducking someone else's problems? :)
[09:43:55] herwin: I got really confused by a failing test in perl yesterday, because I used the ruby ordering of expected and actual
[09:44:24] herwin: and perl used is(actual, expected
[09:44:34] herwin: (more precisely: the test module I used)
[09:45:07] herwin: if only everything was always in sync


[08:56:11] herwin: guess you're looking for irb
[08:56:18] herwin: as the interpreter
[08:56:25] herwin: no clue wat the notebook should be
[08:58:37] herwin: then type irb in the console instead of ruby
[08:58:50] herwin: and by GUI you mean IDE?


[15:56:24] herwin: what is self?


[13:25:11] herwin: @products.map(:price).sum
[13:25:42] herwin: only when we're using ruby 2.4 or higher ;)
[13:33:03] herwin: apeiros: you probably have to convert the meters to feet as well


[18:08:08] herwin: please, don't call that a system call, that term is used for something pretty different


[08:56:06] herwin: I guess you're looking for a.zip(b)


[06:49:15] herwin: it looks like that class has a to_h method
[09:57:59] herwin: makes me wonder what the actual problem is
[10:00:31] herwin: <input type="email"> would catch it as well


[13:00:48] herwin: just build a few arrays with numbers, try to compare them and see what happens


[07:10:35] herwin: there are `diff' links in the files-tree
[07:10:56] herwin: or use the link `view differences' to see the complete commit


[07:45:07] herwin: JustJosh: `make` creates an executable that you can use without installing, so something like `make && bin/ruby -I lib/whatever test/test.rb`
[07:45:22] herwin: not sure about the paths
[07:53:06] herwin: there might be smarter solutions, but this works and i haven't spent enough time in the mri-source to be bothered by it


[07:52:42] herwin: you call it like "some_function(param_a: 'foo', param_b: 'bar')"
[07:52:57] herwin: it's great for having a bunch of optional parameters
[07:53:30] herwin: or as an illustration of the purpose of the parameter, 'foo(option1: true)' is clearer than 'foo(true)'
[09:31:59] herwin: you could, if you want to make it more difficult
[09:41:13] herwin: but it doesn't do what you asked for
[13:42:54] herwin: sed 's/∪/|/' *.rb
[13:43:01] herwin: thereifixedit
[16:00:51] herwin: omarek: http://patshaughnessy.net/2012/1/18/seeing-double-how-ruby-shares-string-values
[16:10:29] herwin: I fail to see how this snippet implies include? runs in constant time


[09:19:32] herwin: https://www.random.org/analysis/dilbert.jpg


[08:44:32] herwin: sounds like http://docs.spring.io/spring/docs/2.5.x/javadoc-api/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.html
[10:37:55] herwin: Znow: your original request included ``since epoch'', but that website you're trying to validate it with doesn't use epoch as base
[10:46:46] herwin: probably something like Time.now - Time.new('0000-01-01')
[10:46:54] herwin: or whatever the constructor of Time accepts


[11:35:34] herwin: how would anyone know the answer to ``Can I'' ?
[15:05:51] herwin: finalizers/weakrefs don't work on frozen objects, and symbols are frozen
[15:06:33] herwin: stumbled upon it last week
[15:17:00] herwin: https://gist.github.com/qnet-herwin/a2f40cc4bc810c9e3ce1fac82cc4817e
[15:17:08] herwin: this is the version with syntax hilighting
[15:17:21] herwin: which makes the difference between lines 5 and 6 obvious
[15:31:22] herwin: is there any specific reason that there is a next in that piece of code?
[15:44:14] herwin: and you learn a lot more from it than if we'd just fix your code without any explanation


[13:53:37] herwin: the quotes


[15:29:03] herwin: a.uniq.size would give the same value as Set.new(a).size
[15:29:11] herwin: it's faster and clearer


[12:31:54] herwin: isn't that specific to rails?
[14:27:03] herwin: nil&.fetch(3, nil) does the same and might be a bit more readable
[14:27:12] herwin: or Array(nil)[3]


[10:00:10] herwin: try a[4,1] and a[4,2]


[15:41:07] herwin: byte order mark
[15:41:34] herwin: `file blah.json` should show it


[09:47:31] herwin: have you tried it?


[15:18:59] herwin: I guess powershell would be a more logical tool here than ruby
[16:09:31] herwin: z4phod: they are two different thing, though the implementation of the method you're calling *might* do the same
[16:20:55] herwin: class << self; attr_accessor :foo; end


[08:13:12] herwin: or if you put "require 'client.rb'" in client.rb
[08:16:49] herwin: only after a file has been fully required, require will not require it again
[08:57:11] herwin: unlikely, but the answer in #php might be different
[12:28:07] herwin: your link to gist.github is missing something
[12:33:32] herwin: so you're trying to reinvent bundler?
[12:39:34] herwin: DWSR: https://bundler.io/
[12:51:55] herwin: is the debian-package libffi-dev installed on the machine where you're trying to compile?


[08:09:28] herwin: is there any reason this data is an array of hashes that all have 1 key, and not just a hash?
[08:12:36] herwin: fonts.flat_map(&:to_a).to_h makes the structure much easier to work with
[09:25:11] herwin: but it's not mentioned in the topic
[15:44:35] herwin: ACTION leaves preparing to postgresql
[16:07:04] herwin: adam12: other languages often require reopen or dup2 to change it
[16:07:10] herwin: it's common, just more work


[05:18:20] herwin: `git grep Kernel`
[10:02:31] herwin: halogenandtoast: http://words.steveklabnik.com/beware-subclassing-ruby-core-classes


[12:36:42] herwin: that problem occurs more often than you think: https://twitter.com/timmartin2/status/23365017839599616


[11:10:21] herwin: that is "more than 2" ;)
[18:24:12] herwin: we had a discussion at my work today about the best code review tool, looks like we forgot to include irc ;)


[13:14:52] herwin: just to think outside the box: don't they have a json-feed (or any other format that is easy to read by machines)?
[13:20:05] herwin: so we can add more bike shedding to code reviews


[15:17:02] herwin: they do the same
[15:17:09] herwin: but the second syntax is preferred
[15:17:10] herwin: https://github.com/bbatsov/ruby-style-guide#syntax
[15:17:31] herwin: (which is not absolute science of course)
[17:15:11] herwin: hxegon: Ruby 2.4 has a Hash#transform_values to simplify that last example


[09:37:06] herwin: and exactly what is wtf about that?


[06:11:42] herwin: it breaks when you input an empty array
[06:11:57] herwin: the array.length * 5 is completely arbitrary
[06:12:41] herwin: and of course you could just use Array#sort (but I assume this code was for educational purposes)
[06:19:06] herwin: HippoDippo: https://en.wikipedia.org/wiki/Bubble_sort
[06:19:17] herwin: this is pretty close to what you are trying to do
[06:43:37] herwin: you could start of with a very simple implementation (like "def sort(array); array.sort; end"), write a number of test cases for it, and then just keep changing things to get closer and closer to bare metal
[06:43:59] herwin: the test cases could be used to see if the implementation still works
[15:12:41] herwin: just keep adding random statements until it compiles?


[08:04:52] herwin: fmartingr: http://ruby-doc.com/docs/ProgrammingRuby/html/tut_classes.html
[12:08:42] herwin: Verity: i believe ^ has the associative property, meaning (mb^k1)^k2 == mb^(k1^k2)
[12:09:10] herwin: in that case, you could pre-calculate the ^ of key
[12:09:25] herwin: and that removes the need for the outer loop


[09:03:11] herwin: ChickeNES: you could try to reuse parse.y from the ruby source tree
[12:49:50] herwin: until data contains a '
[12:49:57] herwin: then suddenly everything breaks
[12:53:16] herwin: is there any reason to have a dependency on curl, cygwin and a hardcoded path
[12:53:25] herwin: instead of using Net::HTTP
[12:53:41] herwin: or any other http lib


[13:08:34] herwin: Verity: short summary to understand it: people have different definitions of OOP, and advertise their meaning as facts
[14:02:41] herwin: "the way rubocop stops complaining"
[16:02:11] herwin: anybody else who uses the badum shell?
[16:02:15] herwin: *badump-sh*


[10:31:17] herwin: sounds like a question for #rails
[14:23:16] herwin: yes, openssl 1.1.0 introduced a number of backwards incompatibilities


[07:27:55] herwin: https://stackoverflow.com/questions/34583168/safe-navigation-operator-for-nil
[07:28:34] herwin: http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/ is a better explanation


[09:59:08] herwin: t1.year == t2.year


[14:58:21] herwin: it's what most languages do
[15:00:43] herwin: perl returns undef (the equivalent of nil), I believe java returns null
[15:01:11] herwin: it always confuses the heck out of me when I have to make a change to a python thing and it raises an error
[15:01:16] herwin: C just segfaults ;)
[15:05:14] herwin: foo.fetch(i, baz)
[15:06:10] herwin: actually, i don't think i use array indexes that much
[15:06:30] herwin: mostly just map/each
[17:32:52] herwin: ACTION grabs the popcorn


[12:48:32] herwin: and excatly why would you put a zip-file in a json-file?
[13:53:52] herwin: ...u0192\u201e\u2026\u2020\u2021\u2c6\u2030\u0160\u2039\u0152\u...
[13:54:10] herwin: that points exactly to the incorrect unicode thing here


[09:58:47] herwin: ArgumentError: comparison of Fixnum with String failed
[14:08:25] herwin: Burgestrand: you realize he's now going to load the V8 engine in ruby to run JS?