« Back to channel list

#ruby - 17 May 2017

« Back 1 day Forward 1 day »
[00:02:05] snockerton: https://gist.github.com/adampats/4277ee7e23da8e6d55e1e04afaceaa11
[00:02:30] snockerton: can anyone tell me a better way to find a multi-nested object based on a key/value?
[00:04:45] User458764: has joined #ruby
[00:05:04] bougyman: #detect will return 1 result instead of an array
[00:08:08] rkazak: has joined #ruby
[00:08:09] cam27: How come BasicObject has more methods than Object when I run the count method on the methods? I thought BasicObject was superclass to Object?
[00:09:23] tgragnato: has joined #ruby
[00:13:53] al2o3-cr: snockerton: h.dig(0, :form_fields).select { |f| f[:name] == "hostname" }
[00:14:23] bkxd: has joined #ruby
[00:14:31] ledestin: has joined #ruby
[00:15:37] snockerton: wow, i was messing with #dig for like an hour - didn't realize you could step in an array with the 0
[00:16:52] Hunter1: has joined #ruby
[00:18:25] BSAlb: has joined #ruby
[00:19:57] ascarter: has joined #ruby
[00:21:37] quiller: has joined #ruby
[00:21:58] zenguy_pc: has joined #ruby
[00:24:22] dddd: has joined #ruby
[00:28:38] quiller: has joined #ruby
[00:29:24] dddd: rbenv... gem home path is not under my home directory... not sure how to fix it https://gist.github.com/dolvany/da8ea3a33b80b856d5ddda5316019ada
[00:31:03] mrconfused: has joined #ruby
[00:34:30] jusa: has joined #ruby
[00:37:04] brendan-: has joined #ruby
[00:38:28] patarr: has joined #ruby
[00:39:13] tgragnato: has joined #ruby
[00:39:50] cahoots: has joined #ruby
[00:43:21] dddd: think i got it fixed
[00:43:48] JeanCarloMachado: has joined #ruby
[00:46:29] zenspider: cam27: highest is presumably assigned an instance of Ticket. Ticket (the class) is an instance of Class.
[00:47:55] olivier__: has joined #ruby
[00:51:22] cam27: zenspider: Thank you. Yes, that is correct, I ran them to see if it would be true an it was
[00:52:18] apparition: has joined #ruby
[00:53:05] patarr: has joined #ruby
[00:54:05] zapata: has joined #ruby
[00:54:08] Vingador: has joined #ruby
[00:57:44] pifon: has joined #ruby
[00:58:32] Hunter1: has joined #ruby
[00:58:38] JeanCarl1Machado: has joined #ruby
[01:00:56] d^sh: has joined #ruby
[01:04:26] minimalism: has joined #ruby
[01:06:54] patarr: has joined #ruby
[01:07:31] Newbs: has joined #ruby
[01:08:55] Cohedrin: has joined #ruby
[01:10:12] quiller: has joined #ruby
[01:14:36] bruno-: has joined #ruby
[01:15:27] cschneid_: has joined #ruby
[01:16:30] uZiel: has joined #ruby
[01:17:42] newbs_: has joined #ruby
[01:18:52] mim1k: has joined #ruby
[01:18:56] houhoulis: has joined #ruby
[01:19:36] cahoots: has joined #ruby
[01:21:20] newbs_: has joined #ruby
[01:24:51] jeffreylevesque_: has joined #ruby
[01:29:21] patarr: has joined #ruby
[01:31:05] PaulCapestany: has joined #ruby
[01:32:32] JeanCarl1Machado: has joined #ruby
[01:34:00] JeanCarloMachado: has joined #ruby
[01:34:45] cdg: has joined #ruby
[01:38:12] quiller: has joined #ruby
[01:40:52] sspreitz: has joined #ruby
[01:42:15] JoshS: has joined #ruby
[01:43:35] gizmore: has joined #ruby
[01:48:27] Newbs: has joined #ruby
[01:49:02] Cohedrin: has joined #ruby
[01:49:08] patarr: has joined #ruby
[01:49:27] olivier__: has joined #ruby
[01:50:02] ascarter: has joined #ruby
[01:52:38] Alina-malina: has joined #ruby
[01:53:26] enterprisey: has joined #ruby
[01:55:29] d^sh: has joined #ruby
[01:58:13] JeanCarl1Machado: has joined #ruby
[02:01:03] tgragnato: has left #ruby: ("Sto andando via")
[02:02:49] JeanCarloMachado: has joined #ruby
[02:06:46] ascarter_: has joined #ruby
[02:07:22] Jameser: has joined #ruby
[02:09:19] charliesome: has joined #ruby
[02:09:55] Newbs: has joined #ruby
[02:10:20] HoierM: has joined #ruby
[02:11:18] uZiel: has joined #ruby
[02:11:57] ascarter_: has joined #ruby
[02:13:52] raspado: has joined #ruby
[02:16:58] JeanCarl1Machado: has joined #ruby
[02:20:25] genpaku: has joined #ruby
[02:20:56] ascarter: has joined #ruby
[02:22:50] ascarter: has joined #ruby
[02:22:54] Cohedrin: has joined #ruby
[02:24:23] rexb0t: has joined #ruby
[02:27:17] quiller: has joined #ruby
[02:29:11] duderonomy: has joined #ruby
[02:34:53] JeanCarloMachado: has joined #ruby
[02:35:18] jusa: has joined #ruby
[02:35:36] quiller: has joined #ruby
[02:36:45] mrconfused: has joined #ruby
[02:50:17] itarato: has joined #ruby
[02:50:59] olivier__: has joined #ruby
[02:53:10] Alina-malina: has joined #ruby
[02:53:17] jrafanie: has joined #ruby
[02:57:18] Mutter: has joined #ruby
[03:00:34] Jameser: has joined #ruby
[03:00:43] ascarter: has joined #ruby
[03:04:44] sspreitz: has joined #ruby
[03:14:06] jusa: has joined #ruby
[03:14:40] ascarter: has joined #ruby
[03:14:48] bkxd: has joined #ruby
[03:18:54] duderonomy: has joined #ruby
[03:19:17] \tau: has joined #ruby
[03:19:20] \tau: http://codepad.org/m21pT3YT
[03:19:21] mim1k: has joined #ruby
[03:19:24] \tau: that resumes my doubt.
[03:19:43] dasher00: has joined #ruby
[03:32:54] __Yiota: has joined #ruby
[03:40:11] brent__: has joined #ruby
[03:42:28] JeanCarloMachado: has joined #ruby
[03:45:35] JeanCarl1Machado: has joined #ruby
[03:49:03] jane_booty_doe: has joined #ruby
[03:51:00] harfangk: has joined #ruby
[03:51:43] olivier__: has joined #ruby
[03:52:56] gix: has joined #ruby
[03:55:38] olivier__: has joined #ruby
[03:56:26] bambanx: has joined #ruby
[03:58:38] lyoung: has joined #ruby
[03:58:38] hndk: has joined #ruby
[04:01:15] JeanCarloMachado: has joined #ruby
[04:01:48] JeanCarl1Machado: has joined #ruby
[04:14:48] JeanCarloMachado: has joined #ruby
[04:19:18] ger0: has joined #ruby
[04:22:12] cam27: Are singleton methods and CLass methods different?
[04:27:22] cam27: obj_name.method_name vs ClassName.method_name
[04:27:58] Radar: different how?
[04:31:16] Hanmac: class methods are singleton methods on the class object, or do you mean instance methods?
[04:31:26] ascarter_: has joined #ruby
[04:32:09] renchan: has joined #ruby
[04:36:47] cam27: Is there a difference between Class.method_name and c = Class.new c.method_name
[04:37:23] cam27: and mathcing method signatures
[04:41:54] charliesome: has joined #ruby
[04:44:01] gothicsouth: has joined #ruby
[04:45:40] cagomez: has joined #ruby
[04:46:37] JeanCarl1Machado: has joined #ruby
[04:50:52] Hanmac: cam27 i think you confuse them. the second one are instance methods
[04:53:00] cam27: not if you are calling a methid with the same signature like c.method_name param1
[04:53:45] cam27: an instance method would be method_name param1
[04:55:03] cam27: def Class.method_name VS def object_name.method_name
[04:55:43] cam27: Class method VS Singleton method, are they the same?
[05:00:37] JeanCarloMachado: has joined #ruby
[05:00:45] JeanCarl1Machado: has joined #ruby
[05:00:51] Mavriik: has joined #ruby
[05:02:20] vahe: has joined #ruby
[05:03:06] ascarter: has joined #ruby
[05:04:25] vahe: hi all :) Friends , tell me alternatives RubyMine I'm a beginner , and looking for IDE
[05:05:13] Radar: cam27: no, they are different.
[05:06:00] dionysus69: has joined #ruby
[05:06:38] cam27: How so Radar?
[05:06:56] Radar: cam27: One is a class method and one is an instance method.
[05:08:07] cam27: Oh, so a singleton is still just an instnce method but only that instance can access it
[05:08:25] dminuoso: Two days in a row Radar has been here ;o
[05:08:25] dminuoso: Radar: Did you start learning real ruby?
[05:08:25] dminuoso: ACTION be hating on rails again
[05:08:29] cam27: Ok, thanks
[05:08:41] Radar: dminuoso: I have forgotten more Ruby than most people know.
[05:08:49] Radar: All instances of the class have the same methods. There are ways to add new methods to instances but typically you wouldn't do that.
[05:09:38] patarr: has joined #ruby
[05:09:44] Radar: For example: https://gist.github.com/radar/a586e904479a519d4fdf5918428031d6
[05:09:52] Mavriik: is this the only room about ruby I am new to this?
[05:10:13] dminuoso: cam27: each object has an associated singleton class with it (this recursively holds true for singleton class objects themselves)
[05:10:13] dminuoso: I got just the thing for you..
[05:10:20] Radar: Mavriik: this is the ruby channel that you need to know about :)
[05:10:23] nofxx: vahe, I would advise using some lightweight editor, good syntax highlight is all you need
[05:10:46] Radar: I should just state again: the code in the Gist is not typical Ruby. You wouldn't go defining random methods like that on instances of a class. I would go as far as to say it is bad practice to do what I just did.
[05:10:56] nofxx: and emacs if you want to join the church
[05:11:11] Radar: +1 Sublime Text is fine for newbies.
[05:11:13] Mavriik: radar: okay cool
[05:11:18] dminuoso: cam27: http://i.imgur.com/04Mlrwp.png
[05:11:48] dminuoso: cam27: I made that diagram a while ago it accurate represents how Ruby works internally. If you call a method it's basically "go one down, and then follow the chain to the right until you find a class that defines the method"
[05:12:11] Mavriik: how do i respond to one person?
[05:12:27] nofxx: Mavriik, use <tab>
[05:12:49] nofxx: but maybe you're on a shitty client...
[05:13:04] Radar: Mavriik: Type part of their name and then hit tab.
[05:13:15] Radar: dminuoso: that is a very scary diagram
[05:13:20] Mavriik: Radar: okay I think I got it
[05:13:27] Radar: dminuoso: scary + accurate, I should say
[05:13:39] Mavriik: Radar Im really new to all this
[05:15:59] Hanmac: dminuoso: need info on how strings are stored in ruby like there: http://patshaughnessy.net/2012/1/4/never-create-ruby-strings-longer-than-23-characters XD
[05:16:08] uZiel: has joined #ruby
[05:16:15] Radar: Mavriik: No worries :) Always good to have new people here.
[05:16:55] cam27: Thanks for clearing up the Singleton vs Class methods
[05:17:55] cam27: I can now move onto the next chapter
[05:18:00] Mavriik: Radar: do you make apps or websites or is it all the same?
[05:18:33] Radar: Mavriik: I use Ruby to make both http://ryanbigg.com is the website I made using a gem called Jekyll, and I've built lots of Ruby applications using the Rails framework.
[05:19:21] Bock: has joined #ruby
[05:19:51] mim1k: has joined #ruby
[05:20:17] Mavriik: Radar: Nice! pleasure to meet you
[05:20:41] Mavriik: Radar: my goal is to make a website to sell my music on
[05:20:57] Hanmac: cam27: info for you: there are some objects which can not have singleton methods, mostly integer and Float numbers because this objects does not have a singleton class
[05:21:06] Radar: Anyone know under which circumstances DateTime objects would include microsecond precision? I've got a test here which has DT without msec precision, but on CI it has msecs.
[05:21:17] Hanmac: boolean values like true, false and nil does trick around that
[05:22:21] Bock: has joined #ruby
[05:22:49] enterprisey: has joined #ruby
[05:25:46] jusa: has joined #ruby
[05:28:51] JeanCarl1Machado: has joined #ruby
[05:33:13] Jameser`: has joined #ruby
[05:43:29] Kug3lis: has joined #ruby
[05:46:13] JeanCarloMachado: has joined #ruby
[05:46:41] JeanCarl1Machado: has joined #ruby
[05:47:43] muelleme: has joined #ruby
[05:54:27] anisha: has joined #ruby
[06:00:20] nofxxx: has joined #ruby
[06:01:05] Xiti: has joined #ruby
[06:04:51] TvL2386: has joined #ruby
[06:05:03] ascarter: has joined #ruby
[06:05:51] DeeJayh: has joined #ruby
[06:07:41] DeeJayh: I have a custome method that adds text to a log file, the text is PRINTed in sections, and there's two threads that are using the method. What would be a good way to queue up each addLog() so that only one is ever handled at a time, thus guaranteeing newlines and keeping the log from becoming a jumbled, unreadable mess.
[06:08:28] JeanCarloMachado: has joined #ruby
[06:09:28] JeanCarl1Machado: has joined #ruby
[06:11:56] DeeJayh: I've been thinking of Queue, but the only examples I see are used to pop information between threads... I just want to do them one at a time to prevent issues.
[06:12:06] Bhootrk_: has joined #ruby
[06:16:43] tildes: has joined #ruby
[06:20:36] conta: has joined #ruby
[06:21:30] aufi: has joined #ruby
[06:23:34] dionysus69: has joined #ruby
[06:26:16] SaschaVoid: has joined #ruby
[06:27:42] bilal: has joined #ruby
[06:29:10] burgestrand: has joined #ruby
[06:31:51] bilal_: has joined #ruby
[06:32:13] JeanCarl1Machado: has joined #ruby
[06:32:43] vahe: nofxxx: can you tell me an example? :)
[06:36:15] JeanCarloMachado: has joined #ruby
[06:37:44] mrconfused: has joined #ruby
[06:41:51] bilal_: has joined #ruby
[06:41:55] DeeJayh: https://gist.github.com/Ruined1/ccea3669dde66ae6f2f48462ad58ba8b
[06:42:51] jgt: has joined #ruby
[06:43:32] DeeJayh: so you can see where you would want it to output Stuff1Thing1\nStuff2Thing2\n infinitely, but instead it gets jumbled because both threads are writing simultaneously and this causes one to happen in the middle of another before the newline
[06:44:04] JeanCarloMachado: has joined #ruby
[06:44:07] igniting: has joined #ruby
[06:55:59] pandaant: has joined #ruby
[06:58:36] arooni: has joined #ruby
[06:59:07] nobitanobi: has joined #ruby
[07:00:36] mrconfused: has joined #ruby
[07:01:14] Drakevr: has joined #ruby
[07:01:31] cagomez: has joined #ruby
[07:02:53] conta: has joined #ruby
[07:03:36] muelleme: has joined #ruby
[07:05:38] ascarter: has joined #ruby
[07:06:11] jaruga: has joined #ruby
[07:06:52] jaruga: has joined #ruby
[07:08:17] ooozanoodles: has joined #ruby
[07:10:28] patarr: has joined #ruby
[07:14:11] TomyWork: has joined #ruby
[07:17:35] mark_66: has joined #ruby
[07:18:39] Sembei: has joined #ruby
[07:19:18] Bhootrk_: has joined #ruby
[07:20:24] mim1k: has joined #ruby
[07:22:49] Mortomes|Work: has joined #ruby
[07:24:15] Bhootrk_: has joined #ruby
[07:25:31] jusa: has joined #ruby
[07:26:59] tvw: has joined #ruby
[07:27:52] awille: has joined #ruby
[07:29:09] _sfiguser: has joined #ruby
[07:29:16] DeeJayh: Nevermind, figured it out. I setup a thread to pop the queue constantly and redirected the log calls to add the value to the queue.
[07:29:24] ooozanoodles: has left #ruby: ()
[07:30:09] aep: has joined #ruby
[07:32:36] SaschaVoid: has joined #ruby
[07:33:40] SenpaiSilver: has joined #ruby
[07:35:19] guardianJ: has joined #ruby
[07:36:39] ljarvis: zenspider: re the roulette code, no idea. I thought it might be Windows being weird too. I think they were messing the code up a bit too though (main loop exits early). So I'd lean further toward user error
[07:37:37] mikecmpbll: has joined #ruby
[07:37:38] ljarvis: DeeJayh: if you want to print sequentially, why use threads?
[07:38:08] jamesaxl: has joined #ruby
[07:38:25] ljarvis: also for testing, i would highly recommend added some sleep() calls
[07:38:31] DeeJayh: because it's a server, hosting multiple different services that I want running in sync, and they all print to the same console
[07:39:53] ljarvis: ok, I guess I'm confused by your code then. I don't understand why procA and procB would care about the other (e.g. about logging sequentially). Am I missing something?
[07:40:30] DeeJayh: run the code, and notice that the log gets crossfed
[07:40:55] DeeJayh: meaning that sometimes before procA finishes writing it's second half of the log, procB starts writing it's first half
[07:41:04] DeeJayh: jumbling up the log
[07:41:21] ljarvis: right, you want mutual exclusion. Do you know what that is?
[07:41:53] DeeJayh: Not a clue
[07:42:09] DeeJayh: the problem isn't necessarily the calls
[07:42:13] DeeJayh: it's the way my logger works
[07:42:18] DeeJayh: it prints the time
[07:42:27] DeeJayh: then prints the event type
[07:42:31] DeeJayh: then prints the game type
[07:42:37] DeeJayh: then PUTS the message
[07:42:53] DeeJayh: I have to do it that way because of something specific to my case
[07:43:02] DeeJayh: and in-between those prints, other prints can be made
[07:43:07] DeeJayh: from the other proc
[07:44:20] DeeJayh: now, instead, they queue the information they wants to write to the log all at once, then one queue item at a time is processed.
[07:44:24] DeeJayh: problem solved
[07:46:16] Cohedrin: has joined #ruby
[07:49:24] ljarvis: DeeJayh: maybe you just want to build a string inside your proc methods and then output it at the end, rather than one process blocking another
[07:50:01] DeeJayh: ljarvis, but then I am writing the same code twice...
[07:50:34] guardianJ: has joined #ruby
[07:50:35] DeeJayh: one moment, I'll share some code with you, all should become clear
[07:51:16] cfec0b8d: has joined #ruby
[07:51:40] rgr: has joined #ruby
[07:55:35] ljarvis: DeeJayh: https://gist.github.com/leejarvis/b4d3779f0695448da919106d58ae8bf0
[07:57:00] DeeJayh: see how each line of the log is pieced together, and even colored differently, based on the options given each time addLog is called?
[07:57:09] ljarvis: right, yes
[07:57:20] ljarvis: you just need to build that string before you send it to stdout, that's all
[07:57:42] ljarvis: or rather, before you write it to Console
[07:57:50] blackmesa: has joined #ruby
[07:57:57] DeeJayh: I don't know how to do that with color-console while keeping the seperate colors where I want them. That's why it was so convoluted
[07:58:14] DeeJayh: Basically I hacked my way around the problem, rather than addressing it directly
[07:58:15] burgestrand: has joined #ruby
[07:58:30] mikecmpbll: has joined #ruby
[07:58:42] ljarvis: does the console gem allow an alternative IO?
[07:59:08] ljarvis: that gem is *very* old
[07:59:20] ljarvis: have you looked around for alternatives?
[07:59:54] DeeJayh: It still does, very effectively, what I want it to do, which is to be able to color output regardless of the OS/cli
[08:00:25] ljarvis: but maybe it also doesn't do what you want (use an alternative IO)
[08:00:38] ljarvis: this is much better: https://github.com/fazibear/colorize -- because it builds strings
[08:00:52] ljarvis: so you could do log.puts "foo".colorize(:blue)
[08:01:39] Silthias: has joined #ruby
[08:01:51] Hunter1: has joined #ruby
[08:02:33] hurricanehrndz: has joined #ruby
[08:02:38] ljarvis: 2 other things: you could would be much easier to read if it's formatted in a rubyish way, with 2 spaces for indentation and using snake_case instead of camelCase
[08:05:02] DeeJayh: ljarvis, I'm pretty stuck on using tabs, sorry, it's engrained in my mind... believe it or not however, 90% of my code in snake_case, that method was one that got away from a late night of coding
[08:05:17] ljarvis: fair 'nuff
[08:05:36] DeeJayh: I always appreciate the tips though
[08:05:42] ljarvis: are you richard hendricks?
[08:06:31] djbkd_: has joined #ruby
[08:06:49] DeeJayh: HOW DOES EVERYONE ALWAYS KNOW?
[08:07:55] guardianJ: he learned ruby on rails in a weekend
[08:08:41] romank: has joined #ruby
[08:10:00] ur5us: has joined #ruby
[08:10:08] olivier__: has joined #ruby
[08:10:16] DeeJayh: Worst part is, btw, that I used headlessCamelCase
[08:10:25] DeeJayh: Apparently that makes some people cringe
[08:10:40] DeeJayh: (when I do slip up and use it once in a blue moon)
[08:11:10] lipoqil: has joined #ruby
[08:11:20] User458764: has joined #ruby
[08:12:04] guardianJ: isn't that regular camelcase?
[08:12:31] DeeJayh: CamelCase is CamelCase, thisIsHeadlessCamelCase
[08:12:54] DeeJayh: where the first word isn't capitalized (headless)
[08:16:02] mim1k: has joined #ruby
[08:20:05] mas886: has joined #ruby
[08:20:05] mas886: has joined #ruby
[08:20:42] jenrzzz: has joined #ruby
[08:20:43] jenrzzz: has joined #ruby
[08:21:54] mdw: has joined #ruby
[08:22:19] Jameser: has joined #ruby
[08:23:19] ferr: has joined #ruby
[08:27:59] DeeJayh: guardianJ, rather, I should say, that's my understanding, I didn't confirm that, but I've always understood it that way
[08:28:42] antgel: has joined #ruby
[08:29:09] marr: has joined #ruby
[08:29:50] tomphp: has joined #ruby
[08:30:01] harfangk: has joined #ruby
[08:33:29] guardianJ: i knew them as camelCase and PascalCase
[08:33:59] guardianJ: but i really don't care what people call them
[08:35:05] guardianJ: btw, i want to relearn pascal or delphi
[08:35:46] mim1k: has joined #ruby
[08:36:15] harfangk: has joined #ruby
[08:37:45] im0nde: has joined #ruby
[08:40:28] lxsameer: has joined #ruby
[08:40:52] flying: has joined #ruby
[08:40:59] Dimik: has joined #ruby
[08:43:09] Beams: has joined #ruby
[08:45:05] Pumukel: has joined #ruby
[08:46:02] TreyG: has joined #ruby
[08:46:11] Cohedrin: has joined #ruby
[08:48:18] blackmesa: has joined #ruby
[08:51:36] nadir: has joined #ruby
[08:52:26] vali: has joined #ruby
[08:52:28] jenrzzz: has joined #ruby
[08:52:51] mim1k: has joined #ruby
[08:53:30] tomphp: has joined #ruby
[08:57:51] blackmes1: has joined #ruby
[08:59:15] charliesome: has joined #ruby
[09:01:30] xall: has joined #ruby
[09:02:38] xall: has joined #ruby
[09:04:00] loechel: has joined #ruby
[09:04:41] jamesaxl: has joined #ruby
[09:06:00] vall: has joined #ruby
[09:06:45] gizmore: has joined #ruby
[09:10:09] aupadhye: has joined #ruby
[09:10:51] xall_: has joined #ruby
[09:11:17] patarr: has joined #ruby
[09:14:10] dminuoso: asm>> foo.bar
[09:14:11] ruby[bot]: dminuoso: I have disassembled your code, the result is at https://eval.in/798986
[09:17:27] cagomez: has joined #ruby
[09:24:04] darix: is there any SCM repository for wxruby somewhere? even the wxwidget main page still points to rubyforge. and the gem on rubygems.org is binary only
[09:27:36] alazred: has joined #ruby
[09:27:37] alazred: has joined #ruby
[09:29:48] tomphp: has joined #ruby
[09:31:26] Jameser: has joined #ruby
[09:33:30] xall: has joined #ruby
[09:36:08] _sfiguser: has joined #ruby
[09:38:04] Alina-malina: has joined #ruby
[09:39:04] Trpger: has joined #ruby
[09:39:48] Radcircle: has joined #ruby
[09:40:18] Radcircle: hey guys, really quick question - for http basic auth in ruby, how can i have multiple users and passwords?
[09:42:07] romank: has joined #ruby
[09:42:26] tvw: has joined #ruby
[09:43:39] Trpger: has left #ruby: ()
[09:44:27] ljarvis: Radcircle: the same way you'd have one, but you just lookup the username and check the password. It depends on your framework and how you're storing the data of course
[09:45:15] Radcircle: if my code is just this line: http_basic_authenticate_with :name => "user", :password => "password"
[09:45:25] Radcircle: is there no other way to have multiple arguments, like an array?
[09:45:57] Radcircle: i feel like i'm missing something very very basic, but i just can't seem to figure it out
[09:46:51] ljarvis: Radcircle: authenticate_or_request_with_http_basic { |username, password| ... }
[09:49:47] Gabemo: has joined #ruby
[09:50:11] jgt1: has joined #ruby
[09:52:32] itarato: has joined #ruby
[09:52:34] Kug3lis: has joined #ruby
[09:52:52] tomphp: has joined #ruby
[09:57:14] xall_: has joined #ruby
[10:00:07] mim1k: has joined #ruby
[10:03:40] muelleme: has joined #ruby
[10:03:57] pandaant: has joined #ruby
[10:10:18] cschneid_: has joined #ruby
[10:11:37] Hunter1: has joined #ruby
[10:13:27] olivier__: has joined #ruby
[10:14:37] xall: has joined #ruby
[10:18:19] AnoHito: has joined #ruby
[10:18:38] xall: has joined #ruby
[10:20:17] Kug3lis: has joined #ruby
[10:20:55] anisha: has joined #ruby
[10:22:43] bigkevmcd: has joined #ruby
[10:23:02] quobo: has joined #ruby
[10:25:29] Bhootrk_: has joined #ruby
[10:25:47] romank: has joined #ruby
[10:26:40] patarr: has joined #ruby
[10:30:17] gnufied: has joined #ruby
[10:32:02] blackmes1: has joined #ruby
[10:36:57] itarato: has joined #ruby
[10:41:09] mim1k_: has joined #ruby
[10:41:19] xall_: has joined #ruby
[10:42:20] TreyG_: has joined #ruby
[10:45:40] AnoHito_: has joined #ruby
[10:50:06] xall: has joined #ruby
[10:50:31] jolamb: has joined #ruby
[10:51:38] shinnya: has joined #ruby
[10:52:46] esObe: hi guys, I have a problem with creating a method which is a rgb calculator. I want to add some validations like the calculation works if you type 3 values (r, g, b) and each value is in range (0..255)
[10:52:53] esObe: Can someone help me, please?
[10:52:58] esObe: https://gist.github.com/anonymous/5e58e0cde33776abf17ff88262feb1f8
[10:54:56] xall: has joined #ruby
[10:56:30] anisha: has joined #ruby
[10:56:37] esObe: a is an array, rgb refers to a[0], a[1], a[2]
[10:57:01] elomatreb: Check out Range#cover? http://ruby-doc.org/core-2.4.1/Range.html#method-i-cover-3F
[10:58:22] bilal: has joined #ruby
[11:00:03] stamina: has joined #ruby
[11:02:38] mrconfused: has joined #ruby
[11:03:02] Ove_: has joined #ruby
[11:03:33] tomphp: has joined #ruby
[11:03:33] Ove_: I am seeing really high ActiveRecord::QueryCache#call (currently at 143 seconds) .
[11:03:36] Ove_: Anyway to fix it?
[11:03:48] esObe: I'm not sure how to use it as I get an error 'undefined method `cover?' for [4, 0, 255]:Array (NoMethodError)'
[11:03:57] xall: has joined #ruby
[11:04:05] esObe: a.cover?(0..255)
[11:04:26] matthewd: Ove_: In less-than-current Rails versions, that middleware connects to the database. You probably need to increase the size of your connection pool.
[11:04:57] bilal: has joined #ruby
[11:05:22] svisz: has joined #ruby
[11:05:57] tomphp: has joined #ruby
[11:06:22] esObe: elomatreb: hmm cover? method is for strings, not arrays
[11:07:07] elomatreb: Oh, it's on the range, and for a single value. E.g. `(0..10).cover? 3`
[11:07:18] elomatreb: (which would return true)
[11:07:35] elomatreb: You may be interested in Enumerable#all? to check all components of your array for a condition
[11:08:11] Ove_: matthewd: All other queries runs very fast, so I don't know what the issue is.
[11:09:19] raspado: has joined #ruby
[11:09:53] olivier__: has joined #ruby
[11:10:34] matthewd: Ove_: I just told you what's wrong, why it's manifesting as you're seeing it, and how to fix it... so I'm not clear what else you want to know
[11:11:17] xall: has joined #ruby
[11:11:56] bilal: has joined #ruby
[11:14:17] Ove_: matthewd: Had it been a too low connection pool wouldn't it also imply that I'd get a "couldn't get a database connection bla bla" ?
[11:14:40] User458764: has joined #ruby
[11:14:50] esObe: elomatreb: exactly, but I've just figured out a.each {|value| puts value.between?(0,255)}
[11:15:13] User458764: has joined #ruby
[11:15:50] matthewd: Ove_: Are you saying individual requests are taking 143 seconds?
[11:16:33] elomatreb: esObe: Look at the example for Enumerable#all?, it does pretty much exactly what you want: http://ruby-doc.org/core-2.4.1/Enumerable.html#method-i-all-3F
[11:17:04] esObe: okay, thanks
[11:17:33] Ove_: matthewd: I don't know, I am seeing this in newrelic, however in our own metrics I see an average of ~13 ms response times while on newrelic it says that I have a really high response time.
[11:19:00] matthewd: Ove_: My assumption is that requests are getting stuck waiting for a connection, but ultimately do get one before they time out
[11:19:08] Ove_: matthewd: Is it possible that newrelic reports the wrong metrics?
[11:19:48] matthewd: I don't know enough about New Relic, sorry
[11:20:04] ruby[bot]: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[11:20:12] matthewd: We should probably take this over ^ there, though
[11:20:44] olivier__: has joined #ruby
[11:22:21] nowhere_man: has joined #ruby
[11:28:13] Kug3lis: has joined #ruby
[11:30:56] sepp2k: has joined #ruby
[11:31:37] jrafanie: has joined #ruby
[11:32:20] Kug3lis: has joined #ruby
[11:33:34] cagomez: has joined #ruby
[11:33:55] im0nde: has joined #ruby
[11:34:27] bilal: has joined #ruby
[11:35:06] xall: has joined #ruby
[11:36:19] User458764: has joined #ruby
[11:37:44] znz_jp: has joined #ruby
[11:39:32] fmcgeough: has joined #ruby
[11:40:12] gnufied: has joined #ruby
[11:42:36] ldnunes: has joined #ruby
[11:45:48] bkxd: has joined #ruby
[11:47:29] VladGh: has joined #ruby
[11:49:32] xall_: has joined #ruby
[11:49:52] ascarter: has joined #ruby
[11:50:39] itarato: has joined #ruby
[11:50:56] charliesome: has joined #ruby
[11:50:57] bkxd: has joined #ruby
[11:51:33] ascarter: has joined #ruby
[11:51:53] JeanCarloMachado: has joined #ruby
[11:51:55] JeanCarl1Machado: has joined #ruby
[11:54:53] nadir: has joined #ruby
[11:55:08] xall: has joined #ruby
[11:56:14] ferr: has joined #ruby
[11:58:01] mim1k: has joined #ruby
[12:00:29] bkxd: has joined #ruby
[12:03:57] itarato: has joined #ruby
[12:04:38] jeffreylevesque: has joined #ruby
[12:08:33] blackmes1: has joined #ruby
[12:10:07] gigetoo: has joined #ruby
[12:10:58] cschneid_: has joined #ruby
[12:11:57] itarato1: has joined #ruby
[12:12:09] gnufied: has joined #ruby
[12:15:09] itarato2: has joined #ruby
[12:16:46] xall_: has joined #ruby
[12:17:53] jgt1: has joined #ruby
[12:18:01] tvw: has joined #ruby
[12:18:59] bilal: has joined #ruby
[12:19:03] synthroid: has joined #ruby
[12:20:24] t-recx: has joined #ruby
[12:21:30] olivier__: has joined #ruby
[12:21:46] itarato3: has joined #ruby
[12:23:13] itarato4: has joined #ruby
[12:30:33] itarato4: has joined #ruby
[12:34:17] biberu: has joined #ruby
[12:34:30] mrconfused: has joined #ruby
[12:35:52] nobitanobi: has joined #ruby
[12:35:53] dionysus69: has joined #ruby
[12:36:16] nobitanobi: has joined #ruby
[12:36:56] Kug3lis: has joined #ruby
[12:37:31] mim1k: has joined #ruby
[12:38:27] xall: has joined #ruby
[12:39:54] BSaboia: has joined #ruby
[12:41:58] itarato4: has joined #ruby
[12:41:59] redaudit: has joined #ruby
[12:42:22] houhoulis: has joined #ruby
[12:48:42] uZiel: can I compare an integer with all elements in an array?
[12:48:55] bilal: has joined #ruby
[12:49:38] uZiel: Array.methods does show >, <, >=, <= operators and more but I can't recall where did I read how to use them
[12:50:42] cedum: has joined #ruby
[12:50:51] ljarvis: uZiel: what do you want exactly?
[12:52:18] itarato4: has joined #ruby
[12:53:00] uZiel: check to see if an number is greater than the smallest and smaller than the largest element of an array
[12:53:42] bauruine: has joined #ruby
[12:55:08] ljarvis: uZiel: sort the array and then use `x > arr.first && x < arr.last` or `Range.new(arr.first, arr.last).cover?(x)`
[12:55:44] ljarvis: there are other ways if you need it to be fast, but they're more verbose
[12:55:50] uZiel: basically, I have an array of n size and I want to keep the top n elements from a stream
[12:56:15] uZiel: ljarvis: yes please, go ahead, a bit of verbosity won't hurt
[12:56:48] xall: has joined #ruby
[12:57:14] ljarvis: uZiel: well, you'd want to loop through the array and checking each item against N, and you can break the loop as soon as you've found a value less or greater than N (thus not having to loop through the entire array)
[12:58:11] mim1k: has joined #ruby
[12:58:41] uZiel: ah, that one, ok now I think I want to save lines :D , coz n is only 10-20, not more
[12:59:10] ljarvis: right, yep.. no point then
[12:59:28] rdw200169__: has joined #ruby
[13:00:10] uZiel: but I would still like to know why those comparison operators exist for Array and how to use them?
[13:00:36] ramortegui: has joined #ruby
[13:00:48] herwin: just build a few arrays with numbers, try to compare them and see what happens
[13:01:23] elomatreb: See the docs for <=>, all other comparisons are defined in terms of that: http://ruby-doc.org/core-2.4.1/Array.html#method-i-3C-3D-3E
[13:03:11] cdg: has joined #ruby
[13:04:09] pupsicle: has joined #ruby
[13:07:53] dionysus69: has joined #ruby
[13:12:33] jrafanie: has joined #ruby
[13:12:36] Kug3lis: has joined #ruby
[13:14:33] bkxd: has joined #ruby
[13:15:48] xall_: has joined #ruby
[13:20:09] Pumukel: has joined #ruby
[13:20:15] romeoh: has joined #ruby
[13:20:43] jphase: has joined #ruby
[13:21:12] mrconfused: has joined #ruby
[13:21:40] Asher: has joined #ruby
[13:22:38] cedum: has left #ruby: ("WeeChat 1.7.1")
[13:23:04] olivier__: has joined #ruby
[13:24:02] yeticry: has joined #ruby
[13:25:25] cahoots: has joined #ruby
[13:26:23] GGMethos: has joined #ruby
[13:27:40] anisha: has joined #ruby
[13:28:07] tomphp: has joined #ruby
[13:29:10] etehtsea: has joined #ruby
[13:31:16] xall: has joined #ruby
[13:34:20] Kug3lis: has joined #ruby
[13:36:12] mrconfused: has joined #ruby
[13:36:35] itarato4: has joined #ruby
[13:39:04] oleo: has joined #ruby
[13:40:26] majuk: has joined #ruby
[13:40:49] majuk: Anyone dealt with rbenv? It... doesn't seem to actually take any of its own command line arguments.
[13:41:04] majuk: Everything just prints the default help message.
[13:41:24] griffindy: has joined #ruby
[13:41:36] havenwood: majuk: Give chruby a try. It's the simplest thing that can possibly work.
[13:41:51] majuk: havenwood: Any idea if it will pull in reby-dev headers?
[13:41:56] majuk: *ruby-dev
[13:42:13] majuk: I don't even know if rbenv will but it seemed simple enough to try.
[13:42:30] havenwood: majuk: chruby doesn't handle installing, but if you build head to ~/.rubies/ruby-dev or /opt/rubies/ruby-dev it'll auto-detect it.
[13:42:45] im0nde: has joined #ruby
[13:42:56] majuk: havenwood: Cool, thanks for your input.
[13:44:28] havenwood: majuk: What OS/distro are you on? I'll paste you a script.
[13:45:13] majuk: havenwood: I'm on a custom system on an SoC sooo.... likely won't work.
[13:45:33] majuk: Thanks though
[13:46:35] xall: has joined #ruby
[13:46:42] majuk: Yea, chruby doesn't get what I need, I need a tool that handles install
[13:46:47] majuk: as I have no package manager.
[13:47:29] majuk: So naturally it doesn't work.
[13:47:37] havenwood: majuk: folk often use ruby-install with chruby, but you'll need to provide the deps yourself
[13:47:43] minimalism: has joined #ruby
[13:47:59] DLSteve: has joined #ruby
[13:48:03] bruno-: has joined #ruby
[13:48:22] mim1k: has joined #ruby
[13:48:35] majuk: havenwood: Ah, that's nice. Thanks.
[13:48:55] fuzzyhorns1: has joined #ruby
[13:49:25] majuk: I'm still bothered by the fact that I can't get rbenv to respond to me in an anticipated manner.
[13:49:36] majuk: Makes me think there is something deeper wrong with this system.
[13:49:44] majuk: Which is noooooot very comforting.
[13:49:49] matthewd: A custom system seems like the place I'd just go with a manual compile, personally
[13:50:08] havenwood: +1 compile it yourself
[13:50:11] havenwood: majuk: https://gist.github.com/havenwood/2c30cb64dd08a4afd8e058dcfeda0406
[13:50:20] majuk: matthewd: Did it, tried a few different versions, gem installs fail after build
[13:50:34] majuk: For various reasons.
[13:50:36] havenwood: ^ that'll install the nightly snapshot, and provides a place for you to point to the location of the deps you've installed yourself
[13:50:42] matthewd: So now we're XYing it? :/
[13:50:55] trwyth: has joined #ruby
[13:51:02] majuk: Don't know what that means, but sure.
[13:51:10] ruby[bot]: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[13:51:44] majuk: I came in asking for help with rbenv. So.
[13:51:54] majuk: Feel free to stop responding.
[13:51:59] matthewd: You're seeking help with rbenv, when rbenv is actually your attempted solution to the original problem.
[13:52:04] havenwood: majuk: right, rbenv doesn't have anything to do with the problem you're looking to solve
[13:52:28] majuk: has left #ruby: ()
[13:52:29] matthewd: I was offering to help fix your original problem, but okay ¯\_(ツ)_/¯
[13:52:30] xall_: has joined #ruby
[13:54:14] __Yiota: has joined #ruby
[13:54:17] trwyth: I'm at my wit's end. Why does this error, and how do I actually do this?
[13:54:19] trwyth: > @f = lambda { |x| puts x}
[13:54:19] trwyth: > result = @f('foo')
[13:54:19] trwyth: SyntaxError: (irb):366: syntax error, unexpected '(', expecting end-of-input
[13:54:37] havenwood: trwyth: @f.('foo')
[13:55:03] havenwood: trwyth: Or: `@f.call 'foo'` or `@f['foo']` - pick your poison.
[13:55:06] elomatreb: Yeah, lambdas are just objects, not methods
[13:55:10] gothicsouth: has joined #ruby
[13:55:19] trwyth: ugh I didn't realize there was actually a difference
[13:55:21] trwyth: my js is leaking
[13:55:24] Mia: has joined #ruby
[13:56:05] bkxd: has joined #ruby
[13:56:24] tomphp: has joined #ruby
[13:59:19] gr0gg|ex: has joined #ruby
[14:06:21] Mutter: has joined #ruby
[14:08:24] rakm: has joined #ruby
[14:10:13] alazred: has joined #ruby
[14:12:26] alazred: has joined #ruby
[14:12:27] alazred: has joined #ruby
[14:13:59] kantu: has joined #ruby
[14:14:00] ResidentBiscuit: has joined #ruby
[14:14:25] ResidentBiscuit: has joined #ruby
[14:14:50] ResidentBiscuit: has joined #ruby
[14:15:04] xall: has joined #ruby
[14:15:15] ResidentBiscuit: has joined #ruby
[14:15:39] Rodya_: has joined #ruby
[14:16:25] kantu: has left #ruby: ()
[14:19:57] jphase: has joined #ruby
[14:21:25] cam27: has joined #ruby
[14:21:39] rkazak: has joined #ruby
[14:23:00] mc_fail: i'm trying to implement expression like e = a || c.key?(:d) ? b : 'bla'
[14:23:43] olivier__: has joined #ruby
[14:23:53] mc_fail: so, i expect e = a when a is presented, a = b when c.key(:d) is there, and 'bla' if nothing is presented
[14:24:05] mc_fail: but somehow, in this case a always equals b
[14:24:14] mc_fail: for example https://gist.github.com/anonymous/1e599e1ff6248167e8c753c89b6fa124
[14:24:29] mc_fail: this feels ridiculous
[14:24:41] chouhoulis: has joined #ruby
[14:24:56] matthewd: mc_fail: Add some parens
[14:25:54] mc_fail: matthewd now it works
[14:26:05] mc_fail: is this some parsing problem?
[14:26:20] dminuoso: mc_fail: Not a "problem"
[14:26:25] dminuoso: mc_fail: It's just precedence rules.
[14:26:26] Mutter: has joined #ruby
[14:26:39] dminuoso: It's considered as (a || b) ? c : d
[14:27:04] dminuoso: mc_fail: https://github.com/ruby/ruby/blob/trunk/parse.y#L970-L973
[14:28:02] mc_fail: still weird
[14:28:05] dminuoso: (Order is from lowest to highest, and left/right is self-explanatory)
[14:28:23] ljarvis: ah parse.y, you disgusting pile of mess <3
[14:29:54] mc_fail: well, than i can do something like ( a || b ) || c
[14:30:04] mc_fail: instead of ternary operator
[14:30:20] chouhoulis: has joined #ruby
[14:30:31] ljarvis: or also, save lives by writing more code
[14:30:54] workmad3: has joined #ruby
[14:31:28] mc_fail: ljarvis to provide employment for people who are going to maintain all the brackets and pipes I wrote?
[14:32:14] mc_fail: or you mean just to stick with plain if .. else ?
[14:33:45] rakm: has joined #ruby
[14:35:15] dminuoso: mc_fail: irb(main):021:0> e = a || c.key?(:d) ? b : 'bla'
[14:35:27] dminuoso: mc_fail: To even want this sounds fishy to me.
[14:37:14] ljarvis: tbh, the last part should be c.fetch(:d, 'bla') anyway
[14:37:38] mc_fail: ljarvis not really
[14:37:40] bilal: has joined #ruby
[14:37:53] mc_fail: dminuoso what would you suggest?
[14:38:09] montyboy: has joined #ruby
[14:38:19] tomphp: has joined #ruby
[14:38:41] ljarvis: can't you just re-assign a instead of a new var (e)?
[14:39:06] dminuoso: mc_fail: I'd have to see the contest of what you are trying to achieve.
[14:39:16] ljarvis: what's the prize
[14:39:31] dminuoso: ljarvis: You get to buy me a beer.
[14:39:32] mc_fail: dminuoso you don't want to know...
[14:39:52] dminuoso: mc_fail: That must be why I just asked, because I don't want to know.
[14:39:52] Silthias: has joined #ruby
[14:39:53] ljarvis: dminuoso: where do you live?
[14:40:13] dminuoso: ljarvis: The home of the true grammar Nazis.
[14:40:27] ljarvis: that doesn't rule much of the planet out
[14:41:12] dminuoso: ljarvis: Right across the ocean I guess.
[14:41:55] ljarvis: ah, so s/grammar//, got it
[14:42:05] duderonomy: has joined #ruby
[14:42:10] psychicist__: has joined #ruby
[14:44:09] fuzzyhorns1: has joined #ruby
[14:44:16] fuzzyhorns1: has left #ruby: ()
[14:44:33] Newbs: has joined #ruby
[14:44:47] apparition: has joined #ruby
[14:47:29] trwyth: now I'm having scope trouble. https://gist.github.com/aaronboyle/ff9ce34fb3eda5890b998c36f229b92e
[14:47:58] ljarvis: trwyth: method(:mult)
[14:49:11] ljarvis: trwyth: do you understand why?
[14:49:41] trwyth: when you consider the last three problems I've had, obviously I don't going in
[14:49:48] trwyth: pretty sure I will in the next 5 minutes though :)
[14:50:05] trwyth: I was listening when I was told earlier that methods and objects are different
[14:50:08] ljarvis: ok, i haven't followed the other problems, but let us know if you get stuck
[14:50:16] trwyth: and I think it has to do with the call method
[14:50:28] trwyth: thanks ljarvis :)
[14:51:34] ljarvis: right, method() is a method call, but it returns an instance of Method, which has a .call method, that you can invoke with the .() syntax. Try this: method(:mult).(1, 2)
[14:51:35] trwyth: yeeeeeahhh so I was trying to invoke Call on method... which I'm guessing is the same as just asking it to return itself?
[14:52:04] trwyth: not sure if I'll remember that after I go to sleep tonight
[14:52:10] trwyth: but eventually I'll know it well :)
[14:52:26] ljarvis: well you're calling the method method with 0 args, but it obviously expects one
[14:52:47] patarr: has joined #ruby
[14:53:11] ljarvis: that would have worked if `method` was something that did not expect any arguments and returned an object that responded to .call :)
[14:54:01] ljarvis: >> class Thing; def self.call; "here"; end; end; def thing() Thing; end; thing.()
[14:54:02] ruby[bot]: ljarvis: # => "here" (https://eval.in/799388)
[14:54:15] dminuoso: apeiros: Do you have that gist of yours regarding encoding and encoding issues at hand?
[14:55:03] dionysus69: has joined #ruby
[14:56:29] Pumukel: has joined #ruby
[15:00:25] rippa: has joined #ruby
[15:01:49] Pumukel: has joined #ruby
[15:02:04] Rodya_: has joined #ruby
[15:03:39] Newbs: has joined #ruby
[15:04:22] mim1k: has joined #ruby
[15:05:15] Pumukel: has joined #ruby
[15:05:20] bilal: has joined #ruby
[15:05:40] blackmes1: has joined #ruby
[15:06:42] chouhoulis: has joined #ruby
[15:08:09] cschneid_: has joined #ruby
[15:08:50] mas886: has joined #ruby
[15:09:00] vahe: has joined #ruby
[15:09:45] mas886: Is there something like "buf = msg.split()[:3]" <- This (python) in ruby? (To create an array and grab the number of elements defined by :3))
[15:11:22] raul7821: has joined #ruby
[15:11:25] bilal: has joined #ruby
[15:11:31] nobitano_: has joined #ruby
[15:11:32] majuk: has joined #ruby
[15:11:59] istrasci: has joined #ruby
[15:12:18] istrasci: HEREDOCs implicitly have a newline at the end that is often undesirable.  Is there a way to auto chomp! it in the syntax, or you just have to do it manually?
[15:12:41] itarato4: has joined #ruby
[15:12:52] mikecmpbll: mas886 : lots of different ways .. msg.split.take 3
[15:13:16] mikecmpbll: msg.split[0..2]; msg.split[0, 3]
[15:13:33] ljarvis: istrasci: manually, you could wrap your heredoc in a method that does it though
[15:14:01] mas886: mikecmpbll: Thanks :)
[15:14:05] mikecmpbll: if msg is a string, drop the split.
[15:14:10] mikecmpbll: and use `[]` :)
[15:14:24] johnny56: has joined #ruby
[15:14:24] nicoulaj: has joined #ruby
[15:14:48] raul782: has joined #ruby
[15:24:27] boakes: has joined #ruby
[15:27:39] mrconfused: has joined #ruby
[15:28:59] Mutter: has joined #ruby
[15:33:09] brent__: has joined #ruby
[15:33:36] brent__: has joined #ruby
[15:34:20] intermo[m]: has joined #ruby
[15:39:46] olivier__: has joined #ruby
[15:40:47] Pumukel: has joined #ruby
[15:42:19] TomyLobo: has joined #ruby
[15:42:42] theunraveler: has joined #ruby
[15:45:34] xall: has joined #ruby
[15:49:56] __Yiota: has joined #ruby
[15:54:03] MrBismuth: has joined #ruby
[15:55:23] igniting: has joined #ruby
[15:55:23] Pumukel: has joined #ruby
[15:55:34] Pumukel: has joined #ruby
[15:56:04] itarato4: has joined #ruby
[15:56:50] dionysus69: has joined #ruby
[15:57:22] ascarter: has joined #ruby
[15:57:34] flying: has joined #ruby
[15:58:34] oborot: has joined #ruby
[15:58:47] tgragnato: has joined #ruby
[15:59:01] synthroid: has joined #ruby
[16:00:47] amclain: has joined #ruby
[16:02:21] raul782: has joined #ruby
[16:02:42] rakm: has joined #ruby
[16:03:21] Rodya_: has joined #ruby
[16:08:12] ResidentBiscuit: has joined #ruby
[16:10:10] ych: has joined #ruby
[16:10:44] ascarter: has joined #ruby
[16:11:04] gusrub: has joined #ruby
[16:13:56] etehtsea: has joined #ruby
[16:14:58] igniting: has joined #ruby
[16:16:12] tomphp: has joined #ruby
[16:18:55] bruno-: has joined #ruby
[16:18:56] alazred: has joined #ruby
[16:18:56] alazred: has joined #ruby
[16:21:45] kristofferR: has joined #ruby
[16:22:08] chouhoulis: has joined #ruby
[16:23:21] olivier__: has joined #ruby
[16:28:12] ResidentBiscuit: has joined #ruby
[16:28:22] olivier__: has joined #ruby
[16:29:07] guacamole: has joined #ruby
[16:32:26] muelleme: has joined #ruby
[16:35:23] al2o3-cr: has joined #ruby
[16:37:18] bkxd: has joined #ruby
[16:39:15] itarato4: has joined #ruby
[16:40:05] feal: has joined #ruby
[16:40:23] redaudit: has joined #ruby
[16:42:40] bkxd: has joined #ruby
[16:43:47] unshadow: has joined #ruby
[16:46:39] fern: has joined #ruby
[16:46:46] nitric: has joined #ruby
[16:48:08] jackrandom: has joined #ruby
[16:48:19] nicesignal: has joined #ruby
[16:48:40] ltem: has joined #ruby
[16:49:24] olivier__: has joined #ruby
[16:50:22] griffindy: has joined #ruby
[16:52:01] lacuna: has joined #ruby
[16:56:27] KnownSyntax: has joined #ruby
[16:56:27] KnownSyntax: has joined #ruby
[16:58:38] zachk: has joined #ruby
[16:59:40] __Yiota: has joined #ruby
[17:00:12] Mutter: has joined #ruby
[17:00:32] uZiel: has joined #ruby
[17:04:17] mim1k: has joined #ruby
[17:05:13] __Yiota: has joined #ruby
[17:05:17] duderonomy: has joined #ruby
[17:06:18] User458764: has joined #ruby
[17:10:04] rdw200169_: has joined #ruby
[17:11:31] SeepingN: has joined #ruby
[17:16:43] uZiel: has joined #ruby
[17:17:23] DrCode: has joined #ruby
[17:17:26] kradnl: has joined #ruby
[17:20:21] blackmes1: has joined #ruby
[17:20:24] skweek: has joined #ruby
[17:24:53] uZiel: any way to zip two arrays to form a hash?
[17:25:24] al2o3-cr: uZiel: a1.zip(a2).to_h
[17:25:53] xall: has joined #ruby
[17:27:19] istrasci: has left #ruby: ()
[17:27:28] itarato4: has joined #ruby
[17:29:13] Cohedrin: has joined #ruby
[17:30:00] cschneid_: has joined #ruby
[17:30:16] GGMethos: has joined #ruby
[17:30:28] kradnl: has joined #ruby
[17:33:04] raul782: has joined #ruby
[17:34:18] alibby: has joined #ruby
[17:36:51] Mutter: has joined #ruby
[17:40:35] ascarter: has joined #ruby
[17:40:57] griffindy: has joined #ruby
[17:43:32] u0_a190: has joined #ruby
[17:44:25] raul782: has joined #ruby
[17:47:42] kradnl: has joined #ruby
[17:47:47] Rodya_: has joined #ruby
[17:49:01] postmodern: has joined #ruby
[17:50:34] itarato4: has joined #ruby
[17:51:19] Mutter: has joined #ruby
[17:51:39] Mutter: has left #ruby: ()
[17:52:11] haylon: has joined #ruby
[17:52:53] haylon: has joined #ruby
[17:53:55] jrafanie: has joined #ruby
[17:54:47] enterprisey: has joined #ruby
[17:58:35] itarato4: has joined #ruby
[17:58:48] chouhoul_: has joined #ruby
[18:02:30] cfec0b8d: has joined #ruby
[18:05:28] ascarter: has joined #ruby
[18:07:10] Rodya_: has joined #ruby
[18:07:46] hahuang65: has joined #ruby
[18:09:44] bilal: has joined #ruby
[18:09:59] jackrandom: has joined #ruby
[18:11:09] mrconfused: has joined #ruby
[18:11:39] oborot: has joined #ruby
[18:12:29] __Yiota: has joined #ruby
[18:14:13] nothingnew: has joined #ruby
[18:14:28] jphase: has joined #ruby
[18:14:45] psychici1t__: has joined #ruby
[18:17:55] raul782: has joined #ruby
[18:18:01] Rodya_: has joined #ruby
[18:18:08] lacuna: has joined #ruby
[18:18:20] jphase: has joined #ruby
[18:19:53] haylon: has joined #ruby
[18:20:27] gothicsouth: has joined #ruby
[18:21:48] arup_r: has joined #ruby
[18:22:28] arup_r: Hi We have some data encrypted using this lib. Now we are migrating data to Ruby. So which lib I should use to decrypt them?
[18:22:31] arup_r: https://laravel.com/docs/5.0/encryption
[18:22:34] vall: has joined #ruby
[18:23:03] arup_r: Need to know the equivalent Ruby way of the above link ^
[18:24:15] cschneid_: has joined #ruby
[18:24:28] pankaj_: has joined #ruby
[18:25:05] chouhoulis: has joined #ruby
[18:27:02] trwyth: arup_r: http://ruby-doc.org/stdlib-2.0.0/libdoc/openssl/rdoc/OpenSSL/Cipher.html is probably a good place to start.
[18:27:12] trwyth: that was the first google hit for 'ruby aes'
[18:27:26] cek: has joined #ruby
[18:27:31] trwyth: I'm a total beginner. Experts won't help you if you don't look for yourself first.
[18:27:53] cek: Looking for a way to access an element of range for the given index in shortest possible way
[18:28:20] cek: actually, for shortest possible code
[18:28:35] arup_r: trwyth: I did try it,, and now I am here to find some helps. thanks I will try
[18:28:53] trwyth: ok.. use google more though
[18:28:57] trwyth: it's really the best way
[18:28:59] psychicist__: has joined #ruby
[18:29:04] cek: well, not #to_a, but something along #find_with_index
[18:29:48] arup_r: trwyth: well. that is the lib I am using to get some result. But no luck so far.
[18:29:50] jusa: has joined #ruby
[18:30:10] trwyth: oh I see.. you should post a real question then
[18:30:33] trwyth: like what problem you're having
[18:32:06] ascarter: has joined #ruby
[18:36:14] mrconfused: has joined #ruby
[18:36:50] raul782: has joined #ruby
[18:37:18] minimalism: has joined #ruby
[18:39:27] tristanp: has joined #ruby
[18:40:28] conta3: has joined #ruby
[18:41:04] cam27: has joined #ruby
[18:41:07] conta3: has joined #ruby
[18:43:25] bilal_: has joined #ruby
[18:45:42] __Yiota: has joined #ruby
[18:45:58] yeticry: has joined #ruby
[18:46:40] fern: has joined #ruby
[18:48:45] redaudit: has joined #ruby
[18:49:41] bonhoeffer: has joined #ruby
[18:51:45] vall: has joined #ruby
[18:54:24] clamstar: has joined #ruby
[18:55:04] fern: has joined #ruby
[18:55:06] rkazak: has joined #ruby
[18:57:23] ShekharReddy: has joined #ruby
[18:57:25] haylon: has joined #ruby
[18:58:00] itarato: has joined #ruby
[19:01:31] mikecmpbll: has joined #ruby
[19:01:32] nowhere_man: has joined #ruby
[19:03:13] dviola: has joined #ruby
[19:04:05] mrconfused: has joined #ruby
[19:04:58] oborot: has joined #ruby
[19:05:22] nobitanobi: has joined #ruby
[19:08:06] fern: has joined #ruby
[19:11:04] lxsameer: has joined #ruby
[19:11:16] majuk: has joined #ruby
[19:13:47] fern: has joined #ruby
[19:14:18] chouhoulis: has joined #ruby
[19:16:52] bilal: has joined #ruby
[19:16:57] fern: has joined #ruby
[19:17:08] itarato: has joined #ruby
[19:19:22] BTRE: has joined #ruby
[19:22:38] patr0clus: has joined #ruby
[19:26:06] ascarter: has joined #ruby
[19:28:17] fern: has joined #ruby
[19:29:09] bonhoeffer: has joined #ruby
[19:31:34] bilal_: has joined #ruby
[19:32:09] olivier__: has joined #ruby
[19:32:53] hxegon: cek #each_with_index#find { |e, i| ...
[19:33:24] redCOAT_: has joined #ruby
[19:33:37] tgragnato: has joined #ruby
[19:33:44] olivier__: has joined #ruby
[19:33:52] al2o3-cr: hxegon: they probably want Range#find_index
[19:33:53] Cohedrin: has joined #ruby
[19:34:09] fern: has joined #ruby
[19:34:28] hxegon: al2o3-cr: ah, ok. That's what I get for not reading the full context
[19:34:37] bilal: has joined #ruby
[19:34:46] al2o3-cr: hxegon: no worries :)
[19:35:14] itarato: has joined #ruby
[19:35:36] cek: no, why, he's right. ('a'..'x').each_with_index.find {|e, i| i == 2 }
[19:37:01] cek: have forgotten each_with_index can return an enum
[19:37:10] hxegon: enums are the best :)
[19:37:43] al2o3-cr: oh, it was that misread it then :P
[19:37:49] mrconfused: has joined #ruby
[19:38:01] hxegon: maybe this has already been said, but why can't you use (a..n).to_a[i] cek?
[19:38:22] cek: because (1..10**29)
[19:39:11] cek: (slightly exaggerating)
[19:40:00] chouhoul_: has joined #ruby
[19:40:11] fern: has joined #ruby
[19:40:47] al2o3-cr: cek: is it numbers your dealing with?
[19:41:05] hxegon: Are there any ruby list types with O(1) access to element by index?
[19:41:48] hxegon: ACTION googles it
[19:43:41] al2o3-cr: cek: do you want the index and element returned?
[19:43:44] hxegon: actually I think ruby's arrays are already O(1) index lookup because they are basically tables under the hood... could be wrong, but that's what a brief google shows me
[19:44:04] cek: no, i already got the answer, thanks.
[19:44:12] yqt: has joined #ruby
[19:44:31] cek: has left #ruby: ()
[19:44:59] majuk: has left #ruby: ()
[19:45:01] majuk: has joined #ruby
[19:45:08] jimothy: has joined #ruby
[19:45:17] ascarter: has joined #ruby
[19:45:36] jimothy: has left #ruby: ()
[19:46:44] gothicsouth: has joined #ruby
[19:47:23] User458764: has joined #ruby
[19:48:32] romeoh: has joined #ruby
[19:52:55] User4587_: has joined #ruby
[19:53:31] olivier__: has joined #ruby
[19:54:33] Dimik: has joined #ruby
[19:54:39] xall: has joined #ruby
[19:59:33] dminuoso: hxegon: arrays are indeed O(1) for random access.
[19:59:34] alibby: has left #ruby: ()
[19:59:46] dminuoso: hxegon: They grow (chunkwise) at the end even.
[20:00:58] vall: has joined #ruby
[20:01:17] dminuoso: hxegon: A Ruby array is basically just this structure https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L1006-L1011
[20:02:03] dminuoso: (Though depending on the size it can also be "ary" instead of "heap" which is basically Rubys way of keeping small arrays. This is why tiny arrays are not really more expensive.
[20:03:19] olivier__: has joined #ruby
[20:09:29] vall: has joined #ruby
[20:13:11] cdg: has joined #ruby
[20:15:35] tildes: has joined #ruby
[20:16:06] shinnya: has joined #ruby
[20:19:02] Silox|: has joined #ruby
[20:22:11] patr0clus: has joined #ruby
[20:23:01] raul782: has joined #ruby
[20:30:19] ForeignBiscuit: has joined #ruby
[20:33:40] bonhoeffer: has joined #ruby
[20:34:03] tomphp: has joined #ruby
[20:35:39] cagomez: has joined #ruby
[20:37:25] olivier__: has joined #ruby
[20:41:49] haylon: has joined #ruby
[20:42:34] ur5us: has joined #ruby
[20:42:38] jrafanie: has joined #ruby
[20:43:25] brendan-: has joined #ruby
[20:43:27] hahuang65: has joined #ruby
[20:43:32] raspado: has joined #ruby
[20:45:22] tgragnato: has joined #ruby
[20:45:41] tomphp: has joined #ruby
[20:47:10] duderonomy: has joined #ruby
[20:47:38] jphase: has joined #ruby
[20:48:51] olivier__: has joined #ruby
[20:49:28] minimalism: has joined #ruby
[20:51:49] tomphp: has joined #ruby
[20:52:20] gusrub: has joined #ruby
[20:56:10] tgragnato: has joined #ruby
[20:57:33] vall: has joined #ruby
[21:00:46] JoshS: has joined #ruby
[21:01:45] gusrub: has joined #ruby
[21:02:51] fern: has joined #ruby
[21:06:48] preyalone: has joined #ruby
[21:07:53] unsymbol: has joined #ruby
[21:08:17] marr: has joined #ruby
[21:08:33] tomphp: has joined #ruby
[21:11:31] ascarter: has joined #ruby
[21:11:44] Rodya_: has joined #ruby
[21:14:21] skweek: has joined #ruby
[21:17:41] electrostat: has joined #ruby
[21:22:57] jphase: has joined #ruby
[21:24:42] olivier__: has joined #ruby
[21:26:54] tgragnato: has joined #ruby
[21:27:55] jenrzzz: has joined #ruby
[21:28:44] gothicsouth: has joined #ruby
[21:31:25] romeoh: has joined #ruby
[21:31:30] VladGh: has joined #ruby
[21:32:00] hinbody: has joined #ruby
[21:32:38] herbmillerjr: has joined #ruby
[21:32:43] zapata: has joined #ruby
[21:33:43] cagomez: has joined #ruby
[21:34:48] cagomez: has joined #ruby
[21:37:28] fern: has joined #ruby
[21:41:42] enterprisey: has joined #ruby
[21:43:03] fern: has joined #ruby
[21:43:10] ascarter: has joined #ruby
[21:46:03] fern: has joined #ruby
[21:47:33] jusa: has joined #ruby
[21:47:34] hxegon: Anyone here switch from vim or emacs to rubymine? Never used an IDE before and I'm wondering what I'm missing
[21:49:14] baweaver: a smug sense of superiority
[21:49:43] baweaver: joking aside, I just don't really use an IDE for Ruby so I couldn't say
[21:50:13] hxegon: besides that, and the knowledge that if someone tries to use my computer when I'm on lunch or something they're in for a surprise
[21:53:21] hxegon: because <smug> I use dvorak *and* vim </smug>
[21:55:07] hxegon: with qwerty keycaps, just to try and convince anyone watching that I'm actually on hackertyper
[21:59:36] eam: I briefly used rubymine, it didn't last long
[22:02:58] kaleido: has joined #ruby
[22:03:25] ascarter: has joined #ruby
[22:05:48] SeepingN: much power. it also NEEDS much power, unless they've tamed the java beast
[22:06:44] SeepingN: security hole much?
[22:06:46] SeepingN: "As of now, we have resolved most of Java 8 issues for this OS and bundle our custom patched Java version that works the best. "
[22:07:05] SeepingN: nothing brings warm fuzzies like "custom patched java"
[22:08:12] kaleido: i definitely feel the warmth
[22:08:27] fmccann: has joined #ruby
[22:08:51] mrconfused: has joined #ruby
[22:11:09] redCOAT_: DLSteve where would you start to solve it?
[22:12:18] redCOAT_: or learn how to do it
[22:12:31] bonhoeffer: has joined #ruby
[22:14:07] mas886: has joined #ruby
[22:14:07] mas886: has joined #ruby
[22:14:38] hahuang65: has joined #ruby
[22:16:21] mrconfused: has joined #ruby
[22:17:12] jenrzzz: has joined #ruby
[22:17:12] jenrzzz: has joined #ruby
[22:17:45] luckyruby: has joined #ruby
[22:17:56] Qommand0r: has joined #ruby
[22:19:20] bilal: has joined #ruby
[22:20:05] romeoh: has joined #ruby
[22:20:14] romeoh: has joined #ruby
[22:20:28] lele: has joined #ruby
[22:20:32] bkxd: has joined #ruby
[22:25:04] SCHAPiE: has joined #ruby
[22:31:27] pragmaticus: has joined #ruby
[22:32:19] mrconfused: has joined #ruby
[22:36:12] JeanCarloMachado: has joined #ruby
[22:36:14] JeanCarl1Machado: has joined #ruby
[22:37:33] olivier__: has joined #ruby
[22:38:01] bruno-_: has joined #ruby
[22:38:08] tgragnato: has joined #ruby
[22:39:58] AndBobsYourUncle: has joined #ruby
[22:41:24] Rodya_: has joined #ruby
[22:42:51] God: has joined #ruby
[22:44:08] cam27: has joined #ruby
[22:45:25] t-recx: has joined #ruby
[22:52:05] raul782: has joined #ruby
[22:53:29] azwieg103: has joined #ruby
[22:55:10] KnownSyntax: has joined #ruby
[22:55:10] KnownSyntax: has joined #ruby
[22:56:05] mim1k: has joined #ruby
[22:58:09] fmccann: has joined #ruby
[23:02:23] zachk: has joined #ruby
[23:02:33] zachk: has joined #ruby
[23:02:57] _aeris_: has joined #ruby
[23:03:02] jamesaxl: has joined #ruby
[23:03:56] enterprisey: has joined #ruby
[23:06:57] nobitanobi: has joined #ruby
[23:07:37] jphase: has joined #ruby
[23:08:42] cschneid_: has joined #ruby
[23:09:24] zachk: has joined #ruby
[23:10:50] zachk: has joined #ruby
[23:12:08] tAn: has joined #ruby
[23:12:17] zachk: has joined #ruby
[23:12:53] Fire-Dragon-DoL: has joined #ruby
[23:17:40] charliesome: has joined #ruby
[23:26:43] Dimik: has joined #ruby
[23:32:44] aep: has joined #ruby
[23:34:09] cschneid_: has joined #ruby
[23:34:58] SeepingN: whoa, wtf. Suddenly none of my scripts can require 'trollop'. It was working fine. It shows as installed with "sudo gem list". How can this even be?
[23:35:52] bw\: has joined #ruby
[23:36:48] jhack: has joined #ruby
[23:36:48] jhack: has joined #ruby
[23:36:58] havenwood: SeepingN: Sanity check: sudo gem which trollup
[23:38:26] Nicmavr: has joined #ruby
[23:41:02] havenwood: SeepingN: Is that location in a directory in the Gem PATH?: sudo ruby -e "puts Gem.path"
[23:42:05] havenwood: SeepingN: (It's called trollop though.)
[23:42:17] havenwood: Unless this is an unpublished gem.
[23:42:40] Rodya_: has joined #ruby
[23:43:28] havenwood: Oh, i'm the one who misspelled it. Heh. My brain broke.
[23:46:57] jenrzzz: has joined #ruby
[23:48:27] jusa: has joined #ruby
[23:52:44] DrCode: has joined #ruby
[23:53:02] Kestrel-029: has joined #ruby
[23:54:32] alveric3: has joined #ruby
[23:56:24] gnufied: has joined #ruby