Thursday, October 30, 2008

Brief: Powershell With Visual Studio 2008

Books:

Windows PowerShell Cookbook

Microsoft Windows Powershell Step by Step


 

Links:

Powershell Main Page

http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx

Powershell Team Blog

http://blogs.msdn.com/Powershell/

UI Automation Article

http://msdn.microsoft.com/en-us/magazine/cc337896.aspx?pr=blog


 

Visual Studio Addins:

CodePlex project Powershell inside VS2008

http://www.codeplex.com/VSCmdShell

CodePlex project Powershell Debugger Visualizer

http://www.codeplex.com/PoshDebugVisualizer

Wednesday, October 29, 2008

Code: Powerscript to remove directory


 


 

$ReleaseList = Get-Content '.\ReleaseList.txt'

foreach($Directory in $ReleaseList)

{

Write-Host "Removing Directory: " $Directory

if (Test-Path -Path $Directory)

{    

remove-item -recurse $Directory

}

else

{

Write-Host "Directory does not exist: $Directory"

}    

}

Wednesday, October 22, 2008

Tuesday, October 7, 2008

Outline Microsoft Partner Competency Requirements

Microsoft Partner Competency

Competencies

  • Small Business
  • Advance Infrastructure Solutions
  • Business Intelligence
  • Custom Development Solutions
  • Data Management Solutions
  • Hosting Solutions
  • Information Worker Solutions
  • ISV/Software Solutions
  • Learning Solutions
  • Microsoft Business Solutions (Dynamics)
  • Mobility Solutions
  • Networking Infrastructure Solutions
  • OEM Solutions
  • Security Solutions
  • SOA and Business Process
  • Unified Communications Solutions


 

