Sunday, January 25, 2009

Bookmarklet - View Rendered HTML Source Code

Developing DHTML applications can be challenging, often the rendered HTML source code is dynamically assembled via JavaScript or AJAX and is dramatically different than the original source code of the Web page.

To view the raw rendered source code of an HTML page, save the following link as a bookmark, then navigate to the HTML page and click the bookmark.

javascript:document.write('<pre>' + document.body.innerHTML.replace(/</g,'&lt;').replace(/>/g,'&gt;') + '</pre>');

Friday, January 23, 2009

Change Remote Desktop Port

To change the default port for Windows Remote Desktop:

  1. Start Registry Editor ("RegEdit.exe")
  2. Locate and the following registry key:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber

  3. On the Edit menu, click Modify, and then click Decimal
  4. Type the new port number, and then click OK
  5. Exit Registry Editor

See Microsoft Knowledge Base Article 306759 for additional details.

Classic ASP Permanent Redirect

In Classic ASP, the Response.Redirect method causes the server to send a temporary redirect code (302) in the response header.

To send a permanent redirect code (301) in the response header, use the following code instead:

Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "/new-page.asp"
Response.End

Replace "/new-page.asp" with the absolute or relative URL of the destination page.

Sunday, January 04, 2009

Website Analytics Investment in 2009

Web Analytics Demystified conducted a poll during a webcast in December of 2008. The poll asked about planned website analytics investment in 2009. Based on 251 responses, the results were as follows:

  • 36% said spending on website analytics would increase in 2009
  • 50% said spending on website analytics would not change in 2009
  • 14% said spending on website analytics would decrease in 2009

Saturday, January 03, 2009

MySQL Detailed Table Information

Use the following query to view detailed information about each table in the specified database:

SHOW TABLE STATUS FROM `database`;

Explanation

The SHOW TABLE STATUS command will show the following information about each table in the specified database:

  • Name
  • Engine
  • Version
  • Row Format
  • Rows
  • Average Row Length
  • Data Length
  • Max Data Length
  • Index Length
  • Data Free
  • Auto Increment
  • Create Time
  • Update Time
  • Check Time
  • Collation
  • Checksum
  • Create Options
  • Comment

Replace database with the name of your database.

MySQL ISNULL() Function

If you are familiar with Microsoft SQL you may have used the ISNULL() function; the equivalent function in MySQL is IFNULL().

In Microsoft SQL, the syntax is as follows:

SELECT ISNULL(NULL, 'Some Value')

In MySQL, the syntax is as follows:

SELECT IFNULL(NULL, 'Some Value')

Xbox 360 - Left 4 Dead - Game Design

Lately I have been playing Left 4 Dead on the Xbox 360 console and one thing that really impresses me is how smoothly multi-player gaming works. From a game design perspective, I think the following features are really nice:

  • Players can join or leave games at anytime (even during a campaign)
  • Players who are inactive (idle) for too long are seamlessly controlled by the computer until they return and press a button (which means people can take breaks without significantly impacting the other players)
  • Left 4 Dead is heavily focused on cooperative play, to the extent that your team must "rescue" players in many situations; this greatly enhances the overall experience and raises the intensity level as players strive to reach teammates before they are killed
  • Voice chat works really well and is almost mandatory to survive on the more challenging difficulty settings
  • Players can see silhouettes of their teammate through walls and other obstacles, which greatly reduces people asking "Where are you?" and makes it much easier to rejoin the group if players get separated
  • Players can see their teammates health bars at all times, as well as a partial inventory of what they are carrying
  • Players can heal their teammates

Many of these techniques have been implemented in other games, but Left 4 Dead does a great job of blending them all together in a cohesive and fun experience.