« Back to channel list

#ruby - 08 July 2017

« Back 1 day Forward 1 day »
[00:03:34] vondruch: has joined #ruby
[00:05:39] hkdsun_: has joined #ruby
[00:07:03] eckhardt: has joined #ruby
[00:14:52] bronson: has joined #ruby
[00:15:06] impermanence: has joined #ruby
[00:17:11] vondruch: has joined #ruby
[00:21:10] sleepee: has joined #ruby
[00:21:21] vondruch: has joined #ruby
[00:23:19] gothicsouth: has joined #ruby
[00:25:30] vondruch: has joined #ruby
[00:26:01] mim1k: has joined #ruby
[00:33:38] vondruch: has joined #ruby
[00:33:55] ascarter: has joined #ruby
[00:39:09] eckhardt: has joined #ruby
[00:42:35] cahoots: has joined #ruby
[00:50:36] kculpis: has joined #ruby
[00:50:48] jenrzzz: has joined #ruby
[00:50:48] jenrzzz: has joined #ruby
[00:55:10] hkdsun: has joined #ruby
[00:57:15] vondruch: has joined #ruby
[01:03:25] vondruch: has joined #ruby
[01:09:21] ketan: has joined #ruby
[01:10:47] Bhootrk_: has joined #ruby
[01:13:26] Nitza: has joined #ruby
[01:17:05] knight33: has joined #ruby
[01:17:35] vondruch: has joined #ruby
[01:18:10] Rr4sT: has joined #ruby
[01:28:02] mim1k: has joined #ruby
[01:33:12] vondruch: has joined #ruby
[01:34:01] sleepee: has joined #ruby
[01:39:25] choke: has joined #ruby
[01:41:20] vondruch: has joined #ruby
[01:43:15] gizmore|2: has joined #ruby
[01:45:31] vondruch: has joined #ruby
[01:47:33] bkxd: has joined #ruby
[01:47:35] bkxd_: has joined #ruby
[01:50:20] duderonomy: has joined #ruby
[01:51:30] boombox_: has joined #ruby
[01:53:41] vondruch: has joined #ruby
[01:56:24] xall: has joined #ruby
[01:56:47] oscurochu: has joined #ruby
[01:57:13] oscurochu: has left #ruby: ()
[01:57:21] vondruch: has joined #ruby
[02:01:31] vondruch: has joined #ruby
[02:01:42] d^sh: has joined #ruby
[02:02:12] br0d1n: has joined #ruby
[02:04:05] br0d1n: has joined #ruby
[02:15:11] _whitelogger: has joined #ruby
[02:17:36] ecuanaso: has joined #ruby
[02:31:01] mim1k: has joined #ruby
[02:33:51] vondruch: has joined #ruby
[02:37:32] vondruch: has joined #ruby
[02:41:43] vondruch: has joined #ruby
[02:45:21] vondruch: has joined #ruby
[02:48:34] ascarter_: has joined #ruby
[02:52:27] GinoMan2440: has joined #ruby
[02:55:30] vondruch: has joined #ruby
[02:55:55] jenrzzz: has joined #ruby
[02:55:55] jenrzzz: has joined #ruby
[02:59:53] knight33: has joined #ruby
[03:01:46] AnoHito_: has joined #ruby
[03:03:02] TvL2386_: has joined #ruby
[03:04:58] sspreitz: has joined #ruby
[03:07:50] mokiwis: has joined #ruby
[03:09:28] __Yiota: has joined #ruby
[03:10:13] ketan: has joined #ruby
[03:10:30] brent__: has joined #ruby
[03:13:32] Joufflu_Fail: has joined #ruby
[03:17:46] juanca_: has joined #ruby
[03:20:03] AnoHito: has joined #ruby
[03:23:45] vondruch: has joined #ruby
[03:25:01] mim1k: has joined #ruby
[03:28:51] charliesome: has joined #ruby
[03:29:25] vondruch: has joined #ruby
[03:30:08] nicesignal: has joined #ruby
[03:31:28] rhyselsmore: has joined #ruby
[03:31:47] meadmoon: has joined #ruby
[03:33:45] nobitanobi: has joined #ruby
[03:37:27] AnoHito_: has joined #ruby
[03:44:14] gix: has joined #ruby
[03:51:10] _whitelogger: has joined #ruby
[03:51:19] hutch34: has joined #ruby
[03:53:14] knight33: has joined #ruby
[03:54:26] __Yiota: has joined #ruby
[04:00:31] lpio: has joined #ruby
[04:01:20] mim1k: has joined #ruby
[04:01:26] arescorpio: has joined #ruby
[04:03:41] lpio: I have a basic question about hashes. I'm using Ruby 2.3.1. If I create a new hash a = {font_size: 10, font_family: "Arial"} a[:font_size] returns 10 but a["font_size"] returns nil. Does the second case not get converted to a symbol as well?
[04:03:49] AnoHito_: has joined #ruby
[04:08:34] brent__: has joined #ruby
[04:09:53] AnoHito_: has joined #ruby
[04:13:51] Periapsis: has joined #ruby
[04:16:45] bronson: has joined #ruby
[04:16:51] Nitza: has joined #ruby
[04:17:36] vondruch: has joined #ruby
[04:21:13] vondruch: has joined #ruby
[04:21:16] hutch34: has joined #ruby
[04:25:24] vondruch: has joined #ruby
[04:33:31] vondruch: has joined #ruby
[04:36:51] brent__: has joined #ruby
[04:42:44] Silthias1: has joined #ruby
[04:49:40] vondruch: has joined #ruby
[04:50:28] milardovich: has joined #ruby
[05:01:21] vondruch: has joined #ruby
[05:04:08] Periapsis: has joined #ruby
[05:05:28] bkxd: has joined #ruby
[05:05:31] vondruch: has joined #ruby
[05:10:00] bkxd_: has joined #ruby
[05:11:05] ketan: has joined #ruby
[05:13:11] vondruch: has joined #ruby
[05:14:32] xall: has joined #ruby
[05:16:00] Geschopf: has joined #ruby
[05:16:39] bronson: has joined #ruby
[05:17:37] MarkBilk: has joined #ruby
[05:19:12] Bock: has joined #ruby
[05:27:01] Doukeshi: has joined #ruby
[05:28:41] shiranuidong: has joined #ruby
[05:29:56] juanca_: has joined #ruby
[05:32:34] Doukeshi: has joined #ruby
[05:36:57] juanca_: has joined #ruby
[05:37:11] Mia: has joined #ruby
[05:37:11] Mia: has joined #ruby
[05:45:17] Doukeshi: has joined #ruby
[05:48:14] shiranuidong: has joined #ruby
[05:50:49] ascarter: has joined #ruby
[05:51:21] vondruch: has joined #ruby
[05:53:48] bkxd: has joined #ruby
[05:53:48] shiranuidong: has joined #ruby
[05:54:12] bkxd_: has joined #ruby
[05:55:33] shiranuidong: has joined #ruby
[05:56:33] shiranuidong: has joined #ruby
[06:00:16] ltem: has joined #ruby
[06:03:19] shiranuidong: has joined #ruby
[06:04:19] rhyselsmore: has joined #ruby
[06:05:37] shiranuidong: has joined #ruby
[06:09:05] shiranuidong: has joined #ruby
[06:14:29] havenwood: lpio: A Symbol is a different thing than a String. Rails has HashWithIndifferentAccess that conflates the two.
[06:14:47] lpio: @havenwood oh I see. Thanks!
[06:14:56] lpio: havenwood: ^
[06:17:21] bronson: has joined #ruby
[06:20:38] Nitza: has joined #ruby
[06:21:21] mesamoo: has joined #ruby
[06:35:45] nofxxxx: has joined #ruby
[06:37:25] dcunit3d: has joined #ruby
[06:44:59] AnoHito: has joined #ruby
[06:52:12] patarr: has joined #ruby
[06:57:04] Ishido: has joined #ruby
[07:11:56] ketan: has joined #ruby
[07:12:14] rohitpaulk: has joined #ruby
[07:13:37] enterprisey: has joined #ruby
[07:16:36] nofxx: has joined #ruby
[07:18:09] bronson: has joined #ruby
[07:33:58] yeticry: has joined #ruby
[07:35:13] rohitpaulk: has joined #ruby
[07:52:58] moei: has joined #ruby
[07:59:31] vondruch: has joined #ruby
[08:01:18] dionysus69: has joined #ruby
[08:08:14] rohitpaulk: has joined #ruby
[08:08:51] meshsmith: has joined #ruby
[08:08:51] meshsmith: has joined #ruby
[08:18:57] bronson: has joined #ruby
[08:20:09] nemesit|znc: has joined #ruby
[08:21:04] Nitza: has joined #ruby
[08:23:00] marr: has joined #ruby
[08:23:17] ur5us: has joined #ruby
[08:24:02] InfinityFye: has joined #ruby
[08:24:31] djbkd: has joined #ruby
[08:29:30] rohitpaulk: has joined #ruby
[08:37:09] hutch34: has joined #ruby
[08:37:31] belmoussaoui___: has joined #ruby
[08:41:42] ddddddd: has joined #ruby
[08:42:32] Nitza: has joined #ruby
[08:46:44] roshanavand: has joined #ruby
[08:49:03] stamina: has joined #ruby
[08:52:59] patarr: has joined #ruby
[08:59:24] kies: has joined #ruby
[09:01:17] kent\n: has joined #ruby
[09:07:48] dionysus69: has joined #ruby
[09:12:48] ketan: has joined #ruby
[09:17:38] psychicist__: has joined #ruby
[09:20:09] bronson: has joined #ruby
[09:22:25] InfinityFye: has joined #ruby
[09:24:05] InfinityFye: has joined #ruby
[09:38:01] belmoussaoui: has joined #ruby
[09:41:41] ur5us: has joined #ruby
[09:45:03] ecuanaso: has joined #ruby
[09:45:11] vondruch: has joined #ruby
[09:48:47] faraco: has joined #ruby
[09:49:34] faraco: hi guys, what is the equivalent of Python 'if word in sentence' for Ruby?
[09:50:03] biberu: has joined #ruby
[09:50:11] faraco: I know I can use regex =~, but I don't think it is good for simple string checking.
[09:50:11] ytti: can you please give real example
[09:51:19] vondruch: has joined #ruby
[09:51:23] ytti: sentence.split.include? word
[09:51:48] faraco: for symbol in message: if symbol in LETTERS: do_something()
[09:52:15] ytti: sentence.include? word
[09:52:17] ytti: seems to work too
[09:52:28] ytti: (i did not know that)
[09:52:54] dminuoso: havenwood: Sadly.
[09:55:01] Nitza: "hello worlds".include? "world" will be true. Probably best to split and check the array includes the words you want?
[09:55:16] ascarter: has joined #ruby
[09:55:51] Zarthus: nitza: it is equivelent to python's "if word in sentence" though
[09:56:12] Nitza: Zarthus ah yeah, that _was_ the question :)
[10:01:05] andrzejku: has joined #ruby
[10:06:51] Nitza: has joined #ruby
[10:11:11] bkxd: has joined #ruby
[10:12:36] bkxd_: has joined #ruby
[10:13:10] l0ve: has joined #ruby
[10:13:59] Silthias: has joined #ruby
[10:14:26] l0ve: So i have basicly 0 knowlege of Ruby and was thinking how hard it is.. What can you say about it?
[10:20:56] bronson: has joined #ruby
[10:24:18] anisha: has joined #ruby
[10:24:23] apeiros: ACTION highly doubts that python actually does check whether a *word* exists in a string with `if word in sentence`
[10:25:28] apeiros: I assume that's either "substring in string" or "item in array" (or both). both equivalent to subject.include?(element) in ruby (for `element in subject`)
[10:26:11] tvw: has joined #ruby
[10:26:34] dminuoso: ACTION pokes apeiros with a pure function
[10:26:50] dminuoso: Can't sue me, it had no side effect on you.
[10:26:50] apeiros: ACTION spoils it so it becomes an impure function
[10:27:16] apeiros: ACTION goes back to defeat ganon
[10:27:25] dminuoso: Sounds like Zelda
[10:28:17] apeiros: no, that poor lady has been trapped with ganon for 100 years without defeating him (it?)
[10:38:14] nowhere_man: has joined #ruby
[10:43:03] lxsameer: has joined #ruby
[10:43:47] belmoussaoui: has joined #ruby
[10:46:18] anisha: has joined #ruby
[10:49:55] belmoussaoui: has joined #ruby
[10:50:26] sepp2k: has joined #ruby
[10:53:56] patarr: has joined #ruby
[10:55:50] Zarthus: apeiros: it's basically strpos
[10:55:59] Zarthus: and yes, it also works for arrays
[10:56:42] davic: has joined #ruby
[10:57:32] dionysus69: has joined #ruby
[10:59:21] xall: has joined #ruby
[11:03:12] _whitelogger: has joined #ruby
[11:03:42] uZiel: has joined #ruby
[11:07:57] nitza_: has joined #ruby
[11:10:50] Silthias: has joined #ruby
[11:11:10] l0ve_: has joined #ruby
[11:11:57] rohitpaulk: has joined #ruby
[11:13:06] workmad3: has joined #ruby
[11:13:47] ketan: has joined #ruby
[11:21:29] rapha: Is there any way to select all those tags with Nokogiri that do not contain any further tags? My best try so far is doc.css('*').xpath('text()') {|n| n.parent}, but when I try n.parent.content.strip! inside of that (which is the point of the exercise) nothing happens.
[11:21:47] bronson: has joined #ruby
[11:22:58] rapha: But n.content='Meh' works. Strange.
[11:23:34] rapha: Albeit mildly entertaining to have a big and complicated HTML document that reads "Meh Meh Meh" all the way.
[11:27:34] dcunit3d: has joined #ruby
[11:30:49] anisha: has joined #ruby
[11:35:43] armyriad: has joined #ruby
[11:36:43] rapha: Okay, better question: how do I find out what the things I get from "blah".bytes actually are? I.e. what their Unicode code is? (A space character is 32 which is not the same as 0020)
[11:43:51] nowhere_man: has joined #ruby
[11:44:23] anisha: has joined #ruby
[11:48:20] anisha: has joined #ruby
[11:49:22] l0ve_: has joined #ruby
[11:50:42] elomatreb: rapha: If you want the codepoints, make sure your String has the correct encoding and call #codepoints
[11:52:51] anisha: has joined #ruby
[11:52:56] elomatreb: And 0020 is the same as 32, it's a hexadecimal number
[11:54:41] rapha: Oh. So easy!
[11:54:48] rapha: ACTION huggles #codepoints and elomatreb
[11:57:45] anisha: has joined #ruby
[11:58:38] workmad3: has joined #ruby
[11:59:33] ketan: has joined #ruby
[12:00:41] rapha: Okay, so the problem is with Nokogiri. It changes a <p>1</p> into a <p> 1</p> for some reason.
[12:04:15] anisha_: has joined #ruby
[12:07:57] anisha_: has joined #ruby
[12:08:21] dminuoso: 14:06:19 elomatreb | [11:52:55] And 0020 is the same as 32, it's a hexadecimal number
[12:08:27] dminuoso: elomatreb: ^- I like you to look at that message.
[12:08:31] dminuoso: And ponder about it.
[12:08:55] dminuoso: If shooting people was legal, I might try it on you.
[12:09:54] ketan: has joined #ruby
[12:09:54] sepp2k: has joined #ruby
[12:11:26] rapha: But s/he is right dminuoso: 2*16+0=32 - ain't it so?
[12:11:45] dminuoso: >> 0020 == 32
[12:11:47] ruby[bot]: dminuoso: # => false (https://eval.in/829579)
[12:11:57] dminuoso: rapha: Now you ponder too.
[12:12:03] rapha: dminuoso: Well, okay, that part was context. Which a computer cannot understand on its own.
[12:12:29] dminuoso: rapha: 020 is octal.
[12:12:32] rapha: >> 32.to_s(16) == "0020"
[12:12:33] ruby[bot]: rapha: # => false (https://eval.in/829582)
[12:12:34] dminuoso: 0x20 is hexadecimal.
[12:12:43] rapha: >> 32.to_s(16)
[12:12:44] ruby[bot]: rapha: # => "20" (https://eval.in/829583)
[12:12:51] rapha: well, close enough...
[12:13:01] dminuoso: rapha: If you write 020 it _means_ octal.
[12:13:12] matthewd: dminuoso: And in context, 0020 is pretty clearly a [hexadecimal] unicode codepoint
[12:13:19] rapha: dminuoso: but the writing was "0020", not "020"
[12:13:19] dminuoso: matthewd: Uhh?
[12:13:28] dminuoso: matthewd: Mmm.
[12:14:03] anisha_: has joined #ruby
[12:14:15] matthewd: "0020 is octal" is just as contextual; claim it's equal to 32 to a person off the street and see how far you get.
[12:14:21] dminuoso: matthewd: I would say its conventional to write U+0020 then but *shrugs*
[12:14:52] matthewd: err, 16, not 32.. but you know what I meant ;)
[12:15:45] dminuoso: matthewd: Still. I feel like calling it "0020" is making up an ambigious notation.
[12:15:57] dminuoso: In particular because in Ruby and some other languages a mere "0" prefix means octal
[12:16:13] ur5us: has joined #ruby
[12:16:14] matthewd: Agree, but elomatreb was quoting the value rapha gave. So the sentence said "0020 is" but actually had an implied "the 0020 you're seeing is"
[12:16:21] dminuoso: Ah. I missed that part.
[12:16:41] dminuoso: Should really get this damn znc fixed
[12:17:10] rapha: >> "For breakfast: #{['scrambled eggs, grilled tomatoes and rye bread', 'musli with oranges, raisins and warm milk', 'rye bread with various spreads and cheeses'][rand(0..2)]}"
[12:17:16] ruby[bot]: rapha: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[12:17:27] rapha: Damn. Now I still don't know.
[12:18:05] Papierkorb: >> ['scrambled eggs, grilled tomatoes and rye bread', 'musli with oranges, raisins and warm milk', 'rye bread with various spreads and cheeses'].sample(2)
[12:18:11] ruby[bot]: Papierkorb: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[12:18:24] anisha_: has joined #ruby
[12:18:34] rapha: Seems the bot is different from what we're used to.
[12:18:52] rapha: >> "For breakfast: #{['scrambled eggs, grilled tomatoes and rye bread', 'musli with oranges, raisins and warm milk', 'rye bread with various spreads and cheeses'].values_at(rand(0..2))}"
[12:18:58] ruby[bot]: rapha: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[12:19:11] rapha: Okay, that's strange.
[12:19:12] matthewd: That's the bot having an internal error, not complaining about your supplied code
[12:19:23] rapha: Did I break it? :(
[12:20:34] rapha: Anyways, the laptop decided for the first choice.
[12:21:06] matthewd: No, it just breaks sometimes -- it relies on a separate remote service to do the actual evaluating
[12:21:29] vondruch: has joined #ruby
[12:22:38] bronson: has joined #ruby
[12:25:06] belmoussaoui: has joined #ruby
[12:25:25] stamina: has joined #ruby
[12:25:50] rapha: I see. Btw, Papierkorb, your version would have to be .sample(1)[0]
[12:26:22] Papierkorb: mis-interpreted your code. In you case, calling #sample without any arguments will return an element without an array
[12:28:08] rapha: Oh, cool, thank you! :)
[12:29:40] vondruch: has joined #ruby
[12:30:03] anisha_: has joined #ruby
[12:37:37] kanye_vest: has joined #ruby
[12:39:19] vondruch: has joined #ruby
[12:42:26] t-recx: has joined #ruby
[12:46:26] belmoussaoui: has joined #ruby
[12:46:54] cahoots: has joined #ruby
[12:47:26] vondruch: has joined #ruby
[12:52:46] belmoussaoui: has joined #ruby
[12:55:35] vondruch: has joined #ruby
[12:57:10] ascarter: has joined #ruby
[13:13:16] vondruch: has joined #ruby
[13:25:26] vondruch: has joined #ruby
[13:29:01] dionysus69: has joined #ruby
[13:29:30] belmoussaoui: has joined #ruby
[13:39:19] lele: has joined #ruby
[13:42:35] elomatreb: dminuoso: ...
[13:43:14] elomatreb: I know of course, I wanted to say that the Unicode codepoint IDs (In the form e.g. U+0020) are hexadecimal
[13:45:24] mahlon_: has joined #ruby
[13:47:20] MarkBilk: has joined #ruby
[13:58:58] cschneid_: has joined #ruby
[13:59:51] Ishido: has joined #ruby
[14:00:58] ltem: has joined #ruby
[14:02:03] djbkd: has joined #ruby
[14:11:47] uZiel: has joined #ruby
[14:17:14] nanoz: has joined #ruby
[14:17:26] br0d1n: has joined #ruby
[14:19:23] milardovich: has joined #ruby
[14:20:31] romankapitonov: has joined #ruby
[14:23:29] bronson: has joined #ruby
[14:36:15] rohitpaulk: has joined #ruby
[14:37:36] vondruch: has joined #ruby
[14:46:27] fgo: has joined #ruby
[14:47:47] romankapitonov: has joined #ruby
[14:48:52] santasquid: has joined #ruby
[14:49:18] vondruch: has joined #ruby
[14:52:28] belmoussaoui: has joined #ruby
[14:55:27] vondruch: has joined #ruby
[14:59:35] vondruch: has joined #ruby
[15:00:36] jgnagy: has joined #ruby
[15:08:07] Tau: has joined #ruby
[15:10:22] freeze: has joined #ruby
[15:15:12] vondruch: has joined #ruby
[15:15:30] conta3: has joined #ruby
[15:17:05] ltem: has joined #ruby
[15:19:45] PaulCapestany: has joined #ruby
[15:23:21] vondruch: has joined #ruby
[15:23:25] Ishido: has joined #ruby
[15:24:22] cdg: has joined #ruby
[15:26:07] milardovich: has joined #ruby
[15:26:16] ascarter: has joined #ruby
[15:27:31] psychicist__: has joined #ruby
[15:29:31] vondruch: has joined #ruby
[15:29:43] roshanavand: has joined #ruby
[15:30:02] konsolebox: has joined #ruby
[15:30:49] zapata: has joined #ruby
[15:31:24] charliesome: has joined #ruby
[15:32:00] DLSteve: has joined #ruby
[15:36:17] kanye_vest: has joined #ruby
[15:37:05] choke: has joined #ruby
[15:37:41] vondruch: has joined #ruby
[15:43:22] vondruch: has joined #ruby
[15:43:46] duderonomy: has joined #ruby
[15:51:39] FastJack_: has joined #ruby
[15:51:40] vondruch: has joined #ruby
[15:52:37] TwoPiece: has joined #ruby
[15:54:50] cseder: has joined #ruby
[15:57:54] sonOfRa: has joined #ruby
[15:59:19] vondruch: has joined #ruby
[16:01:48] knight33: has joined #ruby
[16:03:29] vondruch: has joined #ruby
[16:05:31] shiranuidong: has joined #ruby
[16:09:52] shtirlic: has joined #ruby
[16:10:51] romankapitonov: has joined #ruby
[16:11:39] vondruch: has joined #ruby
[16:12:10] bkxd: has joined #ruby
[16:12:12] bkxd_: has joined #ruby
[16:15:15] vondruch: has joined #ruby
[16:15:21] shtirlic: has joined #ruby
[16:17:46] shtirlic: has joined #ruby
[16:19:43] mathys: has joined #ruby
[16:20:26] shtirlic: has joined #ruby
[16:24:44] bronson: has joined #ruby
[16:25:49] kculpis: has joined #ruby
[16:25:57] FastJack: has joined #ruby
[16:27:38] hutch34: has joined #ruby
[16:35:39] preyalone: has joined #ruby
[16:36:22] sepp2k: has joined #ruby
[16:36:28] cdg_: has joined #ruby
[16:41:51] Mia: has joined #ruby
[16:46:19] rohitpaulk: has joined #ruby
[16:47:10] AnoHito_: has joined #ruby
[16:52:59] AnoHito: has joined #ruby
[16:55:25] boombox_: has joined #ruby
[17:07:05] ionte: has joined #ruby
[17:13:03] kobain: has joined #ruby
[17:13:33] cseder: has joined #ruby
[17:17:24] vondruch: has joined #ruby
[17:18:49] oleo: has joined #ruby
[17:20:46] stamina: has joined #ruby
[17:21:25] mtkd: has joined #ruby
[17:22:31] FastJack: has joined #ruby
[17:25:33] vondruch: has joined #ruby
[17:33:12] vondruch: has joined #ruby
[17:41:21] vondruch: has joined #ruby
[17:44:36] dviola: has joined #ruby
[17:47:48] ddddddd: has joined #ruby
[17:55:45] nobitanobi: has joined #ruby
[17:57:25] vuoto: has joined #ruby
[17:59:26] bronson: has joined #ruby
[18:00:25] bkxd: has joined #ruby
[18:00:27] bkxd_: has joined #ruby
[18:01:29] vondruch: has joined #ruby
[18:03:28] minimalism: has joined #ruby
[18:05:05] AnoHito_: has joined #ruby
[18:05:06] AlexRussia: has joined #ruby
[18:06:37] AlexRussia_: has joined #ruby
[18:08:50] Mia: has joined #ruby
[18:08:59] belmoussaoui__: has joined #ruby
[18:09:38] vondruch: has joined #ruby
[18:13:43] mhib: has joined #ruby
[18:15:17] vondruch: has joined #ruby
[18:17:39] mathys: has joined #ruby
[18:18:30] dviola: has joined #ruby
[18:23:28] vondruch: has joined #ruby
[18:25:26] cdg: has joined #ruby
[18:26:46] TomyLobo2: has joined #ruby
[18:28:50] nobitanobi: has joined #ruby
[18:30:23] bronson: has joined #ruby
[18:32:47] vuoto: has joined #ruby
[18:47:59] cseder: has joined #ruby
[18:53:36] vondruch: has joined #ruby
[18:54:11] Asher: has joined #ruby
[18:59:15] zautomata: has joined #ruby
[18:59:16] ketan: has joined #ruby
[19:01:56] dcunit3d: has joined #ruby
[19:02:12] ascarter_: has joined #ruby
[19:03:16] vondruch: has joined #ruby
[19:07:27] vondruch: has joined #ruby
[19:08:05] stamina: has joined #ruby
[19:08:19] cdg: has joined #ruby
[19:12:44] adavia: has joined #ruby
[19:12:49] impermanence: has joined #ruby
[19:13:22] adavia: how can i fix this https://gist.github.com/adavia/4208c0d71b28bc942f254c4e02ca6b63
[19:17:26] elomatreb: The lower one is not a valid Hash, take a look at that again
[19:17:35] vondruch: has joined #ruby
[19:22:29] shinnya: has joined #ruby
[19:23:02] xrlk: has joined #ruby
[19:23:15] vondruch: has joined #ruby
[19:23:37] GinoMan2440: has joined #ruby
[19:28:00] adavia: elomatreb, how can achieve something like questions: { 0: { title: "This is an error" }, 1: { title: "This is an error" } }
[19:29:25] vondruch: has joined #ruby
[19:30:49] adavia: Like this https://gist.github.com/adavia/4208c0d71b28bc942f254c4e02ca6b63
[19:33:17] elomatreb: adavia: If you can trust the indices in the individual hashes you could use ...[:questions].inject({}, :merge) to merge all the Hashes into one
[19:35:35] vondruch: has joined #ruby
[19:36:13] elomatreb: After that you could use transform_values to remove that array from the title key: https://eval.in/829694
[19:41:16] vondruch: has joined #ruby
[19:44:27] andrzejku: has joined #ruby
[19:48:11] __Yiota: has joined #ruby
[19:48:38] bkxd: has joined #ruby
[19:48:40] bkxd_: has joined #ruby
[19:52:46] cdg: has joined #ruby
[19:54:45] quobo: has joined #ruby
[19:57:24] vondruch: has joined #ruby
[20:03:50] ur5us: has joined #ruby
[20:06:18] psychicist__: has joined #ruby
[20:09:46] __Yiota: has joined #ruby
[20:17:38] akkad: has joined #ruby
[20:23:15] bronson: has joined #ruby
[20:25:06] lacuna: has joined #ruby
[20:28:35] milardovich: has joined #ruby
[20:29:59] hutch34: has joined #ruby
[20:30:29] dionysus69: has joined #ruby
[20:44:37] n0vo: has joined #ruby
[20:44:48] n0vo: IS anyone here familiar with Cassandra in ruby?
[20:45:35] n0vo: I'm attempting to create a simple ruby interface to interact with a keyspace from the command line, and I'm trying to simply describe the tables of a specific keyspace.
[20:46:03] n0vo: Is there a command to use a keyspace, so that every subsequent CQL query will be run in the context of that particular keyspace?
[20:46:38] n0vo: cluster.connect('keyspace') is the only thing I've found but it doesn't seem to have any effect of subsequent commands
[20:49:23] n0vo: Alternatively, does " `get': line 1:0 no viable alternative at input 'DESCRIBE'" pertain to a syntax error? Because I can't imagine there'd be too many gotchas running "DESCRIBE tables"
[20:49:28] n0vo: Seems pretty straightforward to me
[20:49:35] vondruch: has joined #ruby
[20:52:27] milardovich: has joined #ruby
[20:52:44] milardovich: has joined #ruby
[20:55:19] Guest46113: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[21:00:05] cschneid_: has joined #ruby
[21:00:08] ketan: has joined #ruby
[21:04:43] milardovich: has joined #ruby
[21:04:43] ascarter_: has joined #ruby
[21:05:11] vondruch: has joined #ruby
[21:11:18] vondruch: has joined #ruby
[21:13:50] connor_goodwolf: has joined #ruby
[21:19:18] milardovich: has joined #ruby
[21:19:35] milardovich: has joined #ruby
[21:19:48] dissident: has joined #ruby
[21:27:27] workmad3: has joined #ruby
[21:29:28] vondruch: has joined #ruby
[21:30:27] minimalism: has joined #ruby
[21:36:50] bkxd: has joined #ruby
[21:36:52] bkxd_: has joined #ruby
[21:38:27] Kanibal: has joined #ruby
[21:38:54] Kanibal: Greetings! Can anybody recommend a way to delete a certain substring (by offset and length) from a string?
[21:40:03] n0vo: string.slice! 'somestring'
[21:40:17] n0vo: Is that what you're looking for?
[21:40:37] ytti: string[first..last]
[21:40:41] Kanibal: almost, the problem is, that my substring is defined by offset and length
[21:40:57] Kanibal: ytti: Thanks. I though about that just now :-)
[21:41:24] Kanibal: but how to delete the substring ...
[21:41:32] Kanibal: string[first..last]=""?
[21:42:05] Kanibal: irb(main):003:0> "foobar"[2..4]=""
[21:42:12] iomotoko: has joined #ruby
[21:42:17] ytti: string.delete string[first..last]
[21:42:25] ytti: i don't actually know if that is guaranteed to work, probably not
[21:42:30] ytti: definitely not
[21:42:54] matthewd: >> s = "abcdefghijklmn"; s[4, 2] = ""; s
[21:42:55] ruby[bot]: matthewd: # => "abcdghijklmn" (https://eval.in/829719)
[21:43:21] Kanibal: what kind of sorcery is this
[21:44:05] matthewd: Note comma for length, vs range if you have the end offset
[21:44:24] Kanibal: I have offset + length, so it is perfect :-)
[21:45:41] matthewd: >> s = "abcdefghijklmn"; s.slice!(4, 2); s
[21:45:42] ruby[bot]: matthewd: # => "abcdghijklmn" (https://eval.in/829720)
[21:46:05] matthewd: ^ works too, if that's a little less inscrutable
[21:49:39] cseder: has joined #ruby
[21:49:56] therealGent: has joined #ruby
[21:53:23] milardovich: has joined #ruby
[21:55:18] armyriad: has joined #ruby
[22:12:37] dviola: has joined #ruby
[22:17:58] matthewd: TIL https://github.com/k-takata/Onigmo/blob/3ddfbfcc469a246f8c5bc50072c7e9cdb1e50b22/doc/RE#L293
[22:19:38] vondruch: has joined #ruby
[22:23:18] vondruch: has joined #ruby
[22:23:42] jhass: has joined #ruby
[22:29:14] lianj: has joined #ruby
[22:29:14] lianj: has joined #ruby
[22:31:35] comet23: has joined #ruby
[22:31:44] comet23: how does ruby know when a block is passed in?
[22:36:44] Papierkorb: comet23: How do you mean that?
[22:37:25] comet23: like how does it differentiate from a normal method call and one with a block
[22:38:22] Zarthus: do you mean .block_given?
[22:38:40] raatiniemi: has joined #ruby
[22:39:19] InfinityFye: has joined #ruby
[22:40:30] tacoboy: has joined #ruby
[22:47:41] Ishido: has joined #ruby
[22:48:30] dcunit3d: has joined #ruby
[22:48:50] ahrs: has joined #ruby
[22:51:33] boto: has joined #ruby
[22:58:56] mattp_: has joined #ruby
[23:01:00] ketan: has joined #ruby
[23:12:57] brent__: has joined #ruby
[23:15:21] weathermaker: has joined #ruby
[23:24:31] agent_white: has joined #ruby
[23:25:51] Dimik: has joined #ruby
[23:31:58] zacts: has joined #ruby
[23:32:21] d^sh: has joined #ruby
[23:35:20] nofxx: has joined #ruby
[23:36:30] milardovich: has joined #ruby
[23:37:06] hinbody: has joined #ruby
[23:37:52] patarr: has joined #ruby
[23:40:15] t-recx: has joined #ruby
[23:45:05] cseder: has joined #ruby
[23:47:33] nofxx: has joined #ruby
[23:47:41] duderonomy: has joined #ruby
[23:52:09] lacuna: has joined #ruby
[23:53:24] oleo: has joined #ruby