About the Author

Danny is a Senior Software Engineer at InterKnowlogy in Carlsbad, CA. Danny began acquiring his expertise in software engineering at Neumont University in Salt Lake City, Utah where he graduated with a BSCS. Danny’s passion for technology has led him throughout the Microsoft Stack including .NET, C#, XAML, and F#. Danny has an expertise in NUI (The Natural User Interface) having built numerous multi-touch and gesture based interfaces for software applications across a broad spectrum of devices. Currently his passion includes building Windows Universal Apps and WPF Applications driven by gesture interaction using the Microsoft Kinect. Danny is a Microsoft MVP for Windows Platform Development and speaks all over Southern California and at devLink. When not building beautiful software, Danny is an outdoorsman and family man. He loves to camp, hike and mountain bike. Follow him on twitter @dannydwarren

SoCal Code Camp – Crawl, Walk, Talk – Windows Universal App Lifecycle and Cortana API

This year’s SoCal Code Camp at Cal State Fullerton was a blast! So many great speakers and attendees. It’s nice getting out again.

Huge thanks to the crew that came out today to my talk. It was a great having so many people there! Here is a link to my materials for my talk:

Crawl, Walk, Talk – Windows Universal App Lifecycle and Cortana API.

Hope to see everyone at the next SoCal Code Camp!

What I do When Creating a New Machine for Development

Everyone has a build that makes them happy when it comes to their development machine. I particularly love to use Bootable VHDs. They allow me extreme flexibility in size, OS, and disposability. I know that sounds funny to some, but I burn through a new dev machine almost every 6 months. Lately it’s been ever project so the ease is great. I’m not going to go in to creating Bootable VHDs in this post, but my fellow InterKnowlogist Travis Schilling has covered it in this blog post. The steps work for both Windows 7 and Windows 8. I assume they will not change for Windows 10, but I don’t know.

I’ve followed this process twice in the last 3 months so it’s pretty comprehensive of what I need and do. Please do let me know your thoughts, suggestions, alternatives, and what you do! Cheers!

My Build

Dell Precision M4800, Core i7-4800MQ, 8GB RAM

SSD Size: 500GB

  • HOST OS Partition: 25GB (Windows 8.1 with Windows ADK – No updates)
  • Data Partition: 475GB

Bootable VHDs (Live on Data Partition)

  • DEV: 150GB

Windows 8.1 Update or Higher

NOTE: “Restoration Tools” is a directory on the Data Partition (I always use the drive letter E:\) that contains installers that are required each time a new bootable vhd is created. This way the internet is not required in  order to get the machine up and running. This also significantly reduces down time caused by slow download speeds caused by some manufacturers and software providers.

Restoration Tools->Basics->M4800

  • BIOS not needed (M4800A03.exe)
  • System Tray->Dell Touchpad->Mouse
    • CHECK: Disable Touchpad & Pointstick when USB Mouse is present

Power Settings

Activate Windows

Start Full Windows Update

Control Panel\Appearance and Personalization\Display

  • Right-Click Desktop->Screen Resolution->Display (Back a level)
    • CHECK: Let me choose one scaling level for all my displays
    • ABOVE SELECT: “Smaller – 100%”

Add Printers

Disable Notifications

  • Win+I->Change PC Settings->Search and apps->
  • Search
    • Strict Search
  • Notifications
    • SWITCH “Show app notifications” to Off

Move Libraries (“C:\Users\Danny”, ALL)

  • Right-Click Library->Properties->Location (tab)
    • Input new shared directory location for library to share with other VHDs
      • (i.e. E:\Desktop)
    • Click Move
    • Accept move all Items

Taskbar and Navigation Properties

  • Right-Click Taskbar->Properties->Jump List
    • Set to 30 items

Add Toolbar to Taskbar for Recycle Bin

  • Right-Click Taskbar->Toolbars->New Toolbar
    • Select Folder with Shortcut to Recycle Bin (E:\Toolbar)

Remove Recycle Bin from Desktop

  • Right-Click Desktop->Personalize->Change Desktop Icons
    • UNCHECK: Recycle Bin

