6 Feb 2021

There’s a munch of computing anachronisms that I still find charming that at the time we considered terrible. I guess in part its nostalgia, and in part I think it’s the realization that simplicity has its place: the quest for better things is necessary, but the stages along the way aren’t all inherently bad - they just felt that way at the time as it stopped you doing better things.

One of these things is how old Apple Macintosh computers dithered images to display them on their 1-bit colour depth displays. Whilst it’s great we have amazing colour displays today, I do find there is a nice artistic simplicity that old look has for certain images, particularly those with high contrast, like this picture of Tate Modern I posted yesterday:

A 1-bit dithered image of Tate Modern's new wing.

In abstract it’s a terrible rendition of the image, but for high contrast black and white images it’s a nice way to reduce them to their primitive elements without losing all the detail if you just set the sliders to the extremes of black and white in Lightroom.

Or perhaps, as I alluded to already, I’m just overly nostalgic 🤷‍♀️

Here’s today’s photo upload, which also happens to be a highish contrast black and white piece:

A 1-bit dithered image of a long exposure of people walking around some art at Yorkshire Sculpture Park.

I was all set to try reproduce this effect in photoshop, but when I went to research this I discovered this web page that implements the Hyperdither algorithm and you can just drop an image in there and bam, it’s like being back in the early 90s all over again.

2 Aug 2020

I’ve recently been trying to find non-screen based ways to find inspiring and/or just nice to look at photographs, and to that end I’ve been buying one photography book and a small number of zines each month as lock-down continues. Whilst I’m not going to review them all, I will recommend my favourites here, starting with Modern Color, a look back at the photography of Fred Herzog.

A picture of the cover to the book Modern Color

I’d not heard of Fred Herzog before reading this book, so don’t feel bad if it a new name to you too; my understanding is that his work wasn’t very appreciated at the time and is only gaining notice of late. In part because he chose to work in colour back when photography was only considered art if you used black and white. Fred Herzog takes what I’d describe as street photography without people, capturing city life (mostly in his home town of Vancouver) of the 50s and 60s but with the city as the subject rather than any individual people living there.

There is a current vogue, which I must confess to rather like, for pictures of the remains of old buildings from this same era, particularly along route 66 and the like (e.g., Kat Swansey or Kyle McDougall, just to pick some examples from the K’s). I guess it’s a mix of the wonderful visual design elements whilst also telling a story about how things don’t last. But if those photos tell the end of the tail, Fred Herzog captured its birth in these pictures. It was that modern world being created: tower blocks settling in amongst the wooden buildings that came before, the shiny sleek modern cars, neon signs everywhere.

The images themselves certainly stand on their own in terms of composition and use of colour - I like the images as images themselves. Whilst a few do feel a bit snap-shot-ish, most have a strong sense of there being a point to what Herzog was trying to capture as he walked about his city: somewhere in each picture there is a juxtaposition or strong visual element to make it interesting. But as the book title hints, here’s more to these photos than this.

A spread from Modern Color showing some pictures of cars from the 70s in vivid oranges.

It’s rare those of us who didn’t like through the era to get to see it without the filter of black and white making it immediately of another time: distant and distinct. Here in colour the world is much more relatable to modern day, encouraging you to spend more time looking at the details that make the world of the 50s and 60s different from the world of today, or instead to reflect on the similarities that indicate we haven’t come as far from that world as we oftentimes might think.

Some scenes, such as this picture from 1960, could easily have been shot today, such is the timeless nature of certain aspects of our cities:

A photo showing a street in Vancouver at night with car light trails and neon signs that could be from anywhen.

And that I think is why I like this book so much: not only are the pictures aesthetically pleasing and pop thanks to the inclusion of colour, but they really do encourage you to engage with them rather than just immediately write them off as here’s how things used to be.

20 Jul 2020

Recently, as noted here, I recently rebuilt my website at short notice. Thankfully I was already tinkering with a new version of the site in the background, and that new version suddenly went into production sooner than I’d anticipated. I was a bit nervous as I’d just started rebuilding the site in a new tool, called Hugo, which at the time I was still getting started with, but I’m pleased to note that it has exceeded my expectations.

Still, there’s a bunch of things I wish I’d known then than would have got me going much more quickly, so I thought I’d document them here to save others time. The tl;dr is:

  • Don’t use a canned theme, as it will severely restrict how you can structure your content, not just how it looks.
  • If you’re making your own theme, you can use the page metadata to do very interesting things
  • You can add your own markdown extensions to make common content tasks easier

If that’s possibly interesting then read on, otherwise if you scroll to the bottom there’s a picture of a skateboard.


