.NET Developers Blog An aggregated blog of .NET developers. Bookmark and Share

Welcome to the .NET Developers Blog

This is an aggregated blog of .NET developers.

If you have a blog about Microsoft, .NET, XAML, WPF, Silverlight, etc... development add your blog here. Email me for any suggestions and feedback.

Minh T. Nguyen

Syndication & Stats

Blogs - 444
OPML (list of bloggers)
RSS (list of posts)



Bloggers

#Fellows
   (1/16/2012)
.NET User Group Frankonia
   (10/20/2008)
A Henry P. Erich III
   (7/21/2008)
Aaron Junod
   (7/21/2008)
Adam Beal
   (8/12/2006)
Adam Kinney
   (1/7/2012)
Adam Kinney
   (2/16/2007)
Adam Weigert
   (1/7/2012)
Adolfo Marinucci
   ()
Adrian Florea
   (6/28/2011)
Adron Hall
   (9/12/2008)
Adron Hall
   (2/3/2012)
Adwait Ullal
   (7/2/2005)
aharvey
   (10/27/2009)
Akshay Luther
   (3/6/2005)
Alex Campbell
   (6/28/2011)
Alexander Zeitler
   (5/19/2007)
Alexandre Gomes
   (10/20/2011)
altaf Hussain
   (12/22/2011)
ALTERthought
   (4/13/2010)
Amanda
   (10/29/2010)
Anand M.
   (3/26/2005)
Anand Patel
   (1/29/2012)
André Obelink
   (4/6/2008)
Andrea Saltarello
   (10/6/2011)
Andrei Hetel
   (7/25/2011)
Andrej Budja
   (3/26/2005)
Andres Aguiar
   (9/21/2011)
Andrew Whitten
   (8/21/2007)
Andy Smith
   (11/16/2006)
Angry Hacker
   (9/24/2011)
Anjana Ram
   (6/28/2011)
Anna
   (8/27/2009)
Armand du Plessis
   (7/21/2008)
arshly
   (3/14/2010)
Ashraful Alam
   (4/10/2009)
Ashvil
   (8/9/2005)
Avner Kashtan
   (10/6/2011)
Axinom
   (12/1/2010)
Barb Bowman
   (3/26/2005)
Bartek
   (1/30/2012)
BCS
   (8/29/2009)
Ben Hall
   ()
Ben S. Stahlhood II
   (1/3/2009)
Bertrand
   (10/19/2006)
Bil Simser
   (1/29/2012)
Bill Christenson
   (12/10/2011)
Bill Evjen
   (1/15/2012)
Bill Evjen
   (11/25/2007)
Bill Wagner
   (12/12/2008)
Bob Swart (aka Dr.Bob)
   (11/14/2011)
Bojan Resnik
   (6/28/2011)
Brendan Tompkins
   (5/29/2005)
Brian Button
   (8/24/2009)
Brian Desmond
   (11/16/2006)
Brian Nantz
   (10/25/2005)
Brian Nantz
   (10/6/2005)
Brian Scott
   (6/28/2011)
Bruno Rodrigues
   (11/30/2011)
Bryan Reynolds
   (6/28/2011)
Bryant Likes
   (1/18/2010)
ByteMyCode CSharp
   (3/23/2010)
ByteMyCode VB.NET
   (6/28/2011)
Carl Franklin
   (5/21/2006)
Carsten Unterberg
   ()
Chris Hammond
   (1/25/2012)
Chris Hammond
   (1/22/2012)
Chris McKenzie
   (9/12/2006)
Chris Stewart
   (6/28/2011)
Chris Thomson
   (6/16/2011)
Chris Woodill
   (4/6/2011)
Christian Engel
   (2/15/2009)
Christian Nagel
   (5/21/2006)
Christian Weyer
   (6/28/2011)
Christoph Wille
   (6/28/2011)
Christophe Lauer
   (6/5/2006)
Christophe Menet
   (3/19/2009)
Christopher Frazier
   (5/25/2007)
cialis
   ()
cialis
   ()
Claudio Perrone
   (10/10/2006)
Clint Caraway
   (7/19/2007)
Clinton Ruivivar
   (11/23/2006)
CoderPaws
   (6/28/2011)
Colt Kwong
   (12/17/2011)
Courtois Sébastien
   (1/31/2012)
Craig Nicholson
   (12/4/2008)
Craig Roffers
   (7/28/2008)
Damian Barrow
   (5/21/2006)
Damir Tomicic
   (6/28/2011)
Damir Tomicic on Architecture
   (6/28/2011)
Dan Bright
   (5/21/2006)
Dani Meier
   (12/1/2007)
Daniel Cazzulino
   (1/22/2012)
Daniel Jin
   ()
Daniel Zeiß
   (4/14/2008)
Darrell Norton
   (7/1/2005)
Darren Neimke
   (5/21/2006)
Dave Balzer
   (5/13/2008)
Dave Bettin
   (5/23/2005)
Dave Burke
   (6/28/2011)
Dave Donaldson
   (9/6/2006)
Dave Konopka
   (12/23/2009)
David Brabant
   (1/22/2009)
David Cumps
   (6/28/2011)
David Douglass
   (7/4/2010)
David Godwin
   (8/17/2007)
David Peterson
   (6/28/2011)
David Truxall
   (1/9/2009)
Dboy Smith
   (6/30/2005)
Derek Hatchard
   (1/3/2009)
Devdutt Patnaik
   (1/3/2009)
devel.oping.net
   (4/24/2006)
DevPinoy.Org
   (6/9/2010)
Dinis Cruz
   (1/10/2012)
Dion Hinchcliffe
   (6/28/2011)
DnnCart.com
   (11/7/2005)
DnnCart.com
   (8/25/2005)
dodned.de (Damir Tomicic)
   (10/20/2008)
Don Browning
   (6/28/2011)
Donald Hughes
   (3/29/2010)
DonXML
   (3/26/2005)
DonXML Demsak
   (5/22/2006)
Doug King
   (11/16/2006)
Doug Seven
   (3/30/2006)
Douglas Reilly
   (6/17/2006)
Duane Laflotte
   (1/27/2007)
Dusty Davidson
   (6/28/2011)
Edgar Sánchez
   (6/28/2011)
eglasius
   ()
Elliott Nash
   (6/28/2011)
Emerging Technologies Group
   (8/21/2005)
Entrance Software
   ()
Erik Porter
   (2/16/2009)
Ernst Kuschke
   (2/21/2009)
Eugene K
   (7/28/2011)
Fabrice Marguerie
   (11/26/2011)
Famil Jones
   (1/3/2009)
Felice Pollano
   (1/23/2012)
fengzhimei
   (12/17/2011)
Fergal Reilly
   ()
Fons Sonnemans
   (6/12/2011)
Forest Blog
   (2/6/2009)
Francois Camus
   (6/15/2011)
Frank Hileman
   (7/27/2010)
Frans Bouma
   (1/20/2012)
Fredrick J Sahaya
   (6/28/2011)
Freek Leemhuis
   (10/20/2011)
G. Gnana Arun Ganesh
   ()
Gareth
   (1/4/2011)
Gaston Milano
   (6/28/2011)
Gavin Donoho
   (8/27/2006)
Gavin Stevens
   (4/26/2004)
Giorgio Sardo
   (6/28/2011)
gojko
   (1/31/2012)
Grant Killian
   (6/11/2005)
Greg Hurlman
   (3/23/2007)
Greg Robinson
   (3/12/2011)
Greg Shackles
   (12/31/2011)
hammett
   (2/2/2006)
hannan
   (2/21/2010)
Hannes Preishuber
   (6/28/2011)
Hernan Garcia
   (7/8/2010)
Hieu Pham
   (3/21/2009)
Holly Styles
   (12/9/2011)
Huang
   (4/20/2011)
Huw Collingbourne
   (1/24/2012)
Igor Milovanovic
   (9/14/2004)
Igor Milovanović
   (6/28/2011)
Issam Elbaytam
   (1/3/2009)
Iwan Taljaard
   (1/30/2005)
J. Ambrose Little
   (5/21/2006)
J. Frank Carr
   ()
James Avery
   (9/18/2009)
James Steele
   (10/22/2009)
Jan Tielens
   (12/12/2011)
Jan-Cornelius Molnar
   (4/14/2007)
Janiv Ratson
   (5/25/2010)
Jason Alexander
   (1/3/2009)
Jason Gorham
   (1/7/2007)
Jason Haley
   (7/7/2005)
Jason Nadal
   (1/3/2009)
Jason Nadal
   (11/22/2011)
Jason Olson
   (12/19/2009)
Jason Row
   (6/4/2009)
Jason Salas
   (5/21/2006)
Jason Stangroome
   (4/28/2007)
Jason Stangroome
   (4/22/2010)
Jay Janarthanan
   (1/9/2012)
Jay Kimble
   (7/6/2005)
jaypm
   (9/14/2011)
Jeff Julian
   (1/19/2012)
Jeff Key
   (6/28/2011)
Jeff Perrin
   (4/21/2007)
Jeff Putz
   (2/3/2012)
Jeroen van den Bos
   (8/2/2007)
Jerry Coder
   (6/28/2011)
Jerry Dixon
   (6/22/2005)
Jesse Ezell
   (6/28/2011)
JetBrains, Inc.
   (1/24/2012)
Jim Cheseborough
   (8/22/2006)
Jim Martin
   (5/10/2005)
Joe Kunk
   (1/9/2012)
Joe Sroczynski
   (1/26/2009)
Joel Jeffery
   (2/3/2012)
Johan Danforth
   (9/8/2011)
Johan Perez
   (9/13/2010)
John Papa
   (5/22/2008)
John Qin
   (6/30/2005)
John Sheehan
   (2/3/2012)
John Tobler
   (4/15/2011)
Jon Galloway
   (1/28/2012)
Jon Yates
   (11/13/2009)
Jonathan McCracken
   ()
Jørn Aakre
   (2/22/2007)
Jose Lamas Rios
   (2/21/2007)
Joseph Cooney
   (3/29/2005)
Josh Evitt
   (11/16/2005)
Josh van Eikeren
   (4/8/2009)
Joydip Kanjilal
   (1/30/2012)
Juozas
   (11/30/2010)
Justin Rogers
   (11/13/2009)
Juval Lowy
   (2/16/2007)
K. Scott allen
   (11/30/2011)
Kalyan Bandarupalli
   (1/17/2012)
Kathy Nguyen
   (6/28/2011)
Keith A. Barrows
   (3/25/2011)
Keith Oliver Rull
   (5/18/2005)
