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
 Wednesday, September 14, 2005

Due to the Visual Studio 2005 launch event in November my presentation of the Compact Framework version 2 to the Wisconsin .NET user's group has been pushed back to January 2006.  Considering how cool VS 2005 is I think its safe to say this launch event will be better than anything I could have possibly presented.

The CF 2.0 release is very near and dear to me due to the amount of pain I have experienced in the CompactFramework 1.0 and SqlCE 2.0, and conversely the joy I have found in porting one of my mobile apps to the new platform.  There are so many different things I could discuss related to the state of mobile development, I'd welcome anyone's ideas for specific things they'd like to see covered.  Some of the points I planned to touch on:

  • Important API differences
  • Important CLR differences
  • Important Visual Studio differences
  • SQL Mobile: this is a big one, especially from a performance perspective
  • COM interop on the CompactFramework
  • Data Sync processes
  • Discussion of Active Sync and Emulators
  • Discussions of Smartphone vs. Windows CE builds vs. WindowsMobile builds

I'd welcome any comments at damon@damonpayne.com ;see you in January.

Wednesday, September 14, 2005 1:55:24 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, September 06, 2005

Next Tuesday the 13th I will be attending the .NET user group meeting, however it is also a birthday for me.  Being "young at heart", I still like my birthday.

The following Saturday, the 17th, will be an annual event, of epic proportions.  I have a good friend who's birthday follows mine by two weeks and for several years we have been having an Uber Party on the weekend in between.  If you have nothing better to do and would like to truly see me at my worst then feel free to join us at Hooligan's Super Bar on the East side for food, just look for me preaching about something to 20 or so uninterested rowdy people.  The yearly tradition ends with a trip to The Safe House where my friend and I drink two or three Mission Impossibles (Missions Impossible?) each.

Tuesday, September 06, 2005 3:41:55 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Wednesday, August 31, 2005

Random Task is my idea for a Visual Studio add in.  The premise is simple, as are many good ideas.  Either you will immediately see the value in this due to your own work habits or you will think it trite.

I do a lot of work on various different things: I have several different solutions for my day job, I have a couple of solutions for side work I spend a lot of time in, and several solutions I only spend time working on from time to time.  Visual Studio is always open if my laptop is on.  My issue is that I often switch between three or more solutions in a sitting and find it difficult to guestimate how much time I spend working on Project A, then Project B, and billing those clients accordingly.

Random Task, then, is a Visual Studio add in that records timestamps for when I open and close solutions.  The UI for the add in can then report on how much time was spent on each solution (and therefore client) just by keeping track of Visual Studio .NET time.  This would save me a lot of pain in "Erring on the side of safety" and essentially under-billing everyone in my efforts to be fair.

I did a quick proof of concept in VS 2003, but there are actually a couple of code contests I could submit this to if I upgrade to VS 2005.  The extensibility IDEs are not a part of the normal Beta 2 distribution so I had to join the Visual Studio Partner Program and download the VS 2005 version of the SDK from http://www.vsipdev.com/downloads/ 

Wednesday, August 31, 2005 9:16:09 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [4]  |  Trackback
 Tuesday, August 30, 2005

Look at me, I am such a waste of space that I am not producing anything of value, I merely react to other people's original thoughts with thoughts of my own.  So casey is upset about ever-tighter digital rights management built into Windows, and maybe some day hardware as well.  Let me first share some of my thoughts:

  • I think the companies comprising MPAA and the RIAA horribly mistreat the artists without whom they would not exist.  I think these companies do not recognize an artists Moral Right to their work, nor is "Fair Use" in their vocabulary
  • I think these companies produce a ton of crappy content and then blame piracy for their downfall rather than ponder the idea that I don't feel like me and the Mrs. going through the tedium of acquiring a baby-sitter and then paying over $20 for two tickets and crappy popcorn just to sit in front of something that is 99.9% likely to suck. (It sure is loud though)

