Boozy Gummies

I’ve been experimenting with booze-filled gummies for a while now, and I’ve been asked by several people to share my recipe. We’re all stuck and home and living with a lot of stress, so a comfort food like finger jello goes a long way to improving happiness. Tools First, let’s start with the molds. You need silicone molds of some sort to hold and form the gelatin. The gummies we’re making are significantly stiffer than the finger jello you might have known as a child, so cutting up a sheet pan into squares isn’t going to be a good time.

Your New Remote Work Life

A lot of people are discovering what it’s like to work remote suddenly, or they’re about to. It’s possible that this experience has sucked. I worked for over a year on mixed remote and collocated teams, and there were some important lessons we learned. My team used extremem programming practices, which are intensely collaborative, including pair programming and test first code. Here are some of the things we learned. Tools The Microphone Is Everything.

Embedded Testing Setup

One of the most confusing parts of setting your workstation up for embedded testing is just what tools you’ll need and how to install them. Fortunately the number of tools you’ll need is minimal. You need: A compiler that builds native binaries for your workstation operating system. Unless you want a very hard time, its command line should be compatible with the UNIX cc command line. Gcc and clang both conform to this interface, and they are available for most common workstation operating systems.

Meritocracy and Other Comfortable Lies

In tech we love to tell ourselves that we operate on merit. It’s nice to tell ourselves that we work at a place that only hires the best. Out of everyone else who tried to get my job, I was the best. And that is true, I was the best of the people who applied for my job. The problem is that the best way to lie is to use the truth to do it.

Real Pirates Seek the C Followup - Codemash Edition

I was really happy to see all the people who cam out and wanted to hear about C programming at CodeMash. It’s wonderful to find a place with so many people who share my same obscure fascination. Books I neglected to put a bibliography into my slides, so let me address that here. Learning C The gold standard is The C Programming Language, but the prices offered on Amazon on ridiculously high.

Team Health for Fun and Profit - Codemash Followup Edition

In my talk Team Health for Fun and Profit I strongly advocate for working reasonable hours. The 40 hour work week was paid for in blood, and we ignore it at our peril. A person in the audience pointed out that it’s common in the tech industry for somebody who only puts in their 40 to be perceived as a “clock puncher.” Somebody with no passion for the business, not as dedicated to the goal as everyone else.

Setting Up the Unity Testing Framework

I’ve been drinking the Test First kool-aide for years. So when I write embedded code for an Arduino, I want to test that code before pushing it to my lovingly hand-wired circuit. C doesn’t get a lot of love in the testing world, which is a shame. It’s probably easier to write automated tests for C than any other language. One of my favorite tools for light weight testing is Unity from Throw the Switch.

I Am An Imposter

Imposter syndrome, that feeling that you’re really not good enough to be where you are, that you’re going to be discovered and kicked out, is a women’s issue. No Real Man™ would ever admit to being an imposter. Fortunately, after 20 years as a developer, I was able to woman up and admit that I too had imposter syndrome. That admission was one of the most freeing things I have done in my life.

Filesystem Library in C++17

One of my favorite things about C++ is that it works exceptionally well cross platform. This is entirely to the work of library authors who put a lot of effort into putting a common interface on common tasks, each with a different implementation. The proposed filesystem library in C++ 17, based on the excellent boost filesystem library, in one of my favorite bits. Unfortunately it’s not entirely obvious how to use it without some deep digging.

Makefiles for Test Driven Development

I’m a big believer in Test Driven Development. That’s the model where you write a failing test, then you write just enough code to make the test pass, but no more. It sounds counter-intuitive,but experience has shown that I get a finished, deliverable product a lot faster, and I’m less likely to find bugs. Even more importantly, my customers are less likely to find bugs. Setting up a Makefile to support test driven development adds some additional challenges to what I’ve shown in my earlier articles.

Clay's Blueberry Pie Recipe

I’ve cobbled this recipe together from various sources, starting with my grandmother’s pie crust recipe, and adding in things I learned from my mother and reading cooking magazines. Tools This recipe requires a kitchen scale capable of measuring in grams. It’s important to keep the ratios of liquids to solids correct, or you’ll have a bad time. Learn from my pain. Stage 1 Ingredient grams Cumulative grams Flour 180 Salt 1 181 Lard 102 283 Measure the ingredients into a bowl on the scale, looking for the cumulative balance total on your scale for each step.

Mocking System APIs

One problem a lot of people run into is the need to test code that uses APIs they don’t control. This came up tonight during a discussion on mocking at the Pillar Technology Plugged In event in Ann Arbor. The system in question was a remote service, but I encountered it recently with UNIX system calls. Fortunately there’s a simple solution. If you wrap the APIs in a class, you can mock that class.

Better Tests Through Mocking

If you have even a moderately complex application, writing tests can be a real pain. You either wind up writing complex, fragile tests, or you skip it altogether. There is a third path: fake out all of the parts that you aren’t testing in this test. You can examine the fake parts to see what has been done with them, and you can make them respond however you want to your program.

