link friday: Syria, stack ranking at Microsoft, boo Texas National Guard
Mood: okay
Posted on 2013-09-06 10:55:00
Tags: links
Words: 329

- 9 questions about Syria you were too embarrassed to ask - a good primer.

- Your Labor Day Syria Reader, Part 2: William Polk - ignoring the "Labor Day" bit, this is a good long article making a case against attacking Syria. I honestly don't know where I stand on this anymore - at first I was for attacking, then I was against, now I'm "maybe if I shut my eyes the civil war will stop?"

- An inside anecdotal look at Microsoft's stack ranking and how terrible it is. It surprises me a lot that a high-tech company would do something like this - it seems like a way to fight "grade inflation" at the high cost of totally perverting every employee's incentives.

- Defying Pentagon, Texas National Guard Refuses To Process Benefits For Gay Couples - so they won't let you apply for benefits at a state facility, but after you apply at a federal one they have to provide you services anywhere. Congratulations, Texas National Guard, for making it very clear you don't like gay people!

- Hmm, I was going to link this dialect quiz, but it's offline at the moment. Anyway, here's my dialect map:

I was surprised how well it pegged me, although apparently people in Kansas City also talk like people in Houston...

- My Son Wears Dresses; Get Over It - hooray! This article made me forget about that gender studies book where everyone was terrible when someone didn't conform exactly to gender roles.

- From the Onion: Renowned Hoo-Ha Doctor Wins Nobel Prize For Medical Advancements Down There - classic!

- When Harvard Met Sally: N-gram Analysis of the New York Times Weddings Section - a cool look at how wedding announcements have changed over time.

- Minimum wage over the last 40 years, inflation-adjusted - after the fast food workers protests, I looked up an inflation-adjusted chart. Of course it's hosted at raisetheminimumwage.com, and the text indicates that it starts when the minimum wage was at its inflation-adjusted high; here's a chart that goes back further.

2 comments

Windows Phone: including ads in your app, and using In-App Purchasing to turn them off
Mood: cheerful
Posted on 2013-09-04 19:55:00
Tags: windowsphone wpdev
Words: 824

Free apps are wildly more popular than paid apps, but some people (myself included) get annoyed at ads in apps. To get the best of both worlds, you can include ads in your free app but let people in-app purchase a way to turn them off. I've done this in two apps now (HospitalPrices, and SatRadioGuide), and here's how to do it!

Note that this is for Windows Phone 8.0 - here's a similar guide for Win/WP 8.1 Universal apps.

Part 1: Adding advertising

I'm going to use the Nokia Ad Exchange, although there are other choices such as Microsoft pubCenter, Ad Exchange, etc. You can also use the Ad Rotator to switch these on the fly and rotate between them.

This will be a fairly brief guide - see this guide on the Nokia Developer Wiki for a more thorough one. Honestly, if I had found that one first I would have just linked to that and skipped to Part 2, but it seems a shame to waste all these words!

