Walkthrough: setting up a Django+React project

For fullstack web developers on small projects that still want a reactive single-application interface, it can be usefull to build and serve a React application directly from Django. Here I show how to achieve a minimal setup with the least number of dependencies, and then build on that to include optional but common libraries.

Read more...

Measuring delay when using webview with Go

Serge Zaitsev's webview library allows us to use a native browser webview in applications written in the Go programming language. Amongst other things it allows us to invoke Go methods from the webview's Javascript code, and I wanted to measure how much delay that would introduce.

Read more...

Using modules for workspaces in Go

As of Go 1.11, the Go programming language has (experimental) support for modules. This addresses a number of needs - such as ensuring semantic versioning, ensuring reproducible builds, etc. Here I look specifically at how modules help replace the need for $GOPATH based workspaces.

Read more...

Python asynchronous cooperative mode

With the addition of asyncio in the Python 3.4 stdlib and the async/await syntax in Python 3.5, co-operative asynchronous programing is now an official part of Python. The co-operative asynchronous mode is not complicated to use - but the Python ecosystem is a bit confusing at first. Here I give an introduction to asynchronous programing concepts and eco-system in Python.

Read more...

Testing Python asyncio code with SSL

The asyncio library introduced in Python 3.4 allows us to write concurrent code running, amongst other things, network clients and servers. Here I show how to unit-test asyncio code to ensure it is possible to use it over an SSL connection.

Read more...

whathammers: a tool to get a quick overview of Apache log files

With most websites now using some form of client side analytics, we do not tend to parse and analyse Apache log files automatically any more. However for people managing web-servers they are still our first port of call when troubleshooting issues. To help quickly working out what is happening I wrote a small command line tool to parse and provide statistics out of Apache log files.

Read more...

State in back and front end web technologies

Processing user requests in the backend component of websites is something that feels like a mostly solved problem. Doing the same in frontend web applications is on the other hand something that is still being improved on all the time. Here I look at how managing state differs in the two environment, and how this affects application architecture.

Read more...

Setting up a Cordova development environment in Ubuntu

While there are many guides on setting up Apache Cordova for Android development on Ubuntu, none seemed to cover all the issues I encountered - it took a combination of resources to get there. I decided to write how I went about setting this up, and the issues I encountered along the way.

Read more...

Low bandwidth asset management in Djando

Low bandwidth implies high latency - when implementing a site for low bandwidth conditions we must pay attention to the packaging and number of assets we include on each page. Here we look at an approach for combining assets in Django while preserving the relationship between each asset and the code that required it.

Read more...

Re-implementing the CKAN API for performance

CKAN, an open source data portal platform, provides an API for fetching everything from datasets to individual records. Here we look at how CKAN's architecture allows developers to transparently re-implement the datastore API, and how this was used to improve performance by switching all searches to using a Solr backend.

Read more...

A look into Docker concepts

Docker is a tool to help in the deployment of applications across host systems. Virtualization, union file systems, image registries, orchestration services - while Docker is a useful tool for staging and deployment, there is a learning curve to get to grips with the whole ecosystem.

Read more...

Testing a PostgreSQL slave/master cluster using Docker

Docker is extremely useful for deploying packages, but also for creating environments for running functional tests. Here I show how to easily setup a cluster of PostgreSQL servers in slave/master replication using Docker and drive them using the Docker Python API.

Read more...

Dynamic mouse events for PySide

PySide, one of the Python bindings for Qt, uses the same event model as the C++ version of Qt - one that is designed for static languages. Here I show how to implement a layer above PySide's mouse events that provides a more dynamic event model.

Read more...

Prioritizing requests in node

Node is a great platform when it comes to handling and dispatching numerous concurrent requests. Here I explain how I implemented a proxy which limits the number of concurrent requests per client, and prioritizes the queue of request using user-defined criteria.

Read more...

Interrupting urlopen in Python

While the Python ecosystem is replete with libraries for fetching data over the web, none of them give you an easy way to interrupt requests before the queried server has returned the response headers. As more often than not servers will only output response headers once they have the full response at hand, this does not make it possible to release resources early. Here I show a possible implementation based on sockets and Httplib.

Read more...

A Python multi-process task queue

Looking to integrate a task queue manager in a service I was implementing, I discarded existing task queues and libraries as over complex for my need and implemented a simple solution based on existing examples found online.

Read more...

Implementing a CKAN permission plugin

CKAN implements a permission system based on roles, permissions and authorization functions which can be overridden by plugins. I used to this to implement the ckanext-userdatasets plugin. The aim of this plugin is to allow certain types of users to create datasets in an organization without having the permission to edit or delete other users' datasets. Here I describe how I went about implementing this plugin.

Read more...