Showing posts with label programmer's arena. Show all posts
Showing posts with label programmer's arena. Show all posts

How to set up a simple LRU cache using LinkedHashMap

Posted by Shashank Krishna Thursday, May 28, 2009

Caches

Caches are a simple way to improve the performance of an application that reads data from a "slow" source such as files on disk or rows of data from a database table, but may need to re-read the same data multiple times. The idea is simple: instead of discarding the data after using it, keep it in memory so that it doesn't have to be re-read later.

For example, a simple way to organize this for files might be to create a HashMap that maps the file names to objects containing the file data. When your application needs a particular file it first checks the map to see if it already has the data; if it doesn't, it reads the file and places it in the map in case it needs it again later.

LRU caches

The problem with this simple method is that your application could use a vast amount of memory. Once read in, a file is in the cache for the lifetime of the application whether or not it is ever used again. For an application such as a server that is intended to stay up and running for weeks or months at a time, this is probably not acceptable.

What's needed is a cache that automatically discards entries that haven't been accessed for some time so as to limit the amount of space being used. Such as cache is called an LRU Cache. LRU stands for "Least Recently Used", which refers to the policy of removing the oldest, or least-recently used entries to make space for new data.

LRU caches have a maximum number of data items that they will hold and these items are usually arranged in a list. When an item is added to the cache, and every time it is accessed after that, it is automatically moved to the head of the list. If the cache is full and a slot is required for a new item, the cache makes room by discarding the entry at the tail of the list - the least-recently used item.

The java.util.LinkedHashMap class

LinkedHashMap is a subclass of java.util.HashMap that adds a couple of useful features. One is that by default the iteration order reflects the order that entries are added to the map, rather than the rather haphazard order of a HashMap.

The other feature - the one we're interested in here - is that LinkedHashMap has an option to use access-order instead of insertion order, and includes a way to remove the least-recently accessed entries automatically. This makes it well suited for creating LRU caches.

Creating a cache class

The simplest way to create a cache using LinkedHashMap is to extend it. Here is an example:


public class Cache extends LinkedHashMap
{
private final int capacity;

public Cache(int capacity)
{
super(capacity + 1, 1.1f, true);
this.capacity = capacity;
}

protected boolean removeEldestEntry(Entry eldest)
{
return size() > capacity;
}
}



Note that the constructor takes as an argument the maximum number of entries we want a Cache object to hold. The superclass constructor has three arguments: the initial capacity of the map, the load factor, and a boolean argument that tells the LinkedHashMap constructor to keep entries in access order instead of the default insertion order. (See the java.util.HashMap API documentation for a description of the initial capacity and load factor.) In this case we set the initial capacity to be one more than our required cache size - this is because new entries are added before any are removed, so for example if we want to hold 100 entries the cache will actually contain 101 for an instant when new data is added. Setting the load factor to 1.1 ensures that the rehashing mechanism of the underlying HashMap class isn't triggered - this isn't a vital point but helps a little with efficiency at run-time.

The removeEldestEntry() method overrides a default implementation in LinkedHashMap and is where we determine the policy for removing the oldest entry. In this case, we return true when the cache has more entries than our defined capacity.

Using the cache

Using the cache is simple - just use a suitable key to access the cache; if the data is in the cache we can read it from there. If it's not there we pull it from the slow medium and add it to the cache so that it's in place if needed later:


Cache cache = new Cache(100);
// ...

String filename = "file.txt";
String filedata = (String) cache
.get(filename);
if (filedata == null)
{
// Read filedata from file system here...
cache.put(filename, filedata);
}

How does it perform?

Our basic implementation should work just fine but we may need to know how effective it is in a given application. One measure of how well a cache is performing is Hit Rate, which tells us how many cache accesses are "hits" - that is, how many times the required data was found in the cache for a given number of accesses. Hit rate is usually expressed as a percentage - a hit rate above 80% is usually pretty good.

We can add a few things to our Cache class to make it possible to monitor performance so that we can tune the cache by setting an optimum size. We need a counter for the number of accesses and another for the number of hits. We will need getter methods to allow us to retrieve those values after the cache has been running for a time, and finally we must override the get() method to update the counts. Here is our Cache class complete with these new members:

public class Cache extends LinkedHashMap
{
private final int capacity;
private long accessCount = 0;
private long hitCount = 0;

public Cache(int capacity)
{
super(capacity + 1, 1.1f, true);
this.capacity = capacity;
}

public Object get(Object key)
{
accessCount++;
if (containsKey(key))
{
hitCount++;
}
Object value = super.get(key);
return value;
}

protected boolean removeEldestEntry(Entry eldest)
{
return size() > capacity;
}

public long getAccessCount()
{
return accessCount;
}

public long getHitCount()
{
return hitCount;
}
}


One point to note is that calls to the containsKey() method don't update the access counts; we may want to override that method also, so that the hit rate isn't skewed by code such as this:

 
if (cache.containsKey(filename))
{
filedata = (String) cache
.get(filename);
}
else
{
// Read filedata from file system here...
cache.put(filename, filedata);
}

Which is better JSP or PHP?

Posted by Shashank Krishna Sunday, April 19, 2009

Which is better, JSP or PHP? that's a religious questions, depends on whether you believe in god or not? but who is god anyway?

The question itself isn't a very good one. It should be which is better J2EE or PHP because it's not really possible to look at JSP in isolation. There is no doubt that PHP is the better langauge for building web apps. PHP is the shortest path between the problem and the solution. J2EE will take you through a more scenic path. It might possibly be argued that the road built with J2EE technology will be more durable and can carry vehicles with bigger loads, but that is another religious question.

If you are a java programmer you will say PHP code looks really messy when you embed it into HTML and PHP programmers will come back and say JSP looks a lot worse, which is true. The retort generally given is that you can make use of varius tag libs such as struts or jstl to make the code neater. Some people will also make vague references to the MVC pattern.

If these advocates of tag libraries look at the servlet source code generated from their JSP they will surely bring up their dinner. Hand coded JSP when made into a servlet might make you lose your appetite but your dinner will hopefully stay in.

Not so with PHP, once you have written a few hundred thousand lines of code with PHP you can make scripts that look distinctily sexy.

Courtesy:-http://www.raditha.com/

Using the Registry Editor (windows)

Posted by Shashank Krishna Monday, January 5, 2009


Using the Registry Editor (regedit.exe)

I don't expect the average home PC owner to be involved in manual Registry editing but there is no reason why advanced PC users should shy away from editing the Registry directly, provided that they follow the iron-clad rule of always backing up first. It is also advisable to restrict direct Registry editing to small changes. If more extensive changes are involved, a script or an editing interface like TweakUI or the Group Policy Editor is a preferable method for making edits. Many useful Registry edits consist of changing one or two values and are easily reversed.

Accessing the Registry Editor (Regedit)

The Registry Editor (also called regedit) is not listed in the Start menu or in All Programs. The utility is a single file regedit.exe and is located in the Windows folder on XP systems. It is accessed by using the Run line. Enter "regedit" and the utility will open. In Vista the utility is opened by entering "regedit.exe" in the Start Search line The Run line can also be used in Vista (but is no longer necessarily on the Start menu). As to be expected, an administrator account is required.

Regedit is a two-pane interface with keys in the left pane (key pane) and value names with the corresponding data in the right pane (value pane). The setup is not unlike Windows Explorer with keys analogous to folders and values analogous to files. (The basics of Registry structure are discussed on another page.) An example is shown in the figure below.

Figure 1, Registry Editor (Regedit)
Registry Editor

Also listed in the right or value pane is the type of data contained in a value. There are a number of formats that data can take and the usual ones that most PC users will encounter are given in Table I. I have omitted the more esoteric types. The three listed in the table constitute the vast majority of all Registry entries. Other data types are described at this Microsoft link.

Table I. Common Registry data types
Data type Description
REG_BINARY Binary data . Usually in hexadecimal notation. An example is 0xA8
REG_DWORD Double word (32 bits). Can be edited in either hexadecimal or decimal
REG_SZ A string. Figure 1 shows examples in the right pane.

Menus in Registry Editor

Regedit has some of the same menus that are so familiar throughout Windows. These can be seen near the top of Figure 1. Shown below are what two commonly used menus look like.

Figure 2. File menu Figure 3. Edit menu
Registry File Menu Registry Edit Menu