1. Sign up for an account at nax.nokia.com. Under the SDKs tab, download the SDK for the versions of Windows Phone you'd like to target. Unzip the SDK - you'll find some documentation as well as Inneractive.Ad.dll. Under the Add App tab, create a new AppID (it's OK to leave the description and download link blank for now).

2. In your Windows Phone project, right-click on References, and click Add Reference. Go to the Browse section, and browse to the Inneractive.Ad.dll you unzipped from the SDK. Make sure the following permissions are set in your WMAppManifest.xml:
- ID_CAP_NETWORKING
- ID_CAP_WEBBROWSERCOMPONENT
- ID_CAP_PHONEDIALER
- ID_CAP_IDENTITY_DEVICE

If you want location-based ads, see the documentation.

3. Wherever you'd like to put an ad in the app, use the following XAML:


<ad:InneractiveAd
xmlns:ad="clr-namespace:Inneractive.Nokia.Ad;assembly=Inneractive.Ad"
AppID="<your ad ID>" AdType="IaAdType_Banner"
ReloadTime="60" Name="Ad" />


See the documentation if you'd like to customize this further.

--

Now the ads in your app should be working! Launch it and make sure that they appear and don't obscure any content.


Part 2: Using In-App Purchasing to Disable Ads

Note that in-app purchasing is only possible in Windows Phone 8 apps. For Windows Phone 7 apps, you can use a similar technique and only show ads in the trial version of an app.

1. Log in to the Windows Phone Dev Center, click "Dashboard" (at the top), then "Submit App" on the left. Under the "App info" section, give your app a name and category, then Save. (you can change these when you're ready to submit for real) Go back to the dashboard, select your new app, and go to the "Products" section. Click "Add in-app product". For the product info, specify whatever you want for the product alias (I usually use "<your app name>-NoAds") and "NoAds" for the product identifier. Set the type to "Durable", select the price, and click Save. Then specify a title and description - for the icon, feel free to use this:

(click for full-sized image)

Finally, submit the product. Since your app isn't published yet, it won't be visible to anyone else

2. Either create a Utils class or add this code to an existing one:

public static bool ShowAds { get; set; }
public static void UpdateInAppPurchases()
{
ShowAds = true;
var allLicenses = Windows.ApplicationModel.Store.
CurrentApp.LicenseInformation.ProductLicenses;
if (allLicenses.ContainsKey("NoAds"))
{
var license = allLicenses["NoAds"];
if (license.IsActive)
{
ShowAds = false;
}
}
}


In App.xaml.cs, add a call to Utils.UpdateInAppPurchases() to the Application_Launching() and Application_Activated() methods.

3. Find all of the ads you added in XAML, and add Visibility="Collapsed" to them. Then, to each page that has an ad, add this method:

public void UpdateAd()
{
Ad.Visibility = Utils.ShowAds ? Visibility.Visible : Visibility.Collapsed;
}


and add a call to UpdateAd() to the OnNavigatedTo() method.

4. All that's left now is to add the option to remove ads from inside the app. If you'd like to add a menu item in the app bar, you can add the following XAML:

<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="remove ads" Click="RemoveAds_Click"/>
</shell:ApplicationBar.MenuItems>


Or, you can add a button in your about page, or both.

Then, add the event handler:

private async void RemoveAds_Click(object sender, EventArgs e)
{
try
{
await Windows.ApplicationModel.Store.CurrentApp
.RequestProductPurchaseAsync("NoAds", false);
UpdateAd();
}
catch (Exception)
{
// oh well
}
}


Finally, to remove the menu item from the page if the user has already removed the ads, add this code to your UpdateAd() method:

// if we add more of these, we'll need to be more clever here
if (!Utils.ShowAds && ApplicationBar.MenuItems.Count > 0)
{
ApplicationBar.MenuItems.RemoveAt(0);
}


--

To test the in-app purchasing code, you'll need to publish your app as a beta. (all in-app purchases are free in a beta) But, other than that, you're done!

References: Windows Phone blog post on In-App Purchasing

In-App Purchase: Success stories and Tips to test common in-app failure scenarios

--

See all my Windows Phone development posts.

I'm planning on writing more posts about Windows Phone development - what would you like to hear about? Reply here, on twitter at @gregstoll, or by email at ext-greg.stoll@nokia.com.

--

Interested in developing for Windows Phone? I'm the Nokia Developer Ambassador for Austin - drop me a line at ext-greg.stoll@nokia.com!

0 comments

David and I with George Takei! with pictures!
Mood: excited
Posted on 2013-09-02 20:41:00
Tags: pictures
Words: 62

We waited in line for quite a while (some of it in the heat), but we got an autograph and picture with George Takei!

(click the thumbnails for the full images)

<- David and I with George Takei! We chatted briefly - he was a nice guy even after signing autographs for hours!

<- his autograph

<- someone made a balloon Enterprise!

<- waiting outside

<- waiting inside

0 comments

link friday: bank robber becomes a law clerk, homelessness is way down, "Same Love"
Mood: peaceful
Posted on 2013-08-30 15:00:00
Tags: links
Words: 378

- Shon Hopwood and Kopf’s terrible sentencing instincts - a blog post written by Judge Kopf about Shon Hopwood, who Kopf sentenced to 12 years in jail for robbing banks. After Hopwood got out, he went to law school and will be clerking for a judge on the D.C. Circuit Court of Appeals. Down in the comments, Hopwood himself responds and they have a rather pleasant conversation! This comment on Hacker News sums it up well:

I feel like I'm in some fantasy alternate reality, where prison rehabilitation really works, and where the Internet is used for polite, intelligent, and uplifting discussion.
Just wonderful!

- The Astonishing Decline of Homelessness in America - thanks to programs put in place by Obama and George W. Bush(!); unfortunately, the sequester may threaten the progress we've made.

- Macklemore’s “Same Love” Is the Only VMA Performance Worth Remembering - this song has come up a lot on the radio stations we listen to lately, and every time I get chills. It just sounds so heartfelt (and the bit by Mary Lewis is beautiful!)

- How Poverty Taxes the Brain - thinking about financial problems causes a mental burden that is the equivalent of losing 13 IQ points.

- Booker OK With Speculation That He’s Gay: ‘So What Does It Matter If I Am?’ - excellent response from Cory Booker, who's running for the open Senate seat in New Jersey. Another quote:
I hope you are not voting for me because you are making the presumption that I’m straight.

- Bill Watterson: A cartoonist's advice - words by Bill Watterson, drawn by someone else (who does a good job mimicking Watterson's style!) I miss Calvin & Hobbes!

- College Footbal Grid of Shame - the "Admirable/Embarrassing" scale looked questionable at first, but there is at least a methodology to it. Also, Rice is just where it should be - in the upper-left quadrant :-)

- The Killing Machines: How to think about drones - good long article in the Atlantic. I'm glad our drone strikes have dropped off dramatically.

- English Letter Frequency Counts: Mayzner Revisited - using a bunch of Google book Ngrams data to get more recent frequency tables for letters, digrams, and words. Fun fact: R, L, and C are more popular than they used to be. (I'm a big R fan myself!)

--

Have a good Labor Day weekend!

0 comments

link friday: giving to the poor with no strings attached, discrete logarithms probably OK
Mood: cheerful
Posted on 2013-08-23 14:04:00
Tags: links
Words: 272

- Is It Nuts to Give to the Poor Without Strings Attached? - maybe not! This reminds me of the idea of an unconditional basic income, which I think is an idea worth considering.

- Bruce Schneier says the "internet security crisis" I mentioned last week from advances made on the discrete logarithm problem is probably not such a big deal.

- Orson Scott Card Worries About Obama Turning "Urban Gangs" Into His Personal Police Force - siiiiiigh. I realize the article in question is titled "Unlikely Events", but there's a lot of crazy packed in there.

- What Snowden and Manning Don't Understand About Secrecy - sure to be controversial, but I think I mostly agree. Leaking something because there's a particular thing that the government is doing that is wrong/illegal is one thing, but leaking thousands of documents indiscriminately is quite another. (although Snowden's leak seemed closer to the first kind than Manning's)

- A good collection of findings that voter ID laws can be discriminatory. I'm not sure if they're targeting minorities specifically, but they certainly affect low-income people much more than higher-income.

- ‘Dear Dylan’: The Wonkblog advice column for everything - this is so good! (thanks Gary!)

- A harrowing first-hand account of an EVA gone wrong.

- Bill Keller says the Republicans oppose the "Common Core" educational standards for no good reason.

- Poll: Louisiana GOPers Unsure If Katrina Response Was Obama’s Fault - not from the Onion! But an excellent example of whatever the cognitive bias is where if someone is "bad" then everything they do is therefore bad, and vice versa.

- The God of ‘SNL’ Will See You Now - fun anecdotes from people auditioning for Saturday Night Live.

0 comments

link friday: pay employees more!, gamifying relationships, free co-pays are probably good
Mood: chipper
Posted on 2013-08-16 13:32:00
Tags: links
Words: 368

- Sorry, It's Not A 'Law Of Capitalism' That You Pay Your Employees As Little As Possible - a good article by Henry Blodget discussing the trend for business to maximize profits at the expense of their employees. With graphs! Lots of depressing graphs.

- When a Relationship Becomes a Game - I'm not sure how to feel about gamification of relationships. On the one hand, it sure seems wrong. But it's easy (for me, anyway) to let a relationship just kind of coast along and not put any thought into it, and this is an imperfect way of prodding one's self into doing more. (and this idea isn't new - I remember people in World of Warcraft logging off saying it was time to grind some rep with the wife...)

