6/29/2006

Minimal Set of Rules for Team Development with Visual Studio.NET and VSS

I'm trying to pare this down to just the absolute streamlined minimum, here's what I have so far. If you have comments, feel free to contribute:


Minimal rules for Team Development:

1) Learn how to add a solution / project to VSS and make sure you don't screw up. Everybody needs to be able to be working from the same solution tree, and a new developer should be able to get latest on a solution and successfully build it within 10 to 20 minutes. Shared library references should be in the solution as Solution Items, and they should be able to be checked out with the Solution. If a shared library needs to be changed, it should be checked out and the new library saved over it, then checked back in so everybody can have the same versions.

2) All references should be PROJECT references if the project is available, and the project should be retrieved from VSS and included in your solution.

3) All build output from EVERY project should go ONLY into it's respective /bin folder. That can be /bin/release or /bin/debug depending on configuration. DO NOT ALTER THE DEFAULT BUILD OUTPUT FOLDER!

4) If you are going to change something ALWAYS ask "What will this affect?" It is your responsibility to keep in contact with the other developers on the team and keep them informed of any changes you propose, and to ensure that any related code that needs to be modified gets changed. And, the best time to do this is BEFORE you make any changes.

5) Always check in your code as soon as it is ready to build. Don't keep code checked out any longer than necessary. If you need to keep code checked out for a long while, you can comment out your changes and check it in, and use the "Keep checked out" option from Visual Studio to keep working on it. Learn how to use Merge.

6) if you add a new class or web page to a project, you need to CHECK OUT the project before adding it, then check in the project so that the project will now include your new file(s). Same with adding a project to a Solution.

7) All actions involving VSS-based code should be done ONLY from within the Visual Studio IDE.

8) All developers are encouraged to take the time to read the Team Development Guide.

6/28/2006

Tailgating, Queue Theory and the "Phantom Traffic Jam"

Yesterday it took me an hour to get to work, a trip that normally takes about 35 minutes. I say "normally" but it turns out there's probably almost never a "normal" day, as I drive a stretch of Interstate 4, a six lane highway that runs from Daytona Beach in the east, all the way to Tampa on the west coast of Florida. I grew up in New York City, but I gotta tell ya -- Florida drivers are the absolute worst on the fyookin' planet!

The reason for the delay? Tailgating accident. There is something about getting into 3,500 pounds of metal that has a decided effect on many people's personalities. Normally docile human beings become overly aggressive. The automobile becomes an extension of our "personal space" and anyone who invades this space is to be defended against. Tailgating 10 feet behind the rear bumper of the car in front of you at 80, sometimes as high as 90 miles per hour won't get you there any faster, in fact, as about six drivers found out yesterday, it often ensures that you don't get there at all! Yep, six cars and SUV's, all neatly parked on the side, almost all of them except the guys in the very front and back with both their hoods and their rear ends completely smashed to smithereens. Obviously, there was no QA Department to test their brains before deployment into production...

Over 95% of motor vehicle accidents involve some degree of driver behavior combined with one of other factors.

My brakes work the same regardless of how close the people in front of me are to each other. If somebody passes in front of me, I've learned to turn down the temperature and just drop back to a safe distance. Unfortunately, some motorists "just don't get it" and the only thing you can do is be extra alert and careful - and give yourself PLENTY OF ROOM to stop safely.

So called "phantom traffic jams" are actually caused by a vehicle braking sharply - causing a red light domino effect. The red light is the brake light that the following driver sees ahead. The driver behind then brakes suddenly and this has a domino effect until further down the line traffic can actually grind to a complete halt.

We as programmers understand the math behind this as it is a textbook case of queue theory in action.

Motorists are then perplexed as to what has caused the traffic jam. In reality they have all caused the traffic jam because of their sharp braking, most of which has been caused by following too closely.

The top five causes:

1. Tailgaters: The number one cause of phantom traffic jams is indeed motorists themselves who tailgate. If a vehicle is driving too close to the vehicle in front and the lead vehicle slows down then the following vehicle will have to brake sharply. So the easiest way to prevent phantom traffic jams is to keep a good distance from the car ahead. Emotionally, tailgating is infantile "bully" behavior to punish the driver ahead of you or make him go faster. But logically, keeping a safe distance behind will actually get you to your destination faster!

2. Slow bus: The number two cause is the slow bus. This can be any vehicle that pulls into the outside lane at a speed much slower than the general flow of traffic. It can be a bus or truck, but it is equally likely to be a car driver.

3. The cop: Yes, sometimes the police can trigger phantom jams. The lead car in the outside lane spots a police car on the hard shoulder or inside lane and brakes suddenly.

4. The "Your Speed" radar machine: The lead car spots the machine and brakes suddenly. The dominos begin to roll.

5. The rubbernecker: This problem occurs when there has been an accident on the opposite side and the rubberneckers brake hard to have a good look. This causes massive tailbacks and even when the accident is cleared away delays can still occur and hence the phantom traffic jam.

You cannot change other people's idiotic, dangerous behavior -- but you can change your own behavior. Keep two to three seconds behind the guy in front of you, if people pass and cut in front of you, take it in stride and drop back to a safe distance, and above all, stay alert. You are driving a killing machine.

6/23/2006

Freedom, Privacy, WGA and more

We Americans live in a society that is based largely on the ideals of our forefathers - ideals that have survived the test of time. Those ideals include life, liberty, individualism, and the right to privacy, among others.

We all know that during times of national threat or war that sometimes these privacy rights must be partially abrogated. With the attacks of 9/11/2001, the rules had to be changed and this has caused significant controversy among Americans.

I for one, am glad that I am not an ATT customer - but I'm also fearful that other providers may follow. Essentially "Ma" just said "All your phone records are belong to us".

It's not that they suddenly decided to change their policies about customer data - they haven't changed a thing! All they've done is put it in writing to help prevent themselves from being successfully sued.

I realize that information about me that I do not wish to have disseminated without my consent is distributed anyway, and in some cases this is done for profit - again, without my consent and often without even my knowledge. Much of this information has nothing at all to do with helping to defend against the threat of terrorism. It didn't have anything to do with it before 9/11, and it doesn't have anything to do with it now.

Almost every piece of personal information that Americans try to keep secret -- including bank account statements, e-mail messages and telephone records -- is semi-public and available for sale.

That was the lesson Congress learned over the last week during a series of hearings aimed at exposing peddlers of personal data, from whom banks, car dealers, jealous lovers and even some law enforcement officers have covertly purchased information to use as they wish. Rep. Ed Whitfield, Chairman of the panel's oversight subcommittee, described a multimillion dollar industry that sells cell phone records for $200, Social Security information for $60 and a student's university class schedule for $80.

Most often, the customers are banks or financial institutions attempting to locate absconding debtors. But law enforcement officers -- including those in the Department of Homeland Security, FBI and Police Departments -- have used the services on occasion. The problem has been that data brokers often have obtained information by deception, and they did not monitor to whom they were selling or how the data was used.

If there is one thing that really pisses me off, its deceptive marketing that cloaks an inner purpose that hasn't been disclosed. I feel that the WGA (Windows Genuine Advantage) program smacks of this aura. We only found out recently that the WGA "Security Patch" (yes, that's essentially how it was marketed to you) "phones home" every day at boot time.

Mind you, I have no issue with helping Microsoft or any other company protect against piracy of their legitimate corporate assets (Windows the OS for example). However, let me just remind you that you had to put your Product ID in when you installed the product, and it already phoned home at that time to validate it. Shouldn't that be sufficient?

At any rate, I suspect this is just one of those annoyances that fall into the category of "you can't do much about it" other than "Bitch".


If you find the WGA practice annoying as I do, there is something you can do to "have your cake and eat it, too". "RemoveWGA" is a free tool that disables the daily "phone home" feature, but still leaves the functionality intact that allows legitimate Windows owners to download Microsoft software that requires the WGA authentication process.

I understand that future versions of WGA are supposed to only "phone home" every two weeks. That's not the point. Nobody ever told me it was going to phone home; I never agreed to it, and

I DON'T WANT IT TO PHONE HOME AT ALL.

Got it?

I see where the same lawyers who sued Sony BMG over Rootkits on music CDs, and Ubisoft for Starforce on its game disks are now taking on Microsoft. But think about it for a minute - isn't WGA around because the basic Activation process when you first install the OS is flawed? Wouldn't it be better if only the pirated copies of Windows did the phoning home, instead of all of them? I just think the whole scheme is ill-conceived.

Now, if I can just find software that will :

1) Block out my credit history and allow ME to control who gets access to my personal information.
2) Prevent people from using my Social Security Number to access information about me.
3) Force companies to disclose to me UP FRONT exactly what they or their software is going to do related to privacy issues, as a REQUIREMENT OF THE LAW, with stiff, REAL PENATIES for non-compliance.

Then I think we will have made a step in the right direction!


"There are no necessary evils in government. Its evils exist only in its abuses." -- Andrew Jackson



6/21/2006

Dealing With Bullies 101 and Phone Tag

North Korea said Wednesday it wants direct talks with the United States over its apparent plans to test-fire a long-range missile, a day after the country issued a bristling statement in which it declared its right to carry out the launch.

