Not Surprised, But Still Disappointed
After being told the composition of the jury considering the case against George Zimmerman the week before, I said he wouldn’t be found guilty. I also posted comments to the same effect on Facebook. But I was still disappointed to discover that he’d been found not guilty.
In (foolishly) arguing the outcome of the case with people on Facebook, I made the following comment:
Zimmerman effectively profiled and stalked a minor child while armed for the simple act of walking home from the store. Incompetent as the prosecution apparently was, the laws of Florida are culpable too. They enable and condone vigilantism, and the needless deaths that will certainly continue to result.Andrew Sullivan's commentary on the verdict is well-worth reading. It raises the very uncomfortable specter of lynching, as well as the prospect that this verdict might encourage it. Given the widely-documented disparities in treatment of minorities when compared to whites in sentencing for the same crime, along with the highest rates of incarceration in the world, outcomes like the George Zimmerman verdict (and the perverse laws that enabled it) force me to question whether or not this country values my life, or those of other black males.
I’ve heard some talk of boycotting the state of Florida as a response to the verdict. I can understand the sentiment. What I’m less sure of is whether any such boycott could be effective without a clear objective (such as the repeal of Florida’s Stand Your Ground law). There’s also a legitimate concern about such a boycott hurting people who have no choice but to remain in Florida.
Word Games
I love word games. Whether it’s old-school ones like Scrabble and Boggle or the increasing number of iPhone word games (Words with Friends, Scramble with Friends, Letterpress, Ruzzle, etc), I play them all. Our federal government is playing a different word game right now, by hesitating to describe the overthrow of the Morsi government in Egypt as a coup d' etat.
The Merriam-Webster dictionary defines coup d' etat this way:
: a sudden decisive exercise of force in politics; especially:the violent overthrow or alteration of an existing government by a small groupHere's how the Oxford Dictionaries define coup:
The Wikipedia entry on coup is more extensive, and is perhaps the best description of the current situation:
- 1 (also coup d'état) a sudden, violent, and illegal seizure of power from a government:he was overthrown in an army coup
A coup d'état (/ˌkuːdeɪˈtɑː/; plural: coups d'état), also known as a coup, a putsch, or an overthrow, is the sudden deposition of a government,[1][2][3][4] usually by a small group of the existing state establishment—typically the military—to depose the extant government and replace it with another body, civil or military.Did the military depose the government? Yes. All indications are that Morsi is currently under house arrest. Did they replace it with another body? Yes. The chief justice of Egypt's supreme court was sworn in and placed in charge mere hours after Morsi's removal.
So why won’t our government call this change what it is? Perhaps because the U.S. provides more foreign aid to Egypt than to any other country except Israel for the purpose of preventing another shooting war between Egypt and Israel. Perhaps because a section of the Foreign Assistance Act of 1961 “restricts assistance to the government of any country whose duly elected head of government is deposed by military coup or decree”. Whatever the reason, now that the Egyptian army has killed 51 and injured hundreds in clashes yesterday, it’s unclear how much longer the Washington word games can (or should) continue.
The App Store Economy Ain't Broken (So Don't Fix It)
I came across this article via Daring Fireball, and figured I’d post my two cents about it. I disagree with the both the premise of the article and some of the specifics.
To the question of “why are so many of us so surprisingly cheap when browsing the virtual shelves of the App Store?” I’d say because quite a few vendors have conditioned us to expect high-quality apps for a fairly low price. It’s the same reason that the vast majority of people expect news to be free on the Internet. Those news sources that went online with paywalls at the beginning (The Wall Street Journal and The Economist are two publications I read for example) are still doing just fine financially. Those that didn’t are struggling financially (or going out of business altogether).
The idea that “we as cheap customers are having a negative impact on a lot of both real and potential businesses” is one I disagree with. One, because the author doesn’t quantify the negative impact. Two, because a potential business is a valueless unknown (and as such, can’t have any real weight in a discussion of what to pay for products from real companies). I’ll certainly buy an app if I use it a lot (and/or get tired of seeing ads in the case of most games). The benefit of the low pricing both to us as consumers and to app developers is that we can buy multiple apps that do similar things without having to think much about the cost (it’s why I own more than one photography app, for example).
I’m not a big fan of in-app purchases (especially after finding out how much my wife spent on a single game), but I don’t see much of a difference between that model and the licensing/subscription model that more and more software companies (Adobe, Microsoft) and others (Netflix, Hulu, Spotify, Pandora) are moving (or have already moved) to. The author’s focus on social media apps and games leaves out more serious “service-backed” apps like Evernote, GitHub, Flickr, DropBox, Box, LinkedIn and Google Drive that let you use a limited set of functionality for free and pay more for additional features or storage space.
Companies who sell apps aren’t doing it for charity. So if they’re any good at business at all, they’ll sell their products at a price that will keep them in business–or they’ll go out of business. It isn’t our job as consumers to keep poorly run companies in business by buying their software. And despite the author’s suggestion, paying for great apps now certainly doesn’t mean great apps later.
My 2 Cents on SXSW 2013
Size
I hadn’t been to a conference so large (whether you’re counting people or land area covered) since Microsoft’s PDC in 2001–and that was held at Staples Center in Los Angeles.
Sessions
Even though I only attended Interactive (they have Music and Film too), there were a ton of choices of sessions across a wide variety of technical, creative and other disciplines. In addition the technical topics I was looking for, I got to learn about the quantified self movement, 3-D printing, wearable computing and entrepreneurship.
Swag
Between the vendors in the exhibit hall and all the companies there recruiting new people, I’ve never gotten so much free stuff in my entire life.
Keynotes
I’d attended keynote speeches at conferences before, but hadn’t seen keynote interviews before. Elon Musk and Al Gore were both entertaining and thought-provoking. While it wasn’t billed as a keynote, the best solo talk I heard during the entire conference was Phil Libin’s Chaotic Good.
Panels
Many sessions weren’t just a single person speaking, but a group speaking in front of an audience. Making it Rain in Non-Techy Markets was the best panel I attended during the conference. While I’m not an entrepreneur (yet), all four panelists gave really helpful advice.
People
I met people from all over the world at this conference. Just on the rides to and from the convention center each morning and evening I met people from the Netherlands, Australia and Italy–as well as from all over the U.S. In the airport on the way back, I met 3 people from a company that happens to be across the parking lot from mine!
Quite a few people I met were founders or co-founders of their own companies. I heard a number of start-up pitches and met a venture capitalist who was in town looking for companies to invest in.
The locals who were brave enough to stay in town for South By were very friendly and helpful. One guy even gave a couple of us a ride to the convention center when our shuttle was running late.
Traffic
Speaking of shuttles, R & R Limousine and Bus (the exclusive shuttle provider between hotels and SXSW venues) did a pretty poor job serving my hotel (one of two close to the airport). When we didn’t resort to bumming rides from strangers or calling cabs, we usually ended up waiting a long time for our to show up. The traffic did us no favors either. Between the construction on the roads and street closures, it took a long time to get in and out of downtown.
Overall
SXSW Interactive 2013 was a great (if tiring) time. I really enjoyed Austin as a town. It has a buzz, an energy to it unlike any city I’ve ever visited. I hope to go back–if not for SXSW 2014, then a different time of year to enjoy the rest of Austin.
Replicating Folder Structures in New Environments with MSBuild
I recently received the task of modifying an existing MSBuild script to copy configuration files from one location to another while preserving all but the top levels of their original folder structure. Completing this task required a refresher in MSBuild well-known metadata and task batching (among other things), so I’m recounting my process here for future reference.
The config files that needed copying were already collected into an item via a CreateItem task. Since we’re using MSBuild 4.0 though, I replaced it with the simpler ItemGroup. CreateItem has been deprecated for awhile, but can still be used. There is a bit of debate over the precise differences between CreateItem and ItemGroup, but for me the bottom line is the same (or superior) functionality with less XML.
Creating a new folder on the fly is easy enough with the MakeDir task. There’s no need to manually check whether or not the directory you’re trying to create already exists or not. The task just works.
The trickiest part of this task was figuring out what combination of well-known metadata needed to go in the DestinationFiles attribute of the Copy task to achieve the desired result. The answer ended up looking like this:
<Copy SourceFiles="@(ConfigFiles)" DestinationFiles="$(OutDir)_Config\$(Environment)\%(ConfigFiles.RecursiveDir)%(ConfigFiles.Filename)%(ConfigFiles.Extension)" />
The key bit of metadata is the RecursiveDir part. Since the ItemGroup that builds the file collection uses the ** wildcard, and it covered all the original folder structure I needed, putting after the new “root” destination and before the file names gave me the result I wanted. Another reason that well-known metadata was vital to the task is that all the files have the same name (Web.config), so the easiest way to differentiate them for the purpose of copying was their location in the folder structure.
In addition to the links above, this book by Sayed Ibrahim Hashimi was very helpful. In a previous job where configuration management was a much larger part of my role, I referred to it (and sedodream.com) on a daily basis.
Fixing MVC Sitemap Errors
When attempting to manually test a .NET MVC application, I got the following exception from Visual Studio:

