Archive for October, 2009|Monthly archive page

Microsoft Linux: Why one free software advocate wants it – phoey

This is a response to:  http://www.networkworld.com/community/node/46840

There is an enormous difference between a lawyer and a software developer: lawyers charge hourly rates for thier expertise as applied to a specific individual while a software developer charges per product license.

Each legal case is unique, and each individual that requires a lawyer has unique needs and will pay a lawyer _hourly_ to help them in court, prepare those documents, etc.  I cannot imagine standing in front of a judge and saying, “Well, I didn’t want to pay for a lawyer so I’m just going to reuse these free documents that somebody else paid for your honour;  not being a lawyer myself I hope they’re relevant.  I will now rest my case”.  Lawyers do not charge you to produce documents, they charge you for their time and expertise.  The documents are a byproduct of that.

Convsely, a software developer can write a single piece of software (like an OS, spreadsheet, etc) that can potentially be used by millions of people.  It can easily take 1000s of hours to develop a single non-trivial piece of software.  For example, I’ve been working (more than) full time on my own software for over a year and its only 3/4 done.  However thousands of different people will be able to use it, and I certainly won’t be charging them all per hour.  Developers do not charge you for thier time, they charge you for their finished product.  Our expertise allows us to create that product.

So while a lawyer might spend 100s of hours for a single client (charging by the hour), a developer can spend 1000s of hours for hundreds , thousands or millions of clients.   Thus, the correct analogy between a lawyer and a software develoer would be if a lawyer got paid once for the first case and then volunteered for the 1000s of people that had an even remotely similar case.

Advertisements

Pining for a distributed version control system

I would LOVE to use a distributed version control system. While my main computer was down over the last week I was using my laptop for development, and I couldn’t check-in anything (The server was of course on my main desktop)!

Usually I’m developing one feature on my main computer and a different feature on my laptop; having a distributed version control system would be perfect because I could be checking things in on my laptop (where I do all the easy features) and only merge them into my main computer when I’m done the next major feature on it.

Bazaar – looks great

Specifically, I’d love to be using Bazaar, which at first glance looks great!   The website looks great, the focus on functionality (such as rename) looks great, the focus on usability and different workflows looks great.  This software looks great.

Subversion is almost great

About once a week I get bitten by some Subversion weirdness, almost always around renames, and sometimes caused by I don’t know what but files/directories either disappear or stick around after I’ve removed them.  Like the famous Mark Shuttleworth blog posting, I think renaming is very important; I didn’t use to think this but the more I get bitten by the lack of good/real rename support in Subversion the more I want it.

Distributed version control is not there yet

I realized the other day that I’ve become reasonably demanding about my version control.  I didn’t know this about myself, it just crept up on me.
The top features I want are, in no particular order:

  • EASY to use
  • Distributed
  • Hi quality rename support
  • The ability to do things directly in Windows Explorer (like with Tortoise*)
  • The ability to a few things in Visual Studio
    • Diff (VERY important)
    • Commit
    • Update
    • Rename files
    • Easily switch between branches

Kyle Cordes has a very nice blog posting on this subject here.

Command line tools – WTF?!

Unlike Kyle I don’t really care if it has a great standalone GUI as long as I’ve got the above features and I can easily see the revision tree somwhere then I’m good.

Additionally, unlike the <4% of Linux users (and what smaller subset of them are developers?) I NEVER want to use the command line to interact with my SCM.  Ever.  Period, exclamation point full stop.

When I read about GIT’s 2 million command line tools each one of which probably with hundreds of esoteric command line switches each of which probably accepts multiple types of options I think, “Who actually needs that and wants to spend time NOT developing to learn it all while potentially doing something disastrously wrong that could serious mess up your core repository?!”  When I read that Mecurial’s command line tools are almost the same as Subversion’s, I just don’t care!  Can you get a decent human readable diff from the command line?  Can you get a meaningful navigable tree hierarchy from the command line?!  (Plastic SCM even has a 3D revision tree for crying out loud – I DARE you to do that in a console window).  Even most Java developers (who don’t even know the kind of productivity we achieve with .NET and VS) want to do things right inside Eclipse.

