Tuesday, December 27, 2005

Freedom

Freedom comes in small packages........
usually TCP/IP.

Tuesday, December 20, 2005

quotes from Debugging the Development Process

quotes from ‘Debugging the Development Process’ , Steve Maguiret)

  • Don’t waste the developers’ time on work that does not improve the product.

  • Always determine what you’re trying to accomplish, and then find the most efficient and pleasurable way to do it.

  • Establish detailed project goals to prevent wasting time on inappropriate tasks.

  • Don’t Fix Bugs Later, Fix them now.

  • Regularly Stop what you’re doing and look ahead, make little adjustments now to avoid big obstacles later on.

  • Each day, ask, “What can I do today to help keep the project on track for the next few months?”

  • Don’t waste time working on the wrong problem. Always determine what the real problem is before you try to make a fix.

  • People often ask for something other than what they really need. Always determine what they are trying to accomplish before dealing with any request.

  • Never commit the dates you know you can’t meet. You’ll hurt everybody involved.

  • Beware of recurrent meetings. Make sure they’re worth the disruption they cause.

  • Before calling any meeting, be sure you know exactly what you want to achieve and what you need to achieve it. Then make sure you do achieve it.

  • Make sure each team member learns one new significant skill at least every two months.

  • Watch out for and correct the “It’s too much work” reaction. Train programmers to first consider whether task makes sense and whether it matches up with the project goals and priorities.

  • Don’t ship substandard feature. Postpone them until you can implement them properly.

  • Give some priority to writing easily shared code. Programmers can’t share each other’s code unless they’re writing it so that it can be shared.

  • If your project is slipping, something is wrong. Don’t ignore the cause and demand long hours of the team members. Find and fix the problems.

  • Beware of the misguided belief that long hours result in greater productivity. If anything, long hours only hurt productivity.

  • Stress the importance of thinking hard, not working hard.

  • Train the development team to work efficiently during a normal workday. Don’t allow them to work long hours, which servers only to mask time-wasting activity.

Tuesday, November 22, 2005

event handler: Cannot complete this action


I made an event handler for doclibs to log the document updating and deletion activities. After deployment, the event handler for document library was logging the delete event but giving the exception on update event: “Cannot Complete this action, Please try again.”
After much effort, I found that the problem was with WSS Service Pack 2, and the exception was raised when try to access SPListItem collection.
The issue was because of increased security with WSS sp2.
http://support.microsoft.com/default.aspx?scid=kb;en-us;909455

The resolution is
using System.Security.Principal ...
WindowsImpersonationContext wic = WindowsIdentity.GetCurrent().Impersonate();
//implement OM code here
wic.Undo();

Thursday, November 17, 2005

Attach an Event sink with Multiple Document Libraries

Attach an Event sink with Multiple Document Libraries
There is no easy way in SPS 2003 to attach an event sink with multiple document libraries. You have to iterate each one manually or programmatically, following is the hack for this (SPS 2003)
For existing doclibs
Db: _Site
update lists set
     tp_EventSinkAssembly = 'WSSEventSink, Version=1.0.0.0, Culture=neutral,                                          PublicKeyToken=56761703e95c64a0',
     tp_EventSinkClass ='WSSEventSink.EventSink'
where tp_ServerTemplate = 101 --doclib

For newly created doclibs
Schema.XML
<List  EventSinkAssembly="WSSEventSink, Version=1.0.0.0, Culture=neutral, PublicKeyToken=56761703e95c64a0" EventSinkClass="WSSEventSink.EventSink"