Tuesday, February 22, 2011

how to set classpath for java

For Windows like this 

javac -classpath dir1;dir2;dir3 ...

The difference is that Windows uses the colon (:) character as part of a filename, so it can't be used as a filename separator. Naturally the directory separator character is different as well: forward slash (/) for Unix and backslash (\) for Windows.( I ). For running a simple program we need to set the  java path  on command prompt(for temporary )& in Environment variable using PATH variable  & CLASSPATH variable :
PATH variable 
In JDK the PATH variable contains directories where binary files (e.g. EXE files in Windows) will be looked for.We set the PATH variables like this i.e path C:\Java\jdk1.6.0_03\bin 
(i)on command prompt
C:\>set path=%path;C:\Java\jdk1.6.0_03\bin%
When you open a command prompt and type "javac", you're supposed to have the "bin" directory of your sdk into the PATH, otherwise you'll get an infamous "Command not found" error message.
CLASSPATH 
In JDK the CLASSPATH contains directories (or JAR files), from where your java compiler/runtime will look for .class files (and some others). For example, "java Hello.class" will not work unless you set the directory (or JAR file) Hello.class is in, into your CLASSPATH.
i.e.classpath  C:\Java\jdk1.6.0_03\lib

For setting CLASSPATH using command prompt  Java class path can be set using either the -classpath option when calling an SDK tool (the preferred method) or by setting the CLASSPATH environment variable. The -classpath option is preferred because you can set it individually for each application without affecting other applications and without other applications modifying its value.
(ii)on command prompt 
C:\>set classpath=%classpath;C:\Java\jdk1.6.0_03\lib%
JARs on the classpath
Java compiler and run-time can search for classes not only in separate files, but also in `JAR' archives. A JAR file can maintain its own directory structure, and Java follows exactly the same rules as for searching in ordinary directories. Specifically, `directory name = package name'. Because a JAR is itself a directory, to include a JAR file in the class search path, the path must reference the JAR itself, not the directory that contains the JAR. This is a very common error. Suppose I have a JAR jarclasses.jar in directory /jarclasses. The Java compiler look for classes in this jar, we need to specify: javac -classpath /jarclasses/jarclasses.jar ...
and not merely the directory jarclasses. For the CLASSPATH  use  CLASSPATH Environment Variable 
In java programming language we use the following packages such as  java.io.*;  java. util.*;These  packages are  just a set of classes, you will want to store them in one place, separate from the directory where you are developing your program. Sometimes these libraries have a set of files stored in a single jar file ( with a .jar extension). From where  the Java compiler and run programs must be able to find any of these. This is done for command line use of Java and for some editors and IDEs by setting an environment variable called CLASSPATH. For  Windows, the CLASSPATH environment variable should look like this :
c:\MyJavaLib;c:\MyJavaLib\myutils.jar;c:\MyJavaLib\blackboxclasses.jar;.
At the end " . "  includes the current directory in the search for classes. 
  • Suppose we have a directory MyJavaLib on the C-drive that contains some utility classes or the directories that correspond to some packages. This  is the part before the first semi-colon.
               
  • Second part indicates that we have some classes stored in a file myutils.jar
             
  • Third part indicates that we have a jar file blackboxclasses.jar. 
Finally, after the last semi-colon we have the period( . ), indicating that the current directory is on the CLASSPATH. If some things are stored in directories that are subdirectories, the complete path, starting with "c:\" should be in the CLASSPATH.
(2)  For  setting CLASSPATH & PATH variable  in environment variable by using the following steps:
(i) right click on my computer icon on desktop
(ii) click on properties
(iii) click on advanced

(iv) click on  Environment variables

(v)  system varables  click on  new

(vi) in ( variable name) write ----- path
in ( variable value)  paste the path till bin directory i.e.------- c:\java\jdk1.6.0_03\bin click on ok

(vii)  in system varables again click on  new

(viii) in ( variable name) write ----- classpath
in ( variable value)  paste the path till lib directory i.e.------- c:\java\jdk1.6.0_03\lib  click on ok

(ix) after finished click on ok

(x) finished click on ok

How to set System Classpath :
Java class path is set for including the various files during program execution & compilation.After setting class search path on the javac command line, we set `system' class path. This  class path  will be used by both the Java compiler and the JVM . In both Unix and Windows systems, this is done by setting an environment variable. For example, in Linux with the bash shell:

CLASSPATH=/jarclasses/jarclasses.jar;export CLASSPATH 

for Windows:

set CLASSPATH=c:\jarclasses\jarclasses.jar

We use this procedure for setting  short-term changes to the system CLASSPATH, but if you want these changes to be persistent you will need to arrange this yourself.For different - 2 system this path  is different . On a Linux system, we  put the commands in the file .bashrc in my home directory. On Windows 2000/NT there is a `Control Panel' page for this.
Setting the system CLASSPATH is a useful procedure if you have JARs full of classes that you use all the time.