Keith Oliver Rull
   (6/9/2010)
Ken Brubaker
   (7/25/2008)
Kent Tegels
   (2/14/2007)
Kevin Blakeley
   (7/6/2005)
Kevin Daly
   (1/3/2009)
Kevin Harder
   (12/23/2007)
Kevin Potgieter
   (8/21/2005)
Kiran
   ()
Kiruthik Nandha Kumar
   (10/21/2010)
Klaus Aschenbrenner
   (4/12/2006)
Kouroushi Bros Ltd
   (10/17/2011)
Krishna Kumar
   (7/6/2005)
Kyle Hebb
   (1/3/2009)
Laimonas Simutis
   (2/4/2005)
Laimonas Simutis
   (2/9/2009)
Lamont Harrington
   (6/21/2005)
Lance Hunt
   (8/10/2010)
Lance Robinson
   (10/18/2011)
Loren Halvorson
   (7/19/2011)
Lorenzo Barbieri
   (11/13/2009)
Luc Bos
   ()
Luke Woodard
   (3/8/2007)
Mack D. Male
   (8/17/2009)
Mack D. Male
   (8/20/2005)
Marcie Robillard
   (4/1/2010)
Marco Russo
   (7/15/2006)
Marcus Mac Innes
   (10/7/2008)
Mario Priebe
   (1/26/2012)
Mark Brown
   (8/14/2004)
Mark Frantz
   (4/25/2007)
Mark Levison
   (6/10/2005)
Mark Nilsen
   (2/19/2007)
Marlon Ribunal
   (10/6/2011)
Marlon Ribunal
   (3/9/2009)
Martin Hey
   (1/22/2012)
Martin Jarvis
   ()
Martin Spedding
   (5/21/2006)
Mathew Nolton
   (5/15/2009)
Matt Davey
   (5/21/2006)
Matt Hawley
   (8/24/2010)
Matt Watson
   (1/2/2010)
Matthew Deiters
   (3/2/2006)
Matthew Marksbury
   ()
Mauricio Scheffer
   (7/15/2011)
Mehran Nikoo
   (7/7/2009)
Memi Lavi
   (5/21/2006)
Michael Ceranski
   (1/31/2012)
Michael Freidgeim
   (1/25/2012)
Michael Herman
   (11/2/2007)
Michael Mello
   (9/15/2004)
Michael Palermo
   (1/11/2012)
Mickey Gousset
   (7/28/2009)
Mike Calvert
   (9/2/2011)
Mike Diehl
   (12/31/2010)
Mike Griffin
   (1/29/2012)
Mike Kolitz
   (3/26/2005)
Mike Richardson
   (3/13/2006)
Mike Vallotton
   (3/14/2011)
Milan Negovan
   (6/23/2010)
Minh T. Nguyen
   (12/9/2011)
Mitch Denny
   (2/16/2011)
Mohammad Ashraful Alam
   (5/12/2011)
Mohammad Hajjar
   (5/5/2008)
Morten
   (9/17/2009)
Morten
   (8/2/2006)
Morten Abrahamsen
   (6/28/2011)
Morten Christensen
   (8/8/2006)
Morten Nielsen
   (1/30/2008)
Mugambar
   ()
Nards Ocampo
   (6/23/2008)
Nathan Maffeo
   (10/25/2006)
Natty Gur
   (3/21/2011)
Neno Loje
   (2/6/2009)
Nick Grattan
   (5/5/2006)
Nik
   (2/16/2007)
Nikhil Kothari
   (6/28/2011)
Notorious N.E.R.D
   (3/11/2010)
odalet
   (10/25/2006)
odalet
   (2/14/2010)
Oddur Magnusson
   (1/3/2009)
Oisin Grehan
   (3/9/2011)
Oliver Sturm
   (10/29/2011)
Ondrej Svacina
   (12/26/2011)
ozba
   (1/18/2012)
P.J. van de Sande
   (2/24/2009)
pablo
   ()
Paschal L
   (6/28/2011)
Pasi Heinonen
   ()
Patrick Steele
   (1/24/2012)
Patrick Tisseghem
   (1/3/2009)
Patrik
   ()
Patrik Hägne
   (4/21/2009)
Paul Bartlett
   (4/25/2007)
Paul D. Murphy
   (6/26/2006)
Paul Edwards
   (4/21/2006)
Paul Fallon
   (10/24/2009)
Paul Irwin
   ()
Paul Laudeman
   (6/15/2005)
Paul Litwin
   (6/28/2011)
Paul Louth
   ()
Paul Mendoza
   (10/17/2008)
Paul Mooney
   (5/31/2009)
Paul Wilson
   (8/9/2009)
Peter Jausovec
   (4/25/2006)
Peter Koen
   (5/21/2006)
Peter Van Ooijen
   (5/16/2005)
Phil Winstanley
   (4/12/2011)
Philip Rieck
   (6/11/2009)
Pierre Greborio
   (6/28/2011)
Pieter Germishuys
   (9/5/2009)
Pronexus
   (1/27/2012)
Ralfs Sudelbücher
   (6/28/2011)
Randy Holloway
   (3/26/2005)
Ravikanth
   (6/28/2011)
Raymond Lewallen
   (1/3/2009)
Razor
   (7/6/2005)
Reed Copsey, Jr.
   (11/28/2011)
Reggie Burnett
   (9/27/2011)
Reggie Burnett
   (3/4/2008)
reydacoco
   ()
Richard Jonas
   ()
Richard Jonas
   (12/24/2006)
Richard Jonas
   (10/17/2007)
Rick Minerich
   (10/22/2010)
Rick Smit
   (10/29/2004)
Rickard Lindberg
   (5/7/2004)
Rob Chartier
   (9/29/2010)
Rob Tillie
   (2/2/2006)
Robert Baiumann
   (5/7/2007)
Robert Hurlbut
   (8/28/2010)
Robert Lair
   (6/21/2008)
Robert McLaws
   (1/3/2009)
Robert McLaws
   (1/25/2008)
Robert Sharp
   (2/16/2007)
Roland Weigelt
   (1/1/2012)
Ron White
   ()
Roy J. Salisbury
   (3/4/2006)
Roy Osherove
   (12/14/2011)
Russ Nemhauser
   (6/22/2005)
Russell East
   (8/4/2010)
Ryan Dawson
   (10/31/2007)
Ryan Farley
   (6/28/2011)
Ryan Rinaldi
   (1/20/2011)
Sadia Aziz
   ()
Sahil Malik
   (8/24/2006)
Sam Gentile
   (7/16/2006)
Sam Gentile
   (11/30/2011)
Sanjeeb Sarangi
   (6/28/2011)
Scott Cadillac
   (10/5/2006)
Scott Cadillac
   (10/12/2007)
Scott Kuhl
   (12/22/2011)
Scott Munro
   (1/3/2009)
Scott Sargent
   (7/17/2007)
Scott Schecter
   (6/28/2011)
Sean McCormack
   ()
Sebastian Weber
   (6/28/2011)
Senkwe
   (5/17/2006)
Senthil Kumar B
   (2/2/2012)
Serg
   (7/30/2009)
Sergey Zhikharev
   (10/22/2008)
Simone Busoli
   (8/6/2007)
SLaks
   (1/25/2012)
Softwaremaker
   (11/7/2011)
Srila Technologies
   (6/28/2011)
Sriram Vaidyanathan
   (3/30/2010)
Steele Price
   (10/10/2009)
Stefan Cullmann
   (5/22/2005)
stefan demetz
   (5/5/2009)
Stefano Demiliani
   (6/16/2005)
Stephen Fuqua
   ()
Stephen Kinsey
   (7/16/2008)
Steve
   (10/22/2011)
Steve Eichert
   (6/20/2005)
Steve Kapsinow
   (5/21/2006)
Steve Schofield
   (1/9/2012)
Steven M. Cohn
   (6/21/2007)
Stuart Radcliffe
   (1/3/2009)
Stuart Radcliffe
   (5/27/2004)
StuartGunter
   (6/23/2005)
Sudhakar Sadasivuni
   (5/21/2006)
sumit gupta
   ()
Suresh Behera
   (11/30/2011)
Sushila Patel
   (9/22/2011)
Sven Cipido
   (6/28/2011)
Team System Blog
   (10/7/2008)
Tejas Patel
   (2/4/2005)
Thea Burger
   (9/19/2008)
Thom Allen
   (10/13/2004)
Thomas Skovsende
   (8/10/2011)
thomas woelfer
   (4/9/2010)
Tim Hibbard
   (5/10/2011)
Tim Murphy
   (3/6/2007)
Tim Murphy
   (2/3/2012)
Tim Weaver
   (6/4/2008)
Timur Fanshteyn
   ()
TK's Blog
   (1/6/2009)
TOM_MUE
   (1/19/2008)
Tomasz Rabinski
   (12/29/2011)
Typemock
   (2/1/2012)
uber
   (1/3/2009)
Udi Dahan - The Software Simplist
   (1/8/2012)
Vasanth Dharmaraj
   (11/9/2005)
Victor Garcia Aprea
   (6/28/2011)
Vijay
   (1/16/2005)
VSTSBlog (by Neno Loje)
   (11/21/2011)
Wallace B. McClure
   (2/2/2012)
Warnar Boekkooi
   (1/3/2009)
Wes Haggard
   (2/24/2010)
Willem Odendaal
   (6/24/2005)
Willy David Jr
   (6/28/2011)
woaychee
   (2/11/2010)
XAML Blogs
   (11/13/2004)
Yezdaan Baber
   (6/28/2011)
Yuri Gorobets
   (3/27/2005)
Yves goeleven
   (7/14/2009)
Zeeshan Umar
   ()



 
Promotion
John Sheehan - Posted 2/3/2012
Promotion:

Mikeal Rogers:

The best way to promote your project is to first promote that understanding of the problem. The better you are at sharing that understanding of the problem the more your audience can appreciate your solution.

In Mikeal’s case he’s talking about open source projects, but this also applies to products. If you define yourself by your competitors instead of sharing in your customers’ pain, all you’ll ever be is just an alternative to the competitor instead of a solution to a problem.


