Some notes on software development... RSS 2.0
# Monday, 14 September 2009

From the article, 10 Ways To Make Your XHTML Site Accessible Using Web Standards

<script type="text/javascript">  
$(function() {  
$('#divone').tipsy({fade: true, gravity: 'n'});  
$('#divtwo').tipsy({fade: true, gravity: 'n'});  

10 Ways To Make Your XHTML Site Accessible Using Web Standards
Monday, 14 September 2009 07:57:37 (GMT Standard Time, UTC+00:00)  #    -
Web Dev
# Friday, 11 September 2009

Here is an extension method that will swap two list items for any class that implements IList

public static void SwapElements<T>(this IList<T> obj, int index1, int index2)
    if (index1 > (obj.Count() - 1) ||
        index2 > (obj.Count() - 1) ||
        index1 < 0 || index2 < 0)
        throw (new IndexOutOfRangeException());

    T tempHolder = obj[index1];
    obj[index1] = obj[index2];
    obj[index2] = tempHolder;

And a quick test:

static void Main(string[] args)
    List<string> testList = new List<string>();

    testList.AddRange(new string[] { "Test1", "Test2", "Test3", "Test4", "Test5" });

    Console.WriteLine("Original List Contents");
    testList.ForEach(s => Console.WriteLine("{0}", s));

    testList.SwapElements(1, 3);

    Console.WriteLine("Swapped Item 1 with 3 List Contents");
    testList.ForEach(s => Console.WriteLine("{0}", s));


The result:


Don’t forget that lists are zero-based ;-)

Friday, 11 September 2009 10:39:22 (GMT Standard Time, UTC+00:00)  #    -
# Tuesday, 08 September 2009

If you change the name of a computer running SQL server you must also update the system metadata stored in sys.servers.
First check the current name by using

If @@SERVERNAME does not show the correct computer name you should change it using the following commands:


sp_dropserver <old_name\instancename>

sp_addserver <new_name\instancename>, local

Last step is to restart the SQL Server instance.

How to: Rename a Computer that Hosts a Stand-Alone Instance of SQL Server

Tuesday, 08 September 2009 08:26:13 (GMT Standard Time, UTC+00:00)  #    -
SQL Server
# Wednesday, 10 June 2009

Sometimes when I log in to a remote desktop session it appears as thought the Windows key is stuck on, so pressing keys like ‘L’ always locks the screen.

The workaround I found is this:

In the Local Resources options for the remote desktop session you should set the Apply Windows key combinations to be On the remote computer


Next log in to the remote desktop session.
Press Ctrl-Alt-End to lock the session.
Log in again and the Windows key will become unstuck.

Windows key "stuck" in Remote Desktop...

Wednesday, 10 June 2009 08:55:16 (GMT Standard Time, UTC+00:00)  #    -

Sign In
Total Posts: 116
This Year: 0
This Month: 0
This Week: 0
Comments: 36
About the author/Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2019
Hadrian Phillips

All Content © 2019, Hadrian Phillips
DasBlog theme 'Business' created by Christoph De Baene (delarou)