Monday, March 26, 2007

The Psychology of Computer Programming

  1. Understand and accept that you will make mistakes. The point is to find them early, before they make it into production. Fortunately, except for the few of us developing rocket guidance software at JPL, mistakes are rarely fatal in our industry, so we can, and should, learn, laugh, and move on.

  1. You are not your code. Remember that the entire point of a review is to find problems, and problems will be found. Don't take it personally when one is uncovered.

  1. No matter how much "karate" you know, someone else will always know more. Such an individual can teach you some new moves if you ask. Seek and accept input from others, especially when you think it's not needed.

  1. Don't rewrite code without consultation. There's a fine line between "fixing code" and "rewriting code." Know the difference, and pursue stylistic changes within the framework of a code review, not as a lone enforcer.

  1. Treat people who know less than you with respect, deference, and patience. Nontechnical people who deal with developers on a regular basis almost universally hold the opinion that we are prima donnas at best and crybabies at worst. Don't reinforce this stereotype with anger and impatience.

  1. The only constant in the world is change. Be open to it and accept it with a smile. Look at each change to your requirements, platform, or tool as a new challenge, not as some serious inconvenience to be fought.

  1. The only true authority stems from knowledge, not from position. Knowledge engenders authority, and authority engenders respect—so if you want respect in an egoless environment, cultivate knowledge.

  1. Fight for what you believe, but gracefully accept defeat. Understand that sometimes your ideas will be overruled. Even if you do turn out to be right, don't take revenge or say, "I told you so" more than a few times at most, and don't make your dearly departed idea a martyr or rallying cry.

  1. Don't be "the guy in the room." Don't be the guy coding in the dark office emerging only to buy cola. The guy in the room is out of touch, out of sight, and out of control and has no place in an open, collaborative environment.

  1. Critique code instead of people—be kind to the coder, not to the code.As much as possible, make all of your comments positive and oriented to improving the code. Relate comments to local standards, program specs, increased performance, etc.

The human principles of software are truly timeless; The Psychology of Computer Programming was written way back in 1971

Friday, March 23, 2007

Top ten things ten years of professional software development has taught me

· Object orientation is much harder than you think
Maybe it's just me, but coming from Computer Science class I thought that OO was easy. I mean, how hard can it be to create classes that mimic the real world? It turns out that it's pretty hard. Ten years later, I'm still learning how to model properly. I wish I spent more time reading up on OO and design patterns. Good modeling skills are worth a lot to every development team.

· The difficult part of software development is communication
And that's communication with persons, not socket programming. Now and then you do run into a tricky technical problem, but it's not at all that common. Much more common is misunderstandings between you and the project manager, between you and the customer and finally between you and the other developers. Work on your soft skills.

· Learn to say no
When I started working, I was very eager to please. This meant that I had a hard time saying no to things people asked of me. I worked a lot of overtime, and still didn't finish everything that was asked of me. The result was disappointment from their side, and almost burning out on my part. If you never say no, your yes is worth very little. Commit to what you can handle, and if people keep asking you for more, make it very explicit that this would mean not doing something else. What I did was to have a list of stuff that I needed to do on a piece of paper with me. When someone asked for something, I showed them the list and asked what I should bump to have time to help them. This allowed me to say no in a nice way.

· If everything is equally important, then nothing is important
The business likes to say that all the features are as crucial. They are not. Push back and make them commit. It's easier if you don't force them to pick what to do and what not to do. Instead, let them choose what you should do this week. This will let you produce the stuff that brings value first. If all else goes haywire, at least you've done that.

· Don't over-think a problem
I can spend whole days designing things in front of the white board. That doesn't mean it will be any better, it just means it will be more complicated. I don't mean to say you shouldn't design at all, just that the implementation will quickly show me stuff I didn't think of anyway, so why try to make it perfect? Like Dave Farley says: "The devil is in the details, but exorcism is in implementation, not theory."