Context first: my old site was effectively just a single blog thing running on Textpattern, and it’d been that way for a decade or there abouts. Textpattern is a simple system that did what I wanted at the time and let me ditch the self written nonsense I’d been using for the decade before that (I assume thus this new system will be in place about a decade - so be sure to check back in 2030 to see what I’m using then). Textpattern was a php based thing I just installed and it used a MySQL database in the backend for storing everything (blog posts, comments, the CSS snippets I used to theme it, and so forth). It was fine, but I wanted to replace it for several reasons:

  • I was paying a bunch of money for hosting both the website and the database for a site that does not get much traffic and does nothing dynamic.
  • It is nice that Textpattern is simple, but it also made it hard for me to use it for anything beside just the blog.
  • You can’t edit posts offline, which means I end up writing them in one place and then moving them over, which leads to my next point…
  • It has its own markup language rather than using markdown like everything else, which I forget when editing offline

So I decided that at some point I’d switch to a much simpler static website, mostly to save me money, but also to let me start doing more with my own website again.


Hugo is a static website generator tool - that is to say you feed it a bunch of files with your posts written in markdown, and then it generates all the HTML files for you with nice index lists, individual post pages, etc. You just then need to copy these static files to your web server and you’re done. Indeed, with a static site you don’t really need a web server of your own these days - you can host them in Github Pages, AWS S3 storage, or Azure storage blog, to name but a few. This would cost a lot less per month, and mean I don’t need to maintain anything server wise. For those curious, I’m hosting this on Azure currently, and it’s costing me a few pennies a day to host.

There are many static website generators out there, but I initially picked Hugo as firstly I didn’t want to write my own, and secondly if the tool turned out to be limited in features it is written in Go, a language I use regularly, so if it came to it I could modify Hugo to my needs (it’s thus not been the case - Hugo turns out to be very flexible as is).

So what are the Hugo features that have made me happy with my choice after using it in anger for the last couple of weeks? Let’s run through them.


Hugo will use a “theme” to make all your web pages look pretty, and indeed they host a site where you can pick from a large range of existing themes. My first bit of advice is, assuming you know any HTML and can cope with writing a few templates, to just ignore this and make your own.

When most people think of themes they thing of what colour the pages are, what font they use etc. And whilst in Hugo your themes do control that, they do something far more important that is lost when you pick an existing theme: how do you want your website to layout content, and treat different types of content? This is controlled by the theme, so if you have even the slightest desire to have more than what the theme author wrote, then you’re stuck. In my mind Hugo only really becomes a tool to enable you to make your own website when you make your own theme.

To make that more concrete, on this site I currently have two different types of content: I have text posts and photo posts. Before I just had the text posts, but as part of having my content on my own site, I wanted to also publish the pictures I post to Flickr to this site too. However, I don’t just want pictures to appear as another blog post, I want them to have their own space on the site and to have the pages for both photo lists and the individual photos to be tailored to show photos, not just squished into a page designed for text. Hugo allows for what I want, but the themes that you can get from their theme site do not, they all make assumptions about the nature of the content you’ll be hosting, and none of that worked for my design goals here.

Thankfully, although theme design can be quite complicated if you want, it is well documented and you can find various beginner tutorials via searching. Designing a theme is mostly about writing templates into which Hugo will place your content, and if you’ve done any modern web development you’ll get up and running very quickly, but if you’re not a developer then don’t worry as it’s really not that difficult once you’ve gone through a tutorial or two.

So that’s my most important tip: don’t use a pre-existing them, make your own: the theme will control how you structure your content, not just how it looks, and that will control how useful the site is to you.


My next tip is to take advantage of the non-content data that Hugo lets you store each page, and have your templates use that to do interesting things.

So a typical Hugo page looks like this:

---
title: "My amazing blog post"
date: 2020-07-20T10:28:57+01:00
draft: true
---

Blah blah blah something something something.

The bottom section is where you put the markdown for your post, this is your content. The top section is what Hugo refers to as the front matter. By default when you create a new page it’ll add those three entries, but you can store anything you like here. By default it uses YAML, but you can use JSON too if you like. In your theme’s templates you would then write something like:

<html>
  <head>
    <title>{{ .Title }}
  </head>
  <body>
    <h1>{{ .Title }}</h1>
    {{ .Content }}
  </body>
</html>

And you’d get a fairly simple page with the right title and the content converted from markdown to HTML under the title. So far, so simple hopefully. You could display the date in there too if you wanted, and the draft field controls if Hugo will render this page when you build the site or not - by default drafts won’t be compiled when you build your site until you say it’s no longer a draft.

However, let’s look at what I do for my photos posts. If you want to try follow along, have a look at an example page here. In my photos I have lots of extra data in the front matter, as you can see here for the page I just showed you:

