Java: Lifecycle of a Java Program

It had been long since i posted something about Java and thought of putting up a post describing Lifecycle of a Java Program.

Java-Lifecycle

The figure above explains the lifecycle of a Java Program. In words, the figure can be explained as:

  1. A Java program is written using either a Text Editor like Textpad or an IDE like Eclipse and is saved as a .java file. (Program.java)
  2. The .java file is then compiled using Java compiler and a .class file is obtained from it. (Program.class)
  3. The .class file is now portable and can be used to run this Java program in any platform.
  4. Class file (Program.class) is interpreted by the JVM installed on a particular platform. JVM is part of the JRE software.

Related Reads: Wat is the difference between JDK and JRE?

Cheers,

Vaibhav                

             

What was HOT: 1 month back on Technofriends

Cheers,

Vaibhav

Apple Update disables Unlocked iPhones

Apple on Thursday released iPhone update 1.1.1 which has led to many unlocked iPhones getting disabled.

iPhone

The update process goes through without a hitch, however, when the phone is restarted an activation message appears which says, “Insert an unlocked and valid SIM to activate iPhone.”

Source: Macworld

LinkedIn Profiles: Add your photo starting this Friday.

LinkedIn, the Professional social networking tool will allow adding photo to your profile starting Friday. This feature addition by LinkedIn is certainly a move to catch up with Facebook.

LinkedIn

Also, Linked is coming out with the LinkedIn Development Network on the lines of Facebook; LinkedIn Development Networks is still under development.
Connect with me on LinkedIn here View Vaibhav Pandey's profile on LinkedIn

Source: Mashable

Cheers,

Vaibhav

Learning the basics of Service Oriented Architecture

In computing, the term Service-oriented architecture (SOA) expresses a software architectural concept that defines the use of services to support the requirements of software users. In an SOA environment, nodes on a network make resources available to other participants in the network as independent services that the participants access in a standardized way.

The embedded ppt below from Slideshare explains the concepts of Service Oriented Architecture.

Cheers,
Vaibhav

Microsoft Windows: More fun with the HOSTS file

Thought of writing another short post on one more interesting thing that can be done using the HOSTS file in Windows.

Previously, I had written about HOSTS file in my post  Block Websites of your choice without any Software.

The Hosts file is usually available in C:\WINDOWS\system32\drivers\etc in case of Windows XP.

If you wish to interchange the websites that get opened when you click enter after entering the address in browser. Lets assume that you wish to open flickr.com when you type orkut.com in the browser and vice-versa; do as mentioned below.

  1. Get the IP Address of Orkut.com and Flickr.com [ lets assume that the IP of Orkut is 72.14.209.86 and the IP Address of Flickr is 68.142.214.24]
  2. Open the HOSTS file in your favorite text editor.
  3. Add the below mentioned lines
  4. 72.14.209.86 www.flickr.com
    72.14.209.86 flickr.com
    68.142.214.24 www.orkut.com
    68.142.214.24 orkut.com
  5. Save the file and reboot your PC. You are done now 🙂

From now on, whenever you type www.flickr.com on your browser; you will find Orkut opening up. Similarly with Orkut you will find Flickr opening up 🙂

Also read: Block Websites of your choice without any Software

Cheers,

Vaibhav

Microsoft Outlook: Creating an Appointment From a Mail

  1. From the mail list, mark the desired mail Drag and drop the marked mail to the Calendar shortcut on the Outlook bar (or the Calendar folder in the Folder list).
    The appointment window opens, and the mail text is displayed in the body of this window
  2. Ensure that the date and time are correct. Make any additional entries
  3. To save the appointment, click Save and Close in the toolbar.

Cheers,

Vaibhav

Computer Viruses: How do they work?

I first heard of this term called Computer Virus when i was 10 years old and that was 15 yrs back. Since then, Computer Viruses have matured both in the way they attack and the coding that goes behind them.

A computer virus is nothing but a small software which piggybacks itself onto some other program. An example to illustrate this definition can be a virus which gets attached to Microsoft Word. Each time Word runs, the virus attached also gets executed.

 Computer Virus