· Dive really deep into something, but don't get hung up
Chris and I spent a lot of time getting into the real deep parts of SQL Server. It was great fun and I learned a lot from it, but after some time I realized that knowing that much didn't really help me solve the business' problems. An example: I know that at the table level, SQL Server will not take an IU lock - it will only take a IX lock. This is a performance tweak, since most of the time, the IU lock will have to be escalated into a IX lock anyway. To find this, I spent countless days experimenting, I read loads of material and talked to Microsoft people at conferences. Have I ever had any use of this knowledge. Nope.

· Learn about the other parts of the software development machine
It's really important to be a great developer. But to be a great part of the system that produces software, you need to understand what the rest of the system does. How do the QA people work? What does the project manager do? What drives the business analyst? This knowledge will help you connect with the rest of the people, and will grease interactions with them. Ask the people around you for help in learning more. What books are good? Most people will be flattered that you care, and willingly help you out. A little time on this goes a really long way.

· Your colleagues are your best teachers
A year after I started on my first job, we merged with another company. Suddenly I had a lot of much more talented and experienced people around me. I remember distinctly how this made me feel inferior and stupid. I studied hard, reading book after book but I still didn't catch up. They had too much of an advantage on me, I figured.
Nowadays, working with great people doesn't make me feel bad at all. I just feel I have the chance of a lifetime to learn. I ask questions and I try really hard to understand how my colleagues come to the conclusions they do. This is why I joined ThoughtWorks. See your peers as an asset, not competition.

· It all comes down to working software
No matter how cool your algorithms are, no matter how brilliant your database schema is, no matter how fabulous your whatever is, if it doesn't scratch the clients' itch, it's not worth anything. Focus on delivering working software, and at the same time prepare to continue delivering software using that code base and you're on the right path.

· Some people are assholes
Most of the time, most of the people around you are great. You learn from them, and they learn from you. Accomplishing something together is a good feeling. Unfortunately, you will probably run into the exceptions. People that because of something or other are plain old mean. Demeaning bosses. Lying colleagues. Stupid, ignorant customers. Don't take this too hard. Try to work around them and do what you can to minimize the pain and effort they cause, but don't blame yourself. As long as you stay honest and do your best, you've done your part.

Ref: http://www.taylor.se/reddit.html

Wednesday, March 14, 2007

How True: Men's rules

Finally, the guys' side of the story.

We always hear
" the rules " From the female side.

Now here are the rules from the male side.

These are our rules!

Please note.. These are all numbered "1"
ON PURPOSE!


1. Men are NOT mind readers.

1. Shopping is NOT a sport. And no, we are never going to think of it that way.


1.
Crying is blackmail.


1. Ask for what you want.

Let us be clear on this one:

Subtle hints do not work!

Strong hints do not work!

Obvious hints do not work!

Just say it!


1. Yes and No are perfectly acceptable answers to almost every question.


1. Come to us with a problem only if you want help solving it. That's what we do. Sympathy is what your girlfriends are for.




1. A headache that lasts for 17 months is a Problem. See a doctor.


1. Anything we said 6 months ago is inadmissible in an argument. In fact, all comments become null and void after 7 Days.


1. If you won't dress like the Victoria 's Secret girls, don't Expect us to act like soap opera guys.

1. If you think you're fat, you probably are. Don't ask us.


1. If something we said can be interpreted two ways and one of the ways makes you sad or angry, we meant the other one

1. You can either ask us to do something Or tell us how you want it done. Not both.

If you already know best how to do it, just do it yourself.


1. Whenever possible, Please say whatever you have to say during commercials.


1.
Christopher Columbus did NOT need directions and neither do we.


1. ALL men see in only 16 colors, like Windows default settings.

Peach, for example, is a fruit, not A color. Pumpkin is also a fruit. We have no idea what mauve is.



1. If we ask what is wrong and you say "nothing," We will act like nothing's wrong.

We know you are lying, but it is just not worth the hassle.

1. If you ask a question you don't want an answer to, Expect an answer you don't want to hear.


