bhaak

Activity Graph

Page 1 of 3 | Next »

2019-07-17

[00:36:18] bhaak: Ping timeout: 272 seconds
[05:39:56] bhaak: has joined #ruby

2019-07-06

[11:47:38] bhaak: Ping timeout: 252 seconds
[13:54:04] bhaak: has joined #ruby

2019-06-15

[06:27:28] bhaak: *.net *.split
[06:37:55] bhaak: has joined #ruby

2019-06-14

[03:22:02] bhaak: *.net *.split
[03:38:06] bhaak: has joined #ruby

2019-06-03

[07:48:00] bhaak: *.net *.split
[07:52:51] bhaak: has joined #ruby

2019-05-18

[15:53:26] bhaak: it's passed by reference

2019-05-06

[23:00:05] bhaak: Ping timeout: 268 seconds
[23:01:35] bhaak: has joined #ruby

2019-04-18

[00:03:09] bhaak: Ping timeout: 255 seconds
[02:56:48] bhaak: has joined #ruby

2019-04-16

[23:00:39] bhaak: has joined #ruby

2019-04-12

[12:21:36] bhaak: Ping timeout: 255 seconds

2019-04-11

[00:00:57] bhaak: has joined #ruby

2019-04-10

[23:35:23] bhaak: Ping timeout: 252 seconds

2019-03-14

[00:47:34] bhaak: Ping timeout: 268 seconds
[05:34:01] bhaak: has joined #ruby
[14:37:30] bhaak: depends on what you want it to do. this is a valid chain of methods in Ruby
[14:39:36] bhaak: it's pretty short already. if you use String interpolation, you don't need to to_s: "something #{Time.now.to_i} something else"

2019-03-07

[04:53:45] bhaak: has joined #ruby

2019-02-28

[15:42:29] bhaak: Math.log10(1).floor + 1
[15:42:50] bhaak: less mathy: 1.to_s.length
[15:44:39] bhaak: it's probably also the slowest.
[15:55:47] bhaak: puts Benchmark.measure { 10_000_000.times { 123456.digits.count } }; puts Benchmark.measure { 10_000_000.times { 123456.to_s.length } }; puts Benchmark.measure { 10_000_000.times { Math.log10(123456).floor + 1 } }
[15:56:13] bhaak: 5 seconds vs 3.3 seconds vs 1.2 seconds
[15:56:27] bhaak: I would have expected the math version to be faster
[16:15:38] bhaak: Zarthus_: the times are pretty stable. but running it now, I get 1.6s seconds for the to_s version
[16:28:45] bhaak: the math one worksforme with bignums
[16:30:27] bhaak: and "working" with negative numbers is depending on what you expect. I'd say -1.to_s.length => 2 is wrong

2019-01-31

[12:40:16] bhaak: possibly IO.select
[12:40:55] bhaak: but for a simple IRC bot I wouldn't do any lowlevel network stuff myself but just use cinch
[12:48:56] bhaak: have you opened the connection with connect_nonblock?

2018-12-05

[10:08:18] bhaak: Ping timeout: 250 seconds
[13:31:58] bhaak: has joined #ruby

2018-12-04

[16:59:03] bhaak: has joined #ruby

2018-12-03

[09:48:10] bhaak: Ping timeout: 268 seconds

2018-11-29

[09:43:48] bhaak: Ping timeout: 245 seconds
[16:52:46] bhaak: has joined #ruby

2018-11-26

[08:57:52] bhaak: Ping timeout: 246 seconds
[15:07:50] bhaak: has joined #ruby

2018-10-24

[02:17:15] bhaak: has joined #ruby

2018-10-23

[23:59:39] bhaak: Ping timeout: 268 seconds

2018-10-17

