August 5, 2009

Eliminate Spaghetti Code Using PHP Rules

HP Rules is a rule engine that lets you separate conditional logical statement from your source code and from the database, placing the conditional logic in reusable files, where you can define and manage them independently. This article demonstrates how to: Install PHP Rules and execute rules stored in text

Discover Long-Running Queries

Let SQL Server tell you which queries take the longest to run. The following query returns the five longest-running queries. You can change the TOP 5 to whatever number best meets your needs. SELECT TOP 5 t.TEXT query, stats.max_elapsed_time AS MaxElapsedTime,FROM sys.dm_exec_query_stats statsCROSS APPLY sys.dm_exec_sql_text( s.sql_handle ) tORDER BYs.max_elapsed_time DESC

An OCX-less Progress Bar

If you need a progress bar in your VB6 application, but don’t want to add the reference to Microsoft Windows Common Controls, here’s a simple way to create a progress bar that doesn’t require any extra components. Author’s Note: The sample program does use the slider bar from the Common

Edit Project Files Directly in Visual Studio

This tip applies to VS project files for .NET languages such as C#, VB.NET, and Managed C++. Follow these steps to edit a project file: In the context Menu of the Solution Explorer, select the “Unload Project” option. This will unload the project so you can edit the project file.

Using the Guard Mechanism in Multi-Threaded Applications

Using the guard mechanism in multi-threaded applications instead of explicit Lock and Unlock instructions can save you from a number of undesirable synchronization problems. Developers writing multi-threaded applications often fall into the trap of acquiring a lock—and then failing to release it—which can lead to random blackouts. Even when the

Make Minor Code Changes to .ASPX Pages Without Rebuilding

If you have a web site already in production, but need to make a small coding fix to an .aspx page, instead of making the change in the code-behind file and then rebuilding and redeploying the entire project, you can make minor changes in the .aspx page code itself, writing