Author Archives: Adeel

Shortcut for shutting down Windows 7

I had been using Microsoft XP since 2004 and being a power user relied heavily on its keyboard shortcuts. I had pre-ordered a copy of Windows 7 and installed it last night. What I’m shocked to realise is they have broken one the most used keyboard shortcuts, i.e. the one to shut down Windows.

In Windows XP, it was as simple as pressing the Windows key and ‘U’. Now that no longer works and I have to use my mouse to turn off my PC. Not a problem for most of the users but for people used to shortcuts its a big nuisance.

I went through the booklet provided to find out if they had put a replacement in it but of no vain. I switched to plan B, tinkering around till I find a shortcut.

To shutdown Windows 7 the shortcut is: Windows key > Left Arrow key > Enter

To open the Shutdown options’ menu, you need to press the Left Arrow key again followed by the shortcut key for the required action.

Shutting down the PC, although different, takes same number of key presses but sleeping (Standby mode in Windows XP), Switch User and log off are two more extra keys.

Is this better than Windows XP? I’ll leave that for you to decide.

Flattr this!

Google does not use the description meta tag in web ranking

Yesterday Google confirmed that they do not use keyword meta tag in web ranking. To be fair, most of the SEO experts had worked that out (for years?). I believe Google did this because of a recent legal battle regarding copying of keywords.

But the most interesting part of the post, for me at least, was:

Even though we sometimes use the description meta tag for the snippets we show, we still don’t use the description meta tag in our ranking.

I always thought that way too. Description meta tag is a description of a page and although Google does highlight certain words, it doesn’t really rank results on the basis of it.

And the big question, is it a good thing? Hell yes! You don’t want people to spam description meta tags with:

keyword1, keyword2. Looking for keyword1, keyword2. Then you can find keyword1, keyword2 here where we offer keyword1, keyword2 at amazing cheap keyword1, keyword2 prices. […]more jibbrish[…]

I just hope people pick this up and start writing good user-friendly (or at the very least grammatically correct) descriptions.

UPDATE:
Matt Cutts has explained it more clearly in a comment on his blog:

[…] meta descriptions don’t count in scoring (that is, determining the scores which are then used to determine what order to show the results in). So changing your meta description tag won’t make your website rank higher. When we show snippets, we can sometimes use the meta description as the snippet that we show. […]

Flattr this!

Resize images using jQuery

UPDATE: I have created a plugin that dynamically resizes the images using jQuery. It basically does the same job but is really easy to use and is optimized better (minified).

Recently I needed a script to resize images on the page. I did not want to lose the actual resolution but just wanted to create thumbnails on the go.

I spent some time searching but could not find anything suitable. The options I found were just too much while I needed something simple. At the end, I ended up writing some own code (I’m a coder after all :P).

The script resizes the images without distorting the proportions. First of all, a variable is declared called max_size that is set to the maximum height or width that the picture needs to be resized to. Then using jQuery we match all img elements and using the each function, we go through each one of them resizing them as necessary. The if statement checks which side of the image needs to be kept to the maximum and the other one is calculated proportionally.

In the final line, the new height and width values are assigned using CSS. Neat eh 😉

Flattr this!

AddThis, Internet Explorer and JavaScript

While working with Internet Explorer 7, I got this error:

Object doesn't support this property or method
Line: 2
Char: 13907
URI: addthis.com/js/250/addthis_widget.js

The thing that hurt more was, Chrome and Firefox were behaving properly. I spent some time searching the error but found nothing interesting. I gave up on that front and decided to have a peek in the AddThis JavaScript.

A bit more look around, I found something very interesting. IE7 has some scoping issue and it was picking up ‘my’ variable instead of AddThis counterpart (in my case it was variable called “c” that I had declared in my own JavaScript that was causing the problem).

Change the variable in your own JavaScript code to anything else and we all can live happily ever after.

Flattr this!

How to enable Registry Editor Tool

I had a problem yesterday where I got a virus in my Desktop PC (running Windows XP). It disabled the Registry Editor Tool (regedit.exe) to stop the user (that’s me) from going and manually editing/deleting registry entry.

This useful command helped me enable Registry Editor. Just click on Start -> Run and then type the following in (all as one line):

REG add HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System /v DisableRegistryTools /t REG_DWORD /d 0 /f

Hope this is useful to someone too 😉

Flattr this!