« Back to channel list

#ruby - 19 July 2015

« Back 1 day Forward 1 day »
[00:00:35] sinkensabe: has joined #ruby
[00:01:01] j4cknewt: has joined #ruby
[00:03:11] tubuliferous_: has joined #ruby
[00:04:22] thiagovsk: has joined #ruby
[00:04:43] chouhoulis: has joined #ruby
[00:08:32] Tritone: has joined #ruby
[00:08:42] Maletor: has joined #ruby
[00:08:49] dseitz: has joined #ruby
[00:09:24] tkuchiki: has joined #ruby
[00:11:25] tubulife-: has joined #ruby
[00:11:30] bungoman: has joined #ruby
[00:13:14] mxrguspxrt: has joined #ruby
[00:14:04] quazimodo: has joined #ruby
[00:18:05] bruno-: has joined #ruby
[00:19:42] Aswebb_: has joined #ruby
[00:20:14] Azure: has joined #ruby
[00:21:30] BTRE: has joined #ruby
[00:22:45] valetudo: has joined #ruby
[00:23:39] jbw_: has joined #ruby
[00:25:30] tubuliferous_: has joined #ruby
[00:26:59] saadq: has joined #ruby
[00:27:37] Ox0dea: >> [1, 2, 3].first(&:even?)
[00:27:39] ruboto: Ox0dea # => 1 (https://eval.in/401037)
[00:32:52] acke: has joined #ruby
[00:33:03] Coraline: I had to look up why first even took an argument, but it makes sense
[00:33:28] Ox0dea: Coraline: Blocks don't count as arguments, technically.
[00:34:07] brandon: has joined #ruby
[00:34:28] Ox0dea: I realize we have #find/#detect to make that do "the right thing", but #last has no such saviors.
[00:34:43] sharpmachine: has joined #ruby
[00:34:44] eggoez: has joined #ruby
[00:35:21] shevy: raise(Invalid, 'invalid data')
[00:35:27] shevy: ^^^ is that common? or do people omit the parens
[00:35:29] Ox0dea: jhass: What would you use to find the last even element of a collection?
[00:36:11] Ox0dea: shevy: `raise` is a "command" method, like `puts`; do you use parens for `puts`? :)
[00:36:23] Coraline: [1,2,3,4,5,6,7,8].select(&:even?).last ?
[00:36:32] Ox0dea: Coraline: But that creates an intermediate array.
[00:36:33] shevy: the above is not my code, I was stumbling over that part above
[00:36:47] shevy: I think I saw the majority without parens
[00:37:19] NeverDie: has joined #ruby
[00:38:32] desigx: has joined #ruby
[00:39:48] ellisTAA: has joined #ruby
[00:41:13] Ox0dea: >> foo = [1, 2, 3]; foo[foo.rindex(&:even?)]
[00:41:14] ruboto: Ox0dea # => 2 (https://eval.in/401038)
[00:41:24] Ox0dea: I think that's the best we can do, and that's not great.
[00:41:42] Ox0dea: foo.last(&:bar) really ought to do the unsurprising thing, but then so should #first for the sake of symmetry.
[00:41:44] Coraline: Fine, then [1,2,3,4,5,6[.reverse!.find(&:even?)
[00:41:53] GitGud: has joined #ruby
[00:42:18] Ox0dea: Coraline: #[] and #rindex would be much faster than #reverse! on sufficiently large arrays.
[00:42:20] toretore: >> [1,2,3,4,5,6].reverse_each.find(&:even?)
[00:42:21] ruboto: toretore # => 6 (https://eval.in/401039)
[00:42:34] Ox0dea: But all these intermediates!
[00:42:54] Coraline: Anyway arrays are cheap
[00:43:01] toretore: reverse_each only creates an Enumerator
[00:43:25] Ox0dea: That's a good point, but it's still wordy.
[00:43:45] toretore: though rfind, rselect, etc wouldn't be out of place on Array or Enumerable
[00:44:00] Coraline: def stubborn_find(stubborn); 0.upto(stubborn.size - 1) { |e| return stubborn[stubborn.size - e] if stubborn[stubborn.size - e].even? }; nil; end
[00:44:09] toretore: not sure if rselect would make sence
[00:44:32] Ox0dea: toretore: Nah, probably not, but #rfind wouldn't go unappreciated.
[00:45:01] toretore: there's other rmethods so why not
[00:45:16] Ox0dea: I suppose I'll submit a patch and see how it goes.
[00:45:32] toretore: though i like the generality of using Enumerator
[00:46:03] toretore: instead of solve 1 problem, solve many problem
[00:47:03] toretore: even problem not have now but at later time
[00:47:23] eggoez: has joined #ruby
[00:47:40] allcentury: has joined #ruby
[00:48:01] hfp: has joined #ruby
[00:48:29] dimasg: has joined #ruby
[00:48:31] hfp_work: has joined #ruby
[00:49:27] martinium: has joined #ruby
[00:49:47] DenSchub: has joined #ruby
[00:50:40] Azure: has joined #ruby
[00:53:17] Spami: has joined #ruby
[00:59:06] Muhannad: has joined #ruby
[01:01:07] Vile`: has joined #ruby
[01:02:12] sinkensabe: has joined #ruby
[01:03:25] rgb-one: has joined #ruby
[01:05:42] Mendenhall: has joined #ruby
[01:08:04] joneshf-laptop: has joined #ruby
[01:08:50] Ox0dea: I guess #rfind isn't a thing because it'd break LSP between Array and Enumerator.
[01:09:09] Ox0dea: An Enumerator needn't have a "right" side from which to begin searching.
[01:09:46] lolmaus: has joined #ruby
[01:11:31] Spami: has joined #ruby
[01:12:12] arescorpio: has joined #ruby
[01:12:53] fabrice31: has joined #ruby
[01:14:42] Rubie: has joined #ruby
[01:17:15] charliesome: has joined #ruby
[01:17:28] Igorshp: has joined #ruby
[01:17:58] ellisTAA: has joined #ruby
[01:18:32] sross_work|2: has joined #ruby
[01:20:20] wnd_: has joined #ruby
[01:21:18] tkuchiki: has joined #ruby
[01:21:22] atomi: has joined #ruby
[01:21:44] baweaver: has joined #ruby
[01:22:04] chishiki: has joined #ruby
[01:22:14] kiki_lamb: has joined #ruby
[01:23:13] kfpratt: has joined #ruby
[01:25:12] artmann_: has joined #ruby
[01:28:19] duncannz: has joined #ruby
[01:29:00] Tritone: has joined #ruby
[01:29:37] [k-: has joined #ruby
[01:29:53] jonathanmarvens: has joined #ruby
[01:32:50] linuxboytoo: has joined #ruby
[01:33:07] celly: has joined #ruby
[01:33:40] acke: has joined #ruby
[01:33:43] Igorshp: has joined #ruby
[01:40:09] tubuliferous_: has joined #ruby
[01:40:43] raypulver: has joined #ruby
[01:42:46] raypulver: I am making a gem.. how can I expose my function as LEON:::parse(str) and LEON::stringify(v)
[01:43:03] raypulver: when you require my library
[01:43:43] chishiki: has left #ruby: ("WeeChat 1.2")
[01:43:58] iateadonut: has joined #ruby
[01:45:42] dimasg: has joined #ruby
[01:45:48] xkickflip: has joined #ruby
[01:48:55] Ox0dea: raypulver: module Leon; def self.parse(str) ...
[01:49:36] [k-: Ox0dea that doesn't work
[01:50:00] [k-: you need to def Leon.parse explicitly
[01:50:01] rgb-one: anyone know how to center an image in css?
[01:50:06] [k-: based on my experience
[01:50:09] ruboto: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[01:50:34] [k-: also Hi Ox0dea!
[01:50:35] rgb-one: anyone know any web development channels?
[01:50:44] Ox0dea: [k-: Heya!
[01:51:01] Ox0dea: >> module Foo; def self.bar; 42 end end; Foo.bar
[01:51:03] ruboto: Ox0dea # => 42 (https://eval.in/401045)
[01:51:07] Ox0dea: [k-: Come on, guy. :P
[01:51:34] [k-: it never seemed to work? :(
[01:51:52] Ox0dea: raypulver: Lutz's Evil Object Notation?
[01:52:35] zenspider: Ox0dea: unsurprising to whom? it'd be surprising to me if first was an alias for find
[01:52:43] ellisTAA: has joined #ruby
[01:52:48] Ox0dea: zenspider: Yes, I've reconsidered.
[01:52:49] Averna: has joined #ruby
[01:53:30] tkuchiki: has joined #ruby
[01:53:44] [k-: oh oh oh, since Obfuscate was a hash, that's why def self.encode didn't work!
[01:53:53] [k-: I'm such a dummy :)
[01:54:14] [k-: wait, I tried declaring it in a module in the first place
[01:54:57] [k-: https://gist.github.com/SkyBirdSoar/2d1267be7661d1ee0803#file-1-libobf-rb-L232
[01:57:59] [k-: it works in eval.in when I change it to self >_>
[01:58:39] zenspider: jesus. my eyes.
[01:58:59] Ox0dea: I think it's beautiful.
[01:59:10] Channel6: has joined #ruby
[01:59:24] Ox0dea: Terrible, but beautiful.
[01:59:38] tubuliferous_: has joined #ruby
[01:59:45] icebourg: has joined #ruby
[01:59:59] zenspider: at least my obfuscator compiled to C
[02:00:03] mike___1234: has joined #ruby
[02:00:15] [k-: the encode part is an example itself!
[02:01:33] RandyT: has joined #ruby
[02:03:04] radialneon: has joined #ruby
[02:03:18] sinkensabe: has joined #ruby
[02:03:23] Ox0dea: zenspider: I trust you're not referring to transmogrify?
[02:04:13] [k-: which aspect were you referring to when you said terrible
[02:04:52] zenspider: no, transmogrify was just a joke. zenobfuscate
[02:05:12] [k-: apeiros showed me that :o
[02:05:31] htmldrum: has joined #ruby
[02:05:56] Feyn: has joined #ruby
[02:06:27] charliesome: has joined #ruby
[02:06:34] zenspider: showed you what?
[02:06:49] [k-: zenobfuscate
[02:07:06] zenspider: ... it was never released
[02:07:17] [k-: your blog posts*
[02:07:34] zenspider: ah. yes. it was announced. got a couple ppl interested, but not enough to pay for it.
[02:07:48] Spami: has joined #ruby
[02:08:34] Aswebb_: has joined #ruby
[02:09:00] prestorium: has joined #ruby
[02:09:33] chridal: has joined #ruby
[02:10:18] zacstewart: has joined #ruby
[02:10:31] mesamoo: has joined #ruby
[02:11:35] [k-: I don't think I want to use common lisp
[02:11:39] [k-: seems like bloat!
[02:12:02] [k-: that was what I was thinking
[02:12:44] Ox0dea: [k-: Use Clojure.
[02:12:59] [k-: JVM is fat
[02:13:02] ValicekB: has joined #ruby
[02:13:10] Ox0dea: You only need the one.
[02:13:23] [k-: but I was thinking clojure anyway \o/
[02:13:54] [k-: but I would like to have static typing
[02:13:57] Ox0dea: [k-: It's dangerous to go alone. Here, take this: https://github.com/ninjudd/drip
[02:14:01] [k-: I grew fond of it
[02:14:09] Ox0dea: [k-: clojure/core.typed is good and getting better.
[02:15:05] [k-: is it inferrable :>
[02:15:10] Ox0dea: Sometimes.
[02:15:19] [k-: I'm bookmarking that
[02:15:19] Thomas-0725: has joined #ruby
[02:15:20] jack_rabbit: has joined #ruby
[02:15:30] Ox0dea: Haskell's type system was bound to spoil you.
[02:15:49] [k-: it's so amazing!
[02:15:56] Ox0dea: It's pretty great.
[02:16:39] [k-: I think it's currently the best, no?
[02:17:54] Ox0dea: The hour is odd enough that we shouldn't need fire extinguishers.
[02:18:03] [k-: I think I'll learn rust before though
[02:18:21] iooner: has joined #ruby
[02:18:48] [k-: I'm guessing it is far late into the night
[02:19:43] Maletor: has joined #ruby
[02:21:40] sankaber: has joined #ruby
[02:22:41] PhantomS_: has joined #ruby
[02:23:30] tyrbo: has joined #ruby
[02:23:58] tyrbo: has joined #ruby
[02:25:04] jbwiv: has joined #ruby
[02:26:31] lorikeet: has joined #ruby
[02:29:12] closer: has joined #ruby
[02:31:53] dopie: has joined #ruby
[02:35:49] nettoweb: has joined #ruby
[02:37:18] jack_rabbit: has joined #ruby
[02:38:11] nettoweb_: has joined #ruby
[02:42:59] Thomas-0725: has joined #ruby
[02:43:55] miwood: has joined #ruby
[02:46:43] bnizzle: has joined #ruby
[02:51:03] SpikeMaster: has joined #ruby
[02:51:25] SpikeMaster: has left #ruby: ()
[02:51:27] odlox: has joined #ruby
[02:51:30] jbw_: has joined #ruby
[02:51:34] [k-: yay! https://github.com/adobe-fonts/source-code-pro/releases/tag/2.010R-ro/1.030R-it
[02:52:49] zacstewart: has joined #ruby
[02:55:57] Ox0dea: [k-: Is that the font you use?
[02:56:31] [k-: no, I'm too lazy to install it, it should be somewhere in my computer though
[02:56:43] [k-: I don't remember :P
[02:56:52] [k-: I tried it once on linux
[02:56:56] [k-: it was amazing!
[02:57:16] [k-: (but now I am on osx)
[02:57:46] mxrguspxrt: has joined #ruby
[02:57:58] Coraline: I like Consolas on OS X
[02:58:23] [k-: I haven't tried other fonts on os x
[02:58:29] [k-: but they do look very nice
[02:58:45] [k-: OS x basically ships with the nicest fonts ever
[02:59:20] Ox0dea: [k-: Do you even Infinality?
[03:00:29] Channel6: has joined #ruby
[03:00:31] Ox0dea: Well, there's your problem. :)
[03:01:03] davedev24: has joined #ruby
[03:01:19] [k-: OSX probably does it better >:3
[03:01:22] Ox0dea: OSX's font configuration is obviously top-notch, but Infinality brings freetype2 very close.
[03:02:15] [k-: should I bookmark it :o
[03:04:08] sinkensabe: has joined #ruby
[03:07:01] Ox0dea: [k-: Do you plan on ditching OSX?
[03:07:24] sankaber: has joined #ruby
[03:07:38] [k-: other OSes dont really work well on a Mac book
[03:07:42] lessless: has joined #ruby
[03:07:55] [k-: Macbook*
[03:08:22] [k-: probably irritated a lot of people here accidentally leaving a space there ;)
[03:08:52] Ox0dea: [k-: Plenty of folks dual- or even triple-boot on their Macs.
[03:09:10] Ox0dea: Well, I suppose "plenty" is stretching it, but it's been done.
[03:09:19] PapaSierra: has joined #ruby
[03:09:26] [k-: the trackpad doesn't work very well on other os
[03:09:49] [k-: I get very irritated by the trackpad
[03:09:54] pizzaops: Can't dual boot if you use filevault and not using filevault is nuts.
[03:10:46] braincrash: has joined #ruby
[03:11:10] Ox0dea: [k-: But it's configurable!
[03:11:11] matcouto: has joined #ruby
[03:11:14] Ox0dea: It's all configurable.
[03:11:26] [k-: I tried configuring it, not satisfactory
[03:11:41] [k-: but I am a noob so >.<
[03:11:48] jbwiv: has joined #ruby
[03:12:55] Ox0dea: The Arch Wiki would've had your back. :/
[03:12:58] Ox0dea: Shame we lost ya.
[03:13:12] [k-: I don't use arch :o
[03:13:38] fabrice31: has joined #ruby
[03:14:11] desigx: has joined #ruby
[03:14:28] [k-: I tried deepin
[03:14:35] [k-: I'm a fan of ui :)
[03:14:43] dimasg: has joined #ruby
[03:15:26] Ox0dea: [k-: http://papyros.io/
[03:16:01] [k-: you know just what I want!
[03:16:06] jbw_: has joined #ruby
[03:16:23] gambl0re: has joined #ruby
[03:17:09] Ox0dea: It's pretty much Arch x Android.
[03:17:23] Ox0dea: A nifty combination, if you're into those sorts of thing.
[03:19:21] acke: has joined #ruby
[03:19:42] The_Phoenix: has joined #ruby
[03:20:26] [k-: deepin still looks better though >.<
[03:23:51] [k-: haskell has ".c" `isSuffixOf` "hello.c"; I think it would be better if they provided "hello.c" `hasSuffix` ".c" tho
[03:24:10] [k-: wouldn't it look much more natural
[03:25:20] iateadonut: has joined #ruby
[03:25:41] mary5030: has joined #ruby
[03:26:00] [k-: it depends on the use case tho
[03:26:31] [k-: maybe the second one could be for handling multiple extensions
[03:26:32] ellisTAA: has joined #ruby
[03:26:43] [k-: while the first is for checking if the extension is correct
[03:27:01] Ox0dea: [k-: The order is as it is to permit a more useful partial evaluation.
[03:28:36] [k-: I am probably influenced by String#end_with?
[03:28:53] kfpratt: has joined #ruby
[03:29:23] linuxboytoo: has joined #ruby
[03:30:22] Ox0dea: It makes sense for object-oriented languages to "parameterize" in the other direction.
[03:30:28] prestorium: has joined #ruby
[03:31:13] Ox0dea: Of course, that tends to make their constructs less general, which is why functional is best.
[03:31:17] Channel6: has joined #ruby
[03:31:44] [k-: i like how you said functional is best at the end ^^
[03:32:17] [k-: *The Oracle sides with functional*
[03:32:19] konsolebox: has joined #ruby
[03:32:23] Ox0dea: endsWithFoo = isSuffixOf "foo" vs. foo_ends_with = "foo".method(:end_with?)
[03:32:25] Ox0dea: The winner is clear.
[03:33:21] [k-: they don't do the same thing :s
[03:33:35] Ox0dea: No, they don't, but they're both "natural" in their respective languages.
[03:33:44] Ox0dea: It's just that the former is much more useful than the latter.
[03:34:35] htmldrum: has joined #ruby
[03:37:13] Rubie: has joined #ruby
[03:37:26] lkba_: has joined #ruby
[03:37:47] dimasg: has joined #ruby
[03:39:02] Rubie: has joined #ruby
[03:41:34] jbwiv: has joined #ruby
[03:41:55] eggoez: has joined #ruby
[03:42:17] Ox0dea: [k-: Show me your fooEndsWith?
[03:43:40] [k-: fooEndsWith s = flip isSuffixOf "foo"
[03:43:59] Ox0dea: [k-: Why the explicit argument?
[03:44:23] [k-: I'm not an expert yet!
[03:46:28] [k-: s `isSuffixOf` "foo" is clearer though
[03:47:11] [k-: ACTION makes a mental note that point free isn't always the best
[03:47:33] Ox0dea: [k-: You got the order backwards. :P
[03:47:41] Ox0dea: ACTION maintains his position on point-free.
[03:47:47] tubuliferous_: has joined #ruby
[03:48:04] dimasg: has joined #ruby
[03:48:07] [k-: I typed more on that example!
[03:48:28] [k-: like, 1 character more
[03:48:50] [k-: the point free version
[03:49:18] ellisTAA: has joined #ruby
[03:49:21] _blizzy_: has joined #ruby
[03:49:54] Ox0dea: Oh, never mind; I forgot we'd switched to fooEndsWith.
[03:50:11] CloCkWeRX: has joined #ruby
[03:51:04] Ox0dea: Yes, the infix version certainly reads better, but that's not an argument against point-free.
[03:51:24] Mendenhall: has joined #ruby
[03:51:45] [k-: come up with a better point free version then :>
[03:52:22] Ox0dea: [k-: Yours is already point-free; you just need to remove the explicit argument.
[03:53:25] Ox0dea: That's... why I asked why you were using it?
[03:53:40] desigx: has joined #ruby
[03:54:16] [k-: I wanted to go with s `isSuffixOf` "foo" first
[03:54:24] [k-: but I changed my mind midway
[03:54:45] darkf: has joined #ruby
[03:54:46] Ox0dea: I think you did the right thing. :P
[03:54:53] duncannz: has joined #ruby
[03:55:04] CloCkWeRX1: has joined #ruby
[03:55:06] gix: has joined #ruby
[03:55:11] [k-: does s = `isSuffixOf` "foo" work by any chance
[03:55:43] duncannz: has joined #ruby
[03:55:52] arup_r: has joined #ruby
[03:56:13] Ox0dea: There's no LHS there.
[03:56:37] duncannz: has joined #ruby
[03:57:17] [k-: but (/2) works
[03:57:25] Aswebb_: has joined #ruby
[03:57:32] duncannz: has joined #ruby
[04:01:48] casadei_: has joined #ruby
[04:02:41] htmldrum: has joined #ruby
[04:03:01] user1138: has joined #ruby
[04:04:52] sinkensabe: has joined #ruby
[04:06:21] bosma: has joined #ruby
[04:06:36] chinmay_dd: has joined #ruby
[04:08:37] Ox0dea: [k-: I don't know the exact semantics, but symbol functions are special: https://gist.github.com/0x0dea/63df1b6c75e347529a7b
[04:10:27] [k-: Ox0dea you are doing d 2 4
[04:10:38] [k-: which is 2 `d` 4
[04:10:47] [k-: you aren't doing (/2)!
[04:11:15] fromthedepths: has joined #ruby
[04:11:22] [k-: I asked for `d` 2 :)
[04:11:29] Ox0dea: Right, so symbol functions fix differently?
[04:11:39] [k-: yes, they are infix by default
[04:11:47] [k-: actually they are always infix
[04:12:34] Ox0dea: That's the rub of it, I think.
[04:12:52] Ox0dea: You can alias d to (/) and it'll behave differently.
[04:12:59] [k-: doing (d 2) doesn't turn it infix :)
[04:13:15] [k-: it will return a curried function
[04:13:30] dimasg: has joined #ruby
[04:13:31] [k-: that divides 2 by a numbet
[04:14:32] [k-: I like how you called it wtf.hs :p
[04:14:49] Ox0dea: How do you define d such that (d 2) 4 == 2?
[04:15:27] [k-: flip (/)?
[04:15:55] Ox0dea: From scratch, I mean.
[04:16:23] Ox0dea: I suppose I naively assumed an "alias" would inherit fixation.
[04:16:50] ndrei: has joined #ruby
[04:17:10] [k-: how do you even implement /
[04:17:27] Ox0dea: It's just x / y = x * (1 / y) in Prelude.
[04:17:34] Thomas-0725: has joined #ruby
[04:17:52] [k-: but that's recursive!
[04:18:06] Ox0dea: Yay, Haskell!
[04:18:06] zacstewart: has joined #ruby
[04:18:46] [k-: does that even work :/
[04:18:51] rickmasta: has joined #ruby
[04:19:23] Ox0dea: http://hackage.haskell.org/package/base-4.8.0.0/docs/src/GHC-Real.html#line-171
[04:19:33] [k-: 1/y is 1*(1/y) :/
[04:19:45] Ox0dea: I'm sure their being inlined has something to do with everything holding together.
[04:20:52] [k-: you are looking at the class definition
[04:20:59] [k-: not the instance definition :/
[04:21:31] [k-: class Eq defines == as not (/=)
[04:21:45] [k-: and /= as not ==
[04:21:51] [k-: you can see how that goes
[04:23:16] [k-: Ox0dea: you need more sleep :3
[04:23:40] Ox0dea: [k-: Wait, I thought we were talking about (/)?
[04:23:45] Ox0dea: Why've you mentioned (==) and (!=)?
[04:24:03] Channel6: has joined #ruby
[04:24:16] [k-: because you are confused!
[04:24:40] [k-: class definitions provide the *default* implementation
[04:24:45] [k-: and the don't always make sense
[04:26:07] Ox0dea: Perhaps my link didn't take you to the right place?
[04:26:42] [k-: it took me to class (Num a) => Fractional a
[04:27:11] Ox0dea: It should've taken you right to the definition of (/), which is implemented in terms of recip, which are both inlined.
[04:27:36] [k-: it's still under the class definition >.>
[04:28:03] [k-: {-# MINIMAL fromRational, (recip | (/)) #-}
[04:28:26] [k-: this line states that you must implement either recip or (/)
[04:28:40] [k-: so that shows us they refer to each other
[04:28:57] [k-: it's the class Eq situation that I just stated :/
[04:29:48] [k-: don't you see that (==) = not (/=) becomes (==) = not (not (==)) and that goes on forever?
[04:30:42] bruno-: has joined #ruby
[04:32:01] matcouto: has joined #ruby
[04:32:42] arup_r: Using Ruby's Net::HTTP module can I send Redirect URL after doing a POST requst?
[04:32:45] Ox0dea: Ah, right, I derped pretty hard there.
[04:33:00] Ox0dea: [k-: But, then, how *do* you even implement (/)?
[04:33:24] jbw_: has joined #ruby
[04:33:33] [k-: https://hackage.haskell.org/package/ghc-prim-0.3.1.0/docs/GHC-Prim.html
[04:33:38] [k-: could be here
[04:34:31] Ox0dea: arup_r: Redirection must be done by the response, not the request.
[04:34:54] Ox0dea: The response needs simply to provide a value for the Location header.
[04:35:27] Ox0dea: [k-: There's no implementation of (/) in there.
[04:36:01] [k-: it's here: https://hackage.haskell.org/package/base-4.4.1.0/docs/src/GHC-Float.html
[04:36:17] cornerman: has joined #ruby
[04:36:46] bigmac: has joined #ruby
[04:38:27] arup_r: Ox0dea, any example how to set location while doing POST ? Just a small example.
[04:38:39] [k-: divideDouble could be anywhere dear friend :3
[04:39:09] Ox0dea: Aye, but I reckon I caught the gist.
[04:39:19] Ox0dea: arup_r: You can't. It's up to the response.
[04:39:33] [k-: actually dividedouble leads to /## :/
[04:39:35] arup_r: I am trying to code : https://gist.github.com/aruprakshit/43f0d622399b4d8de799#comment-1495805
[04:39:46] arup_r: REDIRECT=<Merchant Receipt URL>?paymentID=<Payment ID>
[04:40:17] Ox0dea: arup_r: Do you control the response?
[04:41:33] djbkd_: has joined #ruby
[04:41:34] htmldrum: has joined #ruby
[04:41:36] arup_r: Yes, I do. But processing response data and saving into DB I need to send the PG again a request as they said in the link I gave
[04:42:23] iateadonut: has joined #ruby
[04:42:25] arensburgh: has joined #ruby
[04:43:00] Ox0dea: arup_r: Do you want to perform an HTTP redirect, or is this some Knet-specific mechanism?
[04:43:19] Feyn: has joined #ruby
[04:44:25] arup_r: actually that small paragraph not telling much.. where to send.. I am bit confused.
[04:45:05] _blizzy_: has joined #ruby
[04:45:22] Ox0dea: Well, if you wish to perform an automatic HTTP redirect, you must set the Location header in the response.
[04:45:26] [k-: Ox0dea: https://www.fpcomplete.com/blog/2015/02/primitive-haskell might shed some light on this
[04:46:06] Ox0dea: [k-: But how to define d from scratch such that (d 2) 4 == 2?
[04:46:06] Yiota: has joined #ruby
[04:46:47] [k-: flip (/)!
[04:46:52] Ox0dea: That's not scratch!
[04:47:35] [k-: d x y = let scratch = flip (/) in scratch x y
[04:47:47] tjbiddle: has joined #ruby
[04:48:04] Marsupermammal: has joined #ruby
[04:48:26] [k-: doing (d 2) 4 is the same as d 2 4
[04:48:41] Ox0dea: Except not for (/).
[04:48:58] Ox0dea: Because of its left-fixity of 7?
[04:49:22] [k-: function application has the highest precedence
[04:49:40] [k-: fixity applies to symbols only
[04:49:54] Ox0dea: infixl 7 `d`
[04:50:09] acke: has joined #ruby
[04:50:13] [k-: :/ does that even do anything
[04:50:19] Ox0dea: Apparently not.
[04:50:39] Ox0dea: In short, it's impossible to define a d function that behaves exactly like (/), right?
[04:50:51] [k-: symbols are automatically infix
[04:50:51] [k-: they do not need to be declared infix
[04:50:58] Maletor: has joined #ruby
[04:51:00] [k-: unless `d`
[04:51:22] Ox0dea: I guess that makes sense.
[04:51:55] Ox0dea: It seems like an arbitrary restriction.
[04:52:27] [k-: Ox0dea I win!
[04:52:32] [k-: ????let??d??=??(/)??in??(`d`??2)??4
[04:52:57] Ox0dea: Right, but not (d 2), because math reasons.
[04:52:58] [k-: if you would just try out my `d` suggestion in the first place
[04:53:34] casadei_: has joined #ruby
[04:54:06] [k-: d :: Int -> Int -> Int; d 2 :: Int -> Int; d 2 4 :: Int
[04:54:40] [k-: d 2 supplies the first argument to d
[04:54:52] [k-: (d 2) doesn't change that
[04:55:17] [k-: we have map (\x y -> do something with x and y) xs
[04:55:32] [k-: if it did, this would be chaos
[04:55:41] [k-: at least I think so
[04:56:14] Ox0dea: I guess I'm just trying to get clear on why non-symbol functions can't be given fixity.
[04:56:49] [k-: fixity applies for infix only :/
[04:57:23] [k-: symbols are always infix so (+3) works because (`add` 3) does too
[04:58:26] Ox0dea: Oh, I'm derping again; non-symbolic infix operators would beget terribly ambiguity.
[04:58:31] Ox0dea: *terrible
[04:59:01] [k-: scala more or less
[05:02:42] Ox0dea: Sp4rKy: I know exactly what went wrong there.
[05:02:43] ellisTAA: has joined #ruby
[05:03:01] Ox0dea: Stupid big-ass right Shift key.
[05:03:17] [k-: is that scala
[05:03:26] Sp4rKy: that's it :D and not enough coffee probably :)
[05:03:52] matcouto: has joined #ruby
[05:03:52] [k-: unfortunately I do not know Scala
[05:04:06] Ox0dea: [k-: /w is Sp4rKy's alias for switching windows in his IRC client.
[05:04:26] Ox0dea: / is right next to right Shift on many keyboards.
[05:04:46] [k-: how is that even Scala
[05:05:09] ruboto: [k-, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[05:05:39] sinkensabe: has joined #ruby
[05:05:42] [k-: we have been off topic for hours
[05:05:46] iateadonut: has joined #ruby
[05:05:59] Ox0dea: Nobody's around to phone the authorities.
[05:06:17] Nilium: Off topic? Allow me to complain about how hard it is to use proportional fonts in code editors.
[05:06:21] Nilium: It's really hard.
[05:06:55] [k-: the sudden allowance of off topic!
[05:07:54] Ox0dea: Nilium: What madness overcomes you that you find yourself with such a problem?
[05:08:31] Nilium: The desire to have nice, pretty text.
[05:09:12] [k-: haskell will solve some of your problems!
[05:10:04] ellisTAA: has joined #ruby
[05:11:22] symm-: has joined #ruby
[05:11:56] [k-: newtype IO a = IO (State# RealWorld -> (# State# RealWorld, a #))
[05:13:33] nisstyre: has joined #ruby
[05:13:56] [k-: I'm not ready to look at this...
[05:13:59] fenjamin: has joined #ruby
[05:14:09] nisstyre: has joined #ruby
[05:14:20] fabrice31: has joined #ruby
[05:15:08] bigmac: has joined #ruby
[05:16:25] irk: has joined #ruby
[05:16:49] Thomas-0725: has joined #ruby
[05:18:01] fenjamin: merely curious: perhaps in an exercise of DRY programming if the program understandably does what's expected, there are zero bugs, why then must methods be named consistent with the program? the method names can be gibberish, in other words
[05:18:48] Nilium: Every time I look at Haskell it just convinces me that yeah, no, I'm not smart enough for this.
[05:18:52] fenjamin: other than it helps others to read the program (which people can infer about how it works even if the methods are gibberish?
[05:19:11] Nilium: fenjamin: DRY says nothing of naming, so far as I'm concerned.
[05:19:23] Nilium: Not repeating yourself is just not repeating yourself.
[05:19:34] [k-: Benjamin: read this https://github.com/SkyBirdSoar/libobf/blob/master/examples/example.rb
[05:19:43] [k-: fenjamin*
[05:20:05] [k-: Nilium you are!
[05:20:19] [k-: everything takes time to learn
[05:20:38] [k-: I don't even know how I learnt 1+1
[05:20:51] fenjamin: [k thanks for clarifying
[05:21:17] fenjamin: inference has its limits
[05:21:22] [k-: you are welcome :>
[05:21:38] [k-: that 100% runs
[05:21:47] [k-: it's legal Ruby!
[05:22:42] _blizzy_: has joined #ruby
[05:22:50] fenjamin: free of dependencies?
[05:23:13] Ox0dea: fenjamin: Programs are written to be read as well as executed; what benefit to giving things meaningless names?
[05:23:55] [k-: well you need to require the library in lib/libobf.rb first
[05:24:21] greenride: has joined #ruby
[05:24:28] fenjamin: where's that?
[05:24:59] [k-: https://gist.github.com/SkyBirdSoar/2d1267be7661d1ee0803
[05:25:03] ledestin: has joined #ruby
[05:25:05] [k-: it's here
[05:25:16] Ox0dea: fenjamin: Are you familiar with FizzBuzz? ;P
[05:25:39] [k-: oooooo he's gonna do it!
[05:25:50] [k-: do it Ox0dea!
[05:25:57] Ox0dea: The pieces must be in place.
[05:26:03] Ox0dea: Lest nothing shall be learnt.
[05:26:07] Muhannad: has joined #ruby
[05:26:18] ellisTAA: has joined #ruby
[05:28:01] Thomas-0725: has joined #ruby
[05:29:12] nofxx: >> puts (1..5).map { |i| (fb = [["Fizz"][i % 3], ["Buzz"][i % 5]].compact.join).empty? ? i : fb }
[05:29:13] ruboto: nofxx # => 1 ...check link for more (https://eval.in/401078)
[05:29:18] nofxx: there's a smaller one somewhere
[05:29:20] Blaguvest: has joined #ruby
[05:29:57] ellisTAA: has joined #ruby
[05:30:06] fenjamin: yes I'm finding something with explicit naming conventions it can become a "who's on first" routine
[05:30:29] nofxx: there was this site, backed by ibm iirc, with some challenges that you could compile & run in a bunch of langs
[05:30:39] DenSchub: has joined #ruby
[05:30:53] mary5030: has joined #ruby
[05:31:43] [k-: that's a cool way to do fizzbuzz
[05:32:16] Ox0dea: We golfin'?
[05:32:37] Ox0dea: fenjamin: That's what namespaces are for.
[05:32:53] [k-: dundundun you have triggered Ox0dea!
[05:34:12] fenjamin: ox0dea: ::?
[05:34:26] fenjamin: Ox0dea: ::?
[05:34:51] Ox0dea: fenjamin: Well, yes, that's the resolution operator.
[05:35:11] Ox0dea: foo.compact.join == foo*'' if foo is an array of maybe strings.
[05:35:22] ruboto: [k- # => /tmp/execpad-a76eadcb3df8/source-a76eadcb3df8:3: syntax error, unexpected keyword_rescue, expecting ...check link for more (https://eval.in/401079)
[05:35:26] Ox0dea: >> ['Fizz', nil] * ''
[05:35:27] ruboto: Ox0dea # => "Fizz" (https://eval.in/401080)
[05:35:56] tubuliferous_: has joined #ruby
[05:35:58] Ox0dea: >> 1::to_s # ogodwhy
[05:35:59] ruboto: Ox0dea # => "1" (https://eval.in/401081)
[05:36:32] [k-: $-o::[](?.)
[05:36:41] Ox0dea: It'll work.
[05:36:52] [k-: abooooooose
[05:37:15] [k-: adding that to the tips and tricks section later
[05:37:38] [k-: # how to avoid name spacing issues
[05:37:46] [k-: # do it the JavaScript way
[05:38:10] [k-: -> {# your things here}.call()
[05:39:49] fenjamin: if i understand correctly namespacing is organizationally nesting methods?
[05:39:54] zenspider: *sigh* always saddens me when I see fizz buzz.
[05:39:57] Ox0dea: fenjamin: Nesting anything, really.
[05:40:14] Ox0dea: [k-: All my non-alphanumeric sillinesses use IIFEs.
[05:40:18] fenjamin: Ox0dea: you're a treasure
[05:40:41] Ox0dea: Immediately-invoked function expressions.
[05:40:52] lkba: has joined #ruby
[05:40:57] [k-: ._. how would I resolve that
[05:41:10] fenjamin: without using |x|
[05:41:31] [k-: IIFE isn't defined as immediately-invoked function expressions in my book
[05:41:37] havenwood: has joined #ruby
[05:41:40] [k-: hence, I can't resolve it
[05:41:46] fenjamin: {|x| x p y} rather
[05:41:50] riotjones: has joined #ruby
[05:41:55] Ox0dea: [k-: I'm not sure I follow.
[05:42:20] Ox0dea: [k-: Did you accidentally your_book.freeze?
[05:42:44] [k-: I am unable to understand what you mean by IIFE when you suddenly threw it at me
[05:43:08] Ox0dea: But... it's the first result.
[05:43:44] Ox0dea: And you were already familiar with the concept.
[05:43:54] [k-: wow... indeed it is
[05:44:20] [k-: that's because I use jquery!
[05:45:03] greenride: In the following snippet of code, how can the environment of the first block be changed such that it's variable definitions are available in the rest of the method? https://dpaste.de/MApc
[05:45:45] [k-: that's a cool code pasting site
[05:45:46] Ox0dea: greenride: You'd have to declare inner_object outside of the block.
[05:46:20] Aswebb_: has joined #ruby
[05:46:56] greenride: Ox0dea: Isn't there some way to use binding to modify the scope in which that block's code runs?
[05:47:16] jbw_: has joined #ruby
[05:47:26] zenspider: greenride: *sigh* why?
[05:47:38] [k-: you have to eval first....
[05:47:50] greenride: zenspider: I'll construct an example. One sec.
[05:48:16] [k-: he doesn't want to see it...
[05:50:54] zenspider: "how do I violate nice clean scoping rules? preferably... rectally?"
[05:51:56] Ox0dea: It's fitting that your nick hashes to a shade of jade.
[05:51:59] [k-: :<; :^)*
[05:54:39] greenride: zenspider: https://dpaste.de/L0bh What if I have the following method, and I want to benchmark the time for each line in this method? If I use the Benchmark library, I have to ensure every variable defined within the block is defined outside the block. That's the problem I'm trying to avoid.
[05:54:50] pepperbreath: has joined #ruby
[05:55:18] zenspider: greenride: above it you put a = b = c = d = nil
[05:55:40] zenspider: don't be clever with bindings. be explicit about what you're doing. do the simplest thing that could possibly work
[05:55:49] zenspider: also, use better tools to figure out where your benchmarks are
[05:55:58] Ox0dea: greenride: Alternatively, there's a gem for that: https://github.com/niklasb/ruby-dynamic-binding
[05:56:03] Channel6: has joined #ruby
[05:56:10] zenspider: Ox0dea: do you _have_ to?
[05:56:59] Ox0dea: _why not?
[05:57:07] greenride: zenspider: It seems strange to me that I need to identify every single variable and set it to nil as the very first line.
[05:57:14] Aeyrix: has joined #ruby
[05:57:33] nofxx: expect(Foo).to be or to_not be
[05:57:36] nofxx: that's the spec
[05:57:52] afrianska: has joined #ruby
[05:57:53] [k-: Ox0dea highly tempting!
[05:58:10] xkickflip: has joined #ruby
[05:58:15] [k-: this will be a great addition!
[05:58:29] greenride: zenspider: Also, if my goal is to benchmark every single line in an arbitrary method; will the approach of setting all local variables to nil as the first line always work?
[05:58:52] zenspider: greenride: all you're doing is declaring the variables at the top (relevant) scope.
[05:59:12] Ox0dea: [k-: You might also enjoy binding_of_caller.
[05:59:25] [k-: greenride: there are profiling tools in Ruby
[05:59:39] orbitalo: has joined #ruby
[06:00:58] Ox0dea: greenride: Do it dynamically! Use RubyVM::InstructionSequence.of(foo), programmatically extract each line of the method, then benchmark them while also mutating some object that holds the last return value.
[06:01:05] [k-: huehuehue
[06:02:03] Ox0dea: greenride: It'd probably be much easier just to benchmark every single expression if you wound up taking that path, though.
[06:02:44] zenspider: Radar: can we mute bad idea generators who don't prefix their bad ideas as such?
[06:03:03] [k-: I bet 10 bucks that Ox0dea did that before!
[06:03:29] Ox0dea: Nah, Ruby's iseqs are pretty gnarly.
[06:03:47] [k-: there goes 10 bucks :(
[06:04:06] Ox0dea: I *did* try to modify and execute one, which seems to have been doable at some point, but it's no longer kosher.
[06:04:35] zenspider: you can with some fiddle code to make a C entrypoint public
[06:05:00] Ox0dea: zenspider: It's commented out in trunk.
[06:05:25] Ox0dea: RubyVM::InstructionSequence#load, I mean.
[06:05:51] acke: has joined #ruby
[06:06:23] sinkensabe: has joined #ruby
[06:07:04] Ox0dea: I am derping all over the place. The function is still defined, but I wonder whether its being cast to void causes it to be optimized out of the final binary.
[06:08:02] zenspider: in my build I see: 0000000100171920 t _iseq_build_load_iseq
[06:09:01] [k-: if you want to modify code on the fly you are treating code as data!
[06:09:09] [k-: time for a lisp!
[06:10:16] Ox0dea: zenspider: iseq_build_load_iseq() calls rb_iseq_load(), which is in the symbol table, but that calls iseq_load(), which is not.
[06:10:38] zenspider: is for me... it seems
[06:11:36] greenride: zenspider: The problem with putting something like a = b = c = nil at the top of the method where a, b, and c are the local variables is that it can change the output.
[06:12:05] Ox0dea: greenride: Assignment is not your bottleneck, bud.
[06:12:10] greenride: Ox0dea: I'm thinking/google through your suggestions.
[06:12:26] Ox0dea: greenride: As evinced by zenspider's chewing me out, I was mostly fucking with you.
[06:12:31] [k-: cey cry weeping sounds
[06:12:49] zenspider: change it how? if you have bad logic for nils, then use the right starting value
[06:13:23] greenride: Ox0dea: I'm not worried about assignment being the performance bottleneck. I'm concerned about conditionals such as b = (defined? a) ? 2 : 3.
[06:13:54] greenride: Ox0dea: Granted, people shouldn't write code like that, but I'm looking for a 'correct' method.
[06:14:29] [k-: http://www.synbioz.com/blog/optimize_ruby_code
[06:15:00] [k-: this, is profiling
[06:15:05] [k-: pls don't do it your way
[06:15:34] Ox0dea: greenride: Whom do you suppose will have need of your "benchmark every line" library?
[06:16:24] greenride: The set of users is probably limited.
[06:16:29] Ox0dea: It might even be one.
[06:16:40] zenspider: I'm shooting for zero here
[06:16:43] greenride: Yes, that's a lower bound.
[06:16:46] zenspider: do we have negative one?
[06:16:47] [k-: write it in libobf!
[06:16:50] zenspider: negative two??
[06:17:26] zenspider: greenride: you're trying to generalize this
[06:18:34] yardenbar: has joined #ruby
[06:20:32] greenride: zenspider: Yes.
[06:21:05] zenspider: and you're thinking about lines of code?
[06:21:07] greenride: zenspider: The obvious way is to get the time before and after a line of code. Then, find the difference.
[06:21:11] zenspider: and you're not doing flow analysis on those variables and where they're used?
[06:21:17] zenspider: You're doomed.
[06:21:19] zenspider: Either do the simple thing I suggested for your one-time "profiling", or be prepared for pain.
[06:21:46] zenspider: what; about; this; line ?
[06:21:50] zenspider: lines mean nothing
[06:22:10] Ox0dea: greenride: For what it's worth, there are several excellent Ruby parsers.
[06:22:46] nullsides: has joined #ruby
[06:23:02] jbwiv: has joined #ruby
[06:25:25] greenride: Ox0dea: What would a Ruby parser help me do in this case?
[06:25:41] nofxx: %?() what's the '?' for symbols again?
[06:25:47] htmldrum: has joined #ruby
[06:25:56] Ox0dea: nofxx: i and I.
[06:26:07] nofxx: Ox0dea, thanks!
[06:26:15] lavros: has joined #ruby
[06:26:16] [k-: oh he meant ? as in a wildcard
[06:26:17] Ox0dea: greenride: You've been advised of the futility of benchmarking lines.
[06:26:21] [k-: I was confused
[06:26:29] Ox0dea: [k-: Took me a second as well.
[06:26:50] [k-: it took you a second but I remained confused!
[06:26:53] nofxx: Don't remember the name of this sourcery
[06:27:08] Ox0dea: nofxx: I call them symbol array literals.
[06:27:11] nofxx: array magic spell #8
[06:27:19] xkickflip: has joined #ruby
[06:27:27] [k-: percent literals
[06:27:34] [k-: they are called percent literals
[06:27:49] Ox0dea: Aye, but what do you call the ones that're specfically for symbols?
[06:27:59] nofxx: yeah percent array thing
[06:28:19] [k-: the percent literal specifically for constructing an array of symbols
[06:28:42] [k-: or, shorthand for array filled with symbols
[06:29:04] nofxx: percent array symbol spell
[06:29:33] [k-: that makes no sense to me
[06:29:37] Rubie: has joined #ruby
[06:29:43] [k-: the spell part will throw people ofr
[06:29:45] konsolebox: has joined #ruby
[06:30:22] Ox0dea: I suspect facetiousness.
[06:30:28] nofxx: agreed... was looking for something more it's the force not magic
[06:30:54] Ox0dea: >> 'facetious'.scan(/[aeiou]/).join
[06:30:55] ruboto: Ox0dea # => "aeiou" (https://eval.in/401088)
[06:31:08] [k-: even in order!
[06:31:24] [k-: there is no y, though
[06:31:30] matcouto: has joined #ruby
[06:31:34] Ox0dea: Y is only a vowel when there are no others.
[06:31:45] bruno-: has joined #ruby
[06:31:51] [k-: it is like Pluto :(
[06:32:02] Ox0dea: ACTION checks that "facetious" is still the shortest word with that property.
[06:32:09] nofxx: [k-, hehe, which is your mother tongue?
[06:32:32] [k-: mandarin
[06:32:34] htmldrum: has joined #ruby
[06:34:00] nofxx: [k-, for latin it looks strange, Y V as vowels, guess it's because we made new letter's for em
[06:34:07] nofxx: latin based tongues*
[06:34:46] Ox0dea: nofxx: V?
[06:35:07] nofxx: Ox0dea, yup.. there was no 'U'
[06:35:20] nofxx: i,j,u are the newest iirc
[06:36:02] [k-: there is no v in mandarin
[06:36:10] [k-: only ??
[06:36:12] Ox0dea: I... think he's talking about English.
[06:36:45] [k-: I'm not sure what he is talking about :/
[06:36:46] nofxx: [k-, hum? you mean simplified mandarin, something to write on west keyboard (sorry my naiveness)
[06:37:13] [k-: Chinese/Mandarin
[06:37:23] zenspider: greenride: what
[06:37:59] tmtwd: has joined #ruby
[06:38:02] Ox0dea: nofxx: Isn't V just how they *wrote* the letter U way back when?
[06:38:14] nofxx: Ox0dea, [k- we're talking about the latin alphabet, aren't we?
[06:38:25] Ox0dea: nofxx: A-Z is the Latin alphabet.
[06:38:26] nofxx: Ox0dea, yes
[06:38:31] tkuchiki: has joined #ruby
[06:38:33] [k-: we don't know what you are taking about
[06:39:02] Ox0dea: nofxx: They had the letter U, they just didn't write it like we do now.
[06:39:14] Ox0dea: How do you reckon they pronounced Jvlivs?
[06:39:17] nofxx: Y being a vowel... I said that after we came up with the new i and u it looks strange
[06:39:26] Ox0dea: nofxx: Right, but you also mentioned V.
[06:40:13] Ox0dea: More to the point of confusion, you mentioned V being a vowel.
[06:40:43] phutchins: has joined #ruby
[06:41:37] greenride: zenspider: You asked me 'what about this line?'. Which line are you referring to?
[06:42:20] nofxx: Ox0dea, now you are confusing greek and latin alphabets
[06:42:38] riotjones: has joined #ruby
[06:43:13] [k-: he is confusing everything today
[06:43:15] Ox0dea: >> eval "1 + \n 2 + \n 3" # greenride
[06:43:16] ruboto: Ox0dea # => 6 (https://eval.in/401089)
[06:43:28] [k-: it's upside down day everyone!
[06:44:18] Ox0dea: nofxx: I would appreciate being enlightened as to the nature of my confusion.
[06:45:06] celly: has joined #ruby
[06:45:09] Ox0dea: In short, in which languages, past or present, is the letter V a vowel?
[06:45:46] pwnz0r: has joined #ruby
[06:45:50] nofxx: Ox0dea, really not a expert here but here it goes: basically rome uses some letter from greek and add some others
[06:45:56] greenride: Ox0dea: I see. You are demonstrating that lines are a bad thing to benchmark since your example shows that lines are not necessarily a unit that translates into something meaningful at the token level or the ruby virtual machine level.
[06:46:03] nofxx: and build the latin alphabet, and rome being rome it gets widespread
[06:46:03] zenspider: greenride: I asked you "what; about; this; line?"
[06:46:07] Ox0dea: greenride: That's exactly right.
[06:46:17] zenspider: greenride: I also asked you "what\nabout\nthis\nline?"
[06:46:24] Ox0dea: In Ruby, statements may span multiple lines, and a single line may contain multiple statement.
[06:46:43] Ox0dea: greenride: If you desire to benchmark a method piecemeal, you'll need to do so at the expression level.
[06:46:50] nofxx: Ox0dea, its basically our aphabet, but 'J' did not exist until some centuries ago (another history I dont recall).. they added I and U for instance
[06:47:00] zenspider: half an hour ago I said "lines mean nothing"
[06:47:05] Ox0dea: nofxx: Who added U?
[06:47:06] greenride: Ox0dea: Fully agree.
[06:47:17] nofxx: Ox0dea, rome
[06:47:30] greenride: zenspider: Thanks for pointing that out. I just wasn't sharp enough to get it back then.
[06:47:47] greenride: zenspider: Noted that you said it.
[06:48:08] nofxx: Ox0dea, if not it's the same J history, was later and rome added 'I' heh need to wikipedia
[06:48:28] [k-: zenspider: I actually have a code snippet for that
[06:48:31] [k-: want to see?
[06:48:57] nofxx: Ox0dea, I guess it was later cuz we see a lot of julius as you wrote, and GAIVS too for caesar
[06:49:00] tjbiddle: has joined #ruby
[06:49:19] zenspider: [k-: before I answer your question, expand on "for that"
[06:50:11] nofxx: Ox0dea, they used a lot of greek ones http://www.idlcoyote.com/ps_tips/greeksym_3.png
[06:50:19] [k-: I used \
[06:50:20] nofxx: what they didn't use mathematica grabbed
[06:50:27] [k-: ended with .
[06:50:34] [k-: and stuff
[06:50:59] [k-: to increase number of lines and make it harder to read basically
[06:51:46] nofxx: Ox0dea, cyrillic is a beautiful alphabet too...
[06:52:05] Ox0dea: YIL that Mongolian script is gorgeous.
[06:52:25] zenspider: Ox0dea: ooh. url?
[06:53:12] [k-: zenspider: https://eval.in/392790
[06:53:13] Pupeno: has joined #ruby
[06:53:27] Vile`: has joined #ruby
[06:53:51] Ox0dea: zenspider: http://i.imgur.com/vsMCi4v.png
[06:54:25] WhitePride: has joined #ruby
[06:54:33] Ox0dea: WhitePride: Bye.
[06:54:47] duoi: has joined #ruby
[06:55:27] WhitePride: has left #ruby: ()
[06:55:48] Ox0dea: zenspider: Another example (PDF): https://drive.google.com/file/d/0ByHt4Vj8MdN2NGRVaDNkNm5DdVk/view
[06:55:55] greenride: Ox0dea: By the way, thanks for the discussion.
[06:56:03] greenride: zenspider: By the way, thanks for the discussion.
[06:56:35] [k-: zenspider: greenride: I think I gave up after this: https://eval.in/392793
[06:56:42] Ox0dea: greenride: Sure thing. Sorry your idea turned out to be crazier than you might at first assume.
[06:56:50] Ox0dea: Consider switching to a homoiconic language. :)
[06:56:59] zenspider: ... huh. didn't need to: /troll WhitePride
[06:57:07] ellisTAA: has joined #ruby
[06:57:20] zenspider: ... did the internet just go bizarro?
[06:57:27] zenspider: that script is gorgeous
[06:57:58] Ox0dea: It's very pretty. nofxx's mention of Cyrillic brought it to mind, since that's the alphabet they use for transliteration.
[06:58:19] Pupeno: has joined #ruby
[06:58:19] Pupeno: has joined #ruby
[06:58:46] nofxx: Ox0dea, it's rotated? or they write top to down?
[06:58:57] Ox0dea: It's vertical.
[06:59:02] zenspider: gah so pretty
[06:59:23] greenride: [k-: Thanks for the discussion as well. That's a cool little script.
[06:59:23] nofxx: Ox0dea, that's crazy... does html5 support this? vertical input fields haha
[06:59:52] codecop: has joined #ruby
[06:59:53] zenspider: if it support RTL, it better support vertical
[07:00:06] zenspider: or a ~billion ppl will be annoyed
[07:00:42] nofxx: wait... isn't japanese top to bottom to? AND RTL ? hehe
[07:01:30] Ox0dea: nofxx: Modern Japanese is RTL, but not TTB.
[07:03:20] zenspider: all of the above, depending
[07:03:33] Ox0dea: Apparently so.
[07:05:42] Ox0dea: I know I've had highlighting issues on pages containing Japanese text, and I also seem to vaguely recall seeing pages from a Murakami novel being written right-to-left, but LTR is obviously way more common.
[07:05:50] Ox0dea: I thought for the longest that it had something to do with formality.
[07:06:54] volsus: has joined #ruby
[07:07:07] sinkensabe: has joined #ruby
[07:08:12] zacstewart: has joined #ruby
[07:09:06] [k-: append xs ys = foldr (:) ys xs -- amazeballs
[07:09:48] Mendenhall: has joined #ruby
[07:12:50] nullsides: has joined #ruby
[07:13:27] xkickflip: has joined #ruby
[07:15:14] fabrice31: has joined #ruby
[07:18:50] WhitePride: has joined #ruby
[07:18:57] WhitePride: i hate niggers
[07:20:54] peter_paule: has joined #ruby
[07:21:28] tyrbo: has joined #ruby
[07:21:50] bluOxigen: has joined #ruby
[07:23:21] xkickflip: has joined #ruby
[07:23:30] [k-: has joined #ruby
[07:24:03] htmldrum: has joined #ruby
[07:24:08] tubuliferous_: has joined #ruby
[07:24:51] Vile`: has joined #ruby
[07:25:44] nini1294: has joined #ruby
[07:27:31] mike___1234: has joined #ruby
[07:27:50] zenspider: I was so ready before
[07:28:32] nin1294: has joined #ruby
[07:28:49] zenspider: maybe we should mute all web/freenode logins until they watch a video and answer questions to prove that they're human beings
[07:29:06] joonty: has joined #ruby
[07:31:32] j4cknewt: has joined #ruby
[07:32:11] bruno-: has joined #ruby
[07:32:54] Ox0dea: I pronounce "damnit" "dam nit" every time.
[07:33:32] araujo: has joined #ruby
[07:34:20] Ox0dea: I wonder if any IRCd has CAPTCHA functionality built in.
[07:35:09] Aswebb_: has joined #ruby
[07:37:03] lxsameer: has joined #ruby
[07:38:54] Tristan-Speccy: has joined #ruby
[07:41:37] iateadonut: has joined #ruby
[07:42:34] tjbiddle: has joined #ruby
[07:43:19] armyriad: has joined #ruby
[07:43:50] greenride: has left #ruby: ()
[07:44:24] timonv: has joined #ruby
[07:51:52] xkickflip: has joined #ruby
[07:55:59] krz: has joined #ruby
[07:56:20] baweaver: has joined #ruby
[07:57:13] peter_paule: has joined #ruby
[07:58:23] sinkensabe: has joined #ruby
[07:59:17] roolo: has joined #ruby
[07:59:56] allomov: has joined #ruby
[08:00:55] xkickflip: has joined #ruby
[08:01:17] DexterLB: has joined #ruby
[08:02:45] arooni-mobile: has joined #ruby
[08:04:49] [k-: has joined #ruby
[08:06:25] revath: has joined #ruby
[08:06:34] [k-: we could have a CaptchaServ
[08:07:16] tyrbo: has joined #ruby
[08:08:26] rht: has joined #ruby
[08:08:49] Musashi007: has joined #ruby
[08:11:07] galeido: has joined #ruby
[08:11:33] Alina-malina: has joined #ruby
[08:11:33] relix: has joined #ruby
[08:12:15] acke: has joined #ruby
[08:13:12] Ox0dea: Is there anything even vaguely resembling something which might be called IRCQL?
[08:13:55] yfeldblum: has joined #ruby
[08:13:58] Ox0dea: I'm thinking along the lines of "foo@bar" denoting foo's addressing bar, and maybe "foo+bar" to denote foo and bar speaking in succession.
[08:14:08] Ox0dea: [k-: Query Language.
[08:14:14] Ox0dea: Like SQL for IRC.
[08:15:41] Ox0dea: I'm considering writing an interactive log exploration... thingy.
[08:15:56] [k-: if you might have noticed, I'm very poor at addressing people
[08:16:09] Ox0dea: [k-: I have noticed that, and you shouldn't do that. :P
[08:16:16] Ox0dea: You're going to get lost in so many of my search results.
[08:16:20] [k-: I have deduced that it is the reason why people don't listen
[08:16:34] bubbys: has joined #ruby
[08:16:42] Ox0dea: Something, something, bystander effect. Something else, "you in the blue shirt!".
[08:17:25] Ox0dea: Singling people out has a way of forcing them to stop being a bystander.
[08:17:53] [k-: it's much harder to address people on phone
[08:18:19] Ox0dea: And even harder to tell what color shirt they're wearing.
[08:19:24] arturmartins: has joined #ruby
[08:20:14] [k-: in other news what is seq
[08:20:21] veduardo: has joined #ruby
[08:20:26] Ox0dea: Sequence?
[08:20:28] [k-: as in how do we use it
[08:20:45] Ox0dea: You'll have to clarify the context.
[08:20:47] [k-: the forcing of evaluation of thunks
[08:21:13] Ox0dea: Oh, you're learning Clojure?
[08:22:09] [k-: no, Haskell has it too
[08:22:23] Ox0dea: Right, it's really just an abstraction over iterable things.
[08:22:41] Ox0dea: Ruby's Enumerator::Lazy, more or less.
[08:23:22] [k-: seq forces evaluation
[08:23:24] Ox0dea: >> (1..Float::INFINITY).lazy.select(&:even?).take(10).force
[08:23:25] ruboto: Ox0dea # => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20] (https://eval.in/401116)
[08:25:46] Ilyas: has joined #ruby
[08:26:34] DoubleMalt: has joined #ruby
[08:31:00] peter_paule: has joined #ruby
[08:33:17] celly: has joined #ruby
[08:34:21] relix: has joined #ruby
[08:34:22] Soda: has joined #ruby
[08:42:06] phutchins: has joined #ruby
[08:47:54] Violentr: has joined #ruby
[08:48:15] vickleton: has joined #ruby
[08:50:51] Pupeno: has joined #ruby
[08:54:07] Ox0dea: [k-: Still about?
[08:55:49] [k-: I think I found out how to use seq
[08:56:03] [k-: that example in the book confused me
[08:56:24] Ox0dea: [k-: https://gist.github.com/0x0dea/7d288ea71387856b4330
[08:56:32] [k-: chained x y z = x `seq` y `seq` someFunc z
[08:56:58] Ox0dea: That won't be overly enlightening, but it demonstrates the surface view of Ruby's "thunks".
[08:58:22] revath: has joined #ruby
[08:58:25] [k-: totally enlightening!
[08:59:02] [k-: that isn't related!
[08:59:23] [k-: or I can't make the connection :s
[08:59:32] krz: has joined #ruby
[08:59:41] Ox0dea: A thunk, in a nutshell, is a delayed computation.
[09:00:04] peter_paule: has joined #ruby
[09:00:53] Ox0dea: Ruby's Enumerator::Lazy remembers the methods you called on its instances, but doesn't actually execute them until you force it to, at which point it's able to prune the (potentially infinite) result set down to something more concrete.
[09:00:55] [k-: I was confused because the example I gave didn't make use of x and y :s
[09:01:06] veduardo: has joined #ruby
[09:03:51] Jackneill: has joined #ruby
[09:04:51] dubkoidragon: has joined #ruby
[09:05:50] dubkoidragon: hello my rubyrific friends!
[09:06:17] Ox0dea: dubkoidragon: Tell us of your travels.
[09:06:29] dubkoidragon: just got home from a night out on the town
[09:06:37] dubkoidragon: doing some rubying now
[09:07:47] Ox0dea: That last part sounds particularly Rubyrific; tell us more about that one.
[09:08:57] dubkoidragon: I will be doing a quick tutorial on blocks, procs, and lambdas. I assume theyll be quite similar to pythons lamdbas, but I havent heard of procs, so will be good to know the syntax
[09:11:22] kraljev11: has joined #ruby
[09:11:29] [k-: the reason why they are grouped together is because they are mostly the same
[09:12:05] dubkoidragon: ok I see, yah I know about blocks, and labdas, but no idea what this proc thign is, but I will in a couple mins
[09:12:17] tubuliferous_: has joined #ruby
[09:13:06] [k-: https://eval.in/401119
[09:14:48] Ox0dea: [k-: Where's the block?
[09:15:05] dubkoidragon: I'm checking out the site right now
[09:15:40] [k-: how do you even print the block
[09:15:56] DexterLB: hmm, the first time you start the ruby interpreter it's slow (about 3-4 seconds). Every subsequent time is a lot faster - why is that?
[09:16:00] fabrice31: has joined #ruby
[09:16:19] Ox0dea: DexterLB: In a word, caching.
[09:16:28] dubkoidragon: I do not know
[09:16:32] Ox0dea: [k-: Blocks come into methods as Procs.
[09:16:56] Ox0dea: DexterLB: You should find that that's the case for many prorams you run, at least near to boot time.
[09:17:14] Ox0dea: 3-4 seconds is rather excessive, though.
[09:17:36] DexterLB: Ox0dea: ah, you mean the standard memory caching performed by the OS?
[09:17:47] Ox0dea: DexterLB: There's all sorts of caching going on, but yes, mostly that one.
[09:18:22] Rubie: has joined #ruby
[09:19:01] dubkoidragon: so blocks go into methods as procs
[09:19:09] zenspider: DexterLB: windows?
[09:19:22] [k-: Ox0dea, lies
[09:19:22] zenspider: 3-4 seconds is super duper slow
[09:19:28] DexterLB: zenspider: nope, linux
[09:19:31] [k-: you have to &block
[09:19:38] Ox0dea: [k-: No, you don't.
[09:19:43] [k-: when you do that, it is converted to a proc!
[09:19:45] zenspider: DexterLB: `gem list | wc -l`
[09:19:58] revath: has joined #ruby
[09:20:07] DexterLB: zenspider: lol, shit.
[09:20:17] DexterLB: zenspider: thanks
[09:20:20] zenspider: _maybe_ related... not necessarily
[09:20:30] zenspider: run it, tell me the number
[09:20:44] zenspider: that's not that high
[09:20:54] zenspider: not 3-4 seconds high
[09:21:00] zenspider: unless you're running on a floppy
[09:21:01] Ox0dea: [k-: Every method receives an implicit block if one isn't explicitly provided, and every method's block is accessible via Proc.new/proc when called without an explicit block; &block just lets you name the thing if you so choose.
[09:21:28] Ox0dea: >> def foo; proc[1, 2] end; foo { |a, b| a + b }
[09:21:29] ruboto: Ox0dea # => 3 (https://eval.in/401120)
[09:21:45] [k-: that is obviously converting it to a proc
[09:22:08] Ox0dea: [k-: Blocks are one of the few things that aren't actual Objects in Ruby.
[09:22:21] Ox0dea: They *must* be converted to Procs for you to use them.
[09:22:24] zenspider: huh. I had no idea
[09:22:30] Ox0dea: zenspider: You lie.
[09:22:35] zenspider: Ox0dea: no, they MUST not
[09:23:02] Ox0dea: s/use/manipulate/, then.
[09:23:08] [k-: which was why you can't print a block!
[09:23:25] Ox0dea: I'm sure it could technically be done.
[09:23:56] zenspider: Blocks _are_ "actual Objects".... &b assigns it to a name. therefore first class object
[09:24:00] Aswebb_: has joined #ruby
[09:24:00] [k-: looking back, using was was a good idea
[09:24:12] dubkoidragon: what do you mean by cant prnit a block so like cant print this : 5.times {|x| x**2}
[09:24:25] dubkoidragon: i might be way off im just trying ot learn
[09:24:28] zenspider: no, I think they mean .... print out the code or somethnig
[09:24:28] [k-: (and converts it to a proc)
[09:24:37] Ox0dea: zenspider: What is the class of a block?
[09:24:46] zenspider: blocks and procs are really the same thing. one is just syntactic sugar
[09:25:06] [k-: https://eval.in/401119
[09:25:07] Ox0dea: How do I get the object_id of a block?
[09:25:10] [k-: I mean this
[09:25:14] krz: has joined #ruby
[09:25:18] zenspider: Ox0dea: #object_id
[09:25:28] [k-: blocks aren't procs at first!
[09:25:33] [k-: only when you convert it
[09:25:38] Ox0dea: And then it's not a block.
[09:25:47] Ox0dea: I think it's disingenuous to so thoroughly conflate the two.
[09:26:03] zenspider: [k-: honestly? that's probably just some wierd historical bullshit. it's gone through so much manipulation over the years
[09:26:18] zenspider: Ox0dea: I disagree
[09:26:51] Ox0dea: zenspider: I can call a method with n Procs, but only one block; they are obviously not the same thing.
[09:27:03] zenspider: that isn't obvious at all. nor proof.
[09:27:05] fantazo: has joined #ruby
[09:27:10] Ox0dea: Do you even LSP?
[09:27:11] zenspider: one is syntactic sugar for the other. that's it.
[09:27:12] [k-: if you would look at <source that I am trying to remember>
[09:27:53] zenspider: just like: f { ... } vs f(&block) ? same thing.
[09:28:09] [k-: zenspider, no, &block has overhead
[09:28:16] [k-: it converts the block to a proc
[09:28:30] zenspider: other way around in this case
[09:29:09] Ox0dea: zenspider: When else does conversion take place between two things that are the same?
[09:29:09] zenspider: dubkoidragon: the big difference between a python lambda and a ruby lambda is that in ruby there isn't the language distinction between an expression and a statement. your blocks/procs in ruby can be as complex as you want
[09:29:10] bertro: has joined #ruby
[09:29:22] zenspider: in python, you can only have an expression in the lambda
[09:29:34] zenspider: Ox0dea: I don't understand your question
[09:29:34] GarethAdams: has joined #ruby
[09:29:46] [k-: how do you search reddit
[09:30:05] zenspider: tho the search engine seems to have improved a bit
[09:30:18] Ox0dea: [k-: Google + site:reddit.com is better than "native".
[09:30:37] revath: has joined #ruby
[09:30:38] zenspider: you can now get semi-reliable searches if you limit it to the subreddit
[09:30:48] zenspider: which is harder to do with google
[09:31:51] Ox0dea: site:reddit.com/r/foo works fine.
[09:32:34] thomasvm: has joined #ruby
[09:33:20] leat: has joined #ruby
[09:33:28] bodgix: has joined #ruby
[09:33:38] dubkoidragon: what does .to_a do again
[09:33:47] zenspider: calls the method to_a on an object
[09:33:48] [k-: I'm pretty bad at remembering
[09:33:57] zenspider: [k-: me too! we're so alike
[09:34:06] [k-: usually to_a converts the object to an array
[09:34:09] zenspider: dubkoidragon: aka, depends on what object it is called on
[09:34:31] [k-: zenspider, by alike, you mean you write ugly code too? :)!
[09:34:32] dubkoidragon: oh I thought it would be an answer simple like to_sym changes it to a sybol
[09:34:34] dubkoidragon: \but i see its not
[09:34:44] Ox0dea: dubkoidragon: It is.
[09:35:02] dubkoidragon: ok so whats it do again
[09:35:03] zenspider: .to_sym calls to_sym on an object. depends on what object
[09:35:09] AlexRussia: has joined #ruby
[09:35:11] Yiota: has joined #ruby
[09:35:15] jhass: well, to_sym is a method too, I could do class Foo; def to_sym; "I'm a teapot"; end; end and nobody would stop me
[09:35:50] Ox0dea: dubkoidragon: This is the price paid for ill-conceived questions.
[09:36:01] dubkoidragon: (1..100).to_a.select(&multiples_of_3)
[09:36:09] dubkoidragon: whats to_A do
[09:36:13] zenspider: .xyz just means "sends the message xyz to the reciever" what happens after that is entirely dependent upon the reciever
[09:36:23] [k-: OK I give up, I need to narrow my unknowns first
[09:36:34] jhass: dubkoidragon: do you have irb or pry?
[09:36:46] [k-: what is the site that also documents Ruby and starts with o
[09:36:48] dubkoidragon: i dont know what those things are
[09:36:51] Ox0dea: [k-: Omniref.
[09:36:53] [k-: they look at the source of Ruby too
[09:36:58] [k-: THATS IT
[09:37:05] zenspider: that's how my indexer works too...
[09:37:14] jhass: dubkoidragon: type irb into your command line
[09:37:15] zenspider: "you know... that thing! it starts with a u"
[09:37:24] jhass: then type (1..100).to_a
[09:37:30] zenspider: sometimes I can even dual index the suffix and still be just as lost
[09:37:41] dubkoidragon: like in mcd??
[09:37:51] jhass: uh, windows...
[09:37:55] jhass: I hope yes :P
[09:38:03] [k-: https://www.omniref.com/ruby/2.2.0/symbols/Proc/yield?#annotation=4087638&line=711
[09:38:08] [k-: zenspider ^
[09:38:09] dubkoidragon: but why what am i doing?
[09:38:27] Ox0dea: We all thought you were trying to learn Ruby.
[09:38:38] dubkoidragon: i meant with the ird thing
[09:39:04] zenspider: [k-: yup. some syntax has overhead. your point?
[09:39:05] thomasvm_: has joined #ruby
[09:39:20] Ox0dea: > syntax overhead
[09:39:29] dubkoidragon: irb(main):001:0
[09:39:32] dubkoidragon: thats whati t says
[09:39:40] jhass: now (1..100).to_a
[09:39:42] zenspider: start with 2 + 3
[09:39:49] [k-: it's not only syntax overhead
[09:39:54] [k-: read the whole thing
[09:39:59] [k-: there's a second paet
[09:40:20] zenspider: I've _implemented_ this
[09:40:24] dubkoidragon: it counted to a hundred
[09:40:31] revath: has joined #ruby
[09:40:36] Ox0dea: dubkoidragon: Well, there it is! to_a counts to a hundred.
[09:40:46] dubkoidragon: that was awsome
[09:40:56] dubkoidragon: that actually explained it good, then you can call a proc on that
[09:40:59] zenspider: I'm surprised it's still as bad as it is... I thought 1.9+ did a lot of improvement to blocks/procs
[09:41:31] dubkoidragon: ok so next question i guess what is this irb thing i went into
[09:41:31] zenspider: dubkoidragon: you're not calling a proc on anything... you're sending the message select and passing it a block/proc to filter
[09:41:50] Ox0dea: Which... calls the Proc for every element in the collection.
[09:42:15] lolmaus: has joined #ruby
[09:42:22] joonty: has joined #ruby
[09:42:30] dubkoidragon: whats the irb menu for?
[09:43:10] leat: has joined #ruby
[09:43:18] [k-: lel, there it is! to_a counts to a hundred
[09:43:51] Ox0dea: dubkoidragon: irb is pronounced like "herb"; the irb menu is to be consulted when you're unsure which spices go best with a given dish.
[09:43:58] zenspider: [k-: look at the numbers for jruby, only 1.3x. speed differences are just implementation details.
[09:44:00] tobacco_joe: has joined #ruby
[09:44:16] dubkoidragon: ok cool, and how can I get back out of it and into my ruby folder
[09:44:25] [k-: the implementation differs, so they aren't the same!
[09:44:30] zenspider: exit or ... maybe cntrl d
[09:44:34] zenspider: I dunno about cmd
[09:44:44] [k-: exit, quit, etc
[09:44:45] Mon_Ouie: has joined #ruby
[09:44:56] [k-: irb has those methods defined
[09:45:02] [k-: exit is a Kernel method tho
[09:45:23] [k-: etc is obviously not a method!
[09:45:33] zenspider: nothing is obvious with ruby
[09:45:34] Ox0dea: zenspider: Thread.main.kill?
[09:45:40] zenspider: dunno why irb defined quit
[09:46:01] zenspider: hah. they define their own exit and quit
[09:46:14] [k-: because quit is what other repls do?
[09:46:14] zenspider: and... oddly... irb_quit
[09:46:26] [k-: in Haskell, :quit
[09:46:31] arup_r: has joined #ruby
[09:46:32] [k-: in vim, :quit
[09:46:45] Yiota: has joined #ruby
[09:46:47] zenspider: vim != repl. besides :q :P
[09:46:55] postmodern: has joined #ruby
[09:46:59] zenspider: and python? needs the parens.. hah
[09:47:09] zenspider: I always just close stdin w/ ^d
[09:47:27] zenspider: Use quit() or Ctrl-D (i.e. EOF) to exit
[09:47:28] ruboto: zenspider # => /tmp/execpad-ea983eb34158/source-ea983eb34158:2: syntax error, unexpected '>' ...check link for more (https://eval.in/401131)
[09:47:35] zenspider: oops. sorry ruboto
[09:47:46] Ox0dea: I did the same damned thing recently.
[09:48:07] zenspider: maybe ruboto should know that if there are 3 chevrons it should eval in python
[09:48:14] zenspider: what could go wrong?
[09:48:16] Ox0dea: apeiros: ^
[09:48:36] [k-: syntax errors?
[09:48:41] Ox0dea: And then maybe two leading semicola for Scheme evaluation.
[09:48:59] [k-: and a lambda for haskell
[09:49:14] [k-: I need to add a lambda to my keyboard first, of course
[09:49:17] jhass: why not brainfuck for three >>> and interpret them as part of the program already?
[09:49:41] lolmaus: has joined #ruby
[09:50:21] Ox0dea: [k-: Ctrl-g for Greek.
[09:50:57] revath: has joined #ruby
[09:51:08] spider-mario: has joined #ruby
[09:51:44] _ixti_: has joined #ruby
[09:51:56] [k-: Ctrl does not exist on my keyboard :(
[09:52:26] nini1294: has joined #ruby
[09:53:26] leat: has joined #ruby
[09:54:28] troulouliou_div2: has joined #ruby
[09:54:31] krz: has joined #ruby
[09:54:47] lkba: has joined #ruby
[09:55:39] tkuchiki: has joined #ruby
[09:58:52] fantazo: has joined #ruby
[09:58:57] zenspider: gotta stop using typewriters
[10:00:31] lessless: has joined #ruby
[10:01:28] ruurd: has joined #ruby
[10:01:32] [k-: I do not use a typewriter!
[10:01:55] Ox0dea: [k-: Your MacBook's keyboard really doesn't have a Ctrl key?
[10:02:30] [k-: I'm on my phone!
[10:02:56] Ox0dea: Oh, right. :/
[10:03:16] Silox|: has joined #ruby
[10:03:45] troulouliou_div2: has joined #ruby
[10:04:10] benlovell: has joined #ruby
[10:04:18] Silox|: Are there any gems providing numpy array support to ruby?
[10:05:19] [k-: when I see numpy and Ruby in the same sentence I feel sad
[10:05:26] [k-: is shevy here?
[10:05:41] zacstewart: has joined #ruby
[10:06:38] krz: has joined #ruby
[10:07:47] Silox|: [k-: I tried to look for alternatives but there just don't seem decent (and non-experimental) packages out there
[10:08:15] Silox|: there's NArray which is still experimental, and then you have ScuRuby's nmatrix which relies on BLAS/LAPACK
[10:08:51] arup_r: shevy, Hi
[10:09:04] arup_r: Aww! all are calling shevy
[10:09:37] [k-: pretty much why I feel sad
[10:10:23] Silox|: I'm thinking about putting up a Python Flask API to communicate between my ruby "front end" and the Python processing backend now :c
[10:10:58] Aym_C: has joined #ruby
[10:11:21] [k-: Ox0dea, quick, do something!
[10:11:43] Ox0dea: But Silox| is considering doing the right thing. :/
[10:12:18] jbw_: has joined #ruby
[10:12:33] [k-: at least still rubying
[10:13:23] zenspider: I don't think narray is considered experimental
[10:13:23] pandaant: has joined #ruby
[10:13:34] zenspider: but I wouldn't say it makes up for numpy
[10:14:56] Silox|: Can NArrays get passed through FFI to a C library though?
[10:15:47] Alayde: has joined #ruby
[10:17:15] Mekkis: has joined #ruby
[10:18:49] bruno-: has joined #ruby
[10:18:59] _blizzy_: has joined #ruby
[10:20:03] dubkoidragon: hey guys, my head's really hurting. I'm going to go get some sleep, but tommorrow I will be on again for sure, learning classes. Thanks for your help today, it was very helpful. good night :)
[10:21:01] Musashi007: has joined #ruby
[10:21:02] quimrstorres: has joined #ruby
[10:21:22] celly: has joined #ruby
[10:21:34] [k-: he doesn't drink water!
[10:21:55] [k-: You need to give him your wonderful advice, Ox0dea!
[10:22:28] Yiota: has joined #ruby
[10:23:46] statu: has joined #ruby
[10:23:52] bodgix: has joined #ruby
[10:24:32] statu: I am looking for a gem to access to a API server that returns some JSON data. Any suggestion?
[10:25:58] Silox|: statu: Don't look into 1 solution, use something like HTTParty to do the requests and as [k- said, use JSON to translate the content of the response body
[10:26:50] statu: Silox|: [k- thanks you!! I am very new (1 day xD) in ruby and I don't know the ecosystem yet
[10:27:20] _blizzy_: has joined #ruby
[10:27:39] Yiota: has joined #ruby
[10:28:33] arup_r: Ox0dea, my Php to Ruby integration is finished successfully..:)
[10:28:41] Ox0dea: arup_r: Oh?!
[10:28:43] Ox0dea: Well done.
[10:28:50] arup_r: thanks to you guys also
[10:30:02] [k-: Ox0dea: (I am very new in Ruby) in ruby
[10:30:12] [k-: no quotes!
[10:30:20] tkuchiki: has joined #ruby
[10:30:38] Ox0dea: That's syntactically valid Scheme and Ruby. :)
[10:30:57] Ox0dea: Ah, shit, it's not, because `in`.
[10:31:44] [k-: in Ruby pls
[10:31:48] Ox0dea: >> def method_missing(*) end; Ruby = "<3"; (I am very new to Ruby)
[10:31:49] ruboto: Ox0dea # => nil (https://eval.in/401134)
[10:31:54] Yiota: has joined #ruby
[10:34:49] [k-: I am very new in Ruby, libobf style
[10:34:59] [k-: or no alphanum
[10:36:08] [k-: I(am(very(new(to(Ruby should return "welcome!"
[10:38:49] [k-: Reddit upgraded its ui!
[10:41:21] [k-: https://m.reddit.com/r/ruby/comments/2x9axs/why_blocks_make_ruby_methods_439_slower/
[10:41:31] [k-: totally nicer!
[10:41:37] Silox|: That's on mobile though
[10:42:12] [k-: *Reddit mobile
[10:44:25] ndrei: has joined #ruby
[10:45:49] mike___1234: has joined #ruby
[10:46:28] [k-: I'm so downloading omniref browser plugin
[10:48:02] Silox|: I just realised that I don't actually need super fast serialisation of my array data... I'll just go with Marshal and FFI and see how fast it is
[10:50:50] acke: has joined #ruby
[10:51:31] jbwiv: has joined #ruby
[10:51:33] bruno-_: has joined #ruby
[10:55:18] Ox0dea: >> 'foo'[/(o+)/]; [$1, $1.upcase!, $1]
[10:55:19] ruboto: Ox0dea # => ["oo", "OO", "oo"] (https://eval.in/401135)
[10:55:26] ruurd: has joined #ruby
[10:55:30] astrobunny: has joined #ruby
[10:55:51] [k-: >> $1 = 'TEST'
[10:55:52] ruboto: [k- # => /tmp/execpad-ad551d5c0c68/source-ad551d5c0c68:2: Can't set variable $1 (https://eval.in/401136)
[10:56:13] Ox0dea: But then #upcase! ought to warn about that.
[10:56:24] jbw_: has joined #ruby
[10:56:53] [k-: ask omniref!
[10:56:59] [k-: we should make it a thing!
[10:58:17] mhib: has joined #ruby
[10:58:26] [k-: >> 'foo'[/(o+)/]; [$1, $1[0]=?&, $1]
[10:58:27] ruboto: [k- # => ["oo", "&", "oo"] (https://eval.in/401137)
[11:00:26] tubuliferous_: has joined #ruby
[11:02:01] roolo_: has joined #ruby
[11:07:02] Rubie: has joined #ruby
[11:08:36] sdothum: has joined #ruby
[11:08:42] Axy: has joined #ruby
[11:10:29] krz: when executing User. i want to display something else. which is the method i need to implement? is this to_s?
[11:10:43] krz: User is a class
[11:11:03] Ox0dea: krz: You want instances of User to display differently, yes?
[11:11:52] krz: Ox0dea: yea
[11:11:55] [k-: krz, your phrasing is unclear
[11:12:12] schaerli: has joined #ruby
[11:12:26] Ox0dea: krz: Redefine #inspect for printing, and #to_s for string interpolation.
[11:12:34] krz: ty Ox0dea
[11:12:37] Ox0dea: Sure thing.
[11:12:46] mandarinkin: has joined #ruby
[11:12:50] [k-: you shouldn't redefine inspect
[11:12:52] Aswebb_: has joined #ruby
[11:13:05] [k-: it has everything you could possibly need
[11:13:18] nettoweb: has joined #ruby
[11:13:49] krz: yea probably just to_s
[11:13:59] krz: i believe rails does this too with their Models
[11:14:17] Ox0dea: krz: #inspect is for when your object is given to Kernel.p, but the default does indeed provide all the information you should need.
[11:14:28] Ox0dea: Class, address in memory, instance variables.
[11:15:20] Ox0dea: #to_s for puts, print, and interpolation.
[11:15:26] revath: has joined #ruby
[11:15:31] Ox0dea: And then #to_str for when your object needs to be coerced to a string, but that's rare.
[11:15:48] jbwiv: has joined #ruby
[11:16:18] Ox0dea: [k-: Should Ruby warn us for redefining #inspect? :P
[11:16:27] zacstewart: has joined #ruby
[11:16:36] [k-: to_str calls to_s by default or is it the other way round
[11:17:00] [k-: Ox0dea, yes, because I was stupid enough to redefine inspect
[11:17:13] [k-: my github still has that library >.>
[11:17:21] zdf: has joined #ruby
[11:18:52] Ox0dea: String and NameError are the only classes with #to_str defined by default, but it does delegate to #to_s for the former.
[11:19:50] sonOfRa: has joined #ruby
[11:21:02] jbwiv: has joined #ruby
[11:25:23] tno: has joined #ruby
[11:25:42] isxek: has joined #ruby
[11:26:30] matcouto: has joined #ruby
[11:28:19] jamesaxl: has joined #ruby
[11:28:52] tsvenson: has joined #ruby
[11:29:35] ryba: has joined #ruby
[11:29:45] shevy: [k- I was asleep, the heatwave is knocking me out
[11:29:46] sevenseacat: has joined #ruby
[11:32:16] cornerman: has joined #ruby
[11:32:43] linuxboytoo: has joined #ruby
[11:32:55] [k-: I thought only the cold puts people to sleep
[11:33:42] tsvenson_: has joined #ruby
[11:33:53] jhass: nah, humans turn the brain off in all kind of emergency situations
[11:34:12] [k-_: has joined #ruby
[11:34:36] cornerman: has joined #ruby
[11:34:44] yqt: has joined #ruby
[11:35:01] [k-_: do we need chanserv repeating the topic
[11:35:40] nini1294: has joined #ruby
[11:36:18] jhass: people still don't read it but it increases the chances
[11:37:01] symm-: has joined #ruby
[11:37:22] cornerman: has joined #ruby
[11:38:47] [k-: how about delaying it for 40s and prefixing their nick with it
[11:38:55] cornerman: has joined #ruby
[11:39:43] jhass: that's not how it works
[11:39:58] jhass: chanserv sends it only to you, not the channel
[11:40:40] [k-: I know that
[11:41:08] [k-: but delaying the notice makes it more noticeable after a stream of messages from the motd
[11:41:28] jhass: send a patch to atheme
[11:42:19] jhass: [k-: http://freenode.net/services.shtml
[11:43:04] phutchins: has joined #ruby
[11:43:06] bodzio: has joined #ruby
[11:43:59] Ox0dea: I finally got to use the two-argument form of Hash#fetch_values.
[11:44:15] bodgix: has joined #ruby
[11:45:53] pandaant: has joined #ruby
[11:47:34] [k-_: i know what is atheme .__.
[11:48:05] segfalt: has joined #ruby
[11:48:09] jbw_: has joined #ruby
[11:48:18] djbkd_: has joined #ruby
[11:49:19] bodgix: has joined #ruby
[11:49:30] railsraider: has joined #ruby
[11:50:12] bodgix_wrk: has left #ruby: ()
[11:50:44] allcentury: has joined #ruby
[11:50:57] bodgix: has joined #ruby
[11:51:41] acke: has joined #ruby
[11:51:50] kidoz: has joined #ruby
[11:51:59] dimasg: has joined #ruby
[11:52:09] jbwiv: has joined #ruby
[11:52:19] dtcristo: has joined #ruby
[11:53:36] mistermocha: has joined #ruby
[11:58:04] dfockler: has joined #ruby
[11:58:18] lxsameer: has joined #ruby
[11:59:13] _blizzy_: has joined #ruby
[12:01:53] DEA7TH_: has joined #ruby
[12:02:16] ruurd: has joined #ruby
[12:03:42] lxsameer: has joined #ruby
[12:03:44] lxsameer: has joined #ruby
[12:04:35] FernandoBasso: has joined #ruby
[12:07:05] _blizzy_: has joined #ruby
[12:08:09] Node1: has joined #ruby
[12:08:57] dorei: has joined #ruby
[12:09:25] l0oky: >> puts "test string".parameterize
[12:09:26] ruboto: l0oky # => undefined method `parameterize' for "test string":String (NoMethodError) ...check link for more (https://eval.in/401154)
[12:09:31] celly: has joined #ruby
[12:11:19] Ox0dea: l0oky: Maybe #rubyonrails' bot includes ActiveSupport::Inflector.
[12:11:44] l0oky: Ox0dea: Yeah I thought so. Thanks for the heads up.
[12:13:10] [k-_: why are you doing it here :(
[12:13:53] Ox0dea: [k-_: pry is expensive these days.
[12:15:36] Ox0dea: Given that some people "half-use" it, we can assume the number of users must be fractional. Thus, if nobody used pry, at its current cost of 0, total expenses would be:
[12:15:38] Ox0dea: >> 0 / 0.0
[12:15:40] ruboto: Ox0dea # => NaN (https://eval.in/401156)
[12:16:58] [k-_: unfathomable!
[12:18:04] Ox0dea: Incalculable!
[12:18:22] [k-_: >> 1.0/0.0
[12:18:23] ruboto: [k-_ # => Infinity (https://eval.in/401157)
[12:19:52] zacstewart: has joined #ruby
[12:19:53] Ox0dea: Ah, true; pry does cost one `gem` invocation.
[12:20:01] iateadonut: has joined #ruby
[12:20:56] stamina: has joined #ruby
[12:21:10] nfk: has joined #ruby
[12:21:23] dtcristo: has joined #ruby
[12:21:39] Papierkorb: has joined #ruby
[12:23:28] mary5030: has joined #ruby
[12:26:22] Aym_C: has joined #ruby
[12:27:34] Pupeno: has joined #ruby
[12:30:12] lkba_: has joined #ruby
[12:30:39] railsraider_: has joined #ruby
[12:31:12] [k-_: :o now i am on my computer
[12:31:24] [k-_: i am in a position of submiting patches
[12:31:30] [k-_: s/now/now that
[12:32:02] mikecmpbll: has joined #ruby
[12:32:23] bronson: has joined #ruby
[12:34:18] [k-_: tada found ithttps://github.com/ruby/ruby/blob/b2a36083f8c3a5f7ec142ce3d9d8990788a162a6/object.c#L1526
[12:34:28] [k-_: s/ith/it h
[12:34:51] mikecmpbll: is there a circular list structure in ruby?
[12:35:06] cats: has joined #ruby
[12:35:12] [k-_: you mean a linked list?
[12:35:50] arup_r: no builtin mikecmpbll I think,, :)
[12:35:56] mikecmpbll: arup_r: ok :)
[12:36:02] [k-_: http://matt.weppler.me/2013/08/14/implementing-a-linked-list-in-ruby.html
[12:36:03] arup_r: we have only Queue
[12:36:17] [k-_: http://www.sitepoint.com/rubys-missing-data-structure/
[12:36:30] davedev24: has joined #ruby
[12:36:32] Unicorn|: has joined #ruby
[12:36:33] bruno-: has joined #ruby
[12:36:50] mikecmpbll: basically wanna be able to have a list of elements, and for a user to pass in an element and i want to iterate over every other element starting with the one they pass in, so [1,2,3,4] with 3 would iterate [3,4,1,2].
[12:37:03] mikecmpbll: i could hack something up but wondering if i was missing something elegant :0
[12:37:05] sarkyniin: has joined #ruby
[12:37:06] JDeen: has joined #ruby
[12:38:08] [k-_: Array#rotate
[12:38:13] mikecmpbll: an array that would iterate circularly forever would be the simplest because i can just break when i meet the same element :)
[12:38:20] sarkyniin: has joined #ruby
[12:38:45] mikecmpbll: that's the ticket
[12:38:58] mikecmpbll: cheers [k-_ !
[12:39:15] serivich: has joined #ruby
[12:39:26] mxrguspxrt: has joined #ruby
[12:39:48] havenwood: has joined #ruby
[12:40:03] mikecmpbll: >> a = [1,2,3,4]; a.rotate(a.index(3))
[12:40:04] ruboto: mikecmpbll # => [3, 4, 1, 2] (https://eval.in/401177)
[12:41:45] Mon_Ouie: By the way "iterating circularly forever" also exists (Enumerable#cycle)
[12:42:50] Ox0dea: [k-_: What needs patching in rb_mod_eqq()?
[12:43:00] [k-_: the documentation
[12:43:40] Ox0dea: It is indeed rather misleading.
[12:43:44] keen__________25: has joined #ruby
[12:44:10] Ox0dea: Wait, is it?
[12:44:19] JDeen: has joined #ruby
[12:44:45] [k-_: jhass also said that it is misleading
[12:44:55] [k-_: jhass opinion = win
[12:45:13] Ox0dea: With what did he say he took issue?
[12:45:20] cornerman: has joined #ruby
[12:45:20] mary5030: has joined #ruby
[12:45:37] Mon_Ouie: Is rb_mod_eqq Module#===?
[12:46:49] cornerman: has joined #ruby
[12:46:50] Mon_Ouie: Ox0dea: It could be parsed as saying "Returns true if obj is (an instance of mod) or (one of mod's descendants)
[12:47:10] Mon_Ouie: Instead of "Returns true if obj is an instance of (mod or one of mod's descendants)
[12:47:18] [k-_: thats totally what i understood it as
[12:48:36] tubuliferous_: has joined #ruby
[12:49:22] cornerman: has joined #ruby
[12:49:27] [k-_: where is object.c >:(
[12:49:36] dtcristo: has joined #ruby
[12:49:40] Ox0dea: [k-_: You... linked to it?
[12:51:43] symm-: has joined #ruby
[12:52:17] dgutierrez1287: has joined #ruby
[12:52:24] [k-_: :o there is only one o*.c in ruby
[12:52:35] [k-_: i kept missing it >.<
[12:52:43] davedev24: has joined #ruby
[12:54:40] [k-_: https://github.com/documenting-ruby/ruby/pull/52
[12:54:52] Rubie: has joined #ruby
[12:56:19] [k-_: i must ping shevy about this
[12:56:22] [k-_: he will be happy
[12:56:31] bruno-: has joined #ruby
[12:57:28] kfpratt: has joined #ruby
[12:57:42] [k-_: i contributed to ruby!
[12:57:53] shevy: well that is just documentation
[12:58:13] shevy: you improved the documentation by 0.00000000241%
[12:58:28] [k-_: you didnt contribute to ruby >.>
[13:00:02] [k-_: >> 0.00000000241%
[13:00:03] ruboto: [k-_ # => /tmp/execpad-39d104817ce9/source-39d104817ce9:3: syntax error, unexpected keyword_rescue ...check link for more (https://eval.in/401178)
[13:00:06] [k-_: >> 0.00000000241
[13:00:07] ruboto: [k-_ # => 2.41e-09 (https://eval.in/401179)
[13:00:23] [k-_: look, ruby knows the notation!
[13:00:23] jazz: has joined #ruby
[13:00:31] [k-_: what do we call that notation again?
[13:00:50] [k-_: ah yes, standard form + 3 significant figures
[13:01:31] [k-_: i was going to do 0.00000000241 > 0 but we all know that is true
[13:02:44] Aswebb_: has joined #ruby
[13:03:05] vimz: is anyone prepared to explain procs to a n00b? Slowly. :P https://gist.github.com/anonymous/2b6369fea84ae625c9bb
[13:03:17] Ox0dea: >> [1e-323 > 0, 1e-324 > 0]
[13:03:18] ruboto: Ox0dea # => [true, false] (https://eval.in/401181)
[13:05:20] [k-_: vimz: your block is converted to a proc implicitly when you have block as an explicit argument
[13:06:40] vimz: [k- okay, that clears it up a bit. And a proc is just a portable, executable snippet of code?
[13:06:54] nateberkopec: has joined #ruby
[13:07:32] [k-_: a portable, executable snippet of code would be xslt!
[13:08:01] [k-_: you should use &block tho, it makes it more explicit that the method expects a proc
[13:08:27] ni886105: has joined #ruby
[13:08:53] vimz: [k- okay...what is a proc then? if not a portable snippet of code?
[13:09:00] Mon_Ouie: foo(&x) calls x.to_proc (unless x is nil) to obtain a Proc object, and passes that Proc object as a block argument to the foo method
[13:09:15] Mon_Ouie: What are you calling "portable"?
[13:09:28] sarkyniin: has joined #ruby
[13:10:13] [k-_: do you know a symbol turns into a proc?
[13:10:27] vimz: Mon_Ouie nice. By portable I mean you can pass it into methods.
[13:10:38] [k-_: >> &:itself
[13:10:39] ruboto: [k-_ # => /tmp/execpad-46bed3509f76/source-46bed3509f76:2: syntax error, unexpected & ...check link for more (https://eval.in/401193)
[13:10:55] [k-_: >> :itself.to_proc
[13:10:56] ruboto: [k-_ # => #<Proc:0x40cf0388> (https://eval.in/401194)
[13:11:11] [k-_: ruby is so awkward when & only works in certain places
[13:11:14] vimz: But why do we want to turn these arguments into procs?
[13:11:48] vimz: [k- haha no worries
[13:13:45] [k-_: i see you use tabs
[13:15:23] djbkd_: has joined #ruby
[13:15:47] [k-_: i dont use rspec and i dont know how the magic works
[13:15:49] FernandoBasso: has joined #ruby
[13:15:54] [k-_: so i dont follow the flow of the code :/
[13:16:51] [k-_: also, you need to use good english to make your questions clear and easy to understand :/
[13:17:40] fabrice31: has joined #ruby
[13:19:14] schaerli: has joined #ruby
[13:20:52] endash: has joined #ruby
[13:21:14] ni886105: has left #ruby: ()
[13:21:32] jaygen_: has joined #ruby
[13:24:09] rippa: has joined #ruby
[13:27:21] Ox0dea: [k-_: Noel Rappin would like some of your time: https://speakerdeck.com/noelrap/rspec-it-isnt-actually-magic
[13:27:43] vimz: Ox0dea haha yes not magic I am told
[13:27:46] [k-_: sorry i'm not willing to spend that time :s
[13:28:09] [k-_: read yes, presentation no
[13:28:09] vimz: [k- what part of my English tripped you up?
[13:28:41] [k-_: i forgot
[13:28:55] [k-_: i threw a whole mess of errors and gave up
[13:29:38] havenwood: Minitest! \o/
[13:30:23] chouhoulis: has joined #ruby
[13:30:32] [k-_: i never wrote tests :>
[13:31:04] [k-_: except for finishing_moves
[13:31:14] [k-_: if i didnt write it i would feel wrong
[13:32:32] [k-_: welp, today 40% of the time was me, 40% of the time was Ox0dea, 7% of the time was zenspider, the rest for ther rest
[13:32:56] havenwood: [k-_: The other 13%?
[13:33:02] havenwood: [k-_: I demand answers!
[13:33:06] [k-_: did i miss 13%?
[13:33:07] lorikeet: has joined #ruby
[13:33:13] havenwood: [k-_: You did.
[13:33:37] havenwood: vimz: https://www.youtube.com/watch?v=MA4jJNUG_dI
[13:33:55] [k-_: welp, today 46% of the time was me, 44% of the time was Ox0dea, 7% of the time was zenspider, 3% for the rest
[13:37:18] [k-_: ACTION notes the lack of adaedra today
[13:37:36] Ox0dea: He popped in for a little bit.
[13:38:00] Ox0dea: We could find out exactly when if somebody'd help me flesh out IRCQL.
[13:38:20] [k-_: sorry, i dont do -QL
[13:39:23] [k-_: i went to irclog.whitequark.org/ruby/ and ctrl+f adaedra
[13:39:37] Ox0dea: Fucking neanderthal.
[13:40:23] Ox0dea: Says the guy wanting to write an interactive log viewer for the terminal. :P
[13:40:33] [k-_: i dont keep logs in the first place
[13:40:44] Ox0dea: You compute weird.
[13:41:16] [k-_: compute what
[13:41:28] Ox0dea: "Compute" here meaning "use your computers".
[13:41:38] ruurd_: has joined #ruby
[13:42:20] [k-_: i dont keep logs, what do you want me to do
[13:43:35] ruurd: has joined #ruby
[13:43:42] [k-_: Ox0dea: do you want a git branch graph
[13:43:44] shevy: I also don't keep logs \o/
[13:43:50] [k-_: those are fun!
[13:45:07] [k-_: i also don't keep logs is almost singlish!
[13:47:05] asmodlol: has joined #ruby
[13:47:46] tmtwd: has joined #ruby
[13:50:09] [k-_: my fingers are fragile and clumsy
[13:50:15] [k-_: vim is difficult
[13:51:25] Spami: has joined #ruby
[13:51:28] Ox0dea: [k-_: Do :nmap <Up> <NOP>, and likewise for the other arrow keys.
[13:51:42] Ox0dea: Same for :imap, while you're at it. :)
[13:51:49] Ox0dea: You'll eventually thank yourself for doing it.
[13:52:01] [k-_: i am in lesson 2 of vim tutor
[13:52:13] Ox0dea: I'll do it along with you. :P
[13:52:17] [k-_: and i do not know what is nmap, <NOP>, etc
[13:52:29] [k-_: not lesson 2, sorry, lesson 1.2
[13:52:32] Ox0dea: Right, sorry. Jumped the gun there.
[13:53:03] Ox0dea: [k-_: <Esc> is actually a really shitty key for how often it's used. You'll want to remap that to something more convenient ASAP.
[13:53:20] Marsupermammal: has joined #ruby
[13:54:19] [k-_: yeah, it seems so far away
[13:54:28] shevy: do it like jhass and switch to sublime :>
[13:54:44] [k-_: i use sublime currently >.>
[13:55:07] Ox0dea: jhass switched from Vim to Sublime?
[13:55:11] zdf: editor war
[13:55:12] eGGsha: has joined #ruby
[13:55:25] Ox0dea: Scuffle at worst.
[13:55:35] zdf: what about os?
[13:55:38] mxrguspxrt: has joined #ruby
[13:55:48] [k-_: i use mac os x
[13:56:12] Ox0dea: zdf: Which Linux?!
[13:56:26] zdf: ubuntu 14.04
[13:56:48] Ox0dea: How come?
[13:57:12] Ox0dea: You can't explain why you chose that distro?
[13:57:40] celly: has joined #ruby
[13:58:06] zdf: because i haven't mac which i wish i would have one day and don't like windows
[13:58:21] [k-_: vim is nice since it separates inserting and deleting i learnt
[13:58:23] Ox0dea: That does not explain why you chose Ubuntu over every other Linux distribution.
[13:58:45] ddv: Ox0dea: what does it matter to you if he chose Ubuntu, Arch or whatever?
[13:58:58] [k-_: Ox0dea is a strong believer of arch
[13:59:03] Ox0dea: [k-_: Insert mode is for typing text, normal mode is for speaking a text editing language.
[13:59:11] zdf: installing rails in ubuntu is easier then fedora
[13:59:20] mxrguspx_: has joined #ruby
[13:59:22] zdf: and arch
[13:59:27] Ox0dea: ddv: He started the OS flamewar; I'm just going along with it.
[13:59:37] Ox0dea: zdf: You have never used Arch.
[14:00:18] shevy: real men compile from source
[14:00:20] zdf: no someone told me there is only terminal window there and rest black also no need of update
[14:00:33] zdf: is it true
[14:00:37] Ox0dea: Yeah, it's true.
[14:00:38] ddv: zdf: you are talking out of your butt
[14:00:53] Ox0dea: zdf: Even the terminal window is black.
[14:00:58] Ox0dea: Even the text is black!
[14:00:59] shevy: mine is pink
[14:01:03] Ox0dea: I have to do all my computing blind.
[14:01:04] ddv: no homo, shevy
[14:01:08] zdf: real hacker
[14:01:12] shevy: hey that is the sailormoon theme ddv!
[14:01:23] sevenseacat: installing rails is virtually identical in both ubuntu and fedora.
[14:01:33] codecop: has joined #ruby
[14:01:35] sevenseacat: if anything, its harder in fedora because you need to install a few extra packages first.
[14:01:40] howdoi: has joined #ruby
[14:01:47] zdf: but i faced some problem in fedora
[14:01:52] ddv: shevy: ur such a nerd
[14:01:57] zdf: correct
[14:01:57] sevenseacat: then you did it wrong.
[14:01:58] [k-_: LESSON 1 complete!
[14:02:21] sinkensabe: has joined #ruby
[14:02:25] [k-_: Ox0dea uses green text on black
[14:02:29] [k-_: is he a hacker
[14:02:32] zdf: anyway why is installing rails always painfull for beginners?
[14:02:40] Rubie: has joined #ruby
[14:02:46] sevenseacat: its not, if you follow the numerous guides written on the topic.
[14:03:04] ruurd_: has joined #ruby
[14:03:11] zdf: still people face some error
[14:03:11] [k-_: oh i forgot i need to add the tips and tricks thing
[14:03:19] sevenseacat: not if they follow the instructions.
[14:03:25] [k-_: i'll do it in vim!
[14:03:30] acke: has joined #ruby
[14:03:32] chinmay_dd: has joined #ruby
[14:03:37] joneshf-laptop: has joined #ruby
[14:03:45] ddv: [k-_: nobody cares that you use vim
[14:03:54] [k-_: yes they do!
[14:03:56] ddv: [k-_: get over it
[14:04:01] Ox0dea: ddv: I care.
[14:04:09] Ox0dea: ddv: Perhaps nobody cares that you don't care?
[14:04:23] ddv: Ox0dea: probably
[14:04:31] Ox0dea: ddv: Then why waste your precious finger bones?
[14:04:52] ddv: Ox0dea: I had to put [k-_ in his place
[14:04:53] Ox0dea: You're going to be arthritic that much sooner because you had to voice your righteous indignation.
[14:05:22] eGGsha: has joined #ruby
[14:05:22] [k-_: so i deserve no place in ruby...
[14:05:56] krz: has joined #ruby
[14:06:39] zdf: you can make new chat room for ruby vim
[14:06:44] ddv: this guy
[14:07:48] zdf: ruby irc is more active irc ever i have seen
[14:08:06] Ox0dea: #archlinux is activer.
[14:09:13] zdf: Ox0dea: r u a hacker
[14:09:59] Ox0dea: zdf: You'll need to provide your definition of the term.
[14:10:30] Ox0dea: Have I seen the movie "Hackers"? Yes. Do I use Arch? I do. Have I ever written a line of code in my life? 'Fraid not. :/
[14:10:38] ddv: he hacked the gibson, zdf
[14:10:43] havenwood: zdf: Hacked the Gibson...
[14:10:44] zdf: means software hacker or network hacker
[14:11:07] Ox0dea: zdf: You're still using a term for which you've not provided a definition.
[14:11:21] Ox0dea: Dictionaries don't take kindly to recursion that doesn't eventually terminate.
[14:11:57] zdf: what is gibson
[14:12:06] Ox0dea: No idea. It's my first day on the Internet.
[14:12:17] zdf: i searched and found guitar
[14:12:45] zdf: you r a college guy or professional
[14:13:17] [k-_: well i did it twice
[14:14:10] Ox0dea: [k-_: vimtutor?
[14:14:17] zdf: m colege guy
[14:14:28] [k-_: README.md
[14:14:48] Ox0dea: What is it you did twice?
[14:14:51] zdf: k: can we use vim for ubuntu
[14:15:12] [k-_: i had to add the section twice because i was on the wrong branch
[14:15:12] sankaber: has joined #ruby
[14:16:41] zdf: is there any gsocers
[14:17:15] Violentr: has joined #ruby
[14:17:53] havenwood: zdf: You have an overactive return key.
[14:18:33] _blizzy_: has joined #ruby
[14:18:51] bubbys: has joined #ruby
[14:18:57] havenwood: zdf: Sure, there are a few mentors and mentees around. Unless you mean gangster sorcerers, in which case there are quite a few.
[14:19:16] yuuvee: has joined #ruby
[14:19:39] zdf: actully i want to participate next time
[14:19:51] havenwood: zdf: Next Spring.
[14:20:04] zdf: needed giudence regarding
[14:20:18] desigx: has joined #ruby
[14:20:43] havenwood: zdf: Talk to use come Spring, once the mentoring orgs are chosen.
[14:20:57] [k-_: gSoC isnt some easy thing :<
[14:21:48] havenwood: zdf: Ruby hasn't been chosen yet for next year, since that decision is in the mysterious future.
[14:21:53] zdf: i guess if i would start from now at least some ground level then it would be good
[14:22:09] zacstewart: has joined #ruby
[14:22:20] shevy: gangster sorcerers
[14:22:40] mxrguspxrt: has joined #ruby
[14:24:29] endash: has joined #ruby
[14:26:48] pontiki: gangster sorcerers of ruby?
[14:26:56] Ox0dea: Those are sourcerers, surely.
[14:27:07] dimasg: has joined #ruby
[14:27:59] [k-: rgsourcerers*
[14:28:19] Pupeno: has joined #ruby
[14:29:01] blue_deref: has joined #ruby
[14:30:24] NeverDie: has joined #ruby
[14:33:21] nfk: has joined #ruby
[14:36:45] tubuliferous_: has joined #ruby
[14:39:15] rickmasta: has joined #ruby
[14:41:26] athos_diddy: has joined #ruby
[14:43:14] mxrguspxrt: has joined #ruby
[14:44:12] havenwood: has joined #ruby
[14:45:28] kj: has joined #ruby
[14:47:04] htmldrum: has joined #ruby
[14:47:36] noname: has joined #ruby
[14:48:43] ndrei: has joined #ruby
[14:48:47] chouhoulis: has joined #ruby
[14:49:27] Yiota: has joined #ruby
[14:52:35] last_staff: has joined #ruby
[14:53:36] Gabo: has joined #ruby
[14:54:17] j4cknewt: has joined #ruby
[14:55:04] l0oky: has joined #ruby
[14:55:30] sarkyniin: has joined #ruby
[14:55:58] [k-: # hello
[14:56:15] pontiki: keep your comments to yourself
[14:56:35] [k-: # precisely why I am using comments
[14:58:34] s00pcan: has joined #ruby
[14:58:58] drewvanstone: has joined #ruby
[15:01:00] chinmay_dd: has joined #ruby
[15:02:21] j4cknewt: has joined #ruby
[15:03:09] [k-: __END__
[15:03:35] [k-: # you will never be able to write Ruby code!
[15:04:59] j4cknewt: has joined #ruby
[15:06:24] Ox0dea: ACTION is trying to make WeeChat send EOF.
[15:06:24] Soda: has joined #ruby
[15:06:54] allcentury: has joined #ruby
[15:09:27] pontiki: what does that mean on a network connection?
[15:10:47] aryaching: has joined #ruby
[15:12:04] Ox0dea: Well, it'd come down to the IRC protocol in particular, but I'm reasonably certain it uses a more robust termination signal.
[15:13:23] pontiki: no doubt; "sending EOF" doesn't make sense to me; it's generally just a flag set in the driver on read
[15:13:34] jud: has joined #ruby
[15:14:31] Ox0dea: pontiki: I meant the character "\x4".
[15:14:53] pontiki: oh, well now i feel stupid
[15:15:05] Ox0dea: I'm just trying to get us out of this DATA!
[15:15:23] Ox0dea: [k-: This is all just going into the ether 'cause of you.
[15:15:33] [k-: # oh well
[15:17:16] nfk: has joined #ruby
[15:18:39] peter_paule: has joined #ruby
[15:19:29] zenguy_pc: has joined #ruby
[15:20:10] [k-: # remote host closed the connection
[15:20:32] nfk: has joined #ruby
[15:20:49] schaerli: has joined #ruby
[15:21:24] Ox0dea: I checked the log. I totally sent \x4. :)
[15:21:30] Ox0dea: We're in a new file.
[15:22:01] [k-: # you did not create a new file
[15:22:12] Ox0dea: New files create themselves.
[15:22:17] Ox0dea: That's how the Internet works.
[15:22:57] pontiki: that's why we have to dust and vacuum, to clean up all the old files
[15:23:26] [k-: eval(DATA.read)
[15:23:36] [k-: there, we won't face this issue anymore
[15:24:07] acl_: has joined #ruby
[15:24:16] timonv: has joined #ruby
[15:25:28] zacstewart: has joined #ruby
[15:26:01] [k-: __END__
[15:26:19] [k-: # if we don't do this DATA wouldn't exist and Ruby will crash
[15:27:29] [k-: # now we all have to type in comments
[15:28:21] j4cknewt: has joined #ruby
[15:28:58] amystephen: has joined #ruby
[15:29:50] bruno-: has joined #ruby
[15:30:00] chinmay_dd: has joined #ruby
[15:30:19] zenguy_pc: has joined #ruby
[15:30:49] charliesome: has joined #ruby
[15:31:15] lanemeyer: has joined #ruby
[15:31:51] zacstewart: has joined #ruby
[15:32:19] [k-: if we crash the ruby interpreter, we wont have to deal with this nonsense
[15:34:57] kirun: has joined #ruby
[15:35:04] chinmay_dd_: has joined #ruby
[15:35:13] shevy: DATA is annoying anyway - it should be baseable on the .rb file in question
[15:35:17] ruurd: has joined #ruby
[15:35:36] Ox0dea: shevy: It should be a global Hash.
[15:35:39] [k-: baseable?
[15:35:51] Yiota: has joined #ruby
[15:36:12] [k-: I believe it should remain as per-file only
[15:36:20] [k-: encapsulation!
[15:36:42] shevy: [k- if Bush jr. can coin new words, so can I!
[15:37:07] Ox0dea: You can't use the username "man" on GitHub.
[15:37:25] Ox0dea: Somebody phone the Social Justice police.
[15:37:25] [k-: is it taken?
[15:37:29] Ox0dea: No, it's a reserved word.
[15:38:00] [k-: it's likely to be abused anyway
[15:38:16] Ox0dea: How do you abuse a username?
[15:38:51] [k-: you abuse the meaning of the username
[15:39:00] s00pcan: has joined #ruby
[15:40:47] Yiota: has joined #ruby
[15:41:33] sepp2k: has joined #ruby
[15:41:51] j4cknewt: has joined #ruby
[15:43:00] Papierkorb: has joined #ruby
[15:43:10] Stratege: has joined #ruby
[15:43:31] pontiki: is it a path in https://github.com/man/ or something?
[15:43:37] ndrei: has joined #ruby
[15:44:21] schaerli: has joined #ruby
[15:44:52] Ox0dea: pontiki: No, that page is a 404; it's just an explicitly disallowed username.
[15:45:44] j4cknewt: has joined #ruby
[15:45:47] celly: has joined #ruby
[15:46:02] Ox0dea: pontiki: Oh, I see how I might've misinterpreted that now, but GitHub's help is on help.github.com, so I don't see why that'd be so.
[15:47:44] l0oky: has joined #ruby
[15:49:34] pontiki: if it's pitchfork and torches time, i'm in!!
[15:49:36] chouhoulis: has joined #ruby
[15:49:45] Ox0dea: Coraline: We need you!
[15:49:55] pontiki: always up for a good storming of the castle frankenstein
[15:50:13] pontiki: then beer and skittles for afters
[15:50:20] Ox0dea: I like where this is headed.
[15:50:33] [k-: Coraline: did not find consolas on my macbook :(
[15:51:11] [k-: github is made with love in ruby
[15:51:17] pontiki: ACTION consoles your lack of consolas for your console
[15:51:19] [k-: how can you do this!
[15:51:27] cornerma1: has joined #ruby
[15:51:51] Ox0dea: [k-: Is it difficult to install fonts?
[15:52:02] [k-: I doubt github is written in Ruby anymore though
[15:52:09] Ox0dea: [k-: Bits and pieces. Linguist, for instance.
[15:52:11] konsolebox: has joined #ruby
[15:52:13] pontiki: rails 2 for parts of it, still
[15:52:18] Ox0dea: I don't believe it.
[15:52:31] pontiki: i have friends
[15:52:44] [k-: Ox0dea, no, you just select all the .ttf they give you, double click, and Mac knows what to do
[15:52:48] [k-: it's a painless process
[15:52:52] ArchRogem: has joined #ruby
[15:53:11] dorei: has joined #ruby
[15:53:19] [k-: pontiki: we all have friends
[15:53:24] pontiki: sorry; i have friends that work at github and this is what they tell me
[15:54:07] einarj: has joined #ruby
[15:54:11] [k-: probe more
[15:54:12] shevy: [k- everyone abandons ruby in the late stage :<
[15:54:28] Spami: has joined #ruby
[15:55:09] nateberkopec: has joined #ruby
[15:55:11] [k-: Ruby simply can't keep up
[15:55:13] kj: why shevy?
[15:55:30] [k-: we need to optimise more common idioms
[15:55:38] [k-: 100% of them!
[15:55:47] shevy: dunno, see what [k- wrote above: <[k-> I doubt github is written in Ruby anymore though
[15:56:07] pontiki: you really have to realize github is not one thing
[15:56:12] nveselinov: has joined #ruby
[15:56:36] Ox0dea: Microservices for days!
[15:56:39] pontiki: parts are written in ruby, parts are written in go, huge parts are written in coffee/javascript
[15:56:50] [k-: so twitter is one thing? :o
[15:56:58] Ox0dea: Is Twitter still Scala?
[15:57:00] pontiki: they probably have parts written in other languages, too
[15:57:10] pontiki: twitter is definitely not one thing
[15:57:35] [k-: but we all know twitter is Scala!
[15:57:40] pontiki: the main messaging service is still scala afaik
[15:58:11] pontiki: i don't know anyone who works there anymore
[15:58:28] [k-: anymore :(
[15:58:46] mike___1234: has joined #ruby
[15:59:02] [k-: at least github pages is Ruby!
[16:00:53] [k-: I have proof, look!
[16:00:55] [k-: https://github.com/blog/1992-eight-lessons-learned-hacking-on-github-pages-for-six-months
[16:01:28] fenjamin: has joined #ruby
[16:01:31] kj: correct
[16:01:39] fenjamin: http://pastie.org/10301006
[16:01:51] kj: ruby is loosing its charm bad news..
[16:02:43] [k-: Ruby is dying is nonsense
[16:02:48] kj: intially twitter used ruby but got converted into scala somewhat is going with git i think
[16:03:52] Channel6: has joined #ruby
[16:04:00] fenjamin: i have an output of a .csv file into one array, need nested into 4 elements
[16:04:25] htmldrum: has joined #ruby
[16:05:34] Ox0dea: fenjamin: Could you clarify?
[16:05:41] veduardo: has joined #ruby
[16:06:22] weemsledeux: has joined #ruby
[16:06:40] [k-: ?wordcrime
[16:06:41] ruboto: I don't know anything about wordcrime
[16:06:48] Spami: has joined #ruby
[16:06:51] fenjamin: pastie takes a .csv file and returns an array from a row however i need that array nested into 4 elements. [[a,b,c,d],[e,f,g,h],[i,j,k,l],[m,n,o,p]]
[16:07:06] tmtwd: has joined #ruby
[16:07:33] fenjamin: rather 4 elements per nested array into however many arrays as the dataset.
[16:08:05] [k-: fenjamin: you need to work more on your phrasing :s
[16:09:39] htmldrum: has joined #ruby
[16:10:13] fenjamin: among problem solving abilities.
[16:10:25] fenjamin: which are correlated quite possibly.
[16:11:23] fenjamin: is it understandable? i have [a,b,c,d,e,f,g,...z] need [[a,b,c,d],[e,f,g,h],[i,j,k,l]. . etc]
[16:11:38] [k-: (I need to have a collection of [arrays of 4 elements] created when I read data from a CSV file)
[16:11:56] [k-: examples are always nice
[16:11:57] shevy: hmm there was a method for that .... was it zip ? hmm or group_by ...
[16:12:57] [k-: fenjamin: can you show us what the CSV looks like?
[16:13:20] joneshf-laptop: has joined #ruby
[16:13:24] fenjamin: https://docs.google.com/spreadsheets/d/1X-Iby8lActVhcQ4Ng4tgI615BodflLdcKFYU6Rt0B8w/edit?usp=sharing
[16:13:26] allcentury: has joined #ruby
[16:13:35] FenrirReturns: fenjamin: If you already have an array and just want it grouped like the that, check out http://ruby-doc.org/core-2.2.0/Enumerable.html#method-i-each_slice
[16:13:44] edwinvdgraaf: has joined #ruby
[16:14:33] fenjamin: to clarify: i would append this to the .csv parameter?
[16:15:04] fenjamin: foreach('file.csv', headers:true).each_slice(4)
[16:15:18] FenrirReturns: fenjamin: your_array.each_slice(4).to_a should do what you're describing, since Array includes Enumerable and each_slice takes an argument and returned an Enumerable, and that provides to_a
[16:15:50] [k-: I never knew what that method was for ;)
[16:16:30] pontiki: i find it profitable to keep reviewing Enumerable. so many methods...
[16:16:42] Ox0dea: >> [1, 2, 3, 4].each_cons(2).to_a
[16:16:43] ruboto: Ox0dea # => [[1, 2], [2, 3], [3, 4]] (https://eval.in/401226)
[16:17:23] GitGud: has joined #ruby
[16:17:26] [k-: that is different from what he is describing though
[16:17:51] fenjamin: pontiki: agree FenrirReturns: curious solution - [#<CSV::Row "New York":"Alicia MacLennan" nil:nil
[16:18:25] chinmay_dd: has joined #ruby
[16:19:18] Ox0dea: [k-: I was just showing off another of Enumerable's lesser-known methods.
[16:20:04] FenrirReturns: @fenjamin that's becuase you're putting the object in the array, not to_s or whatever it is you really want.
[16:20:37] pontiki: #zip is fun, too; i was looking at a chunk of code and was like !OMG! i can use zip here!! (was an each_with_index then using index for another collection)
[16:22:09] Ox0dea: Also, #grep takes an optional block to apply to the results:
[16:22:10] Ox0dea: >> [*?a..?z].grep(/[aeiou]/, &:succ)
[16:22:11] ruboto: Ox0dea # => ["b", "f", "j", "p", "v"] (https://eval.in/401227)
[16:22:44] iateadonut: has joined #ruby
[16:23:41] dimasg: has joined #ruby
[16:24:57] tubuliferous_: has joined #ruby
[16:25:47] [k-: I used Array#rotate to solve the Josephus problem
[16:25:52] Rubie: has joined #ruby
[16:25:53] Alina-malina: has joined #ruby
[16:26:45] modern: has joined #ruby
[16:26:56] Silox|: has joined #ruby
[16:27:44] jpfuentes2: has joined #ruby
[16:28:14] arooni-mobile: has joined #ruby
[16:29:03] Ox0dea: [k-: I bet it could be done with a wicked-clever #slice!.
[16:29:08] Pupeno: has joined #ruby
[16:29:57] arup_r: why don't we have updated doco for Ruby in this site.. still 2.0.0 http://docs.ruby-lang.org/en/2.0.0/Hash.html :)
[16:30:40] pontiki: any reason you don't use the new doc?
[16:30:53] pontiki: why would new docs be written in an old path?
[16:31:51] arup_r: I googled hash and it came first
[16:32:04] arup_r: so got curious why not updated
[16:32:27] Ox0dea: arup_r: Because it's been moved: http://ruby-doc.org/core-2.2.2/Hash.html
[16:32:40] arup_r: not aware of
[16:32:45] pontiki: google is not always your friend
[16:32:58] Ox0dea: It learns, though.
[16:33:09] arup_r: one link is old and another is updated.. I thought both are same
[16:33:27] rudak__: has joined #ruby
[16:33:31] [k-: google should show the magic links
[16:34:02] htmldrum: has joined #ruby
[16:34:52] tsvenson: has joined #ruby
[16:37:07] kies^: has joined #ruby
[16:38:47] pontiki: i just pin this in a tab on chrome: http://ruby-doc.org/core-2.2.2/
[16:39:17] Alina-malina: has joined #ruby
[16:40:24] wpp: has joined #ruby
[16:41:07] j4cknewt: has joined #ruby
[16:41:24] centrx: has joined #ruby
[16:42:09] centrx: has joined #ruby
[16:42:46] jpfuentes2: has joined #ruby
[16:43:33] chipotle: has joined #ruby
[16:44:13] shevy: long live firefox! \o/
[16:44:41] arup_r: shevy, I am done.. but got another.. :(
[16:44:51] shevy: more php? you are a poor person
[16:45:03] celly: has joined #ruby
[16:45:10] arup_r: o^o ........ hummmmmmm
[16:45:15] shevy: the only rewrites I have to do are from my old code... which is more than enough torture as is
[16:45:15] [k-: reject their demands
[16:45:40] shevy: the more code, the harder it gets to manage it :(
[16:45:59] [k-: i bet shevy uses 1.8.7
[16:46:42] arup_r: I can't reject... :/ I have to
[16:47:08] arup_r: but after converting it to Ruby the code looks like `gal`.. really.. :)
[16:47:11] tsvenson: has joined #ruby
[16:47:31] [k-: get a php dev in
[16:47:38] [k-: and tell him to write Ruby
[16:47:52] [k-: you will have done him and the world a favor
[16:49:31] toretore: has joined #ruby
[16:50:42] chouhoulis: has joined #ruby
[16:53:04] ne1l: has joined #ruby
[16:55:13] [k-: I expect by 2016 that the number of users would have increased by 1%
[16:55:23] [k-: I call this the k's law
[16:56:21] shevy: [k- I see that you have not been long on #ruby as otherwise you would know that I am on ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
[16:56:48] arup_r: has joined #ruby
[16:57:11] [k-: lies, you definitely only write legacy Ruby
[16:57:54] Ox0dea: shevy: Still?!
[16:57:57] [k-: how many users do we have now
[16:58:03] Casty: has joined #ruby
[16:58:03] shevy: what do you mean with still
[16:58:10] [k-: Ox0dea is on 2.3
[16:58:12] Ox0dea: [k-: 2**10-1
[16:58:27] shevy: that is not an official ruby
[16:58:28] [k-: I mean #ruby
[16:58:32] shevy: ftp://ftp.ruby-lang.org/pub/ruby/
[16:58:41] pothibo: has joined #ruby
[16:58:50] [k-: obviously Ox0dea has means to access 2.3
[16:58:59] Ox0dea: As does everyone else?
[16:59:05] shevy: totally useless
[16:59:31] dgutierrez1287: has joined #ruby
[16:59:55] Ox0dea: shevy: Then why do you follow the ChangeLog?
[17:00:00] Ox0dea: What do you stand to gain?
[17:00:01] [k-: useless?
[17:00:07] shevy: to have a look at what is upcoming
[17:00:12] [k-: yeah, he follows it a lot
[17:00:16] Ox0dea: shevy: But why not wait until you can actually use it?
[17:00:32] shevy: to then digest xxxxx information when I can digest x information before?
[17:00:33] DEA7TH_: has joined #ruby
[17:00:34] [k-: he pings me every time he looks at it :/
[17:00:49] shevy: [k- no worries! no more pings for you in regards to the changelog
[17:01:14] [k-: I don't read the changelog, I don't know how to
[17:01:31] mxrguspxrt: has joined #ruby
[17:02:18] DEA7TH_: has joined #ruby
[17:04:24] tsvenson: has joined #ruby
[17:06:03] niemcu: has joined #ruby
[17:06:40] arup_r: how you guys declared default value for Hash, I don't like my approach.. :/
[17:06:42] arup_r: https://gist.github.com/aruprakshit/43e4f4b0865f31adf915
[17:08:10] Ox0dea: arup_r: What do you think is bad about it?
[17:08:30] mistermocha: has joined #ruby
[17:09:07] pontiki: i think that's perfectly fine
[17:09:20] Ox0dea: The only sane alternative would be foo = Hash.new('bar'), followed by a bunch of foo['x'] = 'y', which is hardly an improvement.
[17:09:49] arup_r: it seems like.. I'm doing something twice.. I went with Hash.new { } syntax.. but with that also I need to do twice.. I am thinking if I can do it in a single definition..
[17:10:24] pontiki: you're not repeating your self, if that's your concern
[17:11:20] arup_r: as you guys support .. I will go with my code.. I was just curious to see if any improvement is possible
[17:11:57] sinkensabe: has joined #ruby
[17:12:04] Ox0dea: arup_r: You can get quite fancy with Hash.new, but not when your data is completely static.
[17:12:38] arup_r: Yes.. I have static data
[17:12:56] Ox0dea: arup_r: No sense in complicating things, then.
[17:13:12] Ox0dea: >> foo = Hash.new { |h, k| h[k] = Hash.new &h.default_proc }; foo[1][2][3][4][5]; foo
[17:13:13] ruboto: Ox0dea # => {1=>{2=>{3=>{4=>{5=>{}}}}}} (https://eval.in/401242)
[17:13:21] Ox0dea: Autovivification will always be my favorite Hash trick.
[17:14:43] endash: has joined #ruby
[17:15:50] arooni-mobile: has joined #ruby
[17:16:03] arup_r: one more thing.. just wanted to know.. Do you people write STATUS_CODE or StatusCode ? which one Ruby community follow ?
[17:16:52] arup_r: while declaring constants
[17:17:07] Ox0dea: I think SCREAMING_SNAKE_CASE is, as the name might imply, unnecessarily noise, but it's the most common style.
[17:17:57] centrx: MULTIWORD_CONSTANTS_ARE_NAMED_LIKE_THIS
[17:18:17] Ox0dea: But only because tradition.
[17:18:18] zenguy_pc: has joined #ruby
[17:18:35] centrx: Also because it's the best way
[17:19:04] centrx: All the other options are taken. Something has to be all-caps
[17:19:23] fabrice31: has joined #ruby
[17:20:15] marr: has joined #ruby
[17:20:27] Ox0dea: centrx: Because we have to differentiate between constants and modules at the syntactic level?
[17:21:34] centrx: yeah they're very different
[17:21:34] zr2d2: has joined #ruby
[17:21:41] centrx: methods and variables have the same naming style though
[17:21:47] centrx: but methods often have (params)
[17:21:57] centrx: and that's Ruby-specific, calling methods without ()
[17:22:10] Ox0dea: centrx: I was being facetious; Ruby gives us the ability to determine that something is a class irrespective of its name.
[17:22:40] centrx: Ruby gives us the ability to determine what a method or variable does irrespective of its name
[17:22:52] centrx: myvar1, myvar2, myvar3
[17:22:54] centrx: names are helpful
[17:23:10] Ox0dea: Sure, but how has that anything to do with capitalization?
[17:23:56] centrx: It's faster to see that a particular name is a class/module, or variable, or method, or constant
[17:24:13] centrx: Ruby could remove the starts-with-caps-is-a-constant
[17:24:26] centrx: or it could add all-caps-means-constant and is unmodifiable
[17:25:08] pontiki: it's all about how you wish to communicate to your team mates, now and in the future. i.e., it's a human communication thing
[17:25:21] pontiki: which is what coding standards are for
[17:26:09] Ox0dea: >> Complex.constants(false)
[17:26:10] ruboto: Ox0dea # => [:compatible, :I] (https://eval.in/401244)
[17:26:29] Yiota: has joined #ruby
[17:27:06] centrx: >> RUBY_VERSION
[17:27:07] ruboto: centrx # => "2.2.0" (https://eval.in/401245)
[17:27:15] therealfibonacci: has joined #ruby
[17:27:15] Ox0dea: 21>> Complex.constants(false)
[17:27:16] ruboto: Ox0dea # => [:compatible, :I] (https://eval.in/401246)
[17:27:43] Ox0dea: centrx: Or were you not checking which version of Ruby has a non-capitalized constant?
[17:28:03] centrx: I don't have this Complex::compatible in my Ruby
[17:28:27] centrx: What is it?
[17:28:30] Ox0dea: It's a secret constant.
[17:28:33] Ox0dea: For internal use only.
[17:28:40] Ox0dea: It's probably a bug that it shows up in #constants, to be honest.
[17:28:56] kies^: has joined #ruby
[17:28:58] Ox0dea: There are loads of internal instance variables with no leading @ that get hidden in #instance_variables.
[17:29:31] Ox0dea: *hidden from
[17:29:43] ndrei: has joined #ruby
[17:29:59] Ox0dea: I patched my local Ruby to get at them: https://gist.github.com/0x0dea/7d288ea71387856b4330
[17:30:00] alphaatom: has joined #ruby
[17:30:04] Yiota: has joined #ruby
[17:30:16] poguez_: has joined #ruby
[17:30:23] Ox0dea: That's pretty much the sanest way to implement Enumerator::Lazy, but I enjoyed seeing it first-hand.
[17:31:02] livcd_: guys what's your opinion about eloquent ruby book ?
[17:31:10] Ox0dea: livcd_: It's great. Go read it.
[17:31:14] Ox0dea: (Really.)
[17:31:26] peter_paule: has joined #ruby
[17:31:28] ljarvis: yeah it's a decent book
[17:31:48] pontiki: a classic, but not in the Twain sense of classic
[17:31:49] livcd_: i like how you had to add that no-irony disclaimer :D
[17:32:11] ljarvis: Anything is better than the Pickaxe
[17:32:23] Ox0dea: ljarvis: Metaprogramming Ruby 2?
[17:32:37] TinkerTyper: has joined #ruby
[17:32:46] ljarvis: Ox0dea: Haven't read it
[17:33:24] pontiki: i've read version 1, haven't gotten to read 2 yet
[17:33:58] zenguy_pc: has joined #ruby
[17:34:01] Mia: has joined #ruby
[17:34:09] leat: has joined #ruby
[17:34:16] icebourg: has joined #ruby
[17:34:19] pontiki: i really enjoyed it, even if most of it isn't directly applicable to the sort of work i end up doing
[17:34:27] pontiki: it was really informative
[17:35:22] livcd_: pontiki: you are talking about what book now ?
[17:35:33] pontiki: Metaprogramming Ruby (1 or 2)
[17:36:26] pontiki: i wouldn't disrecommend the new pickaxe book, but it's far more of a reference, and you can get all the info online easily anyway
[17:36:30] totimkopf: has joined #ruby
[17:36:37] zenguy_pc: has joined #ruby
[17:37:05] pontiki: there are lots of good ruby books out there
[17:37:14] pontiki: don't limit yourself to one!
[17:37:20] Spami: has joined #ruby
[17:37:40] baweaver: has joined #ruby
[17:38:27] Hanmac: has joined #ruby
[17:39:24] Ox0dea: Unless that one is _wPGtR.
[17:40:09] peelback: has joined #ruby
[17:40:10] drewo: has joined #ruby
[17:40:22] pontiki: i've never more than glanced at it, so i wouldn't know
[17:40:33] zenguy_pc: has joined #ruby
[17:42:25] livcd_: pfff dollar is so strong
[17:42:35] livcd_: err euro is so weak..this is going to be expensive :S
[17:43:42] zenguy_pc: has joined #ruby
[17:45:43] momomomomo: has joined #ruby
[17:49:32] eGGsha: has joined #ruby
[17:50:15] livcd_: i need to practice focusing while reading
[17:50:19] schaerli: has joined #ruby
[17:50:19] nettoweb: has joined #ruby
[17:50:23] livcd_: i tend to automatically skip the boring parts
[17:50:37] livcd_: and then i miss all of the nuances :S...anybody has a similar issue ?
[17:51:24] chouhoulis: has joined #ruby
[17:51:50] MasterPiece: has joined #ruby
[17:51:53] schaerli: has joined #ruby
[17:52:59] therealfibonacci: livcd_ same here
[17:54:34] zenguy_pc: has joined #ruby
[18:00:00] zenguy_pc: has joined #ruby
[18:00:24] T3: has joined #ruby
[18:00:47] zenguy_pc: has joined #ruby
[18:01:21] Violentr: has joined #ruby
[18:03:41] CorySimmons: has joined #ruby
[18:04:51] DLSteve: has joined #ruby
[18:05:31] freezevee: has joined #ruby
[18:06:57] freezevee: I am trying to read a binary file and count the bits
[18:07:08] yeticry: has joined #ruby
[18:07:35] Ox0dea: freezevee: Sounds like a blast! How far've you gotten?
[18:07:41] freezevee: I have opened the file and read each_byte, then I do .to_s(2).count('1')
[18:08:24] workmad3: has joined #ruby
[18:08:25] charliesome: has joined #ruby
[18:08:35] freezevee: Ox0dea: I have read the bits from a 4.5Mb file and it does 3.5seconds
[18:08:47] Ox0dea: That seems rather slow.
[18:08:54] freezevee: you think so ?
[18:09:08] Ox0dea: Yeah, it's not great, but this is Ruby. :P
[18:09:12] freezevee: I initially scanned the file and converted each byte to bits, then it tool 10 minutes
[18:09:16] Kalov: has joined #ruby
[18:09:29] Ox0dea: freezevee: You must've been doing that very wrongly.
[18:09:39] freezevee: and I am trying to decrease the time... so far I've gone from 4.5s to 3.5s
[18:10:09] freezevee: Ox0dea: I have two questions - first, If to_s(2) does the right thing and then what about unpack ?
[18:10:36] lkba: has joined #ruby
[18:10:40] freezevee: Ox0dea: probably when you do 8.to_s(2) must be 00001000
[18:10:46] Ox0dea: Yes, that's right.
[18:11:00] Ox0dea: >> 8.to_s(2)
[18:11:01] ruboto: Ox0dea # => "1000" (https://eval.in/401248)
[18:11:06] freezevee: Ox0dea: why '8'.unpack('b*') is wrong ?
[18:11:09] Ox0dea: As you can see, it doesn't bother with padding, but that doesn't matter for popcount.
[18:11:29] peelback: has joined #ruby
[18:11:36] Ox0dea: '8' the string != 8 the number.
[18:11:47] Ox0dea: >> "\x8".unpack('b*')
[18:11:48] ruboto: Ox0dea # => ["00010000"] (https://eval.in/401249)
[18:12:03] lordkryss: has joined #ruby
[18:12:11] Ox0dea: freezevee: Hm, do you know about ASCII?
[18:12:41] freezevee: I know that each character has its own ascii value in the ascii table
[18:12:57] Ox0dea: freezevee: Yes, that's right, and "\x8" just gets you the character at ASCII value 8.
[18:13:01] Ox0dea: It's a hexadecimal escape.
[18:13:05] tubuliferous_: has joined #ruby
[18:13:13] freezevee: Ox0dea: http://www.charstable.com/_site_media/ascii/chars-table-landscape.jpg
[18:13:17] Ox0dea: So, since 'a' is ASCII 97, we can convert that to hexadecimal 61, and then:
[18:13:20] Ox0dea: >> "\x61"
[18:13:21] ruboto: Ox0dea # => "a" (https://eval.in/401250)
[18:13:37] Mendenhall: has joined #ruby
[18:13:49] Ox0dea: >> "\x61".unpack('B*').to_i(2)
[18:13:50] ruboto: Ox0dea # => undefined method `to_i' for ["01100001"]:Array (NoMethodError) ...check link for more (https://eval.in/401251)
[18:13:53] Ox0dea: >> "\x61".unpack('B*')[0].to_i(2)
[18:13:54] ruboto: Ox0dea # => 97 (https://eval.in/401252)
[18:14:05] freezevee: what is the deal with unpack ?
[18:14:20] freezevee: I read this article http://blog.bigbinary.com/2011/07/20/ruby-pack-unpack.html
[18:14:24] Ox0dea: It takes the string and "breaks it up" according to the format specifier.
[18:14:39] freezevee: so you have to pass a string
[18:15:09] Ox0dea: Yes, and the format can get rather complex.
[18:15:27] Ox0dea: For the simple case of converting character values to 8-bit binary, 'B*' is sufficient.
[18:15:45] Rubie: has joined #ruby
[18:16:18] ohaibbq: has joined #ruby
[18:16:21] freezevee: Ox0dea: https://gist.github.com/chrisvel/3bc37acc1c1371039e2f this is my code
[18:16:33] jpfuentes2: has joined #ruby
[18:16:59] freezevee: Ox0dea: I am creating a lookup table with bytes and arrays with the amount of [0,1] bits
[18:17:04] Ox0dea: freezevee: That looks pretty involved for such a simple operation. :/
[18:17:55] freezevee: I tried to create some kind of "lookup table" in order to speed things up
[18:18:00] pocketprotector: has joined #ruby
[18:18:03] freezevee: so I don't have to count the bits
[18:18:13] htmldrum: has joined #ruby
[18:18:22] bubbys: has joined #ruby
[18:18:45] freezevee: so If I read 23 123 11 234 22 111 from the file, then I call hblt[23] and automatically I get the array of counted '1's and '0'
[18:19:00] freezevee: I have to do this as an exercise so please, don't give me a solution
[18:19:07] Ox0dea: freezevee: Why an array and not just how many 1s there are?
[18:19:12] codecop: has joined #ruby
[18:19:14] codecop_: has joined #ruby
[18:19:17] freezevee: but I'd appreaciate If you tell me what I am doing wrong
[18:19:37] freezevee: Ox0dea: because I want the '0's also
[18:19:38] Ox0dea: freezevee: Well, you should strive to make your lookup table as simple (and thus fast) as possible.
[18:19:48] freezevee: I think it's called population count
[18:19:53] Ox0dea: Yes, that's right.
[18:20:11] Ox0dea: But you can get the numeber of 0s simply by subtracting the number of 1s from the total number of characters * 8, right at the end.
[18:20:20] Ox0dea: You get the number of 0s "for free".
[18:21:04] Ox0dea: Do you see what I mean?
[18:22:11] freezevee: Ox0dea: that's what I am doing
[18:22:24] freezevee: actually in that case I should count the number of bytes
[18:22:48] rickmasta: has joined #ruby
[18:23:05] freezevee: Right now I have an image with Size: 4409.817Kb
[18:23:15] Ox0dea: freezevee: You also get that "for free" via `file.stat.size`. :)
[18:24:26] freezevee: so it's 4409817 kilobytes = 35278536
[18:24:36] freezevee: 35278536 bits
[18:25:05] Ox0dea: Why these specifics?
[18:25:07] freezevee: so If I get the '1's = 18211764 you say I could just substract them to get the '0's
[18:25:31] freezevee: sorry for the specific information
[18:25:41] Ox0dea: No worries; I see now why you went there.
[18:26:05] Ox0dea: If you've got a bunch of bits, which can only be 0 or 1, and you know how many are 1, subtraction gets you how many are 0.
[18:26:11] zenguy_pc: has joined #ruby
[18:26:34] Ox0dea: Given that you know how many bits you had to start with, of course, which you can easily obtain.
[18:26:39] arooni-mobile: has joined #ruby
[18:26:51] axl_: has joined #ruby
[18:26:52] freezevee: do you think it's going to get less time ?
[18:27:07] freezevee: so I don't need a lookup table ?
[18:27:15] freezevee: I didn't think about it
[18:27:23] zenguy_pc: has joined #ruby
[18:27:26] axl_: has joined #ruby
[18:27:38] axl_: has left #ruby: ()
[18:28:07] Ox0dea: freezevee: A lookup table from {0=>0, 1=>1, 2=>1, 3=>2, 4=>1, ...} would certainly gain you some speed over doing to_s(2).count('1') on every single byte, absolutely.
[18:28:31] freezevee: let me check it
[18:29:13] ellisTAA: has joined #ruby
[18:29:27] zenguy_pc: has joined #ruby
[18:29:50] Pupeno: has joined #ruby
[18:30:22] zenguy_pc: has joined #ruby
[18:30:28] Aswebb_: has joined #ruby
[18:30:29] bruno-: has joined #ruby
[18:31:31] phroa: has joined #ruby
[18:33:04] freezevee: Ox0dea: I believe I did it
[18:33:17] freezevee: Ox0dea: 0m0.723s !!!!
[18:33:30] freezevee: but I somehow must find out If it's right
[18:33:37] freezevee: the number of bits in total
[18:33:37] Ox0dea: freezevee: Not bad.
[18:33:59] Ox0dea: freezevee: Well, you know the file's size in bytes, don't you?
[18:34:08] Ox0dea: And how many bits in a byte?
[18:34:18] freezevee: usually 8 lol
[18:34:35] Ox0dea: Well, it's not the 1970s anymore. :P
[18:34:40] freezevee: you mean to just multiply and double check with the size in bytes ?
[18:35:01] Ox0dea: freezevee: You want to verify that your answer is correct, yes?
[18:36:03] Ox0dea: Are you on Windows?
[18:37:22] shevy: windows users are dying out like the dodo
[18:38:12] mike___1234: has joined #ruby
[18:38:17] peter_paule: has joined #ruby
[18:39:29] freezevee: Ox0dea: would you write tests for a function like that ?
[18:39:39] freezevee: Ox0dea: is there any meaning in it ?
[18:39:40] devbug: has joined #ruby
[18:39:45] Ox0dea: freezevee: Well, I was going to suggest using either `od` or `xxd` to validate your results, but the former doesn't print binary and the latter doesn't print binary without also outputting address columns. :/
[18:39:55] Ox0dea: freezevee: I mean, you want to know you've written a correct method, don't you?
[18:40:19] Ox0dea: At the very least, test it on simple inputs whose answers you know to be correct (even if that means hand validation).
[18:40:45] Ox0dea: freezevee: The string "abc"?
[18:40:51] Yiota: has joined #ruby
[18:41:18] freezevee: Ox0dea: should I write a test with RSpec for that case ?
[18:41:38] Ox0dea: freezevee: Maybe take this opportunity to explore the space a bit and find the one you like best.
[18:41:55] Ox0dea: test/unit, minitest, and rspec are all nice and not in their own ways.
[18:42:35] Ox0dea: freezevee: If you were asking whether you should write a spec to verify that your code works for something as simple as "abc", then definitely yes.
[18:43:00] Ox0dea: "Fail early" so you can get back to fixing things ASAP.
[18:43:26] freezevee: I mean it's pretty simple, does it make sense to write a test ?
[18:44:02] radialneon: has joined #ruby
[18:44:10] Ox0dea: Yes, it makes sense to write a test.
[18:44:25] Ox0dea: If only to get into the habit of the thing.
[18:44:32] freezevee: and test what? it's a simple function that takes files as attributes
[18:44:38] Ox0dea: Test that it's correct...
[18:45:01] Ox0dea: You want to be able to prove that your code does what you say/think it does.
[18:45:34] Ox0dea: Even, and indeed especially after you've made some minor improvement which you think couldn't possibly affect the result.
[18:46:12] jenrzzz: has joined #ruby
[18:46:32] volsus: has joined #ruby
[18:47:16] NeverDie: has joined #ruby
[18:48:00] spider-mario: has joined #ruby
[18:49:41] jpfuentes2: has joined #ruby
[18:49:54] freezevee: Ox0dea: it's pretty awesome
[18:50:07] Ox0dea: freezevee: Shall we compare answers?
[18:50:09] freezevee: it does 0m0.758s for a file 110Mb
[18:50:17] lorn: has joined #ruby
[18:50:21] freezevee: I can't believe it
[18:51:10] gamename: has joined #ruby
[18:51:46] mike___1234: has joined #ruby
[18:52:18] timonv: has joined #ruby
[18:53:10] phroa: Hey there. I'm writing a script that at one point executes `./configure --with-some-options'. Problem being, the options I pass appear to be ignored. Here's what I've tried and what breaks: https://gist.github.com/anonymous/51144060a5dba330f2a5
[18:53:30] phroa: as far as I know, that's correct syntax/usage. Any other details that would be helpful?
[18:55:34] Ox0dea: phroa: You're on the right track with `system *command`.
[18:55:47] Ox0dea: phroa: Rename "command" to "options". :)
[18:55:56] yqt: has joined #ruby
[18:56:14] Carnage\: has joined #ruby
[18:56:28] phroa: would it seriously work, or is that just better variable naming? :P
[18:56:52] Ox0dea: phroa: No, there's one last piece to the puzzle before it would work as you'd like.
[18:57:21] Ox0dea: phroa: Erm, wait; I might be derping.
[18:58:13] icebourg: has joined #ruby
[18:58:21] Ox0dea: phroa: Yeah, either of your approaches really ought to work. :/
[18:58:40] Ox0dea: Are you sure you're not generating syntax errors in your interpolations?
[18:58:41] phroa: I'm totally stumped. I copy the generated command and run it in a shell and it works :/
[18:59:06] phroa: Ox0dea: puts output in array form and array.join form: https://gist.github.com/anonymous/e78a4893926b601e7678
[18:59:08] pandaant: has joined #ruby
[18:59:16] phroa: which I can directly run
[19:00:02] Ox0dea: ++stumped :<
[19:00:24] phroa: the output is actually `puts %x[echo #{command.join ' '}]' -- so obviously ruby knows there's a command there
[19:00:55] serivich: has joined #ruby
[19:01:05] phroa: I've been banging my head against the wall on this for the past four days at work
[19:01:17] phroa: every time I fix one issue another doubly hard one crops up with this damn program
[19:01:40] Pupeno: has joined #ruby
[19:02:39] Yiota: has joined #ruby
[19:02:50] phroa: on ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
[19:03:13] Ox0dea: phroa: This'll sound a little silly, but what happens if you write your command out to some file foo, then `sh foo`?
[19:03:57] phroa: that does sound silly :P one sec
[19:04:39] lkba_: has joined #ruby
[19:05:03] Ox0dea: That is, %x(sh foo), to clarify.
[19:06:30] l0oky: has joined #ruby
[19:07:08] phroa: errors out
[19:07:15] phroa: `cat foo' shows the proper command though
[19:07:31] phroa: if I run `sh foo' in a terminal it works
[19:07:44] phroa: I'm not going nuts, right? this should work?
[19:07:47] phroa: %x[echo #{command.join ' '} > foo]
[19:07:48] phroa: %x[sh foo]
[19:08:12] bashusr: has joined #ruby
[19:08:51] yqt: has joined #ruby
[19:08:53] phroa: I certainly feel like I'm going nuts
[19:09:42] c355E3B: has joined #ruby
[19:10:05] Ox0dea: Yeah, this is pretty strange.
[19:10:17] phroa: I guess I could try updating ruby?
[19:10:18] jhass: how about system "echo #{command.join(' ')} | tee | sh"
[19:10:23] jhass: what does that print
[19:10:41] cubicool: has joined #ruby
[19:11:12] Ox0dea: phroa: Is there any chance you're being pranked?
[19:11:25] Ox0dea: Redefining Kernel#` affects %x.
[19:11:48] phroa: yeah, I don't think so
[19:12:22] Ox0dea: Maybe check the output of Kernel.method(:`).source_location, just in case. :P
[19:12:22] Vile`: has joined #ruby
[19:12:40] judofyr: has joined #ruby
[19:12:46] phroa: jhass: fails
[19:13:00] jhass: not my question ;)
[19:13:09] phroa: irb(main):001:0> Kernel.method(:`).source_location
[19:13:17] dfockler: has joined #ruby
[19:13:20] Ox0dea: Welp, I'm outta guesses.
[19:13:27] cubicool: Hey guys, I need some advice. In python, I'm used to calling methods and specifying the argument name explicitly: foo(1, 2, x=10). I can't do anything like this in Ruby directly, unless there's something I don't know. I want to define initialize() methods that accept many different methods of invocation, so I use the technique of passing it a single (args={}) argument.
[19:13:51] jhass: ?guys cubicool
[19:13:51] ruboto: cubicool, we're not all guys - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
[19:13:54] cubicool: However, the code for testing this Hash (the size, type of the arguments, etc.) is getting really, really tedious. is this common enough that there may be a library to help?
[19:14:07] ElSif: yes, there are no kw args in ruby
[19:14:17] Ox0dea: >> def foo(x:, y:); x + y; end; foo(y = 17, x = 25) # cubicool
[19:14:18] ruboto: Ox0dea # => wrong number of arguments (2 for 0) (ArgumentError) ...check link for more (https://eval.in/401256)
[19:14:19] jhass: wrong, Ruby 2.0 and 2.1 introduced them
[19:14:26] sinkensabe: has joined #ruby
[19:14:31] Ox0dea: >> def foo(x:, y:); x + y; end; foo(y: 17, x: 25)
[19:14:32] ruboto: Ox0dea # => 42 (https://eval.in/401257)
[19:14:34] Ox0dea: That was bad.
[19:14:39] jhass: cubicool: so since Ruby 2.0 you can use keyword args, since 2.1 you can use required ones
[19:14:57] Ox0dea: ElSif: Please don't do that.
[19:15:04] ElSif: lol what??
[19:15:04] centrx: jhass, Yes we are: guy, n. - A person of grotesque appearance, esp. with reference to dress; a ???fright???.
[19:15:07] yosafbridge: has joined #ruby
[19:15:12] cubicool: Wow, nice. The job I'm at currently, however (I'm learning Ruby "as-I-go" there) is stuck on 1.9.3.
[19:15:15] Ox0dea: ElSif: Spew misinformation?
[19:15:15] jhass: ?guys2 centrx
[19:15:15] ruboto: centrx, it doesn???t matter if it???s "normal"/gender neutral to say "guys" in your idiolect. "You guys" to refer to a mixed group is erasure. All we ask from you is to be a decent channel member and respect that. If you want to further discuss this, join #ruby-offtopic.
[19:15:30] cubicool: Thanks for the information. :)
[19:15:33] cubicool: Maybe I can get them to upgrade.
[19:15:43] shevy: cubicool you could try to use a hash if you are on 1.9.x
[19:15:55] ruboto: I don't know anything about ugly
[19:15:57] ElSif: ok ill keep my 'you could have googled that' jokes to myself
[19:16:07] Ox0dea: cubicool: Even on 1.9, you can use a final Hash argument to emulate keyword arguments.
[19:16:09] cubicool: shevy: That is how I'm doing it now, I just have tons of conditional code and it doesn't have that Ruby beauty.
[19:16:11] jpfuentes2: has joined #ruby
[19:16:13] Ox0dea: It's not perfect, but it sufficed for a long time.
[19:16:22] cubicool: Ox0dea: I use that too, actually.
[19:16:32] shevy: yeah, I end up having to do lots of hash-query checking when I use hash-as-keywords
[19:16:56] jhass: cubicool: well, Ruby 1.9 is EOL (no official security updates anymore) and Ruby 2.0 is set to EOL February 2016, so there are more serious reasons to upgrade ;)
[19:16:59] Ox0dea: cubicool: Well, 1.9.3 is "dead" since February, so yo should be...
[19:17:02] Ox0dea: Yeah, that.
[19:18:10] nofxx: has joined #ruby
[19:18:30] jhass: phroa: so, my command produced no output?
[19:18:42] _blizzy_: has joined #ruby
[19:19:17] phroa: jhass: er, sorry, alt-tabbed. here's the output, same as always https://gist.github.com/anonymous/46701fd5ece44c55531b
[19:19:29] eGGsha: has joined #ruby
[19:20:00] fabrice31: has joined #ruby
[19:20:47] jhass: the ../'s in the paths are kinda weird
[19:20:56] Ox0dea: phroa: You don't have write-access to the directory you're trying to build in.
[19:21:04] jhass: I wonder if they don't get resolved
[19:21:28] ElSif: sounds like a permissions error yea
[19:21:29] phroa: jhass: well, I can copy the exact command and run it in a shell, so that isn't happening
[19:21:39] jhass: phroa: yeah, in your shell
[19:21:48] jhass: I'm saying Ruby/the shell ruby invokes might not
[19:21:50] phroa: not sure how I wouldn't have write access - this script downloads and unzips the source tarball...
[19:21:55] phroa: let me run some permissions checks
[19:22:33] ElSif: coul the permissions on the tarballed files be strange? what args are you using to untar?
[19:22:41] jhass: phroa: try resolving them by hand (or with File.expand_path if you need to do it programmatically)
[19:22:58] pwnz0r: has joined #ruby
[19:23:21] phroa: jhass: er, actually; would the fact that `%x[echo command > foo]' generates a file named foo be proof enough? because I tried that earlier and it worked.
[19:23:30] phroa: by worked I mean the file was written, script still failed :(
[19:23:55] phroa: ElSif: %x[curl -fSsl #{CURL_URL} -o - | tar -zxf -]
[19:24:07] phroa: yes, it works
[19:24:16] jhass: phroa: proof of what?
[19:24:29] phroa: jhass: that ruby has write permission to the directory
[19:24:34] Tritone: has joined #ruby
[19:24:43] jhass: I never claimed it hasn't, Ox0dea did
[19:24:48] phroa: wait, it was Ox0de...yeah
[19:24:52] phroa: whoops :P
[19:24:56] jhass: I claimed it fails to resolve the /../ in the path
[19:25:10] jhass: *paths, even
[19:26:04] _blizzy_: has joined #ruby
[19:29:04] dont-panic: has joined #ruby
[19:30:35] phroa: jhass: late reply, but `puts %x[ls #{bin_path}/../]' works
[19:30:51] ElSif: and you are just running this script with 'ruby blah.rb' not any special command line magic?
[19:30:57] jhass: try resolving them
[19:31:42] mistermocha: has joined #ruby
[19:31:49] phroa: I'm unsure what you mean by 'resolve' if the `ls' wasn't it
[19:32:08] phroa: ElSif: ./script.rb with a shebang, but I could use `ruby` if you like
[19:32:15] ElSif: no thats fine
[19:32:48] jhass: phroa: change the paths so that they don't contain any /../ if you pass them to configure
[19:34:29] leat: has joined #ruby
[19:36:29] ElSif: you could try adding -p to your tar args
[19:36:47] phroa: jhass: removed ../, fails
[19:37:35] jhass: how about explicitly calling the shell in which "it works"?
[19:37:36] phroa: just kidding, had more ../s than I thought
[19:37:44] phroa: let me remove those and try that
[19:38:00] jhass: system "/bin/bash -c '#{command.join(" ")}'"
[19:39:17] yfeldblum: has joined #ruby
[19:39:24] krz: has joined #ruby
[19:40:44] radialneon: has joined #ruby
[19:41:03] ElSif: phroa: have you compile things on this system with this user manually?
[19:41:56] phroa: ElSif: yes, again, I can take the output of `puts command' and run that myself.
[19:42:12] ElSif: ah, i though you had only done a 1 file test, nvm
[19:42:38] ElSif: did you try jhass last suggestion?
[19:42:52] phroa: I'm removing the ..s in the paths
[19:42:55] phroa: then I will, yes
[19:43:04] jhass: yeah, try without the .. first
[19:43:14] ragingcake: has joined #ruby
[19:43:58] freezevee: has joined #ruby
[19:44:49] TheHodge: has joined #ruby
[19:45:23] havenwood: has joined #ruby
[19:46:28] choppington: has joined #ruby
[19:47:18] futilegames: has joined #ruby
[19:47:56] peter_paule: has joined #ruby
[19:51:09] Musashi007: has joined #ruby
[19:52:16] Maletor: has joined #ruby
[19:52:17] phroa: jhass: no dice with `system "/usr/local/bin/zsh -c '#{command.join(" ")}'"' but I added a /usr/bin/env -i before it and it worked. thanks so much for getting me halfway there <3
[19:52:39] phroa: I'll have to look in to what borked the environment, but I'll save that for another day
[19:52:39] jhass: strange nonetheless
[19:52:41] pdxvegan_: has joined #ruby
[19:52:53] phroa: toodle-oo
[19:52:55] phroa: has left #ruby: ("WeeChat 1.3-dev")
[19:53:15] eggoez: has joined #ruby
[19:53:27] FernandoBasso: has joined #ruby
[19:54:08] ragingcake: has joined #ruby
[19:55:06] ElSif: something with a non-interactive versus interactive shell difference??
[19:55:19] ElSif: yea that would be quite rare if it was the case
[19:55:29] gemmy: has joined #ruby
[19:55:48] ElSif: for just running a local script anyways
[19:58:37] ragingcake: has joined #ruby
[19:59:29] alphaatom: has joined #ruby
[19:59:35] dgutierrez1287: has joined #ruby
[20:00:50] Aym_C: has joined #ruby
[20:01:15] tubuliferous_: has joined #ruby
[20:01:34] Casty: has joined #ruby
[20:04:08] shevy: long live ruby \o/
[20:04:37] NeverDie: has joined #ruby
[20:05:13] Muhannad: has joined #ruby
[20:05:13] ruby-lang619: has joined #ruby
[20:05:31] Bloodshot: has joined #ruby
[20:05:36] ruby-lang619: anybody here?
[20:05:42] jhass: well, you are
[20:05:55] wasamasa: if only you are there, did the tree fall down?
[20:05:59] shevy: ruby-lang619 were you not here yesterday as wel
[20:07:19] jhass: what did we do :/
[20:07:38] Yiota: has joined #ruby
[20:08:46] wasamasa: the tree fell down
[20:10:13] eGGsha: has joined #ruby
[20:10:16] ph8: has joined #ruby
[20:14:04] hololeap: has joined #ruby
[20:15:13] sinkensabe: has joined #ruby
[20:15:45] symm-_: has joined #ruby
[20:16:34] niemcu: has joined #ruby
[20:16:45] ndrei: has joined #ruby
[20:19:57] orbitalo: has joined #ruby
[20:21:10] sypheren: has joined #ruby
[20:22:25] shevy: he was using webchat so that is to be expected
[20:22:39] edenc: has joined #ruby
[20:22:56] sharpmachine: has joined #ruby
[20:25:11] ndrei: has joined #ruby
[20:26:03] Domon: has joined #ruby
[20:26:50] radialneon: has joined #ruby
[20:27:04] cjk101010: has joined #ruby
[20:28:27] Yiota: has joined #ruby
[20:31:45] zenguy_pc: has joined #ruby
[20:33:51] ragingcake: has joined #ruby
[20:40:04] eggoez: has joined #ruby
[20:42:03] nofxx: wish ruby gems had an enforce way for this http://guides.rubygems.org/name-your-gem/
[20:42:20] bruno-: has joined #ruby
[20:42:27] nofxx: I mean: "your gem was rejected, foo-bar-baz must require
[20:42:30] nofxx: foo/bar/baz*
[20:42:41] nofxx: feels too much apple store? heh
[20:42:55] pwnz0r: has joined #ruby
[20:44:27] s00pcan: has joined #ruby
[20:44:28] peelback: has joined #ruby
[20:44:38] finisherr: has joined #ruby
[20:45:03] cpg: has joined #ruby
[20:45:09] DEA7TH_: has joined #ruby
[20:45:17] nofxx: worst was this bug I faced: gem is 'foo-bar', I: require 'foo/bar' strange errors happen... author wants you to r equire 'foo_bar' and my way required some part of it =/
[20:45:41] ragingcake: has joined #ruby
[20:46:10] nofxx: To be clear: not require errors, that would caught my attention, it required fine, just worked misteriously
[20:46:41] nofxx: my way == correct way btw
[20:47:43] nofxx: hmm... now need to hear the song, sid vicious or sinatra?
[20:48:14] Agoldfish: has joined #ruby
[20:48:59] g3funk: has joined #ruby
[20:49:26] ragingcake: has joined #ruby
[20:52:13] shevy: nofxx what will it reject precisely?
[20:53:40] icebourg: has joined #ruby
[20:57:36] RobertBirnie: has joined #ruby
[20:59:03] Fezzler: has joined #ruby
[21:00:21] woodruffw: has joined #ruby
[21:01:38] nofxx: shevy, http://guides.rubygems.org/name-your-gem/
[21:02:03] Maletor: has joined #ruby
[21:02:06] nofxx: shevy, enforce... or at least give a warn
[21:02:12] shevy: yeah I still don't know what it will reject when
[21:02:18] nofxx: and a atta boy when its ok
[21:02:43] nofxx: shevy, just gave a rant/example
[21:03:33] sarkyniin: has joined #ruby
[21:03:46] nofxx: this foo-bar gem that have a lib/foo_bar.rb you are expect to require: Rubygems: [WARN] Your lib should countain a requirable lib/foo/bar.rb
[21:08:09] DEA7TH_: has joined #ruby
[21:08:56] l0oky: has joined #ruby
[21:11:49] zacstewart: has joined #ruby
[21:12:00] pengin: has joined #ruby
[21:12:28] Silox|: has joined #ruby
[21:13:18] bruno-: has joined #ruby
[21:14:51] JackBQuik: has joined #ruby
[21:15:57] sinkensabe: has joined #ruby
[21:18:20] allcentury: has joined #ruby
[21:18:53] martinbjeldbak: has joined #ruby
[21:21:55] martinbjeldbak: has joined #ruby
[21:24:11] Musashi007: has joined #ruby
[21:25:33] j4cknewt: has joined #ruby
[21:27:09] Xoro: has joined #ruby
[21:27:44] Channel6: has joined #ruby
[21:28:11] RobertBirnie: has joined #ruby
[21:29:51] ndrei: has joined #ruby
[21:31:30] solars: has joined #ruby
[21:32:43] BTRE: has joined #ruby
[21:33:52] FernandoBasso: has joined #ruby
[21:34:35] quimrstorres: has joined #ruby
[21:36:00] lkba: has joined #ruby
[21:36:27] alphaatom: has joined #ruby
[21:37:13] Pupeno_: has joined #ruby
[21:41:29] quazimodo: has joined #ruby
[21:42:20] senayar: has joined #ruby
[21:42:23] icebourg: has joined #ruby
[21:42:32] ragingcake: has joined #ruby
[21:43:27] Domon: has joined #ruby
[21:44:33] endash: has joined #ruby
[21:44:58] pandaant: has joined #ruby
[21:45:13] njection: has joined #ruby
[21:46:26] pyrotecnix: has joined #ruby
[21:47:55] ajaiswal: has joined #ruby
[21:47:56] ta: has joined #ruby
[21:48:54] postmodern: has joined #ruby
[21:49:16] Asher1: has joined #ruby
[21:49:25] tubuliferous_: has joined #ruby
[21:49:58] Asher: has joined #ruby
[21:50:03] radialneon: has joined #ruby
[21:50:47] dimasg: has joined #ruby
[21:51:02] armyriad: has joined #ruby
[21:51:26] Rubie: has joined #ruby
[21:51:53] zacstewart: has joined #ruby
[21:52:27] Hanmac: has joined #ruby
[21:52:48] mozzarella: has joined #ruby
[21:52:50] maknz: has joined #ruby
[21:52:56] ragingcake_: has joined #ruby
[21:55:24] ellisTAA: has joined #ruby
[21:55:58] lkba: has joined #ruby
[21:57:48] jhass: well, it did in your case, right? how would you detect it's not the "right" one?
[21:58:38] athos_diddy: has joined #ruby
[21:58:52] devbug: has joined #ruby
[21:59:19] vdamewood: has joined #ruby
[22:01:27] maknz: has joined #ruby
[22:02:06] Maletor: has joined #ruby
[22:02:12] decoponio: has joined #ruby
[22:03:09] BTRE: has joined #ruby
[22:03:11] finisherr: has joined #ruby
[22:04:13] Tritone: has joined #ruby
[22:06:51] _blizzy_: has joined #ruby
[22:07:34] sporkmonger: has joined #ruby
[22:09:09] sistema32: has joined #ruby
[22:10:03] ScriptGeek: has joined #ruby
[22:13:37] radialneon_: has joined #ruby
[22:14:20] radialneon_: has joined #ruby
[22:14:57] davedev24: has joined #ruby
[22:15:03] _blizzy_: has joined #ruby
[22:16:46] sinkensabe: has joined #ruby
[22:19:49] prasselpikachu: has joined #ruby
[22:20:36] sharpmachine: has joined #ruby
[22:21:11] lorikeet: has joined #ruby
[22:22:07] hahuang65: has joined #ruby
[22:25:36] miwood: has joined #ruby
[22:25:48] sporkmonger: has joined #ruby
[22:26:36] dgutierrez1287: has joined #ruby
[22:27:31] bruno-: has joined #ruby
[22:27:33] CustosLimen: has joined #ruby
[22:29:07] htmldrum: has joined #ruby
[22:29:16] ValicekB: has joined #ruby
[22:31:49] borkdude: has joined #ruby
[22:33:54] CloCkWeRX: has joined #ruby
[22:34:36] allcentury: has joined #ruby
[22:38:47] zenguy_pc: has joined #ruby
[22:39:09] quimrstorres: has joined #ruby
[22:39:22] l0oky: has joined #ruby
[22:39:39] desigx: has joined #ruby
[22:40:55] blue_deref: has joined #ruby
[22:42:33] Yiota: has joined #ruby
[22:46:37] Blaguvest: has joined #ruby
[22:49:28] MEATCHICKEN: has joined #ruby
[22:49:47] Thomas-0725: has joined #ruby
[22:50:02] MEATCHICKEN: Is there a way I can convert string matches to captures @ regex?
[22:50:05] MEATCHICKEN: such as "/posts/{id}".gsub(/{.+}/,"\\(.+)\\")
[22:50:13] MEATCHICKEN: trying to create a basic router for learning
[22:50:22] duoi: has joined #ruby
[22:51:19] jhass: meatchicken: sure, just stuff the result into Regexp.new to turn it into one
[22:51:20] pengin: has joined #ruby
[22:52:22] Spami: has joined #ruby
[22:52:24] MEATCHICKEN: jhass: let me try - last time it threw an error because I tried using it with union
[22:54:57] finisherr: has joined #ruby
[22:55:50] bodgix: has joined #ruby
[22:57:52] prasselpikachu: has joined #ruby
[22:58:31] stantonnet: has joined #ruby
[22:58:31] zenguy_pc: has joined #ruby
[22:59:00] _blizzy_: has joined #ruby
[22:59:14] Hanmac: has joined #ruby
[22:59:27] CustosLimen: has joined #ruby
[23:01:06] quimrstorres: has joined #ruby
[23:01:07] ScriptGeek: has joined #ruby
[23:03:11] ellisTAA: has joined #ruby
[23:03:30] sarkyniin: has joined #ruby
[23:06:41] bruno-: has joined #ruby
[23:06:56] CloCkWeRX: has joined #ruby
[23:07:00] _blizzy_: has joined #ruby
[23:08:46] sharpmachine: has joined #ruby
[23:10:35] miwood: has joined #ruby
[23:11:28] kinda: has joined #ruby
[23:15:02] finisherr: has joined #ruby
[23:17:32] sinkensabe: has joined #ruby
[23:18:32] mgorbach: has joined #ruby
[23:19:08] drewvanstone: has joined #ruby
[23:19:21] charliesome: has joined #ruby
[23:21:37] fabrice31: has joined #ruby
[23:26:53] benlovell: has joined #ruby
[23:29:06] ellisTAA: has joined #ruby
[23:29:52] Mendenhall: has joined #ruby
[23:32:03] benlovell: has joined #ruby
[23:32:16] charliesome: has joined #ruby
[23:32:44] Contigi: has joined #ruby
[23:32:54] arescorpio: has joined #ruby
[23:34:39] shinnya: has joined #ruby
[23:34:48] Tritone: has joined #ruby
[23:34:52] sharpmachine: has joined #ruby
[23:35:27] eggoez: has joined #ruby
[23:35:49] hanine: has joined #ruby
[23:36:49] ruurd: has joined #ruby
[23:37:57] tubuliferous_: has joined #ruby
[23:38:50] j4cknewt: has joined #ruby
[23:38:56] jesterfraud: has joined #ruby
[23:39:05] jbw_: has joined #ruby
[23:40:57] ruurd: >> bar = {label: 'All fields', field: 'all fields'}
[23:40:58] ruboto: ruurd # => {:label=>"All fields", :field=>"all fields"} (https://eval.in/401287)
[23:41:10] S3thc0n: has joined #ruby
[23:41:15] ruboto: ruurd # => undefined local variable or method `bar' for main:Object (NameError) ...check link for more (https://eval.in/401288)
[23:41:56] jimmychimms: has joined #ruby
[23:44:16] jesterfraud: Is there a version of ||= that only triggers on nils (instead of falses)?
[23:44:47] weaksauce: jesterfraud you can use fetch for hashes
[23:45:02] jimmychimms: hi - can someone help? I'm trying to capitalize every word in a sentence greater than 3 letters long - following code capitalizes each word, but how do i modify it so it only capitalizes words with 3 characters or more? str.split.each{|i| i.capitalize!}.join(' ')}
[23:45:10] darithorn: has joined #ruby
[23:45:14] jesterfraud: weaksauce: that helps
[23:45:48] weaksauce: though if the value is actually nil it won't override the nil value jesterfraud only if it's not been assigned anything to that key
[23:46:13] weaksauce: >> {test: nil}.fetch(:test, "yay")
[23:46:14] ruboto: weaksauce # => nil (https://eval.in/401289)
[23:46:17] jesterfraud: ah. That actually sounds really useful
[23:46:26] dseitz: has joined #ruby
[23:46:31] weaksauce: >> {}.fetch(:test, "yay")
[23:46:31] ruboto: weaksauce # => "yay" (https://eval.in/401290)
[23:48:36] sharpmachine: has joined #ruby
[23:48:48] cscheib: has left #ruby: ()
[23:50:01] quazimodo: has joined #ruby
[23:50:47] Musashi007: has joined #ruby
[23:52:31] hahuang65: has joined #ruby
[23:57:00] dtcristo: has joined #ruby
[23:58:45] sharpmachine: has joined #ruby
[23:59:57] hashrocket: has joined #ruby