11/05/2008
offline missed library in Makefile
you should modify the Makefile
add
"LDFLAGS += -lSpectrum"
10/22/2008
10/21/2008
10/16/2008
在linux中停止某一个进程
- 先找到PID for firefox
gyuan@shanghai:~$ pidof firefox - 然后 kill -9 4383
killall -9 firefox
10/14/2008
vi Modes
vi has two modes:
- command mode
- insert mode
In command mode, the letters of the keyboard perform editing functions (like moving the cursor, deleting text, etc.). To enter command mode, press the escape
10/09/2008
7/31/2008
触摸板问题的解决
方法:编辑 /etc/X11/xorg.conf
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "MaxTapMove" "10"
Option "SHMConfig" "on"
EndSection
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
InputDevice "Synaptics Touchpad"
InputDevice "Configured Mouse"
InputDevice "stylus" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
EndSection
7/28/2008
天文距离单位Parsec (pc)
How Distances are Measured in Astronomy
Dealing with the numbers involved with the distances to the stars or even with those found in the solar system can be hard going. Astronomers make their lives easier by using a number of rulers (units of distance) for the distances and although they have some strange names they can be very useful for comparing the distances to stars, other galaxies and even the planets in our solar system.
AU (astronomical units)
One AU is the distance that the average distance that the Earth orbits the Sun at. The AUis most commonly used for the distances of objects with in our solar system. Pluto, the last planet in the solar system is found at an average distance of 39.47 au from the Sun. Sedna the new body nearly as large as a planet found beyond Pluto is never nearer to the Sun than 76AU and then goes to 880AU from the Sun in its giant elliptical orbit.
Light Years
One of the most common rulers is the light year. The light year is is the distance that light travel in one year (365 1/4 days). It is most commonly used for the distances to stars and other galaxies.
The nearest star is 4.2 light years away from our sun. We are 8.3 light minutes away form the Sun. the distance to the outer most planet Pluto is about 13 light hours.
Some other interesting distances in light years:
| Object | Distance in light years |
| Nearest Star (Proxima Centuri) | 4.2 |
| Sirius the dog star (the brightest star in the sky) | 8.6 |
| centre of the galaxy | approximately 30 000 |
| Andromeda (one of our nearest neighbouring galaxies) | approximately 2 million |
| The stars of Orion. (Betelgeuse and Rigel) | 1400 light years |
Parsec (pc)
Astronomers started measuring distances from the amount that a star moves as the Earth goes from one side of the Sun to the other. Try moving your head and you will see that the postion of everything around you changes. One parsec is derived from the smallest angle measurement of 1/3,600th of a degree or an arc second that is the angle that a star at this distance would appear to move in 6 months as the Earth journeys around the Sun. A parsec is 3.2616 light years or 30,857,000,000,000 km.. Two parsecs is 6.5532 light years or twice the distance, it is not a measure of change in angles of the stars. Due to the massive distance in the universe astronomers often use multiples of parsec commonly found are kiloparsec (kpc) a 1000 parsecs or a megaparsec (Mpc) 1,000,000 parsecs.
Below is a conversion table for some useful astronomical distance units
| kilometres (km) | Astronomical units (AU) | Light Years (l.y.) | Parsec (pc) | |
| kilometres (km) | 1 | 149.6 million | 9,460,000,000,000 | 30,857,000,000,000 |
| Astronomical units (AU) | 0.0000000067 | 1 | 63,240 | 206,263 |
| Light Years (l.y.) | 0.00000000000011 | 0.000016 | 1 | 3.2616 |
| Parsec (pc) | 0.000000000000033 | 0.0000048 | 0.3066 | 1 |
7/23/2008
7/22/2008
7/21/2008
mathematica 字体 透明 问题
解决办法是
在运行 mathematica 之前运行
export XLIB_SKIP_ARGB_VISUALS=1
很无奈但是没别的办法。
6/23/2008
哈佛的凌晨四点

