Archive for September 2007


Check your InitializeComponent method

September 29th, 2007 — 02:13 pm
I previously wrote about a problem with a custom form’s property.
Since then I found problems with additional properties, including the form’s default location.
As it turns out the cause was a missing call to the InitializeComponent method in the initializer of a parent class.

1 comment » | Winforms

Microsoft is making me jump through hoops to watch a webcast

September 29th, 2007 — 10:29 am

This is what you need to watch a recording of a webcast in MSDN:

1) Webcast page - press the “Register Online” button
2) Login to MS passport
3) Event registration - enter attendee name
4) “Thank You For Registering” page - press the download button
5) View recording page - enter email & company name
6) View recording info page - save recording - the default filename is always the same, so you also need to remember the name of the webcast (it’s not shown at this point)

Too many steps to watch a simple webcast.

Comment » | Websites design

Team System integration in a software organization - personal case study

September 17th, 2007 — 02:44 pm

I have been asked several times for my experience regarding installation of Team System inside an organization using (up to this point) an older version control system, so here are few tips:

  1. Team system is a complex software to install, maintain and upgrade. Study the various pitfalls you may encounter and plan your installation strategy very carefully.
    You can find an updated installation guide and administator’s guide in Microsoft’s web site, and it’s probably newer than the guides on your installation discs.
    Team system is mainly composed of the server’s installation (I recommend a dedicated server), and an installation of the Team explorer on each developer machine. It uses SQL server as it’s database server.
    Update: You should also read the “Operations Guidance for Team Foundation Server“.
  2. Decide and implement domain permissions for users (developers) and automated services.
  3. If you also need to install SP1, be aware there are known issues with the upgrade.
  4. Be aware to the fact there are several databases, so be sure to include all of them in your backup scheme. If you don’t have a backup scheme - make one!
  5. You also need to select a branching strategy that suits you for your source control.
    Update: Jeff Atwood wrote a great post explaining branching strategies.
  6. You can also use VS2005 only for source control, and develop your application using VS2003 or Delphi (for example).
  7. Choose how to use your infrastructure’s assemblies repository. You can get them from the source control or store them locally on each computer, but then you don’t guarantee all developers will use the latest version.
    Another option is using a shared folder to store them, but you make yourself more susceptible to network problems.
    One trick is using the window’s subst command, mapping the shared folder to a drive, leaving you the ability to backup the repository locally and mapping it to the same drive if the network is down.
  8. Create an automated build server. This takes some work, but will help you detect invalid code changes by developers. Choose the frequency to run the build at, from once a day to after every check in.
  9. Don’t fall for the NIH syndrome - there are many tools out there to make your life easier - use them.
    If you want to build non-native .Net code, consider getting a commercial tool (such as FinalBuilder for Delphi) and running it from your build code - it will be cheap compared to the developer-days you’ll be saving.
    If you are using the bug tracking capabilities of Team System, be sure to remove the default event registration of the build service, otherwise your “fixed in ver” combo will contain hundreds of values. If you forgot, here is how you remove values from it.

Comment » | VSTS

Supporting "foreach" without implementing IEnumerable

September 15th, 2007 — 09:10 am

Krzysztof Cwalina wrote a post detailing how have your class support the “foreach” loop without implementing the IEnumerable interface:

  1. Public GetEnumerator() method that returns a type with 2 members:
  2. The type will have a bool MoveMext() method.
  3. The type will have an Current property of type object.

Example:

class Foo {    public Bar GetEnumerator() { return new Bar(); }

    public struct Bar {        public bool MoveNext() {            return false;        }        public object Current {            get { return null; }        }    }}

Comment » | Useful .Net classes

I would like some salt with that password, please

September 13th, 2007 — 02:22 pm

Jeff Atwood wrote an interesting post on using “Rainbow tables“, which are pre-calculated hashes of a range of possible string to brute-force crack a password database.

One of the better methods for stopping someone who has your encrypted password from deducing the unencrypted version is “salting” your passwords before storing them, meaning you concatenate your password string with a long constant string before encoding it, thus making a brute force attack impossible. (unless someone manages to get your server’s code)

For example, you can add the string “FarBetterEncryptedPasswordWithThisAttachedToIt” to every 6-characters password before encrypting, forcing the hacker to compute all possible combinations for 52 characters string instead of possible combination for a 6 characters string.
While using rainbow tables would allow cracking of a 6 characters password in minutes, cracking a 52 characters long password would take years, and would require huge amounts of ram.

Comment » | Security

Beware of the AutoScaleBaseSize property

September 13th, 2007 — 10:58 am

I have had a problem recently with some of the form in my application, which were descendants of a custom form class (not the classic Windows.Forms.Form class).
The form would look fine in design mode, but during run time it appeared to have shrunk, with all the controls in it being affected similarly.

It took a lot of digging to find out what was wrong, but after noticing that setting the AutoScale property to “false” seemed to solve the problem the culprit was found - While in a “normal” form the “initializecomponents” method contained this line:
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
In the new forms it has somehow changed to:
this.AutoScaleBaseSize = new System.Drawing.Size(7, 17);
Thus affecting all such forms.

Now I need to fix this line, but I’m still troubled by not knowing what caused it to change in the first place….

Comment » | Winforms

Working with a remote development team

September 12th, 2007 — 03:08 pm

Some times you have a remove developer/team working on the application, as well as in-house team, and they can’t use a remote connection to your source-control solution.
I found out these methods help:

  1. Check out files for them to work on in advance, keep the files checked-out until they give you the updates.
  2. Have the remote developer save the original file for comparison (if merge is needed).
  3. Have the remote developer keep a list of changes.

What else do you recommend for this situation?

Comment » | Programming

« Previous Entries