Posts

Showing posts from June, 2013

Content aplenty! Recordings from recent conferences

There's been a lot of very interesting conferences of late! Starting off with Xamarin's first-ever word wide conference, followed by TechEd and then the Norwegian Developers Conference, there are videos aplenty for the curious developer! What is that? You're hoping for a few rainy days this summer? Don't be silly ;-) Xamarin Evolve Keynote How C# Saved my Marriage, Enhanced my Career and Made Me an Inch Taller Multiplatformism: Lessons learned bringing Bastion to Six New Platforms Buttons are a Hack Cross Platform Getting the Most from Xamarin Studio , your Visual Studio-replacement for Mac! Intro to Calabash , the amazing UI automation toolkit that drives Xamarin's Test Cloud ! Writing native Mac apps in C# with Xamarin.Mac . Yes, you can! Mapping on iOS and Android . Sharing up to 80% code for iOS, Android and Windows platforms, a retail app case study . Cross-platform Barcode Scanning with ZXing . Create a uniform login experience with

Reusable test base classes

(This applies to ASP.NET MVC and MSTest and Moq) When writing tests for MVC controllers that inherit from the same base, you can save yourself some time by creating a test base class that is responsible for setup and teardown of your test cases: 1) Create an abstract class that takes your base controller class as a templated argument 2) Create a public method that initializes your tests. Adorn this with TestInitialize. 3) Create a public method that cleans up after your tests. Adorn this with TestCleanup. 4) Create an abstract method that initializes your controller. Having done this, you can focus the test cases, rather than the boilerplate in your tests, simply having to override the CreateController method (step 4 above) to initialize your particular controller, given the initialized argument passed. Example Base Class Imports SecretCompany.Web.Controllers Imports Moq Namespace ControllerTests   Public MustInherit Class ControllerTestBase(Of TController As BaseC

AngleBrackets, Curly braces and the cloud by @shanselman #devsum13

Image
Speaker deck:  http://devsum.se/wp-content/uploads/2011/05/AngleBrackets-and-Curly-Braces-2013-05.pdf What would you teach someone about web programming, if you were to start today? Sc ott  tells us a story about how he wound up talking to a distinguished older engineer at Intel who was curious about web technologies. The gentleman told Scott that, in order to fire up a virtual machine at Intel, he would have to fax someone. To get a hold of a SQL server instance, he'd have to fill out forms and call people, slowing every effort down. There's now a community depot -  V M DEPOT  - access from Windows Azure, letting you fire up a Ruby Stack Ubuntu machine on Azure right away! If you're not comfortable with managing a virtual machine (managing updates etc) though, Azure supports hosted services, such as  Azure Web Sites , which themselves sit on top of virtual machines that you never have to think about. Scott demonstrates the ease at creating a web s

LightSwitch with @melaniadanciu #devsum13

Melania starts off her presentation, setting the mood by playing  The Script's Hall of Fame  ("You can be the greatest, you can be the best … The world's gonna know your name …").  Lightswitch has had its up and down and recently got a bashing with Microsoft stopping to push Silverlight. What few knows, however, is that - first off - their Visual Studio installation comes with Lightswitch pre-installed (look in your project templates (Applies to Visual Studio 2012)), and - second off - Lightswitch now produces HTML5 output alongside its Silverlight support. Jay Schmelzer, the creator of Lightswitch, describes the product as "The easiest way to create modern line of business applications for the enterprise." It can be used for rapid prototyping too, as it quickly helps you create a three-tier solution with little-to-no custom coding, leaving your more time to discuss the final product with your client, rather than spending your time writing demos

Successful Architecture for Windows Store Apps by @johanlindfors #devsum13

Goal: Simplify development and maintenance Mission: Share code and UI Tactic: Separate UI from application logic Obstacle: Abstract platform specifics Johan started off by telling us that the hints and tips he was going to focus on for his session, were not valid for single use/campaign apps. Instead, he was going to drop some valuable tips for how to write apps apps that are intended to live for a long while. I'm very fond of Portable Class Libraries, says Johan. I try to put as much logic as possible in a shared Portable Class Library, so that I can share that across my Windows Phone and Windows 8 apps. By abstractive native implementations behind generic interfaces in my PCL, I can easily inject the specific behavior in runtime, while maintaining nice code reuse. Git works very well against TFS in the cloud, by the way. If you're using shared code via file links and there are type incompatibilities (Visibility is different between Windows Phone and Win

Step-by-step instructions of how to save form information when your user hits the browser's back button

Scenario You have a form that you use to collect information from the user. The normal use case, is for the user to fill in the form and click next for some processing. The next button posts to the Post method in your Controller. Requirement If the user starts to fill out your form but then changes its mind and hits the browser back button to change some setting on the previous screen, save the collected data. Solution - Download history.js ( jQuery-compatible direct-link (save as)) - Put it in your Scripts folder and reference it from your _Layout. - On the page that requires the save functionality, in the document-ready block, add History.pushState({ state: 1 }, "Loaded", "?loaded"); History.Adapter.bind(window, "statechange", function () {   $("form").append(' ').submit(); }); - In your controller action, add the  backCase  optional property. - If the backCase is set, save your view model and redirect your ta