Requirements

  • Small Business
    • Small Business Sales and Marketing exam
    • One of three (four) technical exams
      • 70-282 deploy network
      • 70-236 Exchange Server 2007, Configure
      • 74-134 OEM Preinstall Kit
      • 70-631 Sharepoint 3.0, Configure
  • Advance Infrastructure Solutions
    • https://partner.microsoft.com/40012655
    • Specializations
      • Active Directory
        • Two Advanced MCP: MCSE, MCSD, MCDBA
        • One of four exams
          • 70-294 Planning 2003 Active Directory
          • 70-297 Design 2003 Active Directory
          • 70-640 Configure 2008 Active Directory
          • 70-647 Server 2008, Enterprise Manager
        • Three refs
      • Systems Management
        • Two Advanced MCP: MCSE, MCSD, MCDBA
        • One of four exams (increase to two, June 2009)
          • 70-400 SC Operations Manager, Configuring
          • 70-401 SC Configuration Manager, Configuring
          • 70-089 Systems Management Server 2003 (del. June 2009)
          • 70-290 Managing Server 2003 Environment (del. June 2009)
        • Three refs
      • Storage Solutions
        • Two Advanced MCP: MCSE, MCSD, MCDBA
        • One of eight exams
          • Exam 70-270—Installing, Configuring, and Administering Windows XP Professional
          • Exam 70-291—Implementing, Managing, and Maintaining a Windows Server 2003 Network Infrastructure
          • Exam 70-293—Planning and Maintaining a Windows Server 2003 Network Infrastructure
          • Exam 70-297—Designing a Windows Server 2003 Active Directory and Network Infrastructure
          • Exam 70-620—TS: Configuring Windows Vista Client
          • Exam 70-621—PRO: Upgrading your MCDST Certification to MCITP Enterprise Support
          • Exam 70-640—TS: Windows Server 2008 Active Directory, Configuring
          • Exam 70-642—TS: Windows Server 2008 Network Infrastructure, Configuring
        • Three refs
      • Windows Desktop Deployment
        • Two MCP
        • One of four exams
          • Exam 70-620; TS: Windows Vista, Configuring
          • Exam 70-621; PRO: Upgrading your MCDST Certification to MCITP Enterprise Support
          • Exam 70-622; PRO: Supporting and Troubleshooting Applications on a Windows Vista Client for Enterprise Support Technicians
          • Exam 70-624; TS: Deploying and Maintaining Windows Vista Client and 2007 Microsoft Office System Desktops
          • Exam: 70-656; TS: Configuring Microsoft Desktop Optimization Certification Pack
        • Three refs
  • Business Intelligence
    • Business Intelligence Platform
      • Two MCP
      • One of five exams
        • Exam 70-228—Installing, Configuring, and Administering Microsoft SQL Server 2000 Enterprise Edition
        • Exam 70-229—Designing and Implementing Databases with Microsoft SQL Server 2000 Enterprise Edition
        • Exam 70-431—TS: Microsoft SQL Server 2005—Implementation and Maintenance
        • Exam 70-445—TS: Microsoft SQL Server 2005 Business Intelligence—Implementation and Maintenance
        • Exam 70-446—PRO: Designing a Business Intelligence Infrastructure by Using Microsoft SQL Server 2005
      • Three refs


         

    • Performance Management
      • Two MCP

      • 70-556: TS: Microsoft Office PerformancePoint Server 2007, Applications.

      • Three refs
  • Custom Development Solutions
    • Two MCPD, MCSD, MCAD
    • Three refs
  • Data Management Solutions
    • Two MCP
    • One of eight exams
      • Exam 70-228—Installing, Configuring, and Administering Microsoft SQL Server 2000 Enterprise Edition
      • Exam 70-229—Designing and Implementing Databases with Microsoft SQL Server 2000 Enterprise Edition
      • Exam 70-431—TS: Microsoft SQL Server 2005—Implementation and Maintenance
      • Exam 70-441—PRO: Designing Database Solutions by Using Microsoft SQL Server 2005
      • Exam 70-442—PRO: Designing and Optimizing Data Access by Using Microsoft SQL Server 2005
      • Exam 70-443—PRO: Designing a Database Server Infrastructure by Using Microsoft SQL Server 2005
      • Exam 70-444—PRO: Optimizing and Maintaining a Database Administration Solution by Using Microsoft SQL Server 2005
      • Exam 70-447—UPGRADE: MCDBA Skills to MCITP Database Administrator by Using Microsoft SQL Server 2005
    • Three refs
  • Hosting Solutions
    • Two MCT, MCSA, MCAD, MCSD, MCSE, MCDBA
    • Sales: 75 processor or 3000 subscriber
    • Three refs
  • Information Worker Solutions


 

  • ISV/Software Solutions
    • Tested Software
    • Three refs
  • Learning Solutions
  • Licensing Solutions
    • License Delivery
      • Two MCP
      • One of two tests
        • Exam 70-671: Designing and Providing Microsoft Volume Licensing Solutions to Small and Medium Organizations
        • Exam 70-672: Designing and Providing Microsoft Volume Licensing Solutions to Large Organizations
      • Three refs
    • Software Asset Management
      • Two MCP
      • Exam 70-123: Planning, Implementing, and Maintaining a Software Asset Management (SAM) Program.
      • Three refs
  • Microsoft Business Solutions (Dynamics)
    • Microsoft Dynamics AX
    • Microsoft Dynamics C5 (Denmark only)
    • Microsoft Dynamics CRM
    • Microsoft Dynamics GP
    • Microsoft Dynamics NAV
    • Microsoft Dynamics POS
    • Microsoft Dynamics SL
  • Mobility Solutions
    • Two MCP
    • Both exams (after Feb 15 2009)
      • 70-500: TS: Microsoft Windows Mobile Designing, Implementing, and Managing
      • 70-540: TS: Microsoft Windows Mobile 5.0 - Application Development
    • Three refs
  • Networking Infrastructure Solutions
    • Two MCP
    • One of 12 exams
      • Exam 70-270—Installing, Configuring, and Administering Microsoft Windows XP Professional
      • Exam 70-282—Designing, Deploying, and Managing a Network Solution for the Small and Medium-Sized Business
      • Exam 70-290—Managing and Maintaining a Microsoft Windows Server 2003 Environment
      • Exam 70-291—Implementing, Managing, and Maintaining a Windows Server 2003 Network Infrastructure
      • Exam 70-293—Planning and Maintaining a Windows Server 2003 Network Infrastructure
      • Exam 70-294—Planning, Implementing, and Maintaining a Windows Server 2003 Active Directory Infrastructure
      • Exam 70-297—Designing a Windows Server 2003 Active Directory and Network Infrastructure
      • Exam 70-298—Designing Security for a Windows Server 2003 Network
      • Exam 70-299—Implementing and Administering Security in a Windows Server 2003 Network
      • Exam 70-350—Implementing Microsoft Internet Security and Acceleration (ISA) Server 2004
      • Exam 70-620—TS: Configuring Windows Vista Client
      • Exam 70-621—PRO: Upgrading your MCDST Certification to MCITP Enterprise Support
    • Three refs
  • OEM Solutions
    • Sell OS: 150 client OR 15 server
    • 2 MCP (or 1 and a Designed for Windows Server)
    • One test of 13


       

  • Security Solutions
    • Infrastructure Security Specialization
      • One MCP with one of:
        • Exam 70-350– Implementing Microsoft Internet Security and Acceleration (ISA) Server 2004
        • Exam 70-351– TS: Microsoft Internet Security and Acceleration (ISA) Server 2006, Configuring
        • Exam 70-557– TS: Microsoft Forefront Client and Server, Configuring
      • And one of
        • (ISC)2 Certified Information Systems Security Professional (CISSP)
        • (ISC)2 Systems Security Certified Practitioner (SSCP)
        • Information Systems Audit and Control Association (ISACA) Certified Information Systems Auditor (CISA)
        • ISACA Certified Information Systems Manager (CISM)
      • Second MCP with one of
        • Exam 70-350– Implementing Microsoft Internet Security and Acceleration (ISA) Server 2004
        • Exam 70-351– TS: Microsoft Internet Security and Acceleration (ISA) Server 2006, Configuring
        • Exam 70-557– TS: Microsoft Forefront Client and Server, Configuring
      • Three refs
    • Identity and Secure Access Specialization
      • One MCP with one of:
        • Microsoft Certified Systems Engineer (MCSE)
        • Microsoft Certified Systems Developer (MCSD)
        • Microsoft Certified Database Administrator (MCDBA) on Microsoft Windows Server 2003 or Windows 2000 operating systems
        • Microsoft Certified IT Professional (MCITP) Database Administrator

          Or, who has achieved one of the following third-party security certifications:
        • (ISC)2 Certified Information Systems Security Professional (CISSP)
        • (ISC)2 Systems Security Certified Practitioner (SSCP)
        • (ISC)2 Certification and Accreditation Professional (CAP)
        • Information Systems Audit and Control Association (ISACA) Certified Information Systems Auditor (CISA)
        • ISACA Certified Information Systems Manager (CISM)
        • ISACA Certified in the Governance of Enterprise IT (CGEIT)
      • And
        • Exam 70-294: - Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure
        • Exam 70-297: - Designing a Microsoft Windows Server 2003 Active Directory and Network Infrastructure
        • Exam 70-640: - TS: Windows Server 2008 Active Directory, Configuring
        • Exam 70-647: - PRO: Windows Server 2008, Enterprise Administrator
      • Second MCP with one of
        • Exam 70-294: - Planning, Implementing, and Maintaining a Microsoft Windows Server 2003 Active Directory Infrastructure
        • Exam 70-297: - Designing a Microsoft Windows Server 2003 Active Directory and Network Infrastructure
        • Exam 70-640: - TS: Windows Server 2008 Active Directory, Configuring
        • Exam 70-647: - PRO: Windows Server 2008, Enterprise Administrator
      • Three refs
  • SOA and Business Process
    • Two MCP
    • One of n tests
      • Exam 70-235—TS: Developing Business Process and Integration Solutions Using Microsoft BizTalk Server
      • Exam 70-300Analyzing Requirements and Defining Microsoft .NET Solution Architectures
      • Exam 70-310Developing XML Web Services and Server Components with Microsoft Visual Basic .NET and the Microsoft .NET Framework
      • Exam 70-320Developing XML Web Services and Server Components with Microsoft Visual C# .NET and the Microsoft .NET Framework
      • Exam 70-431TS: Microsoft SQL Server 2005 - Implementation and Maintenance
      • Exam 70-526—TS: Microsoft .NET Framework 2.0 - Windows-Based Client Development
      • Exam 70-529—TS: Microsoft .NET Framework 2.0 - Distributed Application Development
      • Exam 70-549PRO: Designing and Developing Enterprise Applications by Using the Microsoft .NET Framework
      • Exam 74-135Developing E-Business Solutions Using Microsoft BizTalk Server 2004
    • Three refs
  • Unified Communications Solutions


 


 

