Activity Graph

Page 1 of 9 | Next »


[00:13:14] dorei: >> require 'io/console'
[00:15:08] dorei: apeiros: how can you tell apart the two cases? :S
[00:16:08] dorei: apeiros: i dont know, to the same person that Ox0dea demonstrated the same thing
[00:17:07] dorei: apeiros: that's your problem, not mine
[00:17:18] dorei: has joined #ruby-banned
[00:18:02] dorei: has left #ruby-banned: ()


[19:08:10] dorei: has joined #ruby


[13:19:12] dorei: has joined #ruby
[18:15:13] dorei: DarkElement: try: require 'nokogiri' ; require 'open-uri' ; doc = Nokogiri::HTML(open(''))
[18:16:45] dorei: DarkElement: if this doesnt work for the url you want, then maybe u need other lib to open the url, use wireshark to verify what's actually being send/received on the network
[18:17:08] dorei: there are some shitty sites that endup in an endless loop unless you get their cookies
[18:17:39] dorei: doc is your nokogiri document
[18:18:02] dorei: ready for your xpath queries
[18:19:23] dorei: DarkElement: no idea, give it a try
[18:20:21] dorei: DarkElement: from open-uri documentation: The environment variables such as http_proxy, https_proxy and ftp_proxy are in effect by default.
[18:20:27] dorei:
[18:23:31] dorei: DarkElement: try setting you proxy in enviroment variable
[18:24:34] dorei: DarkElement: if you use bash it's something like: export HTTP_PROXY=""


[02:11:21] dorei: there's probably a bug with the bot :p
[13:01:04] dorei: has joined #ruby
[22:33:49] dorei: Ping timeout: 265 seconds
[22:34:23] dorei: has joined #ruby


[15:17:38] dorei: has joined #ruby


[14:19:31] dorei: has joined #ruby
[14:33:45] dorei: >> "Beethoven".codepoints
[14:35:40] dorei: probably someweird iso then
[14:38:48] dorei: > [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].map {|x| x.to_s(16) }
[14:38:54] dorei: >> [1048605, 1048603, 1048603, 1048606, 1048607, 1048593, 1048608, 1048603, 1048604].map {|x| x.to_s(16) }
[14:40:08] dorei: >> [0x1d, 0x1b, 0x1b, 0x1e, 0x1f, 0x11, 0x20, 0x1b, 0x1c].map(&:chr)
[14:43:15] dorei: looks more like a cryptogram, than a encoding issue xD
[14:43:52] dorei: maybe the numbers have the wrong endianess
[14:44:12] dorei: or maybe they're ebcdic
[14:44:32] dorei: norc_: can you paste that string somewhere in the web?


[14:13:32] dorei: has joined #ruby
[19:00:26] dorei: has joined #ruby


[13:51:31] dorei: has joined #ruby


[13:00:39] dorei: has joined #ruby


[13:24:42] dorei: has joined #ruby


[12:42:15] dorei: has joined #ruby


[01:44:38] dorei: [1,2,3].join(':') gives "1:2:3", if I wanted to get ":1:2:3" is there a better way than this? ([':']*3).zip([1, 2, 3]).join
[01:48:17] dorei: thanx apeiros :)
[13:13:27] dorei: has joined #ruby


[01:06:19] dorei: Ping timeout: 260 seconds
[01:07:31] dorei: has joined #ruby
[14:06:14] dorei: has joined #ruby


[11:25:35] dorei: has joined #ruby


[10:45:46] dorei: has joined #ruby


[13:20:54] dorei: has joined #ruby


[14:02:31] dorei: has joined #ruby
[22:58:26] dorei: when doing "case str ... when regex", is $1, $2, etc the only way to access capture groups from within the when regex block?
[23:11:31] dorei: $LAST_MATCH_INFO[1] ? :O
[23:12:26] dorei: i think i'll stick with $1 :)