1. When we have to go somewhere, absolutely anything you wear is fine. Really .


1. Don't ask us what we're thinking about unless you are prepared to discuss such topics as baseball, the shotgun formation, or golf.


1. You have enough clothes.


1. You have too many shoes.


1. I am in shape. Round IS a shape!

Yes, I know, I have to sleep on the couch tonight;

Friday, February 09, 2007

SQL Server 2005: View all permissions

select dp.NAME AS principal_name, dp.type_desc AS principal_type_desc, o.NAME AS object_name,

p.permission_name, p.state_desc AS permission_state_desc

from sys.database_permissions p

left OUTER JOIN sys.all_objects o on p.major_id = o.OBJECT_ID

inner JOIN sys.database_principals dp

on p.grantee_principal_id = dp.principal_id


(found somewhere on web)

Thursday, February 08, 2007

ParameterizedThreadStart

ParameterizedThreadStart is to pass parameter to new starting Thread.

you can pass only one parameter of type object. the function definition should have one in param of type object.

Passing Parameter to Thread


In .NET 2.0, there is a new delegate, ParameterizedThreadStart, which takes
a parameter of type object. You can create a thread using an instance of
this delegate instead of just ThreadStart, and a new overload to Thread.Start
allows you to specify the value to be passed to the new thread. This is simple, but only accepts
a single parameter and isn't type-safe (just like the options when using thread pool threads).
The earlier code could then be rewritten as:



[In some method or other]

Thread t = new Thread (new ParameterizedThreadStart(FetchUrl));

t.Start (myUrl);



[And the actual method...]

static void FetchUrl(object url)

{

// use url here, probably casting it to a known type before use

}



http://www.yoda.arachsys.com/csharp/threads/parameters.shtml





powered by performancing firefox

BizTalk Macros or FILE adapter

%datetime%

%datetime_bts2000%

%datetime.tz%

%DestinationParty%

%DestinationPartyID%

%DestinationPartyQualifier%

%MessageID%

%SourceFileName%

%SourceParty%

%SourcePartyID%

%SourcePartyQualifier%

%time%

%time.tz%



http://geekswithblogs.net/benny/archive/2006/12/24/101980.aspx





powered by performancing firefox

Friday, February 02, 2007

update WSS 3.0 List through Email



http://www.wssdemo.com/Pages/Email.aspx



Thursday, February 01, 2007

Debugging Windows Service

#if (DEBUG)

Service service = new Service();

service.Start(); //define a public method: public void Start(){OnStart(null);}
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);

#endif

Deserialize to Object from XML Config File in .NET 2.0

static EventLogConfig GetEventLogConfig {

get {

XmlSerializer mySerializer = new XmlSerializer(typeof(EventLogConfig));

XmlNodeReader reader = new XmlNodeReader(Settings.Default.EventLogConfig.DocumentElement);



return (EventLogConfig) mySerializer.Deserialize(reader);



}

}






powered by performancing firefox

Modify application settings in .NET 2.0

(Settings1.Settings) you can't change application settings in code. You can only change user
settings. To change the application settings, you need to write your
own code to open the configuration file as any xml file and modify it

http://blogs.msdn.com/mohamed_sharafs_blog/archive/2006/12/12/using-application-user-settings-in-c-2-0.aspx

Wednesday, January 24, 2007

Office 2007 installation failed!

Setup is unable to proceed due to the following error(s): The 2007
Microsoft Office system does not support upgrading from a prerelease
version of the 2007 Microsoft Office system. You must first uninstall
any prerelease versions of the 2007 Microsoft Office system products
and associates technologies




http://www.hanselman.com/blog/Office2007WontUpgradeFromAPrereleaseVersionOfThe2007OfficeSystemOffice2007SetupSpelunking.aspx





powered by performancing firefox

Tuesday, January 16, 2007

Monday, January 08, 2007

corporate lingo

Here is a little clarification of corporate lingo J

Competitive salary:
We remain competitive by paying less than our competitors.