North Korea said in comments published Wednesday that its self-imposed moratorium on testing long-range missiles from 1999 no longer applies because it's not in direct dialogue with Washington, suggesting it would hold off on any launch if Washington agreed to new talks. Of course, we all know that North Korea, which has deliberately boycotted the six-nation diplomatic talks channel for the last six months, could easily return to these talks at any time with any concerns it may have.

This is classic bullying at its worst -- on an international scale, and with nuclear weapons! The bully taunts and attempts to gain the upper hand through threats and intimidation. And where I grew up, in New York City, where there are plenty of bullies, I learned pretty quickly that there is only one way for a nerdy little kid to stop the bully: You have to stand up to them, no matter what it takes. Once you do that, they will stop. Oh, they may not ever become your friend, as my bleeding heart Liberal friends would hope, but at least they'll stop throwing rocks at your head.

Rephrased into a modern and somewhat vulgar Confucianism:

Confucius Say: "Bully not go away by self. Must disable to remove threat."

I think its time the United States stopped worrying about how we appear to the rest of the world from a diplomatic "Good Guy Rating" perspective, and take care of business. These bullies like Kim Jong-il and Ahmadinejad in Iran need to be handled in a bit more forthright manner. Once you put a stop to this tyrannical BS the whole landscape changes and the tension level goes down for everybody. If we had enough guts to stop Hitler in the late 1930's when it was all too obvious what he was doing, a very large number of American and European lives could have been saved. Not only that, but this guy has people who are starving because he is so determined to build his power, at the expense of basic human needs and dignity.

Do you really think we should "take the high road" and negotiate diplomatically with this kind of Schmuck?

Now this is funny; foreign minister says:

"North Korea as a sovereign state has the right to develop, deploy, test fire and export a missile," he said. "We are aware of the U.S. concerns about our missile test-launch. So our position is that we should resolve the issue through negotiations."

Negotiations? You throw a rock at my house and then you ask me if I want to negotiate? I'll negotiate, you little bastard! You'll be a member of the Memberless Dictator Club when I'm done!!


That's my two cents.


Microsoft Aims to End Phone Tag



On a side note, this from Digg:

When two people are trying to get a hold of each other but each time one calls the other they get the answering machine/service. The tag part is when it goes back and forth:

10 Person One calls Person Two, leaves message
20 Person Two returns Person One call, ends up leaving message
30 Person One again tries to call Person Two but there is no answer so they leave a message again.
40 GOTO 20

The real solution? Leave meaningful messages. I hate when people leave a message of "hey, call me back" When they could have left "hey, I need to know X, Y and Z, give me call when you get a chance." That way, if I call them back and they aren't there I can leave a message answering X, Y and Z and if that's all they need then the loop is broken.

It all boils down to one thing: Communication.

in other news...



Wired has an Article "Laptops Give Hope to the Homeless".

Sure! If you open it up, you can put it over your head to protect you from the rain! Of course! Just send your donations my way.


6/09/2006

Protecting "Trial Versions" of assemblies

Recently I saw a post on one of the MS newsgroups looking for a place to store a "File" so that you would be able to read so you'd know if the user of your Trial software was using it beyond the specified trial expiration date.

There were a number of answers, but none of them used the approach that seemed so obvious to me: Why do you need to worry about a file, when you can embed the expiration date directly into the assembly!

Now this is by no means secure, and is certainly not immune from decompilation - not by a long shot. However, it should give those who have any kind of imagination some food for thought. Bear in mind, I'm keeping it very simple, and I haven't even encrypted the expiration date:


using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Reflection ;

[assembly: AssemblyConfiguration("06/10/2006")]
// this can be encrypted.
[assembly: AssemblyVersion("1.0.0.0")]
namespace AssemblyConfigurationTest
{
public class WebForm1 : System.Web.UI.Page
{
DateTime ExpirationDate;
private void Page_Load(object sender, System.EventArgs e)
{
//Page.Trace.IsEnabled =true; // you can uncomment this and other lines to see the values without having to be "Debug".
Assembly asm = Assembly.GetExecutingAssembly();
string fullHashString= asm.FullName +asm.GetName().Version.ToString();
Trace.Write(fullHashString);
int asmHash = fullHashString.GetHashCode();
object[] objArray=asm.GetCustomAttributes(false) ;
int hash ;
foreach (object obj in objArray)
{
AssemblyConfigurationAttribute conf =
obj
as AssemblyConfigurationAttribute;
if (conf != null)
{
hash = conf.Configuration.GetHashCode();
//Trace.Write(hash + ": " +asmHash);
if(hash !=-579392602 || asmHash!=-1991291623)
throw new InvalidOperationException("Assembly Has been Altered! Bad, Bad!");
this.ExpirationDate=Convert.ToDateTime(conf.Configuration) ;
}
}
Response.Write("This Trial Version Expires: " +
this.ExpirationDate.ToString());
}

6/06/2006

This Just In: AJAX Doesn't have to be -- AJAX!

Yep, Jesse James Garrett, that cowboy of marketing hype, said it very clearly (according to Brent Ashley).

The Decree has been Handed Down:


Ajax is no longer an acronym to be limited to its original initials.

According to Jesse, as long as these two basic ingredients are involved, what you have is an Ajax application. (Hallelluja! Praised be the AJAX Gods! Lordy, Lordy!) :
  • asynchronous interaction model

