Monday, 20 April 2009

XSLT, text-transform:captialize and Excel workbooks

Quick note on parsing an Excel Workbook using XSLT. In this case, there was a requirement to transform a column of upper-case city names into capitalized city names in much the same style as using the text-transform:capitalize css property:

(This example put together with some significant guidance from this link:

Source XML document:

XSL Stylesheet:

Structure for Regular Expressions in Javascript

Quick note on using Javascript to perform basic RegExp pattern matching - it had been a while since I last tried to do this and I spent some time trying to recall everything. Listed is a (hopefully) functional example demonstrating "trimming" the first part of a URL so only the path is returned - while also serving as a reminder for the syntax:

Wednesday, 8 April 2009

SQL Server : Granting EXEC on Stored Procedures

Syntax for this is:

Sunday, 5 April 2009

Eclipse : Save Actions for autoformatting code and updating imports

If you want Eclipse to automatically tidy up your list of import statements and indent your code each time you save:

1. Open Preferences

2. Go to Java > Editor > Save Actions

Select (tick) Perform the selected actions on save and choose "Format Source Code", "Organize imports" and [any] "Additional actions"

Eclipse : Display heap status (like IntelliJ IDEA)

If you want to keep track of the heap status for eclipse (like IntelliJ IDEA does), go to Preferences then to General and tick "Show heap Status".

Eclipse : Display Java Type Indicator for classes

One of the many things I liked about IntelliJ IDEA was the fact that the Project pane would show whether a class was an interface or not. I'd been trying to find out whether Eclipse could do the same thing and it can:

1. Open the Preferences panel

2. Tick the checkbox at: General > Appearance > Label Decorations/Java Type Indicator

When you return to your project view in the package explorer, you should see a purple (I) icon next to your interfaces.