Wednesday, November 09, 2005
At the Wisconsin .NET user's group's Visual Studio/SQL Server 2005 launch even last night I won full copies of Visual Studio 2005 and SQL Server 2005.  Of course I already have these through MSDN and the copies are marked "Not for Resale".  They're valuable so I don't want to just give them away.  I did note that they are not marked "Do not trade this for an XBox or Beer"...
Wednesday, November 09, 2005 9:08:04 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, November 04, 2005

I had a small master page issue which I fixed quickly but which made me want to complain.

One of the great things about .NET is the great design time experience.  Dropping designer support for nested master pages irked me, and there are some other quirks as well.  In one case, I have a page using <div> and the "float" style attributes for layout.  As soon as the divs are nested three deep or so the content no longer renders in the designer.  It seems to be specifically related to the style as I will explain along with the next issue.

In my master page for the site I import a style sheet like so:

<style type="text/css">@import url(kcstyle.css);</style>

Obviously this is a relative path.  If you create sub-directories beneath your site obviously this won't work so I changed to an absolute path like so:

<style type="text/css">@import url(/KlipschCorner/kcstyle.css);</style>

When the content renders in the designer now it does not show my styles for any pages regardless of directory.  When I run the site however all pages look great regardless of directory.  Now that the designer can't find the stylesheet, the content which did not render inside my <div> tags before is now visible in the designer.  I would assume the designer is in some way using an IE component to render behind the scenes but this might not be the case.  The answer seems likely to be the fact that the "ASP.net Development server" is not behaving in the same way that running the site via IIS would.  The inconvienient part is that if you are using newer standards like <div style="float:left;"> for your layout, the designer view looks nothing like the fully rendered view.

Compare this view without style:

To this one when the site is actually ran:

The only difference is the stylesheet.  Maybe I'm complaining about something petty here, but it seems that this type of thing is going to annoy a lot of people.  Isn't part of the point of the designer that you don't have to run it to see what it looks like?

Friday, November 04, 2005 2:25:00 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Thursday, November 03, 2005
I had some odd issues with SQL 2005 last night.  It seems that the surface area configuration tool and the SQL 2005 Native Client bear some investigation.  I was building connection strings just like I would for SQL 2000 and getting a "No process is on the other end of the pipe" error. At http://msdn2.microsoft.com/en-us/library/ms175496.aspx there is some discussion of the issue but none of the fixes worked, I actually had to turn off the shared memory connection to get it to work.  I'm sure there's an explanation for this but I'm not interested in learning the gory details of SQL 2005 yet, I just wanted to get working on my application again.
Thursday, November 03, 2005 10:15:56 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, October 31, 2005

So, working on my first web app using ASP 2.  I had really only messed around with the mobile stuff during the betas.  My goal here is to see how robust the built-in controls and frameworks are.  On the surface everything seems very nice and configurable but we'll see what things are "toys" and what things are worthy of serious consideration.

Visual Studio installs SQL 2005 express by default.  This caused me some woe today since I uninstalled Express and installed Developer Edition instead.  Using the site admin tool, my AspNetSqlProvider is not working, and suggests I run aspnet_regsql.  Did that, did not fix it although it did create the membership tables in my SQL 2005 database.  Hmm, looking at machine.config and did a search for AspNetSqlProvider.  A connection string called "LocalSqlServer" is referenced everywhere and the value was...

<connectionStrings>

<add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient" />

</connectionStrings>

Well then, that won't work if I just got rid of Express.  I suppose there really was no need to un-install express after all if its just an Access replacement and isn't running a service taking up my CPU cycles?  I'm just guessing by looking at the connection string here.

At any rate, in your web.config you can do the following

<connectionStrings>

<remove name="LocalSqlServer"/>

<add name="LocalSqlServer" connectionString="data source=BigFatLaptop\SQL2005;Your info here" providerName="System.Data.SqlClient"/>

</connectionStrings>

and then it should work for you.  More observations as I get time to mess around.

Monday, October 31, 2005 5:20:13 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Wednesday, October 26, 2005