---
title: "Parked"
date: 2019-11-13T08:02:48
taken: 2015-11-29T00:12:44
draft: false
flickr_id: 49057946503
flickr_url: http://www.flickr.com/photos/68497070@N00/49057946503
latitude: 37.765300
longitude: -122.421814
Make: Fujifilm
Model: X-E2
ISO: 200
FocalLength: 35.0 mm
ExposureTime: 1/750
FNumber: 1.4
LensModel: XF35mmF1.4 R
LensMake: Fujifilm
LensInfo: 35mm f/1.4
City: San Francisco
Country: United States
State: California
---
Spotted parted outside Four Barrel in the Mission District. Again, a simple image, but it appeals
to me - probably the lighting/colour, which is straight out of camera pretty much.

What’s going on here? Firstly note the content doesn’t match what’s rendered in the page! No where in the content section do I have the image displayed, but if you follow the link to the page there is an image, so where’s that coming from? I generate the image HTML from the front matter in the page template:

    <a href="{{ .Params.flickr_url }}">
        <img src="{{ .Params.flickr_id }}_large.jpg" alt="{{ .Title }}"/>
    </a>

For various reasons I post all my photos to first Flickr and then sync them over to this site using a script. When the script downloads the images it stores them with the flickr ID in the name so I can easily reference them using the ID as I do in the above template fragment.

You’ll also notice that at the bottom of the page there’s a paragraph about where and when I took the photo, and what camera and lens I used that also isn’t in the content. Again, that’s all from the front matter generated in my template.

Why do it this way? It’s for flexibility: say I decide I don’t want that final paragraph but rather I’d like to have a table of stats about the photo instead - I can simply change my template once and all my photo pages will get the new look. There’s more fields in there than I currently use, but in theory one day I could add a javascript map to the page and use the lat/long stored in there. But there’s no real cost to having more things in the front matter than I use, so why not put it in there just in case? This is nice, because if I was storing this all a database I’d probably be weary of adding things I don’t need, but here it’s free so I do so.

As a more simple example I add a one sentence synopsis to the top of each blog post which is where the short description on the home page comes from.


Putting all this information in the front matter rather than just hard-wiring the content also lets me do one other trick, which brings me onto my final tip for getting started with Hugo.

Markdown is a nice and simple way to express your content, but occasionally you want to do something that markdown won’t let you express, so you fall back to HTML. However, Hugo can help you here with what it calls shortcodes. It’s basically a way in the markdown you can invoke a tiny template. Again, let me give you an example:

Parked
Parked - 13 Nov 2019

I inserted this image into this blog post by just typing:

{{< photo parked >}}

This invokes a template I’ve got called “photo” which looks like this:

{{ $fullname := printf "photos/%s" (.Get 0)}}
<div class="photo">
    {{ with .Site.GetPage $fullname }}
    <div class="listimage">
        <a href="{{ .Permalink }}">
            <img src="{{ .RelPermalink}}{{ .Params.flickr_id }}.jpg" alt="{{ .Title }}"/>
        </a>
        <div class="overlay">
            <b><a href={{ .RelPermalink }}>{{ .Title }}</a></b>
            - {{ dateFormat "2 Jan 2006" .Date }}
        </div>
    </div>
    {{ end }}
</div>

Here when I do the photo shortcode, my photo template works out the name of where the photo really is (as I’m lazy), then works out the Hugo page object based on that, and from there I can generate all the HTML to show the image. Suddenly a page line this one are really easy to pull together - I just need to know the title of the image I want and in two words and some punctuation I have the image nicely placed in the page without having to know anything about where the image is stored, how to link it, etc.


That’s it for now, but I hope this shows you a little how powerful Hugo is, once you get passed the idea that you should be using one of their default themes. I really is powerful under the hood if you want it to be and if you let it.

11 Jul 2020

I doubt anyone will really notice, but this site was unavailable for a few days due to a race between me slowly migrating away from where it used to be and that service going away sooner than I expected. As a result, I’ve deployed the work-in-progress version on the grounds of having something up is better than nothing.

The main change is I want to host a bit more than just the blog here, so you’ll for instance find a seperate feed of the photos I post to Flickr that I’ll try to keep in sync - though again I’m not quite there with all that yet, so that might be a bit sparodic initially too.

The main thing, that no one will realise for obvious reasons, is that the RSS feed locations are now all broken. So if you were following by RSS you’ll need to resubscribe via the links on the right. The RSS feed is also one of those where currently it has partial posts - I’ll try fix that too at some point soon, sorry.

Still, a bit of excitement for an otherwise somewhat moribund website.

I noted a while ago that I recently got myself a camera with a fixed 23mm lens on it, as a way to try prevent me leaving my camera at home due to fear of not having my many lenses with me. In my head I like to think I could just leave the house with my 35mm prime, as that a lovely lens that has been my preferred focal length for a long time.

