Friday, July 13, 2012

Windows 8 Preview doesn't work in Virtual PC: HAL_INITIALIZATION:



When trying to run the Windows 8 Preview in Windows Virtual PC, it just didn't work... I uninstalled, re-installed Virtual PC, rebooted, re-downloaded the ISO, and then realized I should have googled it sooner :-)

There Error I got was:
:(
Your PC ran into a problem and needs to restart.  We're just collecting some error info, and then we'll restart for you.
If you'd like to learn more, you can search online later for this error: HAL_INITIALIZATION


Quick Google search revealed that the native virtualization solution for Windows 7 doesn't run Windows 8!

Err....

The funny thing is that apparently it works in every Third Party virtualization environment... just none of the ones made by Microsoft.

Here are the details I found:
Forum members are reporting success using a few products. Of the most popular options, our baseline assessment is as follows:
Functional:
  • Hyper-V in Windows 8 Developer Preview
  • Hyper-V in Windows Server 2008 R2
  • VMware Workstation 8.0 for Windows
  • VirtualBox 4.1.2 for Windows
Non-functional:
  • Microsoft Virtual PC (all versions)
  • Microsoft Virtual Server (all versions)
  • Windows 7 XP Mode
  • VMWare Workstation 7.x or older

Friday, May 27, 2011

Bing Maps and Google Maps are off in the Bahamas

I was pretty blown away when I started debugging an issue for one of our users.


He reported that he would mark a way point on the web (using Google Maps), and when it went over to the phone (using Bing Maps), it showed up in the wrong place.  Now this is a pretty serious claim since that's pretty much the one thing that we should never mess up.


I started by asking our Q.A. team to confirm the issue.  They reported back that they couldn't reproduce the issue (which was some relief), but the user seemed pretty sure so I hit him up for some more specific details.  He provided a latitude and longitude, and when I retested with that, I was able to reproduce.


The point was in the Bahamas, so I started trying to brainstorm the things that could be different about the map there:


The Map Projection (Nope)
Maybe there is some funny rule for the area because Cylindrical Mercator projection doesn't work well there?  That couldn't be because that projection is the basis of the tile system that everyone uses.


Google:

Google Maps uses a variant of the Mercator projection for its map images


(Google) Maps uses Mercator because it preserves angles


Bing
We chose to use the Mercator projection



The Datum (Nope)
Maybe there is a special datum that people use here? --Maybe.  Most of the world uses WGS84/NAD83, and our apps support that plus NAD27, but there are plenty of other datums out there.


Google:
Google Maps are the GPS coordinates based on the WGS 84 datum


Bing:
The latitude and longitude are assumed to be on the WGS 84 datum




The Map Data


This can't be wrong right?  It's Bing and Google... No way either of these guys get this wrong... they can't afford to get this stuff wrong... Right?



After looking at it pretty closely, it looks like it's just a pretty simple problem: The Google Maps and Bing Maps are offset from eachother.  I don't know who is more right, but they just don't match, and all other things seem to match up, so I'm sold.  I think one of them is just plain wrong.  I tried a number of other sources, and it looks most likely that BING is wrong, but since I'm not sitting in the Bhamas with a GPS unit, I'm not sure :-)


UPDATE: The guys on the bing forums looked into this and found compelling evidence that Bing Maps are right and Google Maps are wrong.   The best way to see this is by checking out this map:http://maps.google.com/maps?t=k&ie=UTF8&ll=25.228858,-76.272143&spn=0.00757,0.013937&z=17
Here you can see that the tiles just stop stitching correctly on Google's Maps.  When you turn on the Street layer you can see that even the vector data doesn't line up correctly.
Thanks for helping identify the guilty part  



So far this is the only place I've seen bad data from bing, but I'll keep my eye out for it now :-)

Thanks to our LizardLeg for spotting the issue.

Wednesday, May 25, 2011

Convert.ToInt32(DateTime) is a Lie

Warning, this is a bit of a rant, I'm just blown away.

I'm building some new features into our C# REST API that all of our phone apps talk to and I wanted to send down a Date in the form of an integer.  I noticed that there was a surprising helper method in the Convert class called ToInt32(DateTime).  That sounded perfect for what I needed, but I really wan't sure what the format would be since you can't really squeeze a DateTime object into 32 bits.  I figured they probably had some standard though, maybe the number of seconds since 1/1/1970 (like Unix/POSIX) or something like that.  So I opened up the documentation and low and behold I find:


Convert.ToInt32 Method (DateTime)

