Tuesday, November 11, 2008

VLC doesn't show subtitle automaticly under Linux

The thing is this, the avi file can be played by VLC media player and if you have the subtitle file (.srt) in the same folder with the same name beside the avi file then it should be read by VLC media player automaticly. But not always, for example mine under Linux refused to add it to the movie. Here is the way to do it manualy :

You click on open file, you specify the video file, then you click on use subtitle file, and then specify the subtitle file, it does not have to have the same name, as long as you specify the correct path

also, the subtitles file might be wrong, try to open it with a text editor and check its contents.

also try opening another subtitles, just to make sure that the subtitles file is not corrupted/worng.

Source that helped me : http://ubuntuforums.org/archive/index.php/t-803063.html

Monday, November 10, 2008

How to set JAVA_HOME variable

Q : I just need a help to show me how to setup java path on Linux. How can I set JAVA_HOME and PATH variables for every user under my Linux system?

A : ~/.bash_profile is a startup script which generally runs once. This particular file is used for commands which run when the normal user logs in. Common uses for .bash_profile are to set environment variables such as PATH, JAVA_HOME, to create aliases for shell commands, and to set the default permissions for newly created files.

Set JAVA_HOME / PATH for single user

Login to your account and open .bash_profile file
$ vi ~/.bash_profile
Set JAVA_HOME as follows using syntax export JAVA_HOME=. If your path is set to /usr/java/jdk1.5.0_07/bin/java, set it as follows:
export JAVA_HOME=/usr/java/jdk1.5.0_07/bin/java
Set PATH as follows:
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin
Save and close the file. Just logout and login back to see new changes:
$ echo $JAVA_HOME
$ echo $PATH

Tip: Use the following command to find out exact path to which java executable under UNIX / Linux:
$ which java

Please note that the file ~/.bashrc is similar, with the exception that ~/.bash_profile runs only for Bash login shells and .bashrc runs for every new Bash shell.


Set JAVA_HOME / PATH for all user

You need to setup global config in /etc/profile OR /etc/bash.bashrc file for all users:
# vi /etc/profile
Next setup PATH / JAVA_PATH variables as follows:
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin
export PATH=$PATH:/usr/java/jdk1.5.0_07/bin

Save and close the file.


Source : http://www.cyberciti.biz/faq/linux-unix-set-java_home-path-variable/

Friday, November 07, 2008

Schematic Diagrams, DC circuits

This is a source of emf (electromotive force), with a voltage of , measured in units of volts, V. The most common source you will see will be a battery.

This is a resistance, measured in units ohms ohms, . Most often it will be a resistor. However, wires connecting parts of a circuit are really not resistance-free. We can model this real-life case by putting a 'resistor' in the circuit which has the same resistance as the wires would have. Thus the wires can still be considered resistance-free since their resistance is represented by an additional resistor.

This is a capacitor, with capacitance C measured in units of farads, F. The perfect capacitor will have no resistance (or inductance; see next), and we will assume that this symbol represents such an ideal capacitor. If a capacitor is not ideal, that is, it has some resistance (or inductance) associated with it, then we can model this by putting a 'resistor' (or inductor) in parallel with the capacitor. This resistor (or inductor) will have the same resistance (or inductance) as the non-ideal capacitor.

This is an inductor, with inductance L, measured in units of henrys, H. To model a non-ideal inductor in a circuit (an inductor with an associated resistance or capacitance) we can put a resistor in series or a capacitor in parallel with the inductor. Giving these the same values as the inductor will represent an imperfect inductor.

--------------------------------------------------------------

1. Ohm's Law deals with the relationship between voltage and current in an ideal conductor. This relationship states that:

The potential difference (voltage) across an ideal conductor is proportional to the current through it.

The constant of proportionality is called the "resistance", R.

Ohm's Law is given by:

    V = I R
where V is the potential difference between two points which include a resistance R. I is the current flowing through the resistance. For biological work, it is often preferable to use the conductance, g = 1/R; In this form Ohm's Law is:
    I = g V
2. Material that obeys Ohm's Law is called "ohmic" or "linear" because the potential difference across it varies linearly with the current.

3. Ohm's Law can be used to solve simple circuits. A complete circuit is one which is a closed loop. It contains at least one source of voltage (thus providing an increase of potential energy), and at least one potential drop i.e., a place where potential energy decreases. The sum of the voltages around a complete circuit is zero.

4. An increase of potential energy in a circuit causes a charge to move from a lower to a higher potential (ie. voltage). Note the difference between potential energy and potential.

Because of the electrostatic force, which tries to move a positive charge from a higher to a lower potential, there must be another 'force' to move charge from a lower potential to a higher inside the battery. This so-called force is called the electromotive force, or emf. The SI unit for the emf is a volt (and thus this is not really a force, despite its name). We will use a script E, the symbol , to represent the emf.

A decrease of potential energy can occur by various means. For example, heat lost in a circuit due to some electrical resistance could be one source of energy drop.

Because energy is conserved, the potential difference across an emf must be equal to the potential difference across the rest of the circuit. That is, Ohm's Law will be satisfied:

    = I R
5. Here is a nice simulated experiment on Ohm's Law for you to test your understanding of this concept. Use the "back" button to return to this place.

Source : http://www.physics.uoguelph.ca/tutorials/ohm/