Joe Moore's blog



Joe MooreJoe Moore
Standup 06/05/2007
edit Posted by Joe Moore on Tuesday June 05, 2007 at 07:13PM

Interesting Things

  • Most of us who have converted from Windows to Mac hate the Mac's usage of the Home and End keys (move to beginning of file or end of file, respectively.) Here's a trick to 'fix' them:

To make home and end keys work on a mac simply copy this into the specified file (DefaultKeyBinding.dict)

<code>
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
{
    "^f"      = "moveWordForward:";            /* Ctrl-f    = next word     */
    "^b"      = "moveWordBackward:";           /* Ctrl-b    = previous word */
    "^v"      = "pageUp:";                     /* Ctrl-v    = page up       */
    "\UF729"  = "moveToBeginningOfLine:";      /* Home      = start of line */
    "$\UF729" = "moveToBeginningOfLineAndModifySelection:";  /* Shift-Home = start of doc  */
    "^\UF729" = "moveToBeginningOfDocument:";  /* Ctrl-Home = start of line and select  */
    "@\UF729" = "moveToBeginningOfDocument:";  /* Cmd-Home = staart of doc  */
    "\UF72B"  = "moveToEndOfLine:";      /* End      = end of line */
    "$\UF72B" = "moveToEndOfLineAndModifySelection:";  /* Shift-End = end of line and select  */
    "^\UF72B" = "moveToEndOfDocument:";  /* Ctrl-End = end of doc  */
    "@\UF72B" = "moveToEndOfDocument:";  /* Cmd-End = end of doc  */
}
</code>

Everything seems to work except firefox, sadly.

Joe MooreJoe Moore
Standup 06/04/2007
edit Posted by Joe Moore on Monday June 04, 2007 at 06:12PM

Interesting Things

Joe MooreJoe Moore
Standup 05/24/2007
edit Posted by Joe Moore on Friday May 25, 2007 at 05:39PM

Interesting Things

  • We're looking for the best search plugins for Trac. Suggestions?
  • Rails: We often find ourselves adding and return in our Controllers to avoid the dreaded DoubleRenderError. It turns out that you can use unless performed? instead:
<code>
def double_rendering_action
  render :template => "wrangler/monkey" if wrangle_monkey?
  render :template => "wrangler/sleep" unless performed?
end
</code>

Joe MooreJoe Moore
Standup 05/23/2007
edit Posted by Joe Moore on Wednesday May 23, 2007 at 07:38PM

Interesting Things

  • Some projects are playing with the Mocha mocking framework. From their site:

    Mocha is a library for mocking and stubbing using a syntax like that of JMock, and SchMock. Most commonly Mocha is used in conjunction with Test::Unit, but it can be used in other contexts.

  • Our own Nathan Sobo has released Treetop 0.1.0:

    Treetop is a Ruby-based DSL for text parsing and interpretation. It facilitates an extension of the object-oriented paradigm called syntax-oriented programming.

  • Jeff from Inveneo presented us with a tech-talk recently about the technology they are bringing to rural and remote communities throughout the world. Fascinating stuff. A group here has volunteered to help write some software if needed.

Ask for Help

  • "Are there problems getting Rspec mocks to 'reset' for each spec run?" Mocks persist across test/spec runs for class methods, so watch out.
  • "My routes arn't working..." Remember that Rails routes are positional, which means that they are matched top-to-bottom; changing the position seemed to be the fix in this case.

Joe MooreJoe Moore
Standup 05/22/2007
edit Posted by Joe Moore on Tuesday May 22, 2007 at 04:51PM

Interesting Things

Joe MooreJoe Moore
Standup 05/21/2007
edit Posted by Joe Moore on Monday May 21, 2007 at 04:50PM

Interesting Things

  • Rails gotcha: with ActiveRecord.findXXX, you can specify query parameters such as :group_by, :limit, and :include. But if you use those three together Rails will generate an incorrect query.
  • Rspec 1.0 has been released.

Ask for Help

*"Can you use the Venkman Javascript Debugger to debug programatically-loaded JS, files that are actually hosted by a 3rd party, such as Yahoo!?" We don't think so, but if anyone in the community has an answer, let us know.

Joe MooreJoe Moore
Standup 05/17/2007
edit Posted by Joe Moore on Thursday May 17, 2007 at 04:49PM

Interesting Things

  • Yahoo's Geolocation service is broken after they released a new version if their code. Zip code searching in particular significantly broken -- discussion thread here: http://tech.groups.yahoo.com/group/yws-maps/message/5468 -- here is an example:
    • Search for a zip code using the following URL: http://local.yahooapis.com/MapsService/V1/geocode?appid=YahooDemo&location=94102
    • Result (notice the bad State and Zip tags):
<code>
    <\?xml version="1.0"?>
    <\ResultSet xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:yahoo:maps"
               xsi:schemaLocation="urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd">
      <\Result precision="zip">
        <\Latitude>37.779411
        <\Longitude>-122.417740 
        <\Address>
        <\City>San Francisco, CA 94102
        <\State>United States
        <\Zip>
        <\Country>US
      <\/Result> 
    <\/ResultSet>
        <\!-- ws05.search.re2.yahoo.com compressed/chunked Thu May 17 15:02:00 PDT 2007 -->
</code>

UPDATE This is fixed! Thanks, Yahoo!

Joe MooreJoe Moore
Standup 05/16/2007
edit Posted by Joe Moore on Wednesday May 16, 2007 at 04:48PM

Interesting Things

Joe MooreJoe Moore
Standup 05/15/2007
edit Posted by Joe Moore on Tuesday May 15, 2007 at 04:40PM

Ask for Help

  • "Does anyone have recommendations for browser-embedded WSIWIG text editors?" The #1 recommendation is TinyMCE, followed by FKEditor
  • "Rails cached-pages sweepers are causing a nil.controller_name_ error deep in the rails framework..." We 'fixed' this with a variation of this patch: http://dev.rubyonrails.org/ticket/6199

Joe MooreJoe Moore
Standup 05/10/2007
edit Posted by Joe Moore on Thursday May 10, 2007 at 04:47PM

Interesting Things

  • Several folks here are looking at Merb (Mongrel with ERB) as a light-weight alternative to Rails for certain targeted usages. We'll be sure and attend the Merb hack-fest at Rails Conf.
  • Debian MySQL pain: if your MySQL Client and Server versions do not match, MySQL behave badly, reporting that it cannot find UTF-8 support.

Ask for Help

  • "Can you terminate an AJAX request?" The answer is "kinda". XMLHttpRequest has an abort() method will terminates the request in the browser and prevents any callbacks from being invoked. But, your server might still be chugging away on the requested action.

Other articles: