Category Archives: Link/News

There’s a reason my blog has been sparse…

I’ve been working a lot on a software project. It’s the first thing I’ve done in a long time that I’ve been passionate about. Basically, it’s a LEGO® inventory management system. I know that some existing stuff already exists out there, but mine is going to have a little different focus. I don’t want to leak too many of the features yet, but in a few words, it’s going to be easier to use, faster to update inventory, and have some cool and useful features.

Excellent article on Rare Risks and Overreactions by Bruce Schneier

I recently started following Bruce Schneier’s blog about security and security technology. He makes LOTS of excellent points. Too bad the powers that be don’t educate themselves sufficiently on this type of stuff before passing bad laws or taking drastic, pointless actions.

I especially like his recent essay on over-reacting to rare events. Right on.

Deep Computing Philosophy from Steve Yegge

If you haven’t read Steve Yegge, you owe it to yourself to do so. He only writes about once a month, but every single article is worth reading, whether you agree with him on everything or not. His latest is fascinating and incites some interesting pondering about the future of software…I’m going to have to think about a lot of it…

Code formatter for Windows Live Writer

I stumbled across a great code formatter for Windows Live Writer today. Here’s an example, using a C# function that converts a number into a formatted file size:

       public static string SizeToString(long size) 
        { 
            const long kilobyte = 1L << 10; 
            const long megabyte = 1L << 20; 
            const long gigabyte = 1L << 30; 
            const long terabyte = 1L << 40; 
            string kbSuffix = "KB"; 
            string mbSuffix = "MB"; 
            string gbSuffix = "GB"; 
            string tbSuffix = "TB"; 
            string suffix = kbSuffix; 

            double divisor = kilobyte;//KB 
            if (size > 0.9 * terabyte) 
            { 
                divisor = terabyte; 
                suffix = tbSuffix; 
            } 
            else if (size > 0.9 * gigabyte) 
            { 
                divisor = gigabyte; 
                suffix = gbSuffix; 
            } 
            else if (size > 0.9 * megabyte) 
            { 
                divisor = megabyte; 
                suffix = mbSuffix; 
            } 

            double newSize = size / divisor; 
            return string.Format("{0:F2}{1}", newSize,suffix); 
        }

Code Formatter Plugin for Windows Live Writer

I stumbled across a great code formatter for Windows Live Writer today. Here’s an example, using a C# function that converts a number into a formatted file size:

       public static string SizeToString(long size) 
        { 
            const long kilobyte = 1L << 10; 
            const long megabyte = 1L << 20; 
            const long gigabyte = 1L << 30; 
            const long terabyte = 1L << 40; 
            string kbSuffix = "KB"; 
            string mbSuffix = "MB"; 
            string gbSuffix = "GB"; 
            string tbSuffix = "TB"; 
            string suffix = kbSuffix; 

            double divisor = kilobyte;//KB 
            if (size > 0.9 * terabyte) 
            { 
                divisor = terabyte; 
                suffix = tbSuffix; 
            } 
            else if (size > 0.9 * gigabyte) 
            { 
                divisor = gigabyte; 
                suffix = gbSuffix; 
            } 
            else if (size > 0.9 * megabyte) 
            { 
                divisor = megabyte; 
                suffix = mbSuffix; 
            } 

            double newSize = size / divisor; 
            return string.Format("{0:F2}{1}", newSize,suffix); 
        }