Windows Live Messengers shows up as two separate items in the Windows 7 taskbar. In order to fix this, if it annoys you like it does me, follow the steps below:

  1. Open the Start Menu
  2. Look for Windows Live Messenger
  3. Do not left click, instead Right Click on the icon
  4. Select Properties
  5. Look for Compatibility Tab
  6. There is a drop down list of operating systems you can choose to which the application was compatible (or in the mode you wish it to run)
  7. Select either Windows XP SP3 or Vista
  8. Click Apply
  9. Click OK
  10. Restart the application (in this case Microsoft Live Messenger)
  11. Should only show one now.

That is it. I can’t explain why this is yet, but at least you can free up some of your taskbar again. :)

Posted: January 11, 2010, 8:53 am by Brian Radford

To import a linux guest from the Xen Opensource (hypervisor) to XenServer

1. Create a new VM in XenServer, and make sure the virtual disk is at least the size of the disk you will import.

2. Get UUID from virtual disk images
xe vdi-list params=all

3. Import the raw disk image file into the virtual disk image
xe vdi-import filename="raw_image.img" uuid="UUID"

4. Boot the VM. Note: You may need boot the VM off a valid bootable ISO image first so that the drive’s location path is set.

To convert from a VMware guest to XenServer
To import a VMware linux guest first convert the vmdk to img and use the “Other install media” Template in XenServer.

qemu-img convert -f vmdk vmdk_image.vmdk -O raw raw_image.img

Posted: October 16, 2009, 3:32 pm by Brian Radford

In the past as we have moved more applications to the browser, there are some users who still struggle with the change from a desktop application to the browser. One main change is that the browser applications don’t always prompt for saving data as the user closes the browser or navigates away from the page. Changes are made, and the changes are lost as they navigate away from the page without saving. How do you ensure that changes to the data are saved before the user navigates away or closes the browser?

The javascript window.onbeforeunload event can help with this.

window.onbeforeunload = some_function

Your code can be as simple as the above, but I would recommend a few additions, e.g. checking to see if the user has made any changes before you throw up a confirmation prompt. It is always annoying to make no changes, but still be prompted to save before navigating away. In order to track if changes have been made, here is a simple javascript tracking example. Of course, your pages may be much more complicated, but this will illustrate one approach.


var values = new Array('', '', '', '', '', '');
var needToConfirm = true;

window.onbeforeunload = confirmExit;
function confirmExit()
{
if (needToConfirm)
{
// check to see if any changes to the data entry fields have been made
for (var i = 0; i < values.length; i++)
{
var elem = document.getElementById(ids[i]);
if (elem)
if ((elem.type == 'checkbox' || elem.type == 'radio')
&& values[i] != elem.checked)
return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?";
else if (!(elem.type == 'checkbox' || elem.type == 'radio') &&
elem.value != values[i])
return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?";
}

// no changes - return nothing
}
}

Enjoy this bit of code, but be careful not to over use it. It can be annoying. :)

Posted: August 3, 2009, 8:20 am by Brian Radford

If you want to check out a quick and easy way to back up your blog, check out http://www.bloggled.com/

There are several options including a FREE one. It is easy to setup and get started. Check it out!

Posted: December 15, 2008, 12:12 pm by Brian Radford

JDBC prepared statements are ideal for backend optimization. The resulting SQL does not need to be re-optimized if you are using a parameterized SQL statement. Single parameters or even parameters by name with a single value are quite simple an easy, and you can find examples all over the internet. But if you would like to pass in an array into a parameter, it may be difficult to find examples.

This is an example of how to do this with an Oracle SQL statement.

First, you will need to create a custom data type in Oracle.

CREATE TYPE t_collection IS TABLE OF NUMBER;

Then in you jdbc client, you will need to use the OraclePreparedStatement class, and some of the other Oracle provided classes.

import oracle.jdbc.OracleConnection;
import oracle.jdbc.driver.OraclePreparedStatement;
import oracle.sql.ARRAY;
import oracle.sql.ArrayDescriptor;

Define your SQL statement.

select itemid, prompt from responses where itemid in (select value(v) from table(:item) v)

Notice: The (select value(v) from table(:item) v ) is using a nested table, thus the table(). We will pass in the :item as the t_collection type that we created which will be treated as a table.

Now in your method call you would:

// change from a jboss connection to an oracle connection
con = (OracleConnection)((WrappedConnection)getConnection()).getUnderlyingConnection();

// create a statement, apply the filters as parameters, add the item parameter, and execute
statement = (OraclePreparedStatement)con.prepareStatement(RESPONSES);
statement = applyFilter(statement, filter);

String[] items = itemid.split(”,”);
ArrayDescriptor desc = ArrayDescriptor.createDescriptor(”T_COLLECTION”, con);
ARRAY sarray = new ARRAY(desc, con, items);
statement.setARRAYAtName(”item”, sarray);
rs = statement.executeQuery();

Posted: August 12, 2008, 11:19 am by Brian Radford

Note: Custom File Filters for Flex Builder Stand-alone’s Flex Navigator

While using Eclipse or Flex Builder, there are times when you want to ignore certain folders in the Eclipse Project Explorer or the Flex Navigator. If you click on the properties for this window then you can apply certain filters. But there are times when you want to add more filters to this list. Here are the steps to do this. (Creating custom filters for eclipse project explorer or custom filters for the Flex Navigator)

Customizing the list of filters isn’t a easy as you would hope (e.g. just clicking add), but it isn’t as difficult as you think if you’re comfortable with editing text files ;). There may be other ways, but this is what I did to tell Flex Builder to ignore my build directories that I had named target:

1. Locate the directory of the Eclipse plugin being used for editing. This is usually something like eclipse/plugins/[plugin name]_[version].
Some examples are:

Flex Builder 3 default installation:
Adobe\Flex Builder 3\plugins\com.adobe.flexbuilder.standalone_3.0.194161

my Aptana plugin directory:
eclipse/plugins/com.aptana.ide.scripting_0.2.9.16696

2. Once you find the plugin directory, open the plugin.xml file in a text editor.

3. Find the extension element whose point attribute has a value of org.eclipse.ui.ide.resourceFilters.

<extension
point=”org.eclipse.ui.ide.resourceFilters”>

4. Copy one of the existing filter elements that already exist and create one that contains the needed file pattern. For my example:

<filter
pattern=”target”
selected=”true”/>
</extension>

5. Restart Eclipse using the -clean switch.

If your file didn’t include a resourceFilters section, you can insert one similar to the one that follows:

<extension point=”org.eclipse.ui.ide.resourceFilters”>
<filter selected=”false” pattern=”.svn”><filter>
<filter selected=”false” pattern=”.project”><filter>

After restarting Eclipse with the -clean switch, the custom file patterns appeared in the Filters list and I was able to hide any patterns.

Posted: July 9, 2008, 2:17 pm by Brian Radford