That 35mm lens on the cameras I use is effectively the same focal length as human vision, and so is a good lens for documenting interesting things you happen across, which is probably how you could politely describe what passes for my photography style. For example, this Skateboard parked up in San Francisco, California:

Parked
Parked - 13 Nov 2019

Or this chap waiting for the train just down the road from that last picture in Mountain View:

Turn Off Cell Phone
Turn Off Cell Phone - 4 Dec 2019

However, I’ve been processing a lot of old photos during lock down, and now I realise why I struggled to leave my lense collection behind – my 12mm wide-angle lens gets more use than I give it credit for. It’s a bulky lens and one that it’s hard to see as a daily shooter lens, but if I look at the pictures I’m selecting to push to Flickr of late, the 12mm is actually dominating.

There’s certain kinds of shot you can only get with a wind-angle lens, such as this shot of Cadillac Ranch, just outside Amarillo, Texas:

Cadillac Ranch
Cadillac Ranch - 10 Apr 2020

That’s a wide thing, and to get it all in you need a wide lens. Similarly, the below shot of some stairs in Helsinki, you can’t get far enough back, so you need something wide to fit it all in:

Spiral stairs
Spiral stairs - 6 Apr 2020

But there’s other shots I’ve taken where at first glance they don’t seem like wide-angle, but in fact are. I love this picture of Laura I took in a coffee shop up in Glasgow, which again shows the use of a wide-angle to not go wide, but to cope with limited room to back up:

Even on landscape shots that lack a strong foreground element I’ll find I assume it’s my go-to 35mm lens I used but on double checking it’s actually the wide-angle 12mm, like this one of East Mitten in Monument Valley, Arizona:

East mitten
East mitten - 18 Apr 2020

If you want an example of the contrast between the two, here’s two pictures I happened to take near the same spot outside our hotel in Dallas, Texas, at different times of day. Here’s the 12mm view:

Dallas at night
Dallas at night - 5 Apr 2020

And here’s the 35mm view:

Obviously there’s a very different tone to the two scenes that makes it hard to just concentrate on the focal length changes, but if you look closely you can see the same landmarks in both, despite at first glance them not appearing to be the same place at all.

Thus now I see how much I was actually using the wide-angle it’s little wonder I struggled to leave the house without multiple lenses. The wide-angle lens I have, the Carl Zeiss Touit is not a small lens like the 35mm, I can’t just hide it in a pocket, and it’s not just a lens that I feel I can just use on its own for all situations either, thus ending up feeling I needed a camera bag, and this the camera becoming something that only came out for special occasions.

Hopefully by getting a camera with a fixed lens that sits between my two favourite lenses I’ll be able to get a little of both. Perhaps not – but having a camera with is certainly better than both the 35mm and 12mm lenses being stuck in the cupboard.

Having just acquired a camera famed for its applicability to urban and street photography, we are all asked to stay at home – my timing is great as always. Obviously you can take a lot of pictures at home – I certainly did during my 365 project where having some white card to use as a backdrop for random household items proved invaluable – I don’t really feel like doing that right now. Instead, I’ve decided to go back through all my old photos and try to improve my basic editing skills.

In the last few years Laura and I were fortunate to go on a series of road trips through parts of the US, and some city trips to Nantes in France, and Helsinki in Finland. During these trips I took a lot of photos but published very few of them. In part this was because I’m not a fan of Lightroom, and so dreaded processing them, but also because I found a lot of the pictures didn’t match the scene as I felt it emotionally or remembered it after. Now, no amount of editing will make up for bad composition, of which there is a fair amount in my library, but even where I felt I got the composition right, the photos didn’t convey how the scene felt, and it’s these photos that I’ve been going back to try and see if I can improve, to expose some hidden gems.

The kind of things I’m looking to adjust are exposure, contrast, colour temperature and balance, that sort of thing. In terms of pixel editing, the most I’m doing here is cropping or straightening, but ideally I’ll have got that right in camera. Basically, I’m just doing the things that you could have done in a dark room – if you’ve not read it I can recommend this old article about how famous film prints had their exposure tweaked across the picture.

My tool for this is Lightroom, and as such I’ve been watching a lot of videos about how to edit photos of various styles. Whilst some of these videos do go into the “swapping the sky for a better one”, or even into “please buy my Lightroom presets”, I’ve learned something from each one despite not all of it being appropriate for me (or the presenter’s bombastic style not being to my tastes :). Here’s a few that I can recommend if you’d like to getting started in this too:

As I continue to watch these videos and expand my knowledge of what I can do, and just get practice in so I develop an intuition for what works and what doesn’t, I’ve been posting to my Flickr account a picture every day or so from my backlog.