Resources

Monday, October 6, 2008

Brief: Microsoft Partner Competency

Microsoft Partner Competency

Competencies

  • Small Business
  • Advance Infrastructure Solutions
  • Business Intelligence
  • Custom Development Solutions
  • Data Management Solutions
  • Hosting Solutions
  • Information Worker Solutions
  • ISV/Software Solutions
  • Learning Solutions
  • Microsoft Business Solutions (Dynamics)
  • Mobility Solutions
  • Networking Infrastructure Solutions
  • OEM Solutions
  • Security Solutions
  • SOA and Business Process
  • Unified Communications Solutions


 

Requirements

  • Small Business
    • Small Business Sales and Marketing exam
    • One of three (four) technical exams
      • 70-282 deploy network
      • 70-236 Exchange Server 2007, Configure
      • 74-134 OEM Preinstall Kit
      • 70-631 Sharepoint 3.0, Configure
  • Advance Infrastructure Solutions
  • Business Intelligence
  • Custom Development Solutions
  • Data Management Solutions
  • Hosting Solutions
  • Information Worker Solutions
  • ISV/Software Solutions
  • Learning Solutions
  • Microsoft Business Solutions (Dynamics)
  • Mobility Solutions
  • Networking Infrastructure Solutions
  • OEM Solutions
  • Security Solutions
  • SOA and Business Process
  • Unified Communications Solutions


 


 

Resources

Brief: Microsoft Certified Partner

Certified Partner

Gold Partner

  • 120 Points
  • One competency minimum


 

Points Toward Partnership

  • 30 Per Compentency
  • 20 First Compentency bonus
  • 25 Small Business Competency
  • 40 (max) for Certified Professionals, ranges from 1 for MCP to 10 for Architect
  • 20 (max) for Customer References, 2 per customer
  • 70 (max) Tested Products
  • 20 (max) Sales OS
  • 60 (max) Sales Business Solutions
  • 20, + 20 bonus, Customer Satisfaction Surveys, bonus for Net Satisfaction
  • 20 (max ) ISV Royalty Program
  • 20 (max) Customer Assessments, 1 point per 5 assessments

Monday, September 29, 2008

Flash, Silverlight and JavaScript Performance

Here is an interesting head to head performance comparison of Flash and Silverlight:

http://www.itwriting.com/primetest/index.html


 

Both grind thru a less than optimal algorithm for finding a bunch of prime numbers.

Code is provided in another link so that you can see that it is apples to apples in terms of the code implemented.


 

On my machine, I saw an over two one advantage for Silverlight. Silverlight ran 1M prime checks in .8892285 seconds and Flash took 2.153 seconds for the same. This ratio held up over a range of values:


 

Number

Flash

Silverlight

Ratio

1 M

2.153

0.8892285

2.42119995

2 M

5.477

2.3092736

2.371741486

3 M

9.627

4.056832

2.373033934

4 M

14.324

6.0697226

2.359910155

5 M

19.692

8.3445947

2.359850982

6 M

25.895

10.802571

2.397114539

7 M

31.773

13.3872827

2.373371857

8 M

38.599

16.1520106

2.389733449

9 M

45.238

19.0887398

2.369878812


 

Another individual, Tobin Harris no doubt, has provided a JavaScript implementation at:

http://www.tobinharris.com/primes.html


 

It took 54 seconds for the 1M to run in JavaScript. But this result had to be thrown out because IE was constantly popping up a dialog asking if the JavaScript should be terminated. Although that is a lesson in and of itself that JavaScript running loose in the browser will face ever increasing scrutiny that diminishes it's usefulness.


 

Friday, September 26, 2008

What Does Agile Lack?


In this "The Register" article AgileDevelopmentLessonsLearned the truth comes out.

Agile is suffering from what it lacks, specifically:
Effective Management
Design and Analysis
Developer Tools








Wednesday, September 24, 2008

Roll Back on Team System Source Control

To perform the equivalent of a roll back with Team System Source Control, you must create a changeset that contains the contents of the roll back.

  1. Get specific version
  2. Right click the root of the Source Control tree and select compare
  3. Select all and then select reconcile from context menu
  4. Reconcil Folder Differences"
  5. On drop down menu "Files that do not have pending changes select "check out"
  6. Check in

Saturday, September 20, 2008

Code F#: Generate Pascal Triangles

The following is code written in F#. It generates a list of Pascal Triangles.

#light


 

let oddTriangle x = [x, ( x * x - 1) / 2, (x * x + 1) / 2]

let evenTriangle x = [ 2 * x, (x * x) - 1, (x * x ) + 1]


 

let pairTriangle x = [ oddTriangle (2 * x - 1), evenTriangle x ]


 

let numbers = [ 1 .. 100]


 

let perfectTriangles = List.map pairTriangle numbers


 

printf "%A" perfectTriangles


 

open System

Console.ReadKey(true)


 

Output:

[[([(1, 0, 1)], [(2, 0, 2)])]; [([(3, 4, 5)], [(4, 3, 5)])];

[([(5, 12, 13)], [(6, 8, 10)])]; [([(7, 24, 25)], [(8, 15, 17)])];

[([(9, 40, 41)], [(10, 24, 26)])]; [([(11, 60, 61)], [(12, 35, 37)])];

[([(13, 84, 85)], [(14, 48, 50)])]; [([(15, 112, 113)], [(16, 63, 65)])];

[([(17, 144, 145)], [(18, 80, 82)])]; [([(19, 180, 181)], [(20, 99, 101)])]]

Tuesday, September 9, 2008

Publishing to Blogger From MS Word


 

XML has always been difficult to get posted on blogger.

Here is a test case:

<?xml version="1.0"?>

<!--

Note: As an alternative to hand editing this file you can use the

web admin tool to configure settings for your application. Use

the Website->Asp.Net Configuration option in Visual Studio.

A full list of settings and comments can be found in

machine.config.comments usually located in

