Friday, January 30, 2009
LogMeIn to the rescue!
Wednesday, January 28, 2009
Visual Studio Google Gadget - Revisited
- Change the blue underline (anchor link) to something more pleasant
- Highlight the item that you're over in a different color to see which one you're selecting
- Remove file extensions to the items listed
- Ability to see more than just the first 6 projects/solutions
- add a tooltip to the items that would add the full path & filename and, to add a little bit more information, when was this item last opened.
- add an icon in front of each item that would differentiate each item based on their extension.
As you can see, it looks much better than the 1st iteration of the gadget. With all this, what's left to add you ask? Where if you remember, I mention that a tooltip would be useful. A tooltip with the full path of the item would be useful in cases where there multiple versions of the same project How do you tell them apart?
Monday, January 26, 2009
Holidays, sickness and work
I'm sorry there's been such a gap between this post and last post. With the holidays, work and me being sick, there hasn't been much time for me to post. I'm hoping to get back on track and keep you posted on my progress (or lack thereof) on my GPS Golf project.
In the spirit of this project, I went out and tried my hand at a round of golf this past Saturday and have played what is probably my worst round EVER since I've been married and moved down to Florida. I posted a 118, with at least 3 holes of 10 strokes! The other big change was that I also posted many 3 putts, which is a rarity for me usually. What is the cause of this abomination? My tempo was off, I could barely breath (breathing through my mouth, except when swinging, which raised my blood pressure I'm sure) and the fact that I'm following a friend's suggestion and changed golf balls from Nike Distance to Bridgestone e6+. Golf balls don't mess your game you say? I disagree... especially if they add about 20 yards to your distance and have enough spin to stop (or backspin) once they hit the green. Try to figure out during all this disarray which club to hit to reach the center of the green which is 156 yards away... oh and don't forget that your normal 7 iron won't do now that it's 170 yards and not 150 yards! Anywho, I have work to do. I have to work on my tempo, keep strenghtening my fingers and get better health wise. The only worthy shots to note are a 60 yards chip in the hole and a 42 foot down side hill put to save par.
With all that said, you have a good week!
Sebastien
Thursday, December 18, 2008
Visual Studio Google Gadget
I was curious as to how Google Gadgets worked, and for that matter, how they were built. I set out to Google's site and looked up Google Gadget. Found the API, downloaded the SDK and I was off to a good start. My project: list recent Visual Studio projects. One step further than that, I want to be able to select which Visual Studio version I wanted to list the projects for.
After a bit of research of how to access the registry through javascript, I was off to a good start. I created the basic form, which was basically just a shell, no real content. On the load event, it would call a method that would 1) find out which version of Visual Studio to look at 2) look under the proper Visual Studio folder and see what recent projects are in the MRU. For each project found, it parses the string path and keeps the solution name and sticks it in a label on the form. If no projects are found, it creates a label that says "No Projects".
I then proceeded to create the Options page, which basically is just 3 mutually exclusive checkboxes for the 3 Visual Studio versions in question (2003, 2005 & 2008). Based on what is selected here, this will affect what is displayed on the main form.
Finally, I worked on the information displayed in the About page. I created the package (*.gg file) and tested it out thoroughly. It works like a charm!
If you're interested, here is the code (VisualStudioProjects.zip) and the gadget (Visual Studio Recent Projects-Sebastien Limoges.gg).
Tuesday, December 9, 2008
Google Maps vs Virtual Earth
I started looking at the details of Google Maps (GM) and noticed that they ignore everything after the 6th decimal. Normally, I'd say that's good enough, but in the case of GPS locations, that is very limiting. I then looked at Virtual Earth (VE) and noticed they didn't have that limitation. The other advantage of VE vs GM is that there's a higher threshold for requests per day and no need to register to receive a special key.
So I set out to test the flexibility of this Virtual Earth and quickly notice that it's using HTML and JavaScript inside a browser. This might be troublesome later when I try to stick this on the Window Mobile 6 (WM6) platform, but I'll deal with that later. For now, I just want to see if I can do what I want in a quick prototype fashion.
I start looking at the Virtual Earth SDK (http://msdn.microsoft.com/en-us/library/aa905677.aspx) and looking at the live demo (http://dev.live.com/virtualearth/sdk/) I see all I could possibly want for this project: type of map (Road, Satellite, hybrid), I can add pushpins (which are Shapes in VE) and I can grab coordinates by responding to mouse events.
After a few hours of testing and messing around with the different possibilities and permutations, I came up with a finished product that quickly demos the ability of VE for this project. You can get the code for this example at the bottom of this entry.
For the purpose of this prototype, I went back again to my good old blue hole #1 at NAS Jacksonville. I first set the "center" of the hole to get the appropriate map. I then set tentative 100, 150 & 200 yds markers and I set another one to simulate where I'd be on the tee box. I add event handlers for the mouse clicks. I set different functionality for both left click and right click. Left Click gets the coordinates of where I clicked on the map both in pixels & in latitude and longitude. It also tells me the distance (yds & ft) from where I clicked to where I'm currently at. Right Click sets my new current location, which would be handled by the GPS data normally. I also added two buttons, a plus and a minus to assist with zooming in and out (if you don't have a scroll button on your mouse). You can see below a screen shot of what it looks like in IE6.
All and all, I'm very happy with this prototype. The next step will be to figure out how to stick this inside the WM6 environment.
Until next time,
Sebastien Limoges
Monday, December 1, 2008
Upcoming MSDN Tiki Hut Roadshow related to my project efforts
I found out that there will be an MSDN Tiki Roadshow this Wednesday, December 3rd @ the FCCJ North Campus and one of the sessions relate to GPS programming. I'm going to make my best effort to be there to see if there's any aspect of data analysis that I'm forgetting and to see how they put a solution together.
For more info, go to the event's site: https://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032389331&culture=en-US
Saturday, November 22, 2008
It all starts with the math...
To use the Haversine formula, you have to make sure your coordinates are in radians, not degrees. That's simple: radians = PI / 180 * degrees. How do you go from 30° 13' 4.07" N to something the formula can use : 30.21779722222222? You parse the string. Everything is related to 1 hour. So 30 / 1 + 13 / 60 + 4.07 / 3600 gives you the 30.21779722222222 and the N gives you the sign (+). If it was South or West, it would have been negative. The formula returns miles, so if I want yards, I multiply the result by 1760 and if I want feet, I multiply by 5280.
Now that I had figured out the formulas, I set out to create a class that would handle this work. I create a class called Haversine (after the formula used) and create a Distance method that returns a double and takes in 3 parameters: Position 1, Position 2 & Distance Type. Positions are a structure containing 2 double values for latitude and longitude. I also create a method that converts degrees into radians and vice versa. The last method is parseReg which takes a string. Basically it converts a value (30° 13' 4.07" N) that is degrees, minutes, seconds & direction into a double (30.21779722222222).
To test this puppy out, I use coordinates from my favorite golf hole at NAS, Red Hole # 1. I take the coordinates of the center of the green and the coordinates of the 200 yard marker. So the center of the green's coordinates are 30 13 4.07N latitude by 81 40 58.55W longitude. The 200 yard marker's coordinates are 30 12 58.18N latitude by 81 40 57.89W longitude. Plug those in the class and I get a result of 199.951410648 yards. For golf application, I'm willing to take this as pretty accurate, especially since the coordinates for the hole were captured off of Google Earth's site, not physical reading on the course.
Well, I'm very happy with the progress made today. I have a class that can handle all the math behind calculating the distance between to points in either yards or feet. The next hard part will be to use actual satellite pictures (probably from Google Earth's site), get coordinates from all 4 corners of the picture and then be able to use those coordinates to be figure out the distance between a point on that picture and the current GPS device location. To explain, let's say I'm looking at a bird's eye view of the hole I'm on. I'm on the tee box and I want to know how far is it to reach that creek on the left. I click on the screen where I see the end of the creek on the left and based on my current coordinates and the coordinates of where I clicked, it tells me that it's 187 yards out. That's the next goal.
Until next time,
Sebastien Limoges
The code of the Haversine class is available for download below.