The blog has moved to ... Many google searches point here so I am leaving it operational, but there will be no new posts.

Saturday, December 15, 2007

Personal Web Page Revisited

Ok, it has been 5 years since I have updated my personal webpage, once again it is just a 1 page web site; lean and mean ~:P

It might load a bit slow; I am using some of the libraries from Ext JS - a few hundred K in css, images and js to load in, should cache in the browser after the first hit, their UI widgets are just too cool.

anyhow here it is -

Random Coding Links - #1

Random Coding Links - #1
wanted to keep track of these somewhere

Saturday, December 8, 2007

mysql migration toolkit

I am using the mysql migration toolkit to transfer a database from MSSQL 2005 over to MySQL database. Ran into an issue with the port, by default the tool wants to use 1433 (MSSQL 2000 default), but it looks like 2005 uses a default port of 1434 (well it is more complicated then that - you can use the stored procedure xp_readerrorlog to verify the port your database is listening on - one of the rows in the text column of the result should be something like 'Server is listening on [ 1434].'

anyhow after changing the port number everything else was smooth sailing, yeah right...
once I got to the reverse engineer stage then this java stack came up, looks like it still doesn't like the connection string, even though I have already authenticated with it?

Initializing JDBC driver ...
Driver class MS SQL JDBC Driver
Opening connection ...
Connection jdbc:jtds:sqlserver://;user=sa;password=;charset=utf-8;
Initializing JDBC driver ...
Driver class MS SQL JDBC Driver
Opening connection ...
Connection jdbc:jtds:sqlserver://;user=sa;password=;charset=utf-8;
The schema could not be reverse engineered (error: 0).
ReverseEngineeringMssql.reverseEngineer :I/O Error: Connection reset
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)com.mysql.grt.modules.ReverseEngineeringGeneric.establishConnection( Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
com.mysql.grt.Grt.callModuleFunction(Unknown Source)

ok, so close the migration tool reopen and go through the same process, exact same behaviour, clicking the back button brings me to the original screen where the MSSQL connection information was entered, everything is as it was, try to connect again and this time another java stack trace, the important part was this line - 'I/O Error: DB server closed connection.' - Weird

a google search led me here -
Using the 'SQL Server Configuration Manager' I had to set the 'SQL Server 2005 Network Configuration' -> 'Protocols for MSSQLSERVER' -> TCP/IP to Enabled

doing this set my default port back to 1433 (actually that is the one I used, xp_readerrorlog shows the database listening on both 1433 and 1434), so re-connecting with the migration tool and using the 1433 default port worked and I was on my way...

so every table fails to migrate except 2? well I guess the migration tool could be better, lucky for me I only had 12 tables going here, I had to update the migration code for all of these tables

had to be changed to

yes removing the () from the default value - now that sure is a pain. It was only occuring on types of tinyint - these were coming from MSSQL bit datatypes, could be an issue only in that one case?

Sunday, December 2, 2007

Tesla Motors - electric cars

I am sure most people have heard of these cars by now?

Changing Perceptions
We needed to change perceptions of electric vehicles in a big way. To make electric cars a viable alternative, we set out to build one that was gorgeous and thrilling to drive.

Our first car, the Tesla Roadster, isn‘t a plan, pipedream or prototype; this car exists and is for sale now. It‘s a no-compromise driver‘s car that can accelerate faster than a Porsche 911 and hit a top speed of nearly twice what the law permits. With a range of more than 200 miles on a single charge, you can use it all day long and not worry you‘ll run out of juice. Just plug it in at night the same way you drop your cell phone into its charger, and sleep well, without guilt.

Just the Beginning
While the Tesla Roadster‘s sticker price is in a league with other
high-performance sports cars with similar specs, we recognize it‘s out of reach
for a lot of people. We consciously chose to develop a high-end sports car as
our first car in order to develop the “performance DNA” from which we could
create other electric vehicles. Our next model will leverage the Tesla
Roadster‘s technology, resulting in a less expensive sports sedan that we can
sell at higher volume.

I don't want a sports car and definitely won't be spending $90,000 on a car of any sort, but I hope they can get a lower cost sedan or wagon on the road in the next few years.

Saturday, December 1, 2007

9 Golden Eagles

Crazy day of birding

The first real cold days have hit - crispy and clear, so I headed out towards Valley Ford with Larry.

We saw the usual - Red tails, Red Shoulder, Norther Harrier, Kestrel, (where was the white-tailed kite?) and then the good stuff 1 Ferrug, 4 Rough-legged and 9 Golden Eagles!!!

Most of the eagles were hanging out in pairs, but at one point we had 4 in our sight at once (that was a first for me), 2 pairs I believe. They were all in the vicinity of a dead lamb, the first one we spotted was actually perched on the lamb getting ready to eat.

last week was good to - first week we saw any rough-leg; Next week can only be better but don't think I'll see that many Goldens in one day for a long time.

Sunday, November 4, 2007

TFS without Visual Stuido

you can actually install Team Foundation System source control without installing the entire Visual Studio IDE, why you would want to do this I am not sure, but we had some QA peoples who needed access to the source control system, seemed like it would be easier for them not to need to go through the VS IDE just to access the files.

anyhow if you install TFS Source Control Explorer, everything should work ok from the command line, only one registry hack was required - found this on msdn forum somewhere but forgot to bookmark it


add a new String Value with the key being the name of your TFS server and the value the uri for the TFS server i.e. MySourceControl=http://mysourcecontrol:8080

or better yet forget all this and save your self a big headache and just use Subversion - it works better and it is free

Sunday, October 21, 2007

Tic Tac Toe on Rails

Ok I finally completed my first rails project. Tic Tac Toe on Rails, you can check it out at It was a good reminder for me of how long it takes to really get up to speed on new technologies, Rails is really cool but it is definitely not a silver bullet for building web applications, when you get right down to it building software is hard work no matter which technology you choose to use.

Thursday, October 18, 2007

Rails RJS and newline characters

ok this one really got me, I was generating a javascript alert from the server via an rjs file, i.e.

# rjs render a javascript alert on the client
page.alert 'Errors\nError 1\nError 2'

and it kept on printing my error message as Errors\nError message 1\nError message2 - note that the newline characters were being escaped and rendered literally

I found this informative post which lead me to change my code from using single quotes to using double quotes - nasty.

# this one will output the newlines in the javascript alert message
page.alert "Errors\nError 1\nError 2"

here is the final code, looping through each error on the model object (product in this case) and outputing a newline on the javascript alert for each error

# rjs file
page.alert "#{get_message_for_show_server_error}"

# helper file
def get_message_for_show_server_error
__s = "Errors "
__@product.errors.full_messages.each do error
____s = s + "\n" + error.to_s

__return s

Sunday, October 14, 2007

Assembla is cool

Check out -

right now I am just using it for the 200MB of free svn repository for my first rails projects (always important to have a back up); but they have so much more to offer as well - Job Board, Distributed Team management tools, etc...

Peregrine sighting in Gualala

We went away for the weekend up to a bed and breakfast in Gualala - the Breakers Inn
a bit on the expensive side but they have pretty nice rooms with great decks that look out over the Gualala river where it comes into the ocean. The weather was perfect, not a cloud in the sky all weekend and no fog either - fall really the best time of year on the Northern California coast.

So there I was sitting on the deck enjoying the sunshine and checking out the seagulls and other water fowl hanging out in the river when all of a sudden they are all flying up in the air (often a sign that a predator is in the area) and so I am looking around in this swarm of birds and there it is a juvenile Peregrine Falcon. He takes a couple of stoops on some water fowl, like 3 or 4 times but nothing doing so he starts heading up the river just a few hundred yards and sees a lone water fowl in the river, next thing I know the Peregrine is diving in on this bird from 15 to 20 feet above the water, coming in from the right and then back from the left, each time the water fowl would avoid being hit by ducking into the water at the last minute - this went on for what seemed like over 5 minutes, I gave up counting how many times he stooped in on the bird after about 40.

So this Peregrine is really determined (probably real hungry) and finally gets the killer blow on the water fowl. He lands on the shore and rests for a few minutes then is back at it, but this time trying to pick the kill up out of the water, takes awhile but he finally grabs it; too heavy to pull out of the water so he flys just out of the water for a bit before dropping in the water and swimming the last 10 feet to the shore.

After a short rest he starts to pluck the feathers and eat some of it. But life is not easy at the top of the food chain. Some Turkey Vultures and Ravens move in and start hanging around the Peregrine. He did not get to eat too much of it before the Ravens move in a steal it from him, they flew off with the kill and the Peregrine tried to pursue and they all went out of my view from there; I doubt the Peregrine was going to get anymore of it at that point.

This was the craziest bird sighting I have ever witnessed - would have been really cool to have a video camera, although it probably would not due the sighting justice.

Thursday, September 27, 2007

TFS and the pain

We have been using TFS (Microsoft Team Foundation System) at work for Source Control for a few months now; we've run into numerous issues none of which I am going to get into now; this post is really just some notes for my future reference.

if you get into real trouble with TFS the following steps should almost definitely get you back to a fresh place
  • Start -> Programs -> Visual Studio 2005 Tools -> command line
  • tf workspaces
  • - this will show you your workspace name; probably the same as your machine
  • tf workspaces /remove:*
  • - this will remove local system cache of TFS
  • tf workspace /delete /server:{servername} {workspacename}
  • - this will remove from the server
  • - it will prompt you to verify - type in y
  • tf workspace /new /server:{servername} {newworkspacename}
  • - this will launch the GUI to map the server to your local system
  • - server = $/
  • - local = C:\TFS
  • cd C:\TFS
  • tf get
  • - pull down all the files

This maps the root of the TFS server to C:\TFS, you may of course want it mapped to another location on your drive.

Check out tf command on msdn

Friday, September 21, 2007

First Rails Project

so off and on the last month I have messed around with bits of rails stuff; reading books, coding associations, migrations, and installing plugins - oh yeah! ActiveScaffold is very sweet! finally got the integration with FCKeditor and the calendar control working as well; so now I am ready to actually build a web site.

a few years back I built a site for my wife's cycling team. It is a pretty simple site but with data driven content, this seems like a good project to convert over to rails as it will give me a little bit of everything. So here we go...

Day 1 - 2007.09.21 2:00pm

rails nor_cal_velo, add it to svn, create a blank database on mysql, then onto the migrations; already had the database tables pencil sketched on paper, similar to what I had before in the previous site but this time a little simpler as I will be using ActiveRecord (of course) and not stored procedures...

4 hours later: migrations and db created, active scaffold hooked in and up and running for a single controller; but got side tracked trying to push before_create_save event down into a controller base class as I do not wish to duplicate the same code for every controller.
Posted to active_scaffold groups, got to be a way around this

going to do some html / css stuff for awhile and get the layout section taken care of then onto more active scaffold controllers

Day 2 - 2007.09.22
spent a few hours tweaking css overrides for active scaffold and figured out the issue with the controller base class see the thread above for the solution. Still have a small glitch with overrides of the Delete function, I am setting the is_active flag to false instead of actually deleting the record, everything works great except the ajax code actually removes the record from the visible list of records, if you refresh the page the inactivated record reappears and is marked as is_active = false as it should be

Side Tracked
Ok, got side tracked messing around with rails and some fun ajax stuff, my first rails project has changed to something much smaller in scope; I'll be back on this project at some point though as long as the day job doesn't consume me...

Saturday, September 1, 2007

Ruby and Rails

Taking a few hours a week to try and learn Ruby and Rails

notes and links for future reference


Ruby and Rails resources

IDE and text editors for Windows

Some notes and code stuff

Ruby Notes - part 1 - dynamic object creation

I am starting to learn Ruby and Rails (just for fun) - took awhile to find a good example of creating an object at runtime given a string representing the objects name; finally came across this post;

in theses 2 examples - given an ActiveRecord object 'Project' and a database table named 'projects', invoke the Project and execute some methods on it

# using eval
def test_dynamic_invoke_with_eval
__object_name = "Project"
__o = eval(object_name)

__p "object name is '" + o.to_s + "'"
__p "object table name is '" + o.table_name + "'"

# using Object.const_get
def test_dynamic_invoke_with_object_const_get
__object_name = "Project"
__o = Object.const_get(object_name)

__p "object name is '" + o.to_s + "'"
__p "object table name is '" + o.table_name + "'"

Check the ruby forum link above as well - the last entry posted by 'unknown (Guest)'; this is probably the true ruby way to do it? extend the String object with a helper method so you can turn any string into an object? code from that post

# extend String
class String
__def to_class

Sunday, May 27, 2007

Ubuntu really is easy

Just installed Ubuntu Desktop on my 'old' (not that old really) Dell Dimension 2400 Celeron. Don't use this computer much anymore and have been wanting to check out Ubuntu.

well the install was way too easy.
- downloaded the iso image from
- burned it to a cd using
- put that in the old 2400 and selected boot from CD-ROM
- Ubuntu OS booted from the CD and I was up and running at that point; but only from disc
- Had to click the install short cut on the desk top and wait a short while

That was it - no driver issues at all!!!
I was on my network and downloading the Ubuntu updates immediately, browing the internet with FireFox and watching avi files with Totem ...

One really cool thing with Ubuntu (maybe Linux in general?) with out any additional installs I could navigate to my other Windows machines and pull files off the File Shares; simple as going to 'Places' -> 'Network' -> 'Windows Network' -> selecting the machine to browse to

Later I might look into setting up Samba so I can share from Windows to the Linux machine

Definitly going to install the Ubuntu Server Edition on my laptop soon and create a simple web site using Ruby on Rails, just need to find that 'extra' time

Thanks to my Dad for turning me on to Ubuntu!

Sunday, April 15, 2007

What would Kwai Chang Caine do?

What would Kwai Chang Caine do?

we've all heard of "What would Jesus do?", but at this point I am more interested in what Kwai Chang Caine would do;

here are just a few great quotes from the Kung Fu series, I don't want to list too many as each should really be cherished on it's own...

"If one's words are not better than silence, one should keep silent."

"In every loss there is gain. As in every gain there is loss."

"Our soul does not keep time, it merely records growth."

And my favorite...
"I seek not to know all the answers but to understand the questions."

Kung Fu revisited

Kung Fu revisited

I recently got a chance to watch the first season of 'Kung Fu' (starring David Carradine) on DVD; I had not seen this show since I was a kid. I really did enjoy it then, but I really appreciate it alot more now and for different reasons; then it was all about the kung fu action, the wild west and Shaolin priests;

It is amazing how this show doesn't really feel very dated, well maybe just a little but in that cool 1970's kinda way. I highly recommend that you watch this show - especially if you have never seen it.

Check out for indepth information on the show or just go to Amazon and order the first season - you will not be disappointed!

Sunday, March 25, 2007

Selenium and file uploads

I have recently started using Selenium for testing web applications; pretty sweet (you know it had to be good coming from ThoughtWorks); anyhow I ran into an issue with testing File uploads; after a couple of Google searches it turns out that Selenium is using javascript requests to manipulate all the html controls and there is a built in security feature (in the browser) that does not allow file uploads to be controlled via javascript. This is probably a real good thing, I sure wouldn't want personal files being randomly uploaded to someone else's web server.

Anyhow if you simply change the browser string to *chrome it will work (at least against localhost, haven't tried it against any of our beta sites yet)

selenium = new DefaultSelenium("localhost", 4444, "*chrome", "");

Read more about chrome and other experimental browser launchers here

More on Selenium
Selenium uses JavaScript and Iframes to embed a test automation engine in your browser. This technique should work with any JavaScript-enabled browser. Because different browsers handle JavaScript somewhat differently, we usually have to tweak the engine to support a wide range of browsers on Windows, Mac OS X and Linux.
- From

Colivita/Sutterhome Norcal Corporate Crit

Went out and watched the NorCalVelo girls race the Santa Rosa Corporate Crit yesterday, took a bunch of pictures, as usual most of them were out of focus, this one turned out alright.

Read more at and at

Friday, March 16, 2007

2007 Grasshopper #2 - Chileno Valley Results

2007 Grasshopper #2 - Chileno Valley Results

The results are up - check them out here

Tuesday, February 27, 2007

2007 Grasshopper #1 - Old Caz Results

2007 Grasshopper Adventure Series #1 - Old Caz - Results are now up!

Check them out here

Also pics here

And the blog -

Monday, February 19, 2007

2007 Tour of California - Stage 1

2007 Tour of California - Stage 1
Coming over Coleman Valley

The pack coming up towards the KOM, 4 riders going off the front
Tour of California 2007 - Coleman Valley

Basso leading the rest of the pack
Tour of California 2007 - Coleman Valley

Sunday, February 18, 2007

2007 Tour of California - Prologue

Levi takes the Prologue two years in a row!
get the details at cycling news . com
he will be rolling into home town Santa Rosa tomorrow wearing the leaders jersey again!

check out these links for photos, news, live coverage etc...

looking forward to Coleman Valley!

Sunday, February 11, 2007

A client side (javascript) confirm box with ASP.NET

The following code sample illustrates a client side (javascript) confirm box in use with an aspx button, this presents the end user with a dialog box asking ''are you sure you want to submit this form?', it gives the user two options 'Ok' and 'Cancel', clicking ok will submit the form, clicking cancel will not

This sample code uses 4 variations;
  • TestButton1 - a standard html input type 'button', which submits the page using hand coded js
  • TestButton2 - a standard html input type 'submit', it has the default behaviour of submitting the form
  • TestButton3 - an asp:button with the OnClientClick (rendered as onclick) declared in the mark up
  • TestButton4 - an asp:button with the onclick defined in the code behind or c#

The aspx page markup - JavaScriptConfirm.aspx

The c# 'code-behind'

The 'key' here is the return in the onclick method; the javascript confirm will return true if 'Ok' is clicked and false if 'Cancel' is clicked, we must return this value from our buttons onclick event so that the form will not generate an HTTP POST (or PostBack if you like)

if you do not include the return statement in the onclick the form will post back regardless of which button is clicked 'Ok' or 'Cancel'; for instance you do NOT want to do this
but instead do this
onclick="return AreYouSure();" 

Generate a Guid from MSSQL

Really simple...


This returns a MSSQL datatype of uniqueidentifier
read more here -

free .NET Business Rule Engines

here are some of the free or open source .NET Business Rule Engines I have come across

NxBRE (port of the Java JxBRE)

Jaxlab Rules Engine

Simple Rule Engine - SDSRE!6B1F9DE12D24534D!131.entry

Saturday, February 10, 2007

Coding Links

Some links I wanted to keep track of...

XSD files and Visual Studio 2005

log4Net - quick and dirty for ASP.NET web applications

Tuesday, January 23, 2007

A client side (javascript) confirm box with ASP.NET

A client side (javascript) confirm box with ASP.NET

check out the code samples here

Monday, January 8, 2007

2007 Grasshopper Adventure Series

2007 Grasshopper Adventure SeriesThe 'official' flier for the 2007 Grasshopper Adventure Series has been released.

No road closures, No chp, No H2O, No Fee, No Sag, No Prizes.

- February 24th - Old Caz
- March 10th - Chileno Valley
- April 21st - King Ridge
- May 5th - Lake Sonoma

Get all the details at

Saturday, January 6, 2007

Maverick: The Success Story Behind the World's Most Unusual Workplace by Ricardo Semler

My dad turned me on to this book, took me a while to pick it up but once I did I finished it in a day; very captivating read, not in the same way as the Da vinci Code code but you get the idea.

Ricardo Semler helped to create a pretty cool work environment when he took over his fathers business. He started by firing almost all of the existing upper management and then over time created a truly 'democratic' workplace. Read an overview here.

he has some more recently published stuff as well