« Back to channel list

#ruby - 28 March 2016

« Back 1 day Forward 1 day »
[00:00:07] tubuliferous_: has joined #ruby
[00:01:33] Inside: has joined #ruby
[00:02:49] jaequery: has joined #ruby
[00:07:42] tristanp: has joined #ruby
[00:10:49] andywojo: has joined #ruby
[00:11:26] Rubie: has joined #ruby
[00:12:04] user__: has joined #ruby
[00:18:00] rkazak: has joined #ruby
[00:23:57] skweek: has joined #ruby
[00:24:33] shazaum: has joined #ruby
[00:24:58] shazaum: has joined #ruby
[00:25:57] htmldrum: has joined #ruby
[00:26:00] htmldrum_: has joined #ruby
[00:27:32] shevy: will we see more games using ruby once mruby will be more stable and well known?
[00:29:43] abort: has joined #ruby
[00:33:18] cd-rum: has joined #ruby
[00:37:25] tristanp: has joined #ruby
[00:37:36] statelesscode: has joined #ruby
[00:39:03] GodFather: has joined #ruby
[00:39:54] chouhoulis: has joined #ruby
[00:42:36] mistermocha: has joined #ruby
[00:42:50] Ebok: has joined #ruby
[00:43:26] benzrf: is mruby that fast
[00:43:58] chouhoulis: has joined #ruby
[00:45:16] sandstrom: has joined #ruby
[00:46:04] stannard: has joined #ruby
[00:47:53] FooMunki: has joined #ruby
[00:48:22] hahuang61: has joined #ruby
[00:48:49] kam270: has joined #ruby
[00:50:50] davedev24: has joined #ruby
[00:52:02] ruby-lang201: has joined #ruby
[00:53:06] ruby-lang201: So, which is the correct operator, "+=" or "=+". I do an add one in a for loop with +=, and I get undefined method `+', but I do =+ and it works. Every resource on operators for Ruby I've looked at say it is +=.
[00:53:39] Ox0dea: ruby-lang201: It is `+=`; you're invoking it on something that doesn't respond to the + method.
[00:53:55] pawnbox: has joined #ruby
[00:54:40] ruby-lang201: is =+ appropriate at all?
[00:55:02] Ox0dea: It's an assignment, with the value being something that responds to unary +.
[00:55:30] Ox0dea: Anything can have a unary + method, but it really only makes sense for numeric values.
[00:56:44] ruby-lang201: For what reasons would I not be able to use the + method in my script?
[00:56:45] shevy: benzrf should be
[00:57:21] shevy: I don't see many games written in or using ruby altogether... one was battle of antargis but the author semi-abandoned it...
[00:57:38] Ox0dea: ruby-lang201: You can't invoke + on something that doesn't respond to that method. `nil` is such a something.
[00:57:48] shellie_: has joined #ruby
[00:57:54] zenlot: has joined #ruby
[00:58:59] shevy: ruby-lang201 look! class Foo; def self.+; puts 'HIO'; end; end; Foo.+() # => "HIO"
[00:59:52] ruby-lang201: Thank you very much for that, it makes sense now
[01:03:49] northfurr: has joined #ruby
[01:04:20] bronson: has joined #ruby
[01:05:03] r0b3rt: has joined #ruby
[01:06:40] moei: has joined #ruby
[01:06:54] CloCkWeRX: has joined #ruby
[01:10:00] diegoaguilar: has joined #ruby
[01:11:52] blackmesa: has joined #ruby
[01:15:50] Trynemjoel: has joined #ruby
[01:19:30] idefine: has joined #ruby
[01:21:32] finisherr: Is this legal? https://gist.github.com/miroswan/366ad30b50dc481e910f
[01:21:36] uglybandersnatch: has joined #ruby
[01:22:42] Rubie: has joined #ruby
[01:24:02] pawnbox: has joined #ruby
[01:25:06] Ox0dea: Hi, brent_.
[01:25:12] brentw: i was working on that hangman cpu logic you looked at briefly yesterday
[01:25:30] brentw: i'm struggling to get it to work and was hoping you could take another look
[01:25:33] LoneHerm_: has joined #ruby
[01:26:08] Ox0dea: brent_: Ah, well, I wrote up a thing showing how I'd go about and just forgot to link it yesterday.
[01:26:24] Ox0dea: I guess I won't show you unless you wanna see it, but yeah, I'll take a look.
[01:27:03] brentw: http://hastebin.com/nupaxapili.rb basically i need it to filter out any words from the dictionary that have had a letter guessed, and also filter otu words that have a correct letter guessed that shows up at an index that the secret_word doesn't have
[01:27:42] brentw: so basically if i've guessed 'r' and the word is 'road', it should filter out words from the dictionary like "rear", but it currently does not
[01:28:34] moei: has joined #ruby
[01:28:39] Ox0dea: brent_: You didn't retain anything we talked about regarding `group_by(&:itself)`. :/
[01:29:37] brentw: let me think
[01:30:28] mistermocha: has joined #ruby
[01:31:48] Es0teric: has joined #ruby
[01:31:59] cpup: has joined #ruby
[01:33:53] leon_e: has joined #ruby
[01:34:12] Ox0dea: brent_: `max_by(&:size)` on a Hash will always just give you back the first key-value pair; do you know why?
[01:34:32] finisherr: has joined #ruby
[01:34:39] arescorpio: has joined #ruby
[01:34:59] Ox0dea: Do you know about Enumerable?
[01:35:05] UndergroundRails: has joined #ruby
[01:35:41] xcesariox: has joined #ruby
[01:37:33] idefine: has joined #ruby
[01:37:56] brentw: I know it's a class of methods, but thats about it
[01:38:54] Ox0dea: Well, #max_by on a Hash essentially converts it to a nested Array first, with the inner Arrays being the key-value pairs.
[01:39:05] Trynemjoel: has joined #ruby
[01:39:12] Ox0dea: >> h = {a: 1, b: 2, c: 3}; h.to_a
[01:39:14] ruby[bot]: Ox0dea: # => [[:a, 1], [:b, 2], [:c, 3]] (https://eval.in/543082)
[01:39:44] Ox0dea: As you can see, they all have size 2, so `max_by(&:size)` is just a really verbose way of saying `first`, which isn't at all what you want for #guess there.
[01:40:03] triangles: has joined #ruby
[01:41:21] sudoubuntu: has joined #ruby
[01:43:00] brentw: letters.group_by{ |letter| letter }.values.max_by(&:size).first
[01:43:16] jaequery: has joined #ruby
[01:44:51] Ox0dea: Yep, that's more what you're looking for.
[01:45:05] brentw: so that helps w/ the cpu picking the most frequent letter
[01:45:17] Ox0dea: Okay if I show mine?
[01:45:23] brentw: please do
[01:45:34] Ox0dea: https://eval.in/543083
[01:45:55] brentw: though, the problem i'm struggling w/ is the excluding words that have a correctly guessed letter at the wrong index
[01:46:31] Ox0dea: Hm... do you want to avoid using reglar expressions?
[01:46:44] Ox0dea: They're really good for this sort of thing.
[01:47:03] rbennacer: has joined #ruby
[01:47:45] brentw: i'm still learnign regex
[01:47:57] brentw: i would be fine using them
[01:47:57] Trynemjoel: has joined #ruby
[01:48:15] brentw: but i really want to get to the bottom of this while staying along the lines of my current logic
[01:48:22] brentw: just so i can understand what i'm missing
[01:49:48] brentw: been banging my head trying to get it right
[01:49:59] brentw: the rspec requires a #candidate_words
[01:50:23] brentw: to filter out the possible words, then optimal guess is ussed in #guess
[01:50:45] djbkd: has joined #ruby
[01:50:51] northfurr: has joined #ruby
[01:51:05] brentw: so i'm trying to get #candidate words to take intio consideration when a correctly guessed word is showing up at incorrect index's and remove those words as well
[01:52:39] Ox0dea: #word_checker is only checking for inclusion; you need to do a position-wise comparison.
[01:54:12] Ox0dea: Something like `word.chars.zip(local_bard).all? { |a, b| ... }` would be more correct.
[01:54:30] Ox0dea: With `...` being a check for either equality or a wildcard (a blank in the puzzle).
[01:55:55] Trynemjoel: has joined #ruby
[01:56:28] brentw: can you explain, how word_checker isn't checkign posiiton. My understanding of current code is local_board should be an array similar to ['r', nil, nil, 'r'] and the .map it's comparing to would be returning ['r', nil, nil, nil]
[01:56:45] brentw: in an example of 'road' and 'rear'
[01:57:28] ur5us: has joined #ruby
[01:59:07] ur5us: has joined #ruby
[01:59:34] LoneHerm_: has joined #ruby
[01:59:45] ur5us: has joined #ruby
[02:01:15] Ox0dea: You're right; that doesn't seem to be the problem.
[02:01:48] jaequery: has joined #ruby
[02:02:32] northfurr: has joined #ruby
[02:02:46] Rubie: has joined #ruby
[02:03:16] jonatin: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[02:05:11] A124: has joined #ruby
[02:06:38] yatish27: has joined #ruby
[02:06:43] idefine_: has joined #ruby
[02:07:23] Trynemjoel: has joined #ruby
[02:07:52] LoneHerm_: has joined #ruby
[02:09:00] northfurr: has joined #ruby
[02:09:09] brentw: phew, was hoping i wasn't misunderstanding it that much
[02:09:45] TinkerTyper: has joined #ruby
[02:09:59] Ox0dea: How come the board isn't just an instance variable?
[02:11:06] brentw: it could be
[02:11:20] TriggerPhish: has joined #ruby
[02:11:23] brentw: i just wanted a quick tester method
[02:11:45] brentw: so i didn't have to mess w/ other methods to update the instance variable
[02:11:55] brentw: while i'm trying to figure this out
[02:12:51] gregf: has joined #ruby
[02:13:35] pawnbox: has joined #ruby
[02:13:40] ljames: has joined #ruby
[02:14:55] blackmesa: has joined #ruby
[02:15:03] Ox0dea: brent_: I wonder if fixing Line 58 is the missing ingredient.
[02:16:43] silentpost: has joined #ruby
[02:16:51] brentw: idxs.empty?
[02:17:36] yatish27: has joined #ruby
[02:18:01] brentw: syntax!!!!!
[02:18:08] stannard: has joined #ruby
[02:19:28] Ox0dea: You're missing a =.
[02:19:43] brentw: i just changed it to idxs.empty?
[02:20:01] Ox0dea: Well, all right.
[02:20:26] brentw: it helped it pass most of the tests, but still get an error w/ the dictionary of [foo, bar]
[02:20:47] brentw: and a handled_guess('o' [1, 2])
[02:20:58] brentw: candiate_words is still returning both foo and bar
[02:21:37] davedev24: has joined #ruby
[02:21:56] htmldrum: has joined #ruby
[02:21:57] htmldrum_: has joined #ruby
[02:27:04] Ox0dea: brent_: Er... not for me?
[02:27:52] brentw: let me send you the rspec error
[02:27:57] brentw: and thanks so much for your time
[02:28:40] andywojo: has joined #ruby
[02:29:49] brentw: http://hastebin.com/nesuqagoqo.vbs
[02:31:43] GnuYawk: has joined #ruby
[02:31:46] hahuang61: has joined #ruby
[02:33:05] Ox0dea: Weird that it's returning "e" instead of "l"; you're subtracting `@guessed_hash.keys` there.
[02:33:58] brentw: thought that was weird as well
[02:34:18] brentw: hangman is going to haunt my dreams
[02:34:26] merida: has joined #ruby
[02:36:15] zast: has joined #ruby
[02:38:00] statelesscode_: has joined #ruby
[02:40:00] idefine: has joined #ruby
[02:40:40] IrishGringo: has joined #ruby
[02:40:45] shevy: brent_ I am watching tales from the crypt - and writing ruby code! it's a scary combination
[02:40:48] davee_: has joined #ruby
[02:41:18] brentw: that little story teller gives the me creeps
[02:41:46] brentw: lol, how do i type the before me
[02:42:26] idefine_: has joined #ruby
[02:43:32] pawnbox: has joined #ruby
[02:43:54] mistermocha: has joined #ruby
[02:44:00] northfurr: has joined #ruby
[02:44:41] sudoubuntu: has joined #ruby
[02:47:26] idefine: has joined #ruby
[02:47:27] crdpink2: has joined #ruby
[02:49:02] brentw: if you got any knowledge to drop on my predicament i would apprecaite any help i could get
[02:50:11] Cohedrin: has joined #ruby
[02:50:50] bratchley: has joined #ruby
[02:51:37] dikaio: has joined #ruby
[02:51:46] duderonomy: has joined #ruby
[02:53:51] shevy: I have no idea about rspec, it always felt so boring to write test when you could write code instead!
[02:55:02] tristanp: has joined #ruby
[02:55:13] brentw: lol, i agree. more of a, do you see why i would be getting those failures
[02:55:59] shevy: no idea but apparently your code is not working
[02:56:46] brentw: i needed that
[02:57:01] GnuYawk: has joined #ruby
[02:58:06] brentw: Ox0dea did you give up on it? It's okay if you did
[02:58:42] Ox0dea: brent_: There's just so much implicit state.
[02:58:56] Ox0dea: I tried to find the bug, but they run when you look at them.
[02:59:51] shevy: does the game work yet without rspec
[03:01:14] yatish27: has joined #ruby
[03:01:53] brentw: haven't got there yet. the rspecs are given as a requirement to get them to pass
[03:02:12] LoneHerm_: has joined #ruby
[03:02:34] fullofcaffeine: has joined #ruby
[03:03:15] shevy: make the game first!
[03:03:27] Ox0dea: brent_: Here's my go at simplifying it: https://eval.in/543094
[03:03:41] Ox0dea: All the tests pass, but I don't what Phase I and Phase II were.
[03:04:24] Dopagod: has joined #ruby
[03:05:35] brentw: intresting
[03:05:42] brentw: i need to read what .zip is
[03:05:54] brentw: do you want me to send you the link to the phase1/2?
[03:06:03] brentw: good choice
[03:06:29] bronson: has joined #ruby
[03:06:44] brentw: did you get the same failures i was w/ my code?
[03:07:38] Ox0dea: The last two initially failed because I forgot to subtract the letters already in `board`.
[03:07:49] Ox0dea: But you're doing that, so I don't know what's going on. :/
[03:09:03] fullofca_: has joined #ruby
[03:09:37] brentw: i'm going to show it to a TA tomorrow and see what they think
[03:09:55] brentw: i'll probably work on a simplified version structured around your code
[03:09:56] shevy: they will hire Ox0dea right away
[03:09:59] fullofca_: has joined #ruby
[03:10:03] brentw: and see if i can get it to work
[03:11:13] Ox0dea: Like I said, I can't tell whether some of that complexity was informed by the prior phases. If not, though, it could definitely stand to be simplified. :)
[03:12:20] braincrash: has joined #ruby
[03:13:16] brentw: haha i'm sure it can
[03:13:21] pawnbox: has joined #ruby
[03:15:19] brentw: i'm reading about .zip in ruby docs, but not quite sure what it's doing
[03:16:15] jtoy: has joined #ruby
[03:17:51] blackmesa: has joined #ruby
[03:18:32] Rubie: has joined #ruby
[03:18:59] Ox0dea: It "zips up" the elements of two (or more) arrays by alternately picking from them, like how a zipper works by "grabbing" a tooth from the left, right, left...
[03:19:23] Ox0dea: >> letters = %w[a b c]; numbers = [1, 2, 3]; letters.zip numbers
[03:19:24] ruby[bot]: Ox0dea: # => [["a", 1], ["b", 2], ["c", 3]] (https://eval.in/543098)
[03:19:33] barajasfab: has joined #ruby
[03:20:06] Ox0dea: I'm using it to get element-wise comparison against the board letters for each candidate word.
[03:20:48] shevy: oh new rubygems
[03:20:59] shevy: https://github.com/rubygems/rubygems/blob/master/History.txt
[03:22:59] brentw: i like the zipper analogy
[03:23:19] Tempesta_: has joined #ruby
[03:23:40] Ox0dea: It's rare, but sometimes things have just the right name.
[03:26:16] Kiwi_sherbet: has joined #ruby
[03:26:43] chagel: has joined #ruby
[03:26:44] brentw: on handle response
[03:27:36] chouhoul_: has joined #ruby
[03:27:37] jaequery: has joined #ruby
[03:28:26] idefine: has joined #ruby
[03:29:26] andywojo: has joined #ruby
[03:29:42] Maletor: has joined #ruby
[03:29:42] brentw: nevermind
[03:29:57] brentw: i understand whats happening there. much simpler
[03:30:14] rbennacer: has joined #ruby
[03:31:08] spuk: has joined #ruby
[03:31:21] Ox0dea: I suppose `chars.each_index` would've been a little more intention-revealing than `size.times`.
[03:33:22] grissom: has joined #ruby
[03:33:58] lyoshajapan: has joined #ruby
[03:34:15] tristanp: has joined #ruby
[03:34:58] grissom: hello Im looking for pairprogramming, my level intermediate - target, practice rspec testing, lang: english, anyone?
[03:35:25] lyoshajapan: whats your timezone?
[03:35:43] brentw: Ox0dea welll utilized your code and added the additional functionality to pass the other phases
[03:36:09] grissom: my 5.36 am
[03:36:19] jaequery: has joined #ruby
[03:36:38] brentw: very frustrating that i was getting those errors seemingly out of nowhere, hoping the TA can help me point out the problem
[03:37:06] cdg: has joined #ruby
[03:38:38] Ox0dea: brent_: Do let me know if y'all end up finding the cause. I imagine it's to do with the way you track indices. That said, I think it's lame that the tests force that implementation detail in the first place.
[03:39:34] brentw: yeah, i was doing a battleship game the other day
[03:40:12] brentw: and and was adding "bonus" functionality by adding a cpu class and it messed up all the rspecs
[03:40:23] fn2187: has joined #ruby
[03:40:49] brentw: what do you mean by the way i track indices?
[03:41:03] brentw: i would love to give it anotherlook if you have a suggestionw her ei should start
[03:42:40] Ox0dea: Well, I suppose I don't see why it needs to be tracked at all.
[03:43:11] Ox0dea: #handle_response is the only method concerned with them, and its purpose is to prune the candidate list.
[03:43:28] brentw: ahh, yeah. one of the test cases in an earlier phase requires indices to be returned
[03:43:55] brentw: one last question about one of your blocks
[03:43:56] brentw: word.chars.zip(board).all? { |a, b| !b || a == b }
[03:44:02] gix: has joined #ruby
[03:45:02] diegoaguilar: has joined #ruby
[03:45:16] brentw: so say i have board = [r, nil, nil, nil], word = road, i would get [[r, r], [nil, o], [nil, a], [nil, r]], correct.
[03:46:13] brentw: what is executing in the all? block?
[03:46:45] brentw: would a, b == r, r for the first one?
[03:47:55] pawnbox: has joined #ruby
[03:48:30] brentw: wait, the board would be the second elements, now i understand why you have !b
[03:48:57] Ox0dea: I think you got it. :)
[03:49:09] fullofcaffeine: has joined #ruby
[03:49:10] brentw: is !b preferred of b.nil?
[03:49:48] Ox0dea: It's a stylistic thing, but the closest thing we have to an "official" style guide recommends #nil? ther.
[03:50:14] brentw: i also noticed you don't use parens on your method args
[03:50:27] stryek: has joined #ruby
[03:50:35] brentw: i thought style guide recommended parnes
[03:50:39] brentw: is that just your preference?
[03:51:02] Ox0dea: It's called "Seattle style".
[03:51:08] Ox0dea: Use as few parentheses as possible.
[03:51:21] brentw: intresting
[03:51:34] brentw: are you from seattle or just coincidence ?
[03:51:45] Ox0dea: http://www.seattlerb.org/
[03:52:53] brentw: looking for a member name that could be you
[03:53:36] Ox0dea: The answer to your question was "mu".
[03:54:03] Ox0dea: https://en.wikipedia.org/wiki/Mu_(negative)#.22Unasking.22_the_question
[03:55:11] Ox0dea: I'm not from Seattle, but nor is my use of Seattle style coincidental.
[03:55:35] brentw: feels like a riddle
[03:55:42] Ox0dea: Welcome to Zen Buddhism.
[03:55:45] kfpratt: has joined #ruby
[03:56:05] brentw: seems like you're at least on my same time zone
[03:56:07] TheGreatGudsby: has joined #ruby
[03:56:10] Ox0dea: I suppose I probably just picked it up because it meant less typing, but it ended up being a visual thing as well.
[03:56:30] brentw: so thats good for me, bad for you
[03:56:47] Ox0dea: I'd ignore you if I didn't love you. <3
[03:57:05] jaequery: has joined #ruby
[03:57:29] brentw: good to hear. don't hesitate to let me know if you don't have time. Appreciate your help once again. i'm going to rest my brain for the night
[03:58:08] brentw: have a good night Ox0dea!
[03:58:19] Ox0dea: And you, brent_. Rest well.
[04:00:32] northfurr: has joined #ruby
[04:02:28] lyoshajapan: has joined #ruby
[04:05:46] yeticry: has joined #ruby
[04:06:24] User458764: has joined #ruby
[04:07:05] tildes: has joined #ruby
[04:08:47] davedev24: has joined #ruby
[04:10:20] dikaio: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[04:11:46] htmldrum: has joined #ruby
[04:11:50] htmldrum_: has joined #ruby
[04:20:51] blackmesa: has joined #ruby
[04:22:40] bb010g: has joined #ruby
[04:23:18] Tempesta_: has joined #ruby
[04:23:55] cabargas: has joined #ruby
[04:24:15] nocontrol: has joined #ruby
[04:24:36] lyoshajapan: has joined #ruby
[04:26:57] elifoster: has joined #ruby
[04:27:28] lkba_: has joined #ruby
[04:28:20] merida: has joined #ruby
[04:29:33] Rubie: has joined #ruby
[04:30:03] LoneHerm_: has joined #ruby
[04:36:16] astrobunny: has joined #ruby
[04:36:51] krz: has joined #ruby
[04:37:08] ozzloy: has joined #ruby
[04:37:53] lyoshajapan: has joined #ruby
[04:39:31] bluOxigen: has joined #ruby
[04:41:31] crameth: has joined #ruby
[04:43:19] uglybandersnatch: has joined #ruby
[04:45:56] lyoshajapan: has joined #ruby
[04:51:15] moei: has joined #ruby
[05:05:23] scepticulous: has joined #ruby
[05:07:10] devbug: has joined #ruby
[05:07:38] devbug_: has joined #ruby
[05:07:55] lyoshajapan: has joined #ruby
[05:08:42] bronson: has joined #ruby
[05:09:09] devbug: has joined #ruby
[05:09:14] moei: has joined #ruby
[05:09:49] moei: has joined #ruby
[05:10:50] sarlalian: has joined #ruby
[05:11:56] fullofcaffeine: has joined #ruby
[05:17:44] andywojo: has joined #ruby
[05:19:12] hk238: has joined #ruby
[05:21:40] yatish27: has joined #ruby
[05:23:30] Tempesta_: has joined #ruby
[05:23:32] Nanuq: has joined #ruby
[05:24:16] blackmesa: has joined #ruby
[05:26:58] pawnbox: has joined #ruby
[05:30:11] bkxd: has joined #ruby
[05:30:42] bkxd_: has joined #ruby
[05:31:44] lyoshajapan: has joined #ruby
[05:31:59] mistermocha: has joined #ruby
[05:32:56] Dimik: has joined #ruby
[05:34:00] lyoshaja_: has joined #ruby
[05:39:17] chagel: has joined #ruby
[05:41:00] fedexo: has joined #ruby
[05:44:28] yfeldblum: has joined #ruby
[05:46:20] mistermocha: has joined #ruby
[05:54:42] patrick-sartent: has joined #ruby
[05:55:32] astrobunny: has joined #ruby
[05:58:51] bkxd: has joined #ruby
[06:01:39] jtoy: has joined #ruby
[06:02:35] Chagel_: has joined #ruby
[06:04:17] hahuang61: has joined #ruby
[06:05:28] fexilal: has joined #ruby
[06:08:08] LoneHerm_: has joined #ruby
[06:09:20] sinanislekdemir: has joined #ruby
[06:09:51] agit0: has joined #ruby
[06:10:44] User458764: has joined #ruby
[06:13:54] tAn: has joined #ruby
[06:15:39] yfeldblum: has joined #ruby
[06:20:26] nocontrol: has joined #ruby
[06:20:44] Tempesta: has joined #ruby
[06:24:27] chipotle: has joined #ruby
[06:24:37] CloCkWeRX: has joined #ruby
[06:25:49] htmldrum: has joined #ruby
[06:25:50] htmldrum_: has joined #ruby
[06:27:06] blackmesa: has joined #ruby
[06:29:32] aganov: has joined #ruby
[06:30:58] abc: has joined #ruby
[06:31:15] kriskropd: has joined #ruby
[06:33:33] rbennacer: has joined #ruby
[06:35:17] agit0: has joined #ruby
[06:36:17] The_Phoenix: has joined #ruby
[06:37:26] Dopagod: has joined #ruby
[06:38:03] GnuYawk: has joined #ruby
[06:41:52] liquid-silence: has joined #ruby
[06:41:52] liquid-silence: has joined #ruby
[06:43:09] CloCkWeRX: has joined #ruby
[06:45:18] hahuang61: has joined #ruby
[06:49:39] anisha: has joined #ruby
[06:56:26] baweaver: has joined #ruby
[06:56:56] firstdayonthejob: has joined #ruby
[06:57:09] blackgoat: has joined #ruby
[06:57:24] nocontrol: has joined #ruby
[07:00:49] nocontrol: has joined #ruby
[07:02:09] nocontrol: has joined #ruby
[07:05:18] Dimik: maybe some one is awake
[07:05:53] Dimik: how can i select id from table in sql in ruby and then add a number to it
[07:05:56] andywojo: has joined #ruby
[07:06:42] Regulati_: has joined #ruby
[07:07:06] jalnt: has joined #ruby
[07:09:09] tildes: Dimik, do you already have a sql database in place?
[07:10:37] bronson: has joined #ruby
[07:10:56] binaryplease1: has joined #ruby
[07:12:16] priodev: has joined #ruby
[07:12:27] tildes: Dimik, besides the DB, you will also need to start it, and connect to it. I would guess using Rails and ActiveRecord ORM could be the quickest way to get you started?
[07:16:55] x77686d: has joined #ruby
[07:19:26] blindsight: has joined #ruby
[07:19:48] htmldrum: has joined #ruby
[07:19:49] htmldrum_: has joined #ruby
[07:24:31] valetudo: has joined #ruby
[07:25:45] chouhoulis: has joined #ruby
[07:26:14] ljames: has joined #ruby
[07:28:52] Dimik: tildes, yes i have a db in place i'm using sqlite3 without rails
[07:29:25] Dimik: i'm using something like session_id = db.execute ("SELECT ses_id FROM fd ORDER BY id DESC LIMIT 1")
[07:29:48] Dimik: to get the last ses_id (which is integer in sqlite3 table) number
[07:29:52] blackmesa: has joined #ruby
[07:30:12] Dimik: the problem is it comes back as an array i guess and i can't seem to get around it to += 1 it
[07:31:19] ur5us: has joined #ruby
[07:32:09] Dimik: so i tried like .to_i and to_int.to_i and .map(&to_i) without any luck
[07:41:59] chipotle: has joined #ruby
[07:42:51] Dimik: never mind i just saved myself a headache by creating a separate session_id table with autoincrement in sql
[07:45:55] htmldrum: has joined #ruby
[07:46:00] htmldrum_: has joined #ruby
[07:46:04] patrick_star: has joined #ruby
[07:46:13] merida: has joined #ruby
[07:46:14] Dimik: can't believe i spent 3 hours on such simple solution
[07:46:14] nocontrol: has joined #ruby
[07:47:44] alem0lars__: has joined #ruby
[07:47:44] mistermocha: has joined #ruby
[07:48:14] kam270: has joined #ruby
[07:49:48] Caerus: Dimik, what were you getting back? seems like limit '1' should only give you one
[07:50:47] dionysus69: has joined #ruby
[07:51:24] mark3: has joined #ruby
[07:52:01] Caerus: at any rate, if the return (for whatever reason) is an array then you should be able to do session_id.last
[07:52:19] phredus: has joined #ruby
[07:55:34] Dimik: getting something like no implicit conversion of fixnum into array
[07:55:49] Dimik: when trying to +=1
[07:58:26] Caerus: your issue was finding out why db.execute on that query was returning an array.
[07:58:48] Dimik: i never got around it
[07:58:54] joonty: has joined #ruby
[07:58:58] Caerus: did you inspect it?
[07:59:19] Dimik: puts out a single number
[07:59:29] Dimik: i don't know how else to inspect it
[08:00:28] roshanavand: has joined #ruby
[08:02:10] Caerus: so after db.execute session_id.class == Array?
[08:02:41] the_drow: has joined #ruby
[08:07:34] last_staff: has joined #ruby
[08:07:48] Jackneill: has joined #ruby
[08:08:12] Dimik: session_id.kind_of?(Array)
[08:09:01] yatish27: has joined #ruby
[08:09:39] Caerus: that is so weird. how bout session_id.size
[08:11:28] Dimik: i broke my head trying to figure this thing out
[08:11:43] Caerus: then you can get away with the ugly session_id.last += 1
[08:12:09] htmldrum: has joined #ruby
[08:12:10] htmldrum_: has joined #ruby
[08:12:50] Dimik: yeah i tried that
[08:13:01] Dimik: same error
[08:13:09] Dimik: no implicit conversion of fixnum into array
[08:14:12] Dimik: anyway having a separate table fixed it
[08:15:19] Dimik: on that note i'm calling it a night
[08:15:23] Dimik: thank you!
[08:15:23] Caerus: yeah i saw, but it was interesting to find out why you were getting an array :P
[08:15:37] Dimik: yeah it's always about the challenge ;p
[08:17:41] Caerus: my wild guess is Database has execute return an array so you would have to do conversion.
[08:18:06] wethu: has joined #ruby
[08:19:21] nocontrol: has joined #ruby
[08:19:37] last_staff1: has joined #ruby
[08:20:22] Caerus: http://www.rubydoc.info/github/luislavena/sqlite3-ruby/SQLite3/Database#execute-instance_method
[08:20:34] Caerus: ow, he left.
[08:21:35] nocontrol: has joined #ruby
[08:23:33] atmosx: has joined #ruby
[08:24:15] weckl: has joined #ruby
[08:26:32] chouhoulis: has joined #ruby
[08:26:48] tildes: has joined #ruby
[08:27:29] tildes: Dimik, ok I got it
[08:28:03] Caerus: think he needed to do db.prepare (sql query)
[08:28:19] tildes: Dimik, to update your record in DB (as you are not using ORM) you would need to use a sql statement called 'UPDATE'
[08:28:47] Caerus: tildes, he left.
[08:29:26] tildes: Caerus, oh ok :)
[08:34:59] rbennacer: has joined #ruby
[08:36:59] blackmesa: has joined #ruby
[08:37:09] Caerus: so tildes as learning exercise, all he needed to do was change the query?
[08:38:18] pawnbox: has joined #ruby
[08:39:02] tildes: Caerus, it depends on what he actually wanted to do. if he wanted to store value back in DB, he would need some way to update the record. that's what I thought he wanted, but I'm not longer sure
[08:40:10] tildes: to update the record, he could use raw sql, as he was using raw sql already in the select clause. he could use a gem, such as sequel, or ORM such as activerecord or datamapper to make things neater
[08:40:31] tildes: if he wanted to retrieve the value, and just add +1, he would need to look into Array methods.
[08:41:19] Caerus: by the looks of it he wanted to create a new session hence the += session_id
[08:41:27] tildes: for sql databases, select returns rows (technically, another table), and even if there is just one, that would be stored in a ruby array
[08:41:45] hightower3: has joined #ruby
[08:42:28] JohnBat26: has joined #ruby
[08:42:36] tildes: (at least I think so, I have only occasionally used raw sql with ruby, and always over ActiveRecord in those cases)
[08:42:56] tildes: Caerus, could be. then he would probably want to store that in DB too
[08:43:11] dc2: has joined #ruby
[08:43:21] tildes: oh, and of course to store it in DB, he would need to retrieve the value from array as well.
[08:43:26] Caerus: man that kind of raw sql reminds me of that time i did php back in the day, so cringeworthy..
[08:43:55] Caerus: so he would need to do a select query to get the last session_id
[08:43:55] tildes: it would have been helpful if he had shown what the db... command returned him in irb
[08:44:10] Caerus: then a second query to create a new session
[08:44:38] tildes: my guess is he would get the id as int just from session_id = db.execute ("SELECT ses_id FROM fd ORDER BY id DESC LIMIT 1").first
[08:45:17] tildes: (http://apidock.com/ruby/Array/first)
[08:45:23] Caerus: i suggested .last
[08:45:37] tildes: Caerus :D
[08:45:57] Caerus: no game. which was weird. he didn't really show code so it's all 'learning' conjecture
[08:46:21] blackmesa: has joined #ruby
[08:46:24] tildes: In any case if I wanted to learn ruby again, (or a similar language), I would start with tutorials, and learning the basic data types and their methods well
[08:46:39] tildes: I probably would not start with creating sessions, unless that was in some tutorial...
[08:47:21] tildes: Caerus: too bad I can't see the entire log (even though I ddin't switch off the computer), that's how I didn't notice that he left either. :-(
[08:47:54] tildes: if you aren't prepared to show the code, chances are you will not get specific enough answers :-(
[08:48:08] Caerus: to each his own i guess, i have a friend that refuses to read programming books and only learns by bashing his head trying code.
[08:48:20] nocontrol: has joined #ruby
[08:49:35] dgncn: has joined #ruby
[08:49:36] tildes: Caerus any specific reason why?
[08:49:50] Caerus: but as i've seen happen, specially with ruby on ra'ils, things can go awry really fast if you don't try to do things 'the ruby way
[08:50:35] Caerus: uhm, dunno, i guess the best books are in english and his isn't good.
[08:50:52] tildes: yes, if you can get things done faster, it applies to the nasty things as well :D
[08:51:39] Caerus: he was doing some java mvc just for fun and i noticed he had a lot of infringements of mvc
[08:51:50] tildes: Caerus: there are blogs in many languages, and even google translate is pretty decent at these things... it's a pity though, without good english it's hard even to get started
[08:51:51] pawnbox: has joined #ruby
[08:52:02] doublemalt__: has joined #ruby
[08:53:06] Caerus: i've always thought programming wasn't really meant for people that don't like to read, specially being a full stack requires a lot of documentation reading
[08:54:09] andywojo: has joined #ruby
[08:54:30] chagel: has joined #ruby
[08:54:36] tildes: what I also see, is that if you can't write clearly in human languages, chances are your code will not be human-readable either
[08:55:11] tildes: reading does help, but people are all different. I know a pretty decent front-end developer, who mostly watches tutorial videos and tries out stuff himself
[08:55:20] tildes: no books, ever, but he is still quite decent
[08:55:21] Caerus: tildes, come to think of it, you're right. i've never thought of it
[08:56:02] Guest91417: has joined #ruby
[08:58:56] LoneHermit: has joined #ruby
[08:59:09] tildes: Caerus, you know, if your book-averse friend does speak a big language (e.g. Spanish) and wants to learn a popular language (e.g. Java), video tutorials could come to his resque
[08:59:22] braderhart: has joined #ruby
[08:59:22] jpinnix_______: has joined #ruby
[08:59:24] zzak___: has joined #ruby
[08:59:35] tildes: (I kind of feel empathetic about that head being bashed needlessly already. :D )
[09:00:19] tildes: (or maybe even an English video could be easier to follow than a book, spoken language is often more simple. sometimes you get subtitles)
[09:00:25] dionysus69: has joined #ruby
[09:00:33] Caerus: tildes, yeah hes spanish native, they taught him java ee @ college
[09:01:04] tildes: Caerus, bueno, miles de online recursos, for sure! :)
[09:01:23] tildes: Caerus I learned java in the university too, unfortunately, nothing about style
[09:01:37] tildes: something about patterns, nothing about testing
[09:02:07] Caerus: he just got a jr dev job and will be doing jdb jdf and all that
[09:02:51] tildes: well that's great! hope he has good colleagues who are willing to share knowledge
[09:03:32] Chagel_: has joined #ruby
[09:03:48] jhass: has joined #ruby
[09:04:03] Caerus: i was doing the whole ruby propaganda to make him come so we could learn it by heart and do joint projects but the book thing made it really hard to fly
[09:04:08] mdw: has joined #ruby
[09:04:30] nemesit|znc: has joined #ruby
[09:05:44] last_staff: has joined #ruby
[09:10:49] chipotle: has joined #ruby
[09:11:23] uglybandersnatch: has joined #ruby
[09:13:00] bronson: has joined #ruby
[09:15:34] blackmesa: has joined #ruby
[09:21:38] lkba: has joined #ruby
[09:21:40] astrobunny: has joined #ruby
[09:22:25] nanoz: has joined #ruby
[09:24:03] siaW: has joined #ruby
[09:25:11] chipotle: has joined #ruby
[09:25:36] SCHAAP137: has joined #ruby
[09:27:13] qhp: has joined #ruby
[09:27:16] chouhoulis: has joined #ruby
[09:27:23] niksrc: has joined #ruby
[09:28:23] baweaver: has joined #ruby
[09:28:33] al2o3-cr: has joined #ruby
[09:29:17] car: has joined #ruby
[09:33:50] mistermocha: has joined #ruby
[09:38:13] lkba: has joined #ruby
[09:38:19] jtoy: has joined #ruby
[09:46:32] merida: has joined #ruby
[09:48:33] User458764: has joined #ruby
[09:49:35] mistermocha: has joined #ruby
[09:50:52] lkba_: has joined #ruby
[09:52:51] nicoulaj: has joined #ruby
[09:54:00] AndChat-43764: has joined #ruby
[09:57:36] yatish27: has joined #ruby
[09:59:56] LoneHermit: has joined #ruby
[10:02:46] yfeldblum: has joined #ruby
[10:03:53] araujo: has joined #ruby
[10:05:26] araujo: has joined #ruby
[10:08:00] araujo: has joined #ruby
[10:09:13] _blizzy_: has joined #ruby
[10:09:13] sandstrom: has joined #ruby
[10:09:40] lkba: has joined #ruby
[10:10:10] araujo: has joined #ruby
[10:12:48] car: has joined #ruby
[10:15:58] cd-rum: has joined #ruby
[10:17:58] sepp2k: has joined #ruby
[10:18:21] cd-rum_: has joined #ruby
[10:18:22] anisha: has joined #ruby
[10:25:47] Spami: has joined #ruby
[10:29:32] chouhoulis: has joined #ruby
[10:38:29] infernix: has joined #ruby
[10:40:52] dvinciguerra: has joined #ruby
[10:42:13] Moosashi: has joined #ruby
[10:42:20] andywojo: has joined #ruby
[10:42:25] spider-mario: has joined #ruby
[10:46:53] Moosashi: has joined #ruby
[10:47:38] uglybandersnatch: has joined #ruby
[10:48:48] last_staff: has joined #ruby
[10:50:10] mistermocha: has joined #ruby
[10:51:00] mondok: has joined #ruby
[10:58:10] lkba_: has joined #ruby
[11:09:13] anisha: has joined #ruby
[11:09:15] Silex: has joined #ruby
[11:09:55] rodfersou: has joined #ruby
[11:13:49] dionysus69: has joined #ruby
[11:14:02] ccooke: has joined #ruby
[11:14:44] bronson: has joined #ruby
[11:18:51] ldnunes: has joined #ruby
[11:19:35] GodFather: has joined #ruby
[11:21:18] sdothum: has joined #ruby
[11:22:36] LoneHerm_: has joined #ruby
[11:23:43] shoemann: has joined #ruby
[11:27:03] shoemann: I am java and python developer, looking for work right now, after a while. What I've found, is that nobody wants this languages anymore, all need #ruby and #nodejs ! Could you please explain, why is that?
[11:27:24] shoemann: Do I need to learn ruby?
[11:27:47] hk238: has joined #ruby
[11:28:56] trinaldi: has joined #ruby
[11:29:27] baweaver: has joined #ruby
[11:34:31] mistermocha: has joined #ruby
[11:36:35] mdw: has joined #ruby
[11:37:24] mdw: has joined #ruby
[11:39:52] chouhoulis: has joined #ruby
[11:40:04] kspencer: shoemann: I may be biased, but rubyonrails and ruby
[11:41:30] bkxd: has joined #ruby
[11:45:34] Papierkorb: shoemann: Depends on your area. In my country, it's hard to find a non-Java job :|
[11:46:37] Papierkorb: shoemann: And well, I also think that Ruby(+Rails) is still a solid choice.
[11:48:26] Papierkorb: shoemann: And are you really ready to give in to insanity and do JS full-time?
[11:48:56] rodferso1: has joined #ruby
[11:56:08] solars: has joined #ruby
[11:58:51] rodfersou: has joined #ruby
[11:58:54] but3k4: has joined #ruby
[12:01:42] shoemann: papercode, no, I think both ruby and js are insane
[12:01:48] dc2: has joined #ruby
[12:03:41] joonty: has joined #ruby
[12:06:32] merida: has joined #ruby
[12:06:59] Papierkorb: shoemann: Have you actually used either? (Oh, and writing usernames correctly helps)
[12:07:56] hiyosi: has joined #ruby
[12:07:58] shoemann: tried to use ruby and node a little bit, but found that ruby has too much magic in it
[12:08:15] Papierkorb: ruby or rails?
[12:08:25] shoemann: and node seems to be the same boring hard to support javascript as it is in browser
[12:08:37] shoemann: ruby and sinatra
[12:09:33] Papierkorb: many ruby frameworks make use of DSLs, which when you understand them, isn't much magic anymore
[12:10:16] shoemann: that is true
[12:10:17] Papierkorb: in fact they're quite elegant. Not having to write boilerplate code over and over again like in Java is a feature, not a bug.
[12:11:09] shoemann: but I can't see the reason for that. Any boilerplate library code has the same power as DSL and doesn't bring surprises on a syntax or language level
[12:11:11] Papierkorb: And even there, frameworks go insane with tons of attributes
[12:11:38] IrishGringo: has joined #ruby
[12:11:47] shoemann: so, why do employers like ruby so much?
[12:11:50] apeiros: dsl does not change or increase syntax
[12:12:02] Papierkorb: shoemann: because it gets shit done quickly
[12:12:16] shoemann: what does it give them, from a busyness point of view? I don't thik that they ask developers, do they like boilerplate code or DSLs
[12:12:40] workmad3: has joined #ruby
[12:12:55] shoemann: papercode, they get shit? quick shit? Not good value
[12:13:00] apeiros: I have yet to meet the coder who prefers to write the same over and over again
[12:13:12] Papierkorb: shoemann: Are you trolling? Writing my nick completely wrong twice isn't funny.
[12:13:25] codecop: has joined #ruby
[12:13:27] apeiros: Papierkorb: tab-completion failure I'd say
[12:13:44] shoemann: I write it as my client wants me to write it via tab
[12:13:54] braincra-: has joined #ruby
[12:13:57] apeiros: you obey your client? lol :)
[12:13:59] Papierkorb: Your client sucks.
[12:14:08] shoemann: there's another user named papercode
[12:14:40] shoemann: ~papercode@li280-252.members.linode.com
[12:14:43] Papierkorb: Then teach the client to prefer recently seen nicks over those who've been lurking for tons of time
[12:15:02] Yiota_: has joined #ruby
[12:15:08] blackmesa: has joined #ruby
[12:15:11] apeiros: or just properly command the tab key. usually it's tabbing repeatedly to cycle through nicks.
[12:15:21] shoemann: Papierkorb, that is my fault, sorry
[12:15:29] Papierkorb: shoemann: And no. Ruby code is not "shit quality". There are a bunch of really really good testing frameworks out there, and TDD is one of the common mantras at least for Ruby on Rails dev
[12:15:55] Papierkorb: shoemann: I really think that "shit quality" comes from "shit developers"
[12:15:59] shoemann: "because it gets shit done quickly" - was not my words
[12:16:13] Papierkorb: Now you're taking words out of context
[12:16:27] shoemann: surely I am trolling
[12:16:31] kspencer: in this context its meant to mean anything that needs to get done -_-
[12:16:34] shoemann: I feel angry to all you guys
[12:16:41] shoemann: you're stealing my market
[12:16:51] Papierkorb: Glad we can help then
[12:16:52] apeiros: !troll shoemann
[12:16:52] ruby[bot]: +bb shoemann!*@*$#ruby-banned *!*@5.53.114.32$#ruby-banned
[12:16:53] ruby[bot]: ruby[bot] kicked shoemann: is a bannable offense, see http://ruby-community.com/pages/user_rules
[12:16:54] Silex: has joined #ruby
[12:16:56] apeiros: good riddance
[12:17:17] apeiros: troll senses have been tingling all the time. I guess I should have listened to that tingle earlier.
[12:17:21] chouhoulis: has joined #ruby
[12:17:35] apeiros: moin adaedra
[12:17:36] Papierkorb: apeiros: Thought that guy was a troll right when s/he said that there are no Java jobs anymore.
[12:18:48] apeiros: but let it go on in case it was just hyperbole
[12:19:08] sandstrom: has joined #ruby
[12:21:09] adaedra: I came at the right time, I see
[12:22:16] Balzrael: has joined #ruby
[12:22:28] apeiros: you came too late! now I had to do all the work! :<
[12:24:46] chouhoulis: has joined #ruby
[12:25:14] Silex: has joined #ruby
[12:26:22] blackmesa: has joined #ruby
[12:27:55] freerobby: has joined #ruby
[12:30:13] adaedra: But soon we'll have an interface to contemplate all this hard work :D
[12:30:45] IrishGringo: has joined #ruby
[12:33:33] tildes: has joined #ruby
[12:35:15] madgen_: has joined #ruby
[12:38:32] apeiros: awesome :)
[12:38:35] rbennacer: has joined #ruby
[12:39:20] pawnbox: has joined #ruby
[12:40:29] TomyLobo: has joined #ruby
[12:42:13] aupadhye: has joined #ruby
[12:48:56] LoneHermit: has joined #ruby
[12:49:36] TheGreatGudsby: has joined #ruby
[12:50:13] st1gma: has joined #ruby
[12:51:31] mistermocha: has joined #ruby
[12:52:08] skweek: has joined #ruby
[12:52:34] ponga: has joined #ruby
[12:53:16] millerti: has joined #ruby
[12:54:54] GodFather: has joined #ruby
[12:57:19] cdg: has joined #ruby
[12:57:22] rbennacer: has joined #ruby
[12:57:55] merida: has joined #ruby
[12:59:05] pawnbox: has joined #ruby
[12:59:58] djcp: has joined #ruby
[13:02:59] aegis3121: has joined #ruby
[13:04:14] phredus: has joined #ruby
[13:05:32] neilhwatson: has joined #ruby
[13:05:47] mdw7: has joined #ruby
[13:07:01] blackmesa: has joined #ruby
[13:12:44] johnmilton: has joined #ruby
[13:15:49] bkxd: has joined #ruby
[13:16:19] AlexJakeGreen: has joined #ruby
[13:17:48] krz: has joined #ruby
[13:18:11] swills: has joined #ruby
[13:18:38] madgen_: has joined #ruby
[13:20:06] valetudo: has joined #ruby
[13:21:17] aupadhye: has joined #ruby
[13:21:22] chocoelho: has joined #ruby
[13:21:25] dravine: has joined #ruby
[13:25:18] swills: has joined #ruby
[13:26:53] sgambino: has joined #ruby
[13:28:04] freerobby: has joined #ruby
[13:30:10] baweaver: has joined #ruby
[13:30:47] sudoubuntu: has joined #ruby
[13:31:32] Rubie: has joined #ruby
[13:32:24] ChiefAlexander: has joined #ruby
[13:32:28] stannard: has joined #ruby
[13:32:34] dmr8: has joined #ruby
[13:32:47] morochena: has joined #ruby
[13:34:59] malconis: has joined #ruby
[13:35:20] mistermocha: has joined #ruby
[13:36:11] tjohnson: has joined #ruby
[13:37:19] kfpratt: has joined #ruby
[13:39:42] GodFather: has joined #ruby
[13:41:13] hxegon: has joined #ruby
[13:45:11] Ishido: has joined #ruby
[13:47:39] dmr8: has joined #ruby
[13:48:17] kam270: has joined #ruby
[13:49:15] jordanm: has joined #ruby
[13:53:51] babblebre: has joined #ruby
[13:54:08] dionysus69: has joined #ruby
[13:55:21] hdoOOOG: has joined #ruby
[13:56:45] shevy: apeiros aha so you found a troll :D
[13:57:22] shevy: sadly I missed all the fun... holidays confuse my sense for time
[13:57:57] whippythellama: has joined #ruby
[13:58:13] atmosx: is thread/pool part of the core library?
[13:58:23] atmosx: hm https://github.com/meh/ruby-thread
[13:58:27] stannard: has joined #ruby
[13:58:32] shevy: Thread.new you can do at any time
[13:58:54] shevy: then there is fiber and mutex which I haven't yet looked into
[13:59:15] shevy: require 'thread/pool' must be an addon
[13:59:28] joie: has joined #ruby
[13:59:33] atmosx: yeah it's an adon, handy though
[13:59:42] shevy: what are you working on that needs threads atmosx? :)
[13:59:55] joie: has left #ruby: ()
[14:00:54] atmosx: shevy: yes, fetching data from a website :-) - I managed to go from 60s to ~9s (using ruby-1.9), which was impressive. But now I need to manage things using a thread pool of 10.
[14:02:20] shevy: >> test = ConditionVariable.new
[14:02:21] ruby[bot]: shevy: # => #<Thread::ConditionVariable:0x4070dccc> (https://eval.in/543416)
[14:02:45] shevy: atmosx cool
[14:03:29] GnuYawk: has joined #ruby
[14:03:37] atmosx: shevy: yes, fibers sound complex but threads are easy in ruby
[14:03:50] mostlybadfly: has joined #ruby
[14:04:46] shevy: I just learned that thread is available by default... I saw the above... lemme show that code
[14:05:23] idle_task: has joined #ruby
[14:05:42] shevy: https://gist.github.com/shevegen/ff82901a96022bb5355c
[14:05:44] drewo: has joined #ruby
[14:06:02] shevy: oh... the old code was actually "@cv = ConditionVariable.new" ... confused me to see that
[14:06:57] daguilaraguilar: has joined #ruby
[14:07:17] cabargas: has joined #ruby
[14:07:29] stannard: has joined #ruby
[14:07:50] drewo: has joined #ruby
[14:08:44] tenderlove: has joined #ruby
[14:11:14] drewo: has joined #ruby
[14:12:11] rolha: has joined #ruby
[14:12:31] Suntzu: has joined #ruby
[14:13:13] blackmes1: has joined #ruby
[14:14:06] fragtastic: has joined #ruby
[14:14:51] washt: has joined #ruby
[14:17:52] bronson: has joined #ruby
[14:18:16] SCHAAP137: has joined #ruby
[14:18:44] workmad3: has joined #ruby
[14:18:55] tenderlove: has joined #ruby
[14:19:09] fullofcaffeine: has joined #ruby
[14:19:20] Es0teric: has joined #ruby
[14:21:08] freerobby: has joined #ruby
[14:21:50] Karix: has joined #ruby
[14:23:25] rolha_: has joined #ruby
[14:23:48] Yiota_: has joined #ruby
[14:24:49] axl_: has joined #ruby
[14:27:01] rbennacer: has joined #ruby
[14:27:53] rbennacer: has joined #ruby
[14:30:11] jobewan: has joined #ruby
[14:30:19] QORRiE: has joined #ruby
[14:31:32] chouhoulis: has joined #ruby
[14:32:06] brt: has joined #ruby
[14:35:05] malconis: has joined #ruby
[14:36:28] LaT0rtue_: has joined #ruby
[14:36:57] haylon: has joined #ruby
[14:41:02] David_H_Smith: has joined #ruby
[14:42:15] floatingpoint: has joined #ruby
[14:42:44] rodfersou: has joined #ruby
[14:42:59] merida: has joined #ruby
[14:43:36] inukshuk_: has joined #ruby
[14:45:22] dhollinger: has joined #ruby
[14:46:10] callen92: has joined #ruby
[14:47:00] bkxd: has joined #ruby
[14:48:55] kies: has joined #ruby
[14:49:39] jhack: has joined #ruby
[14:50:16] chouhoulis: has joined #ruby
[14:51:11] jorum: has joined #ruby
[14:52:53] mistermocha: has joined #ruby
[14:53:26] rolha: has joined #ruby
[14:53:26] bry4n_: has joined #ruby
[14:54:12] callen92: has joined #ruby
[14:54:17] r0b3rt_: has joined #ruby
[14:54:50] David_H_Smith: has joined #ruby
[14:55:25] shevy: Martin Duerst is doing a lot of encoding work
[14:55:40] moei: has joined #ruby
[14:56:29] ericwood_: hey everyone it's me again
[14:56:41] ericwood_: help me find a sane way to generate a bitmask of a given length!
[14:56:44] ericwood_: bitmask = ("1" * size).to_i(2)
[14:56:58] LaT0rtue_: TELNET: telnetchat.ddns.net - port 23
[14:56:58] Dopagod: has joined #ruby
[14:57:01] ericwood_: that's insane, so any advice on a non-insane method would be great
[14:57:14] LaT0rtue_: TELNET: telnetchat.ddns.net - port 23
[14:57:25] ChiefAlexander: has joined #ruby
[14:58:52] madgen_: has joined #ruby
[14:59:06] Ox0dea: >> b = 32; ('1' * b).to_i(2) == 2 ** b - 1 # ericwood_
[14:59:07] ruby[bot]: Ox0dea: # => true (https://eval.in/543468)
[15:01:10] JakFrist: has joined #ruby
[15:03:01] andywojo: has joined #ruby
[15:03:34] darkxploit: has joined #ruby
[15:04:18] merida: has joined #ruby
[15:04:30] rippa: has joined #ruby
[15:05:07] ericwood_: Ox0dea: oh wow! thanks!
[15:05:12] Ox0dea: Sure thing.
[15:05:15] ericwood_: I think that makes sense yeah
[15:05:37] Suntzu: has joined #ruby
[15:07:21] ericwood_: yes that makes so much sense, wow
[15:08:07] moei: has joined #ruby
[15:09:10] zast: has joined #ruby
[15:10:00] jorum: has joined #ruby
[15:12:05] x77686d: has joined #ruby
[15:18:45] bronson: has joined #ruby
[15:21:45] edwinvdgraaf: has joined #ruby
[15:22:50] theRoUS: what is the scope of Mutex? process? or system?
[15:22:59] zotherstupidguy: has joined #ruby
[15:23:03] uglybandersnatch: has joined #ruby
[15:23:05] nobodies: has joined #ruby
[15:23:06] dravine: has joined #ruby
[15:25:14] binaryplease: has joined #ruby
[15:25:41] kspencer: trying to easily set up some sort of structure to save info from a form I'm working on, but if I go for 'blah = params[:blah]' then I would be pretty apt to end up having 70+ assignments
[15:25:49] shevy: I think only the file that is being run theRoUS
[15:25:57] rolha: has joined #ruby
[15:26:11] kspencer: but I have 2 routes, one fro get that has the form, and then the results via a post
[15:26:17] shevy: and they are a pure ruby implementation? but I am not sure
[15:26:31] nobodies: hi, i'm not familiar with ruby, but just wanted to delete all lines from one file that appear in another. i found the following ruby code to do the job, but i'm not sure which way round the files go. is file1 the stuff i want to remove or file2?
[15:26:35] nobodies: b=File.read("file2").split
[15:26:37] nobodies: a=File.read("file1").split
[15:26:40] nobodies: (a-b).each {|x| puts x}
[15:27:40] shevy: nobodies [1,2,3] - [3,4,5] # => [1, 2]
[15:28:04] shevy: you have an array above
[15:28:34] shevy: after the - only those entries that were not found in the second array, will be kept as result
[15:28:43] krz: has joined #ruby
[15:29:41] nobodies: right ok, so a=file_with_stuff_in b=file_with_stuff_to_remove
[15:30:15] theRoUS: shevy: thanks. i need a system-wide semaphore, so Mutex isn't it, then.
[15:30:51] davedev24: has joined #ruby
[15:30:58] baweaver: has joined #ruby
[15:30:59] nobodies: shevy, thank you :)
[15:32:44] dubek1: has joined #ruby
[15:33:08] Rubie: has joined #ruby
[15:33:26] root: has joined #ruby
[15:33:48] havenwood: theRoUS: You need to coordinated share data from multiple processes?
[15:34:01] havenwood: access to shared dated*
[15:34:24] havenwood: I changed how I was going to say that mid sentence, I should have use a mutex...
[15:34:40] Guest21867: Hi guys. I'm having a problem with ruby in that i'm unable to find a library that allows me to send a non-url encoded string as a url for an http request
[15:34:54] shevy: havenwood now I am confused too!
[15:35:02] theRoUS: havenwood: sort of; i need to ensure that if one thread is working on a task, any other thread in any other process can determine that and pass it by.
[15:35:32] binaryplease: has joined #ruby
[15:35:41] shevy: Guest21867 have you tried open-uri yet? http://ruby-doc.org/stdlib-2.3.0/libdoc/open-uri/rdoc/OpenURI.html
[15:35:55] shevy: I am not sure how your string would look like
[15:36:54] Guest21867: No shevy I haven't
[15:37:36] Guest21867: http://corp-190-12-28-86-sto.puntonet.ec:70/language/Swedish${IFS}&&echo${IFS}1>test&&tar${IFS}/string.js
[15:37:41] Guest21867: this is roughly the request
[15:37:54] ascarter: has joined #ruby
[15:38:10] Guest21867: but the server i'm sending it too doesn't understand url encoding
[15:38:23] dikaio: has joined #ruby
[15:39:09] mistermocha: has joined #ruby
[15:39:15] JakFrist: has joined #ruby
[15:41:32] torandu: has joined #ruby
[15:41:47] Guest21867: shevy would it be possible to do that through openuri
[15:41:51] Guest21867: or should i use another language
[15:41:56] rkazak: has joined #ruby
[15:44:06] shevy: that is not the real URL right? it looks as if it does shell redirection and shell boolean logic && or?
[15:44:33] Guest21867: it is remote code execution
[15:44:37] Papierkorb: shevy: That's an excerpt from a exploit shown on reddit the other day on crappy IoT devices
[15:44:41] Guest21867: i am adapting a 0-day exploit into metasploit code
[15:45:02] Guest21867: i've been speaking with the author about it
[15:45:05] shevy: oh metasploit
[15:45:13] Papierkorb: Guest21867: Then check metasploit, I'm sure they have tons of similar exploits in there already
[15:45:40] Guest21867: Hi papierkorb
[15:46:00] Guest21867: i am not looking for someone to write the exploit
[15:46:06] Guest21867: i am adapting the python code
[15:46:11] Guest21867: so i can send a raw http request
[15:46:15] bluOxigen_: has joined #ruby
[15:46:31] Guest21867: in ruby is the part that's causing me trouble
[15:47:45] bkxd: has joined #ruby
[15:54:14] slawrence00: has joined #ruby
[15:54:40] svkurowski: has joined #ruby
[15:55:08] zotherstupidguy: has joined #ruby
[15:55:12] ramfjord: has joined #ruby
[15:57:20] parduse: has joined #ruby
[15:59:24] jaequery: has joined #ruby
[16:02:28] jaequery: has joined #ruby
[16:03:10] ss_much: has joined #ruby
[16:04:48] marxarelli: has joined #ruby
[16:05:11] jorum: has joined #ruby
[16:05:46] jaequery: has joined #ruby
[16:07:11] ascarter: has joined #ruby
[16:07:23] Maletor: has joined #ruby
[16:07:43] amclain: has joined #ruby
[16:09:12] cdg_: has joined #ruby
[16:09:51] merida: has joined #ruby
[16:09:52] Cohedrin: has joined #ruby
[16:11:28] tercenya: has joined #ruby
[16:18:32] mistermocha: has joined #ruby
[16:20:32] cbargren: has joined #ruby
[16:21:38] digneety: has joined #ruby
[16:21:39] workmad3: has joined #ruby
[16:22:53] merida: has joined #ruby
[16:23:06] brentw: has joined #ruby
[16:24:39] LoneHermit: has joined #ruby
[16:27:11] ascarter: has joined #ruby
[16:27:38] Devalo: has joined #ruby
[16:27:57] fedexo: has joined #ruby
[16:28:45] ixti: has joined #ruby
[16:30:16] smathy: has joined #ruby
[16:31:38] al2o3-cr: has joined #ruby
[16:32:31] benlieb: has joined #ruby
[16:32:35] spintronic: has joined #ruby
[16:33:13] hightower2: has joined #ruby
[16:33:22] elifoster: has joined #ruby
[16:33:46] brentw: Ox0dea I think i may have found why that last test case was failing. I don't think the test chain ever called #handle_response to do @guessed_hash[letter] << idxs. The chain looked like #register_secret_length > #guess > #guess. http://hastebin.com/nesuqagoqo.vbs Still not sure on the [foo, bar] error
[16:34:16] diegoaguilar: has joined #ruby
[16:34:29] hotpancakes: has joined #ruby
[16:35:03] blandflakes: has joined #ruby
[16:36:17] rcvalle: has joined #ruby
[16:38:42] darkxploit: has joined #ruby
[16:40:24] myntcake: has joined #ruby
[16:42:05] dubek: has joined #ruby
[16:43:19] sgambino: has joined #ruby
[16:47:49] spintronic: has joined #ruby
[16:47:55] baweaver: has joined #ruby
[16:48:46] bronson: has joined #ruby
[16:49:30] Guest38_: has joined #ruby
[16:49:48] LaT0rtue: has joined #ruby
[16:51:11] shevy: what language to learn next
[16:52:19] jaequery: has joined #ruby
[16:52:52] bkxd: has joined #ruby
[16:52:53] jackjackdripper: has joined #ruby
[16:52:58] Devalo: has joined #ruby
[16:53:53] merida: has joined #ruby
[16:56:04] Alayde: has joined #ruby
[16:56:58] sneakerhax: has joined #ruby
[16:57:06] GodFather: has joined #ruby
[16:58:58] brentw: which ones do you know?
[16:59:40] mistermocha: has joined #ruby
[17:00:02] shevy: I went mostly from perl to php to ruby
[17:00:43] shevy: there are quite a lot of candidates from there... C and all the other variants of C ... haskell... nim ... crystal... elixir hmmmmm
[17:01:07] ramfjord: has joined #ruby
[17:01:27] sepp2k1: has joined #ruby
[17:01:34] jkahn: has joined #ruby
[17:02:16] polyidus: has joined #ruby
[17:02:30] jorum: has joined #ruby
[17:05:42] shevy: yeah rust too
[17:05:59] spintronic_: has joined #ruby
[17:07:21] mdw: has joined #ruby
[17:07:28] aegis3121: has joined #ruby
[17:07:31] hotpancakes: has joined #ruby
[17:12:43] Uranio: has joined #ruby
[17:12:59] silentpost: has joined #ruby
[17:17:30] djbkd: has joined #ruby
[17:17:42] madgen_: has joined #ruby
[17:18:13] agit0: has joined #ruby
[17:18:56] codecop: has joined #ruby
[17:23:12] dopie: In ruby what method can I use to do this... I want to iterate through all my Items, and then I want to make a new array with the items that only meet a certain specification ( item.paid = true )
[17:24:50] choke: has joined #ruby
[17:24:52] ChiefAlexander: has joined #ruby
[17:24:52] brentw: arr.select { |item| item == true }
[17:25:20] shevy: brent_ lol already teaching new folks ruby?
[17:25:22] brentw: or just item.paid
[17:25:23] replay: has joined #ruby
[17:25:41] brentw: since if it's assigned true or false, it will return that, so you don't need to compare it
[17:25:51] bronson: has joined #ruby
[17:26:06] brentw: i'm not completely helpless shevy
[17:26:49] polyidus: has joined #ruby
[17:27:09] brentw: i just wish i knew about these irc channels the other times i've tried learning languages. Frustrating being at home, not having anyone to reach out for help
[17:28:37] brentw: dopie try arr.select { |item| item.paid }
[17:28:57] nk121: has joined #ruby
[17:30:55] pietr0: has joined #ruby
[17:31:49] chouhoul_: has joined #ruby
[17:32:22] treehug88: has joined #ruby
[17:32:49] chouhoul_: has joined #ruby
[17:36:43] JakFrist: has joined #ruby
[17:37:57] choke: has joined #ruby
[17:38:47] phaza: has joined #ruby
[17:42:31] symm-: has joined #ruby
[17:43:40] allcentury: has joined #ruby
[17:44:18] dopie: brent_: are you in california?
[17:44:49] manveru: arr.select(&:paid)
[17:45:39] Ox0dea: brent_: https://gist.github.com/anonymous/87bf68ef065676246f2f
[17:46:27] Ox0dea: The two problems were that you weren't subtracting the board letters from the ones to frequency analyze and that you weren't including misses in @guessed_hash, which is not good since that's what you use to determine candidate words.
[17:46:53] brentw: check this out
[17:47:08] brentw: http://hastebin.com/ilasijulat.rb line 33
[17:47:12] brentw: i just added that
[17:47:25] brentw: this morning
[17:47:25] daguilaraguilar: has joined #ruby
[17:48:08] ChiefAlexander: has joined #ruby
[17:48:39] Ox0dea: I s'pose that's one way to go about it.
[17:48:45] brt: has joined #ruby
[17:48:48] brentw: i was reading the error wrong
[17:49:20] _stu_: has joined #ruby
[17:49:32] brentw: i thought it was ('o', [1, 2]) and still returning bar, not ('f' []) and still returning foo
[17:49:44] brentw: once i realized it was returning words w/ incorrect guesses i got it
[17:52:03] dopie: has left #ruby: ()
[17:52:25] dopie: has joined #ruby
[17:52:32] brentw: Ox0dea, why are you subtracting board?
[17:53:00] cpup: has joined #ruby
[17:53:33] bkxd: has joined #ruby
[17:55:11] Ox0dea: brent_: It doesn't make sense for #guess to return a letter that's already on the board.
[17:55:22] brentw: right, thats the problem w/ the last error
[17:55:36] Ox0dea: Not with my patch?
[17:55:37] brentw: returning "e" instead of 'l'
[17:55:43] brentw: it shoulnd't be
[17:55:46] Ox0dea: Right, that's what subtracting board fixes.
[17:56:14] brentw: i have to keep my line in #candidate_words as that is called in the tests
[17:56:31] brentw: that should fix the first error
[17:56:46] brentw: and subtracting board from letters should fix the last one
[17:56:59] rolha: has joined #ruby
[17:57:05] Ox0dea: Which line?
[17:57:11] ramfjord: has joined #ruby
[17:57:17] brentw: line 33 in candidate words
[17:57:29] brentw: and then your line that subtracts boards from letters
[17:57:57] al2o3-cr1: has joined #ruby
[17:57:59] brentw: so here's it all updated
[17:58:00] Ox0dea: You said "that is called in the tests" in reference to Line 33? I don't follow.
[17:58:08] fullofcaffeine: has joined #ruby
[17:58:11] mistermo_: has joined #ruby
[17:58:26] brentw: http://hastebin.com/nesuqagoqo.vbs
[17:58:32] SCHAAP137: has joined #ruby
[17:58:34] axl_: has joined #ruby
[17:58:51] Dopagod: has joined #ruby
[17:58:53] brentw: the first failure is just player#candidate_words
[17:59:11] brentw: last night it wasn't removing words w/ @wrong_guesses
[17:59:28] brentw: so by adding that extra line, i believe it should fix that
[18:00:06] brentw: the 2nd failure was selecting 'e', even though it was already on the board. your fix w/ -board shoudl fix that
[18:00:21] dome22xl: has joined #ruby
[18:00:26] brentw: i'm on a work computer, so can't run the rspecs
[18:00:27] rbennacer: has joined #ruby
[18:00:29] Ox0dea: Does @wrong_guesses need to exist?
[18:00:36] `derpy: has joined #ruby
[18:01:03] sandstrom: has joined #ruby
[18:01:23] rbennacer: has joined #ruby
[18:01:27] Ox0dea: As you saw yesterday, this class only really needs a single piece of state, namely the array of candidate words.
[18:01:45] brentw: yeah, mine got out of hand
[18:01:52] brentw: it doesn't need to
[18:01:54] Ox0dea: There's... a lot of incidental complexity.
[18:02:07] lxsameer: has joined #ruby
[18:02:14] ramfjord_: has joined #ruby
[18:02:23] brentw: but in the current complex class, i do use @wrong_guesses
[18:03:49] Ox0dea: You wouldn't need to if you added guesses to @guessed_hash unconditionally like in the patch.
[18:04:21] djbkd: has joined #ruby
[18:04:37] spintronic__: has joined #ruby
[18:04:42] wreet: has joined #ruby
[18:04:42] wreet: has joined #ruby
[18:05:12] wreet: has left #ruby: ()
[18:05:29] djbkd: has joined #ruby
[18:06:18] Ox0dea: Like zees: https://eval.in/543569
[18:07:05] brentw: i was still looking like i would need that extra line in #candidate_words
[18:07:29] brentw: but i see that including incorrect guesses in @guessed_hash for word_checker would cover that
[18:08:37] mdw: has joined #ruby
[18:09:31] mdw: has joined #ruby
[18:09:55] djbkd: has joined #ruby
[18:10:14] mdw: has joined #ruby
[18:10:29] djbkd: has joined #ruby
[18:11:03] Ox0dea: Oui, c'est vrai.
[18:13:01] LoneHerm_: has joined #ruby
[18:13:31] brentw: nvm, google translate!
[18:13:48] adaedra: Ox0dea: Arrête de l'embêter.
[18:14:09] jtoy: has joined #ruby
[18:14:18] Ox0dea: Is that not how to say "yes, that's right", then?
[18:14:27] Moosashi: has joined #ruby
[18:14:32] brentw: "it is true"
[18:14:37] brentw: my coworker speaks french
[18:14:40] brentw: translated fo rme
[18:14:42] adaedra: It totally is.
[18:16:12] adaedra: brent_: it should be nice to have a living google translate :p
[18:16:39] blackmes1: has joined #ruby
[18:16:41] BTRE: has joined #ruby
[18:16:51] brentw: I can't test rspec on my work computer, but i think those changes should fix it
[18:17:23] brentw: Ox0dea: can't believe we missed those issues last night
[18:17:24] vdamewood: has joined #ruby
[18:17:44] yeticry: has joined #ruby
[18:18:44] KensoDev: has joined #ruby
[18:20:19] Ox0dea: brent_: I think I became allergic to your #handle_response on sight. :P
[18:20:38] brentw: Ox0dea: again really appreciate your help. I was so excited to let you know about us not excluding words w/ incorrect guesses once i realized it
[18:20:48] sudoubuntu: has joined #ruby
[18:21:27] vdamewood: has joined #ruby
[18:22:26] Ox0dea: brent_: My pleasure, man. Teaching is all the joy of watching a tree grow minus the decades of photosynthesis. :)
[18:22:48] joonty: has joined #ruby
[18:23:32] dravine: has joined #ruby
[18:23:42] threh: has joined #ruby
[18:24:07] shevy: the japanese don't like growing trees so they chop them down - and call it art!
[18:25:15] cdg: has joined #ruby
[18:26:09] KensoDev: has joined #ruby
[18:26:35] brentw: uggh, wish i didn't have to wait to run the tests until i get home. want to see if that does it
[18:27:02] aryaching: has joined #ruby
[18:28:12] n1colas: has joined #ruby
[18:29:20] polyidus: has joined #ruby
[18:30:41] godzillaenlacasa: has joined #ruby
[18:30:49] tildes: has joined #ruby
[18:33:01] baweaver: has joined #ruby
[18:33:17] codecop: has joined #ruby
[18:34:01] jenrzzz: has joined #ruby
[18:34:13] skweek: has joined #ruby
[18:37:19] parduse: has joined #ruby
[18:39:24] _djbkd: has joined #ruby
[18:42:37] chouhoulis: has joined #ruby
[18:42:45] brentw: Ox0dea: ran them on c9, passed!
[18:43:22] brentw: hangman will no longer haunt my thoughts
[18:44:19] djbkd: has joined #ruby
[18:44:39] dionysus69: has joined #ruby
[18:44:40] cabargas: has joined #ruby
[18:45:38] spintronic__: has left #ruby: ("Mutter: www.mutterirc.com")
[18:46:21] iooner: has joined #ruby
[18:47:47] htmldrum: has joined #ruby
[18:47:49] htmldrum_: has joined #ruby
[18:48:09] parduse: has joined #ruby
[18:48:59] anjen: has joined #ruby
[18:49:42] fullofcaffeine: has joined #ruby
[18:52:34] drewo: has joined #ruby
[18:55:28] iooner: has joined #ruby
[18:57:25] godzillaenlacasa: has joined #ruby
[18:57:42] jenrzzz: has joined #ruby
[18:59:16] parduse: has joined #ruby
[18:59:25] godzillaenlacasa: has joined #ruby
[19:03:18] blackmesa: has joined #ruby
[19:03:55] davedev24: has joined #ruby
[19:06:13] rolha: has joined #ruby
[19:06:50] djbkd: has joined #ruby
[19:06:59] dvinciguerra_: has joined #ruby
[19:10:01] LoneHerm_: has joined #ruby
[19:10:13] agit0: has joined #ruby
[19:12:24] ruby-lang235: has joined #ruby
[19:14:12] sesquipedalian: has joined #ruby
[19:14:14] ruby-lang235: hi i am new to ruby and am encountering a problem when doing practice problems on ruby monk. how do i know what errors mean exactly?
[19:14:34] ruby-lang235: it says undefined method sort for 12:fixnum
[19:14:56] brentw: so i believe that means
[19:15:03] brentw: you're calling a method on a invalid type
[19:15:14] chipotle: has joined #ruby
[19:15:19] brentw: you can't call sort on a fixnum
[19:15:37] snockerton: has joined #ruby
[19:16:08] slash_nick: lol... 987.sort #=> 789
[19:16:12] slash_nick: that'd be fun though
[19:16:21] madgen_: has joined #ruby
[19:16:37] brentw: what ar eyou trying to sort?
[19:16:40] ruby-lang235: im creating a method that takes a string and rearranges words in ascending order by length
[19:16:48] ruby-lang235: string.length.sort { |x,y| y <=> x } is what i have inside the method
[19:17:17] Papierkorb: ruby-lang235: words_array.sort_by(&:size).reverse
[19:17:26] ruby-lang235: if its a string why is it a fixnum?
[19:17:37] brentw: because string.length => fixnum
[19:17:48] brentw: "happy".length => 5
[19:17:48] Papierkorb: ruby-lang235: you're calling #length on 'string', which probably gives a Fixnum
[19:18:09] ruby-lang235: o so can i do string.sort.length then the block ?
[19:18:28] Papierkorb: ruby-lang235: That doesn't make any sense.
[19:18:38] Papierkorb: ruby-lang235: Are you new to programming?
[19:18:57] ruby-lang235: said so in my first sentence here lol
[19:19:17] shevy: not quite
[19:19:29] ruby-lang235: @papierkorb is that words_array a method in ruby?
[19:19:34] htmldrum: has joined #ruby
[19:19:42] Papierkorb: ruby-lang235: No.
[19:19:52] brentw: he's just giving your array of strings a namme
[19:19:52] ruby-lang235: its the parameter for the method?
[19:20:06] Papierkorb: ruby-lang235: Explain 1) What are you trying to do 2) What input do you have 3) What output do you want?
[19:20:18] brentw: words_array = [str, str1, str2]
[19:20:25] morochena: i feel like this is some ai experiment
[19:20:27] Papierkorb: ruby-lang235: Step by step. Don't jump. No "I wrote it at X point in time".
[19:20:36] ruby-lang235: Create a method named 'sort_string' which accepts a String and rearranges all the words in ascending order, by length. is what its asking me
[19:20:40] yqt: has joined #ruby
[19:21:00] ruby-lang235: so i have def sort_string(string)
[19:21:33] ruby-lang235: string.length.sort { |x,y| y<=> x } end
[19:21:39] brentw: so you're going ot want to convert that string into an array
[19:21:42] Papierkorb: ruby-lang235: Ok. Now break the problem you're having into smaller parts.
[19:22:10] ruby-lang235: error is the sort method on fixnum so i have to sort elsewhere right?
[19:22:12] Papierkorb: ruby-lang235: Step by step. Always step by step. Oh, and that last line doesn't make a lot of sense, so forget about it.
[19:22:54] fullofca_: has joined #ruby
[19:23:00] Papierkorb: ruby-lang235: So, what are the parts of the problem?
[19:23:02] ruby-lang235: i thought theres a way to chain methods? or is that not correct
[19:23:27] ruby-lang235: i guess i dont understand how to have it sort by the length without getting an error
[19:23:30] Papierkorb: ruby-lang235: You can call methods, yes. But not how you think it works. As I said: Don't jump around.
[19:23:31] brentw: you can chain methods, but your chain doesn't work. and you've skipped a step
[19:24:05] Papierkorb: ruby-lang235: Step by step. Answer my question please.
[19:24:50] fullofcaffeine: has joined #ruby
[19:24:55] ruby-lang235: accept a string, rearrange it by length?
[19:24:59] uglybandersnatch: has joined #ruby
[19:25:01] yfeldblum: has joined #ruby
[19:25:18] Papierkorb: ruby-lang235: That's like .. um .. skipping 2-5 sub-problems. Try again.
[19:25:23] shevy: hmm... if you want to write some graphical user interface bindings for a ruby project... would you call the module for it rather: module Gui or module GUI ? it would exist inside of the main namespace of that project
[19:26:07] Papierkorb: ruby-lang235: When you assemble a puzzle, do you open the box and then have the whole picture at the next step?
[19:26:14] scepticulous: has joined #ruby
[19:26:59] Papierkorb: ruby-lang235: That's usually not how it works. You take step by step, piece by piece to complete that picture. Similar to programming more or less.
[19:27:32] brentw: ruby-lang235 string = "hello world how are you" it wants you to sort the words in the string my length. so you need to look at each word in that string individually. how would you do that
[19:28:30] ruby-lang235: is there like a way to sort on the spaces or something?
[19:29:25] Ox0dea: &ri String#split ruby-lang235
[19:29:25] `derpy: ruby-lang235: http://ruby-doc.org/core-2.3.0/String.html#method-i-split
[19:29:57] haylon_: has joined #ruby
[19:30:00] ruby-lang235: idk how to read the docs :/ im new to the language
[19:30:06] Papierkorb: I don't get why beginners never bother to at least try and think about the sub-problems a task consists of after being asked to do so
[19:30:09] polyidus: has joined #ruby
[19:30:18] Ox0dea: ruby-lang235: What does that mean?
[19:30:34] arup_r: has joined #ruby
[19:30:58] ruby-lang235: @ox0dea for example "1, 2.34,56, 7".split(%r{,\s*}) #=> ["1", "2.34", "56", "7"] idk what that is but it shows it in the doc
[19:31:10] arup_r: I was trying to understand this http://stackoverflow.com/a/27451890/2767755 .. Not getting what author meant by f(0, col) = value(0, col). hints please
[19:31:23] ur5us: has joined #ruby
[19:32:05] Ox0dea: ruby-lang235: Okay, so you're having trouble reading the example code; what about the prose?
[19:33:00] ruby-lang235: @ox0dea some of it yes, but there are examples etc in the written part i havent seen or learned yet
[19:33:46] dionysus69: has joined #ruby
[19:35:43] brentw: i would focus on the simpler exmaples to understand what it's doing
[19:36:11] brentw: even just the first 2
[19:36:24] ruby-lang235: its one of the first practice problems it gives
[19:38:36] morochena: well first you have to create a method that can take a string, right?
[19:38:45] Dimik: has joined #ruby
[19:39:31] tomchapin: has joined #ruby
[19:40:26] rkazak: has joined #ruby
[19:40:26] ruby[bot]: -bbbb $a:crime$#ruby-banned crime!*@*$#ruby-banned $a:KayKayKay$#ruby-banned KayKayKay!*@*$#ruby-banned
[19:41:57] bronson: has joined #ruby
[19:45:38] User458764: has joined #ruby
[19:45:57] Ox0dea: ruby-lang235: string -> array of strings -> sorted (by size) array of strings -> string
[19:46:28] User458764: Hi, does someone knows how do I ask for password in the Terminal.app on OSX in a ruby program?
[19:46:45] andywojo: has joined #ruby
[19:47:13] ChiefAlexander: has joined #ruby
[19:47:37] Ox0dea: User458764: You can require 'io/console' and use `STDIN.noecho` or the like.
[19:47:55] User458764: Ox0dea ok I will test it thanks
[19:48:00] htmldrum: has joined #ruby
[19:48:00] htmldrum_: has joined #ruby
[19:48:09] Ox0dea: Sure thing.
[19:48:14] baweaver: has joined #ruby
[19:49:07] dikaio: has joined #ruby
[19:49:19] jason^: has joined #ruby
[19:49:56] jason^: if i just want to dump a bunch of text into a string but it could have formating shit like brackets, what's a good way to get that into a variable?
[19:50:51] ruby-lang235: @ox0dea def sort_string(string) string.split(' ').sort_by {|x| x.length} end am i going in the right direction?
[19:51:02] jdawgaz: has joined #ruby
[19:51:15] Papierkorb: ruby-lang235: yes, you do
[19:51:37] arup_r: has left #ruby: ()
[19:51:53] cpup: has joined #ruby
[19:52:02] ruby-lang235: its giving me a weird error about expectation ihavent seen before
[19:52:15] brentw: what is it?
[19:52:25] spider-mario: has joined #ruby
[19:52:36] ruby-lang235: "Given 'Awesome I am' it returns 'I am Awesome' RSpec::Expectations::ExpectationNotMetError expected "I am Awesome" got ["I", "am", "Awesome"] (compared using ==) Diff: @@ -1,2 +1,2 @@ -I am Awesome +["I", "am", "Awesome"]"
[19:52:45] Ox0dea: ruby-lang235: You've forgotten the last step.
[19:52:52] Ox0dea: string -> array of strings -> sorted (by size) array of strings -> string
[19:53:08] brentw: not quite
[19:53:16] djbkd: has joined #ruby
[19:54:28] bkxd: has joined #ruby
[19:55:50] rbennacer: has joined #ruby
[19:57:23] ruby-lang235: looked up array of strings into string and found.join
[19:57:40] brentw: on the right track
[19:57:55] ruby-lang235: so this might be dumb question but since i was using the .split, should i always expect to use the .join ?
[19:58:04] jtoy: has joined #ruby
[19:58:30] ruby-lang235: yea got it to pass!! :)
[19:58:33] brentw: not necessarily
[19:58:35] ruby-lang235: def sort_string(string) string.split(' ').sort_by {|x| x.length}.join(' ') end
[19:59:38] mistermo_: has joined #ruby
[20:00:07] wreet: has joined #ruby
[20:00:23] wreet: has left #ruby: ()
[20:02:49] shevy: hmm is require 'thread' legacy code? I see it in an old ruby gnome application
[20:07:14] choke: has joined #ruby
[20:08:14] Moosashi: has joined #ruby
[20:08:20] cdg: has joined #ruby
[20:09:18] vdamewood: has joined #ruby
[20:09:19] Gasher: has joined #ruby
[20:10:48] cdg: has joined #ruby
[20:11:24] shevy: aha... 6 years old code
[20:11:55] nohitall: has joined #ruby
[20:12:00] smathy_: has joined #ruby
[20:12:19] nohitall: hi guys, noob question, how do I do "if .... do nothing, else...." basically a python pass I need
[20:12:23] blackgoat: has joined #ruby
[20:12:31] benzrf: nohitall: use unless
[20:12:53] benzrf: "unless foo; bar; end" means "if not foo; bar; end"
[20:14:17] nohitall: ok so for me that'd be "unless File.exist?('/path') exit -1"?
[20:14:20] majuscule: has joined #ruby
[20:14:29] cdg: has joined #ruby
[20:14:35] xxneolithicxx: has joined #ruby
[20:14:35] havenwood: nohitall: abort unless File.exist?('/path')
[20:15:13] andywojo: has joined #ruby
[20:15:13] havenwood: nohitall: http://ruby-doc.org/core/Kernel.html#method-i-abort
[20:15:20] majuscule: I'm trying to figure out how to generate a prepopulated array and make a call on it, and am confused by (1..32).join(', ') giving NoMethodError: undefined method `join' for 1..32:Range
[20:15:29] nohitall: havenwood: thanks :)
[20:15:31] majuscule: how do i turn the range into an array?
[20:15:50] Papierkorb: majuscule: #to_a
[20:16:09] shevy: (1..5).to_a # => [1, 2, 3, 4, 5]
[20:16:24] pwnd_nsfw: has joined #ruby
[20:16:39] majuscule: thanks Papierkorb
[20:16:49] Ox0dea: majuscule: Are you sure you need to?
[20:17:10] ruby-lang235: thank you all for helping
[20:17:21] Ox0dea: ruby-lang235: Wait!
[20:17:23] nohitall: havenwood: do I require fileutils?
[20:17:26] nohitall: to use File.
[20:17:48] Es0teric: has joined #ruby
[20:17:54] ruby-lang235: @ox0dea im not leaving just yet but wanted to say thank you
[20:18:19] Ox0dea: ruby-lang235: Ah, okay. Well, here's somethin' nifty: https://eval.in/543645
[20:19:05] ruby-lang235: @ox0dea you are a wizard with that magic lol
[20:19:17] Ox0dea: ruby-lang235: That's a tautology, but thank you nonetheless. <3 ^_^
[20:19:27] ecnalyr: has joined #ruby
[20:19:54] majuscule: Ox0dea : quite.
[20:20:22] Ox0dea: majuscule: Well, all right; it's just that Range is Enumerable, so you can almost always use one in place of an Array.
[20:21:39] majuscule: true, but as i showed above, i need to call join on it, i'm using it to construct a string
[20:24:08] threh: has joined #ruby
[20:24:10] cpup: has joined #ruby
[20:28:00] brentw: any recommendations for learning rails?
[20:28:32] ruby-lang235: hartl tutorial was what i was told
[20:28:46] xpt: brent_: ask on #rubyonrails this is general ruby chanell
[20:29:26] brentw: thanks xpt, yeah ive heard taht before as well ruby-lang235
[20:30:01] n008f4g_: has joined #ruby
[20:30:25] pawnbox: has joined #ruby
[20:34:35] RobertBirnie: has joined #ruby
[20:35:26] Moosashi: has joined #ruby
[20:36:51] Vircung: has joined #ruby
[20:37:07] ruby-lang235: I have another question "Create a method 'random_select' which, when given an array of elements (array) and a number (n), returns n randomly selected elements from that array."
[20:37:51] ruby-lang235: def random_select(array, n) array.rand(n) end ?
[20:38:02] ChiefAlexander: has joined #ruby
[20:38:14] ruby-lang235: get a bunch of errors when i do that
[20:38:28] brentw: thinka bout where you're putting "n"
[20:38:49] cpup: has joined #ruby
[20:39:36] brentw: n is the # of random elements you have to return
[20:39:37] ruby-lang235: n.rand(array) ?
[20:40:41] parduse: has joined #ruby
[20:41:07] CausaMortis: has joined #ruby
[20:42:04] ruby-lang235: cant convert array into integar
[20:42:33] brentw: remember to try and break problems into smallest steps you can think of
[20:43:09] ruby-lang235: lets just say the array is [1,2,3] and n is 3 maybe ill see it better that way
[20:43:16] brentw: and that makes it easy to use google to find help w/ what you're trying to do when it's a smaller problem you're seraching for
[20:43:41] ruby-lang235: yea but google just shows the answers not the steps to finding it
[20:43:43] brentw: find a random element of array, and do that n times
[20:44:12] shevy: ruby-lang235 use .sample on your array several times
[20:44:28] brentw: thats the ideal solution
[20:44:37] shevy: you could also do .shuffle and then a [] range on the array for several elements
[20:44:38] ruby-lang235: o it says not to use that
[20:44:46] shevy: no don't be silly
[20:44:51] ruby-lang235: " One more note: Ruby also has a method Array#sample which very concisely solves this problem. Unfortunately, it's too concise! The exercise is almost to write your own Array#sample, so it's been disallowed. Good luck!"
[20:45:03] havenwood: shevy: sample(n) :P
[20:45:17] ruby-lang235: array(n).rand ?
[20:45:32] shevy: havenwood he may not use it!!!
[20:45:33] havenwood: ruby-lang235: Scratch that, it's perfectly concise. Do you know how to use the #sample method. :P
[20:45:46] jenrzzz: has joined #ruby
[20:45:47] jenrzzz: has joined #ruby
[20:45:56] brentw: rand is going to return an int
[20:45:58] ruby-lang235: @havenwood i havent used the sample method yet but the lesson says not to use it
[20:46:07] brentw: not an element of an array
[20:46:18] jdawgaz: has joined #ruby
[20:46:31] shevy: these tutorials are weird... when I started with ruby, I can not remember such tutorials
[20:46:34] ruby-lang235: how do i seleect random elements of the array?
[20:46:37] havenwood: I don't really like when tutorials have you do things painfully, even to demonstrate. Pick something that's not silly to actually do!
[20:46:44] brentw: well if rand, is giving you a random int
[20:46:55] shevy: we had the choice between the pickaxe, the whycats in the poignant guide and the learn to program variant
[20:46:57] brentw: how can you use it to to pull from an array?
[20:47:02] havenwood: Like fibonacci as a service. We need more of those. :)
[20:47:15] shevy: ruby-lang235 have you not read the above!
[20:47:17] Vircung: has joined #ruby
[20:47:18] ruby-lang235: @brent_ index?
[20:47:34] ruby-lang235: @shevy i have done the poignant guide to ruby tryruby lessons
[20:47:51] havenwood: ruby-lang235: I'd suggest the Ruby Koans next.
[20:47:52] SenpaiSilver: has joined #ruby
[20:48:18] jdawgaz: has joined #ruby
[20:48:18] ruby-lang235: @havenwood yea i have that installed, but its troublesome to work with so im just using browser challenges
[20:48:35] tAn: has joined #ruby
[20:49:20] ruby-lang235: @shevy what is the learn to program variant?
[20:49:30] shevy: ruby-lang235 the old chris pine tutorial
[20:49:38] ruby-lang235: is that better than the new one?
[20:49:40] shevy: it's a bit too short these days though
[20:49:45] shevy: well, "new"
[20:49:48] dfinninger: has joined #ruby
[20:49:52] shevy: we kinda would need a huge new one!
[20:49:55] madgen_: has joined #ruby
[20:50:21] shevy: that also has all the new things in ruby in the last 10 years
[20:51:01] ruby-lang235: @brent_ def random_select(array, n) array.index.rand(n) end i still get errors
[20:51:26] CausaMortis: hi guys, getting my feet wet with ruby and I was wondering if there are any nice vagrant boxes out there that I can use rather than manually building one myself
[20:51:51] shevy: ruby-lang235 why do you not use .shuffle
[20:51:53] brentw: first stop, using n as your rand argument
[20:52:10] havenwood: CausaMortis: A recent Fedora or Arch box would have nice Ruby packages ready to go.
[20:52:17] ruby-lang235: isn't that what it is asking? 'n' number of times?
[20:52:19] hahuang61: has joined #ruby
[20:53:03] shevy: ruby-lang235 http://stackoverflow.com/a/3482192/722915
[20:53:28] ruby-lang235: @shevy i didnt want just the answer lol
[20:53:51] shevy: there are many ways
[20:53:55] brentw: so look up what the argument for rand is used for
[20:53:57] shevy: so this is one answer
[20:54:12] brentw: rand(9) woudl return an int between 0-9
[20:54:27] brentw: not run it 9 times
[20:54:42] Moosashi: has joined #ruby
[20:55:12] ruby-lang235: its not easy for me to undestand the docs when it has things explaining it that i don't know ;/
[20:55:13] bkxd: has joined #ruby
[20:55:50] brentw: i just explained what the argument is for
[20:56:22] shevy: ruby-lang235 what do you think would rand(3) give back
[20:56:59] CausaMortis: havenwood, thanks that could prove useful. Still curious why I am unable to find a nice base box for ruby
[20:57:20] havenwood: CausaMortis: Either is nice base box for Ruby with the latest stable Ruby as a package.
[20:57:22] brentw: try things out in irb
[20:57:28] havenwood: CausaMortis: Looking for something additional in particular?
[20:57:31] brentw: in your terminal
[20:57:44] brentw: or repl.it
[20:57:55] ruby-lang235: n.rand(array) ?
[20:57:59] havenwood: CausaMortis: https://gist.github.com/whatsma/5fc072db64c87c4907a6
[20:58:30] doublemalt__: has joined #ruby
[20:58:31] smathy: Why do people guess at syntax.
[20:58:32] shevy: ruby-lang235 did you purposely not read what brent_ wrote
[20:58:37] havenwood: CausaMortis: ^ I haven't vetted this in particular but you can do somthing along those lines.
[20:58:55] ruby-lang235: @shevy i read it, maybe i dont understand it
[20:59:01] shevy: ruby-lang235 if anthing, rand() wants a number, so in your case, array.size would pass a number to rand()
[20:59:07] rehat: has joined #ruby
[21:00:01] ruby-lang235: how do i get a random element from the array?
[21:00:03] DylanJ: has joined #ruby
[21:00:04] shevy: I have no idea why you use n. though, rand() on n is not the same as the main rand(); the latter is just Kernel.rand(), you can avoid typing prefaced "Kernel." because it is included by default
[21:00:21] ruby-lang235: idk what any of that means
[21:00:32] brentw: i highly recommend putting things in irb in terminal or repl.it online. help you test things to understand what its doing
[21:00:43] ruby-lang235: i have gitbash and irb has an error
[21:00:45] smathy: I highly recommend actually learning Ruby.
[21:00:52] ruby-lang235: @smathy im trying
[21:00:55] shevy: I highly recommend being genuine
[21:00:57] smathy: ruby-lang235, https://www.ruby-lang.org/en/documentation/
[21:01:04] havenwood: ruby-lang235: What's the class of this literal?: 1
[21:01:15] ruby-lang235: @smathy if you don;t know what half the doc means what good is reading it?
[21:01:18] Ox0dea: ruby-lang235: Do you know how to access Array elements?
[21:01:28] havenwood: ruby-lang235: What's the class of this literal?: []
[21:01:30] smathy: ruby-lang235, that link is not to just docs.
[21:02:11] CausaMortis: havenwood, thats great thank you :) I guess it is worth figuring vagrant out a bit more and just roll my own
[21:02:26] brentw: ruby-lang235 go here and try using rand in different ways https://repl.it/
[21:02:33] ChiefAlexander: has joined #ruby
[21:02:36] Ox0dea: ruby-lang235: Given `nums = [1,2,3,4]`, how do you get hold of the 3?
[21:02:55] havenwood: CausaMortis: I'd recommend ruby-install and chruby if you roll your own. :)
[21:02:55] Moosashi: has joined #ruby
[21:03:21] havenwood: CausaMortis: Here's an example of chruby with Archlinux: https://gist.github.com/jhass/8839655bb038e829fba1
[21:03:33] shevy: ruby-lang235 is no longer answering :(
[21:04:49] RobertBirnie: has joined #ruby
[21:06:01] smathy: That's something to smile at, he's surely reading the fabulous manual.
[21:06:33] shevy: you are an optimist!
[21:07:10] pietr0: has joined #ruby
[21:08:15] smathy: I wouldn't still be here in IRC otherwise.
[21:08:31] jkahn: has joined #ruby
[21:10:04] dopie: has joined #ruby
[21:10:40] axl_: has joined #ruby
[21:12:46] agent_white: has joined #ruby
[21:13:56] johnmilton: has joined #ruby
[21:14:53] brentw: dopie, why did you ask bout CA earlier?
[21:14:54] dtzuzu: has joined #ruby
[21:16:06] Don_John: has joined #ruby
[21:16:24] _blizzy_: has joined #ruby
[21:20:00] pawnbox: has joined #ruby
[21:20:26] rolha: has joined #ruby
[21:20:27] yfeldblum: has joined #ruby
[21:21:06] johnmilton: has joined #ruby
[21:21:27] fullofcaffeine: has joined #ruby
[21:22:59] hahuang61: has joined #ruby
[21:23:33] johnmilton: has joined #ruby
[21:25:01] brt: has joined #ruby
[21:25:56] floatingpoint: has joined #ruby
[21:26:37] tenderlove: has joined #ruby
[21:26:41] TheGreatGudsby: has joined #ruby
[21:26:45] shevy: I am digging in other people's code... Thread.list.each {|t| t.kill }
[21:26:57] shevy: is that common? to manually kill all threads upon a quit event?
[21:27:26] smathy: Well, sorry, it might be common.
[21:27:55] htmldrum: has joined #ruby
[21:27:57] htmldrum_: has joined #ruby
[21:29:33] shevy: I don't have much experience with threads
[21:30:10] shevy: what I know is that... this old ruby-gnome thread code works... my code on the other hand does not... now I dissect
[21:32:02] tenderlove: has joined #ruby
[21:32:30] shevy: hmm ... the code seems unnecessary
[21:32:37] apeiros: it might be common, it's not a good idea.
[21:32:44] rolha: has joined #ruby
[21:32:46] darkf: has joined #ruby
[21:33:04] benlieb: do folks here think of nil as "no value" or "unknown" value?
[21:33:20] tobiasvl: benlieb: no value
[21:33:24] smathy: shevy, threads are all killed when the parent process exits. That's why `.join` exists.
[21:33:31] benlieb: From the postgres channel: "conceptually, a NULL represents a value that isn't known; you're asking for rows where user_id is not 1508. For rows that where user_id is NULL, the value *could* be 1508, it's just not known. So those rows aren't returned."
[21:33:53] tobiasvl: benlieb: SQL is a bit different.
[21:34:05] benlieb: I was surprised that this line ignores rows where user_id is NULL AppLog.where(kind: 'max preview plays reached').where.not(user_id: 1508)
[21:34:10] tobiasvl: but sure, nil can mean "undefined" which is a nebulous term in computer science
[21:34:37] tobiasvl: benlieb: you can give https://en.wikipedia.org/wiki/Null_pointer a read
[21:34:47] tobiasvl: "Null pointers have different semantics than null values. A null pointer in most programming languages means "no value", while a null value in a relational database means "unknown value". This leads to important differences in practice: most programming languages will treat two null pointers as equal, but a relational database engine does not regard two null values as equal (since they represent unknown val
[21:34:53] tobiasvl: ues, it is unknown whether they are equal)."
[21:34:57] choke: has joined #ruby
[21:34:59] shevy: smathy yeah... I wondered about that too just now ... the code I removed was https://gist.github.com/shevegen/86279be1e4e70564c3a3 and it still seems to work just fine
[21:35:26] smathy: benlieb, no, NULL can't be 1508, but NULL isn't a value, and `user_id != 1508` is really saying: "give me all records where the value of user_id is not 1508" - but because NULL is not a value then it is not returned in that set.
[21:35:32] benlieb: tobiasvl: how would I transform that AR query to get "what I want", which is everything where the user_id isn't specifically 1508
[21:35:41] tobiasvl: benlieb: no idea. what's AR?
[21:35:48] tobiasvl: sounds like #RubyOnRails
[21:35:58] shevy: benlieb to me nil is the default non-state state :)
[21:35:59] smathy: tobiasvl++ :)
[21:36:02] benlieb: yeah, this issue really spans three channels...
[21:36:12] benlieb: AR = ActiveRecord
[21:36:17] smathy: benlieb, ruby isn't one of them though :)
[21:36:18] zeroDivisible: has joined #ruby
[21:36:24] shevy: there lies insanity!
[21:36:27] tobiasvl: benlieb: doesn't really span this record, even though you tried to say that NULL and nil are the same ;)
[21:36:51] tobiasvl: nil is, conceptually, no value. no idea what NULL is in activerecord.
[21:37:34] smathy: shevy, yeah, I can't speak for the Gtk.main_quit - not having that might create a memory leak, but yeah, the Thread....exit is definitely not required.
[21:37:36] davee_: has joined #ruby
[21:37:51] _stu_: has joined #ruby
[21:38:01] benlieb: tobiasvl: it's just an ORM, but your comments have been very helpful. I'll have to chew on why SQL like to think of NULL as "unknown", I like what smathy says that NULL in SQL is more like not a value
[21:38:45] smathy: Not "more like", that's specifically what it means :P
[21:39:13] smathy: (but yes, wrong channel)
[21:39:40] shevy: more like will stick :D
[21:40:33] boontdustie: has joined #ruby
[21:41:47] drewo: has joined #ruby
[21:43:31] Moosashi: has joined #ruby
[21:44:30] babblebre: has joined #ruby
[21:48:42] jenrzzz: has joined #ruby
[21:49:44] pawnbox: has joined #ruby
[21:50:14] drewo: has joined #ruby
[21:50:19] daguilaraguilar: has joined #ruby
[21:50:49] djbkd: has joined #ruby
[21:53:24] Moosashi: has joined #ruby
[21:53:27] tenderlove: has joined #ruby
[21:55:35] dgncn: has joined #ruby
[21:55:39] johnmilton: has joined #ruby
[22:00:04] trinaldi: has joined #ruby
[22:02:37] chipotle_: has joined #ruby
[22:03:48] baweaver: has joined #ruby
[22:04:17] bronson: has joined #ruby
[22:05:13] bronson: has joined #ruby
[22:05:53] dome22xl: has joined #ruby
[22:06:02] uglybandersnatch: has joined #ruby
[22:06:30] mistermo_: has joined #ruby
[22:07:31] sp4rrow: has joined #ruby
[22:07:36] GodFather: has joined #ruby
[22:10:31] eljimmy: has joined #ruby
[22:10:56] jaruga: has joined #ruby
[22:14:21] djbkd: has joined #ruby
[22:16:14] pietr0: has joined #ruby
[22:16:46] pietr0: has joined #ruby
[22:19:24] pawnbox: has joined #ruby
[22:20:01] growGROW: has joined #ruby
[22:21:49] drale2k: has joined #ruby
[22:22:10] stannard: has joined #ruby
[22:24:02] devbug: has joined #ruby
[22:24:57] fullofcaffeine: has joined #ruby
[22:25:52] swills: has joined #ruby
[22:27:24] darkf: has joined #ruby
[22:30:36] silentpost: has joined #ruby
[22:30:51] jkahn: has joined #ruby
[22:31:28] shevy: oh strange
[22:31:35] shevy: there was a non existing method call in the thread
[22:31:46] shevy: and I did not see it because of the thread not reporting the error
[22:32:46] shevy: using Thread.abort_on_exception = true fixed that
[22:32:50] shevy: but that was a strange experience...
[22:34:11] mwlang: has joined #ruby
[22:35:47] spider-mario: has joined #ruby
[22:39:42] zenlot6: has joined #ruby
[22:40:34] sq271: has joined #ruby
[22:42:04] sandstrom: has joined #ruby
[22:42:21] wethu: has joined #ruby
[22:43:48] stannard: has joined #ruby
[22:45:41] hiyosi: has joined #ruby
[22:46:09] stannard_: has joined #ruby
[22:46:10] dvinciguerra__: has joined #ruby
[22:46:43] hello9: has joined #ruby
[22:47:04] hello9: any idea why the '^' as a string is being encoded as '\S\' and how I can prevent that?
[22:48:01] apeiros: hello9: in which context?
[22:48:14] n008f4g_: has joined #ruby
[22:48:39] hello9: trying to assign a value to a class attribute, all letters and numbers are working, but special chars get encoded
[22:48:48] smathy: hello9, show code.
[22:49:03] apeiros: then it'd be because of whatever code you have. ruby doesn't do that on its own.
[22:49:12] apeiros: so ^, show code
[22:49:56] jtoy: http://pastebin.com/, is this just creating a method named '<<'? What's the deal with returning self at the end?
[22:50:12] Ox0dea: jt__: Try again.
[22:50:14] smathy: jt__, that's the pastebin homepage.
[22:50:49] jtoy: err, sorry. Here http://pastebin.com/X9nQKc7Y
[22:50:50] ruby[bot]: jt__: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/1c80858db4c06370d556
[22:50:50] ruby[bot]: jt__: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[22:51:08] pawnbox: has joined #ruby
[22:51:08] smathy: Heh, it's a TRAP!
[22:51:15] solocshaw: has joined #ruby
[22:51:32] Ox0dea: jt__: Methods return the last evaluated expression; it explicitly returns `self` so that calls to #<< can be chained if so desired.
[22:51:33] apeiros: jt__: yes, that's creating a method named <<
[22:51:39] smathy: jt__, yes, just creating a method, returning self because that's what it wants to return.
[22:51:51] smathy: Wow, hive mind.
[22:52:10] smathy: apeiros, and me, you're on the outs.
[22:52:49] smathy: I didn't want to say anything, but it's your wanton mix of O and 0
[22:52:58] tAn: has joined #ruby
[22:53:13] pikajude: has joined #ruby
[22:53:13] pikajude: has joined #ruby
[22:53:25] voodo: has joined #ruby
[22:55:49] threh: has joined #ruby
[22:55:58] bkxd: has joined #ruby
[22:57:02] godzillaenlacasa: has joined #ruby
[22:57:27] solocshaw1: has joined #ruby
[22:58:30] shevy: come on people! hello9 and jt__ say something
[22:58:39] hello9: something
[22:59:12] Rixius|Alt: has joined #ruby
[22:59:13] hello9: apeiros, thanks, i kept exploring and *think* i found the issue
[22:59:33] Ox0dea: hello9: I'd like to know your findings; that's a very strange bug.
[22:59:46] hello9: its what apeiros said, in the code itself
[23:00:15] Ox0dea: The bug was in the code itself?!
[23:00:26] voodo: has joined #ruby
[23:01:20] RobertBirnie: has joined #ruby
[23:01:32] Azure: has joined #ruby
[23:02:00] shevy: we will never see any code :(
[23:02:23] mistermo_: has joined #ruby
[23:03:45] ur5us: has joined #ruby
[23:04:41] mistermo_: has joined #ruby
[23:05:02] smathy: ACTION doesn't think there was ever any code
[23:05:10] valetudo: has joined #ruby
[23:05:14] haylon_: has left #ruby: ("WeeChat 1.4")
[23:05:31] Ox0dea: https://www.youtube.com/watch?v=HSaqQUIs7CM
[23:06:16] CloCkWeRX: has joined #ruby
[23:06:26] barajasfab: has joined #ruby
[23:06:44] smathy: Only in IRC, blogs are all true.
[23:06:57] bronson: has joined #ruby
[23:07:07] Ox0dea: Twitter posts as well.
[23:07:39] apeiros: youtube comments are truth
[23:08:15] roshanavand: has joined #ruby
[23:08:25] LaT0rtue: has joined #ruby
[23:12:06] uglybandersnatch: has joined #ruby
[23:12:09] jackjackdripper: has joined #ruby
[23:12:45] ur5us: has joined #ruby
[23:13:00] allcentury: has joined #ruby
[23:13:29] stannard: has joined #ruby
[23:13:45] wreet: has joined #ruby
[23:14:28] wreet: has left #ruby: ()
[23:15:16] dextertzu: has joined #ruby
[23:15:28] kies: has joined #ruby
[23:16:59] uglybandersnatch: has joined #ruby
[23:17:14] yfeldblum: has joined #ruby
[23:17:51] yfeldblum: has joined #ruby
[23:20:49] pawnbox: has joined #ruby
[23:21:03] Suntzu: has joined #ruby
[23:24:14] roshanavand: has joined #ruby
[23:24:27] davedev24: has joined #ruby
[23:24:48] pocketprotector: has joined #ruby
[23:26:28] millerti: has joined #ruby
[23:26:45] Azure|dc: has joined #ruby
[23:28:59] freerobby: has joined #ruby
[23:30:26] ruby[bot]: -bb $a:DikshitNijjer$#ruby-banned DikshitNijjer!*@*$#ruby-banned
[23:33:00] ellisTAA: has joined #ruby
[23:33:11] ellisTAA: i feel like this code smells … https://gist.github.com/ellismarte/07e727ebf56b57ebce5b
[23:33:16] kam270: has joined #ruby
[23:33:26] Ox0dea: 1 isn't prime.
[23:33:45] shevy: seems a bit verbose
[23:33:46] DLSteve: has joined #ruby
[23:33:58] roshanavand: has joined #ruby
[23:34:47] apeiros: ellistaa: I suppose `require 'prime'` is verboten?
[23:35:11] shevy: alert! german word!
[23:35:17] ellisTAA: Ox0dea: oh yeah
[23:35:20] shevy: call the Kindergarten cops!
[23:39:40] Ox0dea: ellistaa: I quite like this approach: https://eval.in/543676
[23:40:29] Ox0dea: Leave off the explicit check for 3; start your counter there instead and increment by 2.
[23:40:38] ellisTAA: yeah thats a good point
[23:42:15] baweaver: has joined #ruby
[23:45:49] CloCkWeRX: has joined #ruby
[23:46:00] Ropeney: has joined #ruby
[23:46:26] blackmesa: has joined #ruby
[23:46:34] ivanskie: has joined #ruby
[23:48:21] neanderslob_: has joined #ruby
[23:50:49] yfeldblum: has joined #ruby
[23:51:30] ur5us: has joined #ruby
[23:51:48] ur5us: has joined #ruby
[23:53:40] x77686d: has joined #ruby
[23:54:31] LaT0rtue: has joined #ruby
[23:57:23] hotpancakes: has joined #ruby
[23:57:38] straying: has joined #ruby
[23:59:14] hotpanca_: has joined #ruby
[23:59:50] sp4rrow: has joined #ruby
[23:59:58] stannard: has joined #ruby