February 13, 2008

Wii remote sensor problem & tech support Fonzie fix

We recently had one of our Wii remotes go bad - the problem first appeared while playing Wii bowling. The second remote worked fine until it came to releasing the ball - it never did, it now just always threw the ball backward no matter what. After checking all the usual suspects, batteries, sensor bar flush w/TV, etc... I called into Wii tech support (1-800-255-3700). The call dropped twice, but finally, the tech support person told me to:

a) Hold the Wii remote upside-down with one hand so all the buttons are facing the floor.

b) Smack the end of the remote with the power button from underneath with the other hand.

Now it works fine.

Share |

February 06, 2008

Adding a unique digg button per post using Blogger

Adding a digg button to your blog on blogspot is easy, and users can digg the blog, or even digg an individual post, provided they were drilled into a specific post. But what if you want your readers to digg any specific post from your main page? If you have a following, that's probably where they'll read it from, and a digg button on your main page will only take them to digging the blog in general. Basically, you'll want to have a button inside each posting with a digg_url that is specific to that post.

Here's a way I found to get it to work:

Go to your blog's admin page and select the Template tab
Select Edit HTML
Make sure "Expand Widget Templates" is checked
Look for the <div class="post-footer"> div tag
Inside that tag, add your digg button code
For the digg_url value us e <data:post.url/>(This template variable holds the actual url of each individual post)
Note: The code window will encode the quotes.

Here's some sample button code and more digg integration info if you need it.

...Of course if you use it, you have to digg me :)

<!-- digg button with post-specific url added - Dan Shultz -->
<script type='text/javascript'>digg_url = '<data:post.url/>'; digg_title = '<data:post.title/>'; digg_bodytext = ''; digg_skin = 'compact'; digg_window = 'new'; digg_media = 'image'; digg_topic = 'comics_animation';
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
<!-- end digg button code -->

Share |

February 01, 2008

XMLSerialization & null/empty elements

I recently ran into an issue where an application was serializing a .NET object and returning the XML, but not returning elements where the properties were null. The consuming client expected every element in the schema to be returned, so we needed to come up with the best way to generate XML containing all elements & nodes regardless of whether they contained data.

The first solution was to simply decorate the property with

[XmlElement(IsNullable=true)]

which makes sure the element is always generated. The resulting xml element contains the attribute xsi:nil="true" when it is null. That works just fine, but an even simpler solution is just to initialize the private variable behind the property to string.empty. That ensures that the property was always at least an empty string, rather than null. To the XmlSerializer, empty string means generate element. But if you require that the resulting XML has to include all properties, even true nulls, then decorating potentially null properties with the XmlElement IsNullable Attribute is the way to go.

Share |