[00:14:37] dorei: if it cant has infinite loops, it aint a program :p
[00:16:50] dorei: shevy: no infinite loops => halt problem is decidable => no turing machine :p
[00:46:18] dorei: is there some ruby stdlib/core method for 2s complement ?
[00:46:27] dorei: >> ->x { (255 - x + 1) .to_s(16) }.(12)
[00:46:40] dorei: something like that in a less cryptic way
[00:48:30] dorei: shevy: signed int as two's complement for 8bit cpu :p
[00:48:45] dorei: -12 is 0xF4
[00:49:27] dorei: oh, xor :D
[00:49:52] dorei: if it works
[00:49:56] dorei: it works :)
[00:50:10] dorei: isnt % a xor? no?
[00:50:31] dorei: so, using modulus you can get 2s complement
[00:50:34] dorei: interesting
[15:43:43] dorei: has joined #ruby
[18:55:05] dorei: hello, is there anything at ruby core/stdlib to help me deal with endianness?
[18:57:53] dorei: Ox0dea: i was hopping to avoid them
[19:15:16] dorei: Ox0dea: i've found a way without pack/unpack :)
[19:15:33] dorei: >> ->val{ ((val << 8) | ((val >> 8) & 0x00FF)).to_s(16)[2..-1] }.(0x3172)
[19:26:49] dorei: >> ["3172"].pack('H*').unpack('n*').pack('v*').unpack('H*')
[19:40:39] dorei: Ox0dea: what do you mean?
[20:40:56] dorei: _Tariq:
[22:20:02] dorei: DeezCodez: i think the answer is domain specific, try project euler if you're math inclined
[22:47:43] dorei: shevy: somewhere in rails


[00:00:55] dorei: Ping timeout: 240 seconds
[00:01:17] dorei: has joined #ruby
[13:31:40] dorei: has joined #ruby


[14:59:56] dorei: has joined #ruby


[15:55:53] dorei: has joined #ruby
[15:59:17] dorei: anyone here using vim? what do you prefer for snippets management?
[19:45:52] dorei: what's the difference between utc and gmt? is gmt just utc + daylight time saving or are there other differences?
[19:46:50] dorei: i think utc has no daylight time saving, while gmt has, aint sure though
[19:47:50] dorei: oh, it's more weird
[19:47:55] dorei:
[19:48:16] dorei: "One is measured from the sun and another from an atomic clock." xD


[01:17:21] dorei: anyone here that uses the citrus gem?
[14:46:08] dorei: has joined #ruby


[13:24:14] dorei: has joined #ruby


[13:06:46] dorei: has joined #ruby


[12:54:01] dorei: has joined #ruby


[16:57:20] dorei: has joined #ruby
[19:47:55] dorei: i'm very tempted to use eval to transform a string like "3 * 5 + 2" into fixnum 17, is there some other way?
[19:51:30] dorei: yorickpeterse: that's why i'm really tempted to use eval :)
[20:00:59] dorei: havenwood
[20:01:39] dorei: should i prevent the end user from shooting in his foot? :D



[11:39:57] dorei: has joined #ruby
[17:44:51] dorei: ChameleonSix: 1000 in binary, is 8 in decimal
[22:56:28] dorei: coffee is the best drug <3


[14:14:01] dorei: has joined #ruby


[18:10:24] dorei: has joined #ruby
[22:28:41] dorei: elico: there's no point for a number to be padded, its string representation is padded
[23:40:53] dorei: let's say i have an array like ['a', 41, 5, 'b', 41, 'zz', 'd'] , is there a way to split it at 41 so as to have an array like [['a'], [41], [5, 'b'], [41], ['zz', 'd']] ?
[23:44:37] dorei: havenwood: that's magic, thanx :)


[15:27:06] dorei: has joined #ruby
[21:46:41] dorei: how can i transform this string: "this is \"a small\" test" into this array ["this", "is
[21:46:52] dorei: how can i transform this string: "this is \"a small\" test" into this array ["this", "is", "a small", "test"] ?
[21:47:43] dorei: j416: what args should i pass to split?
[21:48:25] dorei: Shellwords?
[21:50:06] dorei: thanx adaedra
[21:51:54] dorei: thanx jbrhbr :))


[16:14:57] dorei: has joined #ruby


[14:25:56] dorei: has joined #ruby
[21:03:40] dorei: ljarvis: first one is something like long, eternity, the second one is spring
[21:04:56] dorei: i think first one is long but long in the dimmension of time, not space


[15:29:18] dorei: has joined #ruby
[19:09:18] dorei: graft: wouldn't a Hash help?
[19:11:51] dorei: graft: i think a correct sql query is faster than anything
[22:49:18] dorei: what's the problem with md5?
[22:49:48] dorei: i mean, if some malicious gets access to your md5 encrypted passwords, then i think it's already too late
[22:50:07] dorei: even if you didnt use md5 and prefered smt better
[22:51:17] dorei: Ox0dea: thankfully, i've got no users :)


