Monday, December 20, 2010

About Browser Cache in IE

Recently i have observed that IE is making duplicate connections to get the same js file if it included twice. After making some experiments, I came to know that there is difference between Ctrl+F5 (Hard Refresh) and F5 (Refresh)

Ctrl+F5 (is intended to abandon all cached content and just retrieve all content from the servers again.)
In this case browser will overwrite the cache and it will not add the "If-modified-since" header to the request because of which it will get the file from the server everytime.

F5:
In this case browser by default adds the "If-modified-since" header to the request which will make the browser to get it from the cache.

So while taking Performance Readings in case of IE, we should be doing somethign like this:
1. Clear the cache.
2. Just F5(refresh) to get the actual response and normal browser behavior.

WebMarker


Recently i have been working on a bookmarklet which i have named it as Webmarker.

It will just work like a canvas on you webpage. You can draw anything on your webpage by using this tool. It still in its infancy stage.

It uses new HTML5 api. This bookmarklet might work with browsers that supports HTML5. You can download the pdf in which it shows sample work done by using this tool.

You can see the rose flower that i have drawn on a webpage using Webmarker.

Finding Max and Min values in an Array

To Find the min and max of an array, there is a simple technique by making use of javascript apply method which takes this object and an array of arguments.

To find the Max of an array
Math.max.apply(Math, [1,2,3,4,5,6,7,8]);

To find the min of an array
Math.min.apply(Math, [1,2,3,4,5,6,7,8]);

Thursday, July 9, 2009

Invisible users in Gtalk...

With the invisible feature for GTalk (in GMail), its easy to go invisible. Is there a way to findout whether a particular user is online or just invisible to others???

Recently I observed a small thing in GTalk that can easily tell you whether he is actually invisible or offline. Just ping the user that you want to know about his status, if the response doesn't contain anything in red and the response is something similar to the image below then the user is in invisible mode.



If the response is something similar to that of the image shown below(if you get the response in red color) then he is actually Offline.



The messages that you get in turn as response in the above two cases are different, which helps us to know the status of the user. This seems to be a very simple trick to check ... :) I have been using this successfully for a while to check my friends status.

Friday, June 12, 2009

Just for fun...

Wanna chat with my AI BOT ..
here u go..
Talk to Spider Man.

Saturday, January 3, 2009

Modifying the Boot loader in Ubuntu !!

Recently I updated Ubuntu from 8.04 to 8.10. This has created one more entry in the Boot loader. I want to delete the unnecessary boot loader entries.

In Windows XP, we have a Boot.ini file where we can directly delete the entries using any Text Editor. But , Windows Vista doesn't have this Boot.ini option. Instead there is a BCDEdit.exe. I was not comfortable editing the Boot Loader file using this Vista tool. So I was looking for alternative solution.

The solution I found was pretty simple using Ubuntu GRUB. GRUB is a Master Boot Record. For example, if you have both Windows and Linux installed on a computer, GRUB would load before either of these and let you choose which one to boot.
Now as I found the exact solution to this problem, I navigated to /boot/grub/menu.lst file, which contains all the Boot Load entries like this ..

title Ubuntu 8.10, kernel 2.6.27-9-generic
root (hd0,5)
kernel /boot/vmlinuz-2.6.27-9-generic root=UUID=dff991c4-a91a-4fe9-a6a7-a0608361eefd ro quiet splash
initrd /boot/initrd.img-2.6.27-9-generic
quiet

title Ubuntu 8.10, kernel 2.6.24-19-generic
root (hd0,5)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=dff991c4-a91a-4fe9-a6a7-a0608361eefd ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

title Ubuntu 8.10, kernel 2.6.24-16-generic
root (hd0,5)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=dff991c4-a91a-4fe9-a6a7-a0608361eefd ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic
quiet

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Windows Vista/Longhorn (loader)
root (hd0,0)
savedefault
makeactive
chainloader +1

Now we have to delete the entries we dont want. I've deleted the unnecessary entries.. Ubuntu 8.10, kernel 2.6.24-16-generic and Ubuntu 8.10, kernel 2.6.24-19-generic sections.

Now I do have only the Boot entries which I want !!!!

Saturday, November 29, 2008

JPS : Differentiate between multiple java processes

The general problem which everybody faces while using multiple JVM process is that when u want to kill a particular process, u need to find out exactly by killing which process kills the program u want.
Suppose when u r running a server and an Java IDE and lets say the IDE is hanged and u want to kill it. But if we see the Task Manager there will be multiple java.exe's. We need to find out which process kills the program u want to terminate.
In that case, we have a handy tool named JPS. JPS is Java Virtual Machine Process Status Tool, which comes by default with the Java Installation.
First of all we need to find out the Process Identifier(PID) of the corresponding programs. Lets say if we run a server and IDE . We want to terminate the IDE.
** Type jps in the command prompt which will list all the Java processes running on the machine with the corresponding PIDs.
**Now we got the PID of the process which we want to kill. Lets say PID of server is 5080 and IDE is 3936.
**Now the next question is how to map this PID with the java process that is shown in the Task Manager.
**Open the Task Manager, Go to View>Select Columns> check PID.
Now the Task Manager will list all the PID's along with the process.
**Now kill the corresponding java.exe process with the correct PID given by JPS. i.e. Kill 3936, which kills the IDE process without interupting any other java processes.

So, now we can be pretty sure which process we r going to terminate !!!!