Finish Full Windows Update (Wait – Continuing before Windows is fully updated may cause instability in Windows. It’s best to fully patch Windows and then continue.)

Business Environment Install (Unless noted all apps can be found in Restoration Tools)

  • Office 2013
    • Setup Outlook and Lync
      • Outlook
        • File->Options->Reading Pane->Uncheck: Mark item as read when selection changes
    • OneNote
      • Can’t Open Hyperlinks: http://support2.microsoft.com/default.aspx?scid=kb;en-us;310049

Restoration Tools->Basics->Misc

  • 7zip
  • Notepad++
  • Cubby
  • Paint.NET
  • TreeSize (? Better app for purpose ?)
  • Chrome
    • Sign in to Chrome and all extensions
  • Camtasia
  • Snagit
  • ZoomIt
  • Skype
    • IM & SMS Settings->IM Settings-> Show Advanced Settings
      • Select: paste message as plain text
  • VLC
  • TweetDeck
  • http://baremetalsoft.com/baretail/
    • Restoration Tools->NoInstall
      • Enable Search: Pin to Start

Set Default File Type Associations

  • All associations for Notepad should be changed to Notepad++
  • Search “Default”->Default Programs->Associate a file type or protocol with a program

Pin Chrome Applications (Pandora, Wunderlist)

  • From Pandora (Pick favorite Station)
    • Click Hamburger Icon->More Tools->Create application shortcuts
      • ONLY CHECK: Taskbar

Enable IIS

  • .NET 3.5
  • .NET 4.5
  • IIS 6 Compatibility
  • Other settings as desired

Full Windows Update (Wait – Again, to prevent instability fully patch Windows at this time.)

Dev Environment Install – Do in Order (Unless noted all apps can be found in Restoration Tools)

  • SQL Server 2012 Dev Edition (MSDN)
  • Visual Studio 2010 (MSDN)
  • Visual Studio 2013 (MSDN)
    • Disable Start Page (Check box at bottom of page)
    • Perform all updates
    • Update Snippets Directory
    • Options->
      • Documents->
        • Check: Auto-load changes, if saved
      • Startup->
        • Show empty environment
        • Uncheck: Download content
      • Tabs and Windows->
        • Uncheck: Allow new files to be opened in the preview tab
    • In Debug Mode->
      • Output Window
      • Solution Explorer
      • Team Explorer
      • Changes
      • Pending changes
  • Resharper
    • Use VS Intellisense
  • Xamarin
  • Telerik
  • Beyond Compare
    • Setup VS (Optional)
  • Xaml Spy
  • Snoop
  • Kaxaml
    • Don’t use as default .xaml file opener
  • MongoDB
    • Still working to figure this one out…