Easy Makefiles

If you read my earlier article [OMG WTF Makefiles]({% post_url _posts/2017-11-01-omg-wtf-makefiles %}), there was a lot of information to take in. And Makefiles built that way can get pretty overwhelming to keep up pretty quickly. In fact, unless I’m forced to use BSD Make, I use GNU Make and take advantage of some nice shortcuts. I’ll show you how to keep your Makefile building simple. Simple Dependency Management I hate having to update the Makefile every time I add a new class to the project.

OMG WTF Makefiles

If, like many developers, you haven’t written a line of C or C++ since you left school, but suddenly find yourself needing to write in those languages, this article is for you. Or maybe you’re in school, but you need to write a moderately complex program (more than one file). This article is also for you. My Instructor Never Covered This It’s almost a given that your programming education didn’t include information on creating Makefiles.

Embedded Test Suites

At Prairie.Code() I provided an example embedded project to demonstrate test driven development as part of an Arduino workshop. The example I gave used the Unity testing framework, but there are several others and they’re worth exploring. Unity http://www.throwtheswitch.org/unity I love Unity for its compactness, and how easy it is to use. It’s small enough to include the complete source in your project without bloating it. The examples in my presentations were all written with Unity.

A Functional Conway's Game of Life

Conway’s Game of Life is an old standby for code retreats and coding katas. The game’s simplicity means that implementation complexity won’t get in the way of what you are trying to learn. A few months back in a code retreat a fellow attendee implemented the game in a functional language. My first thought was “why would anybody do that?” My second was “how could I do this in C?” C isn’t normally thought of as a functional language, but there’s nothing stopping it from being used that way.

Branching By Abstraction

Recently at a client we had a discussion as a team about our continuous integration practices. One of the goals of continuous integration is frequently pushing changes to the master branch, so that it can be integrated into the build. But how do you do that if you need to make breaking changes? You can push to master, break everybody’s build, and earn the undying enmity of your entire team if you do this regularly.

Blinking Lights With GPIO

In my last post we looked at a basic query of the GPIO bus just to show that we could read it. This time I want to actually control something. Blinking a light is the IoT equivalent of Hello World, so we’ll try that. In this setup, the anode (short lead) of the LED is connected to pin 19 by a smaller resistor, and the cathode (long lead) is connected to the 3v ground bar.

Halloween Video Display

Halloween is kind of a big deal where I live, so this year I decided I needed a nice rotation of videos projected onto my garage wall. There are a few things you’ll need: A computer, preferably a laptop or netbook. A projector. External speakers, ideally weather proof. Extension cord Appropriate Halloween videos A safe place out of the weather to set up your gear Video The fun part of this project is putting together the video.

Fear and Loathing in Legacy Code

We’ve all seen code bases that look like they might have been written as an ode to Fear and Loathing in Las Vegas. There’s a good chance that we have even perpetrated such code. But now it’s in production and the support is making you wonder why you didn’t take that nice accounting job out of school. You could put tests on the code but it’s such a mess that you should probably just throw it out and start fresh, if only you had the time and the Business wasn’t howling about the way the software is causing them to bleed cash.

C++11 Array Iteration

I’ve just gotten to play with the C++11 ‘‘for’’ extensions for the first time. It’s really cool, especially the ability to iterate over a plain old array. Dig this code from my current hobby project: int Driver::getSpeedBonus(int speed) { struct speedbonus { int speed; int bonus; }; struct speedbonus benefits[] = { {200, 10}, {140, 9}, {100, 8}, {60, 7}, {40, 6}, {30, 5}, {20, 4}, {12, 3}, {10, 2}, {0, 0} }; for(struct speedbonus b : benefits) { if (speed >= b.

FreeBSD On a Raspberry Pi

Over lunch a colleague mentioned that she wanted to start using Raspberry PI projects to draw crowds at some of our community open house events. Because I first learned systems programming on FreeBSD, I wanted to try making it work. Fortunately there’s a great little project called crochet that helps you build an image you can burn onto an SD card. Since cross compiling is actually kind of hard to set up, whenever it encounters a problem it tells you how to fix it.

Programming the GPIO On a Raspberry Pi

If you read my previous piece on putting FreeBSD on a Raspberry Pi, you’re probably now wondering what exactly you’re going to do with this little box. Fortunately I have invested the effort to work out some basics of handling GPIO on FreeBSD and a Raspberry Pi. Because of why I chose FreeBSD, I’ve also implemented it in C: my first choice for tackling new problems in systems programming. Setup You can, of course, connect to the box with a keyboard and screen.

Medal Box

For Christmas my stepson’s mother in law suggested that she would like to buy a small box to hold my step son’s military medals and ribbons, which currently reside in a plastic bag on his dresser. Since I have a wood shop, making him a box seemed like a much better idea. The box is out of black walnut, the trays have figured cherry sides and maple plywood bottoms. The trays were lined with suede.