[12:06:09] bhaak: >> require 'time'; Time.iso8601("2007-01-01T12:34:56")
[12:06:33] bhaak: looks like the bot is broken?
[12:07:11] bhaak: >> require 'date'; puts Date.iso8601("2007-01-01")
[12:07:21] bhaak: na, broken
[12:07:34] bhaak: but the explanation is in the documentation of iso8601
[12:08:00] bhaak: "alias for xmlschema" and under xmlschema: "Parses date as a dateTime defined by the XML Schema and converts it to a Time object. The format is a restricted version of the format defined by ISO 8601."
[12:08:05] bhaak: _restricted_
[12:12:00] bhaak: puts then you would get a Time object and not a Date object.
[12:12:46] bhaak: s/puts/but
[12:12:51] bhaak: too much ruby
[12:13:50] bhaak: you might remember the parse method and not iso8601?
[12:22:10] bhaak: I just tested it for 1.8.7, doesn't work either
[12:23:05] bhaak: looking at the source code, the relevant method has been last changed in 2014. the regexp matches the input string even only in 2008

2018-09-15

[10:19:24] bhaak: Ping timeout: 252 seconds
[10:26:58] bhaak: has joined #ruby

2018-09-14

[00:13:32] bhaak: has joined #ruby
[12:05:28] bhaak: Ping timeout: 245 seconds
[15:56:57] bhaak: has joined #ruby

2018-09-13

[23:36:04] bhaak: Ping timeout: 246 seconds

2018-09-12

[01:42:04] bhaak: Ping timeout: 244 seconds
[01:42:40] bhaak: has joined #ruby

2018-09-05

[12:56:18] bhaak: Ping timeout: 260 seconds
[13:03:28] bhaak: has joined #ruby

2018-08-29

[14:49:50] bhaak: depends on the content of str
[14:57:10] bhaak: I might have though of String.new
[17:02:35] bhaak: raz: if it's within the context of Rails, are you really sure it's a String? it could also be Rails' HtmlSafeBuffer or whatever it's called
[17:03:42] bhaak: SafeBuffer

2018-07-29

[18:49:39] bhaak: Ping timeout: 256 seconds
[18:51:00] bhaak: has joined #ruby
[22:40:05] bhaak: Ping timeout: 240 seconds
[22:40:20] bhaak: has joined #ruby

2018-07-20

[00:07:20] bhaak: *.net *.split
[00:15:49] bhaak: has joined #ruby

2018-06-29

2018-06-26

[14:30:03] bhaak: having a default is something else than "it just assumes unicode"
[14:31:05] bhaak: dminuoso: how come my Encoding.default_external looks like this => => #<Encoding:ISO-8859-1>
[14:33:53] bhaak: >> File.open('/dev/null', 'rb').read.encoding
[14:34:05] bhaak: doesn't look like Unicode to me
[14:36:30] bhaak: it depends from where the string is coming and possibly what environment you are running.
[14:37:30] bhaak: but the usual default is utf-8. because we aren't living in the 1990s anymore
[14:50:01] bhaak: Bish: ah. well. it depends :-]
[14:52:29] bhaak: Bish: a "String" is just a data type. different languages have different solutions on how to represent that. therefore you can't say what encoding a general String has, you have to put it in context
[14:54:28] bhaak: Bish: you know the difference between integers and floats and how they look at byte level?
[14:55:14] bhaak: then why are they different? why not one byte representation to rule them all?
[14:55:37] bhaak: the same with strings. different approaches have different use cases and different advantages and disadvantages
[14:56:07] bhaak: Ruby chose to put an explicit encoding on a string. in Python, AFAIK, everything is converted to a Unicode representation.
[14:56:47] bhaak: with the latter, you don't have any issues with encoding as there is only one. but if you need to go latin-1 or shift-jis, you have to fall back to byte strings handling
[14:58:08] bhaak: what if you don't want to uft8? like when you need to output latin1?
[15:04:00] bhaak: havenwood: closing your eyes, putting your hands over your ears and going "lalala" is not a proper issue resolving strategy ;-)
[15:05:55] bhaak: Bish: what about legacy systems? what about systems that don't use utf-8 but utf-16 (it's broken, but they do exist)? or even utf-32?
[15:06:18] bhaak: havenwood: if we would live in an ideal world, yes. but we don't.
[15:08:26] bhaak: havenwood: I don't believe in normative claims with programming languages. there are always advantages and disadvantages that need to be considered.
[15:08:55] bhaak: TheBrayn: I don't think we need to dig that up. nonet systems haven't aged well

