Sometimes-Send Values in Rust

I came across an interesting question on Stack Overflow recently, and I found the process through which I developed my answer to be interesting on its own, so I’m going to document it here. If you are unfamiliar with Rust’s Send trait, I would suggest reading Send and Sync in the Rustonomicon. The bird’s-eye view…

async/await and hidden races

JavaScript has become one of my favorite languages. This is no secret to those who know me in a professional capacity. It used to be one of my most hated languages until I spent some time with it, over a dozen years ago. When I have to use other languages, I almost always find myself…

Simple node.js service configuration

There’s a myriad of npm modules for providing configuration to a node.js application or service, but I’ve always found them simultaneously over-engineered and lacking basic validation of the configuration document. I’ve settled on a pattern that works very well for my needs. It leverages the excellent Joi library for validation, and simple node built-ins for…

Hot-swapping virtio disks on QEMU

Many of the articles that cover hot-swapping disks on QEMU or QEMU-KVM either assume you’re using virt-manager/virtsh, cover USB disks and not virtio, or are for an old version of QEMU. The QEMU monitor has changed quite a bit over the years, apparently! This article will explain how to hot-remove and hot-add virtio-blk drives using…

Lock-free clustering of large PostgreSQL data sets

Since 2012-09-27, I have been collecting overstock data from TF2WH every five minutes and storing a snapshot of this data in my database. This enables me to do some really cool things, such as chart past data as well as make projections about future stock levels. For this amount of time, data collection has been…

Object Copying in C#

When working on some sort of data-driven project, I frequently have the need to allow deep-copying of data objects. There are several patterns that accomplish this, but I’ve settled on one in particular. Most .NET developers are probably familiar with the ICloneable interface. While this is a good starting point, it is not what I…

CategoriesC#

TF2 item store launched

So I had some free time last weekend and coded an item store for Team Fortress 2. I collect items and sell them for varying prices, usually one scrap metal each. If you’re interested, check out the store! The store is built on a few components, all written in Python. There is a script to…

Database versioning and handling branching

It’s no secret to developers of database-driven applications that trying to version a database schema (and seed data) is a royal pain. Propagating changes from your development environment to a live environment is not something that most version control systems are well-equipped to do. This is further complicated by distributed VCSes, like Git — how…

VPS.NET experiences

I’ve been using VPS.NET as my hosting provider for two years now (since October 2009). Here’s my experience, the good and the bad. The building block of the VPS offering is a node: a discrete unit of CPU time, RAM, storage, and bandwidth. These nodes can be deployed as separate servers, or combined together to…

Bitcoin for Humans series

Anyone who’s been around me recently knows that I love Bitcoin. It’s a really neat idea, but it’s also a very complicated thing. Most people that I talk to don’t really understand how it works and why it was designed the way it was, and therefore have some incorrect ideas and criticisms of Bitcoin. So…