The other restriction I’ve given myself is that in general I will just use a limited set of colour profiles. Given these are all older pictures, I’ve kept it to Color Chrome and Monochrome+Y on pictures taken with my old Fujifilm X-E2, and a similarly restrictive set of Adobe colour profiles that look similar for those taken with my Canon 7D. The reason for this is to force me to do the editing, rather than letting the colour profile change a lot of things without my understanding why.

This below picture, of a painted street box in Helsinki, is one of the first ones where I managed to get the photo to convey what I saw rather than what came straight out of camera:

Bright Helsinki
Bright Helsinki - 23 Mar 2020

The day was quite overcast at that point if I remember correctly, and so the picture came out of camera with a very flat look. For this one I tightened up the crop a little, upped the overall exposure, then gave it an S-shape on the tone curve to provide slightly more contrast. I also used the clarity slider, which adjusts contrast in the mid-tones for the image to further bring out the detail in the neutral background.

One thing I didn’t change, and as a rule don’t, is colour saturation. Its very easy to overdo that, and I find that adjusting the light and dark to make a photo pop results in an image more to my tastes.

This photo was taken from a hotel window in Nantes, and was me just trying to capture the cityscape a little:

High up in Nantes
High up in Nantes - 24 Mar 2020

The sun at this point was just coming up, and out of the camera I’d lost all the detail in the street, due to the high contrast of the light itself. So here I had to do the opposite of the previous picture and remove contrast rather than add it back. I also tweaked the colour temperature to bring back the warmth of the scene which had been lost as the camera made everything look more white than yellow. The result much better captures my emotional memory of the light of Nantes in the morning than the series of bits that were saved to the flash card.

This final example is one I’m quite frankly amazed is one of my pictures at all – this is something I have no right to have taken:

Through the pass
Through the pass - 26 Mar 2020

This is taken in the Black Canyon of Gunnison National Park in Colorado. At the time there was a crazy snow storm that had swept in: the previous day we were having to buy hats to keep the sun from burning us, and the following morning it was a white out. I took this picture of the break in the rocks, but out of camera it looked very dull, as the diffused light caused everything to come out looking flat.

Interestingly it really didn’t take much to make this pop, which is the real learning for me here – I went from a dull looking picture to one I’m proud of very quickly. I upped the exposure at the top end of the tone curve to brighten up the whites – which is how I remember the scene in that snow storm, and to separate the foreground rocks from the background. I also again adjusted the clarity just a little to bring out the features of the rocks to be a little more distinct. And then finally what got me to me memory was adjusting the colour temperature down, the opposite of what I did on the last photo, to capture that slightly colder look. And bam, it turned out that one of my favourite photos I’ve ever taken was sat in my photo library for the last two years and I didn’t know it.

Thus, if you’re stuck at home wishing you could be out taking pictures, perhaps instead go back and see if there’s any hidden gems in your photo library that just happened to escape your attention at the time.

21 Mar 2020

My stats in Lightroom tell a sad tale: about ten years ago I was taking four to five thousand photos a year with an actual camera, but two years ago that fell below 1000 for the first time, and then last year it halved further.

In part, that’s just how inspiration is, and I’ve had other focuses, but it was also in part down to two practicalities that put me off: firstly I wasn’t finding my camera gear encouraged me to carry it everywhere, and secondly I disliked the tools I had processing photos. This post is mostly about my attempt to solve the first part of that.


About ten years ago, when I first seriously got into photography as a hobby, I graduated from my first DSLR to shooting with a lovely but large Canon 7D. For a while, particularly when I did my 365 challenge, I carried it everywhere. But at some point, even though I mostly just used a fixed 35mm prime, that bulk got far too much to carry everywhere and I found myself less and less frequently heading on out with a camera.

To fix this, about 5 years ago, I swapped over to a Fujifilm X-series compact system camera, the X-E2, which was low down in their range, but had two vital features: it was both small and light. The X-E2 still had proper interchangeable lenses, so I could pander to my love of 35mm primes with lovely narrow depth of fields, but it was also of a size where I could shove it in my bag without adding much bulk.

Along the carriage
Along the carriage - 31 Oct 2019

The problem was that whilst I’m addicted to prime lenses, I also do like having options. So I’d usually have my 35mm prime on the Fujifilm, but then I’d want to carry with me the also very lovely 12mm wide angle prime I had, which was quite bulky. And sometimes I’d want to take my 55-200 zoom if going out somewhere where I might need that – once you managed to get an unexpectedly good shot with a lens you’re loathed to leave it behind just in case.

Great Egret Preening
Great Egret Preening - 30 Oct 2019

And so I ended up with a camera bag full of stuff on the off-chance I might need them, and thus I’m back at having a bulky set of bits to carry around, and thus I kinda stopped carrying them.

