Activity Graph

Page 1 of 1


[14:18:30] pushcx: has joined #RubyOnRails
[14:19:21] pushcx: Is there any way to add to the columns selected by a query? .select() replaces them so scopes can't compose. I can't find any activerecord/arel docs of select, though it seems like it might be possible by really digging deep into arel internals.
[15:01:36] pushcx: *.net *.split
[15:03:08] pushcx: has joined #RubyOnRails
[16:30:40] pushcx: has left #RubyOnRails: ()


[16:28:03] pushcx: has joined #RubyOnRails
[16:29:26] pushcx: Is there a way to add to a scope's select clause rather than replace it? scope.select('foo as bar') without having to say .select('model.*, foo as bar')?
[20:20:35] pushcx: has left #RubyOnRails: ()


[14:06:41] pushcx: DoXiD: Run 'bundle install' and copy the directory bundle installs to over to your other computer. This won't work if the gems have compiled native code, though.
[14:07:28] pushcx: DoXiD: 'bundle install --deployment' might also be useful: http://bundler.io/v1.11/man/bundle-install.1.html
[14:10:36] pushcx: havenwood: That's an even better answer I was unaware of, and I expect it would work with native code. Thanks!
[14:19:46] pushcx: has left #ruby: ()


[17:12:10] pushcx: the cubehelix color scheme is a good way to do gradients: https://www.mrao.cam.ac.uk/~dag/CUBEHELIX/
[17:12:50] pushcx: humans are more sensitive to green than red and especially blue, so if you just linearly ramp over all three your colors will not be accurately understood


[02:23:50] pushcx: Ping timeout: 248 seconds


[12:55:18] pushcx: has joined #ruby
[21:30:11] pushcx: Changing host
[21:30:12] pushcx: has joined #ruby


[22:08:23] pushcx: Ping timeout: 276 seconds
[22:08:29] pushcx: has joined #ruby


[18:27:22] pushcx: *.net *.split
[18:27:27] pushcx: has joined #ruby


[16:11:00] pushcx: 'gem' is the basic user command for adding and removing libraries
[16:11:24] pushcx: 'bundler' is a higher-level tool for projects that need to consistently install specific versions


[12:41:04] pushcx: No, because Ruby wouldn't know if you wanted to set the value to ':one' or the value of the ':one' key.
[15:15:34] pushcx: Watch out for 'zipruby' from that era, it has a case sensitivity bug that can destroy data.


[14:15:09] pushcx: platzhirsch: can a child transaction have a child transaction?
[14:29:36] pushcx: platzhirsch: transactionss.flat_map { |t| transactions << t.parent if t; t }.uniq.compact.inject(0) { |total, t| total + t.amount }
[14:30:00] pushcx: (assuming transactions is an array with child transactions... and you don't care about anyone ever understanding it)
[14:35:04] pushcx: traversing your objects when you have to half-ass it because you can't express them monoidally?
[14:42:50] pushcx: platzhirsch: how deeply do you expect to nest transactions?
[14:49:00] pushcx: platzhirsch: Here's how I'd do it without blowing the stack or building up an extra data structure of all transactions: https://gist.github.com/pushcx/685dc83de087e137bf85
[14:49:46] pushcx: It says 'ary', but really, it'll work on any collection that exposes `.each`
[14:50:27] pushcx: platzhirsch: Fun little puzzle, thanks for sharing it. :)
[14:53:28] pushcx: There's one of my favorite recursion tricks in there, btw. By making the test amounts powers of two, I get more info out of failures because every response is unique. First run I got 12 and it obviously meant I hadn't recursed up the parent chain...
[15:08:32] pushcx: I bet CodeAcademy will teach you more comments in a later lesson.


[17:37:23] pushcx: EdwardIII: Some of them provide different functionality, like Array(2) vs Array.new(2)
[17:41:52] pushcx: EdwardIII: Ruby makes a subtle distinction between "things that can be converted" and "things that pretty much are" in the difference between to_s and to_str, to_a and to_ary.
[17:58:28] pushcx: He wanted attention, so I figured ignoring him completely would annoy him most. :)