- When a Co-Pay Gets in the Way of Health - free markets are great, but health care is not a free market and we should stop treating it as such. The article details a case where eliminating a co-pay made more people actually take their prescribed medicine and probably saved their insurance company money overall.

- A Deeper Look at Austin Plans to Bury I-35 - this plan sounds pretty neat, although expensive. It's similar to what Boston did with the Big Dig on a much smaller scale. I've read a few articles about it so maybe it's more likely to happen than I think? (also, kudos to the headline writer - didn't see the pun until the second time around!)

- 'Less Costly Struggle and Bloodshed': The Atlantic Defends Hiroshima in 1946 - very interesting to read the perspective so close to the actual events.

- Math Advances Raise the Prospect of an Internet Security Crisis - looks like it's possible people are going to make progress on the discrete logarithm problem. (which is the basis of RSA and other encryption algorithms, although not all of them)

- When Power Goes To Your Head, It May Shut Out Your Heart - feeling powerful can suppress your mirror neurons.

- How phone batteries measure the weather - whoa, awesome! Go big data!

- Google Maps Has An Incredible Doctor Who Easter Egg - I'm pretty mad at Google this week, since they blocked Microsoft's Windows Phone YouTube app for ridiculous reasons, but this is pretty neat.

3 comments

A few pictures from my new Lumia 1020!
Mood: happy
Posted on 2013-08-15 20:54:00
Tags: pictures
Words: 58

I splurged and got a yellow Lumia 1020, and it takes great pictures! Here are a few I took around NI (click for full version)

<- in the full 34 MP version you can read the license plate on the truck! (but what I posted is a downsampled 5 MP version which still looks great!)



<- playing with manual focus

0 comments

The summer musical is over! (and pictures!)
Mood: tired
Posted on 2013-08-15 20:50:00
Tags: pictures
Words: 53

The summer musical finished its run last weekend! The show was Peter Pan, and it was very successful - over 1300 people saw the free show! I'm still recovering a bit from it - it seems to get a little more exhausting every year...

Here are a few pictures from the show:
<- click for album

0 comments

Anne Sung for HISD Trustee!
Mood: happy
Posted on 2013-08-05 17:49:00
Words: 27

I went to high school and math camp with Anne, and she's an extraordinary teacher. You can read more about Anne and contribute to her campaign here.

0 comments

a ton o' links: government moneyball, disliking Ken Cuccinelli, fake vaccinations are a bad idea
Mood: tired
Posted on 2013-08-02 11:29:00
Tags: politics links
Words: 556

(wow, this might be my longest link post ever? I think I'm less choosy about links when I'm tired...)

- Just another reminder to donate so KIPP high-schoolers can have laptops at school - they're over 50% funded now, but could use your help!

- Can Government Play Moneyball? - hey, maybe government should try to be more data-driven and only spend money on things that work! What a concept... (written by government officials who worked under Obama and George W. Bush)

- Virginia governor GOP candidate Ken Cuccinelli launches website that pushes for reinstatement of state's anti-sodomy law - he wants to make consensual oral or anal sex felonies, even between married couples in their own homes. Although he says the law would only be applied "to sodomy committed against minors, against non-consenting adults, or in public," that's not what the law says and how hard would it be to write a law that says that? (not hard at all, say 49 other states) And this guy is neck-and-neck in the Virginia governor race...

- Texas is not Pro-Life - a reminder that while Texas is "pro-life" if you mean "trying to make abortion illegal", we're not so much for "trying to make abortion rarer" or in a myriad of other ways.

