Automated Feedback Fun

In Continuous Integration in .NET there’s this cool section about using a LED Message Board. I had to try this and so in early December 2010 I bought one from USB Brando . I went cheap on the shipping and given the xmas shipping load I got it at the end of December. It worked fine but the code samples in the book did not work for me and I put it away. This morning I spent some time and was able to bugfix the code for VS2010.

LED Message Board

Working HID LED code is here. See my earlier blog about where to get the source code for the HID library for .NET.

I also was able to find the developers manual.

The author says he wanted an eye to display when a build breaks but the truth is the byte packets for the eye are exactly what the single code example in the dev manual shows. When time permits I’ll have to implement something more robust but for now at least I have working HID code.

Posted in Continuous Integration | Leave a comment

7 Deadly Sins of Slow Software Builds

Having had to wrestle with CI unfriendly software application solutions suffering from a cultural practice of many dozens of Visual Studio projects being checked in with inconsistent build output settings, I find that honing CI best practice skills is easier than changing team habits. Things are tough in the CI jungle with often little thought for deployment and how the software application will harvest multiple compiled output directories. I was happy to read about Usman Muzaffar and his 7 deadly sins of slow software builds.

  1. Make at the bottom
  2. Targets with side effects
  3. Multiple updated files
  4. Pass-based builds
  5. Output in the source directory
  6. Monoliths
  7. Bad dependancies

Chapter 12 of Continuous Integration in .Net goes into detail on these. And drum roll please, in 12.2.5 the magic words “The solution is obvious: point all the generated output from the build to a single folder”.

There never seems to be mental focus time for the build. Pretty much when I get into CI discussions, the person on the other end of conversion is busy with more important problems and fires to put out. With a pragmatic sigh and saddened with the real world “just hack around it in the build script” knowledge that the build is going to be brittle with code smells that could have been avoided if there was ubiquity, I wait. I wait for the future time when the build breaks and I have the attention that is needed for all players hearts and minds to be on board and going in the same direction. Having at least tried to effect change, one has to pick ones battles.

Posted in Uncategorized | Leave a comment

CI, CD and ADL with HID thrown in.

Past few weeks have been all about continuous integration, continuous delivery and application development life cycles.
I’ve read Continuous Integration in NET, skipping over the parts about TeamCity, and found it very helpful.
There is a really cool reference to Mike O’Brians HID library. This refers to Jan Axelsons HID page.

I have both 1st and 2nd editions of Using MSBuild and Team Foundation Build. The 2nd edition was within arms reach this past month.
I’ve installed and coded up 3 Cruise Control Servers and 1 GO Enterprise server and learned a lot about automated builds, tests and deployment pipelines.

There are many good examples of wiring up builds and deployments using CC. Here’s one.
And here’s the ccnet.config file.

Go Enterprise is newer and I haven’t yet found any really good sources that show how to implement it.

TFS Team Build and GO Enterprise both use a Server\Agent build controller architecture that utilizes a build agent pool. ThoughtWorks refers to this as a build grid.

A free test cover is PartCover.
White can be used for free rich client testing.
For free web app testing: Firefox and Selenium

For acceptance testing, see downloading and installing FitNesse.
and also FitSharp
Here’s an install example to not use port 80 : java -jar fitnesse.jar -p 8088

StyleCop can be downloaded here.

It’s not free but for code quality, NDepend.

For documentation use both SandCastle and Sandcastle Help File Builder

For MSIs : WiX Toolset on CodePlex

Visual Studio 2010 and the .NET Framework 4.0 have newer features for Web Deployment.

RoundhousE is CI for databases.

Posted in Continuous Integration | Leave a comment

History of Failures

Brian Keller makes a mention to the history of software failures in VS 2010 Software Testing Video.
“On average professional coders make 100 to 150 errors in every 1000 lines of code” Really? How was this so called fact determined? Steve McConnell in Code Complete refers to an Industry Standard of 15-50 errors per 1000 lines of “delivered” code.
1000 Lines of Code = KLOC
KLOC Brian Keller

Posted in Software Testing | Leave a comment

VS2010 Build Things

Lately I’ve been doing a lot of CI, getting underneath solutions and project files. Unloading product files just to get to the raw text works but I end up having to unload and reload. The PowerCommands plugin lets me simply right click.PowerCommands plugin

Posted in Uncategorized | Leave a comment

WPF with some Silverlight

  • Last Weds, 2/23/2011, I committed to 6 months of meeting once a month to discuss WPF4. Huge thanks to Ike Ellis and TIG !

This morning I woke up thinking that because my TIG commitment was only for reading 100 pages a month of Adam Nathans WPF4 Unleashed,  it would be interesting to read several WPF books at once. Why? I believe the process of comparing experts will give me a quantum grasp of WPF I could not get by reading the books separately. The books I will be reading are:

WPF and Silverlight books

Source Code

WPF4 Unleashed Code

Pro WPF in C# Code

Pro Silverlight 4 in C# Code

First Impressions and Thoughts

The Unleashed series generally are for beginning and intermediary knowledge.

