Friday, March 20, 2009

Open full screen window using Javascript

Here's a very interesting sample code that I found. I have been looking for the solution of this issue since long time...
 <HTML>  
      <HEAD>  
           <SCRIPT LANGUAGE="JavaScript">  
           function openFull(theUrl) {  
                h = screen.height;  
                w = screen.width;  
                window.open(  
                     theUrl,'','left=0,top=0,screenX=0,screenY=0,  
                     height='+(h-100)+',width='+(w-10)+',  
                     directories=no,location=no,menubar=no,  
                     resizable=no,scrollbars=yes,status=no,  
                     titlebar=yes,toolbar=no'  
                );  
           }  
           </SCRIPT>  
      </HEAD>  
 <BODY>  
      <a href="javascript:void(0);" onClick="openFull('full-screen.html');">Open Full Screen Window</a>  
 </HTML>  

Sunday, March 15, 2009

More swap with a swap file ...

There are situations when either you have a pre-installed Linux system or a new one, but forgot to set enough swap space for your needs or you recently have upgraded your hardware (like I have recently added an additional RAM on my machine :) ).

Now, to make the most of the hardware that you've got, you might consider to increase the swap space. What do you do now? Do you need to repartition and reinstall the system? Answer is NO! Linux offers you with fascinating swap utilities to make a real file and use it as swap space. The trick is to make a file and then tell the swapon program to use it.

Here's how to create, for example, a 64 megs swap file on your root partition (of course make sure you have at least 64 megs free):
dd if=/dev/zero of=/swapfile bs=1024 count=65536


This will make a 64 megs (about 67 millions bytes) file on your hard drive. You now need to initialize it:
mkswap /swapfile 65536

sync

And you can then add it to your swap pool:
swapon /swapfile


With that you have 64 megs of swap added. Don't forget to add the swapon command to your startup files so the command will be repeated at each reboot.

Tuesday, March 3, 2009

Adding emmuerated values to the spreadsheet column.

Most of the client interactions makes use of various spreadsheets. One of the common strategy for validating some spreadsheet column is to provide a list of allowed enumerated values to it.

For long time I wasn't aware of this myself. Thus once I came to know about it I felt like sharing how to achieve that.

Following are the steps for adding validation to a spreadsheet column:

1. For Open Office (OpenOffice SpreadSheet):

  1. Select the spreadsheet cells for validating
  2. Click the menu: Data -> Validity. A popup dialog would appear.
  3. Select "List" option from the "Allow" drop-down.
  4. Add the comma-separated or tab-separated or newline-separated enumerated entries in the "Entry" text area.
  5. Click "Ok"
2. For MS Office (MS Excel):
  1. Select the spreadsheet cells for validating
  2. Click the menu: Data -> Validation. A popup dialog would appear.
  3. Select "List" option from the "Allow" drop-down.
  4. Add the comma-separated enumerated entries in the "Source" textbox.
  5. Click "Ok"

Sunday, March 1, 2009

Creating transparent images using GIMP (GNU Image Manipulation Program) ...

INTRODUCTION:
GNU Image Manipulation Program (GIMP) is a very powerful image manipulation software available for Linux operating systems. While working on one of client project which is a Rich UI application, we felt the necessity of inventing customized icons of our own at lot of places. The key challenge was to find a tool for helping our cause. After scanning through a stack of softwares available free / commercial; we found GIMP to be the most interesting of them all.
Two of the prime requirements for creating icons are to have a control over exact icon size and the graphic transparency. Following are the steps for creating transparent images using GIMP:


STEPS:
1. Open GIMP application
2. Click File -> Open
3. Select and load the image from the disk.
4. Zoom into the image for better accuracy while making it transparent.
5. Click Layer -> Transparency -> Add Alpha Channel
6. Make sure to select the Fuzzy selection tool from the main window toolbar for GIMP
7. Selectively click the section that you want to make transparent
8. When you are sure that this section is highlighted properly, then click Edit -> Clear or simply hit 'delete' from keyboard.
9. Repeat steps 7 and 8 until all the sections are made transparent.
10. Finally save the image File -> Save.


Hope these steps will be very helpful to everyone, especially if the application demands heavy use of images and icons.