The File menu has the functions "Import" and "Export" that involve backup and restore. These are discussed on another page.

As you would expect, the "Edit" menu is where commands are located for making changes to the Registry. Keys and values can be deleted, added, or renamed. (Permission settings on keys can also be edited but that is an advanced subject beyond our scope.) Another two very useful functions are "Find..." and "Find Next". The Registry has thousands of keys and these search functions are very necessary. Unfortunately, the search function cannot find binary values or REG_DWORD entries. It searches key names, value names, and string data.

The bottom of he window for Regedit shows the path of the currently highlighted key as can be seen in Figure 1. The Edit menu also contains a useful entry "Copy Key Name" that sends the path of the key to the clipboard, Since path names can be quite long, this can be very useful.

Favorites menu in RegeditAnother menu that can be quite useful is "Favorites". If you find that there are is a certain key that you modify often, this key can be added to the "Favorites' list for easy access. The example of a "Favorites" menu shown on the right contains three favorites. Note the names have been chosen by this user and can be anything that is a convenient reminder. They actually refer to specific Registry keys, which can have very long path names.

Editing Registry Keys and Values

There are many useful adjustments to the Windows configuration or behavior that can be made by simple editing of the Registry. Unless you are a trained IT professional, you should probably limit Registry editing to one or two values at a time. I will limit this discussion to this type of straightforward scenario.

The first step in editing is always to back up the Registry. Also, back up the key you are working on. If you are a very careful worker, backing up just the key where editing is to be done may suffice but make a system restore point first anyway. To back up a key, open Regedit and highlight the key. Open the "file" menu and click "Export". For most cases. you will choose to export as a registration or REG file. This is a text file with extension .reg that is a copy of the highlighted Registry key. Save it to someplace safe. To restore a key with a REG file, right-click it and choose "Merge". On many machines the default left double-click on a REG file will also create a merge. I prefer to change the double-click action to "Edit" so that accidental mergers do not happen. Notice that I use the word "merge". Reg files do not replace keys but add to them, something to keep in mind. Anything extra that you may have added is not deleted. Some experienced PC users prefer to do any actual editing in the exported REG file and then to merge the edited file. This prevents accidentally doing something to the wrong key. Keep in mind that Regedit has no "undo" function. What's done is done.

If you are editing an entire key, you are very likely deleting it. (Careful! Back it up.) If you are making a number of changes, I suggest using a REG file and not editing in the Registry itself. I repeat, even power users should probably stick with editing one or two values. To delete a highlighted key, choose "Delete" from the "Edit" menu. Note that there is no recycle bin for deleted Registry keys or values. Deleted means gone to the great bit-bucket in the sky.

Dialog box for Edit StringFor the most part, direct Registry editing means changing a value. Highlight the value in question in the right-pane of Regedit. Then choose "Modify" from the "Edit" menu or right-click the value and choose "Modify" from the context menu. For strings, a box like the one shown on the right will open .As a specific example, consider the last value in the right-pane of Figure 1. The time that the system waits for a service to close at Shutdown is controlled by the entry for the value, WaitToKillServiceTimeout. The value is in milliseconds and the default is 20000 ( 20 seconds). To make things close up more quickly, you could change the value to 10000 (10 seconds). Or you might need to make it longer for certain systems. Enter the desired string in the line "Value data" and click OK.

Dialog box for DwordA great many Registry values are strings but another type of data that is common is the "dword". A slightly different box will appear if you are editing a REG_DWORD value. The figure on the left shows the appropriate box. Note that when entering a DWORD value, you need to specify the base for the number. Be careful to be sure that you have chosen correctly between hexadecimal and decimal. You can enter either but the number that you enter must correspond to the correct value for the chosen base. In the example here the decimal number "96" would have to be "60" if hexadecimal were picked for the base.



Share/Save/Bookmark
Subscribe

Learn Unix in 10 minutes

Posted by Shashank Krishna Friday, February 29, 2008

This is something that I had given out to students (CAD user training) in years past. The purpose was to have on one page the basics commands for getting started using the UNIX shell (so that they didn’t call me asking what to do the first time someone gave them a tape).
This document is copyrighted but freely redistributable under the terms of the GFDL . Send me comments, corrections, and extra stuff that you think should absolutely must be included. I’ll gladly listen.

