Stithaprajyna

I use this blog to jot down what ever comes into my mind or get to see anything I feel is important.

Tuesday, March 28, 2006

There are many correct ways to answer a test question

R.L. Loeffelbein A physics teacher at Washington University in St. Louis was about to give a student a zero for the student's answer to an examination problem. The student claimed he should receive a perfect score, if the system were not so set up against the student. Instructor and student agreed to submit to an impartial arbiter, Dr. Alexander Calandra, who tells the story.
The examination problem was: "Show how it is possible to determine the height of a tall building with the aid of a barometer."
The student's answer was, "Take the barometer to the top of the building, attach a long rope to it, and lower the barometer to the ground. Then, bring it back up, measuring the length of the rope and barometer. The lengths of the two together is the height of the building."
I, as arbiter, pointed out that the student really had a strong case for full credit since he had answered the problem completely and correctly. On the other hand, of course, full credit would contribute to a high grade for the student in his physics course, and a high grade is supposed to certify that the student knows some physics, a fact that his answer had not confirmed. So it was suggested that the student have another try at answering the problem.
He was given six minutes to answer it, with the warning this time that the answer should indicate some knowledge of physics. At the end of five minutes, he had not written anything. Asked if he wished to give up, he said no, that he had several answers and he was just trying to think which would be the best. In the next minute he dashed off this answer. "Take the barometer to the top of the building. Lean over the edge of the roof, drop the barometer, timing its fall with a stopwatch. Then, using the formula S=½at2, calculate the height of the building. At this point, I asked my colleague if he gave up and he conceded. The student got nearly full credit.
Recalling that the student had said he had other answers, I asked him what they were. "Well," he said, "you could take the barometer out on a sunny day and measure the height of the barometer, the length of its shadow, and length of the building's shadow, then use simple proportion to determine the height of the building. And there is a very basic measurement method you might like. You take the barometer and begin to walk up the stairs. As you climb, you mark off lengths of the barometer along the wall. You then count the number of marks to get the height of the building in barometer units.
"Of course, if you want a more sophisticated method, you can tie the barometer to the end of a string, swing it as a pendulum, and determine the value of 'g.' The height of the building can, in principle, be calculated from this.
"And," he concluded, "if you don't limit me to physics solutions, you can take the barometer to the basement and knock on the superintendent's door. When he answers, you say, 'Mr. Superintendent, I have here a fine barometer. If you will tell me the height of this building, I will give you this barometer.'"
Finally, he admitted that he even knew the correct textbook answer -- measuring the air pressure at the bottom and top of the building and applying the appropriate formula illustrating that pressure reduces as height increases -- but that he was so fed up with college instructors trying to teach him how to think instead of showing the structure of the subject matter, that he had decided to rebel.
For my part, I seriously considered changing my grade to unequivocal full credit.

Monday, March 27, 2006

Access Control List

ACL is a list of Access Control Entries that specify access and auditing information used by Windows NT on an New Technology File System (NTFS) hard drive. Windows NT uses the lists to determine which users have been granted access to specific resources (files and folders), and which rights a user may exercise, such as read, write, and execute. The ACLs for a file or folder can be viewed by right-clicking the resource, choosing Properties, and selecting the Permissions button on the Securities tab.

Sunday, March 26, 2006

Power of Windows Presentation Foundation

Windows Presentation Foundation allows application authors to build beautiful user experiences. Templates are the primary way an application author can customize the appearance of controls and arbitrary data. In this episode Robert Ingebretsen and Kevin Moore cover both control and data templating.

More at http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20060202WPFKM/manifest.xml

Saturday, March 25, 2006

Encrypting with X 509 Certificates

// Encrypt the message body with the credit card details using the
// Accounts Department Certificate
X509SecurityToken x509Cert = GetFabrikamAccountsDepartmentCertificate();
paymentServiceProxy.RequestSoapContext.Security.Tokens.Add( x509Cert );
paymentServiceProxy.RequestSoapContext.Security.Elements.Add( new EncryptedData( x509Cert ) );

Thursday, March 23, 2006

HttpContext

Classes that inherit the IHttpModule and IHttpHandler interfaces are provided a reference to an HttpContext object for the current HTTP request. The object provides access to the intrinsic Request, Response, and Server properties for the request.So it is easy to access the Current context objects from any component involved in the chain.

So in the business component which is invoked from Web services we can write

HttpContext Mycontext=HttpContext.Current

Wednesday, March 22, 2006

Updater Application Block

The updater block is a library that you add to your application to manage the download of the application pieces through HTTP.It has some advantages over the original Framework implementation:


  • It runs as a local application and is available all the time with no performance penalties.

  • Updates are transacted; that is, all the files of a new version must be successfully downloaded before the new version becomes available.

  • All the application files are listed in a manifest.

  • It runs as a full trust application; you needn't fiddle with client security policy.

  • Your application can have shortcuts on the Start menu.


  • On the other hand, there are also some disadvantages:

  • You must change your application substantially in order to use it. Since it uses BITS to download the application pieces, it does not run under Windows 98/ME; Windows 2000 or later is required.

  • It runs as a fully trusted local application, so it pretty much ignores code access security.

  • It's not supported by Microsoft.

Tuesday, March 21, 2006

Identity in SQL Server

