Profile cover photo
Profile photo
Brett McLarnon
229 followers
229 followers
About
Brett's posts

Post has attachment
My code's available at https://github.com/bmclarnon/remedial/tree/master/week1/

I spent a bunch of time setting up googletest, googlemock, and a custom benchmarking framework--it turns out I feel really uncomfortable developing code without a testing framework. If you're looking for a test framework, I recommend you take a look.

Observations about the actual assignment:
  * Templated dynamic arrays are remarkably complicated in C++. I spent most of my time playing with placement new to make sure that copy constructors and destructors were called at the right time. It's really unfortunate that non-trivially-copyable types prevent you from using realloc since you aren't allowed to move the objects in memory without calling the copy constructor. There are C++11 features to allow you to add template specializations based on whether an object is trivially copyable or not, but I decided that was too much work.

 * Surprisingly, I found in-place quicksort easier to implement than mergesort. I feel like I'd always heard in school that quicksort was tricky to implement right and you were better off learning to implement some other sorting algorithm (e.g., mergesort or heapsort). I think quicksort is going to be my sorting algorithm of choice for interviews from now on.

 * I'm really bad at writing high quality comments when I know that no one will be coming back to this code in 6 months.

 * This assignment was even more fun than I anticipated. Thanks Morgan!

Fitz and the Tantrums, Beck, Foo Fighters, Neil Young, Big Boi, Passion Pit, Metallica, Tom Morello, fun., Franz Ferdinand, Regina Spektor, Rebelution, Dispatch, Skrillex, Stevie Wonder:  What. A. Weekend.

Post has attachment
I consider myself a not very discerning content consumer. I read a lot of books, play a lot of games, and watch a lot of television, but I also spent a lot of time trying to find things worth reading, playing, or watching. In an effort to help you with content discovery (and to motivate reciprocation), I'm going to try sharing short reviews/reflections on Google+. If people find them really annoying, let me know and I'll stop; alternately, if you find them interesting and want to receive notifications whenever I post a new review, let me know as well. (I can selectively notify you for just books, games, television, etc.) And without further ado...


The Alloy of Law (Preview), Brandon Sanderson

I can't speak to the quality of the whole book, but this free preview of Sanderson's upcoming book, The Alloy of Law (11/8 release), is a lot of fun. It has Sanderson's usual flowing narrative, interesting characters, and dramatic fight scenes. It also takes place approximately 300 years after Mistborn: The Hero of Ages and therefore features one of my favorite magic systems. Unlike the Mistborn trilogy—which you should read now if you haven't already—this story is a Western/frontier fantasy. Guns and dusters have replaced swords and cloaks, and Allomancers and Feruchemists use single abilities to be better gunslingers. It's fascinating to see how the world reinvented itself after the conclusion of the Mistborn trilogy, and how a world on the brink of electric lights and automobiles still has room for magic and lawmen.

The Verdict: I finished chapter 6 at 4 am this morning, and I didn't regret it. And did I mention that the previous is free?

Currently Playing: Oblivion, Enslaved: Odyssey to the West, Bioshock, Dragon Age: Origins, Ms. Splosion Man
Currently Reading: The Darkness that Comes Before
Currently Watching: Psych, Burn Notice, White Collar, Covert Affairs, Wilfred
Wait while more posts are being loaded