2018-06-20

[14:37:24] bhaak: EverythingAndTheKitchenSinkWithBells
[14:39:23] bhaak: shed could also derive from "bikeshed"
[14:43:44] bhaak: easily verbed, in English and German
[14:43:48] bhaak: "dings that"
[14:43:55] bhaak: dings this, dings it all around
[14:44:49] bhaak: yeah, that would have been my next suggestion. use a slightly derogative term for "being that is called to fetch stuff"

2018-06-04

[10:05:57] bhaak: but isn't that a yaml error? IIRC jekyll uses yaml for setting meta data (e.g. the title of the generated html). in that case 82582-2017-11-29-gdpr.md would have some syntax error in the yaml part

2018-05-31

[15:34:05] bhaak: Ping timeout: 240 seconds
[15:34:51] bhaak: has joined #ruby

2018-05-29

[02:47:17] bhaak: *.net *.split
[02:48:13] bhaak: has joined #ruby

2018-04-25

[12:26:00] bhaak: *.net *.split
[12:27:26] bhaak: has joined #ruby
[15:01:31] bhaak: *.net *.split
[15:03:10] bhaak: has joined #ruby

2018-02-27

[04:25:42] bhaak: Ping timeout: 256 seconds
[06:31:48] bhaak: has joined #ruby

2018-01-18

[14:22:50] bhaak: Ping timeout: 276 seconds
[16:46:42] bhaak: has joined #ruby

2018-01-15

[13:01:57] bhaak: Ping timeout: 240 seconds
[17:01:13] bhaak: has joined #ruby

2018-01-11

[00:06:26] bhaak: Ping timeout: 252 seconds
[04:17:32] bhaak: has joined #ruby

2017-12-28

[13:40:57] bhaak: Ping timeout: 240 seconds
[15:53:29] bhaak: has joined #ruby

2017-12-23

[02:25:56] bhaak: Ping timeout: 260 seconds
[06:24:38] bhaak: has joined #ruby
[10:55:33] bhaak: Ping timeout: 264 seconds
[11:03:06] bhaak: has joined #ruby

2017-12-19

[14:02:06] bhaak: Ping timeout: 265 seconds
[17:54:44] bhaak: has joined #ruby

2017-12-16

[11:02:51] bhaak: has joined #ruby

2017-12-15

[21:50:11] bhaak: Ping timeout: 276 seconds

2017-12-06

[14:03:26] bhaak: Ping timeout: 260 seconds

2017-12-05

[00:21:05] bhaak: Ping timeout: 240 seconds
[03:50:45] bhaak: has joined #ruby
[04:46:24] bhaak: Ping timeout: 248 seconds
[07:14:45] bhaak: has joined #ruby
[20:14:28] bhaak: Ping timeout: 268 seconds
[20:16:53] bhaak: has joined #ruby

2017-12-01

[02:28:51] bhaak: has joined #ruby

2017-11-29

[15:57:06] bhaak: sounds like he learned his German from commercials
[15:57:31] bhaak: ah, an Austrian
[15:58:26] bhaak: that's south easterish of Germany. that's all the same ;-)

2017-11-16

[01:28:18] bhaak: has joined #ruby

2017-11-14

[06:43:41] bhaak: has joined #ruby

2017-11-13

[23:25:20] bhaak: Ping timeout: 248 seconds

2017-11-11

[13:54:32] bhaak: Ping timeout: 240 seconds
[14:04:11] bhaak: has joined #ruby

2017-11-09

[06:15:07] bhaak: Ping timeout: 248 seconds
[06:21:05] bhaak: has joined #ruby

