« Back to channel list

#ruby - 18 December 2015

« Back 1 day Forward 1 day »
[00:00:22] adaedra: what kind of network streams?
[00:00:29] hxegon: adaedra, I still feel like for how long they have been around + company size + revenue ddg is pretty scrappy. they have some cool built in stuff
[00:00:38] adaedra: High level (HTTP, ...) or low level (TCP, UDP) ?
[00:00:45] bradland: so, i have a UDP stream coming in on 5606
[00:00:49] bradland: i know how to read from a socket
[00:00:57] adaedra: hxegon: they do, but still way behind what google provides me.
[00:01:09] bradland: and i'm about to set about the task of handling the data that arrives
[00:01:14] bradland: some background might help
[00:01:20] bradland: i have a game called ProjectCARS
[00:01:31] adaedra: bradland: have a precise question, a problem, an error?
[00:01:33] bradland: the game broadcasts telemetry data on port 5606 at a configurable interval
[00:01:48] bradland: i'm at the starting phase, but this seems like it might be a solved problem
[00:01:52] bradland: i'm just not sure where to start searching
[00:02:04] bin8me: has joined #ruby
[00:02:05] bradland: i think it might be called strem processing
[00:02:06] crdpink2: has joined #ruby
[00:02:11] bradland: *stream processing
[00:02:12] mg^: what exactly do you want to do?
[00:02:14] bradland: but i'm not sure
[00:02:32] jbrhbr: you're looking at something to handle all of the udp errors and blocking type logistics or something, rather than doing all of that yourself perhaps?
[00:02:32] bradland: i want to listen on the port, detect, and process the data that arrives
[00:02:40] hahuang65: has joined #ruby
[00:02:49] adaedra: do you have to do other things while waiting for the data?
[00:02:51] bradland: jbrhbr: that's a good way to put it
[00:02:53] bitcycle: has joined #ruby
[00:03:12] bradland: for example, the payloads that arrive easily processed by the bindata gem
[00:03:18] adaedra: because iirc, #read is blocking, so won't return without at least some data
[00:03:41] bradland: but there's the matter of listening for the data, detecting the type of payload (it's in the first few bytes), and dispatching to the correct handler
[00:03:48] bradland: all of this seems like a "solved probleM
[00:03:56] madcodes: has joined #ruby
[00:04:10] bradland: so rather than setting out to my own poorly engineered solution, i was hoping to look at other code that does similar things
[00:04:13] adaedra: listening of the data, it's UDPSocket's role.
[00:04:40] shock_one: has joined #ruby
[00:04:57] bradland: yeah, i've managed to fetch some bytes from the wire
[00:05:05] bradland: but i think i need threads or an event loop
[00:05:12] bradland: because the bytes are going to keep coming
[00:05:19] adaedra: then, to read and dispatch, a simple case on the result of #read or #peek (depending if you need the magic afterwards) should do it. (Or a hash and #public_send, if you're feeling fancy)
[00:05:21] bradland: so they need to be read in to a buffer that is processed by the parser
[00:05:30] adaedra: Relax, the kernel buffers the data you didn't read yet.
[00:05:37] bradland: ah, good to know
[00:05:54] adaedra: It's not because you don't read the data that it disappears.
[00:06:01] bradland: so, for example, i could read 1024 bytes, process them, then read more?
[00:06:13] mg^: yeah as long as the data isn't coming in faster than you can receive and process
[00:06:25] adaedra: Same way, if there is no data available, you'll just block until some is here.
[00:06:37] adaedra: Don't make it too complicated :)
[00:06:52] yfeldblum: has joined #ruby
[00:07:45] adaedra: I suppose you're familiar with our friend ri:UDPSocket already?
[00:07:46] `derpy: class `UDPSocket`: UDPSocket represents a UDP/IP socket. ??? http://rubydoc.info/stdlib/socket/UDPSocket
[00:08:02] bradland: i have captured some data using this https://gist.github.com/bradland/91046d8cb770e201daec
[00:08:12] yfeldblum: has joined #ruby
[00:08:18] bradland: i used that to collect the data, then have a look at what's in there (in a hex editor)
[00:08:58] adaedra: If your magic is a fixed size, i.e. 4 bytes, just read that before handling the remaining operations to a specialized method.
[00:09:15] howdoicomputer: has joined #ruby
[00:09:21] bradland: so from what i've observed, it's a stream of null bytes until some data shows up
[00:09:35] bradland: so, i'll get nul, then \x74
[00:09:48] kies^: has joined #ruby
[00:09:52] bradland: that's always the signature of the beginning of the blob
[00:10:18] bradland: so, unfortunately it's not just a matter of waiting on data to arrive
[00:10:34] bradland: because \x00\x00\x00... is always showing up
[00:10:37] adaedra: mh, I get nothing
[00:10:47] bradland: or at least that's how it looks from my capture code
[00:11:06] bradland: so my listener is going to have to do some detecting work
[00:11:23] adaedra: well, let's see that
[00:12:12] bradland: at the first occurance of non-null bytes, pop 2-bytes and verify that they're equal to 1140, then read 1-byte and determine the "packet_type"
[00:12:22] bradland: which is really the *package* type
[00:12:26] StevenXL: has joined #ruby
[00:12:27] StevenXL: has joined #ruby
[00:12:38] adaedra: I get no \0 with your code at all
[00:12:38] bradland: i don't like that they used the term packet, because this is net code.
[00:12:51] bradland: so that means the game is transmitting \0 on the wire?
[00:12:51] dsdeiz: has joined #ruby
[00:13:09] bradland: i have the game running
[00:13:11] bradland: let me see what i get
[00:13:19] Dimik: has joined #ruby
[00:13:22] adaedra: You can use nc to debug that.
[00:13:37] bradland: i used tcpdump too
[00:13:42] bradland: come to think of it
[00:13:50] bradland: i compared the two and both showed the \0 stream
[00:14:26] adaedra: But you see, I got only what I sent: http://adaedra.imgur.com/all/
[00:14:37] adaedra: http://i.imgur.com/qwvJlfa.png
[00:15:30] adaedra: Maybe your game is sending \0 to "keep the stream open"
[00:15:46] nullFxn: has joined #ruby
[00:16:05] bb010g: has joined #ruby
[00:16:23] bradland: yeah, i'm getting the streams of \0
[00:16:40] bradland: so it has to be the game
[00:16:45] adaedra: Given the fact you've got no "connected" state in UDP, it may use it to say "I'm still here"
[00:16:59] bradland: yeah, "feature"
[00:17:06] bradland: there are quite a few clients for this
[00:17:23] bradland: so if you're receiving the \0 stream, you can say with some confidence that you're "connected"
[00:17:32] bradland: makes the stream processing a bit more challenging though
[00:17:33] adaedra: You can have a loop that reads a byte, if it's a 0 discard it, if it's not call the right method
[00:17:36] bradland: because you can't simply wait for data
[00:17:44] bradland: read 1 byte at a time?
[00:17:50] bradland: i thought about that, but was worried about performance
[00:18:01] Nanuq: has joined #ruby
[00:18:03] adaedra: you can read a lot of bytes and then take care of them
[00:18:16] adaedra: the problem is not taking too much
[00:18:32] bradland: was thinking of reading in a chunk of 1024, scanning for the first non \0, then appending chunks until we reach the right size for the packet type (byte 3)
[00:19:39] mg^: UDP packets should be delivered to you in whole, it'd be odd to have them delivered any other way
[00:19:57] mg^: Because you wouldn't be able to tell where one stopped and the other started
[00:19:57] bradland: mg^: what do you mean "in whole"?
[00:20:06] bradland: i get a byte stream
[00:21:00] mg^: recvfrom should give you the whole packet in the case of UDP
[00:21:19] adaedra: mg^: problem is that packets are an abstraction of the layer below
[00:21:44] bradland: yeah, packet issues are handled by UDPSocket
[00:21:48] bradland: i'm not concerned with that
[00:21:58] bradland: i have to process the payload, which may be split across UDP packets
[00:22:08] adaedra: some of them at least. I think you can be still struct by lost or misordered packets.
[00:22:37] adaedra: but that's the joy of doing UDP.
[00:22:37] bradland: i used to work in VoIP, so i'm painfully familiar with the loose nature of UDP
[00:22:39] mg^: so you've got a higher-level protocol that is ABC ABC ABC and it might map to (ABC A) (BC AB) (C)
[00:23:00] bradland: this is all LAN based, so it's generally pretty reliable
[00:23:04] adaedra: but you still get one stream. Amazing, uh?
[00:23:06] bradland: there's no checksum in this netcode though
[00:23:21] adaedra: With packets small enough it should be ok.
[00:23:25] Bellthoven: has joined #ruby
[00:23:55] bradland: have a look at this: https://gist.github.com/bradland/91046d8cb770e201daec#file-stelemetrydata-c
[00:23:59] adaedra: Might lost some; anyway, if you're in a game context, information you get are relevant for such a small amount of time generally that a lost packet is no problem.
[00:24:06] bradland: those are the structs that come across the wire
[00:24:13] bradland: the largest is 1367 bytes
[00:24:29] bradland: no checksum
[00:24:52] adaedra: if half-a-struct is lost tho, you're in for a bad time.
[00:25:00] mg^: Presumably they are encapsulated so that you can tell which struct is where?
[00:25:08] bradland: mg^: hahaha... no
[00:25:19] bradland: see the first two fields
[00:25:29] bradland: sBuildVersionNumber and sPacketType?
[00:25:45] bradland: the first is a fixed value
[00:25:56] mg^: yeah got it
[00:26:00] bradland: the second you run mod 4 against it and it gets you your packet type
[00:26:04] bradland: you pick a struct and run with it
[00:26:14] mg^: yeah in C you'd just cast the structs based on that value
[00:26:30] bradland: since they have defined sizes, you can read 1367 bytes and attempt to process it
[00:26:35] jbrhbr: has joined #ruby
[00:26:43] adaedra: Anyway, it's time for me to read on BEDSocket.
[00:26:49] bradland: *normally*, you'd get a checksum field early on so you could find out if you got al lthe data
[00:26:54] bradland: right on, thanks adaedra
[00:27:33] bradland: mg^ this code uses the bindata gem to pull apart a blob once i've identified it: 1367
[00:27:38] bradland: https://gist.github.com/bradland/91046d8cb770e201daec#file-pcars_net-rb
[00:28:04] bradland: bindata could be thought of as a DSL built around String#unpack
[00:28:31] mg^: Well, on a LAN it's fine because the ethernet FCS will cover you, provided all your L1 is okay
[00:28:55] bradland: FCS won't guarantee that UDP arives in order
[00:29:02] bradland: it will only ensure the frame is intact
[00:29:05] mg^: no, out of order is going to be problematic
[00:29:25] bradland: at the app layer, a checksum helps you discard data you can't use
[00:29:32] mg^: You might find a heuristic way to see if the data makes sense
[00:29:44] bradland: yeah, i have bounds, so i could bounds check
[00:29:55] bradland: toss cookies if it fails
[00:30:32] chouhoulis: has joined #ruby
[00:31:23] mg^: So are you doing a scoreboard or something?
[00:31:33] bradland: "Pit Boss" app
[00:32:04] brixen: has joined #ruby
[00:34:08] bogn: has joined #ruby
[00:36:28] djbkd_: has joined #ruby
[00:40:22] rodfersou: has joined #ruby
[00:42:42] baweaver: has joined #ruby
[00:44:16] hxegon: I wonder if you could train a computer to detect card counters with machine vision
[00:44:40] hxegon: *computer :P
[00:44:54] jhass: I wouldn't be surprised if that's already deployed
[00:46:33] rakm: has joined #ruby
[00:48:09] brixen: has joined #ruby
[00:48:45] Arnvald: has joined #ruby
[00:48:56] akem: has joined #ruby
[00:49:45] nertzy: has joined #ruby
[00:49:47] jessemcgilallen: has joined #ruby
[00:49:48] Bellthoven: has joined #ruby
[00:51:03] hays: has joined #ruby
[00:52:39] hxegon: not deployed I don't think, but exists in some form: http://phys.org/news/2009-10-combats-blackjack-card.html
[00:53:30] Mr_Psmith: has joined #ruby
[00:53:55] rodfersou: has joined #ruby
[00:53:57] atomical: has joined #ruby
[00:56:02] _djbkd: has joined #ruby
[00:59:08] colegatron: has joined #ruby
[01:00:09] lyoshajapan: has joined #ruby
[01:01:28] build22_: has joined #ruby
[01:02:39] kknight: has joined #ruby
[01:03:54] DLSteve: has joined #ruby
[01:06:26] weemsledeux: has joined #ruby
[01:07:24] _djbkd: has joined #ruby
[01:10:30] nettoweb: has joined #ruby
[01:13:17] lacuna: has joined #ruby
[01:14:30] mistermocha: has joined #ruby
[01:18:28] _djbkd: has joined #ruby
[01:19:35] rgtk: has joined #ruby
[01:19:53] cwong_on_irc: has joined #ruby
[01:21:32] banister: has joined #ruby
[01:28:06] nofxx: has joined #ruby
[01:28:06] nofxx: has joined #ruby
[01:28:54] lessless: has joined #ruby
[01:30:47] CloCkWeRX: has joined #ruby
[01:31:28] chouhoulis: has joined #ruby
[01:31:36] DavidDudson: has joined #ruby
[01:32:05] snoozelose: has joined #ruby
[01:32:14] snoozelose: has joined #ruby
[01:34:41] seitensei: has joined #ruby
[01:34:58] nerium: has joined #ruby
[01:36:11] ElFerna: has joined #ruby
[01:36:37] ornerymoose: has joined #ruby
[01:39:38] icarus: has joined #ruby
[01:40:18] idefine: has joined #ruby
[01:40:57] _djbkd: has joined #ruby
[01:41:47] krz: has joined #ruby
[01:44:27] hololeap: has joined #ruby
[01:45:07] Uptime: has joined #ruby
[01:46:20] hololeap: can anybody give me a brief comparison between ruby and scala for event-driven programming? which do you like better?
[01:46:54] ramfjord: has joined #ruby
[01:47:56] c-c: just a queue, then
[01:49:15] guacamole: has joined #ruby
[01:49:40] rickmasta: has joined #ruby
[01:53:57] skcin7: has joined #ruby
[01:55:06] pwnd_nsfw: has joined #ruby
[01:56:28] dsdeiz: has joined #ruby
[01:57:00] cassioscabral: has joined #ruby
[01:57:18] nanoz: has joined #ruby
[02:00:38] idefine: has joined #ruby
[02:01:29] ckrailo_: has joined #ruby
[02:03:56] cwong_on_irc: has joined #ruby
[02:04:13] jun_: has joined #ruby
[02:04:20] SleepySensei: has joined #ruby
[02:05:50] neanderslob: has joined #ruby
[02:07:31] govg: has joined #ruby
[02:07:37] shevy: not sure that you can find many who use scala here hololeap
[02:09:30] guacamole: has joined #ruby
[02:09:52] howdoicomputer: has joined #ruby
[02:10:38] sucks: has joined #ruby
[02:11:47] root_: has joined #ruby
[02:12:39] arescorpio: has joined #ruby
[02:16:15] govg: has joined #ruby
[02:19:34] idefine: has joined #ruby
[02:21:36] _stu_: has joined #ruby
[02:23:59] UniFreak: has joined #ruby
[02:24:37] ss_much: has joined #ruby
[02:26:40] ur5us: has joined #ruby
[02:27:21] fierycatnet: has joined #ruby
[02:29:04] shock_one: has joined #ruby
[02:32:12] chouhoulis: has joined #ruby
[02:33:25] pika_pika: has joined #ruby
[02:36:46] lannonbr: has left #ruby: ("WeeChat 1.0.1")
[02:39:59] weemsledeux: has joined #ruby
[02:43:38] sneakerhax: has joined #ruby
[02:45:41] fullofcaffeine: has joined #ruby
[02:47:35] mistermocha: has joined #ruby
[02:47:59] snoozelose: has joined #ruby
[02:48:09] snoozelose: has joined #ruby
[02:48:10] jmonreal: has joined #ruby
[02:48:43] govg: has joined #ruby
[02:48:53] snoozelose: has joined #ruby
[02:50:22] blackmesa: has joined #ruby
[02:54:38] mjwhitta: has joined #ruby
[02:55:37] lannonbr: has joined #ruby
[02:55:55] smactive: has joined #ruby
[03:04:02] hololeap: has joined #ruby
[03:06:51] Exce1l: has joined #ruby
[03:10:15] Exce1l: Any good suggestions on guides on Ruby for a newbie w/o any coding experience ?
[03:11:13] fullofcaffeine: has joined #ruby
[03:12:50] shevy: Exce1l have a look at https://pine.fm/LearnToProgram/chap_00.html
[03:13:28] cwong_on_irc: has joined #ruby
[03:13:44] hxegon: has joined #ruby
[03:13:46] Exce1l: @shevy how long you being coding ?
[03:14:01] cwong_on_irc: has joined #ruby
[03:16:03] eytanfb: has joined #ruby
[03:16:25] ramfjord: has joined #ruby
[03:16:58] devbug: has joined #ruby
[03:17:55] Ox0dea: has joined #ruby
[03:20:23] nocd: has joined #ruby
[03:20:35] darkf: has joined #ruby
[03:23:48] sucks_: has joined #ruby
[03:27:15] skcin7: has joined #ruby
[03:28:16] Exce1l: has left #ruby: ()
[03:28:52] baweaver: has joined #ruby
[03:29:43] skcin7: has joined #ruby
[03:30:02] jcdesimp: has joined #ruby
[03:30:28] shock_one: has joined #ruby
[03:32:53] chouhoulis: has joined #ruby
[03:33:17] smactive: has joined #ruby
[03:35:32] seitensei: has joined #ruby
[03:36:05] Exce1l: has joined #ruby
[03:37:17] jgpawletko: has joined #ruby
[03:39:05] nanoz: has joined #ruby
[03:44:51] Bloomer: has joined #ruby
[03:45:17] Arnvald: has joined #ruby
[03:47:33] davedev24: has joined #ruby
[03:47:44] dlitvak_: has joined #ruby
[03:50:01] lyoshajapan: has joined #ruby
[03:52:20] kknight: has joined #ruby
[03:52:41] pawnbox: has joined #ruby
[03:57:48] dstarh: has joined #ruby
[03:58:30] CloCkWeRX: has joined #ruby
[03:59:30] jcdesimp: has joined #ruby
[04:02:47] Ropeney: has joined #ruby
[04:05:34] Spami: has joined #ruby
[04:06:36] sgambino: has joined #ruby
[04:07:19] ayromo08: has joined #ruby
[04:07:36] nwhirschfeld: has joined #ruby
[04:10:02] zast: has joined #ruby
[04:14:19] dlitvak: has joined #ruby
[04:15:29] Scripore: has joined #ruby
[04:17:00] braincrash: has joined #ruby
[04:18:16] akem: has joined #ruby
[04:18:23] yeticry: has joined #ruby
[04:18:36] DanielI: has joined #ruby
[04:20:24] blackmesa: has joined #ruby
[04:20:58] floatingpoint: has joined #ruby
[04:22:50] gix: has joined #ruby
[04:23:01] yeshacker: has joined #ruby
[04:23:39] UniFreak: has left #ruby: ("Leaving")
[04:27:27] mloy: has joined #ruby
[04:27:28] akem2: has joined #ruby
[04:29:29] rgtk: has joined #ruby
[04:32:34] astrobun_: has joined #ruby
[04:33:43] chouhoulis: has joined #ruby
[04:34:02] dlitvak: has joined #ruby
[04:35:57] stannard: has joined #ruby
[04:36:56] nocd: has left #ruby: ()
[04:38:15] akem: has joined #ruby
[04:38:25] jun_: has joined #ruby
[04:39:25] djbkd: has joined #ruby
[04:39:34] seitensei: has joined #ruby
[04:44:57] guacamole: has joined #ruby
[04:45:32] Snaggle: has joined #ruby
[04:48:31] msankhala: has joined #ruby
[04:49:38] Snaggle: trying to install pango-ruby (on OS X). I have cairo-1.14.3 and glib2-2.2.5 installed, which should satisfy the dependencies, but gem install says it can???t resolve them (though gem list sees them). https://gist.github.com/nieder/12cc2a9f6ef09259c13b
[04:51:12] kknight: has joined #ruby
[04:51:32] kknight: how to istall rdoc from repository in linux
[04:52:09] hololeap: has joined #ruby
[04:52:59] krz: has joined #ruby
[04:53:40] dlitvak: has joined #ruby
[04:54:41] nanoz]: has joined #ruby
[04:57:19] slackbotgz: has joined #ruby
[04:57:30] braincra-: has joined #ruby
[04:57:35] djbkd: has joined #ruby
[04:57:40] boxofrox: has joined #ruby
[04:57:53] guacamole: has joined #ruby
[04:59:11] agent_white: Radar: Bumped into you outside ruby-land I see :P
[04:59:26] Radar: I am everywhere
[04:59:38] Radar: You cannot escape me.
[04:59:39] pipework: he is the all seeing Radar.
[04:59:42] pipework: hence the nick.
[05:00:08] devbug_: has joined #ruby
[05:02:47] icarus: has joined #ruby
[05:03:36] kknight: i have already installed ruby in my linux, iwant to generate rdoc to see them how to do that?
[05:06:18] berserk_ren: has joined #ruby
[05:06:22] poguez_: has joined #ruby
[05:06:46] nisstyre: has joined #ruby
[05:07:18] nisstyre: has joined #ruby
[05:08:02] guacamole: has joined #ruby
[05:09:52] shock_one: has joined #ruby
[05:12:43] Contigi: has joined #ruby
[05:12:45] baweaver: has joined #ruby
[05:13:26] dlitvak: has joined #ruby
[05:13:54] lyoshajapan: has joined #ruby
[05:21:13] duckgoose: has joined #ruby
[05:21:18] duckgoose: has left #ruby: ("ByrdIRC")
[05:21:55] guideX: has joined #ruby
[05:24:54] mclong: has joined #ruby
[05:25:44] karapetyan: has joined #ruby
[05:26:26] guacamole: has joined #ruby
[05:27:16] houhoulis: has joined #ruby
[05:28:14] roshanavand: has joined #ruby
[05:28:43] guacamole: has joined #ruby
[05:32:44] mistermocha: has joined #ruby
[05:33:20] sucks: has joined #ruby
[05:33:48] guacamole: has joined #ruby
[05:34:26] chouhoulis: has joined #ruby
[05:39:57] dlitvak: has joined #ruby
[05:41:43] buzz07630072: has joined #ruby
[05:42:10] pawnbox: has joined #ruby
[05:43:34] icarus: has joined #ruby
[05:43:54] AKASkip: has joined #ruby
[05:47:08] buzz07630072: /msg NickServ VERIFY REGISTER buzz07630072 xqeapkqydluh
[05:49:44] devoldmx: has joined #ruby
[05:49:49] yfeldblum: has joined #ruby
[05:49:50] camus: Hello, I'm having trouble setting up a script - need it to: 1. query a url with a zip code (populated from a file) 2. store result to file 3. curl url again w/ new zip code. 4. append to file 5. end
[05:50:08] camus: the url returns json about a zip code that is a parameter of the url
[05:50:23] blackmesa: has joined #ruby
[05:50:37] camus: i just want to store and append the json to a local file for each zip code
[05:50:47] pawnbox: has joined #ruby
[05:51:05] pipework: camus: Where's the code for it?
[05:51:58] govg: has joined #ruby
[05:53:38] finisherr: has joined #ruby
[05:55:08] camus: pipework: I'm still trying to figure out what I am going to use to curl the URL.
[05:55:33] pipework: camus: 'to curl'? You mean to request the URL?
[05:55:52] camus: pipework: Yeah, how to grab the URL (which returns JSON)
[05:55:56] pipework: You have lots of choices, you have gems that make it easy, a harder to use core library called Net::HTTP, and all sorts of stuff.
[05:56:16] pipework: camus: Do you mind using a nice gem? I use faraday mostly myself.
[05:56:30] camus: pipework: No, a gem would be great if that would make my job easier.
[05:56:46] pipework: camus: Look into faraday.
[05:57:01] camus: ok, thank you for helping me
[05:57:26] pipework: camus: Let us know if you struggle and need a helping hand.
[05:57:38] camus: ok will do
[05:57:44] yeshacker: has joined #ruby
[05:58:15] guacamole: has joined #ruby
[05:58:27] pawnbox: has joined #ruby
[05:59:46] dlitvak: has joined #ruby
[06:00:16] jcdesimp: has joined #ruby
[06:08:42] jeregrine: has joined #ruby
[06:09:53] phial: has joined #ruby
[06:10:26] chrisseaton: has joined #ruby
[06:11:02] cstrahan: has joined #ruby
[06:11:18] shock_one: has joined #ruby
[06:11:25] rfv: has joined #ruby
[06:11:36] n1ftyn8_: has joined #ruby
[06:11:54] ELCALOR: has joined #ruby
[06:13:30] seitensei: has joined #ruby
[06:17:16] agent_white: has joined #ruby
[06:21:25] startupality: has joined #ruby
[06:24:06] startupality: has joined #ruby
[06:25:07] sdwrage: has joined #ruby
[06:29:52] lyoshajapan: has joined #ruby
[06:30:22] rgtk: has joined #ruby
[06:30:33] seitensei: has joined #ruby
[06:30:45] ur5us: has joined #ruby
[06:30:52] rippa: has joined #ruby
[06:31:47] sdwrage: has joined #ruby
[06:31:56] ohaibbq: has joined #ruby
[06:33:45] chipotle: has joined #ruby
[06:35:10] chouhoulis: has joined #ruby
[06:37:38] juddey: has joined #ruby
[06:39:19] steffkes: has joined #ruby
[06:39:20] steffkes: has joined #ruby
[06:43:57] yfeldblum: has joined #ruby
[06:45:11] nanoz: has joined #ruby
[06:46:19] lyoshajapan: has joined #ruby
[06:47:17] colegatron: has joined #ruby
[06:47:18] guacamole: has joined #ruby
[06:47:33] dostoyevsky: has joined #ruby
[06:47:53] dostoyevsky: I am executing: "gem19 install oauth2" but it just hangs...
[06:49:00] ton31337: has joined #ruby
[06:49:09] dionysus69: has joined #ruby
[06:49:10] ton31337: hi, how to install ruby headers from .tar.gz ?
[06:49:26] ton31337: is there another official .tar.gz for debug symbols?
[06:49:28] ton31337: and headers
[06:51:52] ta: has joined #ruby
[06:52:11] blackmesa: has joined #ruby
[06:55:21] thoraxe: has joined #ruby
[06:55:25] jun_: has joined #ruby
[06:55:49] thoraxe: so i am using the trello gem and messing with lists and cards and etc. and there doesn't appear to be a direct way to "get all cards with a specific label" so it sounds like I will have to do a lot of iterating
[06:56:10] thoraxe: i'm mainly thinking out loud right now, hah
[06:56:57] dlitvak: has joined #ruby
[06:57:19] symm-: has joined #ruby
[06:57:37] radgeRayden: has joined #ruby
[07:01:58] ramfjord: has joined #ruby
[07:02:58] ledestin: has joined #ruby
[07:05:38] yfeldblum: has joined #ruby
[07:05:58] darkxploit: has joined #ruby
[07:08:51] norc: has joined #ruby
[07:08:57] norc: Good morning folks.
[07:09:32] claw: has joined #ruby
[07:09:38] aufi: has joined #ruby
[07:10:59] ruby-lang205: has joined #ruby
[07:13:32] andikr: has joined #ruby
[07:14:13] anisha: has joined #ruby
[07:14:52] dlitvak: has joined #ruby
[07:15:35] codecop: has joined #ruby
[07:18:42] dostoyevsky: has left #ruby: ()
[07:20:19] smactive: has joined #ruby
[07:29:27] Anderson69s: has joined #ruby
[07:32:08] tagrudev: has joined #ruby
[07:34:36] djbkd: has joined #ruby
[07:35:06] tenzan: has joined #ruby
[07:35:40] tvw: has joined #ruby
[07:35:56] chouhoulis: has joined #ruby
[07:36:56] firstdayonthejob: has joined #ruby
[07:38:29] lxsameer: has joined #ruby
[07:38:29] lxsameer: has joined #ruby
[07:44:28] Dimik: has joined #ruby
[07:44:39] passerine: has joined #ruby
[07:45:37] shock_one: has joined #ruby
[07:50:09] n3wbie: has joined #ruby
[07:50:26] n3wbie: Can anyone tell me how ruby generates auth_token?
[07:52:25] agent_white: has joined #ruby
[07:53:38] thoraxe: given an array with hashes inside, is there a way to check if any of the array items' hashes include a particular key:value?
[07:53:44] thoraxe: for example, the array :card_labels=>[{"id"=>"54d4de9c74d650d5671cb3c7", "idBoard"=>"54d4de9c73b36543ddf7d5b9", "name"=>"Project", "color"=>"green", "uses"=>49}]
[07:54:12] blackmesa: has joined #ruby
[07:54:18] thoraxe: normally you can do something like ['cat','dog','bird'].include? 'dog' but doing .include? {"id"=>"blah"} doesn't seem to work
[07:55:34] steffkes: has joined #ruby
[07:55:35] steffkes: has joined #ruby
[07:56:32] thoraxe: whoops, gotta go
[08:01:10] jcdesimp: has joined #ruby
[08:02:44] ltik: has joined #ruby
[08:04:18] dlitvak: has joined #ruby
[08:06:40] j416: thoraxe:
[08:06:41] j416: >> [{ a: 1, b: 2 }, { a: 5, b: 2 }, { a: 10, b: 1 }, { a: 2 }].select { |h| h.fetch(:b, false) == 2 }
[08:06:43] ruboto: j416 # => [{:a=>1, :b=>2}, {:a=>5, :b=>2}] (https://eval.in/487374)
[08:08:02] ton31337: has left #ruby: ()
[08:11:42] passerine: has left #ruby: ()
[08:12:00] agent_white: has joined #ruby
[08:13:10] n3wbie: has joined #ruby
[08:13:31] roshanavand: has joined #ruby
[08:14:17] roshanavand: has joined #ruby
[08:15:22] vasilakisFiL: has joined #ruby
[08:16:07] medvedu: has joined #ruby
[08:16:33] chipotle_: has joined #ruby
[08:16:34] mikecmpbll: has joined #ruby
[08:17:30] neanderslob: has joined #ruby
[08:17:45] sonOfRa: has joined #ruby
[08:17:55] jbrhbr: has joined #ruby
[08:18:04] pawnbox: has joined #ruby
[08:18:49] ur5us: has joined #ruby
[08:19:08] last_staff: has joined #ruby
[08:19:40] dmolina: has joined #ruby
[08:24:53] aganov: has joined #ruby
[08:25:10] seitensei: has joined #ruby
[08:27:47] roshanavand: has joined #ruby
[08:31:01] Hounddog: has joined #ruby
[08:31:10] rgtk: has joined #ruby
[08:32:34] vasilakisfil_: has joined #ruby
[08:34:18] SOLDIERz: has joined #ruby
[08:35:32] startupality: has joined #ruby
[08:36:40] chouhoulis: has joined #ruby
[08:37:26] ltik: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[08:40:56] msankhala: has joined #ruby
[08:43:00] nbdy: has joined #ruby
[08:43:13] eytanfb: has joined #ruby
[08:47:03] shock_one: has joined #ruby
[08:48:26] huyderman: has joined #ruby
[08:50:13] ramfjord: has joined #ruby
[08:56:55] nettoweb: has joined #ruby
[08:57:13] blackmesa: has joined #ruby
[08:57:23] DeXterbed: has joined #ruby
[08:57:48] troulouliou_div2: has joined #ruby
[08:58:20] senayar: has joined #ruby
[08:58:21] renemaya: has joined #ruby
[08:58:21] senayar: has joined #ruby
[08:58:32] agent_white: has joined #ruby
[09:01:40] nunchuck: has joined #ruby
[09:01:45] shock_one: has joined #ruby
[09:02:42] c0m0: has joined #ruby
[09:03:09] joonty: has joined #ruby
[09:03:16] pawnbox: has joined #ruby
[09:03:27] dlitvak: has joined #ruby
[09:03:32] icarus: has joined #ruby
[09:05:04] baweaver: has joined #ruby
[09:06:39] SCHAAP137: has joined #ruby
[09:06:54] tesuji: has joined #ruby
[09:07:59] drptbl: has joined #ruby
[09:11:25] blaxter: has joined #ruby
[09:13:27] chthon: has joined #ruby
[09:13:32] Jackneill: has joined #ruby
[09:13:38] lyoshajapan: has joined #ruby
[09:15:09] ruu_: has joined #ruby
[09:17:08] drptbl: has joined #ruby
[09:20:25] YaknotiS: has joined #ruby
[09:22:57] Neronfapper: has joined #ruby
[09:23:38] lyoshajapan: has joined #ruby
[09:25:09] ruu_: has joined #ruby
[09:27:00] mark3: has joined #ruby
[09:28:17] PlasmaStar: has joined #ruby
[09:29:28] lokulin: has joined #ruby
[09:29:55] DavidDudson: has joined #ruby
[09:32:34] n3wbie: has joined #ruby
[09:33:56] ruu_: has joined #ruby
[09:34:53] ruurd: has joined #ruby
[09:35:14] blackms: has joined #ruby
[09:35:33] TheHodge: has joined #ruby
[09:37:27] chouhoulis: has joined #ruby
[09:37:44] arooni-mobile: has joined #ruby
[09:37:51] rodfersou: has joined #ruby
[09:41:49] Ishido: has joined #ruby
[09:42:43] blackmesa: has joined #ruby
[09:42:50] bweston92: has joined #ruby
[09:44:40] Anderson69s: has joined #ruby
[09:48:16] pawnbox: has joined #ruby
[09:49:01] tomphp: has joined #ruby
[09:50:33] karapetyan: has joined #ruby
[09:51:28] tomphp: has joined #ruby
[09:51:59] konsolebox: has joined #ruby
[09:54:36] yos7ph: has joined #ruby
[09:57:58] FernandoBasso: has joined #ruby
[09:58:59] sandstrom: has joined #ruby
[10:00:21] platzhirsch: has joined #ruby
[10:02:03] jcdesimp: has joined #ruby
[10:02:18] shadoi: has joined #ruby
[10:02:22] alon: has joined #ruby
[10:03:03] ramfjord: has joined #ruby
[10:03:16] cwong_on_irc: has joined #ruby
[10:03:43] pawnbox: has joined #ruby
[10:06:51] pglombardo: has joined #ruby
[10:07:34] PedramT: has joined #ruby
[10:08:28] Bellthoven: has joined #ruby
[10:10:22] slackbotgz: has joined #ruby
[10:13:13] marr: has joined #ruby
[10:15:52] urban_nomad: has joined #ruby
[10:18:01] jds: has joined #ruby
[10:19:17] nonopposition: has joined #ruby
[10:20:32] gregf_: has joined #ruby
[10:21:51] Musashi007: has joined #ruby
[10:22:01] roshanavand: has joined #ruby
[10:22:55] zotherstupidguy: has joined #ruby
[10:23:30] lyoshajapan: has joined #ruby
[10:26:02] xlogic: has joined #ruby
[10:26:55] roshanavand: has joined #ruby
[10:27:59] build22_: has joined #ruby
[10:28:32] nfk|laptop: has joined #ruby
[10:30:03] karapetyan: has joined #ruby
[10:31:01] dlitvak: has joined #ruby
[10:31:34] TomyWork: can ruby deconstruct hashes?
[10:32:05] rgtk: has joined #ruby
[10:32:36] jhass: TomyWork: not really, how would you imagine that to look like?
[10:35:11] TomyWork: foo, bar, baz = { :foo => 1, :bar => 2, :baz => 3 }
[10:36:06] jhass: so depending on order?
[10:36:23] jhass: foo, bar, baz = { ... }.values
[10:36:41] jhass: but this is probably hash misuse
[10:38:08] chouhoulis: has joined #ruby
[10:38:49] maikowblue: has joined #ruby
[10:40:33] lurch_: has joined #ruby
[10:41:22] htmldrum: has joined #ruby
[10:43:28] krz: has joined #ruby
[10:44:18] seitensei: has joined #ruby
[10:44:53] Anderson69s: has joined #ruby
[10:47:45] xlogic: has joined #ruby
[10:50:04] senayar: has joined #ruby
[10:50:04] senayar: has joined #ruby
[10:50:38] dlitvak: has joined #ruby
[10:57:14] smactive: has joined #ruby
[10:57:15] Bish: why does set_instance_variable require an @ in front of the name, i mean that its an instance variable is in the parameter name already
[10:57:22] Meow-J: has joined #ruby
[10:57:26] Bish: why isn't there are cool way to set an instance variable just by a symbol?
[10:57:38] troulouliou_div2: has joined #ruby
[10:58:12] htmldrum: has joined #ruby
[10:58:32] shock_one: has joined #ruby
[11:01:02] startupality: has joined #ruby
[11:01:22] ljarvis: but you can use a symbol but still use @: :@foo
[11:01:54] Scripore: has joined #ruby
[11:02:06] jhass: couldn't one create instance vars without @ via the C API?
[11:02:24] jhass: anyway, the @ is just considered part of the name, not so much as a identifier/modifier thing
[11:02:50] shadoi: has joined #ruby
[11:02:52] jhass: kinda like the = is part of the name of foo= methods
[11:02:58] ljarvis: except it's definitely interpreted more as an identifier
[11:03:55] CloCkWeRX: has joined #ruby
[11:03:58] ljarvis: but yeah rb_iv_set requires the @ too so the logic is as you say
[11:04:51] Neronfapper: Im planning to create a 3d game with ruby, what could go wrong?
[11:04:59] ljarvis: everything
[11:05:07] ljarvis: or nothing
[11:05:10] ljarvis: what a question
[11:07:17] slackbotgz: has joined #ruby
[11:09:14] FooMunki: has joined #ruby
[11:09:14] roshanav_: has joined #ruby
[11:09:43] Bellthoven: has joined #ruby
[11:10:22] dlitvak: has joined #ruby
[11:12:35] skade: has joined #ruby
[11:13:07] guacamole: has joined #ruby
[11:14:19] tenderlove: has joined #ruby
[11:14:24] ruid: has joined #ruby
[11:14:25] ruid: has joined #ruby
[11:14:38] roshanavand: has joined #ruby
[11:15:02] gagrio: has joined #ruby
[11:16:39] oo7cat: has joined #ruby
[11:16:58] Vitor: has joined #ruby
[11:18:43] roshanavand: has joined #ruby
[11:18:51] oo7cat: i want learn ruby. but i don???t know where i must start?
[11:19:21] dlitvak: has joined #ruby
[11:19:21] PedramT: has joined #ruby
[11:20:16] ddv: oo7cat, google
[11:20:24] rickmasta: has joined #ruby
[11:20:51] oo7cat: ddv: i don???t know
[11:20:52] ddv: yeah it's a search engine
[11:22:06] htmldrum: has joined #ruby
[11:22:51] Bellthoven: has joined #ruby
[11:22:57] darkf__: has joined #ruby
[11:24:44] PaulePanter: Hi. I don???t understand why calculating with DateTimes give me a float and not an integer/Fixnum?
[11:24:48] PaulePanter: http://ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/DateTime.html
[11:24:51] medvedu: http://learnrubythehardway.org
[11:25:13] ur5us: has joined #ruby
[11:25:36] Ox0dea: medvedu: Please don't do that.
[11:25:53] jhass: oo7cat: what's your background?
[11:25:56] PaulePanter: Because of milliseconds?
[11:25:59] ljarvis: is the chris pine tutorial still around? it was so good
[11:26:07] Ox0dea: ljarvis: Yep.
[11:26:13] Ox0dea: https://pine.fm/LearnToProgram/
[11:26:23] jhass: oo7cat: ^ if you're all new to programming
[11:26:29] ljarvis: nice one, without doubt my fav beginners learning resource
[11:26:32] oo7cat: jhass: background? i live in mountain.
[11:26:39] Ox0dea: (It's a troll.)
[11:26:41] jhass: oo7cat: I mean programming wise
[11:26:49] colli5ion: has joined #ruby
[11:26:58] oo7cat: i learned c and c#
[11:27:11] jhass: to what degree?
[11:27:28] marcoecc: has joined #ruby
[11:27:50] oo7cat: oh, just i see book one more time.
[11:29:32] jhass: k, go with Pine
[11:29:44] PaulePanter: Is 0.1.floor the same as 0.1.to_i?
[11:30:01] ljarvis: >> 0.1.floor == 0.1.to_i
[11:30:02] ruboto: ljarvis # => true (https://eval.in/487469)
[11:30:08] ljarvis: that was easy to test
[11:30:13] PaulePanter: If x is a float, is x.floor equivalent to x.to_i
[11:30:27] PaulePanter: ljarvis: Sorry, I rephrased my question.
[11:31:07] ljarvis: PaulePanter: you can verify things like this in irb quite easily
[11:31:16] ljarvis: >> [0.1, 0.8].map(&:to_i)
[11:31:17] ruboto: ljarvis # => [0, 0] (https://eval.in/487471)
[11:31:21] ljarvis: must be floor, right?
[11:31:26] PaulePanter: http://ruby-doc.org/core-2.2.0/Float.html#method-i-floor
[11:31:45] PaulePanter: ljarvis: Thanks. I wonder why it???s implemented differently then.
[11:31:47] jhass: >> 100.times.map {|i| i * 0.01 }.all? {|i| i.floor == i.to_i }
[11:31:48] ruboto: jhass # => true (https://eval.in/487472)
[11:31:58] aryaching: has joined #ruby
[11:32:06] PaulePanter: http://ruby-doc.org/core-2.2.0/Float.html#method-i-to_i
[11:32:06] Ox0dea: >> [-3.5.to_i, -3.5.floor]
[11:32:07] ruboto: Ox0dea # => [-3, -4] (https://eval.in/487473)
[11:32:18] canton7: was just about to say - negative numbers...
[11:32:22] oo7cat: has left #ruby: ()
[11:32:39] PaulePanter: Thank you all!
[11:33:28] bmalum: has joined #ruby
[11:33:36] PedramT: has joined #ruby
[11:34:08] PaulePanter: http://ruby-doc.org/core-2.2.0/Float.html#method-i-to_i actually uses `floor` and `ceil`.
[11:34:46] chanx_: has joined #ruby
[11:35:29] Ox0dea: PaulePanter: And indeed why not?
[11:36:08] bmalum: has joined #ruby
[11:36:26] PaulePanter: Ox0dea: Sorry, I did not understand your comment.
[11:36:50] Ox0dea: PaulePanter: It makes plenty of sense that Float#to_i piggybacks on floor() and ceil(), no?
[11:38:54] chouhoulis: has joined #ruby
[11:39:12] Bellthoven: has joined #ruby
[11:39:15] gagrio: has joined #ruby
[11:39:52] inukshuk_: has joined #ruby
[11:40:34] ta: has joined #ruby
[11:40:51] c355E3B: has joined #ruby
[11:45:30] Spami: has joined #ruby
[11:47:33] drptbl: has joined #ruby
[11:49:09] DeXterbed: has joined #ruby
[11:50:16] chanx_: c dev here. you pussies.
[11:51:19] PaulePanter: Ox0dea: Yes, it does. It was just a statement to the answer of my question.
[11:51:20] sandstrom: has joined #ruby
[11:54:29] symm-: has joined #ruby
[11:59:46] arup_r: has joined #ruby
[12:01:23] agent_white: has joined #ruby
[12:01:37] Ishido: has joined #ruby
[12:02:48] jcdesimp: has joined #ruby
[12:03:52] shadoi: has joined #ruby
[12:04:12] cassioscabral: has joined #ruby
[12:05:14] shevy: Paulchen Panther is coding!
[12:06:08] mark3: has left #ruby: ("PART #RubyOnRails :PART #jquery :PART #reactjs :PART ##javascript :PART #elixir-lang :PART #debian :PART #zsh :PART #nethunter :PONG :weber.freenode.net")
[12:07:25] ElFerna: has joined #ruby
[12:07:49] millerti: has joined #ruby
[12:08:20] pawnbox: has joined #ruby
[12:08:57] morfin: has joined #ruby
[12:09:59] prestorium: has joined #ruby
[12:10:14] arup_r: has joined #ruby
[12:11:10] nfk|laptop: has joined #ruby
[12:12:05] basex: has joined #ruby
[12:15:20] nerium: has joined #ruby
[12:19:22] domaldel_: has joined #ruby
[12:19:35] guide_X: has joined #ruby
[12:19:41] Domaldel: has joined #ruby
[12:22:09] ramfjord: has joined #ruby
[12:23:14] ruby-lang953: has joined #ruby
[12:23:45] ruby-lang953: i want to run a ruby script once a day on a ubuntu server withouth having to login etc. Is crontab my best option?
[12:25:27] morfin: yes, as i know you can put it in /etc/crontab.daily or just add to crontab of some user
[12:29:05] jhass: ruby-lang953: crontab or systemd timers if it's running on systemd
[12:30:40] PedramT: has joined #ruby
[12:32:24] brixen: has joined #ruby
[12:32:55] rgtk: has joined #ruby
[12:35:04] atumzin: has joined #ruby
[12:35:04] atumzin: has joined #ruby
[12:38:50] karapetyan: has joined #ruby
[12:39:22] toretore: has joined #ruby
[12:39:38] chouhoulis: has joined #ruby
[12:40:08] tAn: has joined #ruby
[12:40:15] siddharth: has joined #ruby
[12:40:26] senayar: has joined #ruby
[12:41:59] TomyWork: comment.delete if comment.body == '-snip-' rescue # will this ignore exceptions raised in comment.delete?
[12:42:26] skakri: has joined #ruby
[12:43:04] jhass: hence it's bad style
[12:44:35] ta: has joined #ruby
[12:44:42] nonopposition: has joined #ruby
[12:44:43] Anderson69s: has joined #ruby
[12:44:48] nonopposition: has joined #ruby
[12:44:54] madcodes: has joined #ruby
[12:44:59] senayar: has joined #ruby
[12:45:12] seitensei: has joined #ruby
[12:45:40] PedramT: has joined #ruby
[12:46:36] TomyWork: well i'm deleting comments from jira issues. the only way to see if i am able to do it seems to be to try it
[12:46:52] TomyWork: and if i can't, then i dont care that much either
[12:47:01] ljarvis: that doesn't make it better. You should rescue the correct exception
[12:47:14] ljarvis: >> comment.delete rescue "wat"
[12:47:15] ruboto: ljarvis # => "wat" (https://eval.in/487522)
[12:47:32] TomyWork: is that possible in postfix rescue?
[12:47:39] ljarvis: no, which is why you shouldn't use it
[12:47:58] TomyWork: ah well, what could possibly go wrong?
[12:48:04] ljarvis: lots and lots
[12:48:20] TomyWork: out of memory? stack overflow?
[12:48:36] ljarvis: who knows? you've rescued everything, you'll never find out
[12:48:38] TomyWork: hardly an issue with this tiny application
[12:49:09] ljarvis: ok well you have our advice at least
[12:49:35] colegatron: has joined #ruby
[12:50:09] karapetyan: has joined #ruby
[12:50:35] shevy: TomyWork you should write your programs all in one line
[12:52:19] SCHAAP137: has joined #ruby
[12:52:19] SleepySensei: has joined #ruby
[12:52:21] TomyWork: except, i'll need a 2nd line for the shebang
[12:52:21] decoponio: has joined #ruby
[12:52:43] jhass: #!/usr/bin/ruby -e 'p "no you don't"'
[12:53:06] DeXterbed: has joined #ruby
[12:53:09] ljarvis: why even write it in a file anyway
[12:53:11] TomyWork: except, no that doesnt work
[12:53:14] yeticry: has joined #ruby
[12:53:18] ljarvis: just straight up `ruby -e '...'`
[12:53:36] TomyWork: you can pass exactly one argument before the file name with a shebang
[12:54:07] TomyWork: #!appname argument1 still argument 1 all of this is argument 1
[12:54:53] manquer: has joined #ruby
[12:55:00] skakri: has joined #ruby
[12:57:20] cassioscabral: has joined #ruby
[12:58:30] benhuda: has joined #ruby
[12:59:54] PedramT: has joined #ruby
[13:00:12] jcdesimp: has joined #ruby
[13:01:28] pika_pika: has joined #ruby
[13:03:26] ruid: has joined #ruby
[13:03:27] ruid: has joined #ruby
[13:05:21] NfNitLoop: has joined #ruby
[13:06:14] gurix: has joined #ruby
[13:06:23] NfNitLoop: Hi! New to Ruby, but have many other langauges under my belt. I see coworkers (who are offline) using a pattern @foo = begin ... end. That seems to make foo be a closure that returns an object lazily. (from my testing) And it only does it once. Where can I find details about how that works?
[13:07:16] NfNitLoop: "does it" => executes the closure to create the object. That's the part I don't quite understand. If foo is a closure, and you're automatically evaluating closures, I'd expect to see it built each time?
[13:07:46] Snaggle: I???m trying to install pango-ruby-2.2.5 (on OS X). I have cairo-1.14.3 and glib2-2.2.5 installed, which should satisfy the dependencies, but ???gem install??? says it can???t resolve the dependencies (though gem list sees them and I installed them the same way I???m trying to install pango). https://gist.github.com/nieder/12cc2a9f6ef09259c13b Thoughts as to why gem list disagrees with gem install?
[13:08:54] karapetyan: has joined #ruby
[13:09:01] baweaver: has joined #ruby
[13:12:18] roshanavand: has joined #ruby
[13:12:27] nonopposition: has joined #ruby
[13:15:09] ramfjord: has joined #ruby
[13:15:37] TomyWork: I'm still struggling to grasp class variables. I have This at class scope: @@semaphore = Mutex.new; def request; @@semaphore.synchronize { ...
[13:15:44] TomyWork: does this do what i think it does?
[13:16:16] TomyWork: i think it creates one mutex per class, not per instance
[13:16:43] PedramT: has joined #ruby
[13:19:02] mikecmpbll: has joined #ruby
[13:19:19] joonty: has joined #ruby
[13:19:27] jhass: NfNitLoop: it's not a closure no, and shouldn't execute only once unless it's actually @foo ||= begin
[13:20:17] jhass: NfNitLoop: begin; end is simply grouping the following statements into a single expression, whose value is the value of the last statement inside it
[13:20:51] roshanavand: has joined #ruby
[13:20:53] jhass: it's the very same thing you use together with rescue and ensure too
[13:21:30] roshanavand: has joined #ruby
[13:21:32] jhass: TomyWork: no, it creates one per this class and all its child classes
[13:21:47] jhass: TomyWork: generally the valid usecases for class variables are very rare
[13:21:59] synthroid: has joined #ruby
[13:22:00] jhass: most of the time you want a class level instance variable instead
[13:22:04] gagrio: has joined #ruby
[13:22:31] TomyWork: jhass how do i access that from within a method?
[13:22:38] jhass: class << self; def mutex; @mutex ||= Mutex.new; end; end; self.class.mutex.synchronize
[13:22:45] atomical: has joined #ruby
[13:23:04] TomyWork: not going to make a method just for that :)
[13:23:26] roshanavand: has joined #ruby
[13:24:25] jackcom: has joined #ruby
[13:26:14] Jet4Fire: has joined #ruby
[13:27:17] dlitvak: has joined #ruby
[13:27:36] d0nn1e: has joined #ruby
[13:33:32] puria: has joined #ruby
[13:34:08] nateberkopec: has joined #ruby
[13:34:12] xlogic: has joined #ruby
[13:34:18] joonty: has joined #ruby
[13:35:49] charliesome_: has joined #ruby
[13:38:11] kp666: has joined #ruby
[13:38:14] roshanav_: has joined #ruby
[13:39:59] ramortegui: has joined #ruby
[13:40:22] chouhoulis: has joined #ruby
[13:42:10] chipotle: has joined #ruby
[13:42:55] AlexRussia: has joined #ruby
[13:43:07] shevy: TomyWork hmm you don't understand @@vars - but you don't want to use a method to access @vars on the class level either
[13:43:08] NfNitLoop: jhass: aaaah, thank you. That makes much more sense. :)
[13:43:34] NfNitLoop: It was behaving so strangely I figured there must've been some disconnect in my brain. :)
[13:44:12] NfNitLoop: Funny thing is... I encountered it inside of a function that "returns" a variable, so there was no reason to bother wrapping it in a begin...end anyway! They could've just used function scipe.
[13:44:19] TomyWork: shevy you're right, maybe i should figure out how they achieve their inheritance first
[13:44:38] chipotle_: has joined #ruby
[13:45:03] charliesome: has joined #ruby
[13:45:21] NfNitLoop: I discovered this too: http://pastie.org/10639812 It looks like functions have an implicit reference to an instance that calls them, and can muck with their instance variables? Please tell me this is frowned upon in the Ruby community so that I can go tell my devs. never to do it again.
[13:45:32] Polysics: has joined #ruby
[13:46:39] shevy: NfNitLoop an implicit reference? you mean "self"? self will be something but that something may be different
[13:46:56] NfNitLoop: shevy: see the sample code --^
[13:47:00] jhass: NfNitLoop: small terminology nit: Ruby has no functions, only methods, blocks & objects
[13:47:25] NfNitLoop: OK, replace function with "a method that is not on my class." :p
[13:48:04] jhass: well it always is
[13:48:07] shevy: NfNitLoop why did he give the same name
[13:48:11] jhass: toplevel methods are defined on Object
[13:48:11] droidburgundy: has joined #ruby
[13:48:27] jhass: your class inherits Object unless it explicitly inherits BasicObject
[13:49:08] NfNitLoop: shevy: Huh?
[13:49:18] dstarh: has joined #ruby
[13:49:22] jhass: I can't really conclude on what the real code might look like from your sample, so I can't judge if it's something ugly
[13:49:33] jhass: but if your reduction is accurate it probably is
[13:49:40] MissionCritical: has joined #ruby
[13:49:52] NfNitLoop: jhass: it looks very much like what I pasted. It ... for some reason... calls a method not opart of the current class to set an instance variable on the current class.
[13:49:57] charliesome_: has joined #ruby
[13:50:27] NfNitLoop: (current class instance. You know what I mean.) :p
[13:50:29] jhass: "not part of" == "defined at the toplevel" here?
[13:50:41] jhass: that sucks
[13:50:42] goodcodeguy: has joined #ruby
[13:50:47] jhass: should go into a module and be explicitly included
[13:51:01] NfNitLoop: how do you do that?
[13:51:01] _stu_: has joined #ruby
[13:51:21] jhass: module Wat; def wat; @name = "wat"; end; class Foo; include Wat; end
[13:51:28] jhass: + missing end
[13:51:33] TomyWork: ok so @@ behaves like a protected static variable in java. and this diagram tells me there's not really anything other than @@ that will actually have the lifetime, encapsulation and accessibility i need. I would have to supplement accessibility with a method, as you suggested.
[13:51:57] NfNitLoop: jhass: aha. cool. Yeah, that would be more explicit.
[13:52:00] Yiota: has joined #ruby
[13:52:02] soahccc: has joined #ruby
[13:52:12] TomyWork: this diagram: http://natashatherobot.com/ruby-variable-scope/
[13:52:15] shevy: that code is really scary
[13:52:28] NfNitLoop: jhass: so, why does that work? Are you saying that putting something on the top level defines it on Object?
[13:52:36] jhass: TomyWork: the big difference is that in java you have to explicitly call the parent class in child classes, in Ruby it's implicitly done, which makes the propagation and definition point of @@vars entirely not obvious and often hard to debug
[13:52:37] NfNitLoop: (not your code, the crap code I'm looking at.) :p
[13:52:49] sgambino: has joined #ruby
[13:52:55] jhass: NfNitLoop: it does
[13:53:04] jhass: NfNitLoop: since topevel self is an instance of Object
[13:53:14] gizmore: has joined #ruby
[13:53:25] jhass: (well that alone is not entirely sufficient for it to happen but good enough as an approximation for now)
[13:53:52] jhass: fact is toplevel methods are defined on Object
[13:54:18] jhass: >> def foo; end; method(:foo).owner
[13:54:19] ruboto: jhass # => Object (https://eval.in/487529)
[13:54:38] TomyWork: jhass nope: https://ideone.com/4CPsHa
[13:54:41] atomical_: has joined #ruby
[13:55:23] jhass: TomyWork: mh, when calling them from child instances though, no?
[13:56:37] TomyWork: you only need to specify the class if it's shadowed or if the class is not a superclass
[13:56:58] jhass: anyway, it's still much more explicit since you have a clear declaration point
[13:56:59] TomyWork: i'm ideone'ing an example with shadowing right now but that page is being slow
[13:57:17] TomyWork: and you have shadowing in java
[13:57:18] jhass: and even then I wouldn't call it a good pattern in Java either
[13:57:33] TomyWork: yes, but what is a good java pattern anyway? :P
[13:57:55] shevy: tiobe says that java is best
[13:58:03] TomyWork: many times they're workarounds for the lack of a feature
[13:58:11] Anderson69s: has joined #ruby
[13:58:20] fullofcaffeine: has joined #ruby
[13:58:26] karapetyan: has joined #ruby
[13:58:40] TomyWork: https://ideone.com/4CPsHa <-- shadowing
[13:58:55] jhass: shevy: that you take popularity for quality is a very sad mindest to be in
[13:59:06] inukshuk_: has joined #ruby
[13:59:19] TomyWork: this is what java has and ruby doesnt, which makes protected vars viable
[13:59:23] lipoqil: has joined #ruby
[13:59:29] shevy: I see lots of protected static ints
[13:59:31] TomyWork: anyway, no one is going to inherit my class :)
[13:59:45] adaedra: jhass: how many times did we tell him that already?
[14:03:32] ESpiney: has joined #ruby
[14:04:26] Scripore: has joined #ruby
[14:05:53] shadoi: has joined #ruby
[14:05:56] sdothum: has joined #ruby
[14:06:09] akaiiro: has joined #ruby
[14:06:20] TomPeed: has joined #ruby
[14:09:31] nfk|laptop: has joined #ruby
[14:09:39] centrx: has joined #ruby
[14:09:50] moeabdol: has joined #ruby
[14:12:23] atomical: has joined #ruby
[14:14:01] LightStalker: has joined #ruby
[14:14:25] moeabdol: has joined #ruby
[14:15:24] Timba-as: has joined #ruby
[14:15:32] DeXterbed: has joined #ruby
[14:17:07] synthroid: has joined #ruby
[14:18:15] sankaber: has joined #ruby
[14:18:16] dlitvak: has joined #ruby
[14:18:29] moeSeth: has joined #ruby
[14:19:41] troulouliou_div2: has joined #ruby
[14:21:17] dlitvak: has joined #ruby
[14:22:18] arup_r: has joined #ruby
[14:22:31] msankhala: has joined #ruby
[14:23:55] TomyWork: has joined #ruby
[14:26:55] charliesome: has joined #ruby
[14:26:57] symm-: has joined #ruby
[14:28:17] millerti: has joined #ruby
[14:28:19] wildlander: has joined #ruby
[14:28:29] medvedu: is there any place when i can get a good list for rss-feed about ruby or rails&ruby?
[14:29:01] wildlander: has joined #ruby
[14:29:05] Scripore: has joined #ruby
[14:29:10] basex: has joined #ruby
[14:29:22] platzhirsch: has left #ruby: ()
[14:29:38] babblebre: has joined #ruby
[14:30:06] Marsupermammal: has joined #ruby
[14:30:10] wildlander: has joined #ruby
[14:30:20] MissionCritical: has joined #ruby
[14:30:22] build22: has joined #ruby
[14:30:26] build22: has left #ruby: ()
[14:30:41] jhass: medvedu: rubyflow.com
[14:30:54] wildlander: has joined #ruby
[14:31:05] nanoz]: has joined #ruby
[14:32:38] pwnd_nsfw: has joined #ruby
[14:33:18] lazyatom_: has joined #ruby
[14:33:23] depesz: has joined #ruby
[14:33:46] rgtk: has joined #ruby
[14:33:49] depesz: hi. is there any "pretty printer" for ruby? something that would reformat given source code accoring to some set of rules?
[14:33:58] Madhur_: has joined #ruby
[14:33:59] c355E3B: depesz: rubocop
[14:34:28] c355E3B: can do stuff like `rubocop -a src.rb` and it corrects most of the mistakes it finds
[14:34:42] PedramT: has joined #ruby
[14:34:52] lazyatom: anyone here using jruby? I've tried asking a question in #jruby but nobody seems awake there
[14:34:56] charliesome: has joined #ruby
[14:35:20] depesz: c355e3b: testing, thanks.
[14:35:32] chouhoulis: has joined #ruby
[14:36:59] krz: has joined #ruby
[14:37:16] ljarvis: lazyatom: what's the question?
[14:38:14] gurix: has joined #ruby
[14:41:29] lazyatom: I've ready that JRuby 9(.0.4.0) supports refinements, but they don't seem to work for me: https://gist.github.com/lazyatom/6606b777c062ac8e1b84
[14:42:06] krobzaur: has joined #ruby
[14:42:45] marcoecc: has joined #ruby
[14:43:22] polishdub: has joined #ruby
[14:44:20] rgtk: has joined #ruby
[14:46:04] seitensei: has joined #ruby
[14:46:05] seitensei: has joined #ruby
[14:46:12] cdg: has joined #ruby
[14:51:07] dionysus69: has joined #ruby
[14:53:40] symm-: has joined #ruby
[14:54:16] depesz: has left #ruby: ("WeeChat 1.4-dev")
[14:54:25] pandaant: has joined #ruby
[14:58:11] platzhirsch: has joined #ruby
[15:00:45] atomical_: has joined #ruby
[15:02:04] snowy: has joined #ruby
[15:02:45] AncientAmateur: has joined #ruby
[15:02:56] depesz: has joined #ruby
[15:02:57] depesz: has left #ruby: ("WeeChat 1.4-dev")
[15:03:51] depesz: has joined #ruby
[15:04:21] bogn: has joined #ruby
[15:04:32] symm-: has joined #ruby
[15:04:46] marr: has joined #ruby
[15:04:49] depesz: hi. assuming I have string varialbe x, with value of "Something::SomethingElse" - how can I use it to create object of Something::SomethingElse class ?
[15:05:21] moeSeth: has joined #ruby
[15:05:38] ljarvis: &ri const_get
[15:05:42] `derpy: No results found
[15:05:43] JCOE: has joined #ruby
[15:05:57] siddharth: has joined #ruby
[15:05:57] depesz: ljarvis: ?
[15:05:57] ljarvis: &ri Module.const_get
[15:06:12] ljarvis: depesz: check out const_get
[15:06:18] depesz: searching
[15:06:21] ljarvis: adaedra: ^
[15:06:35] headius: lazyatom: file an issue for that please
[15:06:42] headius: that's a simple case and it's weird it doesn't work
[15:06:48] atomical: has joined #ruby
[15:06:57] depesz: oh, nice. thanks, ljarvis
[15:07:05] ljarvis: depesz: np!
[15:07:19] IrishGringo: has joined #ruby
[15:07:32] shadoi: has joined #ruby
[15:08:58] waheedi: has joined #ruby
[15:10:30] lazyatom: headius: I left a comment on https://github.com/jruby/jruby/issues/1062 but I can file a separate issue if you'd prefer?
[15:11:27] karapetyan: has joined #ruby
[15:11:44] grill: has joined #ruby
[15:11:49] headius: lazyatom: ahh yeah, open a new one...1062 is a little amorphous
[15:14:57] alphaatom: has joined #ruby
[15:15:13] weemsledeux: has joined #ruby
[15:17:31] chouhoulis: has joined #ruby
[15:17:49] mistermocha: has joined #ruby
[15:18:22] nettoweb: has joined #ruby
[15:18:33] mistermocha: has joined #ruby
[15:18:35] atomical_: has joined #ruby
[15:19:42] sucks: has joined #ruby
[15:20:40] pdoherty: has joined #ruby
[15:21:39] shanemcd: has joined #ruby
[15:22:13] _stu_: has joined #ruby
[15:22:37] aspire: has joined #ruby
[15:22:41] goodcodeguy: has joined #ruby
[15:23:58] ferr: has joined #ruby
[15:25:56] p0wn3d_: has joined #ruby
[15:29:18] lazyatom: headius: done
[15:29:18] dorei: has joined #ruby
[15:31:25] ornerymoose: has joined #ruby
[15:34:25] nertzy: has joined #ruby
[15:35:04] karapetyan: has joined #ruby
[15:35:47] Anderson69s: has joined #ruby
[15:36:45] hfp: has joined #ruby
[15:37:15] hfp_work: has joined #ruby
[15:38:14] ibouvousaime: has joined #ruby
[15:38:48] howdoi: has joined #ruby
[15:39:49] dmcp: has joined #ruby
[15:40:34] absolutejam: has joined #ruby
[15:42:44] sandstrom: has joined #ruby
[15:43:05] charliesome: has joined #ruby
[15:43:17] TomyWork: i have a simple sinatra app that i want to run as a linux service. it needs to run as a specific user and the correct ruby version should be provided (via rvm or otherwise) as well as the gems in the Gemfile. What should I use?
[15:43:42] TomyWork: this has to run on ubuntu 12.04 and pretty much nowhere else
[15:44:07] PedramT: has joined #ruby
[15:45:33] TomyWork: creating a nice .deb out of it would be a plus, but not required :)
[15:47:07] karapetyan: has joined #ruby
[15:47:24] nfk|laptop: has joined #ruby
[15:47:25] bougyman: TomyWork: chef-solo or puppet could do that pretty easily.
[15:47:46] bougyman: if you want to use ruby and not have to learn the debian build system.
[15:47:49] TomyWork: i'd still need a service script
[15:48:01] bougyman: yes and no.
[15:48:06] bougyman: we run all our ruby apps under runit.
[15:48:13] bougyman: apt-get install runit gets you that, in 12.04
[15:48:28] bougyman: we run all our * services under runit, in fact.
[15:48:49] TomyWork: oh, interesting
[15:48:57] dlitvak_: has joined #ruby
[15:49:05] TomyWork: i was considering runit
[15:49:15] bougyman: good consideration
[15:49:16] TomyWork: but i thought that would require extra effort, not less
[15:49:18] ElFerna: has joined #ruby
[15:49:50] bougyman: it requires a singe ./run script, which runs your sinatra app in the foreground.
[15:50:01] bougyman: all of the rest of the plumbing is provided by the runit package.
[15:50:03] TomyWork: oh that's simple :)
[15:50:18] bougyman: you can get fancy and have per-user services, that's a bit more effort on your part. see http://rubyists.github.io/2011/05/02/runit-for-ruby-and-everything-else.html#dependency_hierarchies_peruser_service_trees
[15:50:53] TomyWork: bougyman do i have to take care of changing the user?
[15:51:13] karapetyan: has joined #ruby
[15:51:35] TomyWork: not sure if i need "per-user services", but i want to run my app as a specific user
[15:51:35] bougyman: TomyWork: not if it's a per-user service tree. those run as the user.
[15:52:04] bougyman: if it's the main (root) runit supervision dir, you use chpst -u <username> <command> in the ./run script to run it as another user.
[15:52:19] bougyman: I usually do a per-user service tree only when that user has multiple interdependent services to run
[15:52:21] tjohnson: has joined #ruby
[15:52:34] bougyman: for just a single one I use chpst -u in the ./run script and put it in /etc/sv/<servicename>
[15:52:38] TomyWork: it doesnt, really
[15:52:52] TomyWork: hmm actually, let me check if i can piggyback on gitlab there...
[15:53:02] slawrence00: has joined #ruby
[15:54:26] toretore: TomyWork, why not just use the init system that's already there?
[15:56:00] madcodes: has joined #ruby
[15:56:04] TomyWork: ok, there's /opt/gitlab/sv/unicorn/run and such. I can probably just put my service script in there and have it start and stop together with gitlab
[15:56:25] TomyWork: toretore upstart or sysv?
[15:56:34] toretore: i'd go with upstart
[15:56:36] TomyWork: upstart has no future, sysv is... sysv
[15:56:41] toretore: if it's available
[15:56:56] toretore: what does it matter if you're running on 12.04
[15:57:07] TomyWork: not forever
[15:57:18] toretore: well then write a new one when you migrate
[15:57:19] TomyWork: i'm running this together with gitlab forever, though
[15:57:25] karmatr0n: has joined #ruby
[15:57:34] toretore: can you run docker?
[15:57:48] toretore: that would take care of dependency requirements
[15:58:03] TomyWork: but i dont fancy downloading a gigabyte just to run a 10 kb app
[15:58:32] toretore: you're downloading all that stuff anyway, and shoving it onto the host fs
[15:58:46] roshanavand: has joined #ruby
[15:58:47] TomyWork: waht am i downloading?
[15:59:05] toretore: ruby versions, gems, libs depended on
[15:59:05] TomyWork: i'm talking about all the layers for an OS
[15:59:12] rgtk: has joined #ruby
[15:59:18] toretore: it's as small or big as you make it
[15:59:20] imperator: has joined #ruby
[15:59:44] AnoHito: has joined #ruby
[15:59:47] toretore: if you use the ubuntu base image then it's going to be that size
[15:59:48] cjbottaro: has joined #ruby
[15:59:49] TomyWork: and the smaller you make it, the harder it gets
[15:59:56] shanemcd: has joined #ruby
[16:00:02] TomyWork: i'll take another look at upstart before deciding whether to use that or runit.
[16:00:24] toretore: you should provision a kubernetes cluster and use that
[16:01:35] TomyWork: /etc/init/rc.conf: description "System V runlevel compatibility" author "Scott James Remnant <scott@netsplit.com>"
[16:01:43] TomyWork: that guy has the right name for the task
[16:03:12] toretore: another option depending on the context is to just run your app in a tmux or screen session
[16:03:33] TomyWork: manually, each time
[16:03:42] toretore: what do you mean each time?
[16:03:47] kfpratt: has joined #ruby
[16:03:52] TomyWork: whenever the VM reboots
[16:04:02] toretore: how often does it do that?
[16:04:21] TomyWork: according to murphy's law, every time i take a vacation
[16:04:21] toretore: well, that's what i meant by context
[16:05:01] adaedra: ljarvis: first one is normal, second one not so much, but it may be a known issue I still haven't fixed, I look at it
[16:05:12] hxegon: has joined #ruby
[16:06:40] stannard: has joined #ruby
[16:07:38] freerobby: has joined #ruby
[16:07:49] cassioscabral: has joined #ruby
[16:08:35] ornerymoose: has joined #ruby
[16:08:58] Jardayn: has joined #ruby
[16:11:34] TomyWork: talking about vacation: see ya in january :)
[16:11:56] benhuda: has joined #ruby
[16:12:16] ramfjord: has joined #ruby
[16:15:52] PedramT: has joined #ruby
[16:17:12] atomical: has joined #ruby
[16:17:24] gambl0re: has joined #ruby
[16:18:09] kies^: has joined #ruby
[16:18:47] nonopposition: has joined #ruby
[16:21:00] skakri: has joined #ruby
[16:25:10] ElFerna: has joined #ruby
[16:26:50] synthroid: has joined #ruby
[16:26:59] bmalum: has joined #ruby
[16:27:16] blandflakes: has joined #ruby
[16:27:43] cwong_on_irc: has joined #ruby
[16:28:46] centrx: has joined #ruby
[16:29:30] msankhala: has joined #ruby
[16:31:11] shock_one: has joined #ruby
[16:32:03] weemsledeux: has joined #ruby
[16:33:05] shevy: java coders - lazy
[16:33:09] shevy: he could use xmas for coding!
[16:34:16] moeabdol: has joined #ruby
[16:34:18] lacuna: has joined #ruby
[16:34:18] lacuna: has joined #ruby
[16:36:32] AKASkip: has joined #ruby
[16:37:14] The_Phoenix: has joined #ruby
[16:37:42] stannard: has joined #ruby
[16:38:14] nofxx: has joined #ruby
[16:38:14] nofxx: has joined #ruby
[16:39:34] bewilled: has joined #ruby
[16:41:21] [Butch]: has joined #ruby
[16:42:00] camus: has joined #ruby
[16:42:08] bewilled: Hello, working with template files and chef where expressions are enclosed by this placeholders <%= %>. Can someone give me a name for these?
[16:42:53] apeiros: bewilled: those are probably erb templates
[16:42:59] apeiros: bewilled: but better ask in the chef channel
[16:43:04] mistermocha: has joined #ruby
[16:43:41] mistermocha: has joined #ruby
[16:44:33] bewilled: apeiros: thank you for this
[16:45:24] mclong: has joined #ruby
[16:46:29] karapetyan: has joined #ruby
[16:46:52] camus: hello, hoping someone can please help me w/ my ruby script: http://pastebin.com/rxKZDZN4
[16:46:53] ruboto: camus, 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
[16:47:01] seitensei: has joined #ruby
[16:47:07] camus: ah, apologies
[16:47:15] stannard: has joined #ruby
[16:47:21] iateadonut: has joined #ruby
[16:48:06] stannard: has joined #ruby
[16:48:21] jbrhbr: has joined #ruby
[16:48:22] ElFerna: has joined #ruby
[16:48:31] synthroid: has joined #ruby
[16:49:37] Ox0dea: camus: You're ignoring the return value of `JSON.parse`.
[16:50:03] camus: Yes, by the way, here is a Gist, apologies for using Pastebin: https://gist.github.com/anonymous/c74d3846b023ae1f81d3
[16:50:38] IrishGringo: has joined #ruby
[16:50:39] apeiros: camus: thanks. JSON.parse does not (can't) change response in-place
[16:50:42] apeiros: you have to re-assign
[16:50:54] apeiros: (ruby is strongly typed, an object can't change its class)
[16:50:56] Ox0dea: apeiros: It could, technically. :)
[16:51:01] camus: I would like to 1) loop through and interpolate the email address with a list of email addresses I have, and 2) store the response in a file, and append each subsequent response
[16:51:32] havenwood: camus: Try: parsed_json = JSON.parse(response); p parsed_json
[16:51:45] apeiros: Ox0dea: not speaking about you fiddling with fiddle or frozencore, or even a native extension.
[16:52:12] apeiros: and even less about you recompiling ruby, just to make a point :-p
[16:53:03] broken_heart: has joined #ruby
[16:53:53] ElFerna: has joined #ruby
[16:53:55] havenwood: I want the |> operator now, now now!
[16:54:02] broken_heart: Hello, any lisp programmers have experience in ruby? Having trouble with a recursive function: https://gist.github.com/anonymous/5b555b6340e89313e5e2
[16:54:09] camus: how do i iterate through a list of email addresses in the "url" and append each json response to a local file?
[16:54:09] apeiros: havenwood: what'd it do?
[16:54:38] havenwood: apeiros: Like the `|` pipe in Streem: https://github.com/matz/streem#readme
[16:55:16] apeiros: havenwood: define Proc#|?
[16:55:19] havenwood: apeiros: Incoming in Ruby 3.0 I think.
[16:55:42] camus: in other words, i would like to interpolate the email address in the "url", requery the url, and then append the result to a local file
[16:55:50] havenwood: "i'm immutable" |> puts
[16:56:17] broken_heart: If anyone has any idea even what's going wrong that would help, the ruby interpreted doesn't even seem to know how to handle the function.
[16:56:40] havenwood: broken_heart: Spaces not tabs! :)
[16:56:51] dipk: has joined #ruby
[16:57:20] havenwood: apeiros: I need to rewatch Matz keynote from RubyConf to get straight on what he said about |>.
[16:57:25] broken_heart: Sorry, I have my editor configured for tabs, and other languages :)
[16:57:50] adaedra: If your editor doesn't support setting per-language tab settings, it's not a good editor.
[16:58:00] havenwood: broken_heart: Getting an error or just not the expected output?
[16:58:09] broken_heart: getting errors,
[16:58:17] havenwood: broken_heart: add em to the gist?
[16:58:21] broken_heart: syntax error, unexpected '\n', expecting :: or '[' or '.'
[16:58:32] broken_heart: But it's not a syntax error.
[16:58:40] Ox0dea: >> class Proc; alias | itself; alias > call; end; -> x { x * 2 }. |> 21 # havenwood
[16:58:41] ruboto: Ox0dea # => 42 (https://eval.in/487585)
[16:58:44] broken_heart: I can reproduce it with any potentially infinite recursion loop
[16:58:46] stannard: has joined #ruby
[16:59:03] broken_heart: tried it on another machine also
[16:59:21] Ox0dea: havenwood: Making it go the other way is really unnatural in Ruby. :<
[16:59:35] Polysics: has joined #ruby
[16:59:38] saddad: has joined #ruby
[16:59:50] havenwood: Ox0dea: I like!: alias | itself
[17:01:10] cjbottaro: has joined #ruby
[17:01:26] shanemcd: has joined #ruby
[17:03:12] rickmasta: has joined #ruby
[17:05:01] mistermo_: has joined #ruby
[17:05:43] Seich: has joined #ruby
[17:08:41] stannard: has joined #ruby
[17:09:02] dlitvak: has joined #ruby
[17:09:14] shadoi: has joined #ruby
[17:09:49] roshanavand: has joined #ruby
[17:10:15] synthroid: has joined #ruby
[17:10:19] gregf_: >> class Foo;def bar; puts "Bar";end; alias bar baz;end; Foo.new.baz
[17:10:20] ruboto: gregf_ # => undefined method `baz' for class `Foo' (NameError) ...check link for more (https://eval.in/487589)
[17:10:43] Ox0dea: ?experiment gregf_
[17:10:43] ruboto: gregf_, Please use your local irb or pry (see ?pry) to experiment, ruboto's eval functionality is for demonstration purposes only.
[17:11:30] synthroid: has joined #ruby
[17:12:12] troulouliou_div2: has joined #ruby
[17:12:13] Ox0dea: gregf_: It's natural enough to think of it as "alias <x> to <y>", but it's "create alias <x> using <y>".
[17:12:50] gregf_: oh so they need to be swapped
[17:12:52] CorySimmons: has joined #ruby
[17:13:03] atomical: has joined #ruby
[17:13:09] gregf_: >> class Foo;def bar; puts "Bar";end; alias baz bar;end; Foo.new.baz ## a demo
[17:13:10] ruboto: gregf_ # => Bar ...check link for more (https://eval.in/487590)
[17:14:18] dlitvak: has joined #ruby
[17:15:33] ElFerna: has joined #ruby
[17:16:24] mistermocha: has joined #ruby
[17:17:08] ferr: has joined #ruby
[17:18:45] mprelude: has joined #ruby
[17:19:12] jhass: gregf_: so what's the question?
[17:20:40] djbkd: has joined #ruby
[17:21:07] pipework: jhass: How is a raven like a writing desk?
[17:21:36] jhass: pipework: because of sewers
[17:21:47] roshanav_: has joined #ruby
[17:21:54] pipework: jhass: Because Edgar Allen Poe wrote on both of them.
[17:22:01] skade: has joined #ruby
[17:22:05] Polysics: has joined #ruby
[17:22:19] jhass: I prefer my answer
[17:22:32] pipework: jhass: I think they both work, to different effect.
[17:22:36] hxegon: has joined #ruby
[17:22:49] kirun: has joined #ruby
[17:24:22] ornerymoose_: has joined #ruby
[17:24:39] Ox0dea: havenwood: https://eval.in/487596
[17:25:23] Ox0dea: Shame about having to declare the parameters outside the braces in this case.
[17:25:37] hxegon: has joined #ruby
[17:26:19] Scripore: has joined #ruby
[17:27:12] cyberarm_: has joined #ruby
[17:27:50] amclain: has joined #ruby
[17:28:05] cyberarm: has joined #ruby
[17:28:51] arup_r: has joined #ruby
[17:31:14] radgeRayden: has joined #ruby
[17:32:10] Alayde: has joined #ruby
[17:32:46] Alayde: any recommendations on which gem to use for dealing with mysql databases? Currently we have some code that uses the dbi gem, but the last commit it had was 7 years ago, so I'm kinda iffy about that
[17:33:08] jhass: Alayde: mysql2 + sequel
[17:33:08] ferr: has joined #ruby
[17:33:44] mistermocha: has joined #ruby
[17:33:51] Alayde: ah, bitchin'
[17:33:52] Alayde: thanks jhass
[17:34:42] yqt: has joined #ruby
[17:34:47] hessparker: has joined #ruby
[17:35:31] treehug88: has joined #ruby
[17:35:34] Ox0dea: "Bitchin'"?
[17:36:20] Alayde: synonymous with 'awesome'
[17:36:51] jhass: I think we'll prefer "awesome" in the future
[17:37:04] Alayde: oh right, can't risk offending people
[17:37:07] Alayde: thanks again for the help
[17:37:09] Alayde: has left #ruby: ("WeeChat 1.1.1")
[17:37:18] djbkd: has joined #ruby
[17:38:33] davedev24: has joined #ruby
[17:38:39] sandstrom: has joined #ruby
[17:38:59] imperator: jhass, but, but....my camaro!
[17:39:07] Mon_Ouie: has joined #ruby
[17:39:31] mistermocha: has joined #ruby
[17:42:45] ruu: has joined #ruby
[17:43:40] davedev24: has joined #ruby
[17:45:14] vF3hNGxc47h8: has joined #ruby
[17:47:05] nertzy: has joined #ruby
[17:48:31] sandstrom: has joined #ruby
[17:48:45] shevy: in 6 days we have a new ruby version!
[17:49:29] [Butch]: has joined #ruby
[17:49:45] shadoi: has joined #ruby
[17:50:47] hxegon: your man could have bytecode export/import, now look back to 2.4. rainbowsplosion.
[17:52:48] Macca: has joined #ruby
[17:52:53] IrishGringo: has joined #ruby
[17:53:56] mrtomme: has joined #ruby
[17:54:09] goodcodeguy: has joined #ruby
[17:56:32] ElFerna: has joined #ruby
[17:58:02] nettoweb: has joined #ruby
[17:58:58] sandstrom: has joined #ruby
[17:59:47] eytanfb: has joined #ruby
[18:01:40] benlieb: has joined #ruby
[18:06:20] howdoicomputer: has joined #ruby
[18:08:08] jbrhbr: has joined #ruby
[18:09:37] ngscheurich: has joined #ruby
[18:09:41] dlitvak: has joined #ruby
[18:10:00] guacamole: has joined #ruby
[18:10:29] cassioscabral: has joined #ruby
[18:11:08] ur5us: has joined #ruby
[18:11:33] ur5us: has joined #ruby
[18:12:28] steffkes: has joined #ruby
[18:12:29] steffkes: has joined #ruby
[18:16:59] MEATCHICKEN: has joined #ruby
[18:17:00] skade: has joined #ruby
[18:17:32] user083: has joined #ruby
[18:18:11] lacuna: has joined #ruby
[18:18:12] lacuna: has joined #ruby
[18:19:18] berserk_ren: has joined #ruby
[18:21:11] shanemcd: has joined #ruby
[18:23:38] eytanfb: has joined #ruby
[18:24:00] Frem: has joined #ruby
[18:25:50] ljarvis: my man has bytecode export
[18:27:37] hxegon: "This week on ruby weekly: WHO ON YOUR CELEB BANG LIST HAS BYTECODE EXPORT?"
[18:28:16] adaedra: Stop shouting, some people are trying to sleep.
[18:28:34] gizmore: good morning *yawn
[18:30:02] jackjackdripper: has joined #ruby
[18:30:59] RegulationD: has joined #ruby
[18:31:02] hxegon: morning gizmore
[18:31:59] gizmore: my code is heroic... it does rescue nil a lot
[18:32:53] gizmore: maybe i do class Object; def olivia_oil; nil; end; end; to allow rescue olivia_oil instead
[18:33:16] hxegon: I'd love to see the docs for that
[18:33:27] shanemcd: has joined #ruby
[18:33:28] gizmore: *docks ... as we sailsman say
[18:35:37] rnetocombr: has joined #ruby
[18:35:43] tAn: has joined #ruby
[18:39:17] RegulationD: has joined #ruby
[18:39:34] dionysus69: has joined #ruby
[18:39:56] atmosx: I have to write python, it's easy but sucks (I need to let the world know :-P)
[18:40:23] ljarvis: I quite like Python, but it has some inconsistencies and small things that bug me
[18:40:37] ljarvis: plus I dislike whitespace sensitive code
[18:40:42] pipework: but does python like you?
[18:41:43] jbrhbr: has joined #ruby
[18:42:50] davedev24: has joined #ruby
[18:43:11] eam: if you dislike whitespace sensitive code you can't like ruby all that much either then
[18:43:20] pipework: eam: ruby ain't whitespace sensitive tho
[18:43:26] ljarvis: lets compare apples to oranges
[18:43:31] pipework: Just the people who dogmatically follow the style guide.
[18:43:57] eam: ruby has whitespace significance all over
[18:44:10] eam: the most common significant whitespace is the end of line delimiter
[18:44:24] darix: eam: troll much :p
[18:44:30] ljarvis: yeah seriously
[18:44:33] eam: dude, that's the definition of the term
[18:44:42] ljarvis: lets not keep going
[18:44:43] eam: is any \s+ the same as any other \s+
[18:44:59] eam: take for example C, where it is
[18:45:44] adaedra: except for the preprocessor or // comments, you know.
[18:46:04] eam: cpp isn't C, and // wasn't originally either
[18:47:02] eam: "cpp is whitespace significant" is absolutely true -- and cpp is also widely reviled
[18:47:46] seitensei: has joined #ruby
[18:47:46] seitensei: has joined #ruby
[18:48:34] spider-mario: has joined #ruby
[18:49:23] finisherr: has joined #ruby
[18:51:02] colegatron: has joined #ruby
[18:51:23] bitcycle: has joined #ruby
[18:51:23] tenseiten: has joined #ruby
[18:51:32] agent_white: has joined #ruby
[18:54:19] bitcycle: Hey all. I've got a question about REXML and removing comments from xml. Is that even possible? http://stackoverflow.com/q/34362154/86263
[18:54:56] PaulCapestany: has joined #ruby
[18:54:58] tvw: has joined #ruby
[18:55:14] yqt: has joined #ruby
[18:55:50] cdg: has joined #ruby
[18:55:58] quesker: has joined #ruby
[18:56:12] quesker: is this syntax right? hash = JSON.parse response.body
[18:56:26] sandstrom: has joined #ruby
[18:56:36] quesker: puts "id is " . hash.first["id"].to_string
[18:56:54] lacuna: has joined #ruby
[18:59:28] koba: has joined #ruby
[19:00:28] nonopposition: has joined #ruby
[19:00:59] ruu: has joined #ruby
[19:01:55] BraddPitt: has joined #ruby
[19:03:01] Hanmac: has joined #ruby
[19:03:19] ruby-lang742: has joined #ruby
[19:03:29] Neronfapper: has joined #ruby
[19:03:57] system64: has joined #ruby
[19:04:07] ramfjord: has joined #ruby
[19:04:23] ascarter: has joined #ruby
[19:04:55] havenwood: ruby-lang742: helloooo
[19:05:10] renemaya: has joined #ruby
[19:05:30] ruby-lang742: is there any official ruby tk documentation?
[19:06:31] ruby-lang742: currently i'm reading from tkdocs.com, which is great, but I'm looking for a more organized way
[19:07:02] graft: has joined #ruby
[19:07:03] graft: has joined #ruby
[19:07:11] sucks: has joined #ruby
[19:07:16] ferr: has joined #ruby
[19:07:48] graft: hey yall, does anyone know of a nice gem/module that lets you build indexes to search an Enumerable faster than #select or #find?
[19:08:01] lxsameer: has joined #ruby
[19:08:01] lxsameer: has joined #ruby
[19:08:08] ibouvousaime: has joined #ruby
[19:08:15] pipework: graft: You mean define_method?
[19:08:20] guacamole: has joined #ruby
[19:08:23] InvGhost: has joined #ruby
[19:08:31] adaedra: ruby-lang742: http://www.rubydoc.info/stdlib/tk
[19:08:34] pipework: enum.sort_by(&:some_method)
[19:08:38] Ox0dea: graft: Well, there's #bsearch.
[19:08:38] graft: pipework: uh... i don't think so, no
[19:08:47] pipework: Or find(&:method)
[19:08:52] Ox0dea: Only useful if your enumerable is sorted, of course.
[19:08:52] graft: yeah but bsearch assumes my data is sorted
[19:09:08] Ox0dea: Well, why aren't your data sorted? :P
[19:09:18] dorei: graft: wouldn't a Hash help?
[19:09:20] graft: they might be sorted on one key but not another
[19:09:54] Ox0dea: graft: Maybe you should just be using a proper database?
[19:09:56] djbkd: has joined #ruby
[19:09:58] graft: dorei: yeah, i can do this with a hash or a btree, but just wondering if there's a well-known method to do this already
[19:10:26] ruby-lang742: hey <adaedra> cool thanks!
[19:10:28] eytanfb: has joined #ruby
[19:10:33] Ox0dea: graft: I think you might be looking for #group_by.
[19:10:34] graft: Ox0dea: i AM using a proper database, but once i have stuff queried into ruby objects i still need to be able to search those efficiently
[19:10:46] Ox0dea: graft: Why?
[19:11:17] imperator: TIL people still use Tk
[19:11:23] graft: Ox0dea: basically, i have a choice between 100 inefficient sql queries, or one big sql query and 100 faster ruby queries
[19:11:34] Ox0dea: graft: Are you sure?
[19:11:45] graft: Ox0dea: no, but that's where i'm at right now
[19:11:51] dorei: graft: i think a correct sql query is faster than anything
[19:12:00] graft: so i'm trying to make my 100 ruby queries faster
[19:12:20] startupality: has joined #ruby
[19:12:25] karapetyan: has joined #ruby
[19:13:19] lacuna: has joined #ruby
[19:13:19] graft: like, if i do Sample.where(name: 'test_name') the SQL query can be very fast if it uses an index
[19:13:20] xybre: How big is your data set?
[19:13:31] graft: but samples.select{|s| s.name == 'test_name'} is linear time
[19:13:34] xybre: What would you use as your index?
[19:13:42] last_staff1: has joined #ruby
[19:13:46] xybre: It sounds like you want a hash.
[19:13:53] graft: yeah, i do want a hash
[19:13:56] graft: or something
[19:14:03] jottr: has joined #ruby
[19:14:12] graft: i just wanted to know if i could plug some Index module into my Enumerable and have it hash stuff for me
[19:14:28] Ox0dea: graft: That would depend largely upon the shape of your data.
[19:14:30] xybre: So.. use a hash. If your "primary keys" are unique, use a hash. If you want multiple indexes, use multiple hashes pointing to the same objects. Lookups are *fast*.
[19:14:38] arooni-mobile: has joined #ruby
[19:15:06] graft: my problem is not how to do the computation, it's how to write a clean interface
[19:15:08] xybre: https://stackoverflow.com/questions/4692465/building-hash-by-grouping-array-of-objects-based-on-a-property-of-the-items
[19:15:28] graft: so i'm wondering if someone wrote a nice interface that does this sort of thing already
[19:15:39] jottr: has joined #ruby
[19:15:47] Ox0dea: graft: Are you allowed to elaborate on what sort of data you've got?
[19:15:47] graft: since it seems like a common use case to have to quickly search an Enumerable
[19:16:23] Ox0dea: graft: I couldn't say where you picked up that misconception, but it is one.
[19:16:37] brixen: has joined #ruby
[19:16:39] Ox0dea: Enumerables are for being enumerated, not quickly searched.
[19:16:56] graft: Ox0dea: #select and #find would belie that notion
[19:17:03] graft: Enumerables are at least for being searched
[19:17:12] graft: the 'quickly' is the part i am trying to bolt on
[19:17:13] colleenmcguckin: has joined #ruby
[19:17:39] xybre: graft: well, there's this: https://github.com/dkubb/axiom
[19:17:44] Ox0dea: graft: #select and #find may well need to enumerate the entire collection to do their thing.
[19:17:47] imperator: ACTION is confused as to what these 100 smaller queries would be
[19:17:58] graft: Ox0dea: this is my point
[19:18:06] Ox0dea: graft: You're simply using the wrong data structure(s).
[19:18:16] imperator: https://github.com/mdub/enumerating
[19:18:57] Ox0dea: graft: I mentioned that about #select and #find to illustrate that Enumerable is "for" enumeration, not search.
[19:19:51] mostlybadfly: has joined #ruby
[19:20:05] Ox0dea: That Enumerable requires a definition of #each (and nothing more) really ought to put the matter to rest.
[19:20:09] graft: imperator: i have an array of populations, and i want to select from amongst them according to several properties. this would be fast if i had all of the properties indexed, say if i had a hash for each one, but right now they are just bare objects in an Array
[19:20:54] Ox0dea: Do it in the database.
[19:21:15] graft: then i am left with hundreds of database queries
[19:21:29] graft: as opposted to hundreds of searches on objects already in memory
[19:21:34] graft: the latter will definitely be faster
[19:21:56] xybre: graft: what about Enumerable::Lazt?
[19:22:56] xybre: http://ruby-doc.org/core-2.2.3/Enumerable.html#method-i-lazy
[19:23:42] graft: xybre: not sure how that lets me search quickly...
[19:24:11] pawnbox: has joined #ruby
[19:24:13] graft: i think that just lets me give up quickly once i've found a match, which is the same as #find
[19:25:16] imperator: graft, can you show us your main query, and what your subquery would look like?
[19:25:18] jottr: has joined #ruby
[19:25:39] imperator: i mean, are you looking for different properties at different times once you have the array? or is it the same for all?
[19:26:22] graft: http://pastebin.com/6Gc5kkaQ
[19:26:22] ruboto: graft, 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
[19:26:41] indiebrain: has joined #ruby
[19:26:42] sandstrom: has joined #ruby
[19:27:17] djbkd: has joined #ruby
[19:27:42] xybre: Okay, well, I suggested Axiom earlier, which is am ore robust querying solution.
[19:27:55] colleenmcguckin: has joined #ruby
[19:28:11] rodfersou|afk: has joined #ruby
[19:28:30] edwinvdgraaf: has joined #ruby
[19:28:55] imperator: graft, is a materialized view out of the question? so, whatever query you used for the cached_populations becomes the view, then slap an index on the view
[19:28:59] stannard_: has joined #ruby
[19:29:03] imperator: ACTION assumes postgres, not sure what vendor you're using
[19:30:45] graft: imperator: using postgres, but not familiar with a materialized view
[19:30:55] lacuna: has joined #ruby
[19:30:55] lacuna: has joined #ruby
[19:31:08] graft: xybre: Axiom looks cool but heavy
[19:31:16] Dimik: has joined #ruby
[19:31:17] imperator: graft, http://www.postgresql.org/docs/9.3/static/rules-materializedviews.html
[19:31:42] imperator: basically, it's a pre-canned query that's treated like a read-only table
[19:32:23] IrishGringo: has joined #ruby
[19:32:46] jschmid: has joined #ruby
[19:32:55] graft: hmm, and you build indices into this table as per usual?
[19:33:22] sankaber: has joined #ruby
[19:34:06] nettoweb: has joined #ruby
[19:34:47] imperator: looks that way
[19:35:03] imperator: though you may just want a "regular" view, otherwise you'll have to refresh with a materialized view
[19:35:20] graft: yeah, might be okay since my data is pretty static
[19:35:42] graft: seems like what i want, but now i'm writing sql instead of ruby
[19:36:10] graft: oy vey... thanks for all the insights, folks, i think i have plenty to chew on
[19:36:43] StevenXL: has joined #ruby
[19:36:44] StevenXL: has joined #ruby
[19:37:13] jackjackdripper: has joined #ruby
[19:37:25] renderful: has joined #ruby
[19:38:17] solocshaw: has joined #ruby
[19:41:27] sankaber: has joined #ruby
[19:42:47] lacuna_: has joined #ruby
[19:43:08] howdoicomputer: has joined #ruby
[19:43:23] amclain: has joined #ruby
[19:43:30] skade: has joined #ruby
[19:50:23] solocshaw1: has joined #ruby
[19:52:03] douglass1: has left #ruby: ()
[19:54:44] cyberarm: has joined #ruby
[19:55:10] nfk|laptop: has joined #ruby
[19:55:13] akem2: has joined #ruby
[19:55:16] bronson: has joined #ruby
[19:56:23] sameerynho: has joined #ruby
[19:57:44] colleenmcguckin: has joined #ruby
[19:59:47] p337rB_: has joined #ruby
[19:59:47] dlitvak: has joined #ruby
[19:59:57] jottr: has joined #ruby
[20:00:10] lacuna: has joined #ruby
[20:00:10] lacuna: has joined #ruby
[20:00:24] AncientAmateur: has joined #ruby
[20:00:44] SenpaiSilver: has joined #ruby
[20:00:46] roshanavand: has joined #ruby
[20:03:24] rnetocombr: has joined #ruby
[20:03:43] moeSeth: has joined #ruby
[20:04:33] solocshaw1: has joined #ruby
[20:08:08] baweaver: has joined #ruby
[20:08:22] fullofcaffeine: has joined #ruby
[20:08:24] nocd: has joined #ruby
[20:10:09] skade: has joined #ruby
[20:11:10] atumzin: has joined #ruby
[20:11:28] rhg135: has joined #ruby
[20:14:07] cornerma1: has joined #ruby
[20:14:34] lemur: has joined #ruby
[20:14:37] nettoweb: has joined #ruby
[20:17:49] nettoweb: has joined #ruby
[20:18:21] PlasmaStar: has joined #ruby
[20:18:52] blackgoat: has joined #ruby
[20:19:33] DavidDudson: has joined #ruby
[20:20:09] fullofcaffeine: has joined #ruby
[20:20:33] sucks: has joined #ruby
[20:20:49] jackjackdripper1: has joined #ruby
[20:22:24] solocshaw: has joined #ruby
[20:23:14] opencard: has joined #ruby
[20:24:57] DavidDudson: has joined #ruby
[20:25:08] jottr: has joined #ruby
[20:25:36] blackmesa: has joined #ruby
[20:26:53] steffkes: has joined #ruby
[20:28:05] goodcodeguy: has joined #ruby
[20:32:35] eytanfb: has joined #ruby
[20:33:18] roshanavand: has joined #ruby
[20:34:05] yfeldblum: has joined #ruby
[20:35:44] fantazo: has joined #ruby
[20:36:50] robbie246: has joined #ruby
[20:39:52] Pathfinder: has joined #ruby
[20:40:33] guacamole: has joined #ruby
[20:41:05] chipotle: has joined #ruby
[20:41:13] renemaya: has joined #ruby
[20:41:39] joonty: has joined #ruby
[20:42:09] howdoicomputer: has joined #ruby
[20:42:35] ur5us: has joined #ruby
[20:43:34] cyberarm: has joined #ruby
[20:43:38] Spami: has joined #ruby
[20:43:58] eytanfb: has joined #ruby
[20:46:16] firstdayonthejob: has joined #ruby
[20:46:54] chouhoul_: has joined #ruby
[20:47:15] _stu_: has joined #ruby
[20:48:20] cpup: has joined #ruby
[20:49:47] n008f4g_: has joined #ruby
[20:50:08] mistermocha: has joined #ruby
[20:50:12] freerobby: has joined #ruby
[20:51:11] millerti: has joined #ruby
[20:51:34] TheBloke-: has joined #ruby
[20:52:14] djbkd: has joined #ruby
[20:52:16] juddey: has joined #ruby
[20:57:01] jessemcgilallen: has joined #ruby
[20:59:09] lapide_viridi: has joined #ruby
[21:00:22] rakm: has joined #ruby
[21:01:32] nunchuck: has joined #ruby
[21:02:26] renemaya: has joined #ruby
[21:02:40] blandflakes: has joined #ruby
[21:04:54] benlieb: has joined #ruby
[21:09:34] guacamole: has joined #ruby
[21:10:08] atomical: has joined #ruby
[21:10:48] idefine: has joined #ruby
[21:10:59] bronson: has joined #ruby
[21:11:57] lacuna: has joined #ruby
[21:11:57] lacuna: has joined #ruby
[21:12:13] ta: has joined #ruby
[21:14:11] tAn: has joined #ruby
[21:15:09] tAn: has joined #ruby
[21:15:56] guacamole: has joined #ruby
[21:17:47] nettoweb: has joined #ruby
[21:17:52] lacuna: has joined #ruby
[21:17:52] lacuna: has joined #ruby
[21:19:19] nonopposition: has joined #ruby
[21:19:38] snowy: has joined #ruby
[21:19:48] mistermocha: has joined #ruby
[21:19:57] atomical_: has joined #ruby
[21:20:02] chipotle: has joined #ruby
[21:21:07] idefine: has joined #ruby
[21:21:23] ta: has joined #ruby
[21:23:05] roger_rabbit: has joined #ruby
[21:23:30] devbug: has joined #ruby
[21:25:02] nettoweb: has joined #ruby
[21:26:28] ta: has joined #ruby
[21:26:53] lacuna: has joined #ruby
[21:26:53] lacuna: has joined #ruby
[21:27:14] Pathfinder_: has joined #ruby
[21:29:06] roshanavand: has joined #ruby
[21:30:16] cdg: has joined #ruby
[21:32:10] mistermocha: has joined #ruby
[21:32:45] roshanavand: has joined #ruby
[21:36:10] jschmid: has joined #ruby
[21:38:08] guacamole: has joined #ruby
[21:38:12] neanderslob: has joined #ruby
[21:40:26] lacuna: has joined #ruby
[21:40:26] lacuna: has joined #ruby
[21:41:13] devbug: has joined #ruby
[21:41:41] idefine: has joined #ruby
[21:43:05] icarus: has joined #ruby
[21:43:25] pdoherty: has joined #ruby
[21:44:04] Ox0dea: >> Time.now.friday?
[21:44:05] ruboto: Ox0dea # => true (https://eval.in/487651)
[21:45:41] andrew9183: has joined #ruby
[21:45:55] imperator: >> Time.now.paid?
[21:45:56] ruboto: imperator # => undefined method `paid?' for 2015-12-18 21:45:56 +0000:Time (NoMethodError) ...check link for more (https://eval.in/487652)
[21:47:02] icarus: has joined #ruby
[21:48:41] Kuukunen: Is it Friday? Yes!
[21:49:07] Ox0dea: http://isitfriday.com/
[21:49:09] adaedra: !self-destruct
[21:49:57] Ox0dea: http://i.imgur.com/zd9k28I.jpg
[21:49:57] dwfait: has joined #ruby
[21:50:22] jhass: Ox0dea: no gore
[21:50:44] shevy: protect the kids of #ruby!!!
[21:50:55] adaedra: You mean you?
[21:51:20] shevy: all of them
[21:51:32] jhass: that'd be you and ...
[21:51:38] hxegon: Cham is drunk not a kid
[21:52:11] Ox0dea: "Now hear, you blissful powers underground: answer the call, send help. Bless the children. Give them triumph now."
[21:52:40] Ox0dea: J.K. Rowling = Satanist confirmed.
[21:53:26] ItSANgo: has joined #ruby
[21:53:27] jschmid: has joined #ruby
[21:53:32] atomical: has joined #ruby
[21:53:39] jhass: ?offtopic
[21:53:39] ruboto: this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[21:53:46] AncientAmateur: has joined #ruby
[21:54:09] Ox0dea: Whatever happened to casual Friday in #ruby?
[21:54:35] baweaver: viva la revolucion Ox0dea
[21:54:50] idefine: has joined #ruby
[21:55:07] idefine: has joined #ruby
[21:56:52] howdoicomputer: has joined #ruby
[21:57:59] minimalism: has joined #ruby
[21:59:37] The_Phoenix: has joined #ruby
[22:01:22] Tricon: has joined #ruby
[22:01:30] goodcodeguy: has joined #ruby
[22:02:03] Maletor: has joined #ruby
[22:02:16] idefine: has joined #ruby
[22:03:01] ur5us: has joined #ruby
[22:03:11] pawnbox: has joined #ruby
[22:03:20] goodcodeguy: has joined #ruby
[22:03:30] guacamole: has joined #ruby
[22:05:36] nofxx: has joined #ruby
[22:05:37] nofxx: has joined #ruby
[22:05:37] radgeRayden_: has joined #ruby
[22:05:42] gizmore: does array += array return a new array?
[22:05:43] baweaver: has joined #ruby
[22:05:59] goodcodeguy: has joined #ruby
[22:06:17] havenwood: >> array = []; array += array
[22:06:18] adaedra: it's (array = array + array)
[22:06:18] ruboto: havenwood # => [] (https://eval.in/487653)
[22:06:31] The_Phoenix: has joined #ruby
[22:06:39] havenwood: array || array = array
[22:06:41] gizmore: i have: klass.instance_variable_set(:@foo, array); array += [:foo] ; klass.instance_variable_get(:@foo) # => yields [] ?
[22:07:07] benlieb: has joined #ruby
[22:07:33] gizmore: i want it to yield [:foo] / add items to that array
[22:07:35] Papierkorb: gizmore: use :<< instead
[22:07:44] gizmore: thank you Papierkorb!
[22:07:46] Papierkorb: gizmore: array << :foo
[22:07:56] Papierkorb: gizmore: or Array#concat if you want to append a whole array
[22:07:58] havenwood: >> array = [:bar]; array.concat [:foo]; array
[22:07:59] gizmore: so array << [:foo, :bar] works fine ?
[22:08:00] ruboto: havenwood # => [:bar, :foo] (https://eval.in/487654)
[22:08:14] radgeRayden__: has joined #ruby
[22:10:03] Ox0dea: gizmore: No.
[22:10:42] gizmore: the concat worked nicely, thanks h avenwood
[22:11:19] Ox0dea: gizmore: Note well that Array#<< is Array#push, and its behavior is quite different from #concat.
[22:11:40] jbrhbr: has joined #ruby
[22:12:02] gizmore: push does only push single items?
[22:12:04] ramfjord: has joined #ruby
[22:12:14] gizmore: >> a = []; a.push(:one); a
[22:12:15] ruboto: gizmore # => [:one] (https://eval.in/487655)
[22:12:20] gizmore: >> a = []; a.push(:one, :two); a
[22:12:21] ruboto: gizmore # => [:one, :two] (https://eval.in/487656)
[22:12:38] lacuna: has joined #ruby
[22:12:38] lacuna: has joined #ruby
[22:13:03] gizmore: thank you as well, Ox0dea
[22:13:10] Ox0dea: gizmore: #push is for appending *elements*; #concat is for array concatenation.
[22:13:31] Ox0dea: foo.concat(bar) is the in-place version of foo + bar, where both are Arrays.
[22:13:47] gizmore: the array instance does not change for concat... in arr1 += arr2 it changes
[22:13:51] jbrhbr1: has joined #ruby
[22:14:04] gizmore: well... i hope you know what i mean :P
[22:14:42] Ox0dea: gizmore: Aye, that's what "in-place" signifies.
[22:14:53] gizmore: aaaahhh okay :)
[22:15:01] gizmore: thanks for clearing it up
[22:15:14] Ox0dea: Sure thing.
[22:15:41] Ox0dea: Are you quite sure it's not #push you want?
[22:16:36] gizmore: i want to concat, yes
[22:16:58] Ox0dea: But you're concatenating a single-element Array, no?
[22:17:06] gizmore: so multiple pushes.... array.push(*myargs) would be the same
[22:17:27] eytanfb: has joined #ruby
[22:17:33] ItSANgo: has joined #ruby
[22:18:23] Ox0dea: Ah, well, if you do have multiple items to push and they're already collected like that, #concat does make more sense.
[22:19:28] Ox0dea: But yes, `foo.push(*ary)` == `foo.concat(ary)`, for reference.
[22:20:19] tricon_: has joined #ruby
[22:20:27] radgeRayden__: has joined #ruby
[22:22:33] paradisaeidae: has joined #ruby
[22:24:11] OmegaA: has joined #ruby
[22:24:36] dwfait: has joined #ruby
[22:26:29] Tricon: has joined #ruby
[22:27:24] mistermocha: has joined #ruby
[22:27:33] n_blownapart: has joined #ruby
[22:28:15] n_blownapart: has joined #ruby
[22:31:43] mistermo_: has joined #ruby
[22:31:58] shanemcd: has joined #ruby
[22:34:19] icarus_: has joined #ruby
[22:34:24] djbkd: has joined #ruby
[22:34:59] nonopposition: has joined #ruby
[22:37:00] guacamole: has joined #ruby
[22:37:03] mostlybadfly: has joined #ruby
[22:37:53] jottr: has joined #ruby
[22:37:56] dlitvak: has joined #ruby
[22:40:01] yfeldblum: has joined #ruby
[22:40:27] devbug: has joined #ruby
[22:42:54] pawnbox: has joined #ruby
[22:43:01] imperator: has left #ruby: ("Leaving")
[22:43:27] roshanavand: has joined #ruby
[22:44:53] tvw: has joined #ruby
[22:45:17] ruby_newbie: has joined #ruby
[22:45:44] ss_much: has joined #ruby
[22:45:49] RegulationD: has joined #ruby
[22:45:49] stannard: has joined #ruby
[22:46:02] lipoqil: has joined #ruby
[22:46:35] ruby_newbie: Hi all. New to Ruby. Reading about encryption. So the way the MD5 hash works is that I give it a string and it always returns the same hash. Ok?
[22:46:41] zenlot3: has joined #ruby
[22:47:35] gizless: has joined #ruby
[22:47:39] finisherr: has joined #ruby
[22:47:42] ruby_newbie: So in a HTTP sort of thing, typically when someone tries to sign in, the client JS will make a MD5 hash of the password, sent it to the server and server compares just the hash?
[22:48:08] cassioscabral: has joined #ruby
[22:48:25] gizmore|2: has joined #ruby
[22:48:32] xybre: ruby_newbie: MD5 isn't a good algorithm for passwords
[22:48:39] Ox0dea: ruby_newbie: That's one way to do authentication without storing plaintext passwords, sure, but please choose something better than MD5.
[22:49:12] shevy: yeah baby
[22:49:16] nonopposition: has joined #ruby
[22:49:18] dorei: what's the problem with md5?
[22:49:20] xybre: https://stackoverflow.com/questions/3715920/about-password-hashing-system-on-client-side
[22:49:20] Yzguy: has joined #ruby
[22:49:25] gizmore|3: has joined #ruby
[22:49:27] bubbys: has joined #ruby
[22:49:33] xybre: dorei: it's a compromised algo
[22:49:44] Ox0dea: class String; alias rot26 dup; end
[22:49:48] dorei: i mean, if some malicious gets access to your md5 encrypted passwords, then i think it's already too late
[22:49:56] pdoherty: has joined #ruby
[22:50:07] dorei: even if you didnt use md5 and prefered smt better
[22:50:12] xybre: https://security.stackexchange.com/questions/93395/how-to-do-client-side-hashing-of-password-using-bcrypt
[22:50:21] Ox0dea: dorei: That's simply not the case.
[22:50:22] xybre: dorei: not true
[22:50:28] Papierkorb: dorei: MD5 is cryptographically broken, even in practice
[22:50:43] Ox0dea: dorei: Your users should matter to you.
[22:50:54] ruby-newbie: has joined #ruby
[22:51:11] Papierkorb: dorei: Please don't invent your own password hashing method. Shit's science, yo. Use bcrypt() instead.
[22:51:17] dorei: Ox0dea: thankfully, i've got no users :)
[22:51:50] Pathfinder: has joined #ruby
[22:51:54] sandstrom: has joined #ruby
[22:51:54] ruby-newbie: I wrote the ROT encryptor, which was very cool. I just wanted to understand standard practice. Just comparing hashes in clear text then?
[22:52:14] Papierkorb: rotation encoder*
[22:52:20] davedev24: has joined #ruby
[22:52:30] Papierkorb: ruby-newbie: "comparing hashes in clear text" ?
[22:52:50] xybre: Anyway, client-side hashing is probably a waste if you're using SSL, the password will be encrypted over the wire. If you want to be certain your servers never see the password at all, there's other ways to do it.
[22:53:05] davedev24: has joined #ruby
[22:53:14] Papierkorb: I will now pretend that I didn't read what xybre just wrote
[22:53:26] Papierkorb: xybre: do you maintain any webservice? if so, which ones?
[22:53:27] ruby-newbie: Yes sending the hash over the wire.
[22:53:49] Ox0dea: ruby-newbie: That's fine, but the comparison itself should happen server-side.
[22:53:57] xybre: Papierkorb: SSL doesn't encrypt passwords when sent through an HTTPS request?
[22:54:09] ruby-newbie: Got it. Ofcourse since the DB has the userid and hash I supposed
[22:54:33] Papierkorb: xybre: "Transport encryption" and "hashing passwords" don't have *anything* in common besides both having to do with security.
[22:55:10] xybre: Papierkorb: Right. But if the concern is sending a password in clear text over the wire, then SSL already covers that use case.
[22:55:27] Papierkorb: xybre: oh for that, of course.
[22:55:30] Yzguy: has joined #ruby
[22:56:08] Papierkorb: As long people don't start to store plaintext passwords for "easy recovery", or invent their own salted-with-rounding MD5 password hash, that's fine
[22:56:44] ruby-newbie: I figured I'd ask since ROT can be cracked by just trying a bunch of rotations, if someone got hold of an MD5 in transport, could they un-hash it.
[22:56:53] xybre: No, you should use bcrypt or scrypt for hashing.
[22:57:01] gambl0re: has joined #ruby
[22:57:13] xybre: Never store passwords in cleartext - or at all, really.
[22:57:22] Papierkorb: xybre: I'm sorry if something I said sounded rude to you. I really go on high alert when security is involved ..
[22:57:42] lacuna: has joined #ruby
[22:57:43] lacuna: has joined #ruby
[22:58:03] idefine: has joined #ruby
[22:58:27] zeroDivisible: has joined #ruby
[22:58:40] xybre: Papierkorb: I just assumed I mispoke, security is important to me as well. :)
[22:59:22] xybre: ruby-newbie: make sure you check out that security.stackexchange link I sent earlier, it explains the whys and wherefores a bit.
[22:59:40] nonopposition: has joined #ruby
[23:01:08] lictor36: has joined #ruby
[23:01:16] shevy: I let facebook handle my security
[23:01:21] Papierkorb: ruby-newbie: please note that it's fine to toy around with stuff like this for educational purposes. But if you were to write a real-world application, prefer battle-tested packages over your own code. It may sound like "hashing a password" is a simple task to get right, but in reality, it's really really hard to get right on your own. People study that stuff for years, there's lots of research money in it and so on.
[23:02:03] waheedi: has joined #ruby
[23:02:04] Yzguy: has joined #ruby
[23:03:50] paradisaeidae: has joined #ruby
[23:04:00] ornerymoose: has joined #ruby
[23:04:26] havenwood: ruby-newbie: Here's a readable writeup that covers a real work case of why you'd not want to store say an MD5 along a properly hashed password :O http://arstechnica.com/security/2015/09/once-seen-as-bulletproof-11-million-ashley-madison-passwords-already-cracked/
[23:04:52] havenwood: s/work/world
[23:05:38] blandflakes: has joined #ruby
[23:11:01] blackjid: has joined #ruby
[23:11:17] hessparker: has joined #ruby
[23:12:40] IrishGringo: has joined #ruby
[23:13:22] mistermocha: has joined #ruby
[23:16:17] davedev24: has joined #ruby
[23:16:20] solocshaw1: has joined #ruby
[23:17:33] gizmore: has joined #ruby
[23:19:18] waheedi: has joined #ruby
[23:20:10] weemsledeux: has joined #ruby
[23:20:25] hxegon: has joined #ruby
[23:21:17] yashinbasement: has joined #ruby
[23:22:39] pawnbox: has joined #ruby
[23:23:04] rgtk: has joined #ruby
[23:23:08] ur5us: has joined #ruby
[23:23:09] dfwqdfui2342: has joined #ruby
[23:23:19] devFrederick: has joined #ruby
[23:23:21] dfwqdfui2342: <@dfwqdfui2342> Hey does anyone have time to help me form a flow chart or pseudocode for a project
[23:23:34] havenwood: dfwqdfui2342: In Ruby?
[23:23:40] dfwqdfui2342: Im a jr programer
[23:23:50] skinux: has joined #ruby
[23:24:04] havenwood: dfwqdfui2342: Hi! This is the Ruby programming language channel. Learning Ruby?
[23:24:29] skinux: Where in Ruby's source code would I look to find the code that actually scans ruby sources for ruby code?
[23:24:56] havenwood: skinux: Whatcha mean by "scans"?
[23:25:24] havenwood: dfwqdfui2342: What kind of project?
[23:25:26] skinux: scans ruby source file to know what that code is doing and therefore make it happen.
[23:25:37] seitensei: has joined #ruby
[23:25:56] adaedra: skinux: you mean, the parser?
[23:26:07] skinux: Yeah, probably
[23:26:13] havenwood: dfwqdfui2342: It might be good to put together a Gist that explains your project and shows off what you have so far.
[23:26:18] shevy: most ruby gems have a version such as 1.0.5 in a constant called VERSION; do you think it may be useful to also add the release-date to a gem project?
[23:26:49] adaedra: skinux: parsing is done in /parse.y
[23:27:27] adaedra: 'tis a terrible place, for what I've heard.
[23:27:35] bronson: has joined #ruby
[23:27:42] havenwood: skinux: From a REPL you could take a look at Ripper#tokenize, Ripper#lex, Ripper#sexp and RubyVM::InstructionSequence#compile.
[23:27:56] havenwood: >> require 'ripper'; Ripper.tokenize '1.upto(5)'
[23:27:58] ruboto: havenwood # => ["1", ".", "upto", "(", "5", ")"] (https://eval.in/487668)
[23:28:04] havenwood: >> require 'ripper'; Ripper.lex '1.upto(5)'
[23:28:05] ruboto: havenwood # => [[[1, 0], :on_int, "1"], [[1, 1], :on_period, "."], [[1, 2], :on_ident, "upto"], [[1, 6], :on_lparen ...check link for more (https://eval.in/487669)
[23:28:09] havenwood: skinux: ^ etc
[23:28:31] hessparker: has joined #ruby
[23:29:20] havenwood: >> RubyVM::InstructionSequence.compile('1.upto(5)').to_a
[23:29:22] ruboto: havenwood # => ["YARVInstructionSequence/SimpleDataFormat", 2, 2, 1, {:arg_size=>0, :local_size=>1, :stack_max=>2}, ...check link for more (https://eval.in/487670)
[23:29:39] ferr: has joined #ruby
[23:30:15] dlitvak: has joined #ruby
[23:31:52] Papierkorb: There's also the 'parser' gem for that
[23:31:54] paradisaeidae: has joined #ruby
[23:32:11] Papierkorb: >> require 'parser/current'; Parser::CurrentRuby.parse('1 + 2')
[23:32:12] ruboto: Papierkorb # => cannot load such file -- parser/current (LoadError) ...check link for more (https://eval.in/487671)
[23:32:16] cmrussell: has joined #ruby
[23:33:38] hesspark`: has joined #ruby
[23:34:10] eytanfb: has joined #ruby
[23:34:27] eytanfb: has joined #ruby
[23:34:36] cmrussell: can anyone help me with an array question?
[23:34:41] devbug: has joined #ruby
[23:34:49] shevy: you must ask your question
[23:35:17] cmrussell: I have an array that asks for 3 numbers. I then want to double those numbers.
[23:35:21] cmrussell: Im very new
[23:35:23] cmrussell: http://pastebin.com/MDQWfttL
[23:35:23] ruboto: cmrussell, 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
[23:35:23] stannard: has joined #ruby
[23:35:40] shevy: cmrussell yes you can use .map method
[23:36:02] cmrussell: .map method is the best way
[23:36:04] shevy: so your code is already quite good; change nums.each do |dub| to .map
[23:36:08] shevy: or .map! respectively
[23:36:15] dfwqdfui2342: i have to alert bus users on when busses arrive so i have an array of times and days when it gets to 3 certen locations
[23:36:20] shevy: yes, it will return a new array; in your case, you simply double the element like * 2
[23:36:42] cmrussell: ok let me try that
[23:37:02] tricon_: has joined #ruby
[23:37:10] shevy: note that line 18 is nonsensical
[23:37:15] shevy: you don't do anything with that line
[23:37:45] cmrussell: yeah, I just couldn't figure out what went there
[23:39:31] bronson: has joined #ruby
[23:40:29] Ox0dea: cmrussell: Be advised that Kernel#gets essentially uses $stdin by default, so `$stdin.gets` is redundant.
[23:40:40] bronson: has joined #ruby
[23:40:57] cmrussell: I can't get it to run without it
[23:41:12] Ox0dea: Is that so?
[23:41:26] cmrussell: I very well could be doing something wrong
[23:41:30] cmrussell: I'm relaly new haha
[23:41:36] Ox0dea: https://eval.in/487678
[23:41:47] mistermocha: has joined #ruby
[23:43:16] Ox0dea: Also, your inputs are strings and you don't convert them to integers before doing math on them; that's one way to have a bad time.
[23:43:23] Ox0dea: >> '123' * 2
[23:43:24] ruboto: Ox0dea # => "123123" (https://eval.in/487679)
[23:46:53] underplank: has joined #ruby
[23:47:07] colleenmcguckin: has joined #ruby
[23:47:21] gizless: has joined #ruby
[23:47:26] dfwqdfui2342: Was wondering if ruby had a real time function/method that could display the array of time i have deppending on the location the user chooses
[23:48:09] idefine: has joined #ruby
[23:48:20] skinux: has left #ruby: ("Leaving")
[23:48:36] SCHAAP137: has joined #ruby
[23:49:02] underplank: Hi all, I have the following code with the error message below https://www.refheap.com/112919
[23:49:36] underplank: I know that that url is returning a 502 (i???ve pry???d it and it returns the correct response) but for somereason has_http_status doesnt seem to work?
[23:49:51] underplank: do I need to require something else to get that functionality?
[23:50:10] Ox0dea: dfwqdfui2342: Question unclear; advice stuck in purgatory.
[23:50:28] colleenmcguckin: has joined #ruby
[23:51:10] colleenmcguckin: has joined #ruby
[23:51:50] dfwqdfui2342: Was wondering if ruby had a real time function/method that could display the array of time i have deppending on the location the user chooses
[23:53:14] jbrhbr: has joined #ruby
[23:53:17] dfwqdfui2342: does anyone have time to help me form a flow chart or pseudocode for a project
[23:53:26] Ox0dea: loop { repetition = clarity }
[23:53:29] stannard: has joined #ruby
[23:55:17] shevy: dfwqdfui2342 I don't even understand the question
[23:56:03] RickHull: has joined #ruby
[23:57:22] freerobby: has joined #ruby
[23:58:18] dfwqdfui2342: like an alarm method
[23:58:33] dfwqdfui2342: i have a bus that stops at 3 locations
[23:58:48] dfwqdfui2342: and i have an array of times
[23:58:50] dkam: has joined #ruby
[23:59:29] dfwqdfui2342: Im using rails
[23:59:43] ruboto: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[23:59:59] dfwqdfui2342: do make the app OS compdable