For crying out loud, we’ve had graphical user interfaces since 1979 people!  If your DVCS only provides a command line interface then it’s not feature complete!  If you have to declare that your “interface is far from perfect or at least bug free” and requires 29 steps to install it then it is not feature complete.  Free is great if its works well, but I will happily pay for quality software if it does what I want at a reasonably price (read:  something a small start-up business can afford without taking out another mortgage).  (Sorry for the rant.  I do feel better now though.)  This all ties into…

It’s about productivity silly, not free software

I should mention that I do really appreciate free software and the fact  that people enjoy donating their time and expertise to free software projects.  However, I am a very goal oriented person.  I remember years ago when I was running Linux for the first time and I needed to print a report for some second year university class.  I discovered that Linux didn’t have a driver for my printer and when I asked around the overwhelming response was “Great!  Write one!”  I promptly uninstalled Linux, re-installed Windows and easily printed my report and achieved my goal of handing in the assignment.

If a tool doesn’t make me more productive than I am now thus helping me achieve my goals more quickly or easily then I’m not interested.  This is why I LOVE PostSharp and will happily pay for version 2 when it comes out.  This is also why (even though I spent 8 years working with Java and know it inside and out) that I actually dislike Java and Eclipse when compared to .NET because Microsoft and the smart people building .NET focus on making developers more productive with each release.  Conversely I saw a pannel at Java One a few years back that actually lauded Java’s complexity because it helped keep out the VB developers!  WFT?!  Sure Java will  let me run on 27 different platforms but I’ll probably never finish my software and all my prospecitve (paying) clients use Windows anway.

As a software developer I know how much time it takes to really learn the craft of designing, architecting and writing good software, and how much time it takes to actually write really good software.  Right now I’m working on building a software business, so yes, after dumping my life savings into this and living like a pauper for 2 years I’ll be charging for my software thank you very much.

So I will happily spend money on a distributed SCM if it helps me achive my goals (one of which is not breaking the bank however).  So if your free SCM doesn’t help me achieve my goals faster and easier than what I’ve got now then I don’t want to use it, and that means it needs to integrate to some extent into Visual Studio and Windows Explorer.

Why I’m using Subversion (sigh)

To this end, Subversion is very easy to use; sadly, it is not distributed and has terrible rename support that messes up about once a week but it’s manageable.  TortoiseSVN not only works on an x64 machine (which I think more and more developers have – if your development tools don’t support x64 yet then what the hell are you doing?!) but it actually exposes lots of the capabilities of Subversion (such as rename, for what that’s worth).  TortoiseBazaar, which I’d love to use doesn’t even support rename yet, which is weird considering that proper rename support is Bazaar’s claim to fame!

VisualSVN Server makes the server very easy to setup, and AnkhSvn 2.x is rock solid and wonderful so I can easily use Subversion from within VS2008.

BitKeeper, SurroundSCM don’t post their prices which means I probably can’t afford it, Code Co-Op (besides having a scary picture of a woman with a mustache on their home page) talks about the “latest” version of Visual Studio as 2005 (yikes), DARCS is apparently very buggy, and Monotone has a very cute mascot and no VS2008 or Windows Explorer tools whatsoever.

So I’m stuck with Subversion.  Sigh.

Robert

6 days of recovery – day 6: Recovering security permissions after restoring data on a new hard drive

Okay, I’ve now got the Windows system drive (C:) back up and running and using my trusty backup I have restored all my data onto the new data drive (A Seagate 1TB 7200RPM 32MB cache – nice and fast).  However, I now had a security problem:  all my old file permissions were now incorrect, and in the directory and file properties windows on the security tab I was getting “Account Unknown”:

Windows Vista Security file properties: Account Unknown