Sections:

Directories:

Moving around the file system:

Listing directory contents:

Changing file permissions and attributes

Moving, renaming, and copying files:

Viewing and editing files:

Shells

Environment variables

Interactive History

Filename Completion

Bash is the way cool shell.

Redirection:

Pipes:

Command Substitution

Searching for strings in files: The grep command

Searching for files : The find command

Reading and writing tapes, backups, and archives: The tar command

File compression: compress, gzip, and bzip2

Looking for help: The man command

Basics of the vi editor

FAQs


Directories:

File and directory paths in UNIX use the forward slash “/” to separate directory names in a path.

examples:

/ “root” directory

/usr directory usr (sub-directory of / “root” directory)

/usr/STRIM100 STRIM100 is a subdirectory of /usr

Moving around the file system:

pwd Show the “present working directory”, or current directory.

cd Change current directory to your HOME directory.

cd /usr/STRIM100 Change current directory to /usr/STRIM100.

cd INIT Change current directory to INIT which is a sub-directory of the current directory.

cd .. Change current directory to the parent directory of the current directory.

cd $STRMWORK Change current directory to the directory defined by the environment

variable ‘STRMWORK’.

Listing directory contents:

ls list a directory

ls -l list a directory in long ( detailed ) format

for example:

$ ls -l

drwxr-xr-x 4 cliff user 1024 Jun 18 09:40 WAITRON_EARNINGS

-rw-r–r– 1 cliff user 767392 Jun 6 14:28 scanlib.tar.gz

^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^

| | | | | | | | | | |

| | | | | owner group size date time name

| | | | number of links to file or directory contents

| | | permissions for world

| | permissions for members of group

| permissions for owner of file: r = read, w = write, x = execute -=no permission

type of file: - = normal file, d=directory, l = symbolic link, and others…

ls -a List the current directory including hidden files. Hidden files start with “.”

ls -ld * List all the file and directory names in the current directory. Without the “d” option, ls would list the contents of any sub-directory of the current. With the “d” option, ls just lists them like regular files.

Changing file permissions and attributes

chmod 755 file Changes the permissions of file to be rwx for the owner, and rx for the group and the world. (7 = rwx = 111 binary. 5 = r-x = 101 binary)

chgrp user file Makes file belong to the group user.

chown cliff file Makes cliff the owner of file.

chown -R cliff dir Makes cliff the owner of dir and everything in its directory tree.

You must be the owner of the file/directory or be root before you can do any of these things.

Moving, renaming, and copying files:

cp file1 file2 copy a file

mv file1 renamed file1 move or rename a file

rm file1 [file2 …] remove or delete a file

rm -r dir1 [dir2…] recursivly remove a directory and its contents BE CAREFUL!

mkdir dir1 [dir2…] make a directory

rmdir dir1 [dir2…] remove an empty directory


Viewing and editing files:

cat filename Dump a file to the screen in ascii.

more filename Progressively dump a file to the screen: ENTER = one line down SPACEBAR = page down q=quit

less filename Like more, but you can use Page-Up too. Not on all systems.

vi filename Edit a file using the vi editor. All UNIX systems will have vi in some form.

emacs filename Edit a file using the emacs editor. Not all systems will have emacs.

head filename Show the first few lines of a file.

head -n filename Show the first n lines of a file.

tail filename Show the last few lines of a file.

tail -n filename Show the last n lines of a file.

Shells

The behavior of the command line interface will differ slightly depending on the shell program that is being used.

Depending on the shell used, some extra behaviors can be quite nifty.

You can find out what shell you are using by the command:

printenv SHELL

Of course you can create a file with a list of shell commands and execute it like a program to perform a task. This is called a shell script. This is in fact the primary purpose of most shells, not the interactive command line behavior.

Environment variables

You can teach your shell to remember things for later using environment variables.

For example under bash:

export CASROOT=/usr/local/CAS3.0 Defines the variable CASROOT with the value /usr/local/CAS3.0.

cd $CASROOT Changes your present working directory to the value of CASROOT