My Announcement: Cloud Foundry is Awesome, PaaS Rules, DevOps/NoOps/AppOps is The Future, & I’m Stepping to Bat!
Adron Hall - Posted 2/3/2012
Alright... deep breath. The last few weeks, no wait, the last few months have been hella busy. I finally got my act together and have set some real goals. One of them is stepping up to bat in the Cloud Computing/Utility Computing Industry, instead of just being a mere critique, writer, and sideline gazer I'll be in the full battle on Monday. The reason Monday, is because today is my last official day at Russell Investments. Beautiful Russell Investments Building in Seattle Working at Russell has been awesome. The team I got to work with regularly used advanced practices (which I like to think of as practices that everybody uses, but I'm aware of reality) - such as TDD, BDD, and Pairing. We did a mild form of Scrum, mostly to help leadership manage to the even higher up management. It works really well. We have happy customers, solid products, a deployment success rate that never had us at work late, and to top it off I got to work on net profitable projects. I love seeing success across the board! The the guys I worked with the most pairing, TDDing & BDDing, and generally making the math work - Jeff Schumacher @codereflection & Scott Koon @lazycoder - cheers, beers on me in the near future (like at 2:00pm!). To the host of others...

Read More


Organizing Your Work With OneNote Page Templates
Tim Murphy - Posted 2/3/2012

If you have seen the Windows Phone commercial where the father is in the grocery store with the shopping list in OneNote you have gotten you first taste of the flexibility that can be had with OneNote.  I like most consultants have a lot of fires going and once and I am finding that the templates in OneNote are helping me to get a handle on the different projects and tasks I need to track.

I started using OneNote to do simply what its name suggests: take and organize notes.  Lately though I am finding ways that it can help to centralize things that I had been using multiple applications to accomplish.  Having them all in one place, as with most things makes it easier to not miss something.

You may find using the tasks feature of Outlook works well for you, but I found that I was in and out of my email so fast that I ignored the tasks.  As simple To Do List template in OneNote seems to be the solution for me since I spend so much time documenting projects.  As an alternative you can use the Prioritized To Do List shown below or the Project To Do List which gives you a list per project.

image

When starting a project at a new client Project Overview is a great way to organize your thought and make sure that you cover all the essentials.  While I am just starting to use it this template is quickly proving its worth.

image

Of course if you don’t find a template that fits your needs you can create your own templates. Start with one of the standards and edit it.  Then click Save Current Page As A Template.  This is great especially for customizing templates like the project overview to suit you needs.

There are many other features to this tool for you to explore.  Add to everything above that it is a write once, maintain anywhere product and I can easily access my notes from any browser or even my Windows Phone.  Life is getting just a little better.


Abstracting away issues of HttpContext from your ASP.NET MVC controllers
Jeff Putz - Posted 2/3/2012

I've noticed that I write software in one of three modes:

  • For myself: Shortcuts, less testing, not well-factored.
  • For myself but in public: Mostly POP Forums, which I try to avoid letting it suck since others will use it and see the code.
  • For sharing: Any day job or gig where others will use or maintain your code. You don't want to unleash crapsauce on others.

I have to admit that second case isn't the most clean of endeavors. While I'm generally happy with the forum app and the feedback I get for it, it needs some refactoring in places. The thing that bothers me the most is that a lot of the controllers do way too much. This is particularly obvious because of all the mocking required for the tests. It's not like I've got inline SQL in there, but they could definitely stand to delegate stuff to other stuff.

One of the inevitable things you end up doing at some point in your ASP.NET MVC controller is access the HttpContext in some way. Because the cats that build the MVC framework are so smart, they actually used HttpContextBase as the type for the HttpContext property on the Controller base class. That already makes life a little easier, because you don't have to mock out a huge graph of objects to test what it is your controller is doing.

I suggest that you can take that one step forward. For example, say that you need to molest your model a little before you return it to a view, but only if the client is a mobile browser. It's actually pretty easy to check, but here's the Boolean that tells you:

var isMobile = HttpContext.Request.Browser.IsMobileDevice;

Simple enough, but it's also pretty deep in the object graph for mocking. It also assumes you'll never do any logic more complicated than checking the property. Since you're already using dependency injection in your controller (and if you're not, shame on you, go read up on it), it might be easier to hand off this logic to something else. So in this example, perhaps you have a class called MobileDetectionWrapper, which implements IMobileDetectionWrapper, and looks like this:

public class MobileDetectionWrapper : IMobileDetectionWrapper
{
    public bool IsMobileDevice(HttpContextBase context)
    {
        return context.Request.Browser.IsMobileDevice;
    }
}

Super simple example, and what might seem like a needless abstraction, but this is far easier to test. Inject the IMobileDetectionWrapper into your controller, and now you simply mock that. Your test might look something like this (using Moq here):