1.现在睡觉的话会做梦 而现在学习的话会让梦实现Thismomentwillnap,youwillhavead... 哈佛的凌晨四点(相信大家看过很多遍了,我发仅供个人励志用) 2008-03-24 00:12
1.现在睡觉的话会做梦 而现在学习的话会让梦实现
This moment will nap, you will have a dream; But this moment study,you will interpret a dream.
2.我无所事事地度过的今天是昨天死去的人们所奢望的明天
I leave uncultivated today, was precisely yesterday
perishes tomorrow which person of the body implored.
3.感到晚了的时候其实是最快的时候
Thought is already is late, exactly is the earliest time.
4.不要把今天的事拖到明天
Not matter of the today will drag tomorrow.
5.学习的痛苦是一时的 而没有学习的痛苦是一辈子的
Time the study pain is temporary, has not learned the pain islife-long.
6.学习不是人生的全部 但连学习都征服不了 你还能做什么?
The study certainly is not the life complete. But, sincecontinually life part of - studies also is unable to conquer, what butalso can make?
7.学习不是因为缺少时间而是缺少努力
Studies this matter, lacks the time, but is lacks diligently.
8.所有人的成功都不是偶然的
Nobody can casually succeed, it comes from the thoroughself-control and the will.
9. 无法避免的痛苦就去享受吧!
Please enjoy the pain which is unable to avoid.
10.早起的鸟儿有虫吃
Only has compared to the others early, diligently diligently, canfeel the successful taste.
11.成功并不属于每个人
Nobody can casually succeed
12.时间在流逝
HOW time flies
13.今天流下的口水将变成明天流下的泪水
Now drips the saliva, will become tomorrow the tear.
14. 像狗一样学习
The dog equally study, the gentleman equally plays.
15.如果今天不走的话 明天就要跑
Today does not walk, will have to run tomorrow.
16.为未来投资的人是对现实忠实的人
The investment future person will be, will be loyal to the realityperson.
17.学历就是金钱
The education level represents the income.
18.今天度过的一天明天就找不回来了
One day, has not been able again to come.
19.即使现在这一瞬间对手的书桌还堆满了书
Even if the present, the match does not stop changes the page.
20.No pains no gains不劳无获
6/20/2008
6/17/2008
TCanvas指令后各个参数的意义
“c1”:名字
"The Cascade example": Title
200: 像素的左起点
10:像素的上起点
700,900:整个画布是700*900的像素
6/16/2008
6/14/2008
root中函数调用问题的解决
void hello(char *name)
{
// print hello name
cout << "hello " << name << endl;
}
void air() //此处名字要跟文件名‘air.C’保持一致
{
Int_t j;
for(j=0;j<5;j++)
{
hello("World!");
}
}
6/12/2008
Filling Histogram with weight
Filling histograms
An histogram is typically filled with statements like:h1->Fill(x);这里的w是weight.
h1->Fill(x,w); fill with weight
h2->Fill(x,y)
h2->Fill(x,y,w)
h3->Fill(x,y,z)
h3->Fill(x,y,z,w)
6/09/2008
6/06/2008
Reset and Debug
gROOT->Reset()
- Calls destructors of all objects created on the stack
- Objects on Heap are not deleted, but pointer variable is disassociated
- .e continue to end of the function
- .c continue to next breakpoint
- .c 45 continue to line 45
- .p print the value of var
- .b 34 sets a break point at line 34
- .db 34 removes the break point at line 34
root commands
Usage: root [-l] [-b] [-n] [-q] [file1.C ... fileN.C]
Options:
-b : run in batch mode without graphics
-n : do not execute logon and logoff macros as specified in .rootrc
-q : exit after processing command line macro files
-l : do not show splash screen
root[0].?
this command will list all the CINT commands
root[1].X [filename]
load [filename] and execute function [filename]
root[2].L [filename]
load [filename]
root[3].ls
ls on current directory
root[4].pwd
list the current directory, canvas, and style.
root [5] TBrowser b
get the information of .root file
useful linux commands
Will uncompress the downloaded file
z means “Gunzip(uncompress) it before extracting, used on file ending in .tar.gz or .tgz”
x means “Extract the contents of the TAR file”
f means “Filename to follow”
v means “Verbose - display contents as it is tarring or extracting”
Open office.org的命令
oobase oodraw oofromtemplate ooweb
oomath 数学公式
oocalc 表格
ooffice 综合
ooimpress PPT
ooo-wrapper
oowriter 文档
Adobe Reader的命令
flyriver@luoyang:~$ acroread
This script is in the
RealPlayer的命令
flyriver@luoyang:~$ realplay
This script is in the /usr/bin/RealPlayer
Evince的命令
flyriver@luoyang:~/Desktop/root_test/test$ evince test.pdf
这个软件适用于以下格式:
- Postscript
- djvu
- tiff
- dvi
6/05/2008
6/04/2008
root 规律总结
- Classes begin with T TTree, TBrowser
- Non-class types end with _t Int_t
- Data members begin with f fTree
- Member functions begin with a capital Loop()
- Constants begin with k kInitialSize kRed
- Static variables begin with g gEnv
- Static data members begin with fg fgTokenClient
root help文件内容
processor. It rather is a portable script language environment which
is close enough to the standard C++.
Note2: Regulary check either of /tmp /usr/tmp /temp /windows/temp directory
and remove temp-files which are accidentally left by cint.
Note3: Cint reads source file on-the-fly from the file system. Do not change
the active source during cint run. Use -C option or C1 command otherwise.
Note4: In source code trace mode, cint sometimes displays extra-characters.
This is harmless. Please ignore.
CINT/ROOT C/C++ interpreter interface.
All commands must be preceded by a . (dot), except
for the evaluation statement { } and the ?.
===========================================================================
> [file] : output redirection to [file]
2> [file] : error redirection to [file]
>& [file] : output&error redirection to [file]
? : help
help : help
/[keyword] : search keyword in help information
Shell: ![shell] : execute shell command
Source: v <[line]>: view source code
V [stack] : view source code in function call stack
t : show function call stack
f [file] : select file to debug
T : turn on/off trace mode for all source
J [stat] : Set warning level [0-5]
A [1|0] : allowing automatic variable on/off
trace
deltrace
Evaluation: p [expr] : evaluate expression (no declaration/loop/condition)
Evaluation: s [expr] : step into expression (no declaration/loop/condition)
Evaluation: S [expr] : step over expression (no declaration/loop/condition)
{[statements]} : evaluate statement (any kind)
x [file] : load [file] and execute function [file](wo extension)
X [file] : load [file] and execute function [file](wo extension)
E <[file]>: open editor and evaluate {statements} in the file
Load/Unload: L [file] : load [file]
La [file] : reload all files loaded after [file]
U [file] : unload [file]
C [1|0] : copy source to $TMPDIR (on/off)
undo : undo previous declarations
lang : local language (EUC,SJIS,EUROPEAN,UNKNOWN)
Monitor: g <[var]> : list global variable
l <[var]> : list local variable
proto <[scope]::>[func] : show function prototype
class <[name]> : show class definition (one level)
Class <[name]> : show class definition (all level)
typedef
function : show interpreted functions
macro : show macro functions
template : show templates
include : show include paths
file : show loaded files
where : show current file position
refcount : reference count control on/off
cover [file] : save trace coverage
return [val] : return undefined symbol value
Run: S : step over function/loop
s : step into function/loop
i : ignore and step over
c <[line]>: continue
f [file] : select file to debug
b [line] : set break point
db [line] : delete break point
a [assert]:
O [0~4] :
Quit:
qqq :
save :
Notes for learning root 06/04/2008
histograms with one float per channel. Maximum precision 7 digits
Quit root (just in case)
root[0]>.q
Display the browser
root[1]>TBrowser b;
C++ 在root中使用时,基本规则不变只是具体的写法有些区别
具体为
第一个字母大写,然后加上"_t"
例如:
int-->Int_t
double-->Double_t
char-->Char_t
which I think it is totally stupid , but anyway , I need to follow their
rules if I want to use it.
6/03/2008
安装 root 的注意事项--亲身体会
1 先下载root 的源文件。
我用的是这个:root_v5.19.04.source.tar.gz
2 解压缩
tar -xvzf root_v5.24.00.source.tar.gz
之后产生了root的文件夹
3 安装
安装路径
set ROOTSYS to the `root' directory:
sh family:
$ export ROOTSYS=/home/flyriver/downloads/root
3.1 $ ./configure --help
3.2 $ ./configure linux //for intel 32 bit machine
( ./configure linuxx8664gcc)// for amd 64 machine
3.3 if gcc is not installed
$sudo apt-get install build-essential,libX11-dev,libxft-dev,xorg-dev
3.4$ make [or, make -j2 for dual CPU machines]
3.5$ make install
4 此时只能在这个文件夹下的目录下运行,若想让root在所有文件夹
下都可以运行,或者你就把文件解压缩/usr/local/bin然后安装,
或者你需要编辑库文件,/etc/ld.so.conf,需要管理员帐号,将
root的lib位置告诉它,也就是添加一行,
include /etc/ld.so.conf.d/*.conf
/usr/lib/atlas
/usr/local/lib
/home/flyriver/downloads/root/lib //此行为后来添加
5 这里还没有完,需要编译ld.so.conf,然后更改才能生效。
具体为在管理员帐号下运行 ldconfig指令
root@luoyang:/home/flyriver# ldconfig
终于,在折腾了三天之后,将root安装在自己的电脑上了,爽!!!!!
*************************************************************
如果上面的方法不起作用,你所需要做的是,编辑
.profile
文件
在
# set PATH so it includes user's private bin if it exists
if [ -d ~/bin ] ; then
PATH=~/bin:"${PATH}"
fi
之后 , 添加
PATH=/home/gyuan/downloads/root/bin:$PATH
export PATH
结束后,log off 然后 login 即可
下面是更详细的
- To add that PATH to every user but root, add the line(s) to /etc/profile
- To add that PATH to root, add those line(s) to /root/.profile
- To add that PATH to a specific user(s), add the line(s) to /home/user/.profile
运行 root的 先行步骤
flyriver@luoyang:~/downloads$ export ROOTSYS=/home/flyriver/downloads/root
flyriver@luoyang:~/downloads$ export PATH=$ROOTSYS/bin:$PATH
flyriver@luoyang:~/downloads$ export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
英文信封的写法
5/30/2008
Keyboard Shortcuts for Bash ( Command Shell for Ubuntu, Debian, Suse, Redhat, Linux, etc)
Ctrl + E Go to the end of the line you are currently typing on
Ctrl + L Clears the Screen, similar to the clear command
Ctrl + U Clears the line before the cursor position. If you are at the end of the line, clears the entire line.
Ctrl + R Let's you search through previously used commands
Ctrl + C Kill whatever you are running
Ctrl + D Exit the current shell
Ctrl + Z Puts whatever you are running into a suspended background process. fg restores it.
Alt + F Move cursor forward one word on the current line
Alt + B Move cursor backward one word on the current line
Tab Auto-complete files and folder names
5/19/2008
编辑双系统电脑的boot 顺序
然后把
title Windows XP
root (hd0,0)
makeactive
chainloader +1
贴到
## ## End Default Options ##
之下,就搞定了!
5/04/2008
4/30/2008
Mathematica中的FindFit命令
mathematica的FindFit指令来估测参数值。
Here is a list of points.
In[1]:=
This finds the values of c and d that give the best linear approximation to points.
In[2]:= |
Out[2]= |


4/27/2008
matlab点的类型
y yellow . point
m magenta 紫红色 o circle
c cyan 蓝绿色 x x-mark
r red + plus
g green - solid
b blue * star
w white : dotted
k black -. dashdot
-- dashed
4/26/2008
Matlab 关系运算符和逻辑运算符
and three logical operators.
*Note that the relational operator == compares two arguments, while = is used to assign a value to a variable.
4/22/2008
4/20/2008
matlab中输出结果到文件的新方法
clear;
fid=fopen('answers.txt','w');
fprintf(fid,'My Name is Qiaofeng, I am from China. \r\n');
fprintf(fid,'I travelled a lot. \r\n');
for i=1:3
j=3*i;
fprintf(fid,'When I was %u years old, I went to City %u . \r\n',j,i);
end
status=fclose(fid);
输出
My Name is Qiaofeng, I am from China.
I travelled a lot.
When I was 3 years old, I went to City 1 .
When I was 6 years old, I went to City 2 .
When I was 9 years old, I went to City 3 .
(zz)
"\r"指的是“回车”符号,即回到本行的开头,
"\n"指的是“换行”符号,即开始新的一行,
根据我的使用经验,在fprintf函数中两者结合使用,
才能达到在新的一行的开头开始打印的目的。
附:matlab输出格式,(from www.mathworks.com)
%6.2f表示输出数字小数点左六位,右两位
例2:
n =
984.1240
fprintf(myfid,'n= %6.1f\r\n n=%2.6f\r\n')
输出如下
n= 984.1
n=984.124000
| Character | Description | Example |
|---|---|---|
| Field width | A string specifying the minimum number of characters to be printed. This includes a plus or minus sign, any leading zeros, numeric digits, and decimal point. | %6f |
| Precision | A string including a period (.) specifying the number of digits to be printed to the right of the decimal point | %6.2f |
Conversion Characters
Conversion characters specify the notation of the output.| Specifier | Description |
|---|---|
| %c | Single character |
| %d | Decimal notation (signed) |
| %e | Exponential notation (using a lowercase e as in 3.1415e+00) |
| %E | Exponential notation (using an uppercase E as in 3.1415E+00) |
| %f | Fixed-point notation |
| %g | The more compact of %e or %f, as defined in [2]. Insignificant zeros do not print. |
| %G | Same as %g, but using an uppercase E |
| %o | Octal notation (unsigned) |
| %s | String of characters |
| %u | Decimal notation (unsigned) |
| %x | Hexadecimal notation (using lowercase letters a–f) |
| %X | Hexadecimal notation (using uppercase letters A–F) |
Escape Characters
This table lists the escape character sequences you use to specify non-printing characters in a format specification.
| Character | Description |
|---|---|
| \b | Backspace |
| \f | Form feed |
| \n | New line |
| \r | Carriage return |
| \t | Horizontal tab |
| \\ | Backslash |
| \'' (two single quotes) | Single quotation mark |
| %% | Percent character |
4/10/2008
physics trainning
Prof. Steve Hsu
University of Oregon
3/27/2008
矩阵的转置共轭就是厄米变换
where the subscripts denote the i,j-th entry, for 1 ≤ i ≤ n and 1 ≤ j ≤ m, and the overbar denotes a scalar complex conjugate. (The complex conjugate of a + bi, where a and b are reals, is a − bi.)
This definition can also be written as
where denotes the transpose and
denotes the matrix with complex conjugated entries.
Other names for the conjugate transpose of a matrix are Hermitian conjugate, or transjugate. The conjugate transpose of a matrix A can be denoted by any of these symbols:
or
, commonly used in linear algebra
, universally used in quantum mechanics
3/26/2008
matlab中画图技巧
matlab中解析解和数值解一起求
然后将参数赋值,用eval 指令将其数值解求出。
例子
%hw6prob3
clear;
syms gamma omega delta;
diary hw6prob3.txt;
A1=[-gamma, i*omega,-i*omega,0;i*omega,-(gamma/2+i*delta),0,-i*omega;-i*omega,0,-(gamma/2-i*delta),i*omega;1,0,0,1],
B=[0;0;0;1],
X1=A1\B;
fprintf('The analytical solution for this linear equation is: \n ');
X1,
gamma=1;
omega=2;
delta=0;
fprintf('The numerical solution for this linear equation is: \n ');
X2=eval(X1),
diary off;
matlab中semicolon(分号)的巨大作用
如果需要显示的话,不要加分号
In many cases, there is no need to see the value of a variable every single time Matlab uses it. If Matlab re-computes the value of a variable 1000 times, we probably don't want to see the result every single time. To surpress the output of a value, just add a semi colon after the variable. Then Matlab will perform the command, but will not show it on the screen.
不需要显示中间过程的话,加上分号.
例子
%solve linear equations
clear;
diary hw6prob2.txt;
fprintf('This just shows 5*5 matrix but 100*100 is basically the same.\n');
fprintf('The result for 100*100 matrix is just too large to show on one paper.\n');
N=5;
for j=1:N,
for i=1:N,
A(i,j) = 1/(i+j-1);//这里需要加上分号,这样可以不显示中间过程
end
end
for n=1:N;
B(n,1)=1/n;
end
A, //这里需要显示结果,所以不能加分号
B,
X=A\B;
fprintf('The solution for this linear equation is: \n ');
X,
diary off;
3/25/2008
matlab中输出结果到文件
%solve linear equations
diary hw6prob1.txt;
clear;
A=[4,-2,1;3,6,-4;2,1,8];
B=[20;-30;40];
Y=inv(A);
X=Y*B;
fprintf('The answers is: \n ');
X,
The
Y,
diary off;
红色的是关键所在,这两个命令之后,中间输出的X, Y就保存在hw6prob1.txt 。
请看输出结果
The answers is:
X =
2.3194
-2.9658
4.7909
Y =
0.1977 0.0646 0.0076
-0.1217 0.1141 0.0722
-0.0342 -0.0304 0.1141
