Brad Lucas

Programming, Clojure and other interests

Bash - Display Function Definition

May 2, 2007

A tip.

If you create a function in bash and want to see its definition. Try

declare -f 'your-function'

Continue reading →

After Cygwin Upgrade – Command Not Found

January 31, 2007

After upgrading Cygwin and starting I found that while sourcing my .bashrc file a lot of “: command not found” messages.

It turns out that this is caused by CR/LF endings needing to be CR. Strange, yesterday’s bash didn’t have a problem with this and today the new version does.

The fix is to run d2u on each file to ‘fix’ the line ending. If you have a .profile that sources your .bashrc don’t forget to run d2u on it as well.

Actually, this isn’t much of a fix as you’ll get very annoyed converting all your scripts.

Continue reading →

Adding Google Analytics To A Wordpress Site

January 27, 2007

The following are instructions on using reading the WordPress Plugin for Google Analytics

  • Download and unpack the google-anlytics.tgz file to get google-analytics.php.
  • Copy that to your wordpress/wp-content/plugins folder.
  • Login to your WordPress site and select Plugins. Active the Google Analytics plugin.
  • Navigate to Options and select Google Anaylitics and add the _uacct value you were given from Google.

For more details see plugin author’s Google Analytics WordPress Plugin page.

Continue reading →

More Jazz On Youtube

January 10, 2007

Anthony Braxton : Impressions - Lounge Lizards - Voice Of Chunk - Ornette Coleman : Pat Metheny 1988 - Steve Lacy -

Continue reading →

Bad Markup Causing Multiple Calls To Spring Controller

January 10, 2007

Had an interesting problem come up with a client using Spring MVC. For some reason they where experiencing GET requests to a Controller resulting in two calls to the Controller. It was as if the browser was making to requests for each user initiated request. Of course, implementing a simple version of the controller and a basic view did not reproduce the problem. Going back to the application and logging continued to verify that the handleRequestInternal was in fact being entered twice.

Nest, the Controller and it’s View where slimmed down a bit to localize the problem. A single test url was setup to point to this controller. Then iteratively parts where changed. Any unnecessary processing was removed so the Controller was excercised from a link and simply returned the View. This still showed the problem. Next, the view was replaced with a very minimal Jsp. When this happened the problem went away. Could something in the existing View cause the Controller to be called again? This didn’t seem likely but it certainly seemed to be true.

Returning to the original view, and selectivly removing one section at at time until the problem went away eventually localized the offending part of the View.

Inside the HTML tag for a TABLE where was a background=”#C3D9FF”. This invalid attribute looked to cause the browser to recall the page as it expected the background to be associated with the BODY.

Continue reading →