Looking at the inner exception revealed this message:
An item with the same key has already been added.The sitemap file for our application is pretty long (over 1300 lines of XML), but a co-worker pointed me to the potential culprit right away. There was a sitemap node near the end of the file that had empty strings for its controller and action attributes. As far as I can tell, this generates the default url for the site's home page. Since it already exists, this results in the exception that's thrown. Removing the sitemap node resolved our issue. A couple of threads that I checked on stackoverflow (here and here) provide other possible causes for the error.
Identifying All Bad Mappings with AutoMapper
One of the long-running annoyances we’ve had with our test of AutoMapper configuration validity on my current project is that a test failure only revealed the first mapping that was wrong. I haven’t figured out why this is the case, but I’ve come up with a work-around that displays all the necessary information.
Because the exception thrown if one or more incorrect mappings is found is AutoMapperConfigurationException, my revised test catches that exception in order to print the source type, destination type, and the list of unmapped property names. Re-throwing the exception at the end ensures that the test still reports a failure. The XUnit test which demonstrates this is available as a GitHub gist. If you’re using NUnit or MSTest in your application, minor revisions to this test will give you the same results.
Ours At Last
After about two weeks of homelessness (a.k.a. living in my wife’s condo and hotels), we finally completed the settlement process on our shiny new townhouse around 3 pm this afternoon. Less than two hours later, we’d spent some of the profit left over from the sale of my old townhouse on new furniture for the main level. Between working full-time, preparing a house to sell, and buying a new one, the past four months have been incredibly busy. It still won’t be slowing down anytime soon. Tomorrow is move-in day, since PODS is coming to pick up their storage unit at noon. There’s still Verizon FIOS to install, furniture deliveries to accept, more furniture and electronics to buy (not to mention a new washer and dryer). I’ll be glad when we’re finally settled in so we can invite some friends to hang out.
Our new neighborhood is still in the process of being built, but what we’ve seen so far of where we’ll be living looks great. I’m looking forward to getting to know our new neighbors.
Fastest Realtor in the East?
I didn’t think a house could be sold in just 4 days, but I was wrong. We got a list price, all-cash offer on the house yesterday. Many thanks to our realtor and friend Karane Campbell. I couldn’t recommend her more highly. She priced the place perfectly and worked hard on the three interested parties to get us the best price.
First-Time Home Seller
Since my wife and I are buying a new place together, I’m selling the townhouse we currently live in. If you’re looking to move into Montgomery County, Maryland you won’t find a better value.
The $285,900 list price gets you a 3-level interior unit townhouse with 2300 square feet of living space; 4 bedrooms, 3 1/2 baths, 2 fireplaces, and a fully-finished walkout basement. The $125 monthly homeowners' association dues cover your water bill, assigned parking space, trash, recycling, maintenance of community common areas and snow removal. Whether you work in DC, Maryland or northern Virginia, this location puts them well within reach. Metro’s Red Line is a 10-minute walk from the front door. The Beltway and Route 29 are just minutes away by car. I’ve had career opportunities in each of these areas over my 14 years here and having these transit options made it a lot easier than it might have been otherwise.
When it comes to shopping, dining, or entertainment, this area is hard to beat. Wheaton Plaza is just around the corner. The area’s newest Costco store will soon be open there. There are multiple CVS pharmacies, a Target and a Giant Food store. A brand-new Safeway is also scheduled to open within a year. There a few good Thai and Vietnamese restaurants within a short drive or a walk. Everything that downtown Silver Spring has to offer is a short drive (or two Metro stops) away.
If you’re into exercise, this area has you covered there too. LA Fitness has a facility in the Wheaton Plaza complex. The paved trails of the Sligo Creek Parkway are not far away either if you run or cycle.
Contact our realtor, Karane Campbell at (240) 393-8906 if you’re interested in finding out more.
MLS# MC7968156
How to Be Black
I finished reading this provocatively-titled book a couple of days ago. I expected Baratunde Thurston’s memoir to have its funny moments (he worked for The Onion until recently) and it did. I was not expecting the deep insights about black identity I found throughout the book. I also wasn’t expecting to see as much of myself in the author (beyond the unpleasant childhood experiences I had as a result of not fitting the stereotypes of what black kids are supposed to do and be). It was a pleasant surprise to discover that Thurston and I have Washington Post internships in common (as does my friend Sandro, one of the handful of other black computer scientists I know).
I was also pleasantly surprised to discover that Thurston’s interest in technology was inspired (at least in part) by his mother, who made a living writing COBOL for the Office of the Comptroller of the Currency. One of the other technologists that blogs whom I admire greatly, raganwald, was inspired into his career by his mother as well.
If you enjoy stories about people destroying stereotypes in general (or stereotypes of black people in particular), How to Be Black is well worth reading.
Visual Studio & TFS Behavior Tweaks
One of a few long-running annoyances I’ve had with every version of TFS is one of the default behaviors on check-in. The default is to resolve an open item on check-in, which is virtually never the case the first (or second, or third, etc) time you check in code to resolve a bug or implement new functionality. Fortunately, Edsquared has the solution.
After making this long-overdue change in my development environment, I exported the keys for VS2010 and VS2012 as registration entry files below:
Feel free to use them in your environment.
Freedom From Default Color Themes in Visual Studio 2012
I finally joined the ranks of those who’ve installed Visual Studio 2012 this week. The default Light color scheme is way too bright. The Dark color scheme is better, but the grays aren’t differentiated enough (just like the Microsoft Blend UI). Thankfully, some wonderful soul compiled this blog post, which details the changes necessary to save your eyes from the horrible default themes.
Following steps 1 and 2 will be enough, but you can go even further if you want the Visual Studio 2010 icons back in addition to the color scheme.
Tim Cook Should Ignore Ars Technica (Almost) Completely
I came across this article by Jacqui Cheng and thought I’d add my two cents on each of the suggestions.
-
License OS X. Despite the article’s protestations that licensing doesn’t have to be the disaster it was for them in the 90s, this suggestion misses the mark because it misunderstands what kind of company Apple–a hardware company. Licensing OS X would only send hardware revenue to a company (or companies) other than Apple. There’s no compelling reason for them to give away that money. Licensing the OS won’t get them additional users, or revenue, or get them into some new market they might want to enter. This is by far the worst idea on the list.
-
Bring some manufacturing jobs back to the U.S. It’s a nice idea in theory, but in reality, there’s no compelling reason for them to do this. Why should they voluntarily raise their costs and reduce their profit margins? Apple is hardly the only company doing business with Foxconn. Dell, H-P, Cisco, Intel and Cisco are also major customers.
8. Invest in an independent research lab. This has been said better by others, but Apple’s success is due in large part to its narrow focus. People and capital used for such a lab wouldn’t be available to help with the things that Apple is great at. There are other ways that Apple can contribute to the public good without directing a ton of money toward basic research. In my view, the federal government is the right entity to be doing that (but that’s a whole other discussion).
7. More transparency on OS X and Mac plans. Like suggestion 10, the primary focus of this suggestion seems to be on Mac Pro users. It’s true that the Mac Pro hasn’t gotten much attention from Apple over the past couple of years. Perhaps the biggest reason is that it doesn’t account for much of their revenue anymore. The one point I would extrapolate from their suggestion that I would agree with is that Apple can definitely improve in how they treat developers for their platforms. I’ve spent my career writing desktop and web applications on and for various versions of Windows, and Microsoft seems much more “pro-developer” (more information about development tools, free copies of software, training events, etc). I wouldn’t expect Apple to try and become just like Microsoft in this regard (nor should they), but there are definitely some lessons Apple could learn.
6. Make the Apple TV more than a hobby. This is the first suggestion in the list that I like. I like the Apple TV enough that I own one for each TV in my house and have started buying them as gifts for family.
- Offer streaming, subscription music. I’m not sure what I think of this suggestion. I avoided subscription music services in favor of buying music for years because I preferred the idea of owning it and being able to listen to it on whatever device I wanted. I like the experience I’ve had with Spotify so far, but I don’t know if I listen to enough music to justify the monthly cost. I’m not sure what Apple could bring to the space that would be better. Whether they do anything with streaming or not, what Apple really needs to do is re-think iTunes. As Apple has offered more and more content, iTunes has become more of a sprawling mess.
4. Inject some steroids into the Mac line. I disagree with this suggestion completely. Apple got it right with their focus on battery life and enough speed. In mobile phones and tablets, seemingly every manufacturer using Android as the OS focused on metrics like processor speed, camera megapixels, and features like full multi-tasking. The result: devices that had to be recharged multiple times over the course of a day. By contrast, the iPhone is plenty fast, but I can go a full day without having to recharge it. Multiple days can go by before I need to recharge the iPad. Apple has correctly avoided competing on specific measures like processor speed and how many megapixels their cameras have. They’re competing (and winning) on the experience of using their products.
3. Diversify the iOS product line. If the rumors are correct, Apple will be offering a smaller version of the iPad soon. The next iPhone will probably have a larger screen as well. But beyond those changes, I don’t think Apple should be in any hurry to diversify in the way Ars Technica suggests. By limiting the differentiation of their iOS-based products to storage size (and cost), Apple has chosen a metric that is both meaningful and easy for the typical consumer to understand. This makes Apple products easier to buy than the alternatives.
- Make a larger commitment to OS security. I agree with this suggestion as well. Apple’s success in the market has made them big enough for virus/malware makers to spend time targeting.
1. Cater to power users again. I see this suggestion as a variation on the them of suggestion 7. I’m sure Apple could do something like this in a way that wouldn’t disrupt their current approach. Whether or not it would net them enough additional customers and revenue to be worthwhile is another discussion.
Help Build a Tesla Museum
One of my favorite cartoonists, Matthew Inman, is using his unique brand of humor to help raise funds to buy the site of Nikola Tesla’s old lab. As of this post, he’s raised nearly $970,000. I don’t contribute to a lot of causes beyond my church and public radio, but I contributed to this project because the U.S. could use a museum about a great scientist a lot more than another mall. If you agree, I hope you’ll donate as well.
Introducing AutoPoco
I first learned about AutoPoco from this blog post by Scott Hanselman. But it wasn’t until earlier this spring that I had an opportunity to use it. I’d started a new job at the end of March, and in the process of getting familiar with the code base on my first project, I came across the code they used to generate test data. I used AutoPoco to generate a much larger set of realistic-looking test data than was previously available.
Last week, I gave a presentation to my local .NET user group (RockNUG) on the framework. The slide deck I put together is available here, and there’s some demo code here. The rest of this blog post will speak to the following question (or a rather rough paraphrase of it) that came up during a demo: is it possible to generate instances of a class with an attribute that has a wide range of values, save one?
The demo that prompted this question is in the AddressTest.cs class in the demo code I linked to earlier. In that class, the second test (Generate100InstanceOfAddressWithImpose) gives 50 of the 100 addresses a zip code of 20905 and a state of Maryland. The possible objective of the question could be to generate a set of data with every state except one.
After taking a closer look at the documentation, and a review of the AutoPoco source code for generating random states, I came up with an answer. The Generate1000InstancesOfAddressWithNoneInMaryland test not only excludes Maryland from the state property, it uses abbreviations instead of the full state name. The implementation of CustomUsStatesSource.Next adds a couple of loops (one if abbreviations are used, one if not) that keep generating random indexes if the resulting state is contained in the list of states to exclude.
The ability to pass parameters to custom datasources in order to control what type of test data is generated is an incredibly useful feature. In the work I did on my project’s test generator, I used the capability in order to create a base datasource that generated numeric strings with the length controlled by parameters. This allow me to implement new datasources for custom ids in the application by inheriting from the base and specifying those parameters in the constructor.
Because AutoPoco is open source, if your project has specific needs, you can simply fork it and customize as you wish. Another value-add of a framework like this could be realized if you write multiple applications that share data. In such a scenario, test data becomes a corporate resource, with different sets generated and made available according to the scenarios being tested.
Another advantage of AutoPoco for test generation is that its use of plain old CLR objects keeps it independent of specific database technologies. I’m currently using AutoPoco with RavenDB; it will work just as well with the database technology (or ORM) of your choosing–Entity Framework, NHibernate, SQL Server, Oracle, etc.
AutoPoco is available via NuGet, so it’s very easy to add to whatever test assemblies you’ve currently got in your solutions. As long as you have public, no-arg constructors for the CLR objects (since AutoPoco uses reflection to work), you can generate large volumes of realistic-looking test data in virtually no time.
The Perils of Renaming in TFS
Apparently, renaming an assembly is a bad idea when TFS is your version control system.
Earlier this week, one of my co-workers renamed an assembly to consolidate some functionality in our application yesterday, and even though TFS said the changes were checked in, they weren’t.
I got the latest code the morning after the change, and got nothing but build failures. We’re using the latest version of TFS and it’s very frustrating that something like this still doesn’t work properly.
Ultimately, the solution was found at the bottom of this thread.
The only way I’ve found to avoid this kind of hassle is to create a new assembly, copy your code from the old assembly to the new one, change any references to the old assembly to use the new assembly, then delete the old assembly once you’ve verified the new one is working.
Please Learn to Code (Continued)
A couple days ago, I wrote a post on why Coding Horror is wrong to suggest people shouldn’t learn to code.
Here’s a much better post on the same subject by Jon Galloway (hat tip Scott Hanselman, and his e-mail Newsletter of Wonderful Things).
Please Learn to Code
I came across this post from Jeff Atwood in my Twitter feed this morning. It even sparked a conversation (as much of one as you can have 140 characters at a time) between me and my old co-worker Jon who agreed with Jeff Atwood in far blunter terms: “we need to cleanse the dev pool, not expand and muddy the water”.
While I understand Jon’s sentiment, “cleansing” vs. “expanding” just isn’t going to happen. Computer science as an academic discipline didn’t even exist until the 1950s, so it’s a very long way from having the sort of regulations and licensure of a field like engineering (a term that dates back to the 14th century). Combine that with the decreasing number of computer science graduates our colleges and universities graduate each year (much less the elimination of a computer science department), and it’s no surprise that people without formal education in computer science are getting paid to develop software.
While it does sound crazy that Mayor Bloomberg made learning to code his 2012 new year’s resolution, I’m glad someone as high-profile as the mayor of New York is talking about programming. When I was deciding what to study in college (way back in 1992), computer science as a discipline didn’t have a very high profile. While I knew programming was how video-games and other software was made, I had to find out about computer science from Bureau of Labor Statistics reports.
Jeff’s “please don’t learn to code” is counterproductive–the exact opposite of what we should be saying. Given a choice between having more people going into investment banking and more people going into software development, I suspect a large majority of us would favor the latter.
I also don’t believe that the objective of learning to code has to be making a living as a software developer in order to be useful. The folks at Software Carpentry are teaching programming to scientists to help them in their research. People who test software should know enough about programming to at least automate the repetitive tasks. If you use a computer with any regularity at all, even a little bit of programming knowledge will enable you to extend the capabilities of the software you use.
We need only look at some of the laws that exist in this country to see the results of a lack of understanding of programming by our judges and legislators. I think that lack of understanding led to software patents (and a ton of time wasted in court instead of spent innovating). The Stop Online Piracy Act and the Protect IP Act are other examples of dangerous laws proposed by legislators that don’t have even the most basic understanding of programming.
As someone who writes software for a living, I prefer customers who understand at least a bit about programming to those who don’t, because that makes it easier to talk about requirements (and get them right). They tend to understand the capabilities of off-the-shelf software a bit better and understand the tradeoffs between it and a custom system. In my career, there have been any number of times where an understanding of programming has helped me find an existing framework or solution that met most of a customer’s requirements, so I and my team were able to focus our work just on what was missing.