export LD_LIBRARY_PATH=$CASROOT/Linux/lib Defines the variable LD_LIBRARY_PATH with the value of CASROOT with /Linux/lib appended, or /usr/local/CAS3.0/Linux/lib

printenv CASROOT Will print out the value of CASROOT, or /usr/local/CAS3.0

echo $CASROOT Does exactly the same thing

env | grep CASROOT A roundabout way to get the same information.



Interactive History

A feature of bash and tcsh (and sometimes others) you can use the up-arrow keys to access your previous commands, edit them, and re-execute them.

Filename Completion

A feature of bash and tcsh (and possibly others) you can use the TAB key to complete a partially typed filename. For example if you have a file called constantine-monks-and-willy-wonka.txt in your directory and want to edit it you can type ‘vi const’, hit the TAB key, and the shell will fill in the rest of the name for you (provided the completion is unique).

Bash is the way cool shell.

Bash will even complete the name of commands and environment variables. And if there are multiple completions, if you hit TAB twice bash will show you all the completions. Bash is the default user shell for most Linux systems.

Redirection:

grep string filename > newfile Redirects the output of the above grep command to a file ‘newfile’.

grep string filename >> existfile Appends the output of the grep command to the end of ‘existfile’.

The redirection directives, > and >> can be used on the output of most commands to direct their output to a file.

Pipes:

The pipe symbol “|” is used to direct the output of one command to the input of another.

For example:

ls -l | more This commands takes the output of the long format directory list command “ls -l” and pipes it through the more command (also known as a filter). In this case a very long list of files can be viewed a page at a time.


Command Substitution

You can use the output of one command as an input to another command in another way called command substitution. Command substitution is invoked when by enclosing the substituted command in backwards single quotes. For example: cat `find . -name aaa.txt` which will cat ( dump to the screen ) all the files named aaa.txt that exist in the current directory or in any subdirectory tree.

Searching for strings in files: The grep command

grep string filename prints all the lines in a file that contain the string

Searching for files : The find command

find search_path -name filename

find . -name aaa.txt Finds all the files named aaa.txt in the current directory or any subdirectory tree.

find / -name vimrc Find all the files named ‘vimrc’ anywhere on the system.

find /usr/local/games -name “*xpilot*” Find all files whose names contain the string ‘xpilot’ which exist within the ‘/usr/local/games’ directory tree.

Reading and writing tapes, backups, and archives: The tar command

The tar command stands for “tape archive”. It is the “standard” way to read and write archives (collections of files and whole directory trees).

Often you will find archives of stuff with names like stuff.tar, or stuff.tar.gz. This is stuff in a tar archive, and stuff in a tar archive which has been compressed using the gzip compression program respectivly.

Chances are that if someone gives you a tape written on a UNIX system, it will be in tar format, and you will use tar (and your tape drive) to read it.

Likewise, if you want to write a tape to give to someone else, you should probably use tar as well.

Tar examples:

tar xv Extracts (x) files from the default tape drive while listing (v = verbose) the file names to the screen.

tar tv Lists the files from the default tape device without extracting them.

tar cv file1 file2 Write files ‘file1′ and ‘file2′ to the default tape device.

tar cvf archive.tar file1 [file2…] Create a tar archive as a file “archive.tar” containing file1, file2…etc.

tar xvf archive.tar extract from the archive file

tar cvfz archive.tar.gz dname Create a gzip compressed tar archive containing everything in the directory

‘dname’. This does not work with all versions of tar.

tar xvfz archive.tar.gz Extract a gzip compressed tar archive. Does not work with all versions of tar.

tar cvfI archive.tar.bz2 dname Create a bz2 compressed tar archive. Does not work with all versions of tar


File compression: compress, gzip, and bzip2

The standard UNIX compression commands are compress and uncompress. Compressed files have a suffix .Z added to their name. For example:

compress part.igs Creates a compressed file part.igs.Z

uncompress part.igs Uncompresseis part.igs from the compressed file part.igs.Z.

Note the .Z is not required.

Another common compression utility is gzip (and gunzip). These are the GNU compress and uncompress utilities. gzip usually gives better compression than standard compress, but may not be installed on all systems. The suffix for gzipped files is .gz

gzip part.igs Creates a compressed file part.igs.gz

