Andy Lamb

Projects

Header image

A battery powered Raspberry Pi, connected to a passive infrared sensor, an infrared LED array and infrared camera all packaged in a small waterproof box. When the sensor detects body heat, the LED array is activated and the camera takes an image of the animal who's body heat was detected. The image captured is posted to Twitter under the @PiTweetie account. The battery lasts around 5 days between charges.

Camera trap image of a hedgehog

A dynamic tabular web page displaying the upcoming trains I can use to commute between home and work. The page calls an HTTP API I host that wraps the SOAP Open Live Departure Boards Web Service from National Rail.

In the 13th Century the Cistercian monks developed a "cipher" for representing any number from 0 to 9999. They used it to number pages, indicate years, and various other list numbering. Looking at the structure of these numerals I thought they could very easily be generated procedurally, by applying flip and translation transformations, dependent on the place value, to the base digits 1-9. The SVG image format is ideal for this kind of project. It is very simple to build SVG images in code and the result will look sharp at any scale.

The stave (virtual line) is a simple line element. The digits (1 to 9) are defined as simple path elements. A transform is defined for each place value (units, tens, hundred, thousands). Applying the appropriate place value transformation to each digit in the number builds the numeral image.

I created an API to generate the numerals and a webpage to try it out.

1234 Cistercian numeral
1234
9876 Cistercian numeral
9876

Debug visualisers are Visual Studio extensions that are available during a debug session to visualise the state of a specific type of object. In this case, lambda expressions can be visualised as binary decision diagrams.

Rendering complex lambda expressions as binary decision trees makes them easier to reason about for technical and non-technical users. Trace the flow through the decision tree following true and false branches at each node until a leaf is reached.

The extension is available to download from the Visual Studio Marketplace.

Here are two example binary decision trees generated using the debug visualiser.

Binary decision tree examples

Visual Studio Synonyms Extension

Visual Studio icon Synonyms

This is an editor window extension, right-click on any word, select the 'Synonyms' menu, and pick an appropriate synonym from the list. A third party thesaurus API is used to provide the synonyms. The extension maintains the style of the word being replaced.

I wrote this extension because naming things well, in code, is important to ensure the code is understandable by those who need to maintain it.

The extension is available to download from the Visual Studio Marketplace.

Visual Studio 'Review Next' Extension

Visual Studio icon Review Next

This is a team explorer extension. The Visual Studio code review process includes shortcut keys to add/save comments, etc, but requires the use of the mouse to select the next file in the review or mark a file as 'reviewed'. To prevent disruption to the flow of the code review by having to switch from keyboard to mouse, I created this extension that adds a keyboard shortcut to mark the current file as 'reviewed' and move on to the next file.

The extension is available to download from the Visual Studio Marketplace.

Provides an Append extension method for enumerable collections, allowing a single item to be appended to an existing IEnumerable. This method was added to Linq in .NET Framework 4.7.1. This package provides the same functionality in code running against earlier versions of the .NET Framework.

The package is available from Nuget.org and the code is hosted publically on GitHub. It's very simple and was really just to get myself familiar with the dotnet CLI.

The most popular mapping framework for .NET is Automapper. It automatically maps properties from one object to another where the property names match, but this has its problems:

  • Changing the name of a property will break the mapping.
  • Tracing associations between properties isn't easy.
Automapper works against modern IDEs that support advanced refactoring tools based on code analysers. Automapper also makes it difficult to use dependency injection in mappings because the mappings are created at start-up.

Explicit Mapper is a mapping framework in which all mappings are explicitly defined using the standard assignment operator, complex mappers are constructed from simpler mappers, and all mappers are resolved from the dependency injection framework.

The package is available from Nuget.org and the code is hosted publically on GitHub.

Post-it Plotter

A small plotter built from base components using an ESP8622 microcontroller to drive 2 stepper motors that move a pen over the surface of a post-it note to draw an image supplied via SVG.

A web page provides the user interface and also transforms the SVG into line segments the plotter can draw.

Here is a video from a very early prototype:

Banana Phone Handsfree Kit

My 4 year old son, Cameron, has been asking for a "real banana phone" for the his birthday and Christmas since he was 2.
So I thought it was about time I built one for him... Cameron using the banana phone

Garden Bird Camera Trap

My family and I enjoy watching the birds in our garden. We get the regular blue tits, robins, wrens, etc and I thought it would be good to be able to capture up-close photos of them as they visit our feeders. Robin holding on to a vertical tree branch

Greenhouse Climate Monitor

We're growing plants from seed in our greenhouse, and it's important to monitor the temperature in there day and night.
So I built a wi-fi enabled solar powered climate monitor and dashboard... Greenhouse climate monitor

Static Grass Applicator

Static grass is used in model railways, dioramas, etc, to make realistic looking grass and undergrowth.
Off the shelve static grass applicators cost £50 to £100, so I built one for £10. Static grass

© 2024 Andy Lamb