[20:51:08] pushcx: floatingpoint: Can't you pick a fight about something interesting instead?
[21:04:00] pushcx: Sounds like a great use for Ruby.
[21:04:49] pushcx: Sounds like you want to check ARGV or use `gets`
[21:05:29] pushcx: cluster = gets.chomp.to_i
[22:12:31] pushcx: yqfvwal: in irb it's waiting for the 'end' to throw the error


[15:14:14] pushcx: ysz: There is no official binary for Windows, but Ruby Installer is recommended: http://rubyinstaller.org/downloads/
[15:14:36] pushcx: They don't yet have a 2.3 installer because the volunteer who maintains it was in a car accident: https://github.com/oneclick/rubyinstaller/issues/300


[00:25:41] pushcx: pizzaops: i recently maintained a site using a SOAP API via Savon. It was... less awful than other approaches?
[00:30:27] pushcx: User1234: Linux or OS X?
[00:31:15] pushcx: shevy: he has mkmf installed
[00:31:45] pushcx: User1234: You need to install the ruby header files... on Debian it's called ruby-dev, let me see if I can find the fedora name.
[00:32:11] pushcx: User1234: yum install ruby-devel
[00:32:32] pushcx: User1234: I think that should solve that error for you
[00:33:06] pushcx: User1234: Great, good luck. :)
[00:36:13] pushcx: If you're new to Ruby, Sinatra's easier to get started and play around with. Rails is nice if you need lots of features or a job.
[00:36:46] pushcx: And if you're into functional programming and think Ruby's OO magic is kinda crazy, Hanami.
[00:38:10] pushcx: Not really any good connection to gui toolkits, no.
[00:39:54] pushcx: JRuby gives you slightly better speed, slightly worse ram consumption, and, infrequently, dealbreaker incompatible gems.
[00:40:58] pushcx: Yeah, if you need to run a Java library there's nice compatibility.
[00:41:55] pushcx: Got me, I don't work in security.
[00:45:10] pushcx: Been doing Ruby around 10 years, spoke at RailsConf last year. Suppose the shoe fits. :)
[00:47:42] pushcx: Currently Haskell and JavaScript; previously worked in Python + PHP, tinkered in C, C++, Pascal, x86 Assembly, HyperCard.
[00:48:15] pushcx: Once you're comfortable in one language C is worth knowing to understand lower-level abstractions and be able to read libraries, yeah.
[00:49:08] pushcx: Very similar - Python is more explicit and popular for scientific computing; Ruby has more magic and is popular for web.
[00:50:25] pushcx: But also Rust > C and Go > C if you're curious to write system code rather read it.
[00:53:09] pushcx: yes: https://en.wikipedia.org/wiki/Rust_(programming_language)
[00:56:19] pushcx: Ox0dea: clearly he just missed the &. operator and then it all would've been fine :p
[00:57:43] pushcx: Ox0dea: It's a page-turner :)
[00:58:41] pushcx: Ox0dea: oh, actually, I did turn pages recently: https://malaprop.org/post/g.mov
[01:00:20] pushcx: Ox0dea: search http://nearbygamers.com/tags for 'smash', there's a few people. But mostly the site is card and board games.
[01:15:58] pushcx: and the int that goes in the array
[01:17:27] pushcx: each_object creates an Enumerator; .count creates a Fixnum
[01:19:13] pushcx: Ox0dea: got me,then - interesting puzzle
[02:12:15] pushcx: renier: You could do 'gem install -i /tmp' so they get installed to a throwaway dir
[02:13:36] pushcx: er, yes, I meant -n rather than -i - havenwood's correct
[02:15:12] pushcx: renier: You could also install it and parse the yaml output of 'gem specification foo' to remove everything under 'executables'
[17:30:38] pushcx: Papierkorb: No, it can cause some bugs: http://www.theregister.co.uk/2016/02/02/delete_efivars_linux/


[21:52:53] pushcx: has joined #ruby


[17:18:35] pushcx: I'm porting up an app from Rails 2.1 and got a weird problem - it's forgotten the application layout. If I "render layout: 'application'" in my action it works, but with noting or with 'layout "application"' in the controller, I get no layout rendered, just the page template. Any ideas?