2017-11-06

[06:31:52] bhaak: *.net *.split
[07:12:01] bhaak: has joined #ruby

2017-10-15

[11:24:05] bhaak: Ping timeout: 240 seconds
[11:24:35] bhaak: has joined #ruby

2017-09-27

[04:29:52] bhaak: *.net *.split

2017-08-08

[02:19:16] bhaak: Ping timeout: 255 seconds
[02:20:08] bhaak: has joined #ruby

2017-07-27

[22:43:27] bhaak: Remote host closed the connection

2017-06-20

[00:15:56] bhaak: Remote host closed the connection
[00:22:44] bhaak: has joined #ruby

2017-05-30

[09:49:10] bhaak: has joined #ruby

2017-05-14

[18:09:21] bhaak: *.net *.split

2017-03-24

[14:46:54] bhaak: I use rvm on OSX and Linux and don't remember any problems

2017-03-12

[18:42:14] bhaak: Ping timeout: 246 seconds
[18:50:09] bhaak: has joined #ruby

2016-07-27

[13:08:25] bhaak: Ping timeout: 240 seconds
[13:21:05] bhaak: has joined #ruby

2016-07-21

[04:42:37] bhaak: Ping timeout: 260 seconds
[05:54:38] bhaak: has joined #ruby

2016-07-20

[10:42:17] bhaak: Ping timeout: 260 seconds
[10:56:24] bhaak: has joined #ruby

2016-07-12

[01:56:36] bhaak: Ping timeout: 258 seconds
[01:57:56] bhaak: has joined #ruby

2016-07-02

[23:13:11] bhaak: Ping timeout: 258 seconds
[23:14:09] bhaak: has joined #ruby

2016-07-01

[21:57:29] bhaak: Ping timeout: 260 seconds
[23:12:29] bhaak: has joined #ruby

2016-06-29

[23:08:57] bhaak: Ping timeout: 260 seconds
[23:34:21] bhaak: has joined #ruby

2016-06-28

[00:15:15] bhaak: has joined #ruby

2016-06-27

[23:55:54] bhaak: Ping timeout: 276 seconds

2016-06-20

[12:19:40] bhaak: Ping timeout: 264 seconds
[12:20:13] bhaak: has joined #ruby

2016-06-18

[20:37:11] bhaak: Quit: leaving
[20:38:39] bhaak: has joined #ruby

2016-06-08

[12:42:06] bhaak: I'm confused about the behavior of Array.new with a block and Array.new(size, default). from the description it sounds as if it would behave similar to Hash.new
[12:42:37] bhaak: but it seems only to take the default for initialisation
[12:43:39] bhaak: that's the same gotcha as with Hash.new but I meant something else
[12:44:06] bhaak: a = Array.new(2, 1) => [1, 1]; a[2] => nil
[12:44:53] bhaak: yeah, that seems to be the case but that's unfortunate
[12:48:08] bhaak: I wanted it for tracking some counts without knowing what the maximal index would be
[12:48:43] bhaak: that's not 100% true though. i'm looking at unicode codepoints so the index is actually limited
[12:49:55] bhaak: I haven't benchmarked it but I would have guessed that array access is faster in arrays than in hashes
[12:55:52] bhaak: norc: yeah, that's why I explicitly said I haven't done any benchmarks. but arrays and hashes have different big O values so there should be a difference.
[12:56:42] bhaak: only on average
[12:57:29] bhaak: no, on worst case, hash is O(n)
[12:57:46] bhaak: think of a hashing algorithm that puts every item on the same slot
[12:58:45] bhaak: jhass: yes. also in the case of ruby, the dynamic re-allocation of the array needs to be considered
[13:02:32] bhaak: norc: update should be O(1) as well. but I don't need the other tasks. if all you use is numbers, it's not obvious that a hash should be faster.
[13:06:49] bhaak: norc: implementing a CORBA? that sounds nasty
[13:07:38] bhaak: still nasty :)
[13:09:13] bhaak: I remember a long time ago when doing some internship, that I found out the hard way that the c++ corba implementation of a company wasn't able to talk to the java corba implementation of the same company ... m(
[13:10:04] bhaak: sure, I know that, you know that, the company probably knew it as well
[13:10:25] bhaak: but when you have a product, you have to ship it!!!!111eleven
[13:16:02] bhaak: norc: was it obvious from the start that corba would not have too much overhead?
[13:16:20] bhaak: I mean, corba is also not the most lightweight protocol there is
[13:29:23] bhaak: only in tutorials

