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

ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION

March 5, 2016

I have a website that allows download of a zip file. This zip file is created on the fly, and by using the Content-Disposition header I can determine the filename it is saved as.

This particular download worked in Firefox but not in Chrome. It turns out that Chrome has ...

Migrations not working with Postgis

February 21, 2016

./manage.py migrate was giving me the following error:

django.db.utils.OperationalError: could not open extension control file "/usr/share/postgresql/9.1/extension/postgis.control":
No such file or directory

I'm on Debian, and most of the solutions suggest installing a scripts package that isn't there ...

xmllint

January 31, 2016

There's a command line too on linux which can be used to check how well formed XML is.

$ xmllint -format carweb.xml >! carweb.format