Monthly Archives: November 2010

More Noborizaka Press

Noborizaka has gotten a few mentions here and there around the interwebs, making it onto a list of the top ten productivity apps on BrightHub, as well as a list of the best WP7 productivity apps on Pocket Lint.

I should really start looking into v2 of the application – mainly a few bugfixes (exp. progress bar not updating/binding properly, really long action names laid out badly in reward message) and possibly rolling in the Equipment module instead of stemming/proper stat point allocation. Fingers crossed, updating through the marketplace won’t be a hassle either – I’d like to keep it a free app, but apparently my work has to pay a fee for every free app submission past the first five. It will be a matter of finding a balance between how long I can realistically put off an update before everyone hates me, and how much content goes into each update.

Outside of work, I haven’t seen anybody else with a WP7 (not that I stop everyone I come across and ask), but it’s definitely specialer than an iPhone here in New Zealand. I can’t wait for Crackdown 2: Project Sunburst, as well as the major update slated for 2011 – not for the copy/paste, but for a fix to the marketplace bug and maps feature parity with the US region!

How To Train Your Dragon

Dreamworks has slowly but surely catching up to Pixar. While I don’t really agree with the scattershot strategy that they’re taking with the three-releases-a-year schedule, especially if it means having to put up with yet another Shrek movie, the upside with more iterations is that you’re more likely to end up with an absolute gem like “How To Train Your Dragon”. I can’t quite put my finger on the best part of the film – the gorgeous landscapes and visuals, the swath of humorous dialogue, a great score, fantastic animation, a moving tale of man and his best friend…

I think what I like most about the movie is Toothless the dragon.

Toothless is pretty much a big giant cat, with badass wings and the ability to shoot fireballs. How can you not love the cute/awesome combo?

I know it’s no Toy Story 3, but How To Train Your Dragon is definitely a movie I would love to watch over and over and over again – fingers crossed the sequel will be Toy Story 2 quality, and not The Lion King 2 quality.

Windows Phone 7 Goodness

My Price This application got a mention on Mat Velloso’s blog, which you can find here. Also listed are a bunch of other cool WP7 apps; the Today on TVNZ and Auckland Transits in particular are fantastic apps in my humble opinion, and I’ll be grabbing them when they get released to the marketplace.

I also now have my Windows Phone t-shirt which I am wearing right now, yes, right now, as well as my marketplace code, which means I’ll be able to submit apps once I get everything all set up. Watch this space for Price This to make it live :)

What’s next in terms of app ideas? Not sure, to be honest – I was going to build a Powershop meter reading application, but that turned out to be harder than expected due to constraints around WP7 not (yet) having the ability to register custom application protocols, and issues around OAuth. I should have guessed it wouldn’t have been as simple as porting the TradeMe authentication code across, but at least I tried! Maybe if nobody makes a decent timer that works while the application has been deactivated/tombstoned, I might go ahead and create one. You would think that there would be a free one by now that does so but sadly, this is not the case.

Or a T-Pain/Autotune app.

Or a TFS source control viewer.

Or a pickup line generator.

Or a chord / progression library.

Where Is A Nappies Packaging Expert When You Need One

In the supermarket today, I came across this product/packaging travesty:

Firstly, WHAT. Did nobody look at this and go “hey wait a minute this looks ridiculous, let’s just not put photos of kids with ridiiiculous face paint on our packaging”? Is it supposed to be a cat? An old woman? A robot? An old catwoman robot?!

Secondly, if you look closer (although I’m not quite sure why one would be compelled to do so instead of running immediately in the other direction), there’s a sticker that says “DC super friends”, implying that the face paint has something to do with DC, or super heroes.

That sure doesn’t look like any super hero I know.

Disabling Additional Form Validation In Sharepoint 2010

This problem cost me about four hours of my life, and lots of tedious debugging in Firebug (what I would do without Firebug in my everyday development work, I am not quite sure…)

The issue that I had was in a custom ASP.NET control hosted in Sharepoint that had a download file button. Prior to downloading a file, everything works as expected and all javascript calls proceed as per usual. However, after you click the download button and the Request (with the file contents) is sent to the browser, no subsequent javascript calls that post back to the server work.

It turns out this happens because Sharepoint is trying to validate for you – as part of a regular postback you get a full page reload, so Sharepoint does some validation to ensure the page has been reloaded after each postback to a page. However, if you’re closing the HttpRequest as part of the postback (to send a file to the user, for example), the page never gets reloaded and thus doesn’t get the updated validation information, causing Sharepoint to reject all your attempts at doing a subsequent postback.

Long story short: if you are having troubles with download controls in Sharepoint not working after being served a file, you can get around this through disabling the validation checks by specifying a property in Javascript:

[sourcecode language="javascript"]
<script type=’text/javascript’>_spSuppressFormOnSubmitWrapper=true;</script>
[/sourcecode]

Setting _spSuppressFormOnSubmitWrapper stops Sharepoint from intercepting your form submit requests and stops the behaviour mentioned above.

In most cases you would want to leave this on (preventing users from doing triple postbacks in quick succession by clicking very fast, for example), but I think it’s a reasonable tradeoff to turn off validation but allow the page to continue working after a file is served to the browser.

If you’re interested in the nitty gritty of the Javascript flow from when you click a button and when the submit event is triggered by the browser, I highly recommend stepping through using Firebug.

Child Cancer Foundation Website : Kentico Site of the Year Finalist (2010)

If you all have a spare second, me and everyone at my work would greatly appreciate votes towards the Child Cancer Foundation website, which is a finalist in this year’s Kentico Site of the Year competition. You can vote here, and check out the website itself here. I was part of the team that built it, and it’s a fantastic website for a great organisation.

Tell all your friends! While you are there as well, why not make a donation to an extremely worthy cause as well? :)

I Am Now An ASP.NET 3.5 Tech Specialist

Or, how not to design your elevators…

At work, there is a voucher floating around for five free Microsoft Exams (well, by free I mean work had already paid for the voucher and nobody was taking it). So in an act of extreme bravery and stupidity, I decided that I would use this voucher. This was about a week ago – and I just sat and passed one of the exams.

Keeping in mind that the last time I tried to finish an exam it took me just under a year because I kept postponing it until I literally couldn’t put it off any longer and had to sit it; I am pleasantly surprised that I managed to scrape through this exam with about one or two days’ worth of study. I didn’t even finish the eBook, that’s how soon the gap between booking and sitting the exam was! Ironically, I scored the lowest in the sections I was most familiar with, but the highest in sections I had never done before (such as Mobile targeting in ASP.NET 3.5).

I sat it at AMES, and the test proctor was quite possibly the nicest and oldest lady I’ve ever seen in the IT industry – great grandmother material. She was lovely though, and very helpful.

But the main thing I actually want to talk about is the elevator in the Ames building. It is quite possibly the dumbest elevator I have ever seen.

Why?

Okay. So you know how there are these things called symbols…and pretty much every elevator in my life has had the universal symbols for open and close

< | > > | <

or something similar?

The elevators in Ames have LETTERS. Yes, that’s right. Instead of up and down, it’s U and D. Instead of open and close, it’s O and C.

Seriously guys?

Sharepoint – Anonymous Access and Publishing Web Default Page

Here’s a big gotcha that I came across recently – if you’re developing a public facing Sharepoint site which will be using anonymous access, check your code for any references to PublishingWeb.DefaultPage. Because direct access to the Defaultpage / home page of a Publishing Web requires the “Browse Directories” permission which isn’t part of the Limited Access role which anonymous users get by default, unauthenticated users will come across 401 Unauthorized exceptions once they hit the code that looks for the Publishing Web’s default page.

The best way to fix this is to run code that refers to the DefaultPage using SPSecurity.RunWithElevatedPrivileges() – but here’s another gotcha! You can’t use SPContext.Current.Web within RunWithElevatedPrivileges, as it will still be running under the current user’s credentials, and not the system account that you need. Therefore, you need to reopen a reference to the SPWeb/SPSite within the RunWithElevatedPrivileges call.

Some sample code follows below…

[sourcecode language="csharp"]
SPSite site = SPContext.Current.Site;
SPWeb web = SPContext.Current.Web;

if (PublishingWeb.IsPublishingWeb(SPContext.Current.Web))
{
//reopen the web to get it under the elevated privileges – otherwise you can’t access pweb.defaultpage
SPSecurity.RunWithElevatedPrivileges(() =>
{
using (SPSite elevatedSite = new SPSite(site.ID))
{
using (SPWeb elevatedWeb = elevatedSite.OpenWeb(web.ID))
{
PublishingWeb pWeb = PublishingWeb.GetPublishingWeb(elevatedWeb);
SPItem defaultPageItem = pWeb.DefaultPage.Item;
}
}
});
}

[/sourcecode]

The Microbial Suicide Bomber

Randomly sprawling on Wikipedia recently, I came across a link to an interesting article published in the New York Times about how some salmonella bacteria deliberately go on suicide missions in order to distract the body and kill a whole lot of good bacteria also.

…about 15 percent of the salmonella go on a suicide mission, invading the intestinal walls. There, the immune system handily wipes them out. But that also sets off a wider immune response that, while attacking the salmonella within the gut, also wipes out many other micro-organisms.

With the other competing ‘good’ bacteria dead, Salmonella then has a much greater chance of thriving inside of you. Extremist Jihad – bacteria were doing it first.