• Skritter: Day 86

    At at average of only 6 minutes study per day, in 86 days I've gone from 0 to 500 Chinese words learnt! Super exciting and still can't wait for the iOS app. I thought I was a big hotshot and tried to read from a tv magazine though, and that was maybe 20% successful - I guess it's still a long road to go! [508 words learned | Retention - 94.2%] more

  • Pro-Tip: Azure RDP User Setup Gotcha

    The within-Visual Studio Azure tooling support has really improved since I used Azure properly about a year and a half ago - you can get away with not accessing the web portal for a lot of things. However, there's just one gotcha with the automatic RDP user configuration that tripped me up today: If you use a username longer than 20 characters, you won't be able to RDP with those settings. … more

  • Cross Process Threading, Synchronization, EventWaitHandles and Mutexes

    As a programmer who normally does websites and non-complicated things, I've been working on a cool / crazy / complex solution which involves multiple processes and a lot of moving parts. So I thought I'd share some of the gotchas that I came across while trying to do two things: 1) Cross Process Thread Signaling If you need a thread to pause until another thread (on another process) has … more

  • Pop Quiz: What's wrong with this code? (And Debugging XAML Parse Exception)

    I wrote the following code today, and it didn't work. private void InitializeMigrationCheck() { if (migrationCheck == null) { migrationCheck = new Timer(); migrationCheck.Interval = (int)TimeSpan.FromMinutes(1).Milliseconds; migrationCheck.Tick += new EventHandler(migrationCheck_Tick); migrationCheck.Start(); } } Spotted the mistake yet? Yup - (int) … more

  • Skritter: Day 72

    Slow going - I'm looking forward to hitting the 500 word mark! But the more I learn, the more I can guess, really. The word for throat is pretty cute. 喉嚨 In Chinese, if you remember, radicals have two main functions in words, pronounciation or meaning. A rule of thumb (though by no means a fast rule) is that the mouth radical on the left of any word denotes onomatopoeia, or phonetic sounds - … more

  • WP7 To Windows 8 / WinRT: The Equivalent Of WebBrowserTask

    A brief but quick tip for any Windows Phone developers out there moving/porting some applications across to Windows 8 / Metro Apps / WinRT; if you need to open a link in a browser, we don't have WebBrowserTasks any more: instead, you're using the Windows.System.Launcher namespace. Here's an example: Launcher.LaunchUriAsync(new Uri("http://www.trademe.co.nz/", UriKind.Absolute)); Note that this … more

  • Getting The Current Active User in C#

    Had an issue recently where I was trying to retrieve the Environment.SpecialFolder.LocalApplicationData for the current user from a Windows Service running under the SYSTEM account. Without any impersonation, SpecialFolder.LocalApplicationData returns an invisible folder / place somewhere within C:\Windows\ which wasn't really what I wanted - I wanted the local app data folder that the currently … more

  • How to fix "KB2669191 does not apply" error when upgrading to WP7 SDK 7.1.1

    While trying to upgrade to the latest drop of the WP7 SDK (which includes the "Tango" emulator), I was shown an error stating that KB2669191 didn't apply to me. It turns out that I was running the 7.1 RC SDK, but needed the 7.1 RTW SDK - you'll need to uninstall the RC, reinstall the RTW then attempt to install the KB patch to get to 7.1.1. Will be great to check all my apps against the 256MB … more

  • Inter-Process Communication With NamedPipes

    Doing heaps of new and exciting (to me, anyway) business at work and needed to get a Windows Service and a WPF app to talk to each other, and have the service be able to initiate commands on the WPF app. I messed around with WCF named pipes for a bit trying to get this to work, but was having a bit of a brain fail, so gave up on that approach (if you've done Service <- Process/WPF app … more

  • Skritter: Day 60

    Okay, so this isn't really related to Skritter, per se. But this is apparently the most complex character still in contemporary usage to write. And it's for a type of noodle - go figure. [418 words learned | Retention - 92.6%] more

  • Pro-Tip: Stopping InfoPath Text Fields From Formatting Numbers With Commas

    Here's another quirky bug + fix for InfoPath 2010; when developing a form, if you create a field as a number field and switch the type to a text field, you'll find that if you enter a pure number (no spaces) into the field, InfoPath will reformat it for you and add numbers in (so, 12345 - 12,345). In the Designer, there aren't any options to change the formatting of the string, so the only way to … more

  • WebBrowserControl and WebBrowserTask not matching?

    Was debugging a very interesting issue today - had an app that was loading a website, that was working on a Nokia Lumia 710 (aside - which looks and feels a lot better in the hand than it does in pictures; its not as plasticy or budget as I imagined) but not displaying correctly on a Lumia 800. However, if the website was loaded directly, either using a WebBrowserTask or just in IE itself, it … more

  • Build Apps. Don't Stop.

    So, there have been quite a few "build an app, win x" competitions around Windows Phone recently. And while, yes, probably one of the driving factors behind this is so that Microsoft can tout amazing marketplace growth numbers, there is quite an interesting yet obvious side effect of this - I am getting better at developing WP7 apps. Or by better, I just mean, I know more - every single one I've … more

  • ProTip: Running Rules Off People Picker / Contact Selector Control In Infopath 2010

    For some strange and annoying reason, the rules boxes are disabled by default on the fields for People Pickers (AccountId, DisplayName and AccountType). So if you want to write some rules to, say, update parts of your form based on the person selected, you can't do this directly - instead, you need to create a new text field and set the default value to the AccountId field, and for it to … more

  • Sharepoint 2010 Tip: Exception When Editing Pages - MediaWebPart and NullReference

    Had a confusing bug in a stage environment today where you could create pages (such as the inbuilt Article Page), but when you went to edit them it would through an exception: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.Publishing.WebControls.MediaWebPart.get_WebPartAdderId() at Microsoft.SharePoint.Publishing.WebControls. … more

  • Windows Phone Dev: Multiple DataTemplates In One ListBox

    I've been putting the finishing touches on Wuxie, and one of the elements I needed was an Achievements list, with a different display for locked and unlocked achievements. While I could have written a whole bunch of converters to detect the appropriate settings, etc; a much cleaner way I came across was to implement a DataTemplateSelector, which essentially serves different Data Templates … more

  • Pro-Tip: Including Background Music For Your Windows Phone App

    Alright! So I've finally cracked how to set up background music playing consistently in the background for a Windows Phone app. Here's a step by step lowdown: 1) Play background music with MediaElement. So we're going to hold a MediaElement object at the Application Level, so our music keeps playing while you transition between pages. Note the MediaEnded event, which we'll come to later. In … more

  • Skritter: Day 41

    The word for late/slow is awesome: 遲, which is 辶 (walk) + 犀 (rhinocerous), which is then in turn 尸 (Corpse) + 氺 (Water) + 牛 (cow). Does it make any sense? Only a little. Is it hilariously awesome? Yes. [319 characters | 136 words] more

  • Sterling DB vs SQL CE in Windows Phone Development

    Just a quick note for everyone weighing up between Sterling DB and SQL CE for your Windows Phone app - while Sterling DB is fantastic for small sets of data, it performs very, very poorly with bulk inserts / restore (a few minutes when we hit the hundreds of rows mark), which makes it unsuitable for any large tables. The SQL CE support in Mango, while slightly slower on queries, is much more … more

  • Pro-Tip: Infopath 2010 and mysteriously duplicating Promoted Fields

    For all it's power, InfoPath sure does have some massive annoying bugs. Today I was working with some InfoPath forms, and was afflicted by the "duplicate promoted fields / properties" issue, which seems to want to randomly occur when you add / modify new promoted fields. In essence, instead of reusing the promoted properties it's already created for use on your SharePoint site, InfoPath decides … more