how to set password in folder?

To add a password to your personal folders follow these steps:

If the Folder List is not visible, then click Folder List on the View menu.


Right-click the Personal Folders, and then click Properties For "Personal Folders" on the shortcut menu.


On the General tab, click Advanced.


Click Change Password.


In the Change Password dialog box, type your new password and verify it by typing it a second time.


Make sure that the "Save this password in your password list" check box is cleared (not checked). This prevents the password from being cached. You will need to type it each time you run Outlook.


After you have entered the password successfully, click OK three times.


The next time you start Outlook, you will be prompted to type a password before viewing the contents of the personal folder.

How to Improve Your Memory

All improvement in memory consists of one's habitual method of recording facts"
- Dr. William James, Father of American Psychology
 Introduction
Most of us might have complained about our memory one time or other. But some of you have been frequently complaining about your poor memory. When we generally talk about poor memory we are really talking about poor recollection. Recollection is possible only if the content is retained in memory. This is possible only if we have recorded it into memory. That is, unless we have not assimilated, we cannot recall at all. That is why William James and many others including mnemonists give emphasis to how we record things into our memory.
Even if we record something correctly in our memory, we may not be able to recall it. This is due to many reasons, the main reasons being problems in retention and stress. The former can be solved by systematic revision and the latter by practicing some Stress Management Techniques or using Stress Management Tools like HIT (Holistic Integration Technique) of Dr.V.George Mathew or the Award winning Guided Somato-Psychic Relaxation (GSPR) Technique of Dr.Krishna Prasad Sreedhar The latter can be learned by using audio cassettes.

Now let us discuss five simple techniques to improve memory: Four of these techniques are used to improve assimilation and thus to have longer retention. The last one is a simple strategy for recollection.
Chunking
Perhaps Chunking is the oldest method used in memorization. In this method, the items to be memorized are divided into small and easily memorizable chunks or groups. This method works best when the order of the items is not important.
This method is found to be particularly well suited for memorizing multi-digit numbers (eg., ID nos., telephone nos., etc.) and for committing complicated spellings to memory.
Example:
  1. The number 472627607 may be memorized easily if it is grouped as 472, 627,607 or as 47, 26, 27,607.
    These chunks may then be learned by rote. Learning and retention are much facilitated if you further explore the nos. by finding some relationship among these different chunks. Finding the
    digital root will also be helpful. The more explorations or relations you do, the better.
  2. Words like mathematics may be divided into mat +he +mat +ics, Together may be divided into to + get + her; Important may be divided into im + port + ant. This technique will make us learn much faster.
  3. The list Apple, cucumber, paper, ink, cabbage, banana, grapes, beans, stapler, orange can be better learned by rearranging and applying chunking as :-
    Apple, banana, grapes, orange, cucumber, cabbage, beans, paper, ink, stapler
    -- 4 fruits, 3 vegitables and 3 stationary items.
If possible, organize the material as meaningfully as you can and think out relationships among each group. This not only improves learnability and retention but also aids in faster and effortless recollection.
Psychologists doing research on Human Memory have found that the capacity of Short Term Memory (STM) for humans is 7± 2 that is from the range 5 to 9 items. So you should take care to keep the chunks you create within this limit.
Rhyming
This is also one of the popular and oldest methods in memorization. This technique makes use of the fact that we have a natural tendency to remember rhymes and rhythms. The following is a very popular example of application of this technique which almost all school students are familiar with.
"Thirty days haveth September
April, June and November
All the rest have thirty-one
February has twenty-eight alone
Except in leap year, then the time
When Febs days are twenty-nine."
If possible create rhymes like this and it will not only aid in improving your memory but in improving your creativity as well.
Mediation/Bridging
In this method, a bridge is built in between the items given to be memorized. This technique is best suited for learning material involving word pairs or material that can be reduced to word pairs. An example often cited by memory experts is the learning of the capital of Poland. The capital of Poland is Warsaw. World War II started with Germany's attack on Poland. Thus it may be arranged as Poland SAW War first.
Here, the word pair to be connected together is Poland and Warsaw. The additional information of the World War II is used as a bridge or mediator in bringing these two words together.
 Again, like other techniques, the mediation technique calls for the learner's active participation in the learning process. This is because one is to bring in the mediator or the bridge from relevant items one has learned.

Bed-time Recital
In this technique, you do your recital or rote learning just before going to bed. The mind in the process of sleeping would then arrange the information in a systematic and effective way when you are sleeping. Psychologists have also found that if you sleep after thinking about your problems there is a better chance that you arrive at a solution the next day.
Steps for Memory Improvement
  1. Be in a relaxed mood
  2. Write down the things that you are supposed to remember in a piece of paper.
  3. Read it aloud (if possible) once or twice and recite it two to three times.
  4. Now go to sleep without worrying or thinking about anything.
You will surely retain the item longer and find it more easy to recall it when in need.

