An In-Memory CSS Compressor For django-pipeline

I recently discovered the convenience of the django-pipeline library when attempting to reduce the asset size of a Django project. Currently, this library only seems to support external CSS compressors, such as Yuglify and YUI. While I have no objection to these specific tools, I simply do not want to complicate the deployment strategy by depending on additional external applications.

Disable Artifact Archiving With Jenkins DSL

Out of the box, the Jenkins DSL project doesn't currently provide a way of disabling artifact archiving. For projects with large outputs built on slave nodes, this can cause dramatic slowdowns as gigabytes of data are sent back to the master.

Freeing MappedByteBuffer

While investigating a production bug that indicated that the operating system of a server running only a JVM continually ran out of memory under a specific set of circumstances, I discovered a very interesting idiosyncrasy of the JVM. Specifically, memory allocated with mmap through the MappedByteBuffer (the super class of DirectByteBuffer) does not get munmapped until the allocating MappedByteBuffer is garbage collected.

Dropwizard IT Port Randomisation

Dropwizard's testing package includes a @ClassRule, DropwizardAppRule, that may be used to create end-to-end integration tests. However, you may rapidly discover that parallel test execution is severely impaired, as each test attempts to use the same application and admin ports as another.

Retain Your CDI Qualifiers

The CDI specifications is very clear in its definition of qualifiers. Of particular importance is the @Retention information: with the default retention, CLASS, a container's behaviour is undefined.

Finally, Rollback Your Transaction

Lately, I've been working with code that exhibits a fairly poor practice: programmatic transactions (namely Spring) don't always get committed or rolled-back, even though the code appears correct.

Enum Hash Codes Are Non-Deterministic

An annoying discovery: Java Enum objects have non-deterministic hash codes. Specifically, a hash code is the Enum's identity (or memory address).

No ConcurrentHashSet? No Problem

The JDK provides several concurrent Set classes, each with their own application, but it does not provide a ConcurrentHashSet. Using the Collections utility class, however, such a structure may be created.

Using @cache_page With Django's Feeds

When returning a django.contrib.syndication.Feed from a view function, the @cache_page decorator does not seem to work as expected. This note explains the reason and "solution".