Archive

Archive for July, 2010

Uninstall SQL Server 2005 Express Tools to continue, but…

July 17th, 2010 1 comment

If you try to install SQL Server 2008 R2 Express Edition you might get into the following error:

“The SQL Server 2005 Express Tools are installed. To continue, remove the SQL Server 2005 Express Tools.”

You say ok, that’s easy! You popup control panel, head to Uninstall Program and search for SQL Server 2005 Express Tools but nothing there…

Omg how should I continue now? :P

Don’t worry here is a quick fix:

  • Hit Start Menu and at the Search Field type “regedit” (The Registry Editor should be open now.)
  • Search for HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90
  • While you are there select the folder 90 and delete it.

This will allow you to continue the installation wizard.

Categories: Database Tags:

Save time with ninite.com

July 16th, 2010 No comments

Are you bored to download and setup each of your favorite applications after formatting your PC?

Would you like to install multiple applications at once without toolbars and clicking Next?

ninite.com
Ninite is the answer :P

This is a great tool that allows you to install common applications at once without having to separately download and setup each software.

All you have to do is:

  • Go to ninite.com
  • Select applications you want to install
  • Get the installer and go for a walk

When you return the latest version of each application will be installed and ready to use

Categories: Tools Tags:

How to sort a drop down list (select) using jQuery

July 15th, 2010 5 comments

Let’s assume we have a drop down list that it is initialized to display a list of option and programmatically you want to add or remove options. When you add options you might need to sort options in the drop down list based on the text or the value of each option.

Here is a select box with the list of Cities:

dropdown_list_cities

<select id="cities">
    <option value="0">Select City</option>
    <option value="2">Paris</option>
    <option value="3">London</option>
    <option value="4">Athens</option>
    <option value="5">Mexico</option>
</select>

In order to add a new city, let’s say Rome, and resort them you can do that client side using jQuery:

// Add a last option to the cities drop down list
$("#cities").append($('<option/>').attr('value', '1').text('Rome'));

// Sort by name
$("#cities").html($("#cities option").sort(function (a, b) {
    return a.text == b.text ? 0 : a.text < b.text ? -1 : 1;
}));

// Sort by Value
// If you don't convert a.value to integers javascript will assume
// that a.value and b.value are strings
$("#cities").html($("#cities option").sort(function (a, b) {
    var aValue = parseInt(a.value);
    var bValue = parseInt(b.value);
    return aValue == bValue ? 0 : aValue < bValue ? -1 : 1;
}));

// Reselect the first option
$('#cities').val('0');

What took me some time to figure out is that the value options should be converted to integers before sorting them as javascript will consider them as strings

Categories: Javascript, Web Design Tags: ,