The Pro series are generally deep reference and are for intermediary to advanced knowledge.

Adam Nathans WPF4 Unleashed claims to be the #1 WPF book.

Matthew MacDonalds Pro .Net 2.0 Windows Forms  has been a solid reference of mine for many years. He is well known for his Pro series and I have many of his books.

I wouldn’t have noticed this if I was reading the books separately but Apress uses thicker pages than Sams. Pro Silverlight 4 is about the same number of pages (874) as WPF4(824) but it is much fatter and it’s not due to the 50 page difference.  Pro WPF in C# 2010 is a monster with 1180 pages. Carrying all 3 books in a backpack adds just over 10 pounds.  I really did weigh them on a bathroom scale by subtracting my weight and, yes, I did brush my teeth while waiting for the digital scale to reset.
WPF4 and Pro Silverlight both are colorized. Pro WPF is not. I must say I do like the color.

Apress has a special through March 11 where you can buy the eBook for $10.
Sams offers a free 30 pass to Safari Books Online

Chapter 1 and The Intros

Mathew MacDonald immediately devotes 3 pages to WPF graphics in Pro WPF.
I’ve been working in the corporate world where cheap underpowered video cards are the norm. While I was reading the new amazing world that WPF opens up , I couldn’t help but ponder the sad reality that developing and then delivering WPF sizzle is going to suffer somewhat for the near future. Not from what WPF can do, but that the WPF Wow factor will be stuck in Rendering Tier 0 until the corporate world catches up to Windows 7 , the corporate bean counters get sold on spending $50 more per desktop for a passable DirectX card, and that network support decision makers get on board with updating video drivers on locked down systems. Change can be hard and effecting change in the Fortune 500 world can move at glacial speed.
See Rendering Tiers

Dxdiag.exe is the DirectX Diagnostic Tool. DxDiag.exe Signing
DxDiag.exe

WPF provides an interoperabilty layer between WPF and Windows Forms that allows each to run the other.
WPF only runs on Windows.
MacDonald specifically states on page 7 of Pro WPF that the ultimate goal of Silverlight is to be a competitor to Flash.
WPF scales on the system DPI and not the physical display device.

WPF uses device-independent images for everything it displays.

Architecture

  • PresentationFramework.dll – most classes you use come from PresentationFramework.dll

PresentationFramework

  • PresentationCore.dll – base types

PresentationCore

  • Windowsbase.dll

WindowsBase

  • milcore.dll -core of WPF rendering system (managed graphics)
  • windowscodecs.dll – low-level API for imaging
  • Direct3D – low-level API for all graphics
  • User32 – controls what program gets what real estate

Class Hierarchy
WPF Class Hierarchy

  • System.Threading.DispatcherObject – Abstract class. WPF uses STA so, like winforms, the entire UI is on a single thread.
  • System.Windows.DepenencyObject – Change notification, inherited default values, property storage.
  • System.Windows.Media.Visual -  Abstract class for drawing instructions and drawing functionality.
  • System.Widows.UIElement – LIFE- layout,input,focus and events.
  • System.Windows.FrameworkElement – Implements from UIElement. Adds data binding, animation and styles.
  • System.Windows.Shapes.Shape – Abstract class. Basic shapes
  • System.Windows.Controls.Control – Elements that can interact with the user.
  • System.Windows.Controls.ContentControl – Base class for all controls that have a single piece of content.
  • System.Windows.Controls.ItemsControl – Base class for all controls that show a collection of items.
  • System.Windows.Controls.Panel – Base class for all layout containers.

WPF 3.5 SP1 added the WPF datagrid control.

WPF Toolkit

Visual Studio 2010 allows building (2) profiles. One is the full .NET 4.0 framework and the other is the .NET Client profile which is    more lightweight and is about 30 megs.
The Client profile is the default.

5 Key Standoput Principles

  1. Hardware Acceleration – It’s all DirectX
  2. Resolution Independence – Scales up or down
  3. No fixed control appeareance – Same rendering engine for everything
  4. Declarative user interface – XAML
  5. Object-based drawing  – No need to work with Paint and pixels

Pro Silverlight 4 quickly gets to Flash, discussing that Silverlight is a browser plug-in and making clear that Flash does not have a modern programming environment. Of note is the statement that it is estimated that circa 2010 Silverlight is installed on 53 per cent of internet connected computers.  Silverlight runs on MACS with OS X 10.4.8 or newer, if they have the newer Intel hardware.  For Linux, Moonlight 2 was released on Dec 17, 2009 and based on the Moonlight Roadmap,  seems to be stalled on Silverlight 2.0.

I just watched the Dec 2, 2010 Silverlight Firestarter 2010.  Wow! Absolutely amazing.  I’ll be watching for how Silverlight 5 goes with beta the 2011 H1 release and for the release of Silverlight 5 at the end of 2011.

Cool Silverlight 3 App WorldwideTelescope.Org

Posted in WPF Ramblings | Leave a comment

XAML – Coding

XAML Coding Notes

http://schemas.microsoft.com/winfx/2006/xaml/presentation

