house9

random code and what not

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 - http://www.jessehouse.com/

Comments

cbetancourt
Move your <script> tags to the bottom of the page, right before </html> and you will see a speed improvement.

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 http://technet.microsoft.com/en-us/library/ms165724.aspx) - 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 [ 127.0.0.1 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://127.0.0.1:1434/databasename;user=sa;password=;charset=utf-8;
Initializing JDBC driver …
Driver class MS SQL JDBC Driver
Opening connection …
Connection jdbc:jtds:sqlserver://127.0.0.1:1434/databasename;user=sa;password=;charset=utf-8;
The schema could not be reverse engineered (error: 0).
ReverseEngineeringMssql.reverseEngineer :I/O Error: Connection reset
Details:
net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2277)
net.sourceforge.jtds.jdbc.TdsCore.login(TdsCore.java:599)
net.sourceforge.jtds.jdbc.ConnectionJDBC2.(ConnectionJDBC2.java:331)net.sourceforge.jtds.jdbc.ConnectionJDBC3.(ConnectionJDBC3.java:50)
net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:178)
java.sql.DriverManager.getConnection(Unknown Source)
java.sql.DriverManager.getConnection(Unknown Source)com.mysql.grt.modules.ReverseEngineeringGeneric.establishConnection(ReverseEngineeringGeneric.java:141)com.mysql.grt.modules.ReverseEngineeringGeneric.getVersion(ReverseEngineeringGeneric.java:161)com.mysql.grt.modules.ReverseEngineeringMssql.reverseEngineer(ReverseEngineeringMssql.java:164)sun.reflect.NativeMethodAccessorImpl.invoke0(Native 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 - http://bugs.mysql.com/bug.php?id=20674
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

`is_active` TINYINT NOT NULL DEFAULT (1),
had to be changed to
`is_active` TINYINT NOT NULL DEFAULT 1,


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?

Tesla Motors - electric cars

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


http://www.teslamotors.com/


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.


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.

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

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\TeamFoundation\Servers

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

Tic Tac Toe on Rails

Ok I finally completed my first rails project. Tic Tac Toe on Rails, you can check it out at http://www.tictactoeonrails.com/. 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.

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.alertErrors\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.alertErrors\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
__end

__return s
end


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.

Assembla is cool

Check out - http://www.assembla.com/

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…