- Pakistan Battles Polio, and Its People’s Mistrust - who would have predicted that having the CIA running a fake vaccination campaign (when they were trying to get Osama bin Laden's DNA) would hurt real vaccination campaigns? (hopefully everyone)

- Why Men Need Women - ignoring the somewhat provocative (and misleading) title, the study seems to show that proximity to baby girls makes men more generous.

- 'Crack baby' study ends with unexpected but clear result - I'll spoil it for you: poverty is a stronger effect on children than the mother using cocaine while pregnant.

- The Unprecedented, Contemptible GOP Quest to Sabotage Obamacare - see also this Tom Toles cartoon (thanks David!)

- The Rise of the Christian Left in America - here's hoping!

- It can be terrible to be a creative person on the Internet, as people are terribly abusive. This seems like a big problem and I'm not sure what you can do about it, other than cut yourself off from any feedback at all.

- Yet another good article by Atul Gawande about why some innovations spread faster than others

- The Huge Threat to Capitalism That Republicans Are Ignoring - the New York Times story the article talks about is a great example of a market failure. When your only metric is "how much money am I making?" (and not "how much value am I adding?" or something like that), that opens the door to abuses like exploiting weird regulations to move around aluminum for no purpose. Really, at that point, why not just counterfeit hundred dollar bills?

- In Lieu of Money, Toyota Donates Efficiency to New York Charity - very cool story. Yay efficiency!

- A good interview with Michael Sandel, who wrote "What Money Can't Buy", which I loved to death.

- Can You Name These Cities by Their Starbucks Locations? - fun but tough; I got 10 right with a few lucky guesses.

- Don’t Be Alarmed by the Drone Blimps Hovering Over D.C. They’re Here to Stop Cruise Missiles - this is a real thing?

- A helpful reminder from Wired to check your application permissions on Facebook, Twitter, etc. with handy links. I had built up a lot of cruft!

0 comments

Ridiculously worthy cause: help KIPP students learn writing skills on laptops!
Mood: hopeful
Posted on 2013-07-29 11:07:00
Words: 132

My friend Lelac Almagor is a teacher at a KIPP school in Washington, DC. If you haven't heard of KIPP (Knowledge Is Power Program), the short version is that it's a free charter school system that targets kids in traditionally underserved neighborhoods, and sets very high expectations for them. The program is tough, but they've shown that it works - kids that go through the program score higher on tests and are more likely to go to college (see more of their results/studies)

Anyway! Ms. Almagor has won a number of awards, but her high-school kids have to do research on photocopies and write their papers/essays on notebook paper. This is both inefficient and doesn't give the kids the computer skills they'll need in college and beyond.

Donate and help her kids succeed!

0 comments

Active Windows Phone developers: raffle for JBL Powerup speakers and backpacks!
Mood: cheerful
Posted on 2013-07-26 10:49:00
Tags: nokia windowsphone
Words: 152

I'm doing a quick and easy raffle for active Windows Phone developers in my region - you could win a JBL PowerUp Wireless Charging Speaker (white or cyan, your choice!) or one of three sweet DVLUP Wenger backpacks.

The rules:
- You must be an active Windows Phone developer, meaning you've published or updated an app since February 1, 2013
- You must be in my region, which includes South Texas (Houston, Austin, San Antonio - email me if you're somewhere else and I'll let you know), Louisiana, Mississippi, Tennessee, Arkansas, Missouri and Iowa.
- Deadline to enter is July 31, 6PM central time

To enter:
Send an email to ext-greg.stoll@nokia.com with the subject line "Active WP Raffle" and the following details:
- Your name
- Your email address
- Your Windows Phone publisher name
- Your city and state

That's it! Good luck!

(got an email from me about a different raffle? No worries, you're eligible for this one too!)

0 comments

link friday: sign language translator, hyperloop, why mobile web apps are slow
Mood: busy
Posted on 2013-07-19 15:40:00
Tags: links
Words: 260

- Microsoft Research worked on a project that can translate sign language with a Kinect! Although she does seem to be signing rather slowly, this is pretty impressive. Between this and using Bing Translator to point your phone at something and have it translate it, it's starting to feel like the future! (that last feature isn't unique to Bing Translator, but it is cool)

- Elon Musk (the Tesla and SpaceX guy) has been teasing a "Hyperloop" that will get you between LA and San Francisco in 30 minutes. (they're 300 miles apart, for we Texas folk :-) ) He also teased that it could be solar-powered, and here's a good article at how it might work. As it says, these are pretty bold claims, but Musk's reputation is very good, so we'll just have to wait until August to see how realistic this is...

- An epicly long post about why mobile web apps are slow - the short version is ARM is slower than x86, JavaScript is ~5x slower than native code and it doesn't look like it's going to be getting much better.

- Neat look at how much you get for 200 calories of various foods - that peanut butter looks so sad! (thanks Barbara!)

- Edit Wars Reveal The 10 Most Controversial Topics on Wikipedia - many of these are not surprising, but "List of World Wrestling Entertainment, Inc. employees" - whaaa?

- Jack Handey Is the Envy of Every Comedy Writer in America - I loved Deep Thoughts!

- Health Insurance Within Reach - an overview of the health exchanges that are scheduled to go live on October 1st.

0 comments

A few thoughts about the George Zimmerman trial
Mood: thoughtful
Posted on 2013-07-15 10:52:00
Tags: essay
Words: 157

- "Not guilty" doesn't mean "he didn't do it", it means "the prosecution couldn't prove it beyond a reasonable doubt". There really wasn't a ton of evidence at the trial, and obviously Trayvon Martin wasn't there to tell his side of the story.

- It sounds like the dominant narrative is something like: Zimmerman is wandering around the neighborhood, sees Martin who he thinks looks suspicious based on some sort of profiling (racial or otherwise), follows him and eventually confronts him. Then there's a fight and Zimmerman shoots Martin.

- While there's certainly an element of "self-defense" there, the fact that Zimmerman caused the confrontation (after being told not to by 911 dispatchers and, hopefully, common sense) makes me feel like he is somewhat culpable for Martin's death - if he hadn't confronted him, none of this would have happened. Manslaughter feels like an appropriate crime to charge him with.

I thought this was a pretty good take on the trial.

1 comment

link friday: anger at politics, penguin galaxies, Parkinson's treatment
Mood: determined
Posted on 2013-07-12 10:44:00
Tags: politics links
Words: 356

First I'm going to get angry about politics, then some more uplifting stuff:

Politics
- Lessons of the Great Recession: How the Safety Net Performed - pretty well, although there are still a lot more people on food stamps (SNAP) than before. Speaking of which:

- House Republicans Push Through Farm Bill, Without Food Stamps - the Republicans say they'll pass a food stamps bill later, but they separated them so they can more easily put in the cuts they want. I'm really pretty angry about this. Also see: Yes, You Should Be Totally Outraged By the Farm Bill (um, hooray!)

- Remember that scandal with the IRS targeting conservative groups? It turns out they also targeted liberal groups, so that should pretty much put an end to that. Honestly, I don't mind the IRS having stricter scrutiny of tax-exempt groups that are politically oriented, and I'm not thrilled with the fact that they get tax breaks to begin with. (on both sides!)

Uplifting stuff
- State-based fun! Here's the most "significant" TV show set in every state where "significant" is defined as "whatever the guy who made the map thought" (here's the readable version of the map), and here's the most famous brand from each state. (thanks, Pai, for the latter!)

- Colliding galaxies take on the shape of a penguin guarding its egg - awwww! (thanks, Jessica!)

- No Parkinson's with the flip of a switch - wow, I had no idea we could treat Parkinson's this well!

- 8-Year-Old Little Leaguer, 31-Year-Old Professional Given Same Hitting Advice - from the Onion - the headline is the joke, but I laughed :-)

