Tag Archives: tech

eLua and STM32F4

I am sufficiently taken with Lua that I went looking for interesting Lua projects. I came across eLua. eLua is a project to build a version of Lua that can be used in embedded projects. There is certainly potential there for making life easier. Often in embedded projects, the vast majority of the work is… Read More »

Supervisord

I’ve recently written a couple of projects that run as a python-based daemon. I want them to run as long-lived projects on a VPS, with automatic restart should they fail. I thought I was going to have to go through the tedium of writing init.d scripts for each. Then I stumbled upon supervisord, which is… Read More »

Lua and C++

I’ve not yet had a project that’s needed an embedded scripting language. When I do, I think I’ll reach for Lua. $ apt-get install lua5.2 liblua5.2-dev Command line lua: $ lua Lua 5.2.2 Copyright (C) 1994-2013 Lua.org, PUC-Rio > print("Hello, World") Hello, World Embedded lua: #include <lua5.2/lua.hpp> int main() { // Create a Lua virtual… Read More »

Python Unit Testing

I discussed C++ unit testing last time; I thought this time I’d make a quick mention of unit testing in Python with the unittest module (which uses a very similar structure to CppUnit – mostly because they are both based on JUnit). The introspective abilities of dynamic languages like Python make unit test frameworks really… Read More »

Fizz Buzz Testing

Unit testing is the name we give to the idea of writing code that tests our application code automatically. Essentially, its job is to exercise each piece of your application in isolation, and ensure that any data dependent bugs you might introduce accidentally, never make it into production releases. Personally, I also find it makes… Read More »

Pointer Implications (C++11)

While C++98 had smart pointers of a sort; they weren’t good enough for use. The language lacked the key feature that makes smart pointers work: move semantics. C++11 has introduced that language feature, and hence has solid smart pointers. The addition of smart pointers gives us some further options for passing references to objects when… Read More »

Pointer Implications (C++)

Last time we covered pointer arguments, and that article was applicable to C and C++. C++ introduced true pass-by-reference semantics. f( O & ) f( const O & ) f(O &) Previously we were careful to note that passing a pointer to a function was still only pass-by-value. The pointer was copied, and then the… Read More »

Pointer Implications (C)

Consider the declarations of various pointer-to-an-O-accepting functions: f( O * ) f( const O * ) f( O * const ) f( const O * const ) What is the author of f() telling us about what the function will do with the O we reference in each of these cases? This, and subsequent articles,… Read More »

rdiff-backup

rdiff-backup is about the only backup tool I’ve found acceptable. The key things for me: The (most recent) backup is readable on disk, as is. That is to say that there is no binary format. If the worst came to the worst, I could restore with cp. It keeps a rolling backup automatically. Each new… Read More »

Delegation

Last time, I spoke about lambdas, and left you with this comment about other features of lambdas. One that’s particularly worth bearing in mind is the ability to pass this as a lambda parameter. That means you can get access to more than just the enclosing scope variables, you can get access to the enclosing… Read More »