Posted 14 February 2013
Tagged to CSS, JavaScript, jQuery, Wordpress
When creating a new WordPress plugin, I wanted to include the handy media uploader. Fortunately, Matt at Webmaster Source has a great tutorial on how to easily add this to your form.
However, when uploading the image it merely drops the URL to the new image into the field. Instead, I want the function to log the uploaded image ID and show a thumbnail.
Continue reading
Posted 7 March 2012
Tagged to HTC, Photography
Since I joined HTC back in October, I’ve gotten to play with a lot of our phones and I’ve been quite impressed, especially with photos from the camera. What I love most is how people are surprised that they were taken with a cellphone — even people in HTC!
Here are a few of my favorites:
 Frosty morning in Seattle |
 Discovery Park |
Check out a few more after the jump.
Continue reading
Posted 14 August 2011
Tagged to Politics
There is an old adage that a group typically won’t vote to reduce it’s own power. It isn’t a far jump to extend this to tax increases: few people are likely to vote an increase in their own taxes. This got me wondering about the new Congressional “super committee” appointed to propose a solution to the debt crisis. Most particularly, which members have the most to lose if taxes are increased on the rich?
Here is a table of the members’ net worth, sorted from richest to poorest. Since the data provides only range of net worth, I’ve sorted by the lowest estimated amount (sorting by the high estimate has only a marginal impact on the order, with Senator Kyl dropping several places).
| Name |
Chamber |
Representation |
Net Worth (low) |
Net Worth (high) |
| John Kerry |
Senate |
D-MA |
$182,755,534 |
$294,869,059 |
| Fred Upton |
House |
R-MI |
$7,010,173 |
$25,651,000 |
| Rob Portman |
Senate |
R-OH |
$6,469,080 |
$14,965,000 |
| Dave Camp |
House |
R-MI |
$2,966,100 |
$10,515,000 |
| Pat Toomey |
Senate |
R-PA |
$1,127,038 |
$2,905,000 |
| Jeb Hensarling |
House |
R-TX |
$928,025 |
$2,270,000 |
| Jon Kyl |
Senate |
R-AZ |
$519,090 |
$746,082 |
| Patty Murray |
Senate |
D-WA |
$449,017 |
$1,185,000 |
| James Clyburn |
House |
D-SC |
$212,010 |
$582,000 |
| Chris Van Hollen |
House |
D-MD |
$148,007 |
$445,000 |
| Xavier Becerra |
House |
D-CA |
$100,054 |
$1,424,999 |
| Max Baucus |
Senate |
D-MT |
$13,013 |
$204,000 |
Data from OpenSecrets.org
I should note that this is a rather blunt analysis. Due to different forms of taxation someone that has a higher net worth may or may not have to pay more taxes if there is a change to the tax regime. Additionally, this is net worth, which is not the same as annual income and is taxed differently.
As an aside, I plan to start a non-profit to help raise Senator Baucus out of his relative poverty.
Posted 7 August 2011
Tagged to Facebook, Measurement, Social Media
HTC recently posted to their Facebook wall a simple question: “How many mobile phones have you owned?” Within a day they received about 2000 answers. Using the Facebook’s Graph API I wondered how hard it would be to automate the analysis to find out the average number. Here is the result:

Note: I removed about a dozen responses that stated ownership of more than 500 mobile phones. While this is probably feasible, it was a small minority and skewed my results too much.

Previous Manufacturer
In most cases, the owner upgraded from a phone by one of these makers to an HTC. As such, these are the “losers”, with Nokia coming out worst.
 |
Current Model
Commenters more readily their shared current model. As expected, most of these are HTCs, though some commenters left HTC for a new maker.
 |

|
Comments by User Gender
While expecting a male bias, I didn’t expect it to be so one-sided. I’m interested to know if the page demographics are similarly skewed.
|
Comments by Locale
Facebook doesn’t provide location for un-authenticated requests. Fortunately, locale is a useful proxy. (EN includes US and GB)
|
Comments by Sentiment
This measures the sentiment toward HTC and their products, not the sentiment of the comment. The sentiment was reviewed manually, so the accuracy is quite high. However, the small sample-size should discourage reading too much into this set of results.
|

The process for this was actually quite straight-forward. First I used the Facebook Graph API to download all the comments into a database. Because I didn’t want to manually review 2000 comments, my first pass automatically checked for comments containing only numbers. This took only a few minutes to code and knocked out 400 comments.
I then selected very short messages with the assumption that they were just numerical answers with punctuation. This proved prescient since many people noted the number of phones they’d owned and appended smiley faces. This took care of another 250 or so messages. To review the final set, I coded a small web application to manually step through each comment. Through this application I could also note the comment sentiment, past and current phones, and other facets. After some refinement to the app, I was able to review about a dozen messages a minute and complete the entire review in less than two hours.

I looked at several other Facebook posts with a large number of comments, but choose this one because many of the answers would be uniquely easy to automatically parse. If the question required a prose response, the analysis would need to be done more manually, which would be quite time-consuming. Crowd sourcing could provide a solution, perhaps through something like Amazon’s Mechanical Turk.
Because I coded the web application solely for this topic, I was able to very specific in my search parameters, which allowed for some interesting insights. For example, it was fascinating to see people’s ownership history (especially how their brand-loyalty has evolved over time). Similar analysis using an off-the-shelf tool (Sysomos, Radian 6, etc) would not have provided this level of customization and granularity.