[Image Source: http://blog.fotogenia.info]

The lifecycle of a computer virus goes through these phases:

  1. Coding/Visualizing the virus: In this phase, the developer of the virus, codes and develops the virus by visualizing the intent of the virus.
  2. Releasing the virus: The virus once ready, is released to the outer world.
  3. Spreading the infection: In order for the virus to be able to make an impact, it needs to be spread, this is often done using techniques like autoforwarding a simple email to all the contacts in your address book. ( there are though many other popular techniques)
  4. Quarantining the virus: In this phase, the virus gets Quarantined. The Quaranting process actually takes sometime. This happens only after the antivirus firms validate the signature of the virus and develop an antivirus update. The virus is then Quarantined.

Also read: How does Email Scanning Work?

More to read: Top 3 FREE Antivirus Applications

In order to prevent the spreading of application using the method mentioned above, Microsoft Applications come built in with a technique called Macro Virus Protection. Macro Virus Protection by default is turned ON. With this feature turned ON, the auto-execute feature is disabled. This ensures that when a viral code is trying to execute itself, a  dialog pops up warning the user.

Macro Virus Protection in Microsoft Word 2000, 2002, and 2003

Macro Virus Protection

Macro Virus Protection in Word 2000, 2002 and 2003 can be configured by going through the steps mentioned below

Open Word  from the Tools menu, select Macro and then click on Security

  1. In the resulting window, click on the tab mentioned as Security Level.
  2. You will then have the option to choose one of the security levels.
  3. Select Very High to allow only macros installed in trusted locations to run. Any other macros, signed or unsigned, are disabled. (This setting is available only in Word 2003.)
    Select High to allow only signed macros to run.
    Select Medium to be prompted to run macros.
    Select Low to run all macros.

Now, with the tool activated, if you load a suspect file, Word will warn you that the document contains macros and will ask you what to do about them. You can select Disable Macros to avoid infection from a file containing a macro virus.

Note: If you close the file and reopen it, or if you open an additional file with macros, you will get the same warning, and you must select Disable Macros again.

Tips on Protecting yourself from Computer Viruses:

  • Get a good Antivirus Software.
  • Keep the Antivirus Software updated with latest Virus signatures.
  • Use an Internet Firewall.
  • If you use Microsoft Windows, Visit Microsoft Update and turn on automatic updating.
  • Never open an e-mail attachment from someone you don’t know.
  • Avoid opening an e-mail attachment from someone you know, unless you know exactly what the attachment is. The sender may be unaware that it contains a virus.

Also read: How does Email Scanning Work?

More to read: Top 3 FREE Antivirus Applications

Do comment if you find this useful.

Cheers,
Vaibhav

Web Technologies: Enter the future

Web Technologies: Enter the future

Until a few years back, Internet used to merely a bunch of static web pages linked to each other. However, today, the time and the Technology governing the net have changed. With the emergence of Web2.0 technologies, Internet today is a live and happening place, and, the popularity of Web 2.0 technologies is growing with every passing day.

In this blogpost, I intend to discuss about how various Web 2.0 Technologies are collectively changing the future of Web.

With the emergence of Web2.0 technologies, the static pages with content and link have become yet more powerful, the Web 2.0 technologies have added the most important and missing feature into the WebPages, Interaction.

The Technologies which have contributed in changing the web include XML, J2EE, ASP.NET, JavaScript, AJAX, PHP/Perl, MySQL etc. Using these technologies, Individuals/ Corporates developed many web based application which gradually led to this change of Internet.

This emergence of Web2.0 has offered several opportunities to the Enterprises as well. Enterprises today are able to able to integrate their applications with powerful tools like Wiki, Blogs, RSS Feeds and develop applications which are more interactive and useful for users.

Whenever, the word Web2.0 is referred to in discussions, the first name that comes to anyone’s mind is AJAX. I will therefore write a little about AJAX below.

AJAX

AJAX stands for Asynchronous JavaScript and XML. AJAX has enabled the web applications to become more responsive by exchanging small amounts of data with the server behind the scenes. This ways, AJAX enables the application to refresh without actually the page getting reloaded.

Ajax model

[image source: http://www.accessiblecontent.com]

JavaScript is the main scripting language wherein AJAX function calls are made and using XML the data is asynchronously received.

Data is asynchronously retrieved using the XMLHttpRequest object. This is then passed to the JavaScript sitting on the client; it then binds everything together and displays the updated information to the client.

AJAX is a framework model which has been getting support from both .Net and Java platforms.
E.g. of applications using AJAX are: Gmail, Google Maps, Google Suggest etc…

Mashups

Mashups are small applications (lightweight) which can be added into a web application. Mashups then source the content from a third party using an interface of API’s.

A good example of Mashups can be a small application on one of the webpage which shows local weather information.

RSS

RSS stands for Really Simple Syndication. RSS is a XML based protocol which when used with feeds and aggregators, offers website summaries and syndications. The RSS feeds are in the form of XML file which can be hosted and then updated automatically by the website owners.  The feed can then be read by RSS feed software. One e.g. of RSS feed reader is Google Reader.

I shall be writing in more detail about AJAX and RSS in my coming posts.

Cheers,

Vaibhav

Microsoft Windows: How to Process Idle Tasks

Running multiple applications simultaneously in Windows for long periods leads to a gradual decrease in system performance over time. Often the only option is a Restart. Even if you close the application in the Task Manager, the tasks/threads associated with the application are not released completely, depleting the system’s memory resources making the system unstable and sluggish. The following tip is designed to offer fast relief:

  1. Right-click on your desktop and select New > Shortcut
  2. In the text box enter the command:
    %windir%\system32\rundll32.exe advapi32.dll,ProcessIdleTasks
  3. Click Next. In the next screen, name the shortcut: for example, Clear Memory
  4. Click on Finish

Whenever you feel that the system is sluggish you can double click on this shortcut and it will take care of the idle tasks by removing them. This can be used before you resort to restarting/rebooting the system.
DISCLAIMER This tip requires changes to processes/components that may lead to undesirable system behavior. While I personally test all tips before publishing them,  I dont takes responsibility for the potential side effects of tips.
Note to this tip: Because this tip involves shutting down application processes, there is the possibility that some applications could be shut down improperly, leading to unexpected application behavior. That said, the following tip has been running happily on my machine for many months without any problems so far.

Cheers,

Vaibhav