The problem was that although my user name was the same in the new Windows install, the unique Security ID (SID) used by my old Windows install was different from the unique Security ID created by the new Windows install.  This makes sense because the ID is a unique identifier (and is probably created based on the current time in milliseconds and lots of other things).

BTW, It’s possible to copy-and-paste that long numeric SID rather than trying to type it out.  From the file security property dialog box above click on the “Advanced” button, and then double-click on the “Account Unknown” in the “Permission entries” pane.  Then, you can copy the long numeric SID from the “Name” text box.

How to copy the numeric SID for an Account Unknown

My first approach was just to remove all the “Account Unknown” entries completely with the iacls command but I got a VERY frustrating message:

D:\>icacls * /remove *S-1-5-21-671368754-1592612355-3076361259-1000 /T
Successfully processed 0 files; Failed processing 0 files

I tried about 50 different variations and got absolutely nowhere, which turned out to be very fortunate because I discovered that it’s possible to simply REPLACE the OLD broken SID with the working new one!  Phew.  A little Microsoft tool called subinacl.exe did the trick very nicely.  It requires installation (?!) and doesn’t put itself onto the path (which is good I guess) and after reading the help and trying a few different things I got it to work like this:

"c:\Program Files (x86)\Windows Resource Kits\Tools\subinacl.exe" /subdirectories d:\
     /replace=S-1-5-21-671368754-1592612355-3076361259-1000=robert

So it took a little while to solve the problem but it worked!  It’s also the ONLY Microsoft Vista command line tool I’ve ever seen that actually had a “fancy” little GUI:

Subinacl at work

The red is a little scary (because I assumed something bad had happened), but it was fine and my new HDD with all my data had all the security backed up correctly, and I didn’t have to muck around trying to remember and manually reset folder permissions.  Very elegant, although it took me about an hour to figure this out!

Robert

6 days of recovery – days 1-5: Western Digital Caviar Green 1TB SATA (WD10EADS) Sucks (or I got a lemmon)

