September 2004 - Posts - Ed's Blog
in

dotnet.org.za

South African .NET Developer Portal

Ed's Blog

Object reference not set to an instance of an object

September 2004 - Posts

  • Why your XML code sucks

    I read Dawid's blog entry on the place of XML and I agree whole heartedly.

    Luckely the XML wave seems to be over now. My main gripe now is that the same thing is happening with web services. It has it's place but it is so overhyped by Microsoft and others that is being used everywhere regardless of wether it is the best solution or not.

    This post on TheServerSide.net list this type of thinking as one of the reasons why YOUR code sucks.

    Posted Sep 30 2004, 08:10 AM by eduard with no comments
    Filed under:
  • Test your hand-eye coordination

    Have some fun with this game

    Posted Sep 29 2004, 09:03 AM by eduard with 4 comment(s)
    Filed under:
  • Cool tool - BlogWave

    Had a quick look at this tool, and it very nice. It's classified as an RSS “Generator“. It basically reads information from it's “adapters“, convert it to RSS and publish it to a variety of destinations. Current adapters include NNTP newsgroups, Event logs and WSS lists and document liberaries. The most impressive thing is that it can give you an RSS feed of a Google search.
    The resulting RSS feeds can be published to a variety of destinations such as .Text blogs, FTP, WebDAV systems (Sharepoint and WSS) and of courses XML files.

    You can also write your own adapters and publishing targets.

    Get it here.

    [Of course it's free !]

    Posted Sep 28 2004, 07:59 AM by eduard with no comments
    Filed under:
  • ASP worker process and identity on Windows 2003 server

    For those who didn't know this, on a windows 2003 server, your asp worker process is no longer aspnet_wp.exe and it no longer runs under the ASPNET account. The process is now w3wp.exe and it runs under the “network service account”. I wish Microsoft would make their minds already.

    These are the types of things you discover when your dev environment is XP, QA is Windows 2000 and Test is Windows 2003 server.

     

    Posted Sep 23 2004, 12:10 PM by eduard with no comments
    Filed under:
  • How to know which .NET framework servicepack version is installed

    I couldn't remember if I'd installed SP1 for framework 1.1, so I wanted to check.

    I found this blog entry by Aaron Stebner that explains where to look it up in the registry

    it's located at HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v1.1.4322

    There is also this KB article that explains how to check the SP version using the .net framework configuration MMC snap-in

  • CodeSmith 2.6 Release Candidate 1 released

    The next version of everyones favourite code generator is on it's way

    Get it here

    New features include:

    - Syntax highlighting of both template and target languages.

    - Much improved Visual Studio .NET custom tool.

    - Outlining support.

    - Line modification markers.

    - CodeSmith Studio is now a single instance application.

    - Improved compiler and template execution performance.

    - Better Unicode support.

    - Tons of other minor improvements and bug fixes.

    Posted Sep 22 2004, 08:08 AM by eduard with no comments
    Filed under: ,
  • 50 years ago THIS is what they predicted for a home PC

    Weird !

    check it out here

    Source

    Posted Sep 21 2004, 08:32 AM by eduard with 1 comment(s)
    Filed under:
  • Have a sidebar now !

    Why wait for Longhorn, you can have a sidebar today for free, very cool tool ! Integrates with outlook, msn, media player etc.

    get it here

    Posted Sep 20 2004, 01:02 PM by eduard with 1 comment(s)
    Filed under:
  • MSDN V2

    Microsoft has release a preview of MSDN v2. Frankly I don't have any trouble with V1, except that it is a bit light on meaningfull examples.

    Check is out here

    Source: TheServerSide.NET

    Posted Sep 17 2004, 07:06 AM by eduard with no comments
    Filed under:
  • Some more bad code

    here is some more hilarious code posted on the daily WTF :

    The first one is a good alternative if you don't like the XML support in java, or if you worry that the W3C might change the XML syntax  :

    public final class XmlGenerator {
      private static final char LEFT_BRACKET = "<";  
      private static final char RIGHT_BRACKET = ">";  
      private static final char Q_MARK = "?";  
      private static final char EQUAL = "=";  
      private static final char DOUBLE_QUOTE = "\"";  
      private static final char SLASH = "/";  
      private static final char SPACE = " ";  
      private static final char AMPERSAND = "&";  
      private static final char APOSTROPE = "'";  
      private static final String XML = "xml";  
      private static final String VERSION = "version";  
      private static final String VERSION_NO = "1.0";
    
      private static void appendXmlVersion(StringBuffer buffer) {
        buffer.append(LEFT_BRACKET);
        buffer.append(Q_MARK);
        buffer.append(XML);
        buffer.append(SPACE);
        buffer.append(VERSION);
        buffer.append(EQUAL);
        buffer.append(DOUBLE_QUOTE);
        buffer.append(VERSION_NO);
        buffer.append(DOUBLE_QUOTE);
        buffer.append(Q_MARK);
        buffer.append(RIGHT_BRACKET); 
    }
    The second one is a different take on polymorphism:
            if(obj instanceof MMSNode) {
                MMSNode node = (MMSNode)obj;
                attribs = node.getAttribs();
            }
            else if(obj instanceof MMSPhysComp) {
                MMSPhysComp physComp = (MMSPhysComp)obj;
                attribs = physComp.getAttribs();
            }
            else if(obj instanceof MMSLogComp) {
                MMSLogComp logComp = (MMSLogComp)obj;
                attribs = logComp.getAttribs();
            }
            else if (obj instanceof MMSPhysLink) {
                MMSPhysLink physLink = (MMSPhysLink)obj;
                attribs = physLink.getAttribs();
            } 

    Posted Sep 15 2004, 08:42 AM by eduard with 1 comment(s)
    Filed under:
  • Good bye RSS Bandit !

    and good riddance ! It's not that bad except that it doesn't update my feeds. So except for not meeting it's primary functional requirement, it's very good. Strange thought that some headlines are downloaded, but never everything ?

    I switched to SharpReader and now I have to catch up on everything I missed. At least it's possible now.

    Another thing that the RSS industry needs to look at is a common format for exporting and importing feeds. My “copy and past” fingers are down to the bone ! I recon there is something like that but I could not find one format supported by all aggregators I've tried including RssReader, RssBandit and SharpReader.

    Posted Sep 14 2004, 09:09 AM by eduard with 4 comment(s)
    Filed under:
  • TempFileCollection revisited

    In a recent post I pointed out that the TempFileCollection class is quite cool, there is however one thing that is not cool, and that is that the class only generates one random filename when it is constructed, so you cannot create 2 temp word documents for example (in the same collection). I wrote a litte extension to the class that takes care of that :

    using System;

    using System.CodeDom.Compiler;

    using System.IO;

    public class UniqueTempFileCollection : TempFileCollection

    {

    public UniqueTempFileCollection() : base()

    {

    }

    public UniqueTempFileCollection(string tempDir) : base(tempDir)

    {

    }

    public UniqueTempFileCollection(string tempDir,bool keepFiles) : base(tempDir,keepFiles)

    {

    }

    public string addUniqueExtension(string fileExtension)

    {

    return addUniqueExtension(fileExtension,this.KeepFiles);

    }

    public string addUniqueExtension(string fileExtension,bool keepFile)

    {

    Random r = new Random();

    string result = "";

    bool found = false;

    while (!found)

    {

    for (int i=0;i < 8;i++)

    {

    result += (char)r.Next(97,122);

    }

    FileInfo file = new FileInfo(result);

    found = !file.Exists;

    }

    result = this.TempDir + (this.TempDir.EndsWith("\\")?"":"\\") + result + "." + fileExtension;

    this.AddFile(result,keepFile);

    return result;

    }

    }

  • Architecture course

    I've been on the architecture course from Solms training the whole of last week, that's why my blog was a bit quite. It's a very good course, gives you a good perspective on where everythin fits in. Now all I need to do is to convince the people at work to go OO. I've been trying unsuccessfully for months now, but I'm not giving up hope :)
    Posted Sep 13 2004, 07:44 AM by eduard with no comments
    Filed under:
  • TempFileCollection

    I discovered this class yesterday, some nice functionality to create temp files (don't have to worry about filenames, it will generate names that do not exist in the target folder) and delete them automatically, if you choose, when the collection is destructed or disposed.

     

  • Daily WTF

    Shaun pointed me to this cool blog about “Curious Perversions In Information Technology”

    we were rolling in the ailes about this one :

    CREATE PROCEDURE sp_get_order (
            @OrderID        int
    ) AS

    select * into #temp_order from Orders
    delete from #temp_order where OrderID<>@OrderID
    select * from #temp_order
    drop table #temp_order

    Posted Sep 02 2004, 09:30 AM by eduard with no comments
    Filed under:
More Posts Next page »
Powered by Community Server (Commercial Edition), by Telligent Systems