« Back to channel list

#ruby - 09 January 2016

« Back 1 day Forward 1 day »
[00:00:46] djbkd: has joined #ruby
[00:01:28] snguyen: has joined #ruby
[00:03:53] djbkd: has joined #ruby
[00:04:33] snowy: has joined #ruby
[00:04:37] tomchapin: has joined #ruby
[00:04:55] choke: has joined #ruby
[00:05:15] charliesome: has joined #ruby
[00:06:02] snockerton: has joined #ruby
[00:08:01] kies^: has joined #ruby
[00:10:44] rkazak: has joined #ruby
[00:11:49] dorakyura: has joined #ruby
[00:11:54] nettoweb: has joined #ruby
[00:13:24] snowy: has joined #ruby
[00:14:01] lacuna: has joined #ruby
[00:15:39] agentmeerkat: has joined #ruby
[00:16:02] Bloomer: has joined #ruby
[00:16:03] choke: has joined #ruby
[00:18:34] nerium: has joined #ruby
[00:20:14] ohaibbq: has joined #ruby
[00:22:01] artX000: has joined #ruby
[00:24:21] casadei: has joined #ruby
[00:24:55] Makorak: has joined #ruby
[00:25:46] choke: has joined #ruby
[00:28:04] shevy: atmosx coding anything fancy in ruby related to your work?
[00:28:43] roshanavand: has joined #ruby
[00:29:26] snowy: has joined #ruby
[00:30:56] dlitvak: has joined #ruby
[00:31:31] dorakyura: has joined #ruby
[00:33:17] atmosx: not fancy
[00:33:24] atmosx: just a little bit of ruby
[00:33:29] atmosx: via logstash filter plugins
[00:33:46] snowy: has joined #ruby
[00:34:03] choke_: has joined #ruby
[00:36:18] lacuna: has joined #ruby
[00:38:07] choke: has joined #ruby
[00:38:56] lacuna: has joined #ruby
[00:39:02] gruz0: has joined #ruby
[00:41:20] choke__: has joined #ruby
[00:41:44] duckson: has joined #ruby
[00:44:00] speaking1ode: has joined #ruby
[00:44:01] choke_: has joined #ruby
[00:44:25] hannelita: has joined #ruby
[00:44:54] shevy: that does not quite sound epic enough as of yet!
[00:45:34] Papierkorb: AwzmFilterMan!
[00:46:24] atmosx: shevy: well it's not epic, but I like it
[00:46:43] atmosx: shevy: the entire code base is in python, so my most interesting tasks in the future will be in python
[00:47:07] atmosx: it's a pitty, I wrk for 2 startups and both use python.
[00:47:16] atmosx: I'm off to bed later
[00:47:25] havenwood: atmosx: g'night
[00:47:41] BTRE: has joined #ruby
[00:49:24] blackmes1: has joined #ruby
[00:49:44] underplank: has joined #ruby
[00:52:58] symm-: has joined #ruby
[00:56:08] nettoweb: has joined #ruby
[00:57:31] DonOtreply: has joined #ruby
[00:59:18] dlitvak: has joined #ruby
[01:02:16] guacamole: has joined #ruby
[01:02:31] al2o3-cr: has joined #ruby
[01:03:34] charliesome: has joined #ruby
[01:05:03] sankaber: has joined #ruby
[01:05:13] chipotle: has joined #ruby
[01:06:06] pawnbox: has joined #ruby
[01:06:12] dorakyura: has joined #ruby
[01:06:39] babblebre: has joined #ruby
[01:06:58] rickmasta: has joined #ruby
[01:08:47] choke: has joined #ruby
[01:11:05] gambl0re: has joined #ruby
[01:17:02] Bloomer: has joined #ruby
[01:19:20] mistermocha: has joined #ruby
[01:19:48] duckpupp1: has joined #ruby
[01:20:00] cpup: has joined #ruby
[01:20:09] harai: has joined #ruby
[01:20:46] mistermo_: has joined #ruby
[01:21:25] TDJACR: has joined #ruby
[01:21:30] kalostro: has joined #ruby
[01:22:41] choke_: has joined #ruby
[01:24:22] harai54: has joined #ruby
[01:27:42] diegoviola: how do I convert a string like this 20160107085332 to this %Y-%m-%d %H:%M:%S
[01:27:50] diegoviola: or 2016-01-07 08:53:32
[01:27:56] diegoviola: do I use regex or something else?
[01:28:00] choke: has joined #ruby
[01:28:16] apeiros: diegoviola: what have you tried?
[01:28:21] pabs: s.gubs(/{
[01:28:27] Coldblackice: has joined #ruby
[01:28:35] diegoviola: apeiros: nothing yet because I don't know what to use
[01:28:55] apeiros: what would you try?
[01:30:10] diegoviola: DateTime.parse?
[01:30:28] apeiros: .parse is a last resort, no.
[01:30:42] apeiros: you only use parse when you don't know the format or nothing else can work.
[01:31:34] apeiros: does strftime parse times?
[01:31:43] diegoviola: only formats them afaik
[01:31:54] Ox0dea: diegoviola: Is that what the "f" stands for?
[01:31:58] pabs: >> s = '201601082030'; s.gsub(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/, '\1-\2-\3 \4:\5')
[01:31:59] ruboto: pabs # => "2016-01-08 20:30" (https://eval.in/499641)
[01:32:06] Ox0dea: pabs: You're crazy.
[01:32:16] apeiros: crazy seconded
[01:32:24] diegoviola: strftime <- string format time?
[01:32:38] apeiros: so what could "string parse time" be named?
[01:33:18] pabs: not afk, apaprently
[01:33:20] apeiros: good. now look that up, try whether you can get it to work.
[01:33:22] pabs: what is crazy about that?
[01:33:46] diegoviola: apeiros: I actually tried strptime
[01:34:03] apeiros: diegoviola: then you're old enough to know how to do a proper problem description, right?
[01:34:47] apeiros: well then, waiting for one.
[01:34:48] Ox0dea: pabs: It's not at all intention-revealing where a perfectly intention-revealing approach exists.
[01:34:52] Ox0dea: Still, kudos.
[01:35:26] apeiros: pabs: additionally to Ox0dea, I'd say diegoviola already had 90%+ of a working solution in place
[01:35:49] pabs: it is literally the solution to the question he asked
[01:35:52] apeiros: and a better one in case they need the time, not the string
[01:36:22] apeiros: yeah, crazy was hyperbole
[01:36:51] pabs: fair enough
[01:37:25] pabs: ok, now i'm afk :D
[01:38:13] apeiros: bye pabs :)
[01:40:10] Ox0dea: pabs: Are you coming back?
[01:40:11] dlitvak_: has joined #ruby
[01:40:40] Cohedrin: has joined #ruby
[01:41:43] diegoviola: I can't use strptime with that string
[01:41:56] Ox0dea: You sure can.
[01:41:58] diegoviola: [12] pry(main)> DateTime.strptime('20160107085332', "%Y-%m-%d %H:%M:%S")
[01:41:59] diegoviola: ArgumentError: invalid date
[01:42:08] Ox0dea: That's not how it works.
[01:42:11] einarj: has joined #ruby
[01:42:20] Ox0dea: You tell it the format *of* the input, not what you wish to convert it to.
[01:42:41] mistermocha: has joined #ruby
[01:43:19] diegoviola: [13] pry(main)> DateTime.strptime('20160107085332', "%Y%m%d %H%M%S")
[01:43:19] cstrahan: has joined #ruby
[01:43:20] diegoviola: => #<DateTime: 2016-01-07T08:53:32+00:00 ((2457395j,32012s,0n),+0s,2299161j)>
[01:43:25] apeiros: that's not the format
[01:43:32] apeiros: or where do you see a space?
[01:43:38] diegoviola: yep just removed it
[01:43:41] choke: has joined #ruby
[01:44:06] diegoviola: >> DateTime.strptime('20160107085332', "%Y%m%d%H%M%S")
[01:44:08] ruboto: diegoviola # => uninitialized constant DateTime (NameError) ...check link for more (https://eval.in/499643)
[01:44:15] apeiros: now next time when "I can't use methodX" happens, GO READ ITS DOCS.
[01:44:28] apeiros: require 'date'
[01:44:34] baweaver: has joined #ruby
[01:44:38] mfb2: has joined #ruby
[01:44:38] dorei: [1,2,3].join(':') gives "1:2:3", if I wanted to get ":1:2:3" is there a better way than this? ([':']*3).zip([1, 2, 3]).join
[01:44:43] diegoviola: >> require 'date'; DateTime.strptime('20160107085332', "%Y%m%d%H%M%S")
[01:44:44] ruboto: diegoviola # => #<DateTime: 2016-01-07T08:53:32+00:00 ((2457395j,32012s,0n),+0s,2299161j)> (https://eval.in/499644)
[01:45:05] Ox0dea: >> s = '20160107085332'; (4..16).step(3).zip('-- ::'.chars).each { |i, c| s[i, 0] = c }; s
[01:45:06] ruboto: Ox0dea # => "2016-01-07 08:53:32" (https://eval.in/499645)
[01:45:09] apeiros: dorei: define better? shorter?
[01:45:15] apeiros: >> ":"+[1,2,3]*":"
[01:45:16] ruboto: apeiros # => ":1:2:3" (https://eval.in/499646)
[01:46:45] apeiros: ?guys diegoviola
[01:46:46] ruboto: diegoviola, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
[01:47:05] gambl0re: has joined #ruby
[01:47:07] terminalrecluse: has joined #ruby
[01:47:29] mfb2_: has joined #ruby
[01:48:17] dorei: thanx apeiros :)
[01:48:27] duncannz: has joined #ruby
[01:48:32] apeiros: so I guess it qualified as "better" :)
[01:51:06] CorySimmons: has joined #ruby
[01:51:40] underplank: has joined #ruby
[01:52:14] choke: has joined #ruby
[01:53:49] skcin7: has joined #ruby
[01:54:25] hannelita: has joined #ruby
[01:54:52] aibot: has joined #ruby
[01:55:42] Limix: has joined #ruby
[01:56:39] aibot: has joined #ruby
[01:56:57] shevy: ohhh interesting
[01:57:22] shevy: I did not read '[1,2,3]*":"' as [1,2,3] * ":" but instead for some weird reason, I thought it was like *array
[01:58:51] Zarthus: huh, so multiply calls #join
[01:59:24] Zarthus: I don't know what I expected, mostly for the array to duplicate by... some amount of times.
[01:59:27] ekinmur: has joined #ruby
[02:00:24] aibot: has joined #ruby
[02:03:27] baweaver: has joined #ruby
[02:04:35] Ox0dea: >> [1,2,3] * 3 # Zarthus
[02:04:37] ruboto: Ox0dea # => [1, 2, 3, 1, 2, 3, 1, 2, 3] (https://eval.in/499649)
[02:05:13] Ox0dea: It does do replication with a numeric argument.
[02:05:27] Ox0dea: But it's not *quite* equivalent to #join if you give it a string.
[02:05:35] Zarthus: but maybe it is my twisted inner PHP-knowledge trying to think ":" might be converted to a char
[02:06:00] jonnyro: has joined #ruby
[02:07:04] jonnyro: What is the easiest coverage suite to use with minitest?
[02:07:29] jonnyro: (not rails app, just plain ruby)
[02:08:06] The_Phoenix: has joined #ruby
[02:09:24] choke: has joined #ruby
[02:10:10] pawnbox: has joined #ruby
[02:12:27] ohaibbq_: has joined #ruby
[02:12:38] krz: has joined #ruby
[02:14:20] choke: has joined #ruby
[02:14:51] tubuliferous_: has joined #ruby
[02:15:00] apeiros: Ox0dea: what's the diff? from the source it seems to call the same rb_ary_join if it's a string arg?
[02:16:02] griffindy: has joined #ruby
[02:16:49] arescorpio: has joined #ruby
[02:17:55] Ox0dea: >> [1,2,3].*() rescue $! # apeiros
[02:17:56] ruboto: Ox0dea # => #<ArgumentError: wrong number of arguments (0 for 1)> (https://eval.in/499655)
[02:18:05] Ox0dea: Whereas #join will use `$,`.
[02:18:14] apeiros: but that's not a string arg ;-)
[02:18:31] Ox0dea: Fair enough.
[02:24:31] hannelita: has joined #ruby
[02:25:43] choke: has joined #ruby
[02:26:36] kalopsian: has joined #ruby
[02:28:32] nettoweb: has joined #ruby
[02:29:42] colegatron: has joined #ruby
[02:31:50] yeticry_: has joined #ruby
[02:35:34] pwnd_nsfw: has joined #ruby
[02:36:21] paradisaeidae: has joined #ruby
[02:38:16] gambl0re: has joined #ruby
[02:38:23] theRealAlexz: has joined #ruby
[02:39:28] _whitelogger_: has joined #ruby
[02:39:41] voker57: has joined #ruby
[02:39:41] voker57: has joined #ruby
[02:39:43] fwx: has joined #ruby
[02:40:22] canton7: has joined #ruby
[02:40:40] choke: has joined #ruby
[02:43:35] SCHAAP137: has joined #ruby
[02:44:00] Nilbus: has joined #ruby
[02:45:16] rkazak: has joined #ruby
[02:47:26] StevenXL: has joined #ruby
[02:48:10] choke: has joined #ruby
[02:50:37] |hit: has joined #ruby
[02:51:35] vikas027: has joined #ruby
[02:53:36] tuelz: has joined #ruby
[02:55:47] miba: has joined #ruby
[02:57:11] miba: has joined #ruby
[02:58:43] einarj: has joined #ruby
[03:02:15] havenwood: miah: sorry for the ping! autocomplete fail on my part, but hi anyways. :)
[03:02:23] ruboto_: has joined #ruby
[03:04:04] peterhu_: has joined #ruby
[03:04:07] Skelz0r_: has joined #ruby
[03:04:22] claws: has joined #ruby
[03:04:26] Plazma_: has joined #ruby
[03:05:02] _fumk: has joined #ruby
[03:05:38] bakedb_: has joined #ruby
[03:05:50] choke: has joined #ruby
[03:06:57] shadeslayer: has joined #ruby
[03:09:13] gbailey-: has joined #ruby
[03:09:15] techietrash_: has joined #ruby
[03:09:19] viperman_: has joined #ruby
[03:09:23] [derpy]: has joined #ruby
[03:10:14] TakumoKatekari: has joined #ruby
[03:10:14] TakumoKatekari: has joined #ruby
[03:10:18] redlegion_: has joined #ruby
[03:11:55] hxegon: has joined #ruby
[03:12:32] Rodya_: has joined #ruby
[03:13:32] jnj: has joined #ruby
[03:13:45] atumzin: has joined #ruby
[03:14:41] crdpink2: has joined #ruby
[03:14:53] sonOfRa: has joined #ruby
[03:15:22] jnj: Hey, so I'm playing around with some api's for a cli app. One of my methods checks to see if credentials are valid on the website and if they are it returns an xml file. I'm just calling system(curl -u username:password etc...) and if the credentials are valid it returns an xml file, which causes my code to print it out. Is there a method or somethign that I can do where I can just check to see if it returns an xml file and just output true?
[03:16:25] haasn`: has joined #ruby
[03:16:44] choke: has joined #ruby
[03:16:49] Petazz: has joined #ruby
[03:17:01] Nilbus: jnj: It sounds like you want to instead use: output = `curl -u ...`
[03:17:23] Nilbus: With backticks, you can capture the output and write the method you want to test for XML.
[03:18:03] jnj: Ah, I see, then I just check to see if the output is nil or not, correct? As in, unless nil return false else true?
[03:18:26] Bloomer: has joined #ruby
[03:20:05] Insti: has joined #ruby
[03:20:09] scottschecter: has joined #ruby
[03:20:18] Nilbus: I believe it should always return a string, perhaps an empty one.
[03:22:09] duckpupp1: has joined #ruby
[03:22:13] avelldiroll: has joined #ruby
[03:22:13] shaman42: has joined #ruby
[03:22:13] lkba: has joined #ruby
[03:22:13] vikas027: has joined #ruby
[03:22:14] artX000: has joined #ruby
[03:22:14] RTG`: has joined #ruby
[03:22:14] tockitj: has joined #ruby
[03:22:14] tomdp: has joined #ruby
[03:22:14] ledestin: has joined #ruby
[03:22:14] seaworthy: has joined #ruby
[03:22:14] mc_fail_: has joined #ruby
[03:22:14] rns: has joined #ruby
[03:22:14] ddubs_: has joined #ruby
[03:22:14] nug: has joined #ruby
[03:22:14] hakunin: has joined #ruby
[03:22:14] Puffball: has joined #ruby
[03:22:14] mkosaki: has joined #ruby
[03:22:14] RaceCondition: has joined #ruby
[03:22:14] Couch: has joined #ruby
[03:22:14] ItSANgo: has joined #ruby
[03:22:14] duracrisis: has joined #ruby
[03:22:14] reaVer_: has joined #ruby
[03:22:14] Raboo: has joined #ruby
[03:22:14] AnoHito: has joined #ruby
[03:22:14] sunya7a__: has joined #ruby
[03:22:14] rmrrn: has joined #ruby
[03:22:14] spacemud: has joined #ruby
[03:22:14] chridal: has joined #ruby
[03:22:14] Platini: has joined #ruby
[03:22:15] tekk: has joined #ruby
[03:22:15] RazorX-: has joined #ruby
[03:22:15] tw1sted: has joined #ruby
[03:22:15] Veejay: has joined #ruby
[03:22:15] awk: has joined #ruby
[03:22:15] pragmatism: has joined #ruby
[03:22:15] Janno: has joined #ruby
[03:22:15] cfloare: has joined #ruby
[03:22:15] forgot: has joined #ruby
[03:22:15] hypnosb: has joined #ruby
[03:22:20] emhs: has joined #ruby
[03:22:20] mame2: has joined #ruby
[03:22:20] KillerFox: has joined #ruby
[03:22:23] mrtomme: has joined #ruby
[03:22:23] TheBrayn: has joined #ruby
[03:23:11] stannard: has joined #ruby
[03:23:21] juddey: has joined #ruby
[03:23:31] apeiros: jnj: ``, popen, spawn
[03:23:37] stannard: has joined #ruby
[03:23:47] apeiros: ah, I see I'm late
[03:24:58] cschneid: has joined #ruby
[03:25:42] mfb2: has joined #ruby
[03:25:54] d0nn1e: has joined #ruby
[03:26:26] hxegon: has joined #ruby
[03:26:30] zemmihates: has joined #ruby
[03:26:32] gmci: has joined #ruby
[03:26:34] skmp: has joined #ruby
[03:26:39] joaomdmoura__: has joined #ruby
[03:26:54] ELCALOR: has joined #ruby
[03:26:59] raz: has joined #ruby
[03:27:27] kalopsian: has joined #ruby
[03:28:10] aibot: has joined #ruby
[03:28:34] ckrailo: has joined #ruby
[03:29:55] miba: has joined #ruby
[03:31:22] choke: has joined #ruby
[03:33:25] finisherr: has joined #ruby
[03:37:42] fuzzyfuzz: has joined #ruby
[03:38:00] Bloomer: has joined #ruby
[03:38:35] snguyen: has joined #ruby
[03:39:17] snguyen: has joined #ruby
[03:42:32] cpup: has joined #ruby
[03:43:05] makenoise: has joined #ruby
[03:45:08] choke: has joined #ruby
[03:46:51] rrichardsr3: has joined #ruby
[03:47:43] nettoweb: has joined #ruby
[03:47:58] rrichardsr3: has joined #ruby
[03:48:25] aibot: has joined #ruby
[03:49:07] rrichardsr3: has joined #ruby
[03:50:13] rrichardsr3: has joined #ruby
[03:50:37] yeticry: has joined #ruby
[03:51:18] rrichardsr3: has joined #ruby
[03:52:26] rrichardsr3: has joined #ruby
[03:53:11] miba: has joined #ruby
[03:53:52] cantaberry: has joined #ruby
[03:55:27] kalopsian: has joined #ruby
[03:58:42] usershell: has joined #ruby
[03:59:59] choke: has joined #ruby
[04:02:49] weemsledeux: has joined #ruby
[04:04:11] baweaver: has joined #ruby
[04:04:33] usershell: has joined #ruby
[04:06:46] hxegon: has joined #ruby
[04:07:15] zast: has joined #ruby
[04:08:23] gix: has joined #ruby
[04:11:21] Melpaws: has joined #ruby
[04:11:46] choke: has joined #ruby
[04:12:16] DonOtreply: has joined #ruby
[04:15:00] uris: has joined #ruby
[04:17:48] solocshaw: has joined #ruby
[04:18:10] DLSteve: has joined #ruby
[04:19:18] Rodya_: has joined #ruby
[04:21:57] linc01n: has joined #ruby
[04:23:41] baweaver: has joined #ruby
[04:23:59] rrichardsr3: has joined #ruby
[04:24:06] arup_r: has joined #ruby
[04:25:12] hannelita: has joined #ruby
[04:25:15] choke: has joined #ruby
[04:25:35] kalopsian: has joined #ruby
[04:26:21] Rodya_: has joined #ruby
[04:27:08] mfb2: has joined #ruby
[04:28:47] hxegon: has joined #ruby
[04:29:37] rrichardsr3: has joined #ruby
[04:30:13] casadei: has joined #ruby
[04:30:42] colegatron: has joined #ruby
[04:30:46] rrichardsr3: has joined #ruby
[04:32:13] rrichardsr3: has joined #ruby
[04:36:51] dorakyura: has joined #ruby
[04:37:10] pawnbox: has joined #ruby
[04:37:41] maximumgeek: has joined #ruby
[04:38:54] sucks: has joined #ruby
[04:39:46] makenoise: has joined #ruby
[04:44:08] uris: has joined #ruby
[04:45:12] choke: has joined #ruby
[04:45:49] dnewkerk: has joined #ruby
[04:53:06] krz: has joined #ruby
[04:54:32] UtkarshRay: has joined #ruby
[04:54:47] tmtwd: has joined #ruby
[04:55:09] kalopsian: has joined #ruby
[04:56:40] govg: has joined #ruby
[04:57:37] choke: has joined #ruby
[04:58:13] Mia: has joined #ruby
[04:58:13] Mia: has joined #ruby
[04:59:38] duckpupp1: has joined #ruby
[05:00:12] usershell: has joined #ruby
[05:02:10] Rodya_: has joined #ruby
[05:02:42] sdothum: has joined #ruby
[05:06:44] gix: has joined #ruby
[05:10:56] _whitelogger: has joined #ruby
[05:11:51] GriffinHeart: has joined #ruby
[05:11:56] choke: has joined #ruby
[05:12:26] uris: has joined #ruby
[05:12:45] The_Phoenix: has joined #ruby
[05:17:26] usershell: has joined #ruby
[05:18:02] choke_: has joined #ruby
[05:19:07] GriffinHeart: has joined #ruby
[05:21:41] choke: has joined #ruby
[05:22:46] gambl0re: has joined #ruby
[05:23:41] speaking1ode: has joined #ruby
[05:23:57] darkf: has joined #ruby
[05:25:26] jschmid: has joined #ruby
[05:25:43] mistermocha: has joined #ruby
[05:26:18] hannelita: has joined #ruby
[05:26:25] colegatron: has joined #ruby
[05:27:24] choke: has joined #ruby
[05:34:12] choke: has joined #ruby
[05:35:14] lemur: has joined #ruby
[05:37:05] nerium: has joined #ruby
[05:37:40] HANJIN: has joined #ruby
[05:41:33] codecop: has joined #ruby
[05:46:47] pawnbox: has joined #ruby
[05:46:52] cmolenda: has joined #ruby
[05:47:17] cmolenda: has joined #ruby
[05:50:43] Scripore: has joined #ruby
[05:53:43] jgpawletko: has joined #ruby
[05:55:36] nixmaniack: has joined #ruby
[05:55:37] nixmaniack: has joined #ruby
[05:55:38] shevy: hmmmm http://sotagtrends.com/?tags=[ruby]
[05:56:03] shevy: the average is a slight decline
[05:56:29] KineticX: has joined #ruby
[05:56:48] cscheib: I suspect if you looked at the bigger picture, it's probably statistically insignificant
[05:57:26] akkad: has joined #ruby
[05:58:53] cscheib: oh, I thought that was over the course of days not years
[05:59:01] shevy: well you actually got a point
[05:59:11] shevy: I just clicked on the "relative" check button
[05:59:31] shevy: and there are, in absolute numbers, more ruby questions in the later years
[05:59:47] cscheib: heh, yea, I just did the same
[05:59:50] choke: has joined #ruby
[05:59:52] nixmaniack: has joined #ruby
[05:59:56] cscheib: more questions, but also more languages
[06:00:40] cscheib: when I read the bottom, I saw Jan 09 and thought that was January 9th through Jan 15th
[06:00:51] cscheib: not realizing the units were years, heh
[06:02:03] Rodya_: has joined #ruby
[06:06:06] Kyle: has joined #ruby
[06:06:10] nixmaniack: has joined #ruby
[06:10:05] choke_: has joined #ruby
[06:10:40] Guest26594: has left #ruby: ()
[06:12:31] hfp_work: has joined #ruby
[06:13:01] hfp: has joined #ruby
[06:15:11] howdoi: has joined #ruby
[06:16:19] Axy: has joined #ruby
[06:16:19] Axy: has joined #ruby
[06:19:08] rkazak: has joined #ruby
[06:19:13] duckpupp1: has joined #ruby
[06:19:22] Rinalds: has joined #ruby
[06:24:22] n00bDev: has joined #ruby
[06:24:37] choke: has joined #ruby
[06:25:14] makenoise: has joined #ruby
[06:25:55] Mia: has joined #ruby
[06:25:56] Mia: has joined #ruby
[06:26:41] lxsameer: has joined #ruby
[06:27:11] hannelita: has joined #ruby
[06:31:28] choke: has joined #ruby
[06:31:58] dopie: has joined #ruby
[06:35:37] usershell: has joined #ruby
[06:36:00] usershell: has joined #ruby
[06:36:04] chipotle: has joined #ruby
[06:36:14] iateadonut: has joined #ruby
[06:37:07] rippa: has joined #ruby
[06:41:32] harai54: has joined #ruby
[06:48:13] ricer2_g4H4: has joined #ruby
[06:49:13] dopie: has joined #ruby
[06:49:19] haraigo: has joined #ruby
[06:49:45] ohaibbq: has joined #ruby
[06:50:18] senayar^: has joined #ruby
[06:51:18] choke: has joined #ruby
[06:53:36] lacuna: has joined #ruby
[06:54:10] nixmaniack: has joined #ruby
[06:54:55] bluOxigen: has joined #ruby
[06:57:16] roshanavand: has joined #ruby
[06:57:23] lacuna: has joined #ruby
[06:57:23] lacuna: has joined #ruby
[06:58:21] senayar^: has joined #ruby
[07:00:02] choke: has joined #ruby
[07:00:35] einarj: has joined #ruby
[07:03:36] choke_: has joined #ruby
[07:07:11] Dimik: has joined #ruby
[07:08:09] choke: has joined #ruby
[07:12:19] The_Phoenix: has joined #ruby
[07:13:58] BTRE: has joined #ruby
[07:14:31] haraigoshi: has joined #ruby
[07:19:59] rkazak: has joined #ruby
[07:20:41] Bloomer_: has joined #ruby
[07:24:48] choke: has joined #ruby
[07:27:26] mistermocha: has joined #ruby
[07:27:53] nixmaniack: has joined #ruby
[07:29:01] hannelita: has joined #ruby
[07:29:17] usershell: has joined #ruby
[07:31:07] blt: has joined #ruby
[07:33:21] Bloomer: has joined #ruby
[07:34:38] cmolenda: has joined #ruby
[07:34:48] choke: has joined #ruby
[07:37:54] duckpupp1: has joined #ruby
[07:38:27] harai: has joined #ruby
[07:39:25] choke: has joined #ruby
[07:39:51] n1x: has joined #ruby
[07:40:20] chipotle: has joined #ruby
[07:41:46] aadam21: has joined #ruby
[07:41:48] djbkd: has joined #ruby
[07:42:54] choke: has joined #ruby
[07:44:35] Jackneill: has joined #ruby
[07:46:15] nixmaniack: has joined #ruby
[07:47:28] nixmaniack: has joined #ruby
[07:48:48] n1x: has joined #ruby
[07:49:50] Bloomer_: has joined #ruby
[07:54:28] usershell: has joined #ruby
[07:57:28] nixmaniack: has joined #ruby
[07:58:02] sandstrom: has joined #ruby
[08:00:49] nixmaniack: has joined #ruby
[08:01:57] nixmaniack: has joined #ruby
[08:03:06] symm-: has joined #ruby
[08:03:33] jackcom: has joined #ruby
[08:03:52] jackcom: can i ask question related with programming?
[08:04:10] chipotle: has joined #ruby
[08:04:33] havenwood: jackcom: Is the programming question about Ruby?
[08:05:11] jackcom: it is very little related because ruby is progrmming
[08:05:13] jackcom: havenwood:
[08:06:11] jackcom: havenwood: anyway you are good at programming. i think so. can i ask question to you?
[08:07:38] shevy: jackcom you wanna get banned again
[08:09:45] sigurding: has joined #ruby
[08:10:04] ledestin: has joined #ruby
[08:14:46] Hanmac: has joined #ruby
[08:15:00] usershell: has joined #ruby
[08:15:05] karapetyan: has joined #ruby
[08:16:24] einarj: has joined #ruby
[08:16:47] ponga: has joined #ruby
[08:17:29] The_Phoenix: has joined #ruby
[08:18:37] juddey: has joined #ruby
[08:21:16] atmosx: I have a logstash filter, which runs for every message. I want to count how many exceptions occour in X processed messages and at which point (to create a nice graph).
[08:21:35] robbyoconnor: has joined #ruby
[08:22:43] atmosx: but this is a class that is loaded and then new objects are created similar to this: http://logstash.net/docs/1.3.2//extending/example-add-a-new-filter ... I should use a class variable right?
[08:25:47] pawnbox: has joined #ruby
[08:28:02] Macaveli: has joined #ruby
[08:29:49] hannelita: has joined #ruby
[08:35:48] cmolenda: has joined #ruby
[08:36:56] chipotle: has joined #ruby
[08:37:03] lxsameer: has joined #ruby
[08:38:37] duckpupp1: has joined #ruby
[08:41:23] peeja: has joined #ruby
[08:42:41] The_Phoenix: has joined #ruby
[08:45:23] bluOxigen_: has joined #ruby
[08:47:24] spider-mario: has joined #ruby
[08:49:06] Yatagarasu: has joined #ruby
[08:49:51] BTRE: has joined #ruby
[08:52:14] mdw: has joined #ruby
[08:53:00] pawnbox: has joined #ruby
[08:55:16] yardenbar: has joined #ruby
[08:57:01] asofgs: has joined #ruby
[08:57:17] asofgs: why do mostly niggers program in this language?
[08:57:44] robbyoconnor: has joined #ruby
[08:57:56] ruboto_: fflush, apeiros, banisterfiend, seanstickle, Mon_Ouie, zzak, Havenn, Radar, jhass, sevenseacat, miah, workmad3, Coraline, drbrain, zenspider, rubyhacker1, slyphon, ljarvis, Aria, baweaver, Adaedra
[08:58:09] apeiros: !ban asofgs racism not welcome
[08:58:12] adaedra: !ban asofgs !P goodbye
[08:58:15] ChanServ: +b asofgs!*@*
[08:58:16] ChanServ: ChanServ kicked asofgs: goodbye
[08:58:35] apeiros: can't wait for ruboto update where that'd have worked
[08:58:48] nerium: has joined #ruby
[09:01:23] adaedra: Thanks, demophoon
[09:01:32] rkazak: has joined #ruby
[09:01:44] sandstrom: has joined #ruby
[09:01:45] demophoon: anytime, thanks for the kick :)
[09:02:34] karapetyan: has joined #ruby
[09:05:52] mesamoo: has joined #ruby
[09:05:58] jbrhbr: has joined #ruby
[09:06:45] hannelita: has joined #ruby
[09:08:50] citizenX: has joined #ruby
[09:10:16] bluOxigen: has joined #ruby
[09:10:32] mooe: has joined #ruby
[09:11:13] mooe: Good morning
[09:11:29] blub: good morning
[09:16:46] aryaching: has joined #ruby
[09:18:03] kp666: has joined #ruby
[09:18:18] JohnT: has joined #ruby
[09:20:15] nixawk: has joined #ruby
[09:21:41] hannelita: has joined #ruby
[09:21:46] mooe: Can anyone help me figure out how to convert a list of paths into a nested tree like http://pastebin.com/weS6cYrh
[09:21:46] ruboto_: mooe, we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[09:22:13] bkxd: has joined #ruby
[09:24:40] mooe: sorry, https://gist.github.com/anonymous/9e3b479718110a5764b5
[09:25:24] CloCkWeRX: has joined #ruby
[09:25:46] ympeg: has joined #ruby
[09:27:13] mooe: I know I need to use reduce but I'm lost
[09:27:37] CloCkWeRX: has left #ruby: ()
[09:30:10] mahk: has joined #ruby
[09:30:15] rippa: has joined #ruby
[09:31:25] mistermocha: has joined #ruby
[09:36:12] cmolenda: has joined #ruby
[09:38:41] Axsuul: has joined #ruby
[09:40:09] ympeg: has joined #ruby
[09:42:17] pskosinski: has joined #ruby
[09:42:59] chipotle: has joined #ruby
[09:45:44] Pupeno: has joined #ruby
[09:45:44] Pupeno: has joined #ruby
[09:49:56] Nightmare: has joined #ruby
[09:52:14] c64zottel: has joined #ruby
[09:52:40] c64zottel: has left #ruby: ()
[09:55:12] chussenot: has joined #ruby
[09:55:23] bkxd: has joined #ruby
[09:55:52] Gnut: has joined #ruby
[09:57:59] snguyen: has joined #ruby
[10:01:23] toretore: has joined #ruby
[10:05:50] cmolenda: has joined #ruby
[10:06:28] tomphp: has joined #ruby
[10:12:40] zipace: has joined #ruby
[10:14:51] cornerma1: has joined #ruby
[10:16:03] arup_r: has joined #ruby
[10:17:08] einarj: has joined #ruby
[10:17:16] Ishido: has joined #ruby
[10:22:13] hannelita: has joined #ruby
[10:22:42] cmolenda_: has joined #ruby
[10:25:14] zapata: has joined #ruby
[10:38:14] pawnbox: has joined #ruby
[10:38:39] pawnbox: has joined #ruby
[10:40:39] duckpupp1: has joined #ruby
[10:40:57] Sirithcam: has joined #ruby
[10:43:54] Coldblackice_: has joined #ruby
[10:45:20] phatypus: has joined #ruby
[10:50:41] yfeldblum: has joined #ruby
[10:52:06] azggil: 50$ and i write code converting to tree
[10:55:30] citizenX: has joined #ruby
[10:56:36] spider-mario: has joined #ruby
[10:57:01] sigurding: has joined #ruby
[10:57:40] SOLDIERz: has joined #ruby
[10:58:01] Mon_Ouie: has joined #ruby
[11:01:56] edwinvdgraaf: has joined #ruby
[11:02:56] FatDiggerNick: has joined #ruby
[11:02:56] ChanServ: +b *!*@gateway/web/freenode/ip.24.6.45.239
[11:02:56] ChanServ: ChanServ kicked FatDiggerNick: goodbye
[11:03:55] karapetyan: has joined #ruby
[11:11:46] aadam21: has joined #ruby
[11:15:44] pandaant: has joined #ruby
[11:17:39] einarj: has joined #ruby
[11:20:58] rodfersou: has joined #ruby
[11:23:05] hannelita: has joined #ruby
[11:26:39] FooMunki: has joined #ruby
[11:27:18] dlitvak: has joined #ruby
[11:27:19] Axsuul: has joined #ruby
[11:28:26] harai54: has joined #ruby
[11:32:57] shinnya: has joined #ruby
[11:33:28] colegatron: has joined #ruby
[11:34:50] mistermocha: has joined #ruby
[11:35:38] jackcom: has left #ruby: ()
[11:37:11] stamina: has joined #ruby
[11:40:36] devbug: has joined #ruby
[11:44:01] last_staff: has joined #ruby
[11:47:03] sdothum: has joined #ruby
[11:47:10] AlexRussia: has joined #ruby
[11:47:12] tomphp: has joined #ruby
[11:47:42] edwinvdgraaf: has joined #ruby
[11:51:16] nettoweb: has joined #ruby
[11:51:36] Phage: has joined #ruby
[11:52:20] Phage: If I want to check if my script gets two arguments suppled, how'd I do that? (like: ruby test.rb argument1 and argument2)
[11:52:47] Phage: Currently using ARGV[] to grab the arguments.
[11:55:51] sigurding: has joined #ruby
[11:57:02] edwinvdg_: has joined #ruby
[12:00:17] sandstrom: has joined #ruby
[12:01:39] toretore: Phage, and that's not good enough?
[12:02:03] Xeago: has joined #ruby
[12:02:53] Phage: toretore: Might be. I just can't figure out how to make the script check if two arguments has been supplied.
[12:02:58] TomyLobo: has joined #ruby
[12:04:19] edwinvdgraaf: has joined #ruby
[12:04:44] mdw: has joined #ruby
[12:04:49] ympeg: check the length of argv
[12:05:10] Phage: Just saw that I can do ARGV.length
[12:05:16] Phage: Why didn't I think if this -.-
[12:05:28] ympeg: as in every array
[12:05:40] Phage: Exactly why I feel stupid right now
[12:08:24] shapeshifter: has joined #ruby
[12:09:12] roshanavand: has joined #ruby
[12:13:25] Nilbus: has joined #ruby
[12:14:32] gruz0: has joined #ruby
[12:15:52] z3uS: has joined #ruby
[12:17:32] bensarz: has joined #ruby
[12:20:49] nettoweb: has joined #ruby
[12:21:29] underplank: has joined #ruby
[12:21:31] z3uS: has joined #ruby
[12:21:45] FooMunki: has joined #ruby
[12:23:44] c355E3B: has joined #ruby
[12:23:52] hannelita: has joined #ruby
[12:24:05] sigurding: has joined #ruby
[12:25:32] karapetyan: has joined #ruby
[12:27:00] dwfait: has joined #ruby
[12:28:34] edwinvdgraaf: has joined #ruby
[12:29:49] FooMunki: has joined #ruby
[12:30:52] edwinvdgraaf: has joined #ruby
[12:31:02] krz: has joined #ruby
[12:31:29] edwinvdgraaf: has joined #ruby
[12:32:59] edwinvdgraaf: has joined #ruby
[12:34:13] edwinvdgraaf: has joined #ruby
[12:35:03] tknz: has joined #ruby
[12:35:48] edwinvdgraaf: has joined #ruby
[12:35:57] m8: has joined #ruby
[12:36:16] glen1: has joined #ruby
[12:37:00] glen1: hi, how to make the second block return similar structure? http://sprunge.us/AdYA
[12:37:19] chipotle: has joined #ruby
[12:37:28] sameerynho: has joined #ruby
[12:37:30] glen1: seemss i want to iterate over array and return hasmap key pairs from it
[12:37:33] karapetyan: has joined #ruby
[12:40:17] crdpink: has joined #ruby
[12:41:23] duckpupp1: has joined #ruby
[12:42:13] ta: has joined #ruby
[12:44:49] last_staff: has joined #ruby
[12:46:24] roshanavand: has joined #ruby
[12:48:25] einarj: has joined #ruby
[12:56:00] edwinvdgraaf: has joined #ruby
[12:57:45] trautwein: has joined #ruby
[12:58:50] usershell: has joined #ruby
[13:02:19] glen1: i was able to came up with this: http://sprunge.us/JSTP can it be done better?
[13:03:18] nanoz: has joined #ruby
[13:08:00] skade: has joined #ruby
[13:11:53] Scripore: has joined #ruby
[13:12:18] roshanav_: has joined #ruby
[13:13:27] dorei: has joined #ruby
[13:18:08] Zaers: has joined #ruby
[13:19:14] bensarz: has joined #ruby
[13:21:53] praveen: has joined #ruby
[13:23:29] Zaers: has left #ruby: ("NedaMise")
[13:24:18] arup_r: has joined #ruby
[13:25:43] hannelita: has joined #ruby
[13:25:47] aibot: has joined #ruby
[13:28:28] stannard: has joined #ruby
[13:28:45] ferd: has joined #ruby
[13:30:19] krz: has joined #ruby
[13:32:35] aadam21: has joined #ruby
[13:33:29] z3uS: has joined #ruby
[13:34:06] UtkarshRay: has joined #ruby
[13:34:11] bensarz_: has joined #ruby
[13:34:42] praveen: has joined #ruby
[13:35:58] aibot: has joined #ruby
[13:37:15] mistermocha: has joined #ruby
[13:39:32] Phage: Is it possible to only join from array[1] and forward?
[13:40:22] Papierkorb: Phage: array[1..-1].join(...)
[13:40:52] Phage: Oh, that works
[13:40:55] Phage: can you explain it to me?
[13:41:00] Phage: Don't understand it 100%
[13:41:27] arup_r: Phage: read http://ruby-doc.org/core-2.2.0/String.html#method-i-5B-5D
[13:41:41] Papierkorb: That's using Array#[], aka "that element access operator" :P ??? Anyway, when you pass in a Range (x..y), it returns you all elements in that range.
[13:41:56] arup_r: str[range] ??? new_str or nil <~~
[13:42:21] arup_r: >> puts "hi"
[13:42:23] ruboto_: arup_r # => hi ...check link for more (https://eval.in/499926)
[13:42:26] Papierkorb: arup_r: he has an array, not a string
[13:42:38] arup_r: sorry wrong doc link
[13:42:48] arup_r: http://ruby-doc.org/core-2.2.0/Array.html#method-i-5B-5D
[13:42:56] arup_r: there you go.. ^^
[13:43:11] Phage: Papierkorb already sent that :)
[13:43:25] Phage: I still don't quite get it though
[13:43:27] arup_r: ok, I joined late then..
[13:43:38] arup_r: I am seeing half convo
[13:43:43] Papierkorb: Phage: what part don't you 'get' ?
[13:44:01] Phage: It's the range part
[13:44:07] Phage: goes from 1 to -1 ?
[13:44:17] Papierkorb: Phage: OK, hang on
[13:44:45] arup_r: Phage: why don't read the doc.. It is mentioned everything with examples..
[13:44:52] Papierkorb: >> a = [4,5,6]; puts a[1..-1].join(',')
[13:44:53] ruboto_: Papierkorb # => 5,6 ...check link for more (https://eval.in/499929)
[13:44:54] arup_r: that doc is worth to read
[13:45:10] Papierkorb: >> a = [4,5,6]; puts a[-1], a[1..-1].join(',')
[13:45:11] ruboto_: Papierkorb # => 6 ...check link for more (https://eval.in/499932)
[13:45:13] skade: has joined #ruby
[13:45:47] arup_r: Phage: use p [ a[-1], a[1..-1].join(',') ] to show all output :)
[13:46:23] arup_r: sorry Papierkorb ^^ not Phage the above
[13:46:26] dlitvak: has joined #ruby
[13:47:04] duckpupp1: has joined #ruby
[13:47:52] glen1: has left #ruby: ()
[13:48:17] Phage: Okay, let me see if I got this right.
[13:48:33] Phage: So, if you go 'in minus' it goes the other way around?
[13:48:44] Phage: i.e. counts backwards?
[13:48:47] Phage: in the array
[13:49:09] Papierkorb: Phage: minus accesses the elements from the right side (as opposed to the left), so yeah, it basically counts 'backwards'
[13:49:19] Phage: now it's clear t
[13:49:24] Phage: thank you very much!
[13:50:26] bithon: has joined #ruby
[13:50:59] charliesome: has joined #ruby
[13:52:49] ferd: has left #ruby: ("NedaMise")
[13:54:22] stannard: has joined #ruby
[13:55:15] jackcom: has joined #ruby
[13:55:39] jackcom: can i see your coding? shevy ?
[13:56:06] KineticX: has joined #ruby
[13:56:50] radgeRayden: has joined #ruby
[13:57:10] jackcom: arup_r: ? what???s wrong?
[13:58:20] arup_r: nothing.. all is perfect..
[13:58:40] jackcom: yeah, can i see your coding? arup_r
[13:58:47] jackcom: because i want learn real coding.
[14:00:34] arup_r: jackcom: look then at codeschool first
[14:00:51] jackcom: where is codeschool?
[14:03:31] arup_r: on internet
[14:04:02] jackcom: arup_r: give me link plz
[14:04:39] nertzy: has joined #ruby
[14:04:43] Makorak: has joined #ruby
[14:04:45] chimche: has joined #ruby
[14:06:31] konr: has joined #ruby
[14:07:06] symm-: has joined #ruby
[14:09:31] einarj: has joined #ruby
[14:09:37] GriffinHeart: has joined #ruby
[14:10:36] roshanavand: has joined #ruby
[14:12:01] SirCmpwn: has joined #ruby
[14:13:11] xet7: has joined #ruby
[14:13:41] Phage: has left #ruby: ()
[14:13:44] karapetyan: has joined #ruby
[14:14:59] chipotle: has joined #ruby
[14:16:49] Anderson69s: has joined #ruby
[14:17:05] northfurr: has joined #ruby
[14:18:46] ta0: has joined #ruby
[14:22:32] northfurr: has joined #ruby
[14:22:59] BTRE: has joined #ruby
[14:23:58] chimche: has joined #ruby
[14:25:25] usershell: has joined #ruby
[14:26:16] Dragooon: has joined #ruby
[14:26:34] hannelita: has joined #ruby
[14:27:11] Dragooon: I don't know Ruby but I'm stuck with a program I need to translate, can anyone explain what this does? https://gist.github.com/Dragooon/6de3f2d796e84a1bdd12 I want to know what would return t[a] .. b achieve
[14:27:22] Dragooon: I get that a is the first group match and b is second group
[14:28:08] Papierkorb: Dragooon: That is Lua Code, not Ruby
[14:28:52] Dragooon: Papierkorb Oh, damn
[14:28:58] Papierkorb: and 'translate'?
[14:28:59] Dragooon: I searched gsub and got ruby, so I presumed it's that
[14:29:13] Dragooon: Papierkorb: I needed to implement the logic in PHP
[14:29:48] Dragooon: Okay got it, double dot is concatenation in Lua
[14:29:55] Papierkorb: That program replaces all character pairs from the regex by capturing those two, then uses the 't' table (associative array or a Hash in this context)
[14:30:10] Dragooon: Papierkorb: Yup, got it. Thanks!
[14:30:26] Papierkorb: Dragooon: it translates a to t[a] and appends the value of b to it (".." = string concat operator iirc)
[14:30:52] dlitvak: has joined #ruby
[14:32:02] HANJIN: has left #ruby: ()
[14:32:39] edwinvdgraaf: has joined #ruby
[14:36:49] Xeago: has joined #ruby
[14:37:45] Phage: has joined #ruby
[14:39:26] usershell: has joined #ruby
[14:42:34] lkba: has joined #ruby
[14:45:47] sdwrage: has joined #ruby
[14:47:41] beevalee: has joined #ruby
[14:53:34] lxsameer: has joined #ruby
[14:53:34] lxsameer: has joined #ruby
[14:54:59] aryaching: has joined #ruby
[14:55:33] d0nn1e: has joined #ruby
[14:57:24] chouhoulis: has joined #ruby
[14:57:54] iateadonut: has joined #ruby
[14:59:30] mfb2: has joined #ruby
[15:01:28] beevalee: has left #ruby: ("WeeChat 1.1.1")
[15:02:03] nerium: has joined #ruby
[15:04:08] usershell: has joined #ruby
[15:05:34] praveen: has joined #ruby
[15:08:20] roshanav_: has joined #ruby
[15:09:24] firstdayonthejob: has joined #ruby
[15:10:27] einarj: has joined #ruby
[15:10:42] gambl0re: has joined #ruby
[15:11:03] lucasb: has joined #ruby
[15:12:47] chussenot: has joined #ruby
[15:18:50] pwnd_nsfw: has joined #ruby
[15:19:37] edwinvdgraaf: has joined #ruby
[15:20:42] varunwachaspati: has joined #ruby
[15:22:14] Xeago: has joined #ruby
[15:24:09] cassioscabral: has joined #ruby
[15:24:14] sgambino: has joined #ruby
[15:26:26] roshanavand: has joined #ruby
[15:26:35] yardenbar: has joined #ruby
[15:28:07] karapetyan: has joined #ruby
[15:29:05] Zarthus: Could anyone assist me on trying to implement multiple TCPServers efficiently? I'm trying to write a server that can listen on multiple ports. However, whenever I iterate over my TCPServers to server.accept, it pretty much freezes there. When a client connects to one port, it works. But then the loop starts listening on the TCPServer with a different port. When another client comes in trying to
[15:29:05] Zarthus: connect from the same port it will not work because no server is accepting from there (yet).
[15:29:05] Zarthus: I can think of some solutions, but more than anything I would expect it to be possible for a TCPServer to listen on multiple ports. Can I do this? Or do I need to start a new thread for every TCPServer I add? My examples are pretty close to http://ruby-doc.org/stdlib-2.2.0/libdoc/socket/rdoc/TCPServer.html and http://ruby-doc.org/stdlib-2.2.0/libdoc/socket/rdoc/TCPSocket.html - except I open more
[15:29:05] Zarthus: than one server and loop through them in `loop do`.
[15:29:15] howdoi: has joined #ruby
[15:29:35] zotherstupidguy: has joined #ruby
[15:30:02] kenbi: has joined #ruby
[15:31:44] mrtomme: has joined #ruby
[15:32:25] adaedra: The thread solution is good
[15:32:26] otuken: has joined #ruby
[15:32:43] adaedra: The other solution would be to use something like select(), I wonder if that exists in Ruby
[15:32:44] otuken: Finaly ruby developers!
[15:33:17] adaedra: &ri IO.select Zarthus
[15:33:17] [derpy]: Zarthus: http://ruby-doc.org/core-2.2.4/IO.html#method-c-select
[15:33:28] adaedra: what happened to you, silly bot?
[15:33:31] nerium: has joined #ruby
[15:33:49] otuken: puts "Hello World!"
[15:35:36] rkazak: has joined #ruby
[15:36:29] otuken: Any mentors here for giving tips to a beginner?
[15:36:36] ruboto_: Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
[15:36:40] Zarthus: hmm. I don't think I fully understand the IO#select example. The given code is also pretty messy. I think I'll take the cleaner way of writing it by wrapping it in a thread.
[15:36:57] phantummm: has joined #ruby
[15:37:08] adaedra: Zarthus: IO.select would not be that complicated, as it keeps everything in one thread.
[15:38:14] adaedra: Zarthus: "select socket" are some keywords you can try to find more things on the Internet, if the doc is not enough.
[15:38:38] mistermocha: has joined #ruby
[15:38:56] agentmeerkat: has joined #ruby
[15:41:22] toretore: Zarthus, https://gist.github.com/toretore/1a7596b63b24aa3af199 this isn't a complete solution obviously, but it's a demonstration of how it would work
[15:41:23] Zarthus: Am I right in reading the documentation for IO#select in that it does not support OpenSSL sockets?
[15:42:00] adaedra: But I don't think it's a problem if it's just to select on TCPServer
[15:42:56] toretore: i think they're supported, but they do some internal caching so sometimes a read or write can block even if it says it's read/writable
[15:42:57] Zarthus: I'll have to do a bit of testing with both methods to see which works better. - thanks for the example toretore
[15:45:57] roshanav_: has joined #ruby
[15:45:58] toretore: Zarthus, keep in mind that using select is pretty much an implementation of an event loop, of which there exists many mature solutions already
[15:46:49] Zarthus: The select method does seem to work pretty nicely.
[15:49:09] nullwarp: has joined #ruby
[15:49:45] duckpupp1: has joined #ruby
[15:52:56] roshanavand: has joined #ruby
[15:54:01] praveen: has joined #ruby
[15:56:15] programmerq: has joined #ruby
[15:58:17] chouhoulis: has joined #ruby
[16:02:27] usershell: has joined #ruby
[16:02:36] domgetter: has joined #ruby
[16:04:05] praveen: has joined #ruby
[16:09:16] Zarthus: toretore: This method seems to work excellently, which is neat.
[16:09:17] praveen: has joined #ruby
[16:10:24] VladGh: has joined #ruby
[16:11:06] sankaber: has joined #ruby
[16:13:09] praveen: has joined #ruby
[16:16:04] karapetyan: has joined #ruby
[16:16:43] davedev24: has joined #ruby
[16:16:44] tomphp: has joined #ruby
[16:17:00] jackcom: has left #ruby: ()
[16:18:46] tomphp: has joined #ruby
[16:19:32] f00dMonsta_: has joined #ruby
[16:21:07] f00dMonsta__: has joined #ruby
[16:22:49] lucasb: I see some strange (*args) arguments in the documentation, for example: to_a(*args) and to_h(*args) in http://ruby-doc.org/core-2.3.0/Enumerable.html#method-i-to_a
[16:23:09] lucasb: I don't think those methods accept any arguments, right? so, the doc is wrong?
[16:23:35] Melpaws: has joined #ruby
[16:25:31] hxegon: has joined #ruby
[16:25:39] Xiti: has joined #ruby
[16:26:12] Pupeno: has joined #ruby
[16:27:00] Scripore: has joined #ruby
[16:27:17] chouhoulis: has joined #ruby
[16:27:30] f00dMonsta_: has joined #ruby
[16:27:30] StevenXL: has joined #ruby
[16:27:31] StevenXL: has joined #ruby
[16:27:36] nerium: has joined #ruby
[16:28:01] hannelita: has joined #ruby
[16:28:35] DEA7TH: has joined #ruby
[16:28:45] arup_r: has joined #ruby
[16:29:18] adaedra: It does not because the underlying object's each does not takes any argument, as these arguments are passed down
[16:29:21] DEA7TH: [f1(), f2_might_raise_an_exception(), f3()].lazy ---- how can I write this code without getting an exception from the second value?
[16:29:46] adaedra: >> module A; def self.each(z); 3.times { yield z }; end; end; A.extend Enumerable; A.to_a(3) # lucasb
[16:29:48] ruboto_: adaedra # => [3, 3, 3] (https://eval.in/499986)
[16:29:54] f00dMonsta: has joined #ruby
[16:30:12] brunto: has joined #ruby
[16:30:26] adaedra: DEA7TH: you can use an inline rescue but that's not really good.
[16:30:40] adaedra: Explain the whole problem?
[16:31:20] lucasb: adaedra: so, in other words, the doc is right?
[16:31:22] domgetter: DEA7TH: ruby doesn't lazily evaluate the functions, it just lazily yields results
[16:31:32] stannard: has joined #ruby
[16:31:51] adaedra: lucasb: yes. Don't forget than Enumerable is just a set of methods based on call on #each.
[16:31:52] tomphp: has joined #ruby
[16:31:55] domgetter: >>[->{puts "3"}.call].lazy
[16:31:56] ruboto_: domgetter # => 3 ...check link for more (https://eval.in/499987)
[16:32:09] lucasb: adaedra: ah, ok. thanks!
[16:32:18] domgetter: the #<Enumerator::Lazy: [nil]> returned shows that
[16:33:00] f00dMonsta_: has joined #ruby
[16:33:18] adaedra: lucasb: the real prototype of your to_a/to_h methods is the same as the real class's #each method.
[16:33:58] domgetter: DEA7TH: so you'll have to wrap the whole thing in a begin... rescue... end block
[16:34:41] freerobby: has joined #ruby
[16:34:51] domgetter: an alternative (among many) is to not construct the array with the calls to those functions, and call them as they are yielded, and then rescue *that*
[16:35:35] adaedra: Could write that `[:f1, :f2, :f3].lazy.map { |n| method(n).call }` to lazily call though.
[16:35:37] toretore: DEA7TH, perhaps it's better to describe what the purpose and goal is
[16:35:53] toretore: not perhaps, it is. always.
[16:36:03] adaedra: Do we have a xy?
[16:36:05] f00dMonsta__: has joined #ruby
[16:36:05] dlitvak: has joined #ruby
[16:36:32] cmolenda_: has joined #ruby
[16:37:55] domgetter: DEA7TH: may I ask what it is you're trying to accomplish?
[16:38:09] DEA7TH: This: https://gist.github.com/VelizarHristov/6a0a8bacabf68569e210
[16:38:15] Melpaws1: has joined #ruby
[16:38:43] praveen: has joined #ruby
[16:39:09] DEA7TH: the only problem with now.rb is the exception which might be raised
[16:39:18] toretore: your before.rb is better
[16:39:38] toretore: now.rb is clever just for the sake of it
[16:39:43] eros_zhao: has joined #ruby
[16:40:09] adaedra: readability > compact code
[16:40:20] hornairs: has joined #ruby
[16:40:22] DEA7TH: I couldn't find a more readable way to do it
[16:40:48] DEA7TH: but before.rb is missing an elegant pattern - each boolean is a state transition
[16:40:49] toretore: you had a readable way already
[16:41:09] tomphp: has joined #ruby
[16:41:28] f00dMonsta_: has joined #ruby
[16:41:31] adaedra: well, the idiom is case and a state property, i'd say
[16:42:12] DEA7TH: adaedra: case? like how?
[16:42:18] cassioscabral: has joined #ruby
[16:42:43] kenbi: has joined #ruby
[16:42:45] domgetter: DEA7TH: https://gist.github.com/domgetter/7c170a0a210c346241b5
[16:42:49] adaedra: case state; when :collected; do_shit; when :ironed; do_shit; ...; end
[16:43:05] DEA7TH: didn't know when can match on a boolean
[16:43:22] domgetter: DEA7TH: when can match on magical things :)
[16:43:42] DEA7TH: still misses the state transition pattern :( argh
[16:43:47] domgetter: it can match on a proc, which when called, will pass whatever was passed to case
[16:43:48] lacuna: has joined #ruby
[16:43:48] lacuna: has joined #ruby
[16:44:08] domgetter: is this to enumerate the states of a dry cleaning order?
[16:44:22] DEA7TH: oh well I suppose that pattern is not common enough to be respected.
[16:44:44] Axsuul: has joined #ruby
[16:44:46] DEA7TH: domgetter: ironing actually. Includes collection and delivery.
[16:44:47] domgetter: DEA7TH: don't be too hasty. I don't entirely know what you're trying to do yet
[16:45:28] bb010g: has joined #ruby
[16:45:37] DEA7TH: domgetter: there are 4 states and 3 booleans between each. You start at state 1. Each boolean gets you one state forward. The first false boolean causes you to return the current state.
[16:46:03] rippa: has joined #ruby
[16:46:06] zast: has joined #ruby
[16:46:24] domgetter: DEA7TH: if something is ironed, is it booked?
[16:46:32] govg: has joined #ruby
[16:47:05] domgetter: sorry, if something is ironed, is it collected?
[16:47:17] DEA7TH: domgetter: First a customer makes a booking. Then their clothing is collected, afterwards it is ironed and finally it is delivered back to them.
[16:47:48] domgetter: do you want it to be the case that when 'ironed?' is true, that 'collected?' is also true?
[16:48:17] C0deMaver1ck: has joined #ruby
[16:48:20] DEA7TH: Yes - one must first collect a customer's clothes before they can possibly iron them.
[16:48:32] dlitvak_: has joined #ruby
[16:49:31] domgetter: okay. usually in a finite state machine, you aren't in two states at once. so if 'ironed?' is true, 'collected?' should be false, since we're past that state.
[16:49:45] dlitvak__: has joined #ruby
[16:49:52] domgetter: (even though logically you can't iron something that isn't collected)
[16:50:24] DEA7TH: You could say that. But the function collected? still returns true because the collection has alraedy been done.
[16:50:30] duckpupp1: has joined #ruby
[16:50:52] jschmid: has joined #ruby
[16:51:50] nerium: has joined #ruby
[16:53:04] brendan-: has joined #ruby
[16:54:02] psye: has joined #ruby
[16:54:46] iateadonut: has left #ruby: ()
[16:55:22] domgetter: DEA7TH: okay I think I understand now.
[16:55:39] benjohn: has joined #ruby
[16:55:52] cassioscabral: has joined #ruby
[16:56:12] agentmeerkat: has joined #ruby
[16:56:12] tomphp: has joined #ruby
[16:56:16] domgetter: DEA7TH: since you're calling methods, the only way to rescue/catch the exception is to wrap the whole thing in a begin end. One sec and I'll make a change to now.rb
[16:56:50] brendan-: has joined #ruby
[16:57:16] domgetter: DEA7TH: https://gist.github.com/domgetter/7c170a0a210c346241b5
[16:57:30] toretore: DEA7TH, https://gist.github.com/toretore/3f1da0f2059a4d667831
[16:58:14] C0deMaver1ck_: has joined #ruby
[16:59:04] domgetter: There are a couple ways to fix the problem. I would personally recommend making the "collected?", "ironed?", and "delivered?" into lambdas, and then mapping over them with individual begin...end blocks
[16:59:33] domgetter: however, what I would recommend more is figure out how to prevent the possibility that you're trying to iron something you haven't collected.
[16:59:46] domgetter: so that this all isn't a problem to begin with
[17:00:17] domgetter: (and likewise, prevent the possibility that you're trying to deliver something that isn't ironed)
[17:00:20] brendan-: has joined #ruby
[17:00:38] DEA7TH: toretore: advance isn't how I use the API - changes to other DB tables determine the state.
[17:01:32] DEA7TH: but I suppose I can just do a take_while and for each increase state_idx by 1, rather than do the .size hack
[17:01:35] harai54: has joined #ruby
[17:01:36] DEA7TH: or just use whens
[17:02:22] DEA7TH: domgetter: that probably won't be a problem.
[17:02:47] domgetter: I mean at the core of it, you're trying to figure out what state you're in, correct?
[17:03:25] toretore: DEA7TH, but why do your query methods raise?
[17:03:43] domgetter: toretore: because he might try to deliver something that isn't ironed
[17:03:54] DEA7TH: toretore: actually I realized that's fixable... and already fixed, even.
[17:03:58] toretore: it's not a mutating call
[17:04:48] toretore: if you have to use three separate booleans, at least make this internal and then only expose the logical one-state as the only way to interact with it from the outside
[17:06:12] DEA7TH: But sometimes, my code wants to ensure that it is "at least collected" - this corresponds to the code {state == 'collected' or state == 'ironed' or state == 'delivered'}
[17:06:39] DEA7TH: I might instead have a method for state_idx and then it will do state_idx >= COLLECTED_IDX
[17:08:23] Makorak: has joined #ruby
[17:08:43] praveen: has joined #ruby
[17:09:54] terminalrecluse: has joined #ruby
[17:10:16] einarj: has joined #ruby
[17:11:35] DEA7TH: even better, use ints 0-4 for state and forget the strings
[17:11:38] tomphp: has joined #ruby
[17:13:48] C0deMaver1ck_: has joined #ruby
[17:13:48] lacuna: has joined #ruby
[17:13:49] lacuna: has joined #ruby
[17:14:10] pskosinski_: has joined #ruby
[17:14:37] El3ktra: has joined #ruby
[17:14:38] El3ktra: has joined #ruby
[17:15:04] aryaching: has joined #ruby
[17:15:37] edwinvdgraaf: has joined #ruby
[17:18:55] Xeago: has joined #ruby
[17:22:31] smactive: has joined #ruby
[17:23:27] kalopsian: has joined #ruby
[17:25:54] aryaching: has joined #ruby
[17:26:06] El3ktra: has joined #ruby
[17:26:07] El3ktra: has joined #ruby
[17:28:58] hannelita: has joined #ruby
[17:29:23] nerium: has joined #ruby
[17:30:47] colegatron: has joined #ruby
[17:31:43] yosafbridge: has joined #ruby
[17:34:12] KineticX: has joined #ruby
[17:34:44] citizenX: has joined #ruby
[17:35:10] atomical: has joined #ruby
[17:36:25] cassioscabral: has joined #ruby
[17:37:18] dlitvak: has joined #ruby
[17:40:32] mistermocha: has joined #ruby
[17:45:29] stannard: has joined #ruby
[17:47:42] lxsameer: has joined #ruby
[17:47:43] lxsameer: has joined #ruby
[17:49:51] Dimik: has joined #ruby
[17:50:35] PedramT: has joined #ruby
[17:51:14] duckpupp1: has joined #ruby
[17:51:48] Scripore: has joined #ruby
[17:55:47] cpup: has joined #ruby
[17:58:06] gregf: has joined #ruby
[17:59:12] lacuna: has joined #ruby
[17:59:12] lacuna: has joined #ruby
[17:59:43] cassioscabral: has joined #ruby
[18:00:24] Azure: has joined #ruby
[18:02:06] SCHAAP137: has joined #ruby
[18:02:53] KineticX: has joined #ruby
[18:04:20] cpup: has joined #ruby
[18:08:58] karapetyan: has joined #ruby
[18:10:03] brunto: has joined #ruby
[18:10:46] ur5us: has joined #ruby
[18:13:34] hxegon: has joined #ruby
[18:13:47] maneco: has joined #ruby
[18:14:30] lacuna: has joined #ruby
[18:14:40] shadoi: has joined #ruby
[18:14:45] karapetyan: has joined #ruby
[18:15:02] nickjj: has joined #ruby
[18:16:32] FernandoBasso: has joined #ruby
[18:17:41] atomical: has joined #ruby
[18:19:59] Xeago: has joined #ruby
[18:21:38] asthasr: has joined #ruby
[18:23:44] mdw: has joined #ruby
[18:23:59] kadoppe: has joined #ruby
[18:24:00] Limix: has joined #ruby
[18:24:09] atmosx: Anyone using the gruff gem to generate charts?
[18:24:54] atmosx: I'm getting this error https://gist.github.com/atmosx/b43e190e33b2bb2cfc7f it's related to imagemagick, any ideas?
[18:25:00] Vertroa: has joined #ruby
[18:25:57] yos7ph: has joined #ruby
[18:26:05] shevy: I used to use gruff
[18:26:17] shevy: it had some nice graphics but the code base was really weird
[18:28:07] atmosx: well, google charts generates graph without data using ruby's gem (no numbers, xy axis etc.) and gruff doesn't work at all
[18:28:09] atmosx: ACTION toasted
[18:28:24] atmosx: I can export tabular data and use excel
[18:29:43] hannelita: has joined #ruby
[18:30:29] shevy: we should rewrite it from scratch!
[18:30:34] shevy: I mean gruff
[18:31:25] atmosx: I don't think I'm up to the task
[18:31:52] Kiwi_sherbet: has joined #ruby
[18:33:33] shevy: that is the faulty part: module Magick; class Draw; def annotate_scaled self.annotate(img, scaled_width, scaled_height, x * scale, y * scale, text.gsub('%', '%%'))
[18:41:41] PaulCapestany: has joined #ruby
[18:42:37] Makorak: has joined #ruby
[18:42:58] diegoviola: has joined #ruby
[18:43:16] gambl0re: has joined #ruby
[18:44:01] BTRE: has joined #ruby
[18:46:36] roshanavand: has joined #ruby
[18:48:36] kspencer: NoMethodError - undefined method `uptimeReport' for #<MyApp:0x00000000d20fc8>:
[18:48:55] kspencer: I've passed it through as a local yet that's what shows up in the errors
[18:49:23] kspencer: slim :uptime, :locals => {"uptimeReport" => uptimeReport}
[18:49:47] karapetyan: has joined #ruby
[18:50:02] roshanavand: has joined #ruby
[18:50:53] northfurr: has joined #ruby
[18:50:57] shadoi: has joined #ruby
[18:51:13] atmosx: kspencer: use .class to debug
[18:52:20] djbkd: has joined #ruby
[18:53:09] programmerq: has joined #ruby
[18:53:37] dionysus69: has joined #ruby
[18:55:30] kspencer: atmosx: honestly I've never heard of '.class' other than if someone were to put h2.class in slim etc, where am I putting this .class
[18:55:32] roshanavand: has joined #ruby
[18:56:24] haraigo: has joined #ruby
[18:56:27] sneakerhax: has joined #ruby
[18:57:53] edwinvdgraaf: has joined #ruby
[18:59:49] shevy: kspencer so the object you are working with has no such method
[19:01:59] mfb2: has joined #ruby
[19:02:04] underplank: has joined #ruby
[19:02:19] kspencer: shevy: its a variable passed through a :locals
[19:03:27] Xeago: has joined #ruby
[19:03:29] shevy: you need to fix that
[19:04:23] ta: has joined #ruby
[19:06:33] karapetyan: has joined #ruby
[19:08:00] sheybo: has joined #ruby
[19:09:46] Cohedrin: has joined #ruby
[19:10:20] spstarr: has left #ruby: ("Leaving")
[19:11:45] pdoherty: has joined #ruby
[19:12:41] kspencer: I found the problem, I have one checking for a User-Agent of the bot, and then the non-agent one was inheriting the content-type
[19:13:03] kspencer: plus other stuff
[19:13:03] DonOtreply: has joined #ruby
[19:13:07] kspencer: but I figured it out
[19:13:18] kspencer: will gist when done
[19:14:32] dorakyura: has joined #ruby
[19:15:42] karapetyan: has joined #ruby
[19:17:08] sdwrage: has joined #ruby
[19:17:08] phantummm: has joined #ruby
[19:17:14] baweaver: has joined #ruby
[19:20:55] chimche: has joined #ruby
[19:21:36] chimche: has joined #ruby
[19:24:31] n0xff: has left #ruby: ()
[19:25:02] faisal_: has joined #ruby
[19:27:13] PedramT: has joined #ruby
[19:27:28] ur5us: has joined #ruby
[19:27:46] northfurr: has joined #ruby
[19:29:29] usershell: has joined #ruby
[19:30:31] hannelita: has joined #ruby
[19:31:35] anski: has joined #ruby
[19:33:14] barajasfab: has joined #ruby
[19:34:38] dtordable: has joined #ruby
[19:36:57] chimche: has joined #ruby
[19:37:01] duckpupp1: has joined #ruby
[19:42:46] aef: has joined #ruby
[19:43:10] Axsuul: has joined #ruby
[19:44:42] sdwrage: has joined #ruby
[19:46:08] underplank: has joined #ruby
[19:47:25] Darmani: has joined #ruby
[19:47:32] Darmani: Hey kids ^^
[19:48:05] thevaliantx: has joined #ruby
[19:48:08] dtordable: hello Darmani
[19:48:47] ongimack: has joined #ruby
[19:49:14] Darmani: ACTION waves
[19:50:51] thevaliantx: i am thinking of buying a Ruby book on Amazon. Currently my 9 year old son and I are working our way through the Python Programming for the Absolute Beginner book. SUPERB book, by the way, we enjoy Python! But .... I am wondering if we would like Ruby, since I would like to expose him to more than just one language. Your thoughts?
[19:51:12] cpup: has joined #ruby
[19:51:54] thevaliantx: The book we are thinking of getting is The Well-Grounded Rubyist. The reviews on it seem really good, and commenters say that the author's style is engaging.
[19:54:24] FastJack: has joined #ruby
[19:54:45] Darmani: thevaliantx: While I've never read it myself Ruby is a fantastic language that is pretty easy to pick up. Especially if you're already coming from another background.
[19:54:54] toretore: one thing to think about, as you say you want to expose him to more than one language, is that ruby is probably the closest language there is to python
[19:55:07] toretore: though they are of course quite different
[19:56:41] northfurr: has joined #ruby
[19:57:39] thevaliantx: i didn't want to say it because i don't have any knowledge to support my thoughts, but something about Ruby reminds me of Python.
[19:57:44] chimche: has joined #ruby
[19:57:52] dlitvak: has joined #ruby
[19:57:54] thevaliantx: and hey .... those Ruby books are BEAUTIFUL on the front cover :)
[19:58:07] dlitvak: has joined #ruby
[19:58:20] thevaliantx: i did not mention that he is being exposed to C when we play around with the Arduino.
[19:58:53] TheHodge: has joined #ruby
[19:59:19] northfurr: has joined #ruby
[20:02:04] TomPeed: has joined #ruby
[20:02:08] mdw: has joined #ruby
[20:02:27] dlitvak: has joined #ruby
[20:04:20] Darmani: Hey guys, quick question.
[20:04:33] Darmani: I'm building a tic tac toe game and I wanted to make sure my logic was solid.
[20:04:42] Darmani: Could someone take a look at my code and tell me if it's okay?
[20:04:44] Darmani: http://ideone.com/1MDWIQ
[20:04:52] karapetyan: has joined #ruby
[20:04:58] Darmani: It's not finished yet, but hopefully what I have so far is okay.
[20:05:11] JohnBat26: has joined #ruby
[20:06:19] Darmani: someoneee plss.
[20:06:23] Darmani: I'm so alone
[20:08:11] Xeago: has joined #ruby
[20:08:37] Darmani: ACTION sighs
[20:09:10] djbkd: has joined #ruby
[20:10:12] jschmid: has joined #ruby
[20:10:38] Anderson69s: has joined #ruby
[20:10:58] blt: has joined #ruby
[20:13:33] choke: has joined #ruby
[20:13:59] shevy: tic tac toe is simple
[20:14:11] shevy: you usually have something like a 3x3 board right? which often is an array
[20:14:36] shevy: so each field has a "o" or a "x" or a " " being empty, so 3 states; the " " should be the initial one
[20:15:53] shevy: have you stored some invisible UTF character there
[20:16:11] shevy: I can save your paste in my local editor but when I run it via ruby I get: invalid multibyte char (UTF-8)
[20:17:28] eam: Array.new(9) is a little weird, I think I'd do Array.new(3) { Array.new(3) { " " } }
[20:17:48] shevy: also I get a: in `choose_spot': undefined method `+' for nil:NilClass (NoMethodError)
[20:17:51] baweaver: also use to_s as your board output method
[20:18:11] xlegoman: has joined #ruby
[20:18:31] lucasb: isn't he mixing the model with the presentation? there's "__" in the array
[20:19:14] eam: this reminds me of a chess program I wrote in high school, when I had no idea what I was doing. I used an 8x8 character array, capital letters for white and lowercase for black
[20:20:20] znz_jp: has joined #ruby
[20:21:02] Darmani: shevy: I left my computer. I thought no one was here lol
[20:21:50] Darmani: lucasb: Umm yeah kind of. I figured the two underscores would be "empty" so if someone was trying to place a marker there I could do it the way I set it up xP
[20:21:58] shevy: you don't ever leave on IRC, you idle to more and more power
[20:22:34] Darmani: So what's wrong with the code?
[20:22:39] Darmani: Why can't you just be happy for me?
[20:23:06] shevy: because your code is sloppy
[20:23:24] shevy: you don't want to be known as "Darmani the sloppy hacker"
[20:23:25] Darmani: So what would you change?
[20:23:41] Darmani: I want to be known as "Darmani the sexy hacker".
[20:23:42] lucasb: and using the convention of 2 spaces indentation would make the readers happy :)
[20:23:59] shevy: Darmani ^^^ just implement all the things!
[20:24:02] Darmani: lucasb: You mean instead of the underscores?
[20:24:18] lucasb: Darmani: no, I mean code indentation
[20:24:43] Darmani: I'm confused...........
[20:24:45] Darmani: The board??
[20:24:59] kalopsian: has joined #ruby
[20:25:12] dtordable: lucasb: and the .vimrc format is? set ts 2 or what?
[20:25:58] shevy: Darmani you indent with tabs right?
[20:26:14] Darmani: No the code editor does that shit for me shevy
[20:26:22] lucasb: dtordable: what? I personally use ft=ruby sw=2 ts=2 et; but, ok, it's just convention. anybody can use whatever they want :)
[20:26:31] shevy: Darmani ok you must tell your editor to stop doing that
[20:27:08] Darmani: shevy: What about the logic itself???
[20:27:17] Darmani: the method check_valid_spot
[20:28:15] dtordable: aha, so I'll put that on my vimrc thanks lucasb
[20:28:18] shevy: the logic can wait
[20:28:38] Darmani: shevy: i hate you
[20:28:48] shevy: people will be so distracted by everything else that they can not focus on the logic
[20:29:12] shevy: take xmas presents - if you don't wrap them up, you won't be so excited to look at what's inside
[20:30:18] Darmani: shevy: So what's wrong with the indentation?
[20:30:20] Darmani: It looks fine to me.
[20:30:34] shevy: tabs are the sign of the devil
[20:30:54] Darmani: Things will be more confusing if everything can only be indented twice -__-
[20:31:15] hannelita: has joined #ruby
[20:31:16] shevy: https://github.com/bbatsov/ruby-style-guide#spaces-indentation
[20:31:47] Darmani: Oh they should be closer together?
[20:31:53] Darmani: Is that really a big deal?
[20:31:55] Darmani: Seriously?
[20:32:25] shevy: I had to replace your evil tabs with spaces in my editor
[20:33:09] Darmani: Okay well it's fixed. I think.
[20:33:20] Darmani: http://ideone.com/JpRyvk
[20:33:50] choke: has joined #ruby
[20:34:12] lucasb: nope, still tabs :)
[20:34:32] Darmani: Well I don't fucking get it then.
[20:35:42] shevy: I now have the spaces
[20:35:49] shevy: but it's not consistent :)
[20:36:01] shevy: Darmani, look at the first line:
[20:36:03] shevy: " class TicTacToe"
[20:36:07] shevy: it should be
[20:36:09] shevy: "class TicTacToe"
[20:36:16] DonOtreply: has joined #ruby
[20:36:18] Darmani: the fuck?? hang on.
[20:36:30] shevy: so he replaced one tab with 4 spaces
[20:36:41] Darmani: I have no idea why you see that. But that's not how it's written on my screen -__-
[20:36:49] shevy: well, the first layer of indent is not necessary, regardless of tab or spaces
[20:37:08] shevy: well look at http://ideone.com/JpRyvk
[20:37:11] Darmani: https://repl.it/Bchk
[20:37:15] shevy: you notice that it does not start right away
[20:37:16] Darmani: maybe this website will work better.
[20:37:46] shevy: yeah on repl.it you can see that there is nothing between the most-left and the start of the first character
[20:37:46] Darmani: It isn't indented shevy.
[20:37:53] shevy: yes but on ideone there it is!!!
[20:37:57] shevy: I will screenshot!!!!!
[20:37:58] Darmani: BUT I DIDNT DO IT
[20:38:02] Darmani: IT WASNT ME
[20:38:14] adaedra: This discussion is going nowhere
[20:38:23] Darmani: adaedra: THANK YOU
[20:38:35] Darmani: All I wanted was for someone to look at the fucking logic.
[20:39:15] mistermocha: has joined #ruby
[20:39:20] Makorak: has joined #ruby
[20:41:33] adaedra: I just dropped in, can you ask your question again?
[20:41:54] adaedra: Or is it just for review?
[20:43:07] karapetyan: has joined #ruby
[20:44:17] shevy: hmm... so the discussion is going nowhere... but you did not know what it is all about :D
[20:44:52] shevy: Darmani I get an error: 33:in `block in check_valid_spot': undefined local variable or method `board' for #<TicTacToe:0xb7d1c790> (NameError)
[20:44:53] shevy: Did you mean? @board
[20:44:56] adaedra: I read enough
[20:45:08] Darmani: adaedra: I was building a tic tac toe game as part of my curriculum. I wanted to make sure my logic was solid for choosing a spot on the board.
[20:45:24] shevy: line 33 holds the devil
[20:45:31] Darmani: https://repl.it/Bchk/1
[20:45:39] Darmani: shevy: just noticed. Thanks for that.
[20:46:11] shevy: have you used attr before?
[20:46:16] shevy: in this case you could use:
[20:46:19] shevy: attr_reader :board
[20:46:26] shevy: then line 33 would work
[20:47:04] Darmani: that was just an error. It should be @board.
[20:47:13] adaedra: the way you've split the methods is weird.
[20:47:47] Darmani: adaedra: I was kind of worried about that. I just tried to follow the order of operations.
[20:47:59] adaedra: Yeah, I see that
[20:48:14] adaedra: But now, all the game is contained in #initialize, indirectly
[20:48:34] adaedra: Don't be afraid to have a bit more code in the global scope
[20:48:48] craysiii: has joined #ruby
[20:49:04] spinagon: has joined #ruby
[20:49:04] Darmani: adaedra: Noted.
[20:49:32] spinagon: has joined #ruby
[20:49:54] xargs: has left #ruby: ()
[20:50:19] adaedra: Also, you show the board only once, at the beginning?
[20:50:37] Darmani: oh shitt. That's right...
[20:50:53] Darmani: I suppose it should be included in the loop right? So after every turn?
[20:51:03] adaedra: You should work better at the separation in methods, Darmani
[20:51:18] Darmani: adedra: It's my first time.
[20:51:33] DonOtreply: has joined #ruby
[20:51:37] northfurr: has joined #ruby
[20:53:02] adaedra: You should split down each step in independent steps, and rather have a main method (i.e. #run) call successively the different steps rather than making them call each other like that
[20:53:35] Darmani: What would that look like? Could you show me an example?
[20:53:54] adaedra: Will try to do that without blackboard
[20:54:24] Darmani: blackboard...? o.o
[20:54:43] adaedra: Yeah, I usually draw something to show that, not easy on IRC :p
[20:54:51] adaedra: (I'm typing)
[20:54:53] Darmani: I would imagine. Lol
[20:55:37] adaedra: You have to see how you can split the game in small steps. You start by the big idea, and identify smaller steps. Then, you take every step and try to break them down again in smaller steps, until you have small enough blocks.
[20:56:12] dpg1: has joined #ruby
[20:56:18] Darmani: But then you would have like 30 methods....
[20:56:30] Darmani: That doesn't sound practical.
[20:56:46] Darmani: jesus you'd have a field day trying to sort through all that...
[20:56:59] skcin7: has joined #ruby
[20:57:16] Papierkorb: Darmani: That or wade through the mud of huuuge methods.
[20:57:25] adaedra: There's a limit on how far you should get; but splitting things in small isolated steps is good as it can make things clearer on how it works at each level, and makes replacement of some logic easy.
[20:57:42] Darmani: Papierkorb: Not you too.... Q.Q
[20:57:52] adaedra: Darmani: bear with us.
[20:58:10] Darmani: ACTION sighs
[20:58:14] adaedra: Let's split your game together, Darmani?
[20:58:58] adaedra: How, can you try to decompose a Tic-Tac-Toe game in some great steps? The first level, so things big enough right now and not a lot
[20:59:05] adaedra: s/great/big/
[20:59:22] Darmani: Are you asking me?
[20:59:34] Darmani: You want me to break the game down?
[20:59:52] lucasb: step #1: say welcome and display an empty board?
[20:59:58] mooe: has joined #ruby
[21:00:03] adaedra: To see how you do it
[21:00:07] Darmani: adaedra: ^
[21:00:34] Darmani: yeah that sounds about right.
[21:00:35] adaedra: give all the steps, they should assemble into a full game
[21:00:57] Darmani: 1. be attractive 2. don't be unattractive.
[21:01:28] centrx: has joined #ruby
[21:02:11] adaedra: that's an exercise that is supposed to help you and show you a way of having things better split; if you don't want to, tell me, and I'll go back to my projects.
[21:02:22] brunto: has joined #ruby
[21:02:30] dtordable: has joined #ruby
[21:02:36] Darmani: adaedra: Relax I'm writing out all the steps.
[21:04:48] Darmani: adaedra: https://repl.it/Bchk/2
[21:04:54] Darmani: off the top of my head...
[21:05:03] Darmani: That's the basic's I suppose.
[21:05:34] adaedra: Papierkorb: you're still looking? I'm not opposed to a second pair of eyes.
[21:05:53] lucasb: can I play together? I'm practicing some ruby myself and think a tictactoe would be a good exercise :)
[21:06:29] Darmani: lucasb: The more the merrier I guess
[21:06:29] adaedra: lucasb: ok then, try to do the exercise too. See if you have something different from Darmani.
[21:06:34] Papierkorb: adaedra: joined the replit board
[21:06:41] DonOtreply: has joined #ruby
[21:07:09] northfurr: has joined #ruby
[21:07:21] lucasb: I think one can model the board in two ways: 1) with a 3x3 array 2) with a 9-element simple array
[21:07:32] adaedra: you're getting too much into details.
[21:07:42] adaedra: you're doing the what, not the how.
[21:08:17] adaedra: this could be tic-tac-toe on a sudoku grid or a rubicks cube; at this moment this does not matter.
[21:08:19] Papierkorb: lucasb: That is a implementation detail. Focus on what the user actually sees first. How you do it internally does not matter to the user (nor does s/he see it), so leave that for later
[21:09:01] lucasb: ok, I'll slow down
[21:09:03] adaedra: Darmani: valid for you too
[21:09:06] pontiki: adaedra: teaching top-down design over irc?
[21:09:11] Papierkorb: adaedra, lucasb: Think about the game logic itself. As in the game rules, not how you'll do it
[21:09:33] Darmani: adaedra: I'm still wondering what you want me to do lol
[21:09:45] adaedra: pontiki: http://i.imgur.com/1Ety2kl.gifv
[21:09:57] adaedra: Darmani: split your program correctly
[21:10:02] djbkd: has joined #ruby
[21:10:07] marr: has joined #ruby
[21:10:16] pontiki: adaedra: :D
[21:11:15] adaedra: Darmani, lucasb: ok, let's do it differently.
[21:11:30] adaedra: Let's say I don't know tic-tac-toe, and you're teaching me to play.
[21:11:50] jnj: has joined #ruby
[21:12:22] Darmani: Alright...
[21:12:54] jnj: I'm creating a cli application that sends requests to a websites api via curl. I'm trying to make a method to figure out whether or not a user's credentials are valid. Is there a way to figure out if the output of curl is nil or not?
[21:13:06] Darmani: https://repl.it/Bchk/3 adaedra
[21:13:13] Darmani: Is this enough splitting?
[21:13:17] adaedra: jnj: why not use a curl library why curb?
[21:13:31] eam: use one string 9 characters long
[21:13:38] adaedra: Darmani: just tell me how to play
[21:13:48] adaedra: With words, not code
[21:13:51] Darmani: You want me to tell you how to play tic tac toe?
[21:14:12] jnj: adaedra: I'm not sure what you mean, I'm using curl -u username:password url. What is curb?
[21:14:31] lucasb: step #2: ask the player #1 for a number 1..9
[21:14:39] adaedra: jnj: https://github.com/taf2/curb
[21:14:40] tuelz: has joined #ruby
[21:14:51] Darmani: Well... We take turns putting our markers on the board, and the first one to get three in a row wins the game. - adaedra
[21:15:10] adaedra: Okay, we have something here
[21:15:14] havenwood: jnj: Curl has a lovely library libcurl you can use without it's binary. Curl is one nice Ruby wrapper for that lib.
[21:15:27] jnj: adaedra: Did you mean to say, why not use a curl library like curb? But sweet, I'll check out curb
[21:15:31] weemsledeux: has joined #ruby
[21:15:33] jnj: Word, thanks!
[21:15:55] adaedra: jnj: ... my keyboard is playful tonight.
[21:16:20] jnj: adaedra: haha, but seriously thanks curb seems very helpful for my project
[21:16:32] aadam21: has joined #ruby
[21:16:38] adaedra: Darmani: so you have already something at top-level here: turns. Tic-Tac-Toe is just a succession of turns (which you started to describe me). This will be our first level.
[21:17:16] Darmani: We need a method just for that...?
[21:17:26] jnj: I assume curb will work with ruby 2.2?
[21:18:00] Darmani: adaedra: But.... how..... why....what.....
[21:18:29] havenwood: jnj: A quick way to check what a project is tested against if it uses Travis for continuous integration is to check the .travis.yml: https://github.com/taf2/curb/blob/master/.travis.yml#L3
[21:19:28] adaedra: Darmani: You'll get it. lucasb, can you now break down what a turn is, again by breaking it down in a small number of steps in words?
[21:20:35] adaedra: mh, they may have quit since
[21:20:46] lucasb: assuming only 2 players (in the general case, N players could play a TTT game, where N >= 2 :)
[21:21:50] lucasb: first player #1 plays, then player #2, then player #1 again, etc... this is a flip flop, changing the state :)
[21:21:58] adaedra: that's a bit much detail, even if you're raising an interesting detail (but go on, i'll go back to that)
[21:22:01] devbug: has joined #ruby
[21:22:12] adaedra: let's say a one player turn
[21:22:43] lucasb: asks player an integer 1..9 (because this way the input will be easier)
[21:22:52] lucasb: checks that the input is valid
[21:23:01] adaedra: no, human ttt currently
[21:23:06] Darmani: adaedra - https://repl.it/Bchk/4
[21:23:11] Darmani: is that broken down enough
[21:24:08] phatypus: has joined #ruby
[21:24:16] maneco: has left #ruby: ("WeeChat 1.3")
[21:24:30] adaedra: not sure. Can you help lucasb on my question?
[21:25:31] maneco: has joined #ruby
[21:25:39] ekinmur: has joined #ruby
[21:25:39] Darmani: adaedra: what's wrong with what he wrote...? Lol
[21:25:40] adaedra: how to describe human tic-tac-toe one player turn in a small number of steps (i'm thinking of two, but I may be wrong)
[21:26:03] adaedra: he's got implementation details we do not care about yet
[21:26:18] Darmani: i go, you go. your turn, my turn, hakuna matata.
[21:26:26] adaedra: ok, and in each turn?
[21:26:39] adaedra: what do I do when it's my turn?
[21:27:01] Darmani: you place your marker on the board.
[21:27:32] adaedra: and then, check if you won :)
[21:27:55] adaedra: (we will take the brag about win out, if you please)
[21:28:01] northfurr: has joined #ruby
[21:28:25] adaedra: so now we have this, right? https://gist.github.com/adaedra/8fae579b507b4b5d55a6
[21:28:51] Darmani: Is that what we have? Lol
[21:29:24] adaedra: well, first level was: <Darmani> Well... We take turns
[21:30:04] adaedra: then, at second: <Darmani> you place your marker on the board. | <adaedra> and then, check if you won :)
[21:30:35] Darmani: I mean... yeah.
[21:30:41] adaedra: this is just human tic-tac-toe, computer one is slightly more complicated but it's just one or two missing lines, I'd say.
[21:31:09] adaedra: Can you find the missing steps, and tell me where to place them?
[21:31:29] Darmani: Does the game also count as the board?
[21:31:41] adaedra: you mean, creating the board?
[21:32:02] adaedra: I will edit my file a little to be clearer
[21:32:03] hannelita: has joined #ruby
[21:32:22] adaedra: here, each step is an action, with a verb
[21:32:35] adaedra: so, you have "create the board". I can work with that, where do you place it?
[21:32:55] adaedra: before play the game? ok.
[21:32:58] skade: has joined #ruby
[21:33:23] adaedra: lucasb: you can still play too!
[21:33:33] Darmani: I think he gave up ;p
[21:33:39] adaedra: do you see something else?
[21:33:46] lucasb: adaedra: I'm listening a little :)
[21:33:52] Darmani: yeah. There needs to be check marker.
[21:34:01] adaedra: check marker?
[21:34:13] TomPeed: has joined #ruby
[21:34:20] Darmani: well you can't just go placing markers willy nilly wherever you want now can you?
[21:34:40] adaedra: This is below place marker, I'd say.
[21:34:52] Darmani: I would agree.
[21:35:07] adaedra: The one I'm trying to place could be under it too, I reckon.
[21:35:21] adaedra: But let's still find it. How do I know how the board looks?
[21:35:39] Darmani: We still have to create it.
[21:36:07] adaedra: I added, create it. But how do the player know what is the current state of the board if they can't see it?
[21:36:45] Darmani: So show board?
[21:36:51] Darmani: We need that too I guess.
[21:37:07] adaedra: (This is the first time you're doing this, this is totally normal you can't do it well or see what I'm getting too; it's still difficult for me with more experience :o) )
[21:37:13] adaedra: Ok, where do I add it?
[21:37:40] lucasb: before the 'place marker' step, I think should be 'show board/table' and 'get input' ?
[21:37:41] Darmani: right after we create it?
[21:37:46] duckpupp1: has joined #ruby
[21:38:14] adaedra: lucasb: I'd place "get input" inside "place marker", actually.
[21:38:35] adaedra: Darmani: I prefer lucasb's proposition, do you see why?
[21:39:09] Darmani: I mean, yeah that works too.
[21:39:30] TomPeed: has joined #ruby
[21:39:38] adaedra: Well, yours show the board only when it's new, so we can't really see the game progress (but this could be advanced mode ;) )
[21:39:56] Darmani: lets do it his way.
[21:40:07] Makorak: has joined #ruby
[21:40:12] adaedra: I'm adding what we said about place marker too, since we have them.
[21:40:24] lele: has joined #ruby
[21:41:03] adaedra: I've updated the gist. Does it looks right to you?
[21:41:18] framling: has joined #ruby
[21:41:25] Darmani: y.....yeah
[21:41:41] adaedra: you've already wrote some part of the code here.
[21:44:29] adaedra: I've added sample methods names; but you're free of what you do
[21:45:05] adaedra: Now, you have the structure of your code, you can try to write it. Some methods are almost completely written here, as they are just calls to the down methods.
[21:45:27] Darmani: So they shouldn't link to each other?
[21:45:36] adaedra: They can link down.
[21:45:39] dling: has joined #ruby
[21:46:07] adaedra: So #turn, in my sample, will call #show_board, #get_play and #check_win.
[21:46:14] underplank: has joined #ruby
[21:46:18] ur5us: has joined #ruby
[21:46:18] CorySimmons: has joined #ruby
[21:47:02] Ox0dea: has joined #ruby
[21:47:08] adaedra: Does not look like too many methods?
[21:47:23] Darmani: adaedra: No it looks very clean and concise.
[21:47:29] Darmani: ACTION claps
[21:47:37] Darmani: Ox0dea: hey boo<33
[21:48:02] Ox0dea: Darmani: You should hide JOINs, babe.
[21:48:21] Darmani: I don't know how to do that -_-
[21:48:47] adaedra: break down the process and you'll know. (Sorry.)
[21:49:05] KineticX: has joined #ruby
[21:49:08] Darmani: adaedra: Lol remind me what the "play game" method does?
[21:49:17] Darmani: it seems redundant now
[21:49:34] adaedra: Darmani: plays the turns one after each others?
[21:50:00] Darmani: isn't that what #play is for?
[21:50:07] Darmani: I mean #turn8
[21:50:37] Darmani: ACTION shrugs
[21:50:44] adaedra: that's the part of the turn where you interact with the user, look the schema
[21:51:03] adaedra: i did not have good name ideas, so you can change them to something more meaningful.
[21:51:18] Darmani: The part of the turn where you interact with the user??
[21:51:24] ur5us: has joined #ruby
[21:51:30] Ox0dea: Darmani: Gotta get dat input!
[21:51:36] Darmani: You mean like a simple message that says "it is your turn?"
[21:51:38] adaedra: Yes, get his input, check it and write it?
[21:51:44] adaedra: You have the methods below?
[21:52:16] adaedra: Er wait, i'm mixing things again
[21:52:19] adaedra: #turn, we said
[21:52:22] Ox0dea: adaedra plz
[21:52:26] Darmani: ACTION is confused
[21:52:40] Ox0dea: Er, a #rewind method?
[21:52:40] adaedra: Ox0dea: blame apeiros, he made me wake early!
[21:52:55] adaedra: Darmani: #turn is when 1 player (and only one) plays.
[21:53:03] griffindy: has joined #ruby
[21:53:18] adaedra: So #play is succession of calls to #turn (with a possible twist to have players succeed.)
[21:53:42] adaedra: Someone tells me something about a call to `loop` or something similar.
[21:53:43] Scripore: has joined #ruby
[21:54:02] Ox0dea: `play while @board.playable?`
[21:54:05] Darmani: I see what you're saying.
[21:54:08] Darmani: And I still can't picture it.
[21:54:33] Darmani: So what exactly is involved in #play? Just getting the input from the user??
[21:54:46] djbkd: has joined #ruby
[21:55:06] Ox0dea: Darmani: #play should be a loop wrapped around #turn.
[21:55:27] Ox0dea: I think calling them #run and #play respectively is a little clearer.
[21:55:38] Darmani: Ox0dea: Don't you start lol
[21:55:52] adaedra: I'll allow Ox0dea to fix my horrendous method names.
[21:56:00] adaedra: He is way better at English than I am.
[21:56:23] Darmani: adaedra: It doesn't matter. I'm learning :P
[21:56:58] Ox0dea: Darmani: http://i.imgur.com/7drHiqr.gif
[21:57:13] Darmani: Ox0dea: No one likes you.
[21:57:34] Ox0dea: The voices like me.
[21:57:51] einarj: has joined #ruby
[21:57:56] shevy: Darmani I think you are slowly becoming the most active here on #ruby
[21:58:05] adaedra: Darmani: don't be so aggressive.
[21:58:07] Ox0dea: >> 4073930972120442021941899024580558813626659657148635604951730592.to_s(16).tr '0-9a-e', 'pwn givestomach'
[21:58:08] ruboto_: Ox0dea # => "the voices want me to stop wanting the voices to stop" (https://eval.in/500033)
[21:58:17] Darmani: shevy: Because I'm the most inexperienced and need the most help lmao
[21:58:30] adaedra: shevy: afraid to loose your rank?
[21:58:40] Darmani: adaedra: Sorry, he knows I'm kidding ^.^
[21:58:41] Ox0dea: Knock! Draw! Loose!
[21:58:57] shevy: adaedra you always think that I am off topic :(
[21:59:04] Ox0dea: adaedra: Darmani and I play rough. Ignore us unless something catches fire.
[21:59:13] adaedra: ?offtopic shevy
[21:59:14] ruboto_: shevy, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[21:59:17] Darmani: Ox0dea: Lmaooo
[21:59:49] adaedra: Ox0dea: yeah, inside jokes do not really works with people outside the joke.
[22:00:11] Ox0dea: "Inside joke" isn't quite applicable; it's just "chemistry" or the like.
[22:00:28] Darmani: Ox0dea: ^ That sounds about right.
[22:00:33] Uranio: has joined #ruby
[22:00:33] solars: has joined #ruby
[22:00:37] steffkes: has joined #ruby
[22:00:37] steffkes: has joined #ruby
[22:00:40] mdw: has joined #ruby
[22:01:35] Darmani: adaedra: Wait, so we're going to have three methods nested within a "loop" inside the "run" method??
[22:01:40] Darmani: Isn't that a bit excessive??
[22:02:03] TomPeed: has joined #ruby
[22:02:09] adaedra: Do you know about recursion?
[22:02:23] Ox0dea: adaedra: Inappropriate?
[22:02:59] Darmani: adaedra: I believe it's the process of breaking up with your girlfriend and getting another girl right away.
[22:03:17] adaedra: Darmani: if this level of "deep" calls is frightening him, I wonder how he will react to recursion. :p
[22:03:31] adaedra: Anyway, no, it's not excessive.
[22:03:41] SenpaiSilver: has joined #ruby
[22:03:54] Darmani: I don't know then lol
[22:04:03] lkba: has joined #ruby
[22:04:09] SenpaiSilver: has joined #ruby
[22:04:13] pskosinski: has joined #ruby
[22:04:21] loren: has joined #ruby
[22:04:36] adaedra: nvm, I was being a bit facetious. Thank your friend Ox0dea who protects you from me so well.
[22:04:45] solars: question: I've got a device that logs temperatures to a sql db, I now need to create a daemon that monitors these values every 30 secs. can anyone suggest gems to do this? something to create a linux daemon, start, stop, etc and something maybe for the frequent polling loop?
[22:04:57] Ox0dea: solars: Why Ruby?
[22:05:18] Darmani: Ox0dea: thank... you?
[22:05:31] Ox0dea: Darmani: I don't know what's going on.
[22:05:36] Darmani: Me neither.
[22:06:19] pontiki: solars: https://rubygems.org/search?query=daemonize
[22:06:29] Darmani: adaedra: Anyway, back to the stupid tic tac toe game that is slowly chipping away at my mental health.
[22:06:54] adaedra: Darmani: well, did you wrote your new implementation?
[22:06:56] solars: pontiki, thank you, I know that :) I thought someone maybe can suggest something based on similar experience
[22:07:26] Darmani: I'm still trying to wrap my head around what the methods do and how they go together...
[22:07:38] Darmani: You told me how to build a car. And that's great now I know.
[22:07:44] Darmani: But I've never built a fucking car.
[22:07:55] freerobby: has joined #ruby
[22:08:08] Darmani: adaedra: You handed me a wrench and said good luck D:
[22:08:09] adaedra: Well, think of the splitting we've done above, with the textual descriptions
[22:08:10] pontiki: Darmani: that's the nature of most software development
[22:08:30] Darmani: pontiki: that's reassuring.
[22:08:49] pontiki: what adaedra has just shown is how to break down a problem into smaller, solvable pieces.
[22:08:51] shevy: huh... who handed you a bench Darmani
[22:08:55] pontiki: that's the essense of programming
[22:09:08] shevy: pontik is chiming in now as well :)
[22:09:08] adaedra: Darmani: you can start by any method you want now, they should be small enough to easily be solvable.
[22:09:16] shevy: damn I can't even get the nick right
[22:09:28] adaedra: lucasb: you too, you can write a sudoku too
[22:09:31] Darmani: pontiki: yeah I get that. But this is still my first time. And no one is being gentle :(
[22:09:35] dpg1: has joined #ruby
[22:09:39] adaedra: shevy: with a real IRC client, you'd have Tab completion.
[22:09:41] pontiki: i though you liked it rough
[22:09:43] Darmani: adaedra: I'll work on it.
[22:09:46] shevy: adaedra there used to be ponbiki!
[22:09:49] Darmani: pontiki: LOL
[22:09:56] adaedra: lucasb: you too, you can write a tic-tac-toe too
[22:10:02] Darmani: pontiki: Not exactly. Not like this lmao
[22:10:06] adaedra: why did I say "sudoku"
[22:10:09] adaedra: too many grids
[22:10:42] adaedra: Darmani: you already have #show_board, for starters.
[22:10:50] djbkd_: has joined #ruby
[22:11:09] Darmani: adaedra: I know. I've just been staring at the computer screen trying to think.
[22:11:16] Darmani: I'll write some shit and get back to you
[22:11:19] Darmani: ACTION sighs
[22:12:03] adaedra: Darmani: when working on a problem like that, give you some limit on the time you work on it. Being stuck on something without progression for a long time does not help.
[22:12:11] pontiki: Darmani: you shouldn't have an understanding of what all has happened yet. you've merely been through a demonstration of it. you have practice, apply, and teach someone to understand it
[22:12:18] pontiki: so don't feel bad; confustion is okay
[22:12:38] Darmani: adaedra: Okay, will do.
[22:12:44] Darmani: pontiki: Thanks I'll keep that in mind.
[22:12:52] adaedra: It's your first time, it's ok to not see through yet.
[22:13:25] Darmani: I will be back.
[22:13:26] adaedra: Rough since the first time ( ???? ???? ????)
[22:13:55] Darmani: I can be summoned if you clap your hands three times, do a somersault and you call my name.
[22:13:59] lucasb: lol, you people are funny. I'm trying to code here something. If I finish, I'll put it in a gist :)
[22:13:59] Darmani: So don't hesitate to do that =p
[22:14:43] adaedra: A somersault?
[22:14:48] adaedra: What do you think I am, human?
[22:16:01] adaedra: Too bad, I don't have anymore my tic-tac-too for Casio
[22:17:11] sucks: has joined #ruby
[22:17:24] jairojunior: has joined #ruby
[22:24:33] yfeldblum: has joined #ruby
[22:24:42] pdoherty: has joined #ruby
[22:25:56] mdw: has joined #ruby
[22:26:00] choke_: has joined #ruby
[22:28:56] penne12: has joined #ruby
[22:30:15] mfb2: has joined #ruby
[22:31:17] shevy: a Casio is for doing calculations adaedra, not for wasting your time playing games
[22:33:28] edwinvdgraaf: has joined #ruby
[22:33:34] mfb2_: has joined #ruby
[22:36:15] ikwhjdw: has joined #ruby
[22:36:23] ikwhjdw: has left #ruby: ("NedaMise")
[22:36:28] ikwhjdw: has joined #ruby
[22:37:01] ikwhjdw: has left #ruby: ("NedaMise")
[22:37:26] TomPeed: has joined #ruby
[22:38:02] praveen: has joined #ruby
[22:38:22] Darmani: shevy, adaedra, Ox0dea, pontiki.
[22:38:30] Darmani: that oughta get everyone's attention xP
[22:38:34] Darmani: https://repl.it/Bchk/5
[22:38:41] adaedra: I have still one method to write
[22:38:52] Darmani: goddamn it
[22:38:58] shevy: you are back to tabs again I see
[22:39:11] Darmani: We've talked about this
[22:39:14] Darmani: That's not me.
[22:39:31] Darmani: That's not what it actually looks like lol
[22:39:36] tuelz: has joined #ruby
[22:39:59] underplank: has joined #ruby
[22:40:20] adaedra: You show the board twice in a turn?
[22:40:50] Darmani: Once when the game first starts
[22:40:53] Darmani: and once after every turn.
[22:41:17] Darmani: I still need to write the logic to check for the winning numbers though.
[22:42:01] adaedra: I said you can only call down; you start by making initialize call play when they are on the same level.
[22:42:19] adaedra: Down was meaning more indented, may have misunderstood that.
[22:42:52] Darmani: oh I thought you meant down like.. next lol
[22:43:06] shevy: or down like ... up
[22:43:18] Darmani: shevy: lol xD
[22:43:32] adaedra: Well, technically, down is right here
[22:43:52] barajasfab: has joined #ruby
[22:44:06] Darmani: Alright............
[22:44:10] Darmani: I need a break
[22:44:10] adaedra: But yeah, we split in sub step; a step do not call the next one, it only calls the sub-steps (and sometimes the dubstep)
[22:44:15] Darmani: Or I might destroy something
[22:44:21] adaedra: You also need that
[22:44:37] Darmani: I will be back in a few hours.
[22:44:39] Darmani: don't miss me too much.
[22:44:44] adaedra: I will be asleep then.
[22:44:58] Darmani: then I love you. And I will see you tomorrow<33
[22:45:11] adaedra: You can pm me things if you want me to read them tho.
[22:46:03] hxegon: has joined #ruby
[22:47:00] dorakyura: has joined #ruby
[22:47:08] shevy: these slides are actually hilarious:
[22:47:12] shevy: https://speakerdeck.com/zzak/rubyconf2014-nobody-knows-nobu
[22:47:23] shevy: this is almost like a meme... "nobody knows nobu!"
[22:47:50] shevy: oh... he is using OSX
[22:48:17] aadam21: has joined #ruby
[22:48:54] ur5us: has joined #ruby
[22:49:07] smactive: has joined #ruby
[22:49:07] finisherr: has joined #ruby
[22:50:03] zenlot: has joined #ruby
[22:52:21] cdg: has joined #ruby
[22:55:12] sankaber: has joined #ruby
[22:56:12] weemsledeux: has joined #ruby
[22:56:31] atomical: has joined #ruby
[22:57:26] NaviFullroot: has joined #ruby
[22:58:38] choke: has joined #ruby
[22:59:05] NaviFullroot: I have an issue with syscall
[22:59:06] NaviFullroot: Who know how to fix "in `syscall': string contains null byte (ArgumentError)"
[22:59:45] NaviFullroot: string is packed structure(with 0 ofc)
[23:00:23] Radar: NaviFullroot: show us your code
[23:01:22] DonOtreply: has joined #ruby
[23:02:26] NaviFullroot: buf = [@name].pack("a16@40")
[23:02:26] NaviFullroot: syscall SYS_IOCTL, @sys_fd, SETKERN, buf
[23:03:52] NaviFullroot: ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux]
[23:04:17] DEA7TH: has joined #ruby
[23:07:53] last_staff: has joined #ruby
[23:08:53] rocfig: has joined #ruby
[23:09:18] rocfig: is why's ruby guide a good read?
[23:10:50] pawnbox: has joined #ruby
[23:11:50] Ox0dea: It's a good read, but it won't teach you Ruby.
[23:12:13] choke: has joined #ruby
[23:12:40] Ox0dea: NaviFullroot: Well, you're padding that result with null bytes, and #syscall don't like that, even though it'd probably be fine down in the kernel. :/
[23:12:50] djbkd_: has joined #ruby
[23:12:53] Ox0dea: Not sure how to circumvent that check.
[23:13:31] framling: has joined #ruby
[23:14:25] NaviFullroot: Why syscall should care?
[23:15:12] The_Phoenix: has joined #ruby
[23:15:12] Ox0dea: Well, because it's C underneath, and C strings can't contain null bytes.
[23:15:28] rocfig: ox0, is codeacademy better?
[23:16:31] NaviFullroot: pointer can points to any s*t(char *p = (char*)&mystruct)
[23:17:36] scottschecter: has joined #ruby
[23:17:41] NaviFullroot: I remember, back in a days, i've using syscall with no problems :(
[23:17:42] Ox0dea: rocfig: https://pine.fm/LearnToProgram/ http://rubykoans.com/
[23:17:48] Ox0dea: NaviFullroot: From Ruby?
[23:19:23] NaviFullroot: 0x0dea: Ruby has some object with "raw" data and it size, it probably creates buffer(with zeros and other) and puts it into C syscall()
[23:21:19] karapetyan: has joined #ruby
[23:21:46] Ox0dea: NaviFullroot: #syscall tries to convert your Ruby string to a C string and bails when it, by definition, can't.
[23:22:46] agent_white: has joined #ruby
[23:24:50] shevy: hey is something happening on #syscall
[23:24:57] shevy: I am there now
[23:25:07] NaviFullroot: 0x0dea: Yea, but why its uses C strings with \0 checks, why not void* with raw buffer
[23:26:50] NaviFullroot: shevy: I have issue with "in `syscall': string contains null byte (ArgumentError)"
[23:27:38] DonOtreply: has joined #ruby
[23:29:01] Ox0dea: NaviFullroot: I suppose it's either an oversight or else an "intentional pain point" to get you to use a more appropriate interface. :P
[23:30:25] Ox0dea: As best I can tell, there's no way to convince #syscall to treat your Ruby string as a void *. :/
[23:30:40] colegatron: has joined #ruby
[23:31:31] konr: has joined #ruby
[23:32:35] howdoicomputer: has joined #ruby
[23:32:42] usershell: has joined #ruby
[23:32:56] Kallis: has joined #ruby
[23:33:19] choke: has joined #ruby
[23:33:43] al2o3-cr: has joined #ruby
[23:38:21] NaviFullroot: here arg[i] = (VALUE)StringValueCStr(v); - mb change it to StringValuePtr(v):
[23:38:31] duckpupp1: has joined #ruby
[23:39:17] Ox0dea: NaviFullroot: Yeah, that'd avoid the null check.
[23:39:23] terminalrecluse: has joined #ruby
[23:39:44] Ox0dea: Instead of re-compiling your Ruby, why not just get a Fiddle::Function on ioctl()?
[23:40:00] Ox0dea: Fiddle doesn't support varargs, but maybe that won't matter for your purpose.
[23:40:49] Makorak: has joined #ruby
[23:40:58] pawnbox: has joined #ruby
[23:41:49] Asher: has joined #ruby
[23:43:39] mhb: has joined #ruby
[23:45:06] Whooop: has joined #ruby
[23:45:14] aspire_: has joined #ruby
[23:47:05] yqt: has joined #ruby
[23:49:35] Psyq: has joined #ruby
[23:50:01] aadam21: has joined #ruby
[23:50:52] NaviFullroot: 0x0dea: - yea thx, ill loook at fiddle - and StringValuePtr - works. But I dont rly understand why there is StringValueCStr?
[23:51:44] rkazak: has joined #ruby
[23:52:14] Ox0dea: NaviFullroot: For passing to functions expecting C strings, of course.
[23:53:08] NaviFullroot: 0x0dea: syscall doesn't expect C string at all
[23:53:09] Ox0dea: I suppose it does boil down to being a clarity of intent kind of thing.
[23:53:23] Ox0dea: NaviFullroot: No, I'm talking about within the Ruby interpreter itself.
[23:53:23] kies^: has joined #ruby
[23:54:24] choke: has joined #ruby
[23:55:20] drbrain: NaviFullroot: IO#ioctl doesn't work? http://docs.ruby-lang.org/en/2.3.0/IO.html#method-i-ioctl
[23:56:43] rkazak: has joined #ruby
[23:57:37] lacuna_: has joined #ruby
[23:58:05] solocshaw: has joined #ruby
[23:58:40] einarj: has joined #ruby
[23:59:59] NaviFullroot: drbrain: well, need to check