Programming

As of today, I am a developer / programmer who focuses on backend services, usually in Kotlin or Java, utilizing REST, SQL, Spring Boot, and some other technologies.

Switching from Essentials4J to Kotlin

At work we had a project that used Essentials4J and its predecessor Rapidoid Fluent, to simplify some stream/collection APIs. We were converting this project to Kotlin, and no longer need that library due to features of Kotlin’s standard library. The conversion was actually fairly straightforward. Do.group(…).by(…) Do.map(…).to(…) Do.map(…).to(…) with unique values d639a7ccf9252433

Switching from Essentials4J to Kotlin Read More »

Grouping runs of data in SQL

There have been a handful of times over the last few years where I have needed to take time series data and group the runs of data together to determine when a certain value changed, and how long it stayed that way. Sample Data We have a log table that, after keeping only the columns

Grouping runs of data in SQL Read More »

Optimizing a SQLite Database

TL:DR; takeaways: These seem very obvious, but with rushed deadlines, and “it works well enough”, these things are sometimes overlooked. The story I’ve been working on a project that involves taking flat files, importing them into SQLite, and exporting that database for use on low-powered client devices. I’ve had two such projects over the past

Optimizing a SQLite Database Read More »

Postal Code Voroni Diagram

The links in this article point to a free Heroku instance, which can shut down due to inactivity. It may take a few seconds for the instance to start up. I’ve uploaded a little experiment to Heroku, showing something I toyed around with a couple years ago. Would it be possible to approximate a map

Postal Code Voroni Diagram Read More »

Hibernate Logging Options

For years I have relied on a simple property “show-sql=true” to see Hibernate’s generated SQL. This option is fairly limited: it bypasses the logging framework in the rest of my apps (SLF4J) it doesnt show parameters, just question marks it doesn’t show any timing information Frustrated at these limitations, I set out to understand all

Hibernate Logging Options Read More »

Java 8: Optional

A fellow developer today asked me a question about the Optional interface in Java 8. My team is still working on a Java 6 stack, but his team is blazing the trail to Java 8. I’ve used Optional a little bit in some side work, and I am a little more familiar with Guava’s version. His use case

Java 8: Optional Read More »

Mockito AdditionalAnswers

Sometimes you use a framework for years, and then discover something new that it can do. I had one of those moments today with Mockito. I have an API that I am mocking, where I need to capture the argument passed in for further testing, that had a line that ended up looking something like this:

Mockito AdditionalAnswers Read More »

IE9 Print Stylesheet Issues

Over the past two years, I have had the pleasure of fixing two issues with printing from Internet Explorer 9. Both of the problems deal with IE-specific “filter” attributes in CSS. We have an application that is used by an audience that deals with a lot of paperwork. They like to print information from our application to add to

IE9 Print Stylesheet Issues Read More »

black and yellow analog clock

Mocking Time with Joda

A big project I have been developing over the last year has been an automated billing system. There is a part of it that involves scheduling bills, and has a lot of pieces that need to know various dates – when bills are due, when they were created, and the current time. We are trying to write

Mocking Time with Joda Read More »

Full Spring 3.1 Config

Someone asked for my full Spring 3.1 annotation configuration. I’ve stripped all domain-specific information, but the overall structure is intact. SpringConfig.java – this is the top level class, is empty except for @ComponentScan and @Import statements. The web.xml references this. SpringMvcConfiguration – Any MVC related configuration DatabaseConfiguration @Configuration
@ComponentScan(basePackageClasses = { SpringConfig.class})
@Import({ SpringMvcConfiguration.class, DatabaseConfiguration.class})
public class SpringConfig

Full Spring 3.1 Config Read More »

OpenSearch

At work we use several Atlassian products, including JIRA and Confluence. We recently upgraded to the latest version of both, and when that happened I noticed Chome starting to behave a little differently. One day I was typing in https://jira (the path to our internal instance), and all of a sudden Chrome's URL bar changed,

OpenSearch Read More »

GMail, webmail, and HTML

While working on a project at work, I started to see some weird things coming across in an e-mail that the system is supposed to send out. There have been several other developers working in the code, and it had not quite reached the testing phase just yet. Since I had some time on my

GMail, webmail, and HTML Read More »

GMail, webmail, and HTML

While working on a project at work, I started to see some weird things coming across in an e-mail that the system is supposed to send out. There have been several other developers working in the code, and it had not quite reached the testing phase just yet. Since I had some time on my

GMail, webmail, and HTML Read More »

Google GSON and Thread Safety

At work we are using gson to do some soft serialization between some applications. Our production application started to throw some errors this afternoon, and after looking into the problem it would appear that gson has a static reference to SimpleDateFormat (or, more correctly, a static member that was constructed with DateFormat.getDateTimeInstance(), which returns a

Google GSON and Thread Safety Read More »

Struts 2 and Fluent APIs

At work we use Struts 2 for a lot of internal applications. Lately, we have started to code a lot of our business objects in a fluent style (beans that return a ‘this’ reference in every setter). We were working on an application this past week that used both Struts 2 (2.0.11) and a fluent

Struts 2 and Fluent APIs Read More »