Sunday, October 12, 2008

MySQL Row Number

Use the following MySQL query to return a row number for each record in a recordset:

SELECT @row := @row + 1 AS `RowNumber`, SomeTable.*
FROM SomeTable, (SELECT @row := 0) `DerivedTable`;

Explanation

MySQL allows variables to be assigned and selected in the same statement; therefore, @row := @row + 1 increments the value of the @row variable by one and selects the result. Because the default configuration of MySQL does not allow multiple queries, the value of @row is initialized through a sub-select in the FROM portion of the query. It is important to note that MySQL requires a name for each derived table, in this case the derived table was named DerivedTable. SomeTable and SomeTable.* should be replaced with your table and field list respectively.

Alternate Syntax

If MySQL is configured to allow multiple statements per command (this is turned off by default to prevent several types of SQL injection attacks), you can use the following alternate syntax, which does not require a derived table:

SET @i = 0;
SELECT @i := @i + 1 AS RowNumber, SomeTable.*
FROM SomeTable;

MySQL Numeric Data Types

Signed

Type Minimum Maximum
TINYINT
(1 Byte)
-128 127
SMALLINT
(2 Bytes)
-32768 32767
MEDIUMINT
(3 Bytes)
-8388608 8388607
INT
(4 Bytes)
-2147483648 2147483647
BIGINT
(8 Bytes)
-9223372036854775808 9223372036854775807

Unsigned

Type Minimum Maximum
TINYINT
(1 Byte)
0 255
SMALLINT
(2 Bytes)
0 65535
MEDIUMINT
(3 Bytes)
0 16777215
INT
(4 Bytes)
0 4294967295
BIGINT
(8 Bytes)
0 18446744073709551615

Source MySQL Numeric Data Types

Saturday, October 04, 2008

Microsoft to Ship jQuery with Visual Studio

Microsoft has announced they will be shipping the JavaScript jQuery library with Visual Studio. From the jQuery Blog:

We have two pieces of fantastic, albeit serendipitous, news today: Both Microsoft and Nokia are taking the major step of adopting jQuery as part of their official application development platform. Not only will they be using it for their corporate development but they will be providing it as a core piece of their platform for developers to build with.

This is important news for developers because they will now be able to standardize on the jQuery library for all JavaScript development.

Tuesday, September 30, 2008

Not So Delicious First Impressions

I do not a very good first impression of Delicious:

Sorry, there is a temporary problem. Adding a new bookmark failed.

Please use your browser's Back button and try again. If this problem persists please contact support.

Hmm... isn't adding a bookmark the main feature of the service? Delicious has now broken over a dozen times in the first 10 minutes of use.

I would think adding bookmarks would be rock solid.

Ironically, many of the support pages fail to load properly because Delicious has mixed secure content with non-secure content causing warning messages to pop-up on a regular basis.

Delicious

Like Twitter, I have been hearing about Delicious for awhile now so I finally signed-up. I'm really glad they changed the main URL from http://del.icio.us/ to http://delicious.com/, the former was a challenge to remember (and type).

Follow me on Delicious:

http://delicious.com/Verious/

Web-based Services

I recently stumbled across Username Check, a website that lets you check if your preferred username is available at a variety of popular (and several obscure) websites. The complete list of websites is as follows:

Sunday, September 28, 2008

Twitter

It was bound to happen sooner or later. I have been hearing about Twitter for awhile now so I finally signed-up.

Follow me or leave your username in the comments so I can follow you:

http://twitter.com/Verious/

Windows Live ID Web Authentication SDK

Recently I have been researching Single Sign-On options to streamline the user's experience. One interesting provider I found is Windows Live ID Web Authentication, which allows visitors to logon to a website using their Hotmail or Windows Live account. Microsoft describes the Windows Live ID Web Authentication SDK as follows:

The Windows Live™ ID Web Authentication software development kit (SDK) gives you a platform-neutral way to bring the power of the Windows Live ID authentication service to your own Web site.

According to Microsoft the benefits include:

  • Ability to use Windows Live gadgets and controls to incorporate authenticated Windows Live services into websites
  • HTTP-based, platform-neutral interface for implementing Windows Live ID authentication in existing websites, even if they are hosted by third-parties
  • Freedom from the technical details of authentication
  • Huge user base: any of the millions of users who have a Windows Live ID can login to Windows Live ID Web Authentication websites

Download Windows Live Web Authentication SDK 1.1

Manage Windows Live Web Authentication Websites

Saturday, September 27, 2008

Experience the Nintendo Wii

I definitely encourage everyone to checkout the following link to a really cool Adobe Flash-based Nintendo Wii advertisement. The concept and implementation are first class.

Experience the Nintendo Wii

Windows Live Messenger

To remove advertisements from Windows Live Messenger without installing a patch or crack:

  1. Run "Notepad.exe"
    Note: In Windows Vista, run "Notepad.exe" as an Administrator by right-clicking on the shortcut and selecting "Run as administrator"

  2. Open the host file
    "C:\Windows\System32\drivers\Etc\host"

  3. Add the following lines to the bottom of the file:
    127.0.0.1    rad.msn.com
    127.0.0.1    rad.live.com

  4. Save the file and restart Windows Live Messenger
    (if it was already running)

To restore advertisements in Windows Live Messenger:

  1. Run "Notepad.exe"
    Note: In Windows Vista, run "Notepad.exe" as an Administrator by right-clicking on the shortcut and selecting "Run as administrator"

  2. Open the host file
    "C:\Windows\System32\drivers\Etc\host"

  3. Remove the following lines from the file:
    127.0.0.1    rad.msn.com
    127.0.0.1    rad.live.com

  4. Save the file and restart Windows Live Messenger
    (if it was already running)

Windows Live Alerts

Microsoft recently released a new version of Windows Live Alerts, which provides several exciting new features:

Windows Live Alerts enables customers to instantly connect to the information that they care most about via Windows Live Messenger, Mobile, and Hotmail.

When you update your blog or other RSS feed, Windows Live Alerts will automatically send a headline to all subscribed readers. The power of Windows Live Alerts is that users can choose where and when to receive alerts.

Learn about the new RSS feature of Windows Live Alerts.

Subscribe to Windows Live Alerts for this website by clicking on the following button (you can unsubscribe at any time by visiting alerts.live.com):

Friday, August 22, 2008

Fuel Tracking Websites

Recently I stumbled across several websites that let users track gas mileage and compare it with other people driving similar vehicles. The site that looks the most promising is Fuelly.

Fuelly is a site that lets you track, share, and compare your gas mileage.

Saturday, August 09, 2008

Sky High Wi-Fi

According to a News.com article, "Delta Air Lines passengers will get Wi-Fi access on all domestic flights by the middle of next year, the company said Tuesday."

The optional service will cost $9.95 for flights less than three hours and $12.95 for flights over three hours, which is great for business travelers who are currently limited to working on offline documents.

According to the article, other airlines are also testing similar services.

Tuesday, July 01, 2008

WPF TransitionContainer Control

The following video demonstrates the Microsoft WPF TransitionContainer control, which provides animated transitions between ViewStates:

The TransitionContainer control was written by Pavan Podila.