Now with SSL

One of the things I’ve been less than happy with in my time at is that premium users using their own domains didn’t get SSL, whereas free users using did. There are perfectly logical technical reasons for that, but I had seriously considered moving elsewhere just to get SSL.

It turns out though that now supports SSL on custom domains, thanks to the LetsEncrypt initiative. The TL;DR version is that LetsEncrypt provides free certificates, supported by all modern browsers, that can be auto-generated using a command line utility. In fact LetsEncrypt is what I’d have most likely ended up using if I’d gone elsewhere.

How close I came to going elsewhere can be demonstrated by the DNS weirdness that some readers might have seen last night. I actually did cancel my premium renewal, and signed up with a traditional hosting provider. Thankfully that was only on a month-to-month deal (though to be fair to them, their signup process was slick and painless), and support were extremely helpful in un-cancelling the renewal I’d asked them to cancel about six hours previously!

Passing by value vs passing by reference: parameters in Java

A key distinction in object-oriented programming is in how languages treat method parameters: whether they are passed by value or by reference.

A parameter which is passed by ‘value’ is a fresh copy of the variable, meaning the method can change the value without affecting other parts of the program which use the variable passed as a parameter. A parameter which is passed by ‘reference’ means that the method is given a reference to the same variable used by the calling code – meaning that any changes will affect the calling code.

The short answer is that all parameters are passed by value in Java, as set out in s8.4.1 of the Java Language Specification (my emphasis):

When the method or constructor is invoked (§15.12), the values of the actual argument expressions initialize newly created parameter variables, each of the declared type, before execution of the body of the method or constructor. The Identifier that appears in the DeclaratorId may be used as a simple name in the body of the method or constructor to refer to the formal parameter.

That’s pretty clear: any time you pass a parameter to a method in Java, a new variable is created which contains the value of that parameter and which is visible solely to the method. But if you’ve programmed in Java you may be aware that this doesn’t (at first glance) appear to be consistent with how non-primitive objects are handled.


public class ValueVsReference{

