Tuesday, 29 December 2020

Less is More

This post shares a title with a little article that a university classmate authored a couple of decades ago - back before blogging was a thing, so the platform that hosted it no longer exists - so you’ll just have to take my word for that.

The article was a comparison of two commonly used unix shell commands that are commonly used for viewing the content of a text file one page or buffer at a time.  The gist was that the “less” command offered greater functionality than the “more” command.

Evidently the same phrase also has a more widely known history for architecture and design being more impactful when there is less complexity or clutter.

People use social media for different purposes, and with different expectations of how to interact. One such example that I was not directly involved in, but found to be particularly strange, was when someone who holds himself up as a community leader became abusive because somebody had commented on their completely public post on Twitter, responding that it was as if he had been interrupted by a stranger while talking with his mates in a pub.

So, I should have known better than to chime in with “Less is more” on another individual’s tweet after having listened to a podcast that had included them as a guest.

Makes me wonder whether anybody that I have blocked on Twitter has taken it personally.  I very much doubt it.

Tuesday, 22 September 2020

The Return to London After Spending Lockdown in New Zealand

Whenever possible I try to minimize the amount of unnecessary stress in my life.  Sometimes that involves flying to the other side of the planet during a global pandemic.

This can be considered as part two of my "What I did during the Coronavirus Pandemic" post - a series motivated by the old "What I did during the school holidays" essay theme from childhood.

In mid-July I made the decision to book my flights back to London.  By this point the infection rate in the UK looked like it was going down, and my old accommodation was less at risk, but a key motivator for moving back was to ensure that my tax situation would not become complicated due to the country of residence situation.

When I went online to book my travel I was thinking about the risk of catching the virus en route, so I aimed to minimise my travel time and transit stops.  I wanted to catch up with friends in Christchurch, so had that as my departure point.  Australia - particularly Melbourne - was experience an increase in cases of the virus, so I decided to avoid any transit stop there.  Hong Kong was still not looking great due to political unrest, so I ruled out having any stop there.  Singapore looked like a safe option, and had been okay when I had travelled from London to Christchurch a few months earlier.

A few weeks later I came to realise that I had made a slight boo-boo when booking my flights.  Although New Zealand was on the UK's list of countries that it was okay to travel from without having to go into self-isolation when arriving back, Singapore was not on the list.  By including a transit stop in Singapore airport in my return flights to get me back to London I had destined myself to 14 days of being stuck in the flat.

Part of my pre-flight entertainment in Christchurch was to try out setting up a delivery of groceries to my UK address so that I would have enough sustenance during my second round of self-isolation.  As the supply / demand balance of online grocery orders had gone into a sensible level, I was able to schedule a delivery for a few hours after my return.

Even with the benefit of hindsight I don't regret my decision to travel via Singapore.  Realistically, given the limited range of countries within the UK's "travel corridor", if I had set up a travel route only involving those countries I believe that I would have been more at risk of becoming infected.

Wednesday, 9 September 2020

What I did during the Coronavirus Pandemic

The move to New Zealand

On March 23rd I decided that there was too much uncertainty around how long London would be in lockdown, so I booked myself a flight to New Zealand to stay with family.

A few days later I was in Balclutha in time to hear the town's civil defence siren sound half an hour before the start of New Zealand's level four lockdown.

Due to the remote possibility of being a carrier of the virus, I had to self-isolate for two weeks from the day that I arrived.  This meant that I could not go to the supermarket (the only retail business still open).  I was still permitted to go outside and walk around, keeping my distance from anyone else who happened to be out and about at the same time.

Work

At the time that I left London my team had already started to work remotely, so I was able to continue to contribute to the software development effort from my laptop - just in a different timezone.

Online only job interviews

Participating in the job interview process is strange enough when meeting face to face in a meeting room in the office, but we had to adapt to try to achieve the same level of confidence with a candidate being met exclusively online.  The challenge that we didn't really solve was finding a suitable mechanism for having the applicant draw an architecture diagram for a hypothetical new system.

Staying connected

For my circle of friends back in London I found myself making new connections on Facebook with people who I would semi-regularly meet up with in the local pub.

My pub quiz team WhatsApp group also kept me informed of changes in my London neighbourhood, though I eventually found myself sending them pics and videos that I had received - such as how a local pub was temporarily converting itself into a delicatessen.

Post lockdown socialising

By the 21st of May New Zealand had gradually moved to a lower level of Covid-19 restrictions.  More shops could open, and caf├ęs, restaurants and bars could operate with social distancing restrictions for customers, known as the three S's: seated, separated, and with a single server.

I didn't expect many businesses would open under the restrictions, as their overheads could be higher than before and the likely turnover could be expected to be much lower.

On one of my daily walks I came to realise that the pub closest to my side of the town was opening, so I decided to try it out for some food, beverages, and people watching - I hadn't really spoken to anyone beyond my immediate family for well over a month by that stage.



 

Monday, 16 December 2019

Revisiting exploring relatedness of videos using youtube APIs

Introduction
 
Way back in 2012 I dabbled with youtube's APIs to see how to determine whether two videos could be related via following their "related videos" out until finding a common video or running out of non-duplicate videos in the accumulated graph.

I've recently realised that the code from that particular experiment was only held on my old laptop that died a few months ago.  This is a good excuse to re-write it from scratch and produce something a little more useful - such as listing out the videos along the related path.

Blocker

Youtube's APIs have changed, so the approach that I took seven years ago won't work any more due to quota restrictions on API calls.
The only call that can bring back the related videos data is a search, and the minimum quota cost for a single search call is 100.  With a daily limit of 10,000 quota that would restrict us to 100 searches - which is simply not enough to build up a graph between videos unless they are very closely related.

Monday, 18 November 2019

Java 11 support added for AWS Lambdas

I've just deployed a little "Hello world" lambda that also logs out the system properties as verification that the setup is correct.  Seems to work.

Wednesday, 13 November 2019

Connection pooling in AWS Lambdas

A few months back I posted my findings from troubleshooting a resource leak in a Java application that had been lifted and shifted to become a lambda rather than a long-running app on AWS.

The resource leak turned out to be the setup of a fresh pool of connections to the back-end cache on each invocation of the lambda, without any corresponding clean up call to close those connections.

Yesterday I attended the Redis Day conference in London during which a presentation happened to include some code for a much simpler use case involving connecting to a similar back end cache - Redis - but with a different approach to initialisation.

The lambda from the presentation was extremely lightweight, so there was no bloated microservice framework involved.  Just a single method to perform a single task.  The initialisation of the connection to the Redis system was performed in a static block and had no corresponding call to close it.  I believe that this approach would ensure that the Redis client is reused between invocations of the lambda, and appears to be a recommended pattern for setting up connection pools for other resources such as database connections - relying on the receiving end to clean up resources if / when the lambda's container is shut down terminating the connection.

The static initialisation approach reduces the startup time for all but the first invocation of the lambda.