Tuesday, December 05, 2006

use MPICH on linux

Setup environment (assuming csh or tcsh)
setenv PATH mpi_install_dim/bin:$PATH

Setup ssh:
1. Setup host authentication (by administrator), following two files are relevant. See ssh manual page for detail.

2. Setup user authentication (by user)
ssh-keygen -b 1024 -t rsa
cp .ssh/is_rsa.pub .ssh/authorized_keys

If ssh is setup correctly, following command should be able to run without entering password:
ssh remosthostname date

Friday, August 18, 2006

conflict of matlab with Intel IPP

If you use latest version of IPP with matlab 7.1,
then you need make sure your IPP\bin and IPP\bin\win32 is ahead of MATLAB's directory in the PATH environment variable.

linux email forwarding

Create a file named .forward at home directory with the following content:
\username, emailname@abc.com

Of couse, you need to change username, emailname and abc.com to suitable value

Saturday, May 27, 2006

Defragment windows system files

Windows Disk defragmenter does not defragment system files.
A good tool PageDefrag at http://www.sysinternals.com/Utilities/PageDefrag.html can do this.

Optimize the System Cache Size

System Key: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ Session ManagerMemory Management]
Value Name: LargeSystemCache
Data Type: REG_DWORD (DWORD Value)
Value Data: "0" for Desktops; "1" for Servers

Reference: http://www.winguides.com/registry/display.php/931/

Friday, April 14, 2006

Notes on using GnuPG

1. generate key-pair of yourself using
gpg --gen-key

2. Download desired file and its signature. The signature is supposed from person Joe
The desired file: abc.tar.gz
Its signature: abc.tar.gz.sig

3. Obtain the public key of Joe using
gpg --import KEY-FILE
gpg --keyserver pgpkeys.mit.edu --recv-key KEY-ID

Here KEY-FILE is the name of the file for the public key of Joe. This file needs to be obtained from Joe or other trusted source.
KEY-ID is the id of the public key of Joe. It should be obtained from Joe or other trusted source.

4. Verify that the signature using is signed using the public key
gpg --verify abc.tar.gz.sig

5. Make sure the key actually belongs to Joe by confirming the key fingerprint of the public key. The ultimate confirmation is by face to face communication.
gpg --fingerprint KEY-ID

6. If you trust Joe and are sure the public key belongs to Joe, you can sign the public key of Joe using
gpg --sign-key KEY-ID

Thursday, April 13, 2006

point vs. rate for mortgage

n: morgage term in number of years
m: number of years to closing
p: paid point

let t= n *annual_rate
s= m* annual_rate

p is equivalent to an increase of t to d+dt
Assuming no closing cost then

dt ~ c*p

So paying point p is equivalent to an increase of annual rate of p*(1/n)*c

example 1:
annual rate = 0.06
term = 30 years
closing until 30 years

t = 0.06*30 = 1.8
s = 0.06*30 = 1.8
c = 1.8 *(exp(1.8)-1)/(exp(1.8)-exp(1.8-1.8)-1.8) = 2.797
suppose paid point is 0.01 (1 point)
then the effective annual rate of this mortgage is
0.06 + 0.01 * (1/30) * 2.797 = 0.06093 = 6.093%

example 2:
Everything same as example 1 except that
closing afte 10 years
s = 0.06*10 = 0.6
c = 1.8 *(exp(1.8)-1)/(exp(1.8)-exp(1.8-0.6)-0.6) = 4.268
then the effective annual rate of this mortgage is
0.06 + 0.01 * (1/30) * 4.268 = 0.06142 = 6.142%

example 3:
Everything same as example 1 except that
closing afte 5 years
s = 0.06*5 = 0.3
c = 1.8 *(exp(1.8)-1)/(exp(1.8)-exp(1.8-0.3)-0.3) = 7.169
then the effective annual rate of this mortgage is
0.06 + 0.01 * (1/30) * 7.169 = 0.06239 = 6.239%

Wednesday, April 12, 2006

Time zone in Java

PST is same as GMT-08:00
PDT is same as GMT-07:00

EST is same as GMT-05:00
EDT is same as GMT-04:00

This mean that for example,
20060412 13:00:00 PST is one hour later than 20060412 13:00:00 PDT

These time zone string can be parsed by java.util.SimpleDataFormat class

Monday, April 10, 2006

Cookie file format of Internet explorer

Cookies are at C:\Documents and Settings\[user name]\Cookies

Cookie name
Cookie value
Host/path for the web server setting the cookie
Exirpation time (low)
Expiration time (high)
Creation time (low)
Creation time (high)
Record delimiter (*)

Conversion of the time to the number of seconds
elapsed since midnight (00:00:00), January 1, 1970,

t = 1e-7*(high*pow(2,32)+low) - 11644473600

Galleta - An Internet Explorer Cookie Analysis Tool

Tuesday, January 24, 2006

Using image in LaTex

Convert the image file to jpeg format.
Use jpeg2ps to convert it to eps file.
Then it can be easily used in LaTex