I have finally managed to get to the bottom of the 'pop' problem on my Bowers and Wilkins ASW608 subwoofer. I understand the problem affects the ASW610 subwoofer as well.
 The solution is to set the EQ on your amp to reduce frequencies 30Hz and below, which the sub can’t reproduce anyway. 
 
 
 The problem is sometimes you hear a loud “pop” during playback.…
To set an “ordering key” on a message sent to Google Pub/Sub via Spring Boot using “Spring Integration”, you need to do the following:
The Spring PropertiesLoaderUtils.loadAllProperties method seems to have a bug where it returns entries from lower-priority classpath entries in preference to higher-priority classpath entries.
Git had a bug from version 2.33 onwards, fixed in 2.35. (Thanks to Richard Laager’s comment for the exact version numbers.) 
 “Stashing” then “unstashing” untracked files (new files you’ve just created) loses those new files, if any of the existing tracked files has a conflict. 
 Let me explain.
If you are trying to get Debian 10 Buster to run in Vagrant and are receiving the following error 
 default: /dev/vda does not exist, so cannot grub-install to it!
default: You must correct your GRUB install devices before proceeding:
default: 
default: dpkg-reconfigure grub-pc
default: dpkg: error processing package grub-pc (--configure):
default: installed grub-pc package…
Links in web applications can be 
 
 Relative links like <a href="/foo"> , or 
 Absolute links like <a href=“https:// www.site.com/foo'> . 
 
 If you’re writing a web application, relative links are generally the way to go. It’s simpler to move the application to a new domain. In addition, for those counting bytes, relative links are shorter. 
 However,…
Around 2003 I changed companies and accepted the title “Software Architect” at the new company. Before that, I’d been working as a developer, then lead developer, then development team lead for a B2C startup. 
 If I had a time machine and could go back in time to give myself advice, this is what I would say. 
 Caveat: Unlike “Software Developer” or…
Turning off a great server from Hetzner with over 1.5k days uptime (4.6 years). It needed an OS “dist upgrade” so I suppose a reboot was in order anyway. Such a shame!

To use XML Java DOM objects with PostgreSQL's XML datatype, do the following.
 
 Create your table with the XML datatype: (You now have a table where the x column can be an XML document, or can be null .) 
 CREATE TABLE foo (xml_column XML);
 
 Add the following to your Maven dependencies: 
 <dependency>
 <groupId>com.databasesandlife</groupId>
…
I hate when pressing the “backspace” key on the keyboard a certain number of times doesn’t wipe out that number of previous keystrokes. 
 For example, on Mac, if you press the spacebar twice then press backspace key twice you end up with one space. (As Apple inserts a period when you type space twice, so there are now three characters to delete.) 
 Or on Chrome, when…
The database system like PostgreSQL serves requests from many clients simultaneously. Sometimes multiple simultaneous requests might pertain to the same set of data. Programmers often (wrongly) think about the software they write as if it were the only process using the database. The danger is that often their software is the only piece of software using a particular piece of data, meaning that…
When trying to send an email, using JavaMail , from my application deployed via the Jetty web server in Docker , I kept on getting the following errors: 
 java.lang.NoClassDefFoundError: javax/activation/DataSource
Caused by:
java.lang.ClassNotFoundException: javax.activation.DataSource
 
 OK so with the upgrade from Java 8 to Java 11, due to Java 9 Project Jigsaw, a lot of…

There is no way to get Java to automatically use find out many cores are available and use them all, on AWS ECS using Docker. You have to specify how many cores you want to use via the -XX:ActiveProcessorCount option.
 
 On JDK >= 10, use the following JDK options: 
 -XX:ActiveProcessorCount=2
 
 On JDK >= 8, use the following JDK options: 
…
Spring’s Consuming web service guide is great at describing how to go about being a client of a SOAP service, but it doesn’t mention how to consume web services which are protected by any sort of security.
If you have a SOAP service written in Java using Spring, you have written methods that are called with Java objects representing the body of the SOAP request. If, after upgrading from Java 8 to Java 11 , you see that every attribute of those Java objects is null, adding the following to your Maven file is the solution:
There is a nice new feature introduced by type-inference in Java. I’ve wanted this feature for a while, but without type-inference, it wasn’t possible. 
 The feature is the ability to create a local variable of an anonymous class, and then use the particularities of that anonymous class. 
 For example, in Java 9, to access a new method you’d defined on an anonymous class,…
I always learn things about usability when watching my Dad use a computer. Recently I observed the following: 
 So as you type a station name into https://www.thetrainline.com/ it makes suggestions. So there are two fields, the “From” and the “To”. If you enter text in any of them, a drop-down appears with suggestions. Both these points are obviously completely standard…