WPF retrofits all previous namespaces so 2006 in the namespace really means 3.0 Or Later

  • XAML is case-sensitive
  • Declaring a XAML element is the same as newing up a default constructor in C#

The default XAML Namespace implicitly maps t0 several .NET namespaces:

  • System.Windows
  • System.Windows.Automation
  • System.Windows.Controls
  • System.Windows.Controls.Primitive
  • System.Windows.Data
  • System.Windows.Documents
  • System.Windows.Forms.Integration
  • System.Windows.Ink
  • System.Windows.Media
  • System.Windows.Media.Animation
  • System.Windows.Media.Effects
  • System.Media.Imaging
  • System.Media.Media3D
  • System.Media.TextFormatting
  • System.Navigation
  • System.Windows.Shapes
  • System.Windows.Shell

Type Converters

System.ComponentModel.TypeConverterAttribute is how the XAML parser finds a property value type converter.

Markup Extensions

Attribute values wrapped in curly braces


Posted in XAML | Leave a comment

XAML – General

XAML Notes

XAML

XAML Syntax In Detail

XAML Mapping Specification
XAML Vocabulary Specification
XAML Silverlight Vocabulary Specification

Default Namespaces
xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”

WPF XAML processors and serializers will ignore or drop all nonsignificant whitespace, and will normalize any significant whitespace.

  • WPF, WF, Silverlight
  • Elements map to CLR object instances.
  • Attributes map to properties and events on those objects
  • XAML uses Templates for style, which is different than CSS (More closer to XBL, a Mosiac binding language)

WPF 4 Unleashed references several XAML editors. As the book is circa 2010 and it’s 2011 I’m starting with Kaxaml as Kaxaml has been upgraded for .NET 4.0.
During install I unchecked everything so I could turned off defaulting to Kaxaml as I wanted VS2010 to be the default.

TurnOffDefaults

There’s a lot of features in Kaxaml

KaXaml Play

Adam Nathan does a nice job of driving home the important concept that XAMLs purpose is to provide the engineering to allow WPF, Silverlight or WF objects to use the .NET framework and that XAML should not be compared to HTML or SVG.
Mathew MacDonald does not draw this distinction in Chapter 2 Pro Silverlight 4 in C# and specifically refers to XAML as providing HTML-like functionality.

Posted in XAML | Leave a comment

WPF – Beginning Learning

Notes on WPF 4

    3.0 – Nov 2006
    3.5 – Nov 2007
    3.5 sp1 & WPF Toolkit – Aug 2008
    4.0 – April 2010

XAML Syntax In Detail

Building a WPF App

Reviews of the 3.5 Toolkit on codeplex imply that it should be avoided so on the new dev system I’m building out I am going to avoid it and stay with a 4.0 framework install.

All WPF apps start with 2 threads, an UI and a background thread. This is different from WinForms which start with a single thread.
Supported Video formats should be everything that runs on Windows Media Player.

Below is a snapshot of Snoop 2.6.1 with a blank MVC app on VS 2010 RTM. I’ll do a compare once I get several WCF apps going.
wpf snoop

I’ve read and heard various opinions on the topic of Silverlight and WPF. The public consensus that WPF is the Parent Set and Silverlight is the Subset Child seems to be a oversimplification that works well for light conversation.
At the end of Chapter 1 of Adam Nathans WPF4 Unleashed, he begins describing Silverlight, not in the usual way that intro demos do by first referring to it as a subset of Daddy WPF but as smaller version of the .NET Framework. He does then later echo the party line that Silverlight is a subset of WPF but he qualifies it with a ” mostly ” and a ” plus ” and he does not mention plugin, the Flash influence or the 4 mb size thing when he first introduces Silverlight. He does clearly convey that WPF and Silverlight should be thought of as two different implementations, with WPF being Full Framework and Silverlight being Small Framework.
Mathew MacDonalds Pro Silverlight 4 in C# prefers to use the word “borrows” to describe what Silverlight is compared to WPF and in his Chapter 1 into he does quickly state that the WPF XBAP browser hosted app approach makes WPF, unlike Silverlight which has Moonlight for Linux, a Windows-only app. So it seems that MAC and Linux users need some extra effort to play with WPF.

Posted in WPF Ramblings | Leave a comment

Old dog ramblings

After 15 years of writing good and bad code, me thinks the trade winds will still be blowing for salty dog legacy developer jobs as long as:

  • Desktop computers do not think for themselves.
  • Delivering prior years functional apps on schedule was more of a priority than good design.
  • Active business software solutions suffer from Uncle Bob Martins 3 traits of bad design.
  • Competitors are reducing company profits but not siphoning dry the main cash cows.
  • Customers are complaining about the software but not leaving.
  • Actually understanding Donald Knuth is not a hiring requirement.
  • Heuristic corporate cultures have budgets

As legacy apps are not the only game in town, for 2011 my goals are to narrow the massive goop of technology and specialize in MVC2 and 3, WPF, Silverlight along with a deep dive into Entity Framework and tie it all together with a serious immersion in Design and Architecture

Posted in Uncategorized | Leave a comment