gunzip part.igs Extracts the original file from part.igs.gz

The bzip2 utility has (in general) even better compression than gzip, but at the cost of longer times to compress and uncompress the files. It is not as common a utility as gzip, but is becoming more generally available.

bzip2 part.igs Create a compressed Iges file part.igs.bz2

bunzip2 part.igs.bz2 Uncompress the compressed iges file.

Looking for help: The man command

Most of the commands have a manual page which give sometimes useful, often more or less detailed, sometimes cryptic and unfathomable discriptions of their usage. Some say they are called man pages because they are only for real men.

Example:

man ls Shows the manual page for the ls command

Basics of the vi editor

Opening a file

vi filename Creating text

i Insert before current cursor position

I Insert at beginning of current line

a Insert (append) after current cursor position

A Append to end of line

r Replace 1 character

R Replace mode

Terminate insertion or overwrite mode

x Delete single character

dd Delete current line and put in buffer

ndd Delete n lines (n is a number) and put them in buffer

J Attaches the next line to the end of the current line (deletes carriage return).

u Undo last command

yy Yank current line into buffer

nyy Yank n lines into buffer

p Put the contents of the buffer after the current line

P Put the contents of the buffer before the current line

^d Page down

^u Page up

:n Position cursor at line n

:$ Position cursor at end of file

^g Display current line number

h,j,k,l Left,Down,Up, and Right respectivly. Your arrow keys should also work if your keyboard mappings are anywhere near sane.

:n1,n2:s/string1/string2/[g] Substitute string2 for string1 on lines n1 to n2. If g is included (global), all instances of string1 on each line are substituted. If g is not included, only the first instance per line is substituted.

^ matches start of line

. matches any single character

$ matches end of line

These and other “special characters” (like the forward slash) can be “escaped” with \

i.e to match the string “/usr/STRIM100/SOFT” say “\/usr\/STRIM100\/SOFT”

Examples:

:1,$:s/dog/cat/g Substitute ‘cat’ for ‘dog’, every instance for the entire file - lines 1 to $ (end of file)

:23,25:/frog/bird/ Substitute ‘bird’ for ‘frog’ on lines 23 through 25. Only the first instance on each line is substituted.

Saving and quitting and other ex commands

These commands are all prefixed by pressing colon (:) and then entered in the lower left corner of the window. You cannot enter a ex command when you are in an edit mode.

Press to exit from an editing mode.

:w Write the current file.

:w new.file Write the file to the name ‘new.file’.

:w! existing.file Overwrite an existing file with the file currently being edited.

:wq Write the file and quit.

:q Quit.

:q! Quit with no changes.

:e filename Open the file ‘filename’ for editing.

:set number Turns on line numbering

:set nonumber Turns off line numbering

Linux & Unix Tricks

Posted by Shashank Krishna

A few linux tips and tricks for newbies. I have made this page as a reminder of tricks I used in Linux or unix along the way.

To expand a .tgz of tar.gz file in one line :

gunzip < file.tar.gz | tar xvf -
gunzip < file.tgz | tar xvf -

To change both group and ownership recursively :

chown -R someowner.somegroup file

To search the entire hardrive for a file in Linux :

find / -name somefilename

To search on Linux within each file for some phrase on the entire harddrive and display the file and line numbers :

find / -exec grep -n “phrase” ‘{}’ \; -print

Xargs can be used to create a list of input file to one of your perl scripts e.g.

ls *.txt | xargs ./your_perl_script

Wc can be used to print the total bytes, words and lines in a file, combined with cat you can print a total number of lines or byte, e.g. say you want the total number of lines in all files in the current directory ending in .txt.

cat *.txt | wc -l

Display a range of lines withing a file where the starting line number is x and the ending line number is y :

sed -n ‘x,yp’ filename

Vim uses A4 paper size by default to change this, use the following setting for letter size :

:set printoptions=paper:letter

7 Reasons not to Use IE

Posted by Shashank Krishna

I am a big fan of Windows. I almost like all the microsoft products. Except one, the browser, the browser that is a common name in most households . Its the one that most geeks hate, hate with all their coding power, Internet Explorer. There are tons of websites that have the hate IE campaign and have Bill Gates morphed with horns that make him look like a demon.

