RegEx Search and Replace in Java

July 7, 2016

I wanted to remove the contents of any tags in my XML that ended with the word Password, and replace the password with stars. So:

<xml>
  <password>ABC123</password>
  <securityPassword>sekr1t</securityPassword>
  <username>FRED</username>
</xml>

should turn into

<xml>
  <password>**</password>
  <securityPassword>**</securityPassword>
  <username>FRED</username>
</xml>

This can ...

Venn Diagram in SVG

June 22, 2016

I wanted to put a three way Venn diagram onto a web page. I didn't want to control the size of the circles, but I did want to put numbers into the intersections.

I managed to do it with the following SVG. The double curly bracket notation is Django ...

Tags: svg venn html

Extracting XML from Oracle XMLType using XPath

May 4, 2016

I wanted to extract some XML from a column in a table. The column was of type XMLType, and the XML that was within it had a Namespace in it.

INSERT INTO drumcoder values ('<fred xmlns="drum"><joe>456</joe></fred>');

The value of the joe tag (456) can be ...

Oracle LAG Function

April 26, 2016

I wanted to refer to the previous row in a query and to do some maths to see the difference in the current row's date from the previous row's date.

This can be done with the Oracle LAG function:

SELECT sch_header, sch_date, sch_number, sch_date - lag(sch_date, 1) OVER ...

REST Guidelines

April 25, 2016

I found an interesting set of REST service guidelines at http://blog.octo.com/wp-content/uploads/2014/12/OCTO-Refcard_API_Design_EN_3.0.pdf