David Brownman

Posts Tagged "ruby"

    • ruby
    • programming
    • statistics

    Bogosort in Practice

    For whatever reason, there's a lot of humor in programming. From bogus HTTP responses to fun jargon, we're a funny bunch. In practice, the only thing funnier than an idea is an idea that actually runs, so I decided to see how awful Bad Code could really be.

    The searching and sorting of arrays is a popular (and central) topic in computer science. There's been a lot of time and effort spent ensuring we can sort array as efficiently as possible. Typically, efficiency in sorting methods is measured as a function of input length vs number of loops. A great sort won't appreciably increase ruznning time as the input gets longer. A bad sort, on the other hand...

    When the topic of bad searches come up (at parties or whatever, as it does), a crowd favorite is always the infamous bogosort. The idea is simple: take an array, randomize it, and check if it's sorted. If not, repeat! In the best case, you got really lucky and this sort is very fast. Most of the time, you're less lucky and this is actively awful. Let's see how this would shake out in practice.

    Read more
    • tumblr
    • programming
    • ruby
    • tutorial
    • jq

    The Great Migration

    As I'm back in the job market, I figured it was time to clean up some of my site internals. I've learned a lot about a lot since I first built it and my scss in particular was really showing its age. While I was in the trenches, I realized there was another big pain point I could fix: my blog.

    For a long time, I had my blog in two places. It actually lived on tumblr, but I mirrored it on the blog section of my site using tumblr's APIv1. This was accomplished with some jQuery that would trigger on load and populate a <ul> element.

    This was fine, but it meant I was maintaining two sets of css and user experience was inconsistent depending on which platform they were reading on. I was already leveraging middleman to generate my static site and found that they have a blogging extension. Moving all my posts would allow me to check my posts into git and use triple ` notation for code blocks. The only hiccup was that tumblr has no way to export all of your posts, so it was time to dive back into their API. The game was afoot.

    Read more
    • automation
    • quidditch
    • ruby

    IF Shirt THEN Bounce That Email

    As you may or may not know, I'm one of the presidents of the highly ranked Michigan Quidditch Team. I've been with the team since the beginning and because I lived closest to the post office at the time, I've been in charge of shipping T-shirts to our fans all over the country. Until now, money has gone into my personal PayPal and I've just kept notes (usually of the fetch variety) about which shirts I'd shipped and paid the team for. However, as my tenure with the team nears its end, we needed a more sustainable version of this system.

    Read more

Subscribe