var mobileDetection = new Mock<IMobileDetectionWrapper>();
mobileDetection.Setup(x => x.IsMobileDevice(It.IsAny<HttpContextBase>()).Returns(true);
var controller = new MyController(mobileDetection.Object);
var result = controller.MyActionMethod();
// test the result here for whatever

And just in case you're unclear about the way the controller looks:

public class MyController : Controller
{
   public MyController(IMobileDetectionWrapper mobileDetection)
   {
      _mobileDetection = mobileDetection;
   }

   public ActionResult MyActionMethod()
   {
      var isMobile = _mobileDetection.IsMobileDevice();
      // do stuff
      return View(resultModel);
   }
}

Get it? I freehand-typed that without Visual Studio or Intellicrack, so hopefully it's right. :) In any case, the dependency injection resolver you have set up in your MVC app news up the controller with the concrete implementation of IMobileDetectionWrapper and you use it in your action method. Again, trivial example, but imagine you had to do other special things, like check for a cookie and identify an iPad, and therefore return a false value instead of true for the IsMobileDevice question. The necessary mocking in the controller is significantly less.


SPSite and the Recycle Bin in SharePoint 2010 SP1
Joel Jeffery - Posted 2/3/2012

Service Pack 1 for SharePoint 2010 brought us a much-needed feature – the recycle bin for SPWeb and SPSite objects.

Recycling SharePoint Sites

If you want to move an SPWeb into the recycle bin programmatically, there’s the fairly-straightforward SPWeb.Recycle() method. Once you’ve invoked this, you can restore the SPWeb from the SPSite.RecycleBin object with the Restore() method.

But, how do I recycle and restore a site collection (SPSite)?

Recycling SharePoint Site Collections

Firstly, there’s no Recycle() method on the SPSite object. Invoking Delete() removes the SPSite immediately, unless you pass in an argument to get it to perform a gradual delete. The gradual delete process is carried out by the “Gradual Delete Timer Job”, whose purpose is to delete site collections efficiently 1000 database rows at a time.

Read more on SPSite and the Recycle Bin in SharePoint 2010 SP1…

Technorati Tags: SharePoint, SharePoint 2010, SharePoint Development


Webcast – Entity Framework, LINQ, and WCF Data Services for Oracle Database
Senthil Kumar B - Posted 2/2/2012
Oracle Development Tools User Group is organising an webinar on the topic “Entity Framework, LINQ, and WCF Data Services for Oracle Database” on February 9 , 2012 from 12.00 PM – 1.00 PM EST . The webcast will be presented by Alex Keh, Oracle Corporation . The Webcast – Entity Framework, LINQ, and WCF Data [...]

Author Review and Production Editing are complete
Wallace B. McClure - Posted 2/2/2012

What book editing isn't better the second time around?  Like a dog returns to his vomit and the fool to his folly, the author must return to his writing.  And with the past week, my author team and I have finished our AR and Production Editing for Wrox's "Professional Android with Mono for Android and .NET/C#." We are literally 8 months from being AR and PE complete the first time around (I really hope that there isn't a third).

Mono for Android bookAnd with the upload to my editor at Wiley/Wrox, the book known as "Professional Android Programming with Mono for Android and .NET/C#" is now Author Review Complete, barring any slip ups on my part.  Its always a great feeling to get these things done.  A real load off of my shoulders. 

The genesis of this book has been really interesting.  It started while we were still writing our "Professional iPhone Programming with MonoTouch" book.  We started talking about this due to the Apple self FUD starting last April, 2010.  Watching the number of Android devices sold go up each quarter also helped me make the decision to go forward.  Martin Bowling started as the lead author.  Unfortunately, he had family issues and had to drop off during the planning stages. The other authors that joined me on this were Nathan Blevins, Jon Dick, Chris Hardy, and John Croft.

Here is some info from the Amazon web site about our book:

The wait is over! For the millions of .NET/C# developers who have been eagerly awaiting the book that will guide them through the white-hot field of Android application programming, this is the book. As the first guide to focus on Mono for Android, this must-have resource dives into writing applications against Mono with C# and compiling executables that run on the Android family of devices.

Putting the proven Wrox Professional format into practice, the authors provide you with the knowledge you need to become a successful Android application developer without having to learn another programming language. You'll explore screen controls, UI development, tables and layouts, and MonoDevelop as you become adept at developing Android applications with Mono for Android.

  • Answers the demand for a detailed book on the extraordinarily popular field of Android application development
  • Strengthens your existing skills of writing applications and shows you how to transfer your talents to building Android apps with Mono for Android and .NET/C#
  • Dives into working with data, REST, SOAP, XML, and JSON
  • Location, mapping, and the question of "where am I?" with regards to mobile.
  • Discusses how to communicate with other applications, deploy apps, and even make money in the process

Professional Android Programming with Mono for Android and .NET/C# gets you up and running with Android app development today.

Please remember to buy 8 to 10 copies for the ones you love.  They will make great presents all year round. If you would like to start by pre-ordering 5, that would be great to.

Coming Soon: A New Perspective in Unit Testing
Typemock - Posted 2/1/2012
Want a sneak peek at what’s coming up in our labs? Want to learn more, stay tuned for upcoming webinars in February.

[KinectSDK] Affichage des flux vidéo couleur et profondeur de Kinect dans une fenêtre WPF avec MVVM
Courtois Sébastien - Posted 1/31/2012
Prérequis pour ce tutoriel : Kinect SDK doit être installé sur votre machine Coding4Fun Kinect Toolkit (la dll utilisée est fournie dans le code exemple a la fin de cet article). Kinect et un câble USB permettant de le connecter à un PC (seules les versions de Kinect achetée séparément de la console en ont [...]

Getting Started With The Arduino
Michael Ceranski - Posted 1/31/2012

As an engineer, I constantly feel the need to learn new things in order to keep the "saw sharp". Since I write code for a living, I often feel dissatisfied by the notion that everything I create is "virtual". The only way to interact with the things that I create are with a keyboard and mouse. The thought of this often makes me wonder if I would have been happier in a profession where I built things with my hands. People tend to appreciate things more that they can hold and physically interact with. So naturally, this led me to the idea of "How can I make software take on a more physical presence?". Of course I immediately thought of robotics, so I typed the term "robotics" into Google and I discovered the term "Physical Computing". According to Wikipedia, the definition of physical computing is:

Physical computing, in the broadest sense, means building interactive physical systems by the use of software and hardware that can sense and respond to the analog world. While this definition is broad enough to encompass things such as smart automotive traffic control systems or factory automation processes, it is not commonly used to describe them. In the broad sense, physical computing is a creative framework for understanding human beings' relationship to the digital world. In practical use, the term most often describes handmade art, design or DIY hobby projects that use sensors and microcontrollers to translate analog input to a software system, and/or control electro-mechanical devices such as motors, servos, lighting or other hardware.

Immediately after reading about physical computing I was intrigued by the idea so I decided to learn more about the different kinds of microcontroller that are available on the market. Of course, since I am a .NET Developer I already knew about the Netduino. The Netduino is a microcontroller that runs the .NET micro framework and you can use Visual Studio to create sketches. Although this sounded cool I decided that 40+ hours a week in Visual Studio is more than enough for me. Therefore, I opted to go with the Arduino platform instead. The Arduino programming language is a implementation of Wiring, a physical computing platform, which is based on the Processing multimedia programming environment. With the combination of some basic electronics skills and the Arduino you can create almost anything. If you search online you will find all kinds of Arduino based projects which include clocks, weather stations, robots and even 3d printers! To make a long story short I ended up ordering the SparkFun inventor's kit. The kit includes an Arduino Uno R3, some basic components and a step-by-step guide on how to use each one. If you are starting from scratch like me and you have no prior experience with electronics then I strongly recommend buying a kit. The manual that comes with the SparkFun Kit is very well done and of course there are a large community of Arduino developers willing to help if you get stuck.

The SparkFun Inventors Kit

After you make it through all the tutorials in the kit you will probably lay awake at night just thinking of the possibilities. In addition, you will probably drop some cash because on a bigger breadboard, a multimeter and a soldering station. Anyways, just to whet your appetite here are some examples of things that you can do with an Arduino:

RGB LEDs controlled by an Arduino and sequenced with Flash.

Arduino Robot using a Adafruit motor shield, 2x Sharp IR sensors, one PING sensor and an XPAL XP8000 battery.

And finally, a 3D Printer from MakerBot. Yes, I said 3D Printer! Apparently, this uses a Arduino MEGA under the covers.

In the upcoming months you can expect to see some Arduino and electronics based articles appearing on my blog. Perhaps even an article about how I built my first robot!



Delivering effectively in the age of internet: slides and links
gojko - Posted 1/31/2012
Here are the links and the slides from the APIL2012 keynote: Forrester research on water-scrum-fall Article summarising the research Specification by example Effect mapping Feature injection User story mapping

Microsoft changes file management in Windows 8 after customer feedback
Bartek - Posted 1/30/2012
Today Steven Sinofsky announced that Microsoft had been carefully monitoring the "comments, newsgroup discussions, and reviews that have been written about Windows 8" and subsequently incorporated much of the feedback into the design process, resulting in the following changes to file management in the upcoming Windows 8 beta.



Software Passion Summit 2012
Joydip Kanjilal - Posted 1/30/2012
Hi All, Watch out for Software Passion Summit 2012 scheduled for 19-20th March 2012 at the Clarion Hotel Post in Göteborg, Sweden. Here are the program details: http://softwarepassion.se/program.do You can find the list of speakers here: http://softwarepassion.se/speakers.do...(read more)

Lazy Loading your JavaScript Hierarchical Model
Mike Griffin - Posted 1/29/2012

This was a quick video that was just made showing the full hierarchical object model being lazy loaded in JavaScript using entityspaces.js. It’s pretty cool stuff. It’s exactly like using the EntitySpaces Hierarchical Object Model in C# or VB.NET. It works nicely with Knockout as well.

esvideo

From mobile devices to large scale enterprise solutions in need of serious transaction support, EntitySpaces can meet your needs. Whether you’re writing an ASP.NET application with medium trust requirements, a Mono application, or a Windows.Forms application, the EntitySpaces architecture is there for you. EntitySpaces is provider independent, which means that you can run the same binary code against any of the supported databases. EntitySpaces is available in both C# and VB.NET. EntitySpaces uses no reflection, no XML files, and sports a tiny foot print of less than 200k. Pound for pound, EntitySpaces is one tough, dependable .NET architecture.

The EntitySpaces Team
--

EntitySpaces LLC
Persistence Layer and Business Objects for Microsoft .NET
http://www.entityspaces.net


NET Framework 3.5 & NET Framework 4.0
Anand Patel - Posted 1/29/2012
The .NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services. The .NET Framework is hearty of development now & tomorrow for business applications.

Our dot.net consultant hides technical complexity & ensures deliver of better application. Radix has started development on net framework 4.0 to influence best technology for client projects.

Explore technical verticals of Radix consulting & development services from following sections.

The Big Dummies Guide for Windows Phone Developer Resources
Bil Simser - Posted 1/29/2012

Windows Phone apps are growing in popularity as does the 50,000 60,000 apps in the marketplace today. Microsoft has done a great job at putting together some resources for developers including full documentation. When you first land on App Hub there’s all kind of samples, toolkits, and quick starts to get you going.

This post is to fill in some gaps and direct you to some additional resources that I’ve built up over the last couple of years of building phone apps. I won’t regurgitate the Microsoft resources here, you can get all of those at the App Hub itself. Instead these are other resources that will hopefully be useful.

Toolkits and Utilities

What you get out of the box is a lot but there is a lot more to offer out there that others have come up with. Here are a few.

Wp7nl utilities

Here’s a collection of utilities put together by the Dutch Windows Phone developer community. A lot of great small classes here that you can leverage in your app with some cool controls and new behaviours. It even has NuGet Support so adding it to your project is a no-brainer.

Agfx

I’m always writing code to call HttpRequest (or WebClient), download data from a site, deal with callbacks, then deal with updating my ViewModel. Agfx takes the heavy lifting out of a lot of this and tosses in free caching (with policies you specify like auto-refresh) making it a breeze. Highly recommended for any Windows Phone project that needs data.

Silverlight Toolkit for Windows Phone

This is from the Windows team and again, open source, providing you with a dozen or so controls including a frame system that lets your apps look and behave like the core ones, just with one line of code and a few lines of XAML markup on each page.

Tombstone Helper

I’ve always had to write classes and plumbing code when dealing with tombstoning (saving the state of your app). This helper comes as a NuGet package that you can handle all your tombstoning needs with 1 line of code. Simple and easy.

Your Last About Dialog

Tired of writing about dialogs and screens? Install this (via NuGet of course!) and call it with one line of code. Viola. A complete A bout page with your own user definable pivots, license information, credits, etc. You can even load pages remotely and if there’s no network connection no problem, the library will handle it.

About Page Revisited

Another great about page, this one is driven from local resources and requires no coding, just configuration. Nice!

Phoney Tools

Another useful library with a smattering of great controls, helpers, and converters. Drop in, use, profit (okay, the last part might take some work).

MVVM Light

Silverlight apps on Windows Phone 7 greatly benefit from databinding and not the databinding you learned to hate in VB6. This is true, two-way databinding that lets  you separate your concerns with your app correctly. MVVM Light is one library that helps do this (you can just use IPropertyNotify on your own classes) but provides other things like behaviours that can be bound to properties for eventing. Very useful.

Caliburn Micro

Another MVVM library that works great with Windows Phone 7 (be sure to get the latest code, the NuGet package at the time of this writing didn’t support Mango and needs to be updated).

Design

Design is a huge part of Windows Phone apps looking to capitalize on the Metro Design Language.

Metrogrid Helper

This is a simple class that overlays a series of translucent boxes, all evenly spaced, on your app during debug time. It’s invaluable to check the lining up of those controls and titles. By Jeff Wilcox and the Windows Phone team.

Metro Design Guide

Microsoft offers a design guide which is great but Jeff Wilcox turns it up to 11 with this post, covering all kinds of implementation tips developers should use before submitting an app.

Development

31 Days of Windows Phone

Jeff Blanketburg took it upon himself to post 31 days of Windows Phone tips that covers all the basics you need to get going. Each post is deep on each topic and a recommended read to get into any of the core controls and features for building WP7 apps.

31 Days of Mango

The last update for Windows Phone called Mango added all kinds of great new features like live tiles, search integration, running under lock screens, etc. Jeff comes back with 31 more days for Mango specific features.

MessageBox and Application Lifecycle

This can be tricky when you’re trying to not only pass certification but manage popups and screens. Here’s a post to help you through that.

Windows From Scratch

Jesse Liberty, another huge name in the Windows Phone arena, has a whole set of tutorials focused on single tasks (currently over 30 of them). Great stuff and very useful!

101 Windows Phone Apps

Adam Nathan did the community a solid by creating 101 Windows Phone apps, then writing two books on it (there’s only enough room in a single book). Each app is detailed in a separate blog post on his site and covers various types of apps you would build with WP7 like stop watches, calendars, to do lists, and more.

Internationalization

Windows Phone is everywhere, not just English speaking nations!

Make your apps Kanji-friendly

A nice post on how your app can be more recognizable and (perhaps) popular in the Japanese markets. With Nokia phones hitting the marketplace, this tip is invaluable to reach out beyond your own backyard.

Globalization and Localization for your Phone

A great MSDN article (actually a series of them) that walks you through setting up localization for multiple languages. It’s easy and even if you only support one language, do this so all your strings are in a resource file and not hard coded for easy updates.

Achievements

If you’re building a game or even want to incorporate leaderboards and achievements into your phone app look no further.

Mogade

This is a free and open source solution with a back-end server to keep track of your own user defined leaderboards and achievements. You define it on the site and with a few simple calls in your code, upload scores and award achievements to users and display global leaderboards in your app. Silverlight and XNA samples available to get you started.

Marketing

Building your app is just part of the process, then comes getting it out to the masses and keeping the word out.

Windows Phone 7 App Site Template

This is a complete one-page site template that’s completely data driven. You just make some modifications to the app name, provide some screenshots, deep links, etc. and you’re good to go. There’s even integrated Twitter and Uservoice support.

Training

Free Windows Phone Training

No, this isn’t a link to some overpriced course. It’s a link to over 20 hours of free video training put together by Peter Kuhn. The videos include complete source code and walk through all the aspects of building Windows Phone apps from soup to nuts.

Tools

Tools are any part of a good developers kit and there’s no shortage of them for Windows Phone developers.

Silverlight Spy

Think of it as Firebug for your phone. Why are you still reading this?

Isolated Storage Explorer

Wondering if you’re writing the right thing to your phone or want to take a look at where things are going in your app? This tool lets you peek inside the storage system for you.

Windows Phone Screenhot Tool

This is an awesome tool and installs with ClickOnce so you always have the latest version. It lets you take screenshots effortlessly with or without an emulator skin so you can do cool shots for your blog and take the final images for the marketplace.

Emulator Skin Changer

Bored with the out of the box emulator every time you launch it from Visual Studio? This tool let’s you change up the skin to something more sexy and fun, all with the click of a button. Be the cool kid at your next Windows Phone presentation and amaze your friends!

Monetization

Microsoft Advertising Services

Microsoft has continued to expand it’s monetization services by offering up ads in new markets (and markets are being added regularily). Various reports have different successes with these services but they’re baked into the Mango SDK and easy to setup and use.

This is by far a complete list so please leave a comment with more links, suggestions, and corrections as you see them. I’ll update the post as quickly as I can.

Now, go get building your first Windows Phone app!



ASUS Zenbook UX31 - First Look
Jon Galloway - Posted 1/28/2012

I've been through several laptops over the years, three in the past two years. I had an old Dell beater as a fallback, but for a while my main laptop was a Dell Latitude XT2. The XT2 seemed promising - a small laptop with a touch screen - but poor drivers and slow performance made it barely usable. It was bad enough trying to do day to day work on it, but when I used it to give technical presentations it was flat out embarrassing. That's why, when I was up for a new work laptop, I jumped at the Lenovo W520. The W520 is an enormous brute of a machine in every sense - literally more powerful than most desktop machines, and not much smaller. That's fine, I thought - I'll happily trade convenience for a machine that actually works.

I tell you that history to explain why, when I was offered the opportunity to review an Intel Ultrabook, I was pretty skeptical. I reviewed some of the different options available and - while they looked good - I didn't expect a lot in the way of power, especially when I saw that the prices were pretty reasonable.

As I said, I was offered an Ultrabook in exchange for a review, so here's the disclaimer: I received an ASUS Zenbook 31 for free in the hope that I would mention it on my blog. Regardless, I only recommend things I personally endorse and would recommend. I'm disclosing this in accordance with the FTC's Guides Concerning the Use of Endorsements and Testimonials in Advertising. I also cleared it with my employer's legal / corporate affairs team just to make sure there wasn't an perceived conflict of interest. I made sure the agreement said that my review would be my honest opinion, and that's what this is.

Step one for me was to look at the choices of Intel Ultrabooks. There are a lot of good choices out there, and while I was interested in the Lenovo U300s (a pretty gorgeous machine) I kept coming back to the ASUS Zenbook. It stood out for a number of reasons, but one big one was the screen resolution. Just about every comparable laptop out there maxes out at a screen resolution of 1366x768 or 1440x900 (including the top MacBook Airs), the Zenbook UX31 goes all the way up to 1600x900. Based on recent history with trying to work and give technical presentations using small laptops, I wasn't interested in reviewing anything I couldn't do real work and consider presenting with. If you're looking for an ultrabook form factor laptop to do real work on (as opposed to web and media) I think those extra pixels are a big deal.

Unboxing

This laptop was very well packaged. It was obvious from the start that attention had been paid to quality and elegance, and I think it works. This felt like unpacking a quality consumer product, not your typical laptop box full of random papers and promotional CD-ROMS.

IMG_6172

After removing the small but solid Zenbook, I found a sturdy looking carrying case. As others have noted, a carrying case for this seemingly indestructible laptop seems like overkill, but it sure looks nice.

IMG_6173

After removing the Zenbook and the case (pictured later), you find a nice introductory card on top of a small box with other necessary but not beautiful stuff (owner's manual, warranty card, etc.). Again, opening this laptop feels like an experience.

IMG_6174

So at the risk of being incredibly nitpicky here, I found it odd that the Zenbook card was completely devoted to talking about features of the Zenbook, and none said anything like "You'll need to plug in your Zenbook before using it." Yes, I'm a computer guy who knows (expects) that laptop batteries won't stay charged during shipping and the dang thing needs to be plugged in when you open the package, but thinking like a non-techy consumer who's buying a consumer electronic gizmo here. When I take the Zenbook out of the box and try to turn it on, nothing happens. The welcome card should cover that.

On to the actual laptop - the Zenbook!

IMG_6177

This is a good looking, solid machine. It's small but heavy. When I showed it to my 7yo daughter and asked what she thought it looked like, she said, "Expensive!" I agree, and while this doesn't come through in a blog post, the laptop itself feels very substantial. It's not heavy, but it feels hefty for its petite size.

The case is solidly constructed and looks nice.

IMG_6220

A Few (Minor) Complaints about the First Run Experience

For such a beautiful unboxing experience, I had (unrealistic?) expectations for the first run experience. Things went downhill a little bit when I turned the Zenbook on. The first prompt I got required me to accept an agreement to install the Bing Bar.

IMG_6183

What was especially frustrating with this prompt was that there was no choice - in order to start the machine up, I needed to agree to the Bing Bar license - the Next button is disabled until I do. That really broke the "fancy" feeling. Things continued in that direction after the installation completed, with a bunch of annoying dialogs:

Desktop - 1

Followed a few seconds later with an even more annoying prompt to install Trend Micro whatseehoosie:

Desktop -2

Look, I get that crapware manufacturers pay computer manufacturers money to bundle trial software, and that (kind of) benefits consumers by lowering prices. That's the real world. I think this could be done better, though. Either charge a bit more and ship a beautiful first run experience, or at least bundle all the lame crapware dialogs into one. The overlapping, uncoordinated dialogs feel cheap cheap cheap, which ruins an up-til-then beautiful experience. It's something I expect in a budget laptop, but not something as beautiful (and as beautifully packaged) as the Zenbook.

Curious, I took a quick look at the pre-installed goodies, and wasn't surprised to see quite a list:

2012-01-25 01h13_20

So, I could (and will) uninstall the junkware, but was a little disappointed to see it as a part of an otherwise beautiful setup install experience.

Fast

Regardless of any unwanted pre-installed goodies, this thing is snappy right out of the box. Without installing any updates or uninstalling anything, I got a 5.6 WEI.

2012-01-25 10h09_42

These are pretty fast scores. And, more important, so far this thing feels fast. I've been using it for a week and this thing just feels fast all the time.

Face Login

Okay, I'll talk more about this machine once I've used it for a few weeks, but I wanted to show off one cool feature - Face Login. The webcam locks in on you face and automatically logs you in, as shown below.

I've used a few webcam login systems, but none of them have worked near this well. The Face Login system really works - it's fast and it's fun.

Summary

So far I'm very impressed. While this post focuses on the first few hours with the laptop, the reality is that what's really important is all the hours that follow. I'll write I more detail once I've used this more, but this past week has shown me that this is an amazing laptop. If I was shopping for a new laptop today and my friend showed me this machine, I'd buy it... and I'm a hard sell.

Some more links for the Zenbook UX31:


The Versatility of Dialogic HMP
Pronexus - Posted 1/27/2012
When planning and ultimately deploying an IVR solution you will need to decide how the IVR will connect to the telephony infrastructure. This means that you must decide what protocol to use and what hardware is needed for the server to support that protocol. Often, customer sites may have stipulations on how your IVR can connect to the existing telephony infrastructure, since the IVR will be on their site after all. Then there are the times when you get to decide.

MVC / Razor Style-Switcher – Quicky
Mario Priebe - Posted 1/26/2012
Heute möchte ich zeigen, wie man sich einen einfachen Style-Switcher mittels jQuery in einem MVC / Razor Projekt einbauen kann. Den Basis-Style setzen wir zu Beginn, wenn die Seite zum ersten Mal geöffnet wird. Wichtig ist, das wir eine Id setzen, um in unserer jQuery Funktion dieses Element wieder zu finden. <link id="jQ" href="@Url.Content("http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css")" rel="Stylesheet" [...]

DotNetNuke Webinar for Open Source Developers 1/26
Chris Hammond - Posted 1/25/2012
Scott Willhite recently announced the following free webinar for open source developers interested in learning more about posting projects in the DotNetNuke Forge. On Thursday, January 26 at noon PST, Chris Paterra and I will host a free Webinar: A Developers...(read more)

Protecting against CSRF attacks in ASP.Net MVC
SLaks - Posted 1/25/2012

CSRF attacks are one of the many security issues that web developers must defend against.  Fortunately, ASP.Net MVC makes it easy to defend against CSRF attacks.  Simply slap on [ValidateAntiForgeryToken] to every POST action and include @Html.AntiForgeryToken() in every form, and your forms will be secure against CSRF.

However, it is easy to forget to apply [ValidateAntiForgeryToken] to every action.  To prevent such mistakes, you can create a unit test that loops through all of your controller actions and makes sure that every [HttpPost] action also has [ValidateAntiForgeryToken]. 

Since there may be some POST actions that should not be protected against CSRF, you’ll probably also want a marker attribute to tell the test to ignore some actions.

This can be implemented like this:

First, define the marker attribute in the MVC web project.  This attribute can be applied to a single action, or to a controller to allow every action in the controller.

///<summary>Indicates that an action or controller deliberately 
/// allows CSRF attacks.</summary>
///<remarks>All [HttpPost] actions must have 
/// [ValidateAntiForgeryToken]; any deliberately unprotected 
/// actions must be marked with this attribute.
/// This rule is enforced by a unit test.</remarks>
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
public sealed class AllowCsrfAttacksAttribute : Attribute { }

Then, add the following unit test:

[TestMethod]
public void CheckForCsrfProtection() {
    var controllers = typeof(MvcApplication).Assembly.GetTypes().Where(typeof(IController).IsAssignableFrom);
    foreach (var type in controllers.Where(t => !t.IsDefined(typeof(AllowCsrfAttacksAttribute), true))) {
        var postActions = type.GetMethods()
                                .Where(m => !m.ContainsGenericParameters)
                                .Where(m => !m.IsDefined(typeof(ChildActionOnlyAttribute), true))
                                .Where(m => !m.IsDefined(typeof(NonActionAttribute), true))
                                .Where(m => !m.GetParameters().Any(p => p.IsOut || p.ParameterType.IsByRef))
                                .Where(m => m.IsDefined(typeof(HttpPostAttribute), true));

        foreach (var action in postActions) {
            //CSRF XOR AntiForgery
            Assert.IsTrue(action.IsDefined(typeof(AllowCsrfAttacksAttribute), true) != action.IsDefined(typeof(ValidateAntiForgeryTokenAttribute), true),
                            action.Name + " is [HttpPost] but not [ValidateAntiForgeryToken]");
        }
    }
}
typeof(MvcApplication) must be any type in the assembly that contains your controllers.  If your controllers are defined in multiple assemblies, you’ll need to include those assemblies too.

Syncronize IIS servers in a web farm to enable ETags
Michael Freidgeim - Posted 1/25/2012

It’s known that on web Farm using  of eTags under IIS doesn’t work properly unless all servers are synchronized.
http://support.microsoft.com/?id=922733 suggests to
synchronize the ETag values on all the Web servers that are running IIS using Mdutil.exe that should be extracted from Windows CD

http://developer.yahoo.com/blogs/ydn/posts/2007/07/high_performanc_11/#comment-14835
suggests to use iiscnfg.vbs script (with the /copy switch) to keep cluster configuration synced up, this keeps the MDETAGCHANGENUMBER synced up too.
 
 
Finally I found extended recommendations how to synchronze IIS databases in
http://weblogs.asp.net/owscott/archive/2006/06/07/IISCnfg.vbs---IIS-Settings-Replication.aspx
It has customized MetabaseMerge.bat script, that seems the most appropriate for the job.
 
 

Using hg bisect to hunt down bugs
Patrick Steele - Posted 1/24/2012

The “bisect” command in Mercurial (git has it too) is a great way to quickly find which version of your code introduced a bug.  This post will show you how to use the bisect command along with handling a small “gotcha” I encountered while using it.

I recently had to hunt down a bug in a very old version of an application.  While the application had gone through numerous releases after the bug had been introduced, nobody had noticed.  And as luck would have it, this particular bug was also in a section of code without unit tests – I’d have to load up the code in Visual Studio and run the app to verify the bug.  Since I tag each revision in Mercurial that is used to produce a release, I knew which revision the users first noticed the bug – and I knew the previous release didn’t have the bug.  The problem was that between the bad release and the good release was about 26 commits.  I used Mercurial’s bisect command to make locating the bug quicker.

The first thing to do when doing a bisect is to ensure your working directory has no uncommitted changes.  The bisect command will perform an hg update automatically as it helps you zero in on the bug so it’s important you don’t have any uncommitted code.

Next, I went to my working directory and initialized the bisect operation by running:

hg bisect –r

Now, I had to tell bisect which version was bad (where I knew the bug exists) and which version was good (where I know the bug does not exist).  In this case, revision 581 was good and revision 606 was bad:

hg bisect –g 581
hg bisect –b 606

Mercurial responded:

Testing changeset 593:e3c0018aef4d (25 changesets remaining, ~4 tests)
37 files updated, 0 files merged, 23 files removed, 0 files unresolved

Mercurial had immediately updated my working directory to revision 593. This revision is about halfway between the good revision and the bad revision.  Here’s a graphical view of what I told Mercurial:

bisec01

I opened Visual Studio to load the project up and test the application.  I only have Visual Studio 2010 installed and this was a Visual Studio 2008 solution (see, I told you it was old).  I let Visual Studio perform the conversion.  I then ran the app and found that the bug exists in this version.  At this point, I needed to tell Mercurial that this version was bad.  At the command prompt I entered:

hg bisect –b

Mercurial’s response was an error:

Testing changeset 587:d6e96f87a104 (12 changesets remaining, ~3 tests)
abort: outstanding uncommitted changes

Since 593 was now the first bad revision, Mercurial tried to update to a version between 593 and 581 but couldn’t because there were uncommitted changes.  Remember how I said this an old VS2008 solution?  Since I upgraded it to VS2010, the solution was changed and Mercurial stopped the automatic update that the bisect command wanted to do.

For this situation, I didn’t care about the change to my working directory.  So I had to revert all of the changes before I could continue with the bisect:

hg revert –a
hg bisect –b

Now the bisect worked and put me at revision 587, which is just about right in between the last known good version and the last known bad version:

bisect02

Testing this version in VS2010 (again, the VS2008 solution was updated to 2010), I found the bug didn’t exist.  So I went back to my command prompt, reverted my changes and marked this version as good:

hg revert –a
hg bisect –g

 

bisect03

I was getting closer!  I’m now at revision 590 and the bug still existed.  I revert and mark it as bad:

hg revert –a
hg bisect –b

 

bisect04

After this, Mercurial updated my working directory to revision 588.  I tested it and found the bug.  I did my revert and marked it bad:

hg revert –a
hg bisect –b

Mercurial now reports 588 as the first revision where the bug appeared (since 587 was already marked good).

The bisect command is very useful for quickly hunting down bugs.  In this case, it took a little longer since I had to load the code up into Visual Studio (and convert it), run the code and then revert my changes afterward.  If the code didn’t need to be converted and had a full set of unit tests, identifying the revision where the bug first appeared would have been even quicker.  In fact, the whole process can be automated with the “-c” option which allows you tell Mercurial the name of the command to run to validate the revision!

Technorati Tags: ,,

ActionScript Bubble Debugging - Amethyst 2 preview
Huw Collingbourne - Posted 1/24/2012
Here's a short demo of one of the unique new debugging features which we are developing for the next release of Amethyst...

dotTrace 5.0 Performance Early Access Program
JetBrains, Inc. - Posted 1/24/2012
As some of you may have noticed, we have recently opened the EAP for dotTrace 5.0 Performance. It was a very quiet launch for a number of reasons, but now here we are talking about the new exciting version of the .NET performance profiling tool. There’s a ton of new features in this release as outlined [...]

(5) Interesting uses of Linq.Expression
Felice Pollano - Posted 1/23/2012

… without writing a LinqToSomething provider, of course. The Expression.<Func<T>> construction is sometimes a little frightening since we suppose to have to write some complex tree navigation in order to achieve the expression behavior, but this is not always true, there is scenarios in which we can use it without any complex tree visit. In this post we will see some real world examples using this strategy.

1) INotifyPropertyChanged without “magic strings”

This interface is implemented in its simplest form:


               1:

              public

              string CustomerName

               2: {

               3: get

               4: {

               5:

              return

              this.customerNameValue;

               6: }

               7:  

               8: set

               9: {

               10:

              if (value != this.customerNameValue)

               11: {

               12:

              this.customerNameValue

= value;

               13: NotifyPropertyChanged("CustomerName");

               14: }

               15: }

               16: }

We can leverage Linq.Expression here by this simple base class:


               1:

              class PropertyChangeBase

: INotifyPropertyChanged

               2: {

               3:

              protected

              void SignalChanged<T>(Expression<Func<T>>

exp)

               4: {

               5:

              if (exp.Body.NodeType

== ExpressionType.MemberAccess)

               6: {

               7: var

name = (exp.Body as MemberExpression).Member.Name;

               8: PropertyChanged(this, new PropertyChangedEventArgs(name));

               9: }

               10:

              else

            

               11:

              throw

              new Exception("Unexpected

expression");

               12: }

               13:  

               14:

              #region INotifyPropertyChanged

Members

               15:  

               16:

              public

              event PropertyChangedEventHandler

PropertyChanged = delegate { };

               17:  

               18:

              #endregion

            

               19: }

By deriving our class from this one, we can easily notify a property change by writing:


               1: SignalChanged(()=>CustomerName);

This allow us to leverage intellisense, and it is refactoring friendly, so we can change the name of our property without pain. The first project I seen using this technique was Caliburn Micro, but I’m not sure is the only one and the first. Same technique is used here to test the INotifyPropertyChange behavior.

2) Argument Verification

Really similar to the problem above, we want to avoid:


               1:

              static

              int DivideByTwo(int num) 

               2: {

               3:

              //

If num is an odd number, throw an ArgumentException.

            

               4:

              if ((num

& 1) == 1)

               5:

              throw

              new ArgumentException("Number

must be even", "num");

               6:  

               7:

              //

num is even, return half of its value.

            

               8:

              return num

/ 2;

               9: }

In this case we are typing NUM, that is the name of the argument, as a literal string which is bad. We would preferably write something like this:


               1:

              public

              void DoSomething(int arg1)

               2: {

               3: Contract.Expect(()

=> arg1).IsGreatherThan(0)

               4: .IsLessThan(100);

               5: ;

               6:

            

               7: }

That again give us intellisense and refactoring awareness. You can find he code for this helper class here, and a brief description in this post.

3) The MoQ mocking library

The MoQ library is a .NET library for creating mock objects easy to use that internally leverage Linq.Expression to achieve such a readable syntax:


               1: mock.Setup(framework

=> framework.DownloadExists("2.0.0.0"))

               2: .Returns(true)

               3: .AtMostOnce();

4) A generic Swap function:

The simplest way in creating a generic Swap function in c# is:


               1:

              void Swap<T>(ref T

a, ref T b)

               2: {

               3: T

temp = a;

               4: a

= b;

               5: b

= temp;

               6: }

Unfortunately, this won’t work if we want swap two property of an object, or two elements of an array. We would like to write something like this:


               1: var

t = new Test_() { X = 0, Y = 1 };

               2: Swapper.Swap(()

=> t.X, () => t.Y);

               3: Assert.AreEqual(0,

t.Y);

               4: Assert.AreEqual(1,

t.X);

or with arrays:


               1:

              int[]

array = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };

               2: Swapper.Swap(()

=> array[0], () => array[1]);

               3: Assert.AreEqual(2,

array[0]);

               4: Assert.AreEqual(1,

array[1]);

We can achieve this by a simple helper class using Linq.Expression:


               1:

              public

              class Swapper

               2: {

               3:

              public

              static

              void Swap<T>(Expression<Func<T>>

left, Expression<Func<T>> right)

               4: {

               5: var

lvalue = left.Compile()();

               6: var

rvalue = right.Compile()();

               7:  

               8:

              switch (left.Body.NodeType)

               9: {

               10:

              case ExpressionType.ArrayIndex:

               11: var

binaryExp = left.Body as BinaryExpression;

               12: AssignTo(rvalue,

binaryExp);

               13:

              break;

               14:

              case ExpressionType.Call:

               15: var

methodCall = left.Body as MethodCallExpression;

               16: AssignTo(rvalue,

methodCall);

               17:

              break;

               18:

              default:

               19: AssignTo(left,

rvalue);

               20:

              break;

               21: }

               22:  

               23:

              switch (right.Body.NodeType)

               24: {

               25:

              case ExpressionType.ArrayIndex:

               26: var

binaryExp = right.Body as BinaryExpression;

               27: AssignTo(lvalue,

binaryExp);

               28:

              break;

               29:

              case ExpressionType.Call:

               30: var

methodCall = right.Body as MethodCallExpression;

               31: AssignTo(lvalue,

methodCall);

               32:

              break;

               33:

              default:

               34: AssignTo(right,

lvalue);

               35:

              break;

               36:  

               37: }

               38:  

               39: }

               40:  

               41:

              private

              static

              void AssignTo<T>(T value,

MethodCallExpression methodCall)

               42: {

               43: var

setter = GetSetMethodInfo(methodCall.Method.DeclaringType,methodCall.Method.Name);

               44: Expression.Lambda<Action>(

               45: Expression.Call(methodCall.Object,

setter, Join(methodCall.Arguments, Expression.Constant(value)))

               46: ).Compile()();

               47: }

               48:  

               49:

              private

              static Expression[]

Join(ReadOnlyCollection<Expression> args,Expression exp)

               50: {

               51: List<Expression>

exps = new List<Expression>();

               52: exps.AddRange(args);

               53: exps.Add(exp);

               54:

              return exps.ToArray();

               55: }

               56:  

               57:

              private

              static MethodInfo

GetSetMethodInfo(Type target, string name)

               58: {

               59: var

setName = Regex.Replace(name, "get", new MatchEvaluator((m)

=>

               60: {

               61:

              return m.Value.StartsWith("g")?"set":"Set";

               62: })

               63: ,RegexOptions.IgnoreCase);

               64: var

setter = target.GetMethod(setName);

               65:

              if (null ==

setter)

               66: {

               67:

              throw

              new Exception("can't

find an expected method named:" + setName);

               68: }

               69:

              return setter;

               70: }

               71:  

               72:

              private

              static

              void AssignTo<T>(Expression<Func<T>>

left, T value)

               73: {

               74: Expression.Lambda<Func<T>>(Expression.Assign(left.Body,

Expression.Constant(value))).Compile()();

               75: }

               76:  

               77:

              private

              static

              void AssignTo<T>(T value,

BinaryExpression binaryExp)

               78: {

               79: Expression.Lambda<Func<T>>(Expression.Assign(Expression.ArrayAccess(binaryExp.Left,

binaryExp.Right), Expression.Constant(value))).Compile()();

               80: }

               81: }

This code leverages a samples by Takeshi Kiriya, I just added the ability in handling array to his own the original code.

5) Unit testing the presence of an attribute

Thomas Ardal talks in this post about how to easily unit test the presence of an attribute on a method of a class,  useful for example in MVC scenarios, or in others AOP circumstances.

A test leveraging his strategy is written as below:


               1: var

controller = new HomeController();

               2: controller.ShouldHave(x

=> x.Index(), typeof(AuthorizeAttribute));

So we show five different simple application, I hopw you find here some inspiration for your works, and feel free to write about your own ideas and enrich the list.



BSP 350z Suspension Parts and Exhaust for Sale
Chris Hammond - Posted 1/22/2012

Alright the time has come to part with the parts. I took some time this evening to take photographs of what I have and what I am trying to sell. Right now I am trying to sell everything locally so prices don’t include any shipping. If I don’t have any interest locally I’m willing to ship the coilovers/springs/shocks but only as a package.

Sway bars and the exhaust are way too much of a hassle to try to ship, so those are local only. (Local in the San Francisco Bay Area, if you’re somewhere else in California and want to drive here, feel free).

Cash Only, no checks. Paypal acceptable for a hold, but cash must be delivered in full before handover of the parts. All parts located in Half Moon Bay, contact me at z – at – christoc.com for more info.

All parts are sold as is, with no warranty, and unknown mileage. I can tell you I put about 10k on each of them (except the control arms and the Cobb bar), but am not sure what they had prior to me.


Event Centric: storing and consuming events
Daniel Cazzulino - Posted 1/22/2012
[Disclaimer: I don’t think this disclaimer is needed, but just to be on the safe side. The opinions expressed herein are my own personal opinions and do not represent my company's view, that of any customer current or past, or any current, past or future project related to these concepts in any way] In my [...]

FileNotFoundException im Konstruktor von SPSite
Martin Hey - Posted 1/22/2012

Als ich eben den Post zu AddFieldAsXml geschrieben habe, habe ich die Beispiele in einer Konsolenanwendung nachgestellt. Das Beispiel ist nicht sehr kompliziert und doch überraschte mich SharePoint direkt in der ersten Zeile mit einer FileNotFoundException.

Laut MSDN wird eine FileNotFoundException im SPSite-Konstruktor dann geworfen, wenn die SiteCollection unter der Url nicht gefunden werden konnte. Die Url ließ sich jedoch problemlos im Browser aufrufen - sowohl unter localhost als auch unter dem Rechnernamen wurde die SiteCollection gefunden. Nächster Versuch war also, die Credentials explizit mitzugeben, auch wenn das eigentlich nicht das Problem sein dürfte, weil sowohl Browser als auch Visual Studio mit dem gleichen Nutzeraccount verwendet wurden.

Was die MSDN-Seite verschweigt: Diese Exception wird auch dann geworfen, wenn das Platform-Target nicht stimmt. Konsolenanwendungen haben in der Visual Studio Vorlage grundsätzlich erst einmal das Platform Target x86; SharePoint aber ist eine 64-bit-Anwendung, daher muss das Platform Target der Konsolenanwendung auch x64 sein, damit es funktioniert. Also die Einstellung eben geändert, neu kompiliert und schon klappt es auch von der Konsole.


"Re: I have a question about proving code correctness"
Frans Bouma - Posted 1/20/2012

Recently I received an email with the following contents:

I recently started working at a startup. I'm learning lots of cool stuff, including unit testing, but as a math major something kinda nagged at me about them. I don't know if I could write a unit test that I really trust all that much. It's better than manually poking my code to be sure, but I felt there might be a better way. Fast forward to an article posted in ycombinator which gave me the knowledge that there are actually people who prove their code correct. I stumbled upon a blog you wrote, in 2009 and have found a few more from around the same time, but I was wondering if you were familiar with any literature on best practices, application, etc. I have some guesses as to how I personally would start to go about attempting proving code correctness, but I find it useful to have books written by people who implement this practice in their day to day work lives. Thank you for your time

Proving code correctness of a whole system is hard. It's so hard in fact that for a large system it's undoable. So should one give up on that altogether? Well... no not exactly, as there's a different approach to it: do it in two steps. It's based on the idea that a unit test actually tests at least two things, not one:

  • A unit test tests whether the algorithm implemented functions correctly with the input specified
  • A unit test tests whether the implementation of the algorithm is correct.

If a test fails, it can be because there's a bug in the code (e.g. the code uses the wrong index variable) or a bug in the algorithm (e.g. it fails to reach the desired outcome with a given input set) or both (and then you're in real trouble ;)). Because if a test fails it can mean more than one thing, it's good to weed out all possibilities but one: that way, when a test or verification fails, we know it's always because of the same reason and never because of another. So if we for example eliminate errors in the algorithm, we can be sure that if a test fails, the implementation of the algorithm is borked, the algorithm itself is OK.