That being said, I see no issue with digital rights management as long as it does not interfere with my fair use of something I paid for. I am a strong believer in Capitalism, and as such I can choose or not choose to engage in any transaction with another party.  If I choose to buy something from someone, I must buy it on the terms they offer.  If I sell something, I sell it on my terms and I expect them to be honored.  I view my HD Cable via a DVI digital connection on my TV, which supports HDCP.  It means I cannot record these shows easily, I have no issue with this.  I entered into this arrangement with Charter cable (who also sucks) knowing this up front.

If the MPAA says I can buy this DVD from them but I am not allowed to copy it, then I have agreed not to copy it.  The fact that Microsoft is going to make it harder to copy it from Windows does not concern me as long as my privacy is not comprimised.  I do not have a "right" to use something outside of the terms of the seller, regardless of how ridiculous their copyright law is or how much Pearl Harbor or Alexandar: Director's Cut sucked to begin with.

If you don't like these terms, do not buy it.  If Hollywood shoots themselves in the foot because their new copy protection is not viewable on my mom's TV then its their loss when they miss out on the sale of millions of copies of "The Mummy Returns" to people like her.  If there is some ridiculous backlash against the public (Sueing college kids for trading Mp3s come to mind) then we brought that on ourselves.  What's fair likely lies some place in the middle.

What do you think?  How can we best treat the studios who spend millions of dollars making crap like <<Insert Julia Roberts film title here>>, hardware and software manufactures, and consumers fairly?

Tuesday, August 30, 2005 1:56:52 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [3]  |  Trackback
 Sunday, August 21, 2005

Right now I'm sitting at the kitchen table in this purgatory known as "apartment living" while my new house sits uncompleted only a kilometer away.  This completely sucks so I went and picked out a nice new mahogany veneer desk/workstation setup to go in my office when this new house is ready for occupancy.  I am also standing by to order an Aeron chair as it is the most comfortable chair I've ever sat in.  I just built a fast new PC.

I do a lot of work from home. This new office will eliminate manyof the frutrations I have at client sites: the ergonomic nightmare, the slow PCs with no memory and slow hard drives, the silly IT policies blocking this or that messenger, the mandatory virus scans that happen every Thursday at 1pm and render your already slow laptop completely incapable of doing any real work for two hours.  Yeah, the 10,000 RPM Serial ATA hard drive with a gig of ram and 3.6ghz proc can compile the hell out of that code, and setting up multiple monitors is genuinely useful for work.  Its too bad I'll only have this excellent environment for the 10-20 hours per week I am working on side projects at home, while the majority of the work I do will be in the cubical with its interruptions and inferior equipment. 

No matter how many studies are done linking good environment, no internet monitoring, and good equipment to higher worker productivity we are just not ready for the progressive office here in the midwest.  I have yet to see a single office that can hold a candle to the type of work environment a developer would choose if asked to create an environment where they could be most productive.  I think my goal for 2006 is to seek out ways to work from home as much as possible.  Does anyone out there have "Work from home" stories?

 

Update: supporting documentat http://www.time.com/time/archive/preview/0,10987,1083900,00.html

Sunday, August 21, 2005 6:57:57 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [12]  |  Trackback
 Wednesday, August 10, 2005

The Damon show has been off the air for a while, and for both of you out there who are regular readers I do apologize for the lack of posts.  I have been so busy with deadlines at work, and deadlines on two of my side projects that I haven't been able to screw around with "Project Cesium" or any of the game programming or AI stuff.  I've been so busy that I sold my house a month and a half ago and just deposited the proceeds on Saturday.    I still have to make enough revenue through my business to pay taxes and buy some appliances.   I guess what I'm saying is that I am a whore and that until my new house is done things that pay money now will win my time over neat projects.  

Finally, in regards to the religious discussion going around the local community, I leave you with this.  It seems as though in this exciting age of Science we have become more religous as a people, not less.  For those of us who choose to sleep in on Sunday, its becoming a social liability.

Wednesday, August 10, 2005 9:13:49 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback