Friday, February 24, 2012

OS’s scheduler

First-come first-served (FCFS)
Shortest-job next (SJN)
Shortest remaining time (SRT)
Round-robin (RR), quantum = 1
Round-robin (RR), quantum = 5

RR is a preemptive scheduler, which is designed especially for time-sharing systems. In other words, it does not wait for a process to finish or give up control. In RR, each process is given a time slot to run. If the process does not finish, it will “get back in line” and receive another time slot until it has completed.

Scheduling
Round-Robin Scheduling

Monday, November 21, 2011

Writing Custom Code in SQL Server Reporting Services

To add code to a report 

1.On the Report menu, click Report Properties. 
  Note If the Report menu is not available,
  click within the report design area. 
2.On the Code tab, in Custom Code, type the code.

Methods in embedded code must be written in Visual Basic .NET. The following is a sample function to calculate Last Monday.

Public Function StartDate()
StartDate = Today.AddDays(-6 - Today.DayOfWeek())
End Function

Writing Custom Code in SQL Server Reporting Services

Friday, November 18, 2011

Run MS Test via the command-line tool MSTest.exe

  • Right-click the ‘List of Tests’ option in the tree view on the left and select the ‘New Test List…’ option.
  • Fill out the dialog with a meaningful name and description.
  • Click the ‘All Loaded Tests’ option in the tree view to display a list of available tests. Right click on the displayed list and select the menu item.
  • Running MSTest at the command prompt with the ‘testmetadata’ option pointing to your new vsmdi file will run the tests.
"C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\MSTest.exe" /testmetadata:%1.vsmdi

Wednesday, November 09, 2011

Replay an IIS web server log

  1. Click Test and then click New Test.
    The Add New Test dialog box is displayed.
  2. Under Add to Test Project, choose one of the options for creating a new test project. For example, click Create a new Visual C# Test Project.
    Note:
    By default, the type of test project shown under Add to Test Project is the type that is currently set as the default in the Options dialog box, which is available onthe Tools menu. For more information, see How to: Configure Test Project Creation.
  3. In the Templates pane, select the type of test you want to add.
  4. Click OK.
    The New Test Project dialog box appears.
  5. Enter a name for the new test project, or accept the default name, and click Create.
  6. Depending on the type of test you chose, you can either hand-code or generate the newly added test.
Microsoft.VisualStudio.TestTools.WebTesting namespace is in
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PublicAssemblies\ Microsoft.VisualStudio.QualityTools.WebTestFramework.dll
Application must target .NET Framework 4.

To reference the Log Parser, look for the “MS Utility 1.0 Type Library – LogParser Interfaces collection” COM component in the Add Reference dialog.


MSDN: Create a Test Project
Josh Christie: Replay an IIS web server log
VS 2010 compiler error: Interop type XXX cannot be embedded. Use the applicable interface instead.

Thursday, October 13, 2011

Prevent popup appearing before the page is fully rendered.

StringBuilder strScript = new StringBuilder();
strScript.Append(" ");
ClientScript.RegisterStartupScript(this.GetType(), "Pop", strScript.ToString());

When you click the Save button, the popup may appear immediately after the postback with the white screen background.


Solution 1:
StringBuilder strScript = new StringBuilder();
strScript.Append(" ");
ClientScript.RegisterClientScriptBlock(this.GetType(), "Pop", strScript.ToString());

Solution 2: Add a timer to the alert

strScript.Append("window.setTimeout('displayMessage()', 1000);\n");

Monday, September 19, 2011

Registry Edits for Windows XP

Windows XP - Fix Suddenly lost the ability to minimize programs onto the taskbar


Registry Edits for Windows XP

Thursday, September 15, 2011

WYSIWYG HTML editors

elRTE is a WYSIWYG HTML editor for the Web written using jQuery. It features rich text editing, options for changing its appearance and style, insertion and management of various HTML elements with formatting (images, tables, lists, etc.), support for viewing and editing HTML code, and normal and full-screen modes.
elRTE

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB.
TinyMCE

PATCH .trim() in JavaScript not working in IE


if (typeof String.prototype.trim !== 'function')
{
String.prototype.trim = function()
{
return this.replace(/^\s+\s+$/g, '');
}
}