Tuesday, April 24, 2007
Tuesday, April 24, 2007 3:24:30 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Tuesday, April 03, 2007

Scott blogs about the new features in IIS 7.0 server version coming out later this year. One set of features that I think is really really amazing :

"The web farm support in particular is really cool, and will allow you to deploy your web applications on a file-share that contains all of the code, configuration, content, and encryption keys needed to run a server.  You can then add any number of stateless and configuration-less web-servers into a web farm and just point them at the file-server to dynamically load their configuration settings (including bindings, virtual directories, app pool settings, etc) and application content.  This makes it trivial to scale out applications across machines, and avoid having to use replication schemes for configuration and application deployment (just copy over the files on the file-share and all of the machines in the web farm will immediately pick up the changes). "

I already use source control to deploy files to the web farm so replication is not a big issue, but it is a pain to configure sites for the first time on each server.

More on this

Tuesday, April 03, 2007 9:15:55 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Friday, March 30, 2007

Quick and dirty function to return the size of a file in a properly formatted string in KB, MB or GB. There has to be an easier way than this .....

 

    private const double KByte = 1024;
    private const double MByte = KByte * 1024;
    private const double GByte = MByte * 1024;

public static string GetFileSizeString(int bytes) {
        if ((bytes / GByte) < 1) {
            if ((bytes / MByte) < 1) {
                if ((bytes / KByte) < 1) {
                    return String.Format("{0} B", bytes);
                }
                else {
                    return String.Format("{0} KB", Math.Round((bytes / KByte), 2));
                }
            }
            else {
                return String.Format("{0} MB", Math.Round((bytes / MByte), 2));
            }
        }
        else {
            return String.Format("{0} GB", Math.Round((bytes / GByte), 2));
        }
        
    }
Friday, March 30, 2007 1:54:54 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Sunday, March 25, 2007

Started work on a small personal project using WPF and ClickOnce today. I'm using Expression Blend (RC) to design the interface and VS for the code. I can open the same VS project in Expression Blend, both environments detect file changes but with that popup message. Blend makes it easier to add controls and set properties, but it lacks intellisense, tag completion and code formatting that the VS XAML editor has. I hope this is added in the final version.

Here are a few reasons why I think WPF/E is better than Flash, though I think it won't be a Flash killer yet.

  1. Data binding: Flash does not come with any of this out of the box, it has to be done using Action script. WPF has extensive support for data binding. Binding to an XML data source is done easily in XAML using declarative code. This makes it easier for the designer types to add data integration without having to rely on an action script developer for the task.
    Update : WPF/E however does not have databinding in the current CTP build. See point 3, which makes it not so bad.
  2. Source is available: If I find really cool whizz bang work created with WPF, I can look at the source and see how it's done. This is similar to HTML and CSS where one can look at the code and copy/learn/link. This leads to more reusable code and gets people sharing great WPF implementations. Can't do this with Flash now, unless a decompiler is used.
  3. Generate XAML from the server: Since all it takes is to have the web server serve up a xml file it is possible to generate customized interfaces based on backend data. XAML from ASP .Net

More on WPF vs. Flash

http://donburnett.wordpress.com/2007/03/07/poor-maligned-and-misunderstood-by-many-wpfe/

http://thewpfblog.com/?p=17

http://www.nukeation.net/PermaLink,guid,ea198313-623e-400f-be22-82c242b5812c.aspx

Sunday, March 25, 2007 9:34:32 PM (GMT Standard Time, UTC+00:00)  #    Comments [2]  | 

My Vista installation has to wait a while longer. Toshiba does not support Vista on the Satellite M30 and considers it an out of date model ( ??? ). Though the hardware is perfectly capable of running Vista with Aero glass. NVidia doesn't have Vista drivers for the GeForce Go 5X series GPUs. There are hacky ways of getting this to work, but these are not stable so far from what I've read.

However, I'm in the mood to buy a new laptop. I'm looking at the Toshiba P100 series of laptops, as they have a decent mix of features i.e good graphics Nvidia geforce 7600 with at least 128 MB of video ram, IGB of memory and a 100gb hard drive. My budget for all this is about £1000. I play games on my laptop and it serves as my main entertainment center therefore it should have a  decent graphics card. Should be able to run secondlife and need for speed :). I've narrowed down my requirements and now just need to hunt around the shops more till I get it for as cheap as possible. It's cheaper to buy a laptop with 1 GB of RAM and upgrade it later. Crucial is selling 2 GB kits for less than £100. The price difference between a 1GB laptop and a 2GB model is close to £250.

Sunday, March 25, 2007 9:32:20 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Saturday, March 24, 2007

I bought a Picooz on impulse a few weeks ago. I saw it on display and it was only £30 and it gave me a "What the heck, its only 30 quid" moment. Turns out that I've bought the world's smallest RC helicopter, weight about 10 grams. Though it is small, it does have a lot pf power in it. The copter charges from the RC controller and takes about 20 minutes to charge for a 5 minute flight.

It's hard to control it at first, though I'm getting the hang of it. It's a very forgiving toy and handles all the bumps and crashes very well. Indestructible so far :). Getting the Picooz to fly forward took a bit of hacking it. It has a tendency to fly in circles and get into an un-controllable spin. This happens even after trimming. I added a nose extension, which looks like an antenna to add a bit more weight to the front so it can fly forward slowly.

Saturday, March 24, 2007 5:40:27 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Monday, March 19, 2007

I should be receiving my copy sometime this month. This was for answering a question after the UK  Vista and Office developer launch event. I thought I didn't  win since I didn?t get the email from MS. Yesterday I requested a list of the winners and my name is on the list.  Yippee !!  :)

Ok, now I have to find a laptop to run it, my current laptop is showing its age. In retrospect, I should have entered the Office competition because I would be able to use that on this laptop. 

Monday, March 19, 2007 10:03:51 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Sunday, January 28, 2007

A nice step by step tutorial, on how to submit a patch/bug fix to a OSS .net project on Sourceforge.

How to contribute a patch

Sunday, January 28, 2007 8:21:32 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
 Tuesday, January 16, 2007

I have situations where I need the domain name and the application path of the current page (request ).

if the current request was http://www.myserver.com/website1/page.aspx

I need http://www.myserver.com/website1. Though the web.config can store this setting, I don't want to change the config each time I move the site between servers.

So here is a little function I wrote.

Request.Url.AbsoluteUri   gives http://www.myserver.com/website1/page.aspx

Request.ApplicationPath gives /website1/. Subtract page.aspx from http://www.myserver.com/website1/page.aspx

 

public static string GetSiteUrl() {

if (HttpContext.Current.Request.ApplicationPath == "/") {
     return "/"
}

          string url = HttpContext.Current.Request.Url.AbsoluteUri;
            int end = url.IndexOf(HttpContext.Current.Request.ApplicationPath) +
                  HttpContext.Current.Request.ApplicationPath.Length;
            url = url.Substring(0, end);
            return url;
        }

 
Tuesday, January 16, 2007 11:17:33 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]  |