The other downside of the Fujifilm was that those earlier models were quite slow in terms of focus. So on some trips, like when we went to Nantes last, I’d still take the Canon 7D with me just armed with the Sigma 30mm prime, but still be frustrated with its bulk whilst enjoying the ability to get shots quicker (even if this example below looks static, it was on a moving boat :).

Pastel rope
Pastel rope - 12 Oct 2019

Add to that my other interests, this lead to me just using my phone to take snaps and forgetting about artistic photography for a while.

But of late I’ve wanted to get back into photography. Partly as I wanted something that I’d do for fun alone, and partly as I was inspired by seeing great photos from my friends, such as Dave, Morag, Tim, Jason, and Karen – each has a very different style from me, but it’s just lovely to see what they’ve been making and it made me want to try again.


Thus I decided at the end of last year to stop having two cameras that I didn’t want to carry around with, and get one I would. Originally I was looking at trading in both my 7D and X-E2 and getting a more recent Fujifilm body like the X-30 that had faster autofocus whilst remaining in their lighter end of their cameras, but that didn’t fix the issue with my lack of discipline around taking all my lenses with me everywhere just in case.

So I decide to do something radical/silly and get a camera with just one fixed lens in it: not just a fixed focal length, but also permanently fixed to the camera. If I can’t change the lens, there’s no need to take all these extra lenses around with me is there? To this end I got a Fujifilm X100F, which has an 18mm f/2 lens on it. The 18mm sits somewhere between my two usual regular primes of 35mm and 12mm, making it good for urban style photography which usually what I go for:

But it also still is close enough that it still lets you take pictures of people in situations:

The laughing drummer
The laughing drummer - 5 Mar 2020

The camera choice is/was a bit of a gamble – it may be over time that I find this a frustrating choice (when I explained to my friend I mentioned above, Dave, what I was doing he asked “why do you hate yourself?” :). However, one thing I love about prime lenses is how they force you to consider things differently, look for a non-obvious take that will fit within the constraints of the limitations of the lens you have to hand. I’m not a hugely artistically creative person, so I find that forcing these constraints on me pushes me to be more creative than I’d otherwise be.

Abstract aluminium
Abstract aluminium - 20 Mar 2020

The other nice feature about the X100F is that it is a Fujifilm camera still, and means I still get to use the lovely film simulations that Fujifilm cameras come with. The above photos are mostly using the Acros black and white film simulation, but I also like the Classic Chrome colours:

Morning goods
Morning goods - 6 Mar 2020

And it’s with these two film simulations I’m trying to fix a little of the other reason I don’t take many photos, which was I became obsessed with trying to edit them just so. Instead I’ve set myself a soft limit that I can use just these two film modes, and then just minimal edits in Lightroom before publishing. This way I worry more about the moment of capture than spending an age editing.


So I’m back taking pictures again: perhaps not at a prolific rate still, but I’m having more fun experimenting with this simplified camera and simplified workflow.

I’ve resurrected my Flickr account, and am posting there what I take if you’re interested in seeing what I capture.

And if you do, feel free to take time to comment if you see something you like or dislike; I feel like I’m restarting my photography in part, and I recall one of the best things about my 365 was the constructive feedback I got from others that helped me improve.

I’ve been getting back into podcast listening of late, and rather than my usual listening to guitar or tech podcasts, I’ve been trying to listen to a mix of things to help increase my understanding of the current issues we find ourselves in around politics and the environment, and then mixing it up with some podcasts that look at more light-hearted topics that are still educational in some way.

Here’s a list of things I can recommend, grouped by topic, and roughly also happens to be the order of priority in which I listen to them when they pop up on my podcast player.

Politics

None – this is an attempt to look at why the current political environment is as divisive as it is. It (usually) stays away from the day-to-day politics, and tries to understand the general landscape of why we seem to have ended up in a situation where we have two sides that share no common ground or hope for compromise.

I binge listened to this from the start over the course of a couple on months, and if you do try this one I recommend listening in order.

Talking Politics – whereas Polarized tries to take a macroscopic look, Talking Politics is more a mix of current affairs analysis and longer term trend reviews, but is always more analytical and thoughtful, avoiding personality politics and focussing on the actual political/legal side of things.

I tend to prefer the longer term episodes, but I do find in the current run up to a general election the microscopic is useful.

Environmental

The Beam Podcast – The Beam is a magazine publication that looks into environmental topics, and their podcasts continues that theme. I do like that this takes broader topical looks, but I find that compared to the politics podcasts it lacks a little actionable bite, but then that’s probably more a reflection on the domain. Still, worth listening to.

General Interest

Reply All – Reply All attempts to explain how the modern Internet impacts life, from a non-technical standpoint. It has a standard set of topics it cycles through, my favourite of which is super-tech-support: here they dig into things like how did someone’s snapchat account get hacked, or how did someone trying to listen to relaxation sounds on their Alexa get something with creepy footsteps on it – all of which expose how interconnected everything is and nothing comes from where you expect.