Sad day!!!
Taking the website https://art.world/ offline soon.
I guess I must have worked at least 1 year full-time on this product.
I made a little video so I could remember the product after it’d been taken down.
It’s 15 mins, not that interesting! But if you want to know the sort of stuff I work on, this is it.
When I first started working, I noticed my boss at the time had a coding convention that I’d not seen elsewhere. As I was new to work, and the convention seemed logical, I adopted it, thinking it might be standard in the world of work. Alas I was wrong, I’ve never seen anyone else use it. But I still think it’s a good convention. 
 And that’s based around the following…
A Guide to the Project Management Body of Knowledge (PMBOK Guide) defines Resource Leveling (also known as Predictive Planning or Priority-Based Scheduling )
in the context of project management tools as: 
 
 A technique in which start and finish dates are adjusted based on resource constraints with the goal of balancing demand for resources with the available supply. 
 
 Many…
No view for workers to see what their tasks are.
 No range estimates to capture uncertainty.
 No view of estimated predicted costs.
 No view to see how long workers have work for (resource utilization).
 No 'what-if' scenarios.

-->
 
 
 
 
 
 Tool 
 Cost 
 What it does 
 What it doesn't do 
 
 
 
 
 Microsoft Project…
Back in 2010 I worked for a company that had daily stand-ups at 10am every day.
That’s fairly standard practice, so I found it difficult to complain about.
I was never enthusiastic about these meetings, but could never put my finger on why.
Recently I realized it was a combination of these factors: 
 
 
 You get paid for your best ideas. Nobody hires anyone to go to…
Email delivery providers such as Mandrill, Mailgun, SendGrid, AWS SES etc. all provide proprietary APIs and SDKs to send email over their service. These APIs are different from one email provider to the next. However all these services also allow you to send email via the industry-standard SMTP. 
 All email delivery providers encourage you to use their own API. Sometimes they don’t…
So this is your setup. You’ve using Jetty to serve your web application, and you’re deploying it via Docker to AWS Elastic Container Service (ECS), and you place it behind an AWS Elastic Load Balancer (ELB). You aren’t living in the past so you enable HTTPS on the ELB. Your clients connect via HTTPS to the ELB, and the ELB connects to your application via HTTP internally to AWS.…
In a similar vein to my previous article , here is a script to change the line endings of all files across all revisions in a Git repository to UNIX line endings. 
 git filter-branch -f
 --tree-filter 'find . 
 -name .git -prune -o 
 -exec sh -c 'file {} | grep -q text' \;
 -exec dos2unix -q {} \;
 ' 
 Subversion, by default, stores all files in the repository in the…