I saw over on Sean's blog that MySQL 5.0 is released.  Before I get too into this rant let me say that MySQL is a fine tool in some situations.  I'll steal the highlight's of the release from Sean as well:

  • Stored Procedures and SQL Functions -- to embed business logic in the database and improve performance;
  • Triggers -- to enforce complex business rules at the database level;
  • Views -- to ensure protection of sensitive information;
  • Cursors -- to allow easier database development and reference of large datasets;
  • Information Schema -- to provide easy access to metadata;
  • There's more but this is enough for me to talk about.  Take a look at that list.  Does anything strike you as odd?  If not, let me roll back the clock just a little while to when MySQL added another great new feature.  The developer team called this feature "Support for Transactions", I believe it was added in version 3.23.  I'm being an ass of course, Transactions had been in every other relational database, including crap like Access, since the dawn of time.  The MySQL fans made such a big deal out of this that I had to grin. Transactions!  What will they think of next?  Pretty soon they'll support sub-selects and ANSI standard JOIN syntax. This is the database I am constantly hearing is "better" than things like Oracle, and UDB, and SQL Server. 

    Now we have another release with some great new features.  I have many complex feelings on this issue, since I do in fact like MySQL.  Despite liking it, I think I can sum up my feelings with this press release:

    "Kia Releases new Car V2.0.  Standard options now include:

    • Tires: increases vehicle handling and makes wheels last longer
    • Brakes: car now has the ability to "stop" at a rate greater than the coefficient of rolling friction on standard road surfaces
    • Side Windows: Driver can now see in directions other than forward, huge safety increase
    • Seat Belts: we know this "air bag" fad is very popular, but we feel seat belts provide the best balance of total cost of ownership with safety.

    "

    I guess the reason I feel inclined to poke at MySQL is that I am always hearing from its fans how it is so much better and faster than big expensive RDBMS's.  The speed one I found especially irksome, and my quest to prove or disprove this rumour led me far and wide.  I landed at the Transaction Processing Performance Council's web site: http://www.tpc.org/;  I was shocked (by shocked I mean utterly un-surprised) to find that MySQL is nowhere on these performance lists.  A little digging shows that its somewhat expensive to participate, which may be a barrier for a free product.  A little more digging shows that a non-profit company can submit their product for a ridiculously small fee ($500-$1000), now I was shocked to find MySQL not on the lists.  A little more digging shows that MySQL just plain isn't standards compliant so cannot participate in the test anyway.  I do not have a list of what features are missing but I suspect near the top are various transation isloation settings and things of this nature.  Specifically: the type of things you'd want in a big enterprise database where disastor recovery and data integrity are of paramount important, the type of things that slow your database down just a little bit...

    I like MySQL, but I doubt its "better" than Oracle or SQL server unless your sole metric for judging value is the fact that its free.  "Free" is a loaded term anyway, but the MySQL team is working on making it easier to use and providing good tools.  There seems to be an aweful lot of people willing to accept on blind faith that MySQL is better than high-priced alternatives.  That's fine if you want to defend your religion, but if you want to convince me that you are better, you have to show me.

    Wednesday, October 26, 2005 11:05:02 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
     Thursday, October 13, 2005

    This is by no means new:

    Palm/Microsoft are going to port WindowsMobile to run on Palm hardware.  Microsoft makes very little money off of licensing for WindowsMobile/CE so this move must be an effort to sell more of the things that go along with mobile systems: back end integration, lock people into the WindowsPlatform, etc.  Does this mean we may see ActiveSync get some more attention and maybe get ported to more platforms?

    Palm has always had great hardware in my opinion and was absolutely an innovator in this field.  I believe having their own OS has contributed greatly to their downfall.  With Windows CE we have had eVB, eVC, the .NET CF for years.   They weren't always great but they were all VERY usable small device development environments.  With Palm you have had C++ using CodeWarrior and J2ME using the KVM.  I have not looked at J2ME in a couple of years, but I have seen some big names post about it: it's not very good.  Maybe I am out of touch with the community, but I've never heard of a big app being written on PalmOS the way I do about windowsmobile stuff.  I run into mobile apps all over the place: at the airport, in Kohls or Target, at the rental-car place; every one I've gotten a chance to look at was undoubtedly a  Windows CE based device.  Big apps being written on these things means companies like DAP, TDS, Symbol, Intermec get orders for hundreds of units at a time, meanwhile Palm has been (as far as I know) relying on individual purchasers to upgrade their units to be able to view their calendar faster or store that extra million contacts they were missing. 

    Since I may end up evaluating palm units on a future project I'm curious: can anyone else tell of their experience developing for Palm over the past several years?

    Thursday, October 13, 2005 3:19:23 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
     Tuesday, October 04, 2005

    Yesterday in the middle of compiling some code my computer blue-screened.  Subsequent attempts to start it up kept giving "Unmountable boot drive", the hard drive had bit the bullet.  Luckily I back things up to an external drive semi-regularly.  I went to a friend's work where he builds PCs and got a laptop hard drive.  He also had an adapter so that I could hook my crashed HD up to a regular PC's IDE chain and sure enough I could get most of my data off of it and burned onto a DVD so I didn't even need to go to my backups.

    If anyone knows a quick way to get the contents of My Documents off of an NTFS drive let me know.

    Due to some funky display driver problems I spent 6 hours last night:

    1. Install windows xp
    2. get display drivers working
    3. Windows update
    4. service pack 2
    5. more windows update
    6. Office
    7. Office update
    8. ActiveSync
    9. Messengers, etc.

    Today, I had to stop by the office to get MSDN discs for:

    1. Visual studio
    2. MSDN
    3. Source Safe
    4. eMbedded C++4
    5. Visio
    6. Sql Server

    ... and on and on and on.  Despite having a halfway decent laptop I estimate it will be a total of 12 hours of installation easy.  Despite the various advances in hardware and software technology in recent years a couple of things are still sorely missed:

    • Can we get these things to boot up faster?
    • Can we get the install time for a complete development environment below 12 hours?

    Visual Studio is 50% done, I'm going to go read something.

    Tuesday, October 04, 2005 9:58:48 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [2]  |  Trackback
     Monday, September 26, 2005

    I recall reading a best practice somewhere that you should neither give nor expect null as the result of a method invocation.  This was absolutely the norm in C++ despite the somewhat common notion of the NullObject pattern (http://www.eli.sdsu.edu/courses/spring98/cs635/notes/strategy/strategy.html#slide8); the practice is still so common in .NET languages that I doubt many people are familiar with the notion of a null object.

    Today I began self-reviewing my code for a mobile project I am in the process of wrapping up.  I found that this notion had made its way into some of my code and for the sake of consistancy I went about repairing my error.  The fact that I had things like

    CustomerDataAccess dao = new CustomerDataAccess();
    CustomerTruck ct = dao.FindByBarcode(bc);
    if (null != ct) {
    //Do something
    }

    in (shamefully) about half my code made me take a step back and question the value of what I was doing. First of all, I find it amusing that I still keep to the old C++ "Put your constants on the left hand hand side of any comparison" practice.  For those of you who never had the honor of programming C++ the following code would compile, but give you unexpected results:

    if (lValue == 3){
    // do something
    }
    //Versus:
    if (lValue = 3) {
    //whoops...
    }

    ...since both "=" and "==" are valid inside an if statement.  To make a long story short, any successful action such as this will return a non-zero value and failure a zero value.  In C++ "if (0) " is valid syntax and therfore this could result in a hard to track down issue.  My question to my mentors was always "Well, if I can remember to use the const expression as the Lvalue why can't I just remember to do it right?"; but that's neither here nor there.

    There are some examples of a NullObject pattern in the current .NET framework, for example using string.Empty instead of "" or null. 

    Thinking further, many have accidently (mis)used this pattern for value-types in the current .NET language.  Have you ever used DateTime.MinValue in your code to signify "No value here" ?  In .NET 2.0 we will have nullable value types (http://msdn2.microsoft.com/en-us/library/b3h38hb0) to make this a little bit cleaner for us. 

    As I replaced code such as if (null != ct) with if( ct != CustomerTruck.None) it certainly did look cleaner and made me feel better about myself as a person but I wondered if it was worth going back over working code to do.  One additional benefit is that if I DO forget to check for null (or proper NullObject) in code somewhere, I will likely get some expected behavior rather than a NullReferenceException.  

    My questions to the community are these: do you have your own argument for using a NullObject Pattern?  Do you use the NullObject pattern?

    (Thanks to Terski for being my pre-post sounding board yet again)

    Monday, September 26, 2005 2:40:44 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [4]  |  Trackback