Trying by Not Trying
All of us apply this method knowingly or unknowingly. Sometimes when you try to recall you may not be able to recall it at that time even if you are sure that you know it very well. You experience a blocking that prevents you from recalling it. Normally you tend to try again and again but in vain. To handle this situation you just keep away from trying to recollect it and do something else; to your pleasant surprise that information automatically pops up into your mind after some time. This is because even if you stopped trying, the mind is searching for that information and brings it to awareness when it is found. Sometimes the information was blocked when you wanted, and mind brings it forward when the blocking is removed. This is where stress plays its role in hindering recall.
If you are very anxious by nature or very stressful in nature, you may encounter this type of blockage very often. In such case, it is highly recommended that you practise some kind of relaxation technique and thus keep your anxiety and stress away. This is very important because this behavior can bring many undesirable psychological and physiological conditions. You may even consult a Clinical Psychologist in extreme cases.

How to Use the GPS on an IPhone 3G

One of the most anticipated features on the iPhone 3G was the inclusion of GPS technology. Apple's incorporation of GPS (Global Positioning System) onto its portable mobile phone enables users to receive directions and navigate anywhere they are in the world. Whether you are in your car or walking around a foreign city, the iPhone 3G makes it very easy to figure out where you are and how to get to your destination.

Instructions

   1.
     
      Tap "Settings" and go to "General." Make sure that "Location Services" is turned on.
   2.
     
      Go back to the "Home" screen and tap "Maps." Tap the scope icon on the bottom left corner of the screen. Click "OK" when the iPhone asks if Maps can use your current location. The iPhone GPS will now locate where you are.
   3.
     
      Tap the "Directions" tab on the bottom of the screen. Enter the address of where you want to go in the "End" field. Tap "Route."
   4.

      At the top of the screen, select your mode of transportation: Car, Bus, or Walking. You should see a green pushpin marking your current location on the map. The red pushpin is your destination. The message at the top should indicate how many miles away your destination is and the approximate amount of time it will take to get there.
   5.
     
      Tap the "Start" button on the upper left corner of the screen. Maps will give you step-by-step instructions on where to head next. The iPhone GPS will continue to track your location as you move.

Product Supplierswww.hktdc.com
Connect with over 120,000 suppliers from Hong Kong, China and Taiwan

how to capture streaming video


Many websites like YouTube use a Flash Video format that enables highly-compressed streaming video to effectively play in most browsers. However, the inconvenience with this type of format is that you will not be able to download it by using your Save target  option.

There are three common ways available to download/capture/save streaming videos online to your computer:

1. Using download-helper websites
2. Capture the video using a Firefox extension
3. Save the video by using commercial softwares.

Download-helper Websites


KeepVid and YouTube Downloader are download-helper websites that allow users to provide them with the video links. These videos will hence be catalogued and uploaded to the site. They are not video hosting websites like YouTube or Dailymotion; they provide a browser-based service from as the user only has to enter the video’s URL in the field provided and choose its source from the list. The file formats in FLV can be converted into Mpeg video formats on Keepvid.

Download Links:

KeepVid: http://keepvid.com/
Youtube Downloader: http://www.youddl.com/

Firefox extension


Mozilla Firefox is a web browser that allows you to grab online videos with its additional Video Downloader extension. This application runs both on Windows and Mac OS X operating systems.

Mozilla Firefox 3.1 can be downloaded at: http://www.mozilla.com/en-US/firefox/

Install Mozilla Firefox

1. Choose Save when the file download window opens and select the path where you want the set up extension to be saved in.

/s/image-http-img292-imageshack-us-img292-7757-step1pf7-png

2. When the download is completed, Click Open
3. This will prompt theSet Up Wizard and you will be free to make all the necessary changes concerning its installation. If you do not want to make any changes to the installation settings, check the box labeled “I agree to the terms and conditions of the program” and proceed by clicking Next until installation completes.

/s/image-http-img247-imageshack-us-img247-5842-step3pu7-jpg

Install Mozilla Firefox Video Downloader

When Firefox's installation is complete, you can now download the Video Downloader extension at https://addons.mozilla.org/en-US/firefox/addon/3006

1. When prompted to download the software extension, click Save
2. From the Mozilla Firefox folder in your “Program Files” save the add-on in the “Extensions” folder.
3. When download is complete, choose “Close”
4. When you will open the Mozilla Firefox browser window, it will ask you if you want to install the add-on. Click “Install Now”
5. After installation, the toolbar should have the /s/image-http-img291-imageshack-us-img291-9796-3006gy3-png icon located to the left-hand side of your address bar.
6. You should first load the page containing the video stream to use this option. Once you have loaded the right page, click on the down arrow next to your video downloader icon and choose the format you want to save the video. By default it will save it as an FLV format file.
7. Choose the path where you want the video to be saved to.

Note: Winamp’s latest versions can play FLV format files. You can download the program at: http://www.winamp.com/player