2016-06-07

[00:34:57] bhaak: Ping timeout: 276 seconds
[00:42:08] bhaak: has joined #ruby
[00:50:32] bhaak: Ping timeout: 260 seconds
[00:50:40] bhaak: has joined #ruby

2016-06-06

[22:23:18] bhaak: Ping timeout: 246 seconds
[23:18:07] bhaak: has joined #ruby

2016-05-31

[23:03:30] bhaak: Ping timeout: 276 seconds
[23:31:53] bhaak: has joined #ruby

2016-03-31

[00:41:28] bhaak: Ping timeout: 252 seconds
[16:17:48] bhaak: has joined #ruby

2016-03-29

[00:10:17] bhaak: Ping timeout: 260 seconds
[00:10:25] bhaak: has joined #ruby

2016-03-24

[10:28:58] bhaak: has anybody tried to mock/overwrite I18n.translate?
[10:30:09] bhaak: I wanted to do that for a test but ran into problems as it is implemented as "module I18n; extend(Module.new {def translate; ...; end } ... "
[10:30:33] bhaak: apeiros: nope, I mean the ruby gem, not the stuff used by rails.
[10:33:12] bhaak: apeiros: yeah, I got as far but it didn't work when I tried to overwrite the translate method for this module, it didn't stick. the original one was still being called
[10:34:50] bhaak: maybe, I'd have to test again if I checked every case because of the alias :t :translate
[10:36:27] bhaak: in the end I did I18n.extend(Module.new { def t!(key, options={}); ...; end }) in the before and redefining it back in the after block. but that feels dirty and I don't have a clue why it didn't work the other way
[10:40:08] bhaak: Ox0dea: prepend always gives me headaches. every time I read it up I think I understand and then run into problems using it. :-/
[10:40:35] bhaak: but I'll have to do a proper minimal example first. I just wanted to be sure that I didn't overlook something obvious and simple.
[10:43:38] bhaak: gregf_: how does the load of your machine look like?
[10:48:51] bhaak: Ox0dea: that's how I think it should work but I seem to more often than not get it wrong anyway. but the idea with #remove_method could be handy sometimes. thanks

2016-03-12

[15:29:29] bhaak: Ping timeout: 252 seconds
[15:31:27] bhaak: has joined #ruby

2016-03-02

[00:03:57] bhaak: Ping timeout: 276 seconds
[00:17:13] bhaak: has joined #ruby

2016-02-28

[12:53:52] bhaak: Ping timeout: 264 seconds
[12:55:48] bhaak: has joined #ruby

2016-02-27

[22:40:56] bhaak: has joined #ruby

2016-02-20

[09:01:03] bhaak: Ping timeout: 268 seconds
[09:49:59] bhaak: has joined #ruby

2016-02-15

[07:03:54] bhaak: *.net *.split
[07:37:11] bhaak: has joined #ruby

2016-02-12

[00:02:30] bhaak: Ping timeout: 250 seconds
[00:05:09] bhaak: has joined #ruby

2016-02-10

[17:27:20] bhaak: Ping timeout: 250 seconds
[17:30:32] bhaak: has joined #ruby
[17:35:08] bhaak: Ping timeout: 250 seconds
[18:07:31] bhaak: has joined #ruby

2016-02-09

[22:46:42] bhaak: has joined #ruby