I'm a huge Blackberry fan.  I have had a Blackberry for close to 6 years now and have never looked back. They do what they are designed to do (email and phone), no questions asked.  I've used windows mobile phones and have a few friends that have them and it seams like they are always having issues.  The iPhone is definitely a strong competitor but without a real keyboard and push email its not an option for me.  There is one huge are area that Blackberrys and RIM (Research In Motion) is lacking in and that's developer support. While there are many things to complain about the issue that pains me the most as a web developer is the Blackberry Browser.

The iPhone browser rocks.  The Blackberry Browser doesn't.  Its like developing for IE 4.0.  There is limited xhtml  and css support and if you follow the documentation its possible to create a functional website that looks decent  on the device.  There is very little javascript support, but it does have support to get GPS coordinates from a device with builtin GPS, like the Blackberry 8800, 8820, and 8310, which could be used to create some very cool location based websites.  Unfortunately the documentation is completely wrong.   The information in the content developer guide is just plain wrong and sample code on the blackberry developer website isn't even valid javascript.

Here is what I have found to be a more accurate description of the blackberry.location javascript API in the blackberry browser based on my testing using a Blackberry 8800 running v4.1.1.90:

gpsblackberry.location.latitude & blackberry.location.longitude:
The current latitude and longitude of the device.  The first time you access either of these properties the user is prompted if they would like to let the website access location information.  There is currently no setting on the device or on the enterprise server to disable this prompt or whitelist specific sites. If the user selects "No" then "0" will be returned for the latitude & longitude.

blackberry.location.setAidMode(aidMode):
This method sets the GPS aid mode to be used. 0 - Cell Site, 1 - Assisted, 2 - Autonomous.  The documentation is mostly correct on this method. "Autonomous" is the most accurate and most supported but also the slowest. The other two methods require carrier support and my carrier doesn't support it so I couldn't test them.

