Tyler Schultz's blog
Ask for Help
"CarrierWave is messy leaving files in the tmp directory when running tests. Is rm -rf the best answer?"
Yes!
"While the we love Rails, we don't need it, we just want its asset packaging features. Some suggest using sprockets. Do you have other suggestions?"
Interesting Things
*Gem Maintainers: use LicenseFinder to save users of your gem the hassle of digging through your gem to figure out what license your gem is distributed under.
*A Pivot had great success using Join.me for remote pairing. Setup was a snap! Others suggest checking out TeamViewer as well.
Help!
"How do I choose the value of a select box programmatically? The val function does not seem to do the trick."
Try setting the desired option as selected and then trigger a change event on the select input.
*"A pair is looking for 'multi file upload via iframe-transport' expertise. Specifically uploads in FireFox 3.6."
Interesting
- The latest RubyMine EAP has improved code formatting options!
Ask for Help
"Our delayed job consumes 2G of memory creating ~20k ActiveRecords in a loop!"
It doesn't answer why your job is using so much memory, but check out activerecord-import.
Interesting Things
- Pivotal SF will be hosting a Tracker Users Group meetup tonight. Dan Podsedly will be speaking. He will be seeking feedback for a eagerly awaited feature to be rolled out shortly: Epics! Come and mingle with fellow Tracker users, drink some beer and eat some food.
We spent some time trying to figure out why some html content would not load in our app's WebView. We found trivial html can be loaded into a WebView using the loadData(String, String, String) method. Rendering complex pages with Javascript is a problem. It turns out the loadData() method requires the html to be URI escaped (RTFM? Bah!). There are additional characters that need to be escaped too, requiring some nasty boilerplate.
The simpler solution (workaround?) is to use loadDataWithBaseURL(String, String, String, String, String). Calls to this method do not require escaping. Pass along a garbage base url (or null), and an empty or null history url for success and profit.
webView.loadDataWithBaseURL("blarg://ignored", getData(), "text/html", "utf-8", "");
Web development spoiled me. Set the src tag on an img tag and away you go. For the most part, browsers just do the right thing and cache these requests. Disappointingly, Android does not come with out of the box support for caching content downloaded from the network. Server apis often require SSL, request headers, support for different HTTP methods, multipart post bodies, etc. requiring the use of the apache http client libraries. These libraries are powerful, but are a bear to work with. As far as I can tell there is no support for caching http responses built into the apache libraries, requiring that you roll your own caching scheme. Images often do not have all these complicated HTTP requirements. They're usually simple HTTP GET calls. This makes the java.net.* libraries appealing. The java.net libraries come with some handy classes that makes caching a breeze.
Android Activity classes can become gigantic and unwieldy if you're not careful. Testing complex Activities requires complex setup. To reduce that pain we try our best to keep the Activity lean. This means getting logic out of the Activity. One technique we use is to create custom views that we can test in isolation.
Help
Some pivots are having trouble with a flash embed tag's scale attribute. The desired behavior is that the movie scale to fit the size of the element. According to documentation, this should just work. The flash content will not scale, instead the content is getting cropped.
Anyone have experience using Amazon RDS with Heroku?
Several projects at Pivotal have used this combination with great success.
Interesting
- A project had some intermittently slow queries. The problem was traced back to some large strings in one of the columns. The team solved this problem by overriding the default scope, and only selecting the expensive column when needed.
Help:
- Does anyone know of a way to aggregate multiple projects into one hudson build? A pivot currently has 4 hudson projects that he'd like to show as one status. If any one project fails to build, then the build should go red, but hudson should still build the other three.
Interesting:
- Time gotcha:
In 1.8.7 you'll see this:
> Time.now => Wed Dec 08 22:26:37 -0800 2010 > 1.day.ago => Wed, 08 Dec 2010 06:26:44 UTC +00:00 > 1.day.ago.to_date => Wed, 08 Dec 2010 > (Time.now - 1.day).to_date => Tue, 07 Dec 2010
In 1.9.2 you'll see this:
ruby-1.9.2-p0 > Time.now => 2010-12-08 23:28:26 -0800 ruby-1.9.2-p0 > 1.day.ago => Tue, 07 Dec 2010 23:28:26 PST -08:00 ruby-1.9.2-p0 > 1.day.ago.to_date => Tue, 07 Dec 2010 ruby-1.9.2-p0 > (Time.now-1.day).to_date => Tue, 07 Dec 2010
Interesting:
- salesforce acquires heroku: http://blog.heroku.com/archives/2010/12/8/the_next_level