SQL Server 2000 has three functions that return IDENTITY information. The result of each of these three functions is dependent on three factors:

  • The session scope (which connection produced the IDENTITY value?)

  • The table scope (which table produced the IDENTITY value?)

  • The statement scope (where is the statement that produced the IDENTITY value?)
    (SQL Statements that are contained in the same batch, stored procedure, or trigger are considered to be in the same scope. So, if I call an INSERT that fires a trigger, I have two different scopes: scope 1 is inside the batch that called the INSERT, and scope 2 is inside the trigger.)

SELECT @@IDENTITY
This is everyone's favorite function, unchanged from earlier versions of SQL Server. It returns the last IDENTITY value produced on a connection, regardless of the table that produced the value, and regardless of the scope of the statement that produced the value.

SELECT IDENT_CURRENT('tablename')
This new function returns the last IDENTITY value produced in a table, regardless of the connection that created the value, and regardless of the scope of the statement that produced the value.

SELECT SCOPE_IDENTITY()
This new function returns the last IDENTITY value produced on a connection and by a statement in the same scope, regardless of the table that produced the value

Monday, March 20, 2006

Setting Word Properties Programatically

From within Word, one can select File Properties to view the same information. You could, of course, simply open each document in turn and manually change the settings. That would be rather tedious, though.

A better solution would be to iterate through a selected folder, and possibly the subfolders within the folder, and update the properties programmatically for each file you find. For more information about the built-in document properties and how to set it programatically browse.

Thursday, March 16, 2006

SQL Server 2005 Trial Software

The new platform is chock-full of improvements that make it an ideal database engine whether it's IT administration and management or database development. That's why Microsoft invites you to see what it can really do with a trial version.
More at http://www.microsoft.com/sql/eval/trial-dvd.mspx?wt.mc_id=SQL.AD.01038

Tuesday, March 14, 2006

Microsoft Certifications

For a limited time, you can get a free second shot at any Microsoft IT Professional, Developer, or Microsoft Dynamics (formerly Microsoft Business Solutions) Certification exam. Just register for this offer before your first exam, and you'll get two chances to pass. But this offer won't last forever, so

More at http://www.microsoft.com/learning/mcp/offers/2ndchance/

Monday, March 13, 2006

Visual Studio Team System

Software development is generally recognized as a difficult process. Numerous studies have been conducted and volumes of books written on how to improve the process of developing applications to yield better and more consistent results. The difficulty has never been in coming up with new and better ideas. Rather, the difficulty is in taking those ideas and implementing them in meaningful ways in the real world. With Visual Studio 2005 Team System, Microsoft is taking an important step in helping development teams build robust software systems

Friday, March 10, 2006

Videos for Express Edition

The individuals who are interested in learning the basics of how to create applications using Visual Basic 2005 Express Edition and Visual C# 2005 Express Edition can have a look at the following link. This includes over 10 hours of video-based instruction that walks from creating your first "Hello World" application to a fully functioning RSS Reader application. Learn how to write your first application today!!

More at http://lab.msdn.microsoft.com/express/beginner/default.aspx

Wednesday, March 08, 2006

Principles of Service Design

The Principles of Service Design series has been developed to communicate best practices and sample codes when relevant. Microsoft now released some papers which provides fundamental principles for designing and implementing Web services, including a brief review of Service Oriented Architecture (SOA) concepts and a detailed discussion of several patterns and anti-patterns that developers can leverage when building Web services. Guidance is applicable to any programming language or platform for which Web services can be developed and deployedr.

More at http://msdn.microsoft.com/architecture/default.aspx?pull=/library/en-us/dnbda/html/SOADesign.asp

Tuesday, March 07, 2006

Visual Studio Webcasts

Interested in leveraging your existing skills to become more versatile and more employable? Whether you have skills in Microsoft Visual Basic 6.0, classic ASP, or Microsoft Visual Studio .NET 2003, there is a wealth of learning opportunities to help you discover more than 200 new features in Visual Studio 2005. Choose from over 40 Microsoft ASP.NET webcasts, sign up for a free Visual Basic E-Learning course, or get a copy of Visual Studio 2005 Trial Software and soon, you too will be taking advantage of everything Visual Studio 2005 has to offer.

More at http://www.thedifferenceisobviousvb05.com/campaign.aspx

Friday, March 03, 2006

C# Code Snippets in Visual studio 2005

Code Snippets are reusable, task-oriented blocks of code. Visual Studio 2005 includes code snippets covering tasks ranging from creating a custom exception, to sending an e-mail message, to drawing a circle. A set of Visual Basic and Visual C# Code Snippets are included in the Visual Studio 2005 box. Microsoft released a new set of Code snippets for Visual C# .VB.NET version of these snippets is already available in Visual Studio 2005 box.



You can download these snippet from following Location..

http://msdn.microsoft.com/vstudio/downloads/codesnippets/default.aspx

Thursday, March 02, 2006

Execute XPath Queries by Using the System.Xml.XPath Classes

The System.Xml.XPath namespace contains the XPath parser and the evaluation engine of the .NET Framework.The System.Xml.XPath namespace supports the World Wide Web Consortium (W3C) XML Path Language (XPath) Version 1.0 Recommendation.

More at: http://support.microsoft.com/default.aspx?scid=kb;en-us;317069

Wednesday, March 01, 2006

Code Reviewer

Code reviewer tool by SmartBear software allows you to efficiently automate your code review process. The highlights are


  • Quickly package and deliver code changes for review

  • Automate audit trails

  • Enforce checklists

  • Never miss a change again

  • Review code remotely

  • Integrates with version control / SCM system

  • Integrates with CodePickle for concurrent reviews and development

  • No server to manage


  • More at http://www.codehistorian.com/codereviewer-overview.php