Hi! Thanks for visiting my blog. If you've received any value from my content would you mind supporting my new startup by downloading our browser add-on? It's called PriceBlink and makes online shopping a breeze. You can watch it in action here and download it for Chrome, Firefox, IE, or Safari by going to PriceBlink.com. Thank you and I hope you enjoy!

Displaying Altitude with Google Maps

Apr 17

In conjunction with displaying speed and direction on Google maps I’ve added the ability to view altitude. The approach is a little different in that altitude is not displayed directly on the map, but underneath it. There are quite a few tweaks that I’m working on, but at least it’s in a demonstrable state.

When you mouse over the altitude chart you’ll get a tooltip and the map will recenter to the corresponding location. The user experience is a bit choppy and I’m thinking about recentering on mouse click instead. I’d also like to display an info window when the map is recentered, but I’m not certain how I’ll get this working in the current format. This is more conceptual than something useful and I’m hoping to create a more seamless experience over the next few weeks. Click here or on the image below to see the interactive version.

Read More

Ruby on Rails WEBrick Returning Blank Pages

Apr 17

I was trying to access some session info in my Rails application and all of a suddent started receiving HTTP 500 errors from the WEBrick server.  This resulted in completely blank pages throughout the entire application.  It didn’t matter whether or not I was accessing legitimate controllers and actions, EVERYTHING was broken.

I searched around for a while and luckily came up with this link that talks about deleting Rails session files.  After clearing out the session files I was able to run the application again.  I’m not sure exactly what caused the problem, but at least I’ll know for next time.  Hopefully this is an infrequent event that only turns up in my development environment.

Read More

Ruby on Rails Conditional Assigment Operator

Apr 16

I’ve found an interesting operator that I’d like to share.  I’m pretty fascinated with it because in ColdFusion I fell in love with cfparam for assigning default values that could be overridden.  You can achieve the same in Ruby on Rails using the conditional assigment operator.  This comes in handy when setting session or even url variables.  An example of its usage looks like:

def yourmethod
@params[:name] ||= ‘dennis baldwin’
end

That’s how it would be defined in your controller and displaying it within your view would look like:

Hello <%= @params[:name] %>

By default this would display Hello dennis baldwin. Now passing a url parameter called name into your controller would yield different results.  Let’s say that it looks something like http://www.yourapp.com/yourcontroller/yourmethod?name=somebody, then you would see Hello somebody.  The default value is overridden and the specified value is displayed.  Once again Rails makes this extremely clean and simple.

Read More

Displaying Speed and Direction on Google Maps

Apr 16

I recently posted about displaying speed on Google maps. I’ve been wanting to represent other information graphically so I decided to add direction. The icons now represent speed (within a range) as well as direction. Direction is currently sent in degrees from the GPS unit, so I’m translating this to one of eight segments (N, NE, E, SE, S, SW, W, and NW). It’s accurate to within 45 degrees and works well for casual analysis. You can click here or on the image below to see the interactive version. The image displays my recent trip to Austin and I’ll be working on displaying altitude next.

Read More

Displaying Speed on Google Maps

Apr 14

As I’ve been working on my Bluetooth GPS app for Windows Mobile I’ve been thinking how to display useful information on a map. The GPS receiver provides all sorts of data such as location, altitude, speed, direction and many other things. Instead of displaying this information in a simple text format I’d like to do something more visual.

Tonight I was able to work up a basic speed example that represents three different states: 0-15 MPH (red icon), 16 – 45 MPH (yellow icon), and anything over 45 MPH (green icon). You can see a screen of a recent trip. I used my Bluetooth GPS app, which currently logs data to a text file. At the end of the trip I’m able to upload the data to my server. I’m still working on getting the real-time piece in place. This would allow my Windows Mobile device to upload data to the server while I drive.

My next step for the UI piece will be to represent direction in a visual format. This will most likely come in the form of a rotated icon since the GPS receiver returns direction in degrees (in relation to north). Representing altitude will be more challenging and for now it will simply display in the info bubble when you click on a marker. You can click here or on the image below to see the interactive version.

Read More