\Windows\Microsoft.Net\Framework\v2.x\Config

-->

<configuration>

<appSettings>

</appSettings>

<connectionStrings>

</connectionStrings>

    <system.web>

<sessionState

cookieless="true"

regenerateExpiredSessionId="true"

timeout="30" />


 

<!--

Set compilation debug="true" to insert debugging

symbols into the compiled page. Because this

affects performance, set this value to true only

during development.

-->

        <compilation debug="true"/>

        <!--

The <authentication> section enables configuration

of the security authentication mode used by

ASP.NET to identify an incoming user.

-->

        <authentication mode="Windows"/>

        <!--

The <customErrors> section enables configuration

of what to do if/when an unhandled error occurs

during the execution of a request. Specifically,

it enables developers to configure html error pages

to be displayed in place of a error stack trace.


 

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">

<error statusCode="403" redirect="NoAccess.htm" />

<error statusCode="404" redirect="FileNotFound.htm" />

</customErrors>

-->

    </system.web>

</configuration>

Saturday, August 30, 2008

Separate Installs for Service and Desktop Application

The install originally lumped a Windows Service and a Desktop application together in one install.


This created a problem in the Install for Everyone. The Resilency was firing because of items in the Desktop application install. Specifically, Shortcuts installed per user were causing the Resilency install to fire when the second user logged in.

The Windows Service Installer does not handle this situation. And testing for the existence of the service causes a corrupt install state.

The less than ideal solution was to have separate installers for the two components.

Monday, August 25, 2008

Fixing: Error 1001. The specified service already exists

Fixing: Error 1001. The specified service already exists

Description: This error occurred during a per user install. The install was using the installer classes for services. The application was installed for all users. When a second user ran the installer classes tried to install the service again. This is fixed by testing for the existence of the service and skipping the service install if it already exists.

Sunday, August 24, 2008

Code: Test For Service Existence

Code To Test For Service Existence


bool serviceExists = false;
foreach ( System.ServiceProcess.ServiceController serviceController in System.ServiceProcess.ServiceController.GetServices())
{
if (serviceController.ServiceName == "TwentyTwentyLiveService")
{
serviceExists = true;
}
}

Saturday, August 23, 2008

Code: Determining If A User Is An Admin

There are several built in roles to help determine if the user is an Admin, User or Guest.


 WindowsIdentity currentIdentity = WindowsIdentity.GetCurrent();

WindowsPrincipal currentPrincipal = newWindowsPrincipal(currentIdentity);
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
if (currentPrincipal.IsInRole(WindowsBuiltInRole.Administrator))
{
  //Administator code
}
if (currentPrincipal.IsInRole(WindowsBuiltInRole.User))
{
 // User code
}
if (currentPrincipal.IsInRole(WindowsBuiltInRole.Guest))
{
 // Guest or anonymous code
}

Friday, August 22, 2008

Level 2 Ignorance

"You do not know what you do not know."

This quote travels in IT/IS communities. The humor lies in the second of the double meanings. Not only do you not know some thing. But there are also things you don't know and you are unaware of what they are. These are the Level 2 in The Five Levels Of Ignorance.

There are two dynamics at work here on the one hand your Level 2 Ignorance is like a minefield of problems. On the other hand simply learning the name of things which you do not know transforms them into Level 1 Ignorance.

These dynamics illuminate why command and control systems, everything from communism to waterfall, fail. And methods which stress grassroots bottom up development, like Agile, have shown stunning results.

The command and control tries to plan everything beforehand while all the participants are in their highest states of Level 2 Ignorance. In fact because the organization is making no attempt to discover Level 2 Ignorance it is operating at Level 3 Ignorance.

In contrast, the bottom up methods stress experimenting and thus gaining knowledge of the problem space. This will result in ignorance being discovered. Which means these methods guard against Level 3 Ignorance and thus are eliminating Level 2 Ignorance as well.

Thursday, August 21, 2008

Fixing: Access to the path 'Global\.net clr networking' is denied

Fixing: Access to the path 'Global\.net clr networking' is denied


Description: The problem occurred in an application that leverages 'WindowsFormsApplictionBase' to create a singleton application. It occurs when logged in as 'Guest'


Resolution: We test for 'Guest' and display a form stating the application must be run with a non Guest account. Guest is severely restricted.


Comments: The application "Shared View" does not display this problem when log in as the Guest account. Since "Shared View" was deployed as a ClickOnce, it likely is using 'WindowsFormsApplictionBase'. It is possible they are using Impersonation to give the code a different execution context.

Wednesday, August 20, 2008

Reflecting On Browser Properties