Taskbar Icon Order (Enable Win + [#], ex: Win + 1 launches IE):

  1. IE
  2. Pandora
  3. Chrome
  4. File Explorer
  5. VS13 (Always in Admin Mode)
  6. SQL12
  7. Wunderlist
  8. Excel
  9. Snoop (Always in Admin Mode)

NEAdNUG: Crawl, Walk, Talk – Windows Universal App Lifecycle and Cortana API

Always more time for firsts! This was my first time giving a remote presentation! HUGE THANKS to NEAdNUG and everyone else who attended with that group or online! It’s a strange feeling to be so immersed in tech and be able to connect with people on the other side of the country.

Crawl Walk Talk – Windows Universal App Lifecycle and Cortana API

Repo: CrawlWalkTalk

It’s always a pleasure to work with such talented people across the globe. I hope my materials were found to be relevant and helpful. Feedback and Pull Requests are always welcome. Hope to see you at the next User Group!

devLink 2014: Presentation Materials

Super stoked to present at devLink this year. I’m trying to get with the times and provide my materials before hand so you can get your hands on them before you forget about them. You can find everything from my slide deck to code in my GitHub repos.

Crawl Walk Talk – Windows Phone App Lifecycle and Cortana API

Repo: CrawlWalkTalk

Master Windows 8.1 Location and Proximity Capabilities

Repo: WindowsLocationAndProximity

For those that see this before I hope you attend, and for all those that attend thank you so much for coming and please let me know what you thought of the presentation and materials. I’m always trying to improve. For those that find these materials after the presentation please check them out and let me know if I can answer any questions you may have!

Presentation: Crawl Walk Talk – App Lifecycle and Voice API for Windows Phone

Talk about technical difficulties! Major props to the vNext crew for sticking through my crazy tech issues. For those of you who couldn’t make it VS wouldn’t open any files. It would load the project, but if I tried to open a .xaml file VS crashed. I had installed VS 2013 Update 2 the night before thinking it would fix a code issue for me. Instead it created a nightmare! And then Cortana and I got into a fight. A little reboot fixed her right up. Overall I had fun despite the difficulties. Thanks again to all who attended!


I’m starting a new practice with this presentation. I’m using GitHub to host ALL of my materials: Code and Deck! I hope that works out better than having to download .zip files. Plus this way you can submit Pull Requests for bugs you see during my presentations. 😉 But seriously, I hope it makes it easier for you to access and for me to update! See link below:

Review: Dave Fancher’s “The Book of F#”

This book is fantastic! I had little F# experience going into this book and found the basics of the language easy to understand and fun to read. Dave does an excellent job explaining F# from syntax, types, and its functional nature all the way through complex topics like quoted expressions and asynchronous programming. The occasional Dr. Who reference is sure to catch the eye in his exciting code samples. As a C# developer I really appreciated Dave’s chapter that focused on comparing F#’s APIs to C#’s. I feel confident in adding F# to any of my pre-existing C# projects right away. One thing that I found very intriguing was Dave’s focus on using F# for regular application development not just math! F# is not just a niche language for the scientific world, but is a way to help develop extremely testable and reliable code in everyday applications.

I highly recommend Dave Fancher’s “The Book of F#” to every .NET developer. Even if the developer does not adopt F# the lessons taught by the language are invaluable and will make them a better .NET developer in whichever language they use.

DVLUP Day San Diego – Intro to WinPhone Dev and App Studio Materials

Thank you so much to those who attended my session today! It was awesome. All of my materials were websites and Visual Studio project templates. You can find them here:

We also learned about Windows Phone AppStudio.

If you have any questions feel free to contact me! You can find me on twitter: @dannydwarren or here in comments.

Presentation: Introduction to Windows 8.1 App Development

A huge thanks to the crowd at the San Diego .NET Developers Group! You guys were an awesome crowd. Congrats on the 20 year anniversary of the group as well. It’s great to know we have a deep culture of helping and teaching each other in the area. Keep it up!

For those that couldn’t make it we discussed how to handle Page Navigation and App Lifecycle for the first hour then moved into Location Services for the last 30min. Theses are some critical topics for Windows 8.1 App Development that I think a lot of people could use some help with. I only say that because many apps I use behave badly. I hope you find the recording of the session useful. Please leave some comments on what you think!



Again, thanks a bunch! And we’ll catch you next time!

Send Your Automated Build via Hightail (Formerly YouSendIt)

Here at InterKnowlogy we are always looking for ways to optimize our business. We’ve been using automated builds for sometime now. They are seriously one of the best things since sliced bread! Who doesn’t love to see a giant green checkmark stating their check-in succeeded. Or yelling names down the hallway when someone else causes a huge red ‘X’ to show up due to a failed check-in. As long as those names are aimed at you that is… We’ve been struggling with one problem lately with our release builds. If we have someone working offsite and they need to get the build after it completes they have to VPN into our network, go to the build directory, and copy the deliverable to their local machine. We do a lot of really cool graphically intense applications, which can mean large deliverables. This then turns into a really long difficult process to get a single deliverable. After a lot of discussions we come up with a really cool idea to use Hightail.

Hightail (Formerly YouSendIt)

We use Hightail for sending and receiving large files as I’m sure many of you do. We love the feature allowing us to specify an expiration date on a file so it will no longer take up space on our account. I did a lot of research on DropBox, Box, SkyDrive, and a few other options and each had pros and cons. In the end, Hightail was superior. It supports expiration dates, emails, and an easy API.


We created a REST service that lives on our build server named the BuildSendService. This service is responsible for accepting a file path, expiration date, and details for sending the email with a link to the file. Information received is immediately added to a queue and which is then processed asynchronously. This allows the caller of the service to continue on to do more work instead of waiting for the file to be hightailed. The service asynchronously processes each item in the queue using the Hightail API, which is brain dead simple! It’s really great! Hightail takes care of the email for us once the file is uploaded. Recipients can then quickly download the file from their inbox! AWESOME!

SendBuild Custom Build Action

In order to leverage the BuildSendService most efficiently we built a Custom Build Action named SendBuild. In our Build Process Template, after the build has completed all other tasks and the final deliverable is ready for use in the final build directory, the SendBuild action contacts the BuildSendService to hightail the build to all desired recipients. It is not a mandatory action and is ignored if no recipients are specified. We wanted this action to be as fast as possible. That is why the BuildSendService accepts the parameters and queues the information immediately. This frees up our build server to process the next request immediately instead of waiting for a large deliverable to be uploaded to Hightail.


While this process is still new to us here at InterKnowlogy it is showing promise. Overtime, I’m sure we’ll tweak the current implementation to make it better and help use run more effectively and efficiently. Also, Hightail is just awesome! They have been super helpful answering all of our questions and pointing me in the right direction for development. They have a .NET sample application, which as far as I can tell implements each of their APIs. That was the best source of information. Their documentation is mostly good, but could use some extra explanations. If you want to do something similar for your build process let me know. I’m happy to help where I can.

C# to F#: I’m a Convert

In my previous blog post C# to F#: My Initial Experience and Reflections I wrote about learning F# and converting a C# formula model into an F# formula model. As of writing my previous post the jury was still out on performance. I am very happy to say that I have some very quantifiable results and I’m ecstatic to announce that F# took C# to school!

Formula Model

The formula model we created can be found here. The structure is essentially: Model contains many Leagues. A League contains many Divisions. A Division contains many Teams. A Team plays at every Stadium thus creating many StadiumTeamData objects. Each Stadium contains details. In the excel file you’ll find 2 Team sheets, a LeagueSummary sheet, a Stadiums sheet, and a Stadium Schedules sheet. The Stadium Schedules sheet contains the schedule for each Stadium found in the Stadiums sheet which is only a list of Stadiums and their details. Each Team sheet contains StadiumTeamData (a row of data) which is the lowest form of calculation in this model. The LeagueSummary sheet sums the 2 Team sheets and calculates 10 years of data which can be used to create a chart. Our sample apps do not chart as our test was not about prettiness, but rather about performance. The excel model is a very simple model. It was used only to prove the calculations were being performed correctly. In the source code included at the end of this article you will notice the existence of 2 data providers: MatchesModelNoMathDataProvider and PerformanceTestNoMathDataProvider. The matches model provider matches the excel scenario with 1 League, 1 Division, and 2 Teams and 2 Stadiums and a single mandatory Theoretical Stadium. The Los Angelos Stadium is ignored in code. The performance model however has 2 Leagues. Each League has 9 Divisions. Each Division has 10 Teams. Each Team references 68 Stadiums. There is also a single mandatory Theoretical Stadium. This gives a grand total of 12,240 StadiumTeamData instances. These instances represent the bulk of the formula work and in the case of PDFx the bulk of property dependency registrations.


C# and PDFx

The first implementation we created was in C# and uses the PDFx (Property Dependency Framework). This implementation represents the pattern we have used for the last year for client implementations. Due to familiarity this implementation took about 16-24 hours to implement. Which is pretty fast. This is why we really like the PDFx. It helps to simplify implementation in C#. Because PDFx is a pull based approach no custom events are required. The PropertyChanged even triggers everything under the hood for the PDFx. There is a catch though. This means that each property in a chain of dependent properties will raise the PropertyChanged event. In our example of 12,240 StadiumTeamData instances this means that PropertyChanged is called roughly 500,000 times just on the first calculation of top level data. With all of the properties in existence properties are accessed 2,487,431 times and of those 1,176,126 are doing work to setup the required property dependency registrations. So at the end of the day the C# with PDFx implementation takes about 55 seconds to load the object model and another 24 seconds to run the first calculation for a grand total of 79 seconds to load the application. Another really bummer part of PDFx and that it’s currently not thread safe so it must run on the UI thread which means that for about 1:20 the application looks like it’s not doing anything. Very bad, very very bad! On top of that each time we change a value via slider on a single StadiumTeamData it takes about 6 seconds to finish calculating. Again blocking the UI thread. A very important detail to note is that when a single StadiumTeamData has an input value change only objects that depend on that StadiumTeamData and objects that depend on those object etc. are recalulated. This means that out of 12,240 StadiumTeamData instances only 1 is being recalculated and only 1 team, 1 division, 1 league, and the top level values of the formula model are being recalculated. We have been trying to improve PDFx performance for some time now, and we have a few more tricks up our sleeves, but most of the tricks are around load time not calculation time.


After listening to a ton of .NET Rocks recently I’ve learned a lot about F#. I was so intrigued that I set out to create an F# implementation of the same formula model we created in C# and PDFx. The implementation took about 32 hours, but that’s also with a ton of research. By the end I think I could have written the entire thing in less than 16 hours which would be less time than the C# and PDFx implementation. I learned that functional programming lends itself to parallelization more than object oriented programming. Due to the fact that functional programming encourages an approach of not modifying values because everything is immutable by default the F# implementation can be run on a background thread as well. The cool part about all of this is the theory that many sub calculations can be run at the same time then aggregate the output to run a final answer calculation. Our current formula model is perfect for this approach. Because we no longer have a dependency on the PDFx to know when a property changes the PropertyChanged event is only raised once to trigger all calculations and is then only triggered once for each property that is updated by the output of the calculations so the UI will be able to respond. The object model takes a bit more than 1 second to load and the first calculation is done in another 2.5 seconds. The total load time is about 3.5 seconds. Compared to 79 seconds that’s 95% faster in F# just for load. Each subsequent calculation when a value changes via slider on a StadiumTeamData takes about 1.2 seconds. Compared to 6 seconds F# is about 80% faster for each calculation. Unlike the C# and PDFx implementation I have not optimized the F# formula model to only calculate the object tree that changed, instead all 12,240 StadiumTeamData instances are being recalculated each time and value changes in the entire object model. So we could still become more performant by only calculating the single StadiumTeamData that changed and the related team, division, league, and then the top level values of the formula model.


A complete breakdown of my comparisons can be found in this excel file. I wanted to call out a few very important results in this post to wrap things up.


I used to think that C# and PDFx was very readable. And while it is for very simple models it can get unwieldy. F# however is the clear winner here. I reduced lines of code by the hundreds. I can see one entire formula in one file which is compact enough to fit on my screen at one time, versus C# and PDFx which takes up multiple files due to multiple classes, and it requires me to do a lot of scolling due to the amount of lines a single property takes up. This seriously increases maintainability.


When it comes to performance C# and PDFx were blown out of the water. Application load time was improved by 95% and calculation time was improved 80%. This is serious business here!

Time to Implement

This is a slightly skewed comparison due to experience. I was impressed by the fact that C# and PDFx took 16-24 hours and F#, a brand new language, took only 32 hours. I am convinced that I can write F# faster than C# using PDFx on future projects.

Next Steps

I will be diligently searching for opportunities to use F# in production client code. It is a no brainer to me. I agree with the statement from many of .NET Rocks podcast guests talking about F# and functional programming, “Every software engineer should learn F#!” It just makes sense!


Source Code: Formula Implementation Proving Ground

C# and PDFx Executable

F# Executable

Formula Excel Workbook

F# vs. C# Comparison Excel File