blackberry.location.refreshLocation():
This method request and update of the location from the device.  This method is non-blocking so if you try to read the laitude/longitude right after calling this method you may or may not get the newest information.  This method returns true on success.  If you have set an invalid AidMode (0 or 1 and the carrier doesn't support that feature) this method will return false and the callback method will never be called.

blackberry.location.onLocationUpdate(callbackJS)
This method is the worst a far as incorrect documentation goes.  This method sets a callback function that is called after you call refreshLocation() and the device actually has the new location data.  However in my testing it appears that this does not get called once per refreshLocation() call.  After you call refreshLocation() the callback function is invoked continuously when the location changes (about every 10-15 seconds in my testing). Another very important note is that you have to pass this method a string that gets evail-ed (like you can do with setTimeout).

 

Here is a sample that puts all of the pieces together.  It simply shows a javascript alert with the latitude and longitude when the location is updated:

   1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
   2: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   3:   <head>
   4:     <title>GPS Testing</title>
   5:     <script "text/javascript">
   6:  
   7:       // called when location object changes
   8:       function locationCB()
   9:       {
  10:           alert("Latitude "  +
  11:               blackberry.location.latitude);
  12:           alert("Longitude " +
  13:               blackberry.location.longitude);
  14:           return true;
  15:       }
  16:  
  17:       // test to see if the blackberry location API is supported
  18:       if( window.blackberry && blackberry.location.GPSSupported) {
  19:             document.write("GPS Supported");
  20:  
  21:  
  22:             // Set our call back function
  23:             
  24:             //WRONG: this would call our call back function immediatly, not after the refresh
  25:             //blackberry.location.onLocationUpdate(locationCB());
  26:             
  27:             //WRONG: the blackberry browser won't support passing a method.
  28:             //It will error on refresh and all javascript processing on the page will stop
  29:             //blackberry.location.onLocationUpdate(locationCB());
  30:             
  31:             
  32:             // RIGHT: pass a string that calls our method
  33:             blackberry.location.onLocationUpdate("locationCB()");
  34:             
  35:             // set to Autonomous mode
  36:             blackberry.location.setAidMode(2);
  37:         
  38:             //refresh the location
  39:             blackberry.location.refreshLocation();
  40:       }    
  41:       else
  42:       {
  43:         document.write("This Device doesn't support the Blackberry Location API");
  44:       }
  45:     </script>
  46:  
  47:   </head>
  48:   <body>
  49:   </body>
  50: </html>

 

Hopefully someday we will get a more feature rich, fully documented, Blackberry browser with DOM and AJAX support  (Firefox mobile anyone?).  Until then hopefully I have saved someone days of debugging incorrectly documented features.

Posted at 5/8/2008 2:40 AM
Comments [2] - Permalink
Here is a simple script that will automate the process of replacing notepad.exe with notepad2.exe in Vista.

I borrowed the idea from Jens Schaller and Lifehacker. Just save the code in a .bat file in the same directory as notepad2.exe and it will take care of the rest.
takeown /F c:\windows\notepad.exe
icacls c:\windows\notepad.exe /grant administrators:F

takeown /F c:\windows\system32\notepad.exe
icacls c:\windows\system32\notepad.exe /grant administrators:F

copy notepad2.exe c:\windows\notepad.exe
copy notepad2.exe c:\windows\system32\notepad.exe
Posted at 4/14/2008 10:36 PM
Comments [0] - Permalink

It looks like the fat lady is singing for HD DVD.  Netflix just sent me an email that they are switch to Blu-Ray only.  They are even going to switch the movies that are already in my queue to standard definition DVDs.  I hope that Microsoft releases a Blu-ray add on for Xbox 360.

netflix email

Posted at 2/11/2008 3:56 PM
Comments [0] - Permalink

We have been running Exchange 2007 basically since it was released.  Over all it is a great product and quite an upgrade over Exchange 2003.  Last month SP1 was released with some much anticipated improvements, including major improvements in the administrative UI, OWA, and more.  Unfortunately not all of us gets those new features.

The service pack installer is actually a full copy of exchange, not an patch. So just like the first time you install Exchange 2007 the setup runs through the "Readiness Check" to make sure you meet all the requirements.  Seeing how Exchange is already installed I wasn't too concerned about not meeting any of the requirements.  Boy was I wrong.  I was quickly greeted with an unexpected error message:

Error:

Microsoft Exchange Server 2007 setup cannot continue because this computer belongs to a domain that has a single-labeled DNS name. DNS domain name: mydomainname

Humm.  That's not good.  It appears that exchange doesn't like the fact that the windows domain name is "mydomainname" instead of something like "mydomainname.local" or "mydomainname.com".   I knew this day would come.  We have avoided renaming the domain for a while now because it is not a fun process.  The instructions to rename a domain are contained in an 82 page 1.2MB word document, and that's before you event get into the exchange stuff.

So I read all the documentation and was prepared to pull the trigger when I came across an interesting Knowledge Base article.  In summary you can't rename a domain that has an Exchange 2007 server in it, and if you do the only solution is to rename it back.

So I can't install SP1 with a single labeled DNS name and if you have Exchange 2007 already installed you can't rename the domain.  Microsoft just backed me into a corner.

I'm not alone as it appears there are several other people with this problem.  The worst part is the lack of documentation.  None of the release notes talk about this the requirement.  Even the new Deployment checklist doesn't say anything about it.

HELP MICROSOFT!!!  We want SP1 too.

UPDATE: 
It looks like the Exchange team is listening.  They posted on their blog that they are looking into the problem and will have an update by February 15th.  If you don't want to wait commenter inf pointed me to a registry hack to get around the domain check.
Posted at 12/20/2007 7:52 PM
Comments [2] - Permalink

A few weeks ago I decided to give Visual Studio 2008 a shot after reading all the good reviews.  I'm now using it as my primary development environment with and overall it is a nice upgrade.  Intellisense feels smarter, the IDE looks cleaner, the web designer is much nicer, and lots of other good stuff.  Unfortunately I have run into a few problems.

Web Deployment Projects - Currently web deployment projects are not supported in VS 2008.  I am a huge fan of WDP, recompiling a web application project not only makes the site load faster (at least on the initial page load) but also simplifies deployment.  It leaves me with a nice clean directory free of .vb or .cs files that I upload with having to worrying about deploying source files.  It also ensures that my aspx pages don't have any parser errors.  For VS 2005 WDP shipped as an add-in and I was hoping it would be included as part of VS 2008, just like Web Application Projects.  After some searching it look like we aren't going to get WDP in VS 2008 until after the final version ships.  Currently the top suggestion on Microsoft connect is for WDP to be included in VS 2008.  Maybe I'm wrong but it seams as if WDP isn't a very complex add-in, its just a wrapper around asp_merge.exe 

Microsoft Visual StudioBusiness Intelligence Projects - It looks like SQL Server Report Services projects (*.rptproj files) aren't supported either.  You get a lovely error message that lets you know that doesn't sound very optimistic about getting these reports to open in VS 2008.  My guess is I'll have to wait for SQL Server 2008 and will then be forced to update my sql server in order to use my development tools.

All in all I'm a VS 2008 fan, but its still in beta and it shows.  I rarely have major problems, like a complete crash, but the smaller issues can still be bothersome.   It is great thought that Microsoft is getting these beta versions in the hands of developers, hopefully in an effort to make a better final product.

Posted at 9/19/2007 11:14 PM
Comments [0] - Permalink

While not exactly as soon as everyone hoped, dasBlog 2.0 is set to be released next Tuesday.  The biggest change is that dasBlog is now compiled under .NET 2.0 and ALMOST fully supports medium trust. The goal of medium trust is for hosting providers to provide functional ASP.NET 2.0 hosting while also protecting against rogue or malicious applications.  Unfortunately that protection comes at the cost of application flexibility. We tried our best but in the battle between security and functionally there are a few features that are limited in a medium trust environment:

  1. SMTP on alternative ports
    • This requires SmtpAccess.ConnectToUnrestrictedPort on the System.Net.Mail.SmtpPermission.  In a default medium trust environment you only get SmtpAccess.Connect, which allows for port 25 access but that's it.  I would assume that this is to prevent spamming and maybe to prevent using the SMTPClient class to launch socket based attacks.
  2. Mail to Weblog via POP3
    • This requires SocketPermission to at least the port and address of your pop3 server.  With the default medium trust settings you do not have any Socket Permissions.  This prevents applications from launching network based attack.  This is especially important if the web server is located behind a firewall because then an asp.net application could access network resources intended to be protected by the firewall.

dasBlog will let you know that you don't have these privileges by displaying warnings on the configuration page:

smtpCapture

pop3Capture

There is some good news though, these limitations won't affect most users.  Many hosting providers that run limited trust environments don't run in the default medium trust, but rather a "modified full trust".  In that case you may already have all the permissions you need for all of the features to work.  

If your hosting provider does run the standard medium trust configuration or their custom trust level doesn't provide the necessary permissions there is still hope. Normally hosting providers allow access to a mail server that runs on port 25.  In most cases it doesn't even matter if the from address dasBlog is using is hosted on that server, as long as you are authenticating with a valid SMTP user.  The POP3 issues is a bit more difficult.  There are legitimate reasons for a provider to limit socket access, but if you ask nicely they might make an exception for the specific POP3 host you are using.  

There is only last consideration that needs to be accounted for in a reduced trust environment.  You can read more details here, but the basic idea is that in the default medium trust environment you can only do outbound web connections that match your originURL.  OriginURL is specified as a regular expression in your web.config file.  Setting it to ".*" will let dasBlog connect to any host.

For more information about dasBlog check out http://www.dasblog.info, and if you are have any questions about medium trust or anything else feel free to post on the dasBlog forms at http://www.dasblog.us

 

 
Posted at 8/12/2007 12:11 AM
Comments [4] - Permalink

So I'm going on vacation next week and being the connected person I am my laptop will be by my side.  I stumbled across a good deal on a second 1GB stick for only $25 after rebate.  Installing the ram was easy as pie in my T60, just unscrew the four screws that have a little ram chip picture next to them and then lift up the touch pad area.  I popped in the ram and turned the system back on.  BIOS shows 2GB so all is good right?

Unfortunately it wasn't that easy.  Vista now wants me reactive.  I tried the online activation with no luck.  I called the 800 number, read the IVR system nine sets of six numbers and of course it couldn't activate me either.  I finally got a person on the phone, definably an overseas individual but their English was great and he was very helpful.  I only had to give him the first set of six and let him know the only thing I did was install ram he promptly gave me the necessary code to reactivate.

While the process wasn't very painful I shouldn't have ever had to do it.  I would assume that adding RAM is one of the most common hardware changes and its someone ridiculous that it would require re-activation.

While I respect Microsoft right to protect their software it is really the guy that follows the rules that gets hurt.  I could have downloaded a hacked version of vista using an OEM bios and never had the problem but instead I followed the rules and had to jump through hoops because I want to follow the rules.

Posted at 7/18/2007 10:16 PM
Comments [0] - Permalink