Blog

Blogging on programming and life in general.

  • Published on
    -
    1 min read

    Could Writing a Blog Post Get Any Easier???

    I have just installed Window Live Messenger 8.5. Yes, you might be thinking I have been a little late installing the latest version of Messenger. The reason for this is because I really had no reason to. After all I use Messenger just to talk to my friends. Nothing more, nothing less.

    Anyway. Back to this blog post. Windows Live Messenger 8.5 has a really neat tool to manage you own blog. It is called Windows Live Writer (WLW). WLW has to be the most useful application for anyone who is an avid blogger. It features a WYSIWYG authoring, photo-publishing and map-publishing functionality, and is currently compatible with Windows Live Spaces, Blogger, LiveJournal, TypePad, Wordpress, Community_Server, PBlogs.gr, JournalHome, the MetaWeblog API, and the Moveable Type API. Even if your blogging engine is not listed here I am sure WLW will be compatible. For example, my blogging engine is BlogEngine and I was able to connect WLW to it really easily!

    There are many extensions available to add extra functionality to WLW which you can find here. I highly recommend downloading "Code Snippet". This extension makes inserting code a breeze!

    Code Snippet In Use:

    // Hello1.cs
    public class Hello1
    {
       public static void Main()
       {
          System.Console.WriteLine("Hello, World!");
       }
    }
    


    WLW user interface is just as what you'd expect from the Microsoft product family. Very easy and intuitive to use:

    WLWScreen

    If you have not already tried WLW I highly recommend it. You can download WLW without installing Windows Live Messenger here.

  • Published on
    -
    1 min read

    Is an Arraylist still in use?

    When I first started using ASP.NET 1.1, I always used an Arraylist to iterate through most of my collections. However, when I started using ASP.NET 2.0 I was introduced to Generic Lists. The List<T> class is the generic equivalent of the ArrayList class. It implements the IList<T> generic interface using an array whose size is dynamically increased as required. This means the List class performs much better in most cases and more importantly it is "type" safe.

    So I am not too sure why you would ever need to use an Arraylist since a Generic List class is able to do exactly the same thing with the added benefit of extra perfomance. So is the Arraylist still widely used in todays standards? I guess it still must be in use if Microsoft has not omitted it from their Framework. Maybe Microsoft has something in store for the Arraylist in their grand plan.

    Here are a few useful links:

    C# Corner - C# Generics Josh Williams MSDN Blog - Arraylist vs. Generic List MSDN Network - List (T) Generic Class

  • After I designed a theme to my SharePoint 2007 site I came across a small problem. Well it was not exactly a problem it was more of a hassle I encountered. The current SharePoint Intranet I was working on contained quite a lot of sites and I didn't want to change the site settings within each site in order to change the theme. Thankfully, SharePoint 2007 allows you to apply a Custom CSS from your theme.

    In order to change the theme across the whole SharePoint Intranet carry out the following:

    1. View the source of main portal homepage and look for a line which looks something like this:
    <link rel="stylesheet" type="text/css" id="onetidThemeCSS" href="/_themes/Intranet/Intr1011-65001.css?rev=12%2E0%2E0%2E4518"/> 
    
    1. In Site Settings click on Masterpage and scroll down to the bottom of the page.
    2. Select the "Specify a CSS file to be used by this publishing site and all sites that inherit from it" radio button.
    3. Use the link from the CSS HTML tag above excluding anything after the query string. For example: ""/_themes/Intranet/Intr1011-65001.css".

    Now the theme should be applied throughout the site. You can change the link for the Custom CSS by changing the directory path.

  • Published on
    -
    1 min read

    Asus EEE PC 701 Ultra Mobile Laptop

    While I was browsing the web for some tech goodies for my PC something at the side of the webpage caught my eye. Judging by my post title you guessed it, a ASUS EEE Laptop. But the thing that really surprised me about his laptop was the price. It was £239.99 (at time of post print)! Just think, you could purchase a PDA for that amount! Of course for this price it is not the most highest spec laptop:

    • 7" Display.
    • Intel Celeron CPU.
    • Linux OS.
    • Webcam.
    • 4GB Flash HDD.
    • Wireless
    • Ports: 3 USB ports, 1 VGA out, SD card reader, modem, Ethernet, headphone out, microphone in.

    After looking at this spec the only thing that disappointed me was the limited Hard Drive space especially when comparing to the amount of junk on my current laptop. The maximum Hard Disk space you can get in the Asus EEE series is 16GB. Being a Windows XP guy (will isn't everyone), I was actually quite glad that a Linux operating system was used for the Asus because overall Linux is a lot lighter when compared to Windows. By combing a little Linux with a flash Hard Disk Drive you know that startup time will not be an issue. However, even the Linux OS takes around 2.5GB storage space. So you will be limited to the amount you can store. Well I guess thats why they supplied a USB port to attach a flash drive.

    So who would buy this laptop??? Well if you want a sleek fast and portable laptop with lots space for all your data then this is not for you. However, if you simply just browse the Internet, check emails and uploading a few images and music. Then this could be good value for money.

    The reviews for this Laptop has been quite favourable and this is a really really good example that the price of technology has reduced considerably. This has to be an ideal candidate for the education market.

    asus_eee_1

  • Over the last couple of months I have been involved in upgrading our current MOSS 2003 Intranet to MOSS 2007. All I can say that it has been eventful to say the least with numerous errors popping up left right and center. I am sure I will be posting more in future regarding my Sharepoint upgrade experience.  Anyway, back to this post. When I attempted to add a content database to my MOSS 2007 Intranet I got the following error:

    "Duplicate ID on sequence [Microsoft.Sharepoint.Portal.Upgrade.FarmSequence]"

    Interesting...

    The cause of this error resides in the Upgrade Definition files located in  "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG\UPGRADE" directory. The Upgrade Definition files tell Sharepoint where to dump the old content in the new database during the upgrade process. Even though the error message is not helpful in any shape or form, the solving this error is not too bad.

    Locate the following two XML files within the UPGRADE directory: SPSUpgradePremium.xml and SPSUpgrade.xml. Then all you need to do is delete the following line that looks something like this in both files:

    <Assembly Name="Microsoft.SharePoint.Portal.Upgrade,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c,Custom=null">
        <Order>5</Order>
    </Assembly>
    

    I just hope the other Sharepoint upgrade errors that appear will be more straight forward...

  • After my last blog posting (Google Is Better Than I Thought!!!), one of my mates said that he was unable integrate the Google Sitemap facility to his Blogger.com blog since there we could not find a Sitemap file. You can create a Google Sitemap for your Blogger.com site by carrying out the following:

    1. Login to your Google Sitemap account.

    2. Soon as you login you will be able to add your blogger site. In my example, I am creating a fictitious blog called "someblog.blogsite.com".

    1. Once you have added your new site you will get a message saying that your new site was added successfully.

    2. Now you will need to verify that you are the owner of the blog you have submitted (you wouldn't want anybody to track your site would you? :-P). You have two options here. You can either use a HTML file (which cannot be used on Blogger blogs) or META tag. Select META tag.

    1. A unique META tag will be generated for you:

    1. Login to your Blogger.com account and edit your Blog Template. Insert your generated META tag straight after the <head> tag and Save your template.

    2. In the Google Sitemap account click on the "Verify" button and if everything goes to plan you will be able to create a Sitemap file.

    3. Click on the "Sitemap" link from the left navigation and then click "Add Sitemap".

    4. From the Drop Down List select "Add General Web Sitemap".


    10) The Blogger RSS feed will be used as your Sitemap. So enter the full web address of your RSS feed. For example: http://someblog.blogsite.com/feeds/posts/ and press "Add General Web Sitemap" button.

    That should be it. It may take up to 24 hours for Google to crawel through your blog depending on the amount of content on your site.

    UPDATE:

    It looks like  there are 4 possibilities for referencing your Blogger Sitemap:
    > someblog.blogsite.com/rss.xml
    > someblog.blogsite.com/feeds/posts/full
    > someblog.blogsite.com/feeds/posts/default?alt=rss
    > someblog.blogsite.com/atom.xml

  • Published on
    -
    1 min read

    Google Is Better Than I Thought!!!

    google-as-a-giant-robot I decide to test how well my site postings was being tracked on Google and I was quite surprised that my site had not been tracked for over a month, which meant that all my recent posts were not submitted to the search engine. However, I found that you can manually tell Google to update your website through XML sitemaps. Pretty much all well known blog formats have sitemaps functionality. For example, http://blogs.sampleblog.co.uk/sitemap.axd. As you can see the .axd page is the XML Sitemap file.

    Using Google's manual update is as simple as going to the following web address: http://www.google.com/ping?sitemap=[sitemap URL]. Once you have carried this out Google will display a link to check your tracking status and gives you additional information on when your site was last tracked. Amazing!

    From carrying out further research on the Internet, Microsoft Live Search has incorporated the Sitemap ping back service in the exact same way. Instead you will need to go to the following web address: http://webmaster.live.com/ping.aspx?siteMap=[sitemap URL].

  • Published on
    -
    1 min read

    "Timeout expired" in SQL Server 2005

    If you are running a query that needs to make changes to quite a few rows within a database (in my case 8700 rows). You might get an error exception pop up which says the following:

    "Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding."

    After some investigating I found that there are two ways to overcome this error:

    1. Use Database Engine Query (or formally known as Query Analyser) to run your query instead of using SQL Panel in table view. I think that the SQL Query panel within table view is only used for smaller query operations. Thats just my guess because it didn't work for me. When using Database Engine query there is pretty much no limit to the amount of data you need.

    2. Override connection timeout in SQL Server Options:


    I found an option to change the timeout limit in the least place I expected. Under the "Designers" selection within SQL Server Options you will be able to change the timeout amount. But you cannot uncheck the override amount, you will have to specify the amount of seconds you require. 

  • Published on
    -
    1 min read

    Windows Disk Cleanup Alternative

    To keep a PC running smoothly, regular maintenance is critical. Many users shy away from maintenance tasks, thinking it is a long, drawn out manual affair, but the Disk Cleanup Utility can easily determine which files on a hard drive may no longer be needed and delete those files. In addition to freeing up potentially significant amounts of hard drive space, using a Disk Cleanup on a regular basis can significantly improve system performance.

    I have always used Microsoft Windows Disk Cleanup and I was interested in seeing if there were any free software that could do a better job. After trawling through the net I was surprised to find how many programs claim to help you get back your PC into original working condition by removing all the clutter. Just as I expected most of the Disk Cleaning utilities were not free. But I did find one cleanup utility that fitted the mark quite nicely called Cleanup (well what else would it be called Tongue out!).

    CleanUp is a powerful and easy-to-use application that removes temporary files created while surfing the web, empties the Recycle Bin, deletes files from your temporary folders and more. It frees disk space and reduces the "clutter" on your computer helping it to run more efficiently. It also can be used as a way to protect your privacy on the Internet. You can even instruct CleanUp to securely delete files making it impossible to retrieve their contents using lower-level disk tools - just another way of protecting your privacy.

    You can download the program here.

    WARNING!: This program is a really thorough piece of kit because it can even delete your Bookmarks if you have not selected the right options:

    Cleanup Options

  • Published on
    -
    1 min read

    Programmatically Using SqlDataSource

    The SqlDataSource control enables you to use a Web control to access data located in a relational data base, including Microsoft SQL Server and Oracle databases, as well as OLE DB and ODBC data sources. You can use the SqlDataSource control with other controls that display data, such as the GridView, FormView, and DetailsView controls, to display and manipulate data on an ASP.NET Web page, using little or no code.

    protected void PopulateComments(string recordNo)
    {
        //Connection to database
        string connString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
        
        SqlDataSource sqlDataSource = 
            new SqlDataSource(connString, "SELECT [CommComments], [RelComments], [ManageComments], [RoleComments], [PersonalComments] FROM [tblSurveyResults] WHERE ([SurveyID] = @SurveyID)");
    
        sqlDataSource.SelectParameters.Add(new Parameter("SurveyID", System.TypeCode.Int32, recordNo));
        
        System.Data.DataView dv = (System.Data.DataView)sqlDataSource.Select(DataSourceSelectArguments.Empty);
        
        //Output Comments to label controls
        lblQuestion1Comments.Text = dv[0][0].ToString();
        lblQuestion2Comments.Text = dv[0][1].ToString();
        lblQuestion3Comments.Text = dv[0][2].ToString();
        lblQuestion5Comments.Text = dv[0][3].ToString();
        lblQuestion4Comments.Text = dv[0][4].ToString();
    }
     
    

    As you can see, the data is output from the database in little code. I believe this is far more flexible compared to dragging a dropping a SqlDataSource onto the page. The above code queries the database and then passes the selected fields to a DataView. You can then output each individual column data where you want. In this case, I have output the data to labels:

    //Output Comments to label controls
    lblQuestion1Comments.Text = dv[0][0].ToString(); //Output CommComments column data
    lblQuestion2Comments.Text = dv[0][1].ToString(); //Output RelComments column data
    lblQuestion3Comments.Text = dv[0][2].ToString(); //Output ManageComments column data
    lblQuestion4Comments.Text = dv[0][3].ToString(); //Output RoleComments column data
    lblQuestion5Comments.Text = dv[0][4].ToString(); //Output PersonalComments column data