- Anatomy of a pseudorandom number generator - visualising Cryptocat's buggy PRNG - funny how a simple off-by-one error can lead to such a "broken" PRNG. Crypto is hard! (although I'm not sure how much faster you could break the crypto with this error - I guess if you're guessing what random number it picked, you have more likely places to start..)

- What Does It Take to Stop Crips and Bloods From Killing Each Other? - Interesting article from the NYTimes magazine about a new approach to curbing gang violence that seems to be working.

- A few tips for sleeping better

0 comments

Windows Phone: showing images built in to your app
Mood: cheerful
Posted on 2013-07-09 22:14:00
Tags: windowsphone wpdev
Words: 224

This isn't too tricky, but for some reason I always mess it up. If you have images that you ship with your app and want to display them in XAML, here's how to do it.

The images in your app can be set in Visual Studio to Content or Resource. Generally you'll want to use Content (for performance), but I'll cover both.

In XAML:

<Image Source="images/yellow.jpg"/>

This works whether the image is Content or Resource.

In C#:
If the image is Content:
CSharpContentImage.Source =
new BitmapImage(new Uri("images/cyan.jpg", UriKind.RelativeOrAbsolute));

If the image is Resource:
CSharpResourceImage.Source =
new BitmapImage(new Uri("/ImageSources;component/images/grey.jpg", UriKind.Relative));

Note that in this case "ImageSources" is the name of the .xap file.

I've put together a small sample WP project with all four of these images.

If you want to display images in a WebBrowser control, it appears that you have to copy the images to IsolatedStorage. There is a hint that there might be a direct way to do this in WP8 but I couldn't find any more documentation on it.

--

See all my Windows Phone development posts.

I'm planning on writing more posts about Windows Phone development - what would you like to hear about? Reply here, on twitter at @gregstoll, or by email at ext-greg.stoll@nokia.com.

--

Interested in developing for Windows Phone? I'm the Nokia Developer Ambassador for Austin - drop me a line at ext-greg.stoll@nokia.com!

0 comments

Hello new Prius! (2013-)
Mood: relieved
Posted on 2013-07-06 15:07:00
Tags: pictures car
Words: 383

We bought a new Prius this morning! It is blue. See?


Yesterday we learned that the car was totaled. I had been doing some research, and I was pretty much down to either a Chevy Volt or another Prius. So we test-drove both yesterday afternoon. The Volt, while being technologically awesome and all, had a few big problems:
- The front seats were just not comfortable. It felt like there was zero padding between you and a board or something. This sounds trivial, but considering how much I drive my car it was a big minus.
- The back seats were extremely small and tight. I understand there have to be compromises given the huge battery in the car, but I felt squished at my average size. (David, being taller, had even less kind things to say about it)
- The trunk room was OK but not great.

Anyway, I just felt that we'd be spending substantially more for a car that would be less comfortable. I was hoping my next car would be a Volt, and I'm still hoping that :-)

Grades:
- Service King - A+ We had our car towed to a towing company lot, and then USAA recommended we have it towed to the Service King in Round Rock. They were extremely responsive, and both emailed and texted me to get in touch with me. They determined that it was totaled very quickly and let me know that, and we were able to come in that day and pick up our stuff.

- USAA - Incomplete, but probably A USAA, as always, has taken good care of us, and explained very clearly what was covered and what wasn't. We'll hear on Monday or Tuesday how the car-totaling process works.

- Charles Maund Toyota - B They were running a pretty good Fourth of July promotions, so I think we got an OK deal. Negotiation is not my strong suit, but at least they didn't try to hard sell us the warranty/rustproofing/all that other stuff. (we said "no" and the guy moved on) Interestingly, the woman who sold us the car said she had just moved in with her girlfriend! So we sort of bonded over that. But it's hard (impossible?) to buy a car without feeling like you're getting screwed at least a little, and today was no exception.

2 comments

Farewell sweet Prius (2004-2013)
Mood: thankful
Posted on 2013-07-05 23:59:00
Tags: car
Words: 54

So we got the news today that the Prius has been totaled. We went to pick up all the random crap we had left it in this morning. So long!

On a more serious note, we're certainly lucky that this is annoying to deal with, not financially crippling or anything. So, no more complaining!

6 comments

A few pictures from //build/
Mood: relaxed
Posted on 2013-07-04 14:37:00
Tags: pictures
Words: 39

I added a few pictures from //build/ to my gallery:
<- click here for the album!

Here are a few of my favorites:
<- the Nokia wall of phones!
<- it's Miguel de Icaza!
<- a tea bag that looks like a Pikmin!

0 comments

Karma catches up
Mood: cheerful
Posted on 2013-07-01 15:30:00
Tags: car
Words: 121

Last week was a pretty great week thanks to DOMA/Prop 8. It was also a good week for me personally - I got to go to Microsoft's //build/ conference in San Francisco, where I got to hang out with cool people (and got some free stuff!), and I got an award at work.

As I was waiting for my bags at the Austin airport I got a call from David that started with "I'm fine, but" - he had been sideswiped on his way to pick me up. (and then the other car drove off...) Thankfully he is indeed fine, and while the car isn't drivable, the damage doesn't look too bad so it probably isn't totaled. (apparently Priuses maintain their value well!)