Join our fast-paced company:
We have no time to train you.

Casual Work Atmosphere:
We don't pay enough to expect that you'll dress up-well; a couple
of the real daring guys wear earrings.

Must be deadline oriented:
You'll be six months behind schedule on your first day.

Some overtimes required:
Some time each night and some time each weekend.

Duties will vary:
Anyone in the office can boss you around.

Must have an eye for detail:
We have no quality control.

Career-minded:
Female Applicants must be childless (and remain that way).

Apply in person:
If you're old, fat or ugly you'll be told the position has been
filled.

No phone calls please:
We've filled the job; our call for resumes is just a legal
formality.

Seeking candidates with a wide variety of experience:
You'll need it to replace three people who just left.

Problem-solving skills a must:
You're walking into a company in perpetual chaos.

Requires team leadership skills:
You'll have the responsibilities of a manager, without the pay or
respect.

Good communication skills:
Management communicates, you, figure out what they want and do.

I am extremely adept at all manner of office organization:
I've used Microsoft Office.

I am honest, hardworking and dependable:
I pilfer office supplies.

My pertinent work experience includes:
I hope you don't ask me about all the McJobs I've had.

I take pride in my work:
I blame others for my mistakes.

I am personable:
I give lots of unsolicited personal advice to co- workers.

I am extremely professional:
I carry a Day-Timer.

I am adaptable:
I've changed jobs a lot.

I am on the go:
I'm never at my desk.

We will look into it - By the time the wheel makes a full turn, we assume you will have forgotten about it too.

It is in process -
So wrapped up in red tape that the situation is almost hopeless.

A Program -
Any assignment that can't be completed by one telephone call.

Expedite -
To confound confusion with commotion?

Channels -
Be trail left by the interoffice memo.

Coordinator -
me guy who has a desk between two expeditors.

Consultant (or Expert) -
Any ordinary guy more than 50 miles from home.

To Activate
- To make carbons and add more names to the memo.

To Implement a Program -
Hire more people and expand the office.

Under Consideration -
Never heard of it.

Under Active Consideration -
We're looking in the files for it.

A Meeting -
A mass mulling by master minds.

A Conference
- A place where conversation is substituted for the dreariness of labor and the loneliness of thought.

To Negotiate -
To seek a meeting of minds without knocking together of heads.

Re-orientation -
Getting used to working again.

Reliable Source -
The guy you just met.

Informed Source -
The guy who told the guy you just met.

A Clarification -
To fill in the background with so many details that the foreground goes underground.

We Are Making A Survey -
We need more time to think of an answer.

Note and Initial -
Let's spread the responsibility for this.

See Me, or Let's Discuss -
Come down to my office, I'm lonesome.

Let's Get Together on This -
I'm assuming you're as confused as I am.

Give Us the Benefit of Your Present Thinking -
We'll listen to what you have to say as long as it doesn't interfere with what we've already decided to do.

To Give Someone the Picture -
A long, confused and inaccurate statement to a newcomer.

Will Advise You in Due Course -
If we figure it out, we'll let you know.

Sunday, January 07, 2007

upgrade TFS to WSS 3.0


http://bloggingabout.net/blogs/mglaser/archive/2006/12/08/Upgrade-TFS-V1
-to-WSS-3.0-Guide.aspx

Wednesday, December 06, 2006

BizTalk Server 2004 Databases List

BizTalk 2004 can install with up to 13 different databases. The databases installed depends on how you configure your installation. The potential database list is:

  • BAMPrimaryImport – used for Business Activity Monitoring
  • BAMStarSchema – used for Business Activity Monitoring
  • BAMAnalysis – Business Activity Monitoring OLAP Cubes
  • BAMArchive – Archives Business Activity Monitoring
  • BizTalkHWSDb – Human Workflow Services Database
  • BizTalkDTADb – Tracking Database
  • BizTalkMgmtDB – Stores all Configuration Information
  • BizTalkMsgBoxDb – Stores all Messages and subscriptions – You can have multiple MessageBox Databases
  • BizTalkRuleEngineDb – Stores Policies and Vocabularies
  • SSODB – Single Sign-On Database
  • TPM – Trading Partner Database for Business Activity Services
  • BizTalkAnalysisdb – Stores business and health monitoring OLAP Cubes
  • BizTalkEDIdb – Stores state for EDI
