Tag Archives: tech

Not Everything Is A Reference

I like Java as a language. Kind of. It’s strongly and statically typed, has object oriented syntax, reflection, exceptions, and interfaces (interfaces being one of the few features that I think C++ is missing). Dynamically typed languages encourage sloppiness, and don’t help you avoid sloppiness, and the overriding feature of all good software is that… Read More »

Invisible Races

When you’re writing multi-threaded applications, the problem you are working hardest to avoid is that of data races. Here’s an example (assume a 32-bit x86 system): int global = 0; void thread1() { global += 1; } void thread2() { global = 0x10000; } The race here is pretty obvious. Two threads are accessing the… Read More »

Copy and Swap Idiom

I learned a new trick today, while reading about C++11 (of which more to come). It’s a technique I wish I’d known about a long time ago, as it addresses an issue I’ve always thought C++ had – forcing you to duplicate code. That issue is addressed even more thoroughly with C++11, which has introduced… Read More »

UNIX’s Achilles’ Heel I

UNIX has one (to my mind) big hole in its API. Windows, surprisingly, doesn’t share it. This article will discuss that gap, and how it can be worked around. File Descriptor Wakes There are a few multiplexing system calls, select(), poll(), and epoll() that put a thread to sleep, with the wakeup triggered by activity… Read More »

Android Authenticators I

I found a blog that gave an example of how to make a custom authenticator for Android. I didn’t find it very clear, so this article covers my understanding that I’ve pulled this together from the example given by that blog author, and from the Android documentation, and then building something that works. To make… Read More »

Burning MPEG4 to DVD From Linux

(TODO: Find out how to get aspect ratio correct.) Sometimes you want to turn an MPEG4 (or anything else you might have) from, say, your digital camcorder into a DVD that is playable on a standard DVD player. It’s not quite as simple as it should be, but it is a mechanical sequence. First we… Read More »

STM32F0 Discovery Development III

The ARM startup code we discussed last time was enough to get a program to compile, link and run, but it wasn’t enough to support a real C program. There is one primary feature that we’re missing, pre-initialised variables need their initial values copying from flash to RAM. The discovery-basic-template is full of useful information,… Read More »

STM32F0 Discovery Development

In my previous article about the STM32F0-discovery board, I wrote this: I believe it will be possible, with a bit of research, to use the arm-linux-eabi version, and hence to get the cross-compiler direct from the emdebian project. Today’s article is going to be looking at exactly that. I’d like to be able to use… Read More »