.NET Framework 4


Calling this method always throws InvalidCastException.


http://msdn.microsoft.com/en-us/library/ch56d3w9.aspx

Using this doesn't result in a compiler error.  It doesn't even result in any warnings at compile time.  It just results in a runtime exception if you were naive enough to assume it would do something good.  What are we developing in VB?

In my mind, the biggest benefit to strongly typed languages like c# is that they should expose the fact that you did something stupid at compile time so you don't need to wait for it to crash on your when it's released... (OK: there are probably a million different reasons why strongly type languages make sense, but that's one of them ;-) )


Sorry for the Rant-- Back to being productive.

Tuesday, May 24, 2011

Windows 7: SMTP server running on localhost


I recently migrated my development machine to Windows 7 64-bit, and I didn't run into too many issues that weren't already on Google :-)

I did hit one that I didn't find a good solution for on Google though: How to install the windows SMTP component.

I figured they must have removed that component, but It turned out that they didn't remove it, they just stopped listing it under IIS in the add/remove windows components section of the control panel.

To add it you just have to (unintuitively) select the following:

Control Panel > Programs > Turn Windows feature On/Off > Internet Information Systems > World Wide Web Services > Application Development features > Turn On ASP.

It's not intuitive, but it works.

You'll now see SMTP in your IIS Manager console:

Tuesday, June 30, 2009

Nokia 6650 Certificate error.

One of the guys on the team was doing some work on the Nokia 6650 for AT&T and we kept getting a certificate error when we would try to load the build onto the device. It would say:

Certificate error. Contact the application supplier.


We had signed it with the Certificate required by AT&T, we examined the root certificates on the device, we even swapped out the device and tried another, but the problem still remained. We started pulling out MIDlet-Permissions, nothing.

Finally I made a test application that did nothing and had basically no jad attributes. I signed that app, loaded it, and it worked. I started moving in changes from the real app into the test app, and quickly found that the error was in a place I would never expect. It was in the "MIDlet-Info-URL". If you include this simple jad attribute, it will not load onto the device.

I checked all of the documentation on Nokia's developer site, and I found full documentation for the MIDlet-Info-URL jad attribute, and it seemed like it should be fully supported, but it will result in that certificate error :-/

I thought it was worth a post since it wasted hours of my life, and still doesn't seem to be documented on the internet.

Good Luck!

Friday, May 30, 2008

Building Projects and Solutions without Visual Studio

In the 2.0 version of the .net framework, Microsoft included a little gem called MSBuild.exe. MSBuild provides a command line interface for compiling entire projects and solutions.

Normally we would maintain NANT build scripts for our projects, and then we would run them on a build server, using CruiseControl .net, as our source control changed. However with this cool tool we can now build the solution directly from the sln file; removing our need to maintain build files.

I did run into a few snags:

J# support

J# is not entirely supported in the 2.0 framework, until you install the j# redistributable (3.7 mb) http://www.microsoft.com/downloads/details.aspx?FamilyId=E9D87F37-2ADC-4C32-95B3-B5E3A21BAB2C&displaylang=en

Web Applications

Web Applications aren't supported in the 2.0 framework. They came as an addition after the initial release of Visual Studio 2005. All of the information about them came with Microsoft® Visual Studio® 2005 Team Suite Service Pack 1. There was really no change required to the framework for these types of projects, it's really only affected Visual Studio, so there is no service pack for the framework.

I tried to download and install the service pack, but it's huge (431 mb) and it won't install:



So when all else fails, start over :)

The error message was:
error MSB4019: The imported project "C:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
so I just copied the \WebApplication\ folder from a PC with Visual studio installed, and added it into to the directory where it was expecting to find it (which I had to create)

Now everything works great, and life is easier than it was before. Every time I commit a change it is auto deployed to the our dev site and life is good.

Wednesday, July 18, 2007

Bluetooth GPS Getting Smaller

Check this out! It's a bluetooth GPS receiver (nothing new there) but its so much smaller than I've seen them before. It's roughly the size of a thumb drive, and it alleges to have 8 hours of battery life, which is very impressive indeed.



I did notice that the initial aquisition time seemed a little slower than it's older bigger brothers'. But I suppose that is to be expected. The quality of the GPS output did not seem any worse to the naked eye.

In general, I would probably prefer the bigger one, just because it really doesn't need to be this small, and the bigger ones do seem to get the initial fix faster, which is the most important fix, but I'll continue to play with it and let you know if I change my mind.