« Back to channel list

#ruby - 30 May 2016

« Back 1 day Forward 1 day »
[00:00:09] mattwashere: has joined #ruby
[00:02:57] tristanp: has joined #ruby
[00:03:49] Ropeney: has joined #ruby
[00:04:22] Radar: von-strauss: There's only one Rails book you need: Rails 4 in Action.
[00:04:31] Radar: Written by an extremely smart, handsome and humble author.
[00:05:29] Arcaire: i thought Yehuda had nothing to do with that?
[00:05:36] Radar: Badumtish.
[00:05:40] Arcaire: :^))^)^)^)^))))
[00:08:01] tristanp_: has joined #ruby
[00:08:18] |meta: I'm glad Rails is still gaining new developers, will keep me very busy when I get paid to rewrite all of their garbage
[00:09:03] Radar: |meta: $250/hr to remove all Model.suppress calls from the app :D
[00:09:52] |meta: I'd rather remove the app. Someday when Crystal hits 1.0 I'll start my own consulting firm doing that
[00:09:55] tristanp: has joined #ruby
[00:10:55] Radar: Yeah because rewriting entire apps is a market just waiting to be cornered.
[00:11:06] Radar: ** <- forgot my sarcasterix. Have two.
[00:11:07] maletor2: has joined #ruby
[00:11:35] |meta: Twitter seemed to think so :^)
[00:11:52] tristanm_: has joined #ruby
[00:11:57] |meta: what do they know? those amateurs
[00:12:04] Arcaire: Twitter didn't have outside consultants come in and do the work.
[00:12:07] Arcaire: They hired Java developers.
[00:12:19] |meta: Well that's because I haven't started up yet.
[00:12:28] |meta: They can't get the best before he came
[00:12:31] |meta: came around
[00:14:10] Radar: ACTION <- also wat'ingm
[00:15:07] tristanp: has joined #ruby
[00:15:08] jeyraof: has joined #ruby
[00:16:19] |meta: Radar, that seems like the sort of thing that isn't uncommon for you
[00:16:40] Radar: |meta: Are we now having a |meta discussion?
[00:16:46] |meta: I was born meta
[00:16:55] Radar: "They can't get the best before he came" absolutely does not make any sense.
[00:17:05] |meta: I am the best
[00:17:08] Radar: Who is "they"? Who is "he"?
[00:17:51] |meta: My point is that companies are more than willing to rewrite huge components of infrastructure if you convince them it's worth it
[00:17:55] Radar: I don't think I want to continue this discussion.
[00:18:02] Radar: Just checked the logs and saw this streak of brilliance: http://logs.ryanbigg.com/ruby?date=2016-05-29#5753453
[00:18:19] |meta: I've read a lot of your logs
[00:18:19] tristanp: has joined #ruby
[00:18:50] |meta: I'm fairly certain you would *literally* cry or something if I shared my opinions on the worth of a conversation with you. I'll spare you the trauma
[00:19:24] Radar: !rude |meta
[00:19:25] ruby[bot]: +qqqq $a:|2701 |meta!*@* |2701!*@* *!*@gateway/web/irccloud.com/x-eobukwolqvrquxbo
[00:19:25] ruby[bot]: +q *!*@gateway/web/irccloud.com/x-tkorgsukilkydniy
[00:19:27] Radar: Don't need to.
[00:19:27] Arcaire: |meta: You will feel at home here: reddit.com/r/iamverysmart
[00:19:27] ruby[bot]: -qq slushdot!*@* Moonman420!*@*
[00:21:24] diegoaguilar: has joined #ruby
[00:21:55] der-landgraf: has joined #ruby
[00:22:32] nankyokusei: has joined #ruby
[00:22:34] jancel: has joined #ruby
[00:25:34] CloCkWeRX: has joined #ruby
[00:30:45] moon_man_420: has joined #ruby
[00:31:49] aupadhye: has joined #ruby
[00:32:21] karmatr0n: has joined #ruby
[00:32:59] aupadhye: has joined #ruby
[00:33:09] allcentury: has joined #ruby
[00:33:42] tristanp_: has joined #ruby
[00:34:08] arlek: has joined #ruby
[00:34:30] benzrf: |meta: loooooooooooooooooooool
[00:35:38] tristanm_: has joined #ruby
[00:35:57] gilfoyle: has joined #ruby
[00:36:10] sarkis: has joined #ruby
[00:36:41] sarkis: hey all - so what do you all use for production ruby apps? brightbox ruby repos?
[00:36:58] sarkis: we've been using rbenv - sick of compiling rubies during provisioning/upgrading to new version of ruby :9
[00:37:29] Xeago: has joined #ruby
[00:38:00] sarkis: curious how "prod ready" those brightbox debs ar
[00:38:32] tristanp: has joined #ruby
[00:40:45] ledestin: has joined #ruby
[00:43:40] tristanp_: has joined #ruby
[00:44:15] nando293921: has joined #ruby
[00:44:17] bob434: has joined #ruby
[00:45:20] nettoweb: has joined #ruby
[00:46:55] tristanp: has joined #ruby
[00:47:19] von-strauss: it costs way too much
[00:47:42] Nawn: try: https://www.railstutorial.org/book/frontmatter
[00:47:43] von-strauss: something tells me i shouldn't be developing on a debian distro
[00:47:49] von-strauss: Nawn, yeah i'm going to end up using this
[00:48:40] bob434: has joined #ruby
[00:48:43] shevy: you are still on debian!
[00:49:04] shevy: though, if you can get ruby to work, it should not be a huch hassle anymore really
[00:49:43] gilfoyle: has joined #ruby
[00:50:14] von-strauss: hayden@mint ~/new_project $ bin/rails server
[00:50:15] von-strauss: bash: bin/rails: No such file or directory
[00:50:43] von-strauss: ruby works fine in general but can't get rails to work. what distro do you recommend?
[00:50:53] Nawn: I use ubuntu just fine :o
[00:51:40] von-strauss: hayden@mint ~ $ rails -v
[00:52:35] Radar: von-strauss: Yeah, so Rails 3.2.16 didn't have a bin/rails directory.
[00:52:36] Nawn: Why not use 4.x.x?
[00:52:52] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[00:52:57] ruby[bot]: von-strauss: I don't know anything about sorry
[00:56:39] ssiris: has joined #ruby
[00:58:36] dhk: has joined #ruby
[00:58:42] Nawn: woops, wrong buffer haha
[01:07:02] WebDawg: has joined #ruby
[01:08:40] dhk: has joined #ruby
[01:10:34] smathy: has joined #ruby
[01:11:55] maletor2: has joined #ruby
[01:15:02] roamingdog: has joined #ruby
[01:15:41] Ebok: has joined #ruby
[01:15:44] Rodya_: has joined #ruby
[01:19:41] ruby[bot]: -qqqq $a:|2701 |meta!*@* |2701!*@* *!*@gateway/web/irccloud.com/x-eobukwolqvrquxbo
[01:19:41] ruby[bot]: -q *!*@gateway/web/irccloud.com/x-tkorgsukilkydniy
[01:22:37] tristanp: has joined #ruby
[01:24:36] Yzguy: has joined #ruby
[01:25:28] tristanp_: has joined #ruby
[01:25:41] wetriner: has joined #ruby
[01:28:25] RegulationD: has joined #ruby
[01:28:39] tristanp: has joined #ruby
[01:30:22] bravowhiskey: has joined #ruby
[01:31:56] tristanp_: has joined #ruby
[01:33:13] karmatr0n: has joined #ruby
[01:34:12] tristanp: has joined #ruby
[01:34:43] ramfjord: has joined #ruby
[01:35:51] Yiota: has joined #ruby
[01:38:03] sdothum: has joined #ruby
[01:41:50] shakes: has joined #ruby
[01:46:15] duckpuppy: has joined #ruby
[01:46:21] tmtwd: has joined #ruby
[01:47:25] dar123: has joined #ruby
[01:50:53] mattwashere: has joined #ruby
[01:51:40] nettoweb: has joined #ruby
[01:51:48] Devalo: has joined #ruby
[01:52:27] m_antis: has joined #ruby
[01:55:21] tristanp_: has joined #ruby
[01:56:28] konsolebox: has joined #ruby
[01:57:34] tristanm_: has joined #ruby
[01:58:19] allcentury: has joined #ruby
[01:58:27] konsolebox: has joined #ruby
[01:59:07] mjuszczak: has joined #ruby
[01:59:56] mjuszczak: has joined #ruby
[02:00:00] wetriner: has left #ruby: ("Leaving")
[02:00:47] tristanp: has joined #ruby
[02:02:54] tristanp_: has joined #ruby
[02:03:24] paradisaeidae_: has joined #ruby
[02:09:43] lightt: has joined #ruby
[02:11:30] paradisaeidae_: So I've moved my previous ~/.e dir aside, new one is created on login, same issue with sound.
[02:11:52] paradisaeidae_: So must be a pulse config?
[02:12:40] maletor2: has joined #ruby
[02:12:48] mattwashere: has joined #ruby
[02:13:05] arlek: has joined #ruby
[02:13:31] lightt: im new to programming should i learn Ruby first or Python
[02:13:43] lightt: or both at once
[02:14:36] paradisaeidae_: good question...
[02:15:35] paradisaeidae_: For the log term, reading your own code in Ruby is more bearable than any previous language I've used.
[02:15:55] paradisaeidae_: ... I've used around twenty by now.
[02:16:43] paradisaeidae_: SO I stick to it, not exposed myself to much python.
[02:17:06] paradisaeidae_: Though when I have to read some python, usually it's understandable.
[02:17:19] lightt: thanks for your answer
[02:17:29] magikid: has joined #ruby
[02:19:26] Madplatypus: has joined #ruby
[02:22:25] tristanp: has joined #ruby
[02:22:45] phredus__: has joined #ruby
[02:22:59] mattwashere: has joined #ruby
[02:23:23] nankyokusei: has joined #ruby
[02:27:14] tvon: has joined #ruby
[02:30:21] Yzguy: has joined #ruby
[02:32:26] threh: has joined #ruby
[02:33:08] tristanp: has joined #ruby
[02:34:12] karmatr0n: has joined #ruby
[02:41:02] Es0teric: has joined #ruby
[02:44:36] paradisaeidae: has joined #ruby
[02:45:45] M570: has joined #ruby
[02:50:57] tristanp: has joined #ruby
[02:51:45] jaguarmagenta: has joined #ruby
[02:55:45] hutch34: has joined #ruby
[02:56:23] Nawn: has joined #ruby
[02:57:44] jaiks1: has joined #ruby
[03:00:02] allcentury: has joined #ruby
[03:00:41] wnd_: has joined #ruby
[03:02:08] tristanp_: has joined #ruby
[03:02:18] roamingdog: has joined #ruby
[03:03:12] Alazoral: has joined #ruby
[03:05:19] roamingdog: has joined #ruby
[03:05:32] arooni: has joined #ruby
[03:06:25] arooni: hey anyone here use rvm with fish ? i'm having trouble getting it installed correctly i keep seeing, "Warning! PATH is not properly set up, '/home/david/.rvm/gems/ruby-2.3.0/bin' is not at first place" ... even though ive installed fish functions as instructed
[03:06:41] tristanp: has joined #ruby
[03:06:46] sarkis: lightt: generally you will get more help with ruby and there are more resources imo
[03:07:03] sarkis: i've used both languages now and prefer ruby ... whereas earlier in my career preferred python
[03:07:28] sarkis: can't go wrong with either though.. both great first options
[03:10:06] tristanp_: has joined #ruby
[03:11:15] arescorpio: has joined #ruby
[03:12:55] braincrash: has joined #ruby
[03:13:27] maletor2: has joined #ruby
[03:14:36] robbyoconnor: has joined #ruby
[03:16:47] Vingador: has joined #ruby
[03:20:56] k3rn31: has joined #ruby
[03:24:10] aries_liuxueyang: has joined #ruby
[03:27:11] nettoweb: has joined #ruby
[03:32:12] lxsameer: has joined #ruby
[03:34:08] jenrzzz: has joined #ruby
[03:35:56] bob434: has joined #ruby
[03:36:57] mloy: has joined #ruby
[03:38:09] safe: has joined #ruby
[03:38:38] allcentury: has joined #ruby
[03:39:09] northfurr: has joined #ruby
[03:39:53] roamingdog: has joined #ruby
[03:41:30] tie: has joined #ruby
[03:41:35] paradisaeidae: has joined #ruby
[03:42:01] tie: is there a binary to string and string to binary call in ruby?
[03:42:22] jancel: has joined #ruby
[03:42:49] Yiota_: has joined #ruby
[03:43:31] dkam: has joined #ruby
[03:43:34] Arcaire: tie: .pack
[03:43:37] Arcaire: and .unpack
[03:44:00] tie: ill try it out. Thank you.
[03:45:33] tie: im guessing unpack it decimal to binary?
[03:45:47] Arcaire: It's the reverse of .pack.
[03:45:59] lictor36: has joined #ruby
[03:46:51] Arcaire: >> [1000001].pack('C')
[03:46:52] ruby[bot]: Arcaire: # => "A" (https://eval.in/579053)
[03:46:57] duckpuppy: has joined #ruby
[03:47:14] Arcaire: >> "A".unpack('B*')
[03:47:15] ruby[bot]: Arcaire: # => ["01000001"] (https://eval.in/579054)
[03:48:05] tristanp: has joined #ruby
[03:48:15] tie: im trying to go from '3' -> '11' and '11' -> 3
[03:49:25] Arcaire: >> 3.to_s(2)
[03:49:26] ruby[bot]: Arcaire: # => "11" (https://eval.in/579055)
[03:49:26] baweaver: >> '3'.to_i(2)
[03:49:27] ruby[bot]: baweaver: # => 0 (https://eval.in/579056)
[03:49:32] baweaver: freaking ninjas
[03:49:40] Arcaire: >> "11".to_i(10)
[03:49:41] ruby[bot]: Arcaire: # => 11 (https://eval.in/579057)
[03:49:51] Arcaire: >> "11".to_i(2)
[03:49:51] ruby[bot]: Arcaire: # => 3 (https://eval.in/579058)
[03:50:08] guardianJ: has joined #ruby
[03:50:21] tie: what is the number in the ()?
[03:50:41] Arcaire: So, 2 is binary (base 2), 8 would be octal (base 8).
[03:50:45] Arcaire: 16 would be hex.
[03:50:46] baweaver: ACTION spends too much time in JS
[03:50:54] Arcaire: >> 255.to_s(16)
[03:50:55] ruby[bot]: Arcaire: # => "ff" (https://eval.in/579059)
[03:51:02] domgetter: And of course, the default is 10
[03:51:09] tie: Thanks!
[03:51:21] baweaver: Glad we could tie things up for you
[03:52:28] e4xit_: has joined #ruby
[03:52:30] nando293921: has joined #ruby
[03:53:01] Devalo: has joined #ruby
[03:53:48] tie: https://gist.github.com/anonymous/5a91c80a4080f44757e6b1974f5f98dd
[03:53:52] tristanp_: has joined #ruby
[03:53:58] tie: So what is the error in my thinking?
[03:54:11] tie: im trying to go from 4 -> 100
[03:54:43] Arcaire: Oh, don't use .pack
[03:54:46] Arcaire: in that cas
[03:54:54] Arcaire: that's for buffer sort of stuff
[03:55:01] Arcaire: I misinterpreted what you wanted, heh.
[03:55:16] tie: >.> running me around in circles i see
[03:55:29] rkazak: has joined #ruby
[03:55:49] tie: okay, so now im getting an output of 0
[03:56:00] tie: im wanting 100 in binary
[03:56:05] Arcaire: >> "4".to_i(2)
[03:56:06] ruby[bot]: Arcaire: # => 0 (https://eval.in/579060)
[03:56:19] Arcaire: >> 4.to_s(2)
[03:56:20] ruby[bot]: Arcaire: # => "100" (https://eval.in/579061)
[03:56:39] tie: your STILL trying to screw with me
[03:56:40] Arcaire: not really sure why the former one didn't work there tbh
[03:56:56] Arcaire: oh wait, ofc,
[03:57:00] Arcaire: so if you want to go string => string
[03:57:02] Arcaire: you'll have to go
[03:57:31] tristanp: has joined #ruby
[03:57:46] Arcaire: >> "4".to_i.to_is2)
[03:57:47] ruby[bot]: Arcaire: # => /tmp/execpad-8c6b4c63a9d6/source-8c6b4c63a9d6:2: syntax error, unexpected ')', expecting keyword_end ...check link for more (https://eval.in/579062)
[03:57:52] Arcaire: jesus christ whatever rubybot
[03:57:54] Arcaire: you know what i mean
[03:58:06] Arcaire: you could probably just do a formatted print or something
[03:58:19] Arcaire: but realistically i don't know the scope of your app so i'm just punching the dark here with what i see in that gist
[03:58:46] tie: im taking in a string of 8 1s and 0s and encrypting them
[03:58:52] ponga: has joined #ruby
[03:58:56] tie: all the while keeping them as strings
[03:58:58] bougyman: tie: well it's not a secret anymore
[03:59:38] mattwashere: has joined #ruby
[03:59:46] gix: has joined #ruby
[04:00:13] tie: Got it! thanks
[04:00:38] tie: Whats the command to check the current datatype?
[04:00:52] tie: Sorry, pampered by visual studio and c++
[04:01:31] Arcaire: >> "hi".class
[04:01:32] ruby[bot]: Arcaire: # => String (https://eval.in/579064)
[04:01:54] Arcaire: >> ["h", "i"].class
[04:01:55] ruby[bot]: Arcaire: # => Array (https://eval.in/579065)
[04:01:57] tie: Your just a wealth of knowledge. Your my new best friend.
[04:02:01] Sammichmaker: has joined #ruby
[04:02:13] Arcaire: >> ["h", "i"].each { |e| e.class }
[04:02:13] ruby[bot]: Arcaire: # => ["h", "i"] (https://eval.in/579066)
[04:02:20] Arcaire: lol forgot that it's one lines
[04:02:21] Radar: >> "hi".is_a?(String)
[04:02:22] ruby[bot]: Radar: # => true (https://eval.in/579067)
[04:03:24] hk238: has joined #ruby
[04:03:27] pawnbox: has joined #ruby
[04:03:53] tristanp: has joined #ruby
[04:04:47] xlegoman: has joined #ruby
[04:08:27] lightt: has joined #ruby
[04:08:59] kareeoleez: has joined #ruby
[04:10:54] pawnbox: has joined #ruby
[04:14:12] maletor2: has joined #ruby
[04:16:24] tristanp_: has joined #ruby
[04:17:04] dimasg: has joined #ruby
[04:18:05] YaknotiS: has joined #ruby
[04:19:49] tristanp: has joined #ruby
[04:22:43] jaguarma_: has joined #ruby
[04:24:12] tristanp_: has joined #ruby
[04:24:12] nankyokusei: has joined #ruby
[04:25:07] CorOne: has joined #ruby
[04:25:29] roamingdog: has joined #ruby
[04:27:13] northfurr: has joined #ruby
[04:28:42] tristanp: has joined #ruby
[04:29:14] Radar: I'm generating a CSV using CSV.generate, but it's a few hundred thousand lines of CSV data so that leads to memory bloat. Is there a recommended way to kind of write this file in chunks?
[04:30:00] Radar: Maybe CSV.open might be what I want.
[04:31:02] k3rn31: has joined #ruby
[04:31:03] tristanp_: has joined #ruby
[04:31:27] Arcaire: Radar: probably open with append mode, write in 4096kb chunks
[04:31:54] Sammichmaker: has joined #ruby
[04:31:59] JoshGlzBrk: has joined #ruby
[04:32:16] Arcaire: i guess that depends on the length of each line tho actually, pick a number :^)
[04:32:27] Arcaire: does it really matter though? it'll be gc'd after a couple seconds
[04:32:36] karmatr0n: has joined #ruby
[04:32:43] tax: has joined #ruby
[04:33:24] Arcaire: oh neat i just found a typo in the ruby docs while looking at this
[04:33:28] ramfjord: has joined #ruby
[04:35:06] pawnbox: has joined #ruby
[04:38:15] d0lph1n98: has joined #ruby
[04:39:35] mikecmpbll: has joined #ruby
[04:40:08] allcentury: has joined #ruby
[04:42:07] Devalo: has joined #ruby
[04:44:42] bob434: has joined #ruby
[04:47:47] dar123: has joined #ruby
[04:48:19] roamingdog: has joined #ruby
[04:48:54] tie: has joined #ruby
[04:53:41] nando293921: has joined #ruby
[04:54:06] armyriad: has joined #ruby
[04:54:28] tie: Is there a limit to how many datamember function calls you can make on one line? like 'what = test[0].to_i.to_s(2)'
[04:56:03] Radar: no, you can chain as many as you like
[04:56:47] tie: Great, i know in Scheme theres a limit of 4-5 but i didnt know if my code had a bug or if it was a limit in the language.
[04:56:49] apeiros: you might be limited by your OS' max file size ;-p
[04:57:40] apeiros: now I actually wonder whether ruby has limits on method name size
[04:57:42] tie: Alright, if i need to .upcase.downcase.upcase 4.2 million times, im pretty sure the problem isnt with the code...
[05:00:55] apeiros: hm, seems to be the same as string-length, and since stringlength is a long, that limit is pretty high
[05:03:12] mleung: has joined #ruby
[05:03:27] tildes: has joined #ruby
[05:03:40] Arcaire: upon trying, i've crashed my text editor
[05:05:28] tie: I beginner Ruby programmer has broken Ruby. I feel pretty accomplished.
[05:06:50] roamingdog: has joined #ruby
[05:07:20] tristanp: has joined #ruby
[05:08:00] apeiros: Arcaire: achievement unlocked? :D
[05:08:10] apeiros: ACTION off now, bye :)
[05:08:10] Arcaire: apeiros: it also crashed nano, and vim is struggling
[05:09:14] tie: test = "10"
[05:09:14] tie: print test.to_i.to_s(10)
[05:09:49] tie: I'm tying to convert 10 (binary) to '2' decimal. But its converting it to 10. What would you recommend I change?
[05:09:52] Arcaire: λ ruby x.rb
[05:09:53] Arcaire: x.rb: stack level too deep (SystemStackError)
[05:10:25] Arcaire: >> "10".to_i(2)
[05:10:26] ruby[bot]: Arcaire: # => 2 (https://eval.in/579071)
[05:10:32] Arcaire: You keep the base the same.
[05:10:50] tie: Sweet, thanks.
[05:11:26] thejamespinto_: has joined #ruby
[05:11:33] Cohedrin: has joined #ruby
[05:14:06] craigp: has joined #ruby
[05:15:02] maletor2: has joined #ruby
[05:15:34] tristanp: has joined #ruby
[05:17:08] slackbotgz: has joined #ruby
[05:21:24] Devalo: has joined #ruby
[05:24:11] bob434: has joined #ruby
[05:24:55] roamingdog: has joined #ruby
[05:27:18] ur5us: has joined #ruby
[05:27:32] threh: has joined #ruby
[05:29:20] tmtwd: has joined #ruby
[05:29:54] RegulationD: has joined #ruby
[05:30:01] tie: I'm starting to love Ruby more and more. I used C++ for 6 months and the algorithm i wrote took 226 lines and 2 days to write. In four hours I've been able to write the same algorithm in Ruby in 108 lines...
[05:30:10] tie: Go functional languages :3
[05:30:14] Akagi201: has joined #ruby
[05:30:40] tie: I've only been doing ruby for 13 hours.
[05:31:10] jancel: has joined #ruby
[05:33:29] karmatr0n: has joined #ruby
[05:35:25] pawnbox_: has joined #ruby
[05:43:08] tristanp: has joined #ruby
[05:44:11] gilfoyle: has joined #ruby
[05:44:33] northfurr: has joined #ruby
[05:47:42] duckpuppy: has joined #ruby
[05:47:46] tristanp_: has joined #ruby
[05:47:56] duncannz: has joined #ruby
[05:48:48] moeabdol: has joined #ruby
[05:52:22] ur5us: has joined #ruby
[05:54:18] last_staff: has joined #ruby
[05:55:46] tAn: has joined #ruby
[05:56:24] tAn: has joined #ruby
[05:56:37] aufi: has joined #ruby
[05:58:27] djbkd: has joined #ruby
[06:00:22] dionysus69: has joined #ruby
[06:00:32] M570`: has joined #ruby
[06:02:27] ur5us: has joined #ruby
[06:05:23] aganov: has joined #ruby
[06:05:57] kareeoleez: has joined #ruby
[06:09:00] kareeoleez: has joined #ruby
[06:09:07] Macaveli: has joined #ruby
[06:09:59] n1x-nz: has joined #ruby
[06:11:57] allcentury: has joined #ruby
[06:12:43] goeast: has joined #ruby
[06:13:25] k0n: has joined #ruby
[06:13:33] k0n: how do we view the channel's owner?
[06:14:15] tristanp: has joined #ruby
[06:14:32] jhass: k0n: /msg ChanServ ACCESS #channel LIST
[06:14:48] jhass: what's the matter?
[06:15:42] k0n: thank you jhass
[06:15:49] maletor2: has joined #ruby
[06:16:28] tristanp_: has joined #ruby
[06:18:22] Radar: You saw nothing.
[06:18:53] k0n: i don't like that there are founders that are mean
[06:18:57] tristanm_: has joined #ruby
[06:19:18] jhass: in #ruby?
[06:19:36] k0n: no in #css
[06:19:44] k0n: you guys seem nice
[06:19:44] agit0: has joined #ruby
[06:19:47] jhass: ?offtopic ;)
[06:19:47] ruby[bot]: jhass: I don't see no ;), whom should I tell about offtopic?
[06:19:52] Arcaire: i was gonna say
[06:19:55] jhass: ?offtopic
[06:19:55] ruby[bot]: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[06:20:00] Arcaire: #ruby is almost as safe a space as #node
[06:20:42] k0n: what is a good route for a self-taught rubyist
[06:20:53] k0n: in terms of being able to find a job without a college education
[06:20:58] k0n: and learning rub
[06:21:36] uncertainty: has joined #ruby
[06:22:08] tristanp: has joined #ruby
[06:22:18] solars: has joined #ruby
[06:23:16] roshanavand: has joined #ruby
[06:23:23] mikecmpbll: k0n : learn it, make some stuff that demonstrates to employers you're proficient.
[06:23:39] k0n: what kind of stuff should you make?
[06:24:00] Arcaire: Things you're interested in.
[06:24:02] mikecmpbll: whatever takes your fancy, go wild.
[06:24:08] Arcaire: I'm building a GitHub clone for BitKeeper, for instance.
[06:24:31] mikecmpbll: i like horse racing, so i made a system that predicts winners of horse races.
[06:24:38] Contigi: has joined #ruby
[06:24:40] Arcaire: Does it use LSTM?
[06:24:54] mikecmpbll: 'fraid not :)
[06:24:56] Arcaire: or any other form of neural network, but LSTM would be the best for such discrete data
[06:25:06] nankyokusei: has joined #ruby
[06:25:31] mikecmpbll: no neural network at all, atm.
[06:27:03] tristanp_: has joined #ruby
[06:27:09] fenre: has joined #ruby
[06:27:59] tax: has joined #ruby
[06:30:55] uncertainty: has joined #ruby
[06:31:35] tristanp: has joined #ruby
[06:32:04] dkam: has joined #ruby
[06:32:37] raeoks: has joined #ruby
[06:32:53] fenre: has joined #ruby
[06:33:25] grassass: has joined #ruby
[06:34:04] tristanp_: has joined #ruby
[06:34:23] karmatr0n: has joined #ruby
[06:37:15] tildes: has joined #ruby
[06:40:02] dionysus69: has joined #ruby
[06:41:19] User458764: has joined #ruby
[06:46:40] Hanmac: mikecmpbll: wait until your system does tell you the wrong horses and then does use your money to bet on the right ones ;P
[06:47:11] codecop: has joined #ruby
[06:48:50] norc: has joined #ruby
[06:51:57] andikr: has joined #ruby
[06:53:44] d0lph1n98: has joined #ruby
[06:53:45] tristanp: has joined #ruby
[06:54:12] isxek: has joined #ruby
[06:59:01] tristanp_: has joined #ruby
[07:01:34] gagrio: has joined #ruby
[07:02:06] Omni: has joined #ruby
[07:02:55] mikecmpbll: has joined #ruby
[07:02:55] tristanp: has joined #ruby
[07:03:06] anisha: has joined #ruby
[07:04:59] uncertainty: has joined #ruby
[07:05:22] tristanp: has joined #ruby
[07:05:27] Akagi201_: has joined #ruby
[07:06:16] c0mrad3: has joined #ruby
[07:07:56] dkam: has joined #ruby
[07:10:07] avelldiroll: has joined #ruby
[07:10:37] dling`: has joined #ruby
[07:12:04] roamingdog: has joined #ruby
[07:14:03] okdas: has joined #ruby
[07:14:03] okdas: has joined #ruby
[07:14:03] twistedpixels: has joined #ruby
[07:14:04] twistedpixels: has joined #ruby
[07:14:35] Ariadeno: has joined #ruby
[07:14:43] z0id: has left #ruby: ("Leaving")
[07:15:42] chridal: has joined #ruby
[07:15:49] veloutin: has joined #ruby
[07:16:32] maletor2: has joined #ruby
[07:17:12] solars: has joined #ruby
[07:18:15] skade: has joined #ruby
[07:18:52] lxsameer: has joined #ruby
[07:19:24] ur5us: has joined #ruby
[07:21:06] mikecmpbll: has joined #ruby
[07:23:53] edwinvdgraaf: has joined #ruby
[07:25:04] User458764: has joined #ruby
[07:25:20] Ishido: has joined #ruby
[07:26:03] okdas: has joined #ruby
[07:26:03] okdas: has joined #ruby
[07:26:21] Ariadeno_: has joined #ruby
[07:27:15] eGGshke: has joined #ruby
[07:29:37] troulouliou_div2: has joined #ruby
[07:33:00] joonty: has joined #ruby
[07:33:27] LoneHermit: has joined #ruby
[07:33:40] tristanp: has joined #ruby
[07:35:17] karmatr0n: has joined #ruby
[07:36:30] the_drow: has joined #ruby
[07:37:10] uncertainty: has joined #ruby
[07:38:52] TvL2386: has joined #ruby
[07:40:10] last_staff: has joined #ruby
[07:41:31] n1x-nz: has joined #ruby
[07:42:52] pen: has joined #ruby
[07:43:44] dkam: has joined #ruby
[07:43:52] skade: has joined #ruby
[07:43:53] terlar: has joined #ruby
[07:44:33] r0bby_: has joined #ruby
[07:45:18] r0bby_: has joined #ruby
[07:47:19] antgel: has joined #ruby
[07:48:29] duckpuppy: has joined #ruby
[07:49:07] mrmortondk: has joined #ruby
[07:49:18] crdpink2: has joined #ruby
[07:50:26] TomyWork: has joined #ruby
[07:50:44] hfp: has joined #ruby
[07:51:09] cfillion: has joined #ruby
[07:51:40] creat: has joined #ruby
[07:52:55] watersoul: has joined #ruby
[07:55:45] neanderslob: has joined #ruby
[07:56:23] johnny56: has joined #ruby
[07:56:30] bigkevmcd: has joined #ruby
[07:57:08] saltsa: has joined #ruby
[07:57:10] galeido: has joined #ruby
[07:57:44] jaruga___: has joined #ruby
[07:58:07] jnoob22: has joined #ruby
[08:00:16] thejamespinto: has joined #ruby
[08:00:34] firstdayonthejob: has joined #ruby
[08:01:23] hightower3: has joined #ruby
[08:03:30] skakri: has joined #ruby
[08:07:28] ocbtec: has joined #ruby
[08:08:21] tristanp: has joined #ruby
[08:11:18] gilfoyle: has joined #ruby
[08:11:44] mark_66: has joined #ruby
[08:12:13] biox: has joined #ruby
[08:12:48] roamingdog: has joined #ruby
[08:13:07] vondruch: has joined #ruby
[08:13:45] allcentury: has joined #ruby
[08:13:57] johnny56: has joined #ruby
[08:16:16] dkam: has joined #ruby
[08:17:18] maletor2: has joined #ruby
[08:20:49] sluukkonen: has joined #ruby
[08:25:13] eGGshke: has joined #ruby
[08:25:58] nankyokusei: has joined #ruby
[08:26:38] einarj: has joined #ruby
[08:28:18] uncertainty: has joined #ruby
[08:28:26] marr: has joined #ruby
[08:29:22] Tempesta: has joined #ruby
[08:30:39] Ropeney: has joined #ruby
[08:30:54] CloCkWeRX: has joined #ruby
[08:32:16] pawnbox: has joined #ruby
[08:32:38] joonty: has joined #ruby
[08:36:12] karmatr0n: has joined #ruby
[08:37:18] jaguarmagenta: has joined #ruby
[08:37:47] sarkis: has joined #ruby
[08:38:59] syngularity: has joined #ruby
[08:40:35] antgel: has joined #ruby
[08:41:29] maladr0it: has joined #ruby
[08:41:58] snowy: has joined #ruby
[08:42:00] Mia: has joined #ruby
[08:42:00] Mia: has joined #ruby
[08:42:09] maladr0it: i have my first ever technical interview next week. i have to refactor some 'basic' ruby code. Any advice on where to get some practice in?
[08:43:14] shevy: write lots and lots of code yourself
[08:44:31] tristanp_: has joined #ruby
[08:44:54] jhass: maladr0it: excercism.io codewars.com, idle here and help folk out
[08:45:44] maladr0it: thanks so much, exercism looks good
[08:49:04] skade: has joined #ruby
[08:51:40] tristanp: has joined #ruby
[08:54:22] lsmola_: has joined #ruby
[08:55:41] anisha: has joined #ruby
[08:59:12] phatypus: has joined #ruby
[09:00:50] CloCkWeRX: has joined #ruby
[09:00:50] thejamespinto: has joined #ruby
[09:01:13] gilfoyle: has joined #ruby
[09:01:23] senayar: has joined #ruby
[09:02:36] anisha: has joined #ruby
[09:03:24] claudiuinberlin: has joined #ruby
[09:03:56] goeast: has joined #ruby
[09:03:57] etehtsea: has joined #ruby
[09:04:12] claudiuinberlin: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[09:07:05] Macaveli: has joined #ruby
[09:07:20] allcentury: has joined #ruby
[09:07:34] ur5us: has joined #ruby
[09:07:57] toretore: has joined #ruby
[09:12:41] yfeldblum: has joined #ruby
[09:12:43] pawnbox: has joined #ruby
[09:13:07] d0lph1n98: has joined #ruby
[09:13:21] digneety: has joined #ruby
[09:13:35] roamingdog: has joined #ruby
[09:14:27] CausaMortis: has joined #ruby
[09:14:57] craigp: has joined #ruby
[09:15:42] yfeldblum: has joined #ruby
[09:16:45] tier: has joined #ruby
[09:16:48] User458764: has joined #ruby
[09:18:05] maletor2: has joined #ruby
[09:21:36] maximilian: has joined #ruby
[09:21:49] LoneHermit: has joined #ruby
[09:22:38] weckl: has joined #ruby
[09:24:10] weckl: has joined #ruby
[09:24:24] joonty: has joined #ruby
[09:24:33] anisha: has joined #ruby
[09:25:08] weckl: has joined #ruby
[09:29:09] Vingador: has joined #ruby
[09:29:36] sash_: has joined #ruby
[09:30:04] tristanp_: has joined #ruby
[09:30:06] Gasher: has joined #ruby
[09:31:22] sash_: Hey everyone, I am working on an snmp monitoring script in ruby, and I try to use the snmp4em because it seems to have snmpbulkwalk implemented. I get a warning because of https://github.com/normelton/snmp4em/blob/master/lib/snmp4em/requests/snmp_bulkwalk_request.rb#L36. Can anyone explain, what this line tries to achieve? I am having trouble understanding it.
[09:31:24] RegulationD: has joined #ruby
[09:31:42] Couch: has joined #ruby
[09:31:57] sash_: EndOfMibView looks like this: https://paste.fedoraproject.org/372585/60070414/
[09:33:12] tristanp: has joined #ruby
[09:34:12] eGGshke: has joined #ruby
[09:34:57] tristanm_: has joined #ruby
[09:36:23] uncertainty: has joined #ruby
[09:36:42] blaxter: has joined #ruby
[09:36:50] toretore: sash_: what is the warning?
[09:37:05] karmatr0n: has joined #ruby
[09:37:35] sash_: toretore: Comparable#== will no more rescue exceptions of #<=> in the next release.
[09:38:03] sash_: toretore: and Return nil in #<=> if the comparison is inappropriate or avoid such comparison.
[09:38:12] jaruga___: has joined #ruby
[09:38:28] sarkis: has joined #ruby
[09:38:47] sash_: However, I am more interested in the line itself, it looks like dead code to me, because some tests I made always return false if I compare anything with a class like that.
[09:40:34] norc: sash_: Unless you use the class itself.
[09:40:41] norc: sash_: It's probably used as a poison token.
[09:40:56] lightt: has joined #ruby
[09:41:53] sash_: norc: Exactly, Test == Test is true. But how should response_vb.value ever become a ruby class definition?
[09:42:10] norc: sash_: not a class definition
[09:42:23] norc: sash_: SNMP::EndOfMibView is a constant pointing to an object of class Class.
[09:42:31] norc: Even classes are Objects.
[09:42:43] norc: >> Fixnum.is_a?(Object)
[09:42:44] ruby[bot]: norc: # => true (https://eval.in/579286)
[09:42:54] norc: >> Fixnum.class
[09:42:55] ruby[bot]: norc: # => Class (https://eval.in/579287)
[09:43:49] norc: sash_: I commonly use this in consumer/producer patterns. When my producer has no more work to do, it injects a StopToken into a shared queue, and my consumers pop from the queue until the object is a StopToken.
[09:44:11] goeast: has joined #ruby
[09:45:28] norc: sash_: the only things making classes special is that they have a class method ::new (Ruby provides this for you), which creates new objects of that kind. Other than that they are objects like anything else.
[09:45:31] braincra-: has joined #ruby
[09:45:53] norc: Well, there are some other subtle things. But for the sake of this lets assume that to be true.
[09:46:22] ICantCook: has joined #ruby
[09:46:23] czerasz: has joined #ruby
[09:46:59] norc: >> Foo = Class.new do def inialize(a); @a = a; end; attr_reader :a; end; puts Foo.new(1).a
[09:47:00] ruby[bot]: norc: # => wrong number of arguments (given 1, expected 0) (ArgumentError) ...check link for more (https://eval.in/579293)
[09:47:10] norc: >> Foo = Class.new do def initialize(a); @a = a; end; attr_reader :a; end; puts Foo.new(1).a
[09:47:11] ruby[bot]: norc: # => 1 ...check link for more (https://eval.in/579294)
[09:47:52] flughafen: has joined #ruby
[09:48:24] tvw: has joined #ruby
[09:48:58] uncertainty: has joined #ruby
[09:49:13] duckpuppy: has joined #ruby
[09:49:31] beilabs: has joined #ruby
[09:50:40] dtzuzu: has joined #ruby
[09:50:48] |ifei5good: has joined #ruby
[09:51:05] emilkarl: has joined #ruby
[09:52:01] czerasz: hi, what is the "Free heap slots" in the "Ruby VMs/Ruby heap size" NewRelic section? is that the number of objects freed by the GC?
[09:52:30] sash_: norc: I still don't get it, I think. Is EndOfMibView some kind of constant then?
[09:52:52] norc: sash_: Any variable name that starts with an upper case letter is a constant.
[09:53:05] norc: sash_: It may become more obvious when you look at how exceptions are commonly defined:
[09:53:15] norc: >> MyError = Class.new(StandardError)
[09:53:16] ruby[bot]: norc: # => MyError (https://eval.in/579297)
[09:53:30] howdoi: has joined #ruby
[09:53:32] norc: (You could also use the class keyword, but this is shorter and more obvious)
[09:54:48] norc: czerasz: It is the number of slots that are allocated on Rubys heap but not used.
[09:56:17] flughafen: hey shevy I hope you
[09:56:22] flughafen: don't need to fly anywhere
[09:56:40] czerasz: norc: thx, can ruby reuse this memory?
[09:56:57] norc: czerasz: Exactly.
[09:57:40] beilabs_: has joined #ruby
[09:57:46] bluOxigen: has joined #ruby
[09:58:25] czerasz: norc: what if this grows constantly? Does it indicate a memory leak?
[09:58:44] norc: czerasz: That would indicate a bug in Ruby.
[09:58:53] norc: Or might.
[09:59:30] norc: So from the perspective of the operating system it might be a memory leak.
[10:00:01] norc: (I do not understand the gc too well, so I am not sure what policy it uses to free memory back to the operating system)
[10:00:08] braincrash: has joined #ruby
[10:00:34] beilabs: has joined #ruby
[10:01:15] dkam_: has joined #ruby
[10:01:28] bmorrison: has joined #ruby
[10:01:41] mikecmpbll: has joined #ruby
[10:03:28] pawnbox: has joined #ruby
[10:07:39] c355E3B: has joined #ruby
[10:08:03] allcentury: has joined #ruby
[10:09:51] jhass: norc: I actually hate that style of defining exceptions, I disagree it's more obvious
[10:10:10] mdw: has joined #ruby
[10:10:43] jhass: czerasz: the GC will be conservative about freeing memory if your program has many spikes of actual usage
[10:13:02] bmorrison: has joined #ruby
[10:13:18] symm-: has joined #ruby
[10:13:56] emilkarl: has joined #ruby
[10:15:48] tristanp: has joined #ruby
[10:17:25] zapata: has joined #ruby
[10:18:24] tristanp_: has joined #ruby
[10:18:54] maletor2: has joined #ruby
[10:19:04] beilabs: has joined #ruby
[10:21:12] tristanp: has joined #ruby
[10:21:18] roamingdog: has joined #ruby
[10:24:35] norc: jhass: I just meant it would be more obvious to show that a class is just an object.
[10:25:19] last_staff: has joined #ruby
[10:25:46] digneety: has joined #ruby
[10:26:07] tristanm_: has joined #ruby
[10:26:50] braincra-: has joined #ruby
[10:26:51] nankyokusei: has joined #ruby
[10:30:31] ruby-lang227: has joined #ruby
[10:33:08] flopsec: has joined #ruby
[10:34:00] pajton: has joined #ruby
[10:35:07] CausaMortis: has joined #ruby
[10:36:24] ur5us: has joined #ruby
[10:36:48] nettoweb: has joined #ruby
[10:37:00] bob434: has joined #ruby
[10:38:04] karmatr0n: has joined #ruby
[10:38:06] jaguarmagenta: has joined #ruby
[10:39:15] sarkis: has joined #ruby
[10:42:00] pajton: has joined #ruby
[10:43:55] ruby-lang227: Hello, I've been learning Ruby as of late and I'm not entirely certain of my thinking. Could you say that .class can be run on any object and returns the name of the class from which the object was instantiated (so any ClassName.class == Class), whereas .superclass can only be called on objects that are also classes and it's directly related to class inheritance?
[10:44:02] bob434: has joined #ruby
[10:45:09] jyaworski: has joined #ruby
[10:45:13] zel: has joined #ruby
[10:45:38] illusionmedic: has joined #ruby
[10:46:06] pajton_: has joined #ruby
[10:47:36] pajton: has joined #ruby
[10:48:14] sdothum: has joined #ruby
[10:48:33] pajton: has joined #ruby
[10:48:34] uncertainty: has joined #ruby
[10:51:03] norc: ruby-lang227: #superclass is a method of Class, and can be called on any object of class Class.
[10:51:13] norc: Even the root of all objects:
[10:51:15] norc: >> BasicObject.superclass
[10:51:16] ruby[bot]: norc: # => nil (https://eval.in/579321)
[10:51:23] norc: Well classes.
[10:52:18] wmsuvd: has joined #ruby
[10:53:17] norc: ruby-lang227: And Object#class can be run on any Object that has Object in its ancestry (that excludes BasicObject/Delegator by the way)
[10:53:29] norc: >> BasicObject.new.class
[10:53:42] ruby[bot]: norc: # => undefined method `class' for #<BasicObject:0x41475cc0> (NoMethodError) ...check link for more (https://eval.in/579327)
[10:53:43] CloCkWeRX: has joined #ruby
[10:54:35] alxgsv: has joined #ruby
[10:55:26] d0lph1n98: has joined #ruby
[10:56:30] leitz: has joined #ruby
[10:56:47] ruby-lang227: norc: thank you, it makes sense
[10:57:06] digneety: has joined #ruby
[10:58:13] allcentury: has joined #ruby
[10:58:24] tristanp: has joined #ruby
[11:01:42] norc: ruby-lang227: But yeah. Ignoring a few corner cases what you said was correct.
[11:02:10] dimasg: has joined #ruby
[11:02:13] phredus: has joined #ruby
[11:03:20] thejamespinto: has joined #ruby
[11:04:04] tristanp: has joined #ruby
[11:06:36] rodfersou: has joined #ruby
[11:07:28] tlaxkit: has joined #ruby
[11:09:48] diegoaguilar: has joined #ruby
[11:10:31] leitz: Coffee hasn't kicked in, I'm missing the obvious. Why is the outfile only holding the one data bit? It should be cumulative between runs of the program. https://gist.github.com/LeamHall/bd396647c9c0455c19dffbbfa485ae51
[11:11:14] jhass: leitz: "w" -> "a"
[11:11:14] anisha: has joined #ruby
[11:12:02] kirun: has joined #ruby
[11:12:06] leitz: jhass, it's supposed to intake the entre file so that the "resume" hash can be updated. That's the theory, anyway.
[11:12:20] domgetter: leitz when you open a file in "w" aka 'write' mode, it overwrites the file
[11:12:30] jhass: https://gist.github.com/LeamHall/bd396647c9c0455c19dffbbfa485ae51#file-resume_data-rb-L40 ?
[11:12:47] jhass: also your File API usage is terrible
[11:13:07] jhass: use the block form of File.open or the class level File.read / File.write
[11:13:31] skade: has joined #ruby
[11:13:36] jhass: don't rescue the error of the file missing, check with File.exists? prior trying to read it
[11:15:12] aries_liuxueyang: has joined #ruby
[11:15:21] jhass: https://gist.github.com/LeamHall/bd396647c9c0455c19dffbbfa485ae51#file-resume_data-rb-L39 return value isn't used, so this just wastes a few cycles
[11:15:55] jhass: I strongly prefer {} over Hash.new, but that's style I guess
[11:16:16] leitz: jhass, line 38 is supposed to end with the resume_data file in a hash. When line 58 occurs it's supposed to write the updated resume hash into the file.
[11:16:53] leitz: jhass, as to style, I'm re-learning what little I knew. So there is a lot of room for improvement. FIrst, though, is making the program functional.
[11:17:00] jhass: line 58 only occurs if reading your file fails
[11:17:25] jhass: see my first point
[11:17:48] jhass: also it's commented in your gist
[11:17:56] leitz: Ah, sorry, lines 39, 40 were to test what was going on. I should have removed them from the gist before posting.
[11:18:12] User458764: has joined #ruby
[11:19:42] maletor2: has joined #ruby
[11:20:26] leitz: The logic should be: open the file into a hash. Add data to the hash. Overwrite the old file with the new hash.
[11:21:21] johnmilton: has joined #ruby
[11:22:41] jhass: >> require "json"; JSON.parse(File.open(__FILE__))
[11:22:42] ruby[bot]: jhass: # => no implicit conversion of File into String (TypeError) ...check link for more (https://eval.in/579352)
[11:23:07] jhass: leitz: if you would fix all my points it would work
[11:23:22] lightt: has joined #ruby
[11:23:34] jhass: sometimes style is necessary to discover issues and helps with correctness in the first place
[11:24:00] roamingdog: has joined #ruby
[11:24:05] alfiemax: has joined #ruby
[11:24:09] jhass: you've been bitten by your bad style plain rescue instead of checking preconditions
[11:24:23] mark_66: has joined #ruby
[11:25:25] leitz: jhass, the revisions tab just shows an entire "new" file.
[11:25:30] leitz: Which lines did you change?
[11:25:59] jhass: I didn't change anything
[11:26:05] jhass: I pointed out your issues here
[11:26:07] ruby[bot]: You can find a log of this channel at http://irclog.whitequark.org/ruby/
[11:28:49] leitz: Ah, fixed. For the nonce.
[11:29:56] pawnbox: has joined #ruby
[11:32:35] RegulationD: has joined #ruby
[11:33:43] tristanp: has joined #ruby
[11:33:50] millerti: has joined #ruby
[11:33:56] terlar: has joined #ruby
[11:34:14] senayar: has joined #ruby
[11:34:15] madgen: has joined #ruby
[11:38:18] AlexJakeGreen: has joined #ruby
[11:38:28] fenre: has joined #ruby
[11:38:59] karmatr0n: has joined #ruby
[11:40:02] sarkis: has joined #ruby
[11:40:16] tristanp_: has joined #ruby
[11:42:06] inukshuk_: has joined #ruby
[11:43:23] tristanp: has joined #ruby
[11:43:51] goeast: has joined #ruby
[11:44:21] chip_: has joined #ruby
[11:44:31] qba73: has joined #ruby
[11:45:10] beilabs: has joined #ruby
[11:45:45] ldnunes: has joined #ruby
[11:45:59] tristanp_: has joined #ruby
[11:48:13] bob434: has joined #ruby
[11:49:56] rodfersou: has joined #ruby
[11:50:00] duckpuppy: has joined #ruby
[11:51:05] beilabs: has joined #ruby
[11:51:24] senayar: has joined #ruby
[11:51:32] dtzuzu: has joined #ruby
[11:52:17] Noxilex: has joined #ruby
[11:52:24] bob434: has joined #ruby
[11:53:20] grios: has joined #ruby
[11:53:28] davedev24: has joined #ruby
[11:53:59] symm-: has joined #ruby
[11:54:34] joonty: has joined #ruby
[11:55:09] beilabs: has joined #ruby
[11:56:34] nettoweb: has joined #ruby
[11:56:37] rodferso1: has joined #ruby
[11:57:34] chridal: Is there a way to stub out something like `sh` in Ruby?
[11:57:35] Hanmac: has joined #ruby
[11:57:37] chridal: I'm trying to write a unit test for a function that runs `sh` to scp something from one server to the scripts directory
[11:57:50] chridal: But I don't want to actually fetch that file from the server in the tests
[11:58:08] chridal: I'd like to stub that out and write / return a separate file from the tests
[11:58:17] DoubleMalt: has joined #ruby
[11:58:41] nettoweb: has joined #ruby
[11:59:52] rodfersou: has joined #ruby
[12:00:52] beilabs: has joined #ruby
[12:04:16] tristanp: has joined #ruby
[12:04:32] thejamespinto: has joined #ruby
[12:05:37] jhass: chridal: Stub Kernel#` ?
[12:08:14] tristanp_: has joined #ruby
[12:09:34] norc: >> def `(a); p a; end; `abc`
[12:09:35] ruby[bot]: norc: # => "abc" ...check link for more (https://eval.in/579406)
[12:09:43] norc: That has got to be the most ugly hack in Ruby..
[12:10:12] hutch34: has joined #ruby
[12:10:13] tristanp: has joined #ruby
[12:10:29] norc: sexp>> `a`
[12:10:39] norc: lex>> `a`
[12:11:17] norc: ast>> `a`
[12:11:18] ruby[bot]: norc: I have parsed your code, the result is at https://eval.in/579409
[12:11:34] norc: Okay I have not thought of that..
[12:12:39] goeast: has joined #ruby
[12:12:42] User458764: Hi, you often need unique sequence of characters what is the best way to deal with thi, use timestamp?
[12:12:55] beilabs: has joined #ruby
[12:13:14] jhass: the best way depends on the specific usecase most of the time
[12:13:37] norc: User458764: For cryptographic needs I recommend university. For everything else it depends.
[12:13:39] tristanp_: has joined #ruby
[12:14:24] User458764: jhass I think so in my case it is for naming filenames
[12:16:01] jhass: that's still fairly general of a usecase
[12:16:43] bob434: has joined #ruby
[12:17:40] User458764: Another question about this sometimes sofware or web service creates temporary data like a temp file. Does the service takes care of uniqueness before creating the file or does it assume a random string will be enough to be unique?
[12:17:48] k3rn31: has joined #ruby
[12:18:04] |meta: has joined #ruby
[12:18:30] aries_liuxueyang: has joined #ruby
[12:19:40] bob434: has joined #ruby
[12:20:09] jhass: User458764: https://github.com/ruby/ruby/blob/trunk/lib/tempfile.rb#L131 -> https://github.com/ruby/ruby/blob/trunk/lib/tmpdir.rb#L134
[12:20:25] maletor2: has joined #ruby
[12:22:11] User458764: jhass ok nice answer
[12:25:38] camilasan: has joined #ruby
[12:27:42] nankyokusei: has joined #ruby
[12:27:46] alfiemax: has joined #ruby
[12:29:09] tknz: has joined #ruby
[12:33:47] futilegames: has joined #ruby
[12:34:23] Fernando-Basso: has joined #ruby
[12:35:03] d0nn1e: has joined #ruby
[12:35:58] k3rn31: has joined #ruby
[12:36:09] futilegames: has joined #ruby
[12:37:31] spudowiar: norc: wow, that hack actually looks beautiful, lol
[12:37:53] spudowiar: At least, unlike in #python, I wasn't just PM'd that this is a no lol zone
[12:38:19] tobiasvl: this is a lol zone
[12:39:01] jaguarmagenta: has joined #ruby
[12:39:52] karmatr0n: has joined #ruby
[12:41:54] norc: spudowiar: Have you actually looked at the lexer for this?
[12:42:04] norc: It gives a real headache.
[12:42:06] sarkis: has joined #ruby
[12:44:53] nerium: has joined #ruby
[12:46:27] Alazoral: has joined #ruby
[12:46:53] vondruch_: has joined #ruby
[12:49:12] CloCkWeRX: has joined #ruby
[12:49:30] tristanp: has joined #ruby
[12:49:31] Ropeney: has joined #ruby
[12:51:27] tristanm_: has joined #ruby
[12:52:23] Spami: has joined #ruby
[12:53:18] tristanp_: has joined #ruby
[12:53:22] tax: has joined #ruby
[12:55:49] tristanp: has joined #ruby
[12:57:06] digneety: has joined #ruby
[12:57:23] slackbotgz: has joined #ruby
[12:57:47] tristanm_: has joined #ruby
[12:58:14] fenre: has joined #ruby
[13:00:17] jackjackdripper: has joined #ruby
[13:01:44] mdw: has joined #ruby
[13:02:06] madgen: has joined #ruby
[13:03:46] mdw7: has joined #ruby
[13:03:54] roamingdog: has joined #ruby
[13:04:29] tristanp_: has joined #ruby
[13:04:30] ramortegui: has joined #ruby
[13:04:59] bob434: has joined #ruby
[13:05:08] thejamespinto: has joined #ruby
[13:10:16] gagrio: has joined #ruby
[13:12:08] jackjackdripper: has joined #ruby
[13:12:35] Guest38693: has joined #ruby
[13:13:13] bob434: has joined #ruby
[13:13:43] bkxd: has joined #ruby
[13:15:58] bob434: has joined #ruby
[13:16:20] karmatr0n: has joined #ruby
[13:17:19] bob434: has joined #ruby
[13:18:40] bob434: has joined #ruby
[13:19:16] eljimmy: has joined #ruby
[13:21:15] maletor2: has joined #ruby
[13:22:21] beilabs: has joined #ruby
[13:28:40] rkazak: has joined #ruby
[13:31:13] bob434: has joined #ruby
[13:32:46] tristanp: has joined #ruby
[13:33:04] mdw: has joined #ruby
[13:33:08] maloik: jhass you can shift click lines ;-)
[13:33:24] maloik: oh apologies, not the same file
[13:33:46] jhass: I knew but thanks anyway ;)
[13:34:07] Yiota: has joined #ruby
[13:34:45] tristanm_: has joined #ruby
[13:34:50] Yiota: has joined #ruby
[13:35:39] Yiota: has joined #ruby
[13:35:41] arlek: has joined #ruby
[13:36:38] Yiota: has joined #ruby
[13:37:29] prestorium: has joined #ruby
[13:37:35] cwenner: has joined #ruby
[13:37:53] tildes: chridal: you could write the function so, that the sh command is its default parameter, substituted by something else in your unit test. in another test, you could check the content of the default sh command
[13:38:08] tildes: chridal: actual stubbing options might depend on how you call sh in your program
[13:38:41] tildes: chridal: with regard to the return file, does the same function also return the file?
[13:39:05] mdw: has joined #ruby
[13:39:06] thejamespinto: has joined #ruby
[13:39:20] tristanp: has joined #ruby
[13:39:40] tildes: chridal: you might want to have file fetching in a separate method, there also giving the normal file path as the default parameter, substituted by your test file path, for the tests
[13:40:55] tildes: actually I have never seen a ruby program call sh to scp, now that I think about it :)
[13:41:15] tristanp_: has joined #ruby
[13:41:24] tildes: in any case, this is how you could write something unit-testish without executing the actual call
[13:42:17] vondruch: has joined #ruby
[13:42:52] sarkis: has joined #ruby
[13:43:23] antgel: has joined #ruby
[13:43:50] bob434: has joined #ruby
[13:45:03] croberts: has joined #ruby
[13:46:01] jackjackdripper1: has joined #ruby
[13:46:32] wojtodzio: has joined #ruby
[13:46:58] User458764: has joined #ruby
[13:48:30] goeast: Hello I have library.rb:32:in `add_song': undefined method `<<' for nil:NilClass (NoMethodError). I know why its because I need to use two different instances of Artist as equivalent hash keys and use eql? and hash appropriately.
[13:48:42] goeast: https://gist.github.com/anonymous/79dee1aae800de3da00e2d98f972d18e
[13:49:05] goeast: However I am not able to imlement the code
[13:49:10] goeast: *implement
[13:49:45] goeast: Can you give me a hint ?
[13:49:56] goeast: I found that http://stackoverflow.com/questions/1931604/whats-the-right-way-to-implement-equality-in-ruby
[13:50:23] goeast: but I still stucked
[13:50:52] duckpuppy: has joined #ruby
[13:51:26] Hates_: @goeast the array is nil that's why you can't push onto it
[13:51:45] tildes: goeast: I think add_song method should have a reference to the artist as well
[13:52:00] hutch34: has joined #ruby
[13:52:07] Hates_: goeast: the artist you are initializing the array with is not the same one you are trying to add to
[13:52:16] dtzuzu: has joined #ruby
[13:52:47] goeast: thank you tildes and Hates
[13:53:28] tildes: Library should not have attr_accessor :artist... assuming you want more than just one artist for the library?
[13:53:35] goeast: Hates : yes it why I need to say that it is equivalent
[13:54:00] ishe_ua: has joined #ruby
[13:54:16] Hates_: goeast: plus the method `add_song` needs to take an artist and a song
[13:55:59] bkxd: has joined #ruby
[13:56:12] edwinvdgraaf: has joined #ruby
[13:56:34] goeast: @Hates : iyou mean as a parameter ? def add_song(artist, song)
[13:56:45] Hates_: goeast: something like this https://gist.github.com/Hates/1dd6c5effba13287e99ca89caf48c108
[13:57:04] northfurr: has joined #ruby
[13:57:20] tildes: goeast: song should probably be a class of its own, and the song would have an artist member
[13:57:25] Kedare: has joined #ruby
[13:57:42] Hates_: yeah, plenty of small improvements like that should be made ^^
[13:58:08] tildes: goeast: you're new to ruby right? :)
[13:58:30] goeast: @tildes : yes
[13:58:54] goeast: I am doing it as an exercise
[13:59:24] tildes: goeast: small toy projects can be really useful
[14:00:03] bob434: has joined #ruby
[14:00:16] goeast: OK so I will do one class for song
[14:00:16] goeast: one class for artist
[14:00:29] terlar: has joined #ruby
[14:00:34] tildes: goeast: keep going. add some more object oriented programming on your reading / tutorial list
[14:00:37] goeast: the add song will that 2 parameters artist and song
[14:00:38] goeast: I will check my attr-accessor that I am using
[14:00:44] goeast: in the Library class
[14:01:32] goeast_: has joined #ruby
[14:02:52] stev: has joined #ruby
[14:03:09] goeast: I had a problem with my conection
[14:03:18] kaleido: has joined #ruby
[14:03:21] m_antis: has joined #ruby
[14:03:25] goeast: @tildes and @hates thank you very mich for your kind help
[14:03:28] steve: has joined #ruby
[14:03:33] goeast: I will try to improve my code first
[14:03:46] goeast: with your suggestion
[14:04:23] tildes: goeast: you're welcome. come back with the new version :)
[14:05:01] brendan-: has joined #ruby
[14:06:35] beilabs: has joined #ruby
[14:09:36] vikid: has joined #ruby
[14:11:46] sarbs: has joined #ruby
[14:13:45] workmad3: has joined #ruby
[14:14:01] dimasg: has joined #ruby
[14:14:05] etehtsea: has joined #ruby
[14:14:38] justapersona: has joined #ruby
[14:15:16] pawnbox: has joined #ruby
[14:15:27] pawnbox: has joined #ruby
[14:15:35] User458764: has joined #ruby
[14:16:26] k3rn31: has joined #ruby
[14:18:06] Oclair: has joined #ruby
[14:18:16] jhack: has joined #ruby
[14:19:53] SilverKey: has joined #ruby
[14:20:35] sepp2k: has joined #ruby
[14:22:02] maletor2: has joined #ruby
[14:22:21] tristanp: has joined #ruby
[14:25:14] Akagi201: has joined #ruby
[14:26:37] goeast: has joined #ruby
[14:27:10] SMackMyBitchUp: has joined #ruby
[14:27:35] ferr: has joined #ruby
[14:27:36] SilverKey: has joined #ruby
[14:28:32] nankyokusei: has joined #ruby
[14:28:36] symm-: has joined #ruby
[14:29:29] justapersona: has joined #ruby
[14:30:09] kriskropd: has joined #ruby
[14:30:48] thejamespinto_: has joined #ruby
[14:32:58] Alazoral: has joined #ruby
[14:33:39] nfk: has joined #ruby
[14:34:11] pawnbox: has joined #ruby
[14:35:59] tristanp_: has joined #ruby
[14:39:19] kgrz: has joined #ruby
[14:39:33] daguilaraguilar: has joined #ruby
[14:39:38] jaguarmagenta: has joined #ruby
[14:41:42] mdw: has joined #ruby
[14:44:16] chridal: tildes: Is there some other way I should be SCPing from Ruby besides using sh?
[14:44:37] chridal: The way I had written it now it first fetches the file, and then runs CSV.read on it, and returns the contents.
[14:45:01] chridal: But you basically think I should move the sh-scp into its own function, and just not unit test that function specifically?
[14:45:17] SilverKey: has joined #ruby
[14:45:27] tristanp: has joined #ruby
[14:45:28] chridal: And then just stub that function for the remaining functions?
[14:45:57] Fernando-Basso: has joined #ruby
[14:46:42] antgel: has joined #ruby
[14:47:24] scepticulous: has joined #ruby
[14:47:28] jhbs: has joined #ruby
[14:48:21] ocbtec: has joined #ruby
[14:50:24] tristanp: has joined #ruby
[14:50:44] mleung: has joined #ruby
[14:54:01] depesz: has joined #ruby
[14:54:05] Rodya_: has joined #ruby
[14:54:48] minimalism: has joined #ruby
[14:55:22] depesz: hi. I mightbe lacking some vocabulary to explain what I need, but let me show you simple example. Given this input: [["a", "b", "c", "d"], ["9", "8", "7"]], I would like to generate all 12 results: [a, 9], [a,8], [a,7], [b,9], ...
[14:55:58] depesz: but I need a way that will not require me to set specific number of loops inside - it should work with any number of elements in source arrays, on both levels
[14:56:01] madgen: depesz: that would be a cartesian product
[14:56:22] depesz: madgen: ok, how to get it? any ready function/method/class/gem?
[14:56:29] madgen: depesz: checkout Array#product
[14:56:39] madgen: depesz: it is built in in the Array class
[14:57:11] depesz: thank you, reading.
[14:57:30] rippa: has joined #ruby
[14:57:43] skade: has joined #ruby
[14:58:02] madgen: >> ["a","b","c","d"].product ["9", "8", "7"]
[14:58:14] depesz: ah, so i just "stack" products
[14:58:17] sarkis: has joined #ruby
[14:59:33] depesz: %w{a b c d}.product(%w{9 8 7}).product(%w{x y z}).product(%w{5 6 7 }).map(&:flatten)
[14:59:43] depesz: does this look sensible, or am i missing some easier thing?
[14:59:50] joonty: has joined #ruby
[15:00:54] depesz: ok. i think I got it, thank you :)
[15:00:57] jhass: I think you just changed your problem behind our back
[15:01:00] madgen: well, you can do [1,2,3].product([['x', 'y', 'z'],[5,6,7]])
[15:01:15] depesz: jhass: why? i mentioned, that number of elements/arrays is not fixed.
[15:01:21] Devalo: has joined #ruby
[15:01:22] eljimmy: has joined #ruby
[15:01:22] depesz: madgen: yeah. looks nicer.
[15:01:25] madgen: which is arguably more readable and less function calls to make, however asymptotic efficiency is similar
[15:01:49] madgen: depesz: you're very welcome
[15:02:04] roamingdog: has joined #ruby
[15:02:06] jhass: "any number of elements in the source array" != "any number of arrays"
[15:02:26] nocnoc: has joined #ruby
[15:02:49] depesz: jhass: "in source arrays, on both levels"
[15:03:32] nocnoc: I'm looking for a Gem or somthing that let me get thet content of a web as firefox lecture mode does
[15:04:18] jhass: you mean all text in the body?
[15:04:32] jhass: or some heuristics to find the "main content"
[15:04:48] nocnoc: the ttext in the body
[15:05:05] jhass: Nokogiri::HTML(html).css("body").text
[15:06:09] nocnoc: jhass great! :D
[15:06:38] edwinvdgraaf: has joined #ruby
[15:06:58] nando293921: has joined #ruby
[15:07:57] nando293921: has joined #ruby
[15:08:25] jhack: has joined #ruby
[15:11:37] Guest38693: has joined #ruby
[15:11:38] Guest24860: has joined #ruby
[15:11:52] tristanp: has joined #ruby
[15:13:42] tristanp_: has joined #ruby
[15:14:02] nocnoc: jhass: i get scripts an buttons
[15:14:06] nocnoc: even text :P
[15:14:28] jhass: well you said you want all of it
[15:14:49] pawnbox: has joined #ruby
[15:15:23] shevy: always take everything!
[15:15:35] tristanm_: has joined #ruby
[15:15:42] nocnoc: jaja, i only want text
[15:15:52] xkapastel: has joined #ruby
[15:16:28] jhass: the label of a button is text too
[15:17:27] arlek: has joined #ruby
[15:18:00] elementaru: has joined #ruby
[15:18:48] tristanp: has joined #ruby
[15:18:53] jancel: has joined #ruby
[15:19:56] elementaru: having troubles with threads
[15:20:29] jhass: that's normal
[15:20:38] tristanp_: has joined #ruby
[15:20:42] elementaru: :) good to hear
[15:20:58] dar123: has joined #ruby
[15:22:46] maletor2: has joined #ruby
[15:23:49] tristanp: has joined #ruby
[15:24:05] shevy: elementaru treat threads as an evil alien beast that tries to make you crazy
[15:24:19] madgen: has joined #ruby
[15:25:12] elementaru: I will try to have that in mind
[15:27:09] Yiota: has joined #ruby
[15:28:08] tristanm_: has joined #ruby
[15:28:15] Yiota: has joined #ruby
[15:28:57] nettoweb: has joined #ruby
[15:31:48] anisha: has joined #ruby
[15:32:25] Gasher: has joined #ruby
[15:32:42] northfurr: has joined #ruby
[15:33:09] eGGshke: has joined #ruby
[15:33:30] goeast: has joined #ruby
[15:35:34] TomyLobo: has joined #ruby
[15:35:51] chops_: has joined #ruby
[15:36:10] eljimmy: has joined #ruby
[15:36:17] SilverKey: has joined #ruby
[15:36:40] fedexo: has joined #ruby
[15:36:59] depesz_: has joined #ruby
[15:39:54] skade: has joined #ruby
[15:40:14] bluOxigen: has joined #ruby
[15:42:36] chouhoulis: has joined #ruby
[15:43:08] evidex: has joined #ruby
[15:43:59] sarkis: has joined #ruby
[15:45:00] Ropeney: has joined #ruby
[15:46:15] kareeoleez: has joined #ruby
[15:47:14] dar123: has joined #ruby
[15:47:14] northfurr: has joined #ruby
[15:47:18] mattwashere: has joined #ruby
[15:49:53] uncertainty: has joined #ruby
[15:50:37] B1n4r10: has joined #ruby
[15:51:31] duckpuppy: has joined #ruby
[15:52:12] dionysus69: has joined #ruby
[15:52:24] norc: has joined #ruby
[15:53:06] dtzuzu: has joined #ruby
[15:54:34] pietr0: has joined #ruby
[15:57:06] pandaant: has joined #ruby
[15:58:12] Ropeney: has joined #ruby
[15:59:02] fedexo: has joined #ruby
[15:59:13] Guest38693: has joined #ruby
[15:59:25] triangles: has joined #ruby
[16:03:03] tristanp: has joined #ruby
[16:04:16] elementaru: if someone could take a look.. the code is quite big, but all works fine except for listening which I don't quite get
[16:04:20] elementaru: http://pastebin.ca/3613937
[16:04:45] elementaru: shouldn't "listen" method run all the time?
[16:05:04] Cohedrin: has joined #ruby
[16:06:05] northfurr: has joined #ruby
[16:06:18] armyriad: has joined #ruby
[16:06:25] elementaru: and I think I got it, I'm not passing "client" most of the time
[16:08:19] ramfjord: has joined #ruby
[16:10:04] idefine: has joined #ruby
[16:10:08] moeabdol: has joined #ruby
[16:11:26] moeabdol1: has joined #ruby
[16:11:36] armyriad: has joined #ruby
[16:12:44] norc: elementaru, the idea of classes in Ruby is not that you create one class and stuff everything inside it, but split your program into parts.
[16:13:28] norc: elementaru, so you would have one class maybe dealing with connections, another class for cards, another class for the game engine.
[16:13:38] norc: Just to give you a rough idea.
[16:13:53] nankyokusei: has joined #ruby
[16:14:06] elementaru: I see your point
[16:14:12] pglombardo: has joined #ruby
[16:14:50] threh: has joined #ruby
[16:16:16] jhbs: An error occurred while installing sqlite3 (1.3.11), and Bundler cannot
[16:16:16] jhbs: continue.
[16:16:16] jhbs: Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.
[16:17:06] norc: jhbs, try installing the gem manually, that will give you the error message.
[16:17:19] nankyokusei: has joined #ruby
[16:17:24] norc: (Not sure whether Bundler actually writes its log somewhere, this is probably easier)
[16:18:42] Mia: has joined #ruby
[16:18:42] Mia: has joined #ruby
[16:19:03] norc: elementaru, also please try to use 2-space indentation - it is common enough in Ruby to ask everybody to follow that convention (for readability sakes)
[16:19:17] kriskropd: has joined #ruby
[16:19:22] elementaru: anyhow, I do not get actually. So I pass (client) to "listen" method in the "run" method, and there's a 'msg = client.gets.chomp' on the loop, so why doesn't it pick up the messages?
[16:19:48] elementaru: it only picks up the messages and does msg_all method, when other methods are waiting for user's input
[16:19:53] norc: elementaru, the difficulty in debugging this is a result from your program design. By not separating all your modules it is hard to tell what is doing what.
[16:20:08] norc: It would force anyone to understand the entire scope of your program first.
[16:20:21] Spami_: has joined #ruby
[16:20:34] tristanp_: has joined #ruby
[16:20:35] binaryplease1: has joined #ruby
[16:22:37] norc: elementaru, you could start by extracting all the code that defines the game engine (dealing with players and cards) into a separate class that does not know about network connections.
[16:22:47] norc: For example.
[16:23:26] elementaru: what is 2-space indentation btw? I should press space 2 times instead of tabbing?
[16:23:31] maletor2: has joined #ruby
[16:23:35] norc: elementaru, which editor are you using?
[16:23:45] tristanp: has joined #ruby
[16:24:07] norc: elementaru, go to Settings > Preferences > Tab Settings, set Tab Size to 2, and enable "Replace by space"
[16:25:51] SCHAAP137: has joined #ruby
[16:26:00] hutch34: has joined #ruby
[16:26:46] mattwashere: has joined #ruby
[16:26:49] tristanp_: has joined #ruby
[16:27:30] allcentury: has joined #ruby
[16:29:34] idefine: has joined #ruby
[16:30:52] tristanp: has joined #ruby
[16:32:45] nankyoku_: has joined #ruby
[16:33:05] mleung: has joined #ruby
[16:33:59] diegoaguilar: has joined #ruby
[16:35:06] jhbs: Errno Message
[16:35:08] jhbs: conftest.c:3:21: fatal error: sqlite3.h: No such file or directory
[16:35:20] norc: jhbs, gist the entire error message. Check the topic for a link on where.
[16:35:34] northfurr: has joined #ruby
[16:36:23] cgfbee: has joined #ruby
[16:36:28] norc: elementaru, also extract your client code (should be your listen method) into a separate class that you can test externally.
[16:36:28] imperator: has joined #ruby
[16:36:34] cfloare: has joined #ruby
[16:36:41] imperator: why does this fail? https://gist.github.com/djberg96/3cdbf3b32454064ff7f5d971bf150b56
[16:37:12] jancel: has joined #ruby
[16:37:22] norc: imperator, race condition perhaps?
[16:37:27] arlek: has joined #ruby
[16:37:54] ramfjord: has joined #ruby
[16:37:56] norc: imperator, there is no guarantee that the assignment is actually executed before your assertion. Or am I being silly here?
[16:38:23] imperator: norc, i think you're right. Adding a small sleep call to the setup worked
[16:38:39] norc: imperator, let's figure out how to solve it *properly* then.
[16:40:04] imperator: join the thread?
[16:40:23] pawnbox: has joined #ruby
[16:40:23] jaguarmagenta: has joined #ruby
[16:40:43] norc: imperator, sounds like an idea.
[16:40:53] vikaton: has joined #ruby
[16:41:31] norc: imperator, Not sure whether the thread is still alive enough to the point where you can use #key? though
[16:42:00] norc: imperator, do you have external code that relies on that key?
[16:42:34] imperator: does a thread have to be alive to retain its keys? irb would indicate no
[16:42:59] norc: imperator, I am not sure how that minitest is actually useful.
[16:43:46] norc: imperator, either you have some code that relies on that key being present (which needs some form of synchronization to communicate to the outside), or you have no business testing it from outside the thread.
[16:46:13] norc: imperator, testing whether a key is present *after* a thread has been joined is pointless because it tells you nothing about the state during the thread.
[16:46:19] thejamespinto: has joined #ruby
[16:46:23] dar123: has joined #ruby
[16:46:28] norc: So really. This makes no sense to me.
[16:46:46] hutch34: has joined #ruby
[16:46:48] imperator: norc, how would you test it?
[16:47:05] norc: imperator, test the behaviour of code.
[16:47:06] norc: Not internals.
[16:47:11] tristanp_: has joined #ruby
[16:47:22] norc: Whether something sets some key at some point cannot be of relevance to you, unless some code depends on it.
[16:47:33] norc: If some code depends on it, test it from *that* situatoin using the same synchronization methos.
[16:47:35] norc: *methods.
[16:48:11] jhbs: norc: i'll gist it thanks
[16:49:45] norc: imperator, and if you are testing your own thread implementation, test from inside your thread
[16:49:50] norc: Or synchronize it.
[16:50:21] jhbs: norc: https://gist.github.com/anonymous/41b58b979ff7c1378510d4844acceb37
[16:50:38] ocbtec: has joined #ruby
[16:50:59] norc: jhbs, google for the error message "sqlite3.h: No such file or directory"
[16:51:03] tristanp: has joined #ruby
[16:51:07] norc: You will find plenty of links helping you solve this. :)
[16:52:31] Rodya_: has joined #ruby
[16:52:54] maloik: has joined #ruby
[16:53:04] VeryBewitching: has joined #ruby
[16:53:17] CamCam2: has joined #ruby
[16:53:30] uncertainty: has joined #ruby
[16:54:42] shevy: jhbs ah you are von strauss with another nick!
[16:55:02] CamCam2: I thought I understood the ternary operator, but then I found this: `@status = status ? status[0...140] : status` which limits the length of status to 140. Can anyone explain to me how this works?
[16:55:34] CamCam2: In other words, if status is false, status = status?
[16:55:56] CamCam2: But when would status = false
[16:56:02] apeiros: and it could be shortened to: @status = status && status[0,140]
[16:56:12] jhass: CamCam2: false or nil
[16:56:30] idefine: has joined #ruby
[16:56:43] CamCam2: Makes sense. Gracias amigos!
[16:56:46] apeiros: it's "limit status to 140 chars, if it is present, else don't do anything"
[16:57:32] jhbs: i'm not a power user so i'm hesitant to apply the workaround i found
[16:57:56] jhbs: i'll do it and see where it takes me. hopefully not to some awful, horrible eighth circle of hell
[16:59:02] Guest38693: has joined #ruby
[16:59:05] joonty: has joined #ruby
[16:59:42] RegulationD: has joined #ruby
[16:59:59] joonty: has joined #ruby
[17:00:07] shevy: only if you would use a certain distribution
[17:00:55] gusrub: has joined #ruby
[17:01:35] tildes_: has joined #ruby
[17:02:41] symm-: has joined #ruby
[17:04:35] jhbs: so where do i go to get extconf.rb
[17:04:46] User458764: has joined #ruby
[17:05:17] symm-_: has joined #ruby
[17:05:17] Gasher: has joined #ruby
[17:05:21] yfeldblum: has joined #ruby
[17:06:11] yfeldblum: has joined #ruby
[17:07:53] QpQ4: has joined #ruby
[17:08:10] allcentury: has joined #ruby
[17:09:37] houhoulis: has joined #ruby
[17:11:38] skweek: has joined #ruby
[17:12:29] craigp: has joined #ruby
[17:14:06] tristanp_: has joined #ruby
[17:16:18] gopz: has joined #ruby
[17:17:11] cgfbee: has joined #ruby
[17:17:21] cfloare: has joined #ruby
[17:17:26] tristanp: has joined #ruby
[17:19:01] kareeole_: has joined #ruby
[17:19:43] gopz: Why would doing: "require './lib/arugula'" cause an error 'cannot load such file -- arugula/data_handler', but then doing "require './lib/arugula/data_handler'" produces no error. The only line in arugula.rb is "require 'aruguala/data_handler'
[17:20:06] aries_liuxueyang: has joined #ruby
[17:20:16] spider-mario: has joined #ruby
[17:20:29] Sammichmaker: has joined #ruby
[17:20:43] jhass: gopz: do ruby -Ilib arugula and require "arugula"
[17:21:01] jhass: later when your gem is installed lib will be added to the load path by rubygems
[17:21:22] tristanp: has joined #ruby
[17:22:00] gopz: jhass: ruby -Ilib arugula gives me No such file or directory -- arugula (LoadError)
[17:22:11] flughafen_: has joined #ruby
[17:22:21] jhass: gopz: arugula was meant to be whatever script you run
[17:23:03] gopz: I am just entering these commands in rib
[17:23:39] ramfjord: has joined #ruby
[17:24:03] symm-: has joined #ruby
[17:24:17] maletor2: has joined #ruby
[17:24:28] justapersona: has joined #ruby
[17:24:52] 7F1ABE0WR: has joined #ruby
[17:25:23] jhass: gopz: run irb with irb -Ilib then
[17:25:51] dionysus69: has joined #ruby
[17:27:06] joneshf-laptop: has joined #ruby
[17:28:38] gopz: jhass, should i run that from within the top level directory? I get irb/magic-file.rb:8:in `initialize': No such file or directory @ rb_sysopen - arugula (Errno::ENOENT)
[17:29:07] joonty: has joined #ruby
[17:29:52] jancel: has joined #ruby
[17:31:04] User458764: has joined #ruby
[17:31:19] allcentury: has joined #ruby
[17:31:22] codecop: has joined #ruby
[17:31:27] hutch34: has joined #ruby
[17:31:44] startupality: has joined #ruby
[17:32:21] pglombardo: has joined #ruby
[17:33:17] einarj: has joined #ruby
[17:33:36] Madplatypus: has joined #ruby
[17:35:09] Es0teric: has joined #ruby
[17:35:19] tristanp_: has joined #ruby
[17:35:23] jhbs: Ok I fixed it!
[17:35:26] jhbs: Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
[17:35:35] jhbs: how seriously should i take this
[17:36:22] apeiros: seems to explain the consequences quite well, no?
[17:36:23] jhbs: i should redo bundler
[17:36:30] hutch34_: has joined #ruby
[17:36:49] jhbs: sorry to even ask such trivium
[17:37:14] skade: has joined #ruby
[17:37:47] mtkd: has joined #ruby
[17:38:11] tristanp: has joined #ruby
[17:40:01] nettoweb: has joined #ruby
[17:41:34] Billias: has joined #ruby
[17:44:27] mdw: has joined #ruby
[17:44:28] kgrz: has joined #ruby
[17:46:19] panpainter: has joined #ruby
[17:49:18] ramfjord: has joined #ruby
[17:50:52] alfiemax: has joined #ruby
[17:51:52] SilverKey: has joined #ruby
[17:51:53] fenre: has joined #ruby
[17:52:17] duckpuppy: has joined #ruby
[17:53:11] symm-: has joined #ruby
[17:53:53] dtzuzu: has joined #ruby
[17:54:04] fenre: has joined #ruby
[17:54:13] uncertainty: has joined #ruby
[17:55:36] arlek: has joined #ruby
[17:55:39] sdrew: has joined #ruby
[17:55:41] snowy: has joined #ruby
[17:57:28] scottschecter: has joined #ruby
[18:01:24] m8: has joined #ruby
[18:02:25] SilverKey: has joined #ruby
[18:02:58] gopz: has joined #ruby
[18:07:40] Rodya_: has joined #ruby
[18:08:59] arooni: has joined #ruby
[18:09:32] futilegames: has joined #ruby
[18:15:15] futilegames: has left #ruby: ()
[18:15:23] al2o3-cr: has joined #ruby
[18:17:29] ferr: has joined #ruby
[18:19:59] craigp: has joined #ruby
[18:21:43] tristanp_: has joined #ruby
[18:22:14] symm-: has joined #ruby
[18:24:01] phoo1234567: has joined #ruby
[18:24:30] Sammichmaker: has joined #ruby
[18:25:05] maletor2: has joined #ruby
[18:25:48] sepp2k: has joined #ruby
[18:25:48] bio_grin: has joined #ruby
[18:26:01] bio_grin: Can anyone help me
[18:26:15] ruby[bot]: Just ask your question, if anyone has or can, they will respond.
[18:26:18] bio_grin: https://gist.github.com/anonymous/527d87d9296bc0f7371efb14d09e0e77
[18:26:21] ruby[bot]: Just ask your question, if anyone has or can, they will respond.
[18:26:27] anyone: what's up, bio_grin ?
[18:26:30] jhbs: Don't ask to ask.
[18:26:31] bio_grin: this code is executing too long
[18:26:32] jhbs: Beg and grovel to ask.
[18:26:47] bio_grin: it needs to verify do hashes exist
[18:26:56] bio_grin: it was tested using 100k of lines
[18:27:03] bio_grin: can i shorten the time
[18:27:04] Nilium: Can a hash truly be said to exist?
[18:27:14] bio_grin: check the code?
[18:27:26] Nilium: Does a hash have to be sentient to exist?
[18:28:03] bio_grin: it stores everything in the hash
[18:28:06] jhass: what's too long?
[18:28:08] bio_grin: and then checks back
[18:28:13] bio_grin: the runtime
[18:28:17] jhass: also why do you do that?
[18:28:28] bio_grin: because i am doing a challenge
[18:28:29] jhass: no I mean some concrete figures
[18:28:35] bio_grin: and it wont pass due to long execution
[18:28:41] eljimmy: has joined #ruby
[18:28:45] startupality: has joined #ruby
[18:28:50] jhass: .keys allocates an array each time
[18:28:52] jhass: use .has_key?
[18:29:24] Corrosive_: has joined #ruby
[18:29:33] jhass: also your loops can both simply be N.times do
[18:29:53] zeroDi: has joined #ruby
[18:30:31] jhass: bio_grin: also prefer "#{string} interpolation" over "string" + concatenation
[18:30:40] bio_grin: no need for that
[18:30:51] jhass: so puts "#{key} = #{hash[key]}"
[18:30:58] jackjackdripper: has joined #ruby
[18:31:09] jhass: isn't that tremendously more readable? ;)
[18:31:16] jhass: (it's also faster)
[18:31:22] bio_grin: I was so drunk yesterday that i used calculate(x) instead of x.calculate in class
[18:31:30] shevy: very lispy
[18:31:34] millerti: has joined #ruby
[18:32:00] bio_grin: also i got another question
[18:32:03] jhass: idk what i, b, j or k are for
[18:33:20] bio_grin: https://gist.github.com/anonymous/10ace6008899993834d1956660aea8e6
[18:33:28] bio_grin: this should find the max 7 numbers from the input
[18:33:43] bio_grin: it wont does that on my local machine but not online
[18:33:45] bio_grin: their fault?
[18:34:01] multi_io: has joined #ruby
[18:34:34] jhass: bio_grin: https://p.jhass.eu/27.rb
[18:34:53] jhass: oh, sorry
[18:35:32] bio_grin: any problems with my code?
[18:35:33] jhass: should load now
[18:36:02] bio_grin: god that is efficient
[18:36:10] bio_grin: that is for the previous program
[18:36:16] bio_grin: i am ok with that
[18:36:25] bio_grin: i prefer to learn by my own methods
[18:36:35] bio_grin: i mean i will get that over time i think
[18:36:42] jhass: see how proper variable names makes stuff readable?
[18:37:16] Nahra: has joined #ruby
[18:37:18] bio_grin: 2d arrays is the name of the topic
[18:37:29] bio_grin: i put all into 1 array and find the max and then delete it and find the other max
[18:37:50] djbkd: has joined #ruby
[18:38:17] jhass: line 10 does nothing since you don't use the result
[18:38:40] jhass: oh nvm it's an array at this point -.-
[18:38:59] jhass: use argument less .split though
[18:39:00] LoneHerm_: has joined #ruby
[18:39:02] jhass: it eats all whitespace
[18:39:09] Yiota: has joined #ruby
[18:39:52] Cohedrin_: has joined #ruby
[18:39:53] jhass: but other than style issues it should work I guess
[18:40:11] dimasg: has joined #ruby
[18:40:13] jhass: not exactly sure what the task is
[18:40:31] jhass: sum of all maximums of each given array?
[18:40:43] jhass: because then that would not be correct of course
[18:41:07] jaguarmagenta: has joined #ruby
[18:41:07] kareeole_: has joined #ruby
[18:41:28] jhass: since for [[1, 4, 6], [1, 2, 3]] your code would do 6 + 4 instead of 6 + 3
[18:42:23] k3rn31: has joined #ruby
[18:43:47] bio_grin: sorry got to take some water
[18:44:11] edwinvdgraaf: has joined #ruby
[18:44:12] bio_grin: the task is to get max 7 nums
[18:44:15] bio_grin: they can all be in one array
[18:44:25] bio_grin: doesnt matter
[18:45:32] bio_grin: or maybe max in one array
[18:45:35] tristanp: has joined #ruby
[18:45:43] bio_grin: this challenge is confusing
[18:46:00] dar123: has joined #ruby
[18:48:30] tristanp_: has joined #ruby
[18:48:44] bio_grin: can i send you the problem?
[18:48:51] bio_grin: https://www.hackerrank.com/challenges/30-2d-arrays/copy-from/21298012
[18:49:04] Rodya_: has joined #ruby
[18:49:24] bio_grin: choose language ruby instead of java
[18:49:53] symm-: has joined #ruby
[18:50:24] mdw7: has joined #ruby
[18:50:51] skade: has joined #ruby
[18:50:53] bio_grin: jhass you there
[18:51:42] jhass: some patience, doing more than just this ;)
[18:52:11] bio_grin: i would appreciate to tell me the problem in my code later
[18:52:29] workmad3: has joined #ruby
[18:53:15] jhass: bio_grin: well, it's not even close to tackling the problem tbh
[18:53:33] bio_grin: but it works?
[18:53:37] bio_grin: max 7 numbers?
[18:53:41] jhass: coincidentally
[18:53:47] allcentury: has joined #ruby
[18:54:02] sepp2k: has joined #ruby
[18:54:03] bio_grin: i am new to ruby
[18:54:08] bio_grin: i might not be an expert
[18:54:16] jhass: you should build up the 2d array
[18:54:30] jhass: then compute the indicies for each hourglass
[18:54:31] bio_grin: i made it all 1
[18:54:40] jhass: yes, don't
[18:54:53] bio_grin: i dont understand
[18:55:01] bio_grin: isnt the point to find max 7 numbers?
[18:55:01] jhass: did you read the task?
[18:55:07] uncertainty: has joined #ruby
[18:55:13] jhass: yes, in each "hourglass"
[18:55:19] skolman: has joined #ruby
[18:55:21] jhass: not in each line
[18:55:25] jackjackdripper: has joined #ruby
[18:55:39] bio_grin: wrong reading
[18:56:03] bio_grin: calculate the sum of every glass and print the max
[18:56:03] kriskropd: has joined #ruby
[18:56:06] bio_grin: i only print the max
[18:56:10] bio_grin: this problem isnt easy
[18:56:10] Cohedrin: has joined #ruby
[18:56:14] bio_grin: idk why is it in the easy section
[18:56:39] panpainter: has joined #ruby
[18:59:04] bio_grin: it will always contain 16 hourglasses
[18:59:59] jhass: you could just figure out the indexes by hand and hardcode a list of them or something, but... ;)
[19:00:15] Yiota: has joined #ruby
[19:00:41] bio_grin: but you can be the ruby expert and do it easier
[19:01:08] alfiemax: has joined #ruby
[19:01:41] jhass: not until you have a solution ;)
[19:01:51] eljimmy: has joined #ruby
[19:02:00] bio_grin: fair enough
[19:02:04] bio_grin: i drank 4 beers
[19:02:11] bio_grin: in 1 hour it might take little longer
[19:02:14] shevy: you know how to tackle problems
[19:02:22] last_staff: has joined #ruby
[19:02:34] bio_grin: i can brute force it?
[19:02:52] bio_grin: i mean anyone can do that
[19:03:49] tw1sted: has joined #ruby
[19:04:50] nerium: has joined #ruby
[19:04:55] xpt: Any centos user here? Is there a repo that gets recent ruby packages? Ruby 2.2.0 is too old for my needs and I am wondering if I can get it easy way or not.
[19:05:00] shevy: have one more beer bio_grin
[19:05:28] bio_grin: shevy that wont help
[19:05:32] mdw: has joined #ruby
[19:05:36] kobain: has joined #ruby
[19:05:43] bio_grin: i will start writing html
[19:05:43] xpt: have two moree beers bio_grin
[19:05:47] bio_grin: and trying to execute it as ruby
[19:06:30] bio_grin: jhass little hint
[19:06:36] kobain: has joined #ruby
[19:06:36] Guest70551: has joined #ruby
[19:07:28] mdw7_: has joined #ruby
[19:07:36] kobain: has joined #ruby
[19:07:42] bluOxigen: has joined #ruby
[19:07:45] johnmilton: has joined #ruby
[19:08:03] depesz_: has joined #ruby
[19:08:11] norc: xpt, generally chruby/post-install is the common way to get Ruby on almost any distribution.
[19:08:18] bio_grin: So many people leave and join
[19:08:33] allcentury: has joined #ruby
[19:08:39] antgel: has joined #ruby
[19:08:43] norc: xpt, that way you get the most recent Ruby versions and a very non-intrusive version management if you should need multiple Ruby versions.
[19:08:49] bio_grin: brb going to eat
[19:08:54] bio_grin: and drink some water
[19:09:12] anisha: has joined #ruby
[19:11:53] Akagi201: has joined #ruby
[19:12:02] alfiemax: has joined #ruby
[19:12:54] tristanp: has joined #ruby
[19:13:33] alfiemax: has joined #ruby
[19:15:11] nadir: has joined #ruby
[19:15:19] testuser000: has joined #ruby
[19:15:37] jhass: bio_grin: got a solution, 17 loc ;)
[19:15:52] testuser000: has left #ruby: ()
[19:15:59] tristanp_: has joined #ruby
[19:16:42] jhass: well, 11 significant ones
[19:16:53] jhbs: ruby on rails is so different from anything else ive done
[19:17:10] jhbs: i don't know how i feel about it forcing you to do something a certain way
[19:17:22] shevy: use padrino!
[19:17:26] bluOxigen: has joined #ruby
[19:18:03] alfiemax: has joined #ruby
[19:18:33] xpt: norc: thanks
[19:18:40] xpt: I'll give it a shot
[19:21:00] tristanp: has joined #ruby
[19:21:21] roamingdog: has joined #ruby
[19:21:59] dimasg: has joined #ruby
[19:22:46] Dimik: has joined #ruby
[19:23:17] jancel: has joined #ruby
[19:24:10] yfeldblum: has joined #ruby
[19:24:22] symm-: has joined #ruby
[19:25:07] greenride: has joined #ruby
[19:25:48] maletor2: has joined #ruby
[19:25:57] kgrz: has joined #ruby
[19:26:46] chip_: has joined #ruby
[19:28:56] houhoulis: has joined #ruby
[19:30:08] nofxx: has joined #ruby
[19:30:24] johnmilton: has joined #ruby
[19:30:25] dreinull: has left #ruby: ("undefined")
[19:30:33] roamingdog: has joined #ruby
[19:32:58] nerium: has joined #ruby
[19:33:59] phatypus: has joined #ruby
[19:35:11] Es0teric: has joined #ruby
[19:35:15] ule: has joined #ruby
[19:36:00] stev: has joined #ruby
[19:36:11] nankyokusei: has joined #ruby
[19:36:51] bio_grin: jhass can you give this poor soul a hint
[19:38:02] skade: has joined #ruby
[19:38:13] jhass: bio_grin: two loops, choose the start and end index so you don't have to do bound checks
[19:38:46] bio_grin: i need to find 7 numbers
[19:40:17] jhass: There are 16 hourglasses in A, and an hourglass sum is the sum of an hourglass' values.
[19:40:54] omphe: has joined #ruby
[19:41:09] bio_grin: i should sum all numbers
[19:41:16] dmr8: has joined #ruby
[19:41:17] bio_grin: like 7 random combos
[19:41:30] jhass: "Calculate the hourglass sum for every hourglass in A, then print the maximum hourglass sum."
[19:41:54] jhass: shall I copy paste the entire description for you or will you start reading it? ;)
[19:42:41] bio_grin: i read it 10 times
[19:42:43] bio_grin: im a little
[19:42:51] bio_grin: getting sober
[19:42:56] bio_grin: any more hints
[19:43:08] axisys: has joined #ruby
[19:43:10] jhass: I don't have the feeling you tried much yet
[19:43:22] bio_grin: fair enough
[19:43:26] bio_grin: i will go to try
[19:43:38] emilkarl: has joined #ruby
[19:47:45] tristanp_: has joined #ruby
[19:49:59] kraken: has joined #ruby
[19:50:18] _kraken: Does an instance of a particular class inherit methods from its superclass?
[19:50:22] tristanp: has joined #ruby
[19:50:41] _kraken: I mean it's superclasses's superclass
[19:50:45] _kraken: It's grandparent
[19:52:51] jancel_: has joined #ruby
[19:53:03] duckpuppy: has joined #ruby
[19:53:07] jhass: .singleton_class.ancestors is searched
[19:53:11] roamingdog: has joined #ruby
[19:53:45] norc: _kraken, also don't forget about each singleton class in the ancestory chain.
[19:54:19] roamingdog: has joined #ruby
[19:54:24] tristanp: has joined #ruby
[19:54:28] norc: (They will not be shown but are searched regardless)
[19:54:37] hutch34_: has joined #ruby
[19:54:39] jhass: .method(:foo).owner / .source_location to find where something comes from
[19:54:43] dtzuzu: has joined #ruby
[19:55:12] MrBusiness2: has joined #ruby
[19:55:42] uncertainty: has joined #ruby
[19:56:14] symm-: has joined #ruby
[19:56:32] xpt: norc: woohoo, only one issue submitted on ruby-install in process of getting most recent ruby
[19:56:49] ur5us: has joined #ruby
[19:56:49] xpt: fortunatelly I managed to install it
[19:56:50] Rodya_: has joined #ruby
[19:58:26] panpainter: has joined #ruby
[19:58:35] Maxifalk: has joined #ruby
[19:59:18] bio_grin: im getting sober and more ideas
[20:03:33] Gasher^: has joined #ruby
[20:05:10] B1n4r10: has joined #ruby
[20:05:52] tristanp_: has joined #ruby
[20:07:13] symm-: has joined #ruby
[20:09:40] Noxilex: has joined #ruby
[20:10:09] sebyx07: has joined #ruby
[20:10:12] sebyx07: has left #ruby: ()
[20:10:12] tristanp: has joined #ruby
[20:10:58] yqt: has joined #ruby
[20:11:07] Rodya_: has joined #ruby
[20:12:20] existensil: Naming question: what would you call a generic machine that when turned on stays on for n seconds, turning off when n seconds have elapsed, and resetting its clock when started while running?
[20:12:22] tristanp_: has joined #ruby
[20:12:59] art-solopov: has joined #ruby
[20:13:00] existensil: Basically how sleep features and motion detectors for lighting work
[20:13:13] norc: existensil, timer
[20:13:18] existensil: just looking for a generic term. Best I can come up with is "idle switch"
[20:13:35] norc: existensil, the idea is that its a mechanism that after some time does something. That is called a timer.
[20:13:37] roamingdog: has joined #ruby
[20:13:54] existensil: but not all timers would auto-reset like that
[20:13:58] norc: This one does.
[20:14:33] existensil: right. was hoping for something more precise that describes how this is different from a regular timer
[20:15:05] existensil: will have several things that use a timer like this and just wanted a good name
[20:15:11] pietr0: has joined #ruby
[20:15:12] houhoulis: has joined #ruby
[20:15:35] roamingdog: has joined #ruby
[20:16:01] norc: existensil, can you give a concrete example of what your "timer" does?
[20:17:39] existensil: Turning on an appliance in response to a sensor. If the sensor is only on for a split second you can't cycle certain appliances that fast. You need a timer that has a minimum run time and each sensor trip resets that so the appliance just keeps running.
[20:17:49] existensil: I'm using it for a sump pump right now but planning other uses.
[20:18:18] norc: existensil, TimedSwitch perhaps?
[20:18:56] existensil: yeah. that's better than idle switch probably. was hoping there was some word I've long forgotten that could get it done in one.
[20:19:26] norc: Perhaps someone else with more experience can hop in and give you some input. That is as far as my limited background goes.
[20:19:56] existensil: naming is hard and I'm obsessing because its a hobby project
[20:20:13] norc: existensil, naming things can be essential because it helps you identify what parts actually are.
[20:20:19] lightt: has joined #ruby
[20:23:50] existensil: TimeoutSwitch wins for now
[20:24:44] norc: existensil, not sure whether Timeout carries the right notion here.
[20:25:07] elementaru: is there a way to call a method or whatever, and not wait for it to finish to carry on with the rest of the code?
[20:25:14] Kus: has joined #ruby
[20:25:22] existensil: elementaru: Thread.new{ method }
[20:25:24] norc: elementaru, using threads and processes
[20:25:53] norc: elementaru, note that if you walk down that road you suddenly have to take care about thread safety, concurrency, reentrancy, synchronization.
[20:26:08] norc: Threads come with a high price tag attached to it.
[20:26:36] maletor2: has joined #ruby
[20:26:40] existensil: elementaru: you're spawning a new thread and that carries with it some complexities. Just that will work for some simple stuff but check out the Thread docs for info on what they are and how to control them.
[20:26:45] Billias: has joined #ruby
[20:27:34] existensil: If you're waiting for something its likely threads have a comparably low price tag
[20:27:48] norc: elementaru, note that in the topic of threads often the GIL (or GVM) is mentioned - but all it promsises is that Ruby won't crash horribly if you screw things up. Race conditions still apply..
[20:28:49] elementaru: googled "GIL ruby", first result "Nobody understands the GIL - Jesse Storimer"
[20:29:14] norc: elementaru, just ignore the GIL really. It gives you no guarantees beyond not crashing.
[20:29:28] existensil: elementaru: are you waiting on something external to ruby? like a network request or database request? if that's the case threads are a pretty great solution.
[20:29:29] roamingdog: has joined #ruby
[20:29:39] existensil: but reading up will help you
[20:30:02] norc: elementaru, make sure you read up on "Reentrancy" regardless of what you intend to do, and topics about synchronization and mutual exclusion if you want to share *any* data with the thread and the outside world.
[20:30:17] norc: If you do not do that you will get bugs, race conditions, random behaviour you cannot debug..
[20:30:38] elementaru: ok I will ty
[20:30:59] skolman_: has joined #ruby
[20:32:05] chouhoulis: has joined #ruby
[20:32:17] minimalism: has joined #ruby
[20:32:49] symm-: has joined #ruby
[20:36:01] futilegames: has joined #ruby
[20:36:15] tristanp: has joined #ruby
[20:36:17] mherold: has joined #ruby
[20:37:30] jancel: has joined #ruby
[20:38:47] tristanm_: has joined #ruby
[20:39:22] xkapastel: has joined #ruby
[20:41:08] tristanp_: has joined #ruby
[20:41:51] jaguarmagenta: has joined #ruby
[20:42:32] eGGshke: has joined #ruby
[20:43:05] mozzarella: has joined #ruby
[20:44:27] Gasher: has joined #ruby
[20:44:33] slackbotgz: has joined #ruby
[20:45:06] shevy: has anyone else noticed how norc transformed into a ruby teacher here :-)
[20:45:09] pawnbox: has joined #ruby
[20:45:45] nando293921: has joined #ruby
[20:46:10] futilegames_: has joined #ruby
[20:48:15] LoneHermit: has joined #ruby
[20:49:59] allcentury: has joined #ruby
[20:50:13] Insti: has joined #ruby
[20:52:36] roamingdog: has joined #ruby
[20:54:09] startupality: has joined #ruby
[20:55:43] glundgren: has joined #ruby
[20:56:29] uncertainty: has joined #ruby
[20:56:32] Coldblackice: has joined #ruby
[20:56:37] lightt: has joined #ruby
[20:56:49] glundgren: has left #ruby: ()
[21:01:07] symm-: has joined #ruby
[21:02:52] tristanp: has joined #ruby
[21:03:30] pglombardo: has joined #ruby
[21:04:31] hutch34_: has joined #ruby
[21:05:05] dtzuzu: has joined #ruby
[21:06:13] futilegames: has joined #ruby
[21:13:23] kriskropd: has joined #ruby
[21:14:29] moeabdol1: has joined #ruby
[21:15:45] eljimmy: has joined #ruby
[21:20:28] jancel: has joined #ruby
[21:24:44] symm-: has joined #ruby
[21:27:21] maletor2: has joined #ruby
[21:28:07] bobbycvi: has joined #ruby
[21:28:11] allcentury: has joined #ruby
[21:29:01] Xentil: has joined #ruby
[21:29:26] tristanp_: has joined #ruby
[21:29:49] mdw: has joined #ruby
[21:30:37] sdrew: has joined #ruby
[21:31:26] tristanm_: has joined #ruby
[21:32:00] karmatr0n: has joined #ruby
[21:33:40] tristanp: has joined #ruby
[21:35:39] madgen: has joined #ruby
[21:36:08] mattwashere: has joined #ruby
[21:36:48] tristanp: has joined #ruby
[21:38:39] sergey_makagon: has joined #ruby
[21:39:30] edwinvdgraaf: has joined #ruby
[21:39:35] mdw: has joined #ruby
[21:43:50] audibleblink: has joined #ruby
[21:45:10] ledestin: has joined #ruby
[21:46:19] startupality: has joined #ruby
[21:48:53] tristanp_: has joined #ruby
[21:49:20] spudowiar: has joined #ruby
[21:50:53] tristanp: has joined #ruby
[21:51:12] kriskropd: has joined #ruby
[21:51:23] |ifei5g00d: has joined #ruby
[21:53:49] duckpuppy: has joined #ruby
[21:55:33] SCHAAP137: has joined #ruby
[21:55:45] dar123: has joined #ruby
[21:56:52] symm-: has joined #ruby
[21:57:14] uncertainty: has joined #ruby
[21:57:53] roamingdog: has joined #ruby
[21:59:49] gigetoo: has joined #ruby
[22:00:30] blackmesa: has joined #ruby
[22:01:13] LoneHerm_: has joined #ruby
[22:01:18] panpainter: has joined #ruby
[22:01:35] pawnbox: has joined #ruby
[22:01:41] tvw: has joined #ruby
[22:03:24] domgetter: has joined #ruby
[22:05:49] tristanp_: has joined #ruby
[22:06:10] roamingdog: has joined #ruby
[22:08:13] tristanp: has joined #ruby
[22:09:57] tristanm_: has joined #ruby
[22:11:56] magikid: has joined #ruby
[22:18:33] shevy: is there a way to use .sub or .gsub only n times, where n is a number such as 5? I need to colourize the first 5 instances of a substring
[22:19:20] CalimeroTeknik: has joined #ruby
[22:21:03] ozanyurt: has joined #ruby
[22:21:53] tlaxkit: has joined #ruby
[22:24:06] Azure: has joined #ruby
[22:25:07] idefine: has joined #ruby
[22:28:10] maletor2: has joined #ruby
[22:28:54] norc: shevy, {n}
[22:29:00] symm-: has joined #ruby
[22:30:45] allcentury: has joined #ruby
[22:31:26] tristanp: has joined #ruby
[22:33:32] phredus: has joined #ruby
[22:34:47] tristanp_: has joined #ruby
[22:34:55] lightt: has joined #ruby
[22:36:27] tristanp: has joined #ruby
[22:36:34] nankyokusei: has joined #ruby
[22:37:19] mattwashere: has joined #ruby
[22:39:06] xlegoman: has joined #ruby
[22:42:39] jaguarmagenta: has joined #ruby
[22:44:30] idefine: has joined #ruby
[22:46:34] solocshaw: has joined #ruby
[22:49:01] Gasher: has joined #ruby
[22:49:45] tristanp_: has joined #ruby
[22:52:27] tristanp: has joined #ruby
[22:56:13] gigetoo: has joined #ruby
[22:57:57] uncertainty: has joined #ruby
[22:59:05] roamingdog: has joined #ruby
[23:00:58] tildes_: has joined #ruby
[23:06:37] alexander: has joined #ruby
[23:06:56] alexander: has left #ruby: ()
[23:07:20] roamingdog: has joined #ruby
[23:07:36] tristanp: has joined #ruby
[23:09:00] Dios: has joined #ruby
[23:12:03] tristanp_: has joined #ruby
[23:13:38] dar123: has joined #ruby
[23:14:00] jancel: has joined #ruby
[23:15:51] tristanp: has joined #ruby
[23:17:10] jackjackdripper: has joined #ruby
[23:18:02] roamingdog: has joined #ruby
[23:19:05] |meta: has joined #ruby
[23:19:06] sarbs: has joined #ruby
[23:21:41] Oclair: has joined #ruby
[23:21:42] SilverKey: has joined #ruby
[23:22:38] gigetoo: has joined #ruby
[23:28:55] maletor2: has joined #ruby
[23:29:51] symm-: has joined #ruby
[23:31:35] sdrew: has joined #ruby
[23:33:26] Yiota: has joined #ruby
[23:33:37] rkazak: has joined #ruby
[23:34:18] roamingdog: has joined #ruby
[23:37:52] tristanp: has joined #ruby
[23:38:25] JakFrist: has joined #ruby
[23:41:50] millerti: has joined #ruby
[23:42:29] tristanp_: has joined #ruby
[23:45:07] tristanp: has joined #ruby
[23:49:01] nchambers^: has joined #ruby
[23:49:27] ozanyurt: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[23:49:52] hahuang65: has joined #ruby
[23:50:22] jwang: has joined #ruby
[23:50:26] koooge: has joined #ruby
[23:50:31] CloCkWeRX: has joined #ruby
[23:51:54] jancel: has joined #ruby
[23:52:07] tristanp: has joined #ruby
[23:54:19] Akagi201: has joined #ruby
[23:54:33] duckpuppy: has joined #ruby
[23:54:52] roamingdog: has joined #ruby
[23:56:34] CloCkWeRX: has left #ruby: ()
[23:56:36] roamingdog: has joined #ruby
[23:56:36] Dios: has joined #ruby
[23:58:49] uncertainty: has joined #ruby
[23:59:25] mudbox: has joined #ruby