99% Invisible – Each week 99PI picks a different niche topic and takes a detailed look at it. It usually has a slight design bend, but topics range from automating pepper farming (which made me aware of how much automation in farming ruins bio-diversity), the design of call holding systems, the and how placing a garden store Buddha statue can change crime patterns significantly. It’s not very deep, but it’s usually quite interesting, and makes a nice antidote to the more serious podcasts I listen to.

The Incomperable – The Incomperable is a film/book/game review show, commonly with a science fiction theme, but not exclusively. I tend to pick and choose which episodes to listen to on this one, as either I’m not interested in the latest Marvel/Star Wars films, or I’m trying to avoid spoilers. However, it has introduced me to some great classic films, like The Thin Man, and I enjoy their annual review of nominations for the two big sci-fi book awards as a way of finding new reading material.

12 Jun 2019

My Grandad passed away recently, someone who was a large part of my childhood. As I’ve got older and things in life get in the way I’d not seen him (or any other of my family) nearly as often as I should have, but he’ll always be a special person to me, and someone who had a large impact on my life. It’s not just me: he and Nanna had five daughters, so I have a lot of cousins, and we all share the similar fond memories of our Grandad.

Of the countless memories I have of him, there’s two that for some reason stick out right now, both I guess from when I was around 12 or thereabouts.

The first I think captures his fun side. One evening, whilst everyone else had their supper cup of tea in the living room, Grandad and I went into the kitchen to have a biscuit with our tea – he was always a fan of gingernuts – and I realised after nattering with him for a while that we’d ate the entire packet between us! A slightly mischievous act, but I’ve no idea why it sticks with me. Perhaps because it’s one of the few that’s just me and him rather than as a larger family unit. But it also shows his of child-like fun he had, and this seemed to cement part of that for some reason. To this day I still have a (helpfully) similar sense of childish fun, which I attribute in a large part to both to him and my gran on the other side of the family.

The other memory that came to mind is of him being amazed at how brattish I was being about not getting to play an arcade game I really wanted to play (as ever, it was something my “cooler” friends were playing, and so I felt the need to play it to just be on par, but didn’t have the money to do so). He wasn’t being nasty about his observation, just bemused I think, hardly surprising given what his generation would have had to deal with at a similar age. But despite clearly seeing me for the brat I was a lot of the time as a child, he still treated me as someone worthy of attention and playing with. I hope that I can be as inclusive and as generous as he was to others, and I guess this is a textbook example of unconditional love. Dear me, I must have been a major pain in the neck as a child (sorry Mum & Dad), but Grandad still gave me attention like the rest of his grandkids.

His funeral was this Monday gone, and at the get together of family and friends afterwards it was lovely to see everyone share their happy memories. Grandad disliked dark clothing, so we all tried to wear something bright – thankfully I’m well stocked for bright floral shirts. But the lasting memory will be watching the set of grandkids playing the games he’d play with us all – we brought in the marbles and the dominos and the other toys he’d spent hours playing with us, and we had some more fun in his memory. To me that’s a near-perfect way to remember his impact on us.

Photo of my Grandad with my and my sister, on a beach, possibly mid-80s

Grandad passing was a reminder to me that our time is finite, something that it’s easy to forget in the day-to-day. That blue guitar I recently completed which everyone has said nice things about, had been stuck in limbo waiting for me to finish it as I procrastinated due to fear of things not being perfect. But Grandad’s passing spurred me to just get on with it – stop worrying about the maybes, and just do your best and give it a go. So that guitar is there thanks to his memory, and I’ll always think of him now when I think of it.

I was sharing my memories above with my Mum after the funeral, and she remembers me at a similar age complaining for the n-th time that I was bored (I really was a terrible child), and Grandad turning around and saying “life is boring – you have to make it not boring”. Words that didn’t take at the time, but speak to me now. This is definitely one of the reasons I’m very fortunate to have Laura in my life: she helps life not be boring, both by being there and by encouraging me to do things I might not otherwise try.

And that saying is also the broader point of this note: time is limited, and whilst I don’t think you can treat every moment as precious (that’d be as tiring as it is impractical), it’s worth being reminded that you can’t put things off indefinitely. Whatever it is that is important to you, ensure you make time for it, as it’s only you that can make it happen: life is boring, you have to make it nor boring.

I’ll try my best Grandad.

I’m writing this up as it doesn’t seem to be a common testing pattern for Go projects that I’ve seen, so might prove useful to someone somewhere as it did for me in a recent project.

One of the things that bugs me about the typical golang http server setup is that it relies on hidden globals. You typically write something like:

package main

<code>import (
    "net/http"
    "fmt"
)
</code>

func myHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, “Hello, world!") } func main() { http.HandleFunc("/”, myHandler) http.ListenAndServe(":8080”, nil) }

This is all lovely and simple, but there’s some serious hidden work going on here. The bit that’s always made me uncomfortable is that I set up all this state without any way to track it, which makes it very hard to test, particularly as the http library in golang doesn’t allow for any introspection on the handlers you’ve set up. This means I need to write integration tests rather than unittests to have confidence that my URL handlers are set up correctly. The best I’ve seen done test wise normally with this setup is to test each handler function.

But there is a very easy solution to this, just it’s not really considered something you’d ever do in the golang docs – they explicitly state no one would ever really do this. Clearly their attitude to testing is somewhat different to mine :)

The solution is in that nil parameter in the last line, which the golang documents state:

“ListenAndServe starts an HTTP server with a given address and handler. The handler is usually nil, which means to use DefaultServeMux.”

That handler is a global variable, http.DefaultServeMux, which is the request multiplexer that takes the incoming requests, looks at the paths, and then works out which handler to call (including the default built in handlers if there’s no match to return 404s etc.). This is all documented extrememly well in this article by Amit Saha, which I can highly recommend.

But you don’t need to use the global, you can just instantiate your own multiplexer object and use that. If you do this suddenly your code stops using side effects to set up the http server and suddenly becomes a lot nicer to reason about and test.

package main

<code>import (
    "net/http"
    "fmt"
)
</code>

func myHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, “Hello, world!") } func main() { mymux := http.NewServeMux() mymux.HandleFunc("/”, myHandler) http.ListenAndServe(":8080”, mymux) }

The above is functionally the same as our first example, but no longer takes advantage of the hidden global state. This in itself may seem not to buy us much, but in reality you’ll have lots of handlers to set up, and so your code can be made to look something more like:

func SetupMyHandlers() *http.ServeMux {
     mux := http.NewServeMux()

<code>    // setup dynamic handlers
     mux.HandleFunc("/", MyIndexHandler)
     mux.HandleFunx("/login/", MyLoginHandler)
    // etc.
</code>

// set up static handlers http.Handle("/static/”, http.StripPrefix("/static/”, http.FileServer(http.Dir("/static/")))) // etc. return mux } func main() { mymux := SetupMyHandlers() http.ListenAndServe(":8080”, mymux) }

At this point you can start using setupHandlers in your unit tests. Without this the common pattern I’d seen was:

package main

<code>import (
    "net/http"
    "net/http/httptest"
    "testing"
)
</code>

func TestLoginHandler(t *testing.T) { r, err := http.NewRequest(“GET”, “/login”, nil) if err != nil { t.Fatal(err) } w := httptest.NewRecorder() handler := http.HandlerFunc(MyLoginHandler) handler.ServeHTTP(w, r) resp := w.Result() if resp.StatusCode != http.StatusOK { t.Errorf(“Unexpected status code %d”, resp.StatusCode) } }

Here you just wrap your specific handler function directly and call that in your tests. Which is very good for testing that the handler function works, but not so good for checking that someone hasn’t botched the series of handler registration calls in your server. Instead, you can now change one line and get that additional coverage:

package main

<code>import (
    "net/http"
    "net/http/httptest"
    "testing"
)
</code>

func TestLoginHandler(t *testing.T) { r, err := http.NewRequest(“GET”, “/login”, nil) if err != nil { t.Fatal(err) } w := httptest.NewRecorder() handler := SetupMyHandlers() // <—- this is the change :) handler.ServeHTTP(w, r) resp := w.Result() if resp.StatusCode != http.StatusOK { t.Errorf(“Unexpected status code %d”, resp.StatusCode) } }

Same test as before, but now I’m checking the actual multiplexer used by the HTTP server works too, without having to write an integration test for that. Technically if someone forgets to pass the multiplexer to the server then that will not be picked up by my unit tests, so they’re not perfect; but that’s a single line mistake and all your URL handlers won’t work, so I’m less concerned about that being not picked up by the developer than someone forgetting one handler in dozens. You also will automatically be testing any new http wrapper functions people insert into the chain. This could be a mixed blessing perhaps, but I’d argue it’s better to make sure the wrappers are test friendly than have less overall coverage.

The other win of this approach is you can also unittest that your static content is is being mapped correctly, which you can’t do using the common approach. You can happily test that requests to the static path I set up in SetupMyHandlers returns something sensible. Again, that may seem more like an integration style test, rather than a unit test, but if I add a unit test to check that then I’m more likely to find a fix bugs earlier in the dev cycle, rather than wasting time waiting for CI to pick up my mistake.

In general, if you have global state, you have a testing problem, so I’m surprised this approach isn’t more common. It’s hardly any code complexity increase to do what I suggest, but your test coverage grows a lot as a result.