Group by SQL

Saturday, February 26th, 2011

For some reason I can never remember this simple piece of “group by SQL”. Some sort of mental block

SELECT foo, COUNT(foo) AS theCount FROM bar GROUP BY foo

Tags:
Posted in Development | No Comments »

DB2′s equivalent of Oracle’s “dual”

Wednesday, February 16th, 2011

This is really a quick example of DB2′s equivalent of Oracle’s “dual”

Get current date/time in DB2

select current date from sysibm.sysdummy1

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

RAD “Invalid thread access” errors when accessing CVS

Wednesday, November 10th, 2010

With its default settings, RAD 7.5 seems to be unable to remember CVS passwords. It also gives you a lot of “Invalid thread access” errors when accessing CVS.

To get around this, go to Window -> Preferences and then to General -> Security -> Secure Storage. Uncheck the “Windows Integration” checkbox.

You will now be prompted for a master password. From this point onwards, when you enter a CVS password and check “save password”, the password will be encrypted with the master password and RAD will properly remember it. Note that RAD will periodically prompt you for the master password, so make sure it’s something you can remember!

Tags: ,
Posted in Misc | No Comments »

Sample Java interview questions

Thursday, October 21st, 2010

  • Explain final, finally and finalize
  • Explain volatile
  • Difference between ArrayList and LinkedList and why/where would you use each
  • Difference between checked and unchecked expections
  • JVM – what do arguments Xms, Xmx indicate
  • Try/Catch/Finally – do you always need Catch?
  • Explain a deadlock
  • Name a design pattern, explain when you would use it
  • Why do you use Design Patterns?
  • Explain Inversion of Control, what advantages does it give you?

Tags: ,
Posted in Misc | No Comments »

How to stop XSLT from escaping XML in output

Tuesday, September 28th, 2010

I was asked by a colleague today how to prevent XSLT from escaping XML “special characters” in its output. i.e. < was being escaped to &lt ;.

I didn't know but somebody else did...

<xsl:value-of select=”somethingWhichContainsXml” />

should be 

<xsl:value-of select=”somethingWhichContainsXml” disable-output-escaping=”yes” />

Tags: ,
Posted in Development, How to's | No Comments »