  public static void main(String[] args){
    Thing myThing = new Thing(5);
    int myInt = 5;
    System.out.println("myThing value: "+myThing.getNumber());
    System.out.println("myInt value: "+myInt);

  private static void increaseThingNumber(Thing thing){
    thing.setNumber(thing.getNumber() + 1);

  private static void increaseInt(int number){
    number++; // equivalent of number = number + 1;

  public static class Thing{
    private int number;

    public Thing(int number){
      this.number = number;

    public void setNumber(int number){
      this.number = number;

    public int getNumber(){
      return this.number;

Executing the above code results in the output:

myThing value: 6
myInt value: 5

Why does this happen, when the JLS says that a new copy of each parameter is created? Consider what happens if we change one of the methods in the above code example:

  private static void increaseThingNumber(Thing thing){
    thing = new Thing(6);

So now rather than calling an instance method of the object passed by the calling code, we’re assigning the variable to a new instance of that class. The resulting output shows that Java is indeed a pass-by-value language, because the value of myThing is 5 (the value of the instance the main method creates) rather than 6 (the value of the new instance the increaseThingNumberByOne method creates):

myThing value: 5
myInt value: 5

The reason for the difference is that Thing is an object, not a primitive type (like int, float, char and so on). When an object is passed as a parameter, the value which is given to the method (and which is stored in a new variable per the JLS quote above) is a reference. Confused yet? The distinction between this and passing by reference is that you can assign the parameter to a different object without affecting the calling code – exactly as the second increaseThingNumberByOne method does.

So in short, when you pass an object as a parameter to a Java method, that method can change the original object (unless the object is immutable like String, BigDecimal, and many others), but can’t make the calling code’s variable point to a different object.

Spotify vs Apple Music: feature comparison

I have to admit, I’m a bit of a CD die-hard. The completionist in me likes having ‘the best sound quality’ available, and the freedom to convert content into whatever format is needed for a particular use case. Lately though I’ve been wondering whether it’s all worth the bother, or rather whether it’s worth still using CDs as my sole method of music purchase. Music streaming services cost about the same as 1.5 albums a month – and give you the freedom to listen to as many as you like.

Since I’m increasingly coming round to the idea of streaming as a way to make listening to music much more straightforward, this post is part public information, part ‘thinking out loud’. The selection of comparators is entirely arbitrary, and the decisions made even more so. The important point is that this comparison is made from the point of view of a potential customer, who hasn’t used either service and is thus judging them purely on available information rather than from experience.

Sound quality and format

Spotify Premium offers subscribers multiple quality settings up to 320kbps. Apple Music will presumably offer streams at the same 256kbps bitrate used by iTunes Match and the iTunes Store itself. So clear win for Spotify then? Sort of. There’s a point at which you no longer hear a difference from increased bitrates, which depends on your hearing, the quality of the original track, the quality of your audio equipment, how noisy your listening environment is and so on.

One also has to bear in mind that Apple Music streams will be in AAC format while Spotify uses Vorbis. AAC provides better sound quality at the same bitrate, so the gap between 256kbps AAC and 320kbps Vorbis may be less than it would be if Spotify also used AAC. Apple Music should also use less battery, because most devices have hardware decoding for AAC (which is much more efficient) whereas Vorbis has to be decoded in software.

Winner: Spotify

Music library

The $24,000 question. The music labels aren’t fond of Spotify – they insist that imposing greater limitations on the ‘free’ ad-supported service will increase takeup of subscriptions, despite Spotify’s clear evidence to the contrary from earlier trials of this idea. Some high-profile artists have also criticised the amount Spotify pays for streams – though the company pays 75% of its revenue to rightsholders (generally the record labels).

There might therefore be some cases in which content available on Apple Music is not offered to Spotify, though of course competition authorities would be very interested were such a situation to develop: even rumors of these sorts of shenanigans were sufficient to get them interested. This is perhaps unsurprising given that the last time it attempted to enter a new market, it used illegal anti-competitive tactics to try and unseat the dominant player.

The one slight trump card Apple Music has is matching. It appears that an Apple Music subscription will include the features currently being sold as iTunes Match (which will continue, by the way). This could potentially expand the range of content available (audiobooks perhaps?) beyond what’s available in the streaming library itself.

Winner: Wait and see (my money’s on the fruit-themed Californians)

Platform support

What you have to bear in mind is that Apple is a hardware company. It views its services, and its software, as ways of convincing people to buy more iPhones, iPads and Macs. It’s therefore not surprising that Apple Music’s platform support is very poor. The only non-Apple platform supported by the service is a Windows PC with iTunes installed. Spotify, by comparison, supports virtually any computer with the ability to output sound. There are native clients for Windows, Mac, Android, iOS, and even a beta client for Debian-based Linux distros. If that isn’t enough of a selection for you, there’s always the option of using the web player – perfect for situations where you don’t want to (or can’t) install a client. Workplaces which allow employees to listen to music on headphones for example.

Of course if you only ever buy Apple products then this may not concern you! About the only thing Spotify doesn’t support is the AppleTV, so if you have one of those connected to decent speakers then Apple Music is definitely for you.

Winner: Spotify, by a country mile

User interface

The Spotify clients, on various platforms, are generally quite well-organised and let you get on with listening to music. That’s of course if you ignore the white-on-black theme they force you to use, which can be decidedly Not Fun for people with certain types of poor eyesight.

On the other hand Apple Music will – on PCs and laptops at least – run through iTunes, which has the advantage of not using a white-on-black theme but the disadvantage of being iTunes. The mobile apps (provided you use iOS of course) should be excellent though.

Overall, “slightly crap desktop client” is less of an issue for me personally than “eye-hurting colour scheme you can’t change, on every platform”.

Winner: Apple

Free service

I decided to split this one off from pricing (below), because otherwise that comparison would become largely meaningless. Spotify has a ‘free’ service – where users pay by allowing advertisements to be played on their device, rather than paying directly with cash. Apple Music, on the other hand, offers a three month free trial (admittedly of the full, ad-free service) before requiring users to buy a subscription. So if you only use streaming occasionally (CD fans looking to ‘try before they buy’, for example) then Spotify is obviously the service for you.

Winner: Spotify (rather obviously)


The base price for both services is the same, so the only reason you’d choose between them on price grounds is if you are interested in one of the special account types on offer. Spotify offers a 50% student discount on Premium, while Apple offers a ‘family account’ for £14.99/$14.99 covering up to six family members. The latter could be a huge draw for the Apple service, since even if you only have four people in your household it reduces the cost to £3.75 per person – Spotify on the other hand expects you to buy additional accounts at a 50% discount, meaning that it only matches Apple’s price for a couple. You might think that Spotify will inevitably adjust its family account offering, to avoid Apple Music eating their lunch in Androidless households, but that sort of logic doesn’t always apply to streaming services. Amazon Instant Video for example still doesn’t offer a family subscription (at least in the UK), while Netflix has had one since the beginning.

Note that both services maintain the common fallacy of ‘$1=£1’ pricing. While the UK price includes VAT, that 20% tax doesn’t even begin to justify the 55% price premium users in the UK are charged compared to their US counterparts – at the time of writing $9.99 (USD) was equivalent to £6.42 (GBP) rather than the £9.99 both services charge.

Winner: Apple


It really all comes down to platform support. Do you use an Android mobile device or a PC with a Linux-based operating system? Spotify is the only viable choice. For those who use Apple devices and/or Windows PCs exclusively, Apple Music may well prove to be the better option – especially given the potential battery savings mentioned above.

Mod release: Vanilla High School for Cities: Skylines

I posted earlier about the Colditz-style high school in the new European art pack for Cities: Skylines. Since I really didn’t want to restart the city shown in the screenshot for that article, I’ve put together a mini-mod (more of a micro-mod really!) so that the standard high school can be built in European biome maps. It’s called Vanilla High School and is on the Steam Workshop.
The vanilla high school in Cities: Skylines
Obviously it would be pointless to activate this mod on a map that doesn’t use the European biome, unless you enjoy having duplicate items in your build list for some reason. The stats are entirely unaltered – the reason I decided to make the mod incidentally, as all the possible high school replacements on there at the moment buff the building’s stats and break the game balance to varying degrees.

Still, this shows how much better a game is when it has proper mod support. Don’t like a change? Rather than writing angry messages on the developer’s forums, just mod the game to make it more like what you want.

Cities: Skylines European biome – a concrete problem

The high school building in the Cities: Skylines European biomeOne of the features in the 1.1.0 patch for Cities Skylines was the new European map theme. Users were excited about the possibility of Parisian-style adjacent buildings and various other artistic goodies. Unfortunately one rogue element seems to have got through the QA process, in the form of this prison/1960s estate block masquerading as a high school.

I mean what. the. actual? Aside from its general unattractiveness (schools with council estate-style outdoor elevated walkways?), the thing isn’t to anything like the same scale as the other buildings in the game. It takes up a block of about 10 squares by 8 – the same as half a dozen factories. Come on Colossal Order, letting a ‘my first mod’ nonsense like this into a release isn’t up to the high standards we’ve come to expect.

Update: Fix now available

Top 5 recommended Cities: Skylines Mods

Cities: Skylines has many advantages over the most recent iteration of SimCity, but the most obvious of them is in its extensive modding support. Like other modern EA games, SimCity was locked down tight for fear that free mods would be better than EA’s cherished paid DLC. Colossal Order, on the other hand, take the view that including modding support in a game makes it more fun and therefore makes more people buy it – which makes them more money in the first place, and increases the potential audience for good quality DLC in the future. This post aims to provide a brief insight for new players, or those considering buying the game (hint: Steam summer sale starting in a couple of weeks), into some of the best on offer.

1. New Game+

One of the key gameplay elements of any city builder is unlock progression. Most of the unlocks in Cities: Skylines – called Milestones – are fairly sensible, and offer a good sense of achievement as your city expands. Unlike some other examples in the genre, C:S also gives you a cash bonus at most of the earlier milestones so that you actually have the money to build at least one of the newly-unlocked shiny things. The one restriction that’s a bit annoying though is the limited road selection at the start of the game – you can only build the most basic, undecorated version of each road type and highways are locked off entirely until you reach 2,400 population. This leads to various problems:

  • Since the decorated road variants (the ones you actually want) take up more space than the undecorated ones, you end up having to demolish buildings along every road you upgrade to the new road type. Aside from hitting your city’s growth, it can also mess up your grid spacing and require expensive relocation of city buildings.
  • You can’t use highways for moving traffic through your city, so you end up either using avenues or having a huge roundabout at your city entrance – both of which can have rather unfortunate impacts on your traffic flow

New Game+ adds extra options to the ‘new game’ dialog, allowing you to choose which unlocks are available at the start of the game. You can also adjust your starting funds – so you can afford a couple of blocks of highway intersection for example – but don’t hike this too much or you take a lot of the challenge out of the early game. There is a bug with the mod (or perhaps, rather, with how C:S handles mods) which means that the dialog will only appear for the first new game you start after downloading it. This isn’t an insurmountable problem (much as the trolls on the Steam Workshop page would argue otherwise), since you just delete the mod from the ingame ‘mod manager’ and then redownload it from the workshop using the Steam Overlay. It honestly takes less time than waiting for the map to load.

2. Improved Public Transport

An odd quirk of Cities: Skylines is that the public transport management system is actually quite limited. I say ‘odd’ because Colossal Order’s previous game development experience was a series of public transport games called Cities in Motion! You can set up lines OK, but you aren’t given any control over the number of vehicles running on the line – the game automatically generates vehicles based on a preset formula. This can leave you with vast zergs of passengers waiting at your bus stops and train/metro stations.
A passenger zerg in Cities: Skylines
Improved Public Transport rectifies this situation, by allowing you to manually set the number of vehicles on each line. It also allows editing the capacity of vehicles, and by default will set these to more sensible values than vanilla C:S – for example it sets the capacity of metro trains to be the same as real-life London Underground trains. This will solve your passenger zerg problem, but remember that while you don’t have to buy the individual vehicles (as in Cities in Motion) they do have a running cost which can mount up very quickly.

The one thing the mod doesn’t do is make airports and seaports worth building – you’ll still get weekly tourist numbers in double figures, and you’ll still be much better off having a tourist rail station (connected to the external network, which your city’s passenger network shouldn’t be). The fact that Colossal Order have made no mention of fixing the very low tourist numbers (the ‘unique building’ attractions cost about €100 per tourist in upkeep!) does make me slightly suspicious that a “make tourism not pointless” paid DLC may be coming at some point in the future – perhaps I’m just being cynical.

3. Pig and Pay bank

The pig bank growable asset for Cities: SkylinesOK so this is technically an asset rather than a mod but it’s an adorably cute pig, what more could you want? It’s a 1×1 light commerce growable, so you’ll see them popping up quite often in the gaps between larger buildings’ footprints or in those small segments of zone that you’ll end up with if you ever build curved roads. I recommend you do build curved roads by the way, not just for extra piggy loveliness but because once your city gets to the 30-40k population mark looking at that many identical square grid blocks becomes a bit boring!

4. Traffic Report Tool

Once your city gets big enough then unless you planned it really well (you probably won’t, for your first 3-5 cities at least) you’ll start getting serious traffic problems. Simply seeing the traffic jam isn’t much help in working out how to solve it though, and clicking on individual vehicles will only provide imperfect information. Traffic Report Tool will show you the routes being travelled across a particular segment of road – it pulls the info from the game AI’s routing system. This allows you to either redesign your road layout in that area (probably dynamiting more high rises than Glasgow City Council in the process) or to provide additional public transport to hopefully reduce the problem.

5. Mod Achievement Enabler

This one is pretty self-explanatory. By default, enabling any mod will disable Steam Achievements. This mod turns them back on. Bear in mind that if you use ‘auto-milestone’ mods (which automatically activate milestone rewards at the start of the game) then you’ll automatically gain a bunch of achievements immediately rather than through gameplay – and this can’t be undone. That aside though, this mod enables you to play with the Cities: Skylines setup of your choice and still gain achievements in the process.

Why I switched to

I’ve been with NSDesign for as long as I’ve had this site – since 2000 in fact. Lately though I’d been noticing a steady decline in performance – the admin interface could sometimes take 4 or 5 seconds to open, and tests with site performance diagnostics didn’t produce encouraging results either. This doesn’t have any obvious cause, as I hadn’t written any posts lately (hence traffic was infinitesimal) and only had five user-facing plugins installed. It might just be my imagination, but I have the impression that this decline in performance started when NSDesign spun off their hosting service to a separate company (‘Broadband Cloud Solutions’) – though it could simply be down to running PHP in CGI mode, which the WordPress Codex article on performance regards as a Bad Thing.

I’d half considered (even before deciding to change hosting) using something like a static site generator – the idea being that instead of storing your posts in a database and having script files of some sort to generate pages from that, you write the posts as Markdown or reStructuredText and then use the generator to turn that into a fully functional set of HTML files for a blog. The obvious benefit to this is that the web server doesn’t have to do anything difficult: it just gives each visitor a copy of the static page they requested. Since I’ve done some Python development before, Pelican would have been an obvious fit. The problem though was that although this is obviously a blog, the capabilities of static site generators as a category didn’t meet my particular use case:

  • You obviously can’t do anything interactive, given that you’re using static files. There are ways of getting around some of these limitations, but I’m not a particular fan of Disqus and wanted to avoid using it if possible
  • You lose the ability to update your site from any computer, whether a desktop laptop or mobile device. In fact you can only really update from a machine where you have administrative rights, a command line, and permission to install software.

Since I knew I definitely didn’t want to go down the cloud VPS route (just I didn’t want that sort of hassle for a personal site), that excluded the various Django-based solutions I might otherwise have gone for. Ultimately then, with Textpattern not having advanced hugely and Ghost relying on a VPS-type setup I knew I would end up using some form of WordPress. Installing WordPress yourself on a hosting account has the obvious advantage that you get full control over your WordPress install. You can use any theme you want, edit its structure however you want, and install any plugin you want. doesn’t allow you to do any of these things: you can only select themes from a gallery of presets, while installing plugins is verboten.

What you get in return for that loss of flexibility is actually quite good though. Premium gets you a total of 13GB of storage (everyone gets 3GB, buying Premium gets you an extra ten), which is roughly comparable to what the more reputable shared hosting providers offer at this price point. You also lose the ads that occasionally appear on free sites and gain the ability to modify the CSS (but not the structure) of whatever theme you end up choosing. The key advantage – and what ultimately persuaded me to go with – is that everything else is unmetered. You don’t need to worry about bandwidth (‘unlimited’ bandwidth shared hosting for £2 per month? Pull the other one!) or CPU usage (the real killer) – if your site gets Slashdotted then it just continues to work, rather than slowing down to a crawl, eventually dying, and getting your account suspended.

UPDATE: I actually wrote most of this as a draft before I ported the site over. Unfortunately the changeover went a lot less smoothly with my old host than would probably have been the case with their pre-outsourcing customer support team. I filed a fairly simple support ticket asking for the nameservers on the domain to be changed to the ones, and nothing happened except a query the next day effectively asking if I knew whether changing the nameservers meant the nameservers would be changed. I confirmed that I did, and still nothing happened. Perhaps I’m being unreasonable, but I don’t think it should take more than 24 hours to copy-paste three lines into a domain config – even at the weekend! It’s a shame that a 15-year relationship with a company had to end with transferring the domain to a different registrar in order to get something so simple sorted.