Matthew Kocher's blog



Matthew KocherMatthew Kocher
[SF] 11/30/2011: 30 Days has Movember
edit Posted by Matthew Kocher on Wednesday November 30, 2011 at 09:30AM

Ask for Help

"Is there a good JS/HTML code editor that will expand to fix the contents?"

A team is just getting started with putting in a code editor and is currently using ACE. It doesn't seem like there's a way to tell it to take up as much height as it needs. Many suggestions were thrown out, FCK and TinyMCE being two, but none was known to auto size itself. There is one that no one can remember the name of, but they had fond memories of from the past.

Interesting Things

Movember Update

  • Webstash passed the $20k mark that Davis & Sean had been shooting for--congratulations everyone! (This does not include Rob's generous Mohawk donation). SF has raised $323.36 per stash, NY $163.40 and Boulder $210.50. There's still time to donate.

Matthew KocherMatthew Kocher
[Standup][SF] - 11/28/2011 - Post Turkey Edition
edit Posted by Matthew Kocher on Monday November 28, 2011 at 10:12AM

Ask for Help

Why does my md5 change when the timezone changes?

A pivot found that the tests of MD5 generation fail if the machine is in a different time zone. While one of the inputs to the hash is the time, he swears up and down that it's integer seconds since the epoch, and is the same on both boxes.

Interesting Things

  • Tomorrow is Mo'hawk day at the Pivotal SF Office. It will be live streamed, with color commentary by our own Davis Frank. The live stream may be a PPV event, please have a major credit card available.

Interesting

  1. The the Riak Client gem uses nethttp by default. While it allows you to specify a timeout for a map reduce job, it doesn't set the nethttp timeout for the connection to riak. This means that all requests are effectively limited to 60 seconds. The project that discovered this is switching to curb.

  2. The Mac App Store is actively hostile to business users. There is no way for us to buy software through the app store without setting up a separate account for every three computers, and then you can only reuse a credit card for three accounts. We won't be purchasing any software through the app store that isn't absolutely necessary until there's a way to purchase N licenses and use those on N machines. Pixelmator is the first app to lose our business.

Matthew KocherMatthew Kocher
Standup 4/13/11 - a ruby injection vulnerability?
edit Posted by Matthew Kocher on Wednesday April 13, 2011 at 10:04AM

Ask for Help

*Is sunspot vulnerable to a ruby injection attack? Sunspot requests ruby as an output format from solr, and evals the response. One project is seeing invalid unicode being passed to solr and coming back in the response, causing the eval error on the invalid characters. The consensus was that it probably wasn't exploitable, but is unfortunate.

  • Is there a way to put Jasmine in the test group without it causing errors on production?

This has gotten better in rails 3 but the fix has caused problems in rails 2 apps. For now you can install in every group or catch the exception when it tries to load it in production.

Interesting Things

  • You can pass an array as the value of the :join parameter in ActiveRecord finders. This lets your write clearer code instead of having one long string with multiple joins.

Matthew KocherMatthew Kocher
Standup 4/11/11 - Rubygems & Things you shouldn't try
edit Posted by Matthew Kocher on Monday April 11, 2011 at 01:50PM

Help

  • Is anyone getting corrupt or empty gems from rubygems?

Yes. It's not clear what causes it, but it's been seen. The best work around is to have bundler cache the gems in the project.

Interesting Things

  • You can define a method in ruby called return. You can send :return to an object with return defined as a function, and it will call the method. You can't call the method normally. None of this is a good idea.
  • RVM can use most any version of rubygems you might need. just rvm rubygems 1.5.2 to get 1.5.2, for instance. Some gems are incompatible with new versions of rubygems, so this can come in handy.

Matthew KocherMatthew Kocher
Standup 6/23/2010: Mock what isn't there
edit Posted by Matthew Kocher on Wednesday June 23, 2010 at 09:16AM

Help

  • Is there a reason why java on 64 bit linux doesn't seem to go above 4GB of ram even if it's given more? Some docs say that 2GB is the max, which is clearly not the case. Other projects report they have JVMs as large as 12 gigs. The search for a reason for the OOM errors goes on.

  • How do you mock the backtick or array operator with RR? This is done in rspec by mocking the symbol on the class that it's being called in, but it's not obvious in RR. Suggestions included finding a different way to test the behavior, wrapping the system call in a function that's easily mockable, or investigating another way to shell out.

Interesting

  • Free Ruler, the measurement tool of choice for pivots who need more than the pixels measurements of Command-Shift-4, doesn't just know the pixel density of the display it's running on. 20" Aluminum iMacs are significantly different from what it assumes.

  • The Jasmine javascript BDD testing framework project was jealous of the newcomer Cedar's @cedarbdd twitter. They've struck back by creating @jasminebdd. You can follow both for updates, announcements and tips.

  • Some devs working on a mobile JS app recently discovered Prototype's wrap function after implementing the same thing many times before. They did preface this with "is anyone else still using Prototype" so as to not offend the jQuery zealots.

Matthew KocherMatthew Kocher
Standup 6/22/2010:
edit Posted by Matthew Kocher on Tuesday June 22, 2010 at 09:25AM

Interesting

  • Don't put your expectations on a proxy, as the proxy might not get called in your code as the proxy may have turned into a real object by the time you use it. The right thing to do is to put your expectations on your proxy target, and you can do this on either either the target or proxy_target of the proxy object. Proxy_target is strongly preferred by some pivots.

Help

  • One project in the office is deploying varnish to EY Cloud, and was wondering if anyone else had gone down this path before. There is a EY Cloud chef recipe for varnish, but it is not supported thus changes with EY cloud may break it in the future.

Danger

  • A pivot warns that the recent facebooker gem (1.0.70 and 1.0.71) come with a gemspec that reports version 1.0.67. This causes bundler and RubyMine to both be very confused. If you find yourself in this situation complain loudly and then remove all previous version from your system.

Matthew KocherMatthew Kocher
Standup 6/21/2010: A Monday morning assortment
edit Posted by Matthew Kocher on Monday June 21, 2010 at 02:00PM

Help

A pivot asks if anyone has used any of the multitude of grid frameworks in a production site. Assorted developers have used and liked Blueprint, Compass and 960 grid. Blueprint was the most used, but no one had any complaints. It seems that often times people think they need a grid when really they just want a three column layout.

Interesting

Another pivot reports that they are very happy after setting "paste and match style" to the default behavior for Cmd-V. The peanut gallery pointed out that you might want to paste without matching styles occasionally, and it was decided this would be an acceptable use of the mouse when it was necessary. Read more at Thaweesak

And an anecdote

The paste and match style discussion reminded another developer of a time when they were trying to compare two things pasted from terminal. They learned the hard way that there are character encoding or other issues that caused cause the diff to not include all the differences that they were looking for.