Ehsanul Haque

Welcome to my personal site & blog

Archive for the 'Resources' Category

18 January
0Comments

Tricks for MS Excel: Add a frozen header row and set alternate background colors for rows

Here are couple of tricks for MS Excel users.

First we take a look at how to add a “Frozen” header row. Frozen header row is the one you could have for a very long worksheet. This row will be frozen (to act as the column header) and rest of the rows will scroll. Here’s how to do this.

1. Select the row below the one you want to be the header (or be frozen)

2. From Window menu select Freeze Panes (for MS Excel 2007 click on the View tab and inside Window panel click on Freeze Panes and pick the first option which is also Freeze Panes)

The frozen row will have a border at the bottom. Simple but an essential option for MS Excel users.

Second trick is the alternate background color for rows in the MS Excel worksheet.

1. Select the rows

2. From the Format menu go to Conditional Formatting (or in MS Excel 2007 under Home tab click on Conditional Formatting from Styles panel and click on New Rule)

3. When the window appears select Formula Is… (or on MS Excel 2007 select the last option Use a Formula to Determine Which Cells to Format)

4. Add this formula: =mod(row(),2)=1

5. Then click on Format button and go to Fill tab

6. Pick the color that will be used as the alternate color

7. Hit OK and go back to the worksheet

You will see the worksheet has alternate background colors.

12 January
0Comments

Grab Yahoo class is in “coma”

Grab Yahoo class was one of my works that has been used by many people around the world. Since I released this class I did  not have a single month without comments or questions or suggestion about this class. Some people have copied the class, released it under their name (simply taking out my comments and added their own) to increase traffic to their site probably. But more importantly this class was appreciated by many. This was one of my finest contribution to the open source world.

How did I come up with this idea?

Well, I cannot remember which user group but in one of the groups I participate in had a discussion over if PHP can pull data off from places like Yahoo and use it for some purpose. Users on the group said this can be done (easily) with Java, but cannot be done with PHP. So I started researching over it. I found the cURL extension for PHP which seemed the good candidate to do the job. So I started working on it. After days of coding I finally wrote a script that will allow someone to login to their Yahoo account and fetch data from their address book. Initially I simply had a script but then I converted it to a Class allowing people to grab their address book, messenger list, number of new emails and calendar data.

What is happening now?

As per the title of this post this class is in “coma”. The reason is the update to Yahoo address book export mechanism. They have placed a CAPTCHA validation page in the export feature and, therefore, my Grab Yahoo class cannot go any further to grab the content it needs. Same thing happened with the LinkMeIn class which stopped working after LinkedIn added the CAPTCHA validation.

Why is this class in “coma”?

I have looked at the Yahoo address book export feature and found the CAPTCHA validation which will not allow the class to work. But I’ve not done my complete research on it yet, to make sure there is no other way to make this class functional. So, for the time being, this class is in “coma”. If I fail to revive this class I will probably officially pronounce it “dead”.

Can you help?

Yes, of course, you can. I hardly have time, these days, to sit with these side projects. If anyone from the community has time to research and help me revive this class it will be appreciated. Your name will go into the credit section of the class, well that is all I can offer!

11 December
0Comments

Take a Screenshot with iPhone 3GS

We are all used to taking screen shots for various purposes on a PC or Mac. In case if you’ve something on your screen you want to share with someone quickly, this is a handy feature. There are many other reasons why we would like to take a screen shot, to create a documentation or user manual for example.

As I am getting used to different features of my newly bought iPhone I discovered it also has the option to take screen shot. The process is very simple. Press the Sleep/Wake button (on top) with the Home button (at the bottom) together and your screen shot will be saved in the Camera Roll section of Photos application.

sspecs_controls_20090608

Source: Apple.com

I believe iPhone 3GS has lot more features and I will keep posting them as I explore.

30 November
0Comments

Import contacts from Blackberry to iPhone 3GS

If you are switching from Blackberry to iPhone 3GS, you must be trying to import all your Blackberry contacts to iPhone 3GS. When I switched to other phones before I always copied all my contacts to SIM and import them to the new phone. Most of the time the format would be different for the phones so you will end up editing the contacts. But with Blackberry to iPhone 3GS the process was really simple and clean.

I downloaded Blackberry Desktop Manager on my Mac Book Pro. After installing the BDM I had to reboot my Mac. After Mac restarted I plugged in my Blackberry on USB and started BDM (Blackberry Desktop Manager). Synced the contact with my Mac Address Book. After it was done I plugged in my iPhone 3GS with Mac and synced it using iTunes.

In few minutes and with few easy steps I’ve all my contacts on iPhone 3GS from Blackberry. I didn’t try to do it on my PC but I believe the process will be close to Mac, if not similar.

Enjoy!

12 November
0Comments

Cannot start Microsoft Office Outlook. Cannot open the Outlook window.

Are you getting the error “Cannot start Microsoft Office Outlook. Cannot open the Outlook window.” when you try to open the MS Office Outlook? If you are then the quick and easy fix it to run the following command from Start > Run:

Outlook.exe /resetnavpane

This command should fix the problem with your MS Office Outlook. It worked for me on Windows XP SP2.

28 October
0Comments

New Login System for Facebook: Scam Email

Be carefull of the scam email going around asking people to update their Facebook profile to use the new login system Facebook has implemented. If you look closely the link provided in the email to update your Facebook account the link is not going to take you to Facebook. It is actually going to some site with domain name www.facebook.com.XXXXXX.XXX (where XXXXXX.XXX is some domain name). Here’s a screen shot of the email.

Picture 1

16 September
3Comments

