Bryan's Blog

Strength through compiling

Simulating Coin Flips in C++

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.

Burnt Out

Today I have homework to complete housework to start chores to complete a hyper puppy to placate Sigh.

Lighthouse Lemonade

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.

Batch File Renaming The Lazy Way

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.

End of Vacation 2016

It’s Sunday, the first of May, and I’m wrapping up my week-long vacation from work. It was nice to be out of the office for a few days, but with the amount of work I got caught up on for school, I still feel like I need a vacation. The positive side of this work-cation is that I no longer feel like I’m drowning in work, as I’m pretty much caught up with everything I need to do.

C++ Friends, Templates, and Friends of Templates

This post is mostly to keep my own memory fresh. It’s been a while since I’ve written any hard-core C++ code, especially code that uses the language to its fullest potential. Let’s assume for some strange reason that you have a class template within another class template. In other words, consider the following code: template <typename T> class outer { int x = 0; public: template <typename U> struct inner { void foo(outer<U> const& o) const { cout << o.

Samsara

The world keeps turning And programs need to be built. Somebody save me.

Beta Reduce? What? Why? A Brief History

Introduction You might be wondering why I’ve decided to name my personal website (blog, what-have-you) what I did. The reason is, and this is probably not too surprising, because I’m a huge freaking nerd. This blog post is both a quick overview of my history as a geek, and a justification for why I named my personal website after an operation for manipulating expressions in something called lambda calculus.

Hugo: Only Show Content Under a Given Section

One thing I initially found strange of Hugo was that it listed every piece of content on the front page - as if they were all blog posts. Luckily Hugo is flexible enough to change that behaviour without having to do any hacking. This blog post is mostly so that I remember how to do this in the future. To limit your front page to show only content from a certain sub-directory, say, “post”, edit your index.

New Site

Every once in a while I like to shake things up a bit around here. I’ve owned this domain since around 2005 or so, and over the years it has changed quite drastically. From my humble web development beginnings, exploring the in’s and out’s of HTML, PHP, etc; to the Wordpress years; to now. Since 2013 I’ve opted to rely on static site generators such as Jekyll, Hakyll, and now Hugo.