Saturday, December 15, 2007
Personal Web Page Revisited
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/
Random Coding Links - #1
wanted to keep track of these somewhere
Saturday, December 8, 2007
mysql migration toolkit
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?
Sunday, December 2, 2007
Tesla Motors - electric cars
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
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
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
Sunday, October 21, 2007
Tic Tac Toe on Rails
Thursday, October 18, 2007
Rails RJS and newline characters
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# rjs render a javascript alert on the client
page.alert 'Errors\nError 1\nError 2'
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
__end__return s
end
Sunday, October 14, 2007
Assembla is cool
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
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
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
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
http://groups.google.com/group/activescaffold/browse_thread/thread/58bc7fae33b62a57
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
notes and links for future reference
Books
Ruby and Rails resources
- Rails Casts
- Active Scaffold
- Ruby Rools
- Ruby Forum
- Rails Plugin Tutorial
- Active Scaffold Tutorial
- Jay Fields Thoughts
- O'Reilly Ruby and Rails articles
- Migration Cheat Sheet
IDE and text editors for Windows
Some notes and code stuff
Ruby Notes - part 1 - dynamic object creation
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 + "'"
end
# 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 + "'"
end
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
___Object.const_get(self)
__end__
end
Sunday, May 27, 2007
Ubuntu really is easy
well the install was way too easy.
- downloaded the iso image from http://www.ubuntu.com/getubuntu/download
- burned it to a cd using InfraRecorder
- 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?
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
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 http://www.kungfu-guide.com/ for indepth information on the show or just go to Amazon and order the first season - you will not be disappointed!
http://www.amazon.com/exec/obidos/ASIN/B00013F38K/continguidetothe
Sunday, March 25, 2007
Selenium and file uploads
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", "http://www.google.com/");
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 http://www.openqa.org/selenium-core/
Colivita/Sutterhome Norcal Corporate Crit
Read more at www.norcalvelo.com and at http://www.renesraces.com/corporatecrits.html
Friday, March 16, 2007
Tuesday, February 27, 2007
2007 Grasshopper #1 - Old Caz Results
Check them out here
Also pics here
And the blog - http://www.grasshopperadventureseries.blogspot.com
Monday, February 19, 2007
2007 Tour of California - Stage 1
Coming over Coleman Valley
Sunday, February 18, 2007
2007 Tour of California - Prologue
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
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 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
onclick="AreYouSure();"but instead do this
onclick="return AreYouSure();"
Generate a Guid from MSSQL
SELECT NEWID()
This returns a MSSQL datatype of uniqueidentifier
read more here - http://msdn2.microsoft.com/en-us/library/aa276822(SQL.80).aspx
free .NET Business Rule Engines
NxBRE (port of the Java JxBRE)
http://www.agilepartner.net/oss/nxbre/
http://sourceforge.net/project/showfiles.php?group_id=97759
Jaxlab Rules Engine
http://www.jaxlab.com/rulesengine/default.aspx
http://www.codeproject.com/useritems/Rules_In_Your_Apps.asp
http://www.codeproject.com/useritems/Using_a_Rules_Engine.asp
Simple Rule Engine - SDSRE
http://sourceforge.net/projects/sdsre/
http://thusithata.spaces.live.com/Blog/cns!6B1F9DE12D24534D!131.entry
Saturday, February 10, 2007
Coding Links
XSD files and Visual Studio 2005
http://blogs.msdn.com/astebner/archive/2005/12/07/501466.aspx
log4Net - quick and dirty for ASP.NET web applications
http://haacked.com/archive/2005/03/07/2317.aspx
Tuesday, January 23, 2007
Monday, January 8, 2007
2007 Grasshopper Adventure Series
- February 24th - Old Caz
- March 10th - Chileno Valley
- April 21st - King Ridge
- May 5th - Lake Sonoma
Get all the details at http://www.norcalvelo.com/
Saturday, January 6, 2007
Maverick: The Success Story Behind the World's Most Unusual Workplace by Ricardo Semler
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.
http://www.amazon.com/Maverick-Success-Behind-Unusual-Workplace/dp/0446670553/ref=pd_sim_b_1/105-3077826-1463608
he has some more recently published stuff as well
http://www.amazon.com/exec/obidos/search-handle-url/105-3077826-1463608?%5Fencoding=UTF8&search-type=ss&index=books&field-author=Ricardo%20Semler