« Back to channel list

#ruby - 14 December 2015

« Back 1 day Forward 1 day »
[00:00:51] jgt2: has joined #ruby
[00:01:15] ur5us: has joined #ruby
[00:05:20] SCHAAP137: has joined #ruby
[00:08:21] ruid: has joined #ruby
[00:08:22] ruid: has joined #ruby
[00:08:55] cantaberry: has joined #ruby
[00:10:26] duckpuppy: has joined #ruby
[00:12:04] rgrmatt: has joined #ruby
[00:13:49] blackgoat: has joined #ruby
[00:14:31] bklane: has joined #ruby
[00:16:02] dlitvak: has joined #ruby
[00:16:11] tvon: has joined #ruby
[00:16:45] blackgoat: has joined #ruby
[00:19:56] stannard: has joined #ruby
[00:23:27] ElFerna: has joined #ruby
[00:25:04] bithon: has joined #ruby
[00:27:45] banister: has joined #ruby
[00:28:14] dlitvak: has joined #ruby
[00:28:45] dfinninger: has joined #ruby
[00:28:51] minimalism: has joined #ruby
[00:29:25] bithon: One of the few friendly chats I've been to today :D
[00:29:25] freerobby: has joined #ruby
[00:30:22] zeroDivisible: has joined #ruby
[00:31:11] ElFerna_: has joined #ruby
[00:31:41] bklane: has joined #ruby
[00:32:25] akem: has joined #ruby
[00:32:29] shock_one: has joined #ruby
[00:32:57] whiteline: has joined #ruby
[00:36:24] rgrmatt: has joined #ruby
[00:36:48] charliesome: has joined #ruby
[00:39:59] bklane: has joined #ruby
[00:40:05] Rodya_: has joined #ruby
[00:40:13] _stu_: has joined #ruby
[00:40:59] BTRE: has joined #ruby
[00:41:08] Ropeney: has joined #ruby
[00:41:40] prereflect: has joined #ruby
[00:44:16] Ox0dea: bithon: Have Ruby question(s)?
[00:44:43] StevenXL: has joined #ruby
[00:44:43] StevenXL: has joined #ruby
[00:45:43] C0deMaver1ck: has joined #ruby
[00:47:05] bklane: has joined #ruby
[00:47:35] sdothum: has joined #ruby
[00:50:01] bithon: Ox0dea: Nope.
[00:51:34] nettoweb: has joined #ruby
[00:51:38] djbkd: has joined #ruby
[00:54:08] bronson: has joined #ruby
[00:54:45] wolffles: i probably will have a question soon
[00:55:00] jdelaney: has joined #ruby
[00:56:15] j4cknewt: has joined #ruby
[00:56:38] freerobby: has joined #ruby
[00:58:43] lyoshajapan: has joined #ruby
[01:01:36] shevy: (famous last words)
[01:01:56] kalopsian: has joined #ruby
[01:02:47] bklane: has joined #ruby
[01:03:19] bithon: I need an interesting idea for a project.
[01:03:32] bithon: Been learning ruby for some time but I can't think of anything cool that isn't too complex to work on
[01:03:46] bithon: Come on peeps of the interwebs, direct your fellow aspiring rubyist :D
[01:03:59] j416: fizzbuzz
[01:04:27] wolffles: bithon: have you done a text adventure rpg game yet?
[01:05:21] dlitvak: has joined #ruby
[01:05:29] blub: metacircular evaluator
[01:05:44] bithon: blub: a what? :D
[01:07:49] rgrmatt: has joined #ruby
[01:08:21] DavidDudson: has joined #ruby
[01:08:33] bithon: blub: could you possibly elaborate?
[01:08:48] bithon: I read that as metacircuit elevator lol
[01:09:03] bithon: Too much EE can do that to your head
[01:11:14] duckpuppy: has joined #ruby
[01:12:36] pontiki: bithon: write the game of life?
[01:13:14] bithon: I'll figure something out
[01:13:18] bithon: I wanted to write a dropbox clone
[01:13:21] bithon: (I know, lame)
[01:14:02] bklane: has joined #ruby
[01:14:04] pontiki: url shortener?
[01:15:30] StevenXL: has joined #ruby
[01:15:30] StevenXL: has joined #ruby
[01:17:02] Rodya_: has joined #ruby
[01:17:05] bbert: has joined #ruby
[01:17:11] bithon: Hmm they're all cool ideas I guess
[01:17:14] bithon: I could do some of them
[01:17:29] bithon: blub: Can you elaborate more on what metacircular evaluator is ?
[01:17:40] roshanavand: has joined #ruby
[01:17:41] bithon: I did check the wiki, but it's too absract for me right now (too tired :))
[01:17:44] Ox0dea: bithon: https://mitpress.mit.edu/sicp/full-text/book/book.html
[01:18:12] ponga: has joined #ruby
[01:18:35] bithon: Ox0dea: Oh. Thank you! Boomarked it for when the weekend comes to study the material. Thanks ;p
[01:18:44] radgeRayden__: has joined #ruby
[01:18:51] Ox0dea: SICP is a holy text; use it wisely.
[01:18:52] bbert: any advice for writing a small ruby daemon that does client I/O over TCP sockets and stores its state in a database (probably sqlite)? I'm already comfortable using TCP in Ruby. I haven't dealt with databases.
[01:18:53] pontiki: bithon: are you looking for something to practice on?
[01:19:22] jhass: bbert: not sure what kind of advice you're seeking
[01:19:36] pontiki: bbert: well, jhass beat me to the question
[01:20:03] bbert: jhass pontiki: basically, to be pointed in the right direction for dealing with databases. maybe orm
[01:20:13] jhass: bbert: check Sequel
[01:20:21] jhass: (gem called that)
[01:20:36] Ox0dea: bbert: Alternatively, use one of the pseudo-databases from the standard library.
[01:20:55] bithon: Yes sir :D
[01:20:56] jhass: does anybody really use them?
[01:21:07] bithon: Well I really just need some sort of brain teaser to keep my mind occupied
[01:21:19] jhass: bithon: codewars.com?
[01:21:22] bithon: I've just wasted the entire weekend watching tv shows and doingbasically nothing
[01:21:38] Ox0dea: bithon: Sounds like you meant to join #selfhelp.
[01:21:48] bithon: Good idea probably
[01:21:55] Ox0dea: Yeah, I wasn't being facetious.
[01:22:00] bithon: I'm either super productive and work 12-14 hours a day
[01:22:07] bithon: or I'm a total slob
[01:22:20] bithon: Can't meet in the middle even if my life depended on it
[01:22:34] ruboto_: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
[01:23:14] Ox0dea: See ya there!
[01:23:27] bithon: Well, can I still stay in this channel ?
[01:23:29] kalopsian: has joined #ruby
[01:23:52] bklane: has joined #ruby
[01:24:29] atomical: has joined #ruby
[01:27:13] bbert: Ox0dea: I like built in functionality... are you referring to something like DBM?
[01:28:25] bklane_: has joined #ruby
[01:28:37] wolffles: im sure this is super easy for you guys. i cant get my counter to count :(
[01:29:25] wolffles: def count_vowels(string)
[01:29:25] wolffles: string.scan(/[aeiou]/) { |vowels| vowels =+ 1 }
[01:29:26] wolffles: puts vowels
[01:29:28] wolffles: count_vowels("color")
[01:29:30] dfinninger: has joined #ruby
[01:29:36] ruboto_: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[01:29:59] bithon: or even pastebin ;)
[01:30:06] jhass: wolffles: anyway, I'm sure you get an error message on that
[01:30:13] jhass: shall we read it together?
[01:30:18] wolffles: yeah i need help :[
[01:31:22] jhass: well, if you want help reading the error message you gotta share it first
[01:31:38] bklane: has joined #ruby
[01:32:25] wolffles: : syntax error, unexpected '=', expecting end-of-input
[01:32:26] wolffles: =beginputs('count_vowels("abcd...
[01:32:44] charliesome: has joined #ruby
[01:33:10] krobzaur: has joined #ruby
[01:33:46] jhass: wolffles: that doesn't seem to match up with the code you posted
[01:34:09] wolffles: oh i thought i noted the other part
[01:34:28] shock_one: has joined #ruby
[01:34:40] wolffles: question5.rb:8:in `count_vowels': undefined local variable or method `vowels' for main:Object (NameError)
[01:35:24] bklane_: has joined #ruby
[01:35:45] Scripore: has joined #ruby
[01:35:45] Ox0dea: bbert: Aye, but one of {G,S,Y}DBM might better take your fancy/serve your purpose.
[01:36:12] jhass: wolffles: sorry but that still doesn't seem to match up
[01:36:14] Ox0dea: jhass: Yes, it does; wolffles used `=+`.
[01:36:28] jbrhbr: has joined #ruby
[01:36:35] Ox0dea: That was in reference to the syntax error, of course.
[01:36:37] jhass: getting tired
[01:36:57] Ox0dea: Reporting for shift change.
[01:37:27] jhass: wolffles: a local variable defined inside a block is not available outside it
[01:37:45] wolffles: oh did not know that
[01:38:10] jhass: wolffles: however a block does inherit local variables defined before it
[01:38:15] juddey: has joined #ruby
[01:40:59] Ox0dea: >> 'This sentence contains 9 vowels.'.count('aeiou') # wolffles
[01:41:00] ruboto_: Ox0dea # => 9 (https://eval.in/484537)
[01:41:43] jhass: mh, should we give a solution while theirs doesn't work?
[01:41:48] Ox0dea: >> 'foobar'.scan(/[aeiou]/).size
[01:41:49] ruboto_: Ox0dea # => 3 (https://eval.in/484538)
[01:42:27] lyoshajapan: has joined #ruby
[01:42:30] Ox0dea: jhass: I felt they were well off the right path; better to save them going over, I reckon.
[01:43:00] jhass: well, I usually do that by "look at String#count" and stuff
[01:43:06] jhass: not giving the solution right away
[01:43:15] jhass: me thinks you learn less by that
[01:45:36] wolffles: Ox0dea: thanks that was much easier than mine.
[01:45:52] Ox0dea: wolffles: And correct to boot. :P
[01:46:02] Ox0dea: Ruby loves you.
[01:46:05] jdelaney: has joined #ruby
[01:46:22] Ox0dea: Easy things are easy, hard things are easy.
[01:47:07] bithon: The words of wisom! :D
[01:47:08] wolffles: question how come in my book the code looks like (/[aeiou]/) instead you just used (???aeiou???)??? what is hte difference
[01:47:33] bklane: has joined #ruby
[01:48:04] Ox0dea: wolffles: String#scan expects a regular expression to search for, whereas String#count simply expects a string of one or more characters to tally the occurrences thereof.
[01:50:26] kalopsian: has joined #ruby
[01:50:45] prereflect: has joined #ruby
[01:50:58] baweaver: has joined #ruby
[01:51:03] al2o3-cr: jesus loves you more then you will know
[01:51:10] wolffles: hmm is there a resource i can use to see what method expects what? i feel like thats something i would want ot memorize.
[01:51:20] ruboto_: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
[01:51:26] havenwood: al2o3-cr: ^
[01:51:27] Ox0dea: havenwood: ?
[01:52:04] havenwood: wolffles: The docs do say what the various method params can be.
[01:52:06] Ox0dea: In his defense, al2o3-cr does normally contain himself to #ot.
[01:52:43] Ox0dea: &ri String#count
[01:52:44] `derpy: method `String#count`: Each +other_str+ parameter defines a set of characters to count. The intersectio??? ??? http://rubydoc.info/stdlib/core/String#count-instance_method
[01:52:55] Ox0dea: wolffles: That should work at your shell too, sans the '&'.
[01:53:52] havenwood: wolffles: One nice way to look at docs is to do it inside the Pry REPL (an alternative to IRB): gem install pry pry-doc && pry -e "show-doc String#count"
[01:55:08] al2o3-cr: havenwood: just ?
[01:55:34] havenwood: wolffles: Or in irb you can enter `help` then: String#count
[01:55:58] ledestin: has joined #ruby
[01:56:53] wolffles: woah i did the irb method and it was confusing
[01:57:05] havenwood: wolffles: Yeah, you enter a help mode. :O
[01:57:32] al2o3-cr: wolffles: carefully read it, it helps some :)
[01:57:44] TTilus: wolffles: pry is lovely in countless ways, you want to get familiar with it
[01:57:45] ElFerna_: has joined #ruby
[01:57:49] ruboto_: Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting `binding.pry` directly in your source code. Visit https://pryrepl.org/ or get it now with: gem install pry pry-doc
[01:58:12] havenwood: wolffles: In Pry try `help` for a list of Pry-specific commands.
[01:58:40] havenwood: wolffles: `ls`, `show-doc` and `show-source` are handy sometimes
[01:59:20] malconis: has joined #ruby
[01:59:32] havenwood: Or `gem-install` for that matter. Nice to install and load a gem without leaving the REPL.
[02:00:08] mitt3ns: has joined #ruby
[02:00:45] tenderlove: has joined #ruby
[02:01:08] wolffles: i dont have permission lol
[02:01:20] kalopsian: has joined #ruby
[02:01:46] ixti: has joined #ruby
[02:01:48] atomical_: has joined #ruby
[02:02:24] rickmasta: has joined #ruby
[02:03:09] ixti: has joined #ruby
[02:04:04] jdelaney: has joined #ruby
[02:04:06] darix: wolffles: gem install --user-install
[02:04:27] wolffles: i tried sudo it worked
[02:04:52] ixti: has joined #ruby
[02:05:16] al2o3-cr: Who's digging dig?
[02:05:24] framling: has joined #ruby
[02:05:30] Ox0dea: ACTION digs #dig.
[02:05:45] Ox0dea: It's essentially an "operator" too.
[02:05:47] krz: has joined #ruby
[02:06:05] avahey: has joined #ruby
[02:06:35] Feyn: has joined #ruby
[02:06:50] jhass: I reckon it operates one of these? http://blog.truck-mobiles.de/wp-content/uploads/2012/11/tm2412_scheuerle_schwerlast_02.jpg
[02:07:46] Ox0dea: By which I meant to indicate that custom objects can participate if you define #dig.
[02:08:22] Ox0dea: Probably.
[02:08:39] Ox0dea: Good for deep traversal of complex YAML, I guess.
[02:08:46] goodcodeguy: has joined #ruby
[02:08:48] sucks: has joined #ruby
[02:08:49] lyoshajapan: has joined #ruby
[02:09:12] roshanavand: has joined #ruby
[02:09:17] devoldmx: has joined #ruby
[02:09:26] jhass: I probably should move my configuration's library's API to it
[02:09:47] jhass: gosh, I can't write anymore
[02:10:58] kalopsian: has joined #ruby
[02:11:58] duckpuppy: has joined #ruby
[02:12:03] baweaver: has joined #ruby
[02:12:07] Ox0dea: al2o3-cr: Do you actually use JSON with custom "types"?
[02:12:22] al2o3-cr: Ox0dea: Nope
[02:13:00] Arnvald: has joined #ruby
[02:13:39] dfinninger: has joined #ruby
[02:13:52] Ox0dea: I must then maintain that JSON has little to do with being able to define Foo#dig and have it Do The Right Thing.
[02:14:25] al2o3-cr: Ox0dea: Ok.
[02:15:45] mitt3ns: has joined #ruby
[02:19:58] rgrmatt: has joined #ruby
[02:22:16] lyoshajapan: has joined #ruby
[02:25:12] kalopsian: has joined #ruby
[02:27:18] Yzguy: has joined #ruby
[02:28:38] Ox0dea: >> require 'yaml'; 1.times.reduce('', &:to_yaml)
[02:28:40] ruboto_: Ox0dea # => undefined method `write' for 0:Fixnum (NoMethodError) ...check link for more (https://eval.in/484542)
[02:28:44] Ox0dea: What even?
[02:28:45] weemsledeux: has joined #ruby
[02:28:56] Ox0dea: >> require 'json'; 4.times.reduce('', &:to_json)
[02:28:57] ruboto_: Ox0dea # => "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\"\\\"\"" (https://eval.in/484543)
[02:29:14] Ox0dea: Why is #to_yaml trying to do IO there?
[02:30:25] ornerymoose: has joined #ruby
[02:31:03] yfeldblum: has joined #ruby
[02:32:51] jhass: >> :to_yaml.to_proc.parameters
[02:32:52] ruboto_: jhass # => [[:rest]] (https://eval.in/484544)
[02:33:39] jhass: >> require "yaml"; Psych.method(:dump).parameters
[02:33:40] ruboto_: jhass # => [[:req, :o], [:opt, :io], [:opt, :options]] (https://eval.in/484545)
[02:33:55] dlitvak_: has joined #ruby
[02:34:53] Ox0dea: >> require 'yaml'; ''.to_yaml.to_yaml.to_yaml # jhass
[02:34:54] ruboto_: Ox0dea # => "--- |\n --- |\n --- ''\n" (https://eval.in/484546)
[02:35:04] Ox0dea: Doing it with #reduce shouldn't change that behavior?
[02:35:31] jhass: reduce yields more than one argument
[02:36:01] cantaberry: has joined #ruby
[02:36:55] jhass: >> 4.times.inject([], &:<<)
[02:36:56] ruboto_: jhass # => [0, 1, 2, 3] (https://eval.in/484547)
[02:37:53] shock_one: has joined #ruby
[02:38:48] Ox0dea: `foo.to_yaml(bar)` tries to write to `bar`, which is a little weird, but I see the potential for convenience.
[02:39:20] jhass: Crystal does that all the time since that kind of API can avoid unneeded intermediate strings
[02:39:38] jhass: so even the to_s interface is primarily to_s(IO) in crystal
[02:39:40] dlitvak: has joined #ruby
[02:40:19] Ox0dea: How does it avoid intermediate strings?
[02:40:33] Ox0dea: Do you mean "under the hood"?
[02:40:34] djbkd: has joined #ruby
[02:41:12] jhass: def to_s; "#{@a}#{@b}"; end; vs def to_s(io); @a.to_s(io); @b.to_s(io); end;
[02:41:45] jhass: or more conveniently def to_s(io); io << @a; io << @b; end; since IO#<< just calls .to_s(self)
[02:42:06] Ox0dea: I don't see how swapping the order should have any bearing?
[02:42:40] lyoshajapan: has joined #ruby
[02:42:43] jhass: well, it's more pleasant to the eye to me at least
[02:43:06] jhass: io << @a << @b works too actually since it retains the return self contract from Ruby
[02:43:16] Ox0dea: `foo.write(bar)` and `bar.write(foo)` being equivalent squicks for some reason.
[02:43:45] jhass: it's not true?
[02:44:08] Ox0dea: Close enough as pertains #to_yaml.
[02:44:25] casadei: has joined #ruby
[02:44:51] Ox0dea: I concede that `obj.to_yaml io` is nicer than `io.write obj.to_yaml`.
[02:45:10] jhass: anyway, that kind of API avoids writing an entire object hierarchy without any string allocation when done stringently
[02:46:59] doodleha_: has joined #ruby
[02:47:44] p0wn3d: has joined #ruby
[02:48:26] charliesome: has joined #ruby
[02:49:31] arescorpio: has joined #ruby
[02:52:17] al2o3-cr: jhass: When can I play hangman?
[02:53:27] jhass: 4 more hours
[02:54:30] jbrhbr: has joined #ruby
[02:54:45] bronson: has joined #ruby
[02:55:38] dlitvak_: has joined #ruby
[02:56:59] kalopsian: has joined #ruby
[02:58:34] ElFerna: has joined #ruby
[02:58:46] armyriad: has joined #ruby
[02:59:20] Bloomer: has joined #ruby
[02:59:50] charliesome: has joined #ruby
[03:00:37] Arctaire: has joined #ruby
[03:02:15] ur5us: has joined #ruby
[03:02:20] devbug: has joined #ruby
[03:02:23] al2o3-cr: What is string theory?
[03:02:39] ur5us: has joined #ruby
[03:03:08] mozzarella: ask in ##physics
[03:03:30] al2o3-cr: Apperently javascript can accomplish this
[03:05:46] Ox0dea: al2o3-cr: How come you're never this civil in #ot?
[03:06:24] al2o3-cr: Ox0dea: What do you mean by civil?
[03:06:44] goodcodeguy: has joined #ruby
[03:07:16] Ox0dea: al2o3-cr: Just not saying things like "chips and fried ricetwice with a vinyl roof, some gravy", I guess.
[03:07:24] pawnbox: has joined #ruby
[03:07:26] dlitvak: has joined #ruby
[03:07:50] al2o3-cr: Ox0dea: Well, off-topic I suppose?
[03:08:12] Ox0dea: I'm not sure that sufficiently clarifies the matter.
[03:08:14] rgrmatt: has joined #ruby
[03:08:28] Ox0dea: It's like you flip some sort of switch between here and there.
[03:09:50] al2o3-cr: Ox0dea: Thought you could express anyting in ot?
[03:10:32] al2o3-cr: apperently not
[03:10:39] slackbotgz: has joined #ruby
[03:11:06] iamdevnul: has joined #ruby
[03:12:10] al2o3-cr: Sometimes I just want to be lazy like Ruby
[03:12:43] duckpuppy: has joined #ruby
[03:14:03] prereflect: has joined #ruby
[03:15:41] blackgoat: has joined #ruby
[03:16:02] charliesome: has joined #ruby
[03:16:36] kalopsian: has joined #ruby
[03:17:00] pontiki: somehow, i never thought the point of ot was "be as annoying as possible"
[03:17:07] iateadonut: has joined #ruby
[03:17:16] pontiki: but that's probably ot
[03:17:21] AnoHito_: has joined #ruby
[03:18:04] ElFerna: has joined #ruby
[03:18:09] al2o3-cr: pontiki: You'll probably want take that to #ruby-offtopic
[03:18:12] RegulationD: has joined #ruby
[03:19:40] pontiki: too late, mate
[03:19:57] weemsledeux: has joined #ruby
[03:19:59] al2o3-cr: I thought mice never sleep?
[03:20:34] al2o3-cr: Or is that a myth?
[03:20:44] pontiki: rust never sleeps
[03:21:09] al2o3-cr: Neither does al2o3-cr
[03:21:32] roshanavand: has joined #ruby
[03:21:53] Ox0dea: https://en.wikipedia.org/wiki/Mouse_(programming_language)
[03:22:28] lyoshajapan: has joined #ruby
[03:22:37] stannard: has joined #ruby
[03:23:32] blub: the word forth isnt on that page o_o
[03:23:48] Ox0dea: Should be.
[03:24:00] al2o3-cr: blub: Welcome
[03:24:15] Ox0dea: I actually solved the first ten-or-so Project Euler problems with Mouse, but those programs are lost to time. :/
[03:25:15] GlueC: has joined #ruby
[03:26:04] tenderlove: has joined #ruby
[03:26:30] lyoshaja_: has joined #ruby
[03:28:35] kalopsian: has joined #ruby
[03:31:58] qiukun: has joined #ruby
[03:33:53] djbkd: has joined #ruby
[03:36:46] kalopsian: has joined #ruby
[03:37:24] AnoHito: has joined #ruby
[03:37:45] Exce1l: has joined #ruby
[03:37:54] dlitvak: has joined #ruby
[03:39:08] Exce1l: has left #ruby: ()
[03:39:18] jdm: has joined #ruby
[03:40:37] dlitvak_: has joined #ruby
[03:41:47] qiukun: has joined #ruby
[03:42:24] jessemcgilallen: has joined #ruby
[03:44:06] al2o3-cr: >> "Merry Christmas".center(80, [[10052].pack('U*')]*20*' ')
[03:44:07] ruboto_: al2o3-cr # => "??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? Merry Christmas??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ??? ???" (https://eval.in/484569)
[03:45:24] pawnbox: has joined #ruby
[03:48:02] dockoneal: has joined #ruby
[03:49:13] BTRE: has joined #ruby
[03:51:46] htmldrum: has joined #ruby
[03:51:48] qiukun: has joined #ruby
[03:52:35] kalopsian: has joined #ruby
[03:53:47] CloCkWeRX: has left #ruby: ()
[03:54:24] skcin7: has joined #ruby
[03:56:45] jzpmendoza: has joined #ruby
[03:58:46] dlitvak: has joined #ruby
[03:59:23] pawnbox: has joined #ruby
[03:59:32] AnoHito: has joined #ruby
[04:00:39] al2o3-cr: has joined #ruby
[04:01:15] sdothum: has joined #ruby
[04:02:41] kalopsian: has joined #ruby
[04:04:19] sdothum: has joined #ruby
[04:04:33] Rodya_: has joined #ruby
[04:06:08] qiukun: has joined #ruby
[04:06:10] sorbo_: has joined #ruby
[04:09:08] exadeci: has joined #ruby
[04:11:31] qiukun: has joined #ruby
[04:13:01] kalopsian: has joined #ruby
[04:13:29] duckpuppy: has joined #ruby
[04:13:53] jdm_: has joined #ruby
[04:14:45] braincrash: has joined #ruby
[04:16:06] krz: has joined #ruby
[04:17:56] hostess: has joined #ruby
[04:18:13] agent_white: has joined #ruby
[04:18:27] auzty: has joined #ruby
[04:18:30] agent_white: Evenin' folks
[04:19:38] dlitvak: has joined #ruby
[04:20:00] sdothum: has joined #ruby
[04:20:07] mclong: has joined #ruby
[04:21:33] tenderlove: has joined #ruby
[04:21:39] wsewolod: Evening, agent_white.
[04:22:24] Ami0: has joined #ruby
[04:22:49] pontiki: good evening, agent white. what is your report?
[04:23:45] Exce1l: has joined #ruby
[04:23:49] N1GG3RZSUCKD1CK: has joined #ruby
[04:23:49] ChanServ: +b *N1GG3R*!*@*
[04:23:49] ChanServ: ChanServ kicked N1GG3RZSUCKD1CK: Unacceptable nick - http://ruby-community.com/pages/user_rules#rule_2_10
[04:24:28] Exce1l: has left #ruby: ()
[04:25:16] Exce1l: has joined #ruby
[04:25:23] Exce1l: has left #ruby: ()
[04:25:29] agent_white: pontiki: \o ! Today I kept the peace on this planet! This planet is very peaceful!
[04:25:38] Suntzu: has joined #ruby
[04:25:49] tildes: has joined #ruby
[04:26:48] davedev24: has joined #ruby
[04:27:47] gix: has joined #ruby
[04:27:53] ornerymoose: has joined #ruby
[04:28:54] Exce1l: has joined #ruby
[04:29:02] qiukun: has joined #ruby
[04:29:03] Exce1l: has left #ruby: ()
[04:29:07] BTRE: has joined #ruby
[04:29:09] AnoHito: has joined #ruby
[04:30:09] havenwood: >> require 'prime'; [Prime.each_cons(2).take(12).map { |x, y| y ** 3 - x ** 3 }.last * 7].pack 'U'
[04:30:10] ruboto_: havenwood # => "????" (https://eval.in/484571)
[04:30:17] fp-: has joined #ruby
[04:30:30] fp-: has joined #ruby
[04:30:47] roshanavand: has joined #ruby
[04:33:27] pontiki: excellent, agent white.
[04:33:34] pontiki: you have the same assignment tomorrow.
[04:33:38] qiukun: has joined #ruby
[04:33:43] AnoHito: has joined #ruby
[04:34:17] davedev24: has joined #ruby
[04:34:38] renderful: has joined #ruby
[04:36:06] podman: has joined #ruby
[04:36:33] Y_Ichiro: has joined #ruby
[04:36:33] Y_Ichiro: has joined #ruby
[04:36:38] tejasmanohar: has joined #ruby
[04:37:06] hahuang61: has joined #ruby
[04:37:39] drbrain: has joined #ruby
[04:37:40] sfr^: has joined #ruby
[04:38:05] Miron: has joined #ruby
[04:38:06] BackEndCoder: has joined #ruby
[04:38:08] yeticry_: has joined #ruby
[04:38:24] borkdude: has joined #ruby
[04:38:48] G: has joined #ruby
[04:38:49] threh: has joined #ruby
[04:39:09] pwnd_nsfw: has joined #ruby
[04:39:41] krz: has joined #ruby
[04:39:48] eggoez: has joined #ruby
[04:40:51] FastJack: has joined #ruby
[04:41:23] rickmasta: has joined #ruby
[04:41:41] weemsledeux: has joined #ruby
[04:42:18] BLuEGoD: has joined #ruby
[04:42:26] agent_white: pontiki: Fight the bad guys wherever they may be?
[04:42:38] Klumben: has joined #ruby
[04:42:58] CloCkWeRX: has joined #ruby
[04:48:59] pontiki: affirm and ensure the peace, agent_white
[04:50:06] ElFerna: has joined #ruby
[04:50:08] agent_white: pontiki: Roger!
[04:50:26] hagabaka: has joined #ruby
[04:54:27] hagabaka: I think we need more people doing adventofcode in Ruby :p http://hagabaka.github.io/advent-of-code/
[04:57:20] braincra-: has joined #ruby
[04:57:59] tildes: has joined #ruby
[04:58:16] bbert: can someone explain the syntax for inequality found here: http://sequel.jeremyevans.net/rdoc/files/doc/cheat_sheet_rdoc.html#label-Inequality assuming I have a table named "value" (accessed by the method :value), as well as a variable passed into the current scope named "value"
[04:58:50] pontiki: why do you think so, hagabaka ?
[04:59:43] ibouvousaime: has joined #ruby
[05:00:45] bbert: ^sorry, not a table named "value", but a column named "value"
[05:02:01] berserk_ren: has joined #ruby
[05:04:17] jokke: has joined #ruby
[05:06:02] jayzer: has joined #ruby
[05:06:44] A124: has joined #ruby
[05:07:15] xcesariox: has joined #ruby
[05:07:20] qiukun: has joined #ruby
[05:11:45] quazimodo: has joined #ruby
[05:14:00] jdm__: has joined #ruby
[05:14:19] duckpuppy: has joined #ruby
[05:19:39] droidburgundy: has joined #ruby
[05:19:59] jdelaney: has joined #ruby
[05:24:54] lictor36: has joined #ruby
[05:33:03] bigmac: has joined #ruby
[05:36:44] dionysus69: has joined #ruby
[05:40:30] hagabaka: pontiki: out of the github users on the leaderboard, 9 have python repos for "advent", and only 3 have ruby ones
[05:41:15] pontiki: um, so what?
[05:44:00] techsethi: has joined #ruby
[05:44:21] aspire: has joined #ruby
[05:46:40] hagabaka: see the chart on the page I linked
[05:47:18] pontiki: again, so what?
[05:47:24] lxsameer: has joined #ruby
[05:47:32] pontiki: is this some sort of contest?
[05:47:34] hagabaka: oh I missed the "so" in "so what"
[05:48:38] pawnbox_: has joined #ruby
[05:52:33] pawnbox: has joined #ruby
[05:55:41] astrobun_: has joined #ruby
[05:56:14] Arnvald: has joined #ruby
[05:59:05] astrobun_: has joined #ruby
[05:59:08] pawnbox: has joined #ruby
[05:59:39] bronson: has joined #ruby
[06:03:42] pawnbox_: has joined #ruby
[06:05:42] tenzan: has joined #ruby
[06:06:38] reoring: has joined #ruby
[06:06:42] tenzan: has joined #ruby
[06:07:36] lkba: has joined #ruby
[06:07:38] pawnbox: has joined #ruby
[06:07:48] passerine: has joined #ruby
[06:08:53] tenderlove: has joined #ruby
[06:11:54] pawnbox_: has joined #ruby
[06:12:17] CloCkWeRX: has joined #ruby
[06:13:03] lurch_: has joined #ruby
[06:14:06] jdm_: has joined #ruby
[06:14:50] jdelaney: has joined #ruby
[06:15:01] duckpuppy: has joined #ruby
[06:15:07] TheWhip: has joined #ruby
[06:15:17] qiukun: has joined #ruby
[06:15:42] pawnbox: has joined #ruby
[06:15:52] qiukun: has left #ruby: ()
[06:16:09] yardenbar: has joined #ruby
[06:17:56] ur5us: has joined #ruby
[06:21:39] wldcordeiro: has joined #ruby
[06:21:56] CloCkWeRX: has joined #ruby
[06:22:17] pawnbox: has joined #ruby
[06:22:18] djbkd: has joined #ruby
[06:22:37] ZeeNoodley: has joined #ruby
[06:23:22] krz: has joined #ruby
[06:30:17] A5101: has joined #ruby
[06:33:11] howdoico1: has joined #ruby
[06:34:30] tagrudev: has joined #ruby
[06:35:10] SOLDIERz: has joined #ruby
[06:36:45] darkf: has joined #ruby
[06:38:23] ElFerna: has joined #ruby
[06:41:31] bbert: has joined #ruby
[06:41:31] bbert: has joined #ruby
[06:41:40] dexteryy: has joined #ruby
[06:44:00] trautwein: has joined #ruby
[06:47:09] shock_one: has joined #ruby
[06:47:36] xcesariox: has joined #ruby
[06:54:04] Ishido: has joined #ruby
[07:01:44] TheWhip: has joined #ruby
[07:05:57] passerine: has left #ruby: ()
[07:06:55] dlitvak: has joined #ruby
[07:10:56] raddazong: has joined #ruby
[07:11:47] cschneid: has joined #ruby
[07:14:19] jdm: has joined #ruby
[07:15:50] duckpuppy: has joined #ruby
[07:16:04] ibouvousaime: has joined #ruby
[07:17:11] tokik: has joined #ruby
[07:17:48] solars: has joined #ruby
[07:18:13] christiandsg: has joined #ruby
[07:18:17] gagrio: has joined #ruby
[07:18:42] pawnbox: has joined #ruby
[07:19:46] RegulationD: has joined #ruby
[07:21:58] Arnvald_: has joined #ruby
[07:22:09] colegatron: has joined #ruby
[07:22:12] codecop: has joined #ruby
[07:22:23] techsethi: has joined #ruby
[07:25:24] varunwachaspati: has joined #ruby
[07:30:37] Pupeno: has joined #ruby
[07:31:05] yardenbar: has joined #ruby
[07:31:07] hagabaka: has joined #ruby
[07:31:40] ledestin: has joined #ruby
[07:32:03] firstdayonthejob: has joined #ruby
[07:32:14] CrazyEddy: has joined #ruby
[07:32:50] Macaveli: has joined #ruby
[07:33:37] anisha: has joined #ruby
[07:34:04] pawnbox: has joined #ruby
[07:36:22] TheWhip: has joined #ruby
[07:39:23] skade: has joined #ruby
[07:39:52] colegatron: has joined #ruby
[07:40:22] aganov: has joined #ruby
[07:44:27] flughafen: has joined #ruby
[07:45:28] flughafen: shevy: certainty oioioi ;)
[07:46:17] Pumukel: has joined #ruby
[07:48:39] DeXterbed: has joined #ruby
[07:51:39] ponga: has joined #ruby
[07:51:59] claw: has joined #ruby
[07:52:58] phatypus: has joined #ruby
[07:55:13] User458764: has joined #ruby
[07:55:41] jgt2: has joined #ruby
[07:57:14] tenderlove: has joined #ruby
[07:58:45] techsethi: has joined #ruby
[08:03:21] Dimik: has joined #ruby
[08:04:58] astrobun_: has joined #ruby
[08:05:37] oz: has joined #ruby
[08:07:39] bmalum: has joined #ruby
[08:10:01] jas02: has joined #ruby
[08:12:33] bmalum_: has joined #ruby
[08:14:27] jdm_: has joined #ruby
[08:15:52] jbrhbr: has joined #ruby
[08:15:57] sucks: has joined #ruby
[08:16:35] duckpuppy: has joined #ruby
[08:18:46] kmckelvin: has joined #ruby
[08:19:39] TomyWork: has joined #ruby
[08:20:03] krzkrz: has joined #ruby
[08:23:25] blackms: has joined #ruby
[08:24:01] ec\: has joined #ruby
[08:24:37] shock_one: has joined #ruby
[08:25:22] aufi: has joined #ruby
[08:26:25] Hounddog: has joined #ruby
[08:26:32] ElFerna: has joined #ruby
[08:26:44] moeabdol: has joined #ruby
[08:27:56] mark3: has joined #ruby
[08:28:27] lurch_: has joined #ruby
[08:28:59] wmdrossard: has joined #ruby
[08:30:11] shock_one: has joined #ruby
[08:34:54] CrazyEddy: has joined #ruby
[08:35:51] skade: has joined #ruby
[08:37:11] symm-: has joined #ruby
[08:37:26] nettoweb: has joined #ruby
[08:38:04] roshanavand: has joined #ruby
[08:41:04] luckyme: has joined #ruby
[08:43:56] blaxter: has joined #ruby
[08:46:14] voodo: has joined #ruby
[08:46:50] pawnbox: has joined #ruby
[08:46:50] vondruch: has joined #ruby
[08:47:11] nhhagen: has joined #ruby
[08:49:13] User458764: has joined #ruby
[08:51:22] tenderlove: has joined #ruby
[08:52:12] colli5ion: has joined #ruby
[08:52:21] tokik: has joined #ruby
[08:53:44] matp: has joined #ruby
[08:54:20] Stan: has joined #ruby
[08:54:25] reoring: has joined #ruby
[08:55:05] kp666: has joined #ruby
[08:55:24] moei: has joined #ruby
[08:56:09] bigkevmcd: has joined #ruby
[08:57:25] reoring_: has joined #ruby
[08:58:38] c0m0: has joined #ruby
[08:58:59] agent_wh1te: has joined #ruby
[08:59:30] jgt2: has joined #ruby
[09:01:23] ur5us: has joined #ruby
[09:04:11] TheWhip: has joined #ruby
[09:05:34] charliesome: has joined #ruby
[09:05:38] terlar: has joined #ruby
[09:05:51] charliesome: has joined #ruby
[09:06:46] joonty: has joined #ruby
[09:06:47] tvw: has joined #ruby
[09:07:27] darkxploit: has joined #ruby
[09:11:05] snowy: has joined #ruby
[09:11:25] Couch: has joined #ruby
[09:11:57] Grey_H: has joined #ruby
[09:14:34] jdm__: has joined #ruby
[09:15:10] lurch_: has joined #ruby
[09:15:15] p0wn3d: has joined #ruby
[09:17:03] chthon: has joined #ruby
[09:17:18] duckpuppy: has joined #ruby
[09:18:28] pawnbox: has joined #ruby
[09:20:29] tesuji: has joined #ruby
[09:21:27] lipoqil: has joined #ruby
[09:21:57] huyderman: has joined #ruby
[09:22:12] zeljkof: has left #ruby: ()
[09:22:49] moei: has joined #ruby
[09:23:21] skade: has joined #ruby
[09:25:49] n008f4g_: has joined #ruby
[09:25:53] rdark: has joined #ruby
[09:27:54] kam270: has joined #ruby
[09:31:58] tomphp: has joined #ruby
[09:32:26] senayar: has joined #ruby
[09:32:27] senayar: has joined #ruby
[09:33:36] tulak: has joined #ruby
[09:34:12] roshanavand: has joined #ruby
[09:34:22] dmolina: has joined #ruby
[09:34:36] TheWhip: has joined #ruby
[09:36:41] colli5ion: has joined #ruby
[09:39:21] kalopsian: has joined #ruby
[09:41:18] last_staff: has joined #ruby
[09:42:21] SOLDIERz: has joined #ruby
[09:44:34] rodfersou: has joined #ruby
[09:45:40] tenderlove: has joined #ruby
[09:46:33] yfeldblum: has joined #ruby
[09:46:58] jokke: has joined #ruby
[09:48:11] jokke: has joined #ruby
[09:48:53] nateberkope: has joined #ruby
[09:50:52] kke: has joined #ruby
[09:51:33] kke: my gem executable path is set to ~/bin. is there any way to set it to ~/.gem/bin with my .gemrc?
[09:52:54] TheWhip: has joined #ruby
[09:53:02] jokke: has joined #ruby
[09:53:41] TheWhip: has joined #ruby
[09:53:56] DeXterbed: has joined #ruby
[09:54:40] roshanavand: has joined #ruby
[09:55:26] techsethi: has joined #ruby
[09:56:11] colli5ion: has joined #ruby
[09:59:10] houhoulis: has joined #ruby
[10:00:41] steffkes: has joined #ruby
[10:00:42] steffkes: has joined #ruby
[10:01:01] devoldmx: has joined #ruby
[10:02:07] xcesariox: has joined #ruby
[10:02:39] zamerick_: has joined #ruby
[10:03:32] Xentil: has joined #ruby
[10:04:25] SCHAAP137: has joined #ruby
[10:04:37] platzhirsch: has joined #ruby
[10:05:51] colli5ion: has joined #ruby
[10:06:50] sdilizio: has joined #ruby
[10:07:55] mcanevet: has joined #ruby
[10:08:12] quazimodo: has joined #ruby
[10:08:39] jokke: has joined #ruby
[10:08:44] sdilizio: has left #ruby: ()
[10:08:59] voodo: has joined #ruby
[10:09:32] sdilizio: has joined #ruby
[10:10:25] jokke: has joined #ruby
[10:11:12] ruby-lang450: has joined #ruby
[10:13:57] ruid: has joined #ruby
[10:13:57] ruid: has joined #ruby
[10:14:37] ur5us: has joined #ruby
[10:14:38] jdm_: has joined #ruby
[10:14:40] ElFerna: has joined #ruby
[10:15:17] last_staff: has joined #ruby
[10:16:35] jokke: has joined #ruby
[10:18:04] duckpuppy: has joined #ruby
[10:18:17] nfk|laptop: has joined #ruby
[10:18:47] Stalkr_: has joined #ruby
[10:20:11] c0m0: _ke: are you talking about shell path?
[10:23:48] agent_white: Sounds like it.
[10:23:59] TheWhip: has joined #ruby
[10:24:02] agent_white: Ah he's gone. Oh well.
[10:24:05] JohnBat26: has joined #ruby
[10:24:25] ur5us: has joined #ruby
[10:24:37] agent_white: Speaking of... why do all the ruby version managers (rbenv/chruby/rvm...) setup the path in bashrc or bash_profile instead of profile?
[10:27:17] agent_white: Just odd, especially with rvm being picky about 'login shells' and not utilizing profile.
[10:29:00] lurch_: has joined #ruby
[10:29:27] zenguy_pc: has joined #ruby
[10:30:13] CloCkWeRX: has joined #ruby
[10:31:20] snowy: has joined #ruby
[10:33:25] antgel: has joined #ruby
[10:35:40] charliesome: has joined #ruby
[10:37:26] tulak: has joined #ruby
[10:37:38] JohnBat26: has joined #ruby
[10:38:52] jxs_: has joined #ruby
[10:39:00] Peg-leg: has joined #ruby
[10:39:39] tenderlove: has joined #ruby
[10:40:19] pushpak: has joined #ruby
[10:40:36] jokke: has joined #ruby
[10:42:35] zenguy_pc: has joined #ruby
[10:43:15] bronson: has joined #ruby
[10:48:03] jokke: has joined #ruby
[10:48:36] ElFerna: has joined #ruby
[10:49:37] claw: has joined #ruby
[10:51:02] DotMH: has joined #ruby
[10:52:44] howdoi: has joined #ruby
[10:52:48] colli5ion: has joined #ruby
[10:53:42] colli5ion: has joined #ruby
[10:55:51] colli5ion: has joined #ruby
[10:58:43] tulak_: has joined #ruby
[10:59:12] c355E3B: has joined #ruby
[10:59:35] shevy: flughafen fly baby flyyyy
[11:00:01] FooMunki: has joined #ruby
[11:00:31] gioele: has joined #ruby
[11:01:04] dlitvak: has joined #ruby
[11:01:10] gioele: hi, how can I execute a lambda (or a proc) using the current binding instead of the original closure?
[11:01:34] TheWhip: has joined #ruby
[11:01:53] devoldmx: has joined #ruby
[11:02:20] flughafen: shevy: "learning to fly is throwing yourself at the ground and trying to miss"
[11:03:52] antgel: has joined #ruby
[11:03:55] colli5ion: has joined #ruby
[11:04:09] adaedra: gioele: take a look at instance_exec/instance_eval
[11:04:33] monthy: has joined #ruby
[11:05:05] Lildirt: has joined #ruby
[11:05:44] colli5ion: has joined #ruby
[11:07:13] Jet4Fire: has joined #ruby
[11:08:27] spt0: has joined #ruby
[11:08:41] charliesome: has joined #ruby
[11:08:46] jcromartie: has joined #ruby
[11:09:03] Polysics: has joined #ruby
[11:10:07] dlitvak_: has joined #ruby
[11:10:25] rikkipitt: has joined #ruby
[11:10:53] GarethAdams: has joined #ruby
[11:11:24] zenguy_pc: has joined #ruby
[11:12:40] pawnbox: has joined #ruby
[11:13:20] blackgoat: has joined #ruby
[11:14:33] pawnbox: has joined #ruby
[11:14:34] jokke: has joined #ruby
[11:14:49] jdm__: has joined #ruby
[11:15:51] gioele: adaedra: but it looks like instance_exec/eval do not allow a proc to use a variable that was not bound at the time of the its creation
[11:16:08] prestorium: has joined #ruby
[11:16:14] gioele: B = lambda { p extra } ; self.instance_exec { extra = 10; B.call } NameError: undefined local variable or method `extra' for main:Object
[11:18:53] duckpuppy: has joined #ruby
[11:20:29] rickmasta: has joined #ruby
[11:20:56] Vitor: has joined #ruby
[11:20:56] nfk|laptop: has joined #ruby
[11:21:34] yashinbasement: has joined #ruby
[11:22:28] ElFerna: has joined #ruby
[11:24:51] apeiros: gioele: that applies to all blocks.
[11:25:04] apeiros: if you "create" a variable within a block, it's not usable outside of it.
[11:25:25] apeiros: >> extra = 1; B = lambda { p extra } ; self.instance_exec { extra = 10; B.call }
[11:25:27] ruboto_: apeiros # => 10 ...check link for more (https://eval.in/484712)
[11:25:27] Oog: has joined #ruby
[11:25:45] Oog: i am ready to pull my hair - htf do i do a regex that does not match a string.......
[11:25:48] apeiros: gioele: ^ if you create it outside the block, the block closes over it, and another block can close over the same.
[11:25:56] Oog: people = data.scan(/event\)">([^\|<]*?) \| LinkedIn<\/a>.*?<div class="f slp">([^<]*?) - ([^<]*apex[^<]*)<\/div><span class="st">/im)
[11:26:01] agent_white: apeiros: Can you pass bindings into a proc, just not out?
[11:26:08] apeiros: Oog: don't. use. regex. for html.
[11:26:10] Oog: the problem is the .*? is eating a span - i want to tell it do not eat span
[11:26:19] apeiros: Oog: use nokogiri, oga or another html/xml parser.
[11:26:39] Oog: this almost works but this one damn problem
[11:26:42] ledestin: has joined #ruby
[11:26:50] Oog: its too hungry why does it do it
[11:26:53] agent_white: "--> http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454
[11:26:59] apeiros: agent_white: it's not really passing bindings.
[11:27:04] apeiros: ACTION afk, lunch
[11:27:16] agent_white: apeiros: Ah okey doke!
[11:27:52] agent_white: Oog: "Parsing HTML with regex summons tainted souls into the realm of the living." -- Please don't summon demons upon this planet.
[11:28:10] adaedra: We already have Donald Trump, it's enough.
[11:28:20] agent_white: adaedra: Amen.
[11:29:40] shevy: we can parse the world with regexes!
[11:29:55] shock_one: has joined #ruby
[11:30:11] marr: has joined #ruby
[11:30:49] gregf_: >> extra = 10; B = lambda { |val| p extra * val } ; self.instance_exec { B.call(10) } # thats probably a clojure?
[11:30:50] ruboto_: gregf_ # => 100 ...check link for more (https://eval.in/484715)
[11:33:38] solocshaw: has joined #ruby
[11:33:57] Oog: fuck it i figured it out - do the regex and then do a filte rin the for loop afterwards
[11:34:00] CloCkWeRX: has joined #ruby
[11:34:06] Oog: so fucking annoying i hate regex
[11:34:33] arup_r: has joined #ruby
[11:34:39] adaedra: They didn't listen, did they?
[11:35:18] gregf_: well looks like they've found the ugliest way to hurt themselves :|
[11:35:25] dlitvak: has joined #ruby
[11:35:56] kmckelvin: has joined #ruby
[11:37:10] chipotle: has joined #ruby
[11:38:16] rdark: has joined #ruby
[11:43:03] redondos: has joined #ruby
[11:44:06] shevy: regexes kinda hurt
[11:44:12] drptbl: has joined #ruby
[11:45:01] jacyzon: has joined #ruby
[11:47:07] gaiada: has joined #ruby
[11:47:35] cassioscabral: has joined #ruby
[11:47:55] Bellthoven: has joined #ruby
[11:47:58] toretore: has joined #ruby
[11:48:10] drptbl: has joined #ruby
[11:49:05] cantaberry: has joined #ruby
[11:49:05] solocshaw: has joined #ruby
[11:50:45] cassioscabral_: has joined #ruby
[11:51:39] drptbl: has joined #ruby
[11:52:01] solocshaw1: has joined #ruby
[11:52:30] moeabdol: has joined #ruby
[11:53:08] azgil: has joined #ruby
[11:55:21] f4cl3y: has joined #ruby
[11:56:01] drptbl: has joined #ruby
[11:56:05] Mon_Ouie: has joined #ruby
[11:59:52] drptbl: has joined #ruby
[12:03:09] FooMunki: has joined #ruby
[12:03:53] cornerma1: has joined #ruby
[12:04:37] drptbl: has joined #ruby
[12:06:04] vondruch: has joined #ruby
[12:09:08] ElFerna: has joined #ruby
[12:10:03] symm-: has joined #ruby
[12:10:56] skade: has joined #ruby
[12:12:32] Pupeno: has joined #ruby
[12:12:32] Pupeno: has joined #ruby
[12:12:43] ibouvousaime: has joined #ruby
[12:13:49] pawnbox: has joined #ruby
[12:14:54] jdm_: has joined #ruby
[12:15:49] pawnbox: has joined #ruby
[12:15:55] kirun: has joined #ruby
[12:17:17] SylarRuby: has joined #ruby
[12:19:36] duckpuppy: has joined #ruby
[12:23:28] Cyther: has joined #ruby
[12:24:00] Ishido: has joined #ruby
[12:24:14] marienz: has joined #ruby
[12:24:49] nfk|laptop: has joined #ruby
[12:25:04] sdothum: has joined #ruby
[12:26:39] pulgolino: has joined #ruby
[12:26:51] loren: has joined #ruby
[12:26:53] nettoweb: has joined #ruby
[12:28:06] TheWhip: has joined #ruby
[12:28:07] tenderlove: has joined #ruby
[12:28:41] tknz: has joined #ruby
[12:28:45] ornerymoose: has joined #ruby
[12:29:34] dlitvak: has joined #ruby
[12:29:54] lurch_: has joined #ruby
[12:29:56] casadei: has joined #ruby
[12:31:06] jgt2: has joined #ruby
[12:35:41] dede__: has joined #ruby
[12:36:29] chipotle: has joined #ruby
[12:36:33] senayar: has joined #ruby
[12:36:34] senayar: has joined #ruby
[12:38:30] niko: has joined #ruby
[12:38:56] drbrain: has joined #ruby
[12:40:02] kp666: has joined #ruby
[12:40:22] iyan: has joined #ruby
[12:40:37] kalopsian: has joined #ruby
[12:41:18] krz: has joined #ruby
[12:44:26] wmdrossard: has joined #ruby
[12:47:12] senayar: has joined #ruby
[12:47:19] Cyther: has joined #ruby
[12:51:27] bronson: has joined #ruby
[12:51:40] Icey: has joined #ruby
[12:52:29] PaulePanter: http://paste.debian.net/344252/
[12:52:54] chipotle: has joined #ruby
[12:52:58] PaulePanter: So to maintain an array with pairwise uniq elements and not using sets, doing it manually is better than using push and uniq!?!
[12:53:14] PaulePanter: a = (1..10).to_a; a << b if a.include?(b)
[12:53:33] PaulePanter: a = (1..10).to_a; a.push(b).uniq!
[12:54:01] PaulePanter: Is my benchmark carried out incorrectly or do I jus need to accept that?
[12:54:43] PaulePanter: I would have at least expected for the case, that b is not in a, that the second solution is faster.
[12:55:09] adaedra: add and remove is more expensive than just not adding.
[12:55:19] CloCkWeRX: has left #ruby: ()
[12:55:28] yorickpeterse: On small arrays the overhead of #include? is next to none
[12:55:34] yorickpeterse: so using that will save you re-allocations of memory
[12:55:59] snowy: has joined #ruby
[12:56:24] tenderlove: has joined #ruby
[12:59:22] PaulePanter: I???ll try with bigger arrays.
[13:01:41] vondruch: has joined #ruby
[13:02:15] DeXterbed: has joined #ruby
[13:02:26] ornerymoose: has joined #ruby
[13:02:34] devoldmx: has joined #ruby
[13:04:01] PaulePanter: Probably using the already sorted (1..n).to_a does favor the `include` solution too.
[13:04:37] PaulePanter: Bigger arrays of this pattern just makes `push(???).uniq!` even slower.
[13:04:59] adaedra: That's normal
[13:05:42] blackjid: has joined #ruby
[13:06:07] PaulePanter: adaedra: As written, I understand that for the case where b is already in a.
[13:06:15] PaulePanter: But not for the case, where b is not yet in a.
[13:06:38] kobain: has joined #ruby
[13:07:32] adaedra: because #uniq is making way more reads than #include?
[13:08:25] synthroid: has joined #ruby
[13:10:15] PaulePanter: Ah, that makes sense.
[13:10:18] PaulePanter: Sorry for being dense.
[13:13:43] ornerymoose_: has joined #ruby
[13:14:29] TheWhip: has joined #ruby
[13:15:05] jdm__: has joined #ruby
[13:16:18] TheWhip: has joined #ruby
[13:16:52] grepwood: has joined #ruby
[13:16:57] grepwood: hello everyone
[13:17:12] grepwood: I've got this nasty piece in my code, system "mysql -e 'SET PASSWORD = PASSWORD('#{mysql_root_password}');'"
[13:17:21] skade: has joined #ruby
[13:17:42] grepwood: no matter how many time I escape the characters, it just doesn't want to parse correctly, mysql client complains that the command is malformed
[13:17:48] duckpuppy: has joined #ruby
[13:18:02] grepwood: can someone please tell me how to do that nasty piece correctly?
[13:18:10] adaedra: Just use a mysql adapter?
[13:18:25] grepwood: it has to use system, mysql gem has way too many dependencies
[13:18:53] adaedra: &ri Kernel#system
[13:18:55] `derpy: method `Kernel#system`: Executes _command..._ in a subshell. _command..._ is one of following forms. com??? ??? http://rubydoc.info/stdlib/core/Kernel#system-instance_method
[13:19:13] adaedra: Use the variant where you separate arguments
[13:19:28] adaedra: system "mysql" "-e" "SET PASSWORD = ..."
[13:19:36] adaedra: system "mysql", "-e", "SET PASSWORD = ..."
[13:19:37] gagrio: has joined #ruby
[13:21:05] rickmasta: has joined #ruby
[13:21:16] steffkes: has joined #ruby
[13:21:17] steffkes: has joined #ruby
[13:21:28] drbrain: has joined #ruby
[13:21:37] tlaxkit: has joined #ruby
[13:21:41] cassioscabral: has joined #ruby
[13:22:12] govg: has joined #ruby
[13:22:13] grepwood: big thanks adaedra !
[13:23:51] pulgolino: has joined #ruby
[13:24:29] sgambino: has joined #ruby
[13:24:55] pulgolino: has joined #ruby
[13:25:39] Mia: has joined #ruby
[13:25:39] Mia: has joined #ruby
[13:26:10] Axy: has joined #ruby
[13:26:10] Axy: has joined #ruby
[13:26:40] nmyster: has joined #ruby
[13:27:27] ibouvousaime: has joined #ruby
[13:29:21] shanemcd: has joined #ruby
[13:31:00] shanemcd: has joined #ruby
[13:32:26] decoponio: has joined #ruby
[13:32:40] bmalum_: has joined #ruby
[13:33:00] scepticulous: has joined #ruby
[13:33:24] GinoManWorks: Wait, so > thing = "stuff"; defines a variable but > Thing = "stuff"; defines a constant?
[13:33:36] bbert: has joined #ruby
[13:33:37] bbert: has joined #ruby
[13:35:54] dfinninger: has joined #ruby
[13:36:27] GinoManWorks: like the case of the first letter is the cv qualifier?
[13:39:01] shevy: GinoManWorks yeah
[13:39:08] shevy: in principle you can also change a "constant" in ruby
[13:39:10] Bloomer: has joined #ruby
[13:39:13] shock_one: has joined #ruby
[13:39:24] shevy: >> Thing = 'bla'; Thing = 'Ble'; puts Thing
[13:39:25] ruboto_: shevy # => /tmp/execpad-183cd4a8b750/source-183cd4a8b750:2: warning: already initialized constant Thing ...check link for more (https://eval.in/484768)
[13:39:49] shevy: don't mind the warning ruboto_ showed, it works as https://eval.in/484768 says
[13:40:38] moeabdol: has joined #ruby
[13:40:59] shevy: apeiros loves the name constant there :)
[13:41:27] colegatron: has joined #ruby
[13:41:47] GinoManWorks: shevy: So you can change constants in ruby, they'll just give you a warning instead of an error like other languages?
[13:42:03] GinoManWorks: or is that only within the same line?
[13:42:51] Polysics: has joined #ruby
[13:42:56] lurch_: has joined #ruby
[13:43:53] darkf: has joined #ruby
[13:43:54] adaedra: Nah, you can, with a warning, redefine a constant. But you shouldn't.
[13:44:14] shevy: GinoManWorks yeah you can change them, even in a method if you use the Object.const_set() method
[13:44:27] shevy: respectively the namespace you wish to have this constant reside at
[13:44:34] grepwood: how do I convert MatchData into a string?
[13:45:07] Vitor_: has joined #ruby
[13:45:26] ljarvis: grepwood: into what string?
[13:45:32] grepwood: just a string
[13:45:35] thejamespinto: has joined #ruby
[13:45:39] GinoManWorks: I want to say >> MatchData.to_string; but.... I suspect that wasn't what he was looking for.
[13:45:41] ljarvis: what would a String version of a MatchData object look like?
[13:45:53] grepwood: the same I think
[13:45:55] grepwood: Ruby is weird
[13:45:58] ljarvis: >> "foo".match(/(.)$/)
[13:45:59] ruboto_: ljarvis # => #<MatchData "o" 1:"o"> (https://eval.in/484780)
[13:46:04] ljarvis: >> "foo".match(/(.)$/).to_s
[13:46:05] ruboto_: ljarvis # => "o" (https://eval.in/484781)
[13:46:20] TomPeed: has joined #ruby
[13:46:22] ljarvis: Ruby isn't weird (not here, anyway), your requirements are weird
[13:46:42] shevy: grepwood rule of thumb is the .to_s method
[13:47:17] grepwood: ljarvis, yeah I think so
[13:49:20] netwoodle: has joined #ruby
[13:49:25] ljarvis: grepwood: ok, that just returns the entire matched string
[13:50:02] grepwood: give me a sec, everything is crumbling down in the tests
[13:50:13] ljarvis: >> "1xyz23".match(/[^\d]+/); $&
[13:50:14] ruboto_: ljarvis # => "xyz" (https://eval.in/484782)
[13:51:36] grepwood: alright, I think it got everything right
[13:51:46] grepwood: thank you shevy, ljarvis GinoManWorks
[13:51:59] GinoManWorks: You're welcome
[13:52:12] goodcodeguy: has joined #ruby
[13:52:23] grepwood: now the reason why I said ruby is weird
[13:52:26] tvw: has joined #ruby
[13:52:43] grepwood: is cause I'd expect such a match to return a string rather than make a special_snowflake_t for itself
[13:53:13] grepwood: like it's done with grep in bash
[13:53:54] duckpuppy: has joined #ruby
[13:53:55] adaedra: because it has to return multiple strings?
[13:54:01] emilkarl: has joined #ruby
[13:54:03] trwyth: has joined #ruby
[13:54:09] grepwood: that's not a multiple string
[13:54:22] adaedra: >> "grepwood".match(/./).matches
[13:54:22] grepwood: it's a huge string with many \n chars
[13:54:23] ruboto_: adaedra # => undefined method `matches' for #<MatchData "g"> (NoMethodError) ...check link for more (https://eval.in/484790)
[13:54:31] adaedra: >> "grepwood".match(/./).to_a
[13:54:32] ruboto_: adaedra # => ["g"] (https://eval.in/484791)
[13:54:37] grepwood: string is a byte array that ends with 0x00
[13:54:44] adaedra: >> "grepwood".match(/(.)/).to_a
[13:54:45] ruboto_: adaedra # => ["g", "g"] (https://eval.in/484793)
[13:54:48] ramortegui: has joined #ruby
[13:55:02] adaedra: >> "adaedra".match(/(.)+/).to_a
[13:55:03] ruboto_: adaedra # => ["adaedra", "a"] (https://eval.in/484794)
[13:55:10] adaedra: ok, I don't remember the thing.
[13:55:19] GinoManWorks: grepwood: in that case it wouldn't be, but you might get no matches, one match, or many matches. The problem is that it would be type-unsafe to just assume you'd get one or the other because accessing them requires different syntax
[13:55:28] adaedra: Anyway, since there can be multiple matches, you have to be able to return them all.
[13:56:11] dlitvak: has joined #ruby
[13:56:18] d0nn1e: has joined #ruby
[13:56:28] GinoManWorks: In the name of simplicity, Ruby handles typing for you to a large extent, but if you ALWAYS got an array, then you'd have to use array redirection even when you expected and only got one result.
[13:57:07] GinoManWorks: unless I'm wrong, I am still learning myself but I read a couple books several years ago.
[13:57:28] adaedra: You can have no match, you can have multiple matches, you can have named groups, ...
[13:57:33] GinoManWorks: and I remember typing and such that much and if that be the case it makes sense to me
[13:58:06] pandaant: has joined #ruby
[13:58:14] GinoManWorks: ah yes, I forgot about "named groups", because then you have to be able to retrieve that matched text
[13:58:15] adaedra: <grepwood> string is a byte array that ends with 0x00 ??? that's true in C.
[13:58:37] shevy: fossil languages!
[13:58:41] GinoManWorks: although they prefer you to use the std::string class moreso
[13:58:44] adaedra: and some others like Obj-C, yes.
[13:58:55] shevy: swift to the future!!!
[13:59:02] grepwood: Ruby has a different definition of a string?
[13:59:09] shevy: it's an object
[13:59:15] adaedra: >> "a Ruby string can contain a \x00 character."
[13:59:16] ruboto_: adaedra # => "a Ruby string can contain a \u0000 character." (https://eval.in/484799)
[13:59:35] adaedra: Modern implementation use a chars array + size couple.
[13:59:36] mary5030: has joined #ruby
[13:59:37] Pupp3tm4st3r: has joined #ruby
[13:59:42] adaedra: Allows more flexibility.
[13:59:44] GinoManWorks: grepwood: also you can call methods directly against a ruby string literal
[14:00:23] dlitvak_: has joined #ruby
[14:00:29] grepwood: adaedra, like Pascal
[14:00:33] adaedra: grepwood: what language are you coming from?
[14:00:36] GinoManWorks: >> "this string will respond to messages".capitalize
[14:00:37] ruboto_: GinoManWorks # => "This string will respond to messages" (https://eval.in/484803)
[14:00:42] grepwood: adaedra, C and bash
[14:00:44] ledestin: has joined #ruby
[14:01:30] grepwood: I started with Python though
[14:01:54] grepwood: but my first ever project, prime number bruteforcer, was really slow in Python
[14:02:04] shevy: well doesn't python have a somewhat similar definition of a string?
[14:02:06] grepwood: rewrote it in C and that kinda sold it to me
[14:02:20] grepwood: it does yes
[14:03:21] adaedra: grepwood: note that in Ruby you don't often care about the underlying implementation. A string is a string; how it is stored in memory doesn't really matter, except if you're doing things inside Ruby itself.
[14:03:46] wsewolod: has joined #ruby
[14:04:38] GinoManWorks: Say, does ruby have a syntax checking commandline switch?
[14:04:45] Polysics: has joined #ruby
[14:04:46] adaedra: ruby --help
[14:05:38] adaedra: It's rather basic tho; if you want something tougher (checks style), you have rubocop.
[14:05:39] grepwood: adaedra, is it possible to do low-level stuff in Ruby? I have LZSS decompression algo implemented in C, C++ and Pascal at home, and I just now wondered if that's possible in Ruby too
[14:05:55] adaedra: Depends how low, but should be possible, yes.
[14:06:20] grepwood: that doesn't even require 64bit math so it's pretty easy
[14:06:32] trautwein: has joined #ruby
[14:06:41] jordanm: has joined #ruby
[14:06:46] adaedra: If what you're looking for is direct bytes access, you have ri:Array#pack and ri:String#unpack
[14:06:48] `derpy: http://rubydoc.info/stdlib/core/Array#pack-instance_method, http://rubydoc.info/stdlib/core/String#unpack-instance_method
[14:07:20] adaedra: (bytes or any other low-level type.)
[14:07:31] nateberkopec: has joined #ruby
[14:07:45] artX000: has joined #ruby
[14:07:52] grepwood: something like this http://pastebin.com/raw.php?i=fjUAvTwC
[14:07:52] ruboto_: grepwood, as I told you already, please use https://gist.github.com
[14:08:00] grepwood: oops, sorry
[14:08:18] bithon: astebin is fine too
[14:08:28] bithon: How come nobody ever suggests pastebin
[14:08:28] _stu_: has joined #ruby
[14:08:47] adaedra: bithon: that's exactly the thing the bot asks not to use.
[14:08:56] grepwood: people don't like ads
[14:09:02] adaedra: grepwood: seems doable. Not in direct translation; but seems doable.
[14:09:12] ruboto_: Please don't use Pastebin! Pastebin sucks because it loads slowly, has ads which are distracting and has terrible formatting. Please use Gist (http://gist.github.com) or Pastie (http://pastie.org).
[14:09:57] adaedra: Some people here won't even open your thing if you post it in pastebin, mind.
[14:10:20] bithon: Now that's just silly
[14:10:52] kalopsia1: has joined #ruby
[14:10:58] bithon: One word: adblock.
[14:11:30] adaedra: Doesn't solve the other problems.
[14:11:56] GinoManWorks: actually grepwood, if you already implemented it in C, why not retrofit it to be a ruby module you can call?
[14:11:57] grepwood: I'm guessing pastebin has a lot of scripts under the hood that don't do anything useful too
[14:11:58] bithon: Never really had any slowdowns
[14:12:13] bithon: But whatever, gist is just as fine in my eyes
[14:12:19] grepwood: GinoManWorks, could do in my spare time
[14:12:26] bithon: not about to start a religious war
[14:12:26] jpank: has joined #ruby
[14:12:29] adaedra: Anyway, if you want to discuss channel policies, go #ruby-community.
[14:12:32] grepwood: but what would it be useful for?
[14:12:47] grepwood: LZSS is only ever used in... old games? Final Fantasy 7, Fallout 1, etc...
[14:12:47] bithon: ACTION slowly steps away from the debate
[14:13:14] shevy: channel policy states that pastebin is not allowed?
[14:13:22] bithon: Apparently
[14:13:25] GinoManWorks: grepwood: if you retrofitted it, you could use it in your ruby programs, the algorithm would have the same speed as the C version (because it is the C version, even though now-a-days that's not so much an issue) and it's DRY friendly
[14:13:26] shevy: can I read up on this
[14:13:33] zamerick_: has joined #ruby
[14:13:36] bithon: It almost feels like emacs vs vim debate imho lol
[14:13:52] shevy: anyway, pastebin is inferior to pastie or gis
[14:14:00] B1n4r10: has joined #ruby
[14:14:04] govg: has joined #ruby
[14:14:05] shevy: emacs vs vim is bad because there are only two losers
[14:14:06] bithon: :O Oh no you ddn't
[14:14:12] c355E3B: In that debate we already know the winner bithon
[14:14:20] symbol: has joined #ruby
[14:14:27] adaedra: ok, editor war goes in #ruby-offtopic now.
[14:14:34] shevy: bithon I remember how pastebin had annoying flash ads that played loud music once... I hated it since that day, that shocked me
[14:14:35] c355E3B: Fair enough
[14:14:52] c355E3B: Pastebin is super ad heavy
[14:14:59] GinoManWorks: ACTION gives a thumbs up to the editor war going away (all hail vim)
[14:15:06] shevy: GinoManWorks hahaha
[14:15:14] bithon: GinoManWorks <3
[14:15:15] shevy: sublime forever!!!
[14:15:21] bithon: no shevy, just no.
[14:15:22] jdm: has joined #ruby
[14:15:23] c355E3B: I can see why people would not want to use it
[14:15:41] GinoManWorks: I like notepad++ but when I'm on the command line on Linux and have to edit config files, vim all the way
[14:15:58] bithon: Well I use vim or gvim everywhere I go
[14:15:59] adaedra: ok, editor war goes in #ruby-offtopic now. 2nd call.
[14:16:10] bithon: as a matter of fact, I have a usb with Vim on it with my vimrc and all that jazz
[14:16:22] shevy: ok now I can understand vim actually... but gvim? really?
[14:16:30] bithon: adaedra aye aye!
[14:17:33] GinoManWorks: anyways grepwood, I would recommend at least looking into that if for no other reason that repurposing the same code without having to rewrite it
[14:17:45] GinoManWorks: i.e. "DRY friendly"
[14:17:57] mary5030: has joined #ruby
[14:18:20] atomical: has joined #ruby
[14:18:26] vdamewood: has joined #ruby
[14:18:32] grepwood: GinoManWorks, what's DRY?
[14:18:37] apeiros: shevy, bithon: no, channel policy doesn't forbid any paste service. the information is courtesy, mostly because as adaedra said, lots of high profile helpers won't even read a pastebin.com paste.
[14:18:40] GinoManWorks: Don't Repeat Yourself
[14:19:13] bithon: Fair enough
[14:19:13] GinoManWorks: There's a book out there called "The Productive Programmer" where he talks about ways to be more efficient as a programmer and one of them was "DRY - Don't Repeat Yourself"
[14:19:22] GinoManWorks: he being the author*
[14:19:34] bithon: I almost feel like productivity hacks are in itself a waste time
[14:19:45] bithon: a time waster*
[14:19:48] GinoManWorks: Another one is YAGNI - You Aint Gonna Need It
[14:19:54] rgtk: has joined #ruby
[14:20:37] GinoManWorks: bithon: They're not so much hacks as principles. They're broader than just "in this one situation, don't do this", it's like "in general observe this principle..."
[14:21:32] shevy: apeiros \o/ I don't use pastebin anyway, it's indeed awful
[14:21:42] gagrio: has joined #ruby
[14:23:23] bithon: GinoManWorks: I know. That was my terrible attempt at humor that I decided belongs to the offtopic channel rather than here. I mean after all, I don't want to be banned from you all beautiful peeps :P;2u
[14:23:47] symbol: has joined #ruby
[14:24:28] GinoManWorks: The program I'm re-learning ruby to make I started making in C++ originally and I created a class that would contain all the parsed command line options as C++ types and I kept adding features to the program and then I realized that most of the features had NOTHING to do with the problem I was trying to solve so I commented them out and put an explanation that maybe I'll add these features later but for now they're commented out because YAGNI
[14:24:51] apeiros: adaedra: we need a clippy-bot :D
[14:25:02] adaedra: what would it do?
[14:25:06] apeiros: adaedra: "It looks like you try to start a flame war, would you like to continue in #ruby-offtopic?"
[14:25:59] GinoManWorks: apeiros: It could make it so that we could private message it code pastes and then send it like an "end" command and it would generate a gist.github.com url
[14:26:07] atomical: has joined #ruby
[14:26:29] apeiros: GinoManWorks: I don't follow?
[14:26:30] GinoManWorks: that'd be cool
[14:26:41] GinoManWorks: clippy bot I assumed you meant for pastes
[14:26:43] boxofrox: has joined #ruby
[14:26:49] adaedra: apeiros: he wants ruboto_ to autopaste code we would pm ruboto_.
[14:26:59] aryaching: has joined #ruby
[14:27:00] apeiros: GinoManWorks: heh, no, for automatically recognizing certain behaviors
[14:27:02] djcp: has joined #ruby
[14:27:11] apeiros: ruboto_: y u goz tail?!?
[14:27:26] thejamespinto: has joined #ruby
[14:27:55] Jardayn: has joined #ruby
[14:28:03] adaedra: apeiros: I told you yesterday about it!
[14:28:35] babblebre: has joined #ruby
[14:28:41] bmalum_: has joined #ruby
[14:29:11] symm-: has joined #ruby
[14:29:13] adaedra: apeiros: http://irclog.whitequark.org/ruby/2015-12-13#14910799;
[14:29:15] bithon: Somebody should make a git repo of that. And in the meantime while it's being developed you could direct people's attention to that rather than the flame war
[14:29:15] bithon: It's a win-win sitaution
[14:29:28] uris: has joined #ruby
[14:29:50] dstarh: has joined #ruby
[14:30:11] apeiros: I keep forgetting how tf to change the nick in cinch
[14:30:28] apeiros: always assume .nick= would set the value, not trigger a message to the server???
[14:30:42] adaedra: I'm cheating: the bot is connected to ZNC, so I can connect directly and /nick myself. Way easier.
[14:31:03] apeiros: adaedra: ah, 2100 - at that time I finally allowed myself some leisure time with xenoblade
[14:31:22] apeiros: adaedra: oh. clever.
[14:31:41] apeiros: capital idea. will steal.
[14:31:55] bithon_web: has joined #ruby
[14:32:03] `derpy: Also, makes a great puppet.
[14:33:48] grill: has joined #ruby
[14:34:47] bithon: has joined #ruby
[14:34:56] The_Phoenix: has joined #ruby
[14:35:48] atomical_: has joined #ruby
[14:36:08] roshanavand: has joined #ruby
[14:36:24] diego2: has joined #ruby
[14:37:11] mary5030: has joined #ruby
[14:39:19] roshanavand: has joined #ruby
[14:39:51] roshanavand: has joined #ruby
[14:41:48] rvchangue: has joined #ruby
[14:41:56] mostlybadfly: has joined #ruby
[14:43:23] malconis: has joined #ruby
[14:45:05] polishdub: has joined #ruby
[14:46:42] Scripore: has joined #ruby
[14:49:06] djcp: has joined #ruby
[14:49:43] dlitvak: has joined #ruby
[14:49:58] roshanavand: has joined #ruby
[14:50:26] mikecmpbll: has joined #ruby
[14:50:46] aspire: has joined #ruby
[14:51:02] dorei: has joined #ruby
[14:51:02] tenderlove: has joined #ruby
[14:51:30] mhib: has joined #ruby
[14:52:51] roshanavand: has joined #ruby
[14:53:26] jgt2: has joined #ruby
[14:53:44] bronson: has joined #ruby
[14:54:19] jgpawletko: has joined #ruby
[14:55:11] Stalkr_: has joined #ruby
[14:56:46] krobzaur: has joined #ruby
[14:56:59] B1n4r10: has joined #ruby
[14:57:51] dfinninger: has joined #ruby
[14:59:35] goodcodeguy: has joined #ruby
[14:59:37] bithon: has joined #ruby
[15:00:35] tulak: has joined #ruby
[15:00:44] slackR: has joined #ruby
[15:01:16] gregf: has joined #ruby
[15:01:46] stannard: has joined #ruby
[15:02:06] whippythellama: has joined #ruby
[15:02:34] grepwood: is there a way to capture output of system into a variable?
[15:03:03] al2o3-cr: grepwood: not with system
[15:03:16] devoldmx: has joined #ruby
[15:03:25] duckpuppy: has joined #ruby
[15:03:28] lurch_: has joined #ruby
[15:03:36] grepwood: as noted before I'm avoiding the mysql gem, it needs to many deps to work
[15:03:58] adaedra: grepwood: there are the backticks, but you'll get back to your escaping problem.
[15:04:06] blackms: has joined #ruby
[15:04:18] grepwood: so I do this, system 'mysql -e \'SELECT "Hello World!";\' | base64', to get a base64 of mysql's response
[15:04:20] al2o3-cr: grepwood: ``, %x(), IO.popen
[15:04:23] adaedra: Also, I remember that the dependencies for mysql gem is just the mysql dev package.
[15:04:37] ItSANgo_: has joined #ruby
[15:04:42] grepwood: it should be "SGVsbG8gV29ybGQhCkhlbGxvIFdvcmxkIQo=" if the database is working alright
[15:05:16] grepwood: adaedra, it fails to build in a horrible way on my vms
[15:05:37] chipotle: has joined #ruby
[15:05:40] grepwood: don't think boss would fancy my script having more than 300 lines already
[15:05:41] mary5030: has joined #ruby
[15:05:53] adaedra: Fix that. It will be way less painful to do than to try to make everything go through mysql binary.
[15:06:27] bweston92: has joined #ruby
[15:06:46] nettoweb: has joined #ruby
[15:07:59] underplank: has joined #ruby
[15:08:46] mary5030: has joined #ruby
[15:12:45] jhass: grepwood: use the mysql2 gem
[15:13:02] loren: has joined #ruby
[15:13:09] casadei: has joined #ruby
[15:15:16] Phage: has left #ruby: ()
[15:15:26] jdm_: has joined #ruby
[15:16:20] mchu: has joined #ruby
[15:16:59] bbert: has joined #ruby
[15:16:59] bbert: has joined #ruby
[15:17:00] ttilley: has joined #ruby
[15:17:00] ttilley: has joined #ruby
[15:20:28] kiez0rd: has joined #ruby
[15:20:53] kp666: has joined #ruby
[15:20:55] solocshaw: has joined #ruby
[15:21:01] tulak: has joined #ruby
[15:21:27] Suntzu: has joined #ruby
[15:22:13] rickmasta: has joined #ruby
[15:23:51] cdg: has joined #ruby
[15:26:53] ornerymoose: has joined #ruby
[15:27:53] kaka__: has joined #ruby
[15:28:51] moeabdol: has joined #ruby
[15:29:26] rippa: has joined #ruby
[15:29:49] atomical: has joined #ruby
[15:30:36] kp666: has joined #ruby
[15:31:00] failshell: has joined #ruby
[15:32:39] mustmodify: has joined #ruby
[15:32:48] mustmodify: Is there a way to ask gem where a certain gem lives?
[15:32:59] mustmodify: like, give me the directory where you stashed all that code?
[15:34:13] mustmodify: adaedra: Now that you've sent it, I'm kind of disappointed in myself I didn't just try that. :)
[15:34:35] apeiros: mustmodify: there's also always `gem help` ;-)
[15:34:50] BSaboia: has joined #ruby
[15:35:12] freerobby: has joined #ruby
[15:36:29] jhass: mustmodify: gem open is a thing too
[15:38:00] solocshaw: has joined #ruby
[15:38:53] n0xff: has joined #ruby
[15:39:30] marr: has joined #ruby
[15:39:40] grill: has joined #ruby
[15:39:52] akem: has joined #ruby
[15:40:14] grepwood: ...found it
[15:40:15] grepwood: i = Base64.encode64(IO.popen(["mysql", "-e", 'SELECT "Hello World!";']) { |ls_io| ls_result_with_error = ls_io.read })
[15:40:43] grepwood: couldn't understand a word of the mysql2 gem docs
[15:40:52] jhass: grepwood: I can honestly say that is the most horrible approach to something I've seen in a long time
[15:41:41] adaedra: Is this #ruby-masochism?
[15:41:55] DefV: I assumed #ruby-antipatterns
[15:42:04] axl_: has joined #ruby
[15:42:08] adaedra: #ruby-dontdothat
[15:42:12] aspire: has joined #ruby
[15:42:30] arup_r: has joined #ruby
[15:43:08] dfinninger: has joined #ruby
[15:43:14] DefV: #ruby-wat-r-u-doin-stahp
[15:45:35] tenderlove: has joined #ruby
[15:45:37] shanemcd: has joined #ruby
[15:47:13] apeiros: adaedra: see, again, clippy time
[15:47:29] adaedra: apeiros: we need one for HTML and Regex.
[15:47:30] apeiros: "it looks like you try to create an sql injection backdoor, do you wish some help?"
[15:47:33] senayar: has joined #ruby
[15:47:33] senayar: has joined #ruby
[15:47:36] dlitvak: has joined #ruby
[15:47:56] mchu: has joined #ruby
[15:48:03] adaedra: "it looks like you're trying to parse HTML with regex, do you wish me to ask you WHAT THE FUCK YOU ARE DOING?"
[15:48:17] symm-: has joined #ruby
[15:48:34] apeiros: "we offer regex consultancy services, and psychological counseling"
[15:48:43] apeiros: "trust us, you'll need both"
[15:52:55] roshanavand: has joined #ruby
[15:53:29] grepwood: it's dirty as heck but it works
[15:53:49] spt0: has joined #ruby
[15:53:51] speakingcode: has joined #ruby
[15:54:12] SenpaiSilver: has joined #ruby
[15:54:28] spt0: has joined #ruby
[15:55:24] ljarvis: 10:40 < jhass> grepwood: I can honestly say that is the most horrible approach to something I've seen in a long time
[15:55:27] ljarvis: 10:41 < grepwood> thank you
[15:56:48] arup_r: has joined #ruby
[15:56:56] casadei: has joined #ruby
[15:58:02] yqt: has joined #ruby
[15:58:28] yorickpeterse: I'm currently grepping Ruby code to determine which methods use ActiveRecord, so that I can instrument them
[15:58:34] yorickpeterse: ACTION shivers
[16:00:46] mustmodify: has left #ruby: ()
[16:00:56] yorickpeterse: check this out
[16:01:13] yorickpeterse: https://gist.github.com/YorickPeterse/0434416575e399649100
[16:01:21] kmckelvi1: has joined #ruby
[16:01:56] indy_bali: has joined #ruby
[16:02:05] ibouvousaime: has joined #ruby
[16:02:07] adaedra: dat filename.
[16:02:08] indy_bali: good night all
[16:02:16] jdm: has joined #ruby
[16:02:24] indy_bali: greetings from bali, indonesia
[16:02:31] yorickpeterse: somehow this breaks Devise though
[16:02:36] adaedra: Hi, indy_bali.
[16:02:40] yorickpeterse: it starts moaning about my secret key being gone
[16:02:46] dhollinger: has joined #ruby
[16:02:46] agent_white: has joined #ruby
[16:03:07] indy_bali: how are you, adaedra?
[16:03:20] jdm_: has joined #ruby
[16:03:25] adaedra: I'm doing ok. Do you have a question to ask us?
[16:03:36] RegulationD: has joined #ruby
[16:03:46] loren: has left #ruby: ("Leaving")
[16:03:47] indy_bali: i don't think so for this time. i just join in
[16:04:15] adaedra: If you want to smalltalk, I invite you to join #ruby-offtopic too.
[16:06:02] Xentil: has joined #ruby
[16:08:41] arup_r: has joined #ruby
[16:08:41] sepp2k: has joined #ruby
[16:09:00] dopie: has joined #ruby
[16:12:15] tesuji_: has joined #ruby
[16:14:50] roshanavand: has joined #ruby
[16:14:52] codecop: has joined #ruby
[16:15:05] shock_one: has joined #ruby
[16:16:24] bb010g: has joined #ruby
[16:17:40] wmdrossard: has joined #ruby
[16:18:28] ZiggyTheHamster: has joined #ruby
[16:18:29] ZiggyTheHamster: has joined #ruby
[16:20:45] hxegon: has joined #ruby
[16:21:17] Suntzu: has joined #ruby
[16:21:36] YankNYC: has joined #ruby
[16:23:47] roshanavand: has joined #ruby
[16:23:52] duckpuppy: has joined #ruby
[16:25:26] Sou|cutter: has joined #ruby
[16:25:31] bmalum_: has joined #ruby
[16:25:32] Jackneill: has joined #ruby
[16:25:38] dlitvak_: has joined #ruby
[16:25:50] dh64: has joined #ruby
[16:27:00] slawrence00: has joined #ruby
[16:27:49] mark3: has left #ruby: ("PART #RubyOnRails :PART #jquery :PART #reactjs :PART ##javascript :PART #elixir-lang :PART #debian :PART #zsh :PART #nethunter :PONG :leguin.freenode.net")
[16:29:08] kalopsian: has joined #ruby
[16:30:22] failshell: has joined #ruby
[16:30:32] whiteline: has joined #ruby
[16:31:15] TheBrayn: if you want smalltalk, join ##smalltalk
[16:31:53] dfinninger: has joined #ruby
[16:32:12] bithon: Hahah good one
[16:32:19] bithon: (hopefully that was a pun :D
[16:32:47] cwong_on_irc: has joined #ruby
[16:32:53] [Butch]: has joined #ruby
[16:32:57] AugustoC: has joined #ruby
[16:33:39] Vitor_: has joined #ruby
[16:34:09] zenlot: has joined #ruby
[16:34:58] dviola: has joined #ruby
[16:35:12] jawa_: has joined #ruby
[16:35:28] blackms: has joined #ruby
[16:37:31] marens: has joined #ruby
[16:37:32] marens: has joined #ruby
[16:37:39] dviola: has joined #ruby
[16:39:48] tenderlove: has joined #ruby
[16:41:23] chouhoulis: has joined #ruby
[16:41:23] hobodave: has joined #ruby
[16:41:49] mchu: has joined #ruby
[16:42:40] dlitvak: has joined #ruby
[16:42:43] Papierkorb: >> require 'yaml'; YAML.dump("foo")
[16:42:44] ruboto: Papierkorb # => "--- foo\n...\n" (https://eval.in/484905)
[16:42:56] Papierkorb: >> require 'psych'; Psych.dump("foo")
[16:42:57] ruboto: Papierkorb # => "--- foo\n...\n" (https://eval.in/484906)
[16:43:12] Papierkorb: Huh, when I do that in pry it says "NoMethodError: undefined method `dump' for Psych:Module"
[16:43:27] Encapsulation: has joined #ruby
[16:44:18] Papierkorb: $ gem uninstall psych # fixed it
[16:49:10] roshanavand: has joined #ruby
[16:49:41] atumzin: has joined #ruby
[16:49:42] atumzin: has joined #ruby
[16:49:49] sucks: has joined #ruby
[16:49:59] shock_one: has joined #ruby
[16:51:24] p0wn3d: has joined #ruby
[16:52:22] vasilakisFiL: has joined #ruby
[16:52:27] Papierkorb: Is there a way to always put quotation marks on strings when generating YAML? So I get ' foo: "bar" ' instead of ' foo: bar '
[16:52:31] vasilakisFiL: is there any alternative to timeout ?
[16:53:40] luckyno7: has joined #ruby
[16:55:06] toretore: vasilakisfil, the only real alternative is to use IO timeouts that are specific to each library
[16:55:21] toretore: i.e. Net::HTTP has a timeout that is set on IO operations directly
[16:55:44] jdelaney: has joined #ruby
[16:56:03] toretore: but Timeout is the only "generic" solution
[16:56:10] ElFerna: has joined #ruby
[16:56:38] steffkes: has joined #ruby
[16:56:39] steffkes: has joined #ruby
[16:56:53] jhass: Papierkorb: I haven't found any beyond using ya2yaml :/
[16:57:33] jhooker: has joined #ruby
[16:57:42] Papierkorb: jhass: meh. thanks.
[16:58:13] rcs: has joined #ruby
[16:59:09] senayar: has joined #ruby
[16:59:10] senayar: has joined #ruby
[17:01:37] Vile`: has joined #ruby
[17:01:58] synthroid: has joined #ruby
[17:02:21] madcodes: has joined #ruby
[17:03:54] amclain: has joined #ruby
[17:04:03] devoldmx: has joined #ruby
[17:04:05] synthroid: has joined #ruby
[17:05:41] moeabdol: has joined #ruby
[17:06:57] Dimik: has joined #ruby
[17:08:49] jbrhbr: has joined #ruby
[17:09:16] ta: has joined #ruby
[17:09:21] dionysus69: has joined #ruby
[17:09:23] dravine_: has joined #ruby
[17:13:44] claw: has joined #ruby
[17:14:04] nertzy: has joined #ruby
[17:14:42] Vile`: has joined #ruby
[17:16:11] tomphp: has joined #ruby
[17:17:29] gusTester: has joined #ruby
[17:18:29] Lildirt: has joined #ruby
[17:18:47] FooMunki: has joined #ruby
[17:18:52] techsethi: has joined #ruby
[17:18:54] steffkes: has joined #ruby
[17:18:55] steffkes: has joined #ruby
[17:20:05] ornerymoose: has joined #ruby
[17:21:10] dfinninger: has joined #ruby
[17:21:40] dlitvak: has joined #ruby
[17:22:00] shanemcd: has joined #ruby
[17:23:10] gaiada: has joined #ruby
[17:23:10] rickmasta: has joined #ruby
[17:24:47] CrazyEddy: has joined #ruby
[17:25:53] duckpuppy: has joined #ruby
[17:26:24] gusTester: has joined #ruby
[17:26:56] ledestin: has joined #ruby
[17:27:21] mchu: hello, a little help. can anyone explain what this code means?
[17:27:23] mchu: if login_with_credentials resource.username, params[:roster_session][:password]
[17:27:39] adaedra: which part?
[17:27:53] mchu: resource.username, params[:roster_session][:password]
[17:28:07] mchu: why is there a comma after resource.username? what does that mean
[17:28:15] adaedra: those are the parameters of login_with_credentials
[17:28:37] adaedra: if we put back optional parenthesis, it's `if login_with_credentials(resource.username, params[:roster_session][:password])`
[17:29:06] mchu: oh i see. ok thanks, let me try to work with that really quick
[17:29:49] Sou|cutter: has joined #ruby
[17:29:56] RobertBirnie: has joined #ruby
[17:31:08] shevy: a vimster!
[17:31:14] shevy: it tampers with ze brains
[17:31:24] mchu: adaedra: is it normal to have parameters for an If Statement? i thought parameters are usually for methods
[17:31:42] nateberkopec: has joined #ruby
[17:31:50] adaedra: you have a method, it's login_with_credentials
[17:32:13] adaedra: it's calling login_with_credentials with the two given parameters, and the if is done on the return of this method
[17:32:28] sol: has joined #ruby
[17:32:44] mchu: ohh right
[17:32:49] psye: has joined #ruby
[17:33:47] psye: has joined #ruby
[17:34:01] tenderlove: has joined #ruby
[17:35:57] mchu: thanks adaedra
[17:37:25] mikecmpbll: has joined #ruby
[17:39:19] polishdub: has joined #ruby
[17:39:30] kenichi: has joined #ruby
[17:42:04] TheBloke-: has joined #ruby
[17:42:56] fantazo: has joined #ruby
[17:43:23] moeabdol: has joined #ruby
[17:44:16] tildes: has joined #ruby
[17:44:22] davedev24: has joined #ruby
[17:46:08] ruby-lang437: has joined #ruby
[17:47:30] lemur: has joined #ruby
[17:51:02] momomomomo: has joined #ruby
[17:52:51] jbrhbr: has joined #ruby
[17:53:29] spt0: has joined #ruby
[17:54:07] ornerymoose: has joined #ruby
[17:54:37] Lildirt: has joined #ruby
[17:56:15] berserk_ren: has joined #ruby
[17:58:31] lemur: has joined #ruby
[18:00:12] gizmore: has joined #ruby
[18:01:23] bronson: has joined #ruby
[18:01:39] ElFerna: has joined #ruby
[18:02:15] zast: has joined #ruby
[18:02:19] howdoico1: has joined #ruby
[18:03:05] Saklovich: has joined #ruby
[18:03:05] ChanServ: +b *!*@unaffiliated/lovich
[18:03:05] ChanServ: ChanServ kicked Saklovich: trolling
[18:03:12] Scripore: has joined #ruby
[18:05:20] Synthead: has joined #ruby
[18:06:36] TomyLobo: has joined #ruby
[18:06:48] baweaver: has joined #ruby
[18:08:11] JDiPierro: has joined #ruby
[18:08:37] SylarRuby: has joined #ruby
[18:09:19] angrywombat: has joined #ruby
[18:10:01] InvGhost: has joined #ruby
[18:10:25] SegFaultAX: has joined #ruby
[18:11:28] angrywombat: has left #ruby: ()
[18:13:06] Lildirt: has joined #ruby
[18:13:50] tomphp: has joined #ruby
[18:13:55] emilkarl: has joined #ruby
[18:14:26] ibouvousaime: has joined #ruby
[18:14:32] Cohedrin: has joined #ruby
[18:14:56] jpfuentes2: has joined #ruby
[18:14:58] rehat: has joined #ruby
[18:15:49] banister: has joined #ruby
[18:16:36] djbkd: has joined #ruby
[18:16:58] snockerton: has joined #ruby
[18:18:30] thomasfedb_: How're we looking for a Flynn that I can update?
[18:18:42] thomasfedb_: (without reinstalling)
[18:18:46] pdoherty: has joined #ruby
[18:18:58] [Butch]: has joined #ruby
[18:20:30] _djbkd: has joined #ruby
[18:20:33] jgt2: has joined #ruby
[18:21:10] kfpratt: has joined #ruby
[18:21:30] snockerton: i need a way to do a #merge equivalent on an existing OpenStruct object - doesn't look like it's supported natively - any ideas?
[18:21:56] arooni: has joined #ruby
[18:22:21] colleenmcguckin: has joined #ruby
[18:22:29] apeiros: snockerton: #to_hash, merge, construct new openstruct from result
[18:22:41] snockerton: doh, just realized i could to_h it
[18:23:16] apeiros: ah right, to_h, not to_hash (to_hash was my name for it when to_h didn't exist yet)
[18:23:37] snockerton: is there an actual difference?
[18:23:50] snockerton: i just figured it was a ruby lazy-ism
[18:24:12] Scripore: has joined #ruby
[18:24:54] Lildirt: has joined #ruby
[18:26:36] duckpuppy: has joined #ruby
[18:26:51] rakm: has joined #ruby
[18:28:06] colleenmcguckin: has joined #ruby
[18:30:23] snguyen: has joined #ruby
[18:32:13] Eiam: has joined #ruby
[18:33:23] dlitvak: has joined #ruby
[18:33:32] pawnbox: has joined #ruby
[18:34:34] bronson: has joined #ruby
[18:35:24] Frem: has joined #ruby
[18:36:05] kmckelvi1: has joined #ruby
[18:39:25] ur5us: has joined #ruby
[18:40:27] jessemcgilallen: has joined #ruby
[18:41:28] azgil: has joined #ruby
[18:42:25] s00pcan: has joined #ruby
[18:43:18] pika_pika: has joined #ruby
[18:44:31] platzhirsch: has left #ruby: ()
[18:44:36] zdman135: has joined #ruby
[18:45:23] howdoico1: has joined #ruby
[18:45:27] weaksauce: has joined #ruby
[18:47:27] dionysus69: has joined #ruby
[18:48:28] Pupeno: has joined #ruby
[18:48:29] Pupeno: has joined #ruby
[18:49:11] aibot_: has joined #ruby
[18:49:11] last_staff: has joined #ruby
[18:50:32] papercode: has joined #ruby
[18:51:02] thomasfedb: has joined #ruby
[18:51:22] B1n4r10: has joined #ruby
[18:52:02] jbrhbr: has joined #ruby
[18:54:18] Omen-DiE-: has joined #ruby
[18:55:35] akem: has joined #ruby
[18:56:54] postmodern: has joined #ruby
[18:57:10] kadoppe: has joined #ruby
[18:57:44] moeabdol: has joined #ruby
[18:58:14] thejamespinto: has joined #ruby
[18:58:19] xaxisx: has joined #ruby
[18:58:19] Omen-DiE-: has joined #ruby
[18:59:15] shadoi: has joined #ruby
[18:59:35] firstdayonthejob: has joined #ruby
[19:01:31] davejlong: has joined #ruby
[19:02:17] weaksauce: has joined #ruby
[19:02:30] bl4ckw4ter: has joined #ruby
[19:03:40] jokke: has joined #ruby
[19:03:53] djbkd: has joined #ruby
[19:04:18] guacjack: has joined #ruby
[19:04:42] saddad: has joined #ruby
[19:04:50] djbkd: has joined #ruby
[19:04:58] bl4ckw4ter: has left #ruby: ()
[19:05:00] devoldmx: has joined #ruby
[19:05:33] ElFerna: has joined #ruby
[19:05:54] dlitvak: has joined #ruby
[19:07:27] RegulationD: has joined #ruby
[19:07:44] thejamespinto: has joined #ruby
[19:07:45] howdoico1: has joined #ruby
[19:07:46] calderonroberto: has joined #ruby
[19:08:18] ta: has joined #ruby
[19:09:48] Regulati_: has joined #ruby
[19:10:34] xaoz_: has joined #ruby
[19:11:14] Cohedrin: has joined #ruby
[19:11:40] Lildirt: has joined #ruby
[19:11:48] n008f4g_: has joined #ruby
[19:13:10] shevy: snockerton I assume it is probably out of consistency, we have .to_s, .to_i, .to_f and .to_a; there also is .to_str though
[19:13:13] spider-mario: has joined #ruby
[19:13:33] shevy: I have no idea why apeiros associates .to_h with .to_hash but not .to_a with .to_array though :)
[19:13:52] jdelaney: has joined #ruby
[19:13:53] shevy: oh I forgot .to_sym
[19:14:07] jbrhbr: my interpretation is that he had his own library that defined .to_hash before .to_h existed in ruby
[19:14:10] apeiros: shevy: never had a need of defining a to_array
[19:14:13] kalopsian: has joined #ruby
[19:14:23] apeiros: jbrhbr: correct
[19:14:54] apeiros: ruby didn't standardize for to_h back then.
[19:15:01] skcin7: has joined #ruby
[19:15:08] jbrhbr: only weird thing there for a newcomer such as myself, which i brought up a couple of weeks ago, is that there is no .to_b
[19:15:08] apeiros: (nor did any core class have a to_h)
[19:15:23] apeiros: jbrhbr: to_boolean?
[19:15:36] apeiros: we rarely ever need that
[19:15:50] apeiros: false/nil being the only falsy values obviates the need in most cases
[19:16:11] shevy: x = "true"; x.to_bool now that would be something
[19:16:16] Pupeno: has joined #ruby
[19:16:16] jbrhbr: i admit its use is limited, but there seems to be other things that would be used less but are still in the language, whereas this creates a slight inconsistency
[19:16:33] jbrhbr: shevy: your example is probably why it doesn't exist
[19:16:35] apeiros: jbrhbr: it's easy to add
[19:16:51] jbrhbr: shevy: ppl argue that the semantics are ambiguous because some people want to define it as you have written
[19:17:06] apeiros: class NilClass; def to_b; false; end; end; class FalseClass; def to_b; false; end; end; class Object; def to_b; true; end; end
[19:17:10] jbrhbr: i argue that it should just be: !!v, ie, "pass it through the truthiness algorithm"
[19:18:06] yardenbar: has joined #ruby
[19:18:08] kalopsian: has joined #ruby
[19:18:45] jessemcgilallen: has joined #ruby
[19:18:47] shevy: jbrhbr hmm yeah... I only had to do this for strings though actually
[19:19:22] shevy: I got tired of having to write true or false in yaml files to I simply used t and f instead :D
[19:20:33] jbrhbr: my curiosity was just piqued because i saw the !!v idiom being used here at work and i was like "why didn't this code use .to_b? ops, it doesn't exist". but the better argument is why !!v is needed at all perhaps
[19:21:54] shevy: I like the ! toggler
[19:21:59] djbkd: has joined #ruby
[19:22:11] tenderlove: has joined #ruby
[19:22:11] shevy: it's like turning a switch on and off ... "turn into a pigeon! turn into a pigeon!"
[19:22:13] luckyno7: has joined #ruby
[19:22:20] shevy: eventually I will have a pigeon
[19:22:43] bbert: has joined #ruby
[19:22:43] bbert: has joined #ruby
[19:22:48] jbrhbr: bang enough, and you'll have a pigeon
[19:23:11] momomomomo: has joined #ruby
[19:23:24] dlitvak_: has joined #ruby
[19:23:44] shevy: I think I saw it first in ruby ... I was using perl, then php but can't remember having used that there
[19:23:45] rickmasta: has joined #ruby
[19:27:21] duckpuppy: has joined #ruby
[19:27:21] apeiros: the most common case where I translate a value to a boolean is when I don't want to expose inner state
[19:27:38] apeiros: e.g. there's plenty of people who'll write code like: `def foo?; @some_complex_value; end`
[19:28:06] apeiros: and @some_complex_value can be either nil or a complex value - which represent the falsy and truthy results
[19:28:33] apeiros: I prefer to actually return a boolean, to avoid that complex value ending up being referenced somewhere it doesn't belong
[19:28:48] ap4y: has joined #ruby
[19:29:01] apeiros: additionally to avoid people stupidly not reading the docs and relying on foo? to return the complex value
[19:29:19] ta: has joined #ruby
[19:29:21] apeiros: though, that's a minor concern. people who do that deserve the hurt :)
[19:29:30] troulouliou_dev: has joined #ruby
[19:30:34] axl_: has joined #ruby
[19:30:37] ta: has joined #ruby
[19:30:40] troulouliou_dev: has joined #ruby
[19:31:07] edwinvdgraaf: has joined #ruby
[19:31:31] chouhoul_: has joined #ruby
[19:31:37] troulouliou_dev: has joined #ruby
[19:32:07] nettoweb: has joined #ruby
[19:32:24] jdm: has joined #ruby
[19:32:35] troulouliou_dev: has joined #ruby
[19:32:36] dfinninger: has joined #ruby
[19:32:36] shevy: there are two difficult-to-handle things in software evolution
[19:32:38] Vitor_: has joined #ruby
[19:32:39] shevy: - complexity
[19:32:42] shevy: - naming things
[19:33:27] eam: - off by one errors
[19:33:34] edwinvdgraaf: has joined #ruby
[19:33:43] troulouliou_dev: has joined #ruby
[19:34:54] axl_: has joined #ruby
[19:34:55] SHyx0rmZ: has joined #ruby
[19:35:09] troulouliou_dev: has joined #ruby
[19:35:18] msx: has joined #ruby
[19:35:22] jdm: has joined #ruby
[19:35:25] Icey: "\n".gsub(/\n/, 'yay') => "yay"; '\n'.gsub(/\n/, 'yay') => "\\n"
[19:35:39] Icey: how can I get a regular expression to match the second format as well?!
[19:36:20] eam: Icey: /\n|\\n/
[19:36:23] apeiros: Icey: you realize that '\n' is a backslash followed by an n, NOT a newline?
[19:36:40] eam: also what apeiros said
[19:36:50] Icey: yes apeiros I'm working on parsing
[19:36:52] apeiros: >> "\n" == '\n' # will be false
[19:36:53] ruboto: apeiros # => false (https://eval.in/485007)
[19:37:02] eam: Icey: are you, by chance, doing advent of code?
[19:37:08] apeiros: Icey: well, then what eam said. because /\n/ matches a newline.
[19:37:10] slash_nick: i wondered that
[19:37:12] Icey: just wondering what the case for a string containing \n but not being a newline would be
[19:37:16] Icey: no to advent of code
[19:37:28] eam: slash_nick: I just started again
[19:37:42] eam: I'm doing look and say
[19:37:45] slash_nick: eam: i didn't get to spend any time at a computer last weekend, so i have to catch up
[19:37:50] slash_nick: look and say was so much fun, i thought
[19:37:50] apeiros: Icey: eh, the point is that your string does not contain \n. it contains \\n
[19:37:58] Icey: fair enough
[19:38:21] slash_nick: Icey: be consistent with your decision to use single or double quotes
[19:38:37] Icey: I'm contemplating a compiler, so my program will be fed strings
[19:38:47] Icey: I won't get to decide what the strings are, just what I don't support :)
[19:38:59] mg^: heh advent of code, looks fun
[19:39:04] slash_nick: mg^: much much
[19:39:18] slash_nick: also, the gchq christmas card puzzles
[19:39:29] eam: it has a nice progression from trivial to taking some consideration
[19:41:09] howdoico1: has joined #ruby
[19:41:23] edwinvdgraaf: has joined #ruby
[19:41:31] colegatron: has joined #ruby
[19:41:54] kalopsian: has joined #ruby
[19:42:08] pdoherty: has joined #ruby
[19:42:23] mg^: my brain doesn't do crypto puzzles well, so I'll look at the gchq stuff when I have run out of everything else to do
[19:42:43] mg^: but writing a reindeer simulation is well within my skill set
[19:42:48] chouhoulis: has joined #ruby
[19:43:58] Vitor_: has joined #ruby
[19:44:08] weemsledeux: has joined #ruby
[19:44:52] yfeldblum: has joined #ruby
[19:44:52] BadQuanta: has joined #ruby
[19:45:48] yqt: has joined #ruby
[19:46:08] f00bar-32: has joined #ruby
[19:46:12] aspire: has joined #ruby
[19:48:20] jbrhbr: has joined #ruby
[19:49:05] djbkd: has joined #ruby
[19:49:45] tulak: has joined #ruby
[19:51:50] slash_nick: yeah, something satsifying about driving a robotic santa around a 2d grid
[19:55:48] gioele: has left #ruby: ()
[19:56:01] aryaching: has joined #ruby
[19:56:25] snowy: has joined #ruby
[19:58:27] djbkd: has joined #ruby
[19:58:59] shevy: what are crypto puzzles
[19:59:12] shevy: writing a reindeer simulation sounds like fun though
[19:59:31] rikai: has joined #ruby
[19:59:32] shevy: apeiros once famously wrote an audio song alle meine entlein... perhaps he does a new variant for xmas melodies :D
[20:01:09] shevy: (except when it would be "last xmas, I gave you my heart ...")
[20:02:10] baweaver: has joined #ruby
[20:03:07] dfinninger: has joined #ruby
[20:04:05] eam: crypto puzzles are stuff like "why is my openssl library linking all screwed up"
[20:04:38] gizmore: shevy: ?selzzup otpyrc
[20:04:59] shevy: that reminds me... I had a mix up when I had installed both libressl and openssl, one program was using libressl rather than openssl when I tried to compile it
[20:05:08] shevy: gizmore let me decipher that...
[20:05:16] shevy: k seems like .reverse
[20:05:32] gizmore: actually it??s a book cipher
[20:05:52] gizmore: "selzzup otpyrc" means "you are right, this is not crackable and plausible deniable"
[20:05:59] snockerton: has joined #ruby
[20:06:06] shevy: >> "selzzup otpyrc".reverse
[20:06:07] ruboto: shevy # => "crypto puzzles" (https://eval.in/485017)
[20:06:13] gizmore: coincidence :)
[20:06:16] colleenmcguckin: has joined #ruby
[20:06:27] gizmore: of course the words in the codebook are chosen to distract you!
[20:06:55] gizmore: read up on navajo code book
[20:07:02] droidburgundy: has joined #ruby
[20:07:12] ElFerna: has joined #ruby
[20:07:53] shevy: a crypto egg?
[20:08:26] otherj: has joined #ruby
[20:08:47] mg^: OK I know which reindeer is ahead at 2503 seconds.
[20:09:09] nhhagen: has joined #ruby
[20:09:45] gizmore: Cryptologist are not allowed in casinos, because they tend to count cards
[20:10:25] mg^: heh, I learned how to count cards, can't help myself now at the blackjack table
[20:10:44] mg^: I just force myself to leave when I am about $20 ahead
[20:10:46] shevy: I saw some videos about professional cheaters in casino... pretty creative some of them were there
[20:10:58] mg^: because I'm not at all slick about it like that movie
[20:11:13] gizmore: mg^: isn??t it pretty hard with 4 or 6 decks,.... or better said, quite useless?
[20:11:26] mg^: no, number of decks doesn't matter
[20:11:29] mg^: it's how often they shuffle
[20:11:33] edwinvdgraaf: has joined #ruby
[20:11:33] gizmore: as they stop at the half?
[20:11:33] mg^: and how many they burn off the top
[20:11:37] rikai: has joined #ruby
[20:11:51] shevy: so many things you have to keep in mind
[20:12:05] atomical: has joined #ruby
[20:12:19] mg^: basically, the more decks, the longer you need the cards to stay in play before your count becomes useful
[20:12:29] gizmore: Do you want another card? "yes" - The next card would have been a sheep!, wanna re-consider?
[20:12:30] shevy: same thing with professional players in games, like warcraft 3 or starcraft 2... the amount of factors they consider, or what they have to calculate to min-max, at which specific time ...
[20:13:19] gizmore: i??d say sc2 and such games are quite easy to play well with lots of clicks and keyboard gestures
[20:13:42] gizmore: it??s more about concentration on the movement and build up quickly, than strategic decisions
[20:14:15] gizmore: of course, you should not make horrible mistakes and have a strategy... but in the end the clickspersecond matter a lot
[20:14:40] shevy: gizmore I may have thought so too until I listened to some of grubby's post-play commentaries... one of the best statements he made was "to enable later opportunities"... that is, if you adapt your playing style, e. g. push for more pressure at the right time, the game may be easier lateron
[20:15:17] colleenmcguckin: has joined #ruby
[20:16:06] tenderlove: has joined #ruby
[20:16:12] gizmore: shevy: yeah... but the research etc is not _that_ important i bet, compared to resource hogging and such things
[20:16:24] momomomomo: has joined #ruby
[20:16:36] gizmore: who gets second resources first, usually was the winner in sc1
[20:20:09] jessemcgilallen: has joined #ruby
[20:20:54] mchu: has joined #ruby
[20:21:19] shanemcd: has joined #ruby
[20:21:42] steffkes: has joined #ruby
[20:21:43] steffkes: has joined #ruby
[20:22:55] rikai: has joined #ruby
[20:24:11] _stu_: has joined #ruby
[20:24:24] tildes: has joined #ruby
[20:24:44] yqt: has joined #ruby
[20:24:55] kmckelvin: has joined #ruby
[20:25:50] baweaver: has joined #ruby
[20:26:15] Vitor: has joined #ruby
[20:27:50] Pupeno_: has joined #ruby
[20:28:09] duckpuppy: has joined #ruby
[20:28:59] AnoHito: has joined #ruby
[20:30:19] tvw: has joined #ruby
[20:30:38] bbert: has joined #ruby
[20:30:38] bbert: has joined #ruby
[20:34:57] idakyne: has joined #ruby
[20:35:21] prestorium: has joined #ruby
[20:35:29] n_blownapart: has joined #ruby
[20:35:30] mchu: can i get some help?
[20:35:45] mchu: error: undefined method `empty?' for 1:Fixnum
[20:35:59] mchu: for line: %a{href: incidents_chapter_root_path(current_chapter)}
[20:36:52] dfinning_: has joined #ruby
[20:37:56] havenwood: >> 1.empty?
[20:37:57] ruboto: havenwood # => undefined method `empty?' for 1:Fixnum (NoMethodError) ...check link for more (https://eval.in/485025)
[20:38:58] mchu: how do i fix it?
[20:39:26] mchu: i dont understand the error
[20:39:54] havenwood: >> 1.respond_to? :empty?
[20:39:55] ruboto: havenwood # => false (https://eval.in/485027)
[20:40:22] ElFerna: has joined #ruby
[20:40:30] havenwood: mchu: ^, but for example:
[20:40:31] havenwood: >> [].respond_to? :empty?
[20:40:32] ruboto: havenwood # => true (https://eval.in/485028)
[20:40:44] havenwood: mchu: Are you familiar with irb or Pry?
[20:41:14] mchu: not great with it, but some what know it
[20:42:08] havenwood: mchu: In irb try `[].empty?` and `[0, 42].empty?` or `"".empty?` and `"guffaw!".empty?`.
[20:42:16] mchu: ok thanks
[20:42:43] bigkevmcd: has joined #ruby
[20:43:35] bbert: has joined #ruby
[20:43:35] bbert: has joined #ruby
[20:43:35] mchu: i understand ???.empty???? however i dont understand why i???m getting an error on the line
[20:43:38] mchu: %a{href: incidents_chapter_root_path(current_chapter)}
[20:43:39] mchu: %i.fa.fa-fire.fa-2x
[20:43:44] havenwood: mchu: Are you looking at redcross arcdata then?
[20:43:57] mchu: howd you know haha
[20:44:15] kmckelvin: has joined #ruby
[20:44:32] havenwood: mchu: The best place for Rails questions is the #RubyOnRails channel. That'd be the place to ask why you're getting a Fixnum rather than the expected Object that responds to #empty?.
[20:44:40] mchu: ok thanks!
[20:44:46] havenwood: mchu: you're welcome
[20:45:04] blackgoat: has joined #ruby
[20:45:41] Scripore: has joined #ruby
[20:45:57] moeabdol: has joined #ruby
[20:48:08] mchu: havenwood: getting an error when typing in #rubyonrails room
[20:48:10] mchu: ???can???t send to room ???#rubyonrails??? on ???cht.freenode.net???"
[20:48:21] mchu: any ideas why?
[20:48:42] dfinninger: has joined #ruby
[20:48:57] havenwood: mchu: Register your IRC nick and identify yourself: https://freenode.net/faq.shtml#nicksetup
[20:49:47] havenwood: mchu: /msg NickServ HELP REGISTER
[20:50:10] jgpawletko: has joined #ruby
[20:50:10] EvilDMP: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[20:50:28] jgt2: has joined #ruby
[20:52:00] dhollinger: has joined #ruby
[20:52:10] mary5030: has joined #ruby
[20:53:08] kalopsian: has joined #ruby
[20:53:45] gusTester: has left #ruby: ()
[20:53:49] mary5030: has joined #ruby
[20:55:01] Fire-Dragon-DoL: has joined #ruby
[20:55:15] zequix: has joined #ruby
[20:55:36] bap1313: has joined #ruby
[20:55:47] gizless: has joined #ruby
[20:56:22] SylarRuby: has joined #ruby
[20:56:27] colleenmcguckin: has joined #ruby
[20:56:43] kobain: has joined #ruby
[20:57:37] freerobby: has joined #ruby
[20:57:57] juddey: has joined #ruby
[20:58:07] zeroDivisible: has joined #ruby
[20:59:35] FernandoBasso: has joined #ruby
[21:01:46] ta: has joined #ruby
[21:02:59] SenpaiSilver: has joined #ruby
[21:04:21] djbkd: has joined #ruby
[21:04:45] atomical: has joined #ruby
[21:05:04] n_blowna_: has joined #ruby
[21:05:46] devoldmx: has joined #ruby
[21:06:15] ricer2: has joined #ruby
[21:06:35] DavidDudson: has joined #ruby
[21:08:01] shevy: unfinished thought here ...
[21:08:02] ta: has joined #ruby
[21:08:16] shevy: we have ... modules and classes. we can add methods from a module, into a class, but we have to do a include
[21:08:28] shevy: is there a way to add methods of a module to a class, without using include or extend?
[21:08:52] gizless: shevy: yes... with kinda reflection
[21:09:15] gizmore: in theory with kinda reflection, no?
[21:09:38] pwnd_nsfw: has joined #ruby
[21:09:44] shevy: reason I ask this is ... I have a main namespace right now which is a module, there I add some methods to the main namespace... but I also want to have these methods in the main namespace be available for classes, without include... I guess it may not be possible but I am asking for confirmation
[21:09:47] gizmore: "just" get the methods for a module and add them to the class... maybe possible
[21:09:51] shevy: gizmore I dunno, it is over the top of my head right now
[21:10:04] havenwood: shevy: prepend
[21:10:17] tenderlove: has joined #ruby
[21:10:50] adaedra: >> module A; def self.foo; "Hello"; end; end; class B; end; B.send(:define_method, :bar, &A.method(:foo)); B.new.bar
[21:10:51] ruboto: adaedra # => "Hello" (https://eval.in/485047)
[21:12:04] [gmi]: has joined #ruby
[21:12:11] shevy: hmm let me think
[21:12:19] havenwood: shevy: PR merged so it'll be fixed when rubygems.org next deploys.
[21:12:23] pawnbox: has joined #ruby
[21:12:27] shevy: havenwood wheeee \o/
[21:14:43] dlitvak: has joined #ruby
[21:14:58] moeabdol: has joined #ruby
[21:15:25] hobodave: has joined #ruby
[21:16:35] kerframil: has joined #ruby
[21:17:53] bbert: has joined #ruby
[21:17:54] bbert: has joined #ruby
[21:18:07] jackjackdripper: has joined #ruby
[21:18:15] ESpiney: has joined #ruby
[21:18:52] colleenmcguckin: has joined #ruby
[21:19:24] jackjackdripper: has joined #ruby
[21:20:39] DrCode: has joined #ruby
[21:22:01] Dreamer3: has joined #ruby
[21:22:29] howdoico1: has joined #ruby
[21:22:45] baweaver: has joined #ruby
[21:23:22] spt0: has joined #ruby
[21:24:09] akem: has joined #ruby
[21:24:16] Pumukel: has joined #ruby
[21:24:41] drys: has joined #ruby
[21:25:06] rickmasta: has joined #ruby
[21:26:41] moeabdol: has joined #ruby
[21:27:59] BrunoSaboia: has joined #ruby
[21:28:54] rgtk: has joined #ruby
[21:28:55] duckpuppy: has joined #ruby
[21:29:58] dlitvak: has joined #ruby
[21:31:17] JDiPierro: has joined #ruby
[21:33:56] DavidDudson: has joined #ruby
[21:35:30] akem: has joined #ruby
[21:36:14] makenoise: has joined #ruby
[21:37:02] moeabdol1: has joined #ruby
[21:37:45] petanikode: has joined #ruby
[21:37:46] shock_one: has joined #ruby
[21:39:37] bbert: has joined #ruby
[21:39:37] bbert: has joined #ruby
[21:40:21] dlitvak: has joined #ruby
[21:40:34] minimalism: has joined #ruby
[21:40:37] akem2: has joined #ruby
[21:41:27] seitensei: has joined #ruby
[21:41:27] seitensei: has joined #ruby
[21:42:39] gusTester: has joined #ruby
[21:44:08] Ishido: has joined #ruby
[21:44:37] makenoise: has joined #ruby
[21:44:45] ledestin: has joined #ruby
[21:45:04] nettoweb: has joined #ruby
[21:46:14] shock_one: has joined #ruby
[21:47:14] howdoicomputer: has joined #ruby
[21:47:39] steffkes: has joined #ruby
[21:47:39] steffkes: has joined #ruby
[21:48:36] duncannz: has joined #ruby
[21:49:40] akem: has joined #ruby
[21:50:18] drysjasper: has joined #ruby
[21:51:04] zenlot: has joined #ruby
[21:52:50] radgeRayden_: has joined #ruby
[21:53:16] akem2: has joined #ruby
[21:53:42] htmldrum: has joined #ruby
[21:53:46] howdoicomputer: has joined #ruby
[21:54:51] davedev24: has joined #ruby
[21:58:11] ttilley: has joined #ruby
[21:59:11] akem: has joined #ruby
[21:59:35] atomical: has joined #ruby
[21:59:54] claw: has joined #ruby
[22:00:13] ttilley: has joined #ruby
[22:00:31] chouhoul_: has joined #ruby
[22:00:56] houhoulis: has joined #ruby
[22:01:54] neanderslob: has joined #ruby
[22:02:44] cdg: has joined #ruby
[22:03:00] chouhoulis: has joined #ruby
[22:03:09] drys: has joined #ruby
[22:03:27] jdelaney: has joined #ruby
[22:03:35] akem: has joined #ruby
[22:03:55] threh: has joined #ruby
[22:04:29] rikai: has joined #ruby
[22:04:31] tenderlove: has joined #ruby
[22:05:49] rayzaum: has joined #ruby
[22:07:15] leat1: has joined #ruby
[22:07:48] djcp1: has joined #ruby
[22:09:55] tulak: has joined #ruby
[22:09:56] riceandbeans: has left #ruby: ()
[22:10:36] dlitvak: has joined #ruby
[22:10:51] cassioscabral: has joined #ruby
[22:11:27] pdoherty: has joined #ruby
[22:13:56] jdelaney: has joined #ruby
[22:14:53] kmckelvin: has joined #ruby
[22:14:53] howdoicomputer: has joined #ruby
[22:15:01] xaxisx: has left #ruby: ()
[22:15:57] FCser: Hmm I have a silly question about scope.... I have a cinch bot with the megahal plugin. I want megahal to respond to it's own name instead of a prefix / string. Is there a way to make @bot available outside of methods to make line #51 work? http://pastie.org/10632875#49
[22:17:00] zequix_: has joined #ruby
[22:17:12] axl__: has joined #ruby
[22:18:08] TomyLobo: if you want #megahal to respond, ask in #megahal. as to your question of scope. this is clearly out of scope :P
[22:18:14] Kabaka: has joined #ruby
[22:18:38] howdoicomputer: has joined #ruby
[22:19:22] shevy: fcser if you have a butler bot you could perhaps ask apeiros!
[22:19:42] shevy: dominikh wrote cinch, he used to be on #ruby-lang but seems to not have survived the transition into #ruby
[22:20:10] FCser: well I was just curious I thought there was some way to make the variable available "out of scope"..
[22:20:16] mclong: has joined #ruby
[22:20:20] FCser: with lambda or somethin or maybe it's not possible
[22:20:30] FCser: or just checking every message the way it is now is fine
[22:20:34] TomyLobo: fcser, as to your actual question about scope, you have a lifetime problem there, not just a scope problem
[22:20:41] adaedra: not this way
[22:21:00] TomyLobo: fcser, i assume you mean @hal, yes?
[22:21:26] TomyLobo: @hal is initialized upon instantiation and it belongs to an instance of HAL
[22:21:46] adaedra: fcser: I don't think this can work this way; if your bot get renamed, you want it to respond to your new name, right?
[22:21:52] TomyLobo: that match is in calss scope and is run way earlier, when the class HAL is first loaded
[22:22:01] FCser: adaedra: correct
[22:22:59] TomyLobo: s/calss/class/
[22:23:04] hxegon: has joined #ruby
[22:23:13] bithon: has joined #ruby
[22:23:26] FCser: TomyLobo: ok yes this is what I'm experiencing
[22:23:32] FCser: since bot is empty at that point
[22:23:40] Xentil: has joined #ruby
[22:23:42] FCser: so it's just 'not possible' I'm approaching it wrong or something
[22:23:58] adaedra: fcser: I think you'll have to intercept all messages, and match afterwards, in the handler. Here your name will be available.
[22:24:15] FCser: that's what I'm doing - was just concrned if that was too... heavy handed
[22:24:17] FCser: but it will work
[22:24:42] adaedra: that's what cinch is doing anyway.
[22:24:48] TomyLobo: fcser, well you need your name variable to exist before that match line is run
[22:24:54] adaedra: You're just moving the match from cinch code to your code.
[22:26:38] gaiada: has joined #ruby
[22:27:15] ni291187: has joined #ruby
[22:28:19] FCser: TomyLobo: I did try defining a special @botnick = @bot.nick variable in the initialization method but @bot.nick is empty at that point too
[22:28:21] claw: has joined #ruby
[22:28:35] FCser: either way thanks i'm understanding a bit more
[22:28:54] TomyLobo: fcser, the initialization method is an instance method
[22:29:19] TomyLobo: when "match" is run, no instance exists yet
[22:29:21] Azure: has joined #ruby
[22:29:34] TomyLobo: because, for one, the class isnt even fully initialized yet
[22:31:14] ornerymoose: has joined #ruby
[22:32:01] SCHAAP137: has joined #ruby
[22:32:38] FCser: TomyLobo: ok makes sense - I was just thinking @bot.nick would be available since megahal is a subclass of cinch bot
[22:33:05] TomyLobo: that doesnt matter at all
[22:33:09] TomyLobo: there is no instance yet
[22:33:12] ni291187: has left #ruby: ()
[22:33:15] TomyLobo: not even a fully initialized class
[22:33:27] TomyLobo: and hence no instance methods can possibly have been called yet
[22:33:35] TomyLobo: not even the initialization method
[22:33:52] B1n4r10: has joined #ruby
[22:34:15] jessemcgilallen: has joined #ruby
[22:35:13] ellisTAA: has joined #ruby
[22:36:10] bithon: has joined #ruby
[22:36:49] FCser: TomyLobo: ok I see - I thought there may have been some way to create an instance to get the bot name (then disregard that instance) and use match etc - but apparently I'm just confused
[22:37:30] FCser: I'll stop trying to do it the hard way hhe
[22:38:05] jdelaney: has joined #ruby
[22:38:32] tomphp: has joined #ruby
[22:38:48] Scripore: has joined #ruby
[22:38:51] yfeldblum: has joined #ruby
[22:39:52] hobodave: has joined #ruby
[22:40:12] tenderlove: has joined #ruby
[22:40:18] ellisTAA: i???m trying to create a method inside of a method ??? this doesn???t seem to work https://gist.github.com/ellismarte/02687f16f0565da6ad02#file-trie-rb-L13-L15
[22:41:07] dlitvak: has joined #ruby
[22:42:48] ellisTAA: has joined #ruby
[22:42:55] snockerton: has joined #ruby
[22:44:32] idefine: has joined #ruby
[22:45:06] DroidBur_: has joined #ruby
[22:45:50] akem: has joined #ruby
[22:46:48] kalopsian: has joined #ruby
[22:47:27] finisherr: has joined #ruby
[22:47:52] djcp1: has joined #ruby
[22:48:13] soahccc: ellistaa: define_method is a class method. What do you want to do there? a.b.something? I'm not sure if this is the best way of doing things :)
[22:48:19] marr: has joined #ruby
[22:48:43] akem2: has joined #ruby
[22:48:48] idefine: has joined #ruby
[22:50:21] ellisTAA: soahccc: ty! i just fixed it https://gist.github.com/ellismarte/02687f16f0565da6ad02 i???m trying to create a trie data structure where every node is a letter and you traverse it to find words ???
[22:50:24] zenlot: has joined #ruby
[22:50:45] nickjj: has joined #ruby
[22:52:40] nickjj: has joined #ruby
[22:53:07] akem: has joined #ruby
[22:53:18] tulak: has joined #ruby
[22:53:29] pawnbox: has joined #ruby
[22:53:49] baweaver: has joined #ruby
[22:55:13] akem: has joined #ruby
[22:55:17] sucks: has joined #ruby
[22:56:08] InvGhost: has joined #ruby
[22:57:04] claw: has joined #ruby
[22:57:55] quazimodo: has joined #ruby
[22:58:20] jgpawletko: has joined #ruby
[22:59:19] akem2: has joined #ruby
[23:02:30] soahccc: ellistaa: https://gist.github.com/2called-chaos/9afa3b5499330c36fa0f
[23:02:35] gusTester: has joined #ruby
[23:02:53] gusTester: has left #ruby: ()
[23:03:25] akem: has joined #ruby
[23:03:38] ellisTAA: soahccc: could u explain that to me? i dont get what accept_virutal is
[23:04:11] rgrmatt: has joined #ruby
[23:05:14] soahccc: ellistaa: this is just an extracted method from our base model. We use it when we need accessors for form_for etc. and don't want to define them on the class generally. But it does what you want I guess and the caveats :) The first version is bogus and I took ages to realize
[23:05:45] akem: has joined #ruby
[23:06:31] devoldmx: has joined #ruby
[23:06:35] soahccc: ellistaa: so basically you have to call define_method on the instance metaclass (it's a bit complicated in ruby)
[23:07:05] ellisTAA: soahccc: what do u mean accessors for form_for?
[23:07:16] soahccc: ellistaa: rails related
[23:07:45] ellisTAA: soahccc: does that refer to strong params?
[23:08:01] bnizzle: has joined #ruby
[23:08:54] soahccc: ellistaa: not really. If you use form_for in rails (with a model) and you do `form.text_field :something` that "something" has to be a method on the model. Sometimes you have fields only in that form and we don't want to put the accessor in the class generally so we set it dynamically
[23:09:02] devbug: has joined #ruby
[23:09:44] ellisTAA: soahccc: oh i see ??? so if you wanted info like zip code and you didn???t want to include that in the model you???d use the code you linked to? that???s cool
[23:09:51] rickmasta: has joined #ruby
[23:09:52] gizless: has joined #ruby
[23:10:57] jbrhbr: in trying to understand `a.map(&:foo)`, i tried `a.map(->(v) { v })` and was surprised to see this doesn't work. instead you have to write it as `a.map(&->(v) { v })`. can anyone explain that? in the :foo case, it's calling .to_proc and sending that symbol to the object you're iterating over. but a lambda is already a proc, so why does it need the &?
[23:11:26] dlitvak: has joined #ruby
[23:11:51] dfinninger: has joined #ruby
[23:12:12] pika_pika: has joined #ruby
[23:14:02] soahccc: jbrhbr: a method can accept any amount of arguments but either one or no "code block". But you can pass multiple procs/lambdas as arguments. Does that help?
[23:14:42] jbrhbr: i knew that actually, but your restatement there seems to illuminate hte problem here
[23:14:52] jessemcgilallen: has joined #ruby
[23:14:56] jbrhbr: i guess map is using the default block and using &->(){} causes that lambda to become the default block
[23:15:14] jbrhbr: otherwise it's just an argument
[23:15:30] ellisTAA: could someone tell me how i could call this line but get the result ???christmas.h??? instead of christmas.letter?
[23:15:31] ellisTAA: https://gist.github.com/ellismarte/02687f16f0565da6ad02#file-trie-rb-L37
[23:15:36] CloCkWeRX: has joined #ruby
[23:16:40] shevy: you call a method called letter
[23:16:41] cdg: has joined #ruby
[23:16:48] shevy: does your object respond to a method called .letter
[23:16:58] ellisTAA: shevy: alright ill try that
[23:17:34] shevy: no that is a question
[23:18:27] Mon_Ouie: has joined #ruby
[23:18:42] shevy: if the method exists you could try
[23:18:46] shevy: christmas.send letter
[23:18:58] shevy: to check if your object responds to, you can do: object.respond_to?
[23:19:27] shevy: word = "hello".split("") # => ["h", "e", "l", "l", "o"]
[23:19:30] ellisTAA: shevy: i used christmas.method(letter)
[23:19:39] shevy: so your object would have to respond to .h .e .l .l .o
[23:19:40] ellisTAA: is send a better approach?
[23:19:59] shevy: who knows if it is better or not but
[23:20:02] ellisTAA: shevy: thanks for the help
[23:20:05] shevy: in your code, you invoke .letter all the time
[23:20:12] shevy: so that is quite pointless to iterate via .each
[23:20:16] shevy: since you invoke the same method there
[23:20:23] shevy: here is the documentation for .send http://ruby-doc.org/core-2.2.3/Object.html#method-i-send
[23:21:12] ellisTAA: send seems to work better than method
[23:21:31] shevy: via .method you can get a handle onto a method
[23:21:44] shevy: so in theory you could turn a method into an object, or reattach it
[23:22:05] shevy: .send is much simpler, you can think that it is equivalent to calling the method itself
[23:22:11] shevy: >> 'abc'.send :size
[23:22:12] ruboto: shevy # => 3 (https://eval.in/485128)
[23:22:14] ellisTAA: shevy: yeah sends seems easier
[23:22:46] dlitvak: has joined #ruby
[23:24:04] Synthead: has joined #ruby
[23:24:16] kmckelvin: has joined #ruby
[23:24:20] ornerymoose: has joined #ruby
[23:25:24] chouhoulis: has joined #ruby
[23:26:27] charliesome: has joined #ruby
[23:28:01] solocshaw: has joined #ruby
[23:28:35] claw: has joined #ruby
[23:28:52] spt0: has joined #ruby
[23:30:27] duckpuppy: has joined #ruby
[23:32:00] tenderlove: has joined #ruby
[23:33:47] whiteline: has joined #ruby
[23:33:58] f00bar-32: has joined #ruby
[23:34:04] Pupeno: has joined #ruby
[23:35:35] cassioscabral: has joined #ruby
[23:37:16] akem: has joined #ruby
[23:37:24] mary5030_: has joined #ruby
[23:39:29] akem: has joined #ruby
[23:40:04] shock_one: has joined #ruby
[23:40:11] whiteline: has joined #ruby
[23:41:18] akem: has joined #ruby
[23:41:30] al2o3-cr: has joined #ruby
[23:44:04] akem2: has joined #ruby
[23:46:11] akem: has joined #ruby
[23:48:43] slieb: has joined #ruby
[23:48:54] akem: has joined #ruby
[23:50:20] zeroDivisible: has joined #ruby
[23:50:24] slieb: has left #ruby: ()
[23:51:02] akem: has joined #ruby
[23:53:20] banister: has joined #ruby
[23:54:17] Qantourisc: has joined #ruby
[23:55:07] akem2: has joined #ruby
[23:55:44] ta: has joined #ruby
[23:57:17] claw: has joined #ruby
[23:58:46] Scripore: has joined #ruby
[23:58:50] ta: has joined #ruby