I like to use Haskell to make little utilities for work. This can range from tools to analyze C code to code generation. When creating these utilities, the most tedious part for me is almost always the creation of some sort of command line interface to my code. Argument parsing is a pain in almost […]
Once in a while, I find myself doing work for a client who requires me to be on their VPN with a specific DNS setup. At the same time, I’ll need to have access to our office’s DNS server so I can reach local services like our continuous integration server, network storage, or build machines. […]
Some database-related projects require access to information based around maximum and minimum values. Recently, I was trying to figure out the best way to perform a “greatest N per group” query in an ActiveRecord model with a SQL database backend. Eventually, I settled on the SQL proposed by Bill Karwin on StackOverflow. Once I had […]
My first experience with Thor wasn’t great. I had heard that it could be used as a Rake replacement. Now, I have no problem with Rake (I like Rake!), but I’m always open to trying something new. I didn’t like the new thing. Well, I didn’t like it until I tried to use Thor for […]
Sometimes I get the impression that people think that embedded software development is “special” or an “exception” to many rules. It’s not, and we should stop treating it as such. C is not an excuse to write shit code. Here are some things we need to work on:
Test driven development may not feel like a natural fit for C at first, but a few tweaks to your methodology can help you get back into the rhythm you’re used to when test driving in other languages.
A simple example of using the 'indents' library to implement indentation parsing with Haskell's Parsec library.
The C Language has a heavy reliance on the C Preprocessor (CPP)–a preprocessor is a program that runs over a set of text files replacing specific patterns as it goes. The more I use C, the more I’ve become convinced that the CPP should be used only very rarely in .c files (though limited use […]
The Arduino IDE is great for embedded software novices, but what happens when you want to take the next step?
Some of my previous work experience involved the validation and verification (testing) of aerospace software. One of the rules for this testing was that test cases needed to structurally cover a large portion of the software under test, but this coverage was not allowed to be incidental code coverage. Incidental coverage occurs when a test case causes execution of specific lines but does not validate the inputs and outputs affected by those lines. Code coverage is usually used to determine which portions of a project are currently tested, but incidental coverage is a false positive. It causes the coverage tool to tell us that lines are tested when they may not be. For example, 100% of our code may be executed by our test suite, but some of the code may be a routine without its own set of tests covering a variety of inputs.