« Back to channel list

#ruby - 11 September 2015

« Back 1 day Forward 1 day »
[00:00:24] quazimodo: has joined #ruby
[00:00:45] Ox0dea: Have you not completely ruled out the possibility that demons got into your machine and removed the first's log, then?
[00:02:25] jedney: has joined #ruby
[00:03:58] Azure: has joined #ruby
[00:05:53] sevenseacat: i hate when that happens.
[00:06:34] casadei_: has joined #ruby
[00:07:36] juanpablo_: has joined #ruby
[00:08:05] postmodern: also double check that reality is not a simulation, and the laws of the universe are starting to glitch
[00:09:29] shock_one: has joined #ruby
[00:10:43] dfockler: another gap in my sys admin knowledge is log files
[00:10:59] dfockler: although I'm not a sys admin so...
[00:12:22] chills42: has joined #ruby
[00:13:38] dfockler: and server supervisors
[00:14:04] shevy: just ask systemd
[00:14:14] ranchodev: has joined #ruby
[00:14:41] linuxboytoo: has joined #ruby
[00:14:42] dfockler: systemd help
[00:15:04] diegoviola: has joined #ruby
[00:16:20] dfockler: When would I use a lambda for something anyways?
[00:16:34] dfockler: I've only ever needed them for callbacks in JS
[00:18:28] dfockler: ACTION runs off to write a monad with a lambda, knowing little about monads or lambdas
[00:18:34] jedney: has joined #ruby
[00:19:05] shevy: dfockler I always wondered about that as well
[00:19:22] Ariadeno: has joined #ruby
[00:19:42] Ox0dea: dfockler: You use blocks all the time, no?
[00:19:57] Ox0dea: They're essentially lambdae.
[00:20:22] Ox0dea: If Ruby didn't give us explicit syntax for them, somebody would've made it a library. :P
[00:20:37] casadei_: has joined #ruby
[00:20:58] Ox0dea: It's illustrative to think of lambdae as "dynamic blocks"; sometimes you're not sure which block you want to execute.
[00:21:30] hays_: has joined #ruby
[00:21:56] devoldmx: has joined #ruby
[00:24:20] Ox0dea: It's true that they're not strictly necessary, but following that logic all the way down gets us back to the bad old days of `goto` and nothing but.
[00:24:29] arcanez: Ox0dea: I'm trying to figure out why I'd have .2015-07-31 and .2015-08-02. I want to rule out Lumberjack messing up
[00:24:32] morenoh149: has joined #ruby
[00:24:58] bootstrappm: posted this in #ror but got no response so I'm trying here: how do you stub Devise's authenticate_user! in controller tests?
[00:25:12] Ox0dea: arcanez: Consider whether you'd be more or less alarmed if the file existed and were empty.
[00:25:15] bougyman: doesn't Devise have a mock mode for that?
[00:25:41] HAL2328: has joined #ruby
[00:25:49] bootstrappm: no RSpec, just Minitest
[00:25:53] sevenseacat: i'm sure that would be in the devise wiki
[00:25:57] bootstrappm: does it? I'll google
[00:26:11] bootstrappm: I looked in the wiki and it gives two options. One with RSpec, one for Rails 3
[00:26:19] sevenseacat: https://github.com/plataformatec/devise/wiki/How-To:-Test-controllers-with-Rails-3-and-4-%28and-RSpec%29
[00:26:27] arcanez: Ox0dea: given that Lumberjack doesn't sit around waiting for the day to change and rotate, but rather checks on flushes.. I think my issue is I didn't log for a while
[00:26:53] bootstrappm: actually both are w/ RSpec and the one you linked sevenseacat just tells you to simulate signing in
[00:27:07] sevenseacat: bootstrappm: which is exactly what you want to do isnt it?
[00:27:37] Ariadeno: has joined #ruby
[00:27:42] rafaelcout: has joined #ruby
[00:27:42] bootstrappm: well no, that requires signing in in the setup, I want the method Devise uses internally when checking for a valid auth to just return true
[00:27:53] bootstrappm: so I can do as many controller tests as I like
[00:27:56] karapetyan: has joined #ruby
[00:27:57] bootstrappm: and don't have to signin in the setup of each
[00:28:09] sevenseacat: you shouldnt share state between tests
[00:28:23] sevenseacat: you shouldnt be mucking with devise internals either
[00:28:29] sevenseacat: you should use the tools the gem provides
[00:28:42] bootstrappm: but I should be logging in in tests that are not trying to test login?
[00:29:05] bootstrappm: the point is to test the logic of the actions
[00:29:05] sevenseacat: yes, if they require a logged in user to run
[00:29:45] bootstrappm: that sounds more like an integration test to me, not really a functional test of the logic of controller action
[00:29:50] bootstrappm: I'll write that one later
[00:29:58] sevenseacat: all rails tests are integration tests.
[00:30:11] sevenseacat: especially controller tests
[00:30:48] charliesome: has joined #ruby
[00:31:12] sevenseacat: you're welcome to disagree, but it doesnt change the facts :P
[00:31:25] dfockler: Is this a monad in ruby? https://gist.github.com/dfockler/d9e00153ba76736cc79c
[00:31:54] gambl0re: has joined #ruby
[00:32:51] zenspider: yay minitest! what'd I miss?
[00:36:09] bootstrappm: sevenseacat: you can't just take your opinion and call it a fact :P. I'm basing my opinion on the fact that the Rails documentation has separate sections for function controller tests and integration tests (http://guides.rubyonrails.org/testing.html#integration-testing) which describe their purpose very differently. Also on the fact that the wiki for integration testing describes it as tests that are " constructed to test whether all the components within
[00:36:11] bootstrappm: assemblages interact correctly" ... that's not what I'm trying to test at all. The innards of Rails after the request leaves the controller action have been tested, as are the availability of request params in the action. I'm literally just testing the logic on one function where all the other stuff has been tested. Doesn't sound like an integration test to me
[00:36:23] bootstrappm: Even aside from that a model test where you stub out the db isn't an integration test either
[00:36:28] bootstrappm: you're just unit testing a class at that point
[00:36:36] s00pcan: has joined #ruby
[00:36:48] bootstrappm: a method of a class*
[00:36:56] bootstrappm: so saying all rails tests are integration tests is well .... wrong
[00:37:26] sevenseacat: bootstrappm: are you stubbing out the request, response, the model layer, the view layer, and every other type of object that your controller touches?
[00:37:47] sevenseacat: if not, then it's an integration test.
[00:37:59] sevenseacat: because it tests how your controller integrates with all of those things.
[00:38:02] Yzguy: has joined #ruby
[00:38:14] rbennacer: has joined #ruby
[00:38:15] quazimodo: has joined #ruby
[00:38:19] sevenseacat: an error in any one of those things will cause your controller test to fail.
[00:38:27] bootstrappm: cool, I buy that a controller test can be considered an integration test
[00:38:31] bootstrappm: but a model test w/ the db stubbed out?
[00:38:33] sevenseacat: which is exactly what I said
[00:38:50] bootstrappm: pretty sure you said "all rails tests are integrations tests." ....?
[00:38:54] bootstrappm: like, verbatim
[00:39:14] sevenseacat: they are. you're not stubbing out all of activerecord internals when you write unit tests
[00:39:28] sevenseacat: and activerecord touches a loooot of other things
[00:39:39] sevenseacat: not just the db
[00:40:12] bootstrappm: okay, cool. I'll just agree to disagree, thanks
[00:40:15] bootstrappm: anyways zenspider, just figuring out how to stub out some Devise stuff
[00:40:43] bootstrappm: there are some guides but they use rspec or do it a slower way than I'd like
[00:40:49] Oog: has joined #ruby
[00:40:50] bootstrappm: gonna just mess around until I figure it out
[00:40:51] rbennacer: has joined #ruby
[00:43:43] Mives: has joined #ruby
[00:44:46] jonr22: has joined #ruby
[00:44:47] roxtrongo: has joined #ruby
[00:45:07] drbrain: if rails says "we support testing of type X and Y" saying "no, actually they only have Z" it's really hard to communicate when someone only wants to X if you make them say "Z" instead
[00:47:06] sevenseacat: I think that was directed at me
[00:47:19] drbrain: there was a lot of back-and-forth
[00:47:52] zenspider: bootstrappm: why stub it at all?
[00:48:09] zenspider: is it going out to an external service?
[00:48:27] sevenseacat: I mean if you want to stub authenticate_user! then just stub it, thats fine. but don't muck around with devise internals, and don't pretend you're unit testing when you're not
[00:50:15] Mives: has left #ruby: ("WeeChat 1.3")
[00:50:48] sevenseacat: why else would you want to 'stub authenticate_user!' if not to 'simulate signing in' ?
[00:51:07] freerobby: has joined #ruby
[00:51:13] bootstrappm: never said unit testing but how do you say that when you're trying to do the exact same thing pretending everything is an integration test? That sounds like saying "oh well actually the test that you wrote to test that arithmetic function is an integration test because it touches a lot of other things, like Math.add". The whole point of getting tested packaged software is that you're not testing that when you write stuff on top of it
[00:51:18] keen__________17: has joined #ruby
[00:51:19] bootstrappm: but it doesn't matter really, doesn't solve the problem
[00:52:23] zenspider: really seems like you two are talking past each other for the sake of talking past each other
[00:52:47] sevenseacat: well my first response was the docs that explained how to handle authentication in controller tests
[00:52:55] bootstrappm: zenspider: I want to stub it because I don't want to login in my test, basically. I'll test being logged in somewhere else but I just want to test the logic of the action in this test
[00:53:03] xcesariox: has joined #ruby
[00:53:12] sevenseacat: ACTION shrugs
[00:54:15] bootstrappm: so I'd rather just have the auth stuff return true (a stub) so it looks like I'm logged in without having to worry about having a user in the db, the time it takes for it ACTUALLY check, etc. Just trying to get quick digestible tests
[00:54:25] zenspider: bootstrappm: login... for a model's unit test? either you're not communicating something or ... I doubt there's an or
[00:54:37] finisherr: has joined #ruby
[00:54:50] opensource_ninja: has joined #ruby
[00:54:58] bootstrappm: hah no, its a controller action. Simulating a request to soft delete something
[00:55:06] zenspider: and you said the db was stubbed out already...
[00:55:35] bootstrappm: no, that was more of a hypothetical unit test in rails
[00:55:39] tcopeland: has joined #ruby
[00:55:43] bootstrappm: I could stub it out though
[00:55:46] dgutierrez1287: has joined #ruby
[00:55:50] zenspider: bootstrappm: you realize you're being a pain in the ass, right?
[00:55:51] bootstrappm: its on my todo list as those tests take 1.5 each
[00:56:12] bootstrappm: I don't actually :/ sorry zenspider
[00:56:22] zenspider: say what you mean. describe your actual problem at hand. stop obfuscating issues in order to argue
[00:56:38] eam: how do I test rand()
[00:57:04] bootstrappm: I tried! I just said agree to disagree and then was told disagreeing doesn't change the facts >:|
[00:57:06] bootstrappm: but okay, got it
[00:57:07] zenspider: what's wrong with: <blah>.current_user = user1 ? no stubbing. no nothing. (for some value of <blah>... wherever you hang that)
[00:57:37] bootstrappm: hm, let me try
[00:57:58] drbrain: eam: I would override it with a method that records the arguments and returns 4
[00:58:04] drbrain: then verify the arguments separately
[00:58:06] chouhoulis: has joined #ruby
[00:58:17] eam: it's as good of a random number as any other I suppose
[00:58:34] drbrain: since it is Kernel#rand you can often override it directly on the instance you're testing
[00:58:36] zenspider: 4?!? no way! 42!!
[00:58:51] drbrain: def subject.rand(*a) ??? record arguments ???; 4; end
[00:58:59] eam: I need an integration test though, how do I know the results are really random
[00:59:02] zenspider: the alternative answer is: don't test rand
[00:59:11] drbrain: eam: hire a cryptologist
[00:59:16] zenspider: srand w/ a static seed and use rand normally
[00:59:30] zenspider: your job is not to test ruby
[00:59:41] sevenseacat: rubyhas its own tests
[01:00:04] eam: for rand? (and you realize it's a jackass question of course)
[01:00:15] vipaca: has joined #ruby
[01:00:23] drbrain: eam: (I did)
[01:00:26] dopamean_: has joined #ruby
[01:00:40] eam: sho' 'nuff test_securerandom.rb
[01:00:41] mary5030: has joined #ruby
[01:01:27] iateadonut: has joined #ruby
[01:02:44] tejasmanohar: has joined #ruby
[01:02:46] zenspider: eam: you know sarcasm doesn't convey over plain text, right?
[01:03:00] eam: zenspider: no, it never does. It can't, even. Impossible.
[01:03:06] CloCkWeRX: has joined #ruby
[01:03:48] Rollabunna: has joined #ruby
[01:03:51] eam: http://www.ling.upenn.edu/~beatrice/humor/double-positive.html
[01:06:36] vdamewood: has joined #ruby
[01:06:49] CloCkWeRX: has left #ruby: ()
[01:08:25] havenwood: has joined #ruby
[01:08:53] finisherr: has left #ruby: ()
[01:09:35] finisherr: has joined #ruby
[01:11:09] stardiviner: has joined #ruby
[01:11:44] nettoweb: has joined #ruby
[01:13:14] dfockler: has joined #ruby
[01:15:09] blt: has joined #ruby
[01:16:24] swgillespie: has joined #ruby
[01:16:47] choke: has joined #ruby
[01:16:53] Akagi201_: has joined #ruby
[01:18:01] RudestBuddhist: has joined #ruby
[01:19:50] RudestBuddhist: Hey guys, I???m making my first jump into playing with JSON files. I???ve got a file that I want to find the difference between two timestamps but when I try to manipulate the keys I get a ???no implicit conversion of String into Integer (TypeError)???. I???ve tried converting and cleaning up the file but no avail. Can someone point me in the right direction for a tutorial or something for manipulating JSON in ruby?
[01:19:55] jeadre: has joined #ruby
[01:20:17] toertore: has joined #ruby
[01:21:00] dfockler: RudestBuddhist: Make sure you aren't trying to access an array as a hash
[01:21:07] RegulationD: has joined #ruby
[01:21:11] ruboto: havenwood # => no implicit conversion of String into Integer (TypeError) ...check link for more (https://eval.in/431472)
[01:22:07] RudestBuddhist: dfockler: I thought array???s were hashes in ruby?
[01:22:13] RudestBuddhist: dfockler: It???s similar to a dictionary?
[01:22:14] r_baron: has joined #ruby
[01:22:15] havenwood: RudestBuddhist: Check: JSON.parse(your_json).class
[01:22:42] devoldmx: has joined #ruby
[01:23:02] mary5030: has joined #ruby
[01:23:12] havenwood: RudestBuddhist: http://ruby-doc.org/core/Array.html
[01:23:15] havenwood: RudestBuddhist: http://ruby-doc.org/core/Hash.html
[01:23:19] RudestBuddhist: havenwood: I???m going json = File.read(???scans.json???); json_hash = JSON.parse(json)
[01:24:03] RudestBuddhist: so am I accidently parsing that json_hash into a array?
[01:24:14] kshah: has joined #ruby
[01:24:19] RudestBuddhist: it would appear so???
[01:25:01] j4cknewt: has joined #ruby
[01:25:05] havenwood: RudestBuddhist: Show us the Array? Are you wanting a Hash? Key/value pairs?
[01:25:06] kshah: I???m running into a bizarre problem using ActiveRecord (not Rails) where my very simple loop-over-an-array-of-hashes script is causing dozens of threads to appear
[01:25:08] kshah: https://gist.github.com/whistlerbrk/a8766e0199333aed1075
[01:25:20] kshah: any help appreciated, I can???t tell what the cause is
[01:25:29] RudestBuddhist: havenwood: key/value pairs would be ideal
[01:25:49] mary5030: has joined #ruby
[01:26:03] RudestBuddhist: havenwood: I thought that???s how I could access it but for some reason if I call json_hash[1] for example, I get the entire thing back, instead of just one key which I would expect
[01:26:18] howdoicomputer: has joined #ruby
[01:26:45] havenwood: RudestBuddhist: Show us the return value and someone can explain it to you.
[01:27:14] RudestBuddhist: sure one sec, I???ll create a gist
[01:27:34] yfeldblum: has joined #ruby
[01:27:45] RudestBuddhist: https://gist.github.com/DanPatey/d74cbc4255edb4ebca9c
[01:28:22] RudestBuddhist: so I have a ton of those responses from a JSON I???ve grabbed. I???d like key value pairs for each so I could compare all of the start times, and all of the end times
[01:28:25] havenwood: kshah: Even if it's not a Rails app the #RubyOnRails channel is the most familiar with ActiveRecord. You might ask there as well, just mention you're cross-posting.
[01:29:07] kshah: havenwood: I already have, no responses. I don???t think they can help anyway
[01:29:52] havenwood: kshah: It looks like "The default ConnectionPool maximum size is 5."
[01:30:25] havenwood: kshah: You're creating a connection pool for each product.
[01:30:37] havenwood: kshah: 5 * x
[01:32:43] kshah: havenwood: ???with_connection??? just checks a connection out of the pool and yields it to a block
[01:32:53] tkuchiki: has joined #ruby
[01:33:23] havenwood: kshah: You're not just calling #with_connection on an existing pool.
[01:33:24] mkosaki: has joined #ruby
[01:34:56] sankaber: has joined #ruby
[01:35:06] kshah: havenwood: and ActiveRecord::Base.connection_pool according to L108 of connection_handling.rb just retrieves the connection pool itself
[01:35:33] havenwood: kshah: I was wondering if it did after saying that. I know Ruby but not Rails.
[01:35:34] r_baron: has joined #ruby
[01:35:45] RudestBuddhist: havenwood: looks like symbolize names is what I want
[01:36:03] havenwood: kshah: I'm actually I've just started learning Rails in earnest.
[01:36:16] havenwood: And I waffle on how to say things and then say them badly.
[01:36:52] kshah: my recent experiences with Rails after being a very solid user (since 1.2.0) have been.. abysmal to say the least
[01:37:10] kshah: things which were once straightforward to script up are now overly complicated and slow
[01:37:29] kshah: Sequel looks to be a fine alternative as an ORM
[01:37:37] havenwood: kshah: I really have been enjoying Roda lately. It's by the maintainer of Sequel.
[01:37:56] havenwood: kshah: http://roda.jeremyevans.net
[01:38:03] havenwood: kshah: I'd highly recommend.
[01:38:06] kshah: havenwood: looks good!
[01:38:32] sevenseacat: Rails is awesome.
[01:38:41] havenwood: sevenseacat: I've been enjoying it so far.
[01:39:04] havenwood: sevenseacat: Bought my copy of R4IA! Need to start going through that.
[01:39:19] sevenseacat: yaaaaaay I was going to ask if you were reading it, but didn't want to be all plug plug plug
[01:39:28] shmilan: has joined #ruby
[01:39:33] sevenseacat: I feel a bit awkward self-promoting it lol
[01:39:43] NightMonkey: has joined #ruby
[01:39:51] havenwood: I've fell asleep last night on like the fourth page. Been so busy lately!
[01:40:02] linuxboytoo: has joined #ruby
[01:40:09] sevenseacat: can understand that
[01:40:13] havenwood: Again with the changing sentence mid-sentence. I need to put a mutex around it.
[01:41:19] RudestBuddhist: havenwood: figured it out! thanks for the help!
[01:41:29] RudestBuddhist: havenwood: this rules :)
[01:42:29] havenwood: RudestBuddhist: Nice.
[01:44:35] khebbie: has joined #ruby
[01:48:13] David27: has joined #ruby
[01:48:28] rbowlby: has joined #ruby
[01:49:45] JamesDH: has joined #ruby
[01:49:56] Brando753: has joined #ruby
[01:51:29] centrx: has joined #ruby
[01:52:24] kshah: has joined #ruby
[01:52:59] kshah: and boom my computer crashed from running that script??? good lord??? adding 900 rows a database was never so hard
[01:53:46] sevenseacat: what did you put in that script o.O
[01:54:01] sevenseacat: I generally use sequel whenever I want to do big database migrations
[01:54:18] sevenseacat: well, 'big' meaning ~100,000 rows
[01:55:22] kshah: sevenseacat: https://gist.github.com/whistlerbrk/a8766e0199333aed1075/ the hash is a bit more complicated, but it???s data from Redis, so I had to paraphrase code so to speak
[01:55:43] kshah: sevenseacat: and I also tried not using the connection pool block as well, same problem
[01:56:00] sevenseacat: kshah: is that opening a new connection for every product? >_>
[01:56:21] juanpablo_: has joined #ruby
[01:56:53] kshah: sevenseacat: that is what rhizome implied however the documentation does not state this at all, with_connection should only be checking a connection out of the pool
[01:57:07] kshah: sevenseacat: regardless, when I don???t use the connection pool I have literally the same exact problem
[01:57:08] sevenseacat: why not just use one single connection
[01:57:18] sevenseacat: open it, use it, close it at the end
[01:57:38] kshah: sevenseacat: at the start of the loop establish, at the end disconnect?
[01:58:23] kshah: sevenseacat: Ill give that a go, I???ve done that before, not for a week though so I???ll try it again
[01:59:25] theery: has joined #ruby
[02:00:57] crankharder: has joined #ruby
[02:02:24] kshah: sevenseacat: when I did that last time the startup time between the conection/disconnection was immense
[02:02:55] sevenseacat: what startup time? of loading activerecord before the connection?
[02:02:59] bender_unit: has joined #ruby
[02:03:04] kshah: sevenseacat: establishing the connection
[02:03:30] sevenseacat: i dont see how it would make a difference, whether you establish it inside the loop or outside
[02:03:30] xylotism: has joined #ruby
[02:03:39] Oog: has joined #ruby
[02:04:03] kshah: sevenseacat: we???re talking about reusing a connection or establishing it for every iteration of the loop and then closing it at the end of the loop though
[02:04:07] bmurt: has joined #ruby
[02:04:10] cajone: has joined #ruby
[02:04:39] tenderlove: has joined #ruby
[02:04:51] sevenseacat: now I'm very confused as to what you're doing - I'm telling you to do the former
[02:05:06] sevenseacat: use one connection for the entire import script
[02:05:17] A124: has joined #ruby
[02:05:36] sevenseacat: which should definitely be faster than establishing it n times
[02:05:42] kshah: sevenseacat: that???s what I???ve been doing....
[02:05:56] xylotism: Hi guys... I have a potentially complex question -- how does a GUI library like Shoes, Visualruby, FXRuby hold up vs. coding in another language, like Java or Python?
[02:06:02] sevenseacat: doesn't look that way to me
[02:06:26] kshah: sevenseacat: I???m not using the with_connection block anymore, I got rid of that
[02:06:30] pontiki: has joined #ruby
[02:06:37] sevenseacat: so what code do you have now?
[02:07:21] xylotism: Context: I've so far been using Ruby very effectively as a scripting tool, but I recently wanted to add more user interaction than just command line input, without developing a full web app. Something I can package and deliver to Windows/potentially Mac clients.
[02:07:23] kshah: sevenseacat: well, I tried the same exact code w/those two lines (the with_connection and it???s end) commented out
[02:07:31] kshah: sevenseacat: that didn???t work, went out of control again
[02:07:32] kshah: sevenseacat:
[02:08:04] rafaelcout: has joined #ruby
[02:08:13] kshah: sevenseacat: so now I???m running it with establish_connection and connection.disconnect! at the top and ends of the loop respectively (inside it of course)
[02:09:29] kshah: sevenseacat: yes, I???m aware it???s ridiculous to be establishing and disconnecting an AR connection for every single iteration of the loop
[02:09:39] kshah: sevenseacat: it???s also the *ONLY* way this script is able to run somehow
[02:10:07] RudestBuddhist: hey guys I have a two strings "22:49:02.871" and ???22:57:02.913???. I???d like to find the difference between those two times but .to_f and .to_i are not giving me the correct numbers. What could I convert them to so I can manipulate them with the ruby math library?
[02:10:08] Unopoo: has left #ruby: ("Leaving(what's the difference between this and quitting?)")
[02:10:46] sevenseacat: they look like times, not integers or floats
[02:10:54] chills42: has joined #ruby
[02:11:15] AndChat|159600: has joined #ruby
[02:11:17] RudestBuddhist: they are times, but it didn???t look like Date would get me what I want
[02:11:34] RudestBuddhist: actually it looks like the Time gem might be what I want...
[02:11:37] sevenseacat: no, but Time might
[02:11:40] kshah: RudestBuddhist: Time.parse
[02:12:10] RudestBuddhist: awesome, thanks for helping the newbie :)
[02:12:31] sevenseacat: RudestBuddhist: we're not all guys here also, just so you know :)
[02:13:41] sevenseacat: ACTION tries to not be passive-aggressive about it
[02:14:43] gambl0re: has joined #ruby
[02:15:27] samukasmk: has joined #ruby
[02:15:54] RudestBuddhist: ACTION appreciates it
[02:18:38] arescorpio: has joined #ruby
[02:18:43] jackjackdripper: has joined #ruby
[02:19:06] mary5030: has joined #ruby
[02:19:22] Swappticon: has joined #ruby
[02:19:47] mary5030: has joined #ruby
[02:20:06] EasyCo: has joined #ruby
[02:21:10] hfp: has joined #ruby
[02:21:40] hfp_work: has joined #ruby
[02:23:10] choke: has joined #ruby
[02:25:38] freerobby: has joined #ruby
[02:26:18] freerobby1: has joined #ruby
[02:26:33] bootstrappm: figured it out! https://gist.github.com/frankpinto/5c7d56128d54741dfce4
[02:26:42] bootstrappm: thanks for the suggestion to look up the test helpers
[02:26:48] bootstrappm: part of it was actually in the wiki, was just searching wrong
[02:27:00] bootstrappm: (dance) thanks y'all
[02:28:50] j4cknewt: has joined #ruby
[02:28:58] mordocai: has joined #ruby
[02:32:09] freerobby: has joined #ruby
[02:32:52] jonr22: has joined #ruby
[02:33:06] Xiti: has joined #ruby
[02:36:16] djbkd: has joined #ruby
[02:36:17] Yzguy: has joined #ruby
[02:38:18] bootstrappm: timing comparison for that is 8.07s for test suite w/ sign_in, 4.75s w/ stubbing
[02:40:34] arup_r: has joined #ruby
[02:42:28] fostertheweb: has joined #ruby
[02:42:38] iamvery: has joined #ruby
[02:43:04] kjones_: has joined #ruby
[02:43:26] davedev24: has joined #ruby
[02:45:06] dopie: has joined #ruby
[02:45:56] khebbie: has joined #ruby
[02:46:18] bootstrappm: has left #ruby: ()
[02:47:10] ramfjord: has joined #ruby
[02:48:13] kshah: has left #ruby: ()
[02:49:22] dopieee: has joined #ruby
[02:52:21] pawnbox: has joined #ruby
[02:52:37] howdoicomputer: has joined #ruby
[02:54:51] karapetyan: has joined #ruby
[02:55:10] Oog: has joined #ruby
[02:57:20] baweaver: has joined #ruby
[02:58:25] kjones_: has joined #ruby
[02:59:41] shmilan: has joined #ruby
[03:01:54] gener1c_: has joined #ruby
[03:02:43] freerobby: has joined #ruby
[03:03:16] devbug: has joined #ruby
[03:03:18] freerobby1: has joined #ruby
[03:04:43] Rollabunna: has joined #ruby
[03:04:52] j4cknewt: has joined #ruby
[03:06:17] freerobby: has joined #ruby
[03:06:38] Musashi007: has joined #ruby
[03:09:30] ruby-lang811: has joined #ruby
[03:13:05] jas02: has joined #ruby
[03:14:56] braincrash: has joined #ruby
[03:15:46] arooni: has joined #ruby
[03:21:17] Oog: has joined #ruby
[03:21:18] voltalio: has joined #ruby
[03:21:59] psy: has joined #ruby
[03:22:45] davedev24: has joined #ruby
[03:23:00] RegulationD: has joined #ruby
[03:23:02] Oog: has joined #ruby
[03:23:27] devoldmx: has joined #ruby
[03:25:59] cajone: has left #ruby: ()
[03:26:15] Oog: has joined #ruby
[03:27:40] arooni-mobile: has joined #ruby
[03:27:46] fostertheweb: has joined #ruby
[03:28:10] arooni-mobile: has joined #ruby
[03:28:32] roxtrongo: has joined #ruby
[03:29:35] poguez_: has joined #ruby
[03:29:43] cajone: has joined #ruby
[03:30:34] casadei_: has joined #ruby
[03:31:12] autrilla: has joined #ruby
[03:31:15] Pharaoh2: has joined #ruby
[03:31:22] crdpink2: has joined #ruby
[03:34:01] Oog: has joined #ruby
[03:35:04] linc01n: has joined #ruby
[03:35:53] sfr^: has joined #ruby
[03:36:33] segmond: has joined #ruby
[03:37:00] universa1: has joined #ruby
[03:37:29] theery: has joined #ruby
[03:37:54] bootstrappm: has joined #ruby
[03:40:01] lokulin: has joined #ruby
[03:41:32] ledestin: has joined #ruby
[03:45:05] juanpablo_: has joined #ruby
[03:46:26] danpatey: has joined #ruby
[03:46:58] j4cknewt: has joined #ruby
[03:48:11] astrobunny: has joined #ruby
[03:48:47] gix: has joined #ruby
[03:49:13] Yzguy: why wouldn't I be able to access the db object?: http://pastebin.com/xUWauPXN
[03:49:13] ruboto: Yzguy, as I told you already, please use https://gist.github.com
[03:49:24] rickmasta: has joined #ruby
[03:49:47] Yzguy: https://gist.github.com/yzguy/f0b8b68a9203357e6dbd
[03:50:05] Yzguy: I get: NameError - undefined local variable or method `db' for #<Sinatra::Application:0x007f95f505dab0>:
[03:51:31] dgs_: has joined #ruby
[03:53:26] JamesDH: has joined #ruby
[03:54:41] bmn: has joined #ruby
[03:58:03] bootstrappm: has joined #ruby
[03:58:04] TDJACR: has joined #ruby
[03:59:44] ebbflowgo: has joined #ruby
[04:00:20] bootstrappm: has joined #ruby
[04:00:44] Azure|dc: has joined #ruby
[04:01:29] bootstrappm: Yzguy I got disconnected there for a bit, did you get an answer to that?
[04:02:46] havenwood: has joined #ruby
[04:03:15] monoprotic: no one replied
[04:04:24] bootstrappm: cool, looks like they left anyway
[04:05:57] jackjackdripper: has joined #ruby
[04:07:12] astrobunny: has joined #ruby
[04:08:53] rakm: has joined #ruby
[04:09:26] elton: has joined #ruby
[04:10:31] morenoh149: has joined #ruby
[04:10:47] shock_one: has joined #ruby
[04:14:32] Ropeney: has joined #ruby
[04:14:40] krz: has joined #ruby
[04:15:50] Guest5: has joined #ruby
[04:20:22] davedev24: has joined #ruby
[04:20:43] sevenseacat: has joined #ruby
[04:22:44] Musashi007: has joined #ruby
[04:24:16] Fraeon: has joined #ruby
[04:24:54] anisha: has joined #ruby
[04:31:05] Rubie: has joined #ruby
[04:35:50] darkf: has joined #ruby
[04:36:47] ht__: has joined #ruby
[04:38:04] xcesariox: has joined #ruby
[04:38:38] Stalkr_: has joined #ruby
[04:39:04] Stalkr^: has joined #ruby
[04:39:06] arescorpio: has joined #ruby
[04:39:17] mary5030: has joined #ruby
[04:42:10] Swappticon: has joined #ruby
[04:42:41] casadei_: has joined #ruby
[04:45:48] Gnomethrower: has joined #ruby
[04:45:51] Gnomethrower: has joined #ruby
[04:47:34] craysiii: has joined #ruby
[04:47:43] khebbie: has joined #ruby
[04:49:23] rehat_: has joined #ruby
[04:52:13] jgt: has joined #ruby
[04:52:38] Jerro: has joined #ruby
[04:53:52] bronson: has joined #ruby
[04:55:04] mozzarella: has joined #ruby
[04:58:05] astrobunny: has joined #ruby
[05:03:25] bricker: has joined #ruby
[05:05:35] Rollabunna: has joined #ruby
[05:07:22] rubie_: has joined #ruby
[05:11:29] fella5s: has joined #ruby
[05:11:38] dhjondoh: has joined #ruby
[05:14:51] pawnbox: has joined #ruby
[05:17:35] ruby-lang751: has joined #ruby
[05:17:45] ruby154: has joined #ruby
[05:17:53] oldbay: has joined #ruby
[05:21:29] tkuchiki: has joined #ruby
[05:21:56] karapetyan: has joined #ruby
[05:21:57] bootstrappm: has joined #ruby
[05:23:31] postmodern: has joined #ruby
[05:23:38] tkuchiki: has joined #ruby
[05:24:14] devoldmx: has joined #ruby
[05:24:30] RegulationD: has joined #ruby
[05:24:39] riotjones: has joined #ruby
[05:27:44] Rubie: has joined #ruby
[05:28:51] khebbie: has joined #ruby
[05:30:37] mozzarella: has joined #ruby
[05:31:02] pawnbox: has joined #ruby
[05:32:49] [k-: has joined #ruby
[05:33:35] aganov: has joined #ruby
[05:33:49] swgillespie: has joined #ruby
[05:33:53] juanpablo_: has joined #ruby
[05:35:22] leat2: has joined #ruby
[05:41:19] codenapper: has joined #ruby
[05:42:21] codenapper: has joined #ruby
[05:42:34] senayar: has joined #ruby
[05:42:53] claw: has joined #ruby
[05:44:31] Mia: has joined #ruby
[05:44:31] Mia: has joined #ruby
[05:45:09] arup_r: has joined #ruby
[05:45:30] tagrudev: has joined #ruby
[05:47:24] pawnbox: has joined #ruby
[05:48:00] Musashi007: has joined #ruby
[05:50:27] ruurd: has joined #ruby
[05:53:06] naftilos76: has joined #ruby
[05:54:12] dgs: has joined #ruby
[05:54:46] fedexo: has joined #ruby
[05:57:55] andikr: has joined #ruby
[05:59:13] jonr22: has joined #ruby
[06:01:57] acke: has joined #ruby
[06:02:21] segmond: has joined #ruby
[06:03:25] riotjones: has joined #ruby
[06:03:54] sevenseacat: has joined #ruby
[06:04:18] bender_unit: has joined #ruby
[06:05:25] jas02: has joined #ruby
[06:06:43] armyriad: has joined #ruby
[06:06:58] dhjondoh: has joined #ruby
[06:08:36] ayonkhan: has joined #ruby
[06:09:27] ilken: has joined #ruby
[06:11:13] ilken: has joined #ruby
[06:12:52] swgillespie: has joined #ruby
[06:13:04] shock_one: has joined #ruby
[06:13:56] ICantCook: has joined #ruby
[06:14:57] mary5030: has joined #ruby
[06:15:04] baweaver: it's /join python
[06:15:19] baweaver: ICantCook: ^
[06:15:47] Axy: has joined #ruby
[06:15:47] Axy: has joined #ruby
[06:15:51] claw: has joined #ruby
[06:17:09] fostertheweb: has joined #ruby
[06:17:28] nofxx: has joined #ruby
[06:18:48] ICantCook: baweaver: Sorry, hexchat got me. I did "/join #ruby" while in another channel, and then started typing "/j #python". It ended up putting the '/' in the text field of the previous channel before Hexchat responded and moved me to this window, which got the 'join #python"
[06:19:06] baweaver: heh, not a problem.
[06:19:46] jonr22: has joined #ruby
[06:21:44] pawnbox_: has joined #ruby
[06:22:09] last_staff: has joined #ruby
[06:22:21] tvw: has joined #ruby
[06:24:18] timonv: has joined #ruby
[06:24:28] solars: has joined #ruby
[06:25:00] Macaveli: has joined #ruby
[06:27:45] bootstrappm: has joined #ruby
[06:28:24] leat2: has joined #ruby
[06:28:40] krz: has joined #ruby
[06:30:05] bootstrappm: has joined #ruby
[06:30:11] tenderlove: has joined #ruby
[06:30:22] MichaelSmith: has joined #ruby
[06:33:09] shock_one: has joined #ruby
[06:33:45] pontiki: has joined #ruby
[06:33:51] lxsameer: has joined #ruby
[06:34:04] firstdayonthejob: has joined #ruby
[06:36:56] skade: has joined #ruby
[06:38:36] leat2: has joined #ruby
[06:39:53] karapetyan: has joined #ruby
[06:42:00] jenrzzz: has joined #ruby
[06:42:12] nhhagen: has joined #ruby
[06:42:33] jenrzzz: has joined #ruby
[06:43:02] bayed: has joined #ruby
[06:44:23] charliesome: has joined #ruby
[06:44:59] [1]kk: has joined #ruby
[06:45:44] DoubleMalt: has joined #ruby
[06:45:57] howdoi: has joined #ruby
[06:46:30] karapetyan: has joined #ruby
[06:46:35] alphaatom: has joined #ruby
[06:47:40] xcesariox: has joined #ruby
[06:50:42] RudestBuddhist: has joined #ruby
[06:52:11] beast: has joined #ruby
[06:52:44] RudestBuddhist: Hey Everybody, I???m trying to nest some conditionals inside of a while loop. I believe I can use a while but using do ??? end while <some condition> correct? For some reason I can???t reach my end code. Not sure if it???s the while that is causing me issues or my if conditions. Could someone point me in the right direction?
[06:53:02] RudestBuddhist: here???s my source: https://gist.github.com/DanPatey/8242c5b971429a37cab2
[06:53:45] flughafen: RudestBuddhist: perhaps the conditionals are not in the loop, but inside you. have you tried cultivating them?
[06:54:10] baweaver: enough of that
[06:54:18] sevenseacat: RudestBuddhist: learn about methods like min, max, etc.
[06:54:45] RudestBuddhist: I see, so I can just call the methods inside the while loop
[06:54:47] baweaver: http://ruby-doc.org/core-2.2.3/Enumerable.html#method-i-minmax
[06:54:56] baweaver: you won't need a while loop
[06:54:59] shock_one: has joined #ruby
[06:55:07] bronson: has joined #ruby
[06:55:10] sevenseacat: theres indeed no need for while loop
[06:55:18] stanc: has joined #ruby
[06:55:20] sevenseacat: look into things like each as well
[06:55:21] RudestBuddhist: ah, I can just use those to get to the same result
[06:56:20] skullcrasher: has joined #ruby
[06:56:28] baweaver: have a sample of the json?
[06:57:08] RudestBuddhist: baweaver: here???s a snippet of the JSON: https://gist.github.com/DanPatey/273566c6e44f9579b613
[06:58:02] baweaver: going through this, first you don't need rubygems required
[06:58:11] baweaver: unless you're using 1.8.x for some odd reason
[06:58:15] baweaver: you shouldn't
[06:59:14] ruurd: has joined #ruby
[06:59:22] xcesariox: has joined #ruby
[06:59:39] Balzrael: has joined #ruby
[06:59:50] RudestBuddhist: I???m using 2.0something
[07:01:07] RudestBuddhist: I???m not using pp anymore, so I???ve removed that
[07:01:39] jmarrec: has joined #ruby
[07:02:26] karapetyan: has joined #ruby
[07:03:51] Spami: has joined #ruby
[07:04:17] greenarrow: has joined #ruby
[07:05:38] n008f4g_: has joined #ruby
[07:06:29] Rollabunna: has joined #ruby
[07:07:18] baweaver: https://gist.github.com/DanPatey/8242c5b971429a37cab2#gistcomment-1571176
[07:07:43] baweaver: though really you only need current time
[07:07:50] baweaver: cleaning that up a bit more
[07:07:59] dhjondoh: has joined #ruby
[07:09:46] baweaver: there we go
[07:10:25] RudestBuddhist: I have some stupid questions :)
[07:10:36] baweaver: you should really use Spark for this
[07:10:43] RudestBuddhist: er, crap I can???t see that old change
[07:11:09] RudestBuddhist: I was looking at mongo or kafka
[07:11:23] RudestBuddhist: because I think this JSON file may grow
[07:11:36] RudestBuddhist: but stupid question #1 in that first iteration you set @variable = variable in accessor
[07:11:38] baweaver: Kafka streams data
[07:11:50] baweaver: Mongo is a DB
[07:11:59] baweaver: Spark is used to rip that data
[07:12:21] RudestBuddhist: spark uses workers to split the data up?
[07:12:42] baweaver: http://baweaver.com/blog/2015/06/21/intro-to-spark/
[07:12:49] baweaver: pay close attention to that JSON section
[07:13:09] baweaver: Ruby will not play nicely with 100M+ log files like you're wanting.
[07:13:45] baweaver: You'd probably want something to rip the logs into a database as a stream whenever they come in
[07:13:54] baweaver: or act as a batch processing engine whenever new ones show up
[07:14:09] baweaver: I like Ruby, but definitely not a use case for it.
[07:14:35] RudestBuddhist: gotcha, I???m kind of using this project as an excuse to learn ruby
[07:14:42] RudestBuddhist: but maybe not the best use case for the project itself
[07:15:30] baweaver: look into log parsing and searching
[07:15:51] baweaver: it's a broad field, and at the level of data you have, not a very friendly niche for ruby
[07:16:49] RudestBuddhist: cool, thanks for all the help
[07:17:19] khebbie: has joined #ruby
[07:18:20] zlogan: has joined #ruby
[07:18:49] Oog: has joined #ruby
[07:19:04] leat2: has joined #ruby
[07:22:03] nhhagen: has joined #ruby
[07:22:37] juanpablo_: has joined #ruby
[07:24:59] devoldmx: has joined #ruby
[07:25:52] shevy: beaver blogs - progress of dam building ever since
[07:26:00] RegulationD: has joined #ruby
[07:26:02] mike___1234: has joined #ruby
[07:26:19] tenderlove: has joined #ruby
[07:27:31] tkuchiki: has joined #ruby
[07:27:46] lsmola: has joined #ruby
[07:29:19] niemcu: has joined #ruby
[07:31:30] karapetyan: has joined #ruby
[07:32:58] SCHAAP137: has joined #ruby
[07:34:42] felixr: has joined #ruby
[07:34:44] FalseDeal: has joined #ruby
[07:35:19] felixrsmith: has joined #ruby
[07:38:20] swgillespie: has joined #ruby
[07:40:49] beast: mmm...it's tasty...oh it must be Ruby
[07:41:58] howdoicomputer: has joined #ruby
[07:42:02] charliesome: has joined #ruby
[07:42:16] terlar: has joined #ruby
[07:43:28] rdark: has joined #ruby
[07:45:46] Hounddog: has joined #ruby
[07:47:34] xnr: has joined #ruby
[07:47:52] senayar: has joined #ruby
[07:49:14] lsmola: has joined #ruby
[07:51:10] Hounddog: has joined #ruby
[07:52:03] ramfjord: has joined #ruby
[07:54:34] Spami: has joined #ruby
[07:55:42] felixrsmith: has joined #ruby
[07:57:47] HayesHimself: has joined #ruby
[07:58:54] dhjondoh: has joined #ruby
[07:59:03] fostertheweb: has joined #ruby
[08:00:40] GeissT: has joined #ruby
[08:01:17] pawnbox: has joined #ruby
[08:01:35] tenderlove: has joined #ruby
[08:03:15] mikecmpbll: has joined #ruby
[08:03:50] Ropeney: has joined #ruby
[08:05:12] futilegames: has joined #ruby
[08:05:45] bronson: has joined #ruby
[08:05:58] tenderlove: has joined #ruby
[08:06:05] dionysus69: has joined #ruby
[08:09:28] felixrsmith: has joined #ruby
[08:10:31] charliesome: has joined #ruby
[08:12:00] ndrei: has joined #ruby
[08:14:32] JohnBat26: has joined #ruby
[08:15:06] tenderlove: has joined #ruby
[08:18:52] Zai00: has joined #ruby
[08:18:55] k3asd`: has joined #ruby
[08:20:05] shevy: if we have: def foo(*i)
[08:20:18] shevy: inside of that method, will i be always an Array?
[08:20:22] nhhagen: has joined #ruby
[08:20:45] Kjarva: has joined #ruby
[08:22:10] [k-: >> def foo *i; i.class end; [foo, foo(1), foo(1,2,3)]
[08:22:11] ruboto: [k- # => [Array, Array, Array] (https://eval.in/431592)
[08:22:14] zenspider: shevy: i will always be an array at the start of the method...
[08:22:20] zenspider: not necessarily by the end of it
[08:26:47] garethrees: has joined #ruby
[08:26:54] UtkarshRay: has joined #ruby
[08:27:18] C1V0: has joined #ruby
[08:29:02] ndrei: has joined #ruby
[08:31:18] davidhq: has joined #ruby
[08:32:19] davidhq: has joined #ruby
[08:34:30] pontiki: has joined #ruby
[08:34:57] michael_mbp: has joined #ruby
[08:35:58] jgt: has joined #ruby
[08:36:26] skade: has joined #ruby
[08:36:40] khebbie: has joined #ruby
[08:38:18] chthon: has joined #ruby
[08:41:43] CustosL1men: has joined #ruby
[08:43:31] c0m0: has joined #ruby
[08:46:13] bazbing80: has joined #ruby
[08:46:56] jonr22: has joined #ruby
[08:47:47] PINGwin4IK: has joined #ruby
[08:48:38] dmolina: has joined #ruby
[08:49:13] bazbing80: hey all. If a create a class that has a | attr_reader :name | I can both read and write name to an instance of the class. same with attr_writer. I can both read and write an attribute created with attr_writer. So what's the point of attr_accessor if both attr_reader and attr_writer can both individually read and write? I mean maybe I'm wrong, this is just based in irb experimentation
[08:49:18] nhhagen: has joined #ruby
[08:49:37] r0uder: has joined #ruby
[08:50:42] fidalgo: has joined #ruby
[08:50:48] bazbing80: yeah I think I was mistaken, scratch that :P
[08:51:15] r0uder: has joined #ruby
[08:51:40] bazbing80: 2.2.1 :029?> attr_reader :number
[08:51:40] bazbing80: 2.2.1 :030?> end
[08:53:29] bazbing80: okay, how can the number attribute be set if it can only be read? Is an internal method the only way? if I do | g = Gary.new | what are all the possible ways I can make g.number equal something other than nil?
[08:53:38] nhhagen: has joined #ruby
[08:53:52] felixrsmith: has joined #ruby
[08:54:31] wpp: has joined #ruby
[08:56:02] marr: has joined #ruby
[08:57:42] leafybasil: has joined #ruby
[08:58:34] [k-: i count 3
[08:58:39] jhass: bazbing80: if you truly never defined a writer and also didn't define an initializer that takes an argument and sets it to that: instance_variable_set(:@number, x), but that way is a hack and not what the author of the class intended
[08:58:56] jas02: has joined #ruby
[08:59:00] [k-: there is also instance_eval
[08:59:16] [k-: and def instance.number
[08:59:57] cisco: has joined #ruby
[09:00:18] jhass: all hacks though
[09:00:44] [k-: and reopening the class explicitly
[09:01:31] jgt: has joined #ruby
[09:01:47] cisco: has joined #ruby
[09:02:18] cisco: has joined #ruby
[09:03:38] bazbing80: jhass so attr_reader's only purpose is to expose the result of a class' method of the same name?
[09:03:45] dgs: has joined #ruby
[09:03:52] jas02: has joined #ruby
[09:04:07] dhjondoh: has joined #ruby
[09:04:14] yfeldblum: has joined #ruby
[09:04:28] jhass: attr_reader :foo is a shortcut to defining the method def foo; @foo; end;
[09:04:34] jhass: @foo is called an instance variable
[09:05:09] bazbing80: jhass: ahh, now that is interesting. thanks
[09:05:57] nhhagen: has joined #ruby
[09:06:49] astrobunny: has joined #ruby
[09:07:19] Rollabunna: has joined #ruby
[09:07:28] [k-: it is also optimised by the interpreter and a common ruby idiom
[09:08:03] voker57: has joined #ruby
[09:08:27] bazbing80: [k-: it's more efficient than writing def foo; @foo; end ?
[09:09:14] tenderlove: has joined #ruby
[09:09:17] suchness: has joined #ruby
[09:09:32] emilkarl: has joined #ruby
[09:09:40] tvw: has joined #ruby
[09:09:46] jhass: probably slightly, but your motivation for using it should be having to write less code ;)
[09:11:20] juanpablo_: has joined #ruby
[09:11:35] bazbing80: jhass: indeed. a balance between readability and less code anyway :P I didn't know attr_reader returned the result of an instance var i.e. the result of the attribute can be set anyway within the class (and maybe more places in hacky code)
[09:12:24] [k-: yes, it is more efficient \o/
[09:12:40] nhhagen: has joined #ruby
[09:12:44] [k-: it's so common that it is definitely optimised for performance
[09:14:19] Igorshp: has joined #ruby
[09:14:36] ruurd: has joined #ruby
[09:15:09] atmosx: I have to write another 10 pages
[09:15:10] sevenseacat: has joined #ruby
[09:15:14] atmosx: ops sorry
[09:15:30] atmosx: I'll write in the afernoon probably.
[09:15:44] skade: has joined #ruby
[09:16:00] bazbing80: atmosx I fear a mute is coming
[09:17:09] atmosx: ACTION ducks
[09:18:37] shevy: the word rhymes with duck
[09:18:43] shevy: such as luck
[09:20:30] pawnbox_: has joined #ruby
[09:22:47] allomov: has joined #ruby
[09:23:57] Oog: has joined #ruby
[09:25:44] devoldmx: has joined #ruby
[09:26:07] emilkarl: Hi, is there a nice way to group and count a hash based on a value, like this??? http://pastie.org/10411938
[09:26:43] dumdedum: has joined #ruby
[09:27:31] RegulationD: has joined #ruby
[09:27:34] [k-: >> {a: 1, b: 1, c: 2}.values.group(&:itself)
[09:27:35] ruboto: [k- # => undefined method `group' for [1, 1, 2]:Array (NoMethodError) ...check link for more (https://eval.in/431667)
[09:28:02] sevenseacat: did you mean group_by ?
[09:28:22] emilkarl: group by the value
[09:28:29] vondruch: has joined #ruby
[09:28:41] [k-: >> {a: 1, b: 1, c: 2}.values.group_by(&:itself)
[09:28:42] ruboto: [k- # => {1=>[1, 1], 2=>[2]} (https://eval.in/431668)
[09:29:08] [k-: well that looks weird, but it is somewhat correct
[09:29:21] emilkarl: undefined method `itself' for 3:Fixnum
[09:29:28] chthon: has joined #ruby
[09:29:36] [k-: your ruby version is too old
[09:30:01] [k-: class Object; def itself; self; end end
[09:30:13] casadei_: has joined #ruby
[09:30:17] jhass: >> {147=>3, 148=>3, 163=>6}.group_by(&:last).map {|k, v| [k, v.size] }.to_h
[09:30:18] ruboto: jhass # => {3=>2, 6=>1} (https://eval.in/431673)
[09:30:19] emilkarl: > > [3, 3, 6].group_by(&:itself)
[09:30:28] emilkarl: >> [3, 3, 6].group_by(&:itself)
[09:30:29] ruboto: emilkarl # => {3=>[3, 3], 6=>[6]} (https://eval.in/431674)
[09:31:25] emilkarl: hmm what ruby version comes itself?
[09:31:39] sevenseacat: a pretty recent one i think
[09:31:49] [k-: don't know, but you can implement it yourself
[09:31:50] emilkarl: fails locally.
[09:32:20] [k-: open class Object, define itself
[09:32:34] sevenseacat: or just do what jhass said
[09:32:51] Siyfion: has joined #ruby
[09:32:52] jhass: I think itself is 2.1
[09:33:00] jhass: 21>> 1.itself
[09:33:00] ruboto: jhass # => undefined method `itself' for 1:Fixnum (NoMethodError) ...check link for more (https://eval.in/431680)
[09:33:05] jhass: mh, so 2.2 even
[09:33:13] emilkarl: yeah i have 2.1 localy
[09:33:26] jhass: but see above, you don't need it
[09:33:50] Oog: has joined #ruby
[09:34:06] emilkarl: jhass: it works thanks
[09:34:27] emilkarl: not as nice looking
[09:35:05] flaf: has left #ruby: ("WeeChat 1.0.1")
[09:35:36] [k-: monkey patch hash to hide it then (or not)
[09:35:44] jhass: how's .group_by(&:last) worse than .values.group_by(&:itself) ?
[09:35:53] thinkswan: has joined #ruby
[09:35:58] jhass: I mean it's even an array allocation less
[09:36:11] AndChat|159600: has joined #ruby
[09:36:30] jhass: okay maybe not if you count the inner arrays but meh
[09:36:36] [k-: no, it's not!
[09:39:15] zeroDivisible: has joined #ruby
[09:39:59] Oog_: has joined #ruby
[09:41:19] platzhirsch: has joined #ruby
[09:41:46] Oog: has joined #ruby
[09:42:04] bazbing80: epix failus
[09:42:15] jhass: ACTION hands bazbing80 a /
[09:42:29] Macaveli: has joined #ruby
[09:42:31] bazbing80: jhass: thankyou kind sir xP
[09:44:10] arup_r: has joined #ruby
[09:45:39] pegasuspect: has joined #ruby
[09:46:18] ahuman: has joined #ruby
[09:47:04] AndChat|159600: Hey guys, what options do I have for making a standalone GUI app?
[09:47:23] herrphon: has joined #ruby
[09:47:30] herrphon: has left #ruby: ()
[09:49:51] erichmenge: has joined #ruby
[09:51:15] nofxx: AndChat|159600, shoes, electron, qt, gtk... which OS?
[09:51:46] AndChat|159600: Windows, primarily
[09:52:37] khebbie: has joined #ruby
[09:52:56] nofxx: AndChat|159600, the new kid on the block is electron, but all we said can do too.
[09:52:57] shredding: has joined #ruby
[09:53:03] pawnbox: has joined #ruby
[09:53:50] djbkd: has joined #ruby
[09:55:09] AndChat|159600: I'll check them out, thanks
[09:55:35] nofxx: AndChat|159600, except it's JS heheh... wasnt electron ruby in the beginning ? when it was only the editor? Guess I'm confusing...
[09:55:48] [k-: write a blog post afterwards!
[09:55:53] nofxx: but.. there's opal for that =D
[09:56:50] nofxx: AndChat|159600, truth is, ppl use ruby for terminal and webapps... gui's are just not much used, so the libraries dont evolve
[09:56:56] nofxx: as web and cli ones
[09:58:15] AndChat|159600: That's a bummer... I love the ruby language, but sometimes one needs to build something outside the console/web scope.
[09:58:37] nofxx: bottomline I think is ruby is one the the most unix ratio in all langs. I mean, java, javascript 90% devs use winshit, ruby is 90% unix
[09:58:57] maciom: has joined #ruby
[09:59:00] nofxx: by unix I'm merging linux and osx
[09:59:19] maciom: hi, how can I achieve sth like doube splat in ruby<2.0
[10:00:29] maciom: in method invocation: method(**opts)
[10:01:00] Kallis: has joined #ruby
[10:01:39] nofxx: maciom, opts = {} guess is the closest
[10:01:58] khebbie: has joined #ruby
[10:03:23] ndrei: has joined #ruby
[10:04:03] maciom: nofxx: in method definition?
[10:11:08] Oog: has joined #ruby
[10:12:27] felixrsmith: has joined #ruby
[10:12:43] nofxx: maciom, yeah, def meth(opts = {})
[10:15:03] workmad3: meth(type: :blue_sky)
[10:16:49] allomov: has joined #ruby
[10:17:08] Vile`: has joined #ruby
[10:18:34] chthon: has joined #ruby
[10:20:03] leat2: has joined #ruby
[10:21:24] bkxd: has joined #ruby
[10:26:26] shevy: is it LSD time again?
[10:26:43] drbrain: has joined #ruby
[10:27:30] Ray`: it's always LSD time
[10:27:55] dhjondoh: has joined #ruby
[10:29:10] blt: has joined #ruby
[10:29:56] Balzrael: has joined #ruby
[10:33:18] ponga: has joined #ruby
[10:34:25] khebbie: has joined #ruby
[10:34:28] dhjondoh: has joined #ruby
[10:35:01] DoubleMalt: has joined #ruby
[10:36:04] arup_r: has joined #ruby
[10:36:33] tercenya: has joined #ruby
[10:36:35] sdothum: has joined #ruby
[10:37:56] ndrei: has joined #ruby
[10:38:41] phutchins: has joined #ruby
[10:39:48] morenoh149: has joined #ruby
[10:39:49] mprelude: has joined #ruby
[10:41:29] startupality: has joined #ruby
[10:41:30] devoldmx: has joined #ruby
[10:42:29] dhjondoh: has joined #ruby
[10:45:17] r0t13: has joined #ruby
[10:47:28] nofxx: has joined #ruby
[10:48:32] Rollabunna: has joined #ruby
[10:49:14] khebbie: has joined #ruby
[10:50:12] jedney: has joined #ruby
[10:51:09] khebbie: has joined #ruby
[10:52:32] shazaum_: has joined #ruby
[10:53:07] khebbie: has joined #ruby
[10:55:02] khebbie: has joined #ruby
[10:57:09] karapetyan: guys, how to understand for loop?
[10:57:46] sevenseacat: they must be pretty complicated if only guys can understand them.
[10:58:03] startupality: has joined #ruby
[10:58:04] suchness: This again?
[10:58:18] rodfersou: has joined #ruby
[10:59:00] felixrsmith: has joined #ruby
[10:59:38] eGGsha: has joined #ruby
[10:59:39] shevy: karapetyan in ruby it may be easier to use .each, and loop {}
[11:00:05] juanpablo_: has joined #ruby
[11:00:11] shevy: karapetyan check out answers on http://stackoverflow.com/questions/3294509/for-vs-each-in-ruby
[11:00:16] eosinx: has joined #ruby
[11:00:38] sevenseacat: suchness: i know, people still keep using 'guys' to refer to mixed-gendered groups :(
[11:01:12] shevy: I am all for calling people cats
[11:01:18] Rutix: has joined #ruby
[11:01:18] Rutix: has joined #ruby
[11:01:55] wildlander: has joined #ruby
[11:02:04] shevy: karapetyan that one has nicer colours :) -> http://graysoftinc.com/early-steps/the-evils-of-the-for-loop
[11:02:31] [k-: cat: hi
[11:02:31] karapetyan: ah, thanks you... but now i try to describe task that i can't understand
[11:02:56] davidhq: has joined #ruby
[11:03:20] karapetyan: i even can imagine algorithm
[11:03:33] karapetyan: i spent about 4 hours and have no any results
[11:03:36] shevy: feels like me when writing code
[11:03:45] shevy: yeah, I end up watching youtube videos :(
[11:03:57] [k-: cat: :(
[11:04:13] shevy: there be no cats in singapore
[11:04:30] suchness: karapetyan: "For each item in a set of items, do this thing to that item."
[11:04:36] [k-: there are cats in Singapore D:<
[11:05:40] suchness: sevenseacat: And what would you prefer?
[11:05:49] ruboto: Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
[11:06:26] suchness: Well, I don't relate to being included in y'all or everyone.
[11:06:28] jgt: has joined #ruby
[11:06:36] suchness: And certainly not folks.
[11:06:40] bronson: has joined #ruby
[11:06:45] karapetyan: https://gist.github.com/anonymous/30816517dffe93ae9537
[11:06:51] suchness: I'll soapbox about it.
[11:06:59] karapetyan: sevenseacat: sorry)
[11:07:16] sevenseacat: suchness: ok, what would you recommend. we can update it
[11:07:25] sevenseacat: though I won't remove 'everyone'
[11:08:54] karapetyan: do you have any ideas and can anyone help me how to solve this type of tasks?
[11:10:26] shevy: a rabbit problem
[11:10:34] suchness: sevenseacat: I recommend relaxing and not making a point every time someone says guys to hop on your soapbox. It's pointless and never related to the issue at hand. It's also discouraging for a person to come into IRC and instantly be called out for yet another thing.
[11:10:58] sevenseacat: ok, if you don't have any constructive suggestions, not a lot I can do
[11:11:01] jhass: karapetyan: I have troubles relating the example to the problem, that seems to be x = 6 & n = 3?
[11:11:09] suchness: sevenseacat: You aren't going to change the world in an IRC chat, take your war somewhere it actually matters.
[11:11:14] shevy: I also have problems to relate to rabbits
[11:11:25] apeiros: suchness: why don't you take your own advice? to me it seems like you're just throwing a tantrum.
[11:11:58] karapetyan: shevy: what exactly? :)
[11:12:00] shevy: karapetyan I don't quite understand it yet but it seems as if .step could be used? if you need the rabbit to hop
[11:12:04] jhass: karapetyan: ah, just weirdly formatted
[11:12:21] suchness: apeiros: I was asked my opinion.
[11:12:25] shevy: the format are rabbit tracks
[11:12:55] apeiros: suchness: yes, after you threw a tantrum
[11:13:14] apeiros: which IMO just goes to show that sevenseacat is much more mindful of others than you manage to be.
[11:13:24] suchness: apeiros: I hardly think saying "This again?" qualifies as a tantrum.
[11:13:35] nhhagen: has joined #ruby
[11:13:38] karapetyan: shevy: jhass i need to know count of every possible unique rabbits routes going to top
[11:13:49] jhass: karapetyan: so to rephrase the problem a bit more formal: in how many ways do to the numbers from 1 to n add up to x.
[11:14:07] apeiros: suchness: I do. and even more so in the collective.
[11:14:32] shevy: this is why nobody likes rabbits
[11:14:44] karapetyan: jhass: seems i have bad explanation :(
[11:14:48] karapetyan: give me a second
[11:15:41] karapetyan: https://gist.github.com/anonymous/e509aefb20ebb89fe9ab
[11:15:43] [k-: ?ot suchness apeiros
[11:15:43] ruboto: suchness, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
[11:15:51] shevy: what determines "N - number of steps that rabbit can jump at one time"?
[11:16:12] shevy: you want it to be 1, then 2, then 3 etc... ?
[11:16:15] Spami: has joined #ruby
[11:16:33] karapetyan: yes. all possible options
[11:16:49] karapetyan: 1 + 1 + 1 + 1
[11:17:17] shevy: yeah so you have to find the algorithm that will scale towards all steps
[11:17:20] karapetyan: 1 + 1 + 1 + 2; 1 + 1 + 2 + 1; 1 + 2 + 1 + 1; 2 + 1 + 1 + 1 +
[11:17:28] shevy: that actually is not that trivial is it?
[11:17:35] stamina: has joined #ruby
[11:17:44] [k-: O(e^n) :O
[11:17:47] karapetyan: shevy: yes, i fell that i am dumb.
[11:18:13] [k-: (im kidding)
[11:18:22] karapetyan: i dan't want get some code from you
[11:18:40] shevy: it seems as if the problem would start from the maximum amount of steps, down to 1
[11:18:59] shevy: 1 + 2 is the same solution as 2 + 1, just the position is different
[11:19:20] casadei_: has joined #ruby
[11:19:23] karapetyan: shevy: yes, i can. But what difference? )
[11:21:29] chills42: has joined #ruby
[11:21:42] jhass: karapetyan: for x = 6, n = 3, isn't 1 + 1 + 2 + 2 a valid route too?
[11:22:09] jhass: and its permutations
[11:22:37] karapetyan: jhass: yes, it valid too
[11:22:54] jhass: so your example is missing a couple of routes and it's more than 14, no?
[11:23:03] karapetyan: jhass: yes, sorry
[11:23:55] karapetyan: jhass: could you recommend what should i do to be able solve tasks like this?
[11:24:20] felixrsmith: has joined #ruby
[11:24:38] karapetyan: jhass: cause now i feel that i cant even understand how to build algorithm for this task
[11:24:40] jhass: so a naive approach could be to list all repeated permutations of the numbers in [1, n], then filter out those that don't add up to x
[11:25:05] jhass: check Array, it has a couple of helpers to get combinations and permutations
[11:25:26] [k-: so what would be the non naive approach?
[11:25:46] doddok: has joined #ruby
[11:25:50] bluOxigen: has joined #ruby
[11:25:59] [k-: i thought you would have something D:
[11:26:06] jhass: no, I suck at math
[11:26:24] jhass: I say naive because it blows up at x = 17, n = 5 already
[11:26:49] FernandoBasso: has joined #ruby
[11:27:20] [k-: hehe now my getNextFreeSquare algorithm works correctly as it brute forces, and cannot handle outputs > 50
[11:27:21] karapetyan: jhass: can i be RoR developer don't knowing math at level that requires this task?
[11:27:36] [k-: inputs*
[11:27:47] karapetyan: jhass: cause i suck at math much more than you
[11:28:03] jhass: karapetyan: probably, depends a bit on the kind of tasks you'll need to tackle
[11:28:19] jhass: some statistics knowledge is certainly useful for a lot of backend work
[11:28:42] pqowiu: has joined #ruby
[11:28:53] karapetyan: yep feel that to be software developer you should be a great in math
[11:29:07] jhass: that's not true
[11:29:10] RegulationD: has joined #ruby
[11:29:24] jhass: there's lots of work that doesn't require it at all
[11:30:04] syath: has joined #ruby
[11:30:31] zenspider: not in the slightest.
[11:30:39] zenspider: mathematical thinking is helpful, but not math
[11:30:50] bruno-: has joined #ruby
[11:30:59] zenspider: symbolic manipulation and algebraic refactorings
[11:31:41] atomical: has joined #ruby
[11:32:13] karapetyan: you know that fucking power of programming know how many routes rabbit have. Cause it's too hard to count in mind
[11:32:25] [k-: referential transparency!
[11:34:56] helpa: has joined #ruby
[11:34:59] shevy: [k- doesn't haskell have a trivial way to solve the rabbit problem?
[11:35:11] jhass: karapetyan: the rabbit is just a way to phrase the problem. If you google for a more abstract definition... ;)
[11:35:13] ldnunes: has joined #ruby
[11:35:14] but3k4: has joined #ruby
[11:36:26] [k-: i have no idea what the problem is about
[11:36:34] jhass: and you end up at pages like https://en.wikipedia.org/wiki/Composition_%28combinatorics%29
[11:36:36] [k-: and i definitely don't know how to solve it
[11:37:22] y0da: has joined #ruby
[11:39:35] Zai00: has joined #ruby
[11:41:24] leat2: has joined #ruby
[11:42:38] emilkarl: has joined #ruby
[11:44:44] Spami_: has joined #ruby
[11:44:58] jonr22: has joined #ruby
[11:45:19] atomical: has joined #ruby
[11:45:25] shevy: kill that rabbit
[11:45:27] howdoicomputer: has joined #ruby
[11:45:56] shevy: karapetyan can you solve it when the rabbit can do only 2 or 1 jumps?
[11:46:15] bruno-: has joined #ruby
[11:46:21] karapetyan: shevy: in mind? or in ruby ?
[11:46:36] karapetyan: shevy: if there only 1 jump then nothing to solve
[11:46:51] shevy: yeah for 2, in ruby
[11:46:56] karapetyan: shevy: it always be 1 + 1 (n times)
[11:47:04] karapetyan: shevy: give me a second)
[11:47:45] pegasuspect: has joined #ruby
[11:49:17] dgutierrez1287: has joined #ruby
[11:50:18] [k-: karapetyan has been closing a lot of things
[11:50:46] Spami: has joined #ruby
[11:51:16] bruno-: has joined #ruby
[11:52:22] [k-: )))))))))))))))))))(
[11:53:07] wpp: has joined #ruby
[11:53:28] raypulver: has left #ruby: ()
[11:53:32] zenguy_pc: has joined #ruby
[11:54:57] karapetyan: shevy: thank you! it's a good question and i glad to work on it!)))
[11:55:07] startupality: has joined #ruby
[11:56:32] [k-: he closed more yet again :o
[11:56:39] bruno-: has joined #ruby
[11:57:36] shevy: what's with the lisp here
[11:57:46] [k-: {[(?????<??????>?????)]}
[11:57:52] big|bad|wolf: has joined #ruby
[11:57:54] Macaveli: has joined #ruby
[11:58:06] futilegames: has joined #ruby
[11:58:23] shevy: wheee mruby gets utf https://github.com/mruby/mruby/commit/eb9bec19dcb99bf0a6934471fb8f35e80beb8719
[11:58:32] shevy: on windows
[11:59:07] sankaber: has joined #ruby
[11:59:15] [k-: \open\door
[11:59:42] arup_r: shevy: Look at the cat below .. http://vaidehijoshi.github.io/blog/2015/03/31/delegating-all-of-the-things-with-ruby-forwardable/?utm_source=rubyweekly&utm_medium=email :)
[12:01:46] krisquigley: has joined #ruby
[12:01:50] jenrzzz: has joined #ruby
[12:04:24] chills42: has joined #ruby
[12:04:27] greenarrow: has joined #ruby
[12:04:32] morenoh149: has joined #ruby
[12:05:47] JCOE: has joined #ruby
[12:06:48] startupality: has joined #ruby
[12:07:35] rbennacer: has joined #ruby
[12:08:49] Quandl: has joined #ruby
[12:08:54] shevy: aha! unicode!
[12:08:58] shevy: How many character positions should each Unicode character occupy in a monospace font?
[12:10:08] karapetyan: shevy: yes i can! :))
[12:10:19] karapetyan: shevy: almost done)
[12:10:19] Soda: has joined #ruby
[12:10:36] shevy: you do indeed used a lot of )
[12:10:40] shevy: so [k- was actually right
[12:10:47] shevy: do you use some cyrilic keyboard or something?
[12:11:31] startupality: has joined #ruby
[12:12:16] devoldmx: has joined #ruby
[12:14:05] meatherly: has joined #ruby
[12:14:19] Spami: has joined #ruby
[12:14:30] [k-: > [k- was actually...
[12:15:37] felixrsmith: has joined #ruby
[12:15:38] TvL2386: has joined #ruby
[12:16:21] linuxboytoo: has joined #ruby
[12:16:38] Guest40644: has joined #ruby
[12:18:08] shevy: I seem to remember having had seen that before by some russian programmer here on #ruby... AlexRussia or so
[12:20:34] djbkd: has joined #ruby
[12:21:36] garethrees: has joined #ruby
[12:24:08] bmurt: has joined #ruby
[12:30:12] khebbie: has joined #ruby
[12:31:36] bhaak: shevy: that depends on the unicode character in question :)
[12:31:52] ishahnaz: has joined #ruby
[12:31:55] karapetyan: if i have recursive function how to define variable to store results?
[12:31:56] aaronmcadam: has joined #ruby
[12:32:10] karapetyan: should it be class variable / global / or instacne ?
[12:32:16] shevy: karapetyan several ways, you can use @ivar
[12:32:43] shevy: well, if you already use a class, then an @ivar would make most sense
[12:32:49] karapetyan: shevy: in this case i have error..
[12:33:08] suchness: karapetyan: It depends, oftentimes it's the argument to the function
[12:33:12] shevy: then you are doing something wrong :)
[12:33:28] shevy: but you could also show the error
[12:34:57] karapetyan: https://gist.github.com/anonymous/7cb47d7eccda988ec7c3
[12:35:33] ndrei: has joined #ruby
[12:35:34] karapetyan: home_work:35:in `block in options': undefined method `+' for nil:NilClass (NoMethodError)
[12:36:48] [k-: class ivars are different from instance ivars
[12:37:00] centrx: has joined #ruby
[12:37:07] tcopeland: has joined #ruby
[12:37:15] [k-: yorickpeterse and apeiros would be keen to tell you more, unlike me
[12:37:18] karapetyan: https://gist.github.com/anonymous/7cb47d7eccda988ec7c3
[12:37:33] MatthewRock: has joined #ruby
[12:38:20] but3k4: has joined #ruby
[12:38:24] [k-: do you know how to solve the error now?
[12:38:40] MatthewRock: Hey Ruby guys. I want to call grep from Ruby. I'm doing so using backticks: `echo #{string} | grep -P regex`. However, I get some errors, depending on regex, which aren't showing up in grep called from command line.
[12:38:56] MatthewRock: I've asked the question on StackExchange, so detailed problem explanation would be here: http://stackoverflow.com/questions/32521718/grep-in-ruby-recursive-call-could-loop-indefinitely
[12:39:11] MatthewRock: I guess that's Ruby's thing, since command line works fine. How can I fix it?
[12:39:29] MatthewRock: Example error: "grep: unmatched parentheses"
[12:39:46] yorickpeterse: ACTION slaps [k- a few times
[12:41:22] karapetyan: ok, seems it works now
[12:41:26] karapetyan: shevy: could you check it?
[12:41:32] [k-: do you need to absolutely use grep?
[12:42:29] karapetyan: shevy: https://gist.github.com/anonymous/6dafbf7e8332742f7d46
[12:43:03] shevy: karapetyan youc an save on gist with a .rb file end
[12:43:09] shevy: then you get colour highlighting for free
[12:43:20] [k-: class vars arent the same as class ivars or ivars
[12:43:24] shevy: btw karapetyan
[12:43:29] shevy: didn't we talk about this yesterday
[12:43:35] shevy: again you don't use "def initialize"
[12:43:57] jgpawletko: has joined #ruby
[12:43:58] [k-: cvars != civars != ivars
[12:44:06] shevy: so today's lesson is - use def initialize! most classes will make good use of that method
[12:44:12] karapetyan: shevy: yes, we did, but i trying to focus on things that i can't understand.
[12:44:16] krisquigley: has joined #ruby
[12:44:25] karapetyan: i fix it today :) sorry
[12:44:27] shevy: yeah but you keep on dragging old stuff with ya :)
[12:44:31] shevy: see that again: check = Rabbit.new; check.read
[12:44:42] shevy: check.read is unnecessary
[12:44:55] shevy: in some months you won't be able to remember which method to use
[12:45:02] shevy: but .new will work on your classes
[12:45:29] karapetyan: shevy: understand. thats easy. i can clean up this all. This is important but not critical. Critical is to be a dumb in algorithms
[12:46:10] karapetyan: that i trying to fix, not so successful, as i understand )
[12:46:19] ndrei: has joined #ruby
[12:46:37] elperdut: has joined #ruby
[12:47:04] shevy: fix the small things
[12:47:22] shevy: else you repeat them
[12:47:25] [k-: do not use cvarsssss
[12:47:34] meatherly: has joined #ruby
[12:47:56] [k-: you shouldn't need to save outputs of recursion to a variable at an intermediate step
[12:48:05] [k-: only when it's done
[12:48:18] cball: has joined #ruby
[12:48:48] leat2: has joined #ruby
[12:48:53] juanpablo_: has joined #ruby
[12:49:43] [k-: because your result will definitely screw up if you call the method several times
[12:51:23] [k-: use an accumulating argument
[12:51:41] [k-: def options(max_jump, previous_result)
[12:52:16] [k-: then when you call options again in options: options(max_jump, previous_result + 1)
[12:52:50] s00pcan: has joined #ruby
[12:52:55] [k-: if jump != 2, return previous_result
[12:53:19] tknz: has joined #ruby
[12:53:51] davedev24: has joined #ruby
[12:55:45] [k-: do you understand?
[12:56:44] meatherly: has joined #ruby
[12:57:28] shevy: now he is gone
[12:57:55] devoldmx: has joined #ruby
[12:58:23] victortyau: has joined #ruby
[13:01:08] n1lo: What class Module end does ?
[13:01:40] n1lo: I mean, creating a class to subscribe Module.
[13:01:57] shevy: >> class Module; end
[13:01:58] ruboto: shevy # => nil (https://eval.in/431808)
[13:02:10] workmad3: has joined #ruby
[13:02:10] shevy: you can extend it n1lo
[13:03:01] st1gma: has joined #ruby
[13:04:04] [k-: Module is already a class used by Ruby
[13:04:17] n1lo: shevy, in this code: https://gist.github.com/nilo/fb1ad744f226244c5673
[13:04:23] [k-: you shouldnt name your class Module
[13:04:29] iateadonut: has left #ruby: ()
[13:05:00] pegasuspect: has joined #ruby
[13:05:16] allomov: has joined #ruby
[13:05:32] mary5030: has joined #ruby
[13:06:09] Usse: has joined #ruby
[13:06:13] [k-: does it run?
[13:06:27] shevy: n1lo that will add the method f() to class Module - it already exists by default
[13:06:38] shevy: n1lo see http://ruby-doc.org/core-2.2.0/Module.html
[13:07:11] Igorshp: has joined #ruby
[13:07:21] n1lo: [k-, yes.
[13:08:17] casadei_: has joined #ruby
[13:08:58] rbennacer: has joined #ruby
[13:09:05] Hobbyboy: has joined #ruby
[13:10:01] [k-: ok, what it will do is create 2 methods
[13:10:23] [k-: one is just an alias of another
[13:10:35] [k-: _method and method
[13:11:46] tbuehlmann: when having a convenience class method that prepares/parses input before calling the constructor, which one would you prefer? 1: Something.from(json_string) or 2: Something.from_json(json_string)
[13:11:49] [k-: upon calling the method, it will create a cache and store the result of the method being called with its arguments
[13:12:09] [k-: this is called a lookup table i presume
[13:12:48] [k-: it caches the results of an expensive method so that it does not need to reperform the method many times
[13:13:07] sgambino: has joined #ruby
[13:13:11] [k-: hence, it is an optimisation technique to make things run faster
[13:13:12] prambaud_: has joined #ruby
[13:13:31] shevy: tbuehlmann second would be more explicit
[13:13:46] shevy: first one would be shorter
[13:13:46] charliesome: has joined #ruby
[13:14:07] [k-: the second one is better, probably
[13:14:28] mary5030: has joined #ruby
[13:14:34] [k-: n1lo, sorry it doesnt create two methods
[13:14:38] tbuehlmann: let's say there's no chance of adding another method like from_xml
[13:14:48] shevy: second variant
[13:15:06] [k-: n1lo it takes an existing method and "makes a backup for it"
[13:15:06] shevy: how often do you have to type it?
[13:15:24] tbuehlmann: saying the method "from" makes no sense on its own, I'd argue that knowing about the method name alone doesn't happen. params are part of the signature, so you have to know them as well
[13:15:43] [k-: n1lo: then it redefines the existing method to become a cache/a pure function
[13:16:09] [k-: so, if you have a method foo, it creates _foo, which does the same as foo
[13:16:19] tbuehlmann: shevy, mh, it's not about writing but reading. how would you read "Something.from(json_string)" and how would you read "Something.from_json(json_string)"?
[13:16:31] [k-: n1lo: and then it redefines foo as a cache
[13:17:16] bruno-: has joined #ruby
[13:17:25] [k-: Something.from(some_string_that_can_take_any_name_the_dev_wants)
[13:17:29] Freijo: has joined #ruby
[13:17:44] nhhagen: has joined #ruby
[13:17:44] tbuehlmann: [k-, yeah, that's a good point
[13:17:49] shevy: well I would not use a variable called json_string probably
[13:17:57] niemcu: consider reading someone else's code, I would prefer to see from_json cause it doesnt make me think what would be in that parameter
[13:18:08] jhass: tbuehlmann: your variables shouldn't describe your data type but what the data represents, so I'd argue specifying the data type in the method name makes sense. Something.from_json(serialized_something)
[13:18:31] shevy: niemcu yeah
[13:18:54] [k-: n1lo: when you call foo(a,b,c), if you did not call it before, it will call _foo(a,b,c) and store the result
[13:19:09] tkuchiki: has joined #ruby
[13:19:43] [k-: n1lo: afterwards, when you call foo(a,b,c) again, it does not need to call _foo, it just takes it from the hash, which is a zillion times faster
[13:19:45] tbuehlmann: all very good arguments
[13:19:50] jhass: tbuehlmann: though following that line of thought one could also argue that if there's only one serialization format for Something, Something.deserialize(json) could make sense too
[13:20:01] tbuehlmann: I like the signature argument, too, but I think this is something for a perfect world
[13:20:30] shevy: we did progress a lot in this discussion
[13:20:39] [k-: n1lo: of course, if you call it with foo(a,b,d) it will have to call _foo(a,b,d) again and the process repeats for all different kinds of arguments
[13:20:40] shevy: by showing that both options are good!
[13:20:41] rdark: has joined #ruby
[13:20:51] tbuehlmann: jhass, yeah, that's the from_xml thing I mentioned. let's say it's just this one method
[13:21:21] n1lo: [k-, How I call foo(a,b,c) using it ?
[13:21:28] jhass: I guess what I'd miss with just "from" is that the method does something but from doesn't describe (accurately enough) what it does
[13:21:58] [k-: n1lo, when you call f(:foo), you must already have a method called foo
[13:22:18] [k-: so, you can just call foo
[13:22:58] jonr22: has joined #ruby
[13:23:49] jhass: another argument I could come up with is that the json stdlib adds to_json, so from_json gives nice symmetry
[13:23:57] jonr22: has joined #ruby
[13:24:14] tbuehlmann: being explicit here makes sense, will go with that
[13:24:35] [k-: CSV.from(xml)
[13:24:57] sonOfRa: In the C Extension API, I can use Check_Type to raise an exception if the type doesn't match. Is there also a version that just returns false if the type doesn't match?
[13:26:02] khebbie_: has joined #ruby
[13:26:16] dblessing: has joined #ruby
[13:27:08] jhass: http://rxr.whitequark.org/mri/source/error.c#442 so TYPE(x) == type I guess?
[13:27:10] sonOfRa: ah, the TYPE macro
[13:27:17] sonOfRa: just found it at the same time \o/
[13:27:42] hoov: has joined #ruby
[13:28:35] shevy: lots of C hackers active lately \o/
[13:28:59] CustosLimen: has joined #ruby
[13:30:22] nettoweb: has joined #ruby
[13:30:33] RegulationD: has joined #ruby
[13:30:46] sonOfRa: need to add some functionality to the rkerberos gem, or invoke the kerberos shell utilities
[13:30:46] voltalio: has joined #ruby
[13:30:57] sonOfRa: I don't like invoking shell utilities in web applications.
[13:34:19] sharkman: has joined #ruby
[13:34:40] sharkman: will the regex (.*) match breaklines?
[13:35:46] malconis: has joined #ruby
[13:35:47] apeiros: sharkman: only with the m flag
[13:36:01] apeiros: also \n is "newline", not breakline ;-)
[13:36:12] sharkman: what is \r ?
[13:36:21] apeiros: carriage return
[13:36:29] sharkman: whats the difference between \r and \n
[13:36:34] malconis: has joined #ruby
[13:36:53] hinbody: has joined #ruby
[13:36:58] apeiros: the same as the difference between "a" and "b" - they're different characters.
[13:37:09] Zai00: has joined #ruby
[13:37:15] sharkman: but arent they HTML code that both start a new line?
[13:37:15] Igorshp: has joined #ruby
[13:37:43] apeiros: they both are whitespace. whitespace does not matter in html
[13:37:44] [k-: that is <br>
[13:38:12] [k-: apeiros did you go for tea?
[13:38:38] ruby-lang788: has joined #ruby
[13:38:47] sharkman: ohh, i see, you mean both \r and \n are used for formatting the code, but it wont affect the output on browsers?
[13:39:10] shevy: hmmm... 2 hours in the rewrite... I suddenly realize that the error I had was due to the main regex not handling one corner case properly...
[13:39:23] apeiros: sharkman: yes. both affect the output the same as an ordinary space does.
[13:40:00] nettoweb: has joined #ruby
[13:40:02] ericfournier2: has joined #ruby
[13:41:11] leat2: has joined #ruby
[13:41:14] apeiros: sharkman: of course, assuming you don't have white-space: pre
[13:42:41] ericfournier2: Hi! Ruby is baffling me this morning. I'm trying to get the minimum of two numbers, but I'm getting a "comparison of Fixnum with nil failed". I've simplified my statement to:"run_length = ((1 > 12) ? 1 : 12)", and I'm still getting that error. I have no idea what is "nil" in that statement.
[13:43:10] apeiros: >> run_length = ((1 > 12) ? 1 : 12)
[13:43:11] ruboto: apeiros # => 12 (https://eval.in/431828)
[13:43:27] apeiros: ericfournier2: runs fine. are you sure that's the code where you can still reproduce the problem?
[13:43:27] NeverDie: has joined #ruby
[13:43:55] JCOE: has joined #ruby
[13:44:11] shevy: double baffle!
[13:44:48] ericfournier2: Well, it's the statement returning the error. It's inside an action controller object, but I don't think that should have an impact.
[13:45:03] jhass: it might very well be the wrong line you're looking at
[13:45:14] havenwood: has joined #ruby
[13:45:17] jhass: "controller object" sounds like rails, are you looking at the full trace?
[13:45:56] whippythellama: has joined #ruby
[13:45:56] ericfournier2: Yeah, itS' rails. I'm looking at the trace, and it's throwing at the "each" in "min", which I removed from the code 20 minutes ago. Seems like I have some sort of caching problem after all.
[13:46:15] [k-: apeiros: you were gone for so looooong
[13:46:38] apeiros: [k-: that happens sometimes
[13:46:53] ericfournier2: Ah, if I remove the line entirely, it still crash and burn.
[13:46:56] freezevee: has joined #ruby
[13:47:16] dc: has joined #ruby
[13:47:32] freezevee: How can I reverse the order of a hash @hash = {0=>"a", 2=>"b", 3=>"c", 4=>"d", 5=>"e"} to become {0=>"e", 2=>"d".... etc ?
[13:47:48] freezevee: the order of values of a hash
[13:47:53] apeiros: freezevee: hash.to_a.reverse.to_h
[13:47:57] jhass: freezevee: looks like you actually want an array with nil elements
[13:48:07] apeiros: oh, the values. well, sort_by(&:last) instead of .sort then.
[13:48:07] freezevee: apeiros: so you first convert it to an array
[13:48:11] freezevee: let me try it
[13:48:36] arup_r: has joined #ruby
[13:48:36] Igorshp: has joined #ruby
[13:48:39] lavros: has joined #ruby
[13:48:51] freezevee: apeiros: it becomes {5=>"e", 4=>"d", 3=>"c", 2=>"b", 0=>"a"}
[13:48:54] apeiros: if it's reversing, yes. if it's sorting, then you don't need to.
[13:49:05] freezevee: I don't know how to describe it
[13:49:09] jhass: ?xy freezevee
[13:49:09] ruboto: freezevee, it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[13:49:14] jhass: big one, I bet
[13:49:22] apeiros: freezevee: oh, I should have read your example. your example does not really match your question.
[13:49:37] juanpablo_: has joined #ruby
[13:49:44] dumdedum: has joined #ruby
[13:49:54] apeiros: (actually there's now 3 contradicting descriptions of your problem)
[13:49:55] [k-: &ri Hash#invert
[13:49:55] Guest68297: http://www.rubydoc.info/stdlib/core/Hash#invert-instance_method
[13:50:03] freezevee: apeiros: {0=>"a", 2=>"b", 3=>"c", 4=>"d", 5=>"e"} to {0=>"e", 2=>"d", 3=>"c", 4=>"b", 5=>"a"}
[13:50:10] jhass: [k- read it neither
[13:50:17] apeiros: freezevee: why do you use a hash?
[13:50:26] apeiros: freezevee: this looks like a hash used as an array
[13:50:28] bigbadbear: has joined #ruby
[13:50:28] jhass: freezevee: but why the hell would you need that?
[13:50:37] freezevee: experimenting
[13:50:43] freezevee: should I use an array ?
[13:50:50] jhass: yes, like I said initially
[13:51:18] freezevee: .invert will work like that then ?
[13:51:34] jhass: [k- just understood your problem even less
[13:51:44] yxhuvud: for arrays, then #reverse would be the method to use.
[13:51:49] freezevee: let's say you have a = [1,2,3,4,5]
[13:52:18] freezevee: reverse will reverse the array to [5,4,3,2,1]
[13:52:20] [k-: that's a wasted computation
[13:52:23] freezevee: so a[0] = 5
[13:52:25] freezevee: it makes sense
[13:52:27] tjohnson: has joined #ruby
[13:52:35] freezevee: I am such an idiot
[13:52:42] freezevee: thanks guys
[13:52:57] apeiros: suchness: you should look away
[13:53:03] apeiros: ?guys freezevee
[13:53:04] ruboto: freezevee, 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:53:20] freezevee: thanks friends !
[13:53:26] apeiros: you're welcome :)
[13:53:36] apeiros: even if I still don't know what you're actually trying to solve ;-)
[13:53:37] arup_r: has joined #ruby
[13:53:40] Gnomethrower: has joined #ruby
[13:53:45] freezevee: apeiros: an array of arrays
[13:53:59] [k-: a table?
[13:54:18] [k-: an associative array?
[13:54:50] jhass: freezevee: that's still implementation/solution, not a problem description ;)
[13:54:54] karapetyan: has joined #ruby
[13:55:17] freezevee: to be honest I don't want the solution
[13:55:28] freezevee: I want to find it myself :P
[13:55:41] freezevee: I know you always help but... I am denying it this time
[13:56:16] [k-: > jhass always help
[13:56:20] freezevee: I am trying to use a hash as an array with no reason, that's a great help
[13:56:21] [k-: hehehehehehehe
[13:56:27] rippa: has joined #ruby
[13:56:49] adaedra: jhass, channel's most valuable
[13:57:04] [k-: indeed, a hash is not suitable for a table
[13:58:04] bmurt: has joined #ruby
[13:58:23] adaedra: > use a hash as an array
[13:58:25] adaedra: I smell PHP
[13:58:36] casadei_: has joined #ruby
[13:59:13] [k-: adaedra: that's a set!
[13:59:27] adaedra: game, set, match
[13:59:46] [k-: no, set really does this
[13:59:56] hoylemd: has joined #ruby
[14:00:04] shevy: good old php
[14:00:15] adaedra: we have to go higher
[14:00:18] adaedra: and be upset
[14:00:21] adaedra: ACTION leaves
[14:00:27] sharkman: is anyone else cold
[14:00:41] [k-: the world is on fire
[14:00:56] soc42: has joined #ruby
[14:01:08] gamename: has joined #ruby
[14:01:10] hoylemd: Best practices question: what's the accepted way to encode large-ish(> 10 lines, nicely formatted) data structures into a method? Rubocop likes to complain if any method is larger than 10 lines.
[14:01:34] jhass: >> require "set"; Set.new([1, 2, 3])[0] # not sure I'd call this array still if that property is lost [k-
[14:01:35] ruboto: jhass # => undefined method `[]' for #<Set: {1, 2, 3}> (NoMethodError) ...check link for more (https://eval.in/431833)
[14:01:39] sharkman: im in starbucks i am in patns and a sweatshirt and im about to get hypothermia
[14:01:43] suchness: hoylemd: Aside from refactoring into smaller methods? Or perhaps implementing a class?
[14:01:49] renanoronfle: has joined #ruby
[14:01:58] apeiros: hoylemd: no silver bullets. hence there's no answer to that generic question.
[14:02:12] solocshaw: has joined #ruby
[14:02:17] adaedra: I had to get outside, oh god
[14:02:18] [k-: why is a datastructure a method
[14:02:23] Gnomethrower: has joined #ruby
[14:02:28] pegasuspect: has joined #ruby
[14:02:37] [k-: a bird pooped on adaedra's windoe
[14:02:42] solocshaw: has joined #ruby
[14:03:00] hoylemd: suchness: The smallest method I could refactor into would still just return the entire data structure though, so if I have a data structure that has > 10 members, there'll be no way to create it in a method without ging over that limit.
[14:03:13] adaedra: [k-: did you mean: window
[14:03:23] suchness: hoylemd: May I look at your method, on pastie.org perhaps?
[14:03:28] hoylemd: A class might work, but The data structures are created as dictionaries so they can be easily json-ified
[14:03:31] [k-: now what will you do adaedra?
[14:03:35] adaedra: And no, windows are clean
[14:03:39] adaedra: I'm eating ice cream
[14:03:59] [k-: why did you go outside then?
[14:04:05] hoylemd: suchness: I can't show you the one I'm working on verbatim, but I'll whip up an anaolgous example (if I can do that before a meeting :/)
[14:04:05] [k-: to get icecream?
[14:04:07] shevy: he was in need of a baguette
[14:04:37] suchness: hoylemd: That's fine, just replace anything sensitive, I'll still understand it.
[14:04:46] hoylemd: aw damn. Meeting is now. I'll ask again later
[14:05:51] [k-: abyss went for a meeting and never came back
[14:05:52] adaedra: [k-: got things to do
[14:06:23] [k-: why do programmers have so many meetings @.@
[14:06:43] mary5030: has joined #ruby
[14:06:43] shevy: because they receive their instructions that way
[14:06:50] adaedra: Emulation of social activities.
[14:07:08] shevy: and to give fancy presentations
[14:07:13] benaiah: has joined #ruby
[14:07:27] shevy: [k- you will have to do this as well eventually
[14:07:28] centrx: http://4.bp.blogspot.com/-3ZBbiMsWxCQ/TV3SvlzBBBI/AAAAAAAAChE/idPCXf-VrX0/s1600/meetings.jpg
[14:08:00] shevy: eat donuts
[14:08:07] ruboto: I don't know anything about donut
[14:08:17] [k-: ?doughnut
[14:08:18] ruboto: I don't know anything about doughnut
[14:08:33] [k-: i'll just settle for a cake then
[14:08:39] ruboto: here's your cake: ????
[14:08:43] Swappticon: has joined #ruby
[14:08:55] Eddieh_: has joined #ruby
[14:08:57] livathinos: has joined #ruby
[14:09:55] shevy: we need to add more food factoids to ruboto
[14:10:25] juanpablo_: has joined #ruby
[14:10:54] Swappticon: has joined #ruby
[14:12:00] pegasuspect: has joined #ruby
[14:12:17] Jamo_: has joined #ruby
[14:12:28] Kricir: has joined #ruby
[14:12:46] bruno-: has joined #ruby
[14:14:25] tomchapin: has joined #ruby
[14:14:50] adaedra: I think apeiros has to deploy the dynamic list also
[14:16:30] [k-: we should create a list of things
[14:17:05] umgrosscol: has joined #ruby
[14:17:38] Soda: has joined #ruby
[14:18:00] bruno-: has joined #ruby
[14:19:11] banister: has joined #ruby
[14:19:13] adaedra: ACTION puts [k- on the list
[14:20:57] solocshaw1: has joined #ruby
[14:21:01] shevy: trapping [k-
[14:21:04] mary5030: has joined #ruby
[14:21:35] dopamean_: has joined #ruby
[14:21:36] wpp: has joined #ruby
[14:21:49] mercerist: has joined #ruby
[14:22:21] dmolina: has joined #ruby
[14:23:27] bruno-: has joined #ruby
[14:25:00] tkuchiki: has joined #ruby
[14:25:53] Evans: has joined #ruby
[14:26:21] workmad3: has joined #ruby
[14:28:40] momomomomo: has joined #ruby
[14:29:08] pawnbox: has joined #ruby
[14:29:31] khebbie: has joined #ruby
[14:32:24] ckinniburgh: has joined #ruby
[14:32:31] i: has joined #ruby
[14:33:50] bruno-: has joined #ruby
[14:34:10] r0t13: has left #ruby: ("Leaving")
[14:35:05] nettsundere: has joined #ruby
[14:38:19] JCOE: has joined #ruby
[14:38:53] Mives: has joined #ruby
[14:40:36] chills42: has joined #ruby
[14:40:43] sharkman: i have a question if someone could help me on about scraping. i need to scrape play by play data for football games from espn
[14:40:58] linuxboytoo: has joined #ruby
[14:40:59] sharkman: when a game is done, my browser has all the play details in html code. http://espn.go.com/college-football/playbyplay?gameId=400763599
[14:41:16] sharkman: but when a game is in progress, espn puts all the play by play info in a JSON variable, espn.gamepackage.data
[14:41:37] sharkman: im wondering if there is a way to retrieve this JSON variable even when a game ends? to put a request through and force them to give it to me?
[14:42:03] nhhagen_: has joined #ruby
[14:42:23] n1lo: How can I get the string value inside String class ?
[14:42:27] Oka: has joined #ruby
[14:42:48] RegulationD: has joined #ruby
[14:43:06] [k-: the string value inside the string class is a string
[14:43:10] centrx: n1lo, self ?
[14:43:25] Hanmac: has joined #ruby
[14:44:02] dfockler: has joined #ruby
[14:44:02] suchness: sharkman: Seems like a question better suited to espn.
[14:44:15] n1lo: centrx, yeah. +_+
[14:44:15] sharkman: yes it is. but you guys are what im left with
[14:44:35] suchness: sharkman: Alright, let me just quickly reference my espn manual.
[14:44:55] jxv: has joined #ruby
[14:44:58] khebbie: has joined #ruby
[14:45:00] suchness: sharkman: Nothing, drat.
[14:45:22] sharkman: lol youre funny suchness
[14:45:39] suchness: sharkman: What kind of answer did you expect?
[14:46:12] oldbay: has joined #ruby
[14:46:40] sharkman: maybe the variable is accessible through some javascript magic
[14:47:23] suchness: sharkman: Maybe, but you've offered absolutely no resources, no examples, nothing. No one here is going to charge out and figure out a niche question better suited to ESPN.
[14:47:43] beast: has joined #ruby
[14:47:50] dgutierrez1287: has joined #ruby
[14:49:08] sharkman: you are answering for other people
[14:49:24] [k-: ?ot sharkman
[14:49:24] ruboto: sharkman, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
[14:49:59] apeiros: I don't think sharkman's question was offtopic
[14:50:19] apeiros: but I also think suchness' assessment is right on
[14:50:42] adaedra: much topic
[14:50:56] [k-: very wow*
[14:51:41] [k-: do you have the k factor?
[14:51:45] dogedra: this is my life now
[14:52:05] bigbadbear: has joined #ruby
[14:52:49] polishdub: has joined #ruby
[14:53:38] [k-: RFC444 defines many as more than or equal to 4
[14:56:29] bootstrappm: has joined #ruby
[14:56:47] podman: has joined #ruby
[14:56:50] pegasuspect: has joined #ruby
[14:57:08] dfockler: has joined #ruby
[14:58:48] charliesome: has joined #ruby
[15:00:00] Chau: has joined #ruby
[15:02:43] dionysus69: has joined #ruby
[15:02:47] shmilan: has joined #ruby
[15:02:51] Rubie: has joined #ruby
[15:04:03] momomomomo: has joined #ruby
[15:04:22] bruno-_: has joined #ruby
[15:04:28] Mives: has joined #ruby
[15:04:50] camm1: has joined #ruby
[15:05:12] prefixed: has joined #ruby
[15:05:13] soc42: has joined #ruby
[15:05:47] dopie: has joined #ruby
[15:07:26] slawrence00: has joined #ruby
[15:07:58] camm1: Hello everyone, do you know how to doc a @param with yardoc when is a "list" of Objects?
[15:08:36] dogedra: a list how?
[15:08:42] dogedra: vararg, or array of Object?
[15:08:52] TPBallbag: has joined #ruby
[15:10:16] camm1: array of Object
[15:10:33] dogedra: Any kind of object, or is there a limit?
[15:10:50] linuxboy_: has joined #ruby
[15:11:02] [k-: Array<Object> iirc
[15:11:27] Igorshp: has joined #ruby
[15:11:38] pegasuspect: has joined #ruby
[15:11:43] [k-: And Array<String, Fixnum, Hash> iirc
[15:11:48] dogedra: Object is very generic, if you want a limit, you have to indicate it
[15:11:51] athinggoingon: has joined #ruby
[15:11:54] apeiros: IMO Array<Object> is redundant. Array is sufficient.
[15:12:00] camm1: Thank you
[15:12:05] dfockler: Yeah it's like @param [Array<Object>]
[15:13:01] camm1: Thanks a lot.
[15:13:07] pawnbox: has joined #ruby
[15:14:13] dfockler: I guess in Ruby you shouldn't expect the array to contain a specific type, because it can contain any number of types
[15:14:23] dogedra: Just use Array if it's *any* object, otherwise Array<T> it is (i.e. Array<String>, Array<#poke>)
[15:14:37] dogedra: dfockler: that's for documentation tho
[15:14:47] bruno-_: has joined #ruby
[15:14:54] [k-: ... Array<T>
[15:15:27] [k-: ...if you pass in any other objects, the behaviour is undefined
[15:15:57] dfockler: well it's docs not code, the docs don't care what type you pass in
[15:16:39] dogedra: that's a hint for users!
[15:16:50] dogedra: much dynamic types
[15:16:56] dfockler: I document for the Users!
[15:17:22] nhhagen: has joined #ruby
[15:17:27] rwyoung: has joined #ruby
[15:18:18] Igorshp: has joined #ruby
[15:18:21] [k-: dirty dirty
[15:19:03] sharkman: do you guys agree that users in the linux irc channel are smarter than people here?
[15:19:36] sharkman: 20+ iq points smarter?
[15:19:42] ruboto: Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
[15:19:47] suchness: I would say 15, 20 is pushing it
[15:20:02] dogedra: sharkman: why do you want to compare?
[15:20:28] dogedra: Also, what does "being smarter" means? How do you measure it? Just by IQ points?
[15:20:37] sharkman: maybe they are immorallar than us
[15:21:04] fostertheweb: has joined #ruby
[15:21:23] sharkman: yeah using like IQ points
[15:21:32] codecop: has joined #ruby
[15:21:33] sharkman: yeah using like IQ points
[15:21:38] dogedra: I don't know my IQ score. What do we do?
[15:21:45] sharkman: you can guess
[15:22:24] suchness: I guess dogedra is at least 210 iq.
[15:22:36] apt-get: has joined #ruby
[15:22:42] suchness: Which makes the linux people around 225.
[15:22:59] [k-: the only way to know if someone is smart if they know if they are stupid
[15:23:05] sharkman: why does "aaa" =~ /a/ return 0?
[15:23:14] sharkman: why wouldnt it return "a", or true
[15:23:14] [k-: s/are/feel/
[15:23:28] abg: has joined #ruby
[15:23:33] [k-: it returns the index where the regex first matches
[15:23:42] abg: has left #ruby: ()
[15:23:45] imperator: has joined #ruby
[15:23:45] suchness: sharkman: I think that's where it matched.
[15:23:49] [k-: it provides alternate behavior to .match
[15:23:58] sharkman: oh thanks i see
[15:24:01] [k-: because people actually do need it
[15:24:29] dogedra: &ri String#=~ explains it
[15:24:29] `derpy: http://www.rubydoc.info/stdlib/core/String#%3D%7E-instance_method
[15:25:05] [k-: people always ignore me :(
[15:25:28] dogedra: did someone talk?
[15:25:55] shinnya: has joined #ruby
[15:26:21] ramfjord: has joined #ruby
[15:26:56] ndrei: has joined #ruby
[15:28:32] elperdut: has joined #ruby
[15:30:14] bruno-: has joined #ruby
[15:30:14] psy: has joined #ruby
[15:31:07] ruurd_: has joined #ruby
[15:31:51] sepp2k: has joined #ruby
[15:32:07] dionysus69: has joined #ruby
[15:33:16] MichaelSmith: has joined #ruby
[15:33:23] chouhoulis: has joined #ruby
[15:34:30] ruurd: has joined #ruby
[15:34:49] ndrei: has joined #ruby
[15:35:32] bahar: has joined #ruby
[15:36:12] shmilan: has joined #ruby
[15:36:58] shevy: dogedra I prefer your old nick
[15:38:29] michaeldeol: has joined #ruby
[15:38:52] bigbadbear: has joined #ruby
[15:39:04] davidhq: has joined #ruby
[15:42:58] The_Phoenix: has joined #ruby
[15:43:03] JCOE: has joined #ruby
[15:43:18] karapetyan: has joined #ruby
[15:46:47] chouhoulis: has joined #ruby
[15:49:21] slash_nick: shevy: what was it?
[15:49:21] bb010g: has joined #ruby
[15:50:14] ruurd: has joined #ruby
[15:50:32] Rubie: has joined #ruby
[15:51:04] luckyme: has joined #ruby
[15:53:26] platzhirsch: has joined #ruby
[15:53:57] paulcsmith: has joined #ruby
[15:55:25] morenoh149: has joined #ruby
[15:56:46] Motoservo: has joined #ruby
[15:57:45] bigbadbear: has joined #ruby
[15:58:51] khebbie: has joined #ruby
[16:00:40] Swappticon: has joined #ruby
[16:01:47] towski_: has joined #ruby
[16:02:05] petricore: has joined #ruby
[16:03:24] ndrei: has joined #ruby
[16:03:41] jenrzzz: has joined #ruby
[16:04:21] dgutierrez1287: has joined #ruby
[16:07:33] ruurd: has joined #ruby
[16:07:39] yfeldblum: has joined #ruby
[16:09:50] momomomomo: has joined #ruby
[16:09:51] r_baron: has joined #ruby
[16:10:40] bruno-: has joined #ruby
[16:11:24] amclain: has joined #ruby
[16:11:36] chihhsin: has joined #ruby
[16:12:10] agent_white: has joined #ruby
[16:13:16] bootstrappm: has joined #ruby
[16:18:54] bubbys: has joined #ruby
[16:19:33] bricker: has joined #ruby
[16:20:31] hyperdrive: has joined #ruby
[16:21:03] camm2: has joined #ruby
[16:21:07] bruno-: has joined #ruby
[16:21:34] mleung: has joined #ruby
[16:21:44] Jackneill: has joined #ruby
[16:21:48] craigp: has joined #ruby
[16:22:09] djbkd: has joined #ruby
[16:22:40] craigp_: has joined #ruby
[16:22:54] minotep: has joined #ruby
[16:23:04] krz: has joined #ruby
[16:23:38] mroark: has joined #ruby
[16:24:11] mhib: has joined #ruby
[16:24:13] ruurd: has joined #ruby
[16:24:36] shevy: slash_nick adaedra
[16:25:06] [k-: good one
[16:25:07] User458764: has joined #ruby
[16:26:06] fostertheweb: has joined #ruby
[16:26:19] tkuchiki: has joined #ruby
[16:27:31] armyriad: has joined #ruby
[16:28:41] linuxboytoo: has joined #ruby
[16:29:32] marr: has joined #ruby
[16:30:38] armyriad: has joined #ruby
[16:32:09] minimalism: has joined #ruby
[16:32:14] ellisTAA: has joined #ruby
[16:32:54] camm1: has joined #ruby
[16:32:55] hoylemd: Repeating earlier question: What's the best practices way to keep a method to less than 10 lines (as Rubocop wants) when the method needs to define a large-ish data structure? example: http://pastie.org/10412720
[16:33:25] tercenya: has joined #ruby
[16:33:50] skullcrasher: has joined #ruby
[16:33:53] tomchapin: has joined #ruby
[16:34:01] dorei: has joined #ruby
[16:34:04] Lycanii: has joined #ruby
[16:35:16] bootstrappm: I wouldn't worry too much about that guideline hoylemd. For example, if you put your whole data structure on one line you'd have a 4-line method ??? does that mean its a better method? No, I'd say its worse because its less readable
[16:35:28] bootstrappm: just keep it short and to the point
[16:35:53] al2o3-cr: has joined #ruby
[16:35:56] bootstrappm: if you're gonna share that data structure across methods put it somewhere else, sure, but don't do it for the sake of saving a few lines
[16:36:20] hyperdrive: has joined #ruby
[16:36:52] ekain: has joined #ruby
[16:36:54] ndrei: has joined #ruby
[16:37:30] roxtrongo: has joined #ruby
[16:38:22] mleung: has joined #ruby
[16:39:07] shadoi: has joined #ruby
[16:39:09] psye: has joined #ruby
[16:39:27] ruurd: has joined #ruby
[16:40:18] roxtrongo: has joined #ruby
[16:40:20] Trieste: has joined #ruby
[16:40:39] psye: has joined #ruby
[16:40:55] shadoi1: has joined #ruby
[16:41:04] siemprefresco: has joined #ruby
[16:41:33] fostertheweb: has joined #ruby
[16:41:46] bootstrappm: has joined #ruby
[16:42:13] arup_r: has joined #ruby
[16:42:16] RegulationD: has joined #ruby
[16:42:39] Maletor: has joined #ruby
[16:42:39] skade: has joined #ruby
[16:43:25] justin_pdx: has joined #ruby
[16:43:42] Sou|cutter: hoylemd: Disable the cop on that method is what I'd do
[16:44:06] fantazo: has joined #ruby
[16:44:47] bootstrappm: has joined #ruby
[16:45:14] ngscheurich: has joined #ruby
[16:46:11] FernandoBasso: has joined #ruby
[16:46:27] RandyT: has joined #ruby
[16:47:12] symm-: has joined #ruby
[16:47:42] apt-get: has joined #ruby
[16:49:06] riskish: has joined #ruby
[16:49:08] ndrei: has joined #ruby
[16:49:09] frozen3: has joined #ruby
[16:54:52] tejasmanohar: has joined #ruby
[16:55:50] ruurd: has joined #ruby
[16:56:16] voltalio: has joined #ruby
[16:57:37] nanoz: has joined #ruby
[16:59:19] n008f4g_: has joined #ruby
[16:59:19] sampai: has joined #ruby
[16:59:28] User458764: has joined #ruby
[16:59:29] certainty: actually i'd considere breaking up the construction of the datastructure
[16:59:35] certainty: consider, even
[17:00:10] artmost: has joined #ruby
[17:00:26] apt-get: has joined #ruby
[17:00:40] khebbie: has joined #ruby
[17:01:19] centrx: hoylemd, Why is the data structure being defined in the method?
[17:01:22] RandyT_: has joined #ruby
[17:02:07] RandyT_: has joined #ruby
[17:02:52] voltalio: has joined #ruby
[17:03:50] bootstrappm: has joined #ruby
[17:04:20] fostertheweb: has joined #ruby
[17:04:47] RegulationD: has joined #ruby
[17:04:50] ramfjord: has joined #ruby
[17:05:12] skinkitten: has joined #ruby
[17:05:46] kirun: has joined #ruby
[17:06:38] shevy: hoylemd you could trick it by defining a constant for the part that remains static; the part that then gets changed of that hash could be used or become assigned to another variable e. g. @instance_variable
[17:07:01] shevy: the main reason why smaller methods are preferred is because they are often much easier to work with or refactor than those 500 lines of code methods
[17:07:11] wldcordeiro: has joined #ruby
[17:07:37] cornerma1: has joined #ruby
[17:08:09] ruurd: has joined #ruby
[17:08:49] tubbo: hoylemd: you make a MethodLength exception for that file
[17:08:55] tubbo: that's what i do anyway
[17:09:12] shadoi1: always follow the rules unless they are stupid.
[17:10:50] jgt: has joined #ruby
[17:11:04] NeverDie: has joined #ruby
[17:11:46] anaeem1_: has joined #ruby
[17:12:22] alphaatom: has joined #ruby
[17:12:46] bootstrappm: has joined #ruby
[17:13:31] sampai: has joined #ruby
[17:14:12] poli: has joined #ruby
[17:15:34] certainty: obviously the values there aren't produced out out thin air. I mean the parts of the datastructure. There probably is business logic hidden there. If it is it should be expressed elsewhere.
[17:15:51] leafybasil: has joined #ruby
[17:16:36] bruno-: has joined #ruby
[17:16:39] certainty: make these pieces composable
[17:17:30] shmilan: has joined #ruby
[17:17:55] bootstrappm: has joined #ruby
[17:18:03] voltalio: has joined #ruby
[17:21:29] wldcordeiro: has joined #ruby
[17:21:43] BraddPitt: has joined #ruby
[17:21:50] krisquigley: has joined #ruby
[17:22:00] bruno-: has joined #ruby
[17:23:28] sampai`: has joined #ruby
[17:23:40] shevy: there is logic hidden there!
[17:23:51] shevy: certainty analyzes it deep
[17:24:06] Hanmac: has joined #ruby
[17:24:43] ruurd: has joined #ruby
[17:26:04] bootstrappm1: has joined #ruby
[17:28:54] renderful: has joined #ruby
[17:29:08] postmodern: has joined #ruby
[17:29:11] cantaberry: has joined #ruby
[17:29:15] pegasuspect: has joined #ruby
[17:29:44] pegasuspect: has left #ruby: ()
[17:29:54] k3asd`: has joined #ruby
[17:30:17] rdark: has joined #ruby
[17:30:34] pragmatism: has joined #ruby
[17:30:58] tomchapin: has joined #ruby
[17:32:28] bruno-: has joined #ruby
[17:33:25] rbowlby: has joined #ruby
[17:33:58] tomchapin: has joined #ruby
[17:34:19] dionysus69: has joined #ruby
[17:35:21] Jardayn: has joined #ruby
[17:37:04] Jardayn: has joined #ruby
[17:37:15] NeverDie_: has joined #ruby
[17:37:22] tomchapin: has joined #ruby
[17:37:53] bruno-: has joined #ruby
[17:39:39] krisquigley: has joined #ruby
[17:40:57] ruurd: has joined #ruby
[17:41:14] HayesHimself: has joined #ruby
[17:42:55] eGGsha: has joined #ruby
[17:43:19] bruno-: has joined #ruby
[17:45:42] iateadonut: has joined #ruby
[17:45:59] mprelude: has joined #ruby
[17:47:14] alphaatom: has joined #ruby
[17:47:49] VeryBewitching: has joined #ruby
[17:48:44] bruno-: has joined #ruby
[17:48:44] leafybasil: has joined #ruby
[17:49:30] baweaver: has joined #ruby
[17:50:02] Stalkr_: has joined #ruby
[17:51:02] chrisseaton: In MRI what is T_DATA?
[17:51:05] craigp: has joined #ruby
[17:51:53] senayar: has joined #ruby
[17:51:53] senayar: has joined #ruby
[17:52:39] milanpaperclip: has joined #ruby
[17:53:04] baweaver: ACTION is / was a SysAdmin
[17:53:14] baweaver: ah, old messages
[17:53:16] baweaver: every time.
[17:53:33] dfockler: chrisseaton: Apparently it's a type
[17:54:01] dfockler: http://rxr.whitequark.org/mri/source/include/ruby/ruby.h#492
[17:54:07] dogedra: systemctl disable baweaver
[17:54:11] bruno-_: has joined #ruby
[17:54:13] centrx: chrisseaton, speculating it's related to DATA
[17:55:05] chrisseaton: I get all of that - but what goes into T_DATA as opposed to any of the more clearly named symbols?
[17:55:27] [k-: has joined #ruby
[17:55:39] yfeldblum: has joined #ruby
[17:56:25] ruurd: has joined #ruby
[17:57:15] Hanmac: chrisseaton: T_DATA is used for bindings and stuff, T_DATA is the representation for a C pointer bound to an ruby object (PS: but i dont know why the DATA class exist in ruby visible)
[17:57:29] dionysus69: has joined #ruby
[17:57:43] chrisseaton: Ah so it's a generic opaque handle into a VM object I guess
[17:57:45] Alina-malina: has joined #ruby
[17:57:49] pandaant: has joined #ruby
[17:58:08] dogedra: no it is patrick
[17:58:37] centrx: chrisseaton, has some info - https://github.com/ruby/ruby/blob/trunk/doc/extension.rdoc
[17:59:30] CustosL1men: has joined #ruby
[17:59:38] bruno-_: has joined #ruby
[18:00:07] platzhirsch: has left #ruby: ()
[18:00:37] Pupeno: has joined #ruby
[18:02:25] khebbie: has joined #ruby
[18:03:44] shevy: what does the leading T_ denote there?
[18:04:21] harumph: has joined #ruby
[18:04:36] timonv: has joined #ruby
[18:04:52] jenrzzz: has joined #ruby
[18:05:09] Rurik: has joined #ruby
[18:06:36] alphaatom: has joined #ruby
[18:07:20] bronson: has joined #ruby
[18:07:23] mikecmpbll: has joined #ruby
[18:07:30] ramfjord: has joined #ruby
[18:07:38] howdoicomputer: has joined #ruby
[18:07:43] casadei_: has joined #ruby
[18:08:08] karapetyan: has joined #ruby
[18:08:16] shevy: centrx lol
[18:10:12] [k-: a small t is token!
[18:10:21] [k-: see, i know some Ruby c
[18:10:42] bb010g: has joined #ruby
[18:11:20] Alayde: has joined #ruby
[18:12:06] banjara: has joined #ruby
[18:12:52] ruurd: has joined #ruby
[18:13:02] dgutierrez1287: has joined #ruby
[18:13:23] baweaver: has joined #ruby
[18:14:19] harumph: Querying postgres through a ActiveRecord raw connection with the pg adapter, seems to return wonky datatypes. Anyone find that?
[18:14:53] slash_nick: harumph: def wonky? i haven't noticed anything
[18:15:03] harumph: ActiveRecord::Base.connection.execute("SELECT col_that_is_def_an_integer FROM stuff")
[18:15:09] harumph: col_that_is_def_an_integer returns as a string
[18:15:36] dfockler: are you sure it's def_an_integer?
[18:15:41] dfockler: in the database
[18:15:57] harumph: yea, it's an integer type in the db.
[18:16:29] dfockler: Is it defined as an int in the AR code?
[18:16:52] casadei_: has joined #ruby
[18:18:22] ndrei: has joined #ruby
[18:18:47] harumph: Hmm, its type is unspecified in the code. Shouldn't the result be taken from the db data type when using a raw connection?
[18:18:53] nettsundere: has joined #ruby
[18:19:07] harumph: I'm moving an app from MySQL to Postgres and it seemed to work as expected with MySQL.
[18:19:46] failshell: has joined #ruby
[18:20:59] Rurik: has joined #ruby
[18:21:30] El-skra7: has joined #ruby
[18:21:35] El-skra7: has left #ruby: ("Leaving")
[18:22:08] bricker: harumph: show your schema, the code you're running, what it's returning, what you expect it to return, etc.
[18:24:44] ruurd: has joined #ruby
[18:25:50] tarun: has joined #ruby
[18:26:55] tkuchiki: has joined #ruby
[18:26:56] DLSteve: has joined #ruby
[18:28:55] atomical: has joined #ruby
[18:29:57] michael_mbp: has joined #ruby
[18:30:04] bruno-_: has joined #ruby
[18:30:52] _yolgs_: has joined #ruby
[18:31:13] harumph: http://pastebin.com/c6YgKm8B
[18:31:14] ruboto: harumph, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/491db275bb625e27b967
[18:31:14] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[18:31:39] harumph: true enough
[18:32:30] harumph: ActiveRecord::Base.connection.execute("SELECT * from variance_report_caches").to_a[0][:size]
[18:32:36] harumph: will be "2"
[18:32:45] slash_nick: cool feature mr. ruboto
[18:33:14] mike___1234: has joined #ruby
[18:34:47] harumph: bricker: ^
[18:34:58] konsolebox: has joined #ruby
[18:35:27] bruno-_: has joined #ruby
[18:37:01] freerobby: has joined #ruby
[18:38:54] Pharaoh2: has joined #ruby
[18:39:50] momomomomo: has joined #ruby
[18:42:48] allomov: has joined #ruby
[18:43:05] yqt: has joined #ruby
[18:43:13] atomical: has joined #ruby
[18:43:38] AustinMatherne: has joined #ruby
[18:44:05] karapetyan: has joined #ruby
[18:44:14] yqt: has joined #ruby
[18:45:08] blackmesa: has joined #ruby
[18:45:46] araujo: has joined #ruby
[18:45:46] araujo: has joined #ruby
[18:46:09] jhooker: has joined #ruby
[18:48:19] martxel: has joined #ruby
[18:49:02] fostertheweb: has joined #ruby
[18:49:02] atomical: has joined #ruby
[18:51:31] DanielI: has joined #ruby
[18:52:41] sn0wb1rd: has joined #ruby
[18:53:17] ruurd: has joined #ruby
[18:54:09] Swappticon: has joined #ruby
[18:55:01] pulgolino: has joined #ruby
[18:55:58] bruno-: has joined #ruby
[18:56:07] otacon-: has joined #ruby
[18:58:52] j_suth: has joined #ruby
[18:59:07] shmilan: has joined #ruby
[18:59:36] davedev24: has joined #ruby
[18:59:56] elperdut: has joined #ruby
[19:01:25] bruno-: has joined #ruby
[19:01:37] yqt: has joined #ruby
[19:01:42] sonne: has joined #ruby
[19:02:10] nofxx: has joined #ruby
[19:02:53] toertore: has joined #ruby
[19:03:45] camm1: has joined #ruby
[19:04:03] khebbie: has joined #ruby
[19:04:42] Coldblackice: has joined #ruby
[19:04:49] nofxx: need a better name for this model, the 'economic activity' of a company.... Trade ? It's a ruby model , befreo someone ot me =D
[19:05:44] jenrzzz: has joined #ruby
[19:06:19] dfockler: has joined #ruby
[19:06:36] centrx: nofxx, What are the records of 'economic activity'?
[19:06:50] bruno-: has joined #ruby
[19:07:04] nofxx: centrx, "sells computer" , "sells pizzas", "makes service x"
[19:07:17] pikajude: has joined #ruby
[19:07:39] pikajude: while trying to build ruby 2.2.2, i get to "generating transdb.h" and then my computer hangs and i have to reboot. this is on OSX 10.10
[19:07:47] pikajude: any idea why?
[19:07:48] centrx: nofxx, Transaction? Action? SalesEvent?
[19:07:57] jzigmund_: has joined #ruby
[19:07:59] nofxx: uses a government list with 2500 economic activities. You got 2500 ways to make money now days
[19:08:14] nettsundere: has joined #ruby
[19:10:04] nofxx: centrx, how it goes again? naming things and expiring caches... heh
[19:10:31] milesmatthias: has joined #ruby
[19:10:31] nofxx: Industry / Bussiness .... think gonna settle with one of those
[19:11:24] jhass: nofxx: that list surely has a title, what is it?
[19:11:51] A-ron: has joined #ruby
[19:12:18] bruno-: has joined #ruby
[19:12:23] nofxx: jhass, 'Atividades Econ?micas' , can yr anglo-saxon get my latin? ;)
[19:12:55] nofxx: adjetives to later in latin... ball red, not red ball
[19:12:59] shadoi: has joined #ruby
[19:13:17] jhass: BusinessActivity ?
[19:14:16] jhass: assuming the models purpose is to store the items of that list, not events associated to an instance of an item of the list
[19:14:28] harumph: has left #ruby: ("ERC (IRC client for Emacs 25.0.50.1)")
[19:14:31] toertore: nofxx: is it a single "transaction" or is it a description of what they do?
[19:14:42] casadei_: has joined #ruby
[19:15:01] nofxx: jhass, ty toertore descriptions
[19:15:43] morenoh149: has joined #ruby
[19:16:16] ramfjord: has joined #ruby
[19:16:47] NeverDie: has joined #ruby
[19:17:00] bahar: has joined #ruby
[19:17:46] bruno-: has joined #ruby
[19:23:29] tomchapin: has joined #ruby
[19:23:50] djbkd: has joined #ruby
[19:26:17] dotix: has joined #ruby
[19:26:17] dotix: has joined #ruby
[19:26:20] urbanmonk: has joined #ruby
[19:26:44] NeverDie: has joined #ruby
[19:29:04] shadoi: has joined #ruby
[19:30:15] jhooker: has joined #ruby
[19:31:24] vickleton: has joined #ruby
[19:34:05] jzigmund: has joined #ruby
[19:36:51] baweaver: has joined #ruby
[19:38:12] bruno-: has joined #ruby
[19:38:51] distif: has joined #ruby
[19:38:52] acke: has joined #ruby
[19:39:05] jzigmund_: has joined #ruby
[19:39:11] ruurd: has joined #ruby
[19:40:26] lxsameer: has joined #ruby
[19:40:36] krisquigley: has joined #ruby
[19:41:32] j_suth: has joined #ruby
[19:42:41] NeverDie: has joined #ruby
[19:42:43] BTRE: has joined #ruby
[19:43:17] Maletor: has joined #ruby
[19:43:39] bruno-: has joined #ruby
[19:44:06] j2p2: has joined #ruby
[19:46:18] konopka: has joined #ruby
[19:47:01] j2p2: has left #ruby: ()
[19:49:08] bruno-: has joined #ruby
[19:49:27] apt-get: has joined #ruby
[19:49:31] spacemud: has joined #ruby
[19:50:20] apt-get: has joined #ruby
[19:50:31] jackjackdripper: has joined #ruby
[19:50:57] blackjid: has joined #ruby
[19:51:18] meatherly: has joined #ruby
[19:52:08] mroark: has joined #ruby
[19:53:40] alexblom: has joined #ruby
[19:54:45] bruno-: has joined #ruby
[19:54:47] roxtrongo: has joined #ruby
[19:55:20] Xiti: has joined #ruby
[19:55:30] amclain: has joined #ruby
[19:56:03] jtdowney: has joined #ruby
[19:56:03] jtdowney: has joined #ruby
[19:56:07] gamename: has joined #ruby
[19:56:26] ruby-lang487: has joined #ruby
[19:56:38] zz_barkerd427: has joined #ruby
[19:56:50] Asher: has joined #ruby
[19:57:08] arooni: has joined #ruby
[19:57:09] arooni-mobile: has joined #ruby
[19:57:12] solocshaw: has joined #ruby
[19:58:33] platosha__: has joined #ruby
[19:58:43] baweaver: has joined #ruby
[19:59:21] urbanmonk: has joined #ruby
[20:00:32] shinnya: has joined #ruby
[20:00:54] voltalio: has joined #ruby
[20:01:46] sharkman: has joined #ruby
[20:03:22] rakm: has joined #ruby
[20:04:39] rbennacer: has joined #ruby
[20:04:57] CustosL1men: has joined #ruby
[20:05:40] bruno-: has joined #ruby
[20:05:49] khebbie: has joined #ruby
[20:06:24] NeverDie: has joined #ruby
[20:09:15] alphaatom: has joined #ruby
[20:10:06] brandon: has joined #ruby
[20:11:25] nhhagen: has joined #ruby
[20:12:12] krisquigley: has joined #ruby
[20:12:34] Stalkr_: has left #ruby: ("Linkinus - http://linkinus.com")
[20:17:22] jamesaxl: has joined #ruby
[20:17:53] pietr0: has joined #ruby
[20:18:06] SCHAAP137: has joined #ruby
[20:20:36] bubbys: has joined #ruby
[20:22:42] allomov: has joined #ruby
[20:26:13] bruno-: has joined #ruby
[20:27:39] tkuchiki: has joined #ruby
[20:27:45] dgs: has joined #ruby
[20:32:31] havenwood: has joined #ruby
[20:33:35] jeffw_: has joined #ruby
[20:33:47] jeffw_: gem install mysql2 fails
[20:34:12] jhass: jeffw_: thanks for the information I guess
[20:34:16] jeffw_: is there a proper way to get mysql support now
[20:34:29] shevy: jeffw_ gateway IRC
[20:34:30] dfockler: has joined #ruby
[20:34:31] jeffw_: that was a question not really a statement
[20:34:33] jhass: many people use it, you can probably fix it by installing something
[20:35:12] jeffw_: trying to follow https://www.digitalocean.com/community/tutorials/how-to-use-mysql-with-your-ruby-on-rails-application-on-ubuntu-14-04
[20:35:24] eam: or by sharing the error, like is it "-bash: gem: command not found" ? or something else?
[20:35:39] jhass: jeffw_: oh is this the game where you guess the error message? does it contain an e?
[20:36:03] roxtrongo: has joined #ruby
[20:36:24] jeffw_: "/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)"
[20:36:38] jhass: jeffw_: install the ruby-dev package
[20:37:16] jhass: also consider upgrading to a supported ruby version, https://www.brightbox.com/docs/ruby/ubuntu/
[20:37:18] atomical: has joined #ruby
[20:37:26] jhass: 1.9 is EOL, 2.0 will EOL in february
[20:37:58] jeffw_: ubuntu LTS 14.04 only comes with 1.9.1
[20:38:13] eam: the ruby eol schedules are never realistic
[20:38:28] jhass: eam: I think they held the announcement for 1.9
[20:38:37] jhass: jeffw_: I believe there's a ruby2.0 package but the ones I linked are better
[20:39:13] jzigmund: has joined #ruby
[20:39:59] jeffw_: ya I am not gonna install ruby from a 3rd party ppa
[20:40:28] jhass: because $reasons
[20:40:34] martxel: has left #ruby: ("Leaving")
[20:40:36] jeffw_: if I really get desperate I might just use the latest ubuntu in a virtual machine
[20:40:56] freerobby: has joined #ruby
[20:41:25] havenwood: jeffw_: The Brightbox packages are a pretty common turn-to to deal with lack of up-to-date Ubuntu Ruby packages.
[20:41:40] bruno-: has joined #ruby
[20:42:07] nettoweb: has joined #ruby
[20:42:16] A124: has joined #ruby
[20:42:26] platzhirsch: has joined #ruby
[20:42:35] havenwood: Wily for 2.2 :P
[20:42:55] havenwood: And don't forget to install: ruby2.2-dev
[20:43:03] shevy: he is in a prison
[20:43:06] firstdayonthejob: has joined #ruby
[20:43:40] havenwood: At least Vivid has 2.1.
[20:43:55] havenwood: A supported Ruby!
[20:44:55] shevy: let me ask a noob question
[20:44:58] shevy: big arrays will slow my ruby programs down?
[20:45:07] apeiros: shevy: define "big"
[20:45:24] havenwood: shevy: If the Array is infinite you'll never get to the end. Not ever.
[20:45:25] shevy: yeah that is one problem
[20:45:28] apeiros: and no, a big array per se will not slow down your program
[20:45:51] paulcsmith: has joined #ruby
[20:46:05] shevy: I was having fun with Readline and setting a completion proc
[20:46:06] apeiros: a big array which has to be swapped out due to its size but you access swapped out parts frequently - yes, that will slow down your app. a lot.
[20:46:09] hoylemd: To all the folks who chimed in re: my data structure method length issue: Thanks for the input! My team is a little averse to disabling cops willy-nilly, but there has been talk of loosening the method length metric to 20 lines. Another option to consider would be having a fixture generator module that has module-specific rubocop exceptions.
[20:46:32] shevy: the array that I was using had less than 20.000 entries, but they actually were calculated/done anew whenever someone presses enter
[20:46:40] apeiros: but that's not really a problem of array. it's more a problem of not having enough ram or not organizing your data well enough to fit into available ram
[20:46:46] eam: bigger datasets generally means slower programs
[20:46:53] pagios: has joined #ruby
[20:47:03] pagios: when should i use ruby on rails and when should i use sinatra? thanks
[20:47:08] eam: whether due to lack of memory, or just doing more work when traversing it
[20:47:10] bruno-: has joined #ruby
[20:47:19] mwlang: What exactly is a ???Backend??? on I18n?
[20:47:23] havenwood: pagios: Use Rails when it's a Basecamp clone and use Sinatra when it's Hello, World!
[20:47:42] apeiros: mwlang: the thing which retrieves a value for a key
[20:47:46] mwlang: For example: ???I18n.backend = I18n::Backend::Chain.new(I18n::Backend::ActiveRecord.new, I18n.backend)???
[20:47:46] shevy: havenwood is in a good mood again :)
[20:47:47] pagios: havenwood: sql goes well with rails?
[20:47:54] BraddPitt: yes, very pagios
[20:47:54] apeiros: mwlang: standard would be the yaml based backend
[20:48:01] jeffw_: if you really want a laugh on CentOS 6.6 Final I have
[20:48:02] jeffw_: ruby 1.8.7 (2013-06-27 patchlevel 374) [x86_64-linux]
[20:48:16] jeffw_: because CentOS likes to "backport"
[20:48:19] havenwood: pagios: SQL goes with SQL databases. Rails and Sinatra are both most often used with SQL of one sort or another.
[20:48:19] apeiros: pagios: rails is over in #rubyonrails
[20:48:20] mwlang: So, if I wanted to add a new lookup mechanism to Rails, I???d just chain up a new backend?
[20:48:36] apeiros: mwlang: that too sounds like #rubyonrails
[20:48:59] havenwood: pagios: Sinatra, unlike Rails, doesn't have a SQL toolkit baked in. Popular choices are to use ActiveRecord from Rails or the very nice Sequel gem.
[20:48:59] ytti: [ytti@ytti.fi ~]% time ruby -e 'Array.new 200_000_000'
[20:48:59] ytti: ruby -e 'Array.new 200_000_000' 0.21s user 1.55s system 55% cpu 3.176 total
[20:48:59] ytti: [ytti@ytti.fi ~]% time ruby -e 'Array.new 100_000_000'
[20:48:59] ytti: ruby -e 'Array.new 100_000_000' 0.13s user 0.24s system 95% cpu 0.383 total
[20:48:59] ytti: [ytti@ytti.fi ~]% time ruby -e 'Array.new 1_000_000'
[20:49:02] ytti: ruby -e 'Array.new 1_000_000' 0.03s user 0.00s system 96% cpu 0.037 total
[20:49:09] havenwood: ytti: Mah eyes!
[20:49:19] apeiros: ACTION hands havenwood some bleach
[20:49:21] ytti: i have cheap bleach for sale
[20:49:26] mwlang: apeiros: heh???it feels more directly ruby to me???not exactly trying to tie into Rails so much as the I18n framework.
[20:49:39] alphaatom: has joined #ruby
[20:49:40] apeiros: mwlang: i18n is part of rails
[20:49:43] beast: has left #ruby: ("Leaving")
[20:49:48] havenwood: pagios: https://github.com/jeremyevans/sequel#readme
[20:49:57] apeiros: at least the one you're discussing
[20:49:59] pagios: so a typical platform would contain js/ajax/htmlcss talking to a website which has a backend gateway being rails and rails talking to sql, is this the correct way to start building a platform? like fb twitter etc?
[20:50:06] dman777_alter: has joined #ruby
[20:50:17] dman777_alter: what is the best way to say details = "#{response['name']}:\n#{response['content']}" if "#{response['key']}:\n#{response['value']}" does not exist??
[20:50:21] mwlang: apeiros: had no idea i18n belonged to the Rails effort!
[20:50:22] pagios: flexible enough and scalable enough
[20:50:26] baweaver: don't cross post dman777_alter
[20:50:31] havenwood: pagios: The maintainer of Sequel also created a very fine Rack adapter that would be an alternative to Sinatra: http://roda.jeremyevans.net
[20:50:54] urbanmonk: has joined #ruby
[20:51:16] havenwood: pagios: I'd recommend creating a very simple, vanilla Rack app. Then port it to Roda and try some Roda plugins. Then try a Rails app.
[20:51:23] eam: ytti: time ruby -e'([1] * 1_000_000).reject! {true}' # great example of simple things getting slow with size
[20:51:34] pagios: havenwood: but is my logic correct?
[20:51:47] pagios: is thera anything in between these entities for improving performance etc?
[20:52:16] eam: reject! is O(n^2) on most rubies :(
[20:52:35] bruno-: has joined #ruby
[20:52:36] havenwood: pagios: Yeah, Twitter's frontend is still Rails. Rails comes with conventions for all of the above and security measures in place, etc. Roda on the other hand starts with just a router and you add plugins to build the framework you need for the given task.
[20:52:45] apeiros: eam: what?
[20:52:51] eam: apeiros: sup
[20:52:57] apeiros: 22:52 eam: reject! is O(n^2) on most rubies :(
[20:53:05] apeiros: that??? sounds wrong?
[20:53:24] eam: it's because it shifts the entire array every rejection (as opposed to reject which is O(n))
[20:53:25] senayar: has joined #ruby
[20:53:25] senayar: has joined #ruby
[20:53:27] apeiros: at least for both Array and Hash I don't see why it would have to be
[20:53:48] pagios: do you guys recommend any book for startups? i need to know how startups are building their infrastructures nowadays
[20:53:52] eam: I think it's getting changed (in which case it would be O(n) but potentially invalid during iteration)
[20:53:54] northfurr: has joined #ruby
[20:53:59] apeiros: eam: code says it creates a new array
[20:54:08] eam: apeiros: reject does, reject! doesn't
[20:54:09] apeiros: looked at reject, not reject!
[20:54:26] eam: 2x memory or O(n^2) pick your poison
[20:54:39] apeiros: 2x memory is usually the better pick
[20:54:49] Pupeno: has joined #ruby
[20:55:25] eam: (and I think reject! may be changing to simply leave self in an invalid state during iteration, so it'll be fast/small but not "correct")
[20:55:32] apeiros: and even without 2x memory you can do it in O(n)
[20:55:49] apeiros: you keep a shift-count and move every item. you can optimize to use memcpy by figuring slices.
[20:56:15] eam: right - but then accesses to the object during the iteration will see ... stuff
[20:56:33] eam: which is an ok concession probably
[20:56:35] new_user: has joined #ruby
[20:56:41] apeiros: again, choose your poison
[20:56:42] ellisTAA: has joined #ruby
[20:56:50] eam: yeah, right answer imo
[20:56:52] apeiros: either "see stuff" or "be locked out"
[20:56:59] karapetyan: has joined #ruby
[20:57:00] havenwood: pagios: Microservices. Monolith. No, Microservices.
[20:57:03] apeiros: personally I prefer "locked out"
[20:57:10] baweaver: If you get to a point where that's _actually_ an issue, ruby might not be the best idea.
[20:57:12] apeiros: "see stuff" is IMO never a good choice :-/
[20:57:16] arooni-mobile: has left #ruby: ("Leaving")
[20:57:26] pagios: havenwood: what do you mean
[20:57:39] havenwood: pagios: Here's a Ruby Rogues episode on Roda: https://devchat.tv/ruby-rogues/210-rr-roda-and-routing-trees-with-jeremy-evans
[20:58:01] havenwood: pagios: And here's a Ruby Rogues episode on Rails: https://devchat.tv/ruby-rogues/222-rr-rails-5-with-sean-griffin
[20:58:02] bruno-: has joined #ruby
[20:58:07] baweaver: havenwood: are the rogues still at it? (suppose I could ping avdi as well here)
[20:58:11] new_user: Ugh. when you have array's within array's, a matrix, and you need to call on array[index[index2]] is there a command for that? Because that isnt working as is.
[20:58:23] havenwood: baweaver: Sure are, lots of episodes lately but fewer hosts per episode.
[20:58:47] apeiros: eam: I wonder whether they could use their existing COW infrastructure to only update the "visible" array upon actual access
[20:58:55] baweaver: >> [[1]][0][0] # new_user
[20:58:56] ruboto: baweaver # => 1 (https://eval.in/431995)
[20:59:09] new_user: Looking now
[20:59:13] havenwood: pagios: I'd suggest listening to those for some context. Then create a plain, simple Rack app. Port it to Roda. Look at Roda plugins. Then go through a Rails book like R4IA.
[20:59:39] paulcsmith: has joined #ruby
[20:59:41] havenwood: ACTION is going through R4IA
[20:59:56] baweaver: new_user: your above code tries to run an index on a number
[21:00:00] new_user: baweaver seems I'm still not far enough along in this code to understand what's even happening there.
[21:00:16] umgrosscol: has joined #ruby
[21:00:28] Hrorek: has joined #ruby
[21:00:29] baweaver: >> [[1,2,3,4], [5,6,7,8]][0]
[21:00:30] ruboto: baweaver # => [1, 2, 3, 4] (https://eval.in/431997)
[21:00:39] baweaver: that gets the first position of a matrix, as it were
[21:00:47] baweaver: which returns a row, which is another array
[21:00:50] havenwood: pagios: Here are an assortment of Hello, World!s in various Rack adapters. Take a look at the Rack, Sinatra and Roda ones: https://github.com/luislavena/bench-micro/tree/master/apps
[21:00:59] pagios: havenwood: i am readin this http://blog.erlware.org/monolith-vs-microservices-where-to-start/
[21:01:03] baweaver: to get an element of that array you need to pull another index.
[21:01:24] havenwood: pagios: Good, those are good things to think about.
[21:01:31] shmilan: has joined #ruby
[21:02:12] tejasmanohar: has joined #ruby
[21:02:41] mwlang: heh???insteresting seeing that rails.ru rackup.
[21:02:41] bricker: Is there any language where you can say "return this at the end of the method: { ... }", and then do other stuff? I know Go has "defer" but it's not quite what I mean.
[21:02:42] pagios: havenwood: whats an example of Monolith vs microservices?
[21:03:06] baweaver: bricker: tap or returning?
[21:03:15] new_user: basically, the only way for me to do it without the $ rescue /raise because I'm trying to build on the code that I know already--before finding shortcuts. I'll have to go... row1 = array[index] and then row1[index2]
[21:03:17] baweaver: Normally known as a K Combinator
[21:03:48] soulcake: has joined #ruby
[21:04:39] bricker: baweaver: I mean in the context of a function, like this: https://gist.github.com/bricker/199d627b91501c23c773 so you don't have to set a variable
[21:04:48] mwlang: pagios: monolith just means a framework that provides everything you could possibly think you might need. microservices are the opposite extremes???just enough is provided to get you working efficiently.
[21:05:00] soulcake: has joined #ruby
[21:05:04] oetjenj: has joined #ruby
[21:05:11] pagios: mwlang: yea but like concrete examples
[21:05:51] platzhirsch: bricker: like a callback?
[21:06:09] bricker: platzhirsch: no, just a compiler feature I guess
[21:06:15] mwlang: rails is monolith. rack is micro. rails is actually built on top of rack if that means anything to you.
[21:06:25] platzhirsch: bricker: or maybe something like the guarantee block in a try catch
[21:06:27] vF3hNGxc47h8: has joined #ruby
[21:06:31] platzhirsch: ensure in ruby
[21:06:37] bricker: nah that's not what I mean
[21:06:47] bricker: doesn't matter, just curious really
[21:06:51] nofxx: there was a nice pastie thing which runs the code, anyone knows?
[21:06:52] AntKnee: has joined #ruby
[21:07:03] havenwood: pagios: Since I'm pointing you at Ruby Rogues, here's an episode where that is discussed: https://devchat.tv/ruby-rogues/170-rr-padrino-with-dario-cravero-nathan-esquenazi-arthur-chiu
[21:07:21] havenwood: pagios: You're also on the right track with Martin Fowler related discussions. Read on.
[21:07:35] nofxx: jsfiddle for ruby*
[21:07:36] eam: apeiros: doubt it, since reject! is the W in COW :)
[21:07:41] jeffw_: is there a good gui to manage + install + uninstall ruby gems?
[21:07:46] apeiros: eam: not meant like that
[21:07:46] new_user: Alright, I have another question. But first I need to know how you guys hosted those post on repl.it
[21:07:50] chouhoulis: has joined #ruby
[21:07:56] platzhirsch: is that Sinatra gone mad?
[21:08:05] new_user: Anyone give me a quick walkthrough how to make and get the url form this site?
[21:08:25] bruno-: has joined #ruby
[21:08:36] apeiros: eam: the idea is basically: other parties accessing during reject! would see stuff, but when they perform a lookup, it is blocked, the array is updated, and after that, it can access it
[21:08:52] toertore: pagios, mwlang monolith usually refers to how an application is architectured; a monolith is a single app that does everything and everything is very coupled together; "microservices" is an alternative approach where you have several apps that do one or a few things each
[21:09:02] apeiros: and the COW infrastructure afaik already deals with different parties accessing an array/hash
[21:09:03] toertore: you can make small rails apps
[21:09:09] shevy: has joined #ruby
[21:09:10] eam: yeah, I think you'd need a copy of the array (or some other similarly invasive approach in terms of size/speed)
[21:09:19] pagios: microservices communicate via what protocols usually?
[21:09:21] mwlang: for me, when I build a complex website, I???ll build with Rails because I often hire other developers to work on it???Rails is well known, well documented, and follows a set convention for the most part, so it???s easy to find developers that can help. But dirt simple websites, I???ll build with Sinatra or something else because they???re small, efficient, and have enough meat to build something rapidly.
[21:09:31] dgutierrez1287: has joined #ruby
[21:09:34] toertore: pagios: doesn't matter, could be http
[21:09:43] Pupeno: has joined #ruby
[21:09:43] FernandoBasso: has joined #ruby
[21:10:06] mwlang: toertore: I knew I was missing something there???I was transliterating microframework with microservices. *doh*
[21:10:20] shevy: ytti hmmm... why take the smaller arrays more cpu time than the larger 200 milion variant?
[21:10:45] camm1: has left #ruby: ()
[21:11:13] urbanmonk: has joined #ruby
[21:11:35] pagios: can rails replace apache btw?
[21:11:55] baweaver: has joined #ruby
[21:12:01] eam: pagios: rails is an application framework, you could run it using apache
[21:12:21] new_user: Figured that out. The QUESTION#2 https://eval.in/432008 <-- can anyone tell me why the array in this is being destroyed by the method?
[21:13:13] pagios: eam: so users would go to apache and then apache would direct traffic to rails
[21:13:50] apeiros: new_user: stack = arr # this does not copy the array
[21:14:03] apeiros: new_user: stack will refer to the *same* array object as arr
[21:14:26] apeiros: you want `stack = arr.dup`, which actually copies the array (and only the array, it's not a deep copy)
[21:14:30] new_user: Okay that makes sense
[21:14:47] new_user: a deep copy?
[21:14:51] Ray`: has joined #ruby
[21:14:57] n20420: has joined #ruby
[21:15:00] eam: nested arrays
[21:15:09] apeiros: >> ary = ["some string"]; other = ary.dup; other[0].upcase!; arr
[21:15:10] ruboto: apeiros # => undefined local variable or method `arr' for main:Object (NameError) ...check link for more (https://eval.in/432011)
[21:15:13] apeiros: >> ary = ["some string"]; other = ary.dup; other[0].upcase!; ary
[21:15:13] n20420: hello everyone
[21:15:14] ruboto: apeiros # => ["SOME STRING"] (https://eval.in/432012)
[21:15:18] apeiros: new_user: ^
[21:15:35] apeiros: "some string" in both `other` and `ary` are the same object
[21:15:41] apeiros: it was not copied.
[21:15:42] eam: "copy this" vs "copy this and everything under this"
[21:16:06] Pupeno: has joined #ruby
[21:16:12] n20420: has left #ruby: ()
[21:17:23] apeiros: >> ary = ["some string"]; other = ary.dup; other[0].upcase!; other.pop; ary # maybe even better example - shows that the array was copied (ary still contains the string)
[21:17:23] ruboto: apeiros # => ["SOME STRING"] (https://eval.in/432014)
[21:17:25] shevy: eam does perl6 entice you?
[21:18:46] bruno-: has joined #ruby
[21:19:37] mwlang: has joined #ruby
[21:19:43] karapetyan: has joined #ruby
[21:22:23] karapetyan: has joined #ruby
[21:23:34] firstdayonthejob: has joined #ruby
[21:24:09] bruno-_: has joined #ruby
[21:24:29] eam: shevy: nope
[21:24:59] ytti: shevy, just over time
[21:25:04] ytti: shevy, the small don't have to wait for IO
[21:25:05] Hrorek: has joined #ruby
[21:25:10] ytti: shevy, so CPU gets to work lot
[21:25:24] ytti: shevy, the larger ones get some downtime due to I/O wait and average CPU use goes down
[21:25:56] danman: has joined #ruby
[21:26:08] yfeldblum: has joined #ruby
[21:26:56] Synthead: has joined #ruby
[21:28:08] Rurik: has joined #ruby
[21:28:11] mleung: has joined #ruby
[21:29:43] Musashi007: has joined #ruby
[21:29:58] bruno-_: has joined #ruby
[21:30:14] finisherr: has joined #ruby
[21:32:12] NeverDie: has joined #ruby
[21:34:07] jenrzzz: has joined #ruby
[21:35:27] shevy: adaedra! you are back!
[21:35:38] adaedra: I was never far away
[21:36:07] adaedra: If you're talking about my temporary nick, blame apeiros
[21:36:27] apeiros: I didn't not do nothing!
[21:36:29] platzhirsch: We thought you were dead
[21:36:39] eam: I'm still not sure you're not dead
[21:37:03] eam: are ... are you a ghost?
[21:37:23] apeiros: they're a daedra. nuff said.
[21:37:25] shevy: he was undead
[21:37:38] platzhirsch: Fear the Walking Dead
[21:37:43] platzhirsch: that's what I have to say about that
[21:37:47] shevy: fear the roaming platzhirsch!
[21:37:48] eam: "undead" is weird because everyone agrees undead are actually dead
[21:37:55] platzhirsch: ACTION bells
[21:38:18] baweaver: We have ways of dealin' with zombies
[21:38:21] baweaver: ACTION shines hammer
[21:38:26] charliesome: has joined #ruby
[21:38:28] shevy: they will hide in threads
[21:38:32] platzhirsch: Where's yorickpeterse
[21:38:51] timonv: has joined #ruby
[21:38:58] platzhirsch: Dude, we need your holy XML parser Oga to defeat the zombies
[21:39:16] DmitryBochkarev: has joined #ruby
[21:39:40] ytti: exec summary, how is it better tha nokogiri, not challenging, just curious
[21:39:45] Pupeno: has joined #ruby
[21:39:58] adaedra: apeiros: you're the one who give the name!
[21:40:04] eam: well for one it's newer
[21:40:07] platzhirsch: better than nokogiri? There's something better than nokogiri?
[21:40:09] adaedra: ugh, english,
[21:40:24] apeiros: adaedra: what? I didn't name you adaedra!
[21:40:29] adaedra: eam: I'm dead on the inside
[21:40:37] adaedra: apeiros: no, dogedra
[21:40:40] kadoppe: has joined #ruby
[21:45:40] bootstrappm: has joined #ruby
[21:46:29] mwlang: what???s the most efficient way to remove ???.foo??? from this string (???foo??? can be any valid model name): ???activerecord.attributes.foo.login" => ???activerecord.attributes.login???
[21:46:52] adaedra: ['.foo'] = ''
[21:47:47] eam: unless there's another element called .foobar.
[21:48:19] baweaver: string.sub(/\.#{ActiveRecord::Base.descendants.map(&:class_name).join('|')}/,'')
[21:48:25] baweaver: I think it was class_name
[21:48:43] baweaver: Ah, parens around it, sloppy me
[21:48:48] xblade: has joined #ruby
[21:49:05] mwlang: baweaver: so basically depend on all the model names and construct a regexp from them?
[21:49:21] baweaver: as far as a fast solution
[21:49:35] baweaver: either that or look for things that'll be constant for a regex
[21:49:56] mwlang: I was thinking split on dot, delete 3rd element, rejoin with dot.
[21:49:57] adaedra: ['.foo.'] = '.'
[21:49:58] NeverDie: has joined #ruby
[21:50:24] bruno-_: has joined #ruby
[21:50:34] baweaver: just make sure to use non-greedy if you go regex
[21:50:37] baweaver: otherwise extra fun
[21:50:55] nettoweb: has joined #ruby
[21:52:08] ytti: fun fact, non-greedy regex is stricly speaking not regular expression
[21:52:17] ytti: same as positive/negative look ahead/behind
[21:52:31] ytti: proper regular expression scales extremely well
[21:52:42] mwlang: actually, since I know the ???prefix??? I want to operate will always be ???activerecord.attributes???, perhaps: "activerecord.attributes.#{a.split('.').last}" (where a = "activerecord.attributes.foo.login"
[21:52:48] juanpablo_: has joined #ruby
[21:52:52] malconis: has joined #ruby
[21:52:52] ytti: but these enchanced engines which support uhh, unregular expressions, can scale terribly
[21:53:06] adaedra: ah, I think I see
[21:53:33] ytti: (good url, i think i posted it earlier - https://swtch.com/~rsc/regexp/regexp1.html)
[21:53:40] mooe: has joined #ruby
[21:53:41] northfurr: has joined #ruby
[21:53:42] ytti: i had used regexps for > decade before reading that few years ago
[21:53:46] ytti: and it was eye opening
[21:54:52] mwlang: hasn???t Ruby replaced it???s RegExp algo with the faster approach by now?
[21:55:28] adaedra: >> "activerecord.attributes.foo.login".gsub(/\A(activerecord\.attributes)\.(?:[.]+\.)([^.]+)\z/, '\1.\2')
[21:55:29] ruboto: adaedra # => "activerecord.attributes.foo.login" (https://eval.in/432020)
[21:55:37] adaedra: !flip_taple
[21:55:58] adaedra: wait, what did I even wrote
[21:56:15] cek: has joined #ruby
[21:56:32] cek: How do you invoke a byebug debugger from withing ruby program?
[21:56:40] cek: "debugger" doesn't work
[21:56:41] dgs: has joined #ruby
[21:56:52] jhass: cek: I just use pry + pry-byebug
[21:57:01] mwlang: adaedra: is regexp even going to be faster than: "activerecord.attributes.#{a.split('.').last}" if a =~ /^activerecord.attributes/
[21:57:02] jhass: and then require "pry"; binding.pry
[21:57:14] adaedra: a.start_with?
[21:57:21] leafybasil: has joined #ruby
[21:57:44] ytti: mwlang, the point is, the features ruby offers make regular expression non regular
[21:57:47] ytti: mwlang, academically speaking
[21:58:05] ytti: mwlang, which are /impossible/ to scale to same performance as proper regular expression
[21:58:26] workmad3: has joined #ruby
[21:58:27] cek: ouch, actually, it worked. It just doesn't stop on debugger but the line after that, so if debugger is the last line, nowhere to stop
[21:58:33] ytti: mwlang, however, this will mostly be academic issue, as the poor scalability will only occur in somewhat constructed examples
[21:58:40] adaedra: mwlang: but otherwise, your solution should be ok
[21:59:14] ytti: mwlang, read the article when you have time, it's quite interesting
[21:59:23] mwlang: adaedra: I forgot about start_with? nice change there: "activerecord.attributes.#{a.split('.').last}" if a.start_with? "activerecord.attributes"
[21:59:54] karapetyan: shevy: dat fucking rabbits killing me)
[22:00:08] mwlang: ACTION almost flunked finite automata class. :-o
[22:00:33] mblagden_: has joined #ruby
[22:00:48] jamesaxl|2: has joined #ruby
[22:00:52] bruno-: has joined #ruby
[22:01:48] ytti: mwlang, pfft, i'm completely uneducated, that article does not require science background
[22:02:08] ytti: i applaud to the author, i know i'm not able to explain complex issues in that clarity
[22:02:16] ytti: to someone who has no clue of the subject, i'm useless
[22:02:35] xcesariox: has joined #ruby
[22:03:50] ordepdev: has joined #ruby
[22:04:32] zenspider: more rabbits? did I miss something?
[22:04:47] TheHodge: has joined #ruby
[22:05:18] mwlang: ytti: I am still reading it???roughly halfway through. Well written, but definitely brings back memories, too.
[22:06:33] cek: has left #ruby: ()
[22:06:52] mroark: has left #ruby: ()
[22:07:00] Vile`: has joined #ruby
[22:07:11] jxv: has joined #ruby
[22:07:38] khebbie: has joined #ruby
[22:09:50] Musashi007: has joined #ruby
[22:11:01] deject3d: has joined #ruby
[22:11:20] bruno-: has joined #ruby
[22:12:07] mleung: has joined #ruby
[22:14:03] dotix: has joined #ruby
[22:14:03] dotix: has joined #ruby
[22:15:25] baweaver: has joined #ruby
[22:15:28] DmitryBochkarev: has joined #ruby
[22:16:46] r_baron: has joined #ruby
[22:17:29] charliesome: has joined #ruby
[22:17:48] pikajude: has left #ruby: ("bye")
[22:19:48] sufyan: has joined #ruby
[22:20:00] failshell: has joined #ruby
[22:20:10] firstdayonthejob: has joined #ruby
[22:21:46] bruno-: has joined #ruby
[22:23:17] andyduf: has joined #ruby
[22:25:20] andyduf: I am facing an issue with rvm. A gem that I installed in global gemset is not available in other gemsets.
[22:25:33] andyduf: I have posted in detail at stackoverflow http://stackoverflow.com/q/32529350/177116
[22:25:52] andyduf: Any idea what's causing this issue?
[22:27:05] Prawnzy: has joined #ruby
[22:27:40] jdawgaz: has joined #ruby
[22:27:40] finisherr: has joined #ruby
[22:28:20] elperdut: has joined #ruby
[22:29:08] gamename: has joined #ruby
[22:31:01] mary5030_: has joined #ruby
[22:31:36] NeverDie: has joined #ruby
[22:31:50] zenspider: bropages? *sigh*
[22:32:01] workmad3: has joined #ruby
[22:32:14] bruno-: has joined #ruby
[22:32:33] s00pcan: has joined #ruby
[22:36:26] bmurt: has joined #ruby
[22:37:52] roxtrongo: has joined #ruby
[22:40:26] firstdayonthejob: has joined #ruby
[22:41:04] workmad3_: has joined #ruby
[22:42:18] andyduf: has joined #ruby
[22:42:28] michael_mbp: has joined #ruby
[22:42:41] andyduf: zenspider anything wrong with bropages? Care to elaborate?
[22:45:02] moredhel: has joined #ruby
[22:47:16] senayar: has joined #ruby
[22:47:40] ngscheurich: has joined #ruby
[22:49:59] rbennacer: has joined #ruby
[22:52:33] centrx: guys bropages zenspider andyduf
[22:54:22] mary5030: has joined #ruby
[22:56:12] juanpablo_: has joined #ruby
[22:59:17] Azure: has joined #ruby
[22:59:59] _aeris_: has joined #ruby
[23:00:00] andyduf: has left #ruby: ()
[23:01:51] jenrzzz_: has joined #ruby
[23:02:05] zipace: has joined #ruby
[23:03:06] zenguy_pc: has joined #ruby
[23:04:16] ekain: has joined #ruby
[23:04:29] symm-: has joined #ruby
[23:05:14] Liam-: has joined #ruby
[23:05:16] [spoiler]: has joined #ruby
[23:05:23] paulcsmith: has joined #ruby
[23:05:23] banjara: has joined #ruby
[23:05:28] sdothum: has joined #ruby
[23:05:37] northfurr_: has joined #ruby
[23:06:00] lipoqil: has joined #ruby
[23:06:04] twistedpixels: has joined #ruby
[23:06:08] dbussink: has joined #ruby
[23:06:13] Freeaqingme: has joined #ruby
[23:06:14] levifig: has joined #ruby
[23:06:19] jeregrine: has joined #ruby
[23:06:40] platzhirsch: http://imgur.com/gallery/qgcN9KQ
[23:06:42] tcopeland: has joined #ruby
[23:07:14] charliesome: has joined #ruby
[23:07:37] HashNuke: has joined #ruby
[23:07:48] AdamMeghji: has joined #ruby
[23:08:06] jxf: has joined #ruby
[23:08:14] culturelabs: has joined #ruby
[23:09:13] Yzguy: has joined #ruby
[23:09:40] lacrosse: has joined #ruby
[23:09:44] neektza: has joined #ruby
[23:09:47] im0b: has joined #ruby
[23:13:25] zenguy_pc: has joined #ruby
[23:15:48] failshell: has joined #ruby
[23:16:07] BraddPitt: when writing a no-arg method, do you include parens?
[23:16:12] BraddPitt: Also same question for calling a no-method arg
[23:17:00] mooe: is this the best channel to ask for feedback on first gem?
[23:17:48] mooe: cool, https://github.com/justinjensen/tripcode
[23:18:49] ordepdev: has joined #ruby
[23:19:05] Coldblackice: has joined #ruby
[23:19:43] bmurt: has joined #ruby
[23:19:51] atomical: has joined #ruby
[23:20:41] zenguy_pc: has joined #ruby
[23:21:01] yorickpeterse: platzhirsch: hat?
[23:21:05] shevy: BraddPitt nah, in this case paren would be superfluous
[23:21:36] shevy: tis not be python!
[23:21:52] BraddPitt: mooe is that an ssh public key as the seed?
[23:21:58] Zai00: has joined #ruby
[23:21:59] BraddPitt: thanks shevy just didn't know protocol
[23:22:20] laphlaw: has joined #ruby
[23:22:41] mooe: It's a key that used to be used by 4chan, not sure how it was created originally
[23:23:28] platzhirsch: yorickpeterse: too late
[23:23:32] platzhirsch: your Oga hammer was required
[23:25:36] Zai00: has joined #ruby
[23:26:19] BraddPitt: are you looking for any particular feedback, mooe ?
[23:26:25] shevy: Yoga hammer?
[23:26:47] dopamean_: has joined #ruby
[23:26:47] shevy: hammer people into being able to do overstretched splits!
[23:27:36] mooe: BraddPitt, I was going to ask f there's a better way to store the seed, and any other general feedback
[23:28:04] laphlaw: Can someone help me out with parsing a string in JSON.. its not making sense to me!
[23:28:07] laphlaw: https://gist.github.com/anonymous/b82c584635e636150ca3/raw/320dd70734ce99b9e35ae064ad3a1c307a7faee0/gistfile1.txt
[23:28:24] paulcsmith: has joined #ruby
[23:28:26] mooe: braddpitt: its also my first time really using tests
[23:28:31] solocshaw1: has joined #ruby
[23:28:46] shevy: are you sure this is valid laphlaw
[23:28:47] elperdut: has joined #ruby
[23:29:15] failshell: has joined #ruby
[23:31:38] failshell: has joined #ruby
[23:34:01] yorickpeterse: platzhirsch: eh?
[23:34:07] platzhirsch: go back to sleep
[23:34:21] yorickpeterse: I don't think XML parsers will help with that
[23:34:24] kies^: has joined #ruby
[23:34:30] platzhirsch: yes, it's a Viking tool
[23:34:50] yorickpeterse: I think RVM will be more useful in getting rid of the zombies ???(???)???
[23:38:37] David27: has joined #ruby
[23:40:15] toretore: has joined #ruby
[23:41:48] failshell: has joined #ruby
[23:44:10] Pupeno: has joined #ruby
[23:44:57] weemsledeux: has joined #ruby
[23:45:04] dgs: has joined #ruby
[23:45:44] bdfhjv: has joined #ruby
[23:49:47] roxtrongo: has joined #ruby
[23:50:16] n_blownapart: has joined #ruby
[23:53:40] Yzguy: has joined #ruby
[23:54:35] bb010g: has joined #ruby
[23:55:58] NeverDie: has joined #ruby
[23:56:26] shmilan: has joined #ruby
[23:56:27] juanpablo_: has joined #ruby
[23:56:29] sepp2k: has joined #ruby