Showing posts with label javascript. Show all posts
Showing posts with label javascript. Show all posts

Thursday, October 09, 2008

Exciting new videos

In the last few weeks, a lot of new videos have been posted to Channel9, Microsofts portal for spreading the word about new software...

A lot of the posts are from the JAOO conference, which was held here in Denmark not too long ago. And just like last year, I've seen almost all the videos, and found the pretty cool. It seems like a lot of the videos are about programming languages and/or parallelism, and the evolution in those fields - very intriguing!

Maybe JAOO is a conference I should attend next year.

Anyway, check it out at http://channel9.msdn.com

Friday, November 10, 2006

I fucking hate caps lock

I hate it when it happens: You're typing your user name and password, but it doesn't work. Then you do it again, and it doesn't work.. Then you do it AGAIN, and it doesn't work. Then you look at the little Logitech stand for your wireless desktop and realize caps lock is on !!!!

I have partly stolen, and partly adjusted and perfected this little JavaScript code snippet to check if caps lock is on, and displays a message if it is:


var capsLockOnMessageDisplayed = false;

function checkCapsLock( e )
{
var keyCode = 0;
var shiftKeyOn = false;

if ( document.all )
{
keyCode = e.keyCode;
shiftKeyOn = e.shiftKey;
}
else if ( document.layers )
{
keyCode=e.which;
shiftKeyOn = ( keyCode == 16 ) ? true : false;
}
else if ( document.getElementById )
{
keyCode = e.which;
shiftKeyOn = ( keyCode == 16 ) ? true : false;
}
if ( ( keyCode >= 65 && keyCode <= 90 ) && !shiftKeyOn ) { displayMessage(); } else if ( ( keyCode >= 97 && keyCode <= 122 ) & shiftKeyOn ) { displayMessage(); } } function displayMessage() { if( !capsLockOnMessageDisplayed ) { alert( 'Caps Lock is On.\n\nTo prevent entering your password incorrectly,\nyou should press Caps Lock to turn it off.' ); capsLockOnMessageDisplayed = true; } }


Ps. check this out: CAPSoff