I want to give atleast 7 basic reasons to convince people why they would need to move away from IE.

1. Security
We have tons of viruses on the internet waiting to take over your computer and millions of malwares that want to suck information from your computer. We make sure that we have the latest and best anti-virus which could protect our computer from any virus and this anti-virus usually comes with a built in firewall which is like the Great Wall of China, nothing can come through it. But we have internet explorer which acts like a gateway to all the spywares and malwares and hence nullifying the reasoning behind having the best anti-virus.

The other browsers in the market don’t allow spywares to install through them easily without knowing it. IE makes it relatively trivial through two features called ActiveX and Active Scripting. These technologies were designed specifically for the purpose of giving websites more control over a user�s computer. Unfortunately, as we have seen with exploit after exploit - that�s not always a good thing.

As some of the Microsoft knowledge base articles suggest, there are so many new ways to take control of one’s computer through internet explorer. This is a serious security threat.

2. Standards
All the web designers have to maintain a standard in order that their web pages/applications to be useful on all platforms and on all browsers. Infact, the browser concept came from having a standard that would not require a specific platform or an application. There is a set agreed upon standards which everyone around the world follow to make internet more user friendly and efficient. But internet explorer is set to change the world for the bad. Microsoft, for some odd reason, seems bent on breaking stride with these agreed-upon standards.

I am a web designer and I know that in CSS, there are so many features that would not work on IE but works on all other browsers. This restricts me from being creative and efficient. Many times, I am forced to change my design to suit IE and I sure am cursing IE all the way.

Microsoft wants to propose their own standards which is suitable for them, because they can. Its a multi-billion dollar company which has its effect on most computers throughout the world and they know that they can call the shots and they are being adamant by not going with the wave.

3. Does not work on all Platforms
Internet Explorer is so Microsoft dependent that it is made only for Windows and it hasn’t been coded for Linux. This is a big disadvantage especially if you are somebody who works on different platforms. We all get used to one application and the specific way we like to tweak it, but IE wouldn’t let you do it if you work on different platforms.

4. Not Extendible
What you get with Windows is what you get. No more additions nor subractions. You cannot add any more features like other browsers. If I take any other browser, there are tons of extensions which would make my life so much better than IE which is as rigid as Bill Gates’ smile.

We have a cell phone that works as a camera, video recording, palm pilot and the list goes on. We want to use one application for all(most) the needs. But, with IE, strictly browsing and gateway to viruses.

5. Reject Anarchy
How long can we allow one company to make the rules and rule the world? We need to bring an end to the Microsoft’s rule and it can very well start with rejecting IE.

I was so excited when I heard that Google was buying Opera because Google has the potential to trounce players like Microsoft and they can bring out quality products.

6. Better Options
Mozilla has the best product right now in the market. Its free. Its a household name for geeks, Firefox. Firefox is the best alternative that I have found so far which is very secure, the web designers love this browser as it follows all the standards all the way. It has tons of extensions which would turn your browser into all-in-one application and makes browsing so much better.

If you haven’t switched over yet from Internet Explorer, I would urge you to make the move now. Better late than never. You need to do it before you get taken over by viruses and hackers.

There are other players in the browsers field like Netscape, Opera, Flock and others. What makes Firefox better than the others is that Firefox has a huge community working behind it. Opera and Flock are in the Firefox mould but Netscape is obsolete with no improvements.

7. You are Smart
God made us human beings to be smart and rule over everything. This means, rule over things that are not genuine. We all know that Internet Explorer is not the best out there (infact one of the worst) and we have better options. Why not make a move towards something that is really good? Let me know me if you made the switch or not.

Free JavaScript Codes

Posted by Shashank Krishna Sunday, February 24, 2008

C++ FAQ

Posted by Shashank Krishna

IF U HAVE QUESTIONS ON C++
CLICK THIS C++ Faqs: Frequently Asked Questions

Are You Planning on Quitting Facebook? Why?

@Flickr

www.flickr.com

About Me

My Photo
Shashank Krishna
Bangalore, up, India
nothin much to say.........doin B.tech in IIIT allahabad loves bloggingn hacking.... :) and loooves blogging
View my complete profile

ads2

topads