« Back to channel list

#ruby - 03 November 2015

« Back 1 day Forward 1 day »
[00:00:08] hxegon: skweek: first thing, get a list of m4a files. That gist has basically what you need, except it lists mp3s
[00:00:33] hxegon: exercise*
[00:00:56] arooni: has joined #ruby
[00:01:22] arooni: has joined #ruby
[00:02:07] hxegon: skweek: if you want Dir['**/*.mp3'] explained in a bit more detail, just ask
[00:02:57] skweek: no its straight foward
[00:03:15] tkuchiki: has joined #ruby
[00:03:46] hxegon: skweek: ok, so now you have a list of m4as, are you using a conversion library or feeding the files to the command line using backticks?
[00:04:09] rgrmatt: has joined #ruby
[00:04:24] hxegon: skweek: I mean feeding it to the ffmpeg command line tool or something
[00:05:15] skweek: i don't want to convert the files, just remove the already converted ones and leave the non-converted ones
[00:05:51] skweek: say i've started converting m4as, have some but not compelted need to move the converted m4as and leave the non converted m4as
[00:06:06] hxegon: skweek: aaah, so you now need another list of mp3 files to compare the m4a list too
[00:06:13] gambl0re: has joined #ruby
[00:08:31] crdpink2: has joined #ruby
[00:08:36] hxegon: skweek: so now, what is the best way to compare? you just need to find any file (without the extension) that appears in both lists.
[00:09:44] Xeago: has joined #ruby
[00:10:21] skweek: i'm not sure how to think about it, well I would think about it like if ruby -e "p Dir['**/*.mp3']" and ruby -e "p Dir['**/*.m4a']" are equal remove ruby -e "p Dir['**/*.m4a']"
[00:10:56] skweek: but instead of remove just print
[00:10:58] Ox0dea: >> [1,2,3,4] & [2,3] # skweek
[00:10:59] ruboto: Ox0dea # => [2, 3] (https://eval.in/461831)
[00:11:08] Ox0dea: Do you understand what Array#& is doing there?
[00:11:22] hxegon: >> File.basename('something/rad_tunes.mp4')
[00:11:23] ruboto: hxegon # => "rad_tunes.mp4" (https://eval.in/461832)
[00:11:54] Ox0dea: >> [1,2,3,4] & [2,3,5] # skweek: How about now?
[00:11:55] ruboto: Ox0dea # => [2, 3] (https://eval.in/461833)
[00:13:50] patdohere: has joined #ruby
[00:13:51] skweek: may I guess, [1,2,3,4] is an array of the numbers 1,2,3,4 and [2,3] is an array being compared to [1,2,3,4]
[00:14:31] hxegon: skweek: yes, and it returns the elements they have in common, being [2, 3]
[00:16:07] skweek: ruby -e "p Dir['**/*.m4a']" & ruby -e "p Dir['**/*.mp3']"
[00:16:25] chibs: has joined #ruby
[00:16:57] Ox0dea: skweek: I only used `ruby -e` in the demonstration for convenience; you should be putting your code in a .rb file and executing it that way.
[00:18:13] hxegon: Is there a File method like basename that precedes the full path? I'd rather not suggest a regex
[00:18:27] eam: dirname
[00:18:28] skweek: i'm kinda of confused, something that looks like inserted into an array.. compared... File.basename('Dir[**/*.m4a*]')
[00:18:48] hxegon: or do a bunch of split('/')[0..-1]bullsh
[00:18:50] Ox0dea: skweek: File.basename expects a String, not an array of them.
[00:19:18] hxegon: skweek: have you used map yet?
[00:19:27] skweek: i've read about it
[00:19:36] hxegon: skweek: one sec
[00:19:43] kies^: has joined #ruby
[00:20:00] rgrmatt: has joined #ruby
[00:20:57] hxegon: thanks eam
[00:20:58] mistermocha: has joined #ruby
[00:21:34] hxegon: >> foo = 'test/file.m4a'; File.dirname(foo) + File.basename(foo)
[00:21:35] ruboto: hxegon # => "testfile.m4a" (https://eval.in/461834)
[00:21:39] chibs: has joined #ruby
[00:22:22] hxegon: skweek: pay no attention to that
[00:22:51] Renich: has joined #ruby
[00:23:20] hxegon: >> foo = 'test/file.m4a'; File.dirname(foo) + '/' + File.basename(foo).split('.')[0]
[00:23:21] ruboto: hxegon # => "test/file" (https://eval.in/461835)
[00:23:40] hxegon: skweek: there we go.
[00:24:10] sankaber: has joined #ruby
[00:24:45] hxegon: skweek: use this with map on the arrays from Dir[...]
[00:25:38] mattwildig: has joined #ruby
[00:26:08] jhack: has joined #ruby
[00:27:26] millerti: has joined #ruby
[00:27:37] momomomomo: has joined #ruby
[00:28:18] hxegon: I'm suprised there isn't File.basepath or something
[00:31:52] _djbkd: has joined #ruby
[00:32:02] dikaio: has joined #ruby
[00:32:08] eam: hxegon: isn't that what dirname is?
[00:32:41] hxegon: eam: dirname would just returns test/
[00:33:04] baweaver: has joined #ruby
[00:33:17] hxegon: >> File.dirname('one/two/three.txt')
[00:33:17] mattwildig: has joined #ruby
[00:33:18] ruboto: hxegon # => "one/two" (https://eval.in/461850)
[00:33:49] druonysus: has joined #ruby
[00:33:56] pullcheezy: has joined #ruby
[00:34:22] bb010g: has joined #ruby
[00:35:32] qhartman: has joined #ruby
[00:36:49] hxegon: >> foo = 'foo/bar/baz.mp3'; File.dirname(foo) + '/' + File.basename(foo, '.*') # this is better skweek
[00:36:50] ruboto: hxegon # => "foo/bar/baz" (https://eval.in/461853)
[00:38:23] jaequery_: has joined #ruby
[00:40:33] Rinzlit: has joined #ruby
[00:43:08] dhollinger: has joined #ruby
[00:46:51] rgrmatt: has joined #ruby
[00:48:47] rgrmatt: has joined #ruby
[00:49:14] atomical: has joined #ruby
[00:49:27] jaequery: has joined #ruby
[00:49:38] Ox0dea: has joined #ruby
[00:51:16] karapetyan: has joined #ruby
[00:51:44] mistermocha: has joined #ruby
[00:52:32] rgrmatt: has joined #ruby
[00:52:50] Ox0dea: skweek: Time for a fish, then?
[00:53:11] skweek: https://gist.github.com/alact/6b1cbae171924dc463fc
[00:54:08] skweek: I guess this is a bit more involved than I thought it would be... or atleast the time its taken has been greater than the time I have available to dedicate to
[00:54:46] Ox0dea: Busy, busy.
[00:57:09] baweaver: has joined #ruby
[00:57:22] mndoci: has joined #ruby
[00:57:42] babblebre: has joined #ruby
[00:59:47] graydot: has joined #ruby
[00:59:49] swgillespie: has joined #ruby
[01:00:27] Ox0dea: skweek: https://gist.github.com/0x0dea/bbc45e4265ff5d6185a7
[01:00:36] rgtk: has joined #ruby
[01:00:48] Ox0dea: It's really quite easy if you know your tool(s), but that's true of most anything.
[01:01:19] lemur: has joined #ruby
[01:01:45] duckpuppy: has joined #ruby
[01:02:11] PhantomSpank_: has joined #ruby
[01:02:16] Ox0dea: Bothering about with #dirname and #basename is overkill here, given that you know your inputs will differ only in their extension.
[01:02:23] eam: a poor worker blames their tools but no worker ever thanks them
[01:02:37] rgtk: has joined #ruby
[01:03:09] eam: wait, what part of the file was hxegon looking for?
[01:03:14] skweek: I've got a bunch of books on ruby on my book shelve, I should spend more time with them
[01:03:17] eam: if not the filename nor the basename?
[01:03:30] eam: skweek: take them out to a nice coffee shop
[01:03:38] eam: books enjoy that
[01:03:41] Ox0dea: skweek: Do you understand what's going on in that solution?
[01:04:32] rgtk: has joined #ruby
[01:05:05] skweek: no, I guess that .map { |f| f.sub /mp3$/, 'm4a' } is what trips me up
[01:05:15] zenguy_pc: has joined #ruby
[01:05:28] Ox0dea: skweek: #map "transforms" each element of a collection however you specify.
[01:05:47] eam: >> [1,2,3].map {|n| n + n}
[01:05:48] ruboto: eam # => [2, 4, 6] (https://eval.in/461859)
[01:06:06] symm-: has joined #ruby
[01:06:23] skweek: does f iterate through the the map and replace mp3 and m4a?
[01:06:27] eam: >> %w{skweek Ox0dea eam}.map {|s| s + "are doing ruby!"}
[01:06:28] ruboto: eam # => ["skweekare doing ruby!", "Ox0deaare doing ruby!", "eamare doing ruby!"] (https://eval.in/461860)
[01:06:28] rgtk: has joined #ruby
[01:06:31] Ox0dea: skweek: The "clever" bit is to just "rename" all of the .mp3s to .m4a, and do a set union with the actual .m4as; the elements that appear in both are the ones you want deleted.
[01:06:51] eam: oops, dropped a space
[01:07:07] Ox0dea: >> ?\x20 # Here ya go.
[01:07:08] ruboto: Ox0dea # => " " (https://eval.in/461861)
[01:07:24] djellemah_: has joined #ruby
[01:07:35] Ox0dea: *set intersection
[01:07:57] lemur: file_names.group_by { |f| f.split('.')[0] }
[01:08:06] Ox0dea: lemur: Brittle.
[01:08:11] eam: >> "this example foo".sub /foo$/, "bar"
[01:08:12] ruboto: eam # => "this example bar" (https://eval.in/461862)
[01:08:22] rgtk: has joined #ruby
[01:08:57] lemur: file_names.group_by { |f| f.split('.')[0..-1].join('.') }.select { |g| g.size > 1 }
[01:09:28] baweaver: must have had both computers on again.
[01:09:49] skweek: I think that might not do what I want, in folder /two/files/ thare are *.mp3 and *.m4a, does this remove the files in the array that are in /two/files ?
[01:10:12] rgtk: has joined #ruby
[01:10:12] eam: skweek: try it and see!
[01:10:15] to_json: has joined #ruby
[01:10:15] to_json: has joined #ruby
[01:10:30] jdawgaz: has joined #ruby
[01:10:37] Ox0dea: skweek: I deliberately wrote it so that you could run it without screwing yourself.
[01:10:59] Ox0dea: It does a dry run; uncomment the last line to burn 'em.
[01:12:09] rgtk: has joined #ruby
[01:12:57] makufiru: has joined #ruby
[01:13:59] rgtk: has joined #ruby
[01:14:20] rgrmatt: has joined #ruby
[01:14:29] MacDaddy: has joined #ruby
[01:15:57] rgtk: has joined #ruby
[01:16:22] tkuchiki: has joined #ruby
[01:17:00] Ox0dea: baweaver: It was a single-route to-do app: entries.delete_at(param.to_i) || entries = [false] + entries + [param]
[01:17:20] Ox0dea: It's shit since entries can't begin with a digit.
[01:17:28] Ox0dea: But that was the only problem with it.
[01:17:33] baweaver: been in LA on vacation, got back last night at around midnight
[01:17:35] cmaxwe: has joined #ruby
[01:17:50] skweek: I see, cool
[01:17:51] baweaver: makes work rather hellish to stay awake for.
[01:17:53] rgtk: has joined #ruby
[01:17:59] Ox0dea: It is known.
[01:18:02] Ox0dea: skweek: Do you see?
[01:18:22] Ox0dea: skweek: I mustache you a question.
[01:18:28] shevy: baweaver this is why beavers shouldn't party, they just don't wanna go back to that dam work!
[01:18:36] Ox0dea: > dam work
[01:18:57] safe: has joined #ruby
[01:19:04] baweaver: Well I try not to birch about it
[01:19:24] Coraline: No sense in chasing your tail
[01:19:30] eam: wood you look at these puns
[01:19:47] rgtk: has joined #ruby
[01:19:50] baweaver: Decided to spruce things up a bit
[01:20:02] Coraline: Branching out a bit?
[01:20:05] baweaver: I know you were pining for it
[01:20:18] baweaver: Though I'll leaf it at that.
[01:20:28] Coraline: Are you needling me?
[01:20:47] Coraline: There's only so much of that that I cone take
[01:20:53] baweaver: Your bark is worse than your bite ;)
[01:21:10] Coraline: That's the root of the problem for sure.
[01:21:41] rgtk: has joined #ruby
[01:22:21] baweaver: It's gotten a bit syruptitious, I agree
[01:22:31] Coraline: That's what yew think!
[01:22:38] baweaver: (surreptitious)
[01:22:50] northfurr: has joined #ruby
[01:23:05] Ox0dea: (I missed the opportunity to use "Castor down".)
[01:23:32] rgtk: has joined #ruby
[01:23:44] ElSif: has joined #ruby
[01:23:52] Ox0dea: (> mfw OOC in #ruby)
[01:24:31] baweaver: well that's all I have. Can't find a good one for Oak or Elm or Maple
[01:24:46] Coraline: That was fun
[01:24:48] eam: pretty poplar subject
[01:24:55] Coraline: I normally reserve my punning for tenderlove
[01:24:58] baweaver: ACTION high fives eam
[01:25:01] eam: hard to keep going without branching out though
[01:25:10] baweaver: Coraline: I normally reply to his on Twitter.
[01:25:26] rgtk: has joined #ruby
[01:25:36] shevy: oh ... perhaps deer ... well I am not quite awake
[01:25:38] baweaver: shevy: way to buck the system
[01:25:47] eam: going against the grain
[01:25:49] Ox0dea: tenderlove: If you're about, could you say why `%d[1 3.14 2ri]` is terrible?
[01:25:59] mbfff: has joined #ruby
[01:26:13] Ox0dea: I think not.
[01:26:19] baweaver: was about to say, need more cats for summoning rituals
[01:26:36] tenderlove: I tried it, but I got a syntax error
[01:26:52] Ox0dea: tenderlove: Right, I'm considering a proposal.
[01:27:21] mbfff: Question: I am writing a ruby gem and have a couple of questions regarding the standard way to structure classes. 1) I am modeling an API and my module name is that of the service. Then my main class is the object that the API returns a majority of the time.
[01:27:23] rgtk: has joined #ruby
[01:27:49] Ox0dea: tenderlove: I tried piggy-backing off your %i code, but I don't know how to incorporate parse_numeric() pursuant to Virtue #1.
[01:27:56] baweaver: ACTION does not see a question mark
[01:28:17] mbfff: The API also allows users to search for those objects. Should I create a Util class to allow for search/find methods?
[01:28:48] jdawgaz: has joined #ruby
[01:28:48] mbfff: Service::Object.search or Service:Utils.search with results the object or array of ojbects.
[01:29:07] Ox0dea: mbfff: That'd be a Utils module, surely?
[01:29:17] rgtk: has joined #ruby
[01:29:19] Ox0dea: Why not just `Service.search`?
[01:29:36] tenderlove: I'm not sure which production does floats / reals
[01:30:15] tenderlove: presumably you can just copy the %i code, but change symble_list to be a list of numbers
[01:30:32] mbfff: The guide I have been following always encased classes in a module.
[01:30:44] tenderlove: https://github.com/ruby/ruby/blob/trunk/parse.y#L4103-L4127
[01:30:47] sankaber: has joined #ruby
[01:30:48] tenderlove: ^^^ basically that
[01:31:10] rgtk: has joined #ruby
[01:31:43] mbfff: Can I just to Service.search and Then make a separate class for the objects that are returned by search?
[01:31:49] Ox0dea: tenderlove: Sure, I've got all that in place, but there you've got the convenience of dispatching to list_append().
[01:31:49] mbfff: just create*
[01:32:32] Ox0dea: Er, rb_str_intern(), rather.
[01:32:41] rgrmatt: has joined #ruby
[01:32:53] chibs: has joined #ruby
[01:32:55] Ox0dea: I'm sure I'm mistaken, but I don't see how to dispatch to parse_numeric() so conveniently.
[01:33:03] rgtk: has joined #ruby
[01:33:25] Ox0dea: Scratch that; I am certainly not mistaken about not seeing that.
[01:34:05] Ox0dea: The trouble, in short, is that parse_numeric() is (extremely) impure.
[01:34:19] tenderlove: parse numeric eats input
[01:34:51] Ox0dea: Does that mean it can't be used in a production rule?
[01:34:58] devoldmx: has joined #ruby
[01:34:59] rgtk_: has joined #ruby
[01:35:01] Joufflu: has joined #ruby
[01:35:02] scottymeuk: has joined #ruby
[01:35:03] tenderlove: tbh, I'm not sure.....
[01:36:46] tenderlove: I would guess that the parsed number is one of the magic $ variables inside the production
[01:36:49] rgtk: has joined #ruby
[01:36:53] tenderlove: and tBLAH is just the token name
[01:37:06] tenderlove: IOW you probably just need that ZARRAY
[01:37:18] tenderlove: and append to it the right $var
[01:37:23] juanpablo__: has joined #ruby
[01:37:42] DLSteve: has joined #ruby
[01:37:51] tenderlove: but I'm *really* guessing
[01:38:00] tenderlove: gtg, dinner time!
[01:38:00] Ox0dea: Huh, I'll give it a shot.
[01:38:07] Ox0dea: tenderlove: Thanks for dropping in.
[01:38:31] eam: there aren't any sequences which parse to NaN / Infinity, are there?
[01:38:41] Ox0dea: mbfff: Yes: https://eval.in/461864
[01:38:47] rgtk: has joined #ruby
[01:38:55] Ox0dea: eam: "Sequences"?
[01:39:04] eam: character sequences
[01:39:21] eam: you have to calculate it - you can't define a literal
[01:39:39] eam: %d[NaN]
[01:39:42] riotjones: has joined #ruby
[01:40:40] mikeharris22: has joined #ruby
[01:40:43] rgtk: has joined #ruby
[01:41:01] Ox0dea: Well, shit. Why you gotta go pokin' holes in it before it's even a thing?
[01:41:18] eam: it's my nature
[01:41:52] Ox0dea: So... what to do about that?
[01:42:06] Rollabunna: has joined #ruby
[01:42:10] Ox0dea: >> Numeric === Float::NAN
[01:42:11] ruboto: Ox0dea # => true (https://eval.in/461866)
[01:42:37] rgtk: has joined #ruby
[01:43:01] eam: you could special case those numeric constants!
[01:43:30] radgeRayden: has joined #ruby
[01:44:31] rgtk: has joined #ruby
[01:45:56] Rinzlit: has joined #ruby
[01:46:23] rgtk_: has joined #ruby
[01:46:37] odigity: I just studied the Dir, IO, File, and File::Stat classes while taking notes. Then I discovered the pathname package in stdlib. Is it worth my time to learn that now, or are the core libraries good enough for most tasks?
[01:47:03] duckpuppy: has joined #ruby
[01:47:24] bruno-: has joined #ruby
[01:47:42] Ox0dea: odigity: Do you mean the core classes?
[01:47:56] eam: odigity: the former are for interacting with files (opening, reading, writing, etc)
[01:48:04] eam: the latter is for manipulating file names as strings
[01:48:13] eam: you'll need both for different use cases
[01:48:17] rgtk: has joined #ruby
[01:48:32] havenwood: odigity: FileUtils in the stdlib is along the lines of the former: http://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html
[01:48:33] odigity: eam, but the File class already has lots of those types of methods (dirname, basename, extname, absolute_path, expand_path...)
[01:48:41] northfurr: has joined #ruby
[01:48:41] Ox0dea: odigity: You want Pathname for platform-independence.
[01:49:01] Ox0dea: It'll use the appropriate separator in #join, for instance.
[01:49:14] odigity: Ox0dea, File class is not platform-independent? it seems to have platform-specific separator constants and all that jazz
[01:49:20] eam: well, so should File.join, no?
[01:49:46] Ox0dea: Yes, I suppose so.
[01:49:52] odigity: that's my point. seems like a lot of redundancy. even within each class. File has absolute_path, expand_path, realdirpath, realpath... all seem to do about the same thing
[01:50:12] rgtk: has joined #ruby
[01:50:19] odigity: I'm trying to build up a cheat sheet for quick reference with simple answers for best tool in different cases, and it's hard to determine that.
[01:50:26] eam: why does Pathname exist, actually?
[01:50:38] Ox0dea: It seems largely vestigial, I agree.
[01:50:40] odigity: eam, now we're getting to the heart of the matter :)
[01:50:45] havenwood: ACTION grabs a pitchfork
[01:51:05] odigity: if it's vestigial, that's good to know so I can focus my attention on the right answers
[01:51:12] eam: the module name is even redundant
[01:51:23] eam: and it also says the same thing twice
[01:51:26] dstarh: has joined #ruby
[01:52:00] Ox0dea: 'Tis a silly class; let's not import it.
[01:52:05] havenwood: "All functionality from File, FileTest, and some from Dir and FileUtils is included, in an unsurprising way. It is essentially a facade for all of these, and more."
[01:52:08] rgtk: has joined #ruby
[01:52:39] odigity: havenwood, so maybe we have it backwards? Pathname is a newer attempt to clean up the overall I/O API surface area of the core?
[01:53:07] havenwood: odigity: FileUtils has useful stuff. For some fun look at Shell: http://ruby-doc.org/stdlib/libdoc/shell/rdoc/Shell.html
[01:53:36] odigity: havenwood, cool, I'll hit that up after I finish reading File
[01:53:39] eam: I'm reading through Pathname and it appears to conflate a bunch of file operations in inappropriate ways
[01:53:56] odigity: eam, example?
[01:54:00] rgtk: has joined #ruby
[01:54:16] odigity: http://stackoverflow.com/questions/12040116/rubys-dir-vs-file-vs-pathname
[01:54:19] eam: a Pathname isn't just syntactic manipulation of a filename in the abstract - it appears to stat() an actual file on your local filesystem as well
[01:54:29] eam: you usually wouldn't want that
[01:54:53] kayloos: has joined #ruby
[01:54:54] eam: odigity: the underlying unix interfaces are pretty careful to separate the two concerns
[01:55:39] eam: an actual filesystem syscall is going to be several orders of magnitude slower than syntactic manipulation of a path string
[01:55:54] rgtk: has joined #ruby
[01:56:08] odigity: eam, that seems at odds with the comments I just read, one sec
[01:56:37] odigity: "It does not represent the file itself. A Pathname can be relative or absolute. It???s not until you try to reference the file that it even matters whether the file exists or not.
[01:56:37] odigity: Pathname is immutable. It has no method for destructive update."
[01:57:14] odigity: it does have an .exist? method that obviously must check the FS, but it seems like the intent is to give you the ability to manipulate names independent of the FS until you're ready to resolve to a file
[01:57:16] eam: that's saying it's only modified inside new()
[01:57:36] al2o3-cr: has joined #ruby
[01:57:46] Rollabunna: has joined #ruby
[01:57:48] rgtk: has joined #ruby
[01:57:49] eam: odigity: it does things like tell you the size of the file, and what kind of file it is (directory, etc)
[01:57:52] eam: that can only be done with a syscall
[01:58:18] chihhsin: has joined #ruby
[01:58:20] odigity: eam, well, in most cases if I'm working with a filename, it's because I plan to use it. so that's not such a downside. and I kind of like the idea of wrapping paths as first-class objects.
[01:58:49] eam: that's probably the spirit behind the module. I maintain the separation of concerns is a mistake :)
[01:58:50] odigity: now if both String and Pathname had a .to_path method, we'd be in normalization heaven...
[01:59:11] Ox0dea: eam: *conflation of concerns
[01:59:21] odigity: I figured that's what eam meant
[01:59:23] rgrmatt: has joined #ruby
[01:59:27] Ox0dea: You can't tell me what to do.
[01:59:38] Ox0dea: 2.3.0 $ find -type f -print0 | wc -l --files0-from=- | tail -1
[01:59:41] rgtk: has joined #ruby
[01:59:41] Ox0dea: 232362 total
[01:59:42] Ox0dea: That's... a lot.
[01:59:45] eam: Ox0dea: indeed :)
[01:59:53] eam: lack of separation
[02:00:05] Ox0dea: Biggest standard library evar?
[02:00:33] Ox0dea: No, I'm sure that title goes to Factor's.
[02:00:40] odigity: it's pretty damn big. it's kind of insane and scary, actually. I bet the maintainers wish they could go back and not accept some things for inclusion
[02:01:30] eam: odigity: Pathname lazy-evals fields like #size - so it does modify itself
[02:01:30] mack25: has joined #ruby
[02:01:32] jhack: has joined #ruby
[02:01:34] Ox0dea: Factor's stdlib has a reddit module: https://github.com/slavapestov/factor/tree/master/extra/reddit
[02:01:35] rgtk: has joined #ruby
[02:01:37] jhack: has left #ruby: ()
[02:02:09] odigity: Ox0dea, clearly they're abusing the notion of "standard" and should be thrown out of this survey as a fraudulent outlier :)
[02:02:18] odigity: eam, the docs lied to us again!
[02:02:35] eam: in fact, it doesn't just lazy eval, it appears to return current stat() data every access
[02:02:35] Ox0dea: odigity: Well, but, it ships with the distribution?
[02:02:37] odigity: I kind of wish the openssl docs would lie to me. Anything is better than the silent treatment...
[02:02:58] odigity: eam, that's a little disturbing. remind me to cache the result myself....
[02:03:06] eam: just use File.stat :)
[02:03:16] eam: you'll have parity with the entire rest of unix
[02:03:34] rgtk: has joined #ruby
[02:03:47] odigity: Ox0dea, if Factor includes a reddit module in their "standard" library, then I have to question the definition of "standard". Just like I question the definition of "canon" when applied to the Star Wars prequels. I know that's technically correct language, but I simply don't accept it. :)
[02:04:32] EminenceHC: has joined #ruby
[02:04:43] Ox0dea: odigity: In that case, I am interested in learning your definition of "standard library".
[02:04:56] Ox0dea: (I see where you're coming from, mind.)
[02:05:02] eam: well ruby isn't standardized so
[02:05:03] odigity: Pathname was added in 1.9 according to this: http://www.sitepoint.com/rubys-pathname-api/
[02:05:07] opensource_ninja: has joined #ruby
[02:05:22] Ox0dea: eam: But there's an ISO spec.
[02:05:25] rgtk: has joined #ruby
[02:05:31] eam: is there?
[02:05:34] Ox0dea: There is.
[02:05:45] Ox0dea: http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=59579
[02:05:52] odigity: Ox0dea, I don't have a good one. it's one of those "I know it when I see it", things. for now, let's define it as "that which the language maintainers call standard, unless it includes a reddit module", with the caveat that it will need revision in the future
[02:06:00] eam: uh oh, based on 1.8.7?
[02:06:13] eam: so this isn't standard!
[02:06:14] tkuchiki: has joined #ruby
[02:06:24] odigity: tell the ISO to get their hands off my ruby
[02:06:47] eam: when people tell me not to use => I'm just gonna point at the ISO standard
[02:07:15] blackmes1: has joined #ruby
[02:07:16] odigity: I thought we're encouraged to use => for the widest compatibility, at least in our gems. (I don't, but I know it's encouraged)
[02:07:18] rgtk: has joined #ruby
[02:07:24] Ox0dea: odigity: 1.8.7 is kill.
[02:07:31] eam: I use it so I can pretend I'm writing perl
[02:07:45] odigity: I'm on 2.2.3, but I have no one to answer to, so I have that luxury.
[02:07:52] eam: and because, if I'm going to be completely honest, I find foo: :bar rather hard to read
[02:07:57] mordocai: has joined #ruby
[02:08:07] Ox0dea: `=>` is shit, and almost entirely responsible for why we can't have `>` and `<` as unary operators.
[02:08:08] tkuchiki: has joined #ruby
[02:08:09] odigity: eam, that's the one use case I dislike. but I'm not about to start sticking => in place there.
[02:08:29] eam: fat comma 4 lyfe
[02:08:33] odigity: Ox0dea, => is still important for literal hashes with non-symbol keys, which are common -- like http headers.
[02:08:56] Ox0dea: odigity: Most HTTP libraries are agnostic in that regard.
[02:09:13] rgtk: has joined #ruby
[02:09:15] Ox0dea: But I take your point.
[02:09:27] odigity: Ox0dea, most HTTP libraries do not document their behavior in that regard. I just spent several days last week reading up on and trying out rest-client and httparty. It was frustrating.
[02:09:44] arescorpio: has joined #ruby
[02:09:54] odigity: I'm thinking of trying curb, next.
[02:09:57] Ox0dea: I've only just noticed you use two spaces.
[02:10:01] Ox0dea: We can't be friends.
[02:10:15] odigity: Ox0dea, this isn't the first time someone got upset with me about that.
[02:10:40] Ox0dea: You're an angel if it's the last.
[02:10:43] odigity: I also line up my code into columns based on naturally emergent token patterns. I like visual order.
[02:10:45] VeryBewitching: Ox0dea: When I was taught typing, formally, we were taught to use two spaces after a sentence.
[02:10:56] Ox0dea: VeryBewitching: I know the cause.
[02:11:03] Ox0dea: I broke those particular shackles long ago.
[02:11:08] rgtk: has joined #ruby
[02:11:17] odigity: VeryBewitching, I was taught the same, but that's not why I still do it. I do it because I agree with it. I disagree with "punctuation goes in the quote", so I don't do that.
[02:11:21] Ox0dea: Terminal punctuation serves just fine as the separator.
[02:11:26] eam: similarly, I'm using cursive right now with an OCR to IRC program
[02:11:35] odigity: eam, I am impressed
[02:11:36] chihhsin: has joined #ruby
[02:11:55] ReallyNotReally: has joined #ruby
[02:11:57] Ox0dea: odigity: Punctuation goes outside the quote, lest you risk misquoting.
[02:12:06] odigity: odigity, sometimes I'll need to sign someone else's name on a check for convenience (with their consent), and I get stuck, because I can't remember any cursive other than my own name
[02:12:22] VeryBewitching: eam: I don't even think I could write cursive characters anymore. It's been about twenty years.
[02:12:35] odigity: ok, back to work
[02:12:38] Ox0dea: Fucking minuscule Ms.
[02:12:39] eam: in fact I cannot either. I can barely print. My hand cramps when I have to fill out a form
[02:12:54] luckyme: has joined #ruby
[02:12:55] ReallyNotReally: Hi everyone. I???m just learning Ruby and it???s really great so far
[02:12:59] lessless: has joined #ruby
[02:12:59] rgtk: has joined #ruby
[02:13:01] eam: my teachers said I would never be able to get a good job without cursive
[02:13:03] Ox0dea: ReallyNotReally: Really?
[02:13:07] odigity: ReallyNotReally, I can't tell if you're serious or not.
[02:13:13] havenwood: odigity: Curb is nice. Maybe give HTTP.rb and Typhoeus a look as well.
[02:13:21] Ox0dea: ACTION brings up a few packets of troll food just in case.
[02:13:31] sanjayu: has joined #ruby
[02:13:36] davedev24: has joined #ruby
[02:13:49] ReallyNotReally: lol. I figured it would be better than some goofy shit that sounds like I???m 12???wait a min...
[02:13:52] odigity: havenwood, I checked out Typhoeus, seems about as active as curb and roughly equivalent, but with a focus on parallelism, which I don't need right now, and curb is easier to type. :) don't know HTTP.rb
[02:13:57] havenwood: ReallyNotReally: Ruby was made for programmer happiness. Is it not making you happy?
[02:14:08] havenwood: ReallyNotReally: Be nice.
[02:14:34] havenwood: odigity: https://github.com/httprb/http#readme
[02:14:46] ReallyNotReally: making me happy? Well not really experienced enough yet to say that. Still in undergrad
[02:14:51] rgtk: has joined #ruby
[02:15:13] odigity: havenwood, cool, I'll check it out. also, why are there so many damn http gems?
[02:15:19] Ox0dea: odigity: It's 2015.
[02:15:34] odigity: I had to stop using rest-client because I couldn't make it not follow a redirect. I managed to prevent it in httparty, but it took some work.
[02:15:37] havenwood: ReallyNotReally: Are any of the languages you've come across so far great?
[02:16:13] speakingcode: has joined #ruby
[02:16:22] ReallyNotReally: havenwood, Ruby is so far :)
[02:16:28] odigity: Ox0dea, sure, but usually gems thrive or die depending on their relative superiority to alternatives + momentum. I would have figured that by now only 2-3 would still be active, having succeded in the evolutionary battleground -- not ten.
[02:16:31] Ox0dea: ReallyNotReally: What's your favorite feature?
[02:16:41] havenwood: ReallyNotReally: "I???m just learning Ruby and it???s really great so far"
[02:16:46] odigity: maintaining a gem is work. why do the work if your gem isn't better than others in at least a niche if not overall?
[02:16:47] rgtk: has joined #ruby
[02:17:11] Ox0dea: odigity: Nepotism, if nothing else.
[02:17:27] havenwood: ReallyNotReally: http://ruby-community.com/pages/user_rules
[02:17:34] ReallyNotReally: havenwood: i guess blocks, but maybe its programmer freedom to choose is its best feature ala Perl
[02:17:49] odigity: I'm a big fan of curated selection. gimme good choices, but not more than makes sense. CostCo/Sam's Club have great buying depts that do this, which is why you choose from 3-5 microwaves, not 30. it's a time saver because they do a lot of filtering work for you.
[02:18:03] shevy: odigity it sorta depends a lot of the gem itself and the scope of the project. For instance, I think the prawn gem is fairly nice and I think that it would be best if people support it, if they have to do something related to ruby + pdf; but for many small gems, I feel that the differences to other existing gems that do something fairly similar, is very often just minor, often just a difference in style
[02:18:26] shevy: let's be honest - a lot of the gems on rubygems.org are quite old
[02:18:31] odigity: You want an ORM? Rails, Sequel, DataMapper. different experiences, all well supported, pick one of three -- not ten.
[02:18:37] rgtk: has joined #ruby
[02:19:37] shevy: yeah the ruby web world got a lot of manpower working away at things
[02:19:54] Ox0dea: Curse you, DHH!
[02:20:15] odigity: You want an app server? thin for evented, puma for threads, unicorn for neither. easy-peasey
[02:20:23] shevy: I knew of only two pdf things in ruby; one was prawn, the other one was fpdf, which was based on the php fpdf, and the style was ugly; https://rubygems.org/gems/fpdf/versions/1.53 last release 2008
[02:20:32] rgtk: has joined #ruby
[02:20:36] dopamean_: has joined #ruby
[02:21:02] odigity: You want a web framework? sinatra at the bottom, rails at the top, padrino in the middle, grape for rest APIs, and 2-3 others with traction designed around novel alternate models. all well-differentiated, so the space can handle 5-6 contentders in that case.
[02:21:02] havenwood: ReallyNotReally: <3 Glad you're having fun learning!
[02:21:08] Ox0dea: Prawn, ChunkyPNG, Kiba; there are plenty of gems which are plainly the best at what they do.
[02:21:26] odigity: Ox0dea, yes, exactly. I love those cases -- so much research time saved.
[02:21:32] druonysus: has joined #ruby
[02:21:32] druonysus: has joined #ruby
[02:21:32] shevy: if we could fund more projects like prawn!
[02:21:33] havenwood: ReallyNotReally: This is a good place for code review if you have any questions as you proceed.
[02:21:34] Ox0dea: odigity: Rack is at the bottom there, mind.
[02:21:36] odigity: But not when it comes to http libs, for some damn unknown reason.
[02:21:44] odigity: Ox0dea, good point.
[02:21:46] RobertBirnie: has joined #ruby
[02:21:54] havenwood: ReallyNotReally: I've also learned a lot trying to answer questions here.
[02:22:21] ReallyNotReally: havenwood: Thanks. I think I want to learn enough Ruby to do technical interviews. Things are so much easier to do in this language
[02:22:26] rgtk: has joined #ruby
[02:22:50] Ox0dea: ReallyNotReally: How do I create a well and truly immutable String in Ruby? :P
[02:24:03] Ox0dea: Spoiler: some things are impossible to do in this language.
[02:24:20] rgtk: has joined #ruby
[02:24:44] havenwood: Ox0dea: Suggest nicely it not be mutated and wish for the best.
[02:24:54] Ox0dea: havenwood: There is certainly some wisdom to that.
[02:24:58] odigity: I think the ruby community needs to stage an intervention. Invite maintainers from rest-client, faraday, httparty, excon, multipart-post, httpclient, curb, typhoeous, http.rb, and httpi to a panel at a conference, and open with: "WTF?"
[02:25:04] ReallyNotReally: Ox0dea: isn???t that when you would use frozen?
[02:25:15] odigity: Look at the curve of those columns: https://www.ruby-toolbox.com/categories/http_clients
[02:25:20] yaewa: has joined #ruby
[02:25:25] odigity: I've never seen such an indecisive toolbox category.
[02:25:29] Ox0dea: ReallyNotReally: Sure, but it's possible to unfreeze things.
[02:25:42] odigity: (end rant)
[02:25:59] ellisTAA: has joined #ruby
[02:26:17] radgeRayden_: has joined #ruby
[02:26:18] rgtk: has joined #ruby
[02:27:06] ReallyNotReally: so which book is liked more? Pickaxe or Well Grounded
[02:27:33] Ox0dea: odigity: The criticism is valid, but I can only invite you to meditate on Gandhi in these trying times: "Be the change you wish to see in the world."
[02:27:41] havenwood: ReallyNotReally: I'd think Well-Grounded would make for a better read rather than reference. Be sure to get the second edition.
[02:28:10] rgtk: has joined #ruby
[02:29:19] ReallyNotReally: havenwood: I was thinking the same thing. Seems like something I will use. I really haven???t understood OO in Ruby yet..feels complicated
[02:29:29] houhoulis: has joined #ruby
[02:30:04] rgtk: has joined #ruby
[02:30:45] havenwood: odigity: rest-client and httparty are Net::HTTP wrappers, curb and typhoeus are libcurl, excon and httpclient are pure ruby, and faraday and httpi are adapters to other clients
[02:31:19] drbrain: mechanize is a wrapper of a Net::HTTP wrapper
[02:31:30] pontiki: has joined #ruby
[02:31:54] havenwood: wrapper wrapping inception
[02:31:54] rgtk: has joined #ruby
[02:33:50] rgtk: has joined #ruby
[02:35:11] stannard: has joined #ruby
[02:35:25] ReallyNotReally: has left #ruby: ()
[02:35:42] rgtk: has joined #ruby
[02:36:16] mattwildig: has joined #ruby
[02:36:20] skweek: has joined #ruby
[02:37:40] rgtk: has joined #ruby
[02:37:59] cmoney: has joined #ruby
[02:39:33] rgtk: has joined #ruby
[02:39:34] JDiPierro: has joined #ruby
[02:41:22] rgtk: has joined #ruby
[02:43:21] rgtk: has joined #ruby
[02:44:21] colegatron: has joined #ruby
[02:44:59] skweek: has joined #ruby
[02:45:12] rgtk: has joined #ruby
[02:46:44] chibs: has joined #ruby
[02:46:55] rgtk: has joined #ruby
[02:47:06] Bloomer: has joined #ruby
[02:47:25] nertzy: has joined #ruby
[02:48:23] bruno-: has joined #ruby
[02:48:38] tkuchiki: has joined #ruby
[02:48:53] pontiki: has joined #ruby
[02:48:58] rgtk: has joined #ruby
[02:50:04] havenwood: pontiki: hey
[02:50:05] Rinzlit: has joined #ruby
[02:50:52] rgtk: has joined #ruby
[02:52:04] odigity: havenwood, I knew some but not all of that, thanks. I like the idea of trying curb next because curl is the gold standard; seems like a promising approach, plus speed is nice (though rarely a priority for me)
[02:52:25] odigity: BTW-I highly recommend looking through pathname, for those who caught the earlier convo. It's pretty damn awesome.
[02:52:45] rgtk: has joined #ruby
[02:53:04] odigity: Reading it is giving me the kind of joy I usually get from a great gem -- rarely experience that with the stdlib.
[02:54:27] odigity: I think it was a python programmer who said "stdlib is where packages go to die". It's quite true.
[02:54:41] odigity: The opposite of decoupling.
[02:54:43] rgtk: has joined #ruby
[02:56:35] rgtk: has joined #ruby
[02:58:08] skweek: has joined #ruby
[02:58:26] rgtk: has joined #ruby
[03:00:23] rgtk: has joined #ruby
[03:02:02] zenguy_pc: has joined #ruby
[03:02:15] rgtk: has joined #ruby
[03:03:34] rbennacer: has joined #ruby
[03:03:44] rickmasta: Hey guys, I have the following code: http://pastie.org/private/yinn6xh0jua4p6hqb5dq
[03:03:56] zenguy_pc: has joined #ruby
[03:04:08] rgtk: has joined #ruby
[03:04:29] rickmasta: Whenever I remove the commenting from lines 13,14,15, and 20. It tells me that things are included in the array that are not actuall included.
[03:04:58] minimalism: has joined #ruby
[03:06:00] moeabdol: has joined #ruby
[03:06:05] hxegon: has joined #ruby
[03:06:06] rgtk: has joined #ruby
[03:07:57] rgtk: has joined #ruby
[03:08:28] Ox0dea: hxegon: FileUtils.rm Dir['**/*.m4a'] & Dir['**/*.mp3'].map { |f| f.sub /mp3$/, 'm4a' }
[03:08:36] Ox0dea: That's what we ended up with.
[03:08:41] swgillespie: has joined #ruby
[03:09:49] rgtk: has joined #ruby
[03:10:36] gambl0re: has joined #ruby
[03:11:21] blackmes1: has joined #ruby
[03:11:47] rgtk: has joined #ruby
[03:13:34] rakm: has joined #ruby
[03:13:39] rgtk_: has joined #ruby
[03:14:02] i: has joined #ruby
[03:14:46] cacam9621: has joined #ruby
[03:14:47] rbennacer: has joined #ruby
[03:15:09] bigmac_: has joined #ruby
[03:15:32] Ox0dea: Rickmasta: #include? isn't lying to you: https://eval.in/461868
[03:15:33] cantaberry: has joined #ruby
[03:15:35] rgtk_: has joined #ruby
[03:16:47] cmoney: has joined #ruby
[03:17:26] rgtk: has joined #ruby
[03:19:05] mozzarella: has joined #ruby
[03:19:23] rgtk: has joined #ruby
[03:20:59] terminalrecluse: has joined #ruby
[03:21:08] hxegon: Ox0dea: Very nice. with some tweaking I might actually prefer that to the bash version
[03:21:12] rgtk: has joined #ruby
[03:21:13] Ox0dea: Rickmasta: The problem is you're doing mutation all over the place and it's gotten away from you.
[03:21:24] Ox0dea: hxegon: Ooh, could I see the Bash version?
[03:21:36] s00pcan: has joined #ruby
[03:21:43] hxegon: Ox0dea: sure, give me a sec
[03:21:53] Ox0dea: I like the "anonymity" of my approach.
[03:21:56] Ox0dea: Naming things is hard.
[03:23:08] rgtk: has joined #ruby
[03:23:36] machan: has joined #ruby
[03:23:45] dhollinger: has joined #ruby
[03:23:50] Ox0dea: Rickmasta?
[03:25:02] rgtk: has joined #ruby
[03:25:08] Ox0dea: The mutants have taken him; he will be missed.
[03:26:08] juanpablo__: has joined #ruby
[03:26:57] rgtk: has joined #ruby
[03:27:28] favadi: has joined #ruby
[03:28:47] rgtk: has joined #ruby
[03:30:16] favadi: has joined #ruby
[03:30:40] rgtk: has joined #ruby
[03:31:54] rickmasta: Ox0dea: I'm sorry about that.
[03:32:01] Ox0dea: Rickmasta: No worries.
[03:32:01] jobewan: has joined #ruby
[03:32:16] rickmasta: but when I don't include those statements, I get the correct answer.
[03:32:18] Eiam_: has joined #ruby
[03:32:53] rickmasta: Well, kind of. The question asked for unique substrings. My answer was 55, and the correct answer was 53 because two substrings were repeated.
[03:33:46] Ox0dea: Rickmasta: For which input, if you don't mind?
[03:34:50] devbug: has joined #ruby
[03:34:56] RegulationD: has joined #ruby
[03:35:26] hxegon: Ox0dea: haven't tested this out, and not honoring the letter of the challenge, but... rm -f **/*.m4a && ls **/*.mp3 | cut -d'.' -f1 | xargs -n 1 ffmpeg -i {}.mp3 -c:a libfaac -vn {}.m4a
[03:36:00] Ox0dea: Rickmasta: You are *printing* the correct substrings, but the task was to collect them, yeah?
[03:36:17] hxegon: Ox0dea: I mean he said he was converting nested mp3 files to m4a, so why not do the whole thing right?
[03:36:29] rickmasta: Nah. The tast was to find the number of unique substrings.
[03:36:30] Ox0dea: hxegon: You're removing all the .m4a files right at the start...
[03:36:48] Ox0dea: hxegon: Oh... well, yeah, that's one way to go about it, I guess.
[03:36:55] rickmasta: So I used an array to collect the substrings that I found and compare each new substring with the array to see if it was already counted.
[03:37:22] Ox0dea: Rickmasta: Right, only that didn't go so well, and it's because the `temp` on Line 10 isn't always what you think it is.
[03:37:23] rickmasta: in kincenvizh "i" and "n" appear twice.
[03:37:36] Ox0dea: Rickmasta: You know that #slice! is destructive, I trust?
[03:37:53] hxegon: Ox0dea: not that you couldn't do that nicely in ruby... Dir['**/*.mp3'].each { |f| `ffmpeg...
[03:37:57] rickmasta: what do you mean Ox0dea?
[03:38:15] Ox0dea: Rickmasta: #slice! (the "bang" version of #slice) modifies the string in-place.
[03:38:29] rickmasta: yeah I know
[03:38:30] duckpuppy: has joined #ruby
[03:39:08] rickmasta: thats why outside of the first loop, it slices once.
[03:39:25] Ox0dea: Rickmasta: But it's *inside* the first loop.
[03:39:56] rickmasta: it doesn't run on the first loop though, because if the if statement around it.
[03:40:10] rickmasta: https://eval.in/private/7bd7c1db293f5f
[03:40:31] riotjones: has joined #ruby
[03:40:43] rickmasta: If I'm not mistaken that one is correct barring the "n" and the "i" that it counts twice.
[03:40:57] Ox0dea: Rickmasta: Well, sure, but look at all these empty strings you're collecting.
[03:41:36] Ox0dea: You don't have any duplicates (other than those empties), but you're also missing quite a few.
[03:42:17] prereflect: has joined #ruby
[03:43:45] bigmac_: im trying to create a dual repeated_permutation hash '1111'=>'a'
[03:44:03] Ox0dea: Rickmasta: Would you like to see how I solved it?
[03:44:04] bigmac_: [0,1].repeated_permutation(4).map(&:join)
[03:44:27] bigmac_: ("a".."z").repeated_permutation(1).map(&:join)
[03:44:31] bigmac_: ("a".."z").repeated_permutation(2).map(&:join)
[03:44:58] bigmac_: kinda tricky to explain... i have started a rubyforums thread
[03:44:58] Ox0dea: bigmac_: Too much how.
[03:45:10] Eiam_: has joined #ruby
[03:45:26] chibs: has joined #ruby
[03:45:28] ellisTAA: has joined #ruby
[03:45:39] bigmac_: not a accurate example above
[03:45:54] Joufflu: has joined #ruby
[03:45:54] bigmac_: ("a","b","c").repeated_permutation(1).map(&:join)
[03:46:01] bigmac_: [0,1].repeated_permutation(4).map(&:join)
[03:46:27] bigmac_: so, the math portion, does not add up, with abc when its depth is 1, so i want to increase
[03:46:39] rickmasta: temp is added to the collection right after the puts statement. I don't get why the array has empty strings and there aren't any in the puts statement.
[03:46:43] bigmac_: until the math adds up for both repeated_permutation
[03:47:00] bigmac_: ("a","b","c").repeated_permutation(1).map(&:join)
[03:47:03] bigmac_: ("a","b","c").repeated_permutation(2).map(&:join)
[03:47:05] bigmac_: ("a","b","c").repeated_permutation(3).map(&:join)
[03:47:10] rickmasta: mind explaining, Ox0dea?
[03:47:25] Ox0dea: >> foo = 'x'; foo.slice!(0); foo # Rickmasta
[03:47:26] ruboto: Ox0dea # => "" (https://eval.in/461876)
[03:47:28] bigmac_: until the size is equal to 0,1**4 (depth)
[03:47:32] Ox0dea: bigmac_: Stop.
[03:47:45] bigmac_: can i share my forums post
[03:47:59] bigmac_: https://www.ruby-forum.com/topic/6876974
[03:48:07] hxegon: bigmac_: this is a do-ocracy
[03:48:19] axisys: what is ?: means in regex ? I am reading this URI_PARSER regex which suppose to extract fields from [username[:password]@]hostname
[03:48:22] axisys: https://github.com/vmware/rvc/blob/master/lib/rvc/uri_parser.rb
[03:48:35] Ox0dea: axisys: Group, but don't capture.
[03:48:46] diegoaguilar: has joined #ruby
[03:49:44] Ox0dea: >> s = 'abc123'; [s =~ /(\d+)/, $1, s =~ /(?:\d+)/, $1] # axisys
[03:49:45] ruboto: Ox0dea # => [3, "123", 3, nil] (https://eval.in/461877)
[03:49:53] krz: has joined #ruby
[03:50:09] d5sx43: has joined #ruby
[03:50:15] mattwildig: has joined #ruby
[03:50:40] axisys: Ox0dea: thanks
[03:50:47] Ox0dea: axisys: Sure thing.
[03:51:08] rickmasta: Ox0dea: yeah but that's why I'm not doing "foo = foo.slice!(0)"
[03:51:22] Ox0dea: Rickmasta: Aha, but therein lies the rub!
[03:52:14] Ox0dea: The modification is being made in-place; it's *mutating* the receiver.
[03:52:19] Guest97: has joined #ruby
[03:52:49] rickmasta: isn't foo.slice!(0) the same as foo = foo.slice(0)?
[03:52:50] mozzarella: has joined #ruby
[03:53:21] Ox0dea: Rickmasta: Not if the string is empty.
[03:53:38] Ox0dea: Most bang methods return nil if they could've but didn't make a change.
[03:53:45] axisys: Ox0dea: URI_REGEX should catch the password correctly if there is no '@' in it .. right?
[03:54:29] devoldmx: has joined #ruby
[03:54:35] bluOxigen: has joined #ruby
[03:55:08] AMERICAN_PSYCHO: has joined #ruby
[03:56:27] Ox0dea: axisys: URI_REGEX is purposely not capturing anything.
[03:56:55] Ox0dea: If you meant "match", yes, that pattern matches any number of non-@ characters, including zero.
[03:57:00] axisys: Ox0dea: it is at a later def .. right
[03:57:14] axisys: Ox0dea: thanks
[03:57:19] Ox0dea: axisys: Happy to help.
[03:57:34] PlasmaStar: has joined #ruby
[03:57:53] idefine: has joined #ruby
[03:57:56] KlineAcc: has joined #ruby
[03:58:07] KlineAcc: is it possible to develop in a vm?
[03:58:47] KlineAcc: i would like to develop in a virtual machine
[03:58:52] KlineAcc: is this a good idea and is it possible?
[03:58:57] KlineAcc: if so what is a good distribution?\
[04:01:47] futilegames: has joined #ruby
[04:01:52] bricker: has joined #ruby
[04:05:05] RegulationD: has joined #ruby
[04:06:16] Ox0dea: Rickmasta: https://eval.in/461888
[04:07:01] Ox0dea: Come, abandon your mutative ways and see the light of functional programming.
[04:07:21] axisys: Ox0dea: what is x for in %r{ .. }x ?
[04:07:27] rickmasta: I was worried that I would see your program and then know how to do it and not figure it out myself.
[04:07:34] Oatmeal: has joined #ruby
[04:07:41] rickmasta: But I see your program and mostly have no idea what's going on. haha
[04:07:44] Ox0dea: axisys: It permits the regular expression to span multiple lines, but of course whitespace then becomes insignificant.
[04:07:54] Ox0dea: Rickmasta: Excellent. :P
[04:07:59] Ox0dea: #map is your friend every time.
[04:08:34] Ox0dea: String#[] is really just #slice in disguise.
[04:08:49] notnoyyyyy: has joined #ruby
[04:09:10] axisys: Ox0dea: ok
[04:09:34] Ox0dea: axisys: It does help with the legibility of complex expressions, don't you think?
[04:10:26] braincrash: has joined #ruby
[04:12:03] blackmes1: has joined #ruby
[04:12:15] axisys: Ox0dea: big time.. yep
[04:12:47] Ox0dea: axisys: You just have to be mindful to say \s if you do in fact want to match a space.
[04:12:53] Ox0dea: That's bitten me before.
[04:13:46] axisys: hopefully no user will have a space in their password :-)
[04:13:51] wprice: has joined #ruby
[04:13:54] Ox0dea: I'd do it. :P
[04:14:01] Ox0dea: My Unix password is the Konami code.
[04:14:22] Ox0dea: As in, I input my password with the Arrow keys...
[04:14:30] axisys: Ox0dea: so you saying URI_REGEX needs improvement?
[04:14:33] baweaver: has joined #ruby
[04:14:40] Ox0dea: axisys: When did I say that...?
[04:14:56] axisys: Ox0dea: sorry I misread
[04:15:34] Ox0dea: axisys: /[^@]*/ matches spaces just fine.
[04:16:03] axisys: Ox0dea: right right.. doh
[04:16:32] kp666: has joined #ruby
[04:17:41] Ox0dea: >> [/ /x.match(' '), /\s/x.match(' ')] # axisys
[04:17:43] ruboto: Ox0dea # => [#<MatchData "">, #<MatchData " ">] (https://eval.in/461902)
[04:17:55] ducklobster: has joined #ruby
[04:18:28] RobertBirnie: has joined #ruby
[04:18:58] darkf: has joined #ruby
[04:20:44] _djbkd: has joined #ruby
[04:21:03] gix: has joined #ruby
[04:21:16] rickmasta: I still can't figure out what is going on in this program. lol
[04:21:21] ducklobster: hi all, i'm vaguely familiar with the to_proc shorthand (&:method) but having some trouble passing a parameter
[04:21:27] ducklobster: [1, 2, 3].map(&:to_s(16))
[04:21:40] ducklobster: how do i pass an argument to the short handed proc?
[04:23:26] swgillespie: has joined #ruby
[04:23:42] Ox0dea: Rickmasta: So, for a string of length 3, the substrings (as start->length) are 0->1, 0->2, 0->3, 1->1, 1->2, 2->1.
[04:23:49] hakunin: has left #ruby: ()
[04:23:53] Ox0dea: Do you see a pattern? Try writing it out for a string of length 4 if not.
[04:24:00] sankaber: has joined #ruby
[04:24:08] Ox0dea: ducklobster: You can't. :<
[04:24:14] Ropeney: has joined #ruby
[04:24:20] danman: has joined #ruby
[04:24:26] Ox0dea: But see Uberscore: https://gist.github.com/0x0dea/628de90e12acc1874a9a
[04:24:36] Ox0dea: And then pretend it's not real.
[04:24:47] rickmasta: yup I get your program. I also understand why it's better and simpler
[04:24:51] sankaber: has joined #ruby
[04:25:05] rickmasta: but I was just trying to finish my own anyway just for the sake of it.
[04:25:32] ducklobster: Ox0dea: thanks!
[04:25:43] ducklobster: why pretend its not real btw?
[04:26:38] graydot: has joined #ruby
[04:28:01] Ox0dea: ducklobster: You've got a point. Symbol#to_proc really ought to be able to do arguments, huh?
[04:28:38] Ox0dea: >> s = 'foo'; [s.slice!(0), s] # Rickmasta
[04:28:39] ruboto: Ox0dea # => ["f", "oo"] (https://eval.in/461906)
[04:29:23] idefine: has joined #ruby
[04:29:25] Ox0dea: #slice returns what it removed, and then the original receiver is missing those parts; they've been sliced away.
[04:29:32] rickmasta: s = ["f","oo"]
[04:29:46] baweaver: ACTION still doesn't like no-parens
[04:29:55] baweaver: ACTION thinks it prevents aforementioned useful arg passing
[04:29:59] rickmasta: blah I meant to type more than that. haha
[04:30:13] rickmasta: s returns ["f","oo"]?
[04:30:24] Ox0dea: Rickmasta: What's happening is that you're mutating a String that's already in the collection.
[04:30:27] baweaver: ACTION also tends to use an obscene amount of lambdas
[04:30:37] unclouded: has joined #ruby
[04:30:47] duncannz: has joined #ruby
[04:30:55] Ox0dea: So that when you get to the part of your loop that "generates" that String (ostensibly for the first time), it's actually already in there.
[04:30:57] cmoney: has joined #ruby
[04:31:31] Ox0dea: Rickmasta: I'm only using Arrays to show you more than one value with ruboto.
[04:32:11] baweaver: ACTION enjoys the third person
[04:32:38] rickmasta: ok, I'm gonna start from scratch.
[04:33:02] Ox0dea: Rickmasta: Not completely! :P
[04:33:09] Ox0dea: You cannot shield your eyes forever.
[04:33:31] Ox0dea: The functional bug is inside you now. <3
[04:33:59] purplexed-: has joined #ruby
[04:37:36] cmoney: has joined #ruby
[04:38:51] patdohere: has joined #ruby
[04:40:35] rickmasta: Ox0dea: https://eval.in/private/ec0f5cd4dcf676
[04:41:10] baweaver: ACTION wishes to convey a sense of woo
[04:41:19] Ox0dea: And there was much rejoicing.
[04:41:25] rickmasta: but I still don't understand why slice didn't work? lol
[04:41:30] shinenelson: has joined #ruby
[04:41:31] baweaver: ACTION blows party whistle
[04:41:53] yfeldblum: has joined #ruby
[04:42:57] xaxisx_: has joined #ruby
[04:43:06] Ox0dea: Rickmasta: It's #slice! (note the bang) that was giving you trouble.
[04:43:22] Ox0dea: In one place you were using the return value, elsewhere you were using the mutated receiver.
[04:43:32] Ox0dea: As previously demonstrated, those are hardly the same thing.
[04:44:56] rickmasta: I guess I need to read up more on the bang.
[04:45:34] n40391: has joined #ruby
[04:45:50] n40391: best vm Ubuntu dev environment?
[04:45:58] Meow-J: has joined #ruby
[04:47:40] lkba_: has joined #ruby
[04:50:42] graydot: has joined #ruby
[04:54:23] jaequery: has joined #ruby
[04:55:14] v4n: has joined #ruby
[04:55:36] zenguy_pc: has joined #ruby
[04:56:15] mistermocha: has joined #ruby
[04:57:57] m3_del: has joined #ruby
[04:59:05] skade: has joined #ruby
[04:59:26] patdohere: has joined #ruby
[05:00:31] tcrypt: has joined #ruby
[05:00:36] mndoci: has joined #ruby
[05:02:35] abkabkabk: has joined #ruby
[05:03:16] patdohere: has joined #ruby
[05:04:25] abkabkabk: http://imgur.com/HLAfj64 :: We borg now son!
[05:05:00] avahey: has joined #ruby
[05:05:35] sanjayu: has joined #ruby
[05:05:52] m3_del: has joined #ruby
[05:08:15] tmtwd: has joined #ruby
[05:09:40] havenwood: !kick abkabkabk Desprez Opening
[05:09:41] ruboto: ruboto kicked abkabkabk: Opening
[05:09:41] ruboto: -o ruboto
[05:12:14] Ox0dea: havenwood: That is the most esoteric and erudite kick reason I've ever seen.
[05:12:38] Ox0dea: It works so well, though.
[05:12:49] blackmes1: has joined #ruby
[05:13:20] baweaver: you will be assimilated/upgraded/exterminated
[05:13:22] rickyrickyrice: has joined #ruby
[05:14:53] juanpablo__: has joined #ruby
[05:17:32] EminenceHC: has joined #ruby
[05:18:40] zotherstupidguy: has joined #ruby
[05:20:58] charany1: has joined #ruby
[05:22:31] vbatts|work: has joined #ruby
[05:26:02] patdohere: has joined #ruby
[05:26:36] theRoUS: has joined #ruby
[05:27:47] charany1: hi , I am getting upexpepected end-of-input error with my code : https://gist.github.com/charany1/f761c0f92dc894fa8fe8
[05:28:14] charany1: I have checked that there is a matching end for all do's
[05:28:25] moei: has joined #ruby
[05:28:34] stupidystupid: has joined #ruby
[05:28:39] charany1: can you please help me figure what's wrong with my code.
[05:29:26] graydot: has joined #ruby
[05:30:18] stupidystupid: has left #ruby: ()
[05:31:08] zenguy_pc: has joined #ruby
[05:31:32] Ox0dea: charany1: `else if` is spelt `elsif` in Ruby.
[05:32:58] stupidystupid: has joined #ruby
[05:33:05] charany1: Ox0dea : thanks a lot ,I've used C and elif in python ,it solved.
[05:33:13] zenguy_pc: has joined #ruby
[05:33:24] Ox0dea: charany1: Sure thing. It is a little weird.
[05:34:34] KlineAcc: has joined #ruby
[05:36:04] diprotic: but think of all that time we're saving without that pesky e
[05:36:44] zenguy_pc: has joined #ruby
[05:36:44] benlieb: has joined #ruby
[05:39:11] skade: has joined #ruby
[05:41:18] riotjones: has joined #ruby
[05:42:55] phillips1012: has joined #ruby
[05:43:31] mozzarella: has joined #ruby
[05:50:27] forgot: has joined #ruby
[05:53:02] krz: has joined #ruby
[05:55:12] tjbiddle: has joined #ruby
[05:55:54] osvimer: has joined #ruby
[05:56:59] patdohere: has joined #ruby
[06:00:38] mistermocha: has joined #ruby
[06:02:30] jobewan: has joined #ruby
[06:03:53] tkuchiki: has joined #ruby
[06:04:45] mattwildig: has joined #ruby
[06:05:27] cwong_on_irc: has joined #ruby
[06:08:53] Eiam_: has joined #ruby
[06:10:40] jackjackdripper: has joined #ruby
[06:12:26] jas02: has joined #ruby
[06:12:44] tjbiddle: has joined #ruby
[06:12:55] Xeago: has joined #ruby
[06:13:07] zenguy_pc: has joined #ruby
[06:13:15] dhjondoh: has joined #ruby
[06:13:36] blackmes1: has joined #ruby
[06:14:20] haxrbyte_: has joined #ruby
[06:19:21] mikeharris22: has joined #ruby
[06:22:34] Puffball: has joined #ruby
[06:25:44] lxsameer: has joined #ruby
[06:31:10] chibs: has joined #ruby
[06:36:35] aganov: has joined #ruby
[06:37:25] dionysus69: has joined #ruby
[06:37:44] idefine: has joined #ruby
[06:38:07] timonv: has joined #ruby
[06:39:15] oozzal: has joined #ruby
[06:39:54] Ulfalizer: how do /usr/lib/ruby/2.1.0/gems and /var/lib/gems/2.1.0 differ in purpose?
[06:40:16] oozzal: has left #ruby: ()
[06:42:07] tagrudev: has joined #ruby
[06:42:52] claw: has joined #ruby
[06:44:37] Xzanron: has joined #ruby
[06:49:34] oozzal: has joined #ruby
[06:49:37] patdohere: has joined #ruby
[06:50:56] dagda1: has joined #ruby
[06:51:16] idefine: has joined #ruby
[06:51:46] chibs: has joined #ruby
[06:51:51] auzty: has joined #ruby
[06:52:04] skade: has joined #ruby
[06:53:30] bruno-: has joined #ruby
[06:56:35] codecop: has joined #ruby
[06:56:58] houhoulis: has joined #ruby
[06:57:11] krz: has joined #ruby
[06:57:38] moeabdol: has joined #ruby
[06:57:53] yardenbar: has joined #ruby
[07:03:09] tjbiddle: has joined #ruby
[07:03:40] juanpablo__: has joined #ruby
[07:03:48] dikaio: has joined #ruby
[07:06:36] Ox0dea: has joined #ruby
[07:06:58] Ox0dea: >> require 'prime'; 1.prime? # zenspider
[07:06:59] ruboto: Ox0dea # => false (https://eval.in/461946)
[07:07:01] RegulationD: has joined #ruby
[07:07:10] ruurd: has joined #ruby
[07:11:57] fedexo: has joined #ruby
[07:14:24] blackmes1: has joined #ruby
[07:16:14] mozzarella: has joined #ruby
[07:19:47] startupality: has joined #ruby
[07:24:26] kstuart: has joined #ruby
[07:24:43] patdohere: has joined #ruby
[07:28:33] patdohere: has joined #ruby
[07:29:00] firstdayonthejob: has joined #ruby
[07:30:33] yfeldblum: has joined #ruby
[07:30:56] tkuchiki: has joined #ruby
[07:32:49] ruurd: has joined #ruby
[07:33:57] devoldmx_: has joined #ruby
[07:37:46] certainty: havenwood: good one :)
[07:39:22] djbkd_: has joined #ruby
[07:39:41] ta: has joined #ruby
[07:40:44] ta: has joined #ruby
[07:41:26] Stan: has joined #ruby
[07:41:40] TomyLobo: has joined #ruby
[07:42:10] jondot: has joined #ruby
[07:42:15] al2o3-cr: How can I get the full string from the command line with spaces in without quoting?
[07:43:07] chibs: has joined #ruby
[07:43:31] patdohere: has joined #ruby
[07:44:46] moeabdol: has joined #ruby
[07:46:26] swgillespie: has joined #ruby
[07:48:45] lsmola: has joined #ruby
[07:49:13] karapetyan: has joined #ruby
[07:49:47] yeticry: has joined #ruby
[07:51:10] piyush__: has joined #ruby
[07:51:44] AnoHito_: has joined #ruby
[07:52:58] Feyn: has joined #ruby
[07:57:40] Ox0dea: al2o3-cr: You're aware that you won't be able to get to it before shell expansion does?
[07:58:01] rgtk: has joined #ruby
[07:58:44] al2o3-cr: hmm, thats what i thought
[07:59:11] al2o3-cr: It'll have to be quoted then, ok cheers
[07:59:37] bmalum: has joined #ruby
[08:00:10] bigkevmcd: has joined #ruby
[08:02:48] krz: has joined #ruby
[08:03:21] symm-: has joined #ruby
[08:04:30] baweaver: has joined #ruby
[08:04:45] acke: has joined #ruby
[08:04:55] kalusn: has joined #ruby
[08:05:33] ruurd: has joined #ruby
[08:05:34] mattwildig: has joined #ruby
[08:07:08] psye: has joined #ruby
[08:08:37] yeticry: has joined #ruby
[08:12:06] kerunaru: has joined #ruby
[08:14:27] trosborn: has joined #ruby
[08:15:09] blackmes1: has joined #ruby
[08:16:13] notnoyyyyy: has joined #ruby
[08:16:47] adac: has joined #ruby
[08:18:24] j416: has joined #ruby
[08:19:18] lsmola: has joined #ruby
[08:20:13] Glenny: has joined #ruby
[08:20:50] Mon_Ouie: has joined #ruby
[08:24:13] zenguy_pc: has joined #ruby
[08:24:54] Glenny: has joined #ruby
[08:26:17] aufi: has joined #ruby
[08:30:02] marr: has joined #ruby
[08:30:07] Timba-as: has joined #ruby
[08:31:28] jondot: has joined #ruby
[08:33:40] ruurd: has joined #ruby
[08:34:49] Hounddog: has joined #ruby
[08:35:24] ibouvousaime: has joined #ruby
[08:39:15] subscope: has joined #ruby
[08:42:04] kimegede: has joined #ruby
[08:45:33] colegatron: has joined #ruby
[08:45:54] lipoqil: has joined #ruby
[08:46:08] dionysus69: has joined #ruby
[08:46:35] gigetoo: has joined #ruby
[08:47:41] trosborn: has joined #ruby
[08:51:20] machan: has joined #ruby
[08:52:22] juanpablo__: has joined #ruby
[08:54:24] shredding: has joined #ruby
[08:54:26] nfk|laptop: has joined #ruby
[08:55:30] bruno-: has joined #ruby
[08:55:40] piyush__: has left #ruby: ()
[08:59:43] joonty: has joined #ruby
[08:59:58] Xeago: has joined #ruby
[09:00:18] psye: has joined #ruby
[09:01:27] blubjr: hi apeiros
[09:02:02] Ox0dea: has joined #ruby
[09:02:37] Ox0dea: >> '0xff'.oct
[09:02:38] ruboto: Ox0dea # => 255 (https://eval.in/462000)
[09:03:38] SCHAAP137: has joined #ruby
[09:04:31] subscope: has joined #ruby
[09:04:35] kalusn: has joined #ruby
[09:04:43] shinnya: has joined #ruby
[09:06:22] apeiros: I really dislike how invalid input is treated by some core methods
[09:06:50] Xeago: has joined #ruby
[09:08:47] Ox0dea: Are you making fun of me?
[09:08:48] ruurd: has joined #ruby
[09:09:03] solars: has joined #ruby
[09:09:50] Ox0dea: > return rb_str_to_inum(str, -8, FALSE);
[09:09:57] Ox0dea: Seems like that should just be changed to `TRUE`?
[09:10:03] apeiros: no. why do you think I do?
[09:10:04] Alina-malina: has joined #ruby
[09:10:20] Ox0dea: Because I can't have the leading 0 I want. :<
[09:10:58] phillips1012: has joined #ruby
[09:11:01] danman: has joined #ruby
[09:11:02] apeiros: huh? no, o0 is like small-eye/big-eye aka raised eyebrow
[09:11:25] Ox0dea: Yes, I know, but swapping them would've been more pertinent to the octal discussion.
[09:12:02] mark4: has joined #ruby
[09:12:06] apeiros: and people say *I* was a pedant!
[09:12:37] riffraff: has joined #ruby
[09:14:29] piyush__: has joined #ruby
[09:15:32] stamina: has joined #ruby
[09:15:41] piyush__: has left #ruby: ()
[09:16:15] karapetyan: has joined #ruby
[09:16:32] ibouvousaime: has joined #ruby
[09:17:11] blubjr: hi yorickpeterse
[09:17:34] roxtrongo: has joined #ruby
[09:17:49] skade: has joined #ruby
[09:17:58] kalzz: has joined #ruby
[09:19:45] Xeago: has joined #ruby
[09:23:29] nettoweb: has joined #ruby
[09:25:58] kalz: has joined #ruby
[09:26:20] bonemind: has joined #ruby
[09:28:49] jgt: has joined #ruby
[09:31:34] lxsameer: has joined #ruby
[09:32:39] apeiros: moin yorick
[09:33:09] blubjr: hi apeiros
[09:33:47] dionysus69: has joined #ruby
[09:34:10] blackmes1: has joined #ruby
[09:34:13] crdpink2: has joined #ruby
[09:34:50] nickjj: has joined #ruby
[09:35:23] crdpink2: has joined #ruby
[09:35:39] ruurd: has joined #ruby
[09:36:26] consumerism: has joined #ruby
[09:37:34] emilkarl: has joined #ruby
[09:37:45] Peg-leg: has joined #ruby
[09:38:22] ruurd: has joined #ruby
[09:39:00] yfeldblum: has joined #ruby
[09:42:12] haxrbyte: has joined #ruby
[09:46:28] kalzz: has joined #ruby
[09:49:11] ruurd: has joined #ruby
[09:52:28] kalz: has joined #ruby
[09:52:36] haxrbyte_: has joined #ruby
[09:54:58] emilkarl: has joined #ruby
[09:55:00] lukaszes: has joined #ruby
[09:55:47] sinkensabe: has joined #ruby
[09:56:30] jxs_: has joined #ruby
[09:56:48] nfk|laptop: has joined #ruby
[09:59:34] subscope: has joined #ruby
[09:59:39] rdark: has joined #ruby
[09:59:39] rdark: has joined #ruby
[10:01:16] joonty: has joined #ruby
[10:01:26] krz: has joined #ruby
[10:01:55] frudo: has joined #ruby
[10:05:17] frudo: http://pastebin.com/GuihYCFa
[10:05:17] ruboto: frudo, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/8f054727fdb7b02e55a9
[10:05:17] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[10:06:00] baweaver: has joined #ruby
[10:06:07] BSaboia: has joined #ruby
[10:06:23] mattwildig: has joined #ruby
[10:08:45] krisquigley: has joined #ruby
[10:10:02] skade: has joined #ruby
[10:10:58] frudo: https://gist.github.com/Panna007/5ec81a6bd707e5c4614d
[10:10:59] leafybas_: has joined #ruby
[10:11:07] rodfersou: has joined #ruby
[10:11:10] frudo: how can we solve this error.
[10:12:10] apeiros: not sure. try reinstalling libmysqlclient & mysql2 gem
[10:12:17] norc: has joined #ruby
[10:13:47] blueOxigen: has joined #ruby
[10:14:15] troulouliou_div2: has joined #ruby
[10:15:08] leafybas_: has joined #ruby
[10:15:19] solars: has joined #ruby
[10:15:21] machan: has joined #ruby
[10:18:52] voker57: has joined #ruby
[10:20:51] subscope: has joined #ruby
[10:21:21] tvw: has joined #ruby
[10:21:27] blackmes1: has joined #ruby
[10:21:34] tkuchiki: has joined #ruby
[10:21:48] sameerynho: has joined #ruby
[10:23:28] bougyman: man I don't know why it's so hard to find people who know chef and want to work in england.
[10:23:29] anaeem1: has joined #ruby
[10:23:43] sinkensabe: has joined #ruby
[10:25:28] zenguy_pc: has joined #ruby
[10:25:41] ljarvis: i mean, you can't blame them for the last part
[10:29:13] platzhirsch: has joined #ruby
[10:32:28] blaxter: has joined #ruby
[10:34:37] BrunoSaboia: has joined #ruby
[10:36:03] ldnunes: has joined #ruby
[10:37:08] akem: has joined #ruby
[10:39:27] solars: has joined #ruby
[10:40:15] chthon: has joined #ruby
[10:41:07] juanpablo__: has joined #ruby
[10:44:34] dhjondoh: has joined #ruby
[10:45:04] timonv: has joined #ruby
[10:49:46] Luming: has joined #ruby
[10:49:58] FernandoBasso: has joined #ruby
[10:52:18] foooobear: has joined #ruby
[10:52:56] ruurd: has joined #ruby
[10:54:02] lukaszes: has joined #ruby
[10:54:11] bougyman: ljarvis: well it's just a contracting gig.
[10:54:23] bougyman: and they're paying like $100/hour plus expenses.
[10:55:30] machan: has joined #ruby
[10:55:58] Ox0dea: >> $__=$$/$$;_=$__+$__;__=$__+_;$_=_+_;@_=$__+$_;$-_=_**@_;$___=_*$-_;@__=$-_+$___;''<<$___+_*$_<<@__+@_<<@__+@_*@_<<$-_+__*$_<<$-_<<@__+__<<@__+$__<<@__+__<<@__+$__<<@__+__*$_+$__<<$-_+@_*@_<<$-_+($-_-_*@_)<<$-_+_*__*__<<$-_+$_*$_+$__<<$-_+_*(_+@_)
[10:55:59] ruboto: Ox0dea # => "Hey, cacam9621." (https://eval.in/462130)
[10:57:52] karapetyan: has joined #ruby
[10:58:11] trosborn: has joined #ruby
[10:58:32] rodfersou: has joined #ruby
[11:00:32] prestorium: has joined #ruby
[11:00:43] ctp_: has joined #ruby
[11:02:43] moeabdol: has joined #ruby
[11:03:11] DoubleMalt: has joined #ruby
[11:03:28] norc: Ox0dea: What is $$? Is that the current PID?
[11:04:17] Ox0dea: >> require 'English'; [$$, $PID, $PROCESS_ID] # norc: Sure is.
[11:04:18] ruboto: Ox0dea # => [24152, 24152, 24152] (https://eval.in/462146)
[11:04:36] norc: Ox0dea: Figures. Suddenly the whole snippet becomes obvious and trivial. :p
[11:04:50] Ox0dea: norc: Math is magic.
[11:05:27] Ox0dea: norc: Try this one on for size. https://eval.in/459020
[11:08:37] RegulationD: has joined #ruby
[11:09:05] mattwildig: has joined #ruby
[11:09:28] cornerma1: has joined #ruby
[11:10:20] Jardayn: has joined #ruby
[11:11:04] shevy: bougyman it's quite weird in general, a dude I went to school up until 18 years of age, is now working at puppet labs (so thus also ruby; actually he resides in Belfast)
[11:11:25] shevy: and spam mails I got, from europe about ruby, also was from UK, that time rails-based :D
[11:12:05] platzhirsch: has joined #ruby
[11:12:15] norc: Shouldn't you be doing something productive, shevy?
[11:12:25] bruno-: has joined #ruby
[11:12:29] yorickpeterse: look who's talking
[11:13:04] baweaver: has joined #ruby
[11:13:34] karapetyan: has joined #ruby
[11:14:46] bougyman: shevy: there's a big demand for infrastructure devs atm.
[11:14:52] bougyman: chef, puppet, ansible, salt.
[11:15:02] bougyman: if you know any of those 4 it's instantly $100k/year+
[11:15:12] leafybas_: has joined #ruby
[11:15:13] yorickpeterse: I'm very good with salt
[11:15:15] bougyman: or $100/hr consulting
[11:15:24] yorickpeterse: Though I'm not a chef
[11:15:25] norc: yorickpeterse: I didn't like your soup.
[11:16:01] shevy: norc oh but I am, just thinking on which gem to work next
[11:16:53] futilegames: has joined #ruby
[11:16:54] bougyman: shevy: know anyone that works at amazon?
[11:17:11] bougyman: They sent me a job offer yesterday, after a 4 month long interview process.
[11:17:13] shevy: nope not really
[11:17:22] bougyman: I was hoping it would be a crap offer so I could just piss on it.
[11:17:27] bougyman: but it's so good I have to consider it.
[11:17:34] bougyman: I'd hate to go back to an office 5 days a week.
[11:17:48] yorickpeterse: working in PJs > office
[11:17:53] bougyman: but running their linux engineering team would be pretty fucking sweet to have on my resume.
[11:18:41] Xeago: has joined #ruby
[11:18:42] norc: shevy: How do you work a gem?
[11:18:46] sdfgsdfg: has joined #ruby
[11:20:01] kstuart: has joined #ruby
[11:20:03] leafybas_: has joined #ruby
[11:21:11] futilegames: has left #ruby: ()
[11:21:50] _blizzy_: has joined #ruby
[11:21:53] Xeago: has joined #ruby
[11:23:05] [ace]: has joined #ruby
[11:24:34] Ox0dea: shevy: Your fancy-talk confused the reader.
[11:27:32] moeabdol1: has joined #ruby
[11:28:49] chriscoffee: has joined #ruby
[11:30:42] tkuchiki: has joined #ruby
[11:32:54] bruno-: has joined #ruby
[11:33:01] relix: has joined #ruby
[11:34:17] blue_deref: has joined #ruby
[11:34:39] shevy: norc I make some changes, then publish the new variant
[11:35:11] norc: Random gems or ones you use?
[11:35:25] kab: has joined #ruby
[11:36:19] shevy: primarily my own gems; for other gems, I don't know... the coding style they use is often very different from my style. I was considering forking https://github.com/jordansissel/fpm though, I needed something like that... but I don't know yet
[11:36:34] chthon: has joined #ruby
[11:37:49] shevy: https://github.com/jordansissel/fpm/tree/master/lib/fpm/package
[11:39:28] Ox0dea: Those comments are the end of method definitions look so stupid.
[11:39:32] Ox0dea: *at the end
[11:39:41] tkuchiki_: has joined #ruby
[11:40:12] Ox0dea: https://eval.in/462161
[11:41:04] shevy: I dunno, it sorta depends
[11:41:28] Ox0dea: Which means it's inherently inconsistent.
[11:41:53] juanpablo__: has joined #ruby
[11:41:56] kab: has left #ruby: ("Leaving")
[11:44:01] shevy: I am experimenting with things such as:
[11:44:10] shevy: end; alias foo foo? # === foo
[11:44:29] jgt: has joined #ruby
[11:44:35] roxtrongo: has joined #ruby
[11:45:07] shevy: I think matz has some trailing comment in ruby cgi.rb ... lemme try to find it
[11:46:10] shevy: not sure who actually added those # comments there... but let me gist cgi/html.rb
[11:46:41] shevy: https://gist.github.com/shevegen/a1f8c235a05bd58cb27b#file-html-rb-L64 - though to be honest, I assume it was the dude who commented ruby-cgi actually, so not matz
[11:48:07] AugustoCesar: has joined #ruby
[11:49:02] Ulfalizer: what's the best mailing list to ask about cross-compilation and rbconfig.rb-related stuff?
[11:49:27] Ulfalizer: i mostly want to verify that i've understood the intended purpose of some variables
[11:49:30] shevy: I think you must ask the ruby forum, which acts as interface: https://www.ruby-forum.com/forum
[11:50:21] jdawgaz: has joined #ruby
[11:50:31] Ulfalizer: was thinking it might be a bit meta for a general ruby mailing list where people mostly ask about the language itself
[11:50:33] idefine: has joined #ruby
[11:51:10] civil_: has joined #ruby
[11:51:24] bruce_lee: has joined #ruby
[11:51:35] shevy: well the pool of people who will know a lot about both cross-compilation and rbconfig is fairly small
[11:51:49] shevy: you can try to ask hanmac here perhaps, he wrote a lot of C++ code and ruby-bindings to that code
[11:52:07] bougyman: fpm looks like a good idea. one that i've seen implemented thousands of times.
[11:52:25] bougyman: suse's buildservice seems to be the one that's gotten the most people using
[11:52:56] Ox0dea: Quick, everybody use pacman!
[11:53:03] bougyman: i'd like to see how hard it is to add .xbps to fpm
[11:53:17] bougyman: that could be a good weekend project for me if I ever get a free weekend.
[11:53:25] Ox0dea: Weekends are expensive. :<
[11:53:28] bougyman: this weekend i'm roadtripping all of england and next weekend is rubyconf
[11:54:02] jordanloky: has joined #ruby
[11:54:21] nfk|laptop: has joined #ruby
[11:55:21] flyinprogrammer: has left #ruby: ("undefined")
[11:55:29] favadi: has joined #ruby
[11:55:47] ChargedLight: has joined #ruby
[11:56:26] ChargedLight: Hello. I have the following problem (i am using rvm and 2.2.1 is the only ruby that i have installed)
[11:56:26] ChargedLight: kristof@kristof-note:~/Work$ ruby -v
[11:56:26] ChargedLight: ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
[11:56:26] ChargedLight: kristof@kristof-note:~/Work$ sudo gem install capistrano
[11:56:26] ChargedLight: ERROR: Error installing capistrano:
[11:56:26] ChargedLight: net-ssh requires Ruby version >= 2.0.
[11:56:49] adaedra: That's because you're using sudo to install gems.
[11:57:00] mostlybadfly: has joined #ruby
[11:57:07] ruboto: I don't know anything about sudo
[11:57:11] nixmaniack: has joined #ruby
[11:57:11] nixmaniack: has joined #ruby
[11:57:13] ruboto: general advice in system administration: do not and that means never use sudo or root to "fix" things. Only use it if you exactly know why it would work and why it wouldn't work under any circumstances as normal user. Or if you're told to do it.
[11:57:53] ChargedLight: adaedra, thank you
[11:58:22] bougyman: ChargedLight: type 'which ruby'
[11:58:27] bougyman: then 'sudo which ruby'
[11:58:32] bougyman: they're different, i'm guessing?
[11:58:50] ChargedLight: thank you guys
[11:58:54] s00pcan: has joined #ruby
[11:59:45] arup_r: has joined #ruby
[12:01:27] Ox0dea: ~ $ gem search | grep -c [A-Z]
[12:01:36] Ox0dea: Are they all in the wrong?
[12:02:19] jondot: has joined #ruby
[12:03:23] Xeago: has joined #ruby
[12:03:47] emilkarl: has joined #ruby
[12:04:54] mattwildig: has joined #ruby
[12:04:54] Ox0dea: For example, SYNner is a pretty great name for a SYN flood package.
[12:04:57] ChargedLight: Ok, another problem: when i type "cap" from the root of my project, i'm getting this - kristof@kristof-note:~/Work/my-project$ cap
[12:04:57] ChargedLight: bash: /usr/bin/cap: No such file or directory
[12:05:21] ChargedLight: I've also made a huge mistake by installing capistrano like "sudo apt-get install capistrano"
[12:05:29] ChargedLight: i think it's related to this
[12:05:41] Ox0dea: ChargedLight: Definitely.
[12:05:47] Ox0dea: ChargedLight: Ubuntu?
[12:06:02] ChargedLight: i've already removed capistrano that wa installed with apt-get
[12:06:14] ChargedLight: but error still present
[12:06:19] Ox0dea: ChargedLight: Well, there are things that didn't expect you to do that.
[12:06:51] ChargedLight: Ox0dea, how can i fix that now?
[12:07:04] Ox0dea: ChargedLight: $DEITY knows, mate. You'll have to wait for a kinder soul to wander on by.
[12:07:40] Ox0dea: Ubuntu + rvm = pain, and I'm only a masochist for me.
[12:07:41] jondot: has joined #ruby
[12:08:49] ChargedLight: Ox0dea, what is $DEITY ?
[12:09:08] Ox0dea: ChargedLight: A variable whose contents are best left unspecified.
[12:09:23] ChargedLight: looks like i'm fucked
[12:09:38] Ox0dea: >> "#$DEITY"
[12:09:39] ruboto: Ox0dea # => "" (https://eval.in/462177)
[12:09:42] Ox0dea: Seems so. :P
[12:10:11] shevy: ChargedLight you are not fucked in principle, you only need to decide what to pick
[12:10:19] Ox0dea: > fucked in principle
[12:10:22] Ox0dea: I love it.
[12:10:27] shevy: mixing apt-get for ruby stuff while using non-ubuntu stuff isn't a great combination
[12:10:50] subscope: has joined #ruby
[12:10:51] ChargedLight: yeah, using ubuntu and linux in general for ~3 months
[12:11:15] shevy: Ox0dea is an archster
[12:11:18] Ox0dea: ChargedLight: http://i.imgur.com/Ufbr5ej.gif
[12:11:33] shevy: Ox0dea you are still so sceptical!
[12:12:06] Ox0dea: ChargedLight: In any case, there's always the fine people at Brightbox trying to save folks like you from themselves: https://www.brightbox.com/docs/ruby/ubuntu/
[12:12:31] Ox0dea: That pretty much feels like shoving RubyInstaller down Windows users' throats, but there it is.
[12:13:32] bougyman: ubuntu + rvm isn't any pain at all.
[12:13:32] s00pcan: has joined #ruby
[12:13:38] bougyman: just never use sudo.
[12:13:46] chrissonar: has joined #ruby
[12:13:54] ChargedLight: Ox0dea, if i uninstall rvm and ruby and reinstall it from scratch, will it silve my problem?
[12:13:59] Ox0dea: ?try ChargedLight
[12:14:00] ruboto: ChargedLight, Why don't you try it and see for yourself?
[12:14:22] bougyman: ChargedLight: there's no need for that.
[12:14:32] bougyman: rvm current
[12:14:34] bougyman: what does that tell you?
[12:14:37] shevy: "cap" is part of the capistrano gem and resides in bin/cap at the level of where capistrano is installed; i just did a "gem install capistrano" and "cap --help" works fine
[12:14:54] bougyman: you can paste this stuff by rvm current|curl -F'sprunge=<-' sprunge.us
[12:15:06] ChargedLight: kristof@kristof-note:~/Work$ rvm current
[12:15:11] bougyman: though current isn't too long, some of the other one's i'm going to ask for are.
[12:15:23] bougyman: ok, and 'which gem'
[12:15:36] ChargedLight: /home/kristof/.rvm/rubies/ruby-2.2.1/bin/gem
[12:15:47] bougyman: and 'which cap'?
[12:15:53] Ox0dea: /usr/bin/cap
[12:16:02] ChargedLight: kristof@kristof-note:~/Work$ which cap
[12:16:02] ChargedLight: /home/kristof/.rvm/gems/ruby-2.2.1/bin/cap
[12:16:07] Ox0dea: It's fixed!
[12:16:21] ChargedLight: kristof@kristof-note:~/Work$ which cap
[12:16:21] ChargedLight: /home/kristof/.rvm/gems/ruby-2.2.1/bin/cap
[12:16:21] ChargedLight: kristof@kristof-note:~/Work$ cap
[12:16:21] ChargedLight: bash: /usr/bin/cap: No such file or directory
[12:16:31] s00pcan: has joined #ruby
[12:16:33] Ox0dea: All my midkeks.
[12:16:38] Ox0dea: Well, 80% of them.
[12:16:57] jgt: has joined #ruby
[12:16:59] bougyman: ChargedLight: does Work/ have a .ruby-version and .ruby-gemset ?
[12:17:16] bougyman: and a Gemfile ?
[12:17:34] bougyman: "Work" is a weird name for a project.
[12:19:09] pathrocle: has joined #ruby
[12:19:40] ChargedLight: kristof@kristof-note:~/Work/project-web$ cap
[12:19:41] ChargedLight: bash: /usr/bin/cap: No such file or directory - project-web has Gemfile. I've made a mistake by trying to install capistrano as "sudo apt-get install capistrano" before. It was installed under /usr/bin/cap - then i removed it via sudo ap-get remove capistrano and installed it with gem install. But ubuntu still links to the /usr/bin/cap instead of right place
[12:19:56] platzhirsch: has left #ruby: ()
[12:20:34] gheegh: has joined #ruby
[12:22:27] TPBallbag: has joined #ruby
[12:23:45] ChargedLight: bougyman, so maybe it will be faster and easier to completely reinstall rvm and ruby>
[12:23:50] Ox0dea: > ubuntu + rvm isn't any pain at all.
[12:23:59] Zai00: has joined #ruby
[12:24:41] zenguy_pc: has joined #ruby
[12:24:41] shevy: ChargedLight why does it try to look at /usr/bin
[12:24:59] Ox0dea: ChargedLight: which -a cap
[12:25:04] ruurd: has joined #ruby
[12:25:08] shevy: the normal command for when a binary is not found is e. g. this:
[12:25:09] shevy: bash: not-existing-command: command not found
[12:25:26] shevy: so you must use something that attempts to use a hard path
[12:25:50] ChargedLight: kristof@kristof-note:~/Work/project-web$ which -a cap
[12:25:51] ChargedLight: /home/kristof/.rvm/gems/ruby-2.2.1/bin/cap
[12:26:05] Ox0dea: ChargedLight: And, just for giggles, `env cap`?
[12:26:22] idefine: has joined #ruby
[12:26:24] subscope: has joined #ruby
[12:26:31] ChargedLight: kristof@kristof-note:~/Work/project-web$ env cap
[12:26:31] ChargedLight: Stage not set, please call something such as `cap production deploy`, where production is a stage you have defined.
[12:27:02] Ox0dea: Whale, color me flabbergasted.
[12:27:30] Ox0dea: ChargedLight: As shevy says, something is invoking `/usr/bin/cap` explicitly.
[12:27:51] ChargedLight: yes, i understand it, but how to figure out what?
[12:27:58] syath: has joined #ruby
[12:28:01] ChargedLight: and how to fix it
[12:28:28] ChargedLight: it's great that i'm generating loolz for you, but it sould be nice to get some help or advice
[12:29:15] Ox0dea: > You'll have to wait for a kinder soul to wander on by.
[12:29:25] Ox0dea: I'm trying to be that kinder soul, dick.
[12:30:07] Ox0dea: ChargedLight: sudo grep -R '/usr/bin/cap' /
[12:30:13] Ox0dea: It's gotta be in there somewhere, right?
[12:30:28] shevy: ChargedLight if it were my system, the first thing I would do is to get rid of the debian ruby
[12:30:29] zipace: has joined #ruby
[12:30:34] mehwork: has left #ruby: ()
[12:31:48] ChargedLight: kristof@kristof-note:~/Work$ sudo grep -R '/usr/bin/cap' /
[12:31:48] ChargedLight: [sudo] password for kristof:
[12:31:48] ChargedLight: /var/log/auth.log:Nov 3 14:59:27 kristof-note sudo: kristof : TTY=pts/16 ; PWD=/home/kristof/Work/project-web ; USER=root ; COMMAND=/bin/rm -rf /usr/bin/cap
[12:31:48] ChargedLight: /var/log/auth.log:Nov 3 15:30:32 kristof-note sudo: kristof : TTY=pts/16 ; PWD=/home/kristof/Work ; USER=root ; COMMAND=/bin/grep -R /usr/bin/cap /
[12:31:49] ChargedLight: grep: /var/run/wpa_supplicant/wlan0: No such device or address
[12:31:51] ChargedLight: grep: /var/run/acpid.socket: No such device or address
[12:31:53] ChargedLight: grep: /var/run/postgresql/.s.PGSQL.5432: No such device or address
[12:31:57] ChargedLight: grep: /var/run/avahi-daemon/socket: No such device or address
[12:32:07] millerti: has joined #ruby
[12:32:33] Ox0dea: Ubuntu user.
[12:32:38] yorickpeterse: explains everything
[12:32:39] shevy: something is fishy
[12:32:50] yorickpeterse: ChargedLight: stop pasting non Ruby stuff in here
[12:32:52] bougyman: ChargedLight: what the heck are you doing with the sudo stuff still.
[12:32:58] bougyman: you don't need any sudo to use rvm and cap.
[12:33:07] shevy: how can "sudo grep -R '/usr/bin/cap' /" include "COMMAND=/bin/rm -rf /usr/bin/cap"
[12:33:42] Ox0dea: shevy: Process execution is an orchestrated endeavor.
[12:33:48] solars: has joined #ruby
[12:33:51] Mon_Ouie: has joined #ruby
[12:33:55] ByronJohnson: has joined #ruby
[12:34:00] Ilyes512: has joined #ruby
[12:34:17] NightMonkey: has joined #ruby
[12:34:21] Ilyes512: has joined #ruby
[12:34:36] Ox0dea: It's kinda like how asking ObjectSpace for the number of Strings equal to "foo" changes the answer you would otherwise have gotten.
[12:35:21] hyperdrive: has joined #ruby
[12:35:21] ChargedLight: bougyman, if i delete rvm and ruby and reisntall it, will it help me or not?
[12:35:34] tesuji: has joined #ruby
[12:35:46] nizmow: has joined #ruby
[12:36:08] tkuchiki: has joined #ruby
[12:36:30] havenwood: has joined #ruby
[12:36:50] j0bk: has joined #ruby
[12:36:56] shevy: Ox0dea well you were right when you used http://i.imgur.com/Ufbr5ej.gif
[12:36:57] rikkipitt: has joined #ruby
[12:37:02] Ox0dea: So it seems.
[12:37:24] alexblom: has joined #ruby
[12:38:01] vigintas: has joined #ruby
[12:38:18] Ox0dea: ChargedLight: Yeah.
[12:39:58] bougyman: ChargedLight: prehaps
[12:40:25] shevy: now I am the sceptical one :(
[12:40:30] shevy: Ox0dea I blame you
[12:40:37] Ox0dea: I blame me too.
[12:40:43] Ox0dea: But I'm not sorry.
[12:40:49] TomyLobo: being sceptical is a good thing
[12:41:16] shevy: we still generated an epic line thanks to Ox0dea, which I shall add to my IRC collection: <ChargedLight> it's great that i'm generating loolz for you, but it sould be nice to get some help or advice
[12:41:29] Xeago: has joined #ruby
[12:41:40] ChargedLight: you are welcome
[12:42:32] nixmaniack: has joined #ruby
[12:42:39] ChargedLight: it's a pleasure to know that there are people who can become happy because of other people who are newbie or know less
[12:43:27] lessless: has joined #ruby
[12:43:46] Ox0dea: ChargedLight: How very metacircular.
[12:44:15] ChargedLight: you can add this to your list of epic lines
[12:44:54] shevy: ChargedLight are you saying that your problem is "real"?
[12:45:20] Ox0dea: ChargedLight: That you derive pleasured from my deriving pleasure from your pain is confusing the shit outta me.
[12:45:27] sgambino: has joined #ruby
[12:45:48] Ox0dea: > ??deep??me
[12:45:57] Ox0dea: *derived pleasure
[12:47:17] Ox0dea: ChargedLight: How did you come to install Capistrano with apt-get?
[12:47:49] Ox0dea: Whale, everything should've gone just fine, then.
[12:48:02] Ox0dea: You should endeavor to acquire a higher quality of such.
[12:48:33] Ox0dea: ChargedLight: Perturbations?
[12:50:04] shevy: norc are you ChargedLight
[12:50:55] _stu_: has joined #ruby
[12:52:14] j416: has joined #ruby
[12:52:38] Ilyes512: has joined #ruby
[12:53:44] Ox0dea: ChargedLight: For seriouslies, though, that `grep` invocation really would tell you where all the string "/usr/bin/cap" occurs on your system, and that could significantly narrow the search space of possible solutions.
[12:54:12] Ox0dea: You might consider sinking its stderr to reduce the noise, but there shouldn't be unduly many matches.
[12:55:23] ddv: ChargedLight: what is the problem, sir?
[12:55:42] ddv: why are you using sudo?
[12:57:53] ChargedLight: ddv, problem was, that i installed capistrano with "apt-get install capistrano" (yes, i am dumb) first. It installed it into /usr/bin/cap. After that i've removed this package and reinstalled it corrently via gem install. But if i try to launch "cap" command the system is trying to find capistrano in /usr/bin/cap instead of correct place. I am currently reinstalling rvm and ruby
[12:58:30] subscope: has joined #ruby
[13:02:00] ruurd: has joined #ruby
[13:04:01] Ox0dea: ChargedLight: It turns out you probably just needed to say `rvm reset` or some such.
[13:06:05] andykingking: has joined #ruby
[13:06:40] jobewan: has joined #ruby
[13:06:59] arne_: has joined #ruby
[13:07:08] ruboto: arne_ # => "x" (https://eval.in/462246)
[13:07:17] shevy: Ox0dea he no longer talks to you
[13:07:19] arne_: >> "x"[1]
[13:07:19] ruboto: arne_ # => nil (https://eval.in/462247)
[13:07:24] arne_: >> "x"[1..2]
[13:07:25] ruboto: arne_ # => "" (https://eval.in/462248)
[13:07:31] arne_: is this epected behaviour?
[13:07:37] Ox0dea: arne_: It is. Just a second.
[13:07:48] adaedra: arne_: what did you expect?
[13:07:56] arne_: thought it might be a bug, so i better come here, and tell you guys
[13:08:21] arne_: well, character 0 does not exist, or in my c-understanding it would have to be a terminating character, but since that is not the case in rubies, i would've expected to return nil
[13:08:30] Ox0dea: arne_: This is a nice, concise explanation: http://stackoverflow.com/a/3568281
[13:08:50] Ox0dea: It's for arrays, but the principle remains.
[13:09:07] norc: shevy: you are such a hateful person.
[13:09:41] shevy: arne_ [1] you probably understand, as for the Range, http://ruby-doc.org/core-2.2.0/String.html#method-i-5B-5D the two return values are a string or nil
[13:09:44] arne_: so im slicing the SUBSPACE
[13:10:00] Ox0dea: arne_: Aye, that's a good way to look at it.
[13:10:09] gregf_: >> "arne_"[-1] * 10
[13:10:10] ruboto: gregf_ # => "__________" (https://eval.in/462250)
[13:10:18] Ox0dea: gregf_: How very informative.
[13:10:27] shevy: norc not at all, only sceptical :)
[13:10:43] norc: shevy: about?
[13:10:53] shevy: norc real problems!
[13:11:24] arne_: great, i gonna use this, so i gonna come back and be mad and yell at you guys, if this changes
[13:11:32] norc: shevy: Not sure I understand what you mean.
[13:11:32] ChargedLight: reinstalling rvm and ruby helped, if anyone still ineterested
[13:11:56] adaedra: arne_: don't yell too much, some people are sleeping in here.
[13:12:14] arne_: actually that saves me about 3 lines of code!
[13:12:45] Olipro: has joined #ruby
[13:13:02] Ox0dea: arne_: Put everything on one line like a champ, yeah?
[13:13:13] shevy: 4 lines saved?
[13:13:20] bruno-: has joined #ruby
[13:13:32] Ox0dea: arne_: With properly placed parentheses and `and`s, you can even do it without using any semicola.
[13:13:46] shevy: he could omit the parens
[13:13:49] Ox0dea: Not always.
[13:13:50] baweaver: has joined #ruby
[13:14:08] Ilyes512: has joined #ruby
[13:14:11] jondot: has joined #ruby
[13:14:22] arne_: yeah i know a string is atleast 8 bytes, so when im slicing at 8..x, it will never be nil, always be some kind of string, so i can unpack it, and even if that fails, it will be nil
[13:14:23] kalusn: has joined #ruby
[13:14:25] arne_: it's beauty!
[13:14:38] Bloomer: has joined #ruby
[13:16:29] arne_: what do you guys think of crystal?
[13:16:32] sdothum: has joined #ruby
[13:16:35] arne_: not the drug, the language.
[13:17:01] norc: Shame. Could have told some fancy stories.
[13:17:13] arne_: hookers are the greatest
[13:17:23] adaedra: norc, it's time to cook!
[13:17:27] umgrosscol: has joined #ruby
[13:17:31] Ox0dea: arne_: It trades fun for speed (not the drug, the performance), and that's usually a worthwhile trade-off.
[13:17:47] arne_: where does the fun go :(?
[13:17:50] frudo: has left #ruby: ()
[13:17:54] Ox0dea: Into the transistors. :<
[13:18:06] Ox0dea: Our faces lined up...
[13:18:26] arne_: well, it really looks just like ruby, so why would it be less fun?
[13:19:03] arne_: are talking about the requirement to compile?
[13:19:07] arne_: jmonreal, howdy
[13:19:27] jmonreal: arne_: everything fine, how about you?
[13:19:29] favadi: has joined #ruby
[13:19:53] jmonreal: I have a question regarding parsing json and then assigning values
[13:19:54] arne_: im coding ruby so im happpppppppppy
[13:20:02] norc: shevy: If its any consolation I started reading the damn book. Starting to understand more and more about Ruby. :)
[13:20:44] norc: jmonreal: Go ahead and ask away. If you have a gist to share that could help.
[13:20:47] arne_: Ox0dea, tell me, i need to know!!!!!!!!!
[13:20:48] jmonreal: is there a pretty way to assign a value of the JSON to a variable only if the key of the JSON has a non-empty value
[13:20:48] diegoaguilar: has joined #ruby
[13:21:05] jmonreal: thannks norc
[13:21:09] arne_: jmonreal, yes.
[13:21:19] jmonreal: arne_: how would it be?
[13:21:38] ruurd_: has joined #ruby
[13:21:40] norc: jmonreal: JSON is a serialization format.
[13:21:54] [ace]_: has joined #ruby
[13:22:02] pabst: has joined #ruby
[13:22:16] Ox0dea: > now kith
[13:22:22] rtl: has joined #ruby
[13:22:26] uris: has joined #ruby
[13:22:33] arne_: >> JSON.parse({:herp=>:derp}.to_json)
[13:22:34] ruboto: arne_ # => uninitialized constant JSON (NameError) ...check link for more (https://eval.in/462253)
[13:22:47] arne_: >> require 'json';JSON.parse({:herp=>:derp}.to_json)
[13:22:48] arup_r: has joined #ruby
[13:22:48] ruboto: arne_ # => {"herp"=>"derp"} (https://eval.in/462254)
[13:22:49] leat: has joined #ruby
[13:22:49] lsmola: has joined #ruby
[13:22:56] arne_: wow, didn't know that.
[13:22:57] but3k4: has joined #ruby
[13:22:58] hackeron: has joined #ruby
[13:23:09] Ox0dea: That wasn't particularly illuminating.
[13:23:10] guardianW: has joined #ruby
[13:23:24] _joes__: has joined #ruby
[13:23:32] arne_: Ox0dea, please tell me, what do you meant by saying trading fun for XTC
[13:23:40] Ox0dea: arne_: Is that what I said?
[13:23:48] Ox0dea: Yeah, kinda.
[13:23:53] guardianW: has left #ruby: ()
[13:24:32] arne_: jmonreal, when having json, you usually have a string, i don't know what you mean by saying "assing something to it"
[13:24:36] jmonreal: norc: I know. I am trying to "fix" a code I am working on. Look at this: http://pastebin.com/17FhgWcD
[13:24:37] ruboto: jmonreal, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/ae4ca85d8eb1bbcb16b8
[13:24:37] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[13:24:40] Ox0dea: arne_: Ruby just lets you use the full breadth of your imagination, at least more so than any other extant language of which I'm aware.
[13:24:55] jmonreal: sometimes this array is empty
[13:24:55] Alina-malina: has joined #ruby
[13:25:20] jmonreal: ruboto: ok sorry about that
[13:25:28] Ox0dea: jmonreal: Every time you say "a code", $DEITY kills a kitten.
[13:25:47] Ox0dea: Why do you hate baby cats?
[13:25:49] jmonreal: Ox0dea: jajaja
[13:26:07] jmonreal: what am I supposed to say?
[13:26:12] arne_: them codes.
[13:26:23] Papierkorb: all of them?
[13:26:45] jmonreal: did you guys see the line of code?
[13:26:54] Ox0dea: ?guys jmonreal
[13:26:54] ruboto: jmonreal, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
[13:27:16] jmonreal: ruboto: thanks ruboto
[13:27:18] arne_: :D IRC overdose
[13:27:20] symm-: has joined #ruby
[13:27:24] spectra: has joined #ruby
[13:27:28] platzhirsch: has joined #ruby
[13:27:30] Ox0dea: ?ruboto jmonreal
[13:27:30] ruboto: jmonreal, I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
[13:28:02] DEA7TH: has joined #ruby
[13:28:03] noodle: has joined #ruby
[13:28:18] jmonreal: what can I do to first check if the array has elements, before trying to get the first element wich is none
[13:28:23] Ilyes512: has joined #ruby
[13:28:29] Ox0dea: jmonreal: You could ask it for its size.
[13:28:42] Ox0dea: But Array also responds to #empty?, so you should probably use that.
[13:28:51] Papierkorb: jmonreal: ask it. no, really, there's Array#empty?
[13:29:10] jmonreal: but as if (array is empty) then ...
[13:29:16] Ox0dea: jmonreal: Just like that.
[13:29:17] jmonreal: or there is something to do in the same line
[13:29:18] arne_: >> Array, are you empty?
[13:29:19] ruboto: arne_ # => /tmp/execpad-6b70c1b42107/source-6b70c1b42107:2: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/462256)
[13:29:33] synthroid: has joined #ruby
[13:29:49] Ox0dea: >> pardon me array but would you be so kind as to tell me if @you_are_empty
[13:29:50] ruboto: Ox0dea # => nil (https://eval.in/462257)
[13:30:01] Ox0dea: I see. Thank you, array.
[13:30:02] joonty: has joined #ruby
[13:30:04] bruno-_: has joined #ruby
[13:30:58] juanpablo__: has joined #ruby
[13:31:26] arne_: Ox0dea, and what do you think about rubinius?
[13:31:36] Ox0dea: arne_: It's neat.
[13:31:36] jmonreal: did not got it, but I'll keep looking, thanks folks
[13:31:51] symm-_: has joined #ruby
[13:32:07] favadi: has joined #ruby
[13:32:09] Ox0dea: jmonreal: Sorry, we got a little carried away there.
[13:32:10] platzhirsch: has joined #ruby
[13:32:15] arne_: jmonreal, if you have any kind of hash or array, you can just check it's empty
[13:32:32] arne_: >> x={:test=>3}; x.keys.empty?
[13:32:33] ruboto: arne_ # => false (https://eval.in/462258)
[13:32:43] arne_: >> x=[]; x.keys.empty?
[13:32:44] ruboto: arne_ # => undefined method `keys' for []:Array (NoMethodError) ...check link for more (https://eval.in/462259)
[13:32:50] arne_: >> x=[]; x.empty?
[13:32:51] ruboto: arne_ # => true (https://eval.in/462260)
[13:32:55] Ox0dea: My sides.
[13:33:10] dhjondoh: has joined #ruby
[13:33:38] arne_: jmonreal, are you sure your json-input is always filled? because the json parser usually doesn't f up
[13:33:48] jmonreal: so something like this: a = x.empty ? 0 : x[key]
[13:33:55] Ox0dea: jmonreal: Looks okay, yeah.
[13:34:16] arne_: jmonreal, you can also ask it, if it has a "key" key
[13:34:20] Ox0dea: jmonreal: You could use Array#fetch with a fallback if you want to keep it in one expression.
[13:34:25] Papierkorb: jmonreal: or, if the value of x[key] will not be nil nor false intentionally, just: a = x[key] || 0
[13:35:02] arne_: >> x = []; x[:arnold]=:schwarzenegger; x.includes? :arnold
[13:35:03] ruboto: arne_ # => no implicit conversion of Symbol into Integer (TypeError) ...check link for more (https://eval.in/462261)
[13:35:09] jmonreal: thanks folk
[13:35:20] favadi: has joined #ruby
[13:35:20] bruno-_: has joined #ruby
[13:35:21] ruurd: has joined #ruby
[13:35:21] atomical: has joined #ruby
[13:35:46] arne_: >> x={:arny=>:schwarz};x.includes? :arny
[13:35:46] catphish: has joined #ruby
[13:35:47] ruboto: arne_ # => undefined method `includes?' for {:arny=>:schwarz}:Hash (NoMethodError) ...check link for more (https://eval.in/462262)
[13:35:59] arne_: >> x={:arny=>:schwarz};x.include? :arny
[13:36:00] ruboto: arne_ # => true (https://eval.in/462263)
[13:36:30] catphish: when receiving a UDP datagram, i currently use UDPSocket#recvfrom, this returns the remote address and data, but is there a way to get the local address?
[13:36:39] ESpiney: has joined #ruby
[13:37:10] Guest53: has joined #ruby
[13:37:46] catphish: actually i'm not sure the kernel provides this at all
[13:37:47] Ox0dea: catphish: Shouldn't your instance of UDPSocket know that about itself?
[13:38:19] catphish: Ox0dea: the UDPSocket instance is bound to 0.0.0.0, so it doesn't know what addresses packets might arrive to
[13:38:37] Ox0dea: catphish: Oh, right.
[13:38:39] catphish: i suspect this is more of a standard linux question that a ruby specific one
[13:38:47] Guest53_: has joined #ruby
[13:38:55] Ox0dea: I'm sure the information is accessible, but probably not directly via Ruby's Socket class.
[13:39:01] subscope: has joined #ruby
[13:39:15] Ox0dea: jmonreal: This is just for laughs: https://eval.in/462264
[13:39:35] dstarh: has joined #ruby
[13:39:39] Ox0dea: Do not let the palindromic ID trick you into thinking it's a good idea.
[13:40:05] p0wn3d__: has joined #ruby
[13:40:33] bruno-_: has joined #ruby
[13:41:20] catphish: that's a complicated bit of hash reading
[13:41:50] Ox0dea: His idea.
[13:41:59] catphish: is there any reason this is a bad idea?
[13:42:11] catphish: having taken the time to understand it, it looks pretty sane
[13:42:14] tkuchiki: has joined #ruby
[13:42:46] Ox0dea: catphish: It's more expensive than it needs to be in the service of keeping it a single expression chain.
[13:42:55] roshanavand: has joined #ruby
[13:43:08] arne_: >> [][0..1000]
[13:43:09] ruboto: arne_ # => [] (https://eval.in/462265)
[13:43:17] arne_: >> [1][0..1000]
[13:43:18] ruboto: arne_ # => [1] (https://eval.in/462266)
[13:43:29] catphish: Ox0dea: i suppose i'd always prefer to branch it with some if statements
[13:43:58] sandals: has joined #ruby
[13:44:11] Quandl: has joined #ruby
[13:44:13] Ox0dea: catphish: Well, a ternary would be fine here, but yeah.
[13:44:17] arne_: so i can cut the subspace between the last element and the last+1 element, but not the one before 0 and -1? isn't that inconsistend?
[13:45:32] catphish: i actually have a piece of code *nearly* identical to that, except if no disk IO stat is present, it simply doesn't graph it
[13:45:40] Ox0dea: arne_: In both of your examples, elements 0 and -1 are the same dude; there is no subspace between them.
[13:45:49] bruno-_: has joined #ruby
[13:46:25] arne_: yeah but if there is a space where is no element between the last and last+1 element
[13:46:36] arne_: there should be one inbetween -1 and 0
[13:47:04] arne_: sure -1 references the last element, but still, i feel like this is weird
[13:47:30] Ox0dea: arne_: You're not wrong, technically; it's just that Ruby's slices don't wrap.
[13:47:49] Ox0dea: You can't say `foo[-2..0]` and get what you might want.
[13:49:21] mag42c: has joined #ruby
[13:50:14] duckpuppy: has joined #ruby
[13:51:07] bruno-_: has joined #ruby
[13:51:59] jmonreal: Ox0dea: how can I check for values returned by JSON.parse? I believe I can not do it with @variable[key1][key2].emtpy
[13:52:21] arne_: jmonreal, yeah you will have to check for the existence of key1 and key2
[13:52:43] cwong_on_irc: has joined #ruby
[13:53:16] bluOxigen: has joined #ruby
[13:53:18] mattwildig: has joined #ruby
[13:53:26] arne_: there is no "cool" way to do it, but to change the format you're getting your information from
[13:53:48] Ox0dea: arne_: Since when did `rescue nil` become "uncool"?
[13:53:54] Ox0dea: Also, see here: https://bugs.ruby-lang.org/issues/11643
[13:53:57] bluOxigen: has left #ruby: ()
[13:54:06] jmonreal: arne_: how would I check for keys?
[13:54:14] arne_: well, that would imply json parse fails, wouldn't it?
[13:54:29] Ox0dea: No, just that the data are missing.
[13:54:38] blackoperat: has joined #ruby
[13:54:41] arne_: jmonreal, JSON.parse(json_string).has_key?("io_rate")
[13:54:45] moeabdol1: has joined #ruby
[13:54:51] jmonreal: arne_: but the keys exist
[13:54:59] arne_: then, what does not exist?
[13:55:21] Ox0dea: The values at the keys can be `nil`.
[13:55:33] jmonreal: arne_: when doing this unless stats["blkio_stats"]["io_service_bytes_recursive"] I get exception
[13:55:40] jmonreal: or unless stats["blkio_stats"]["io_service_bytes_recursive"].empty
[13:55:51] Ox0dea: jmonreal: Well, #empty isn't a method on Array.
[13:55:56] jmonreal: and stats its the output of JSON.parse
[13:56:20] arne_: jmonreal, 1. the method is called empty? with question-mark
[13:56:23] bruno-: has joined #ruby
[13:56:30] atomical: has joined #ruby
[13:56:39] arne_: and yeah it would still throw an exception of one of those does not exist
[13:56:42] platzhirsch: has joined #ruby
[13:57:12] Ox0dea: >> defined?(nil) # arne_
[13:57:13] ruboto: Ox0dea # => "nil" (https://eval.in/462269)
[13:57:34] lukaszes: has joined #ruby
[13:57:43] Ox0dea: >> defined?(actually_nonexistent_thing)
[13:57:44] ruboto: Ox0dea # => nil (https://eval.in/462270)
[13:57:52] Ox0dea: The difference is subtle.
[13:58:02] shredding: has joined #ruby
[13:58:05] jmonreal: arne_: nop, without question mark
[13:58:06] arne_: >> defined?(defined?)
[13:58:07] ruboto: arne_ # => /tmp/execpad-8557946929f6/source-8557946929f6:2: syntax error, unexpected ')' (https://eval.in/462271)
[13:58:13] atomical_: has joined #ruby
[13:58:14] Ox0dea: arne_: `defined?` is a keyword.
[13:58:23] Ox0dea: It's magical.
[13:58:27] arne_: hoped it to be a method
[13:58:32] Ox0dea: Alas, it can't be.
[13:58:33] rippa: has joined #ruby
[13:58:49] Ox0dea: >> Array.instance_methods.grep(/emp/) # jmonreal
[13:58:50] ruboto: Ox0dea # => [:empty?] (https://eval.in/462273)
[13:58:58] leafybas_: has joined #ruby
[13:59:10] arne_: >> jmonreal_head=[];jmonreal_head.empty?
[13:59:11] ruboto: arne_ # => true (https://eval.in/462274)
[13:59:16] jmonreal: not catching up with you folks
[13:59:24] Ox0dea: jmonreal: Ruby methods can end with question marks.
[13:59:33] Ox0dea: Most of the ones that "answer a question" do so.
[14:00:01] arne_: >> Array.new.empty?
[14:00:02] ruboto: arne_ # => true (https://eval.in/462275)
[14:00:03] tkuchiki: has joined #ruby
[14:00:17] jmonreal: Ox0dea: that worked arne_
[14:00:21] jmonreal: thanks to you both
[14:00:26] arne_: :) you're welcome
[14:00:27] JDiPierro: has joined #ruby
[14:00:28] Ox0dea: jmonreal: Happy to help.
[14:01:18] jmonreal: and could I check if a variable has a value or not
[14:01:37] bruno-_: has joined #ruby
[14:01:40] arne_: jmonreal, with defined?
[14:01:46] Ox0dea: jmonreal: Did you follow along back there and arrive at the proper conclusion that `nil` is a value?
[14:01:49] arne_: without object in front of it
[14:01:53] jmonreal: like variable.defined?
[14:02:01] arne_: no like defined?(variable)
[14:02:03] lipoqil: has joined #ruby
[14:02:14] arne_: since you cannot ask a variable that does not exists, if it exists
[14:02:19] jmonreal: I see nil is also a value
[14:02:35] jmonreal: thanks arne_
[14:02:48] _blizzy_: has joined #ruby
[14:02:58] arne_: but i actually wonder, why isn't every variable defined and nil?
[14:03:11] arne_: would that cause problems besides being a pain in the ass to debug?
[14:03:32] arne_: well if i do >> variable_that_does not exist, it would throw an exception
[14:03:35] roshanavand: has joined #ruby
[14:03:40] Ox0dea: As it ought.
[14:03:47] arne_: why isn't every variable = nil
[14:03:54] arne_: defined or not
[14:04:12] Ox0dea: Because it's sometimes useful to be able to determine whether or not some identifier is actually bound to anything.
[14:04:25] arne_: it's useful but not inuitive, imho
[14:04:31] Ox0dea: #dealwithit
[14:04:33] arne_: but it would be possible to design a language like that, right?
[14:04:44] skcin7: has joined #ruby
[14:04:56] arne_: i mean, it wouldn't render something impossible to code
[14:05:00] cdg: has joined #ruby
[14:05:00] Ox0dea: arne_: I mean, yeah; global, instance, and class variables are all implicitly defined in this language.
[14:05:02] arne_: would it?
[14:05:23] Ox0dea: >> [$foo, @bar]
[14:05:24] ruboto: Ox0dea # => [nil, nil] (https://eval.in/462276)
[14:05:29] mndoci: has joined #ruby
[14:05:37] Papierkorb: arne_: why isn't it intuitive? that would create so much more bugs
[14:05:57] Ox0dea: Erm, sorry; class variables are not implicitly defined.
[14:05:57] sankaber: has joined #ruby
[14:06:02] arne_: [][5] is also not defined, yet it is nil
[14:06:26] Ox0dea: arne_: No, it's just `nil`.
[14:06:50] bruno-_: has joined #ruby
[14:06:53] arne_: yeah i know that what i said was not correct, but it does not a throw an exception, while it doesn't exist
[14:06:57] Papierkorb: arne_: that creates an empty array and then you fetch the 6th element out of it, which is OOB and by def. is thus 'nil'
[14:07:01] jgpawletko: has joined #ruby
[14:07:12] arne_: and using variable_that_is_not_defined, is nothing else, than accessing it in a hash which doesn't include the key, isn't it?
[14:07:13] Papierkorb: arne_: it does exist. you just created an anonymous variable
[14:07:50] pandaant: has joined #ruby
[14:07:56] Ox0dea: arne_: It "has a presence" in ObjectSpace, as it were.
[14:08:44] jdawgaz: has joined #ruby
[14:08:48] Ox0dea: >> foo = []; foo[4] = 2; foo # Maybe this helps?
[14:08:49] ruboto: Ox0dea # => [nil, nil, nil, nil, 2] (https://eval.in/462277)
[14:08:56] malconis: has joined #ruby
[14:09:42] malconis: has joined #ruby
[14:09:59] jdawgaz: has joined #ruby
[14:10:09] RegulationD: has joined #ruby
[14:10:14] Polysics: has joined #ruby
[14:10:59] arne_: not really since
[14:11:08] hackeron_: has joined #ruby
[14:11:12] arne_: >> x={}["peter"];x;
[14:11:13] ruboto: arne_ # => nil (https://eval.in/462278)
[14:11:27] arne_: >> x={};x["peter"];x;
[14:11:28] ruboto: arne_ # => {} (https://eval.in/462279)
[14:11:31] arne_: >> x={};x["peter"]=3;x;
[14:11:32] ruboto: arne_ # => {"peter"=>3} (https://eval.in/462280)
[14:11:46] Ox0dea: You left me at the station.
[14:11:47] Papierkorb: that are three completely different pieces of code Oo
[14:11:58] arne_: well relevant is only the last :D
[14:12:07] bruno-_: has joined #ruby
[14:12:14] subscope: has joined #ruby
[14:12:22] eam: arne_: accessing a key doesn't assign a value -- it's a read only operation
[14:12:32] eam: arne_: do you come from perl, perchance?
[14:12:38] arne_: no, from c
[14:12:38] Ox0dea: arne_: Simply put, `nil` is a "thing"; it is the single instance of the NilClass class. It has just as much right to be considered defined as any other Ruby value.
[14:12:45] eam: in perl, accessing the key will auto-vivify the key
[14:13:04] ddv: vivify?
[14:13:07] Ox0dea: ddv: Bring to life.
[14:13:14] eam: but in ruby, {} is the same as a {} which has had a ["key"] dereferenced -- it does not change the datastructure
[14:13:26] arne_: i understnad that nil is a value, i just find it weird, that accessing non-defined variables throws exceptions, while accessing non-existent key in a array/hash doesn't
[14:13:40] eam: ddv: in perl you have to be careful to test exists($hash{key})
[14:13:50] riotjones: has joined #ruby
[14:13:59] eam: because if ($hash{key}) is just like saying $hash{key} = undef
[14:14:08] Papierkorb: in perl you have to be careful not to accidently implement a brainfuck interpret with an example code
[14:14:20] eam: arne_: yeah - there are alternate hash accessors which will raise if you want
[14:14:32] eam: >> {}.fetch "key"
[14:14:33] ruboto: eam # => key not found: "key" (KeyError) ...check link for more (https://eval.in/462281)
[14:14:54] Ox0dea: Papierkorb: I have something to show you.
[14:15:04] eam: this isn't a language thing so much as a how the methods on Hash were implemented thing
[14:15:06] Ox0dea: Though I suppose you already know about what I'm talking.
[14:15:10] eam: (and on Array)
[14:15:24] eam: >> [].fetch 2
[14:15:25] ruboto: eam # => index 2 outside of array bounds: 0...0 (IndexError) ...check link for more (https://eval.in/462282)
[14:15:26] shevy: snoopy uses the perl programming language
[14:15:41] Papierkorb: Ox0dea: the WAT video? The 31C3 talk about perl by that italian guy?
[14:15:54] Ox0dea: Papierkorb: My non-alphanumeric brainfuck interpreter in Ruby. :P
[14:16:03] eam: arne_: the default [] is more loose I assume to allow techniques which extend the Array/Hash without too much boilerplate
[14:16:03] 6A4AAZCMN: has joined #ruby
[14:16:30] Ox0dea: With *no* boilerplate.
[14:16:42] eam: well, it does take some typing right
[14:16:54] Ox0dea: if thing = hash[key]; ... thing ...; end
[14:17:15] kiddorails: has joined #ruby
[14:17:18] Papierkorb: is code like ^ generally 'accepted' in the community?
[14:17:20] bruno-_: has joined #ruby
[14:17:31] Ox0dea: Am I being shunned?
[14:17:43] Papierkorb: no, no idea, I'm just asking
[14:17:51] favadi: has joined #ruby
[14:18:10] Ox0dea: Papierkorb: Doesn't it feel good in all the right places to write code like that?
[14:18:14] Papierkorb: stuff like (self.foo ||= {})[bar] = baz isn't so great. in fact, it did something I did not expect
[14:18:27] Ox0dea: Yeah, that's gross.
[14:18:53] Ox0dea: But utilizing the language's most basic assignment semantics shouldn't be a crime.
[14:18:55] Papierkorb: Ox0dea: if it gets the job done, and is readable with no weird side effects, sure, why not?
[14:19:13] Ox0dea: Papierkorb: You've answered your own question, methinks. :)
[14:19:34] Ox0dea: Wait, no, you were looking for a box to fit into, yeah?
[14:20:16] Papierkorb: Well, that's my opinion, but they don't always match the guidelines of the community. Sometimes I just don't care about them as for some I think the reasoning is stupid.
[14:20:42] Papierkorb: Sometimes, I see why some things are discouraged, and try to avoid it.
[14:20:45] darix: Papierkorb: (self.foo ||= {})[bar] = baz - that is but ugly. make it 2 lines
[14:20:48] arne_: is ruby powerful enough to let me tell it, that every variable is defined?
[14:20:59] davedev24: has joined #ruby
[14:20:59] arne_: (excpect for just catching the exception)
[14:21:07] Papierkorb: arne_: defined?(the_variable)
[14:21:12] darix: arne_: what problem are you trying to solve actually?
[14:21:24] arne_: curiousity
[14:21:53] Papierkorb: darix: already done it, also because it was buggy as hell and did not do what I expected it to do. But, this code I ran through Opal (Ruby -> JS), so maybe their compiler messed something up. No idea
[14:22:14] TPBallbag: has joined #ruby
[14:22:16] Ox0dea: arne_: You can use #method_missing to "capture" just about anything.
[14:22:28] Papierkorb: also #const_missing hehe
[14:22:34] bruno-_: has joined #ruby
[14:22:52] arne_: ohyeah i totally forgot the main object
[14:23:11] arne_: crazy how matz do that.
[14:23:53] houhoulis: has joined #ruby
[14:24:00] momomomomo: has joined #ruby
[14:24:03] Papierkorb: Also don't forget about Kernel .
[14:24:08] sankaber: has joined #ruby
[14:24:12] jgt: has joined #ruby
[14:24:20] whippythellama: has joined #ruby
[14:25:11] xaxisx: has joined #ruby
[14:25:13] zenguy_pc: has joined #ruby
[14:25:29] Meow-J: has joined #ruby
[14:25:48] chouhoulis: has joined #ruby
[14:27:37] KervyN: has joined #ruby
[14:27:48] bruno-_: has joined #ruby
[14:27:58] chouhoulis: has joined #ruby
[14:28:23] vondruch: has joined #ruby
[14:28:45] gregf_: has joined #ruby
[14:31:28] vbatts|work: has left #ruby: ("found the other side of the rainbow")
[14:31:47] momomomomo: has joined #ruby
[14:32:16] babblebre: has joined #ruby
[14:32:22] Olipro: has joined #ruby
[14:32:27] fold1: has joined #ruby
[14:33:04] bruno-_: has joined #ruby
[14:33:45] spew: has joined #ruby
[14:34:28] gregf_: has joined #ruby
[14:35:25] mattwildig: has joined #ruby
[14:36:35] freerobby: has joined #ruby
[14:37:24] mrchris: has joined #ruby
[14:38:04] momomomomo: has joined #ruby
[14:38:22] bruno-_: has joined #ruby
[14:39:15] diegoviola: has joined #ruby
[14:39:40] evanjs: has joined #ruby
[14:40:07] Guest97: has joined #ruby
[14:40:22] lukaszes: has joined #ruby
[14:41:19] ta: has joined #ruby
[14:41:52] catphish: has left #ruby: ("Leaving")
[14:42:35] freerobby: has joined #ruby
[14:43:18] sandals: has joined #ruby
[14:43:37] bruno-_: has joined #ruby
[14:43:48] Xeago: has joined #ruby
[14:44:19] roshanavand: has joined #ruby
[14:44:40] blueOxigen: has joined #ruby
[14:45:13] chriscoffee: has joined #ruby
[14:45:18] ElSif: has joined #ruby
[14:45:29] colegatron: has joined #ruby
[14:46:15] tmtwd: has joined #ruby
[14:46:23] mugurel: has joined #ruby
[14:47:24] Spami: has joined #ruby
[14:48:19] mikeharris22: has joined #ruby
[14:48:25] mary5030: has joined #ruby
[14:48:39] jobewan: has joined #ruby
[14:48:57] bruno-_: has joined #ruby
[14:50:03] mary5030: has joined #ruby
[14:51:38] Eleeleth: has joined #ruby
[14:52:06] sfr^: has joined #ruby
[14:52:09] stannard: has joined #ruby
[14:53:31] mugurel_: has joined #ruby
[14:53:35] akitada: has joined #ruby
[14:53:36] colstrom: has joined #ruby
[14:54:15] bruno-_: has joined #ruby
[14:54:36] RegulationD: has joined #ruby
[14:54:56] romero: has joined #ruby
[14:54:59] freeze: has joined #ruby
[14:55:21] sfr^: has joined #ruby
[14:55:34] johnhamelink: has joined #ruby
[14:56:11] Zai00: has joined #ruby
[14:57:24] rbennacer: has joined #ruby
[14:59:31] bruno-: has joined #ruby
[15:00:35] tjohnson: has joined #ruby
[15:00:51] DexterLB: has joined #ruby
[15:00:51] devoldmx: has joined #ruby
[15:01:20] Xeago: has joined #ruby
[15:01:53] rbennacer: has joined #ruby
[15:03:41] polishdub: has joined #ruby
[15:03:48] patdohere: has joined #ruby
[15:04:03] roshanavand: has joined #ruby
[15:04:17] Kruppe-: has joined #ruby
[15:04:48] bruno-_: has joined #ruby
[15:04:59] radgeRayden: has joined #ruby
[15:05:33] kies^: has joined #ruby
[15:06:02] Xeago: has joined #ruby
[15:06:51] moeabdol1: has joined #ruby
[15:08:43] musou: has joined #ruby
[15:10:05] bruno-_: has joined #ruby
[15:12:22] krz: has joined #ruby
[15:12:35] treehug88: has joined #ruby
[15:12:47] Zai00: has joined #ruby
[15:13:05] Rinzlit1: has joined #ruby
[15:13:42] Xeago: has joined #ruby
[15:14:40] leafybas_: has joined #ruby
[15:14:43] baweaver: has joined #ruby
[15:14:57] patdohere: has joined #ruby
[15:15:21] bruno-_: has joined #ruby
[15:15:58] _blizzy_: has joined #ruby
[15:16:09] zquad: has joined #ruby
[15:16:53] jgt: has joined #ruby
[15:16:58] danman: has joined #ruby
[15:17:57] centrx: has joined #ruby
[15:19:04] arthurix_: has joined #ruby
[15:19:21] juanpablo__: has joined #ruby
[15:20:37] bruno-_: has joined #ruby
[15:21:39] m3_del: has joined #ruby
[15:22:16] m3_del: has joined #ruby
[15:24:09] Xeago: has joined #ruby
[15:25:07] AlexRussia: has joined #ruby
[15:25:36] diegoaguilar: has joined #ruby
[15:25:50] bruno-_: has joined #ruby
[15:26:21] momomomomo: has joined #ruby
[15:26:25] Peg-leg: has joined #ruby
[15:26:34] dopamean_: has joined #ruby
[15:27:01] patdohere: has joined #ruby
[15:27:03] mark4: has joined #ruby
[15:27:20] vigintas: has joined #ruby
[15:27:51] mordocai: has joined #ruby
[15:28:15] monthy: has joined #ruby
[15:29:33] kstuart: has joined #ruby
[15:31:06] bruno-_: has joined #ruby
[15:31:26] dhollinger: has joined #ruby
[15:32:42] freerobby: has joined #ruby
[15:32:55] theRoUS: has joined #ruby
[15:33:18] nertzy: has joined #ruby
[15:33:28] jessemcgilallen: has joined #ruby
[15:33:42] patdohere: has joined #ruby
[15:33:43] speakingcode: has joined #ruby
[15:35:24] dorei: has joined #ruby
[15:35:34] hotpancakes: has joined #ruby
[15:35:45] ruby-lang019: has joined #ruby
[15:36:17] idefine: has joined #ruby
[15:36:20] bruno-_: has joined #ruby
[15:37:14] Xeago: has joined #ruby
[15:41:26] subscope: has joined #ruby
[15:41:34] bruno-_: has joined #ruby
[15:42:31] xet7: has joined #ruby
[15:42:52] ruby-lang019: Hello Everyone , I have a question related to coding one facter value, I have coded something like this https://gist.github.com/nicks85/821fb9c652ae6fcb323d, But i am not getting it right ? can someone please help me ?
[15:42:55] slawrence00: has joined #ruby
[15:43:49] chibs: has joined #ruby
[15:44:11] jgt: has joined #ruby
[15:45:44] pullphinger: has joined #ruby
[15:46:10] Peteykun: has joined #ruby
[15:46:47] bruno-_: has joined #ruby
[15:47:13] arne_: has joined #ruby
[15:47:38] arne_: hi, it's me again. is there a cool way to do [uid].pack("L").first
[15:47:42] Trynemjoel: has joined #ruby
[15:47:57] arne_: >> [232323].pack("V").first
[15:47:58] ruboto: arne_ # => undefined method `first' for "\x83\x8B\x03\x00":String (NoMethodError) ...check link for more (https://eval.in/462347)
[15:48:04] s2013: has joined #ruby
[15:48:09] vigintas: has joined #ruby
[15:48:11] arne_: nevermind, forget what i was saying
[15:48:16] arne_: i was talking about unpack
[15:48:23] eam: yeah pack returns a string :)
[15:48:26] russellx: has joined #ruby
[15:49:23] MacDaddy: has joined #ruby
[15:49:59] vigintas1: has joined #ruby
[15:50:08] platzhirsch: has left #ruby: ()
[15:50:10] moeabdol1: has joined #ruby
[15:50:54] eam: I don't see why String doesn't implement #first, though
[15:51:01] idefine_: has joined #ruby
[15:52:00] bruno-_: has joined #ruby
[15:52:58] ljarvis: first what?
[15:53:52] Renich: has joined #ruby
[15:54:54] rgb-one: has joined #ruby
[15:57:14] inteq: has joined #ruby
[15:57:16] bruno-_: has joined #ruby
[15:58:04] arthurix: has joined #ruby
[15:58:07] neanderslob: has joined #ruby
[15:58:33] roshanavand: has joined #ruby
[15:59:43] EminenceHC: has joined #ruby
[16:00:02] roshanavand: has joined #ruby
[16:00:29] mndoci: has joined #ruby
[16:00:41] patdohere: has joined #ruby
[16:00:45] vondruch_: has joined #ruby
[16:01:47] yorickpeterse: first everything
[16:02:08] ljarvis: the obvious choice
[16:03:10] jaequery: has joined #ruby
[16:04:42] momomomomo: has joined #ruby
[16:05:27] ibouvousaime: has joined #ruby
[16:05:41] rgb-one: How easy is it to retrieve data from a csv file?
[16:05:57] aufi: has joined #ruby
[16:06:15] ljarvis: super easy!
[16:06:24] `derpy: No results
[16:06:29] `derpy: http://www.rubydoc.info/stdlib/csv/CSV
[16:07:30] sepp2k: has joined #ruby
[16:08:14] skullcrasher: hey there, I have a rest api that send me an object that has a attribute, which itself is an array of json objects
[16:08:22] to_json: has joined #ruby
[16:08:22] to_json: has joined #ruby
[16:08:40] kp666: has joined #ruby
[16:09:12] skullcrasher: so how do you do it in ruby, that I can have a model for the whole request, that maps the array of json objects, to objects of another model class?
[16:10:12] skullcrasher: I thought more it could work somehow like relations for AR but not backed by database and keys
[16:10:36] symbol: has joined #ruby
[16:11:15] adaedra: Silly bot.
[16:11:19] mistermocha: has joined #ruby
[16:11:50] adaedra: skullcrasher: rails?
[16:11:52] ljarvis: yeah who created such a monstrosity
[16:12:02] ruboto: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[16:12:09] skullcrasher: just thought it's a normal ruby thing
[16:12:10] baroquebobcat_: has joined #ruby
[16:12:30] yardenbar: has joined #ruby
[16:12:33] hotpancakes: has joined #ruby
[16:12:41] synthroid: has joined #ruby
[16:12:43] adaedra: Well, that's how ActiveRecord processes your input.
[16:12:44] dnomyar: has joined #ruby
[16:13:02] eam: ljarvis: first element, same as [0]
[16:13:30] ljarvis: eam: i guess, though what [0] has been ambiguous across versions
[16:13:51] eam: sure, but what argument does that present? That [] should go away?
[16:14:01] freerobby1: has joined #ruby
[16:14:04] eam: if [0] and [-1] exist, probably #first and #last ought to
[16:14:05] ljarvis: no, no argument really just stating
[16:14:25] EminenceHC: has joined #ruby
[16:14:46] riotjones: has joined #ruby
[16:16:52] ruurd: has joined #ruby
[16:17:04] rgtk: has joined #ruby
[16:17:54] bmalum_: has joined #ruby
[16:17:56] makufiru: has joined #ruby
[16:18:20] ChargedLight: has joined #ruby
[16:18:51] fedexo: has joined #ruby
[16:19:18] cornerma1: has joined #ruby
[16:20:02] evanjs: has joined #ruby
[16:20:53] baweaver: has joined #ruby
[16:21:23] emilkarl: has joined #ruby
[16:21:55] hotpancakes: has joined #ruby
[16:22:44] Zai00: has joined #ruby
[16:23:19] Eminence_: has joined #ruby
[16:23:36] charany1: has joined #ruby
[16:24:04] adaedra: wait, this is not my shell
[16:24:19] cornerman: has joined #ruby
[16:24:34] charany1: hi , I am getting unexpected tIdentifier error :https://gist.github.com/charany1/d0ac1846b9f757bf5fcd
[16:24:46] patdohere: has joined #ruby
[16:24:54] purplexed-: has joined #ruby
[16:24:55] charany1: please help me in figuring out what's wrong with this ?
[16:25:04] charany1: https://gist.github.com/charany1/d0ac1846b9f757bf5fcd
[16:25:19] Balllkenende: has joined #ruby
[16:26:27] zenguy_pc: has joined #ruby
[16:27:05] adaedra: Your l.33 is weird
[16:27:07] chriscoffee: has joined #ruby
[16:27:28] adaedra: >> (1..3).cover?2
[16:27:29] ruboto: adaedra # => true (https://eval.in/462367)
[16:27:30] nettoweb: has joined #ruby
[16:27:36] adaedra: uh, didn't know.
[16:27:56] RobertBirnie: has joined #ruby
[16:30:56] relix: has joined #ruby
[16:30:58] Peg-leg: has joined #ruby
[16:31:29] atomical: has joined #ruby
[16:31:40] charany1: adaedra : can you please help me with this error ? https://gist.github.com/charany1/d0ac1846b9f757bf5fcd
[16:31:56] Fire-Dragon-DoL: has joined #ruby
[16:32:16] arne_: has joined #ruby
[16:32:20] jhass: charany1: still, put a space after exclude?
[16:32:31] adaedra: that's what I was looking at and don't see anything.
[16:32:34] jamesaxl: has joined #ruby
[16:32:43] jhass: charany1: also parens for the .include? at least
[16:33:01] jhass: >> def a?(a); end; a?1 && a?2
[16:33:02] ruboto: jhass # => /tmp/execpad-b13e6a75fa43/source-b13e6a75fa43:2: syntax error, unexpected tINTEGER, expecting keywor ...check link for more (https://eval.in/462373)
[16:33:25] hxegon: has joined #ruby
[16:33:27] jhass: >> def a?(a); end; a? 1 && a? 2 # parses but is not what you want
[16:33:28] ruboto: jhass # => /tmp/execpad-0b4918368f35/source-0b4918368f35:2: syntax error, unexpected tINTEGER, expecting keywor ...check link for more (https://eval.in/462376)
[16:33:37] jhass: or doesn't even parse actually, hm
[16:33:45] adaedra: yeah, put parenthesis
[16:33:50] mark4: has left #ruby: ("PART #RubyOnRails :PART #jquery :PART #reactjs :PART ##javascript :PART #elixir-lang :PART #debian :QUIT :Leaving.")
[16:33:53] jhass: >> def a?(a); end; a?(1) && a?(2) # anyway, format it like this
[16:33:54] ruboto: jhass # => nil (https://eval.in/462377)
[16:33:55] adaedra: never too many parenthesis.
[16:34:34] cwong_on_irc: has joined #ruby
[16:35:41] snockerton: has joined #ruby
[16:37:31] s2013: has joined #ruby
[16:38:02] kith: >> puts "hello world!"
[16:38:03] ruboto: kith # => hello world! ...check link for more (https://eval.in/462391)
[16:38:28] charany1: jhass : thanks , it solved !
[16:38:44] bruno-: has joined #ruby
[16:40:36] symm-: has joined #ruby
[16:41:50] ReK2: has joined #ruby
[16:41:51] ReK2: has joined #ruby
[16:42:30] ahegyi: has joined #ruby
[16:42:45] DexterLB: has joined #ruby
[16:43:21] mistermocha: has joined #ruby
[16:43:50] moeabdol1: has joined #ruby
[16:43:57] bruno-_: has joined #ruby
[16:44:30] arthurix_: has joined #ruby
[16:45:14] simplyianm: has joined #ruby
[16:47:59] banister: anyone here speak french?
[16:48:58] lucky: has joined #ruby
[16:49:11] bruno-_: has joined #ruby
[16:49:44] hotpancakes: has joined #ruby
[16:50:07] juanpablo__: has joined #ruby
[16:51:05] rehat_: has joined #ruby
[16:52:03] Guest53_: has joined #ruby
[16:53:02] dopie: has joined #ruby
[16:53:23] jhass: our offtopic channel has a french hangman
[16:54:01] seitensei: has joined #ruby
[16:54:01] seitensei: has joined #ruby
[16:54:25] bruno-_: has joined #ruby
[16:55:01] adaedra: banister: yes
[16:55:09] banister: adaedra can i message you?
[16:55:12] crystalmaiden: has joined #ruby
[16:55:13] benlieb: has joined #ruby
[16:55:21] patdohere: has joined #ruby
[16:56:28] BSaboia: has joined #ruby
[16:56:42] s2013: has joined #ruby
[16:56:59] atomical_: has joined #ruby
[16:57:33] yardenbar: has joined #ruby
[16:58:26] balazs: has joined #ruby
[16:59:49] duoi: has joined #ruby
[17:00:24] duoi: has joined #ruby
[17:00:42] _djbkd: has joined #ruby
[17:01:55] marr: has joined #ruby
[17:03:05] hahuang65: has joined #ruby
[17:04:30] darix: has joined #ruby
[17:05:33] solocshaw: has joined #ruby
[17:05:50] polishdub: has joined #ruby
[17:06:01] towski_: has joined #ruby
[17:06:11] hotpancakes: has joined #ruby
[17:06:12] rakm: has joined #ruby
[17:06:51] null_ref: has joined #ruby
[17:07:26] JanPeter: has joined #ruby
[17:07:57] secret: has joined #ruby
[17:08:29] mp_: has joined #ruby
[17:08:41] JanPeter_: has joined #ruby
[17:09:17] Trynemjoel: has joined #ruby
[17:10:47] mp_: has left #ruby: ()
[17:11:49] rakm: has joined #ruby
[17:12:39] aleaf_: has joined #ruby
[17:13:10] blackmes1: has joined #ruby
[17:13:59] SCHAAP137: has joined #ruby
[17:15:47] JDiPierro: has joined #ruby
[17:16:34] jaequery: has joined #ruby
[17:16:57] EminenceHC: has joined #ruby
[17:17:41] moeabdol1: has joined #ruby
[17:18:26] rgb-one: has left #ruby: ()
[17:19:25] zotherstupidguy: has joined #ruby
[17:19:40] arthurix: has joined #ruby
[17:22:48] mattwildig: has joined #ruby
[17:22:54] karapetyan: has joined #ruby
[17:23:17] EminenceHC: has joined #ruby
[17:24:40] jsrn: has joined #ruby
[17:25:55] nertzy: has joined #ruby
[17:26:27] ghostbox: has joined #ruby
[17:26:51] nettoweb: has joined #ruby
[17:28:16] diegoviola: has joined #ruby
[17:29:47] leafybas_: has joined #ruby
[17:31:18] rbennacer: has joined #ruby
[17:31:36] karapetyan: has joined #ruby
[17:31:47] bricker: has joined #ruby
[17:33:00] benlieb: has joined #ruby
[17:34:01] Alina-malina: has joined #ruby
[17:34:11] s2013: has joined #ruby
[17:34:44] baweaver: has joined #ruby
[17:35:23] synthroid: has joined #ruby
[17:36:16] dionysus69: has joined #ruby
[17:36:19] mdih: has joined #ruby
[17:36:28] Xeago: has joined #ruby
[17:36:58] s2013: has joined #ruby
[17:37:10] EminenceHC: has joined #ruby
[17:37:28] InternetFriend: has joined #ruby
[17:38:52] cjbischof_: has joined #ruby
[17:39:03] skullcrasher: has joined #ruby
[17:40:32] [Butch]: has joined #ruby
[17:41:11] evanjs: has joined #ruby
[17:41:20] blackoperat: has joined #ruby
[17:42:57] mjuszczak: has joined #ruby
[17:43:57] roshanavand: has joined #ruby
[17:44:56] shadoi: has joined #ruby
[17:45:58] qwertme: has joined #ruby
[17:49:49] go|dfish: has joined #ruby
[17:52:30] jpfuentes2: has joined #ruby
[17:52:31] mrtomme: has joined #ruby
[17:55:01] Ulfalizer2: has joined #ruby
[17:56:21] bruno-: has joined #ruby
[17:57:34] Ulfalizer2: does ruby-forum.com really mirror ruby-talk? i can't see any of the recent postings when i check the archive for ruby-talk.
[17:57:47] Ulfalizer2: i.e., the archive for the mailing list
[17:58:01] RobertBirnie: has joined #ruby
[17:59:03] zotherstupidguy: has joined #ruby
[17:59:14] last_staff: has joined #ruby
[18:00:26] balazs: has joined #ruby
[18:01:53] axisys: rvc foo:secret@vcenter.com works but rvc foo:"secret&me"@vcenter.com ignores password.. any suggestion of a workaround.. URI parser is here https://github.com/vmware/rvc/blob/master/lib/rvc/uri_parser.rb
[18:02:08] axisys: not sure why it ignore if sees '&' in password
[18:02:33] devoldmx: has joined #ruby
[18:02:39] axisys: no one in #rvc channel rlane@vmware.com bounces and post an issue in github and no response
[18:02:59] hxegon: If I'm trying to use a single file from a new BSD licensed repo, do I have to add new BSD in a comment to the file or something?
[18:03:12] axisys: figure rvc (ruby vsphere console) is written in ruby so ask here
[18:03:44] rakm: has joined #ruby
[18:04:22] firstdayonthejob: has joined #ruby
[18:04:36] soahccc: axisys: does it work without quotes? https://gist.github.com/2called-chaos/c64d56f974b0f5500c91
[18:04:52] acke: has joined #ruby
[18:05:03] bender_unit: has joined #ruby
[18:05:21] alex88: has joined #ruby
[18:06:01] alex88: hi guys, someone uses activeadmin? I've customized a user edit form but it uses POST and it should be PATCH, someone had the same issue?
[18:06:43] hxegon: alex88: are you using activeadmin outside of rails?
[18:06:48] AnoHito_: has joined #ruby
[18:06:51] alex88: nope, inside of it
[18:07:24] hxegon: alex88: #rubyonrails would probably be more able to help you
[18:07:27] alex88: this is my file https://gist.github.com/alex88/6b1ae623e293e3dfacf4
[18:07:35] balazs: has joined #ruby
[18:07:41] hxegon: alex88: no prob, have a nice day
[18:09:35] chibs: has joined #ruby
[18:09:50] hotpancakes: has joined #ruby
[18:09:58] skullcrasher: has joined #ruby
[18:10:39] evanjs: has joined #ruby
[18:12:02] mistermocha: has joined #ruby
[18:12:10] JDiPierro: has joined #ruby
[18:12:25] axisys: soahccc: sorry I was away ...
[18:12:54] diegoaguilar: has joined #ruby
[18:13:00] axisys: soahccc: so I am calling rvc from bash and without quote it starts a background process when sees the '&' outside quote
[18:13:08] shortdudey123: has joined #ruby
[18:13:44] soahccc: axisys: then you have to escape accordingly to the environment
[18:13:51] freerobby: has joined #ruby
[18:13:55] spider-mario: has joined #ruby
[18:14:30] Moblin: has joined #ruby
[18:14:30] Ebok: has joined #ruby
[18:14:42] Channel6: has joined #ruby
[18:15:09] Ebok: Hey, quick question. If I have a string and I need to split it into every third character and keep the remainder in the last array instance, how is the best route to to this?
[18:15:18] Moblin: has left #ruby: ()
[18:15:25] riotjones: has joined #ruby
[18:16:26] Ebok: example: string = "Hello" string.scan(/.../) gives me ["Hel"] rather then what I need: ["Hel","lo"]
[18:16:47] symm-: has joined #ruby
[18:17:00] hotpancakes: has joined #ruby
[18:17:27] hahuang65: has joined #ruby
[18:17:30] soahccc: Ebok: one way (no idea if it is the best) scan(/.{1,3}/)
[18:18:54] erbesharat: has joined #ruby
[18:19:15] axisys: soahccc: rvc foo:"secret&me"@vcenter.com does not send the quote to rvc .. it is just bash needs it
[18:19:18] dorei: >> "Hello".scan(/.../)
[18:19:19] ruboto: dorei # => ["Hel"] (https://eval.in/462462)
[18:19:28] axisys: soahccc: anyway to add a debug to see what rvc sees?
[18:19:33] Ebok: I'm going to need to look up that syntax to understand it. lol. /./ I get, what is {3,1} translate too?
[18:19:59] soahccc: axisys: I don't know rvc but the fact that they maintain an own URL parser is kinda weird
[18:20:18] Zarthus: does it need to be a regex, Ebok?
[18:20:37] s2013: has joined #ruby
[18:20:38] Zarthus: "Hello World!".length.times do |i|; puts "Hello World"[i..i+2]; end could work
[18:20:38] axisys: https://github.com/vmware/rvc/blob/master/bin/rvc
[18:20:47] Zarthus: the remainder is i+2 .. string.length
[18:20:49] axisys: soahccc: ^ may be add a debug in there?
[18:21:04] Kruppe: has joined #ruby
[18:21:16] jgt: has joined #ruby
[18:21:31] Ebok: Thanks Zarthus, I think I'll stick with the regex for now though
[18:21:39] dorei: >> "hello".chars.each_slice(3).map(&:join).last
[18:21:40] ruboto: dorei # => "lo" (https://eval.in/462463)
[18:21:43] axisys: can you suggest a better uri handling and I can send them a rquest for fix?
[18:21:58] leat: has joined #ruby
[18:22:06] hxegon: Ebok: you could also try String.reverse.split('') to get an array of chars and Array#pop
[18:22:27] swgillespie: has joined #ruby
[18:22:34] tigarcia: has joined #ruby
[18:22:38] soahccc: axisys: I guess they have a reason or they are stupid since ruby has a quite functional URI parser which can parse it as shown in my gist
[18:23:35] hxegon: Ebok: err, don't reverse. just use Array.shift which is like pop, but takes from the beggining
[18:23:45] axisys: my problem is rvc foo:secret&me@vcenter.com will not work from bash
[18:23:54] mistermocha: has joined #ruby
[18:24:10] baweaver: has joined #ruby
[18:25:31] Ebok: The regex does what I need it to do /.{1,3}/ though so would using an count variable to shovel it into an array during an each iteration.
[18:25:31] axisys: soahccc: this ignores password as well rvc "foo:secret&me@vcenter.com"
[18:25:39] roshanavand: has joined #ruby
[18:25:53] hxegon: Ebok: foo = "12345".split('') ; until foo.length == 0; p foo.shift 3; end
[18:26:37] kalusn: has joined #ruby
[18:26:42] hxegon: foo = "12345".split('') ; until foo.length == 0; p foo.shift(3).join(''); end # for sure a better way to do this
[18:26:47] woti: has joined #ruby
[18:26:48] hxegon: >> foo = "12345".split('') ; until foo.length == 0; p foo.shift(3).join(''); end # for sure a better way to do this
[18:26:49] ruboto: hxegon # => "123" ...check link for more (https://eval.in/462464)
[18:27:07] axisys: soahccc: URI.parse(%{"foo:secret&me@vcenter.com"}) fails too
[18:27:30] solars: has joined #ruby
[18:28:06] soahccc: axisys: well the quotes there are not needed since %{} already is a string but I guess without protocol it's actually not working as inspected
[18:28:12] based_pdev_: has joined #ruby
[18:28:40] axisys: soahccc: I guess I can modofy line 73
[18:28:52] axisys: uri = RVC::URIParser.parse str .. change it to something better ?
[18:29:10] axisys: str is the argument for rvc
[18:29:26] woti: has joined #ruby
[18:29:27] mattwildig: has joined #ruby
[18:29:33] axisys: uri = URI.parse ?
[18:29:35] soahccc: >> [URI.parse(%{protocol://foo:secret&me@vcenter.com}).userinfo, URI.parse(%{foo:secret&me@vcenter.com}).userinfo]
[18:29:36] ruboto: soahccc # => uninitialized constant URI (NameError) ...check link for more (https://eval.in/462465)
[18:29:47] atomical: has joined #ruby
[18:29:51] soahccc: >> require "uri" ; [URI.parse(%{protocol://foo:secret&me@vcenter.com}).userinfo, URI.parse(%{foo:secret&me@vcenter.com}).userinfo]
[18:29:52] ruboto: soahccc # => ["foo:secret&me", nil] (https://eval.in/462466)
[18:30:17] axisys: soahccc: hey.. that looks good.. now I need to split them
[18:30:46] soahccc: axisys: I guess you can try to debug and see what the parse actually returns there (print it to console or something)
[18:31:08] soahccc: axisys: maybe the parser can parse it but whatever works with it has problems?
[18:31:20] axisys: soahccc: how do I debug it?
[18:31:26] axisys: embed pry ?
[18:32:03] zenguy_pc: has joined #ruby
[18:32:04] soahccc: That's a possibility or just print the result to console (puts) and exit
[18:32:15] axisys: soahccc: ok
[18:32:23] renderful: has joined #ruby
[18:32:55] neanderslob_: has joined #ruby
[18:33:07] evanjs: has joined #ruby
[18:33:35] blackmes1: has joined #ruby
[18:34:07] craysiii: has joined #ruby
[18:34:55] bluOxigen: has joined #ruby
[18:35:14] minimalism: has joined #ruby
[18:35:58] Ebok: honestly I was hoping there was a string.slice(3) type method tbh
[18:36:09] blackoperat: has joined #ruby
[18:36:14] bruno-: has joined #ruby
[18:36:22] soahccc: Ebok: what are you trying to do anyway? :)
[18:36:32] Spami_: has joined #ruby
[18:37:11] Ebok: Oh, I was wondering how to manually put in commas in a string integer without using any other gem.
[18:37:23] axisys: soahccc: bin/rvc is https://gist.github.com/asifiqbal/31f23e4643bc8686a138 .. it calls /var/lib/gems/1.9.1/gems/rvc-1.8.0/bin/rvc .. how do I tell it to call /var/lib/gems/1.9.1/gems/rvc-1.8.0/bin/rvc2 ?
[18:37:26] Ebok: So I needed to count from the back, and reversed everything >_>
[18:37:34] cjbischof_: has joined #ruby
[18:37:40] EminenceHC: has joined #ruby
[18:37:49] axisys: soahccc: i dont want to modify the /var/lib/gems/1.9.1/gems/rvc-1.8.0/bin/rvc since lot of people using it
[18:37:55] secret: has joined #ruby
[18:38:03] gusTester1: has joined #ruby
[18:38:12] mndoci: has joined #ruby
[18:38:46] hahuang65: has joined #ruby
[18:38:52] juanpablo__: has joined #ruby
[18:39:56] danman_: has joined #ruby
[18:40:45] gusTester1: has left #ruby: ()
[18:41:14] soahccc: Ebok: maybe that can give you any inspiration :) https://github.com/rails/rails/blob/master/activesupport/lib/active_support/number_helper/number_to_delimited_converter.rb
[18:41:30] Eminence_: has joined #ruby
[18:41:34] bruno-_: has joined #ruby
[18:43:03] soahccc: axisys: Hmm no idea, call it directly without this wrapper? I would test/modify it in a test environment
[18:43:53] xaxisx: has left #ruby: ()
[18:44:12] mwlang: has joined #ruby
[18:44:52] axisys: soahccc: ok puts str before uri = RVC::URIParser.parse str andI get bad uri
[18:45:02] mistermocha: has joined #ruby
[18:45:08] nfk|laptop: has joined #ruby
[18:45:09] axisys: so I think RVC::URIParser.parse is breaking it
[18:45:11] mcantor: has joined #ruby
[18:45:46] mcantor: Why do I have a directory .rbenv/versions/2.2.3/lib/ruby/gems/2.2.0? I'm using ruby 2.2.3, but the gem dir is 2.2.0
[18:46:50] bruno-_: has joined #ruby
[18:46:52] soahccc: mcantor: it's the C api version or something like that
[18:48:44] kirun: has joined #ruby
[18:48:46] maikowblue: has joined #ruby
[18:48:47] mcantor: soahccc: where can I read more about this?
[18:48:49] soahccc: axisys: I think maybe there is something else wrong? That works here http://files.sven.bmonkeys.net/images/Desktopa.rb_2015-11-03_19-48-25.png
[18:48:54] darix: ruby -r rbconfig -e 'puts RbConfig::CONFIG["ruby_version"]'
[18:49:34] Rollabunna: has joined #ruby
[18:49:36] mistermocha: has joined #ruby
[18:50:15] soahccc: mcantor: http://stackoverflow.com/questions/8564210/why-are-we-installing-ruby-1-9-2-1-9-3-gems-into-a-1-9-1-folder
[18:50:49] FDostoyevsky: has joined #ruby
[18:50:58] griffindy: has joined #ruby
[18:51:00] qwertme: has joined #ruby
[18:51:00] mcantor: soahccc: TIL. thanks!
[18:51:20] mistermocha: has joined #ruby
[18:52:08] bruno-_: has joined #ruby
[18:52:15] mistermocha: has joined #ruby
[18:53:22] umgrosscol: has joined #ruby
[18:53:35] mistermocha: has joined #ruby
[18:53:57] axisys: soahccc: does this password work? T#b]zYs&Ap4I
[18:55:11] soahccc: axisys: nope: lib/ruby/2.1.0/uri/generic.rb:440:in `check_password': bad component(expected user component): T#b]zYs&Ap4I (URI::InvalidComponentError)
[18:55:30] axisys: soahccc: there we go!
[18:55:34] symbole: has joined #ruby
[18:57:14] soahccc: axisys: I guess here we go then https://app.zencoder.com/docs/guides/getting-started/special-characters-in-usernames-and-passwords
[18:57:21] bruno-_: has joined #ruby
[18:57:24] lukaszes: has joined #ruby
[18:58:25] Coldblackice: has joined #ruby
[18:59:06] axisys: so need to try like this? http://user%40example.com:pass%21word@example.com/path/to/input.avi
[18:59:40] mozzarella: has joined #ruby
[18:59:50] jaequery: has joined #ruby
[19:00:32] jacksonmills: has joined #ruby
[19:01:17] `based_pdev`: has joined #ruby
[19:02:04] charany1: has joined #ruby
[19:02:39] bruno-: has joined #ruby
[19:02:59] soahccc: axisys: yeah you have to encode the special characters. at least according to the specification. No idea if the end product will be able to work with it
[19:03:05] roshanavand: has joined #ruby
[19:03:19] vF3hNGxc47h8: has joined #ruby
[19:03:24] axisys: soahccc: but password is unknown..
[19:04:01] snockerton: has joined #ruby
[19:04:12] axisys: how do I know if there is odd character and then encode it?
[19:04:14] bb010g: has joined #ruby
[19:04:49] axisys: or are you saying take the password word and encode it before using it?
[19:04:52] soahccc: axisys: well you either know the password (you need to pass it at some point right?) or you url encode the unknown password
[19:05:05] banister: anyone here speak french?
[19:05:26] axisys: soahccc: yes $_pass in bash has the password
[19:05:34] banister: what does 'bah pour se voir' mean?
[19:05:48] axisys: banister: translate.google.com
[19:06:00] rakm: has joined #ruby
[19:06:05] banister: axisys no shit, it doesn't work in this case, it's clearly some form of french slang
[19:06:45] ibouvousaime: has joined #ruby
[19:07:20] beauby: has joined #ruby
[19:07:53] bruno-_: has joined #ruby
[19:07:55] Ox0dea: has joined #ruby
[19:08:04] Ox0dea: >> require 'uri'; URI.escape '#%<>^`' # axisys
[19:08:05] ruboto: Ox0dea # => "%23%25%3C%3E%5E%60" (https://eval.in/462477)
[19:08:18] druonysus: has joined #ruby
[19:08:23] to_json: has joined #ruby
[19:08:24] to_json: has joined #ruby
[19:09:13] axisys: Ox0dea: cool.. let me give that a try
[19:09:25] malconis_: has joined #ruby
[19:09:27] soahccc: axisys: you can also urlencode with bash but oh my :D
[19:09:44] moeabdol: has joined #ruby
[19:11:37] ta: has joined #ruby
[19:11:46] axisys: soahccc: wow!
[19:11:47] ta: has joined #ruby
[19:11:49] soahccc: banister: "bah" seem to be a sign of hesitation like in "err, nope" and the rest is "to see"... no idea :D
[19:12:23] Ox0dea: Would anyone like to see a magic trick?
[19:12:56] adaedra: Ok, first, get out of my mind, mate.
[19:13:03] Ox0dea: And secondly?
[19:13:08] bruno-_: has joined #ruby
[19:13:22] atomical_: has joined #ruby
[19:13:22] adaedra: Secondly, there was only one point.
[19:13:35] Ox0dea: The math checks out.
[19:13:52] phillips1012: has joined #ruby
[19:14:07] yqt: has joined #ruby
[19:14:42] gusTester: has joined #ruby
[19:14:51] adaedra: soahccc: so close, yet so far away.
[19:15:43] soahccc: adaedra: yeah I know embarrassing... I work for a french company and can't speak a work french :D
[19:15:52] Ox0dea: >> srand File.read($0).size;Object.const_get(Object.constants.sample)[/.{18}$/]
[19:15:53] ruboto: Ox0dea # => "Yukihiro Matsumoto" (https://eval.in/462482)
[19:16:13] Ox0dea: I.respond_to?(:even?) # => false
[19:16:15] Xeago: has joined #ruby
[19:16:31] riceandbeans: if I have a method, def foo (bar, baz, foobar='test'), and I want to check if specifically foobar is set to NOT be 'test' can I not specify it on passing it in like so?
[19:16:55] riceandbeans: foo (bar, baz, foobar='testtest')
[19:17:09] Ox0dea: riceandbeans: It's not entirely clear what you're asking.
[19:17:27] riceandbeans: I have a method with required variables and variables with default values
[19:17:29] adaedra: soahccc: well, it doesn't seems too bad. I'm sure most people working for Ikea don't speak swedish, for example.
[19:17:30] Ox0dea: riceandbeans: You want argument guards or something?
[19:17:49] dorei: is there a way to find out which methods at an object were defined via attr_reader / attr_writer ?
[19:17:56] riceandbeans: I want to be able to specify a specific variable being passed in as something, but the number of arguments passed may vary
[19:18:00] momomomomo: has joined #ruby
[19:18:14] riceandbeans: I may end up just writing a separate method to do the exact same thing for the most part if I can't get it thought
[19:18:19] eam: riceandbeans: you can always set defaults in your own code, outside the method signature
[19:18:20] bruno-_: has joined #ruby
[19:18:50] Ox0dea: dorei: A neat trick for determining that a method was created via #attr_accessor is to grab hold of the getter and setter as Method objects and compare their #source_location.
[19:19:02] acke: has joined #ruby
[19:19:09] Ox0dea: dorei: I suppose you could probably finagle that approach into finding the constituent parts.
[19:19:12] siemprefresco: has joined #ruby
[19:19:27] dorei: let me check that
[19:19:33] decoponyo: has joined #ruby
[19:19:39] eam: def whatevs(*args); arbitrary_logic_on args; end
[19:19:52] Ox0dea: riceandbeans: It depends on where in the argument list you'd like the required argument to appear.
[19:20:15] riceandbeans: I don't care, I just want it to work
[19:20:29] riceandbeans: it could be first, last, middle, really don't care where it is if it works
[19:20:42] Guest79: has joined #ruby
[19:20:44] Ox0dea: riceandbeans: def foo *args, required: 'bar' ...
[19:20:55] dnomyar: has joined #ruby
[19:21:04] ss_much: has joined #ruby
[19:23:35] bruno-_: has joined #ruby
[19:23:52] riceandbeans: how do I have pry tell me the ruby version?
[19:24:15] riceandbeans: windows is weird and doesn't recognize ruby with the pathing and it's using an embedded ruby from chef
[19:24:17] timonv: has joined #ruby
[19:24:56] haxrbyte: has joined #ruby
[19:25:25] Ox0dea: dorei: https://eval.in/462487
[19:25:44] atmosx: riceandbeans: RUBY_VERSION
[19:26:16] riceandbeans: ruby 2.0.0p645 (2015-04-13) [i386-mingw32]
[19:26:26] riceandbeans: I don't think I can do the required: thing in 2.0
[19:26:32] leventix_: has joined #ruby
[19:26:38] Ox0dea: riceandbeans: You can; they're called keyword arguments.
[19:26:51] wlch: has joined #ruby
[19:27:05] riceandbeans: and I don't do () +
[19:27:31] riceandbeans: I do def foo *args, required: 'bar' ?
[19:27:54] riceandbeans: and that just means the last argument specified is the required one?
[19:27:59] Ox0dea: Somebody needs to read a book.
[19:28:11] Ox0dea: Put the parameter list in parentheses if you want, dude.
[19:28:24] riceandbeans: is there any difference?
[19:28:25] haxrbyte_: has joined #ruby
[19:28:50] bruno-_: has joined #ruby
[19:29:07] diegoaguilar: has joined #ruby
[19:29:47] gusTester: has left #ruby: ()
[19:30:28] soahccc: riceandbeans: I only know of one example where parentheses actually make a functional difference and that is calling "super"
[19:30:50] EminenceHC: has joined #ruby
[19:32:21] dopamean_: has joined #ruby
[19:34:04] bruno-_: has joined #ruby
[19:34:34] _stu_: has joined #ruby
[19:35:19] dorei: Ox0dea: nice trick :) unfortunately it only works with attr_accessor :(
[19:35:45] gusTester: has joined #ruby
[19:36:01] Ox0dea: dorei: Yeah. :< I trust the method_source gem would be overkill for your purposes?
[19:36:34] baweaver: has joined #ruby
[19:37:54] gusTester: has left #ruby: ()
[19:39:20] bruno-_: has joined #ruby
[19:39:33] autojack: has joined #ruby
[19:39:58] [Butch]: has joined #ruby
[19:40:15] dorei: Ox0dea: at SO they suggest overriding attr_reader
[19:40:56] autojack: I am struggling with gem dependencies. I am trying to install a specific version of gem foo. when I do, it fails because something tries to install net-ssh 3.0.1, which requires ruby 2.0.0. yet 'gem dependency -r foo -v myversion' shows that it depends on a handful of things, valid versions of which are already installed.
[19:41:08] autojack: how do I figure out what is trying to install net-ssh?
[19:41:38] autojack: -V and --debug on gem install, annoyingly, do not tell me.
[19:41:40] EminenceHC: has joined #ruby
[19:41:50] mistermo_: has joined #ruby
[19:42:56] mattwildig: has joined #ruby
[19:43:49] jackjackdripper: has joined #ruby
[19:44:28] _djbkd: has joined #ruby
[19:44:31] vdamewood: has joined #ruby
[19:44:32] EminenceHC: has joined #ruby
[19:44:38] bruno-_: has joined #ruby
[19:45:42] jackjackdripper: has joined #ruby
[19:46:00] worstcase: has joined #ruby
[19:46:15] worstcase: hi there, any ideas how i could "flip" a array like that: https://gist.github.com/b1nary/6e9416eeaf1e59e3b9e6
[19:46:50] leventix: has joined #ruby
[19:47:26] Ox0dea: has joined #ruby
[19:47:43] Ox0dea: worstcase: You want #transpose.
[19:47:43] ytti: [7] pry(main)> (1..9).to_a.each_slice(3).to_a
[19:47:44] ytti: => [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
[19:48:12] Ox0dea: ytti: Why assume worstcase has sequential elements?
[19:48:15] timonv: has joined #ruby
[19:48:17] charany1: has joined #ruby
[19:48:21] TheHodge: has joined #ruby
[19:48:28] QORRiE: has joined #ruby
[19:48:30] towski_: has joined #ruby
[19:48:35] QORRiE: has joined #ruby
[19:48:44] ytti: Ox0dea, i'm not sure what you mean
[19:49:02] axl__: has joined #ruby
[19:49:04] swgillespie: has joined #ruby
[19:49:12] Ox0dea: ytti: Oh, never mind; your suggestion doesn't even do what worstcase was asking for.
[19:49:16] Ox0dea: >> [1,8,6,7,5,3,0,9,1].each_slice(3).to_a.transpose # worstcase
[19:49:17] ruboto: Ox0dea # => [[1, 7, 0], [8, 5, 9], [6, 3, 1]] (https://eval.in/462495)
[19:49:25] ytti: oh right
[19:49:36] bruno-_: has joined #ruby
[19:49:45] tigarcia: has joined #ruby
[19:49:58] adac: has joined #ruby
[19:51:12] worstcase: Ox0dea, sorry was just looking into the docs as you wrote. yeah sounds about right. thanks!
[19:51:33] ibouvousaime: has joined #ruby
[19:52:02] mozzarella: has joined #ruby
[19:52:40] mistermocha: has joined #ruby
[19:52:48] EminenceHC: has joined #ruby
[19:52:51] jgt: has joined #ruby
[19:53:05] balazs: has joined #ruby
[19:53:20] axl_: has joined #ruby
[19:53:49] kadoppe: has joined #ruby
[19:54:52] bruno-_: has joined #ruby
[19:56:29] jordanloky: has joined #ruby
[19:56:31] roxtrongo: has joined #ruby
[19:57:11] nettoweb: has joined #ruby
[20:02:33] dravine: has joined #ruby
[20:02:37] Tempesta: has joined #ruby
[20:03:49] YourKicks: has joined #ruby
[20:05:15] Zai00: has joined #ruby
[20:05:35] dravine_: has joined #ruby
[20:07:30] hxegon: >> def ransom_text text; acc, chars = [], text.split(''); acc << chars.shift(rand(5)).join until chars.empty?; acc.map(&:capitalize).join; end; ransom_text 'The quick brown fox jumps over the lazy dog.'
[20:07:31] ruboto: hxegon # => "THE qUick bRown foX jUMps Over the Lazy dOG." (https://eval.in/462496)
[20:08:39] hxegon: this whole acc business is killing me
[20:09:37] juanpablo__: has joined #ruby
[20:09:40] Channel6: has joined #ruby
[20:10:27] User458764: has joined #ruby
[20:10:45] mleung: has joined #ruby
[20:13:35] Ox0dea: >> srand File.read($0).size;Object.const_get(Object.constants.sample)[/.{18}$/]
[20:13:36] ruboto: Ox0dea # => "Yukihiro Matsumoto" (https://eval.in/462498)
[20:14:09] Ox0dea: Isn't it great?
[20:14:21] vigintas: has joined #ruby
[20:14:32] dopamean_: has joined #ruby
[20:14:44] adaedra: Having fun here?
[20:14:49] Ox0dea: That plain-as-day 18 is unfortunate, but the program's length had to be exact.
[20:15:16] Ox0dea: adaedra: It's sort of like a quine but not at all really.
[20:15:39] Ox0dea: Still, parameterizing the randomness on the file size is silly and wonderful.
[20:16:01] acke: has joined #ruby
[20:16:03] shevy: >> srand File.read($0).size;Object.const_get(Object.constants.sample)[/.{18}$/]
[20:16:04] ruboto: shevy # => "Yukihiro Matsumoto" (https://eval.in/462499)
[20:16:09] Ox0dea: Holy shit! It's deterministic!
[20:16:23] hxegon: 'random' output
[20:16:25] riotjones: has joined #ruby
[20:16:28] Ox0dea: hxegon: Hue hue.
[20:16:31] mistermo_: has joined #ruby
[20:16:40] hxegon: well if its good enough for RSA
[20:16:47] EminenceHC: has joined #ruby
[20:16:52] Ox0dea: hxegon: Did you mean the universe?
[20:17:03] hotpancakes: has joined #ruby
[20:17:19] mooru: has joined #ruby
[20:17:22] hxegon: Ox0dea: depends on how you thing of quantom mechanics, unless this is a whoosh moment.
[20:17:33] mattwildig: has joined #ruby
[20:17:36] dfockler: has joined #ruby
[20:20:23] EminenceHC: has joined #ruby
[20:22:51] Ox0dea: hxegon: The vast majority of our assumptions regarding randomness have turned up misplaced; doesn't Occam suggest that we ought to just extrapolate all the way out?
[20:23:38] Ox0dea: > Any sufficiently advanced disorganization is indistinguishable from randomness... until you set about organizing it.
[20:25:21] yfeldblum: has joined #ruby
[20:25:32] Ebok: Hm, I'm working with sort_by, and I'm curious. array.sort_by{|str| str.length} gives the smallest to the largest, is there a simple change that would provide the same array but largest to smallest?
[20:25:49] hxegon: Ebok: just do .reverse on the result
[20:26:00] Ebok: nope, that still fucks it up
[20:26:10] Ebok: I need it to do what I asked.
[20:26:24] Ebok: I guess I'll do it differently if that's not possible
[20:26:47] mozzarella: has joined #ruby
[20:27:10] hxegon: Ebok: hmm... you can't just do array.sort_by(&:length).reverse ?
[20:27:17] Ox0dea: Come on, hxegon.
[20:27:22] Ox0dea: Ebok: Negate the length.
[20:27:26] unsymbol: has joined #ruby
[20:27:35] Ox0dea: >> %w[a bb ccc].sort_by { |s| -s.length }
[20:27:36] ruboto: Ox0dea # => ["ccc", "bb", "a"] (https://eval.in/462516)
[20:27:44] andykingking: has joined #ruby
[20:27:46] Ox0dea: Honestly.
[20:27:48] hxegon: Ox0dea: I didn't know you could do that.
[20:27:55] Ebok: That's new
[20:28:10] skcin7: has joined #ruby
[20:28:16] cjbischof_: has joined #ruby
[20:28:17] Ebok: I love it whenever Ox0 answers me >_> everysingle time I learn something
[20:28:45] shevy: Ox only shows reallife code
[20:28:57] Spami_: has joined #ruby
[20:29:21] dhollinger: has joined #ruby
[20:29:32] sandals: has joined #ruby
[20:30:44] eam: hm, sort_by says it does a Schwartzian transform, so wouldn't sort { |a,b| b <=> a } be faster?
[20:30:55] eam: I wonder
[20:31:47] lkba: has joined #ruby
[20:32:29] trosborn: has joined #ruby
[20:32:39] zenguy_pc: has joined #ruby
[20:36:41] sepp2k: has joined #ruby
[20:36:50] shevy: dutiful testing
[20:38:13] eam: looks like #length is a lot more expensive than I would've thought
[20:40:31] Musashi007: has joined #ruby
[20:41:05] tvw: has joined #ruby
[20:41:27] rgrmatt: has joined #ruby
[20:41:52] momomomomo_: has joined #ruby
[20:42:29] eL_bAmba: has joined #ruby
[20:42:40] ghostbox: has joined #ruby
[20:42:41] symm-_: has joined #ruby
[20:42:55] FernandoBasso: has joined #ruby
[20:42:58] mcantor: has joined #ruby
[20:43:28] shevy: it costs 3 bucks!
[20:44:27] andykingking: has joined #ruby
[20:45:37] EminenceHC: has joined #ruby
[20:46:33] colegatron: has joined #ruby
[20:46:51] beauby: has joined #ruby
[20:47:17] baweaver: has joined #ruby
[20:49:52] pwnd_nsfw: has joined #ruby
[20:50:27] Rollabunna: has joined #ruby
[20:50:42] mistermocha: has joined #ruby
[20:50:50] EdwardIII: has joined #ruby
[20:50:59] chibs: has joined #ruby
[20:51:29] Ox0dea: eam: Your predicate there doesn't sort them by length.
[20:53:15] pathOs: has joined #ruby
[20:53:24] JanPeter: has joined #ruby
[20:53:43] rgrmatt: has joined #ruby
[20:54:13] hahuang65: has joined #ruby
[20:55:22] diegoaguilar: has joined #ruby
[20:56:29] bruno-: has joined #ruby
[20:56:54] kstuart: has joined #ruby
[20:57:19] lemur: has joined #ruby
[20:57:28] treehug88: has joined #ruby
[20:57:54] codecop: has joined #ruby
[20:58:02] cdg: has joined #ruby
[20:58:32] trosborn: has joined #ruby
[20:58:37] Coldblackice: has joined #ruby
[20:58:38] Ox0dea: I realize now it was just a demonstration of the principle.
[20:58:47] VeryBewitching: has joined #ruby
[21:00:03] skweek: has joined #ruby
[21:00:35] Ox0dea: { b - a } is ~15% faster than { b <= > a }.
[21:01:05] Ox0dea: All that matters is the sign.
[21:01:50] Ebok: what is a good way to test the efficiency of the code like that?
[21:02:04] Ox0dea: Ebok: require 'benchmark-ips'
[21:02:08] autojack: has left #ruby: ()
[21:03:04] Ox0dea: Ebok: It's pretty great: https://eval.in/462534
[21:03:11] andykingking: has joined #ruby
[21:04:10] Ebok: That goes into my cool useful code for later pile
[21:04:27] Ox0dea: Instead of running some block `n` times and determining how long it took, you calculate how many times it can run in a given time frame.
[21:05:32] arthurix_: has joined #ruby
[21:05:35] Ox0dea: Ebok: Do you own a private island?
[21:05:43] Ebok: Nope >_>
[21:05:51] Ox0dea: Well, where are you gonna put that pile?
[21:05:55] Ox0dea: This is #ruby, after all.
[21:06:00] bricker: has joined #ruby
[21:06:11] Ebok: I'm keeping it in the Ox0dea conversations log
[21:07:14] rgrmatt: has joined #ruby
[21:07:55] bender_unit: has joined #ruby
[21:08:02] PaulCapestany: has joined #ruby
[21:08:30] mg^: has joined #ruby
[21:09:34] podman: has joined #ruby
[21:10:02] shevy: there are different piles
[21:10:08] shevy: code that is useful - one pile
[21:10:16] shevy: code that is of dubious nature - middle pile
[21:10:24] shevy: code that was written by hanmac or Ox0dea - last pile
[21:10:29] to_json: has joined #ruby
[21:10:29] to_json: has joined #ruby
[21:10:51] Ebok: >_>; that's true
[21:10:57] Ebok: also Ox0dea pm
[21:11:05] Axsuul: has joined #ruby
[21:11:06] kinduff: has joined #ruby
[21:11:36] momomomomo: has joined #ruby
[21:11:58] neanderslob: has joined #ruby
[21:12:40] freerobby: has joined #ruby
[21:14:54] mary5030: has joined #ruby
[21:15:15] tigarcia: has joined #ruby
[21:15:31] mary5030: has joined #ruby
[21:17:56] baweaver: has joined #ruby
[21:19:25] andykingking: has joined #ruby
[21:19:56] freerobby: has joined #ruby
[21:20:36] pedahzur: has joined #ruby
[21:22:34] EminenceHC: has joined #ruby
[21:22:56] Axy: has joined #ruby
[21:24:10] nfk: has joined #ruby
[21:24:26] pedahzur: Do Ruby networking libraries (such as open-uri and 'net') honor $HTTP_PROXY and $NO_PROXY rules automatically, or does the application using those libraries have to invoke something to make sure their requests go over the defined proxy?
[21:26:37] Ox0dea: pedahzur: Yes to the former, no the latter.
[21:27:00] pedahzur: Ox0dea: Thanks!
[21:27:10] Ox0dea: pedahzur: You were referring to the environment variables, yeah?
[21:27:17] pedahzur: Ox0dea: yes.
[21:27:58] pedahzur: Ox0dea: I'm trying to troubleshoot a Berkshelf problem, and I wanted to make sure it was honoring proxy rules. It's throwing a 404 exception, but not telling *what* URL it's failing to load, even in debug mode. :)
[21:28:50] Ox0dea: pedahzur: Debug-printing to the rescue. :P
[21:29:09] pedahzur: Ox0dea: Explain?
[21:29:21] solocshaw: has joined #ruby
[21:29:33] uber: has joined #ruby
[21:29:47] andykingking: has joined #ruby
[21:31:52] Mia: has joined #ruby
[21:32:23] Ox0dea: pedahzur: Wherever seems most fitting, print the URL you're about to request before actually requesting it.
[21:32:31] bruno-_: has joined #ruby
[21:32:42] pedahzur: Ox0dea: Ah. I'll have to dig into the berkshelf code for that. :)
[21:33:05] uber: has joined #ruby
[21:34:01] spew: has joined #ruby
[21:34:08] sepp2k1: has joined #ruby
[21:35:10] Ox0dea: pedahzur: Oh, I see. Well, this is Ruby; you're free to redefine just about anything you please just about any time.
[21:35:14] Xeago: has joined #ruby
[21:35:26] pedahzur: heh, this is true.
[21:35:30] Ox0dea: pedahzur: Have you considered watching from the outside instead with some tracing library?
[21:35:43] vinleod: has joined #ruby
[21:35:52] Ox0dea: And, well, there's the TracePoint API if you'd prefer to do it from within Ruby, but that could get hairy.
[21:36:09] pedahzur: Ox0dea: No. Relatively new to Ruby, so much of this is new to me.
[21:36:33] relix: has joined #ruby
[21:36:34] Xeago: has joined #ruby
[21:36:40] pedahzur: There are 55 files in berks to dig through...not sure I want to do this. :)
[21:37:44] bruno-_: has joined #ruby
[21:38:22] axl_: has joined #ruby
[21:39:15] Ox0dea: pedahzur: Well, I'm outta here for a while, but maybe I'll be in the mood for some code archaeology when I get back. :P
[21:39:33] pedahzur: Ox0dea: OK. Seems Berks now uses https://github.com/nahi/httpclient Not sure if that supports $PROXY variables.
[21:39:41] Ox0dea: I bet it does.
[21:39:45] Ox0dea: Give it a look-see.
[21:40:41] pedahzur: From an initial grep, it seems it does.
[21:41:26] fschuindt: has joined #ruby
[21:41:54] fschuindt: How can I pass two parameters to a method, being a string and a block?
[21:42:11] lukaszes: has joined #ruby
[21:42:22] Ox0dea: fschuindt: def foo arg, &block; ...; end
[21:42:44] momomomomo: has joined #ruby
[21:42:53] Musashi007: has joined #ruby
[21:42:59] bruno-: has joined #ruby
[21:43:12] Ropeney: has joined #ruby
[21:43:21] to_json: has joined #ruby
[21:43:21] to_json: has joined #ruby
[21:44:31] bmalum: has joined #ruby
[21:45:52] cpup: has joined #ruby
[21:46:53] jpfuentes2: has joined #ruby
[21:47:05] petricore: has joined #ruby
[21:48:14] bruno-_: has joined #ruby
[21:48:31] tvw: has joined #ruby
[21:49:52] pietr0_: has joined #ruby
[21:49:59] BSaboia: has joined #ruby
[21:50:05] chouhoulis: has joined #ruby
[21:52:08] mattwildig: has joined #ruby
[21:52:52] arthurix: has joined #ruby
[21:53:10] bruno-_: has joined #ruby
[21:53:17] mondongo: has joined #ruby
[21:53:24] mondongo: has left #ruby: ()
[21:55:18] axisys: soahccc: that was a long meeting .. so I used the urlencoded password and now do no get bad uri but incorrect user name or password
[21:55:31] axisys: $ urlencode 'T#b]zXs&Ap4I'
[21:55:33] axisys: T%23b%5DzXs%26Ap4I
[21:55:55] axisys: rvc foo:T%23b%5DzXs%26Ap4I@vcenter.com
[21:55:57] AndyBotwin: has joined #ruby
[21:55:57] AndyBotwin: has joined #ruby
[21:56:09] joshua75: has joined #ruby
[21:56:13] axisys: Failed to connect to vcenter.com: InvalidLogin: Cannot complete login due to an incorrect user name or password
[21:57:22] joshua75: Hello i need help with a problem
[21:57:37] joshua75: I'm very new to ruby programming and im currently doing codecademy
[21:57:53] Balllkenende: has joined #ruby
[21:58:03] axisys: soahccc: that error message is from line 85
[21:58:06] kinduff: has joined #ruby
[21:58:06] axisys: soahccc: https://github.com/vmware/rvc/blob/master/bin/rvc
[21:58:15] karapetyan: has joined #ruby
[21:58:15] joshua75: but im working on a simple log in program, in the command line, just to kinda let my current skills sink in. I keep encountering a syntax issue.
[21:58:21] juanpablo__: has joined #ruby
[21:58:28] bruno-_: has joined #ruby
[21:59:12] joshua75: https://gist.github.com/jminchew97/38b94ee200b3ded1223e
[21:59:14] _stu_: has joined #ruby
[21:59:30] dikaio: has joined #ruby
[21:59:34] SCHAAP137: has joined #ruby
[22:00:47] karapetyan: has joined #ruby
[22:03:40] baweaver: Joshua__: error helps too
[22:03:41] bruno-_: has joined #ruby
[22:03:47] baweaver: also, use two space indentation instead of tabs
[22:03:57] baweaver: no need to indent any of those blocks like that.
[22:04:13] devoldmx: has joined #ruby
[22:04:23] lukaszes: has joined #ruby
[22:05:02] mozzarella: has joined #ruby
[22:05:27] baweaver: probably that you need 'while do'
[22:06:42] shevy: python reloaded! http://blog.pyston.org/2015/11/03/102/
[22:06:57] shevy: now we can have rusy, the updated variant for ruby
[22:08:27] rbennacer: has joined #ruby
[22:08:54] bruno-: has joined #ruby
[22:09:07] cdg: has joined #ruby
[22:09:29] hxegon: Joshua__: I'm just going to make some comments on that gist real quick...
[22:10:47] vdamewood: has joined #ruby
[22:11:55] tigarcia: has joined #ruby
[22:14:09] bruno-_: has joined #ruby
[22:15:45] arescorpio: has joined #ruby
[22:16:46] diegoaguilar: has joined #ruby
[22:16:57] imperator: has joined #ruby
[22:17:10] riotjones: has joined #ruby
[22:17:16] imperator: rubygems 2.5.0 has been released
[22:17:56] momomomomo: has joined #ruby
[22:19:11] joshua75: hxegon: thank you
[22:19:25] bruno-_: has joined #ruby
[22:19:35] mistermo_: has joined #ruby
[22:20:46] darix: shevy: llvm based. should rubinius be similar maybe?
[22:21:19] Musashi007: has joined #ruby
[22:21:20] hxegon: Joshua__: what is the syntax issue?
[22:21:20] haxrbyte: has joined #ruby
[22:21:56] joshua75: Okay now the issue is that
[22:22:17] joshua75: even if my username or password is equal to the username or password i made, it isnt recognizing it
[22:22:29] edj979: has joined #ruby
[22:22:46] joshua75: how do make ruby find if a string is the same as another?
[22:22:59] edj979: Migrations are pending. To resolve this issue, run: bin/rake db:migrate RAILS_ENV=development Extracted source (around line #392): 390 391 392 393 394 395 def check_pending!(connection = Base.connection) raise ActiveRecord::PendingMigrationError if ActiveRecord::Migrator.needs_migration?(connection) end def load_schema_if_pending! I tried that and it showed the same thing again. I already
[22:24:02] edj979: joshua try varName == varName2
[22:24:43] bruno-_: has joined #ruby
[22:24:55] hxegon: >> 'one' == 'one' # Joshua__
[22:24:56] ruboto: hxegon # => true (https://eval.in/462564)
[22:27:11] edj979: https://github.com/edj979/pinterestingb
[22:27:19] opensource_ninja: has joined #ruby
[22:27:22] edj979: can anyone tell me what i did wrong?
[22:29:40] hxegon: edj979: you asked a rails question on #ruby instead of #rubyonrails
[22:29:46] matcouto: has joined #ruby
[22:29:57] bruno-_: has joined #ruby
[22:30:24] eam: >> '???one' == 'one' # hxegon
[22:30:25] ruboto: eam # => false (https://eval.in/462570)
[22:30:45] edj979: is anyone here?
[22:30:52] hxegon: eam: ok? yes.
[22:31:03] edj979: do you know how to fix this?
[22:31:15] edj979: https://github.com/edj979/pinterestingb
[22:31:21] imperator: has left #ruby: ("Leaving")
[22:31:29] hxegon: edj979: I just told you, ask on #rubyonrails
[22:31:29] edj979: Migrations are pending. To resolve this issue, run: bin/rake db:migrate RAILS_ENV=development Extracted source (around line #392): 390 391 392 393 394 395 def check_pending!(connection = Base.connection) raise ActiveRecord::PendingMigrationError if ActiveRecord::Migrator.needs_migration?(connection) end def load_schema_if_pending! I tried that and it showed the same thing again. I already
[22:31:47] edj979: has left #ruby: ()
[22:32:13] bender_unit: has joined #ruby
[22:32:14] shevy: darix no idea, I wish creating new programming languages would be much simpler though
[22:32:19] hxegon: edj979: its ok. Also, mass pasting stuff is not good irc etiquette. use gists or something
[22:32:44] edj979: has joined #ruby
[22:33:16] edj979: When i tried to join it it said i couldn't send messages on that channel. Do you know what thats about?
[22:33:40] shevy: you must register there
[22:33:48] shevy: on #ruby it's free for all
[22:33:56] shevy: don't abandon us :(
[22:34:11] edj979: i have no idea what im doing lol
[22:34:43] shevy: I would not know how to do it with webchat either; if you use a traditional client then this would help https://freenode.net/faq.shtml#userregistration
[22:34:48] shevy: you stay with us instead :>
[22:35:11] bruno-_: has joined #ruby
[22:35:26] ghostbox: has joined #ruby
[22:36:24] karapetyan: has joined #ruby
[22:36:34] adaedra: That's the same way with webchat.
[22:37:44] pietr0: has joined #ruby
[22:38:08] rodfersou: has joined #ruby
[22:38:20] hxegon: you have to register with NickServ
[22:38:27] hxegon: edj979: ^
[22:38:41] Xeago: has joined #ruby
[22:39:10] edj979: nickserv???
[22:39:17] edj979: how do i talk to nickserv?
[22:39:40] adaedra: Did you read the page shevy linked?
[22:39:46] edj979: I've spent all day trying to fix this error but im clueless
[22:39:55] edj979: i just started reading it yea
[22:39:56] kobain: has joined #ruby
[22:40:30] bruno-_: has joined #ruby
[22:40:47] zenguy_pc: has joined #ruby
[22:40:54] ellisTAA: has joined #ruby
[22:41:59] baweaver: has joined #ruby
[22:42:17] ellisTAA: i???m trying to write a 6 degrees of separation algorithm but for some reason i don???t think it???s working. when i???m iterating over an array of [a,b,c] if a hits a conditional statement that includes a break will it break out of that code and then start working on b or will it break out of the entire iteration over the array? https://gist.github.com/ellismarte/2c17adc195dfc84eac01#file-6degreesofbacon-rb-L25
[22:43:32] hxegon: dem nested if statements
[22:43:54] acke: has joined #ruby
[22:44:28] hxegon: EllisTAA: this would be way easier if you named stuff a bit better and extracted functions
[22:44:39] raposa: has joined #ruby
[22:44:56] ellisTAA: hxegon: k let me try that
[22:45:19] pedahzur: How do you get the body from a 404 messages when using open-uri in Ruby 2? This would suggest error.io.readlines http://stackoverflow.com/questions/13020597/getting-the-contents-of-a-404-error-page-response-ruby but that doesn't work in Ruby 2.
[22:45:43] bruno-_: has joined #ruby
[22:46:00] mondongo: has joined #ruby
[22:46:11] yfeldblum: has joined #ruby
[22:47:31] radgeRayden_: has joined #ruby
[22:47:35] jpfuentes2: has joined #ruby
[22:47:53] pedahzur: According to the docs, Net::HTTPNotFound has a parent of Net::HTTPClientError which ha a parent of Net::HTTPResponse which seems to indicate error.body() should work, but it also fails.
[22:48:16] Eiam_: has joined #ruby
[22:49:42] idefine: has joined #ruby
[22:51:00] bruno-_: has joined #ruby
[22:51:20] Rollabunna: has joined #ruby
[22:51:39] chouhoulis: has joined #ruby
[22:52:01] kinduff: has joined #ruby
[22:52:17] Balllkenende: has joined #ruby
[22:53:22] ellisTAA: hxegon: i improved the names https://gist.github.com/ellismarte/2c17adc195dfc84eac01
[22:54:05] raposa: has left #ruby: ()
[22:55:54] arthurix_: has joined #ruby
[22:56:13] axl_: has joined #ruby
[22:56:16] bruno-_: has joined #ruby
[22:56:42] radgeRayden: has joined #ruby
[22:57:49] rgb-one: has joined #ruby
[22:57:52] kstuart: has joined #ruby
[22:58:05] hxegon: EllisTAA: looking now
[22:58:08] hxegon: rgb-one: hi!
[22:58:19] ellisTAA: hxegon: i???m trying to break apart the method .. kinda hard
[22:59:09] hxegon: EllisTAA: thats a sign :D
[23:00:04] SCHAAP137: has joined #ruby
[23:00:37] rgb-one: What is the name of the ruby file hash (md5, sha1, etc.) library?
[23:00:42] hahuang65: has joined #ruby
[23:00:51] hxegon: EllisTAA: is this a runtime error, or a logical error?
[23:01:12] tigarcia: has joined #ruby
[23:01:14] hxegon: EllisTAA: nvm, remembered your question
[23:01:15] ellisTAA: hxegon: logic
[23:01:31] bruno-_: has joined #ruby
[23:02:04] kinduff: has joined #ruby
[23:02:12] momomomomo: has joined #ruby
[23:03:51] rgb-one: has left #ruby: ()
[23:04:13] Zai00: has joined #ruby
[23:05:08] wilsonc91: has joined #ruby
[23:05:39] Limix: has joined #ruby
[23:05:56] wilsonc91: has joined #ruby
[23:06:27] leafybas_: has joined #ruby
[23:06:32] bruno-: has joined #ruby
[23:06:37] malconis: has joined #ruby
[23:06:44] kaneis: has joined #ruby
[23:07:34] atomical: has joined #ruby
[23:07:59] hxegon: EllisTAA: this is... hard to cut through. your mutating stuff, there is recursion. what are kind of data are you operating on? Could you explicit use of return be screwing with this? etc...
[23:08:25] wilsonc91: has joined #ruby
[23:08:34] ellisTAA: hxegon: maybe. any ideas on how i could approach this in a better way?
[23:10:08] jgpawletko: has joined #ruby
[23:10:20] wilsonc91: has joined #ruby
[23:11:22] hxegon: EllisTAA: honestly, I think you might be better starting over... It would probably take me longer to pick through this and make suggestions than help you rewrite it.
[23:11:42] ellisTAA: hxegon: for sure. but how would i approach it diffeerentlY?
[23:11:46] bruno-: has joined #ruby
[23:12:57] wilsonc91: has joined #ruby
[23:12:57] jessemcgilallen: has joined #ruby
[23:13:04] Musashi007: has joined #ruby
[23:13:30] hxegon: EllisTAA: well for starters it's one huge method. We would start by breaking it down.
[23:14:03] ellisTAA: hxegon: the problem with that is that i then need to pass methods a ton of variables ??? you think that???s fine?
[23:14:03] wilsonc91: has joined #ruby
[23:14:19] hxegon: EllisTAA: what data do you need to pass it?
[23:14:50] ellisTAA: a list of groups searched, members searched, degree of separation, the person we are trying to find
[23:14:53] raposa: has joined #ruby
[23:15:40] hxegon: EllisTAA: is groups searched stuff that is necessary for recursion, or stuff that you pass in initially?
[23:16:39] ellisTAA: hxegon: if i don???t pass it in then i could end up searching the same group which would result in a function that doesn???t work
[23:16:59] wsewolod: has joined #ruby
[23:17:04] bruno-_: has joined #ruby
[23:17:40] chouhoulis: has joined #ruby
[23:17:54] CloCkWeRX: has joined #ruby
[23:17:59] CloCkWeRX: has left #ruby: ()
[23:18:07] hxegon: EllisTAA: would you ever pass in a value outside of that method definition?
[23:18:27] radgeRayden_: has joined #ruby
[23:18:35] Motoservo: has joined #ruby
[23:19:49] baroquebobcat: has joined #ruby
[23:21:15] mistermocha: has joined #ruby
[23:21:26] hxegon: EllisTAA: nevermind, you'll see what I mean in a bit. We need to make a prototype method that is easier to work with. How about one that operates on a hash like this: { title: 'footloose', cast: [:KevinBacon, ... ] }
[23:22:07] ellisTAA: hxegon: sorry my arm hurts i gotta take a break from coding.
[23:22:17] bruno-_: has joined #ruby
[23:22:38] hxegon: EllisTAA: ok, see ya
[23:22:55] mistermocha: has joined #ruby
[23:23:55] diegoviola: has joined #ruby
[23:24:50] blueOxigen: has joined #ruby
[23:27:00] Motoservo: has joined #ruby
[23:27:13] baroquebobcat: has joined #ruby
[23:27:35] bruno-_: has joined #ruby
[23:29:20] pedahzur: I'm trying to print out the contents of a 404 message (Ruby2). If I catch the error and print "error.data.response" I get "#<Net::HTTPNotFound:0x007f90320965b8>" According to http://ruby-doc.org/stdlib-2.0.0/libdoc/net/http/rdoc/Net/HTTPResponse.html (which is a parent class of this) I should be able to then do puts error.data.response.body However, when I do that, I get this: https://gist.github.com/jkugler/69e307f68a8b9a86a4d8 How
[23:29:22] pedahzur: do I get the response body?
[23:29:59] kaneis: has joined #ruby
[23:30:19] kaneis: has joined #ruby
[23:31:14] pedahzur: Hmm, doing error.data.response.inspect gives me "#<Net::HTTPNotFound 404 Not found readbody=false>" Why would readbody be false?
[23:32:00] shevy: perhaps because there was no body
[23:32:50] bruno-_: has joined #ruby
[23:34:12] darix: pedahzur: mechanize
[23:34:13] kaneis: has joined #ruby
[23:34:56] SenpaiSilver: has joined #ruby
[23:34:59] pedahzur: has joined #ruby
[23:35:52] idefine: has joined #ruby
[23:36:36] darix: https://gist.github.com/anonymous/7ce480f68bda301733a0
[23:36:48] rgtk: has joined #ruby
[23:36:49] zenguy_pc: has joined #ruby
[23:37:05] Motoservo: has joined #ruby
[23:37:32] mg^: Damn, I suck at RSpec. The mental transition from simple unit tests to what RSpec does is hard.
[23:37:49] pedahzur: Sorry, my connection blipped. Did I miss anything? :0
[23:38:08] bruno-_: has joined #ruby
[23:39:18] lagweezle: pedahzur: shevy suggested that it is perhaps because there was no body. darix said 'mechanize' and linked to https://gist.github.com/anonymous/7ce480f68bda301733a0
[23:40:02] crdpink2: has joined #ruby
[23:40:04] Motoservo: has joined #ruby
[23:42:24] pedahzur: lagweezle: Thanks.
[23:42:48] baweaver: has joined #ruby
[23:42:57] pedahzur: It's actually Berkshelf that uses the open-uri, and I've narrowed it down to a test case that shows open() is causing the issue. I may have to push this upstream. :(
[23:43:24] bruno-_: has joined #ruby
[23:45:06] zylogz80: has joined #ruby
[23:45:44] htmldrum: has joined #ruby
[23:47:07] juanpablo__: has joined #ruby
[23:48:27] jpfuentes2: has joined #ruby
[23:48:43] bruno-_: has joined #ruby
[23:49:17] CloCkWeRX: has joined #ruby
[23:49:42] sandals: has joined #ruby
[23:50:34] pedahzur: darix: Interesting. That gist doesn't seem to work as it should. A 404 raises Net::HTTPServerException not a Mechanize::ResponseCodeError. Is that expected?
[23:51:58] babblebre: has joined #ruby
[23:52:14] lagweezle: pedahzur: Out of curiosity, is this an HTTP URL that redirects to an HTTPS URL?
[23:52:26] pedahzur: lagweezle: No, it's an https URL.
[23:52:48] ruby-lang358: has joined #ruby
[23:53:15] SuMo_D: has joined #ruby
[23:53:30] lagweezle: ACTION ahs.
[23:53:39] ruby-lang358: hi lads, silly question: what's the difference between class Kernel; ... statements ... ; end and class << Kernel; ...statements... ; end ??
[23:53:47] dhollinger: has joined #ruby
[23:54:45] trosborn: has joined #ruby
[23:55:18] havenwood: ruby-lang358: The latter could alternatively be written: class Kernel; class << self; ... end end
[23:56:13] ruby-lang358: so the latter modifies the object representing the class Kernel, while the former the actual class Kernel?
[23:56:13] havenwood: ruby-lang358: `class Kernel; class << self; def example; end end end` could alternately be written as `class Kernel; def self.example; end end end`.
[23:57:04] dopamean_: has joined #ruby
[23:57:09] havenwood: ruby-lang358: Do you know about class methods or module functions?
[23:58:02] ruby-lang358: I'm trying to understand this matter as I'm new to Ruby. I understand that def self.foo is a static method, while def foo is a instance method
[23:58:17] ruby-lang358: at least in class Bla; def foo; end
[23:58:52] ruby-lang358: so class Bla; class << self; looks to me as a shortcut to define static methods/vars?
[23:59:00] havenwood: ruby-lang358: http://www.railstips.org/blog/archives/2009/05/11/class-and-instance-methods-in-ruby/