[00:25:02] dorei: on the expectations of the end user
[18:57:03] dorei: has joined #ruby


[15:52:11] dorei: has joined #ruby
[22:34:07] dorei: rex/racc is the ruby way for lexers/parsers ?
[22:37:48] dorei: thanx Ox0dea
[22:53:41] dorei: nofxx: maybe u should avoid floats and count minutes


[14:21:55] dorei: has joined #ruby
[14:43:02] dorei: Verde`: if you aint looking for a pure ruby implementation, maybe this might be of help


[14:51:02] dorei: has joined #ruby
[19:13:46] dorei: Ping timeout: 272 seconds


[14:47:42] dorei: has joined #ruby


[20:37:44] dorei: has joined #ruby


[15:19:58] dorei: has joined #ruby
[23:43:53] dorei: myztic: get the book coauthored by matz
[23:45:15] dorei: myztic: i think so :)


[01:31:06] dorei: aint signals blocked on a per process basis?
[01:31:10] dorei: sigmask or smt like that
[16:00:07] dorei: has joined #ruby
[20:57:24] dorei: is there some standalone gem for validations?


[13:24:53] dorei: has joined #ruby


[20:30:45] dorei: has joined #ruby


[15:07:22] dorei: has joined #ruby
[15:09:03] dorei: i want to produce unique filenames for urls, i've used Base64::encode64(url) but the output isnt that suitable for filename
[15:18:33] dorei: wouldnt it be an overkill to use a cryptohash?
[15:29:01] dorei: in my specific case i only want to have url => filename, not both ways
[15:42:49] dorei: maybe base64::encode64 and then removing that illegal character at the end would be faster
[15:48:30] dorei: Base64::strict_encode64 instead of Base64::encode64 did the trick :)
[21:30:54] dorei: has joined #ruby
[22:48:18] dorei: >> require 'uri' ; URI::regexp.to_s.size


[01:05:52] dorei: it emits an enterprise aura
[16:57:52] dorei: has joined #ruby
[19:17:39] dorei: Ping timeout: 260 seconds
[19:23:27] dorei: has joined #ruby


[18:05:23] dorei: has joined #ruby
[18:32:12] dorei: is there some standard way to document that in order to include the described module, the class that includes it should implement some method (like to include Enumerable, the class should implement #each) ?
[18:43:19] dorei: Ox0dea: i'm checking the enumerable documentation, it's just at the top
[18:43:37] dorei: btw, should I avoid using ivars at my mixins?
[18:45:52] dorei: is there other way to keep state?
[18:46:33] dorei: and if i choose to use ivars, should i become really paranoid to avoid name collissions or should I just mention it at documentation and then forget about it?
[18:58:18] dorei: i avoid thikning about that


[01:22:53] dorei: is there any stable gem for memoization?
[01:36:16] dorei: well, i could use something like @ivar ||= something too
[20:06:27] dorei: has joined #ruby


[17:18:01] dorei: has joined #ruby


[16:35:06] dorei: has joined #ruby
[16:53:03] dorei: $ and ? are shortcuts for show-doc and show-source


[20:45:19] dorei: has joined #ruby


[15:37:26] dorei: has joined #ruby
[23:08:49] dorei: i'm looking for smt that returns x if the input array has the form [x, x, x, ..., x, x] else nil, any ideas?
[23:28:44] dorei: i'm looking for smt that returns x if the input array has the form [x, x, x, ..., x, x] else nil, any ideas? i don't know x beforehand
[23:34:55] dorei: havenwood: it could be any number, i dont know which number


[14:12:42] dorei: has joined #ruby



[12:54:53] dorei: has joined #ruby


[15:57:58] dorei: has joined #ruby


[13:13:30] dorei: has joined #ruby


[14:47:25] dorei: has joined #ruby


[13:02:51] dorei: has joined #ruby


[14:18:59] dorei: has joined #ruby


[22:07:45] dorei: the error is /usr/bin/ld: cannot find -lgmp
[22:09:20] dorei: ayee: i guess you need to install the gmp dev package or whatever it's called @ ubuntu
[22:10:03] dorei: ayee: maybe this will help you,