http://dallas.sark.com/SarkBlog/mholdorf/archive/2004/06/14/261.aspx

Friday, December 01, 2006

smile:Instructions on consumer goods

On Sears hairdryer:
Do not use while sleeping.
(Gee, that's the only time I have to work on my hair!)

On a bag of Fritos:
You could be a winner! No purchase necessary. Details inside.
(The shoplifter special!)

On a bar of Dial soap:
Directions: Use like regular soap.
(and that would be how?)

On some Swann frozen dinners:
Serving suggestion: Defrost.
(But it's 'just' a suggestion!)

On Tesco's Tiramisu dessert: (printed on bottom of the box)
Do not turn upside down.
(Too late! you lose!)

On Marks & Spencer Bread Pudding:
Product will be hot after heating.
(Are you sure? Let's experiment.)

On packaging for a Rowenta iron:
Do not iron clothes on body.
(But wouldn't that save more time?)
(Whose body?)

On Boot's Children's cough medicine:
Do not drive car or operate machinery.
(We could do a lot to reduce the construction accidents if we just kept those 5 year olds off those fork lifts.)

On Nytol sleep aid:

Warning: may cause drowsiness.
(One would hope!)

On a Korean kitchen knife:
Warning: keep out of children.
(hmm...something must have gotten lost in the translation...)

On a string of Christmas lights:
For indoor or outdoor use only.
(As opposed to use in outer space.)

On a food processor:
Not to be used for the other use.
(Now I'm curious.)

On Sainsbury's peanuts:
Warning: contains nuts.
(but no peas?)

On an American Airlines packet of nuts:
Instructions: open packet, eat nuts.
(somebody got paid big bucks to write this one...)

On a Swedish chainsaw:
Do not attempt to stop chain with your hands.
(Raise your hand if you've tried this...)

On a child's Superman costume:
Wearing of this garment does not enable you to fly.
(Oh go ahead! That's right, destroy a universal childhood belief.)

Wednesday, November 29, 2006

Programming Quotes

It's hard enough to find an error in your code when you're looking for it; it's even harder when you've assumed your code is error-free.

Steve McConnell

 

If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilisation.

Gerald Weinberg

 

Programming can be fun, so can cryptography; however they should not be combined.

Kreitzberg and Shneiderman

 

Testing by itself does not improve software quality. Test results are an indicator of quality, but in and of themselves, they don't improve it. Trying to improve software quality by increasing the amount of testing is like trying to lose weight by weighing yourself more often. What you eat before you step onto the scale determines how much you will weigh, and the software development techniques you use determine how many errors testing will find. If you want to lose weight, don't buy a new scale; change your diet. If you want to improve your software, don't test more; develop better.

Steve McConnell

 

Once a new technology starts rolling, if you're not part of the steamroller, you're part of the road.

Stewart Brand

 

The truth does not change according to our ability to stomach it.

Flannery O'Connor

 

You're bound to be unhappy if you optimize everything.

Donald Knuth

 

An organisation that treats its programmers as morons will soon have programmers that are willing and able to act like morons only.

Bjarne Stroustrup

 

Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

Bill Gates

 

The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.

Tom Cargill

 

The most important single aspect of software development is to be clear about what you are trying to build.

Bjarne Stroustrup

 

If the code and the comments disagree, then both are probably wrong.

attributed to Norm Schryer

 

Simplicity is prerequisite for reliability

Edsger W.Dijkstra

 

Copy and paste is a design error

David Parnas

 

Ref: http://www.eskimo.com/~hottub/software/programming_quotes.html