• Coding

    5 years of Test Driven Development, Visualized

    Here’s a 15 minute video covering nearly 5 years of active Mir development in C++. We (the original Mir team), started the project by reading “Growing Object-Oriented Software, Guided by Tests” by Steve Freeman and Nat Price (book site).  We followed the philosophy of test-driven development closely after that, really throughout the whole project. This is a video generated by the program ‘gource’. What you see is every file or directory is a node. Little avatars, one for every contributor zoom around the files and zap them when a change is made. If you watch closely, some contributors will fixate on a few files for a bit (bug hunting, maybe?)…

  • Uncategorized

    Mir 0.24 Release

    Mir 0.24 was just released this week! We’ve reworked a few things internally and fixed a fair amount of bugs. Notably, our buffer swapping system and our input keymapping system were reworked (Alt-Gr should now work for international keyboards). There was also some improvements made to the server API to make window management better. I’m most excited about the internal buffer swapping mechanism changes, as its what I’ve been working to release for a while now. The internal changes get us ready for Vulkan [1], and improve our multimedia support [2], improve  our WiDi support, and to reduce latency in nested server scenarios [3]. This is prep work  for releasing…

  • Hardware

    ATTiny85 PWM from Timer/Counter1

      I’ve been tinkering with the ATTiny chip a bit lately, and I wanted to hook up of my stepper motors to it. This chip has 2 timers, and a few pins that can output PWM signals. I had OC1B on PB4/pin3 free, and the Timer/Counter1 module looked a bit better than the Timer/Counter0 module for the relatively-long pulse needed to control the stepper motor. First thing to figure out is what I wanted the PWM signal to look like. Stepper motors care more about the pulse length than the frequency. My motor accepted 700-1500us as the control range, so I decided to go with a 4000us period (250Hz). The…

  • Coding,  mir,  Multimedia,  Ubuntu

    Mir and Vulkan Demo

    This week the Mir team got a Vulkan demo working on Mir! (youtube link to demo) I’ve been working on replumbing mir’s internals a bit to give more fine grained control over buffers, and my tech lead Cemil has been working on hooking that API into the Vulkan/Mir WSI. The tl;dr on Vulkan is its a recently finalized hardware accelerated graphics API from Khronos (who also proved the OpenGL APIs). It doesn’t surplant OpenGL, but can give better performance (esp in multithreaded environments) and better debug in exchange for more explicit control of the GPU. Some links: Khronos Vulkan page Wikipedia Vulkan entry short video from Intel at SIGGRAPH with…

  • Coding,  mir,  Ubuntu

    New Mir Release (0.18)

    If a new Mir release was on your Christmas wishlist (like it was on mine), Mir 0.18 has been released! I’ve been working on this the last few days, and its out the door now.  Full text of changelog. Special thanks to mir team members who helped with testing, and the devs in #ubuntu-ci-eng for helping move the release along. Graphics Internal preparation work needed for Vulkan, hardware decoded multimedia optimizations, and latency improvements for nested servers. Started work on plugin renderers. This will better prepare mir for IoT, where we might not have a Vulkan/GLES stack on the device, and might have to use the CPU. Fixes for graphics…

  • Hardware

    Small Run Fab Services

    For quite a while I’ve been just using protoboards, or trying toner transfer to make pcbs, with limited success. A hackaday article (Why are you still making PCB’s?) turned me on to low cost, prototyping pcb runs. Cutting my own boards via toner transfer had lots of drawbacks: I’d botch my transfer (as seen above), and have to clean the board and start over again. Chemicals are no fun either. Drilling is tedious. I never really got to the point where I’d say it was easy to do a one-sided board. I would always route one-sided boards, as I never got good enough to want to try a 2 layer…

  • Coding

    Bjarne on C++11

    I saw this keynote quite a while ago, and I still refer to it sometimes, even though its almost 3 years old now. Its a good whirlwind tour of the advances in C++11.

  • Coding

    More Usable Code By Avoiding Two Step Objects

    Two step initialization is harmful to the objects that you write because it obfuscates the dependencies of the object, and makes the object harder to use. Harder to use Consider a header and some usage code: struct Monkey { Monkey(); void set_banana(std::shared_ptr const& banana); void munch_banana(); private: std::shared_ptr const& banana; }; int main(int argc, char** argv) { Monkey jim; jim.munch_banana(); ... } Now jim.munch_banana(); could be a valid line to call, but the reader of the interface isn’t really assured that it is if the writer wrote the object with two step initialization. If the implementation is: Monkey::Monkey() : banana{nullptr} { } void Monkey::set_banana(std::shared_ptr const& b) { banana = b;…

  • Coding

    Bad Metaphysics Costs Maintainability

    I find myself doing a lot of metaphysical thinking in my day to day work as a coder. Objects that are cohesive and are valid metaphysical analogues to common experiences make it much easier to read, understand, and fix existing code. Taking an example: struct ServiceQueue { void place_customer_at_back(); void service_front_customer(); }; This class maps well to a physical problem we encounter frequently in our day to day lives; customer service at a bank teller window, perhaps, or ordering a hamburger at fast food chain. Taking things to the realm of computers, ServiceQueue also maps to many computer problems pretty well as well. A packet arrives over the network, and…

  • Coding,  mir

    A few years of Mir TDD

    We started the Mir project a few years ago guided around the principles in the book, Growing Object Oriented Software Guided by Tests. I recommend a read, especially if you’ve never been exposed to “Test-driven development” Compared to other projects that I’ve worked on, I find that as a greenfield  TDD project Mir has really benefitted from the TDD process in terms of ease of development, and reliability. Just a few quick thoughts: I’ve found the mir code to be ready to ship as soon as code lands. There’s very little going back and figuring out how the new feature has caused regressions in other parts of the code. There’s…