The 'easiest' thing to eliminate from your tests is algorithm correctness testing. I say 'easiest', because formulating an algorithm is often easier than writing it down in an executable form, as that comes down to projecting it after you formally written it out in your head. To prove an algorithm to be correct is a task which is ranging from trivial to extremely difficult and it's part of what's called Formal Verification. Formal verification is, like its name suggests, rather formal, so if you're not into math that much, it can be daunting. So I'll describe a different approach which, in my humble opinion, is rooted onto the same ideas as formal verification, albeit not using formal math.

The overall idea is this:

  • For a given feature, a specification is written (be it a user story or a thick, 120 page document written by an over-paid consultant) which describes what the feature should do with what input.
  • To be able to realize the feature as stated in the specification, algorithms and data-structures on which they operate are designed. No coding is done yet. You'll see that during these first two steps, changes happen often and it's very easy to apply them, much easier than when altering code.
  • Using verification techniques, the algorithms are proven to be correct for the expected input.
  • Using Program derivation the algorithms are implemented into an executable form. As Program derivation can be very formal, it's often the case a developer falls back to Design by Contract or a less formal way to transform an algorithm into executable form.

The core idea is that if the algorithm is correct, a carefully constructed implementation of it as executable form is therefore correct too. At least for the algorithm part. The implementation of the algorithm can still contain bugs: wrong statements, wrong variable usage, boundaries of used constructs aren't taken into account etc.

