« Back to channel list

#ruby - 28 June 2015

« Back 1 day Forward 1 day »
[00:00:32] olas: has joined #ruby
[00:00:39] pontiki: i bet you're thinking of Kon Tiki, the modern day raft trip
[00:00:56] Ox0dea: Well, "pon" is a very common word in Jamaican English, and "tiki" just screams "islands".
[00:01:47] pontiki: what's it mean in jamaican?
[00:02:20] pontiki: well, i would be an island girl if i could, so that fits :D
[00:02:39] ddarkpassenger: has joined #ruby
[00:03:03] Casty: has joined #ruby
[00:07:19] slash_nick: upon... 'pon?
[00:07:39] mcclurmc: has joined #ruby
[00:08:02] tkuchiki: has joined #ruby
[00:09:07] pontiki: slash_nick: that sorta makes sense
[00:10:31] olas: has joined #ruby
[00:11:01] fgo: has joined #ruby
[00:11:52] j4cknewt: has joined #ruby
[00:12:42] dgutierrez1287: has joined #ruby
[00:15:30] slackbotgz: has joined #ruby
[00:16:29] duncannz: has joined #ruby
[00:17:05] spleeze: has joined #ruby
[00:17:51] giuseppesolinas: has joined #ruby
[00:18:14] Rollabunna: has joined #ruby
[00:18:28] tubuliferous_: has joined #ruby
[00:22:31] Musashi007: has joined #ruby
[00:22:58] JoshGlzBrk: has joined #ruby
[00:24:21] ItSANgo: has joined #ruby
[00:24:35] dgutierrez1287: has joined #ruby
[00:26:04] GETOUT: has joined #ruby
[00:26:18] GETOUT: has left #ruby: ("Leaving")
[00:26:19] chinmay_dd: has joined #ruby
[00:28:15] rickmasta: has joined #ruby
[00:29:44] havenwood: has joined #ruby
[00:34:10] RegulationD: has joined #ruby
[00:40:02] Deele: has joined #ruby
[00:41:03] ddarkpassenger: has joined #ruby
[00:41:47] iamninja: has joined #ruby
[00:41:56] Pupeno_: has joined #ruby
[00:42:14] Casty: has joined #ruby
[00:42:44] Ox0dea: How to require everything?
[00:43:30] giuseppesolinas: has joined #ruby
[00:43:43] bf4: has joined #ruby
[00:44:23] sphex: Ox0dea: seriously?
[00:45:44] Ox0dea: sphex: For very reality.
[00:46:52] mandarinkin: has joined #ruby
[00:47:09] Ox0dea: Pleasure to bescuse my phrases. English not my mother's tongue.
[00:47:15] Jeff_D: could someone tell me what's wrong with my puppet syntax, https://bpaste.net/show/287216d12676, specifically why the definition for the mysql::client is incorrect?
[00:47:49] bkxd: has joined #ruby
[00:47:52] dgutierrez1287: has joined #ruby
[00:48:08] mdw: has joined #ruby
[00:48:15] Royalb15: has joined #ruby
[00:48:32] pontiki: everything?? that would take some time at startup, i imagine
[00:48:56] Ox0dea: It would, but then it's all there close at hand.
[00:49:33] pontiki: true, but it's hard to imagine one app would need to require *everything*
[00:49:41] Ox0dea: This app is such a one.
[00:49:45] datacatalyst: has joined #ruby
[00:50:05] sphex: Ox0dea: I don't want to tell you what to do.. but please don't do that? :p
[00:50:44] pontiki: maybe i'm misunderstanding what "everything" means?
[00:51:26] russt: has joined #ruby
[00:51:56] Ox0dea: Every require-able file in $LOAD_PATH.
[00:52:45] sphex: there are "require_all" helpers, but looks like they need to be given at least one path component. you could always traverse $LOAD_PATH and require everything I guess. there are prolly some shenanigans for gem paths though.
[00:53:09] Ox0dea: sphex: Aye, except that some files must be required before others.
[00:53:12] Ox0dea: >> require 'remote-tk'
[00:53:13] ruboto: Ox0dea # => cannot load such file -- remote-tk (LoadError) ...check link for more (https://eval.in/388609)
[00:53:40] Ox0dea: Well, that one relies on 'multi-tk' having already been required. Does Gem provide a way to resolve these sorts of dependencies?
[00:54:04] pontiki: i'm not sure how that would work, exactly, for require; how does it check if it's already loaded something? just be path name?
[00:54:14] sphex: Ox0dea: hrm. well, usually, each file should require the file it needs, and if you require them again it'll be ignored if they're already loaded, so it should be fine.
[00:54:23] datanoise: has joined #ruby
[00:54:52] pontiki: any given package should require it's own dependencies
[00:56:03] Ox0dea: pontiki: It checks $LOADED_FEATURES to determine whether or not something's already in.
[00:56:32] Ox0dea: sphex: Alas, that is not the case, as demonstrated with 'remote-tk'. It fails upon require if 'multi-tk' hasn't yet been required.
[00:56:57] Ox0dea: That directory listing is non-deterministic is the crux of the problem.
[00:57:13] Ox0dea: Erm, not quite the crux, but definitely a hurdle.
[00:58:07] jackjackdripper: has joined #ruby
[00:59:29] slash_nick: >> class SwissArmyKnife;ObjectSpace.each_object(Module) do |mod|; include mod if !mod.is_a?(Class); end;end
[00:59:30] ruboto: slash_nick # => 298 (https://eval.in/388612)
[01:00:18] pontiki: if you ran all the way through $LOAD_PATH, requiring every file below each of them, would it be possible to end up reloading something of a different version or mixing versions of things?
[01:02:05] choke: has joined #ruby
[01:04:05] Ox0dea: pontiki: To be sure, collisions would abound, but I could use the two-argument form of Kernel.load to bring everything in under anonymous modules.
[01:05:51] Diabolik: what up mi hombres
[01:06:36] tkuchiki: has joined #ruby
[01:07:04] Ox0dea: s/s/s y mujeres/
[01:10:48] casadei: has joined #ruby
[01:12:20] fgo: has joined #ruby
[01:12:30] Rollabunna: has joined #ruby
[01:13:40] Pupeno: has joined #ruby
[01:15:53] slash_nick: because plurality
[01:18:02] Pupeno_: has joined #ruby
[01:20:30] simplyianm: has joined #ruby
[01:24:35] jfarmer: has joined #ruby
[01:24:58] x1337807x: has joined #ruby
[01:25:59] blue_deref: has joined #ruby
[01:26:00] nofxx: is there some Thread.disable! or something that I can debug a code easily? Got some threads I'm commenting.. kinda boring need comment the end too heh
[01:26:23] nofxx: disable all threads I mean, as if is wasn't there
[01:28:30] nofxx: ok, ruby to the rescue, I've joined all the calls in a single one to comment or not. duplication gonne.
[01:28:43] x1337807x: has joined #ruby
[01:28:46] bking39116: has left #ruby: ()
[01:28:57] jfarmer: nofxx Mind sharing the code? I don't really understand the idea of "disabling all threads."
[01:29:14] jfarmer: The semantics of a program w/ threads is fundamentally different than one without.
[01:29:38] abuzze_: has joined #ruby
[01:30:54] yayfoxes3: has joined #ruby
[01:32:04] tsvenson: has joined #ruby
[01:32:54] millerti: has joined #ruby
[01:33:38] Ox0dea: >> ObjectSpace.each_object(Thread, &:kill)
[01:33:39] ruboto: Ox0dea # => exit (SystemExit) (https://eval.in/388613)
[01:33:44] Ox0dea: nofxx: ^ I think that does what you want.
[01:33:57] yayfoxes3: has joined #ruby
[01:38:41] towski_: has joined #ruby
[01:40:43] freerobby: has joined #ruby
[01:43:36] balazs: has joined #ruby
[01:46:12] nofxx: jfarmer, not in this case, it's a media export: from 1 svg or png icon I'm generating about 350 pngs
[01:46:53] nofxx: the imagemagick/rsvg calls are, of course, 400% faster using threads, but annoying to test
[01:47:13] nofxx: Ox0dea, ty, gonna try later
[01:47:22] jfarmer: Are you using rmagick or mini_magick to interact with imagemagick?
[01:48:04] nofxx: jfarmer, mini... was everything going fine so far, but now the last thing I need looks like mini doesnt do: create a new canvas hehe
[01:48:48] jfarmer: nofxx Threads are likely not getting you much benefit here; mini_magick works by forking a process running ImageMagick's `convert` command
[01:49:17] jfarmer: So if you're doing the work in each thread, you're effectively creating a thread that then creates a fork
[01:50:11] nofxx: jfarmer, hm, trying to understand but, what gives the 30s to 7s change ?
[01:50:13] simplyianm: has joined #ruby
[01:50:47] Versality: has joined #ruby
[01:51:05] jfarmer: nofxx It's sort of a cheat because Ruby's threads aren't really threads, but a new thread will get scheduled if another thread starts doing I/O
[01:51:11] jfarmer: In this case, the I/O is the work done by the external process.
[01:51:30] jfarmer: You'd likely see a much bigger speed up if you were able to handle the forking yourself and not use threads at all
[01:51:44] jfarmer: (I'm not familiar enough with mini_magick to say exactly how you'd do that.)
[01:52:21] nofxx: btw, imagemagick support to SVG is really slow and you need to calculate a lot of stuff by hand. So in the SVG -> PNG case there's no imagemagick. Just calling rsvg-convert directly
[01:52:49] jfarmer: That's fair and I'm not sure how rsvg-convert works. If it's CPU bound, your threads will block.
[01:52:50] nofxx: it's very fast, even w/o threads. But the results (30s down to 7s) where PNG -> PNG with mini
[01:53:24] Oka: has joined #ruby
[01:54:37] mcclurmc: has joined #ruby
[01:54:43] nofxx: in the any case rsvg is a dependency of imagemagick for SVG, so I guess it's a feature not using IM for this job
[01:55:13] nofxx: only need raster*
[01:55:32] CowboyCoder: has joined #ruby
[01:56:17] datanoise: has joined #ruby
[01:56:54] nofxx: jfarmer, but forking is good idea
[01:57:29] jfarmer: nofxx My point was more that the forking is already happening and it'd be "best" if you could piggy-back off that.
[01:57:47] jfarmer: And just forget about threads entirely
[01:58:20] jfarmer: Looking through the minimagick docs, though,it's not immediately obvious if this is possible let alone officially supported in the API
[02:00:12] freerobby: has joined #ruby
[02:00:59] dented42: has joined #ruby
[02:01:19] jfarmer: Here's where MiniMagick is eventually farming out to ImageMagick: https://github.com/minimagick/minimagick/blob/master/lib/mini_magick/shell.rb#L32-L56
[02:02:05] CowboyCoder: can anybody suggest a way to list the classes/modules available in a gem from the cli?
[02:03:11] freerobby: has joined #ruby
[02:03:59] finisherr: has joined #ruby
[02:04:16] jfarmer: CowboyCoder gems are free to define any classes or modules they want, so this is a _little_ tricky
[02:04:16] Ox0dea: CowboyCoder: cls = ->{ObjectSpace.each_object(Class).to_a}; had = cls[]; require 'thing'; have = cls[] - had
[02:04:41] jfarmer: Yeah, you'd have to resort to a hack like that.
[02:04:41] Ox0dea: Here, `have` will contain the classes which were introduced by requiring 'thing'.
[02:05:11] jfarmer: CowboyCoder It's also not so black and white because classes and modules can be re-opened in Ruby.
[02:05:45] CowboyCoder: yea, why I'm stuggling w/ it...looking to explore gems at a high level
[02:05:54] CowboyCoder: ty for the info!
[02:06:16] Ox0dea: CowboyCoder: If you're just wanting to spelunk around in some gem, use Pry to `cd` into the "main" module, then `ls` to list all the things.
[02:06:37] tubuliferous_: has joined #ruby
[02:06:46] Rollabunna: has joined #ruby
[02:06:48] Ox0dea: You can, of course, `cd` into any of those things to deepen your dive.
[02:07:03] CowboyCoder: Ox0dea: cool, I'll give it a shot!
[02:07:13] bkxd: has joined #ruby
[02:07:55] nofxx: jfarmer, that's a nice open3 shell.rb, no? heh give me the idea for a new gem: rsvg-mini
[02:08:21] nofxx: mini_rsvg? Anyway, run rsvg-convert in a more sane way than my system(comm)
[02:08:28] jfarmer: CowboyCoder Most gems come w/ auto-generated documentation that lists the available classes and modules
[02:08:47] jfarmer: (Not always with good commentary, but at least w/ the names of the classes and methods.)
[02:09:27] jfarmer: nofxx Hah, yes.
[02:09:55] nofxx: jfarmer, there's a ext one: rsvg2, from gnome2... scary
[02:10:25] finisherr: has joined #ruby
[02:10:31] CowboyCoder: jfarmer: ri or something else?
[02:10:47] karols: has joined #ruby
[02:10:59] jfarmer: CowboyCoder Whether the docs are available on your computer depend on whether you installed them alongside the gem. If so, yes, ri is one tool to do that.
[02:11:06] serivich: has joined #ruby
[02:11:19] nofxx: might give a try, not sure it's much os friendly... cairo, glib, gdb_pixbuf2....
[02:11:29] jfarmer: But there are also services like http://apidock.com/ that scan gems and do the auto-generation themselves
[02:11:41] alotofnoodles: has joined #ruby
[02:12:16] _blizzy_: has joined #ruby
[02:12:18] CowboyCoder: just looking for something offline and ideally cli to explore and reference
[02:13:13] SpikeMaster: has joined #ruby
[02:13:25] jfarmer: Yep, then ri will work
[02:13:40] fgo: has joined #ruby
[02:14:01] Musashi007: has joined #ruby
[02:14:14] CowboyCoder: ok, i'll dig more on using ri, thanks again!
[02:14:17] jfarmer: CowboyCoder Try it in irb: > ri Array#map
[02:14:21] jfarmer: >> ri Array#map
[02:14:22] ruboto: jfarmer # => undefined method `ri' for main:Object (NoMethodError) ...check link for more (https://eval.in/388623)
[02:14:28] jfarmer: (was half expecting that to work)
[02:14:47] KnownSyntax: has joined #ruby
[02:14:48] KnownSyntax: has joined #ruby
[02:15:16] CowboyCoder: jfarmer: how about something that shows per gem, not class?
[02:15:53] CowboyCoder: so I do a "gem list" then what to view what's in the gem?
[02:15:59] finisherr: has joined #ruby
[02:16:43] malconis_: has joined #ruby
[02:16:49] jfarmer: CowboyCoder run "gem server" and visit http://localhost:8808
[02:16:54] SpikeMaster: what is faster? ruby or javascript?
[02:17:46] CowboyCoder: jfarmer: exactly what i'm looking for, but is there a cli version? or am I stuck w/ browser?
[02:18:01] jfarmer: links http://localhost:8808
[02:18:15] jfarmer: But seriously, I don't know. Not sure what you're looking for in a CLI version. Just a text dump?
[02:18:23] CowboyCoder: jfarmer: :) sure!
[02:18:24] jfarmer: You can probably tell rdoc to generate the docs in a format other than HTML.
[02:19:36] CowboyCoder: will see what I can see :)
[02:20:23] jfarmer: Also, looking at "ri --help" it appears you can tell ri to list the docs for a specific gem
[02:20:37] rgb-one: has joined #ruby
[02:20:49] finisherr: has joined #ruby
[02:20:51] alotofnoodles: has joined #ruby
[02:20:58] jfarmer: > Usage: ri [options] [names...]
[02:21:08] jfarmer: > Where name can be: ... gem_name: | gem_name:README | gem_name:History
[02:21:16] jfarmer: > If the gem name is followed by a ':' all files in the gem will be shown.
[02:21:20] Ox0dea: CowboyCoder: $EDITOR $(dirname `gem which foo`)
[02:22:04] jfarmer: So, try something like ri rails:
[02:22:10] jfarmer: and see what happens
[02:22:19] pontiki: maybe not rails :D
[02:22:20] Ox0dea: ".rails not found"
[02:22:31] jfarmer: Ox0dea With a colon after rails?
[02:22:35] jfarmer: "ri rails:
[02:22:43] Ox0dea: Well, how about that.
[02:22:44] CowboyCoder: hmm.... ri thor:
[02:22:52] Ox0dea: jfarmer: It's just a pager, though.
[02:23:05] CowboyCoder: maybe need to generate docs?
[02:23:09] jfarmer: Ox0dea I can't see it myself because I don't install docs alongside gems.
[02:23:16] jfarmer: CowboyCoder Maybe. They're installed by default.
[02:23:19] RegulationD: has joined #ruby
[02:23:31] jfarmer: A lot of people disable it, though, because generating the docs is often the longest part of the gem installation process. Haha.
[02:23:50] jfarmer: 2 seconds to download + install Ruby files, 10 seconds to generate + install docs
[02:23:52] j4cknewt: has joined #ruby
[02:24:16] Ox0dea: jfarmer: Do you impose some sort of arbitrary limit on the number of terminals you keep open?
[02:24:31] CowboyCoder: ri -l .... that's handy :)
[02:25:03] ledestin: has joined #ruby
[02:25:16] Ox0dea: CowboyCoder: That seems exactly the thing you were looking for. :)
[02:25:39] CowboyCoder: yup...with good tips along the way!
[02:25:46] finisherr: has joined #ruby
[02:26:03] jfarmer: ri -l doesn't associate each class w/ the gem it came from, at least not for me
[02:26:42] CowboyCoder: jfarmer: yea, don't know where it came from, but I can dig around in what's available...
[02:27:03] jfarmer: Ox0dea Well, when I'm cloning someone else's project to help them debug it, I don't want "bundle install" to take 30-40 seconds longer than it has to.
[02:27:18] jfarmer: While we just sit there looking at the screen, talking about the weather, whatever.
[02:27:43] baweaver: http://bundler.io/v1.5/bundle_install.html
[02:28:10] jfarmer: baweaver http://cl.ly/image/3b2a1a2G0R10
[02:28:32] baweaver: already got it then
[02:28:46] armyriad: has joined #ruby
[02:28:54] jfarmer: I literally never use the local docs; there's no good reason for me to add 30-50% to the install time of my gems.
[02:28:58] baweaver: well, useful for any lurkers that didn't know that was a thing.
[02:29:15] baweaver: for all other things you can just use Dash on it to auto-doc
[02:29:29] baweaver: though it costs a bit.
[02:29:41] SpikeMaster: has left #ruby: ("ERC Version 5.3 (IRC client for Emacs)")
[02:29:55] baweaver: well off I go, cheers
[02:31:07] eggoez: has joined #ruby
[02:36:16] fenjamin: has joined #ruby
[02:36:45] freerobby: has joined #ruby
[02:39:30] troulouliou_dev: has joined #ruby
[02:39:48] troulouliou_dev: has joined #ruby
[02:40:22] mcclurmc: has joined #ruby
[02:40:43] troulouliou_dev: has joined #ruby
[02:40:43] troulouliou_dev: has joined #ruby
[02:41:11] troulouliou_dev: has joined #ruby
[02:42:18] troulouliou_dev: has joined #ruby
[02:42:58] darkf: has joined #ruby
[02:43:20] troulouliou_dev: has joined #ruby
[02:46:28] neanderslob: has joined #ruby
[02:46:29] sevenseacat: has joined #ruby
[02:48:01] konsolebox: has joined #ruby
[02:48:58] charliesome: has joined #ruby
[02:49:35] JoshGlzBrk: has joined #ruby
[02:52:23] bf4: has joined #ruby
[02:52:24] chickenBox: has joined #ruby
[02:52:24] chickenBox: has left #ruby: ()
[02:54:26] [k-: has joined #ruby
[02:57:26] balazs: has joined #ruby
[02:58:10] sankaber: has joined #ruby
[03:01:55] datanoise: has joined #ruby
[03:04:19] scx_: has joined #ruby
[03:04:19] Rollabunna: has joined #ruby
[03:07:03] aphprentice: has joined #ruby
[03:09:27] lkba: has joined #ruby
[03:11:06] Scroff: has joined #ruby
[03:11:57] bigmac__: has joined #ruby
[03:12:13] Asher: has joined #ruby
[03:12:41] Asher: has joined #ruby
[03:13:19] CloCkWeRX: has joined #ruby
[03:13:23] Rakunh0: has joined #ruby
[03:13:37] linc01n: has joined #ruby
[03:14:40] michael_mbp: has joined #ruby
[03:15:04] fgo: has joined #ruby
[03:15:06] Scrofff: has joined #ruby
[03:15:31] CBke: has joined #ruby
[03:16:17] hagabaka: has joined #ruby
[03:16:46] braincrash: has joined #ruby
[03:17:26] zacts: was smalltalk the main inspiration for Ruby's OOPish way of coding?
[03:17:38] zacts: or what were the main influences on Ruby?
[03:17:49] zacts: I see smalltalk, perhaps Common Lisp's CLOS too?
[03:18:31] zacts: I do see how Perl influenced the scripting / syntax of Ruby (either to be much different from perl, or to borrow ideas from the arguably expressive creative side of Perl syntax)
[03:19:17] mcclurmc: has joined #ruby
[03:19:41] RobertBirnie: has joined #ruby
[03:20:51] linc01n: has joined #ruby
[03:21:25] mhb: has joined #ruby
[03:21:37] drzel: has joined #ruby
[03:23:37] RobertBirnie: has joined #ruby
[03:24:10] hagabaka: has joined #ruby
[03:26:06] mcclurmc: has joined #ruby
[03:27:31] Frem: has joined #ruby
[03:28:33] linc01n: has joined #ruby
[03:28:37] sphex: zacts: seems to be mostly smalltalk. CLOS was more "generic methods"-based. lisp packages were the primary way of organizing them, not classes.
[03:30:03] sphex: zacts: smalltalk had a "everything is done by sending messages to objects" approach. even conditionals were done by passing a block to an object just for that. ruby doesn't go as far.
[03:30:51] zacts: oh cool interesting
[03:32:11] sarkyniin: has joined #ruby
[03:32:44] gix: has joined #ruby
[03:33:45] Ox0dea: sphex: But it can! :)
[03:34:16] Ox0dea: zacts: I think you're right that Smalltalk + Perl + Lisp is a pretty good distillation of Ruby's ancestry.
[03:35:47] fenjamin: has joined #ruby
[03:35:51] hagabaka: has joined #ruby
[03:37:51] Scrofff: has joined #ruby
[03:38:14] sevvie: has joined #ruby
[03:38:55] CBke: has joined #ruby
[03:40:16] CBke: has joined #ruby
[03:40:16] CBke: has joined #ruby
[03:40:55] wldcordeiro: has joined #ruby
[03:43:55] fantazo: has joined #ruby
[03:44:51] pontiki: and Emacs :)
[03:45:16] RobertBirnie: has joined #ruby
[03:47:07] towski_: has joined #ruby
[03:47:29] Musashi007: has joined #ruby
[03:47:52] pontiki: anyway, you can get it straight from Matz: https://www.ruby-lang.org/en/about/
[03:49:23] bkxd: has joined #ruby
[03:49:55] Pupeno: has joined #ruby
[03:50:25] cbz: has joined #ruby
[03:54:22] datanoise: has joined #ruby
[03:54:48] tubuliferous_: has joined #ruby
[03:55:22] Rollabunna: has joined #ruby
[04:00:17] bf4: has joined #ruby
[04:01:58] hagabaka: has joined #ruby
[04:05:26] darkf_: has joined #ruby
[04:08:09] TinkerTyper: has joined #ruby
[04:08:27] Scrofff: has joined #ruby
[04:08:59] baweaver: has joined #ruby
[04:09:29] Zamyatin: has joined #ruby
[04:10:45] renderful: has joined #ruby
[04:11:11] zenspider: sphex: pretty much sums up why I don't like CLOS
[04:11:37] Channel6: has joined #ruby
[04:12:09] RegulationD: has joined #ruby
[04:13:10] NeverDie: has joined #ruby
[04:13:15] vdamewood: has joined #ruby
[04:13:46] icebourg: has joined #ruby
[04:14:29] hagabaka: has joined #ruby
[04:14:42] icebourg: has joined #ruby
[04:17:47] braincra-: has joined #ruby
[04:17:54] bigmac__: has joined #ruby
[04:18:51] knite: has joined #ruby
[04:20:43] tflat: has joined #ruby
[04:21:28] drzel: has joined #ruby
[04:25:23] Yiota: has joined #ruby
[04:26:54] abderian: has joined #ruby
[04:27:11] knite: has joined #ruby
[04:27:34] abderian: any experts on sinatra here? :)
[04:27:46] zenspider: just ask, don't ask to ask
[04:28:34] [k-: ?anyone
[04:28:34] ruboto: Just ask your question, if anyone has or can, they will respond.
[04:28:36] hagabaka: has joined #ruby
[04:29:03] abderian: got it. I'm a beginner when it comes to backend web development, and understand CRUD apps just fine. Recently I've been working on a simple project that scrapes data off of a website and enables users to search through that data
[04:29:18] abderian: problem is, I don't know where to put the code that scrapes the data
[04:29:18] bruno-_: has joined #ruby
[04:29:24] abderian: say if I need it run once a week
[04:29:38] Ox0dea: abderian: Are you on Windows?
[04:29:41] abderian: so far code only gets executed when a user loads a page
[04:29:55] abderian: no on a mac and deving in ubuntu
[04:30:06] Ox0dea: Then a cron job is just what you need.
[04:30:20] zenspider: so, really nothing to do with sinatra, more to do with "how do I run out-of-band jobs for my website"
[04:31:04] zenspider: make a script that does what you want on the cmdline. it needs to run standalone. hook it up with cron to run at a specified time
[04:31:05] abderian: oh my mistake then, I'm still trying to wrap my head around backend development in general > <
[04:31:27] abderian: This whole time I was trying to somehow link it with sinatra
[04:31:33] zenspider: that "run standalone" part is important. cron runs in a very limited env
[04:32:15] zenspider: it still prolly needs whatever ORM code you have for your app, so it still needs it, it just isn't related to an http request/response
[04:32:36] abderian: That makes a lot of sense
[04:33:02] kies: has joined #ruby
[04:33:34] abderian: Up until now I haven't programmed outside of that so I thought I was confined to writing all my code in there
[04:33:59] abderian: Thanks a lot!
[04:35:18] eggoez: has joined #ruby
[04:35:41] Nilium: Particularly important, for cron at least, is that you'll likely want to set some of the environment variables you normally always have
[04:35:52] chinmay_dd: has joined #ruby
[04:35:57] hagabaka: has joined #ruby
[04:37:42] baweaver: has joined #ruby
[04:42:14] hagabaka: has joined #ruby
[04:43:04] Musashi007: has joined #ruby
[04:43:25] linc01n: has joined #ruby
[04:46:08] Marisa: has joined #ruby
[04:48:09] Marisa: anybody know of a good resource that explains how to parse a string so it can be split up via spaces and new lines? I'm finding the official documentation hard to follow
[04:48:27] Ox0dea: Marisa: String#split splits on whitespace by default.
[04:48:35] Ox0dea: >> "foo bar \n baz".split
[04:48:37] ruboto: Ox0dea # => ["foo", "bar", "baz"] (https://eval.in/388630)
[04:48:39] zenspider: I love it when the answer is in the question
[04:48:56] linc01n: has joined #ruby
[04:49:02] sevenseacat: zenspider: makes it easy, doesnt it
[04:49:27] zenspider: Marisa: `ri String.split` in your terminal for the doco
[04:49:31] zenspider: even just `ri split`
[04:49:40] nofxx: Marisa, split(/\s/) ... nice name, portuguese/spanish?
[04:49:41] Rollabunna: has joined #ruby
[04:49:56] s2013: has joined #ruby
[04:50:10] Marisa: American actually ;)
[04:50:24] Marisa: thanks for the help
[04:50:33] Ox0dea: >> "foo bar \n baz".split(/\s/)
[04:50:34] ruboto: Ox0dea # => ["foo", "", "", "bar", "", "", "", "", "baz"] (https://eval.in/388631)
[04:50:42] Ox0dea: Please don't offer advice willy-nilly.
[04:50:57] Ox0dea: There is the potential to do more harm than good.
[04:51:22] nofxx: Ox0dea, she wants new lines, easy to fix anyway
[04:51:37] hagabaka: has joined #ruby
[04:51:42] Marisa: well i'm trying to split up a string by both new lines and spaces
[04:51:57] linc01n: has joined #ruby
[04:51:58] Marisa: i'm at the point where i know more about how to solve my problem than the syntax to do it...
[04:52:50] zenspider: my general advice: think about your types, formulate your question, take the keywords and the types and try to look for it with ri
[04:53:10] Ox0dea: All my objects are ducks.
[04:53:12] zenspider: in your question, you mentioned Strings and split. boom: ri String.split
[04:53:16] linc01n: has joined #ruby
[04:53:44] nofxx: but yeah, taught split's default was only for spaces... Marisa no need for the parameters. Me too, south america ;)
[04:53:57] keen___________4: has joined #ruby
[04:54:08] zenspider: taught -> thought ?
[04:54:25] nofxx: zenspider, sorry, sleepy today
[04:54:34] Marisa: zenspider: thanks for the tip, I appreciate it
[04:54:49] rickmasta: has joined #ruby
[04:56:13] Hanmac: has joined #ruby
[04:57:23] Marisa: nofxx: lol yeah, I forget that american can mean more than one continent
[04:57:52] Sinami: has joined #ruby
[04:58:22] othernick: has joined #ruby
[04:58:47] balazs: has joined #ruby
[04:59:17] Marisa: so, any general recommendations on books/websites to learn Ruby comprehensively? I've been doing learn ruby the hard way but I'm about 2/3rds through and starting to realize it's not very good about teaching "the ruby way" of coding
[05:00:00] zenspider: it's not very good imo
[05:00:19] zenspider: I'm partial to the pickaxe book, but I'm biased
[05:00:24] Ox0dea: "Zed's dead, baby. Zed's dead."
[05:00:26] mhb: The Well Grounded Rubyist + Pick Axe + Eloquent Ruby
[05:00:40] Ox0dea: Really can't go wrong with those.
[05:00:56] Marisa: thanks :)
[05:00:59] Ox0dea: Metaprogramming Ruby is pretty good once you've got the hang of things.
[05:01:08] mhb: just get them all, really
[05:04:26] RickHull: has left #ruby: ()
[05:04:27] mujou: has joined #ruby
[05:06:20] hotpancakes: has joined #ruby
[05:06:39] framling: has joined #ruby
[05:07:03] Marisa: hmm, this is being annoying...i'm using cloud 9 as my ide and when i run ri (which does work), it can't find anything about any function
[05:08:11] Marisa: just keep getting "nothing know about .foo"
[05:08:49] alotofnoodles: has joined #ruby
[05:08:50] Yiota: has joined #ruby
[05:09:07] zenspider: I don't know anything about cloud 9... but it sounds like you installed ruby w/o rdoc/ri info
[05:09:18] zenspider: if you used rvm (ugh) there should be a command to generate it
[05:09:50] konsolebox: Readline.readline breaks completion on filenames that have spaces on them. Is there a common configuration for it? e.g. Readline.readline('abc: '), then enter a pathname with a space. Pressing the next would no longer yield anything.
[05:10:21] framling: zenspider: is rvm no good?
[05:10:27] Marisa: i didn't install it myself, basically, they use a virtual machine (or something like it)
[05:10:39] al2o3-cr: Marisa: they use ubuntu right?
[05:10:41] michael_mbp: has joined #ruby
[05:10:47] Marisa: believe so
[05:11:25] Ox0dea: konsolebox: Works fine here?
[05:12:36] konsolebox: Ox0dea: works on a directory with a space? tab yields filenames within?
[05:12:42] al2o3-cr: Marisa: apt-get install ri
[05:12:48] Marisa: i figured out how to get rvm to download the documentation
[05:12:57] j4cknewt: has joined #ruby
[05:13:02] Ox0dea: konsolebox: Oui.
[05:13:29] [k-: ^ he means yes
[05:13:42] konsolebox: yes saw the translation quick :)
[05:13:59] Ox0dea: konsolebox: Ah, scratch that. Space files in space directories = not good.
[05:15:00] [k-: http://www.urbandictionary.com/define.php?term=oui
[05:15:10] [k-: look at the top def
[05:15:11] michael_mbp: has joined #ruby
[05:15:16] [k-: pretty funny
[05:15:29] Versality: has joined #ruby
[05:15:37] al2o3-cr: good ol' ud :)
[05:15:38] konsolebox: [k-: yeah that's what i saw :)
[05:16:00] Ox0dea: Y'all need some culture.
[05:16:22] xtsee: has joined #ruby
[05:16:45] konsolebox: Ox0dea: i wonder if there's a tweak for it, or else i would end up reimplementing
[05:16:51] Ox0dea: konsolebox: Other readline implementations seem to handle this tricky case by inserting backslashes where appropriate.
[05:17:16] Ox0dea: Disambiguation is necessary, and that's the most logical way to do it.
[05:19:20] Ox0dea: I have little trouble believing there's some system out there that uses percent-encoding at the shell.
[05:22:15] Scroff: has joined #ruby
[05:27:03] psyprus: has joined #ruby
[05:28:17] baweaver: has joined #ruby
[05:28:59] konsolebox: Ox0dea: you mean other non-Ruby readlines?
[05:29:26] Ox0dea: konsolebox: Bash's, to be precise.
[05:29:42] Ox0dea: But they're both using GNU readline.
[05:29:52] Ox0dea: So it must be that Bash is using its own rl_filename_completion_function.
[05:29:53] konsolebox: Ox0dea: well, readline is bash's i think
[05:35:01] s2013: has joined #ruby
[05:35:26] hotpancakes: has joined #ruby
[05:35:51] kies: has joined #ruby
[05:38:09] finisherr: has joined #ruby
[05:39:01] Pupeno: has joined #ruby
[05:39:59] simplyianm: has joined #ruby
[05:42:56] lxsameer: has joined #ruby
[05:42:57] tubuliferous_: has joined #ruby
[05:43:57] dented42: has joined #ruby
[05:44:07] Rollabunna: has joined #ruby
[05:48:19] Ox0dea: konsolebox: Bash uses so thoroughly customized a readline that the file is called "bashline.c". :)
[05:48:48] Ox0dea: $ stat -c '%s' Downloads/bash-4.3/bashline.c dev/ruby-trunk/ext/readline/readline.c
[05:48:50] IanV0rn: has joined #ruby
[05:49:32] Ox0dea: That doesn't tell anywhere near the whole story, of course, but handling space files in space directories is definitely not a stock readline feature.
[05:50:01] j4cknewt: has joined #ruby
[05:52:11] mcclurmc: has joined #ruby
[05:53:52] Dopagod: has joined #ruby
[05:54:20] IanV0rn: has joined #ruby
[05:54:24] simplyianm: has joined #ruby
[05:56:26] konsolebox: Ox0dea: wow, thank you for investigating. that's bad news :)
[05:57:26] konsolebox: Ox0dea: i think i'll try to hack it with a callback to a completion function
[05:57:42] Rakunh0: has joined #ruby
[05:59:00] Ox0dea: konsolebox: Happy to help. Be warned: it can get pretty gnarly.
[05:59:32] Ox0dea: There's an /* XXX */ comment on a free() call right next to where I suspect the magic is happening.
[05:59:59] Ox0dea: How much would you hate shelling out to `read`?
[06:00:05] abuzze: has joined #ruby
[06:01:14] RegulationD: has joined #ruby
[06:01:24] fgo: has joined #ruby
[06:01:24] abuzze: has joined #ruby
[06:02:12] Pupeno: has joined #ruby
[06:02:57] Rubie: has joined #ruby
[06:05:59] finisherr: has joined #ruby
[06:06:32] yayfoxes3: has joined #ruby
[06:07:09] swgillespie: has joined #ruby
[06:09:36] Scroff: has joined #ruby
[06:10:05] Musashi007: has joined #ruby
[06:21:54] simplyianm: has joined #ruby
[06:27:55] Xiti: has joined #ruby
[06:28:22] bkxd: has joined #ruby
[06:30:22] _blizzy_: has joined #ruby
[06:30:47] Rollabunna: has joined #ruby
[06:31:21] fantasticsid: has joined #ruby
[06:31:56] rht: has joined #ruby
[06:32:45] simplyianm: has joined #ruby
[06:33:58] roolo: has joined #ruby
[06:35:23] jfarmer: has joined #ruby
[06:35:52] Ox0dea: The Greeks had 256-core processing units: http://i.imgur.com/Uazphhf.jpg
[06:38:30] ndrei: has joined #ruby
[06:38:58] bf4: has joined #ruby
[06:39:53] simplyianm: has joined #ruby
[06:43:33] ashleyis: has joined #ruby
[06:44:00] sinkensabe: has joined #ruby
[06:44:40] fantasticsid: has joined #ruby
[06:47:42] GPrime: has joined #ruby
[06:47:50] Oka: has joined #ruby
[06:49:01] yardenbar: has joined #ruby
[06:51:19] Rollabunna: has joined #ruby
[06:53:21] mcclurmc: has joined #ruby
[06:56:02] konsolebox: has joined #ruby
[06:57:07] User458764: has joined #ruby
[06:57:34] peter_paule: has joined #ruby
[07:00:09] balazs: has joined #ruby
[07:00:16] wildroman2: has joined #ruby
[07:03:30] celly: has joined #ruby
[07:04:25] doodleha_: has joined #ruby
[07:04:50] chinmay_dd: has joined #ruby
[07:05:26] wildroman2: has joined #ruby
[07:08:15] yardenbar: has joined #ruby
[07:09:18] Marisa: have a question about variable scope...i have 3 variables that I want to use, and i am using a loop to parse their values from my input...would best practice to use a @instancevariable when I call them in the loop and then later in the program or should i just initialize them before the loop?
[07:10:12] ruboto: We can't help you without your code, please post it to https://gist.github.com
[07:10:12] doodleha_: has joined #ruby
[07:10:47] shevy: ruboto don't be so pessimistic a bot!
[07:11:28] shevy: Marisa if you work within a class, I recommend to initialize all your variables right at creation-time (when you call .new; so in other words, within "def initialize"; I use a common method for that, which I then call "def reset")
[07:12:32] Marisa: it's more like, since i'm initializing them inside a loop, i can't call them later (they're local to the loop), so should i make them instance variables (by using @name) or should i just initialize the variables before i assign them values
[07:12:41] Marisa: not really a code question, more of a style question, if you dig
[07:12:47] sameerynho: has joined #ruby
[07:13:05] shevy: if you require them to be persistent, then use @ivars; or initialize them outside the loop
[07:13:22] Marisa: this is a pretty simple program, i'm not even using a class
[07:13:38] shevy: actually you answered your own question there
[07:13:46] shevy: you want to use local variables, which you initialize outside the loop
[07:14:06] doodleha_: has joined #ruby
[07:14:12] shevy: ruby is an OOP language though, the whole point of using a class is that you can re-use it neatly structured through a class
[07:14:38] Marisa: totally, but it's not needed for what I'm doing
[07:14:43] [k-: I still have no clue about what she wants
[07:15:03] Carnage\: has joined #ruby
[07:15:13] [k-: does that variable need to be global?
[07:15:26] [k-: or does it need to be local to a method only
[07:15:34] Marisa: i think initializing the variables before the loop is the way to go for this
[07:15:44] [k-: in general, choose the smallest scope possible
[07:15:48] lavros: has joined #ruby
[07:19:56] doodleha_: has joined #ruby
[07:20:29] vyorkin: has joined #ruby
[07:21:55] shevy: I sort of ended up using classes almost all the time; or at the least modules
[07:23:56] Ox0dea: It just feels "cleaner" somehow.
[07:24:18] khebbie: has joined #ruby
[07:25:40] doodleha_: has joined #ruby
[07:29:27] al2o3-cr: has joined #ruby
[07:31:06] tubuliferous_: has joined #ruby
[07:31:28] doodleha_: has joined #ruby
[07:32:06] Marisa: woohoo, I got it to parse my data inputs and assign variables correctly. Thanks guys for your help :)
[07:32:46] fgo: has joined #ruby
[07:32:50] Ox0dea: Marisa: May we see?
[07:34:08] Rollabunna: has joined #ruby
[07:35:07] Marisa: sure: https://gist.github.com/marisas/eb0a731d64df556e93fd
[07:36:01] [k-: so you only need the first two lines?
[07:36:14] Marisa: the data is always formatted the same, on line 1 there are 3 numbers separated by spaces and on line 2 there are up to 10 numbers separated by spaces
[07:36:38] Marisa: yeah, the loop is a bit overkill, no?
[07:38:18] khebbie_: has joined #ruby
[07:38:21] [k-: you could also break after 2, but the resources are already wasted
[07:38:31] Marisa: any suggestions for cleaning it up? I was having trouble getting data using ARGF
[07:38:33] jfarmer: Marisa You're only ever receiving 2 lines?
[07:39:05] [k-: as in the file is max 2 lines?
[07:39:18] Ox0dea: Marisa: Splitting on ' ' is unnecessarily brittle; your code will malfunction in the presence of extraneous spaces.
[07:39:40] Ox0dea: Never mind.
[07:39:40] Marisa: I can just use split()?
[07:39:48] jfarmer: [k- Seems like the assumption/guarantee is that there will only ever be two lines on STDIN
[07:39:54] Ox0dea: Marisa: Oui, and even without the parentheses.
[07:40:04] jfarmer: Marisa What does each line represent?
[07:40:31] Ox0dea: jfarmer: The variable names make it reasonably clear, I should think.
[07:40:52] bluOxigen: has joined #ruby
[07:41:06] jfarmer: Ox0dea Marisa said that "on line 2 there are up to 10 numbers separated by spaces"
[07:41:11] doodleha_: has joined #ruby
[07:41:16] [k-: let's over engineer the solution!
[07:41:17] jfarmer: Unclear what each number there represents
[07:41:30] Marisa: the hit points of each enemy
[07:41:44] jfarmer: Ok, up to 10 enemies?
[07:41:49] [k-: ah, so this is the first step?
[07:41:54] Marisa: this is for a code challenge so i'm not trying to get tooooo specific on what exactly i'm trying to do
[07:41:56] [k-: so u aren't finished?
[07:42:04] quazimodo: has joined #ruby
[07:42:09] Versality: has joined #ruby
[07:42:14] [k-: ah its a challenge
[07:42:24] [k-: no tips for you then
[07:42:35] Marisa: no, this is just parsing the data, i still have to write the actual logic to give me the answer
[07:42:39] datanoise: has joined #ruby
[07:43:04] [k-: they are all the data you need?
[07:43:06] doodleha_: has joined #ruby
[07:43:07] jfarmer: How you structure this depends on how it'll be used, so it's hard (IMO) to give specific recommendations.
[07:43:11] peter_paule: has joined #ruby
[07:43:15] joshbamboo1: has joined #ruby
[07:43:19] mujou: has joined #ruby
[07:43:28] [k-: we should use json frankly
[07:43:29] othernick: has left #ruby: ("Leaving")
[07:43:32] jfarmer: Marisa As a rule, you should have some concrete object of some kind that represents each entity you care about
[07:43:38] [k-: json > yml
[07:43:52] Marisa: but basically, line 1 has 3 numbers, the first is the number of enemies, second is amount of spell damage on first enemy, third is amount that the spell damage reduces for each subsequent enemy
[07:43:52] NeverDie: has joined #ruby
[07:44:05] Ox0dea: [k-: Heh, no, sorry, I accidentally sent that.
[07:44:12] Ox0dea: I was going to say that it's a strict subset of YAML.
[07:44:14] zenspider: Marisa: a, b, c, ... = string.split
[07:44:22] Marisa: and then line 2 has the hit points of the enemies (and the number will vary)
[07:44:31] [k-: so you mean technically, json < yml
[07:44:33] zenspider: so you don't have to keep using it like an array
[07:44:36] ndrei: has joined #ruby
[07:45:12] zenspider: and use_snake_case notCamelCase in ruby
[07:45:12] Ox0dea: [k-: That was the intended implication, yes.
[07:45:19] Marisa: ah okay :)
[07:45:54] Marisa: well, i wasn't sure how to get data using ARGF line by line and then split it up without using an array
[07:46:18] bnagy: a,b,c = ARGF.readline.split
[07:46:19] Ox0dea: Marisa: String#split gives you the array in question, but you don't need to index into it one-by-one.
[07:46:52] Marisa: well i only want to split the first line, it will work better for line 2 to keep it in an array
[07:47:01] [k-: you can use _ for variables you don't need, as in a, b, _, c, d = array
[07:47:04] Marisa: let me rephrase
[07:47:35] zenspider: you can use splat w/ masgn like so: first, *rest = ARGF.readlines
[07:47:50] bnagy: I think it's only two lines
[07:47:59] jfarmer: Marisa Do you have to handle invalid input?
[07:48:02] zenspider: ah, then stop overthinking this
[07:48:06] unshadow: has joined #ruby
[07:48:17] Marisa: i want the data from line 2 to be in an array (so I can manipulate it later) and but for line 1, i want each item to be assigned to a variable
[07:48:17] yeticry: has joined #ruby
[07:48:20] zenspider: if you know that the first line has 3 numbers then just do that
[07:48:26] zenspider: a, b, c, *rest = ARGF.read.split
[07:48:26] bnagy: a,b,c = ARGF.readline.split; rest = ARGF.readline.split
[07:48:41] Marisa: jfarmer: asaik, no
[07:49:04] Ox0dea: data = 'Alice 20 programmer'.split; name = data[0]; age = data[1]; prof = data[2]
[07:49:04] Marisa: bnagy: that's super helpful, thanks
[07:49:05] Ox0dea: name, age, prof = 'Alice 20 programmer'.split
[07:49:09] duoi: has joined #ruby
[07:49:13] zenspider: do the simplest thing that can possibly work. read a bunch of numbers, grab the first 3
[07:49:14] jfarmer: Then you can ignore the first number on the first line
[07:49:16] [k-: it would be poor practice to keep numbers with special meanings in a areay
[07:49:17] Ox0dea: Marisa: The two lines I pasted are essentially equivalent, but surely you see that one is much nicer than the other?
[07:49:58] RegulationD: has joined #ruby
[07:50:08] bnagy: Marisa: zenspider's is arguably cleaner, but it will run on if there's more than two lines for some reason
[07:50:10] zenspider: poor practice. bah. Marisa just needs to get shit done. not get shit done perfectly.
[07:50:13] tesuji: has joined #ruby
[07:50:29] zenspider: bnagy: absolutely
[07:50:33] Marisa: no, i'm trying to learn, i appreciate it
[07:50:39] [k-: that's what all programmers say ;-;
[07:50:49] zenspider: assuming they have the same # of columns for lines 2-, then each_slice is king
[07:50:54] [k-: and we have to maintain those codebase ;-;
[07:51:09] bnagy: imho if there are more than 10 numbers I don't want to name them individually
[07:51:11] zenspider: [k-: nice way to set up a bullshit us vs them dichotomy
[07:51:40] chishiki: has left #ruby: ("WeeChat 1.2")
[07:51:51] zenspider: bnagy: preferably, you wrap it up in a nice object/struct and pass them in to initialize into named fields.
[07:52:04] Ox0dea: zenspider: Or #zip + #to_h.
[07:52:05] bnagy: Marisa: using the readline approach you also don't need the loop, which means you also don't have the ugly variable initialisation
[07:52:26] zenspider: Ox0dea: don't recommend that. I'd rather use purposeful methods
[07:52:28] bnagy: same with the read.split approach
[07:52:28] Rubie: has joined #ruby
[07:52:43] Marisa: Ox0dea: definitely nicer, i'm just too new at this to know all the syntax especially the pretty stuff ;)
[07:52:53] Ox0dea: Marisa: All in good time.
[07:53:36] Marisa: thanks for all your help though...might need to refactor it tomorrow though, it's getting late here
[07:53:39] joshbamboo2: has joined #ruby
[07:53:59] zenspider: Marisa: what is this for?
[07:54:06] Ox0dea: Knowledge acquisition.
[07:54:13] mcclurmc: has joined #ruby
[07:54:13] Marisa: devdraft.com
[07:54:28] joshbamboo2: has joined #ruby
[07:54:42] doodleha_: has joined #ruby
[07:54:48] Pupeno: has joined #ruby
[07:54:49] Ox0dea: Is that... a Big O joke?
[07:54:51] zenspider: Marisa: interesting. thanks.
[07:55:12] Marisa: i'm not sure i can get through all 3 programs though, this was supposed to be the easy one and it's taken me like 3 hours to just parse the data (to be fair, i've never done anything like that in my previous studies)
[07:55:30] zenspider: http://devdraft.com/employers kinda scary
[07:55:49] zenspider: Marisa: that's fine. failure is how we learn and improve
[07:55:56] Marisa: because of the companies listed?
[07:56:40] Ox0dea: Not to mention the tacky SEO grubbing in the footer.
[07:56:46] Marisa: i'm not realistically trying to get a job out of this, i just thought it would be a good learning experience as a worst case scenario, and best case, you never know...
[07:56:50] zenspider: just... not the way I like companies thinking about me, nor vice versa I guess.
[07:57:11] zenspider: Marisa: *nod* might want to try exercism.io as well.
[07:57:19] zenspider: and codecombat is fun and dorky
[07:57:44] Marisa: i have both of those bookmarked
[07:58:08] zenspider: good. they're fun. I do exercism once in a while. good stuff.
[07:58:34] doodleha_: has joined #ruby
[07:59:29] Marisa: i've been going through the Odin Project, but I was getting bored with the HTML/CSS stuff (as I already know a fair bit about that), so I started going through learn ruby the hard way, but I feel like it's just a bad translation of learn perl the hard way and not really that useful
[07:59:57] sinkensabe: has joined #ruby
[08:00:04] zenspider: I have a biased opinion about it, so... I'll just say that. :)
[08:00:23] Marisa: really just trying to make steady progress on stuff, but i've done too many super simple programs and not enough "sink or swim" type challenges, which is where i tend to learn the most
[08:00:27] zenspider: the nice thing about exercism is it has crowdsourced code reviews
[08:00:37] zenspider: not the best in the world, but much more human
[08:01:04] zenspider: *nod* you might prefer codecombat over exercism then
[08:01:14] Marisa: i think the best thing i've done so far was make a simple calendar generating program...learned a lot from that
[08:01:39] Marisa: like how much syntax i really don't know, for one....
[08:02:18] Marisa: i'll definitely check them both out soon
[08:02:19] zenspider: *nod* and there's a lot of syntax in ruby
[08:02:26] [k-: quick, write all these down
[08:02:29] IanV0rn: has joined #ruby
[08:02:33] [k-: all good testimonials!
[08:04:20] doodleha_: has joined #ruby
[08:05:16] Marisa: out of curiosity, is anyone here in devops?
[08:06:00] Ox0dea: I develop operators, but I've never operated on a developer.
[08:06:18] doodleha_: has joined #ruby
[08:06:34] [k-: huehuehue
[08:06:53] zenspider: I have. it was a bloody mess in the end.
[08:07:34] Marisa: )xxxxx[;;;;;;;;;>
[08:07:47] Ox0dea: "Stick 'em with the pointy end."
[08:08:37] Ox0dea: >> ")#{?x*5}[#{?;*9}>"
[08:08:38] vyorkin: has joined #ruby
[08:08:38] ruboto: Ox0dea # => ")xxxxx[;;;;;;;;;>" (https://eval.in/388672)
[08:08:55] shevy: a twohander
[08:09:53] baweaver: has joined #ruby
[08:10:09] doodleha_: has joined #ruby
[08:11:29] CloCkWeRX: has joined #ruby
[08:11:40] [k-: >> ")" << 5.times { ?x }.reduce(&:<<) << 9.times { ?; }.reduce(&:<<) << ">"
[08:11:41] ruboto: [k- # => undefined method `reduce' for 5:Fixnum (NoMethodError) ...check link for more (https://eval.in/388673)
[08:12:30] wildroman2: has joined #ruby
[08:12:51] Ox0dea: What is the opposite of code golf?
[08:13:04] peter_paule: has joined #ruby
[08:13:43] [k-: there is no end
[08:13:52] al2o3-cr: has joined #ruby
[08:14:01] jhass: uh, code speer throwing?
[08:14:08] [k-: we could implement a factory to process the string
[08:14:14] Ox0dea: We Java yet?
[08:14:25] [k-: we could have a brain fuck interpreter to print it
[08:14:42] [k-: we could implement java in Ruby to print it
[08:14:55] Ox0dea: I could totally write and fully optimize that program by hand.
[08:15:42] Ox0dea: >> 'good' > 'golf'
[08:15:43] ruboto: Ox0dea # => true (https://eval.in/388676)
[08:15:59] doodleha_: has joined #ruby
[08:17:21] Ox0dea: zenspider: Is it okay to use the variable-defining powers of Regexp#match?
[08:18:39] jfarmer: all hail the qlobe http://mamememo.blogspot.com/2010/09/qlobe.html
[08:20:04] Ox0dea: This is my favorite thing from Endo-san: https://github.com/mame/piet-misc/blob/master/bf2piet.rb
[08:20:09] Ox0dea: *Endoh-san
[08:21:06] bruno-: has joined #ruby
[08:22:00] Ox0dea: There's a C-to-brainfuck thing out there somewhere, so you can turn any program into an executable PNG.
[08:22:28] Marisa: hasta luego, muchas gracias amigos
[08:22:42] shevy: ack, alien tongue
[08:22:53] Marisa: c u l8r, tyvm
[08:23:49] Marisa: i'll try to visit using a real IRC client next time
[08:24:10] jfarmer: It's hard to use IRC with a fake client, I'd say.
[08:26:28] Versality: has joined #ruby
[08:26:49] kraljev11: has joined #ruby
[08:28:19] sankaber: has joined #ruby
[08:28:25] jfarmer: tin can IRC
[08:28:25] wildroman2: has joined #ruby
[08:28:47] peter_paule: has joined #ruby
[08:29:06] Ox0dea: TCP => Tin Can Protocol.
[08:30:32] [k-: http://carc.in/#/r/5rn
[08:31:01] Ox0dea: We got a Haskeller.
[08:31:10] Scroff: has joined #ruby
[08:31:35] jfarmer: yeah was going to say, that's like some twisted version of bind/return
[08:31:36] merqlove: has joined #ruby
[08:31:38] Ox0dea: [k-: What did you do with the guard?!
[08:31:38] [k-: this is disgraceful!
[08:32:08] [k-: I usually try not to use it
[08:32:14] [k-: pattern matching best way
[08:32:36] Ox0dea: No, I meant your blade just suddenly becomes the grip.
[08:33:06] [k-: I don't get you
[08:33:16] Ox0dea: You're missing the [ from the original.
[08:33:31] [k-: ;-; it was a pain to write
[08:33:35] Ox0dea: Using yours would potentially cause the wielder to donate blood involuntarily.
[08:33:36] doodleha_: has joined #ruby
[08:33:48] hotpancakes: has joined #ruby
[08:34:01] jfarmer: Needs more unicode variable names
[08:35:20] [k-: tada http://carc.in/#/r/5rp
[08:36:10] s2013: has joined #ruby
[08:36:18] [k-: this one is better: http://carc.in/#/r/5rq
[08:36:30] Ox0dea: This one is a syntax error: http://carc.in/#/r/5ro
[08:37:04] peter_paule: has joined #ruby
[08:37:13] doodleha_: has joined #ruby
[08:37:37] Ox0dea: Sorry. I compulsively look for interesting happenstances in random URLs.
[08:37:47] Ox0dea: I realize carc.in's just auto-increment, but the point remains.
[08:37:49] Ox0dea: Blame imgur.
[08:38:40] [k-: I like cat photos from imgur
[08:39:45] _blizzy_: has joined #ruby
[08:39:49] GitGud: has joined #ruby
[08:40:36] shevy: one day cats will rule this world
[08:40:39] [k-: also dogs http://i.imgur.com/EBvB5hm.mp4
[08:41:03] doodleha_: has joined #ruby
[08:41:06] shevy: dogs are not as sneaky as cats are
[08:41:07] redlegion: has joined #ruby
[08:41:14] ytti: that kid has terrible combover
[08:41:22] ytti: he should just accept the problem
[08:43:43] mandarinkin: has joined #ruby
[08:44:54] doodleha_: has joined #ruby
[08:45:34] mdw: has joined #ruby
[08:46:58] lxsameer_: has joined #ruby
[08:48:49] doodleha_: has joined #ruby
[08:49:26] jas02: has joined #ruby
[08:49:29] Al3ks: has joined #ruby
[08:49:48] wildroman3: has joined #ruby
[08:49:57] jesterfraud: has joined #ruby
[08:50:11] SCHAAP137: has joined #ruby
[08:50:25] ItSAN____: has joined #ruby
[08:50:25] wildroman2: has joined #ruby
[08:50:40] Rakunh0: has joined #ruby
[08:51:30] fgo: has joined #ruby
[08:54:29] tesuji: has joined #ruby
[08:54:35] fantazo: has joined #ruby
[08:55:00] mcclurmc: has joined #ruby
[08:56:54] bkxd: has joined #ruby
[08:57:13] vyorkin: has joined #ruby
[08:59:38] hotpancakes: has joined #ruby
[08:59:47] lavros: has joined #ruby
[09:00:24] doodleha_: has joined #ruby
[09:02:00] simplyianm: has joined #ruby
[09:02:48] bf4: has joined #ruby
[09:03:31] balazs: has joined #ruby
[09:03:46] mengu: has joined #ruby
[09:03:46] mengu: has joined #ruby
[09:04:13] doodleha_: has joined #ruby
[09:05:30] ozzloy: has joined #ruby
[09:05:30] ozzloy: has joined #ruby
[09:06:16] k3asd`: has joined #ruby
[09:06:31] choke: has joined #ruby
[09:07:02] lavros: has joined #ruby
[09:08:50] jimms: has joined #ruby
[09:10:02] doodleha_: has joined #ruby
[09:10:05] bruno-: has joined #ruby
[09:10:18] allomov: has joined #ruby
[09:16:10] simplyianm: has joined #ruby
[09:17:38] doodleha_: has joined #ruby
[09:19:15] tubuliferous_: has joined #ruby
[09:20:18] nfk: has joined #ruby
[09:22:53] wildroman3: has joined #ruby
[09:23:24] doodleha_: has joined #ruby
[09:23:39] wildroman2: has joined #ruby
[09:24:32] yfeldblum: has joined #ruby
[09:27:13] doodleha_: has joined #ruby
[09:27:59] choke: has joined #ruby
[09:30:56] wildroman3: has joined #ruby
[09:31:30] allomov: has joined #ruby
[09:34:57] Scroff: has joined #ruby
[09:37:07] peter_paule: has joined #ruby
[09:38:54] RegulationD: has joined #ruby
[09:38:55] sandstrom: has joined #ruby
[09:46:20] shevy: $.fn.scrollView = function () {
[09:46:36] shevy: I find javascript/jquery syntax somewhat weird
[09:47:27] OrbitalKitten: has joined #ruby
[09:48:36] senayar: has joined #ruby
[09:48:44] apeiros: J.fn.scroll_view = -> () {
[09:48:44] senayar: has joined #ruby
[09:48:48] apeiros: not that much different from ruby
[09:50:55] [k-: coffee: (a) -> iirc
[09:51:54] Rutix: has joined #ruby
[09:52:19] shevy: ewww the ->
[09:53:02] apeiros: shevy: well, you can do: J.fn.scroll_view = lambda { || # too, but that's more different :)
[09:53:10] apeiros: oh, actually proc
[09:53:15] platzhirsch: has joined #ruby
[09:53:17] apeiros: since JS functions don't care how many args you pass in
[09:53:17] platzhirsch: has left #ruby: ()
[09:53:40] shevy: I like that a little more
[09:53:52] shevy: the || trip me off though
[09:55:44] mcclurmc: has joined #ruby
[09:56:19] [k-: why do you need ||
[09:57:02] lavros: has joined #ruby
[09:57:21] al2o3-cr: declaring variables inside the block
[09:58:06] [k-: but there are no params
[10:00:28] lkba: has joined #ruby
[10:01:15] darkf_: has joined #ruby
[10:02:01] Scroff: has joined #ruby
[10:03:31] bf4: has joined #ruby
[10:06:02] Jackneill: has joined #ruby
[10:06:24] shevy: they are invisible
[10:08:11] hectortrope: has joined #ruby
[10:09:18] anjen: has joined #ruby
[10:09:43] michael_mbp: has joined #ruby
[10:11:32] sdothum: has joined #ruby
[10:11:38] apeiros: I think there are cases where with/without || makes a difference. but I think that was in an older ruby.
[10:12:04] apeiros: zenspider: where's that table of yours showing the differences in Proc/proc/lambda/-> ?
[10:12:38] [k-: has joined #ruby
[10:12:43] peter_paule: has joined #ruby
[10:13:33] apeiros: hm, probably still sleepytime over there :)
[10:16:17] shevy: apeiros hmm by the way, did you not at one time create your own webframework?
[10:16:21] shevy: or was that the php past
[10:16:35] apeiros: that was php. but I'm now working on one again.
[10:16:48] [k-: for your work?
[10:16:56] apeiros: not sure whether the term webframework cuts it, though. it's geared towards webapps specifically.
[10:16:58] MacDaddy: has joined #ruby
[10:17:10] apeiros: not for the company I work at, no.
[10:17:26] apeiros: that'd be too expensive for them :)
[10:17:27] [k-: for other companies?
[10:17:34] apeiros: for myself
[10:17:38] apeiros: private work
[10:18:09] Scroff: has joined #ruby
[10:19:26] langlands: has joined #ruby
[10:20:45] apeiros: I hope to opensource it around end of year. though I made much less progress than expected.
[10:21:20] [k-: what will it be called?
[10:21:33] apeiros: that's the working name at least
[10:22:33] [k-: well that is an ...interesting... choice
[10:22:50] apeiros: hehe, that sounds enthusiastic ;-)
[10:23:55] [k-: politeness :>
[10:25:42] chipotle: has joined #ruby
[10:25:43] apeiros: a good name is difficult, and it's not my main focus. well possible that I'll rename it before release.
[10:28:25] pontiki: jacob is a find name for a framework
[10:28:47] mengu: has joined #ruby
[10:29:45] al2o3-cr: has joined #ruby
[10:30:04] kong0: has joined #ruby
[10:30:14] kong0: ruby is ABSOLUTE FOOKING gobshite
[10:30:18] apeiros: huh? sloccount reports 250kLoc ruby code??? that??? sounds like way more than I expected
[10:30:25] Squarepy: has joined #ruby
[10:30:27] kong0: motherFUNKAZ
[10:30:33] apeiros: !mute kong0
[10:30:33] ruboto: +q kong0!*@*
[10:30:33] ruboto: -o ruboto
[10:30:34] kong0: has left #ruby: ()
[10:30:51] baweaver: you'd think they'd get bored after a while
[10:30:52] apeiros: wow, even has a cloak
[10:31:08] [k-: what is sloc?
[10:31:27] apeiros: sloccount is a program which counts source code lines
[10:31:29] pontiki: source lines of code
[10:31:36] Ox0dea: >> require 'date'; Date::MONTHNAMES.join.delete('a-z').include?('JASON')
[10:31:37] ruboto: Ox0dea # => true (https://eval.in/388719)
[10:31:40] baweaver: Ah, working on some big data exercises if anyone's interested for later.
[10:31:53] pontiki: i.e., does not include blank lines or comment-only lines
[10:32:25] Scroff: has joined #ruby
[10:32:27] wasamasa: I like `cloc` more
[10:32:33] baweaver: Fake bookstore data for finding customers who haven't bought anything in a while or are big spenders only during sales / etc
[10:32:41] apeiros: ooooh, lol
[10:32:42] wasamasa: count lines of code
[10:32:43] apeiros: I know why
[10:32:56] wasamasa: because it doesn't have that advertising displaying every time you use it
[10:33:05] apeiros: there's a single file which is contains generated code from the english dict
[10:33:10] apeiros: for the password strength validator
[10:33:14] meph: has joined #ruby
[10:34:05] stamina: has joined #ruby
[10:34:22] [k-: Ox0dea, sneaky :)
[10:34:52] baweaver: pontiki: up late?
[10:35:45] sbhatore: has joined #ruby
[10:36:05] JoL1hAHN: has joined #ruby
[10:36:24] pontiki: late for you, baweaver?
[10:36:34] datanoise: has joined #ruby
[10:36:47] baweaver: Got a little to wrapped up in Apache Kafka and Spark Streaming stuffs.
[10:36:55] pontiki: yeah, but the question is really: have you been to bed yet :)
[10:37:09] pontiki: then late it is :D
[10:37:12] baweaver: I should probably do it.
[10:38:38] decoponio: has joined #ruby
[10:40:28] mengu: has joined #ruby
[10:41:16] vyorkin: has joined #ruby
[10:41:46] lkba_: has joined #ruby
[10:42:21] jhass: -q+b kong0!*@* *!*@unaffiliated/ethicalhacker$#ruby-banned
[10:42:22] rho45dium: has joined #ruby
[10:45:30] TinkerTyper: has joined #ruby
[10:48:50] simplyianm: has joined #ruby
[10:50:36] allomov: has joined #ruby
[10:51:01] OrbitalKitten: has joined #ruby
[10:55:41] simplyianm: has joined #ruby
[10:56:25] mcclurmc: has joined #ruby
[10:59:38] simplyianm: has joined #ruby
[11:01:51] peter_paule: has joined #ruby
[11:06:38] kirun: has joined #ruby
[11:07:25] tubuliferous_: has joined #ruby
[11:10:27] vdamewood: has joined #ruby
[11:11:55] ryba: has joined #ruby
[11:12:43] chinmay_dd: has joined #ruby
[11:13:07] Rubie: has joined #ruby
[11:13:20] hotpancakes: has joined #ruby
[11:14:15] ragingcake_: has joined #ruby
[11:16:11] wildroman2: has joined #ruby
[11:16:12] Scroff: has joined #ruby
[11:18:15] simplyianm: has joined #ruby
[11:20:53] FernandoBasso: has joined #ruby
[11:22:31] startupality: has joined #ruby
[11:23:06] ragingcake_: has left #ruby: ()
[11:24:13] troulouliou_dev: has joined #ruby
[11:24:58] simplyianm: has joined #ruby
[11:27:54] RegulationD: has joined #ruby
[11:28:00] chipotle: has joined #ruby
[11:28:34] icebourg: has joined #ruby
[11:31:48] xxneolithicxx: has joined #ruby
[11:31:48] SCHAAP137: has joined #ruby
[11:35:20] sbhatore: has joined #ruby
[11:45:46] Scroff: has joined #ruby
[11:56:47] yqt: has joined #ruby
[11:58:47] bubbys: has joined #ruby
[11:59:52] [k-_: has joined #ruby
[12:00:10] cashnguns: has joined #ruby
[12:06:47] havenwood: has joined #ruby
[12:12:11] hotpancakes: has joined #ruby
[12:22:08] SCHAAP137: has joined #ruby
[12:22:09] ndrei: has joined #ruby
[12:22:19] quazimodo: has joined #ruby
[12:24:24] Indian: has joined #ruby
[12:34:20] bf4: has joined #ruby
[12:34:41] nateberkopec: has joined #ruby
[12:35:58] Deele: has joined #ruby
[12:36:27] pengin: has joined #ruby
[12:36:53] lessless: has joined #ruby
[12:39:14] phale: has joined #ruby
[12:39:19] phale: hello rubyists
[12:41:17] chinmay_dd: has joined #ruby
[12:41:22] CustosLimen: has joined #ruby
[12:43:39] RegulationD: has joined #ruby
[12:45:31] skade: has joined #ruby
[12:46:53] Versality: has joined #ruby
[12:55:10] chinmay_dd: has joined #ruby
[12:55:34] tubuliferous_: has joined #ruby
[12:59:22] chinmay__: has joined #ruby
[13:01:35] The_Phoenix: has joined #ruby
[13:02:23] Rubie: has joined #ruby
[13:03:01] Yiota: has joined #ruby
[13:07:58] BTRE: has joined #ruby
[13:09:18] BrianBoyko: has joined #ruby
[13:11:42] ruv: has joined #ruby
[13:13:38] Casty: has joined #ruby
[13:15:06] renderful: has joined #ruby
[13:16:38] Scroff: has joined #ruby
[13:17:13] dgutierrez1287: has joined #ruby
[13:18:07] skade: has joined #ruby
[13:18:24] TheBrayn: has joined #ruby
[13:19:29] bruno-_: has joined #ruby
[13:19:51] sandstrom: has joined #ruby
[13:19:51] phutchins: has joined #ruby
[13:21:58] shevy: more ruby code people!
[13:22:22] apeiros: code more ruby people!
[13:22:27] apeiros: code more, ruby people!
[13:22:34] apeiros: code more ruby, people!
[13:22:38] charliesome: has joined #ruby
[13:22:49] apeiros: o/ charlie
[13:23:03] shevy: are you on your medications again apeiros :P
[13:23:10] apeiros: shevy: lol, no
[13:23:19] apeiros: elbow is finally getting better
[13:23:19] wildroman2: has joined #ruby
[13:23:30] Scroff: has joined #ruby
[13:23:30] apeiros: I hope I can do sports again next week
[13:23:54] loechel: has joined #ruby
[13:27:09] [k-_: i'm slowly shifting away from ruby
[13:27:12] [k-_: shift shift
[13:27:19] hotpancakes: has joined #ruby
[13:27:49] [k-_: the last piece of code i wrote in ruby was this: http://repl.it/s0a
[13:28:01] [k-_: a less than spectacular piece of work
[13:28:23] [k-_: (i was porting my haskell)
[13:29:40] sevenseacat: i've been writing elixir all weekend
[13:29:55] [k-_: ah yes im going to learn that too
[13:29:59] [k-_: i should keep a list
[13:30:04] [k-_: because i forgot
[13:30:17] shevy: [k-_ you are writing more haskell code?
[13:30:31] millerti: has joined #ruby
[13:30:31] [k-_: no, busy with homework and surfing internets
[13:30:41] [k-_: i still need to read a haskell book
[13:33:56] ruby-lang590: has joined #ruby
[13:34:22] unshadow: has joined #ruby
[13:34:22] shevy: cool... I can create errors unknown to me so far, from my own code :)
[13:34:24] shevy: module.rb:91:in `write': deadlock; recursive locking (ThreadError)
[13:35:04] bf4: has joined #ruby
[13:35:46] ruby-lang590: Hello. I'm new here, so sorry if this isn't a great question. Can anyone tell me how to insert a new row into a database using the 'pg' gem without having to interpolate the exec string?
[13:35:58] legitler__: has joined #ruby
[13:37:16] [k-_: is it some sort of prepared statements
[13:37:34] [k-_: i havent touched sql at all
[13:39:14] RandyT: has joined #ruby
[13:39:45] ruby-lang590: I can figure out how to di it using interpolation, but I'd rather not do that for security reasons.
[13:39:54] ruby-lang590: I can figure out how to d it using interpolation, but I'd rather not do that for security reasons.
[13:40:18] ruby-lang590: I can figure out how to do it using interpolation, but I'd rather not do that for security reasons.* blargh, getting used to irc, sorry
[13:40:24] rbennacer: has joined #ruby
[13:40:26] [k-_: i think i read somewhere that there is "?" placeholders that you can use for prepared statements
[13:40:51] ruby-lang590: There are $ placeholders I can use in SELECT, but I haven't figured out how to use them for INSERT.
[13:41:30] [k-_: http://stackoverflow.com/questions/10841390/example-of-a-prepared-insert-statement-using-ruby-pg-gem
[13:42:02] ruby-lang590: That looks like what I need. Thx.
[13:43:11] rippa: has joined #ruby
[13:44:30] RegulationD: has joined #ruby
[13:44:49] Muhannad: has joined #ruby
[13:44:57] [k-_: how's my code, nice? >.>
[13:45:04] albatross1: has joined #ruby
[13:46:05] simplyianm: has joined #ruby
[13:48:53] Yiota: hey folks, employer has asked me to learn ruby for the job. now this is because the website is built on rails. is the transition from python to ruby easier or harder than vice versa?
[13:50:12] [k-_: the two languages are similar
[13:50:16] [k-_: but you dont have decorators
[13:50:24] [k-_: or those __cmp__ stuff
[13:50:36] apeiros: Yiota: I think nobody has done a transition in both directions, so I doubt anybody can answer this ;-)
[13:50:40] [k-_: we can define < immediately
[13:50:49] apeiros: Yiota: but the two languages are quite similar. the transition should not be hard.
[13:50:57] [k-_: we also do not have the ugly __init__
[13:51:00] [k-_: we have def initialize!
[13:51:12] Yiota: I see. would you say ruby is more or less abstracted?
[13:51:12] [k-_: hehehehehehehehehe
[13:51:16] apeiros: yeah, the OO is less bolted-on.
[13:51:25] apeiros: otoh we don't have list comprehensions. we use methods for that.
[13:51:26] Yiota: as in higher-leveled
[13:51:34] [k-_: ruby would be less
[13:51:35] apeiros: Yiota: entirely irrelevant ;-p
[13:51:56] bf4: has joined #ruby
[13:53:27] albatross1: has left #ruby: ()
[13:54:06] albatross1: has joined #ruby
[13:55:13] TheHodge: has joined #ruby
[13:56:18] rdark: has joined #ruby
[13:56:34] Scroff: has joined #ruby
[13:57:10] djellemah: has joined #ruby
[13:57:16] iamninja: has joined #ruby
[13:57:17] kubunto: has joined #ruby
[13:57:37] kubunto: is there an easy way to convert julian to and from hebrew dates?
[13:57:56] simplyianm: has joined #ruby
[13:59:13] Aryasam: has joined #ruby
[13:59:59] [k-_: i dont think the stdlib has anything for you
[14:00:11] [k-_: the stdlib supports Julian but I cant find hebrew
[14:00:28] [k-_: http://ruby-doc.org/stdlib-2.2.2/libdoc/date/rdoc/Date.html#method-c-jd
[14:01:02] kubunto: i meant standard dates to hebrew
[14:01:02] [k-_: maybe this? https://github.com/deadprogram/hebruby
[14:01:25] [k-_: "Hebruby is a Ruby library to convert julian dates to hebrew dates, and vice-versa."
[14:01:33] pothibo: has joined #ruby
[14:02:35] [k-_: keywords searched: ruby hebrew calender
[14:03:06] kubunto: thank you, looks promising
[14:03:51] sankaber: has joined #ruby
[14:05:32] phale: has left #ruby: ("Leaving")
[14:06:35] datanoise: has joined #ruby
[14:06:51] shevy: does anyone of you know why descriptions such as at https://rubygems.org/gems/rack do not allow for <br> tags and thus newlines? for longer descriptions of a program, it makes it hard to read
[14:07:14] BigRonnieRon: has joined #ruby
[14:08:52] lessless: has joined #ruby
[14:09:21] [k-_: what do you mean by do not allow
[14:09:27] [k-_: there were no <br> tags found
[14:10:15] shevy: I am pretty sure you can add <br> tags but it won't be honoured
[14:11:07] apeiros: kubunto: sure you want julian and not gregorian?
[14:11:11] [k-_: why dont you try :>
[14:11:29] [k-_: apeiros: i think the fact that a library exists means that it's pretty common :>
[14:11:32] apeiros: (julian is not in use by any country atm)
[14:11:59] idafyaid: has joined #ruby
[14:12:12] shevy: [k-_ nono we can skip ahead, I am absolutely sure
[14:12:31] [k-_: but you have no proof that you cant
[14:12:36] kubunto: apeiros: i do
[14:12:46] shevy: [k-_ do you have?
[14:12:48] [k-_: anyway, im sure apeiros is skilled in the arts of html and css and stuff
[14:13:01] kubunto: if there is a direct conversion from hebrew to gregorian i woudl take it
[14:13:23] [k-_: i also dont have proof that it can, but im not the one asking ^^
[14:13:45] shevy: ok so you have no clue
[14:15:10] shevy: on github, their readmes are often much easier to read
[14:16:30] unshadow: has joined #ruby
[14:18:01] hotpancakes: has joined #ruby
[14:18:07] micmus: has joined #ruby
[14:19:49] kubunto: apeiros: any ideas on how to get the julian number to a gregorian date
[14:19:59] konsolebox: has joined #ruby
[14:20:52] dcarmich: has joined #ruby
[14:21:34] apeiros: kubunto: Date might do that
[14:21:58] kubunto: looks liike it would
[14:22:51] Hien: has joined #ruby
[14:22:53] albatross1: has left #ruby: ()
[14:22:58] apeiros: yeah, Date.new with proper 4th arg should
[14:22:59] [k-_: ruby Date?
[14:24:04] kubunto: Date.jd(julian_number)
[14:24:08] kubunto: that does it
[14:25:41] apeiros: funny, I was looking for that method, but missed it
[14:26:14] Hien: has joined #ruby
[14:26:20] [k-_: i linked that method o_O
[14:26:32] Ox0dea: has joined #ruby
[14:26:49] Ox0dea: apeiros: Wish me luck: https://bugs.ruby-lang.org/issues/11315
[14:27:04] quazimodo: anyone using celluloid:io and/or reel?
[14:27:20] apeiros: ACTION crosses fingers for Ox0dea
[14:27:27] apeiros: 'anyone quazimodo
[14:27:30] apeiros: ?anyone quazimodo
[14:27:30] ruboto: quazimodo, Just ask your question, if anyone has or can, they will respond.
[14:27:42] Ox0dea: I think it's quite strange that Array#^ might just now be getting in.
[14:27:50] ytti: Ox0dea, seems like nobrainer, good luck
[14:28:04] [k-_: Ox0dea: arent you sleeping?
[14:28:17] apeiros: [k-_: he is. he's sleep-typing
[14:28:25] Ox0dea: [k-_: I tried, but I ended up making breakfast (and thus coffee) instead.
[14:28:25] apeiros: Ox0dea: are you a "he"?
[14:28:32] Ox0dea: More or less.
[14:28:40] apeiros: ok. they are. they're sleep-typing.
[14:28:48] shevy: haha slightly offtopic; any gento users https://web.archive.org/web/20150401202403/https://www.gentoo.org/
[14:28:52] shevy: *gentoo rather
[14:29:04] Ox0dea: shevy: Are you a Gentoo user?
[14:29:18] shevy: they use python
[14:29:25] shevy: I can not use python
[14:29:31] Ox0dea: Ah, I think we've discussed this.
[14:29:33] Ox0dea: ACTION le tired
[14:29:50] Versality: has joined #ruby
[14:29:59] quazimodo: apeiros: no real question
[14:30:10] quazimodo: apeiros: is it any performant?
[14:30:21] apeiros: quazimodo: ok then: yes, *someone* uses both, celluloid:io and reel.
[14:30:26] quazimodo: i don't mind stepping away from rails, but I do enjoy doing the ruies
[14:30:36] balazs: has joined #ruby
[14:30:48] mase-chatter: has joined #ruby
[14:31:09] quazimodo: also, is rubinius's JIT starting to speed ruby up at all?
[14:31:24] Ox0dea: It's speeding up Rubinius.
[14:31:25] davedev24_: has joined #ruby
[14:31:47] [k-_: isnt rubinius faster than mri?
[14:32:11] greedo: has joined #ruby
[14:32:18] apeiros: for long running things
[14:32:23] apeiros: or *longer
[14:32:33] Ox0dea: Do we consider Crystal a "Ruby"?
[14:32:56] [k-_: the about page lists implementations of ruby
[14:33:16] quazimodo: i dream of a day when ruby is nil-free, and a bit fater
[14:33:26] quazimodo: i really, really don't want to do nodejs programmering
[14:34:14] quazimodo: actually i'm looking at some monadic constructs
[14:34:23] quazimodo: http://voltframework.com/
[14:34:37] [k-_: http://elm-lang.org/
[14:35:02] Ox0dea: quazimodo: What is a "monadic construct"?
[14:35:04] apeiros: nullpattern everywhere?
[14:35:16] sevenseacat: how can a language be nil-free?
[14:35:19] [k-_: im sure nil doesnt exist in elm
[14:35:23] Ox0dea: sevenseacat: Runtime errors everywhere.
[14:35:28] shevy: quazimodo when ruby is a bit fater? how much fat shall it have? :D
[14:35:30] [k-_: I think it exists as Nothing
[14:35:35] Ox0dea: [][0] # => RuntimeError
[14:35:44] quazimodo: Just(whatever) and Nothing
[14:35:48] sevenseacat: [k-_: thats still a nil-like thing
[14:36:01] Ox0dea: But it's in a box!
[14:36:11] sevenseacat: nil, null, nothing, etc.
[14:36:14] quazimodo: User.last.suburb returns a Maybe that could be Just(suburb) or Nothing
[14:36:23] ryba: has joined #ruby
[14:36:26] quazimodo: and the semantics of Nothing are very different to nil
[14:37:09] quazimodo: Maybe is to Boolean what Just(something) is to true and Nothing is to false (or vice versa)
[14:37:28] quazimodo: we use deterministic gem a bit
[14:37:46] Yiota: has joined #ruby
[14:37:47] sevenseacat: i thought you were kidding when you said Maybe
[14:37:53] Scroff: has joined #ruby
[14:37:56] quazimodo: it gives us nifty stuff like Success(result) or Failure(raised class)
[14:38:09] quazimodo: it's a brilliant idea
[14:38:16] quazimodo: heavily, heavily used in haskell
[14:38:38] sevenseacat: i dont remember it from haskell, but its been a long time
[14:38:42] Ox0dea: I didn't know parrots enjoyed Kool-Aid.
[14:38:44] shevy: sevenseacat I tell you, the Schroedinger cat is a Maybe Monad
[14:38:50] quazimodo: and being monadic ( a monad is a mathematical concept ) means its bullet proof
[14:38:53] [k-_: https://github.com/elm-lang/core/blob/master/src/Maybe.elm
[14:38:56] [k-_: turrduurrr
[14:39:10] Ox0dea: quazimodo: ELI5 monads?
[14:39:22] quazimodo: Ox0dea: ELIS?
[14:39:26] Ox0dea: Explain like I'm five.
[14:39:33] Ox0dea: (And get a better font.)
[14:40:04] shevy: 5 and S look very similar here as well on "Monospace"
[14:40:08] sevenseacat: the features on the elm homepage talk a big talk
[14:40:21] [k-_: ah it is different from haskell in terms of type annotations
[14:40:27] [k-_: you use : instead of ::
[14:41:16] [k-_: shevy: you have not seen ELI5 before?
[14:41:40] simplyianm: has joined #ruby
[14:41:44] quazimodo: Ox0dea: hrm . Monads are hard to explain without you knowing some category theory
[14:41:46] quazimodo: long story short
[14:41:55] Ox0dea: quazimodo: Why do monads get compared to burritos and spacesuits and monoids in the category of endofunctors?
[14:42:08] quazimodo: because they are just like both of that
[14:42:12] shevy: never heard of ELI5
[14:42:22] shevy: isn't elm from the muppet show?
[14:42:23] [k-_: lel shevy doesnt reddit
[14:42:24] Ox0dea: English needs a "both" for three, I've always said.
[14:42:51] shevy: I read mostly a few articles linked from reddit, not everything
[14:42:52] quazimodo: they are wrappers around interesting stuff, they protect you from outside world craziness (kinda) and they are monoids in the category of endofunctors - nfi how to describe that any better
[14:43:00] Ox0dea: [k-_: Troth?
[14:43:20] quazimodo: intuitively
[14:43:26] quazimodo: think of them like a wrapper
[14:43:28] Ox0dea: quazimodo: That doesn't sound mathematical or category-theoretical at all.
[14:43:33] quazimodo: inside is 1 or more lovely things
[14:43:39] [k-_: bi-oth, tri-oth, remove the i, get troth!
[14:43:43] tubuliferous_: has joined #ruby
[14:43:46] Ox0dea: Case closed.
[14:44:09] quazimodo: Ox0dea: do you know category theory?
[14:44:14] Ox0dea: quazimodo: Is it not the case that there are zero or more things inside?
[14:44:22] sevenseacat: Ox0dea knows everything.
[14:44:30] Ox0dea: ACTION knows nothing, like Jon Targaryen.
[14:44:53] quazimodo: Ox0dea: sure, but you already seem to know what they are
[14:45:00] Ox0dea: quazimodo: Yes, I'm poking fun.
[14:45:13] quazimodo: i wish I could explain them better
[14:45:21] Ox0dea: They're burritos, mate.
[14:45:31] quazimodo: i dno who made that stupid analogy honestly
[14:45:36] quazimodo: so useless to help someone understand
[14:45:42] Ox0dea: You were totally for it a moment ago.
[14:45:56] sevenseacat: i see what you did there.
[14:46:03] Ox0dea: quazimodo: You should familiarize yourself with the monad laws.
[14:46:18] [k-_: what are the laws again? :o
[14:46:25] Ox0dea: They differ between monads.
[14:46:27] sevenseacat: do not talk about monad.... what.
[14:46:32] quazimodo: Ox0dea: endofunctor + 2 natural transforms yes yada yada
[14:46:40] havenwood: The first rule of Monad club?
[14:46:45] quazimodo: i even know how bind can be built from join and i know what return is
[14:47:03] Ox0dea: quazimodo: You should work on condensing your understanding of those operations into something much less technical.
[14:47:05] [k-_: m a >>= id = return
[14:47:15] Ox0dea: That is, if it's your intention to explain them to people who don't do a lot of math.
[14:47:35] quazimodo: Ox0dea: tbh i wish i did understand them better, i won't be able to explain it till i understand it better
[14:48:22] quazimodo: i don't yet know how a dude figured that an action could happen during the ??creation?? of a monad
[14:48:53] quazimodo: you know what i mean ( i think )
[14:49:06] [k-_: Ox0dea knows all
[14:50:04] shevy: hey [k-_ do you think that this is a valid mode of action for ruby gems to pursue: http://shevegen.square7.ch/LOAD_ALL_THE_THINGS.jpg
[14:50:23] Ox0dea: Tom Stuart gave a talk where he implemented a few monads in idiomatic Ruby, and that really helped cement my grokking.
[14:50:51] [k-_: what do you mean by all
[14:51:15] shevy: all gems!
[14:51:25] shevy: everything
[14:51:52] [k-_: what do you mean?!
[14:52:02] [k-_: loading all the files at once?
[14:52:10] [k-_: loading all the gems you depend on at once?
[14:52:27] Ox0dea: https://rubygems.org/gems/stdlib
[14:52:30] shevy: damn it... searching on youtube for "ruby" brings up a lot of useless stuff... apparently there is even a singer with that name
[14:52:36] Ox0dea: They really ought to have made that load the entire standard library. :/
[14:54:01] pontiki: Ox0dea: have you tried doing that yet?
[14:54:07] shevy: lol a Banana Piano with ruby https://www.youtube.com/watch?v=t2jL0OrpILw
[14:54:26] quazimodo: Ox0dea: to me a monad is an endofunctor and 2 natural transformations. So i don't really get how Maybe is a monad. Perhaps Maybe + join + return == monad
[14:54:27] shevy: [k-_ nono just load aaaaall the things. all of them. load all of them. all. :)
[14:54:39] quazimodo: Maybe, fmap, join and return
[14:54:47] shevy: Maybe this will work
[14:55:02] [k-_: install all the gems, and load them all?
[14:56:34] [k-_: that will take forever
[15:00:24] shevy: aww that talk is fun. "We believe it is time to bring Ruby and Robots together." he pronounced it in a funny way though, "Ruby and Rubots"
[15:03:06] scruple: has joined #ruby
[15:07:13] simplyianm: has joined #ruby
[15:07:17] quazimodo: does Volt use event machine or similar?
[15:07:27] quazimodo: how does it keep all the webosckets connection alive?
[15:08:20] hotpancakes: has joined #ruby
[15:08:30] Rubie: has joined #ruby
[15:09:05] kobain: has joined #ruby
[15:09:40] pothibo: has joined #ruby
[15:09:41] freerobby: has joined #ruby
[15:13:35] Soda: has joined #ruby
[15:14:21] xxneolithicxx: has joined #ruby
[15:15:50] quazimodo: how does volt work
[15:15:52] quazimodo: i can't find
[15:16:50] [k-_: quazimodo: i think there are youtube videos
[15:17:00] [k-_: its in one of the conf videos
[15:17:10] [k-_: the presenter does a little demonstration
[15:17:16] [k-_: or did i mess that up with jubilee
[15:17:52] dorei: has joined #ruby
[15:20:00] cashnguns: quazimodo I liked Rick Carlino's explanations of volt https://www.youtube.com/watch?v=th0UKrSFdo0
[15:20:13] cashnguns: hes got a couple videos
[15:21:11] athos_diddy: has joined #ruby
[15:22:28] ItSANgo_: has joined #ruby
[15:22:52] rbennacer: has joined #ruby
[15:23:47] havenwood: [k-_: https://github.com/voltrb/volt/blob/014e5651dc394c3d00525d7b21e0cf55abdc6003/lib/volt/tasks/dispatcher.rb#L22-L24
[15:24:06] havenwood: [k-: https://github.com/ruby-concurrency/concurrent-ruby
[15:25:12] quazimodo: jubilee looks very promising
[15:25:21] Zackio: has joined #ruby
[15:25:21] quazimodo: volt.. i dont know
[15:25:28] quazimodo: they chose mongo over postgres :/
[15:26:02] peter_paule: has joined #ruby
[15:26:23] BLuEGoD: has joined #ruby
[15:26:23] quazimodo: i just wanna know if volt's using reactor pattern concurrency or not
[15:26:49] havenwood: quazimodo: Oh, it wasn't [k- asking... It was you!
[15:27:14] [k-_: yes havenwood?
[15:27:15] havenwood: quazimodo: It uses the concurrent-ruby gem.
[15:27:43] havenwood: [k-: Never mind, I haven't had coffee. Fixing that now!
[15:27:45] quazimodo: i never heard of it
[15:27:53] quazimodo: somany gems/ideas
[15:29:13] doerteDev: has joined #ruby
[15:29:13] ItSANgo: has joined #ruby
[15:29:24] dcarmich: has joined #ruby
[15:30:11] quazimodo: i wonder why i'd never heard of concurrent-ruby
[15:30:35] ItSAN____: has joined #ruby
[15:30:58] pontiki: of the hundreds of thousands of gems on rubygems, have you heard of most of them? :D
[15:31:06] blue_deref: has joined #ruby
[15:31:32] quazimodo: pontiki: lol no but, for example, celluloid pops up *all the time*
[15:31:43] quazimodo: and yet if concurrent-ruby exists and does actors...
[15:31:50] quazimodo: just never heard of it is all
[15:33:23] RegulationD: has joined #ruby
[15:33:29] pontiki: it doesn't show up in ruby-toolbox under concurrent programming
[15:34:15] dionysus69: has joined #ruby
[15:34:26] simplyianm: has joined #ruby
[15:34:45] pontiki: it's listed in background-jobs
[15:37:39] havenwood: pontiki: There's a proposed change to put it in the proper category.
[15:38:13] havenwood: pontiki: https://www.ruby-toolbox.com/modifications/1679
[15:40:43] Ox0dea: pontiki: Singular.
[15:42:34] antgel: has joined #ruby
[15:43:30] quazimodo: havenwood: you use it?
[15:43:38] quazimodo: it it going to be the next rails :P
[15:44:53] havenwood: quazimodo: Volt?
[15:44:55] [k-_: havenwood is just very good at searching through codebases and documentation
[15:45:33] havenwood: quazimodo: Or concurrent-ruby?
[15:45:48] pontiki: rails 5 is going to be the next rails :>
[15:46:02] pontiki: put on your backpack
[15:46:59] Al3ks: has joined #ruby
[15:47:07] shevy: pontik is having a great day
[15:47:53] bf4: has joined #ruby
[15:48:39] Polysics: has joined #ruby
[15:49:41] millerti: has joined #ruby
[15:49:45] athos_diddy: ok so this tutorial is recommending three db's on the server, dev, prod and test. one for each enviroment. when saying enviroment they mean three seperate vm's or maybe three versions of the same app?
[15:50:09] pontiki: https://twitter.com/meredithfrost/status/615181364158140416
[15:50:55] [k-_: athos_diddy: i think it means 3 versions
[15:51:30] Rutix: athos_diddy: Depends on how many isolation you want but if it's only a server for db's then 3 db's on the server is fine.
[15:51:37] apeiros: athos_diddy: if you can, then 3 servers
[15:51:44] apeiros: the more separation the better. it's simple.
[15:51:46] woodruffw: has joined #ruby
[15:52:00] athos_diddy: so then maybe i make one server just for db's?
[15:52:07] Rutix: Well yes.
[15:52:20] Rutix: 3 enviorments for the app on the same server is useless
[15:52:41] athos_diddy: that makes sense
[15:52:57] Rutix: Especially prod
[15:53:12] Rutix: that one has to be played with as less as possible since well its production ;p
[15:53:29] apeiros: Rutix: it's not useless. but it's less isolation than on different servers.
[15:53:48] athos_diddy: so i got cloud vm's with one unique ip
[15:53:56] athos_diddy: i can do it with this right
[15:54:06] pothibo: has joined #ruby
[15:54:26] freerobby: has joined #ruby
[15:54:35] athos_diddy: just setup another vm with ubuntu just for the db's
[15:54:52] Rutix: apeiros: Well yes. But I can't think of any situation where you want 3 enviroments AND have them run on the same server
[15:55:08] athos_diddy: so one ip maybe 4 vm's, one for db's and three for test, dev, prod
[15:55:22] diegoviola: has joined #ruby
[15:55:22] apeiros: Rutix: we have test, acceptance and staging for smaller apps on the same server
[15:55:27] apeiros: that's 3 envs
[15:55:27] pothibo: I???m trying to install gems on a docker container using a non-root user and I get this Errno::EACCES: Permission denied @ rb_sysopen - /usr/local/bundle/config I am not sure why it needs to look at config file, any idea?
[15:55:32] apeiros: and it's defnitively useful
[15:55:37] apeiros: *definitively
[15:55:57] Rutix: apeiros: Well but you atleast have them seperate from prod ;)
[15:56:11] apeiros: if you can, you always want prod as isolated as possible
[15:56:20] apeiros: all other envs it's just a question of convenience.
[15:56:28] apeiros: and/or risks in specific cases.
[15:56:31] Rutix: I was mostly basing it on the fact he said test, dev, prod
[15:57:00] athos_diddy: so what should i do
[15:57:04] apeiros: but if you lack the resources, it still makes sense to have separate envs for test/dev/prod, even on the same machine
[15:57:28] apeiros: for private projects I usually have staging & prod on the same machine
[15:57:39] apeiros: and dev/test on my local machine
[15:57:54] apeiros: (ok, I admit, for private projects I usually don't have a test at all :D)
[15:57:56] athos_diddy: staging and prod on the same server and dev/test local
[15:57:57] Rutix: for private projects I usually don't have a test
[15:58:32] Rutix: And the projects i do at work don't really work well when ran on the same server. :p
[15:58:41] athos_diddy: ok so dev is local then i just need a production database lol
[15:58:43] hotpancakes: has joined #ruby
[15:58:49] Rutix: but then again Ruby is not my main language so maybe its easier with ruby
[15:59:13] apeiros: rails apps are pretty self contained
[15:59:28] apeiros: and with ruby version managers you can even have different envs run on different ruby versions
[15:59:28] Rutix: athos_diddy: I would just start small and expand when the need is there
[15:59:40] Rutix: apeiros: True
[15:59:44] athos_diddy: my problem today is a rails problem with deployment
[15:59:52] apeiros: so the only trouble really comes from external dependencies. and even those you can solve on sane OSes
[16:00:02] athos_diddy: that's why i'm into db's today i'm having a problem with permissions somehow
[16:00:09] apeiros: stuff like proper version of libxml or imagemagick
[16:01:00] Rutix: I guess some of my private projects just get directly deployed from github
[16:01:10] Rutix: so not even really have a staging ;p
[16:01:49] Sirupsen: has joined #ruby
[16:02:50] Sirupsen: has joined #ruby
[16:03:00] babykosh: has joined #ruby
[16:03:01] apeiros: I have a project which has production and staging branches and deploy on post-receive
[16:03:10] apeiros: so has staging but still deploys on push :D
[16:03:24] Rutix: Ye that's what i meant ;)
[16:03:48] apeiros: back to valaptor
[16:04:01] apeiros: only ~2h left to bring it to usable state today. which is the target.
[16:04:05] apeiros: but I doubt I reach it :-/
[16:04:11] Yiota: has joined #ruby
[16:04:22] Rutix: What's valaptor :p
[16:04:46] bruno-: has joined #ruby
[16:05:12] apeiros: a library with VALue VALidators, adAPTORs and processORs
[16:05:26] Rutix: Ohhh nice name :D
[16:05:33] babykosh: since rss feeds come in many variations is there such s thing as an rss feed service where you can enter multiple rss feeds and get a normalized rss output?
[16:05:46] apeiros: don't steal it! :D
[16:06:14] [k-_: it's better than Jacob XD
[16:08:25] eggoez: has joined #ruby
[16:09:16] FernandoBasso: has joined #ruby
[16:09:58] Rutix: [k-_: Wth does jacob stand for :P
[16:10:17] Yiota: has joined #ruby
[16:10:27] psye: has joined #ruby
[16:10:31] [k-_: apeiros: ^
[16:10:58] apeiros: Rutix: nothing anymore. it used to stand for something when it was a JS only framework. but lost its meaning.
[16:10:59] rickmasta: has joined #ruby
[16:12:13] sfarley: has joined #ruby
[16:12:18] Rutix: apeiros: Javascript Central Offline Bullshit ;3?
[16:12:31] Rutix: Which doesn't even make sense
[16:13:41] apeiros: yes. that's precisely what it meant.
[16:13:51] symm-: has joined #ruby
[16:13:59] apeiros: how did you figure?!? :-O
[16:14:28] Rutix: Glad you dropped it ;d
[16:15:11] babykosh: since rss feeds come in many variations is there such s thing as an rss feed service where you can enter multiple rss feeds and get a normalized rss output?
[16:15:51] Royalb: has joined #ruby
[16:16:01] Rutix: babykosh: You mean a RSS Aggregator?
[16:16:08] Rutix: plenty of those if you google
[16:16:18] Ox0dea: >> require 'corn_flakes'; Data.cerealize!
[16:16:19] ruboto: Ox0dea # => cannot load such file -- corn_flakes (LoadError) ...check link for more (https://eval.in/388754)
[16:16:38] peter_paule: has joined #ruby
[16:16:41] Rutix: babykosh: Also that question could have been answered with one query on google js.
[16:16:49] bking39116: has joined #ruby
[16:16:50] babykosh: @Rutix nope???
[16:17:17] gambl0re: has joined #ruby
[16:17:26] babykosh: @Rutix not a reader
[16:17:47] Rutix: http://chimpfeedr.com/
[16:18:19] jpfuentes2: has joined #ruby
[16:18:34] babykosh: @Rutix I???m looking for something that will normalize the feeds so I can use them in a project
[16:19:01] Rutix: That was not really clear from your question sorry ;p
[16:19:30] babykosh: @Rutix it???s ok
[16:20:38] Rutix: babykosh: Can't you just use the feed-normalizer gem?
[16:21:15] babykosh: does this marvel handle all rss veriations? @Rutix
[16:21:45] babykosh: if so where might I find this wonderful item? @Rutix
[16:22:16] micmus: has joined #ruby
[16:22:58] Channel6: has joined #ruby
[16:24:46] Rutix: babykosh: It did in the past but i see it hasnt been updated in ages
[16:24:52] hyperdrive: has joined #ruby
[16:25:04] Rutix: http://feed-normalizer.rubyforge.org/
[16:25:46] facebook: has joined #ruby
[16:26:15] babykosh: @rutix ah???yes, that 3 years ago last update seems troubling
[16:27:34] Guest73614: has joined #ruby
[16:28:20] Ox0dea: How to XOR two arrays using only a single pass through each?
[16:28:50] Ox0dea: I can't quite see how not to do a third pass of one kind or another.
[16:28:56] bking39116: has joined #ruby
[16:29:28] MrJiks: has joined #ruby
[16:30:52] Ox0dea: Hash arrays a and b, and then check that each key either satisfies (a && !b) or (b && !a), but that's a third pass.
[16:31:16] apeiros: have two hashes. result and already_seen
[16:31:43] apeiros: check in all from a into result and already_seen
[16:31:53] tubuliferous_: has joined #ruby
[16:32:00] apeiros: errr??? wait
[16:32:06] apeiros: sorry. BAC is too high.
[16:32:12] apeiros: but I think the answer lies somewhere there :)
[16:32:48] Ox0dea: I vaguely considered just doing (a | b) - (a & b), but that wouldn't look very good in a proposal.
[16:33:08] Ox0dea: It's essentially three walks given how efficiently rb_ary_and and rb_ary_or are implemented, but it still feels cheap.
[16:33:35] apeiros: let me see whether I can answer that question after a bottle of 25% vodka :)
[16:33:44] Ox0dea: I like my odds.
[16:34:07] Ox0dea: I'd like to fix my patch before Japan wakes up. :X
[16:34:20] Ox0dea: It's broken for even counts of repeated elements in the second array. :(
[16:34:58] etqqkoiflwhb: has joined #ruby
[16:35:01] pothibo: has joined #ruby
[16:35:01] Pupeno: has joined #ruby
[16:35:18] apeiros: yupp, solution was somewhere there
[16:35:20] rbennacer: has joined #ruby
[16:35:25] apeiros: but you have to translate it to C :)
[16:36:31] apeiros: let me check whether what I did works. but it only .each'es a & b once each.
[16:36:58] Muhannad: has joined #ruby
[16:37:03] Ox0dea: That certainly sounds like a solution. Of course, diffing the keys at the end would be a third pass.
[16:37:44] apeiros: there's no diffing
[16:38:02] apeiros: do you consider Hash#keys to be a pass?
[16:38:06] apeiros: if so, that'd be a second
[16:38:20] Ox0dea: a.each, b.each, result.keys is three passes.
[16:38:33] apeiros: (I conder a.each + b.each to be a single pass - one pass through all elements)
[16:38:40] Ox0dea: It's not, though.
[16:39:06] apeiros: then I doubt it can be done with less than 3 passes
[16:39:18] Ox0dea: Yep, I think that might be the case.
[16:39:22] apeiros: note that a | b alone is 3 passes per your def
[16:39:40] apeiros: so (a | b) - (a & b) is 9 passes
[16:40:07] Ox0dea: Eh, I guess #keys oughtn't really count as a pass.
[16:40:19] apeiros: `TypeError: Enumerable is not a class` lelele
[16:40:36] apeiros: Ox0dea: it might. depending on how Hash is implemented, it has to traverse to extract the keys.
[16:41:06] KetaPan: has joined #ruby
[16:41:08] Ox0dea: Right, I just mean under the semantics I'm using to force myself to write this function as similarly to the existing set-likes as possible.
[16:41:33] apeiros: hm, it works, but due to an optimization fails to keep order
[16:41:36] apeiros: undoing opt.
[16:41:47] Ox0dea: They all convert one of the arrays to a hash immediately, traverse the other, store the necessary info in a single hash, and then return that hash's keys at the end.
[16:42:15] Ox0dea: It really feels like that contract can't be met for XOR, but it's hard to say exactly why.
[16:42:22] Ox0dea: Something about the exclusivity of the thing.
[16:42:31] apeiros: Ox0dea: drunk code: https://gist.github.com/apeiros/b1176723546f7271be60
[16:43:24] apeiros: use .key? in the conditions instead of []
[16:43:27] peter_paule: has joined #ruby
[16:43:52] apeiros: updated https://gist.github.com/apeiros/b1176723546f7271be60
[16:44:48] Ox0dea: No need for Ruby details; I've gotta use these crazy st.h macros.
[16:44:58] lkba: has joined #ruby
[16:44:59] enebo: has joined #ruby
[16:45:15] Ox0dea: But yes, this does do the trick. My many thanks!
[16:46:13] apeiros: ACTION drunk code champion :D
[16:46:17] mcclurmc: has joined #ruby
[16:47:18] GitGud: has joined #ruby
[16:48:02] platzhirsch: has joined #ruby
[16:48:03] platzhirsch: has left #ruby: ()
[16:51:42] yardenbar: has joined #ruby
[16:53:15] simplyianm: has joined #ruby
[16:53:16] haroldwu: has joined #ruby
[16:53:34] bf4: has joined #ruby
[16:54:46] shevy: what the...
[16:55:21] jas02_: has joined #ruby
[16:55:54] s2013: has joined #ruby
[16:56:28] Guest79385: has joined #ruby
[16:58:01] havenwood: Guest79385: hi
[17:00:13] StanAlanMcM: has joined #ruby
[17:00:18] Ox0dea: apeiros: Mind if I cite @apeiros?
[17:00:35] apeiros: but not sure whether you should say it's drunk code :D
[17:00:39] StanAlanMcM: has joined #ruby
[17:00:40] Ox0dea: I was going to. ^_^
[17:00:50] apeiros: go ahead :-D
[17:01:39] StanAlanMcM: I'm trying to learn more about Ruby. I figure this is the place to ask questions that google hasn't been able to help with.
[17:02:07] varunwachaspati: has joined #ruby
[17:02:17] apeiros: stanalanmcm: yupp
[17:02:45] apeiros: o/ manveru
[17:02:48] apeiros: long time no see :D
[17:02:48] shevy: ack, manveru is alive and not a zombie!
[17:02:57] apeiros: shevy: we can't be sure yet!
[17:03:04] apeiros: manveru: do you crave brains? o0
[17:03:14] shevy: he smiles like a zombie!
[17:03:15] manveru: i still have my own, no thanks
[17:03:21] manveru: maybe later
[17:03:29] shazaum_: has joined #ruby
[17:03:30] apeiros: ok, maybe he's a smart zombie.
[17:03:37] StanAlanMcM: I have two classes. I want each class to access the same array. I don't know how to do this. The goal is to have a method in each class which iterates through the same array. Does that make sense?
[17:03:42] hotpancakes: has joined #ruby
[17:03:58] apeiros: stanalanmcm: just pass the same array to both classes in the constructor
[17:04:21] apeiros: but it's hard to say what to do best without knowing what you ultimately try to achieve
[17:04:24] shevy: you could actually put the array into a module; or you could use a constant in one class, and access to that content. or as apeiros wrote. lots of ways
[17:04:29] manveru: anyone familiar with url templates? trying to figure out how to write a template that matches both http and https
[17:04:38] sarkyniin: has joined #ruby
[17:06:21] StanAlanMcM: hmm. What if the array is a list of objects made from one of the two classes?
[17:06:21] xxneolithicxx: has joined #ruby
[17:06:59] apeiros: stanalanmcm: how about you don't feed us tiny bits?
[17:07:06] apeiros: and instead show us what you want to do
[17:07:24] bking39116: has joined #ruby
[17:07:50] StanAlanMcM: I'm not trying to feed you tiny bits. I don't really understand what I'm trying to do. I could show you my source and attempt to explain the goal. Would that help?
[17:08:04] apeiros: yes. tremendously even :)
[17:08:20] havenwood: ACTION chants "Show the code! Show the code!"
[17:08:35] manveru: code the show!
[17:08:36] charliesome: has joined #ruby
[17:09:01] havenwood: What do we want? Code! When do we want it? Time.now!
[17:09:16] diegoviola: has joined #ruby
[17:09:21] apeiros: I get the feeling I'm not the only drunk. good.
[17:09:32] apeiros: code must go n!
[17:09:41] StanAlanMcM: Ok, this is my repo. Only the classes have code. Everything is is disjointed testing that I need to clean up. lolz. https://github.com/mcmillanator/2.4-Zwitter/tree/dev/classes
[17:10:17] jas02_: has joined #ruby
[17:10:21] StanAlanMcM: The goal is to create a twitter like program. Zombies are our users.
[17:10:32] apeiros: stanalanmcm: easy. we're decent people. we will wait with laughing until you're gone.
[17:10:42] Ox0dea: >> Time.now.to_a
[17:10:43] ruboto: Ox0dea # => [42, 10, 17, 28, 6, 2015, 0, 179, false, "UTC"] (https://eval.in/388792)
[17:10:47] Ox0dea: Name the elements without cheating.
[17:11:06] bougyman: confused manveru. what does a template have to do with the uri scheme?
[17:11:09] allomov: has joined #ruby
[17:11:10] manveru: fun fact: `puts zombies` is usually the same as `zombies.each{|zombie| puts zombie }`
[17:11:23] ItSANgo_: has joined #ruby
[17:11:32] apeiros: fun fact: I like p *zombies
[17:11:40] apeiros: but nowadays it needs an additional ;0
[17:11:44] apeiros: which is annoying as hell :(
[17:12:08] lavros: has joined #ruby
[17:12:09] manveru: bougyman: well, i'm trying to avoid having to specify both interpolation format string and a matching regex
[17:12:13] shevy: zombies ... hell ...
[17:12:24] marr: has joined #ruby
[17:12:25] StanAlanMcM: The part I'm stuck on is creating a following for each zombie. So, zombie bob wants to follow zombie joe. I have all zombies in an array of objects. I was thinking I could iterate through that array to get all of joe's tweets for bob. Makes sense?
[17:12:29] bougyman: i guess I don't understand the problem space.
[17:12:29] manveru: using a url template would allow me to do that... but looks like i'd have to write 3-4 versions for each url
[17:12:56] manveru: well, easy: trying to provide users a way to give me urls for social networks
[17:13:18] manveru: i'm classifying the url, allowing them to give me only the username, https/http/plain host, etd
[17:13:52] bougyman: why don't you leverage URI for this?
[17:14:05] StanAlanMcM: It's ok if you want to make fun. :D I'm a student and this is my homework project. My instructor encourages us to seek help.
[17:14:13] Ox0dea: >> %w[json yaml].each(&method(:require)); [JSON, YAML]
[17:14:14] ruboto: Ox0dea # => [JSON, Psych] (https://eval.in/388796)
[17:14:49] bougyman: we have similar inputs for integrations and i just let URI do the work.
[17:14:55] bougyman: validation and formatting and such.
[17:15:22] _blizzy_: has joined #ruby
[17:15:23] Ox0dea: apeiros: Does Valaptors handle URIs out of the box?
[17:15:39] manveru: i'm using Addressable::URI and Addressable::Template :)
[17:15:51] manveru: but yeah, i can normalize them before parsing them
[17:15:52] apeiros: Ox0dea: not in the first iteration.
[17:16:03] apeiros: Ox0dea: there's a resolver for domain names in it already for email addresses, though.
[17:16:04] alphaatom: has joined #ruby
[17:16:21] apeiros: and a domain name validator (for the same purpose)
[17:16:52] apeiros: and I'll probably only ever add http/https uri validators
[17:16:55] NomePadrao: has joined #ruby
[17:17:19] Ox0dea: apeiros: Validating the domain isn't sufficient for email addresses.
[17:17:27] apeiros: Ox0dea: orly?
[17:17:35] peter_paule: has joined #ruby
[17:17:35] apeiros: damn! now I have to throw away all of it!
[17:18:17] Axy: has joined #ruby
[17:18:28] Ox0dea: I mean, don't you have to verify the MX record to actually ensure a mailbox can be delivered to?
[17:19:03] apeiros: you can't ensure you can deliver to a mailbox
[17:19:16] RegulationD: has joined #ruby
[17:19:16] Ox0dea: This I did not know.
[17:19:18] apeiros: I verify the presence of an MX, A or AAAA record (those are used for delivery)
[17:19:48] apeiros: and I verify that the email address is syntactically valid, but actually disallowing a couple of technically valid notations
[17:20:09] Ox0dea: I don't think the A and AAAA records have any bearing on mail delivery.
[17:20:28] snsei: has joined #ruby
[17:20:47] apeiros: they do. MX record is not mandatory.
[17:21:03] jas02_: has joined #ruby
[17:21:12] lxsameer: has joined #ruby
[17:21:12] lxsameer: has joined #ruby
[17:21:26] Ox0dea: A => Address, MX => Mail eXchange.
[17:21:42] Ox0dea: TCP/IP is hard; let's go shopping.
[17:21:58] rbennacer: has joined #ruby
[17:21:59] apeiros: yes. still, the MTA is not resolved through MX alone. If an MX is present, it is used. but as said, it is not necessary.
[17:22:31] manveru: while there may be some that bail on missing MX... i'm quite sure that's not required...
[17:22:34] jhass: apeiros: you resolve CNAME chains prior I hope
[17:22:34] MilleJamille: has joined #ruby
[17:22:37] mcclurmc: has joined #ruby
[17:23:12] Scroff: has joined #ruby
[17:23:24] Ox0dea: apeiros: You're not planning on disqualifying email addresses with comments in, are you?!
[17:23:32] Ox0dea: That's, like, one of the best things CERN ever gave us.
[17:23:44] apeiros: ???Only resolvable, fully-qualified, domain names (FQDNs) are permitted when domain names are used in SMTP. In other words, names that can be resolved to MX RRs or A RRs???
[17:23:57] apeiros: somewhere that's updated to also include AAAA iirc
[17:24:04] apeiros: don't make me look that shit up again :D
[17:24:17] apeiros: I'm pretty sure end result was "domain must have MX, A or AAAA"
[17:24:37] jhass: nah, CNAME is valid and then the target must have either of those
[17:24:46] jhass: note a CNAME allows no other records besides it
[17:24:52] apeiros: ah fuck me. make a pull request if you use valaptor and need that :-p
[17:24:58] apeiros: or open a ticket and quote sources.
[17:25:14] jhass: well, a good resolver should resolve the CNAME chain for you if you ask it for an A, AAAA, MX
[17:25:36] apeiros: is stdlib Resolv a good resolver?
[17:25:38] IanV0rn: has joined #ruby
[17:25:41] jhass: I have no idea
[17:25:51] s2013: has joined #ruby
[17:25:58] MilleJamille: has joined #ruby
[17:26:42] manveru: is resolv anything more than a resolv.h wrapper?
[17:27:04] manveru: can we talk about something more fun than mail?
[17:27:14] Ox0dea: >> % wtf .length
[17:27:15] ruboto: Ox0dea # => 3 (https://eval.in/388799)
[17:27:35] apeiros: manveru: impossibru, nothing is more fun than smtp
[17:27:54] jhass: telnet perhaps
[17:29:01] manveru: i was trying so hard _not_ to say it :(
[17:29:44] manveru: how's the gopherization of the interweb going?
[17:29:57] rbennacer: has joined #ruby
[17:30:14] Ox0dea: manveru: Surely you mean JavaScribbling?
[17:30:52] manveru: you can now even use gopher on your PDAs
[17:31:12] Ox0dea: >> Time.now.year
[17:31:13] ruboto: Ox0dea # => 2015 (https://eval.in/388800)
[17:31:14] Ox0dea: Just making sure.
[17:32:34] KetaPan: has left #ruby: ()
[17:34:00] manveru: gopher://gopher.floodgap.com/1/overbite/install/android
[17:34:02] manveru: there you go
[17:34:03] pontiki: ACTION wonders what Ox0dea was preparing to do if it came back with something else....
[17:35:04] apeiros: Ox0dea: https://gist.github.com/apeiros/0ae1cafa570c977068c0 that's the current validator for email addresses. non-final, mind you.
[17:35:04] vyorkin: has joined #ruby
[17:35:32] Ox0dea: ACTION glares at Line 13.
[17:35:37] Agoldfish: has joined #ruby
[17:35:52] apeiros: Ox0dea: why? you love email addresses with comments in them? :)
[17:35:58] havenwood: has joined #ruby
[17:36:33] Ox0dea: I think they're a great idea. :P
[17:37:02] Ox0dea: apeiros: Surely the spec doesn't say that a domain is any sequence of one or more non-asperands?
[17:37:04] apeiros: yeah??? when I read the email bnf I wanted to get my bat and find the author???
[17:37:06] zenguy_pc: has joined #ruby
[17:37:15] Ox0dea: That might well be TBL.
[17:37:26] apeiros: non-asperands?
[17:37:39] j4cknewt: has joined #ruby
[17:38:13] Ox0dea: Scratch that; I did not in my sleepless stupor immediately realize that these constituent parts are eventually glued together.
[17:38:15] gregf: has joined #ruby
[17:38:32] apeiros: AddrSpec is the relevant resulting regex ;-)
[17:38:45] toretore: has joined #ruby
[17:38:45] apeiros: but the Domain part is verified seperately
[17:40:18] Ox0dea: Any reason to explode match.captures on L84?
[17:40:42] apeiros: I prefer to be explicit. even if ruby does it implicitly.
[17:40:50] apeiros: (a feature I actually dislike)
[17:40:51] Scroff: has joined #ruby
[17:41:03] Ox0dea: In that case, where are the square brackets? ;P
[17:41:17] apeiros: I think you need sleep
[17:41:24] Ox0dea: Also, you most definitely want #bytesize down there.
[17:42:12] apeiros: I'm not sure. I think I scanned the spec and didn't see whether it was characters or bytes. and non-ascii is allowed iirc.
[17:42:22] apeiros: so if it's characters, it's .size, not .bytesize
[17:42:33] Ox0dea: It's a very old spec, is it not?
[17:42:39] apeiros: it has been updated
[17:42:48] apeiros: Utf8Tail was not in the original spec f.ex.
[17:43:08] apeiros: also there had been errata. really annoying to check all errata and figure whether they apply to anything you use???
[17:43:24] charliesome: has joined #ruby
[17:43:28] apeiros: as nice as it is that rfc's exist at all, their presentation is *horrible*.
[17:43:59] Ox0dea: They're like the unpleasant spawn of office memorandums and man pages.
[17:44:26] apeiros: it'd be much less horrible if there was an up-to-date document where all errata have been applied to.
[17:44:37] RobertBirnie: has joined #ruby
[17:45:14] michael_mbp: has joined #ruby
[17:45:22] antgel: has joined #ruby
[17:45:48] _blizzy_: has joined #ruby
[17:45:59] Ox0dea: Heh. 2549 has errata.
[17:46:04] Ox0dea: (I had to check.)
[17:46:28] Ox0dea: Is there really no central errata file?
[17:46:38] apeiros: I didn't find it
[17:46:41] Ox0dea: It seems an easy enough thing to scrape together.
[17:46:43] apeiros: but tbh, I didn't really spend time looking
[17:46:46] last_staff: has joined #ruby
[17:47:15] apeiros: there's also https://pretty-rfc.herokuapp.com
[17:47:38] Scroff: has joined #ruby
[17:48:03] peter_paule: has joined #ruby
[17:48:41] JoshGlzBrk: has joined #ruby
[17:48:50] RobertBirnie: has joined #ruby
[17:48:52] pothibo: has joined #ruby
[17:48:53] troulouliou_dev: has joined #ruby
[17:49:21] hotpancakes: has joined #ruby
[17:49:28] pothibo: In what circumstances does bundler needs to check for /usr/local/bundle/config ? I have an issue with Bundler in Docker and it looks at that file and I want it not to
[17:50:26] WeZZard: has joined #ruby
[17:50:27] apeiros: oh dear, I should parametrize DNS resolving if I move it to utilities. atm it is hard-coded for MX, A and AAAA???
[17:51:15] Yiota: has joined #ruby
[17:51:21] alphaatom: has joined #ruby
[17:51:54] DLSteve: has joined #ruby
[17:53:04] Cyclohexane: How do I get more output from this system('mysql', *mysql_args, config['database'], in: db_file_name) ?
[17:54:00] hyperdrive: has joined #ruby
[17:54:17] Cyclohexane: well then, turns out 'mysql' isn't installed
[17:55:33] Ox0dea: apeiros: For what it's worth, I was unable to find anything about AAAA being a valid fallback in the absence of an MX record.
[17:56:00] Ox0dea: Do you happen to vaguely recall the source on that?
[17:56:52] lkba_: has joined #ruby
[17:56:55] hotpancakes: has joined #ruby
[17:57:07] Scroff: has joined #ruby
[17:57:19] jhass: Ox0dea: I could imagine it's somewhere in some RFC errata, but the fallback to A definitely exists and then the fallback to AAAA is implied for IPv6 capable systems
[17:57:34] hotpancakes: has joined #ruby
[17:57:50] apeiros: Ox0dea: no idea. it might even be in some documents how actual MTAs behave.
[17:57:53] Ox0dea: Makes perfect sense.
[17:58:00] apeiros: because - sadly - not everything follows specs :(
[17:58:08] apeiros: (cf IRC, huehuehue)
[17:59:29] Rollabunna: has joined #ruby
[17:59:53] Yiota: has joined #ruby
[18:00:43] rbennacer: has joined #ruby
[18:01:01] sfarley: has joined #ruby
[18:04:19] diego1: has joined #ruby
[18:06:01] MasterPiece: has joined #ruby
[18:06:42] simplyianm: has joined #ruby
[18:07:28] fantazo: has joined #ruby
[18:07:52] diego1: has joined #ruby
[18:08:00] craysiii: has joined #ruby
[18:08:29] mcclurmc: has joined #ruby
[18:09:10] memph1s: has joined #ruby
[18:09:53] diego2: has joined #ruby
[18:10:01] foureight84: has joined #ruby
[18:10:03] Scroff: has joined #ruby
[18:10:07] jamesaxl: has joined #ruby
[18:10:26] sphex: Ox0dea: didn't follow the whole conversation, but nowadays it's a good idea to follow getaddrinfo()-like behavior (that is, try to connect to all the record types for the supported address families) for pretty much everything, including SMTP prolly. after resolving the MX, existing MTAs follow this behavior (and prolly do the same thing if there's no MX).
[18:10:59] Scroff: has joined #ruby
[18:11:02] Yiota: has joined #ruby
[18:11:24] zacts: ruby my dear
[18:11:37] zacts: you are so fabulous ruby, let me tell you. you rock
[18:13:39] roolo: has joined #ruby
[18:14:10] sphex: zacts: I know I know, but.. let's not.. make this weird :p
[18:14:50] NeverDie: has joined #ruby
[18:15:15] Ox0dea: sphex: Sure, "be liberal with what you accept" and all that. It still "feels" off, but I know it's these little bendings of the rules that're holding the madness together.
[18:15:46] Ox0dea: zacts: Favorite Ruby feature, go!
[18:16:53] Ox0dea: Your answer should've been instinctual; you do not yet have a favorite Ruby feature, padawan.
[18:16:55] bubbys: has joined #ruby
[18:17:31] Carnage\: has joined #ruby
[18:18:17] sphex: ACTION points at zacts and screeches
[18:18:29] zacts: ACTION cries
[18:18:37] zacts: I was just trying to say ruby is cool
[18:18:51] rickmasta: has joined #ruby
[18:20:03] tubuliferous_: has joined #ruby
[18:21:05] alphaatom: has joined #ruby
[18:21:36] Yiota: has joined #ruby
[18:22:12] bubbys: has joined #ruby
[18:22:17] alphaatom: has joined #ruby
[18:22:28] s2013: has joined #ruby
[18:23:27] sankaber: has joined #ruby
[18:23:33] shevy: what is with sundays
[18:23:39] shevy: are people in general more drunk then?
[18:24:01] zacts: shevy: I just woke up
[18:24:43] shevy: ok so it's saturday night alcohol leftover :)
[18:25:04] yqt: has joined #ruby
[18:25:28] wasamasa: night fever!
[18:25:54] wasamasa: that argumentation wouldn't work if you were a cat BTW
[18:26:41] bubbys: has joined #ruby
[18:28:21] wasamasa: ACTION has a very sleepy one between his legs
[18:28:42] JCOE: has joined #ruby
[18:30:40] shevy: yesterday was caturday
[18:32:22] learath: has left #ruby: ()
[18:32:54] yqt: has joined #ruby
[18:33:18] Scroff: has joined #ruby
[18:34:18] alphaatom: has joined #ruby
[18:36:55] GitGud: has joined #ruby
[18:38:39] Cache_Money: has joined #ruby
[18:40:16] alphaatom: has joined #ruby
[18:41:26] renderful: has joined #ruby
[18:41:30] Yiota: has joined #ruby
[18:41:31] charliesome: has joined #ruby
[18:42:24] sarkyniin: has joined #ruby
[18:42:32] craysiii: has joined #ruby
[18:42:37] zacts: I don't drink alchohol
[18:42:51] multi_io: has joined #ruby
[18:42:54] zacts: but I did wake up to my cat who pissed in my closet
[18:42:59] alphaatom: has joined #ruby
[18:43:10] zacts: anyway, got to eat so bbl
[18:43:12] shevy: isn't that a happy way to wake up
[18:43:22] zacts: shevy: not my cats, trust me
[18:43:27] Muhannad: has joined #ruby
[18:43:34] zacts: but my mum has a wild ferral cat or whatever she got as a stray
[18:43:40] zacts: and no-one else will take them
[18:44:18] shevy: teach it some ruby
[18:44:26] shevy: to make it a better cat... one that won't piss into the closet
[18:44:33] Ox0dea: Cats should learn LOLCODE.
[18:44:58] bougyman: cats invented lolcode
[18:44:59] Ox0dea: It follows naturally that dogs should be taught how to program in Dogescript.
[18:45:00] alphaatom: has joined #ruby
[18:45:03] Ox0dea: bougyman: It is known.
[18:45:04] Muhannad: has joined #ruby
[18:46:16] Muhannad: has joined #ruby
[18:46:42] startupality: has joined #ruby
[18:49:24] Muhannad: has joined #ruby
[18:49:27] Omilun: has joined #ruby
[18:49:28] alphaatom: has joined #ruby
[18:49:46] wildroman2: has joined #ruby
[18:50:22] Omilun: hello i have a problem ... i can not use irb ... initialize
[18:50:30] Omilun: http://paste.debian.net/263620/
[18:50:31] drewo: has joined #ruby
[18:51:23] alphaatom: has joined #ruby
[18:52:28] Ox0dea: Omilun: Just `irb` to start, then you'll be at an interactive prompt into which you type code to be evaluated.
[18:53:29] Omilun: Ox0dea: for ammm ... can u say exampel?
[18:54:51] idafyaid: has joined #ruby
[18:54:54] alphaatom: has joined #ruby
[18:55:55] Ox0dea: Omilun: https://asciinema.org/a/2t96c7e53t9o483y91brr1v0s
[18:56:07] Omilun: Ox0dea: thx
[19:04:53] charliesome: has joined #ruby
[19:05:18] SCHAAP137: Omilun: it looks like you were already in irb
[19:08:07] sfarley: has joined #ruby
[19:08:14] RegulationD: has joined #ruby
[19:09:04] knite: has joined #ruby
[19:12:07] hardye: has joined #ruby
[19:12:18] ubuntu_: has joined #ruby
[19:12:20] ubuntu_: Hey guys, I'm getting a `step': UNIQUE constraint failed: words.word (SQLite3::ConstraintException) error even though all I am doing is a select statement
[19:12:26] ubuntu_: Also, I'm running this through ruby-sqlite3 and when the exact same query is ran directly through sqlite3, it works
[19:15:37] nofxx: has joined #ruby
[19:16:19] kraljev11: has joined #ruby
[19:18:17] Versality: has joined #ruby
[19:20:39] Al3ks: has joined #ruby
[19:21:54] bf4: has joined #ruby
[19:22:10] drewo: has joined #ruby
[19:23:08] pwnz0r: has joined #ruby
[19:23:59] havenwood: has joined #ruby
[19:24:23] peter_paule: has joined #ruby
[19:25:20] charliesome: has joined #ruby
[19:25:50] Rollabunna: has joined #ruby
[19:26:56] eggoez: has joined #ruby
[19:27:09] mcclurmc: has joined #ruby
[19:27:21] Ox0dea: ubuntu_: The two operations are obviously not being run on the same data.
[19:28:15] Ox0dea: ubuntu_: That error means you're trying to add a word to the words column that already exists there, thus breaking the uniqueness constraint, which I would assume you placed there on purpose.
[19:28:43] Ox0dea: The words table, rather.
[19:28:49] Omilun: has left #ruby: ()
[19:29:02] allomov: has joined #ruby
[19:29:13] mrmargolis: has joined #ruby
[19:31:29] lavros: has joined #ruby
[19:32:52] charliesome: has joined #ruby
[19:32:57] dseitz: has joined #ruby
[19:33:00] kraljev11: has joined #ruby
[19:33:02] hotpancakes: has joined #ruby
[19:37:04] IanV0rn: has joined #ruby
[19:39:44] blackmesa: has joined #ruby
[19:40:39] yqt: has joined #ruby
[19:42:17] hotpancakes: has joined #ruby
[19:42:19] Guest73614: has joined #ruby
[19:43:00] hotpancakes: has joined #ruby
[19:43:47] hololeap: has joined #ruby
[19:44:27] hololeap: is there a shorthand for `if obj.respond_to? :a_method and obj.a_method` ?
[19:44:47] iamninja: has joined #ruby
[19:44:54] alphaatom: has joined #ruby
[19:45:21] Ox0dea: hololeap: Nothing you should actually use.
[19:45:25] apeiros: hololeap: you do know that `if obj.respond_to? :a_method and obj.a_method` does not do what you think it does?
[19:45:43] apeiros: and no, there's no shorthand for it in plain ruby.
[19:45:56] hololeap: apeiros: ok, but what do you mean about the first part?
[19:46:06] Ox0dea: hololeap: `and` is not the same as `&&`.
[19:46:13] Azure: has joined #ruby
[19:46:15] Ox0dea: It is, in fact, very different.
[19:46:22] hololeap: i understand that
[19:46:55] apeiros: oh, actually it parses in the order you expected it
[19:47:15] apeiros: ah right, in assignment it'll not.
[19:47:48] spider-mario: has joined #ruby
[19:48:01] s2013: has joined #ruby
[19:48:13] fantazo: has joined #ruby
[19:48:56] casadei: has joined #ruby
[19:50:20] Ox0dea: hololeap: Have you considered nicking Object#try from ActiveSupport?
[19:53:23] hololeap: Ox0dea: that's kind of what i was looking for (and i am using that in my current project), but i need to check if the object responds to a method before calling it, but i in this line of code the i know with certainty that the object won't be nil
[19:54:18] Ox0dea: Famous last words. :)
[19:54:32] hololeap: so i don't see how i would use .try in this case. it was silly of me to think there woiuld be a shorthand for it :)
[19:54:40] snsei: has joined #ruby
[19:54:54] armyriad: has joined #ruby
[19:55:55] blackmesa: has joined #ruby
[19:56:22] nofxx: Object#methods is not ruby core is it? Got so many debug gems
[19:56:35] Ox0dea: Of course it is.
[19:56:40] CustosLimen: has joined #ruby
[19:56:45] Ox0dea: >> Object.methods.grep(/methods/)
[19:56:46] ruboto: Ox0dea # => [:instance_methods, :public_instance_methods, :protected_instance_methods, :private_instance_methods ...check link for more (https://eval.in/388809)
[19:56:52] havenwood: >> method(:methods).owner
[19:56:54] ruboto: havenwood # => Kernel (https://eval.in/388810)
[19:56:59] nofxx: you could do obj.methods.include? ahh.. nevermind
[19:57:13] Ox0dea: nofxx: Ctrl-A+K in future. ^_^
[19:58:07] nofxx: Ox0dea, what's that? erc ?
[19:58:16] Ox0dea: nofxx: I was being unnecessarily mean. I apologize.
[19:58:38] drewo: has joined #ruby
[19:58:44] nofxx: Ox0dea, no, ok, just curiosity of the K to clean
[19:58:52] subsonik: has left #ruby: ("Leaving")
[19:59:02] nofxx: irc client
[19:59:14] pwnz0r: has joined #ruby
[19:59:20] Ox0dea: Ctrl-A goes to the beginning of the line, Ctrl-K kills to the end.
[19:59:49] Ox0dea: It was a poorly timed joke, though, as you seem to be at a very important stage of your Ruby learning.
[20:00:33] sandstrom: has joined #ruby
[20:00:47] nofxx: Ox0dea, pardon my french... was just curiosity if you're using erc. I use emacs (and ctrl+a and k's every minute)
[20:00:48] abderian: has joined #ruby
[20:00:54] nofxx: but I dont use erc
[20:00:55] Ox0dea: Yes, you can ask objects all sorts of things about themselves, and they (tend to) give you the results in plain ol' Ruby objects, on which you can apply what you already know to deepen your understanding.
[20:01:29] Ox0dea: nofxx: Ah, I use WeeChat, which does use a lot of Emacs' bindings by default.
[20:01:34] Scroff: has joined #ruby
[20:01:52] nofxx: Ox0dea, hehe, thanks, sorry all the misunderstanding ;)
[20:02:03] Ox0dea: No worries, the fault is entirely mine.
[20:02:13] idafyaid: has joined #ruby
[20:02:30] Ox0dea: >> ObjectSpace.each_object(Class).select { |c| c.instance_methods.include?(:to_a) }
[20:02:31] ruboto: Ox0dea # => [Process::Tms, RubyVM::InstructionSequence, Enumerator::Generator, Enumerator::Lazy, Enumerator, Obj ...check link for more (https://eval.in/388812)
[20:02:38] acke: has joined #ruby
[20:02:46] Ox0dea: >> ObjectSpace.each_object(Class).select { |c| c.instance_methods.include?(:to_a) }.size
[20:02:47] ruboto: Ox0dea # => 18 (https://eval.in/388813)
[20:02:48] Scroff: has joined #ruby
[20:03:15] symm-: has joined #ruby
[20:03:32] zenguy_pc: has joined #ruby
[20:04:27] abderian: Anyone know why when you create an array like this a = Array.new(10, "#" * 10). Changing the first string's first character changes all of strings in the array? For example a[0][0] = "X" will modify all of the strings in the array
[20:05:01] acke_: has joined #ruby
[20:05:22] Ox0dea: abderian: Strings are mutable references in Ruby.
[20:05:49] Ox0dea: >> a = 'foo'; b = a; b[0] = 'b'; a
[20:05:50] ruboto: Ox0dea # => "boo" (https://eval.in/388817)
[20:05:56] phutchins: has joined #ruby
[20:05:57] havenwood: abderian: a = Array.new(10) { "#" * 10 }
[20:06:03] Scroff: has joined #ruby
[20:06:24] Ox0dea: abderian: Enjoy your fish.
[20:06:47] havenwood: abderian: As an argument it will be one String ten times but in a block it will be ten different Strings.
[20:06:54] blackmesa: has joined #ruby
[20:07:01] abderian: oh interesting
[20:07:09] kraljev11: has joined #ruby
[20:07:27] Scroff: has joined #ruby
[20:07:33] nofxx: abderian, to verify this: 'a'.object_id == 'a'.object_id ... try the same with a var, you got it.
[20:08:11] revoohc: has joined #ruby
[20:08:13] tubuliferous_: has joined #ruby
[20:08:18] pwnz0r: has joined #ruby
[20:08:23] abderian: I just would have assumed that the array would be created more along the lines of a[0] = '#' * 10, a[1] = '#' * 10, etc
[20:08:28] nofxx: ah, havenwood gave a better explanation ;)
[20:09:14] s2013: has joined #ruby
[20:09:20] nofxx: abderian, yeah, but now that you know you see ruby is actually being smart. You gave it one object.
[20:09:31] Ox0dea: abderian: That would be wasteful in the event that the programmer did in fact want ten references to the same string.
[20:09:43] nofxx: it's the least surprise that often surprises (of how cool) ;)
[20:10:16] abderian: yeah that makes sense
[20:10:36] havenwood: >> [Array.new(3, rand(1..10)), Array.new(3) { rand(1..10) }]
[20:10:37] ruboto: havenwood # => [[1, 1, 1], [3, 10, 4]] (https://eval.in/388818)
[20:11:01] Ox0dea: abderian: Ruby uses references all over the place in order to avoid unnecessarily copying things around, which helps your program execute more quickly.
[20:11:01] havenwood: >> [Array.new(3, rand(1..10)), Array.new(3) { rand(1..10) }]
[20:11:02] ruboto: havenwood # => [[2, 2, 2], [8, 4, 5]] (https://eval.in/388819)
[20:11:21] havenwood: abderian: ^ the first will always be three of the same
[20:11:32] Scroff: has joined #ruby
[20:11:46] havenwood: abderian: because it's being run once and that one result goes in three times
[20:12:41] abderian: ahh seems like I still have a lot to learn, thanks haven!
[20:13:09] havenwood: ada2358: no prob, you're welcome
[20:13:19] peter_paule: has joined #ruby
[20:13:36] havenwood: abderian: ^
[20:13:42] havenwood: ada2358: Oops misstell. Sry.
[20:14:05] adaedra: how did you do this reversed b
[20:14:39] havenwood: adaedra: special custom keyboard
[20:14:53] Ox0dea: >> Array.new(3, 'foo').each { |f| f << rand(10).to_s }
[20:14:54] ruboto: Ox0dea # => ["foo684", "foo684", "foo684"] (https://eval.in/388820)
[20:15:01] Ox0dea: Wait, what?! I said rand(10).
[20:15:17] Ox0dea: That's duper-spooky.
[20:15:52] Ox0dea: abderian: What do you reckon happened there?
[20:16:03] havenwood: Ox0dea: 6, 8, 4
[20:16:35] GitGud: has joined #ruby
[20:16:40] havenwood: Ox0dea: Oh, you're just demonstrating not wondering?
[20:16:50] Ox0dea: I think I should be insulted?
[20:17:19] amclain: has joined #ruby
[20:17:26] abderian: I get what happened there :p
[20:17:41] havenwood: Ox0dea: Hey, I'm getting nicks confused left and right here. I knew you should have known. :P
[20:17:59] rbennacer: has joined #ruby
[20:18:30] Ox0dea: "Duper-spooky" is not the sort of thing one tends to say under genuine consternation.
[20:18:36] havenwood: ACTION goes back to drinking coffee
[20:19:06] havenwood: I'll wake up eventually!
[20:20:08] Rollabunna: has joined #ruby
[20:21:44] simplyianm: has joined #ruby
[20:22:50] j4cknewt: has joined #ruby
[20:23:03] vickleton: has joined #ruby
[20:24:09] zenguy_pc: has joined #ruby
[20:24:51] Scroff: has joined #ruby
[20:25:56] Channel6: has joined #ruby
[20:27:45] luzidco: has joined #ruby
[20:27:46] mcclurmc: has joined #ruby
[20:27:50] jinie: has joined #ruby
[20:28:24] alphaatom: has joined #ruby
[20:28:37] bartj3: has joined #ruby
[20:28:52] mathie: has joined #ruby
[20:30:03] memph1s: has joined #ruby
[20:31:35] pwnz0r: has joined #ruby
[20:34:23] sandelius: has joined #ruby
[20:35:26] zacts: has joined #ruby
[20:36:32] gix: has joined #ruby
[20:36:51] Scroff: has joined #ruby
[20:37:52] snsei: has joined #ruby
[20:42:57] __butch__: has joined #ruby
[20:43:02] blackmesa: has joined #ruby
[20:43:43] j4cknewt: has joined #ruby
[20:43:44] Papierkorb: has joined #ruby
[20:44:20] weaksauce: crossposting from #vim anyone gotten macvim to work well with chruby? If I chruby to a version of ruby that vim was not compiled against it will crash the ruby interpreter every time the mouse hovers over an identifier. I aliased vi to chruby 2.1.5 && /path/to/macvim but that has the undesirable effect of changing the version of ruby for that terminal session too.
[20:45:26] gregf: has joined #ruby
[20:49:28] Eiam: has joined #ruby
[20:49:47] peter_paule: has joined #ruby
[20:51:07] havenwood: weaksauce: Is it this issue?: https://code.google.com/p/vim/issues/detail?id=114&thanks=114&ts=1361483471
[20:51:09] hotpancakes: has joined #ruby
[20:51:39] Cache_Money: has joined #ruby
[20:52:31] Asher: has joined #ruby
[20:52:34] eggoez: has joined #ruby
[20:53:01] Marisa: has joined #ruby
[20:53:08] yfeldblum: has joined #ruby
[20:53:18] Marisa: Happy Tau Day everyone
[20:53:28] havenwood: weaksauce: If so: make install prefix="..." STRIP="/usr/bin/true"
[20:53:40] Marisa: Ruby needs a tau constant in it's Math module
[20:54:05] havenwood: Marisa: Happy Tau day!
[20:54:19] weaksauce: curious. I ran that command :ruby p RUBY_VERSION and it says "2.0.0" when I had chruby 2.1.5 selected. and it constantly crashes with chruby 2.2.2
[20:54:25] zenguy_pc: has joined #ruby
[20:54:35] yorickpeterse: isn't Pi better? :>
[20:54:39] havenwood: yorickpeterse: Noooo
[20:54:45] havenwood: ACTION grabs a pitchfork
[20:54:53] ljarvis: ACTION grabs a fork
[20:54:55] Marisa: http://tauday.com/tau-manifesto
[20:55:14] yorickpeterse: pi is better because its name is 33% more compact
[20:55:36] havenwood: yorickpeterse: Both one letter. But Pi has an extra down-stem.
[20:55:54] simplyianm: has joined #ruby
[20:55:56] yorickpeterse: havenwood: nobody uses unicode
[20:55:59] Cache_Money: has joined #ruby
[20:56:09] yorickpeterse: ok enough lame trolling for the day
[20:56:12] _blizzy_: could anyone help why https://gist.github.com/NotBlizzard/51b15c7c1c501f3474a8#file-battle-parser-rb-L44 it returns the correct hash, but at line 51 in battle.rb, it returns an empty hash?
[20:56:14] Marisa: Tau Day is celebrated with twice the pie
[20:56:14] ljarvis: gripping conversation in here today
[20:56:19] yorickpeterse: I have typing practise to do
[20:56:38] weaksauce: havenwood actually it seems to always print out 2.0.0. the ruby interpreter works in the crashing version but it fails when I hover over an identifier in a ruby file. any idea how to shut off the popup definition thing?
[20:56:39] yorickpeterse: ACTION is learning Colemak
[20:56:47] Cache_Money: has joined #ruby
[20:56:52] Ox0dea: yorickpeterse: What didn't you like about Dvorak?
[20:57:01] havenwood: weaksauce: 2.0? Sounds like system Ruby.
[20:57:07] RegulationD: has joined #ruby
[20:57:15] yorickpeterse: Ox0dea: it puts the N and S on an annoying spot
[20:57:17] havenwood: weaksauce: Hem, nope I dunno.
[20:57:24] yorickpeterse: plus it's so radically different from QWERTY
[20:57:26] weaksauce: havenwood I compiled it with homebrew so it's whatever that is.
[20:57:31] mrmargolis: has joined #ruby
[20:57:39] Cache_Money: has joined #ruby
[20:57:47] weaksauce: havenwood this thing happens when you hover the mouse over an identifier: http://i.imgur.com/U24x0Em.png
[20:57:49] yorickpeterse: I haven't really decided yet, but so far Colemak has been the most pleasant
[20:57:55] weaksauce: I don't need that.
[20:58:36] Cache_Money: has joined #ruby
[20:59:35] Cache_Money: has joined #ruby
[21:00:32] Cache_Money: has joined #ruby
[21:00:35] sp4rrow_: has joined #ruby
[21:00:40] havenwood: _blizzy_: Get rid of all those `return`s. Move your constants inside the class.
[21:00:52] _blizzy_: havenwood, ok.
[21:01:12] yorickpeterse: Ox0dea: I'm actually learning Dvorak, Colemak and Workman at the same time
[21:01:18] yorickpeterse: because my brain wasn't full of fuck enough already
[21:01:22] Ox0dea: yorickpeterse: Christ, man.
[21:01:29] Cache_Money: has joined #ruby
[21:01:31] Ox0dea: Your hands will not thank you for some time.
[21:02:00] sarkyniin: has joined #ruby
[21:02:11] yaw: has joined #ruby
[21:02:12] ljarvis: you'll look like you've perpetually giving the bloods gang sign
[21:02:24] Cache_Money: has joined #ruby
[21:02:31] sinkensabe: has joined #ruby
[21:02:42] genpaku: has joined #ruby
[21:02:48] yokel: has joined #ruby
[21:02:50] yorickpeterse: Ox0dea: actually the reason I'm doing all this is to prevent my hands from hating me
[21:02:53] _blizzy_: yorickpeterse, learn Brainfuck and Perl while you're at it
[21:03:08] yorickpeterse: as in, QWERTY gives my hands a bad time
[21:03:13] ljarvis: brainfuck is too easy
[21:03:20] Cache_Money: has joined #ruby
[21:03:23] ljarvis: and perl is <3
[21:03:24] yorickpeterse: already know Perl
[21:03:29] Ox0dea: ljarvis: Aren't there about fifty of those?
[21:03:37] ljarvis: Ox0dea: shades of grey?
[21:03:52] _blizzy_: IDK if I should learn Perl
[21:04:02] Ox0dea: _blizzy_: Learn LOLCODE.
[21:04:07] ljarvis: _blizzy_: you're "learning" like 7 languages, you could try and master one
[21:04:09] Cache_Money: has joined #ruby
[21:04:14] _blizzy_: Ox0dea, lol.
[21:04:23] Ox0dea: You're too young to have learned a BASIC, so why not pick up a modern spin?
[21:04:26] _blizzy_: ljarvis, I never said now.
[21:04:34] _blizzy_: I meant like after I 'master' a few
[21:04:34] renderful: has joined #ruby
[21:04:39] ljarvis: fwiw though perl is awesome
[21:04:48] ljarvis: but cecept perl 6
[21:04:49] Cache_Money: has joined #ruby
[21:04:56] yorickpeterse: I was going to ask "what about perl 6"
[21:04:58] ljarvis: which is awful
[21:05:04] yorickpeterse: Perl 6 really looks like Larry did too much acid
[21:05:05] _blizzy_: but I'm already 'strong' in ruby, python, and js
[21:05:17] ljarvis: larry was replaced by an evil twin
[21:05:49] Cache_Money: has joined #ruby
[21:06:05] Ox0dea: _blizzy_: The amount of square brackets in your code does not suggest 'strong' Ruby knowledge, if I may say so.
[21:06:15] _blizzy_: Ox0dea, ok.
[21:06:18] sinkensabe: has joined #ruby
[21:06:18] _blizzy_: medium then
[21:06:27] ljarvis: medium-well
[21:06:41] _blizzy_: I would consider myself strong in ruby however
[21:06:47] Ox0dea: "Give it a few good kicks and walk it by a fire."
[21:06:48] Cache_Money: has joined #ruby
[21:06:59] ljarvis: I would disagree but don't want to seem like a dick
[21:07:08] ljarvis: yorickpeterse: how's the aeon brah
[21:07:11] _blizzy_: this isn't the only project I've made in ruby
[21:07:16] _blizzy_: I've made a few rails apps also.
[21:07:19] yorickpeterse: ljarvis: I added a goto today
[21:07:25] ljarvis: yorickpeterse: so, badly?
[21:07:34] yorickpeterse: https://github.com/YorickPeterse/aeon/commit/cd829d7d4ce2e2d5380cc84c7f499da9e3e595dc it's for loops
[21:07:49] jhass: call it jump, nobody will notice
[21:07:49] _blizzy_: also how does square brackets == bad
[21:07:53] _blizzy_: well, *not strong
[21:07:54] Cache_Money: has joined #ruby
[21:08:03] yorickpeterse: jhass: I already have goto_if_undef/goto_if_def, cbf renaming those
[21:08:30] yorickpeterse: funny enough the VM does already have an object model, method dispatch and multi-threading
[21:08:34] yorickpeterse: it just lacks everything else
[21:08:44] ljarvis: so, the important stuff?
[21:08:44] yorickpeterse: (e.g. a GC, kinda crucial)
[21:08:54] ljarvis: looking good though
[21:09:04] yorickpeterse: Yeah it's coming along nicely
[21:09:13] ljarvis: you're way ahead of my progress on my vm which was started at around the same time
[21:09:26] ljarvis: (not in rust.. ft)
[21:09:30] yorickpeterse: it took me about 2 years to get here
[21:09:31] Ox0dea: _blizzy_: Brackets everywhere is often indicative of a failure to truly understand your data and how best to structure your program around it.
[21:09:39] ljarvis: yorickpeterse: 5 and a half for me
[21:09:42] yaw: defining a private method in a subclass will override a similarly named private method in the parent class?
[21:09:49] ruboto: Why don't you try it and see for yourself?
[21:09:55] _blizzy_: Ox0dea, oh. I disagree, but ok.
[21:10:02] Ox0dea: _blizzy_: Please defend.
[21:10:12] yorickpeterse: For me one of the most difficult parts was setting up the object model
[21:10:13] vyorkin: has joined #ruby
[21:10:15] _blizzy_: Ox0dea, I'd rather not.
[21:10:18] yaw: ljarvis I tried, and looks like that's the case
[21:10:25] yaw: but Rails is making me think otherwise
[21:10:33] yorickpeterse: e.g. the language is OO, so you need to represent a class and instance in the VM. But since a Class is also an instance this gets super confusing
[21:10:38] ljarvis: yaw: yeah rails will do that
[21:10:44] _blizzy_: rails is cool.
[21:10:50] ljarvis: yorickpeterse: sounds complex
[21:10:59] yorickpeterse: because you'll have a Class struct and an Object struct, and a Class is just the layout in the VM (methods, etc) and an Object can wrap it to represent a Class instance in the language and my brain explodes at this point
[21:11:11] yorickpeterse: so I just made it prototype based
[21:11:11] yaw: I'd go ahead and ask the question in #rubyonrails then
[21:11:13] yorickpeterse: problem solved
[21:11:13] yaw: thanks :)
[21:11:16] bking39116: has left #ruby: ()
[21:11:32] yorickpeterse: (the language is still class based)
[21:11:48] yorickpeterse: Plus the bootstrapping of core types has been moved out of the VM
[21:11:54] ljarvis: yorickpeterse: sounds like that's how javascript was built /s
[21:11:59] yorickpeterse: e.g. there will be basically very little code for, say, String, written in Rust
[21:12:18] ljarvis: yorickpeterse: you gonna boostrap this thing? :D
[21:12:19] _blizzy_: on line 50, shouldn't @opponent be updated with the hash? https://gist.github.com/NotBlizzard/5ab1c92cc8b345e3857b
[21:12:37] yorickpeterse: well I can't re-write the VM in itself, but everything else will be done in the language
[21:12:46] drewo: has joined #ruby
[21:12:53] yorickpeterse: The VM just defines some helper instructions for opening files, sockets, etc
[21:13:02] Ox0dea: yorickpeterse: Are there no self-hosted VMs?
[21:13:13] yorickpeterse: For an interpreter that's pretty hard
[21:13:16] _blizzy_: however, it's returning at {} instead of having the values in get_bot_switch
[21:13:25] yorickpeterse: if not downright impossible
[21:13:41] swgillespie: has joined #ruby
[21:13:48] Ox0dea: I bet they were doing it on their Lisp machines in the seventies.
[21:13:56] yorickpeterse: So my goal is to make the VM as small as possible, do the rest in the language itself a la Smalltalk
[21:14:19] ljarvis: yorickpeterse: what's the % sigil for?
[21:14:19] yorickpeterse: unlike Smalltalk there are no primitives (= methods defined in the host language)
[21:14:24] Rollabunna: has joined #ruby
[21:14:25] yorickpeterse: ljarvis: VM instructions
[21:14:30] yorickpeterse: syntax might change, it's just a placeholder
[21:14:37] ljarvis: makes sense
[21:14:54] yorickpeterse: once I figure out what parsing toolkit to use for Rust I'll spend some time actually working on the syntax
[21:15:17] ljarvis: look down at your fingers
[21:15:21] ljarvis: that's what you should use
[21:15:38] yorickpeterse: was probably going to use https://github.com/Geal/nom
[21:15:41] kraljev11: has joined #ruby
[21:16:00] yorickpeterse: though if the syntax is simple enough I can indeed just write it by hand
[21:16:25] ljarvis: looks like it could be, but probably a lot of code
[21:16:41] dgutierr_: has joined #ruby
[21:18:52] yorickpeterse: one thing I'll also need to look into is efficient storing of native stuff in an object
[21:19:15] yorickpeterse: e.g. right now I use an enum (https://github.com/YorickPeterse/aeon/blob/master/src/object.rs#L14-L21) but that's not going to scale very well
[21:19:28] yorickpeterse: add variants for files, sockets, bla bla bla, and you'll quickly have pretty bloated objects
[21:19:40] yorickpeterse: probably have to use some sort of void pointer and unsafe code for that though :/
[21:20:42] kraljev11: has joined #ruby
[21:21:10] yorickpeterse: Now that I think of it, it's kinda fun how I've progressed knowledge wise
[21:21:18] yorickpeterse: e.g. 3-4 years ago I was writing some CMS in Ruby
[21:21:21] micmus: has joined #ruby
[21:21:25] yorickpeterse: now I'm writing compilers and doing all kinds of crazy shit
[21:21:28] drewo: has joined #ruby
[21:21:44] ljarvis: are you basing this project on any type of research paper or such?
[21:22:01] yorickpeterse: Not any in particular, though I've skimmed/read a whole bunch of articles
[21:22:12] yorickpeterse: I've so far avoided most technical papers because I fall asleep reading them
[21:22:23] Ox0dea: ?? cheers for Yorick!
[21:22:36] yorickpeterse: thinking of it my notes however have been the most useful
[21:22:46] ljarvis: I found a lack of good material on this when i first got into building vms and compilers
[21:22:52] yorickpeterse: e.g. I'd write down what I was thinking on paper, try to describe the problem and then sorta rubber duck my way through
[21:23:09] yorickpeterse: a lot of resources assume you're already some sort of compiler Hercules
[21:23:26] ljarvis: most of the stuff i found was in some kind of pseudo pascal and just assumed you already knew everything
[21:23:59] ljarvis: this was about 2 years ago, but not much seems to have changed
[21:24:17] yorickpeterse: I've pieced things together from the most random resources
[21:24:34] yorickpeterse: http://wiki.luajit.org/New-Garbage-Collector <- was actually pretty helpful
[21:24:45] ljarvis: yeah I have a lot of notes but i wasn't very organised and it's a bit of a mess
[21:24:55] yorickpeterse: I probably should've bookmarked more along the way
[21:25:05] ljarvis: lua/luajit is one of my favourite projects
[21:25:05] havenwood: yorickpeterse: enjoy Rust?
[21:25:21] yorickpeterse: The biggest problem with VMs is that the core of it is not that hard
[21:25:27] yorickpeterse: As in, not harder than usual projects
[21:25:36] yorickpeterse: it's just that getting started requires reading a ton of academic shit
[21:25:50] yorickpeterse: (because they're so abstract and such)
[21:25:53] yorickpeterse: havenwood: it's ok so far
[21:26:05] yorickpeterse: like most systems languages it's verbose as heck
[21:26:09] yorickpeterse: but not as bad as Java
[21:26:24] snsei: has joined #ruby
[21:26:36] yorickpeterse: if it wasn't for the Rust IRC channel I would've dropped it by now probably
[21:26:39] urbanmonk: has joined #ruby
[21:26:46] mcclurmc: has joined #ruby
[21:27:41] ljarvis: that didn't stop me :(
[21:27:50] ljarvis: i just don't have the patience anymore
[21:28:15] allomov: has joined #ruby
[21:28:27] yorickpeterse: I'm single and no hobbies, I have plenty of time :P
[21:28:51] Scroff: has joined #ruby
[21:28:57] apeiros: it seems to me you have a hobby
[21:28:58] yorickpeterse: Also no plans for children, so that should cover it for the next 60 years
[21:29:05] yorickpeterse: apeiros: No, that's my life
[21:29:13] yorickpeterse: as odd as that may sound
[21:29:20] ljarvis: no "plans"
[21:29:46] yorickpeterse: ljarvis: well yeah, accidents can happen, but I'm hoping it won't
[21:29:59] Scroff: has joined #ruby
[21:30:12] yorickpeterse: Not looking forward to sacrificing 20 years of my life racing some ugly bag of water
[21:30:15] apeiros: having life as a hobby sounds nice
[21:30:29] ljarvis: i would get so much done
[21:30:29] k3asd`: has joined #ruby
[21:30:30] yorickpeterse: and well I'm starting martial arts again, so I guess that counts as a hobby
[21:30:33] ljarvis: all i do is work
[21:30:50] hotpancakes: has joined #ruby
[21:32:13] yorickpeterse: honestly I wouldn't be surprised if I die behind my computer at age 95 or something
[21:32:23] yorickpeterse: "Yeah we found Yorick, he died while writing an angry bug report"
[21:32:32] snsei: has joined #ruby
[21:32:32] Scroff: has joined #ruby
[21:32:50] ljarvis: that's impressive
[21:33:08] yorickpeterse: most of my family gets stupid old
[21:33:29] ljarvis: mine not so much
[21:33:37] yorickpeterse: e.g. my father's parents are in their 90s (though his mother died a while back), from my mother's side they also turned pretty old IIRC
[21:33:52] vasilakisfil_: has joined #ruby
[21:33:58] Ox0dea: It's theorized that the first person who'll live to 150 has already been born.
[21:33:59] AlexAltea: has joined #ruby
[21:34:21] Ox0dea: Also, you were once the youngest person in the world.
[21:34:32] yorickpeterse: I hope we invent cloning before then
[21:34:38] yorickpeterse: so I can just clone myself, copy my brain, live on
[21:34:46] Ox0dea: yorickpeterse: #clone or #dup?
[21:34:53] Aryasam: has joined #ruby
[21:34:56] ljarvis: deep clone
[21:34:57] yorickpeterse: "Name and date of birth" "Yorick, 1992" "what, that's 300 years ago"
[21:35:00] uber: has joined #ruby
[21:35:20] yorickpeterse: also if you think of it, getting super old is probably super depressing
[21:35:30] yorickpeterse: because everybody you know will be gone (assuming they're not cloned too)
[21:35:52] yorickpeterse: Hm, I also wonder how long the brain would be able to remember things
[21:36:02] yorickpeterse: e.g. would it just forget, say, your first 50 years after 300 years of living?
[21:37:10] ljarvis: i say that with absolutely no certaintly of this fictional scenario we're in
[21:37:19] Ox0dea: I don't think recall follows any particular curve.
[21:37:23] Ox0dea: Certain memories are just indelible.
[21:37:31] Scroff: has joined #ruby
[21:37:45] yorickpeterse: that's the thing though, nobody has ever reached such an age so we can't really know
[21:37:56] yorickpeterse: unless there's ways to test how much you can cram in the human brain
[21:38:23] ljarvis: i hope i don't live that long
[21:38:56] fantazo: has joined #ruby
[21:39:00] ljarvis: c has been full of lots of noobs lately, i wonder where everyone is coming from
[21:39:20] Ox0dea: Zed Shaw was in the news again.
[21:39:38] ljarvis: has he been helping old ladies cross roads again?
[21:39:44] shevy: was he involved in a gun fight
[21:39:59] Ox0dea: He finally seceded the fight against K&R.
[21:40:14] charliesome: has joined #ruby
[21:40:19] ljarvis: the c code in his book is dogshit anyway imo
[21:40:41] Ox0dea: I guess I wanted "ceded" there.
[21:40:50] Ox0dea: Ugly word.
[21:40:53] Ox0dea: >> 0xceded
[21:40:54] ruboto: Ox0dea # => 847341 (https://eval.in/388849)
[21:42:10] weaksauce: havenwood my hack code solution was just to make a zsh function and call it directly: https://gist.github.com/anonymous/eeb38a8a64ffe3859975
[21:42:22] lundell: has joined #ruby
[21:42:29] weaksauce: works well enough for my purposes.
[21:42:35] Scroff: has joined #ruby
[21:42:36] Ox0dea: weaksauce: You're gonna need a bigger shovel.
[21:42:57] yorickpeterse: ljarvis: so ideally you'd "freeze" your body's age, or clone it at a young age
[21:43:00] weaksauce: Ox0dea say what?
[21:43:08] yorickpeterse: I can't imagine living in the body of an 80 year old for 100s of years
[21:43:13] ljarvis: right yeah
[21:43:19] Ox0dea: weaksauce: If you're fine with that result, you're liable to dig yourself into all sorts of other holes.
[21:43:19] ljarvis: that'd suck
[21:43:38] weaksauce: you have a suggestion on how to fix it?
[21:43:48] lundell: Hello! I'm new to Ruby and just want to know if there is any way to iterate through an array without .each because I want to decide myself when it should iterate. Anyone who can point me in the right direction? Not too familiar with the syntax yet, but I really like it so far,
[21:43:58] Ox0dea: weaksauce: Blow it all away and begin anew; it's often quite therapeutic.
[21:44:01] yorickpeterse: lundell: you can use an Enumerator
[21:44:21] Ox0dea: lundell: Aye, you want Enumerator#next.
[21:44:32] yorickpeterse: >> enum = [10, 20, 30].to_enum; p enum.next
[21:44:34] ruboto: yorickpeterse # => 10 ...check link for more (https://eval.in/388850)
[21:45:06] ljarvis: >> foo = [1,2,3]; p foo.each.next
[21:45:07] ruboto: ljarvis # => 1 ...check link for more (https://eval.in/388851)
[21:45:25] weaksauce: Ox0dea got any actionable advice other than "throwing it all away"?
[21:45:34] weaksauce: otherwise I have to assume you are a troll.
[21:45:37] ljarvis: lundell: fwiw enumerable methods without blocks often return Enumator objects
[21:45:56] mcclurmc: has joined #ruby
[21:45:58] Ox0dea: They're a little heavier, though.
[21:45:58] lundell: sweet! Thanks! I'm learning Ruby and I set up my own project to merge two log files to one big log file based on the timestamps.
[21:46:08] lfox: has joined #ruby
[21:46:23] Ox0dea: lundell: That sounds like a really good beginner project.
[21:46:48] ljarvis: glad to see you're caring about memory
[21:47:21] _ixti_: has joined #ruby
[21:47:34] yorickpeterse: "memory is cheap!"
[21:47:49] lundell: I want it linear and not exponential growth the bigger the logs are.
[21:48:00] Ox0dea: lundell: So... insertion sort?
[21:48:22] Ox0dea: Ah, never mind, you didn't specify that the logs are live.
[21:48:59] lundell: Nah they are not up and running, it's for my own sake I'm doing this to make my job a little bit easier.
[21:49:34] kraljev11: has joined #ruby
[21:49:35] snsei: has joined #ruby
[21:50:35] bf4: has joined #ruby
[21:50:56] iamninja: has joined #ruby
[21:51:58] Ox0dea: lundell: Are your timestamps uniform and at the beginnings of lines?
[21:52:27] lundell: Yes I already got the regex down and I can parse the log to an output :)
[21:52:39] Ox0dea: lundell: Do you know about lexicographical ordering?
[21:53:06] lundell: It's just that I need to get two logs in to each array and make sure I put the earliest timestamp first and iterate in a way that it's not going to be exponential.
[21:53:31] Ox0dea: I shall refrain from spoiling your fun.
[21:53:34] lundell: Ox0dea no, my math is kinda basic and so is my programming skills. I'm trying to learn as best as I can :)
[21:53:57] sinkensabe: has joined #ruby
[21:54:30] lundell: Please spoil if you want :) It's informative and thats a good thing.
[21:54:39] kraljev11_: has joined #ruby
[21:54:44] Aryasam: has joined #ruby
[21:54:49] dgutierrez1287: has joined #ruby
[21:55:13] Ox0dea: >> 'cats' > 'bears'
[21:55:14] ruboto: Ox0dea # => true (https://eval.in/388854)
[21:55:18] shevy: spoil and spank us
[21:55:20] Ox0dea: lundell: Do you see why that is?
[21:55:44] blackmes1: has joined #ruby
[21:55:45] shevy: that's easy. cats are the more noble race
[21:55:46] lundell: less memory because it's only 4 letters?
[21:56:00] Ox0dea: >> 'cats' > 'b'
[21:56:01] ruboto: Ox0dea # => true (https://eval.in/388855)
[21:56:15] shevy: cats are great \o/
[21:56:23] tubuliferous_: has joined #ruby
[21:56:36] Ox0dea: Cats *are* great, but Ruby doesn't know that.
[21:56:57] ljarvis: they're not better than bears...
[21:57:02] Ox0dea: Ruby said so.
[21:57:22] lundell: I have no idea why cats > b is true.
[21:57:25] ljarvis: I know when I know better than ruby
[21:57:31] Ox0dea: >> 'a' < 'z'
[21:57:32] ruboto: Ox0dea # => true (https://eval.in/388856)
[21:57:33] ljarvis: >> 'c' > 'b' # spoiler
[21:57:34] ruboto: ljarvis # => true (https://eval.in/388857)
[21:57:42] Ox0dea: lundell: Starting to see it?
[21:58:15] lundell: oh, greater number the further up in the alphabet?
[21:58:29] Ox0dea: Right, but the strings are being compared one character at a time.
[21:59:03] lundell: ah ok. basicly like in C, where the strings are char arrays?
[21:59:08] Ox0dea: As soon as Ruby has determined that one string is "less than" or "greater than" the other, it stops processing, because no later character can change its mind.
[21:59:26] Ox0dea: lundell: Yes, mostly like that. In C, characters are really just integers, and we can expose that truth in Ruby as well.
[21:59:30] Ox0dea: >> ['c'.ord, 'b'.ord]
[21:59:31] pwnz0r: has joined #ruby
[21:59:31] ruboto: Ox0dea # => [99, 98] (https://eval.in/388858)
[21:59:34] ljarvis: >> '50' < '100'
[21:59:35] ruboto: ljarvis # => false (https://eval.in/388859)
[21:59:40] Ox0dea: ljarvis: Stahp!
[22:00:21] arescorpio: has joined #ruby
[22:00:26] lundell: so it's the ascii number you get when you write .ord?
[22:00:46] Ox0dea: Well, it's the ordinal value given to that character by the current encoding, but we can call it ASCII and be just fine.
[22:01:12] Ox0dea: So, strings can be sorted just like numbers (or anything else, really), and it's done based on the values of the characters.
[22:01:14] rbennacer: has joined #ruby
[22:01:22] Ox0dea: Well, you said you've got uniform timestamps.
[22:01:30] Ox0dea: >> '08:14:22' < '09:16:18'
[22:01:31] ruboto: Ox0dea # => true (https://eval.in/388860)
[22:01:43] decoponio: has joined #ruby
[22:01:46] Ox0dea: >> ['09:16:18', '04:12:21'].sort
[22:01:47] ruboto: Ox0dea # => ["04:12:21", "09:16:18"] (https://eval.in/388861)
[22:01:59] snsei: has joined #ruby
[22:02:39] lundell: '2015-06-25 09:20:25,654 text text1' < '2015-06-25 09:20:27,654 text text2'
[22:02:51] lundell: oh forgot >>
[22:02:52] Ox0dea: Yep, you've got the idea!
[22:03:04] lundell: >> '2015-06-25 09:20:25,654 text text1' < '2015-06-25 09:20:27,654 text text2'
[22:03:05] ruboto: lundell # => true (https://eval.in/388862)
[22:03:14] Ox0dea: Since all the hyphens and colons are in the same places, only the figures will matter in the sorting.
[22:03:32] Ox0dea: And since Ruby stops bothering as soon as it has determined the "winner", the rest of the line doesn't matter.
[22:03:35] lundell: ah ok, so I can basicly just parse out that time stamp? I don't have to make a date object for that? This is great!
[22:03:45] Ox0dea: You needn't even do any parsing, my friend.
[22:04:27] ljarvis: this is what a project would boast as zero allocations
[22:04:35] ljarvis: aka herp derp sizzurp
[22:04:35] sinkensabe: has joined #ruby
[22:05:15] Xiti: has joined #ruby
[22:05:41] ljarvis: ACTION back to pretending to code
[22:05:42] lundell: doesn't ruby parse that string? Isn't parsing reading a specific part of a string?
[22:05:44] sinkensabe: has joined #ruby
[22:06:04] Ox0dea: lundell: Parsing is breaking a string up into meaningful pieces.
[22:06:17] lundell: So you say that I can just iterate through the whole line and if it differs on the time stamp it wont bother checking the text?
[22:06:22] Ox0dea: What you've got are a bunch of lines that, by virtue of being properly timestamped, can all be compared naturally with each other, exactly as they are.
[22:06:59] lundell: This is awesome. But is this only for ruby that it checks character for character?
[22:07:08] Ox0dea: Many languages do lexicographical ordering.
[22:07:15] Ox0dea: Python and JavaScript immediately spring to mind.
[22:07:20] Ox0dea: But you didn't hear that.
[22:08:02] pwnz0r: has joined #ruby
[22:08:36] Ox0dea: >> yester = ['06:21 foo', '14:55 bar']; today = ['19:44 baz', '16:20 quux']; (yester + today).sort
[22:08:37] ruboto: Ox0dea # => ["06:21 foo", "14:55 bar", "16:20 quux", "19:44 baz"] (https://eval.in/388863)
[22:08:46] Ox0dea: >> @Ruby == @magic
[22:08:47] ruboto: Ox0dea # => true (https://eval.in/388864)
[22:08:52] Rollabunna: has joined #ruby
[22:09:48] Rollabunna: has joined #ruby
[22:10:03] lundell: Amazing, thank you so much!
[22:10:36] Ox0dea: I do advise you carry on with your line-by-line approach; if nothing else, it'll be much more educational.
[22:10:53] Ox0dea: Truth be told, I've been spewing nonsense and none of that is actually valid Ruby.
[22:10:56] nateberkopec: has joined #ruby
[22:11:08] Rollabun_: has joined #ruby
[22:11:50] lundell: I still need to do the line by line so the time it takes to merge is linear depending on how big the logs are.
[22:11:50] hotpancakes: has joined #ruby
[22:12:25] Rollabun_: has joined #ruby
[22:13:02] Ox0dea: Ruby's #sort is essentially O(n), but it's certainly the case that a cleverer approach could save on both time and memory.
[22:13:07] lundell: The thing is that in file1.log it can print 20 things in a min but in file2.log it might be empty so that iterator needs to remember it's place so I dont have to iterate through file2 everytime file1 goes to the next step.
[22:13:13] Rollabun_: has joined #ruby
[22:13:33] lundell: or not empty, but a hole in the log for 20 min*
[22:13:36] Ox0dea: lundell: Are you passing these files in on the command line?
[22:14:24] lundell: Right now I just name them a special way isntead of going *-log.* so I just name it e.g. x.log and y.log
[22:14:29] greenbagels: has joined #ruby
[22:14:30] Rollabun_: has joined #ruby
[22:14:32] lundell: and put them in the same folder.
[22:14:43] yaw: has joined #ruby
[22:15:28] Rollabunna: has joined #ruby
[22:16:11] thebastl: has joined #ruby
[22:16:26] GPrime: has joined #ruby
[22:16:46] Rollabun_: has joined #ruby
[22:16:51] riotjones: has joined #ruby
[22:17:01] Ox0dea: $ ruby -e 'puts ARGF.sort' *.log
[22:17:35] Ox0dea: lundell: I shit you not, that tiny little command would output your whole collection in timestamp-order.
[22:17:43] Rollabun_: has joined #ruby
[22:17:45] Ox0dea: But your box will explode if you actually run it!
[22:17:52] Ox0dea: So do the line-by-line thing instead.
[22:17:57] Ox0dea: I am so serious right now.
[22:18:00] Ox0dea: Do not run that command, mate.
[22:18:33] lundell: And right now I don't sit on the 800mb logs either since I'm on my vacation. :)
[22:19:01] Rollabun_: has joined #ruby
[22:19:08] Ox0dea: Are megabytes those things people hand out to children during All Hallow's Eve?
[22:19:40] Ox0dea: Nah, I'm only poking fun.
[22:19:44] lundell: But another thing, should I just open two file streams and go from there, or first just put all lines in one array per file? How would you do it?
[22:20:00] Rollabun_: has joined #ruby
[22:20:00] Ox0dea: I'd use ARGF and shell globs.
[22:20:06] Ox0dea: But that's only because I fire-proofed my machine!
[22:21:01] Ox0dea: Really, though, if you want to build up a sorted array little by little, insertion sort is a good first brush.
[22:21:06] Rollabunna: has joined #ruby
[22:21:08] lundell: Like right now when I was trying to get my regex to work I just opened one file and iterated through it.
[22:21:48] Ox0dea: Well, it's been established that regular expressions are overkill for sorting timestamped data. Do you still feel you need to parse your lines?
[22:21:48] jfarmer: has joined #ruby
[22:22:12] snsei: has joined #ruby
[22:22:12] Azure: has joined #ruby
[22:22:20] Rollabun_: has joined #ruby
[22:22:32] lundell: But is it faster to read the file to an array and then use the two arrays to write to the output file? Or should I just keep the files open and iterate through and copying the line I need to the output file?
[22:22:52] baweaver: has joined #ruby
[22:23:12] Ox0dea: It wouldn't make sense to write out to a file until you had a sorted collection, right?
[22:23:25] Rollabun_: has joined #ruby
[22:23:27] Ox0dea: What happens if you've been printing, only to discover that this line should go before one you've already printed.
[22:23:43] lundell: Well I just remembered that sometimes info is printed on several rows so I do actually need the regex. If the next or isn't a timestamp it should put it in the file too.
[22:24:15] Ox0dea: Oh, excellent! Then yes, you'll need to parse your input. ;)
[22:24:29] kraljev11: has joined #ruby
[22:24:34] Rollabun_: has joined #ruby
[22:25:38] Ox0dea: Note well that that doesn't mean you'll need to bother with converting it into an actual Date object.
[22:25:44] Rollabun_: has joined #ruby
[22:26:05] lundell: True. But what I thought was if I have 20 rows in each file as an example. and the first 10 rows in file2 is earlier than file1, so fileone is still on row 0 but file2 is on row9. I'm just thinking that I could do if row 0 in file1 < row 9 in file2 then output.puts row 0 in file 1
[22:26:48] Rollabunna: has joined #ruby
[22:26:53] Ox0dea: lundell: Insertion sort.
[22:27:08] Ox0dea: Insertion sort is basically how you, as a human being, would put a deck of cards in order.
[22:27:25] Ox0dea: You take each card, figure out where it should go, and drop it in.
[22:27:29] lundell: But wouldn't that take longer? Alot longer?
[22:27:46] lundell: the bigger deck the longer it takes to check if it's going in the last spot.
[22:27:58] Rollabun_: has joined #ruby
[22:28:24] baweaver: http://www.sorting-algorithms.com/
[22:28:43] weaksauce: lundell your logs are all sorted individually by the nature of them being append only logs
[22:29:03] Rollabun_: has joined #ruby
[22:29:31] weaksauce: just read a line at a time from each and insert the lowest timestamp of the bunch into a new file.
[22:29:44] baweaver: if array.length < 1000 then selection_sort else quick_sort end
[22:30:20] Rollabun_: has joined #ruby
[22:31:18] Rollabun_: has joined #ruby
[22:32:25] Rollabunna: has joined #ruby
[22:32:38] lundell: weaksauce thats what I will do. But I had not figure out a way for me to tell the program to iterate :) But I learned about enumerator just now
[22:33:13] quazimodo: has joined #ruby
[22:33:45] Rollabun_: has joined #ruby
[22:34:51] ruv: has joined #ruby
[22:35:07] Rollabun_: has joined #ruby
[22:35:58] Rollabun_: has joined #ruby
[22:36:28] EasyCo: has joined #ruby
[22:36:39] humd1ng3r: has joined #ruby
[22:36:57] Rollabun_: has joined #ruby
[22:38:08] al2o3-cr: has joined #ruby
[22:38:22] Rollabunna: has joined #ruby
[22:38:37] towski_: has joined #ruby
[22:39:17] Rollabunna: has joined #ruby
[22:40:34] Rollabun_: has joined #ruby
[22:41:09] mcclurmc: has joined #ruby
[22:41:15] millerti: has joined #ruby
[22:41:18] eggoez: has joined #ruby
[22:41:28] Rollabun_: has joined #ruby
[22:41:39] snsei: has joined #ruby
[22:41:55] Pupeno: has joined #ruby
[22:42:35] Rollabun_: has joined #ruby
[22:43:45] Rollabun_: has joined #ruby
[22:44:49] Rollabunna: has joined #ruby
[22:45:51] RegulationD: has joined #ruby
[22:45:56] Rollabun_: has joined #ruby
[22:46:52] cvtsx: has joined #ruby
[22:47:10] Rollabun_: has joined #ruby
[22:48:12] Rollabun_: has joined #ruby
[22:49:21] Rollabun_: has joined #ruby
[22:50:09] Igorshp: has joined #ruby
[22:50:26] Rollabunna: has joined #ruby
[22:50:29] rickmasta: has joined #ruby
[22:51:35] Rollabun_: has joined #ruby
[22:52:19] kraljev11: has joined #ruby
[22:52:52] Rollabun_: has joined #ruby
[22:53:03] drewo: has joined #ruby
[22:53:05] Pupeno: has joined #ruby
[22:54:11] Rollabun_: has joined #ruby
[22:54:58] Rollabun_: has joined #ruby
[22:56:17] Rollabunna: has joined #ruby
[22:57:14] Rollabunna: has joined #ruby
[22:57:23] mrmargolis: has joined #ruby
[22:58:22] Rollabun_: has joined #ruby
[22:59:28] Rollabun_: has joined #ruby
[23:00:02] urbanmonk: has joined #ruby
[23:00:51] Rollabun_: has joined #ruby
[23:01:29] Igorshp_: has joined #ruby
[23:01:54] pragmatism: has joined #ruby
[23:01:54] Rollabun_: has joined #ruby
[23:02:55] Rollabunna: has joined #ruby
[23:03:27] CloCkWeRX: has joined #ruby
[23:04:10] Rollabun_: has joined #ruby
[23:04:42] pragmati_: has joined #ruby
[23:05:06] eggoez: has joined #ruby
[23:05:08] Rollabun_: has joined #ruby
[23:05:40] yaw: has joined #ruby
[23:05:54] Hobogrammer: has joined #ruby
[23:06:10] yaw: has left #ruby: ()
[23:06:26] Rollabun_: has joined #ruby
[23:07:15] aryaching: has joined #ruby
[23:07:23] Rollabun_: has joined #ruby
[23:08:32] Rollabunna: has joined #ruby
[23:12:18] Ropeney: has joined #ruby
[23:14:23] Muhannad: has joined #ruby
[23:14:27] kraljev11: has joined #ruby
[23:14:37] snsei: has joined #ruby
[23:16:00] Oka: has joined #ruby
[23:17:39] kraljev11: has joined #ruby
[23:17:58] hotpancakes: has joined #ruby
[23:19:57] mcclurmc: has joined #ruby
[23:21:18] othernick: has joined #ruby
[23:21:55] pwnz0r: has joined #ruby
[23:22:03] Raboo: has joined #ruby
[23:22:39] mcclurmc: has joined #ruby
[23:22:48] othernick: has left #ruby: ()
[23:22:55] mcclurmc: has joined #ruby
[23:23:25] urbanmonk: has joined #ruby
[23:24:20] Indian: has joined #ruby
[23:24:26] Marisa: has joined #ruby
[23:24:39] workmad3: has joined #ruby
[23:25:46] dc_: has joined #ruby
[23:26:02] rehat: has joined #ruby
[23:27:27] nateberkopec: has joined #ruby
[23:28:03] rehat: I'm kinda new with web requests and I am trying to write a script that downloads a file from a site. The site requires a login and I think that is why I am getting a 'forbidden' message from net/http is there a way to add my cookie auth or get another auth added to the headers
[23:31:42] vasilakisfil_: has joined #ruby
[23:32:00] Mia: has joined #ruby
[23:32:05] mcclurmc: has joined #ruby
[23:32:52] yokel: has joined #ruby
[23:35:04] quazimodo: has joined #ruby
[23:35:38] Ox0dea: rehat: Post code?
[23:35:58] Eiam: has joined #ruby
[23:36:17] workmad3: has joined #ruby
[23:36:22] nateberkopec: has joined #ruby
[23:36:32] rehat: Ox0dea: using the answer from http://stackoverflow.com/questions/2263540/how-do-i-download-a-binary-file-over-http
[23:36:45] Ox0dea: A link to SO is not code.
[23:37:00] Ox0dea: If you're using something like Net::HTTP.post, you can pass a Hash of headers as one of the arguments.
[23:37:13] ooesili: has joined #ruby
[23:37:26] ooesili: has joined #ruby
[23:37:51] fooooooooo: has joined #ruby
[23:37:55] rehat: I am doing a get. So I basically have something like this http://pastebin.com/yndYAyTD
[23:37:55] ruboto: rehat, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/91241725f6ed98800e8e
[23:37:56] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[23:38:36] techietrash: has joined #ruby
[23:39:14] rehat: so do I need to add auth before the http.get?
[23:39:53] fooooooooo: hey, how come one can't `def some_method(foo?: true); foo?; end` #=> identifier foo? is not valid to set
[23:40:03] Ox0dea: rehat: You shouldn't be able to log into something with a GET, but whatever. Do that, then get the response headers, pluck out whichever one contains your auth cookie, and then pass that along in subsequent requests.
[23:40:19] Ox0dea: fooooooooo: Because.
[23:40:30] ooesili: has joined #ruby
[23:42:04] thalassa: has joined #ruby
[23:42:09] rehat: Ox0dea: thanks, I didn't realize I needed to login to get the auth cookie first. I will work on that
[23:43:27] Ox0dea: rehat: It's possible that the site will set a few cookies as soon as you request the login page, so you may need to apply the steps outlined above at that stage.
[23:43:40] coffee__cup: has joined #ruby
[23:44:31] tubuliferous_: has joined #ruby
[23:44:49] kobain: has joined #ruby
[23:45:09] snsei: has joined #ruby
[23:45:53] bruno-_: has joined #ruby
[23:47:39] ashleyis: has joined #ruby
[23:47:46] michael_mbp: has joined #ruby
[23:48:58] MatthewsFace: has joined #ruby
[23:49:01] fooooooooo: Ox0dea :/ -- :foo? is a valid symbol.
[23:49:09] Ox0dea: That it is.
[23:49:22] Ox0dea: But it is not a valid identifier for anything but methods.
[23:49:26] millerti: has joined #ruby
[23:49:35] Ox0dea: And that makes a good deal of sense too.
[23:49:58] Ox0dea: It's often the case that we call a method to ask a question, but when should a variable represent such a thing?
[23:50:38] balazs: has joined #ruby
[23:50:46] fooooooooo: ok makes sense thanks
[23:51:14] Axy: has joined #ruby
[23:51:14] Axy: has joined #ruby
[23:51:17] bf4: has joined #ruby
[23:53:30] quazimodo: has joined #ruby
[23:54:18] mrmargolis: has joined #ruby