LeadDev Together 2021 - Developing your Team
2021-07-16I'm fortunate enough to have attended the LeadDev conference a number of times through my work, and I always come away with new insights and motivation to improve the way I lead my team. 2021 is no different, with an insightful set of talks on various topics. These are some key things I took away from the first day of the conference.
Importing SSL Certificates into the Java TrustStore
2020-06-10In order to make an HTTPS request in Java, the SSL Certificate issued to the site you're trying to connect to needs to be in a TrustStore. OpenJDK 10 onwards comes bundled with a set of root CA certificates so it's less of an issue, but in older versions of Java this isn't the case.
Configuring a Google Domain to Point to an S3 Bucket
2019-09-28I've just switched to a .dev domain and wanted to host a website on Amazon S3, however all of the guides I could find assume you're going to use Amazon's own Route 53 rather than the Google Domains nameservers to achieve this. I wanted to keep using Google's nameservers as it's more cost-effective and I can use the super-simple email forwarding feature. I did figure out how to do all this in the end, and this post will explain how.
Grails: Hibernate Caching with Ehcache
2017-11-14For a while I’ve ignored Grails’ caching options, often thinking “well even if they’re not optimised, at least they’re doing something”. But I spent some time recently trying to minimise a delay on querying some relatively static data, and diving into caching was a part of this.
New PC
2016-01-05I built a new PC over Christmas (after ~7 years the old one’s more than had it’s day) thanks to the /r/buildapc subreddit, an amazing source of information for all this sort of stuff.
Bootstrapping Test Data against Read-only JPA Repositories in Spring Boot
2016-01-04If you’re working against a database in a Spring Boot application, chances are you’ll need to bootstrap data for your tests. Spring suggests using .sql files, however it soon becomes unwieldy to maintain a large repository of scripts.
Grails: GORM Querying Behaviour
2015-08-29There are various ways of querying a database with Grails, but they behave slightly differently. In this post I want to talk about the behaviour of dynamic finders and where closures specifically.
Grails: Passing Variables from a View to a Layout
2015-08-29In order to pass variables to normal Grails views or templates the model parameter is used, which is a Map that contains all values you want to make available to the view:
The Tetris Randomiser in 20 Lines of Code
2015-07-17The Tetris Randomiser that chooses the next tetromino, implemented in Groovy. It could have been shorter, but with efficiency trade-offs. I chose to implement the TGM2 variant, as described on the Tetris Wiki.
Mockito: Tips and Tricks
2015-04-18I recently finished re-working a small Java-based project that didn’t have any unit tests. I chose to use the popular JUnit + Mockito combo for adding these, and this post contains some of the things I picked up on (sometimes after much blood, sweat and tears) when learning the framework.
Grails: Transient Properties on Command Objects
2014-10-28On Grails domain classes it’s possible to declare variables as transient (i.e. should not be persisted to the database) by using the transients property:
Spock: Interaction Testing with GroovyInterceptable
2014-06-09Grails uses Spock as its testing framework by default. Spock can be a fantastically expressive framework, but I came across a stumbling block recently when trying to test a class with interceptable methods.
When is a Float not a Float?
2014-02-01I came across a small issue the other day that I thought was interesting enough to make a post about. One of the methods I was interfacing with that returned a float would occasionally return a value of NaN (depending on the input), whereas I always wanted to use a numeric value.
The Value of Coding Challenges
2014-01-18I recently spent some time doing coding practice with Codility, a website that sets coding challenges and a time limit and grades your solution on various factors at the end (correctness, scalability, edge case handling etc.). Most of the challenges are able to, or meant to be done using basic techniques such as primitive array and character manipulation, which is something I generally don’t need to do when working in a language with a rich library like Java. So it was a bit of a hurdle at first.
COS: Implementing the Levenshtein Distance Algorithm
2013-08-01I was recently asked to help out a member of our Integration team with an issue they were having matching an entry in a pre-defined list of addresses against some free text that has come into our system from a customer – text that could contain slightly different lines or sections (such as postcodes), words missed out, or extra text such as ‘urgent: please send ASAP’.
Java: Sending Email with SMTP via SSL
2013-05-28This is an example that shows how to send emails using pure Java.
Linux: Configuring SSH Keys
2013-01-12I’ve experienced a few situations where its been necessary to configure an SSH key in order to access a Linux box remotely and securely. This post will be an overview of the general configuration of such a setup, in case I ever have to do something similar in future. These instructions are readily available all over the internet in various formats, but I like to have it all written up in one place.
Java: Parsing JSON with Google’s Gson Library
2012-12-30This post serves as a follow-up to A Simple REST Client, in which a basic REST client for the Facebook Graph API was created. In this post, a few examples will show how to get started with Gson by doing some simple parsing of JSON (JavaScript Object Notation) returned by the Facebook Client.
Java: A Simple REST Client Template
2012-11-26More and more of my projects include an aspect of calling out to remote systems, be it to a web service via SOAP, or more recently to REST architectures. As part of this work, I’ve adopted a certain approach to creating web service consumers. I’ll illustrate this with a simple example, connecting to the Facebook Graph API, the most recent iteration of its REST API (with a fancy name).
Going Metro - Thoughts on Windows 8
2012-11-16I was one of the (likely) minority who jumped to upgrade to Windows 8 within a couple of days of its release. This is the first time that I’ve upgraded OS manually as opposed to waiting for whatever edition comes with my next new PC, but I had my reasons. In this post I’ll be discussing my opinions of some of the new features, highlighting both the good and bad that I’ve come across so far.
The Pi and I
2012-09-30A few weeks ago I was convinced to buy a Raspberry Pi. It’s a very flexible piece of kit, and has a friendly community supporting it to boot. It also gives me a chance to delve into a Linux environment at home, something I haven’t done before. My RPi is currently employed as a media center and sits comfortably next to the television in my living room.
Photoshop: Transparency through Alpha Channels
2012-09-23Alpha Channels. I’ve wasted many hours in the past researching them, finding incorrect guides, finally figuring them out, and then promptly forgetting and repeating the process 6 months later. Thus its in prime position for transcribing.
Introduction - Welp
2012-09-12I decided to invest in some webspace and set up a blog here, mainly focusing on tech/IT stuff. I have a few reasons why. First and foremost, as a Software Developer, I tend to pick up various code snippets; often mundane yet vital pieces of code that perform the things that you find yourself doing over and over again.