One thing that is crucial is that testing and proving are both after the same goal: to make you realize whether what you've written is doing what it should (namely what the spec says!) or not. Using proving techniques is less time consuming in many cases as you can reason about all possible situations in one go, while with unit tests, you test for a subset of situations (the one implemented with the test) which can result in many many tests if there are many different situations the code has to work correctly with. On top of that, unit tests without algorithm proving can still fail for two reasons (algorithm error or code error) instead of one (code error).

How I use this in practice

I'm not mathematician, so I am not using math to prove whether my algorithms are correct. I use pre-/post conditions per step and formal algorithm descriptions to write down the algorithms. I also use per feature a description about what the feature has to do with what input. After all, if there's no description what a feature should do with what input, there's no way to say whether the code written does what it should do, as there's no description of what it should do in the first place.

On a whiteboard I use pre/post condition proving of the algorithm and change it if necessary. If I'm satisfied, I write down the algorithm steps in comments in the code and implement the data-structures required, or look for existing data-structures whether they fit the algorithm. After that I implement each step, either in-place where the comment is placed or in its own method/class.

When I'm done, and the compiler thinks I'm done too, I go back to what I've written and start reading the code again. This is something that should be taken very seriously: humans suck at reading code, so when you read code, it's essential you pay extra attention to what everything does, what the state of things is, etc. It helps to run the code through a debugger if you're not skilled in reading code (developers often 'glance' over code, not read it) to see what it does with each step.