5 comments

link friday: terrible charities, sleep is important, VR sistine chapel
Mood: chipper
Posted on 2013-06-21 14:16:00
Tags: gay links
Words: 288

Honestly, I went a little crazy with links this week. Some of these may not be any good. Try to guess which ones!

- America's Worst Charities - some truly terrible stories in there. Interestingly, GuideStar, Charity Navigator, and others are joining together to point out that a charity's overhead ratio isn't a good metric for judging it. (one non-profit's story along the same lines) It sounds like they're working on other more useful metrics...

- A reminder that not getting enough sleep is really bad for you. Also, sleep deprivation can be a real problem when you're in the hospital.

- Introducing Project Loon: Balloon-powered Internet access - this is a real thing that Google is doing! Wow. Very curious to see how this pans out.

- Are You Smart Enough to Be a Citizen? Take Our Quiz - I think knowing what all of the Supreme Court justices look like may be a bit much. I scored a 46 (without cheating!), 4 points short of earning my citizenship "with distinction".

- A cool VR "photograph" of the Sistine Chapel - very nicely done!

- America's Landlords Are Far Less Likely to Rent to Gay Couples - well, that's sad, and it was a fairly large (7000 landlords) study.

- Exodus International (the biggest "ex-gay" group) is shutting down - wow...it's not often you see a group admit that it was wrong like this. Also see an interview with the the group's president.

- The 4-Minute Workout - take that, 7-minute workout! And it's still backed up by science!

- Silver makes antibiotics thousands of times more effective - neat, although the article points out that silver can be toxic...

- The Science of Why We Don’t Believe Science - long article but I found it interesting. We (humans) are very good at lying to ourselves!

2 comments

A drive-in theater in Austin: Blue Starlite!
Mood: cheerful
Posted on 2013-06-20 10:37:00
Tags: endorsements
Words: 123

One of the things I missed about living in Maryland was going to a drive-in theater - the Bengies was close by, and although it wasn't without its faults (part 2), it was a fun time.

Last week we went to the Blue Starlite Mini Urban Drive-In, and while it was indeed on the small side, we had a great time! They play non-current but good movies - we saw Who Framed Roger Rabbit? and some classic Simpsons episodes, and it looks like there's some cool stuff coming up this summer. It's clearly a small operation and the person who took our tickets said something about spreading the word so they don't go out of business, so I'm doing my part - go check it out!

0 comments

Boston trip recap and pictures
Mood: productive
Posted on 2013-06-16 15:02:00
Tags: pictures travel
Words: 1450

<- click for full album


Monday 6/3/2013 8:30 PM
Whew - we arrived Friday but I haven't written anything until now. I do have some reasonable excuses, as you'll see...

On Friday, our flight was scheduled to get in just before midnight, but it was delayed 90 minutes. Luckily it didn't get cancelled, and our car rental place was open 24 hours (unlike some of them) so I didn't stress much. We were on JetBlue so I got to watch some international soccer (Mexico was playing!) and various old sitcoms. We arrived at 1:45 AM to a mostly deserted airport. Got our bags and our car then drove out to the hotel (at least there was no traffic!), arriving at 3 AM.

The next day we hung out with my relatives, and went to the Winchester Town Day. Saw some cool stuff and picked up a cute mariachi penguin. Unfortunately it was in the 90s and most places don't have A/C so it was pretty tiring. Afterwards, we relaxed and cooled off (including a few rounds of bocce!) and then prepared for my Grandma's 90th birthday party. A few other people came over for the party and we had a good time.


Unfortunately I started to feel sick that night - still not sure whether it was a cold or allergies or what, but it knocked me down.

Sunday we headed down to watch a Pawtucket Red Sox game. Minor league baseball is always fun to watch, and there was even a Rice alum (Anthony Rendon, who was called up to the Nationals shortly after the game!) playing for the other team (the Syracuse Chiefs). Rendon had a good game but the Paw Sox one, so hooray all around! Unfortunately after we got back to Winchester I started feeling worse so we said our goodbytes and turned in early.


This morning we drove into Boston, had breakfast, then dropped my sister at the airport. We checked out the MIT Museum which had some interesting exhibits as well as a small but nerdy gift shop - definitely recommended! The afternoon we spent wandering around Harvard Square with my remaining family, then said goodbye and back to the airport to return the rental car. Very happy to be done driving in Boston!


We then slowly made our way to our hotel in town that we'll be staying at the rest of the week. The first leg was on the Silver Line, which starts as a regular bus but then swaps over to being electric-powered. Interestingly, after that it acts like a subway (the stations look like subway stations) except there are no tracks - it just drives. I wondered why cities don't do that normally - surely buses are cheaper than trains, and then you wouldn't have to lay tracks. But I guess trains can be bigger than buses, and you don't have to steer trains...

Sadly, when I was climbing up the stairs of a subway car while carrying my suitcase I fell and banged up my knee. Aside from the embarrassment I think my knee is mostly OK although it still hurts a bit.

Made it to our hotel (the Boston Park Plaza Hotel) which was surprisingly upscale - I felt underdressed which doesn't happen often, and not because I dress well! Wandered around a bit and saw a few places with Marathon bombing memorials - it happened close to our hotel. There have also been a lot of people wearing "Boston Strong" shirts, which makes sense given that the bombing was less than two months ago.


Tuesday 6/4 6 PM
Had a nice time walking most of the Freedom Trail - lots of very old and famous sights! We bought an audio tour which was nice to have. We also stumbled across a "Panera Cares" store where all the food is donation-based. The Freedom Trail was supposed to be 2.5 miles but according to my fitbit we've already walked 7 miles today, and we even bailed a bit early. We did walk around inside a few museums (Old South Meeting House and the Old State House), but yikes. I was impressed that the museums didn't shy away from topics like slavery and free speech - it was less of a hagiography of the Founding Fathers than I expected, and kudos for that.