Wordpress Plugin: Recently Updated Pages

Today I’ve released a Wordpress plugin called “Recently Updated Pages” which is a Wordpress Widget that displays your recently updated page list on the sidebar.

I was looking for a similar plugin but after searching for a while I wanted to write my own plugin. I followed some instructions on couple of websites and created this plugin. It uses WP_Widget class from Wordpress core and extends it to build the widget. You can download it form Wordpress Plugin page at http://wordpress.org/extend/plugins/recently-updated-pages/

In case if you want to make a small donation you could do so at http://resource.bdwebwork.com/WordpressPlugins/RecentlyUpdatedPages/

Thanks

UPDATE AS OF SEPTEMBER 17, 2009:

I’ve updated the plugin and committed the latest version (1.0.1) to Wordpress plugin directory. The updated version will allow users to include list of blog Posts in the Recently Updated list. Originally the plugin only displayed list of updated Pages and now with this optional choice you can toggle between the option.

22 June
0Comments

How to delete a locked file in Windows?

Sometimes when you try to delete a file on Windows it says file cannot be delete as it is used by another program; you must close the program to delete the file. Well, almost all the time you actually know which program to close in order to delete the file (also rename the file). But today when I tried to delete a file (which was not open in any program nor did I use this file for over three months) Windows was showing the message. You cannot really say which program or process is using it. So I downloaded Process Explorer from Microsoft’s site which you can use to see which process or program is using the file you are trying to delete.

After you run the Process Explorer go to “Find” menu and click on “Find Handle or DLL …” (Ctrl+F). Type in the file name (full or partial) you are having trouble deleting or renaming and hit Search. Process Explorer will list all the processes or programs using this file. When I searched for the file I was having problem with it showed that the “Explorer” is using it! So what can I do in that case?

From “Task Manager” if I kill the “Explorer” process I cannot browse to the folder so using “Task Manager” I ran “Command Prompt” and from command line I changed directory to the desired location. Typed the command to delete the file “del filename.ext”. I was able to delete the file and then using “Task Manager” I started “Explorer” again. It was easy but “Process Manager” made it easy to find the process. So many hidden stuff that we have on Windows!

05 March
1Comment

Turn off the feature of Google Toolbar to display web history on new tabs of Firefox 3 for Mac

The other day when I was browsing on my Mac (using Firefox 3) I noticed everytime I open a new tab it shows the recent websites I’ve visited and few more items under Google Toolbar title. At the begining I liked the idea. I thought it saves me time to type in URL of the sites I frequently visit. But this feature was not available on my PC.

Although I initially liked the feature, it started to bug me when I opened new tab in front of someone (visiting me – for example) and it was showing the cached page of my online banking. It actually cached the account detail page! I didn’t like the idea that if someone is looking over my shoulder will get to see my account balance.

Anyway I started digging into it to turn off that feature. Then I found it was something that needed to be turned off from Google Toolbar’s settings. So to turn it off go to Tools > Add-ons. It should take you to the Extensions tab. Click on the Google Toolbar for Firefox extension and then click on Preferences button. Preference window will start with Search tab and under “Web-browsing tools” section uncheck the option “Enable the Google new tab page”. You should now get back your homepage, whatever it is set to.

31 December
2Comments

Inanis Glass theme for Wordpress: Set the clock to 24hr format

I have installed Inanis Glass theme (v. 1.2) for my Wordpress blog and it is really an amazing theme. It was very easy to install (unlike other themes where something is always missing or not fitting). I made small changes here and there to make it work the way I want. For example, it showed a message on the pages or articles where I turned off the comments that the comments are off etc. I modified it to remove that. Made few more CSS changes.

When I visited the author’s website I found few requests to show the clock in 24hrs format. When I looked at the javascript (functions.js) for the theme I found that the “clock” function is compressed by http://javascriptcompressor.com/. When I visited that site to see if they have any decompressor then I found a contribution on their forum which unpacks/decompresses the javascript – read about it on their forum http://javascriptcompressor.com/forums/p/9/42.aspx – and decompressed the “clock” function.

Decompressed/unpacked function looks like:

function init() {
   timeDisplay=document.createTextNode("");
   document.getElementById("clockhr").appendChild(timeDisplay);
   timeDisplay1=document.createTextNode("");
   document.getElementById("clockmin").appendChild(timeDisplay1);
   timeDisplay2=document.createTextNode("");
   document.getElementById("clockpart").appendChild(timeDisplay2)
}
function updateClock() {
   var currentTime=new Date();
   var currentHours=currentTime.getHours();
   var currentMinutes=currentTime.getMinutes();
   currentMinutes=(currentMinutes<10?"0":"")+currentMinutes;
   var timeOfDay=(currentHours<12)?"AM":"PM";
   currentHours=(currentHours>12)?currentHours-12:currentHours;
   currentHours=(currentHours===0)?12:currentHours;
   document.getElementById("clockhr").firstChild.nodeValue=currentHours;
   document.getElementById("clockmin").firstChild.nodeValue=currentMinutes;
   document.getElementById("clockpart").firstChild.nodeValue=timeOfDay
}

Basically the Javascript function used to find the current time – getHours() – returns the hour in 24hrs format. But to display the clock in 12hrs format the author has done some math. So if anyone wants to display 24hrs format clock comment out line number 14, 15, 16 and 19. To replace the function you can use the site above to re-compress the function or comment the existing function in functions.js file (clock function) and paste this decompressed version in the file.

Note: As I understand javascriptcompressor.com is used to pack/compress your javascript, not to encrypt it or hide it by any means. It is compressed so that it is either unreadable or smaller in size.