While reading the code, I match the code parts of each step with the algorithm step it implements, check whether pre-/post conditions are indeed taken into account. In short this means: did I implement the algorithm step as intended or did I cut corners? Remember, this verification isn't done to check whether the algorithm works or not! It's meant to see whether the implementation of the algorithm is done correctly. We already proved the algorithm to be correct before we started typing one line of code.

It's important not to get cocky here: it's nice to show off your OO skills and how clever you can intertwine these silly loops, but doing so should never ruin the connection between algorithm description and code itself: it's very important for a person who reads the code to know what bizarre algorithm it implements, so changes can be made accordingly if the algorithm changes after a while.

At this point I have:

  • A description of the feature, which is the basis of proving whether the code implementing the feature does what it should
  • A series of algorithm descriptions, which are proven to be correct.
  • Code which implements the algorithms for the feature
  • Data-structures which are needed for the algorithms.

And now I run the code to see what I read and thought to be correct is actually also correct. Think of this as integration testing, as the code is ran in-system, with all the other code. Running the code can mean running a few unit tests, if the feature is a subsystem which is UI-less or which is used later on by other subsystems. The unit tests are focused on what the specification describes as valid inputs (so you also know what invalid inputs are).

"So your code is bug-free?"

In short: not always ;). As all these steps take time, it's sometimes not possible to do every step in the time it requires but has to be done in the time that's available. This leads to some corners being cut for things which seem trivial, but later on turn out to be less trivial. However what I see in our code base is that the parts on average are relatively bug free, and that with a minimum of unit tests. Our runtime test base is only a few thousand unit tests, which is rather small for a code base of about 100K lines. The designer, which is also over 100K lines has only 50 unit tests for core sub systems and has had only 25 bug fixes in the past year. We achieved this by using a solid foundation with proven code, namely our Algorithmia library (open source algorithm and data-structures library).

