An update
This blog is basically on an indeterminate hiatus.
I blog more often at Cross Cutting Concerns, which is a blog specifically about aspect-oriented programming.
I’m still very active on Twitter, where I tweet about similar topics to mgroves.com.
Also, I occasionally write something on Tumblr. Those tend to be very entertainment based: pop culture, comedy, comics, etc.
Goals for 2012 Part 2
My goals for this year are somewhat similar to last year, with a few notable changes.
- Rehab. The “incident” was a grand mal seizure that gave me two dislocated shoulders, both of which caused fractures, which need surgery. I’m on seizure medication, and I’m not supposed to drive a car until April. I have already gotten through one surgery, the other will be coming up in February. If all goes well, I’ll be about 80% by April, and hopefully 100% by July. This goal is much lower on Maslow’s hierarchy than any of my other goals, and thus is automatically the most important.
- Certification. I’m already scheduled to take an MCTS exam to help my employer remain in good standing with Microsoft, as well as to improve my knowledge of Microsoft products. I’m not overly concerned with certification(s) this year. If I have the opportunity to take more Microsoft exams or pick up some PDUs, I’ll take them, but I’m not going to be worried if I don’t.
- Android apps. I will get a handful more of apps into the store this year, whether they be Mono for Android or native Java. I already have one in the works, and ideas for several more. I’m also going to get some Windows Phone apps in the marketplace.
- Conferences/sessions. With the exception of CodeMash, I don’t have any plans for conferences, until–at earliest–after April. I’d be open to doing local presentations if I’m needed, but that’s about it. It will be enough of a challenge just to attend CONDG group meetings in the first half of the year. I would like to definitely make it to GiveCamp this year!
- Blogging. I’ve created another blog, one with a much narrower focus than mgroves.com. It’s called Cross Cutting Concerns, and it’s all about AOP news and information.
- Business. Our MonthlySauce.com business really needs to pick up this year. I will be exploring some creative ways to get exposure on our limited budget.
- Personal/Internal. As before, I have a number of personal and internal-to-my-employer goals that I won’t state here. And I may have another surprise or two up my sleeve this year if all goes well.
That’s it.
Goals for 2012 Part 1: Goals for 2011 recap
It’s a little disappointing to me that my Goals for 2011 post is still on the home page of mgroves.com. But que sera.
First, a review of my 2011 goals, and how well I did:
- Read books. Bender’s TDD book, yes. DDD, not so much (it’s a long book!). F# book, no. Beautiful Code, yes a little. I’ve pretty much abandoned the old dev lunchtime book club due to dailys with my employer at that time, but I’ve managed to sneak in a couple other books too: One on PHP5, reread of Don’t Make Me Think, ASP.NET MVC 3 from Wrox, Lauren Ipsum, and a few fiction titles here and there. With my new Kindle, I’m able to read a lot more conveniently, though code-heavy books could be an issue.
- Certification: I think I got a few PDUs from going to the Cincinnati Day of Agile last year, but I’m really slacking in PDUs. I will take an MCTS exam (70-515) in a couple weeks.
- Android apps: I exceeded my goals here for sure. I have 5 apps in the store: 1 free, 1 paid. One of them (Yeah Dog!) has sold well over 150 copies. My free one has been downloaded over 1000 times.
- Conferences & presentations: I also exceeded my goals here, speaking in Pittsburgh (twice), Findlay, Codestock, Devlink, Columbus, Louisville, Detroit, Ann Arbor, Richmond, Stir Trek, New York, and probably one or two more that I’ve forgotten. The travel has been a bit of a strain on family and finances, so I was already planning to reduce my speaking, even before the “incident”, which I’ll get to later.
- User groups: I regretfully didn’t participate in GiveCamp (because of Richmond) in any capacity, but I did help to organize Central Ohio Day of .NET, and I performed okay on the board of CONDG. I chose not to pursue re-election though (mainly because of the “incident”).
- Project Euler: I definitely dropped the ball here. I ended up spending more time preparing and presenting on Euler than I did doing new problems.
- Blogging: Another fail. I spend more time on Twitter than blogging, that’s for sure.
- Surprises: My wife and I successfully launched our first small business, MonthlySauce.com. Business isn’t exactly rushing in, but we did launch it on schedule.
Stay tuned for my 2012 goals and details on the “incident”.
2011 Funniest Commercial Awards
For some reason, a lot of commercials really appealed to me this year. Maybe it’s because I so rarely watch commercials anymore (DVR,Netflix) that a good commercial really stands out to me. Anyway, this is mainly an excuse to get a cheap blog post with some funny videos. So, without further ado…
5. My brand!
1-800-CONTACTS overly dramatic unboxing commercial. This commercial might not have come out in 2011. That’s okay, it’s not like this award has the same rigor as, say, the Nickelodean Kids’ Choice Awards.
4. I like tacos…
I really like the acting in this commercial, and especially the delivery of “I like tacos” to a crowd of bewildered, chewing coworkers.
3. That’s dumb
This is the commercial that keeps on giving. It’s like the Arrested Development of commercials: each time you watch, you’ll find some new hilarious aspect of it.
2. CUZ I’M BLACK OPS
It’s bizarre how good of a comedic delivery that Brian Wilson has.
1. Yeah dog!
I don’t think I need to explain this one too much.
Hitchhiker’s guide to hitchhiking
I was listening to the Freakonomics podcast recently. Specifically, an episode about hitchhiking. They speculate about the various reasons that hitchhiking has largely gone away. It’s a great episode; check it out. But an important detail was brought up: many people drive around in mostly empty cars. That is, a typical car has capacity for 4 passengers, but only usually carries 1. This means that there’s a lot of wasted capacity.
On the day I write this, I am currently recovering from a medical issue that prevents me from driving. I’m sure there are many others in a similar situation: they have no car, no license, a medical condition, etc, that prevents them from driving themselves. Compare this to all the wasted capacity, and you have a market inefficiency (or a market opportunity, depending on how you look at it).
One of the problems with hitchhiking your person around is unreliability. Maybe I can hitch a ride to Chipotle, but will I be able to hitch back, all within a reasonable time? But what if my burrito could hitch a ride instead of me? There are many food delivery services in Columbus, but few are suitable or affordable for a single person’s meal. So, I posed my idea to Twitter.
I soon received a response that there’s a service called Zaarly, that could act very much like a service that I imagined. I placed a somewhat silly order: $10 to deliver me a Chipotle burrito. I say silly because Zaarly looks like a new service, has very few participants, not to mention I was asking for someone to deliver a burrito to me for about $3 in profit. However, if there were a critical mass of Zaarly users, then there’s gotta be at least one user already going to be driving near both a Chipotle and my house anyway, then the $3 is almost free money for someone with a mostly empty car. And this could work not just for food, but for anything that needs delivery: documents, groceries, anything. Or maybe there’s some sort of crediting that could (hypothetically) happen: you deliver to me today, and you’ll get one free delivery credit to use later, or something like that. This is similar to the concept of “slugging“, or ad-hoc carpooling, as mentioned in the Freakonomics podcast episode, except it’s stuff instead of people.
Realistically, Zaarly hasn’t reached this level of critical mass, at least not in Columbus. I shouldn’t have gotten my burrito. Some smart aleck placed a $40 bid to make this point.
Fortunately for me, the CEO of Zaarly Columbus decided to make his own point: that Zaarly is a business that cares about and needs customers (like me) to be successful, and he accepted and delivered my $10 Chipotle burrito offer. I’m not saying he’s going to be your personal Chipotle delivery man for $3 a pop (I tipped him a little more, by the way
, but I’m saying in cities bursting with commuters (like Columbus), let’s put our wasted capacity to work, and start using Zaarly!
My new android app
Well, it’s not exactly what I expected to create, but one of my goals this year was to get at least two Android apps into the market(s): one free and one paid. Those goals are now accomplished.
My free app has been in the market(s) for a while, and has actually gotten a recent update: Mono Stock Portfolio, which is totally free (and no ads), and was really just a way for me to help learn (and teach) the Mono for Android tool. According to Google, this app actually has a surprisingly large user base: 1080 total installs, and 393 active installs. And I’ve gotten several e-mails from users asking for more features!
The other app, I just threw together this weekend in a sudden fit of whimsy, inspired in no small part by this commercial:
The app is “Yeah Dog!“, which I started creating with Mono for Android, but soon realized that the 5mb+ overhead just didn’t make sense for this app. So I rewrote it, painstakingly, in Java, which wasn’t as unpleasant as I thought it might’ve been (but unpleasant nonetheless). This app will set you back 99 American cents, and is also ad-free.
In the process of creating and publishing Yeah Dog!, I came to find out that I was beaten to market! First, GEICO actually released their own “BroStache” app some time ago, but I discovered that there is a secret “Yeah Dawg” feature in that app. Secondly, some other rascal created his own YeahDawg app (albeit an inferior one!) and published a mere two days before me.
Oh well. Such is the harsh reality of free markets. But in any case, I believe I have enriched myself as a developer, speaker, and businessman throughout the process of creating, publishing, and maintaining these apps, so that alone makes it worth it.
Hail, Xenu!

I first mentioned Xenu link sleuth way back in March, 2008, as a handy way to find broken links.
It’s worth mentioning a second time, 3+ years later, as I just recently dusted it off again.
This time around, though, I wasn’t looking for broken links or 404′s, but what I was looking to do was to “exercise” an entire site by spidering over it. The idea being that my site would catch any exceptions and log them, and so by exercising the entire site, I’m essentially doing one big set of tests.
Xenu is such an easy to use tool. All you need to do is install it and give it a URL to start with, and it will go to town.
Multi-threaded unit testing
I once said that “Multithreading does a lot of things, but I don’t think ‘simplification’ is ever one of them“. Even with the simplest, most beginner level of no-frills threading, I find this to be true.
As an example, I was writing unit tests for my MonoDroid app that I recently decided to refactor with the MVP pattern (so I could increase test coverage). There’s only one place in the whole app where I use multiple threads. When the user clicks on a portfolio, there’s a web service call to get the latest stock prices (and volume, and other stock information). Because this can take a while, I want to show the user a nice animated “please wait” dialog on the UI while the web service (and other stuff) runs on a background thread. That all works great, and provides a preferable user experience to a blank screen doing nothing. (Note that I tried doing this without threads and I couldn’t get it to work–this could be a failure on my part).
However, when I got to the part where I’m testing the presenter’s orchestration of the above multi-threaded scenario, my tests started getting inconsistent results. I had also started using MSpec and JustMock at this time, and so I immediately assumed I was using those tools wrong. However, I should have immediately known it was a race condition, because sometimes my tests would all pass, and sometimes they wouldn’t. Seems obvious in retrospect.
What would happen is that sometimes my background thread would finish before the test assertions, and sometimes it wouldn’t. It was a huge relief once I figured that out, but now I have another problem: how do I test it?
My solution seems a little hacky, but it works. I was reminded of stories of people who wanted to test what would happen to certain parts of code at different times of the day. I.e. service X should do one thing in the morning, and another thing in the evening. But you can’t really inject a mock into every place the DateTime class is used. So, one approach is to simply wrap it in a service and put it behind an interface. And that’s exactly what I did with my threading code (which is a PostSharp aspect):
Then, when testing, before I do anything else, I set the ThreadingService to be some service that just runs the callback on the main thread, instead of putting it into a worker thread. Like so:
Since my unit tests don’t care about user experience (or even touch the UI implemention), I can now test that the presenter is doing what it’s supposed to. Is this a good general strategy for unit testing threaded code? Probably not. But maybe!
Using PostSharp and SOLID principles, part 3
Sorry, I’m getting a little behind myself. Part 3 of my PostSharp SOLID series went up over a week ago. Here’s a preview:
Logging and auditing is one of the things that PostSharp is best at. It’s the quintessential example of a cross-cutting concern. Instead of sprinkling logging code all throughout the app, you simply write a logging aspect in one place. You can apply it selectively or on the whole app.
You can get a log a lot of useful information with an aspect
To find out more about logging and auditing, and some advanced information about how PostSharp optimizes itself, check out 5 Ways That Postsharp Can SOLIDify Your Code: Logging and Auditing
Using PostSharp and SOLID principles, part 2
The second of my 5 part series on using PostSharp to implement SOLID principles is now live. Here’s a little preview:
Sometimes there’s just no way to speed up an operation. Maybe it’s dependent on a service that’s on some external web server, or maybe it’s a very processor intensive operation, or maybe it’s fast by itself, but a bunch of concurrent requests would suck up all your resources. There are lots of reasons to use caching. PostSharp itself doesn’t provide a caching framework for you (again, PostSharp isn’t reinventing the wheel, it’s just making it easier to use), but it does provide you with a way to (surprise) reduce boilerplate code, stop repeating yourself, and separate concerns into their own classes.
Suppose I run a car dealership, and I need to see how much my cars are worth. I’ll use an application that looks up the blue book value given a make & model, and year. However, the blue book value (for the purposes of this demonstration) changes often, so I decide to use a web service to look up the blue book value. But, the web service is slow, and I have a lot of cars on the lot and being traded in all the time. Since I can’t make the web service any faster, let’s cache the data that it returns, so I can reduce the number of web service calls.
Since a main feature of PostSharp is intercepting a method before it is actually invoked, it should be clear that we’d start by writing a MethodInterceptionAspect…
To find out how to write a caching aspect, and some of the more advanced bits of knowledge for working with caches, continue reading: 5 Ways That Postsharp Can SOLIDify Your Code: Caching, and keep an eye out for the next three posts.