7
Aug

The "Why To" Manual

Hank Wallace turned me on to a post by Allison Shapira where she summarizes a key point from Rob Walker's writeup of the Blue Man Group - the "Why To" manual.


This "Actors' Journal" is not so much a how-to manual as a why-to manual; it's not about stage directions, but rather tells the story of the show step by step, from the point of view of the Blue Men. As a decoding and deconstruction of Blue Man's at-times baffling, even mystical behavior, it's a fascinating document, thick with references to everything from Being There to George Bernard Shaw to Robert Motherwell to the caves of Lascaux. Some explanations are straightforward ? "The Blue Men are not aliens" ? and others are more subtle, as when the trio's harmonic "three as one" relationship is described in terms of "blesh," a mix of blend and mesh borrowed from Theodore Sturgeon's science fiction novel More Than Human.


What would a "Why To" manual look like for a development team?


free b2evolution skin
7
Aug

Miško Hevery on Writing Testable Code

Miško Hevery has written a great summary of some basic coding rules for testability in his post Writing Testable Code.

I love this quote because every time I introduce unit testing to someone who has an existing code base you can see this in their eyes:

"I understand how to write tests for your code, but my code is different"

He goes on to list the rules most often broken by developers that make unit testing hard in his top ten list:

  1. Mixing object graph construction with application logic
  2. Ask for things, Don't look for things (aka Dependency Injection / Law of Demeter)
  3. Doing work in constructor
  4. Global State
  5. Singletons (global state in sheep's clothing)
  6. Static methods: (or living in a procedural world)
  7. Favor composition over inheritance
  8. Favor polymorphism over conditionals
  9. Mixing Service Objects with Value Objects
  10. Mixing of Concerns

free b2evolution skin
4
Oct

The Last Language War / Language Trolling Post You'll Ever Need To Read (Hopefully)

Via Jeremy D. Miller

This post by David is hilarious (warning programmer humor...)


free b2evolution skin
17
Feb

HanselMinutes #4

Scott Hanselman has started a podcast called HanselMinutes to talk tools and utilities. Episode #4 on Continuous Integration caught my attention because of 2 names mentioned during the discussion of the Ruby Watir library. Both Dustin Woodhouse and Travis Illig got mentioned because of tools they have written to integrate the Watir functionality at development or test time. Travis wrote RubyTestExecutor which hooks Ruby/Watir scripts up with NUnit. Dustin wrote WatirNUt which is a utility that creates a portable, testable NUnit binary wrapper around Watir test scripts and supporting files.

These two individuals and their tools are interesting to me because they both work on teams I manage and I'm excited to see my guys pushing the envelope.

Scott was also kind enough to mention me as one of the local XP experts (my 30 seconds of podcast fame).


free b2evolution skin
18
Jan

SqlConnection Connection String Parameter Keywords & Values

I can never find this info, so I'm filing it away.

Name
Default
Description
Application Name
  The name of the application, or '.Net SqlClient Data Provider' if no application name is provided.

AttachDBFilename
-or-
extended properties
-or-
Initial File Name
 
The name of the primary file, including the full path name, of an attachable database. If this setting is specified, the Initial Catalog setting must also be specified.
The database name must be specified with the keyword 'database'.
Example:
Data Source=.; Initial Catalog=; Integrated Security=true;AttachDBFileName=c:\MyFolder\MyDb.mdf 

Update:
You can use the following syntax to attach a database that lives in your "Data" directory:
AttachDBFileName=|DataDirectory|MyDb.mdf 
Connect Timeout
-or-
Connection Timeout

15

The length of time (in seconds) to wait for a connection to the server before terminating the attempt and generating an error.

Current Language

 
The SQL Server Language record name.

Data
Source
-or-
Server
-or-
Address
-or-
Addr
-or-
Network
Address

 
The name or network address of the instance of SQL Server to which to connect.

Encrypt

'false'

When true, SQL Server uses SSL encryption for all data sent between the client and server if the server has a certificate installed. Recognized values are true, false, yes,
and no.

Initial Catalog
-or-
Database


 
The name of the database.

Integrated Security
-or-
Trusted_Connection

'false'

When false, User ID and Password are specified in the connection. When true, the current Windows account credentials are used for authentication.

Recognized values are true, false,
yes, no, and sspi (strongly recommended), which is equivalent to true.

Network Library
-or-
Net

'dbmssocn'

The network library used to establish a connection to an instance of SQL Server. Supported values include dbnmpntw (Named Pipes), dbmsrpcn (Multiprotocol), dbmsadsn (Apple Talk), dbmsgnet (VIA), dbmslpcn (Shared Memory) and dbmsspxn (IPX/SPX), and dbmssocn (TCP/IP).

The corresponding network DLL must be installed on the system to which you connect. If you do not specify a network and you use a local server (for example, "." or "(local)"), shared memory is used.

Packet Size

8192

Size in bytes of the network packets used to communicate with an instance of SQL Server.

Password
-or-
Pwd


 
The password for the SQL Server account logging on (Not recommended. To maintain a high level of security, it is strongly recommended that you use the Integrated Security or Trusted_Connection keyword instead.).

Persist Security Info

'false'

When set to false or no (strongly recommended), security-sensitive information, such as the password, is not returned as part of the connection if the connection is open or has ever been in an open state. Resetting the connection string resets all connection string values including the password. Recognized values are true, false, yes, and no.

User ID


 
The SQL Server login account (Not recommended. To maintain a high level of security, it is strongly recommended that you use the Integrated Security or Trusted_Connection keyword instead.).

Workstation ID

the local computer name

The name of the workstation connecting to SQL Server.

Connection Lifetime

0

When a connection is returned to the pool, its creation time is compared with the current time, and the connection is destroyed if that time span (in seconds) exceeds the value specified by Connection Lifetime. This is useful in clustered configurations to force load balancing between a running server and a server just brought online.

A value of zero (0) causes pooled connections to have the maximum connection timeout.

Connection Reset

'true'

Determines whether the database connection is reset when being drawn from the pool. For Microsoft SQL Server version 7.0, setting to false avoids making an additional server round trip when obtaining a connection, but you must be aware that the connection state, such as database context, is not being reset.

Enlist

'true'

When true, the pooler automatically enlists the connection in the creation thread's current transaction context. Recognized values are true, false, yes, and no.

Max Pool Size

100

The maximum number of connections allowed in the pool.

Min Pool Size

0

The minimum number of connections allowed in the pool.

Pooling

'true'

When true, the SQLConnection object is drawn from the appropriate pool, or if necessary, is created and added to the appropriate pool. Recognized values are true, false, yes, and no.


free b2evolution skin
2
May

International Addresses

Darrell pointed me to this site on International Addresses and the complexities therein.

Darrell is using this from a testing point of view, but I have been fascinated for years about how to design an effective solution for US based systems that need to deal with foreign addresses. This will be a great resource.


free b2evolution skin
21
Apr

Together Developer for Visual Studio.NET

Borland has released a version of Together Developer that integrates into VS.NET. Check out the screen casts. I'm thinking that Together combined with ReSharper from JetBrains could be one killer combination.


free b2evolution skin
11
Apr

Build Servers - Love 'em & Hate 'em

Jim Shore wrote about why he doesn't like Cruise Control. I agree to some extent with his points that the reason teams use it is to catch build errors and deal with "slow" builds. Having implemented both Draco.NET and CruiseControl.NET and toyed with FinalBuilder I am not overly impressed with any of them. My impression is that I spend way to much time fiddling the build server for the value added. I will say that I would still implement a build server for any team for the single reason that "people are fallible". People forget to commit related changes, or add files to CVS, run tests, etc. The build server never does.


free b2evolution skin
1
Mar

Getting VS.NET to Recognize @ as T-SQL Variable Prefix

Some of you may be rolling your eyes at this suggestion, but it's been bugging me for months and I finally figured out how to fix it.

For many moons I've been editing T-SQL stored procedures using VS.NET, but been annoyed because every time I when to the graphical query designer it didn't know anything about T-SQL variables (i.e. @MyVar). I could get around this by right-clicking the SQL pane and changing the property page. Very conveniently the designer deleted all your SQL when you do this so I always had to remember to copy my SQL change the property page and paste the SQL back in.

Turns out there is a setting in Tools: Options: Database Tools: Query/View Designer that will take care of it.


free b2evolution skin
18
Feb

Extracting Column Names for a Table in SQL as a CSV String

I had a need (creating CSV BCP files) that required knowing the column names of a MS SQL table in the order they were created. Some inspiration from Mark Clerget and a little fooling around with SQL Query Analyzer resulted in the following.

DECLARE @c varchar(4000), @t varchar(128)
SET @c = ''

SET @t='authors'


SELECT @c = @c + c.name + ', '
    FROM syscolumns c INNER JOIN sysobjects o ON o.id = c.id

    WHERE o.name = @t
    ORDER BY colid

SELECT Substring(@c, 1, Datalength(@c) - 2)

Which gives the following result:

au_id, au_lname, au_fname, phone, address, city, state, zip, contract

Perfect. Note the use of @c = @c + c.name in the select clause to colapse 9 rows into 1 row. I've used this technique many times in the past to generate a single string from multiple rows without resorting to cursors.


free b2evolution skin

:: Next >>