Similar Posts
Parsing HTML
I’ve been interested in HTML parsing for a while now. There are a number of reasons to do this, such as: Validating that what claims to be HTML, is HTML Finding every style sheet and script in an HTML file Pretty-printing Syntax highlighting Linting Translating between markup languages, for example generating JSPs from PHP, or…
Reading Paradox Files
Back in the day, Paradox was a pretty amazing database. I recently had a reason to read some Paradox files for a friend, who had a client with a Paradox database. They needed their data out of the database to insert into something more modern. Googling for the file format of a Paradox DB didn’t…
TNT
If you haven’t read this book, I highly recommend it. I discovered it in high school and finally purchased my first copy at the now-gone Duthie Books in Kitsilano. Without going into the details of the book, the author uses a simple Peano arithmetic called Typographical Number Theory (TNT) to illustrate some of his points. An example…
Ebean-DAO
When building database ORM code, I prefer to use ebean, and I prefer to use DAO‘s. Since DAO’s are simple to make generic, I have a Generic DAO I use for all projects. I’ve finally decided to open-source my DAO code, and you can find it here https://github.com/teverett/ebean-dao.
Playing with the Spa
We have an Arctic Spa at our house which we enjoy. Recently, an OpenAPI spec has been published for it, so I decided to write a Java wrapper so I could control the spa myself, and monitor temperature with Prometheus and Grafana. The resulting code is here. The wrapper class “com.khubla.kspa.Spa” takes care of all…
Servlet mocking with Mockito
When writing custom servlets, it can be quite useful to unit test them. In my case, I used a combination of testng and mockito. The basic idea is simple; mock a HttpServletRequest, and a HttpServletResponse and pass them to the custom servlet. There is a bit more too it, so here’s an example. final HttpServletRequest…