  • browser-native technologies

  • Hopefully, organizations like the new OpenAjax Alliance will be able to reach consensus on what needs to be done and how in order to take us to the next level in Rich Internet Application evolution.

    Open Ajax Alliance? What the hell is that! Why don't we have an Open Javascript Alliance? How about an Open HTML one? What's the purpose?

    Anyway, the message is that now we can call it "AB" - definitely a step in the right direction!

    You see how very adaptible it all is? Even if it ain't really "AJAX", you can still call it -- AJAX! I can't describe how very comfy and relieved that makes me feel!

    Not only that, we can probably get rid of the "Asynchronous Interaction Model" one since a large percentage of so-called "AJAX" webpages do not use asynchronous methods anyhow. Now, "Browser-native" technologies, I suppose, is a "given" also, since without a browser, you'd probably just be watching TV, right? (Of course, for accuracy's sake, I'll probably want to look that one up in my HillBilly SpellChecker). Now this is GREAT NEWS - it means we don't need ANY REQUIREMENTS - therefore, ANYTHING can be AJAX! Whoopee! Though I walk in the valley of the shadow of XMLHTTP, I shall fear NO SCRIPT! WTFOMG! AJAX ME BABY! IT'S THE AJAX REVOLUTION! OMG! CRADLETODAGRAVE, BABY!

    Ain't marketing grand? Acronyms don't have to be limited to their original initials! Now if I am correct in assuming we can get rid of the "A" for Asynchronous and the "B" for browser-native as above, we don't need any acronym at all, and we can just go back to describing such applications as employing "Remote Scripting" which is the way it has always been anyway. Of course "the World AJAX Conference in Amsterdam" would suffer a bit, not having anything much to talk about, but - hey, That's Progress (TP).

    Listen: It's still Remote Scripting to me. That's what it was when Microsoft brought it out in 1998. You can "seminar it to death" if you want to. Eventually, as with any other fad, everything will settle down. Oh, people will still be doing "AJAX" -- just as they have been since last century. Probably by that time we'll have "Web 9.2" (And probably ATLAS 4.2 also).

    I can't seem to get this across to them. It's not AJAX - it's "AHAB" - A Lotta Hype And Bullshit!

    6/02/2006

    Diggety? And ClientID "Unmangling"

    I noticed Digg was down this morning ("metropolitan network problems") so I missed my morning DiggFix.

    But when I stopped back during lunch to check out some post about a new NanoCrystal Display technology, I got a laff from one comment:


    "HOLY CRAP GUYS THIS IS IT. THIS IS THE REVOLUTION. IT STARTS NOW WTFOMGWTF!!!!!!!!WE COULD BEND THE TV WTFOMGWTF!!!!!!!! BEND IT BABY!! BEND IT LIKE BECKHAM!!!!!!!!OOOOOHHH YEAAHHHH!!!!!!!!!!! MY BENDY LAPTOP IS GONNA RUN FOOOOREVER!!!!!!!FUEL CELL BATTERY PLUS NANOCRYSTAL DISPLAY 4 LYFE MOTHER****** CRADLE 2 DA GRAVE BABYWTFOMGWTF!!!!!!!


    This, folks is what happens to otherwise perfectly normal geeks who spend too much time on Digg. Their minds get DiggF*cked!

    Sadly, there is no known cure.

    ClientID Unmangler:



    In other news, I've noticed that the concept of "not being able to get the eventual correct ClientId" of an element when using MasterPages is showing up on forums and newsgroup postings in ever - increasing numbers.

    Let me give an example of one way to do this:


    private string script = "[Label1ID].innerHTML = 'boo!';";
    private string scriptKey = "hello";
    private bool addScriptTags = true;
    protected void Page_Load(object sender, EventArgs e)
    {
    script = script.Replace("[Label1ID]",Label1.ClientID);
    ClientScript.RegisterStartupScript(this.GetType(), scriptKey, script, addScriptTags);

    What this does, very simply, is inject a javascript variable into the page with the "real" ClientId including all the MasterPage and any other namingcontainer mangling that ASP.NET uses to disambiguate control id's.

    ( boy, that was a mouthful. I better look that one up in my Hillbilly SpellChecker.)