We are armpit deep in Mobile Development and facing multiple Level 2 Ignorance traps.
One area concerns browsers. As each Mobile Platform has a unique browser and browser settings.
To help with this, we have a page where we use Reflection to dump out the browser properties.
Note the code has a "evil" empty try catch, our code is similar (read much improved).
But I though it would be handy to provide the essence of the solution.
Type
browserType = Request.Browser.GetType();
foreach (PropertyInfo propertyInfo in
browserType.GetProperties())
{
try
{
Response.Write(propertyInfo.Name +
" : " + propertyInfo.GetValue(Request.Browser, null).ToString()
;
}
catch
{
}
}

Tuesday, August 19, 2008

Sorted HashTable

Recently, I wanted a sorted HashTable.

After struggling with the System.Collections.HashTable, I remembered the definition of hash table.

What I really needed to use was the SortedList. So this is more a reminder that I need to find (or write) a users guide for the System.Collections part of the Framework.

Monday, August 18, 2008

Automated Builds Closing The Door On Ignorance

Arguably the Automated Builds and Integration Builds (2 of the 12 Basic Software Development Practices) form the hinge upon which software development succeeds or fails.

By having an integration build which is automated you are in the position to close the door on some Level 2 Ignorance. To recap Level 2 Ignorance is when you do not know something and at the same time you are unaware of it. (For more see Five Levels Of Ignorance).

The automated integrated build informs you immediately when certain bugs have been introduced. As such you are no longer Level 2 Ignorant of those bugs because you know of them. Granted you may not be able to fix them and so you are at Level 1 Ignorance, but this is an improvement.

Either you caused them, in which case you will learn something you are doing wrong, which remedies something that would otherwise be Level 3 Ignorance. The same is true if someone else caused the bug, they are not aware of the bug and they are not aware they are doing something wrong which is causing bugs.

Absent this build process, your team would be at Level 3 Ignorance of things that cause bugs. A very dangerous place to be. If you remain there your project will fail.

Sunday, August 17, 2008

Web Application and Web Site Development Models

Web Application and Web Site Development Models

History

Visual Studio 2003 introduced the Web Application model. Visual Studio 2005 introduced the Web Site model and initially did not allow the Web Application model. Developers complained and a plug-in was released to allow Visual Studio to do Web Applications. Developer Express Supports only Web Site model originally but will add support in WDE 2008 SP1.

Web Application

A Web Application is project based. If the resource is not in your project it does not exist.
It must be deployed to be used.
Easier to work with Source Control since the projects expose source control syncronization files.
By default, all code is compiled, class files, code behind files, designer files, into a single assembly.
Content files, .ASPX and .ASCX, are compiled dynamically.
With Web Applications you have control over the names of assemblies.
Web Applications also have the ability to create a Web Application from multiple Web Projects.
Web Applications have the ability to run pre-build and post-build steps during compilation.

Web Site

A Web Site is folder based, if it is in the folder it is part of the Web Site.
Web Sites automatically deploy site using HTTP, FTP or File System.
Web Sites run on IIS, they do not run locally for HTTP and FTP.
If you specify local file system the site will run with the local development server.
A Solution file gets created but does not have any information.
Web pages and code files are compiled dynamically. (There are precompile options)
Gives you the ability to open and edit any directory as a Web Project without a project file.
Ability to generate one assembly for each page which could result in a performance gain.

Saturday, August 16, 2008

Blackberry Visual Studio Plugin

Blackberry provides for free a plug-in for Visual Studio. The current version is a beta for Visual Studio 2008. There is a prior version for VS2005.

After installing, you can launch the blackberry emulator directly. Also after selecting File->New -> Project... , you will see there is a new installed template for Blackberry. Running the template results in a working project without any additional code.

This plug-in is a great start as it provides an excellent Blackberry emulator and an environment for starting Blackberry mobile device development.

Friday, August 15, 2008

Three Persons Of Ignorance

Me, You and the Organization.

This is based on the Five Levels Of Ignorance which I recap the bullet points:

Level 0: Knowledge
Level 1: Ignorance with Awareness
Level 2: Ignorance without Awareness
Level 3: Ignorance without Awareness or even a means of becoming aware
Level 4: Ignorance of the Five Levels

Not stated is that, these levels apply to an individual person and were described in the first person. That is the First Person of Ignorance, oneself. The Second Person of Ignorance is another person. Before stating last and controversial entity, lets digress.

The first and second persons are people, they are capable of ignorance because they are capable of knowledge. This is because ignorance is the lack of knowledge. Only something capable of knowledge could be ignorant. A rock is not ignorant simply because it cannot know.

Which brings us to the controversial Third Person of Ignorance, the organization. That is any company, group or collection of people where the members identify themselves as part of the company, group or collection. I will gloss over the difficulty here by contending while an organization may not be capable of knowledge, but it often acts as if it does.

Thursday, August 14, 2008

Changing The Default View For Web Pages In Visual Studio

To change the default view of web pages in Visual Studio select from the menu:
Tools->Options...

On "Options" dialog select from the left side tree control:
HTML Designer->General

In the "Start pages in" groupbox you have three options:
Source View, Design View, Split View

Wednesday, August 13, 2008

When Greenfield Is The Solution To Brownfield

Not once but several times I have witnessed or had direct knowledge of Greenfield projects successfully replacing or improving Brownfield projects.

This would run counter to the general rule that Greenfield is not the solution to Brownfield. Both are true, which can be understood by realizing that these special cases will not generalize across all efforts. These special cases share one common characteristic. They accepted limitations and often tried to accomplished only one limited objective.

One effort that occurred at a company I worked at set out to merely reorder and make more sensible the object hierarchy common to all items. The actual functionality was not changed, just the implementation details. The language used was not changed. No new methodologies were introduced. The objective was limited and a success. A success even though it was late, because it actually did result in an improved product.

Tuesday, August 12, 2008

Five Levels Of Ignorance

Philip Armour enumerated Five Levels Of Ignorance.

He enumerated them starting at Level Zero which corresponds to having no ignorance and proceed up (or rather down ) to Level Four a comprehensive or complete level of ignorance.

Level Zero: Knowledge

At level zero you have a lack of ignorance. To be at level zero you must be able to demonstrate your knowledge. Consider the particular skill of tying a Square Knot. To be at level zero of ignorance of a Square Knot you must be able to tie one.

Level One: Ignorance, With Awareness

At level one you have ignorance but you know you are ignorant. In the case of the Square Knot, if you do not know how to tie one but are aware there is such a thing as a Square Knot, you are at level one ignorance of Square Knot.

Level Two: Ignorance Combined with Lack of Awareness

At level two, you do not even know that you do not know something. Whatever you know of the Square Knot, there is without a doubt some knot that you do not even know the name. For this knot you are at level two. It is amusing and seemingly paradoxical that as soon as you learn the name of the knot, you rise to level one for that particular knot.

Level Three: Unknowable Ignorance

Level three is composed of level two ignorance combined with a lack of means of identifying those level two items. In the case of all of those knots that you are at level three, you are at level two and not three since you have a way of finding them. If all else fails you could use a combination of Google and Wikipedia to find their names. Once again, in a paradoxical fashion if I could provide a description of individual level three items they would be identified and thus not even level two.

Level Four: Meta Ignorance

This level Armour defined as ignorance of the five levels of ignorance. There is humor to this level but it serves a purpose. Chances are you are not in the business of tying knots. But if it were the five levels provide a road map. Constraints of time and the demands of opportunity will cause you to search for and move items through the various levels. Now lets take your actual business, Widgets. To start you should see if Google and Wikipedia are sufficient, and so on through the levels.

Monday, August 11, 2008

Sunday, August 10, 2008

First Look at Shared View

Currently Microsoft's Shared View is free. So if you use Webex or a similar desktop sharing software you should consider Shared View.

But it is not cost that will drive Shared Views success, rather it is the simple and viral way it works and spreads.

Starting with a user with a Microsoft Live account, the user can do a click once install from the web:
http://www.connect.microsoft.com/content/content.aspx?SiteID=94&ContentID=6415

Then after logging in with their Live account they can create a sharing session. A simple way is provided to invite other users. Your email client is invoked with the invitation text, including link to session, already populated. You simply type in the email address.

When the invited party clicks on the link, the shared view comes up if they have it installed. Or if they do not have the Shared View installed, the web page for the click once install is brought up. Microsoft has really nailed the quick once install, it is quick and simple. After the install the shared session is launched.

At this point the original user approve the invitee and the session continues. The controls are both simple and intuitive.

What is interesting is the viral nature of Shared View. The only requirement is the coordinator of a sharing session must have a Microsoft Live ID. All other users will download the software, which is similiar to the Webex experience. This then puts them in the postion of hosting Shared View sessions. Simple, Easy, Viral.

Saturday, August 9, 2008

Why Greenfield Development Is Not The Solution To Your Brownfield

Facing a Brownfield project, the obvious solution is to start over. As a general rule this does not work. Which does not mean it cannot work in isolated instances.

Consider those Brownfield projects that are so bad you or your client are willing to abandon everything and start over and do it all again. There must be multiple problems in the Brownfield. These problems have probably reached an unworkable state. Working on one problem creates other problems. One problem prevents working on another problem. Perhaps the source code for a COM component has gone missing. (I do not know what it is about COM but since it's widespread use, every company seems to have a COM component with missing source). Or perhaps knowledge of the inner workings of the system is missing. Perhaps the original perpetrators of the code have fled the scene of the crime.


So the motivation for fixing the Brownfield is the ability to fix the multiple problems. This is also why the Greenfield approach will fail. You have a mandate to fix everything in the Brownfield. But this is too much to be attempted at once.


It is not that you can not fix each of the problems in isolation. It is the combination of problems makes it exponentially more difficult. If lack of knowledge (like missing source code or fled perpetrators) is added to the mix, you will be flying blind. You may think you know what the component is supposed to do but there is tribal knowledge embedded in the source code.


But lets suppose you have jumped off and started the Greenfield to fix your Brownfield. As you solve the problems, the solutions will start to compete with each other and to a certain extent some hard trade offs will emerge. Some of these trade offs are what caused the original nest of problems in the original Brownfield. Thus the Greenfield becomes a Brownfield.


So it then becomes a race. Can you get all of the features implemented in the new Brownfield before being overwhelmed by the toxins being created.

Friday, August 8, 2008

Metropolis Is The Future Of Work

For those who have not seen Metropolis, work in the future is presented as an individual standing in front of a dial and moving two hands to connect the dots indicated by blinking lights. This appears laughable these days as we can clearly see that we would build a machine to automate even that task.
But consider the "Games With A Purpose" movement. A typical game puts two humans in competition to categorize something, like an image of a puppy. At this time, we cannot devise a program that will reliably label images in a way that humans would find useful. So by turning this into a game we can extract these labels as byproduct of humans playing the game.
This dynamic has a precedent, hackers have set up adult themed sites where access is gained by solving CAPTCHA logins. The CAPTCHA logins are used on sites which are trying to prevent automated access.
In both cases the thing which only the human can do is extracted and presented in isolation. All the other work has been automated. It is important to point out that in both cases there is "pay", in the one it is access to a game, in the other it is the adult material.
Now as to Metropolis, of course they got the minor detail wrong, which is the clock dial and the moving of the two arms in response to blinking lights. But as a metaphor it is dead on. Labeling images disembodied from their context. Solving CAPTCHA. The work is dull and lifeless. But what Metropolis tried to capture, it is work that requires the essential human.

Thursday, August 7, 2008

Prerequisite Package Location In Visual Studio

In order to use Prerequisite Packages in Visual Studio you must place them in the appropriate Bootstrapper directory.
For Visual Studio 2008 on 32 bit:
%PROGRAMFILES%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\
For Visual Studio 2008 on 64 bit:
%PROGRAMFILES(X86)%\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\
For Visual Studio 2005 on 32 bit:
%PROGRAMFILES%C:\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\
For Visual Studio 2008 on 64 bit:
%PROGRAMFILES(X86)%\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\

Wednesday, August 6, 2008

Buzzword: Greenfield Brownfield

It has become common to refer to new development projects as Greenfield. This obviously conjures images of an untouched patch of land with no previous work impeding progress.

Of late, a new term Brownfield  has become trendy to describe the rest of software development. Here there is the obvious contrast with Greenfield in the sense that the ground has been torn up and there is dirt and mud everywhere. But in addition, Brownfield had a prior meaning in commercial real estate. Brownfield referred to a property contaminated by one or more toxins.

In the case of software development, these toxins are prior decisions or implementations which have gone bad or never worked in the first place.

Tuesday, August 5, 2008

Device Emulator Manager and Internet Access

Device Emulator Manager and Internet Access

These steps were tested with:
"Pocket PC 2003 SE Emulator"
"USA Windows Mobile 5.0 Pocket PC R2 Square Emulator"

Launch "Device Emulator Manager"

1. Select Emulator From Tree control
2. Right click selection and select "Connect" from context menu
3. After Emulator Launches, Right click selection and select "Cradle"

On Emulator Window

1. Select from Menu: File->Configure…
2. Select Network Tab
3. On Network Tab, check box "Enable NE2000 PCMCIA network adapter..."
4. Click OK

On Window Menu of the mobile device

1. Select "Settings" from menu
2. Select "Connections" tab on Settings screen
3. Select "Connections" icon on "Connections" tab
4. Select "Advanced" tab
5. Select Networks
6. Select "My Work Network" from menu
7. Click "Edit" button below menu
8. Select "Proxy Settings" tab
9. Check box "This network connects to the Internet"
10. Exit all screens and menus with "ok" in upper right corner
11. Browse to google.com

Monday, August 4, 2008

Fixing: Virtual PC 2007 error "Reboot and Select..."

Description: When creating a virtual machine using Virtual PC 2007, the following error occurs on the first use:

"Reboot and Select proper Boot device or Insert Boot Media in selected Boot Device"

Solution: The root problem is the hard drive has been created as an empty hard drive, as such it has no operation system. So you will need to install the OS.



Sunday, August 3, 2008

Hail The Reference Implementation, Slayer Of Gurus

If you work in software development, gurus with silver bullet suggestions are around every corner. In a previous post, I mentioned how effectively, asking for a Reference Implementation can resolve the angst caused by these suggestions.
While I did not connect the dots at the time, I experienced this effect first hand in a prior project. I was in a liason role and there was an all powerful consultant (APC) from venerated Vendor (Microsoft, not that it matters all vendors do this). No matter what the problem was the APC always had that combination of Vendor silver bullets would fix the problem.

The scary side of the equation was no one knew what he was talking about and we were not sure if he was brilliant or just making stuff up. At one point, he had convinced us that a critical problem with one part of the Vendors stack could be resolved be a particular combination of silver bullets in other Vendor items.
At the following meeting with my consulting company, I brought up a particular silver bullet festooned boondogle and asked what should I do. Fortunately there was an older and wiser consultant advising us and he said, "Just ask for a simple reference project showing the ideas implemented". This I did.

For a while I waited eagerly for the demo. When it never came, I realized I could ignore the suggestion and what was better, I have been using this management trick ever since.

Saturday, August 2, 2008

Buzzword: Hatless

When talking about security there are two well worn buzzwords.

The White Hat is the good guy. He is the security guy who works for the company or it is used to refer to an ethical hacker. He pursues security exploits in order to make systems more secure.

The Black Hat is the evil hacker. Since both can and do use the same practices the terms white and black hat arose.

Now what about the rest of us? We are just the Hatless. (You can say it with the same emphasis you would give to "the great unwashed", only it is shorter.)

Needless to say in the battle between the Hats, white and black, we the Hatless are often the victims.

Friday, August 1, 2008

CORBA Shot To Death With Silver Bullets

The current "Communications of ACM" (2008 08) has two articles that combined are greater than their parts.

In "Software Development Amidst the Whiz of Silver Bullets", Alex Bell explains how we must be ever vigilant against silver bullet solutions. While it is not in the article, I can almost here a paraphrased common wisdom, "if the silver bullet worked, it would be the standard practice."

In "The Rise and Fall of CORBA", Michi Henning provides the Post Mortem Analysis of the CORBA effort. There is a nice auditory illusion that takes place if you read "...Whiz of Silver Bullets" right before reading "...Fall of CORBA", as Henning details the effect of too many specifications, contradictory specifications and unimplementable specifications, you hear the silver bullets whiz followed by the dull thud as they hit and kill developers and companies.

But there is more, Henning provides critical lessons learned. A good Post Mortem is interested in placing blame only to the extent that it allows for the illumination of what could be done to avoid the failure. In the case of the multiple contradictory and perhaps dubious specification one recommendation rings out "PROVIDE A REFERENCE IMPLEMENTATION".

Once again Waterfall and BDUF (Big Design Up Front) take a hit. In the CORBA project, specifications could be approved without anyone having to provide a reference implementation. That is classic Waterfall, all the design at the beginning and no feedback from the experience of having to implement the initial design.

Now if you go back to the first article "...Whiz of Silver Bullets", you have a new tool for dealing with the next silver bullet that is proposed at your company. Simply ask for a Reference Implementation. Often that silver bullet will show it's warts as soon as you get past the boilerplate code.

Thursday, July 31, 2008

Donald Knuth Dams Waterfall

Quoting from an interview in "Communications of the ACM" 2008 08 with Donald Knuth:

The setup is Donald had written a complete spec and assigned it to bright students and then did nothing to manage them as they implemented the spec.

"To my amazement, the students, who were outstanding students, did not complete it."

Only later when he tried to implement it, did he find that it was not so easy.

"Because going from my specification, which I thought was complete, they had an impossible task..."

He later goes on to point out that even with the most complete of specifications, questions arise every 5 minutes as you write code.

In effect, his approach was waterfall with a Big Design Upfront. What he found was a cornerstone of Agile practices, you need to implement a portion of the project and then you will learn enough to start asking questions.

Wednesday, July 30, 2008

Fixing: An error occurred while validating. HRESULT = '80004005'

Fixing: An error occurred while validating. HRESULT = '80004005'

The error was encountered when attempting to build a 'vdproj' setup project under Visual Studio 2008.
The underlying problem was a project with a reference to another project that had been removed.
As such the setup could not find the dependency to include in the setup package.

This was fixed by removing the bogus project reference and adding the correct reference.

Tuesday, July 29, 2008

Database Deployment Challenge

Getting a database deployed consists of numerous challenges.


One issue is simply getting the database engine deployed and configured. One might add purchasing to the list as well as getting a licensed copy can be challenging in some companies. An obvious workaround is to use an existing database engine. The Registry serves as an excellent database for configuration information. The Event Logging system of windows is an excellent database for logging. Another common workaround is to use flat text files or xml files. You will still need a database engine, it just may not be apparent because you will be writing it in your program.

The next issue is getting the initial database schema in place. With a traditional engine like SQL Server this is challenging. The best solution is to use DataDude (also known at Microsoft Team System For Database Professionals). In the case of using built in engines like the Registry and Event Logging system the schema is in part dictated by the system and in part created as part of your install. The current setup project that Visual Studio creates makes Registry and Event Logging easy to maintain. In the case of flat text files or xml files, the schema is part of the file. Again the unseen trade off is you will be expending some effort in your code enforcing the schema.

The final deployment issue is getting the initial data in place. If you are not using the DataDude by now, you will find your database deployment has reared up and become a project unto itself. In the case of the Registry and Event Logging the initial values are created at the same time as schema is installed. And in the case of the flat text files or xml files, it is part of the file.

When looking across these options, it is easy to see that the flat text files or xml files present the easy path. The downside will occur later when the data must be shared with other programs, or performance issues arise. So the hard thing to do, but the right thing from an architecture view, is to force configuration information to be stored in the Registry, logging must be stored in the Event Logging system. And for other data, a database engine must be deployed and used.

Monday, July 28, 2008

First Look At Cuil

Taking a quick First Look at the new search engine Cuil.

On the surface it would appear to return more results but when looking at quoted phrases it does something unexpected. Quite often Cuil fails to find the quoted phrase. This is disappointing because it is often the way I track down what some obscure cryptic error message means and how I should resolve it.

The increase in research results also does not hold up in searching for obscure terms. In fact for the obscure "Corpen Source" Cuil currently finds nothing. Google on the other hand finds plenty.

Quality of results is a little bit subjective but Cuil appears to have the edge here. Although it may just be the way Cuil presents the results in a panel fashion together with an image that may be the advantage. Either way, Cuil has marginally better results or a much improved layout.

Sunday, July 27, 2008

Virtual Machine Sprawl

I've stopped using Virtual Machines because they are too useful. Kind of like Yogi saying of a restaurant, nobody goes there anymore because it is too crowded.

Actually I have just reached limit of the number of Virtual Machines I can track and have stopped creating and using additional virtual machines.

So Virtual Machines have crossed over the point where their own success is the problem. This problem has picked up the name Virtual Machine Sprawl. The sprawl problem creates four problems; space, providence, version control and restoration or setup speed.

Each virtual machine takes megs of space in the most compact form and in most cases after a few software installs they are up to gigs of space. I have found I need VMs for several OSes and for each OS I need a range of software installed and not installed and combinations in between. So before I know it I am up to 100s of gigs of space needed.

Providence refers to the prior history of the VM. Wear refers to this as the Genetic Makeup of the Virtual Machine. What is important here is not just what is installed but often the order it is installed. Every ASP.NET programmer is now familiar with the slight difference between installing IIS first then Visual Studio and installing Visual Studio first and then IIS.

Just like code there must be some mechanism for keeping original untouched copies of the machines. Unlike code, nearly everything you do with a virtual machine starts to change it. A primitive solution is to keep a directory full of copies. Unfortunately this instantly doubles the space requirements and there is nothing to prevent the machines being opened and thus spoiled.

Assuming you have found mechanism to track providence and another to track version you will still need to throw away your current copy and restore it from version control. As gigs are involved, the copying can take a chunk of time.

Saturday, July 26, 2008

C++ Hard To Do Security Right Easy To Do Wrong

Whenever possible you should make it easy to do the right thing and hard to do the wrong thing.

From a security point of view C++ may be broken simply because this dynamic is not only missing but reversed.

Take the function "strcpy". It is part of the standard library because C++ lacks a string class and thus it is commonly used. This function comes to mind because I added a huge chunk of existing code to my project. The code base liberally used "strcpy". Now in the "hard to do wrong" fashion the compiler warned on dozens of these and other security obsolete functions.

The security based warnings indicated in good "easy to do right" fashion that one should use "strncpy". The problem is that it often hard to determine the size of string at compile time, which the "n" in "strncpy" requires.

So you can see my dilemma either I retrofit size checking code in all of this imported code or live with the numerous security warnings and the reality they represent in terms of security holes.

Two recommendations from the community raised more concerns than comfort. One was to disable the warning. One poster included the amusing joke that starts with "Doctor it hurts when I do this.." Another disturbing recommendation was to replace the function call to "strcpy" with a hand coded replacement that had the same Stack Overflow problem.

So the effect was the practitioners in this space did not do right and in fact did wrong. Why? Because the language C++ makes it easy to do wrong. In this case the direct memory access. This is because it is hard to do right due to the lack of a standard string class that manages the memory access.

Friday, July 25, 2008

XML Literals As Database

Deploying the database has bedeviled development.

Data store and Engine are both issues. MSDE and SQL Express both represented attempts at getting an engine and data store on the machine. They worked well but presence of other applications using MSDE or SQL Express could complicate the deployment.

Standalone XML files, which is common for configuration, is a viable way to solve deploying the data store. Dot Net Framework embraced this common problem and a common solution now involves shipping an XML file to server as the initial data store.

With the XML Literals now part of VB.NET a better solution is possible. And the defect of using a separate language may even serve a purpose. On the one hand the XML literals are nothing more than the equivalent of the standalone files. But since they will be compiled into the executable and this will both create and hide access components the result will be faster and more reliable.

As to the language issue, this feature is only available in VB.Net. So to use this strategy from C# you would need to have a separate executable to house the VB.Net assembly dedicated to the XML Literal. But you could look at this defect as a feature in that it would encourage the separation of concerns.

Thursday, July 24, 2008

Does Security Make C++ Obsolete

Stephen Gould said every species is extinct, they just do not know it.

From a security point of view C++ may be obsolete and we just do not know it yet. Increasing C++ is justified based on performance factors and legacy code. The performance increase that still remains is due primarily to the direct access to memory. This is when comparing to a language that handles memory management like Java or C# or VB.Net.

The security implications of direct memory access becomes apparent when examining lists of top security threats. At the top of the list are Buffer Overflows and Stack Overflows. Both are possible only because of direct memory access.

Since C# is memory managed except when you explicitly tell it not to be, you could say that it is "Secure By Default". This is in contrast to C++ which is "Unsecure By Default."

Wednesday, July 23, 2008

Testing for Endianess

A colleague is studying for a Microsoft Interview.
One of the questions is to write code to test for Endian.
The answer Microsoft likes involves bit twiddling, but one wonders why they would not prefer calling their own framework:
using System;


using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication1

{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("BitConverter.IsLittleEndian " + BitConverter.IsLittleEndian.ToString());
Console.ReadLine();
}
}
}



Tuesday, July 22, 2008

Five Things That Come First

In reading "Writing Secure Code" I was heartened to find the author state "Security is a top priority". The statement as whole is not surprising for the book but the use of "a" as in "a top priority" instead of "the" as in "the top priority" was the comforting part.

Reading Roger Session's blog on code complexity, Roger implies that complexity is more important than security. As in if the code is complex it can never be secured. So that would imply Complexity (or reducing it comes first).
The Test Driven Development movement preaches Test First. It should be noted, code is not testable by default. You will always need to do something to make it testable.
Any book on Scalable Architectures will tell you, you must design from the start for scalability. So add Scalability to the list of things to be done before anything else.
I myself have learned the hard way to do the install first. But having an installer does not guarantee that your software will be deployable. So but Deployable on the list as well.
Thus you end up with Five Things That Come First before you even write your first line of code.

Security
Scalability
Testable
Deployable
Complexity