There are more aspects about making your code bug-free: separation of logic/code so changing one part doesn't affect everything else, clean code so it's easy to understand and maintain, logical placement of functionality, so you can easily find things back and see what affects what as understanding a code base makes making changes easier and less error prone.

There are always a chance that you break something when you make a change. For this, unit tests can help (but are not a way to be 100% certain!): write integration tests. You can design the tests specifically for detecting breaking changes. A lot of our runtime unit tests are designed for just that: fail if a sub-system got changed in such a way it affects the consumers of that sub-system. 

Conclusion

I hope to have given some insight in how to write more solid code, namely by starting with a solid root where the code is coming from: what should it do? what algorithms are used and are these correct? Are the algorithms implemented correctly?

Many algorithms have already been proven, so you can pick these up and implement them right away (if someone hasn't done that for you as well). After all, if what you have to implement sucks, your program will never work correctly, even if the code doesn't contain a single programmer error. You can't avoid all mistakes, but it's doable to make the amount of bugs small.


My Office @ AJI Software Headquarters
Jeff Julian - Posted 1/19/2012

Photo Jan 19, 8 17 49 AM

One of the great things about 2012 is that I am not in our office nearly 100% of the time during business hours.  This is the first time I have been able to work from our office this much in about 4 years.  In fact, we have moved three times during that four years and I have only averaged about 10-25% of my time in the office. 

This means I can actually setup my desk for development instead of business related tasks only.  That means THREE MONITORS!  My first reaction after a week with this setup: I never want to go back to two monitors. 

Visual Studio is a beast when it comes to multi-monitor support.  It remembers where you placed your floating windows and keeps track of all the other goodies.  I do wish I could detach a document and then make it dockable by other monitors, but at least with Windows+Left and Windows+Right and I quickly tile the documents on the external monitors. 

So far with an MVC application I have been working on I was able to have SQL Server, Visual Studio, detached Solution/Property/Team Explorer and my browsers all open at the same time.  I can already find a use for going with 6 monitors now, but that will have to wait…

I am definitely excited to see this new setup working for some of our SharePoint consulting and Team Foundation Server help we do.  Those projects always have a need for multiple applications and flipping between quickly to get the job done.

 


How to remove Wikipedia Blackout with Chrome
ozba - Posted 1/18/2012
As you all aware of, Wikipedia blackout their English website to protest against SOPA. Although I’m very much against that law, the blackout can really damage other people work and education. So for them here is the way to remove the blackout with using nothing but the chrome browser: 1. Go to your desired Wikipedia […]

What is SharePoint Solution Package?
Kalyan Bandarupalli - Posted 1/17/2012
  What is SharePoint Solution Package? SharePoint has a system which bundles all the components of a SharePoint Foundation extension in to a single file which is called a Solution Package. The Solution Package file has the extension .wsp.  The contents of solutions package are Assemblies Web Parts Site Definition files -  Site definition is a [...]

Getting values into a string
#Fellows - Posted 1/16/2012

There are often times where it’s necessary to have some sort of template in a string, with placeholders that will be replaced with data-driven values at runtime.  Examples of this include email templates, mail merges and even integration scenarios.  Now there are many sophisticated and complex approaches to solving this problem, but here is a simple approach that works:

public static class StringExtensions
{
    public static string AddTokens(this string message, object tokenValues)
    {
        return tokenValues.GetType()
                .GetProperties()
                .Select(property => new
                            {
                                Key = property.Name,
                                Value = property.GetValue(tokenValues, new object[0]) as string
                            })
                .Aggregate(message, (current, token) => current.Replace("{" + token.Key + "}", token.Value));

    }

}

And to show you how to use it:

[Test]
public void ShouldReplaceTokens()
{
    var result = "1234{numbers}890".AddTokens(new { numbers = "567" });
    Assert.AreEqual("1234567890", result, "Tokens not added correctly");
}

Analyzing CES 2012
Bill Evjen - Posted 1/15/2012

I just got back from the Consumer Electronics Show 2012 (CES) which was held in Las Vegas. This is a good show for me and the company that I work for as it shows us some of the possible future trends of digital media consumption. Things presented at CES may just come and go and be quickly forgotten, but at the same time, there are definite themes on the conference that companies need to pay attention to.

3D is so yesterday!

This was actually the second CES that I have been to and both were focused on different themes as it seemed to me. Last year’s CES was really all about 3D TVs and even some companies trying to show up the others with glassless 3D TVs. It was amazing to me how much hype there was around 3D televisions at the 2011 CES. The press was really all over this.

For me, I never really enjoyed the presentations on 3D TVs. I wear glasses and everything is tough for me to view on these TVs. My eyes strained constantly and watered when I watched. It was always an uncomfortable experience for me to view these types of TVs. There were many instances in watching 3D that you had to be perfectly positioned for the best picture. This approach obviously won’t work that well in the home. The glassless 3D televisions were the absolute worst when it came to positioning yourself in front of the TV. Being off a bit for a glassless television meant that you could almost be certain of a migraine.

As far as 2012, there really wasn’t that much in the way of 3D. Don’t get me wrong, it was there, but all the hype was gone. The reason is that it hasn’t really taken off in the public market. More people are gravitating to HD, LED, and Smart TVs while not getting to excited about 3D. The new 3D TVs would be fine if you are a massive movie buff and want to watch your 3D movies a lot, but in my opinion, they don’t fit in that well with the average home TV usage. Most people watch TV in a social setting, with others, their eyes moving from the people they are talking to and back to the television in constant glances. People are walking in and out of the room to stir the macaroni on the stovetop or something similar. This doesn’t make for a great 3D television experience. I think people like 3D – but they would rather have this experience in the theater rather than in the home.

So what is new in 3D? Well for one, there was some hype on better looking 3D glasses.

image

image

These glasses were being showcased in the LG booth. There were also quite a wide variety of other styles from some designer brands (e.g. Oakley, Alain Mikli, etc).

OLED TVs! I want one now!


imageWell, the thing that got me the most excited on the TV front was the new OLED TVs. These TVs are so thin (we were seeing them at 4mm thick!). They are also incredible bright and clear. Do you remember that experience when you saw HD for the first time and wondered how that was even possible? Well, looking at OLED was almost as good as that experience. It is considerably better than the HD TVs of today. The picture quality was amazing and the photos/videos here wouldn’t do it any justice.

This video doesn’t do the quality justice. It was way way better than this.

Even though, this is a video I took of the LG OLED TV. Here is a shot of the thinness of the TV (at 4mm thick) at the Samsung booth:

image

Smart TV Fight!

The entire smart TV arena is really starting to come to a battle on direction. First you have the television companies themselves working to bring apps and the entire application model to the television set. The TV companies are creating their own app world. You have Sony, LG, Philips, Samsung, and others working to create an application model that is good for them and their users. Originally there were TV companies that really had a walled-garden approach to their app world. Some of the companies would only allow their own company to supply the apps that were on the TV. But now, there was a lot of movement at CES to include SDKs so that application developers can build apps specifically for their TVs (some working in private clouds only).

By far the leader in this market is Samsung. They have been letting developers specifically develop for their TVs for some time now (really more than anyone else). They also have an SDK that is easy to use and get up to speed with. Samsung has a tremendous amount of support as well for the developers from their website. But with this new found love for the application developer from the TV companies, it is still very difficult for the app dev. It isn’t as if you are going to build a single instance of your application and then have the ability to get this application to work across all the TVs. In fact, you are going to be doing some serious work to build TV-specific applications where some of the TVs might have the APIs that you are looking for to complete your application while others fall considerably short. What is a TV application developer to do? Well – Google TV might be the answer.

Google TV was released in 2010 and basically the street thought that it failed right away. The UI was considered not that well designed and it was tough for the end user to figure out how to navigate through the application. Google then went back to the drawing board and came out in CES with their new Google TV.

I was really impressed with what they have designed. With Google TV, you will have access to the Android Market for applications that can be placed on your television. At this moment there are only about 150 applications that have been specifically designed for the TV, but they are their way.

The absolute best thing for TV application developers is that they can now build a single application for the TV and be agnostic to the underlying TV. This is really what the industry needs at the end of the day for maximum innovation and growth. I would think that the best approach for the television companies is to create an experience on top of Google TV so that it isn’t a vanilla branded version of Google TV. With this, they can do more that works specifically with their hardware while at the same time allowing end users to reach out to the application market. At CES, there were TV companies that were hedging their bets and showcasing both their own Smart TVs with their own environment, while also showcasing Google TV versions of their TVs.

The ability to work with TVs in an agnostic fashion as a TVappDev is also possible with some of these smart TV overriders such as Roku and Boxee. All in all, the Smart TV world is taking off and by 2015 most TVs sold will be smart TVs. It is pretty exciting and this will dramatically change the ways in which we are entertained. I look forward to these coming changes.

Concept Cars

Ok – I don’t work with cars as part of my job, but who doesn’t like to look at concept cars? CES had some neat ones:

image

Summary

I did enjoy myself at CES this year. There was some cool things and strange things as well. Some of those things included:

  • An alien from the upcoming Men In Black 3 walking the floor
  • Every booth selling something that was tied to an iPad in some fashion (iPads were EVERYWHERE!)
  • The new Galaxy Note (nice)
  • A section of a booth showing the new Walkman (huh?)
  • The new Sony and Nokia phones (Sony was using Android and Nokia was using Windows 7)
  • The Tesla car … (my photos were no good)

See you there next year!



Current PST time: 2/4/2012 2:28 AM
.NET Developers Blog - Add your blog