Help – Request for PNG not working in IE7
We request a PNG via IE7 from inside Parallels, but the file doesn’t get returned. The Nginx log just shows an empty line for the request.
Suggestion: Look also in Nginx’s error.log for the failing request. The request might be logged here and help find out what actually went wrong.
Interesting – Google Maps suggest canoeing and jet ski routes if your destination is across the ocean.
Jet ski from Shanghai, China to Kagoshima, Japan
San Francisco to Honolulu via kayak
Interesting – Making “.*” in regular expressions less greedy
Sometimes .* in regular expressions matches more than we would like it too. Let’s say you have a string that includes some numbers you want to extract from a string. Our string might look like this:
some text 123 more text
now we might try to use the following regular expression to get the 123.
However, this will only get us the 3. This happens because .* will match as match as possible. Adding a ? will change this to only match what is needed.
Now we get the 123 as desired.
A nice toll to experiment with regular expressions is rubular.com. Rubular allows you to see the effects of your regex in combination with an example string instantly.
Help – Running my own gem server
Sarah will give a Ruby introduction class for kids at RubyConf. However, there won’t be any Internet connection available, but the participants will need to install several gems.
A solution to this problem is the gem geminabox which allows you to run a server providing gems. Other users
who have geminabox installed then are able to install gems from that server.
Is it possible in Jasmine to spy on a getter such as
myObject[key]? We want to know when local storage is accessed.
Local storage has a functionally equivalent
getValue function, which you can spy on, but the spy is not triggered when you access the value via
On unicorn, the random number generator is seeded before the fork. So if you are depending on a set of unicorns to generate different random numbers, you need to reseed the random number generator manually after the fork.
If you want to make absolutely sure you aren’t generating any queries in your Rails views, try no_querying_views – which explodes if your query comes from view code.
Other ways to track down inefficient queries that folks have successfully used: bullet and query_reviewer
Skype 5 beta is out for Mac, which allows group video chat. Everyone must be on the beta for it to work.
Do people put bundler in the Gemfile?
Yes. Bundler is smart enough to omit it from the cache. It does, however, still follow the rules for version. We recommend using
~> 1.0.0 as the version string, because 1.x is supposed to be backwards-compatible with the current Gemfile format.
If you instead use
= 1.0.0 and your managed hosting environment updates bundler to something more recent, things will ASPLODE.
- Tech talk that was going to be today has moved to Thursday, due mostly to noise concerns. See you tomorrow.
We made a branch in git called “–track” by accident, and now we can’t get rid of it. git thinks it’s a command-line argument, even when it’s in quotes.
Here’s the command what did it:
$ git checkout -b --track origin/actual_branch_name
Branch --track set up to track remote branch refs/remotes/origin/actual_branch_name.
Switched to a new branch "--track"
Consensus: kill it through RubyMine or gitX. There is also a way through the command line:
$ git branch -d -- --track
…but make sure you get the dashes in all the right places.
reset after tail – sometimes, if your PS1 has colors (or square brackets, or … ?) you can lose your Terminal after tailing a file. To get it back, type
reset, which should work even if you can’t see it echoing. You may need an extra return before it.
The Giants seem to have won! There’s a parade tomorrow, right in front of the office. If you’re coming for the tech talk, leave extra time as streets will be closed and they’re expecting a crowd.
Open Source Development Workshop
Thursday, October 28 at 6:30PM
Pivotal Labs is hosting and our own Sarah Mei is leading an open source workshop for developers interested in learning about contributing to open source projects. Sarah will be using the Diaspora project as an example, and the Diaspora team will be on hand to assist. Email Sarah at sarahmei at pivotallabs dot com for more info, or view the meetup page here
Standup 2010-10-26 and 2010-10-27
“How do I use RVM on the server?”
RVM on the server can be fraught with peril. Be sure that your (or your process’s) shell is being invoked in a way which plays nice with RVM, for instance bash -lc or bash -ic in cron.
“Why does Google Street View give me a grey dead area instead of a picture of some dude’s house?”
Most likely this is due to having requested a view for an area where none is available. The Google docs have been found to be a bit misleading on this, however there is an api call to see if there is an available street view for a given radius — try increasing this radius near your lat & long until you get success in order to avoid a useless response.
- Running MySql in ramdisk does not yield any discernable performance boost for small to medium-sized rails projects, for test suites or the app itself. This is probably due to the fact that most projects’ code and data are already small enough to fit in cache.
- Looking for a real perf boost? Try REE with the Twitter GC tweaks
- Edit: followup to delayed_job job logging failures
Switching to resque might help, but not without first rewriting the jobs.
More research yielded the fact that delayed_job reopens all files (including the log files) when it spins up. Under Ruby 1.8, File#reopen defaults file mode to last set, while 1.9 defaults to read only. This could easily cause logging failures. (with a nod to Davis W. Frank for the followup info)
“Anybody have any experience using the oath gem without net/http? There are some things we want to do that it’s not good at”
Like posting large files? Shell out to curl. There are a couple things nobody seems to have done right, yet, and that you just have to use curl for.
“What is the right gem to use for AWS? The official one seems newer than this right_aws that hasn’t had a commit in a couple years”
You are probably looking at the wrong version. Another project was using right_aws and they swear it’s newer than that. It sounds like the gem forked and you probably want the RightScale one. Either way it definitely works better than Amazons ec2 gem, which will get the job done sometimes, but is less than optimal.
Testing right_aws with webmock
A team was seeing webmock continuing to feed a bad result to all of their tests (within a timeout for the shared connection) when one failed, instead of trying again. They switched to using connection=dedicated instead of shared.
“We’re using Rails 2.3.x built-in Digest Auth to hide the production/demo env of a site that doesn’t have a user model yet. It seems like every few requests we have to reauth – possible worse when multiple computers request concurrently”
Make sure there aren’t any failing requests (such as an ajax firing off an illegal route) that might be causing the browser to think it is no longer authed? Maybe just stick with using Basic Auth via an .htaccess? A number of other comments and guessed were thrown around, but nothing conclusive.
The team asking about charting yesterday said Flot was the answer. Highchart has licensing/pricing they didn’t like, Graphael might be getting stale, as it hadn’t been touched in a while, and they needed more data than the GET limit, which prevents the use of Google Charts.
Some Jasmine tests were failing on CI in Selenium, but not locally.
It turned out to be some tests that fail when the window size is to small. The team bringing this up added a helper for Jasmine to resize the window if it was too small. Another team mentioned new Selenium runs fullscreen by default. Another team gave the Jasmine test block a static style and large size in css.
“Anybody have a favorite for charting on the client-side?”
Google charts works well for getting something simple going quickly, use Flot for anything beyond that. Some people mentioned the existence of Raphael.js, but nobody had much experience with it.
“We had to make sure we were using rvm as a function instead of a binary and-”
You installed it wrong – the install checks that rvm is a function.
“We are seeing a lot of errors (more than the hoptoad limits) going to hoptoad and newrelic for error types that are handled by rails built-in rescues, like 404s for ActiveRecord::RecordNotFound. The app is serving up the correct error page, but still sending an error to the services.”
These services hook in lower than that so they can get all error info. Make sure nothing happened to their config of which errors to ignore, because they have their own way of skipping them.
Also consider turning off the default route to cut back on crawlers. This would likely just trade 405s for 404s, though.
“Yesterday we agreed to always check in the Gemfile.lock, but 1.8 and 1.9 versions differ slightly so…?”
It wouldn’t quite make sense to maintain a whole separate branch, but someone cleverly suggested making the file a symlink and having your .rvmrc manage which file the symlink points to.