Spirit X3 File Organization

For larger Spirit-based project, organizing the source code well can lead to more efficient builds and increased maintainability.

Of course, this is true for any project. But the heavily templated nature of even a fully realized Spirit parser makes this doubly so. Figuring out how to take advantage of separate compilation while maintaining the ability for each of the pieces to see the needed type/template information is not trivial.

Read more »

Spirit X3 Error Handling

Once your parser grammar grows beyond a few rules/parsers, handling errors will become a priority. Being able to give feedback about where things went wrong, what exactly went wrong, and possible fixes are all things you would like to provide. It might also be nice to see if you could recover the parsing process from the point of failure and continue parsing to maybe find other problems.

Read more »

Integrate VirtualBox and PuTTY

This is a simple Powershell script to automate starting and logging into a headless VBox VM using PuTTY. My main development environment is a VirtualBox VM running Arch Linux on top of a Windows 10 host. While I could work directly on the console, I like to have multiple windows up - one that has vim running and one that I use for things like running hugo server. So, I start the VM headless and connect to it with one or more PuTTY sessions.

Read more »

Rust Move vs Copy

I’ve been looking at the Rust Ownership model . The skinny is that Rust has made mostly opposite decisions from C++. Copy vs Move An assignment in Rust is by default, a move. The original variable is declared as invalid and using it will net you a hard error at compile time. The example used in the docs is: lets1=String::from("hello");lets2=s1;println!("{}, world!",s1);That last line will not compile because s1 is no longer valid.

Read more »

Live on codevamping.com!

Now officially live on the new blog at codevamping.com! The new site uses: Hugo - site building Jeffprod - theme Netlify - hosting Zapier - automated build for scheduled posts Google - as domain registrar. GitHub - for repostory hosting. I still have posts to migrate from the old site. That is a bit of pain, since it wasn’t originally written in Markdown. One tool that has been indispensible is Dillinger.

Read more »

Chrome OS Linux Container (crostini) tips

The new Linux Containers available on some ChromeBooks are manna from heaven if you are a developer. Having a full blown Debian based distribution just a click away makes supported ChromeBooks very usable development platforms. And getting such a device can be cheap.

Here is a set of tips to help make things a little nicer.

Read more »

Dotfile Maintenance

Here is a party I’m a bit late in joining. And it is one of those ideas that makes you smack your head wondering why you didn’t think of it. Config file tweaks For years, I’ve maintained a tar.Z bundle that contains a .profile, .cshrc, .bashrc, .vimrc etc. You can tell how old it is by the fact that I still maintain it with compress rather than gzip. When I started it, gzip did not exist.

Read more »

Dairying in Mongolia

This will be a bit off from the normal fodder for this blog, but I thought it was interesting. Lets start with a bit of biology. Babies naturally produce an enzyme called lactase that allows them to digest the main sugar component of milk - lactose. Many (globally it would be most) people lose that ability near puberty. This leads to lactose intolerance and the GI issues it can cause. Many people of European heritage, however, are lactase persistent and maintain the ability to digest lactose - to the delight of the dairy industry.

Read more »

Musical Sensors

Vibrating cantilevers has a long history of being used as sensors, but almost always in the micro-domain. The cantilever is frequently etched into silicon or other substrate. The weight of even single molecules can be measured or detected. The idea is fairly simple. Change the distribution of weight on the cantilever, and the frequency of vibration will change. It can even be used as a motion detector since acceleration in the same plane as the natural vibration will either start the cantilever vibrating or will change the frequency of the vibration.

Read more »