CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Darrell Norton's Blog [MVP]

Fill in description here...

February 2004 - Posts

  • Why I hate Radio Userland

    Radio Userland is one of the larger weblogs on the net.  Why do they suck?  One simple reason.  If you forget (or don’t want) to fill in one of the comment form sections, such as your email address, when you submit the form it erases all of your work, and then tells you that it requires an email address.  The form doesn’t even tell you all the fields are required before you begin, and then to throw away all your work is unforgivable.  If I met the developer that created the comment form I’d give him a vicious wedgie.

  • .NET Weblogs Archive, your one-stop .NET weblogs shop

    If you haven’t checked out the .NET Weblogs Archive site, maintained by Jesse Ezell, you really ought to do so.  I had not visited it in a while, and Jesse has done a lot of work since then!

    The entire site got a face lift.  The look is very crisp and clean.  It’s easy to browse through blog posts by date, search by date and/or search terms, or see only a particular author’s posts.  For each post you can view the original blog entry (off-site) or read the entire post without leaving the site, go to the author’s blog, get related links from Technorati, and rate the post.

    At the top are the neatest new features.  There are lists of the top 10 most referenced links and the top 10 most talked about posts.  Plus you can filter by search terms.

    Oh, and most importantly, there is an RSS feed.

  • How to troubleshoot bad RAM

    My laptop was suffering from intermittent crashes, leading me to suspect some of my laptop’s memory was bad.  So I went Googling for answers.

    Windows has a Windows Memory Diagnostic tool that scans your memory for you.  To use it, you need to create either a floppy or CD that contains the bootable diagnostic program and boot directly to the program.  Since my laptop has no floppy drive, I needed to do the CD option.  Luckily the Windows program can also create an ISO image to burn to CD (unlike every other memory-testing program out there).

    Now, I did not have CD burner software that handled ISO images, but the page conveniently pointed me to the Windows Server 2003 Resource Kit Tools which includes the cdburn.exe command line tool.  I downloaded and installed the resource kit.  Then I just typed cdburn f: windiag.iso (replace f: with whatever your CD burner drive letter is) and it created the CD.

    I booted from CD and the program ran itself.  Even with a GB of RAM (2GHz processor) it tested everything in under 10 minutes.  The program even told me that all errors occurred on one memory module.  I took one of the memory sticks out, and still got errors.  That was it!  I ran the program again on the other memory just to be safe, but as expected there were no errors.

    Memory errors are one of the hardest things to figure out, but this tool made it easy (and free).  I will definitely keep this program around.

  • Tool: IPLookup

    After getting aggravated with some comment spam, I needed a tool to lookup who owned a block of IP addresses.

    Enter IPLookup.  It does whois lookups on IP addresses or converts host names to IP addresses.  And it’s free and easy-to-useWhat more could you ask for?  Here’s a screenshot:IPLookup screenshot

    Posted Feb 25 2004, 07:30 AM by darrell with 2 comment(s)
    Filed under:
  • Firefox keyboard shortcuts

    Here is an excellent list of Firefox keyboard shortcuts.  It also shows how the keyboard shortcuts for specific actions map across Firefox, IE, and Opera.  The most important shortcut to know, the Google search box, is Ctrl+K.

  • ASP.NET postback error?

    I've encountered a very strange error in ASP.NET.  I've been able to reproduce it successfully and consistently in a test project.

    Normally if you hit the back button, the page you go back to does not postback.  However, if on the second page you click a link that opens a new browser window (a hyperlink with target="_blank") and then click the back button on the original browser window, the first page will postback even though you only pressed the back button. 

    SmartNav is not enabled.  This is on v1.1 of the framework.

    Anyone ever seen/heard of this?  I can't find anything online, or in the newsgroups, or on the Microsoft support site.

    UPDATE:  This is not an ASP.NET error, it is an Internet Explorer error.  Unfortunately I cannot have people switch browsers since it is a public site, but at least I know what's going on!  Thanks to those who helped.

  • Passed the UML certification exam (IBM exam 486)

    I passed the IBM 000-486 test Object-Oriented Analysis and Design with UML test today with a 91%.  My employer is big on UML and wants pretty much everyone to take this exam.

    What’s nice with the IBM test is it shows you how you fared on each section of the test objectives.  For example, I got 100% of the architecture questions right but only 86% of the development questions right.  And I thought I knew a lot about development processes!  Maybe because I am more interested in agile processes and how they are applied rather than the textbook theory of OOAD.

    I used two books for study materials.  UML Distilled by Martin Fowler gives you everything you need to know about UML diagrams.  I read this book a couple of times since it was so short.  Applying UML and Patterns by Craig Larman covers pretty much everything else (including the UML diagrams).  I’m sure if I had studied this book more I could have done better, but it’s hard to grok everything in a 650-page book, although it was a great read.

    See my review of UML Distilled or my review of Applying UML and Patterns.

  • My Worst Database Experience Ever

    Roy is talking about database sins.  I worked on porting one database that had to be the worst I’ve ever seen in my entire career.

    First off, it was an Access database.  It starts off well doesn’t it?  J  Well, it was an Access database split into two parts (the front file and the back file), each a couple hundred MB each.  And they used the ldb locking file to manage roles, passwords, etc.  Great huh?  It gets better.

    There were 100 tables or so.  Some were in the front file, some were in the back file, some were in both and were not linked tables!

    There was not one relation in the entire database!

    One table held 5 different types of objects.  True they were related to each other, but not the same.  The VBA code was littered with if(type = A) then do x elseif (type=B) then do y etc.

    All forms would select * from tableName, even if the form only needed one value.  Oh, and it did this with the table that held 5 different types of objects (which were the centerpiece of the domain model, thus there were lots of records in the table), so some forms took 2 minutes to open while it selected the entire table, and then filtered the results to typeA only and then displayed 5 of the fields!

    And beside the primary key identifier on some of the tables (some tables had none), all fields were nullable!  There were probably 25,000 IsNull checks in the VBA code.

    There was more, but the rest was peanuts compared to this!

  • Teach Yourself Programming in 10 Years

    Peter Norvig, Director of Search Quality at Google, has an excellent essay titled Teach Yourself Programming in 10 Years.  It's a commentary on the state of books titled “Teach youself x-technology in y days/hours/minutes.”  Although written in 2001, it's still relevant if not more so than when he first wrote it.
  • Why do developers still use SourceSafe?

    Scott Nonnenberg asks why anyone still uses Visual SourceSafe (VSS), especially versus CVS, after some recent bad experiences with it.  Here’s my take on the situation.

    The nice part is that VSS actually integrates with VS.NET while CVS does not.  For CVS, you have to install CVS or CVSNT, then grab TortoiseCVS for a GUI, and some other software (from commercial vendor PushOK ($19) or the open source SCC plugin for TortoiseCVS) to integrate with Visual Studio.

    The reason why many developers still use VSS is because it provides all 3, a version control system, a GUI app, and Visual Studio integration, in one free package.  Even though you can get all 3 parts via open source software and piece them together for free, people still pay lots of money for SourceGear's Vault because it already pieces it together for you.  I expect to see open source software improve its integration with VS.NET now that the SCC API no longer requires an NDA.

    I don't know what the environment that Scott was working on is like, other than the pre-Beta status had something to do with it, but I rarely run into data corruption issues working on teams of up to 10 developers.  You do have to manage VSS and the server it resides on well, which may be a challenge to some people (I’ve seen it several times where the VSS database resides on the oldest, slowest, worst POS computer in the company, and they blame VSS for the problems!).  But I'm still scared enough to move to CVS or Vault.

    The downsides to VSS are that there are no atomic commits, the UI sucks, documentation is sparse, and it doesn’t work well over a distributed network (which is why Source OffSite from SourceGear does so well).  And it doesn’t natively support secure communication; you have to setup IPSEC on the server (which you should do even, no especially, on your internal network at work/home!).

  • Fixing bugs is 80% learning, 15% patience, and 5% coding

    I’ve been trying to help a client tackle a rather large list of issues (some might call them underappreciated program features), so I’ve been doing a grab-bag of various coding issues.  Some JavaScript, some VB.NET, some web services, some database work, yikes!  The possibilities on where the code was broken were huge.

    I started working on one particular issue and saw some code that looked like it would fix it right away.  I changed it and tried out the application.  No change.  I found some more code that looked like it needed fixing, and fixed it too.  Still nothing.  So I continued to fix away for the next 30 minutes, fixing nothing and wrecking pretty much everything else.

    Finally I stepped back, undid my checkout, and went back to the original code base.  I actually went in and figured out how the code really worked, and it was so much simpler than I had originally thought.  It didn’t help that the code base was in marginal shape when I got there, but that was no excuse for “code and burn” debugging!  I hate learning things I already know the hard way.

  • Don't shake it like a Polaroid picture!

    Say it ain't so!  From Yahoo! news:

    Outkast fans like to "shake it like a Polaroid picture," but the instant camera maker is warning consumers that taking the advice of the hip-hop stars could ruin your snapshots.

    Outkast's number one hit "Hey Ya" includes the "shake it" line as a reference to the motion that amateur photographers use to help along the self-developing film.

    But in the "answers" section on the Polaroid Web site (here), the company says that shaking photos, which once helped them to dry, is not necessary since the modern version of Polaroid film dries behind a clear plastic window.

    The image "never touches air, so shaking or waving has no effect," the company said on its Web site.

    "In fact, shaking or waving can actually damage the image. Rapid movement during development can cause portions of the film to separate prematurely, or can cause 'blobs' in the picture."

    Outkast, I loved “Hey Ya!”  How could you deceive me like that??
  • How do you setup NUnit tests in Visual Studio.NET projects?

    I received this in an email a while ago, but have been too busy to blog about it until now.  The email:

    I've recently started TDD, mostly after reading your blog. I downloaded
    NUnit and have begun running a few simple tests. My question is, do you
    normally include test classes and more importantly, the NUnit DLL in
    your projects? I didn't think it was a good idea, not that I have any
    argument for why, so I would write my class and then create a whole new
    project for the test files and finally run my tests from new DLL that
    VS.NET would create. Should I not be concerned about inlcuding test code
    or the the reference to the NUnit DLL in my projects?

    As far as I can tell, there are 4 ways to setup NUnit tests in Visual Studio .NET.  And they are:

    1. In the same class – the advantages to this setup are you have full access to everything, including private methods and variables.  However, since you have to make the test methods public, it could be a security issue.  I don’t generally do this except for learning.

    2. Separate class, same project – here you make a new class within the same project (or folder).  Thus you can access all internal methods without worry.  There could still be security issues, but it is somewhat less dangerous this way.  I sometimes use this for smaller projects if requirements allow.

    3. All tests in 1 separate project – here all of an application’s unit tests are in a separate project.  This has the advantage of keeping all unit tests in one place, so it’s easy to fire up NUnit and run all the application’s tests.  But I tend to need a lot of directories to organize my tests, and for larger applications the unit test project becomes huge.  I use this for all but the smallest and largest projects.

    4. All tests for a project go in a separate project – here you have one test project per real project.  For example, the BusinessServices project has a BusinessServicesTest project.  This keeps the unit test projects manageable, but it takes more effort to run all the application’s unit tests at once.  I generally use this for large applications.

    For options 1 and 2, perhaps not deploying the NUnit dll is good for security reasons, but anyone can still call those public test methods.  I’m not sure of the security implications, since I generally don’t do either of these or if I do, it’s a small local app.  For options 3 and 4, it doesn’t really matter if you include the NUnit dll in the project since you won’t deploy the unit test project(s).

    Which of these methods do you use and why?  Are there other methods out there you are using?  Am I smoking crack?  Leave a comment letting me know!

  • SourceJunkies.com ??

    Donny Mack has something brewing!

    An excerpt:

    Who is Donny Mack? That is a question that not only he asks himself, but his girlfriend, parents, sister, and friends. The fact is, no one knows exactly who Donny Mack really is. We know he is a programmer for sure (a good one at that), but rumors are he is also an agent for the FBI, CIA, and the British Intelligence Agency. Beyond that, he's been seen as a guest star on Alligator Hunter, Emeril Live, and 60 Minutes as an expert on Quantum Physics.

    SourceJunkies.com – coming soon!

    Sorry Donny, I couldn’t resist!  :)

  • Dodgeit (spam)

    Dodgeit offers a service similar to Mailinator.  The only difference I can tell is that Dodgeit offers an RSS feed to a certain mailbox.  (via Jason Alexander)

    I don’t know what value that adds.  I’m only using either one to avoid spam, so I don’t want to be notified of every time I get email at a spam email address!  It kind of defeats the whole purpose.

    But nevertheless, I now have 2 options for avoiding spam.
More Posts Next page »

Our Sponsors

Free Tech Publications