So your product bills customers and produces invoices. Being self-employed, I have to go through my bank statements and send those invoices to my accountant. This is what I wish companies who produce invoices would do: 
 
 
 Invoices are PDFs. PDF files are easy to put into a directory to send to my accountant. PDF files can be styled to actually look like invoices. (HTML files…
The traditional way of dealing with a checked exception being thrown from a place where you know it can’t actually be thrown, is to re-throw it as a RuntimeException . That way in case it does actually happen, you’ll know about it, and have the full stack trace available. 
 public void foo() {
 try {
 Writer w = .....
 w.write("foo");
 ....
 } catch (IOException…

 
 Deadlocks are: One session/user has acquired access to resource A (and won’t let anyone touch it), and is waiting for resource B. Another user/session has acquired access to resource B and is waiting for resource A. They’ll both wait forever. You don’t want that. Your software has now crashed. You want your software to be deadlock-free. 
 
 
 Software…
Recently a customer requested that a piece of software should “move companies” from company A to company B, henceforth appearing as if it’d always been created by company B, and never appear to have been produced by company A at all. (I would surprise you if I say this is not the first time I’ve received such a request.. or not?) 
 The simplest way would have been to…
I have been thinking about emails vs phone , or more generally asynchronous vs synchronous communication, and have realized: 
 
 
 If you receive a call , it breaks your flow, which is bad. 
 
 
 If you send an email , it breaks your flow, which is bad. (As you have to wait for an answer, and do something else in the meantime.) 
 
 
 So: 
 
 
 If you…
So today I got access to a customer’s new JIRA task management system. Unsurprisingly, every task has a field priority , from highest , high , low etc. It’s understandable that tasks might be sorted by urgency, to communicate that the most urgent stuff should be done first.
But these aren’t good names.
I have had the following experience at various previous customers:…
I wrote down a note on my task list on the current project, “Investigate whether docker build always gets the latest version of the base image”. The answer is, it does not, by default. Always use the --pull option to get the latest version. 
 When installing any software, it’s important to have security updates applied to all its components, including the operating system.…
I have long been inconsistent when creating Java Exception classes, in terms of how I name them. Having looked through the Exeptions that are supplied with Java, I see there is no real standard naming convention. 
 I have found more exceptions with the form <problem><noun>Exception . For example, IllegalArgumentException . So that’s what I’ve decided to use in the future.

A friend of mine asked me for my opinions on what programming language should be taught in the introductory class of computer science at university.
 
 I remember this debate when I was at university 20 years ago, this debate has no doubt been raging for centuries. (This may not be literally true, or rather, it is just not yet literally true at the time of writing…)
This is…
If you write a method like “add product to user’s cart”, you want to test that that method works. 
 That method may require state to exist e.g. in a database (e.g. that the user exists, to whose cart the product shall be added), and testing it automatically e.g. with JUnit may require querying the new state (e.g. that the product is now in the user’s cart). 
 You…

One of the functions of backups is to be able to restore the system and data in the case of a successful hacking attack. Without write-only backups, if the servers have access to the backups, then the hacker who has access to the servers has access to the backups too.
 
 It is generally understood that backups which don’t happen automatically get forgotten at some point. Without…

The trouble with toString() in Java (or ToString() in C#) is that every object implements it. If you want to extract information from your object, define your own method, like getName() , as opposed to overriding toString() .
 
 In order to leverage the Java type-checker, you might want to define a class like FooName to wrap a String , as opposed to simply using a String . That way, a…

In the REST specification, there is no way to group individual requests together into a transaction (in the way that it's possible to group multiple modifications to a database into a database transaction, or in a distributed J2EE system use a distributed transaction). Making all APIs idempotent goes some way to compensating for this shortcoming.
 
 Motivation 
 A client may well…

 
 In draw.io in the browser, go to the File menu, Export submenu, export as PDF. (I did not succeed in getting SVG output to work with LyX.) Select “crop” in the PDF export dialog. Export the PDF to the same directory where your LyX document is. 
 
 
 In LyX, go to the Insert menu, choose Float, choose Figure. (A “float” creates the style that the…
The arrow of time may famously only point only one way, but the progress in computer science takes a weaving non-linear path through the thing we understand as time. 
 The current understanding of how “undo” works within computer programs is pretty fixed;
all programs use “undo” and “redo” in the same way? But could “undo” and…
Today I've released a new version of my blog and homepage. Unless you're reading this a long time in the future and this design has been superseded by a new design, you're looking at it :) 
 It’s been a long time since I updated my blog design last. The previous design was a modification of the standard WordPress theme from January 2008. It wasn’t responsive, and was primarily…
If you replace code, and commit out the original while you are working, please delete the commented out code before you commit. 
 Code such as: 
 int x = foo() + 1;
// int x = foo() + 2;
 Becomes pretty unreadable after a time. 
 It makes sense to you while you write it, but in 2 years, and looked at by another developer, it will probably not make any sense. 
 We all…
It is a requirement of many customer projects of mine to have a 'remember me' or 'keep me logged in' checkbox on the log-in form. I am not aware of any standard approach to the subject; I suspect every company invents their own (and then blogs about it?) Here's what I do when asked to implement this feature, as online on art.world . 
 Here are the requirements as I see them: 
 
 Users…
I think it's important, that in a software development company, as all others, customers get transparent up-to-the-minute information about what costs they have incurred. Alas my company can't provide that at the moment, due to our tooling (this is a deficiency, or at least difference of opinion, between me and LiquidPlanner, the tool we use for tracking time.) This is the email I sent to…
The program “Facebook Background Task Host” was consuming the entirety of my disk bandwidth on my Windows 8.1 computer. Further, there seemed to be almost nothing written about this program on the internet according to Google. Rebooting the computer didn’t help: after the reboot it was there again. I did not remember downloading anything from Facebook to run on my computer. 
…
When I was at university in the 90s, studying computer science, my final-year bachelor project was a “fractal raytracer”. 
 My idea was to write a program which could produce pictures of those wonderful artificial worlds one saw on posters of the time, hung in every university dorm room. Raytracers render highly realistic images, and fractals produce interesting shapes to render.…
Ubuntu 14.04 (and various versions of Debian) come with MySQL 5.5. If you need MySQL 5.6 features (such as better join algorithms) you can install the Percona software, as described here . 
 However, the installation process prompts you for the database’s root password. This isn’t convenient if you’re running the installation process from a script e.g. a Vagrant or Docker…
Recently, when reviewing code, I saw a commit resembling the following: 
 - if (x) foo();
- if (y) bar();
+ if (y) {
+ bar();
+ }
 
 It’s not easy to see that of the two “if” statements, only one was actually deleted. The other had its formatting changed, but was otherwise not altered. 
 To prevent this, go through the…
I went to a lecture recently and the CEO of Runtastic spoke. He said: you don’t “win or lose” , you “win or learn” . 2014 was a year of learning for me. Some of it was good, but some of it was definitely in the “you win or learn” sense of learning. 
 Collecting on debts 
 Many customers thought they would just order software from me and worry about paying it later. (The word “later” in the…