This blog post outlines how simple it is to interface with the sqlite3 database platform in a type and memory-safe way using features in modern C++. In order to complie this code, you will need a compiler that supports at least some new features of C++17. Namely: the ability for the compiler to deduce template arguments from constructors. If you want to play with C++17, I suggest grabbing a pre-release snapshot of your favourite compiler.
I’ve been on-edge recently. The reason is because about two weeks ago Tecumseh got more water in one night than we typically do in an entire month. By about a factor of 2. Suffice to say my basement, though mostly unfinished, was ruined. I lost my office, as well as every major appliance that my wife and I owned. We can repair the furnace, but we lost our hot water tank, our washer and dryer, freezer and fridge.
Aside from my usual meanderings about in C++ land I’ve been playing with Perl 6. I used to use Perl 5 back in the day, so I’m not totally lost when it comes to sprinkling sigils around everywhere in my code. From first impressions, however, Perl 6 really does feel like a much cleaner, more consistent language than its older sister. It’s raining tonight in Windsor, Ontario (across from Detroit, Michigan for those of you who don’t know your Canadian geography), and I thought it would be a nice evening to build a program that interfaces with the Weather Underground Developer API.
Experiencing this life as an observer brings one inner peace.
I’m sitting here in my back yard on vacation from work (which means I’m actually quite busy working on other, non-work related projects, such as those for my PhD), just had my coffee, and I’m listening to some of the local wildlife chirp away. It makes me feel that I really need more of this in my life. I’ve blogged before about programming outdoors, but I think I really need to work toward cultivating a career where I actually can spend a good chunk of my time outside.
I use the Emacs thermonuclear word processor for everything in my life that has to do with editing text. It’s extensibility is unmatched by any other editor out there; if there’s a feature missing that would make your life easier, then pop open the hood and add it! While it’s not the prettiest language to work with, Emacs Lisp (or elisp) is a pretty straight forward, yet deeply powerful extension language.
Occasionally I have to generate random numbers in C++, and since C++11 was published the langauge now has a massively powerful, flexible library for generating quality random numbers. The only issue is that for the life of me I cannot remember the API. This would probably not be a problem if I used it more frequently, but anyways, this blog post is a reminder for me of how to generate a uniform distribution.
Today I have homework to complete housework to start chores to complete a hyper puppy to placate Sigh.
I normally don’t do endorsement-type posts, but I just have to share this, even if just with my future self. Lighthouse Lemonade (site here) is the best damn Summer drink I’ve ever had. It comes in a bottle, and you mix in a bit of the stuff with water. The result is delicious lemonade that’s not too sugary, and not too lemony, but absolutely refreshing. I urge you to buy a bottle if you ever come across it during your travels.
When I first converted my blog over to hugo from hakyll, I neglected to put the date published onto the front of the blog posts file names. This resulted in URLs that were slightly less descriptive than desired, and also made it harder to scan through the markdown files quickly. Luckily in each file is a header, and within each header is a date field. Therefore, with my rusty old bash trickery I was able to spit out the following one-liner to do the job of renaming all the files.