Archive for the ‘quick tips’ Category

Selenium Tests Randomly Failing

Saturday, July 31st, 2010

The Problem

The project I’m currently working on uses a lot of selenium tests to verify the behaviour of the web front end and, I must say, I’ve been quite impressed with it.

Yesterday however after updating my local machine with the latest copy of the project from Clearcase I noticed a lot of failing tests; the worrying (interesting?) thing though was that the failures appeared to be “random”. Tests were passing one run and failing the next, with no changes having being made in the source code and no changes in the initial starting conditions. I was starting to pull my hair out. Curiously the tests ran fine on my colleagues’ and the build machine. My workmate had a look (remember the tests ran fine for him) but he too was getting the random failures on my machine – we were both stumped.
(more...)

Tags: , ,
Posted in quick tips | No Comments »

Dos to Unix (Dos2Unix) with Eclipse

Wednesday, July 21st, 2010

1. Open the file in Eclipse that you wish to “Dos2Unix”
2. File -> Convert Line Delimiters To -> Unix

Profit!

Tags: ,
Posted in quick tips | No Comments »

JAXB @XmlAnyElement example

Monday, June 7th, 2010

The problem

I was recently working on a JAXB centric app which was required to capture “arbitary” xml. e.g.

<a>
   <b></b>
   <c></c>
   <d>
       <!-- "Unknown" XML here -->
       <maybee></maybee>
       <maybef></maybef>
       <!-- etc etc -->
   <d />
</d></a>

How could I ever capture the contents of if they could be “anything”?
(more...)

Tags: , , ,
Posted in Development, quick tips | No Comments »

How to convert a CLOB to an XMLType in Oracle

Thursday, June 3rd, 2010

Not much comment to add here; code says it all

PROCEDURE clobToXMLType(myClob IN CLOB)

IS
    l_xmlType XMLTYPE;
    -- do something
BEGIN
    l_xmltype := XMLTYPE.createXML(myClob);

EXCEPTION

    WHEN OTHERS THEN
    	RAISE;

END clobToXMLType;

Tags: , ,
Posted in Development, quick tips | No Comments »

Reset Gnome desktop the easy way

Sunday, May 16th, 2010

I recently upgraded Ubuntu on one of machines from 9.10 (Karmic Koala) to 10.04 (Lucid Lynx). In the old version I had installed a lot of widgets, messed up the fonts, buttons – loads of things. I needed an easy way to restore/reset the Gnome desktop back to the default look and feel.

I could of course have used the gui’s to undo all the changes I made but why bother? This is Linux after all!

# cd
# [sudo] rm -rf .gnome .gnome2 .gconf .gconfd .metacity

Tags: , ,
Posted in quick tips | No Comments »