Well, it’s now Wednesday, a full 6 days after I bought a new hard drive after I decided to reformat my C:  (see  https://robertmccarter.wordpress.com/2009/10/22/ms-sql-server-2005-sp3-cumulative-hotfix-kb970892-painfull/ for all the gory details).

At first I bought a new WD Caviar Green 1TB SATA (WD10EADS).  I have NEVER had a brand new hard drive be such a lemon of a hard drive!  It was slow, but it was “green” so at first I thought that was okay.  Then I was using Image for Windows (which is a great product, I really like it) to restore my data drive and it took 24 hours to restore 200GB!!  It only took me 2.5 hours to create the image, so I started to worry.  So I let it run overnight.

But the next day when I tried to use it or defragment it things started going really, really wrong, and by wrong I mean SLOW.

So I started running speed tests on it, and sometimes the speed tests were abysmal and sometimes they were fine.  But then in Linux (I used the excellent SystemRescueCd) the speed tests were fine, so I kept trying to figure out the problem.  Then rebooting the computer started taking longer as the BIOS tried to find the drive the boot would pause for about 10 seconds.  At that point even the Linux speed tests started coming back slow, and so I knew the drive was bad.  Of course, because everything was highly intermittent and I was moving lots of data around and it was VERY slow (when it was slow) this entire discovery process took ages.

To make a long story short, I eventually decided the drive was a piece of crap, and that I would take it back.  Unfortunately, I first wanted to clean all my data off it, which is hard considering how slow the drive was.  I found this very helpful link:  http://linuxhelp.blogspot.com/2006/06/how-to-securely-erase-hard-disk-before.html.  This worked very slowly for the first 60GB, then it was VERY fast for the next 200 GB, and after that the drive gave out and never worked again.

I’ve never had a problem with a new Western Digital drive before (although I’ve had problems with older ones) so I was just unlucky and got a lemon.  So I took it back and got a brand new Seagate 1TB 7200RPM 32MB cache drive and life is good.  I restored all 200GB of my data in exactly 2:20 – nice and easy!  What a waste of 5 days.

Sigh.  As a small business owner I don’t have time to waste like this; I wish I could bill WD for lost productivity!

Robert

MS SQL Server 2005 SP3 Cumulative Hotfix (KB970892) – PAINFULL

What a pain!  Last Tuesday, 2009-10-13, Microsoft released a whole bunch of patches, my computer apparently needed 19 (?!) security patches.  One of them failed dramatically, and I’ve spent the last two weeks trying to get this security patch to install.  This is “MS SQL Server 2005 SP3 Cumulative Hotfix (KB970892)”, and I can not believe how difficult this has been to install.

My first approach was just to download the hotfix separately from here:
http://www.microsoft.com/downloads/details.aspx?familyid=0d878f4b-71e8-4170-9a14-1bce684811ce&displaylang=en

I’m running Vista Ultimate x64, so I downloaded the x64 version.  However, when I selected my database “MSSMLBIX – SQL Server Database Services 2005” the details section says that:

Setup cannot update SQL Server Database Services 2005 x86 on this computer. To proceed, run the Hotfix Setup program for the x86 platform instead.

(Which is odd, because later I tried a re-install of SQL Server Express 2005 and I could ONLY run the x64 bit version).   So I dutifully downloaded the x86 version of the KB970892 hotfix.  Here’s a video of the results:

Sigh.

Problem Event Name:   APPCRASH
Application Name:           hotfix.exe
Application Version:       1.4.1572.0
Application Timestamp:  4919b4d5
Fault Module Name:      StackHash_e52f
Fault Module Version:   0.0.0.0
Fault Module Timestamp: 00000000
Exception code:                c0000005
Exception Offset:             002d002d
Additional information 1:              e52f

The knowledge base article had links to a number of suggestions, such as setting ALL SQL Server windows services to start up automatically, however that didn’t work for me.

VERY BAD Microsoft Support

So yesterday, I finally called Microsoft Support at 1-866-PCSAFETY and I spent from 11am until 4:30pm on the phone!  Fortunately I just put them on speaker phone and worked on my laptop, but it was still an unbelievably frustrating experience!  First I talked with Lance, but after about 30 minutes the call was cut off and I was left with a dial tone.  I waited for about 20 minutes but he never called back.

Then I talked with Angie (who seemed to be much more persistent and friendly), and after trying a bunch of stuff (some of it the same as Lance) she transferred me to Ruchi, who seemed to be slightly more knowledgeable.  Ruchi  tried to uninstall SQL Server 2008.  The SQL Server 2005 instance that’s running on my machine was installed with Microsoft Office Small Business, and I’ve also installed SQL Server 2008 express as part of my development environment.   Unfortunately most of the SQL Server 2008 stuff failed to uninstall half way through the uninstall; she had also renamed a bunch of directories (c:\windows\SoftwareDistribution and c:\windows\system32\catroot), and run a few batch files that changed directory permissions to “Everybody” so that when the call was disconnected (!) my machine was left in a very indeterminate/messy state!!  All the calls (obviously to somewhere very far away) had very bad connections, and the line was full of static, crackles and pops and I could barely hear them and they could barely hear me, so I’m not terribly surprised that these calls kept being disconnected, except that I didn’t have a case number and now I had a computer in a really bad state.   What was (slightly) amusing is that they all kept saying, “is your phone okay, it seems to be bad” – how strange that if I call anybody in Canada or the USA my phone seems just fine…

Anyway, about an hour after that call was disconnected another gentleman called me and asked me a bunch of questions and had no interest in using Microsoft Easy Assist to connect to my computer (he actually trusted me).  However he finally gave up and suggested I try the paid SQL Server support team’s support.  It doesn’t seem “right” to pay for help fixing the mess their support people created on my computer trying to fix a security fix that they wrote that apparently lots of other people are having problems with!

Trying myself (again)

So I thought about the problem for a while, and decided to uninstall SQL Server 2005 – I haven’t used the small-business side of Office for a while, and I secretly wondered if it might not connect to a (repaired) SQL Server 2008 instance instead.  Unfortunately  I couldn’t uninstall SQL Server 2005, because it said there was a registry problem.

So instead I decided to re-install SQL Server 2005, and I downloaded it from here: http://www.microsoft.com/Sqlserver/2005/en/us/express-down.aspx

I figured after my previous experience with the hot fix installer that I needed the x86 version, but that wouldn’t install so I downloaded the x64 version and that installed just fine.

Then Windows Update said it successfully installed the update!  Unfortunately, after rebooting and asking Windows Update to “Check for Updates” it found “MS SQL Server 2005 SP3 Cumulative Hotfix” again!!  Sigh.

So I then installed the KB update that I had downloaded again (the x86 one that crashed in the video above) and it worked!!    This time there was two instances of the database present, the SQL Express version which the hot fix installed indicated was already updated, but the MSSMLBIX version was “Upgradable”.  The update didn’t crash, and everything seemed to be working.  I rebooted the computer and did another Windows Update and it immediately said that 1 important update was available – the same one!!  Wow, this is almost impossible to fix!

I now just found now found this on Google:  http://social.msdn.microsoft.com/Forums/en/sqlexpress/thread/c7d0a234-763b-4f9c-b7ec-3a40df6340a8.  I decided to try their suggestion (voted on by several people) of the Microsoft Installer cleanup utility to remove ALL SQL installation files and then running the update again:  http://support.microsoft.com/kb/290301

I used this tool to remove the following:

Microsoft SQL Server 2005 Express Edition [9.3.4035.00] (I had two copies of this?  I removed both – in hindsight maybe removing just one would have been best)

Microsoft SQL Server 2005 Tools Express Edition [9.3.4035.00]

Microsoft SQL Server Native Client [9.00.4035.00]

Microsoft SQL Server Setup Support Files (English) [9.00.4035.00]

So I tried running the update from Windows Update (as recommended in the blog post), and that seemed to work.  Unfortunately after I rebooted and it STILL had 1 important security update!!  Sigh.

Apparently this also broke Office, because Office now has to “install” and re-configure itself.  It’s now done this twice and it still won’t start.  I now get the error message, “Microsoft Office Word has not been installed for the current user.  Please run setup to install the application”:

Microsoft Office Word has not been installed for the current user.  Please run setup to install the application

Microsoft Office Word has not been installed for the current user. Please run setup to install the application

I popped in  my MS-Office 2007 DVD and clicked “Repair”, but unfortunately even that failed!

So I decided to try and re-install SQL Server 2005.  Unfortunately, now I get the error:

Error 1603 installing Microsoft SQL Server 2005 Setup Support Files.

So after fighting with that bug for a while I’ve decided to buy a 1TB drive (I was getting low on space anyway) and reinstall Windows.  This SUCKS!!!

 

2009-10-31:  Update

I just received this nice little form e-mail from Microsoft support.

Dear Robert,

Thank you very much for your reply. I’m glad to hear that the issue is resolved. It was a pleasure working with you and I hope you will continue to enjoy using our products.

We always strive to provide a high level of support to our customers and hope you are satisfied with the entire process of this service request. If there is anything you are not satisfied with, please don’t hesitate to let us know. Your feedback is very valuable in helping us to improve our service process and quality. Our goal is to provide first class customer service to you. We do our best to keep improving our Service Level.

At the same time, I have some tips for you if Windows Update issues are encountered in the future.

1: Windows Update issues can be temporarily. We can try restarting the computer to test if the is the issue is solved.

2: When Windows Update issues are encountered, it’s best to try suggestions given by the website first, because these suggestions are most often found to resolve the issue.

3: If one update fails, we can try manually downloading it from Microsoft Download Center: http://www.microsoft.com/downloads/Search.aspx?displaylang=en

I also would like to share more resources. Please check the Microsoft Knowledge Base, which provides a wealth of information that you can use to troubleshoot an issue or answer a question:

Search the Support Knowledge Base:

http://support.microsoft.com/kb/242450

http://support.microsoft.com/search

Another good resource is Microsoft Newsgroups:

http://www.microsoft.com/communities/newsgroups/default.mspx

Based on the current status, I will go ahead and close the case. If you need further assistance from me, please feel free to send emails directly to srxmail@css.one.microsoft.com with the Case ID in the subject line. This issue will then be reactivated for me to follow up with immediately. I appreciate the opportunity to be of assistance.

Your satisfaction to my overall service is my first priority.

Again, thank you for using Microsoft Online Support Service.

Have a nice day.

Best Regards,

 

OnCreated not called when created

I’m using Microsoft .NET RIA Services to build a Silverlight application, and today I had a bug.  At first it looked like the DataGrid’s RowDetailsTemplate wasn’t working, but that wasn’t it.

After debugging it for a little while I realized that the property I had data bound to, “FullName” wasn’t being set by the OnCreated() method,  which is a partial method called by the class’s constructor.

Apparently .NET RIA Services is using reflection in  such a way that it doesn’t call the constructor when it is creating client side objects from a server response.  This is possible using the serialization method: FormatterServices.GetUninitializedObject().  So when .NET RIA Services is de-serializing objects from the server it doesn’t call the constructor and the objects are created without their OnCreated() method being called.

In my case, the solution was simply to move the initialization of the derived  FullName property into the property getter rather than in OnCreated() method.  Then I had to implement the appropriate partial methods for the “FirstName”, “LastName” “SpouseFirstName” and “SpouseLastName”properties so that they would raise the property changed event for the “FullName” property.

Nice and easy, however it’s still a shame there’s no way for an object to know when it has been newly retrieved from the server.

VS2010 MSDN Accouncement and pricing

Microsoft just had some major announcements about VS2010 MSDN subscriptions:

1. New SKUs:
http://arstechnica.com/microsoft/news/2009/10/visual-studio-2010-simplified-to-four-skus-beta-2-arrives.ars

2. “Free” upgrade
http://www.microsoft.com/visualstudio/en-us/products/msdn/default.mspx#roadmap

Here’s a quick price comparison matrix/chart that I put together that will probably mean I’ll ditch NCover and buy MSDN premium instead, picking up Expression Studio 3 and the full version of Office 2010 in the process.

Upgrading to Visual Studio 2010
MSDN Premium
(with Ultimate offer)
MSDN Professional
MSDN subscription cost: $2,499 $1,199
Code Coverage included $658 (NCover complete)
Test prioritization included n/a
Code analysis / optimization included n/a Microsoft code contracts (watch the video)
DB dev & testing tools included n/a
Expression Studio 3 included $600
Office included $540 (Ultimate upgrade price)
Windows OS included included (Windows 7 Ultimate upgrade price)
$2,499 $2,997
$498
Other links:
Current subscriptions http://msdn.microsoft.com/en-us/subscriptions/subscriptionschart.aspx
VS in only 4 SKUs http://arstechnica.com/microsoft/news/2009/10/visual-studio-2010-simplified-to-four-skus-beta-2-arrives.ars

2009-10-30: Update!

I just watched this amazing profiling video:  http://channel9.msdn.com/posts/DanielMoth/VS2010-Parallel-Computing-Features-Tour/

Recently I was talking with RedGate about their profilers:

  1. Performance profiler: http://www.red-gate.com/products/ants_performance_profiler/index.htm $500
  2. Memory profiler:  http://www.red-gate.com/products/ants_memory_profiler/index.htm ANOTHER $620

While Parallel Tasks and Parallel Stacks are available in Pro and above, it’s not immediately clear about the profiling, but I’d guess it’s only in Premium and above, which differentiates itself from the professional version by another $1120 for a total savings of about $1620 AND its all nicely integrated inside Visual Studio.

2010-02-04: Update

For Code Contracts: “The one that includes the static checker requires VS 2010 Premium or VS 2010 Ultimate.

Static code-contract checking is amazing – I think this could save a lot of debugging time.