Tonight we're seeing the Red Sox play at Fenway!

11:30 PM
Red Sox game was a lot of fun! We walked down Yawkey Way, bought a pair of Red Sox socks, and found our seats. The game was "exciting" in the sense of "outcome never seriously being in doubt" as the Red Sox were up 8-0 by the end of the second inning. But there was a high fly ball turned into a double by the Green Monster, a homer run over the Green Monster, David Ortiz managing to hit a triple, and "Sweet Caroline". The Sox won 17-5.


Wednesday 6/5 2:30 PM
We saw the New England Aquarium today, which was fine except most of the penguins were gone due to renovations :-( Both of our feet hurt a bit so we returned to eat lunch at Pret a Manger (delicious!) and rest in the hotel.


8 PM
We hit a lot of short activities this afternoon. First up was the Mary Baker Eddy Library, which was on our list because it contains a three-story stained-glass globe that you walk into (the Mapparium) which was seriously impressive. Mary Baker Eddy (as I learned) was the founder of the Christian Scientist religion, as well as the Christian Science Monitor. The Mapparium was constructed in 1935 and they decided not to update it, so you see all sorts of fun things like "Siam" and "French Indochina". Since you're inside a sphere it's extremely acoustically live. It was awesome!

Next up was Ward's Map Store (sensing a theme?) which had a lot of reproductions of old maps. It was cool to browse around. Then we stopped by a gay bookstore before heading to the Gourmet Dumpling House - there was a 20 minute wait but the dumplings were delicious. Tonight we're relaxing and figuring out what to do on Friday.

Thursday 6/6 10:30 PM
We spent a lot of time at the Boston Museum of Science today. We were planning to come back to the hotel between that and the 4 PM Duck Tour (which left from the museum) but there was so much to see we didn't pull it off. There was a ton of cool stuff to see, even a few good math exhibits! The museum had an odd collection of exhibits: the nanotechnology one was right next to a bunch of old wooden ship models. Anyway, science!


The duck tour was a lot of fun (we "quacked" at random passersby a lot), and although we had walked by a lot of the sights already when we did the Freedom Trail, we did see some new neighborhoods including Beacon Hill, which still has gas streetlamps. Driving into the water and navigating the Charles River was pretty cool.


Afterwards we had dinner and went to see "Shear Madness", where we had a gay old time. (pun intended)

Tomorrow is our last real day here. We had considered taking the commute rrail out to Salem, but it's supposed to be cold and very rainy. I'm also feeling a bit less well than yesterday, so the plan is to just relax. We'll see if we get bored, but I doubt it as I still have plenty of books to read!

Friday 6/7 11:30 PM

It did rain (and was a little chilly although not too bad) so staying in was nice. Did a lot of reading and packed up our stuff. There was a brief moment of excitement when the fire alarm went off - we just made it down to the lobby (from the 12th floor!) before it stopped. (and we saw a fire truck driving away) I went out to an Irish pub to watch the Bruins game - sadly the satellite signal went out after the first period because of the rain. People seemed remarkably indifferent, and the Bruins won and are headed to the Stanley Cup Finals!

We have a bit of an early morning tomorrow, but nothing too terrible. It will be nice to be home!

Saturday 6/8 8 PM
Well, our first flight to Orlando was delayed, and then our second flight was as well - we actually waited on the runway for 30 minutes or so waiting for a storm to pass. But, we got to watch TV (I watched a lot of the Rice baseball game - they were ahead in the 9th but ended up losing :-( ) and were in no particular hurry so it wasn't too bad.

0 comments

link thursday: hospital prices, kickstarter space telescope, donated cars
Mood: content
Posted on 2013-06-13 16:57:00
Tags: links
Words: 333

In case you missed it, I released my HospitalPrices app for Windows Phone! There's a Robert Wood Johnson Foundation competition I might enter if I can get more data in the app.

We were on vacation last week (recap/pictures coming soon!) but I still managed to collect a bunch of quality links:

- Colonoscopies Explain Why U.S. Leads the World in Health Expenditures - more along the line of hospital pricing, procedures are more expensive here.

- A space telescope on Kickstarter! If you contribute enough you get to point the telescope at whatever you want! Awesomesauce.

- Want to Save Civilization? Get in Line - lines are cool, and paying to skip lines at theme parks makes me sad. (touches on the same themes as What Money Can't Buy, an excellent book which it's probably about time to re-read...)

- A nice longform article about the queer games scene - that "Lim" game sounds very poignant. Who was saying video games can't be art, now?

- “Warning” signs at historical sites tell visitors to relax and enjoy themselves - these are excellent!

- What Happens to Donated Cars? - the short version is, it's very lucrative for the companies that charities contract out to. It's also an overly-generous tax break. The only thing missing is much benefit for the charity! (I wonder if this explains why we hear promos the KUT vehicle donation program all the time?)

- A researcher has decoded prairie dog calls - one step closer to Darwin from seaQuest DSV!

- Barns Are Painted Red Because of the Physics of Dying Stars - fairly basic physics/cosmology, but still neat if you stop and think about it.

- How the Robots Lost: High-Frequency Trading's Rise and Fall - good news, I guess?

- Google Trends in real-time - I thought this was showing searches in real time, but I think it's just a neat visualization of Google Trends. Oh well.

- Re the NSA story: if you haven't, you should read NSA Bombshell Story Falling Apart Under Scrutiny; Key Facts Turning Out to Be Inaccurate and The Snowden Prism

0 comments

Windows Phone: HospitalPrices released, how to show 3000+ markers on a Map
Mood: happy
Posted on 2013-06-12 21:38:00
Tags: windowsphone projects wpdev
Words: 500

I just released HospitalPrices for Windows Phone. One of the more interesting parts was figuring out how to put 3000+ markers on a Map control. My first attempt was putting all the markers on the Map, but that ran out of memory. After some more tinkering, here's what I ended up with. It runs pretty smoothly on my Lumia 920 - if it needed to run faster I could have implemented a quad tree to search for markers instead of checking all 3000+ of them every time.

Want to make your own app/website? Check out the SQLite database with all the data!

Prerequisites: I'm using the Windows Phone 8 Map control - MarkerMap is the Map control, and every time the center or zoom level changes we call UpdatePins().


using Microsoft.Phone.Maps.Controls;
using System.Device.Location;

GeoCoordinate _lastUpdatedTopLeft = null;
GeoCoordinate _lastUpdatedBottomRight = null;
MapLayer _pinLayer = new MapLayer();
private void Init()
{
MarkerMap.Layers.Add(_pinLayer);
}
public bool CoordInBounds(GeoCoordinate coord,
GeoCoordinate topLeft,
GeoCoordinate bottomRight)
{
return (coord.Longitude >= topLeft.Longitude &&
coord.Longitude <= bottomRight.Longitude &&
coord.Latitude <= topLeft.Latitude &&
coord.Latitude >= bottomRight.Latitude);
}
private void UpdatePins()
{
const double ZOOM_LEVEL_THRESHOLD = 9.0;
if (MarkerMap.ZoomLevel >= ZOOM_LEVEL_THRESHOLD)
{
const int MAP_MARKER_MARGIN = 150;
GeoCoordinate neededTopLeft =
MarkerMap.ConvertViewportPointToGeoCoordinate(
new Point(-1 * MAP_MARKER_MARGIN, -1 * MAP_MARKER_MARGIN));
GeoCoordinate neededBottomRight =
MarkerMap.ConvertViewportPointToGeoCoordinate(
new Point(MarkerMap.ActualWidth + MAP_MARKER_MARGIN,
MarkerMap.ActualHeight + MAP_MARKER_MARGIN));
// See if we already have all the necessary markers
if (_lastUpdatedTopLeft != null &&
CoordInBounds(neededTopLeft, _lastUpdatedTopLeft, _lastUpdatedBottomRight) &&
CoordInBounds(neededBottomRight, _lastUpdatedTopLeft, _lastUpdatedBottomRight))
{
return;
}
var existingIdsList = _pinLayer.Select(
(overlay) => (int)(((FrameworkElement)overlay.Content).Tag));
HashSet<int> existingIds = new HashSet<int>();

foreach (var id in existingIdsList)
{
existingIds.Add(id);
}
Collection<int> indicesToRemove = new Collection<int>();
Collection<MapOverlay> overlaysToAdd = new Collection<MapOverlay>();
// TODO - this is the entire collection of markers. Each has an integer
// Id and a Latitude and Longitude, as well as a PinBrush which is the
// color of their marker.
var datas = GetHospitalBasicData();
_lastUpdatedTopLeft = MarkerMap.ConvertViewportPointToGeoCoordinate(
new Point(-2 * MAP_MARKER_MARGIN, -2 * MAP_MARKER_MARGIN));
_lastUpdatedBottomRight = MarkerMap.ConvertViewportPointToGeoCoordinate(
new Point(MarkerMap.ActualWidth + 2 * MAP_MARKER_MARGIN,
MarkerMap.ActualHeight + 2 * MAP_MARKER_MARGIN));
// Check existing markers
for (int i = 0; i < _pinLayer.Count; ++i)
{
GeoCoordinate coord = _pinLayer[i].GeoCoordinate;
if (!CoordInBounds(coord, _lastUpdatedTopLeft, _lastUpdatedBottomRight))
{
indicesToRemove.Add(i);
}
}
foreach (var data in datas)
{
if (!existingIds.Contains(data.Id))
{
GeoCoordinate coord = data.Coordinate;
if (CoordInBounds(coord, _lastUpdatedTopLeft, _lastUpdatedBottomRight))
{
MapOverlay overlay = new MapOverlay();
Ellipse e = new Ellipse()
{
Fill = data.PinBrush,
Height = 35,
Width = 35,
Stroke = new SolidColorBrush(Colors.Black),
StrokeThickness = 3,
Tag = data.Id
};
overlay.Content = e;
overlay.GeoCoordinate = coord;
overlaysToAdd.Add(overlay);
}
}
}
// Now, switch them out.
int numToReplace = Math.Min(indicesToRemove.Count, overlaysToAdd.Count);
for (int i = 0; i < numToReplace; ++i)
{
_pinLayer[indicesToRemove[i]] = overlaysToAdd[i];
}
if (indicesToRemove.Count > numToReplace)
{
int offset = 0;
// We know that indicesToRemove is sorted
for (int i = numToReplace; i < indicesToRemove.Count; ++i)
{
_pinLayer.RemoveAt(indicesToRemove[i] - offset);
offset += 1;
}
}
else if (overlaysToAdd.Count > numToReplace)
{
for (int i = numToReplace; i < overlaysToAdd.Count; ++i)
{
_pinLayer.Add(overlaysToAdd[i]);
}
}
else
{
_pinLayer.Clear();
_lastUpdatedTopLeft = null;
_lastUpdatedBottomRight = null;
_lastPinColorType = null;
}
}


--

See all my Windows Phone development posts.

I'm planning on writing more posts about Windows Phone development - what would you like to hear about? Reply here, on twitter at @gregstoll, or by email at ext-greg.stoll@nokia.com.

--

Interested in developing for Windows Phone? I'm the Nokia Developer Ambassador for Austin - drop me a line at ext-greg.stoll@nokia.com!

0 comments

Go earlier/later

This backup was done by LJBackup.