Author archives: Ben

RSS feed of Ben

Keras/TensorFlow Neural Network for Product Categorisation

I thought I would write this post because every time I looked for an example of categorising text all I would find were sentiment analysis of news articles or Twitter feeds. That’s cool because you can get started without having your own data set, but I do have a real data set I need to ...

Continue reading

Git: When is a tree not a tree?

Git repositories are described as trees, with branches. This is true. But, thinking of them as nodes of connected commits, is slightly more correct. Each node has a parent, and might have children. A node can be named with a tag or branch.

Sounds complicated, but let me explain

Target Audience

This post is aimed ...

Continue reading

Fix Dock not showing with Multiple Displays

I recently joined the Triple Display Crew and have two external monitors hooked up to my MacBook. I ran into a strange problem where the Dock, which I keep down the bottom, wouldn’t pop up on the centre screen.

I wanted my display arrangement to match the real layout as accurately as possible. The external ...

Continue reading

I get Marked Down, but I get up again

When I first decided to start writing this blog I wanted to do it using Markdown, however the default HTML it generated didn’t align with what I needed. One example is my block code <pre> tags need the prettyprint class(es). So I resorted to manually typing everything as HTML.

It was only recently that ...

Continue reading

Shared Config for Deployment and Applications

On application deployment, we often want associated services ready to go. After all, what good is a web application without a database? Ideally, when you first deployed your application, a database and role would automatically be created using the same settings that your application uses. In this post I’ll discuss two methods of sharing database ...

Continue reading

Deb Constrictor: Multiple Parents

To reduce the amount of setup required to start using Deb Constrictor for new projects, build configurations now allow for multiple parents (as of version 0.7). Now, when writing configurations, your build-config.json can inherit from a parent project config containing the project name, and a “base” config that defines the type of project ...

Continue reading

DRY Django URLs with Enums

DRY code is good code. Using named URL patterns in Django has always bothered me for the fact that if you decide to change the name of a particular URL you have to change it throughout your code in all of your {% url %} template tags or reverse function calls. There must be a better way ...

Continue reading

Cache Invalidation Magic with Wildcards

The two hardest things in computer science are: naming things, off-by-one errors, and cache invalidation. This post is about the latter, specifically, how to invalidate your users’ browser cache when your static files have changed.

I found out about this one weird trick (doctors hate him) a few years ago but I think it bears ...

Continue reading

Deb Constrictor for Configuration Deployment (Part 3)

Welcome to the thrilling conclusion of this three-part series on deploying this site with Deb Constrictor. This post will cover how to build and deploy DPKGs for configuration (including different configuration for different environments), and how v0.4 of Deb Constrictor adds the ability to mark files as configuration.

This post assumes you’ve read part ...

Continue reading

Deb Constrictor for Virtualenv Deployment (Part 2)

Using Docker for a reproducible deployment environment! Now that I have your attention with some buzzwords, welcome to the second of three parts in my series on how I deploy this site using Deb Constrictor. The last post was about building and deploying the application code, this one is about building the Python virtual environment ...

Continue reading