Tuesday, 12 June 2007

An A-Z Index of the Linux BASH command line

alias    Create an alias
apropos Search Help manual pages (man -k)
awk Find and Replace text, database sort/validate/index
break Exit from a loop
builtin Run a shell builtin
bzip2 Compress or decompress named file(s)

cal Display a calendar
case Conditionally perform a command
cat Display the contents of a file
cd Change Directory
cfdisk Partition table manipulator for Linux
chgrp Change group ownership
chmod Change access permissions
chown Change file owner and group
chroot Run a command with a different root directory
cksum Print CRC checksum and byte counts
clear Clear terminal screen
cmp Compare two files
comm Compare two sorted files line by line
command Run a command - ignoring shell functions
continue Resume the next iteration of a loop
cp Copy one or more files to another location
cron Daemon to execute scheduled commands
crontab Schedule a command to run at a later time
csplit Split a file into context-determined pieces
cut Divide a file into several parts

date Display or change the date & time
dc Desk Calculator
dd Data Dump - Convert and copy a file
declare Declare variables and give them attributes
df Display free disk space
diff Display the differences between two files
diff3 Show differences among three files
dig DNS lookup
dir Briefly list directory contents
dircolors Colour setup for `ls'
dirname Convert a full pathname to just a path
dirs Display list of remembered directories
du Estimate file space usage

echo Display message on screen
egrep Search file(s) for lines that match an extended expression
eject Eject removable media
enable Enable and disable builtin shell commands
env Environment variables
ethtool Ethernet card settings
eval Evaluate several commands/arguments
exec Execute a command
exit Exit the shell
expand Convert tabs to spaces
export Set an environment variable
expr Evaluate expressions

false Do nothing, unsuccessfully
fdformat Low-level format a floppy disk
fdisk Partition table manipulator for Linux
fgrep Search file(s) for lines that match a fixed string
file Determine file type
find Search for files that meet a desired criteria
fmt Reformat paragraph text
fold Wrap text to fit a specified width.
for Expand words, and execute commands
format Format disks or tapes
free Display memory usage
fsck File system consistency check and repair
ftp File Transfer Protocol
function Define Function Macros

gawk Find and Replace text within file(s)
getopts Parse positional parameters
grep Search file(s) for lines that match a given pattern
groups Print group names a user is in
gzip Compress or decompress named file(s)

hash Remember the full pathname of a name argument
head Output the first part of file(s)
history Command History
hostname Print or set system name

id Print user and group id's
if Conditionally perform a command
ifconfig Configure a network interface
import Capture an X server screen and save the image to file
install Copy files and set attributes

join Join lines on a common field

kill Stop a process from running

less Display output one screen at a time
let Perform arithmetic on shell variables
ln Make links between files
local Create variables
locate Find files
logname Print current login name
logout Exit a login shell
look Display lines beginning with a given string
lpc Line printer control program
lpr Off line print
lprint Print a file
lprintd Abort a print job
lprintq List the print queue
lprm Remove jobs from the print queue
ls List information about file(s)
lsof List open files

make Recompile a group of programs
man Help manual
mkdir Create new folder(s)
mkfifo Make FIFOs (named pipes)
mkisofs Create an hybrid ISO9660/JOLIET/HFS filesystem
mknod Make block or character special files
more Display output one screen at a time
mount Mount a file system
mtools Manipulate MS-DOS files
mv Move or rename files or directories

netstat Networking information
nice Set the priority of a command or job
nl Number lines and write files
nohup Run a command immune to hangups
nslookup Query Internet name servers interactively

passwd Modify a user password
paste Merge lines of files
pathchk Check file name portability
ping Test a network connection
popd Restore the previous value of the current directory
pr Prepare files for printing
printcap Printer capability database
printenv Print environment variables
printf Format and print data
ps Process status
pushd Save and then change the current directory
pwd Print Working Directory

quota Display disk usage and limits
quotacheck Scan a file system for disk usage
quotactl Set disk quotas

ram ram disk device
rcp Copy files between two machines.
read read a line from standard input
readonly Mark variables/functions as readonly
remsync Synchronize remote files via email
return Exit a shell function
rm Remove files
rmdir Remove folder(s)
rsync Remote file copy (Synchronize file trees)

screen Terminal window manager
scp Secure copy (remote file copy)
sdiff Merge two files interactively
sed Stream Editor
select Accept keyboard input
seq Print numeric sequences
set Manipulate shell variables and functions
sftp Secure File Transfer Program
shift Shift positional parameters
shopt Shell Options
shutdown Shutdown or restart linux
sleep Delay for a specified time
sort Sort text files
source Run commands from a file `.'
split Split a file into fixed-size pieces
ssh Secure Shell client (remote login program)
strace Trace system calls and signals
su Substitute user identity
sum Print a checksum for a file
symlink Make a new name for a file
sync Synchronize data on disk with memory

tail Output the last part of files
tar Tape ARchiver
tee Redirect output to multiple files
test Evaluate a conditional expression
time Measure Program running time
times User and system times
touch Change file timestamps
top List processes running on the system
traceroute Trace Route to Host
trap Run a command when a signal is set(bourne)
tr Translate, squeeze, and/or delete characters
true Do nothing, successfully
tsort Topological sort
tty Print filename of terminal on stdin
type Describe a command

ulimit Limit user resources
umask Users file creation mask
umount Unmount a device
unalias Remove an alias
uname Print system information
unexpand Convert spaces to tabs
uniq Uniquify files
units Convert units from one scale to another
unset Remove variable or function names
unshar Unpack shell archive scripts
until Execute commands (until error)
useradd Create new user account
usermod Modify user account
users List users currently logged in
uuencode Encode a binary file
uudecode Decode a file created by uuencode

v Verbosely list directory contents (`ls -l -b')
vdir Verbosely list directory contents (`ls -l -b')
vi Text Editor

watch Execute/display a program periodically
wc Print byte, word, and line counts
whereis Report all known instances of a command
which Locate a program file in the user's path.
while Execute commands
who Print all usernames currently logged in
whoami Print the current user id and name (`id -un')
Wget Retrieve web pages or files via HTTP, HTTPS or FTP

xargs Execute utility, passing constructed argument list(s)
yes Print a string until interrupted

.period Run commands from a file
### Comment / Remark

Full List of Linux Man pages (SGI)
Links to other Sites, Books etc...

从CPU的技术参数认识CPU

CPU是PC的核心所在,在以下的文章里面我们从几个与CPU相关的性能参数谈起,使读者初步对CPU有个全面的了解,这样将有助于加深读者对PC的了解。

  1.CPU的内部结构与工作原理

   CPU是Central Processing Unit--中央处理器的缩写,它由运算器和控制器组成,CPU的内部结构可分为控制单元,逻辑单元和存储单元三大部分。CPU的工作原理就象一个工厂对 产品的加工过程:进入工厂的原料(指令),经过物资分配部门(控制单元)的调度分配,被送往生产线(逻辑运算单元),生产出成品(处理后的数据)后,再存 储在仓库(存储器)中,最后等着拿到市场上去卖(交由应用程序使用)。

  2.CPU的相关技术参数

   (1)主频

   主频也叫时钟频率,单位是MHz,用来表示CPU的运算速度。CPU的主频=外频×倍频系数。很多人以为认为CPU的主频指的是CPU运行的速度,实际上 这个认识是很片面的。CPU的主频表示在CPU内数字脉冲信号震荡的速度,与CPU实际的运算能力是没有直接关系的。当然,主频和实际的运算速度是有关 的,但是目前还没有一个确定的公式能够实现两者之间的数值关系,而且CPU的运算速度还要看CPU的流水线的各方面的性能指标。由于主频并不直接代表运算 速度,所以在一定情况下,很可能会出现主频较高的CPU实际运算速度较低的现象。因此主频仅仅是CPU性能表现的一个方面,而不代表CPU的整体性能。

   (2)外频

  外频是CPU的基准频率,单位也是MHz。外频是CPU与主板之间同步运行的速度,而且目前的绝大部分电脑系统中外频也是内存与主板之间的同步 运行的速度,在这种方式下,可以理解为CPU的外频直接与内存相连通,实现两者间的同步运行状态。外频与前端总线(FSB)频率很容易被混为一谈,下面的 前端总线介绍我们谈谈两者的区别。

   (3)前端总线(FSB)频率

  前端总线(FSB)频率(即总线频率)是直接影响CPU与内存直接数据交换速度。由于数据传输最大带宽取决于所有同时传输的数据的宽度和传输频 率,即数据带宽=(总线频率×数据带宽)/8。外频与前端总线(FSB)频率的区别:前端总线的速度指的是数据传输的速度,外频是CPU与主板之间同步运 行的速度。也就是说,100MHz外频特指数字脉冲信号在每秒钟震荡一千万次;而100MHz前端总线指的是每秒钟CPU可接受的数据传输量是 100MHz×64bit÷8Byte/bit=800MB/s。

   (4)倍频系数

  倍频系数是指CPU主频与外频之间的相对比例关系。在相同的外频下,倍频越高CPU的频率也越高。但实际上,在相同外频的前提下,高倍频的 CPU本身意义并不大。这是因为CPU与系统之间数据传输速度是有限的,一味追求高倍频而得到高主频的CPU就会出现明显的“瓶颈”效应——CPU从系统 中得到数据的极限速度不能够满足CPU运算的速度。

   (5)缓存

  缓存是指可以进行高速数据交换的存储器,它先于内存与CPU交换数据,因此速度很快。L1Cache(一级缓存)是CPU第一层高速缓存。内置 的L1高速缓存的容量和结构对CPU的性能影响较大,不过高速缓冲存储器均由静态RAM组成,结构较复杂,在CPU管芯面积不能太大的情况下,L1级高速 缓存的容量不可能做得太大。一般L1缓存的容量通常在32~256KB.

  L2Cache(二级缓存)是CPU的第二层高速缓存,分内部和外部两种芯片。内部的芯片二级缓存运行速度与主频详图,而外部的二级缓存则只有 主频的一半。L2高速缓存容量也会影响CPU的性能,原则是越大越好,现在家庭用CPU容量最大的是512KB,而服务器和工作站上用CPU的L2高速缓 存更高达1MB-3MB。

   (6)CPU扩展指令集

  CPU扩展指令集指的是CPU增加的多媒体或者是3D处理指令,这些扩展指令可以提高CPU处理多媒体和3D图形的能力。著名的有MMX(多媒体扩展指令)、SSE(因特网数据流单指令扩展)和3DNow!指令集。

   (7)CPU内核和I/O工作电压

  从586CPU开始,CPU的工作电压分为内核电压和I/O电压两种。其中内核电压的大小是根据CPU的生产工艺而定,一般制作工艺越小,内核工作电压越低;I/O电压一般都在1.6~3V。低电压能解决耗电过大和发热过高的问题。

   (8)制造工艺

  指在硅材料上生产CPU时内部各元器材的连接线宽度,一般用微米表示。微米值越小制作工艺越先进,CPU可以达到的频率越高,集成的晶体管就可以更多。目前Intel的P4和AMD的XP都已经达到了0.13微米的制造工艺,明年将达到0.09微米的制作工艺。

  从上面我们了解了CPU的逻辑结构以及一些基本技术参数,本文将继续全面的了解影响CPU性能的有关技术参数。

  上图是用WCPUID测试CPU得出的关于某款CPU的各种参数。我们可以看到这款CPU的信息:

  第一部分为处理器的类型,其中Processor(处理器)为AMD Athlon XP CPU;Platform(封裝)是Scoket 462插脚;Vendor String(厂商)为AMD;Family、Model、Stepping ID组成系列号,可以用来识别CPU的型号;Name String(名称)为AMD的Athlon系列CPU。

  第二部分为处理器的频率参数。其中Internal Clock即CPU的主频,可以看到这款CPU的主频为2280.30MHz,即2.2G;System Bus即前端总线,这款CPU的外频为350MHz,并非标准的前端总线,因此是超了外频的CPU;System Clock即外频,即为175MHz,是超了外频的CPU;Multiplier即倍频,这款CPU的倍频为13。

  第三部分为处理器的缓存情况。L1 I-Cache:L1 I-缓存,这款CPU为64k;L1 D-Cache:L1 D-缓存,同样为64K;L2 Cache:L2快取,这款CPU的L2缓存达到512K;L2 Speed:L2速度,和CPU的主频一样。

  第四部分为处理器所支持的多媒体扩展指令集,可以看到这款CPU所支持的指令集有MMX、MMX+、SSE、3DNOW!、3DNOW!+,但是不支持SSE2指令。

  1.指令集

  (1) X86指令集要知道什么是指令集还要从当今的X86架构的CPU说起。X86指令集是Intel为其第一块16位CPU(i8086)专门开发的, IBM1981年推出的世界第一台PC机中的CPU—i8088(i8086简化版)使用的也是X86指令,同时电脑中为提高浮点数据处理能力而增加的 X87芯片系列数学协处理器则另外使用X87指令,以后就将X86指令集和X87指令集统称为X86指令集。虽然随着CPU技术的不断发展,Intel陆 续研制出更新型的i80386、i80486直到今天的PentiumⅢ(以下简为PⅢ)系列,但为了保证电脑能继续运行以往开发的各类应用程序以保护和 继承丰富的软件资源,所以Intel公司所生产的所有CPU仍然继续使用X86指令集,所以它的CPU仍属于X86系列。由于Intel X86系列及其兼容CPU都使用X86指令集,所以就形成了今天庞大的X86系列及兼容CPU阵容。

  (2) RISC指令集RISC指令集是以后高性能CPU的发展方向。它与传统的CISC(复杂指令集)相对。相比而言,RISC的指令格式统一,种类比较少,寻址方式也比复杂指令集少。当然处理速度就提高很多了。而且RISC指令集还兼容原来的X86指令集。

  2.字长

  电脑技术中对CPU在单位时间内(同一时间)能一次处理的二进制数的位数叫字长。所以能处理字长为8位数据的CPU通常就叫8位的CPU。同理 32位的CPU就能在单位时间内处理字长为32位的二进制数据。当前的CPU都是32位的CPU,但是字长的最佳是CPU发展的一个趋势。AMD未来将推 出64位的CPU-Atlon64。未来必然是64位CPU的天下。

  3.IA-32、IA-64架构

  IA是Intel Architecture(英特尔体系结构)的英语缩写,IA-32或IA-64是指符合英特尔结构字长为32或64位的CPU,其他公司所生产的与 Intel产品相兼容的CPU也包括在这一范畴。当前市场上所有的X86系列CPU仍属IA-32架构。AMD即将推出Athlon64是IA-64架构 的CPU。

  4.流水线与超流水线

  流水线(pipeline)是Intel首次在486芯片中开始使用的。流水线的工作方式就象工业生产上的装配流水线。在CPU中由5~6个不 同功能的电路单元组成一条指令处理流水线,然后将一条X86指令分成5~6步后再由这些电路单元分别执行,这样就能实现在一个CPU时钟周期完成一条指 令,因此提高CPU的运算速度。超流水线(superpiplined)是指某型CPU内部的流水线超过通常的5~6步以上,例如Pentium pro的流水线就长达14步。将流水线设计的步(级)其完成一条指令的速度越快,因此才能适应工作主频更高的CPU。但是流水线过长也带来了一定副作用, 很可能会出现主频较高的CPU实际运算速度较低的现象,Intel的奔腾4就出现了这种情况,虽然它的主频可以高达1.4G以上,但其运算性能却远远比不 上AMD 1.2G的速龙甚至奔腾III。

  5.封装形式

  CPU封装是采用特定的材料将CPU芯片或CPU模块固化在其中以防损坏的保护措施,一般必须在封装后CPU才能交付用户使用。CPU的封装方 式取决于CPU安装形式和器件集成设计,从大的分类来看通常采用Socket插座进行安装的CPU使用PGA(栅格阵列)方式封装,而采用Slot x槽安装的CPU则全部采用SEC(单边接插盒)的形式封装。现在还有PLGA(Plastic Land Grid Array)、OLGA(Organic Land Grid Array)等封装技术。由于市场竞争日益激烈,目前CPU封装技术的发展方向以节约成本为主。

Monday, 11 June 2007

issues in "make"

Issues
:
checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details

××××××××××××××××××××××××××

ah it was caused by the recent binutils update! There has been a new binutils update put out today (2.15-5ubuntu2.2) which has fixed the problem. *whew*.
-------------------
Set the CC vble

$export CC=gcc

Jorge
Ushuaia Argentina
-------------------
WORKED
:
I had the same problem as you guys, and tried some of the hints you mentioned, but none worked...

But after installing build-essential (apt-get install build-essential) everything worked fine

zemax - 旋转 2

In the SURFACE PROPERTIES, the 2nd option "MAKE SURFACE GLOBAL COORDINATE REFERENCE" determines which surface is the tilting "axis", which doesn't rotate while others do relatively.

Saturday, 9 June 2007

jsp+mysql server setting

1.java-sdk
2.tomcat
3.mysql
4.mysql driver for jdbc: just copy the mysql*.bin.jar to /tomcat/lib 即可。
以防万一,有些程序特殊要求,在1,2,3所有lib文件夹里都放一个,jre/lib/ext/和jsp所在folder里的WEB-INF/lib/也放一个。

vista 硬盘安装

事先准备:装好xp系统的电脑一台,vista安装iso。

  注:

  (1)Windows Vista要求安装在NTFS分区,但是其他分区可以是FAT32格式!

  (2)简单无损NTFS转换方式:运行cmd进入命令行模式,运行convert x: /fs:ntfs即可(x为需要转换分区盘符),其间可能需要重启计算机。注:该命令可以无损将FAT分区转换为NTFS分区,该过程不可逆!若对分区中 没有有用数据,直接在XP下格式化为NTFS分区也能达到目的!

  (3)建议安装系统分区至少15GB。(我安完VISTA以后,系统区占用6GB。)

  想不损失硬盘中已有数据的前提下对硬盘进行重新分区,用PartitionMagic Portable V8.05 汉化绿色版。

一、Windows Vista系统安装准备

1、把vista.iso用虚拟光驱加载,然后拷贝到硬盘中,我的是f:\vista。(用的虚拟光驱是 DAEMON Tools V4.0.8 X64 and X86 [1120]简体中文版)

2、把f:\VISTA目录下的bootmgr和boot目录(其实只要里面的boot.sdi和bcd文件)拷贝到c盘根目录下,并在C盘根目录下建个sources文件夹。

3、把f:\vista\sources下的boot.win复制到C盘下sourse文件夹。

4、运行cmd-c:\boot\bootsect.exe /nt60 c: (注意,此处bootsect在c:\boot目录下)

二、Windows Vista安装

5、重启计算机,正在启动安装程序,加载boot.wim,启动PE环境。这个过程可能比较长,请等待……

6、安装程序启动,选择你要安装的语言类型,同时选择适合自己的时间和货币显示种类及键盘和输入方式。

7、出现“开始安装界面”,(要注意了,不点击“现在安装”)点左下角“修复计算机”(repair my computer)。

8、进入“系统恢复选项”,选择最后一项“命令提示符”(command prompt),进入DOS窗口。

9、执行格式化命令format c:/q(注:如C盘是FAT32格式,想转NTFS格式的话,执行format c:/fs:ntfs)。

10、安装系统,执行f:\vista\sources\setup.exe,底下就是正常的安装了。

Vista Services Registry Files

Have you messed up your services and want to get back to factory spec? Or do you want a way to play around with various configurations and be able to undo them if it doesn't work out? Well, look no further! Here are the default configuration Service configuration files for all versions of Vista, as well as files for the other configurations I display.

Try out the new Registry File Generator. Just select the services you want to set, and it will generate a .reg file for you (save it as a .reg when it generates).



Default Settings


Windows Vista Home Basic reg bat
Windows Vista Home Premium reg bat
Windows Vista Business reg bat
Windows Vista Ultimate reg bat

Tweaked Settings


These are currently in the works, and are use at your own risk
Windows Vista 'Safe' Settings reg bat - Use at your own risk. I've tried to weed out services that are obviously unnecessary to give you a good starting point to tweaking for your own needs/preference. Please e-mail me any problems, etc.

Windows Vista Tweaked Settings reg bat- Use at your own risk. Works for me for internet, Windows Update, DVD playing, most other things I want to do. May cause some software, etc. to stop working, but I would like to hope not. Please send me feedback on this file as well as safe if you have any issues running them. It assumes that you have your own Firewall software and Spyware software.

Windows Vista Minimal Settings reg bat - Use at your own risk. Works for me for internet, Windows Update, DVD playing, most other things I want to do. May cause some software, etc. to stop working, but I would like to hope not. Please send me feedback on this file as well as safe if you have any issues running them. It assumes that you have your own Firewall software and Spyware software.

Disclaimer: Use this site at your own risk. I am not responsible for damage to your computer, or anything else.



Note: When you run the Registry file, you may get a note saying "Some keys are open by the system or other processes." Some processes are not settable by running Registry scripts, even in safe mode. It is a bit of a pain, but all other services are set properly.


Thanks to kickarse and estcstsurfer for batch file suggestions.

Friday, 8 June 2007

apt-get的list

apt-cache search ***和yum list ***一样.
Or
aptitude search ***

linux下的index searching

beagle:
Novell的产品,开始于suse。
Ubuntu,只是apt-get install beagle即可搞定,beagle图表在右上角出现,可以方便设置index的folders和查询。
fedora,目前为止发现比较好的UI是kerry,和ubuntu下类似很方便,需要安装kde,而且kerry不是开始就运行.这也无妨,它只是一个界面,beagle在后台运行,terminal里beagle-query来查询.

index产生的文件在~/.beagle下.beagle在root用户下不工作。

From ubuntu 7.10/gnome 2.20,tracker is embedded within Gnome.
And striki is in KDE.

Wednesday, 6 June 2007

右键里面添加一个“打开终端”的菜单

UBUNTU:

sudo apt-get install nautilus-open-terminal

Fedora:

yum -y install nautilus-open-terminal


或者一段script,但是是右键加入一个文件夹菜单
-------------------------------------------------------------------------
#!/bin/bash
#
# This script opens a gnome-terminal in the directory you select.
#
# Distributed under the terms of GNU GPL version 2 or later
#
# Install in ~/.gnome2/nautilus-scripts or ~/Nautilus/scripts
# You need to be running Nautilus 1.0.3+ to use scripts.

# When a directory is selected, go there. Otherwise go to current
# directory. If more than one directory is selected, show error.
if [ -n "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" ]; then
set $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
if [ $# -eq 1 ]; then
destination="$1"
# Go to file's directory if it's a file
if [ ! -d "$destination" ]; then
destination="`dirname "$destination"`"
fi
else
zenity --error --title="Error - Open terminal here" \
--text="You can only select one directory."
exit 1
fi
else
destination="`echo "$NAUTILUS_SCRIPT_CURRENT_URI" sed 's/^file:\/\///'`"
fi

# It's only possible to go to local directories
if [ -n "`echo "$destination" grep '^[a-zA-Z0-9]\+:'`" ]; then
zenity --error --title="Error - Open terminal here" \
--text="Only local directories can be used."
exit 1
fi

cd "$destination"
exec x-terminal-emulator

Tuesday, 5 June 2007

软硬链接ln

命令:ln

说明 : Unix文件系 统中,所谓的连接(link),也就是文件的别名。连接分为两种:硬连接(hard link)与软连接(symbolic link),硬连接的意思是 一个文件可以有多个名称,而软连接的方式则是产生一个特殊的文件,该文件的内容是指向另一个文件的位置。硬连接是存在同一个文件系统中,而软连接却可以跨 越不同的文件系统。

参数:

-f : 创建连接时先将同名文件删除

-d : 允许系统管理员硬连接自己的目录

-i : 在删除同名文件时先进行询问

-n : 在进行软连接时,将连接视为一般的文件

-s : 进行软连接(symbolic link)

-v : 在连接之前显示其文件名

-b : 将在连接时会被覆写或删除的文件进行备份

-S SUFFIX : 将备份的文件都加上 SUFFIX 的字尾

-V METHOD : 指定备份的方式

-help : 显示辅助说明

-version : 显示版本

例:

将文件 yy 产生一个软连接(symbolic link)zz

# ln -s yy zz

将文件yy 产生一个硬连接(hard link)zz:

# ln yy xx

Pasted from <http://www.xxlinux.com/linux/article/unix/rumen/2006-06-25/2114.html>

要讲清楚这两个的区别,首先要明白unix系统当中文件的存储。unix文件当中文件的存储可以分为三部分:

1、 文件名 file name;

2、 我们称之为inode, 里面存储了此文件的属性,包括文件大小、所有者、以及访问权限等等。

3、 数据块 DATA;

以一个例子讲:

目标文件名称 /opt/public.c 要建立的软连接的名称为a , 建立的硬连接的名称为b。

此时/opt/public.c 文件的存储为: 1、文件名称 public.c 2、inode 为1233

3、数据块为文件的数据块。

那此时软连接a的存储为: 1、 文件名称:a 2、inode为 1423(系统分配值) 3、数据块数据为:/opt/public.c

而硬连接b的存储为: 1、 文件名称:b 2、inode为1233 3、数据块为文件的数据块。

从上面我们知道软连接 有自己的inode 和数据块,他的数据块当中的内容为所要连接的文件的绝对或者相对路径。而硬连接和他所要连接的文件共有同一个inode 和数据块。

这两个连接不同之处主要体现在访问权限上,建立的软连接的访问权限是777,但是这不是他的实际访问权限,他的实际访问权限还是以它所连接的文件的访问权 限为准。而硬连接建立的时候的访问权限就是它所连接的访问权限,因为他们共用一个inode,而inode当中所存储的就是此文件的访问权限。

需要补充的是,软连接可以跨文件系统,而硬连接不能跨文件系统。

看一个文件或者目录的硬连接数量可用ls -al

drwxr-xr-x 10 jlivr other 512 Jun 9 16:23 .

drwxrwxr-x 13 root sys 512 Apr 11 15:17 ..

-rw------- 1 jlivr other 3442 Jun 9 16:21 .bash_history

-rw-r--r-- 1 jlivr other 1039 May 11 17:04 .profile

drwxr-xr-x 2 jlivr other 512 Apr 26 15:58 bin

drwxr-xr-x 3 jlivr other 1024 Apr 26 15:51 inc

drwxr-xr-x 2 jlivr other 512 Apr 26 15:51 lib

drwxr-xr-x 8 jlivr other 512 Jun 6 17:18 mex

drwxr-xr-x 2 jlivr other 1024 May 20 12:21 new_voice

drwxr-xr-x 2 jlivr other 512 May 23 01:06 obj

访问权限与文件所有者当中有个数字, 代表的就是此文件或者目录的硬连接数量。

Pasted from <http://my.opera.com/abf/blog/unix>

VMware网络设置总结

1)bridge:必须有同网络内的另外一个可用IP地址。一般企业内局域网内不容易得到另外一个ip。
主机无须设置。
2)host-only:设置虚拟机内的网卡与vmnet1同网段,不同地址就ok,gateway和dns都设成vmnet1的网址即可。
主机的vmnet无须填写gateway和dns。
但是不能同时让多个虚拟机同时访问网络。
3)NAT: 只要把虚拟机射程dhcp,什么都不用做。任意多个虚拟机,可以全部同时上网。
主机无须设置(默认)。

shell --Bash 快速查找历史ctrl+r

bash下面按ctrl+r可以查找历史命令中匹配的命令并执行。比如我在前面执行了一个smbmount的命令,如果想重新执行,按上下键查找有时候并不是一个好的选择,这时可以按ctrl+r,然后输入smbmount,bash会帮你找到最近的一条接近smbmount的命令,找到后按回车直接就执行了。

ubuntu安装rpm

1. apt一个alien
2. alien --to-deb *****.rpm
3. 安装(双击执行/dpkg -i *****.deb

Sometimes this doesn't work well. For example, pidgin***.rpm can be installed, but you can not find the executable program in application menu, while stardict***.rpm works well.

Sunday, 3 June 2007

redhat Display Management

Okay, all important system-wide settings in RH and RH-derived boxen are found in /etc/sysconfig, and possibly some stuff in /etc/X11/ or the /etc/init.d tree. So here we go.

Code:
[root@goldfedora sysconfig]# grep GNOME *
desktop:DESKTOP="GNOME"


A quick edit later:

Code:
[root@goldfedora sysconfig]# grep GNOME *
desktop:DESKTOP="KDE"


Now to go after KDM

Code:
[root@goldfedora sysconfig]# cd /etc/X11
[root@goldfedora X11]# find . -type f -exec grep -H gdm {} \;
./prefdm: preferred=gdm
. . .


Okay, so /etc/X11/prefdm looks like a good starting point. Here's the key section in prefdm:

Code:
preferred=
if [ -f /etc/sysconfig/desktop ]; then
. /etc/sysconfig/desktop
if [ "$DISPLAYMANAGER" = GNOME ]; then
preferred=gdm
elif [ "$DISPLAYMANAGER" = KDE ]; then
preferred=kdm
elif [ "$DISPLAYMANAGER" = XDM ]; then
preferred=xdm
fi
fi


It appears that the change in /etc/sysconfig/desktop may effect both changes for us... not quite: That sets $DESKTOP, but not $DISPLAYMANAGER, so let's go back and edit that...

Code:
[root@goldfedora X11]# cd /etc/sysconfig/
[root@goldfedora sysconfig]# vim desktop
. . .
[root@goldfedora sysconfig]# cat desktop
DESKTOP="KDE"
DISPLAYMANAGER="KDE"


Now to test this theory...

KDE installation in Fedora

KDE

The K Desktop Environment (KDE) is a powerful desktop environment. It is available in Fedora as an alternative to the GNOME desktop and other window managers.

Installing KDE

You will have the option of installing KDE during the Fedora installation process.

You can also install KDE packages after installation using yum or the package manager of your choice.

To install KDE using yum, execute the following as root:

  • yum groupinstall "KDE (K Desktop Environment)"

Using KDE

During the default login process, you can use the "Session" menu to choose a KDE login instead of a GNOME login. You will be asked if you wish to make KDE your default desktop.

You can make KDE the system-wide default desktop. This is not necessary in order to use KDE, and may affect other users on the system. To make KDE the default desktop environment, add the following line to /etc/sysconfig/desktop:

  • DESKTOP="KDE"

    If this file already contains a DESKTOP entry, you must replace that entry.

The default display manager on Fedora is GDM - The GNOME Display Manager. You can switch this to KDM - The KDE Display Manager. This has little impact on the end-user experience, and isn't necessary in order to use KDE. To make KDM the default display manager, add the following line to /etc/sysconfig/desktop:

  • DISPLAYMANAGER="KDE"

    If this file already contains a DISPLAYMANAGER entry, you must replace that entry.

Fedora's KDE SIG

The KDE SIG (Special Interest Group) is a group of Fedora contributors that maintain popular KDE packages.

KDE Spin

Fedora 7 will merge core and extras and the broader community will have better access to packages. Fedora 7 plans including a KDE spin.

The KDE spin page describes this proposal's advantages and other details.

Links

find

一、find 命令格式


1、find命令的一般形式为;

find pathname -options [-print -exec -ok ...]


2、find命令的参数;

pathname: find命令所查找的目录路径。例如用.来表示当前目录,用/来表示系统根目录。
-print: find命令将匹配的文件输出到标准输出。
-exec: find命令对匹配的文件执行该参数所给出的shell命令。相应命令的形式为'command' { } \;,注意{ }和\;之间的空格。
-ok: 和-exec的作用相同,只不过以一种更为安全的模式来执行该参数所给出的shell命令,在执行每一个命令之前,都会给出提示,让用户来确定是否执行。


3、find命令选项

-name
按照文件名查找文件。
-perm
按照文件权限来查找文件。
-prune
使用这一选项可以使find命令不在当前指定的目录中查找,如果同时使用-depth选项,那么-prune将被find命令忽略。
-user
按照文件属主来查找文件。
-group
按照文件所属的组来查找文件。
-mtime -n +n
按照文件的更改时间来查找文件, - n表示文件更改时间距现在n天以内,+ n表示文件更改时间距现在n天以前。find命令还有-atime和-ctime 选项,但它们都和-mtime选项相同。
-nogroup
查找无有效所属组的文件,即该文件所属的组在/etc/groups中不存在。
-nouser
查找无有效属主的文件,即该文件的属主在/etc/passwd中不存在。
-newer file1 ! file2
查找更改时间比文件file1新但比文件file2旧的文件。
-type
查找某一类型的文件,诸如:
b - 块设备文件。
d - 目录。
c - 字符设备文件。
p - 管道文件。
l - 符号链接文件。
f - 普通文件。
-size n:[c] 查找文件长度为n块的文件,带有c时表示文件长度以字节计。
-depth:在查找文件时,首先查找当前目录中的文件,然后再在其子目录中查找。
-fstype:查找位于某一类型文件系统中的文件,这些文件系统类型通常可以在配置文件/etc/fstab中找到,该配置文件中包含了本系统中有关文件系统的信息。
-mount:在查找文件时不跨越文件系统mount点。
-follow:如果find命令遇到符号链接文件,就跟踪至链接所指向的文件。
-cpio:对匹配的文件使用cpio命令,将这些文件备份到磁带设备中。

另外,下面三个的区别:

-amin n
  查找系统中最后N分钟访问的文件
  -atime n
  查找系统中最后n*24小时访问的文件
  -cmin n
  查找系统中最后N分钟被改变文件状态的文件
  -ctime n
  查找系统中最后n*24小时被改变文件状态的文件
 -mmin n
  查找系统中最后N分钟被改变文件数据的文件
  -mtime n
  查找系统中最后n*24小时被改变文件数据的文件


4、使用exec或ok来执行shell命令

使用find时,只要把想要的操作写在一个文件里,就可以用exec来配合find查找,很方便的

在有些操作系统中只允许-exec选项执行诸如l s或ls -l这样的命令。大多数用户使用这一选项是为了查找旧文件并删除它们。建议在真正执行rm命令删除文件之前,最好先用ls命令看一下,确认它们是所要删除的文件。

exec选项后面跟随着所要执行的命令或脚本,然后是一对儿{ },一个空格和一个\,最后是一个分号。为了使用exec选项,必须要同时使用print选项。如果验证一下find命令,会发现该命令只输出从当前路径起的相对路径及文件名。

例如:为了用ls -l命令列出所匹配到的文件,可以把ls -l命令放在find命令的-exec选项中

# find . -type f -exec ls -l { } \;
-rw-r--r-- 1 root root 34928 2003-02-25 ./conf/httpd.conf
-rw-r--r-- 1 root root 12959 2003-02-25 ./conf/magic
-rw-r--r-- 1 root root 180 2003-02-25 ./conf.d/README

上面的例子中,find命令匹配到了当前目录下的所有普通文件,并在-exec选项中使用ls -l命令将它们列出。
在/logs目录中查找更改时间在5日以前的文件并删除它们:

$ find logs -type f -mtime +5 -exec rm { } \;

记住:在shell中用任何方式删除文件之前,应当先查看相应的文件,一定要小心!当使用诸如mv或rm命令时,可以使用-exec选项的安全模式。它将在对每个匹配到的文件进行操作之前提示你。

在下面的例子中, find命令在当前目录中查找所有文件名以.LOG结尾、更改时间在5日以上的文件,并删除它们,只不过在删除之前先给出提示。

$ find . -name "*.conf" -mtime +5 -ok rm { } \;
<> ? n

按y键删除文件,按n键不删除。

任何形式的命令都可以在-exec选项中使用。

在下面的例子中我们使用grep命令。find命令首先匹配所有文件名为“ passwd*”的文件,例如passwd、passwd.old、passwd.bak,然后执行grep命令看看在这些文件中是否存在一个sam用户。

# find /etc -name "passwd*" -exec grep "sam" { } \;
sam:x:501:501::/usr/sam:/bin/bash


二、find命令的例子;


1、查找当前用户主目录下的所有文件:

下面两种方法都可以使用

$ find $HOME -print
$ find ~ -print


2、让当前目录中文件属主具有读、写权限,并且文件所属组的用户和其他用户具有读权限的文件;

$ find . -type f -perm 644 -exec ls -l { } \;


3、为了查找系统中所有文件长度为0的普通文件,并列出它们的完整路径;

$ find / -type f -size 0 -exec ls -l { } \;


4、查找/var/logs目录中更改时间在7日以前的普通文件,并在删除之前询问它们;

$ find /var/logs -type f -mtime +7 -ok rm { } \;


5、为了查找系统中所有属于root组的文件;

$find . -group root -exec ls -l { } \;
-rw-r--r-- 1 root root 595 10月 31 01:09 ./fie1


6、find命令将删除当目录中访问时间在7日以来、含有数字后缀的admin.log文件。

该命令只检查三位数字,所以相应文件的后缀不要超过999。先建几个admin.log*的文件 ,才能使用下面这个命令

$ find . -name "admin.log[0-9][0-9][0-9]" -atime -7 -ok
rm { } \;
<> ? n
<> ? n
<> ? n
<> ? n


7、为了查找当前文件系统中的所有目录并排序;

$ find . -type d | sort


8、为了查找系统中所有的rmt磁带设备;

$ find /dev/rmt -print

进入 text command mode

init 3
init 5

if you can not find the command “init",try "whereis init".

init 0 shut down
init 6 restart

Saturday, 2 June 2007

vista安装

==System Restore
==Error Report(in service)-including Startup Recovery Debugging
==关闭一些service/Msconfig(重启后要确认)
==关闭休眠:powercfg -h off/on
==转移My Documents,Desktop
==删除public/help/IME/installer下一些没用的东西
××××××××××××××××××××××
推荐http://www.speedyvista.com的注册表文件

重启network in linux

/etc/init.d/network restart

install vmware-tool for Linux

1.安装c编译器
2.安装kernel-devel
3.检查kernel跟kernel-devel的版本号
4.两个版本号不一致,进行升级
5.再次检查版本号,还不一致,需要重启。
6.install vmare-tool.

Change the Frequency of Your Automatic System Restore Point | ITsVISTA

In a previous tip I showed you how to restore a file, which relies on System Restore. Vista automatically creates a restore point once a day, and also when updates and some software and drivers are installed. If you want to change the once a day to be more or less frequent, it is possible, but will require modifying your registry. I must always mention that incorrectly modifying your registry can cause problems, and could even prevent your machine from functioning all together, so BE CAREFUL!

  1. Open the Start menu and type regedit in the search box.
  2. Choose Regedit from the program list that is found. You'll need to approve UAC if it is enabled.
  3. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore
  4. Doube-click RPGlobalInterval in the right pane.
  5. Change the Base from Hexidecimal to Decimal. This will make entering a value much easier (unless you know hexidecimal, then have at!)
  6. The default value is 86400, which is the number of seconds in 24 hours. Change this value to the number of second you would like between automatic restore points. I'll change mine to 12 hours (43200).
  7. Click OK, close Regedit, you're done!

ReadyBoost in Vista

The other method, and probably more informative but at the same time more confusing, is to look at the performance counters for the ReadyBoost feature. The performance counters can actually tell how often ReadyBoost is being used during the time you are monitoring them. Therefore this can be a useful feature in determining whether or not ReadyBoost is actually being used by Vista.

To access the performance counters you should follow these steps.

  1. Click on the Start button.

  2. Click on Control Panel menu option. When in the Control Panel , change to classic view by clicking on the Classic View option.

  3. Double-click on the Administrative Tools icon.

  4. Double-click on Reliability and Performance Monitor icon.

  5. In the left menu click on the Performance Monitor under the Monitoring Tools category

  6. In the right pane, click on the green + sign () to add new counters.

  7. Under available counters, scroll down till you see ReadyBoost Cache and double-click on it to expand this category.

  8. Select the ReadyBoost Cache counter that you would like to add by left-clicking on it and then clicking on the Add button. A list of the counters with some information as to what they mean is shown in a table below.

  9. Once you have added all the ReadyBoost Cache counters that you would like to monitor, press the OK button.

The various counters that you selected will now be seen in the Performance Monitor. As time goes on you will see the activity occurring in real time for each of these counters.

Available ReadyBoost Performance Counters
ReadyBoost Counter Name
Description
Bytes cached The total amount of uncompressed data currently stored in the cache. If there is data being stored then you know ReadyBoost is being used by Vista.
Cache reads/sec The number of times Vista reads from the cache per second. If you see a lot of cache reads per second then you know Vista ReadyBoost is working. If this occurs often when using your computer it is advised you invest in more physical memory to further increase performance.
Compression ratio The actual size of the data in the cache divided by the uncompressed size of the data in the cache. (actual size of the data in the cache) / (uncompressed size of the data in the cache)
Hit read bytes/sec The number of bytes read from the cache per second. This is a further indication that the ReadyBoost cache is being used by Vista. If a lot of bytes are being read per second you also know that you need more physical memory to truly increase your performance.
Invalidated update buffer blocks/sec The number of blocks in update buffers invalidated per second.
Invalidated update buffer bytes/sec The number of bytes invalidated in update buffers per second.
No-regions reschedules/sec Writes rescheduled due to the lack of regions per second.
No-update-buffers reschedules/sec Writes rescheduled due to the lack of update buffers per second.
Read-Size-Max IOs bailed/sec The number of I/Os not serviced by the cache because the size is bigger than the maximum read size per second.
Sequential IOs bailed/sec The number of I/Os not serviced by the cache due to sequentiality per second.
Total read bytes/sec The number of bytes read from the volume per second.
Total write bytes/sec The number of bytes written to the volume per second.
Updated buffer read bytes/sec The number of read bytes services from the update buffers per second.

For the most part you really only need to monitor the Bytes cached, Cache reads/sec, Hit read bytes/sec, Total read bytes/sec, and Total write bytes/sec counters to get a good indication of the amount of ReadyBoost activity occurring on your computer.

Conclusion

ReadyBoost is a powerful feature that allows you to increase performance on your computer in a cheap and easy manner. Though you will not get the same performance increase that you will receive if you actually installed more physical RAM, this method does provide a quick and cheap manner to boost performance. We also know that if you monitor the ReadyBoost activity in the Vista Performance Monitor we can determine if we truly need to install more physical RAM in order to get the best performance benefit.

As always, if you want to learn more about, or discuss with your peers, this guide and other Vista features, then feel free to ask in our Windows Vista forums.


SuperFetch
既然你知道了Windows XP的Prefetch技术是如何工作的,你就了解了Windows Vista的SuperFetch技术工作原理的70%。作为Windows XP的Prefetch的下一版本,SuperFetch包括了Prefetch的所有功能并做的更多。

首先,SuperFetch克服了Windows XP的Prefetch中的一个大缺点。正如我前面解释的,Prefetch通过导入大部分由内存中一个应用程序或进程需要的文件或数据,所以可以在需要 时更迅速地访问它们。然而,由于这些文件和数据存在于内存中,所以它们受控制虚拟内存的规则支配。换句话说,当其他应用程序需要访问内存,任何预取的数据 会被移出到硬盘上的页面文件中。当再次需要它时,必须将它从页面文件中移回到内存,这当然抵消了性能增强。

SuperFetch更进一步地保证你获得对性能增强的最有效使用。除了构造我前面提到的映射文件之外,SuperFetch还会构造你使用的应用程序的 描述文件,它包括你在何时使用和使用的频率等信息。然后,SuperFetch将跟踪描述文件中的应用程序并且记录任何预取数据在何时被移出到页面文件 中。SuperFetch将监视引起预取数据被移出到页面文件的应用程序描述文件,并且应用程序一完成,它就将预取数据取回到内存中。所以当你转到访问应 用程序,预取数据将在内存中再次可用而且应用程序会快速响应。

扩展存储设备
正如我提到的,Windows操作系统会一直利用虚拟内存,无论在系统中安装了多少物理RAM。我还告诉过你SuperFetch中的一种增强方式是尽可 能快地重新将预取数据从虚拟内存页面文件移回到物理内存中以保证性能增强的连续性。然而,由于页面文件存在于比物理内存响应速度慢的硬盘上,所以 SuperFetch会被让硬盘响应其取回操作所花费的时间所阻碍。

为了改进SuperFetch的取回操作,微软决定利用大容量USB 2.0存储棒/闪存驱动器被广泛应用,相对便宜,非常有效-虽然不像物理内存那样有效,但比硬盘要快得多这一事实。当你向Windows Vista系统插入一个USB 2.0存储棒,SuperFetch能够将任何送到虚拟内存的预取数据重定向到USB驱动器,而不是硬盘上。同样的,当需要将数据取回到内存时,取回操作 将更快。
当你将一个USB 2.0存储棒插入到运行Windows Vista的系统中,你将看到类似于图形A中显示的自动运行对话框。

然后将提示你指定你想分配给SuperFetch的存储空间容量如图所示。正如你看到的,Windows Vista将自动留出建议的空间容量,但是你可以使用滑动条增加空间容量。

vista 内存减肥 -- services

1. Turn Windows Features on or off:只保留Games,Microsoft.net,Remote Differential Compression
2. 控制面板--系统属性--高级--启动故障恢复--写入调试信息选择无;系统失败里面的勾全部取消.
3. 优化服务.关闭不常用的服务.运行--services.msc
详见http://itsvista.com
或者推荐参考http://www.speedyvista.com的注册表文件

@Application Experience 在应用程序启动时为应用程序处理应用程序兼容性缓存请求 大多的程序都可以运行 关闭

@**Background Intelligent Transfer Service 使用空闲网络带宽在后台传送文件。如果该服务被禁用,则依赖于 BITS 的任何应用程序(如 Windows Update 或 MSN Explorer)将无法自动下载程序和其他信息。 为自动升级等提供服务 关闭(自动更新需要)

@Base Filtering Engine 为防火墙和网站筛选提供服务 如果你对VISTA自带的防火墙和对网站都比较熟悉的话 可以关闭

@**automatic==Computer Browser(局域网)
is basing on this service, and some LAN application such as printing need it.
局域网浏览网络邻居。

@Cryptographic Services用于确认 Windows 文件的签名和允许安装新程序 可以关闭
with the importance of security in Vista, this is a service you'll definitely be needing. Cryptographic Services is required for Windows Update and installing signed drivers, among other features of Vista. If you disable this, Vista will automatically set it back to Manual and start the service when needed, so there is little point in disabling it.

@Desktop Window Manager Session Manager 桌面管理 可以关闭
his service controls the Desktop Window Manager (DWM), which is responsible for Aero (transparent windows, etc). Without this service, you won't have Aero effects. DWM consumes a fair amount of RAM which increases with each window you have open (open 30 IE windows and you'll likely exceed 100MB) as well as CPU (mine typically bounces between 0% and 3% every couple seconds, but with a large amount of windows can go much higher). You can temporarily disable this one (and Aero) from a command window with adminstrator rights by typing net stop uxsms (type net start usxms to turn it back on). If you want to save memory and CPU, and are willing to sacrifice the Aero visual effects, you can safely disable this service.

@Diagnostic System Host 诊断系统主机服务启用 Windows 组件的问题检测、故障排除和解决方案 有点像事件查看器 可以关闭

@Distributed Link Tracking Client: 用于局域网更新连接信息,比如在电脑A有个文件,在B做了个连接,如果文件移动了,这个服务将会 更新信息。占用4兆内存,禁用后将无法获得更新信息,不常使用局域网的化,影响不大。

@==manual(default setting)==Distributed Transaction Coordinator
It helps applications communicate with multiple data sources as part of one transaction, acting like a traffic cop to help each request get to the proper source.

@++automatic==DNS Client
The DNSView definition in a new window Client is not specifically required to use the internet. What it does do is try to improve your internet experience. The most basic way it does this is by caching domain name addresses, which speeds up the browsing experience. This service also determines if an IPv4View definition in a new window or IPv6View definition in a new window address would be more appropriate for a domain name. In an enterprise, it can also be useful in letting the network know your PC's domain name, which can simplify finding shared resources. Though it is safe to disable this service, most users will likely end up with slower internet browsing, as well as other minor DNS related issues, so it's best to leave this one on.

@Function Discovery Provider Host(局域网)
寻找,显示局域网电脑。但寻找局域网电脑时,此service会自动加载。
he Function Discovery Provider Host service allows resources to be discovered over the network. One of the more notable resources that depend on this is the Media Center Extender (an XBOX that can play media from your computer), but it can also be used to discover networked cameras, printers, disks, etc. If you are fine with manually setting these items up you may be able to get away with disabling this service, but since the default setting is 'manual', you probably won't save any resources, so you might as well leave it alone.

@Function Discovery Resource Publication(局域网)
对lan无影响。

@++automatic==KtmRm for Distributed Transaction Coordinator
which assures that file and directory actions are handled properly in the event of a crash or failure. If no applications or components of Vista EVER crash, it's probably OK to disable this one, but if you value your data, you'll want to keep it running.

@**Print Spooler 将文件加载到内存供稍后打印 没有打印机的话就关闭(局域网打印机需要)

@++ReadyBoost(如果常把usb stick接在电脑上,建议保留)
  加速Vista的最简便也是最廉价的方式是使用Ready Boost技术,其使用USB闪存来扩充用户计算机的内存。一款1GB的闪存售价最低只有15美元,2GB容量闪存的价格大约稍高于1GB闪存价格的两倍。  怎样才能知道适合自己计算机的闪存容量?ReadyBoost 支持的最小容量是256MB,最大为4GB。微软推荐附加的闪存容量与系统内存的比率为1:1或2.5:1。例如你使用的计算机自带内存容量为 512MB,可以购买512MB至1.25GB存储容量的闪存,配置为1GB内存容量的系统应该使用的闪存容量在1GB至2.5GB之间。
  最难确知的信息是用户购买的USB闪存是否通过了ReadyBoost测试。所以在购买前一定要核实最低需求条件及其它ReadyBoost信息。在购买指定的闪存前,可以先通过网络搜索其信息并确定其是否已经进行过ReadyBoost测试。
  在使用ReadyBoost功能时,首先将闪存插入USB接口中,然后在屏幕上出现的窗口中选择“加速系统”。接下来选择“使用闪存”,之后点击“确定”按钮。在“属性”对话窗口的ReadyBoost标签中,用户即可以遵从Vista的建议空间容量,也可以通过滑动条选择自己认为合适的容量。

@Server 持此计算机通过网络的文件、打印、和命名管道共享。 需要的时候再打开 可以关闭
关闭后局域网,打印activity照旧;当Computer Browser Service is started, 此服务自动start。

@Security Center 监视系统安全设置和配置。 关闭

@Shell Hardware Detection 为自动播放硬件事件提供通知。 比如插U盘的时候的提示 可以关闭

@Tablet PC Input Service 启用 Tablet PC 笔和墨迹功能 可以关闭

@Task Scheduler(if can be stop) 使用户能在此计算机上配置和制定自动任务的日程。 也就是计划任务 关闭

@Telephony
提供电话服务 API (TAPI)支持,以便各程序控制本地计算机上的电话服务设备以及通过 LAN 同样运行该服务的服务器上的设备。设置ADSL连接或其它依赖电话线的网络需要此项目,用路由或不用电话线上网可禁用。

@Themes 为用户提供使用主题管理的经验。 关闭

@WebClient 基于 Windows 的程序能创建、访问和修改基于 Internet 的文件。主要用于WEB服务器 可以关闭
have not found a reason to have this service running. For security reasons, I recommend for this service to be disabled. It seems for web folder, WEB DAV etc. internet programs using local explorer or materials. If some MS products, such as MSN Explorer, Media Player, NetMeeting or Messenger fail to provide a particular function, try to enable this service to see if it is "required" for your configuration.

@Windows Error Reporting Service 允许在程序停止运行或停止响应时报告错误,并允许提供现有解决方案 程序错误报告 关闭

@Windows Update 自动更新 关闭

Friday, 1 June 2007

vista硬盘减肥(blogged)

Windows Vista要占用大量的系统资源,下面的这些方法可以帮助我们减少Vista占用的硬盘空间。Vista之家www.vista123.com)特别提示,users文件夹如果直接在资源管理器里面观看,显示是“用户”,实际上,真实路径还是Users。
-------------------------------------------------------------
休眠 + 临时文件 + 还原点 + superfetch缓存,让c盘越来越大
-------------------------------------------------------------

休眠会把所有当前状态存成一个文件,以保存工作状态,powercfg -h off/on 关闭/打开休眠功能。

  C:\Windows\Web\Wallpaper

  里面是Windows自带墙纸,不需要的可以删除掉,或者转移至其他盘(45.5M)

  C:\Windows\System32\DriverStore\FileRepository

  这个文件夹中是Window自带驱动备份,一般来说都不需要,所以可以删除(1.03G)

  当然了,如果你想直接删除这个文件夹的话,系统会提示你没有权限,所以我们就要获得这个权限。首先在C:\Windows\System32\ DriverStore\FileRepository上点击右键-属性,我们先来获得这个文件夹的所有权,点安全-高级-所有者,接着点编辑-高级其他 用户或组,在输入选择的对象名称里面输入你的用户名,或者点高级-立即查找,选择你的用户名,确定,然后选择替换子容器和对象的所有者,不选择这个的话, 我们就只有这个文件夹的所有权,并没有他的子文件夹和里面的文件的所有权,然后应用-确定,这样我们就拥有了这个文件夹的所有权,因为之前这个文件夹的所 有权是属于System,并不属于我们。再点权限-编辑-添加,把你的用户名填入或者用高级-立即查找,确定,再点击你的用户名-编辑,把完全控制/允许 那个打勾,确定,再把使用可从此对象继承的权限替换所有后代上现有的可继承权限打勾(我靠微软,真TMD复杂,你一句应用到所有子文件夹和文件不就行了 嘛),同前面,这个不打勾你就只有外面那文件夹权限,里面的文件夹还是不能“完全控制”,然后点应用-确定-确定-确定。好了,里面的文件夹,你想怎么删 就怎么删吧。

  C:\Boot

  这个里面是不同语言的Windows启动界面,除zh-CN外均可删除,直接删除会提示无权限,方法同上(13.3M)

  C:\perflogs\System\Diagnostics

  这个里面是你进行了Windows Vista系统测试之后的测试记录文件存放处,按照不同的日期一个文件夹来存放,不需要的可以删除之(9.39M)

  C:\Windows\Downloaded Installations

  有一些程序(Dreamweaver。)安装的时候会把安装文件解压至此文件夹里面,可以删除之

  C:\Windows\Help

  这个不用说了吧,帮助文件,可以删除。建议暂时保留,因为对这VISTA还不怎么熟悉,有时有点用出(105M)

  C:\Windows\IME

  输入法文件,日韩繁对应文件夹个输入法(100M左右)

  C:\Windows\Installer

  已安装程序的卸载修改时所需程序,如果确定该程序安装后不用卸载,可以删除之,要不然以后要删除可能删不了(不过也可以重新安装再删),所以删了吧,按安装程序的数量,几十到几百M不等

  C:\Windows\winsxs

  此文件夹总大小在3-4G左右,winsxs 存储各版本的winxp 组件
Windows XP在“Windows”目录下提供了一个名为“WinSxS”(Windows Side-by-Side)的文件夹。
系统使用这个文件夹存储各个版本的Windows XP组件,减少因为动态链接库(Dynamic Link
Libraries,DLL)引起的配置问题(DLL hell)。

  C:\Windows\winsxs\Backup

  这个里面是一些备份文件,慎重(353M)

  C:\ProgramData

  一些程序安装时会放一些文件到这里面,看需要删除,例如我装了iTunes之后会出现C:\ProgramData\Apple Computer\Installer Cache\iTunes 7.0.2.16这个文件夹,里面其实就是安装文件,可以删除,但是有些是软件运行时需要的文件,不能乱删,自己看着是安装文件的就可以删,此文件夹大小 几十到几百M不等

  C:\Users\Public

  所有用户公用文件夹,里面有一些示例图片、视频等,可以删除之(217M),其中,C:\Users\Public\Recorded TV\Sample Media为Windows Media Center的示例电视录制文件(143M),C:\Users\Public\Music\Sample Music为示例音乐(59M),

  C:\Users\Public\Pictures\Sample Pictures为示例图片(4.7M),C:\Users\Public\Videos为示例视频(9.6M)

  C:\Windows\Web\Wallpaper(45M)

  C:\Windows\System32\DriverStore\FileRepository(1030M)

  C:\Windows\Help(105M)

  C:\Users\Public(217M)

  这4个一删除,1397M!加上其他的一些东西,随随便便2G的空间就给省下来了,然后把用户文件转移至其他盘,页面文件弄到其他盘,C盘不会超过5G的。

ubuntu root 密码 的问题

新接触ubuntu的人(base on debian),大多会因为安装中没有提示root密码而不太清楚为什么会这样。根据ubuntu的中文文档,总结了本文。原文来自于 八小时外: http://www.oo8h.com/news_460.html
关键词:
如何设定/改变/启用 root 使用者的密码?
sudo passwd root
为了启用 root 帐号 (也就是 设置一个口令) 使用: sudo passwd root
当你使用完毕后屏蔽 root 帐号 使用: sudo passwd -l root
这个将锁住 root 帐号.
如何在终端机模式下切换到 root 身份?
sudo -s -HPassword: <在这注明您的密码>缺省禁止 root 的好处包括了以下内容.
起初 Ubuntu 团队希望安装尽可能的简单. 不使用 root , 在安装期间的两个用户交互步骤可以省略. (科林·沃森)
更进一步, 如果在安装中使用 root, 用户将被要求永远记住他们选择的密码--即使他们很少使用到它. Root 密码经常被对 Unix 安全模型不熟悉的用户忘记. (马特·齐默曼)
它防止了缺省登录时 "我能做任何事情" --在较大的变化发生之前,你将被提示输入口令,这可以使你考虑你这样做的结果. 如果你作为 root 登录, 你可以删除一些 "没用的文件夹" 并且不会意识到你正处于错误的目录,那时已经太晚了. 它是在 Unix 下长时间使用 "su-command-^D" 练习的情况下,代替一直呆在 root shell--除非你做严重的系统维护 (那时你仍然可以使用 "sudo su"). (吉姆·奇塔姆 和 安德鲁·索巴拉)
Sudo 增加了运行命令的日志记录 (在 /var/log/auth.log). 如果你陷入困境, 你总是可以返回并看见那些运行的命令. (安德鲁·Zbikowski)
安全
与传统的 superuser 模型相比,这种方法有不同的利弊,两者都不总是显示优良的.
在鼓励使用 root 权限执行一个单独的命令, sudo 好过打开一个 shell:
减少使用 root 权限的时间总耗用, 降低了不注意使用 root 执行命令的风险
提供了有用的审核痕迹
有一个单独的 root 密码 (传统模型) 提供了一层额外的保护,当如果一个管理员的密码被侵害时。
无论怎样, 如果管理员 (使用 sudo 或 su 变成 root) 被侵害, 攻击者一般可以通过一次间接的攻击来获得 root

Wednesday, 30 May 2007

隔夜茶

1.隔夜茶的概念很难区别。。。。。隔夜茶不会致癌

早晨泡的茶下午喝很常见,深夜工作泡的茶,清早起床后喝,茶水中发生的变化不会比白天大,如果非得说有什么不同的话,倒是白天的气温高,茶水变化可能更
大些。

2.茶水放置时间长了,会发生一些什么变化呢。。。。。怎样饮茶最健康

研究表明,最主要的变化是茶多酚的进一步氧化,颜色加深。一杯清澈碧绿的茶水,尤其是在气温较高的情况下放置久了,会失去绿色,增加黄色的程度。这是茶
水中的茶多酚氧化形成黄红、红褐色的氧化产物,主要是茶黄素、茶红素、茶褐素等。这些产物是无毒的,不会对人体产生危害。

3. 还有人推测,茶水放过夜后,会产生亚硝胺这种致癌物质。。。。。品茶品出健康来

首先,应该肯定茶叶中即使有亚硝胺,也是微不足道的,我们日常食用的许多食物中,如面包、蔬菜,腌菜、咸鱼、咸肉等均含有亚硝胺,而且量较茶水中多多
了。可也没见大家都不吃饭菜了。每千克肉制品中的亚硝胺含量有4~50微克,岂不是很可怕,其实非也,因为人体本身就有分解亚硝胺的功能。

再说,亚硝胺要达到每千克体重吸收100~2000毫克才有可能致癌,而且是常年持续性大剂量的服用。一般正常的进食量,是不会产生如此巨大的危害性
的,喝茶的数量与摄入的饭菜数量相比,更是微不足道。如果轻而易举地对这些微量的亚硝胺“俯首称臣”,人怎么还能称得上是“万物之灵”呢?

因此,担心喝茶会带来亚硝胺致癌的危害,是毫无道理的。

另外,研究显示,茶叶中含有丰富的茶多酚和维生素C,都是亚硝胺天然抑制剂。因此喝茶还能消除其他含有亚硝胺食物带来的危害。茶叶中含有丰富的茶多酚通
过清除氧自由基,抑制脂质过氧化,对其他致癌物的抑制效果也相当明显。茶水中的维生素C和维生素E,也有辅助抗癌的功效。

隔夜茶因时间过久,维生素大多已丧失,且茶汤中的蛋白质、糖类等会成为细菌、霉菌繁殖的养料,所以,人们通常认为隔夜茶不能喝。其实,没有变质的隔夜茶
不但可以饮用,还有以下保健作用:

抗癌、抗氧化:茶水放置时间长了会变为红褐色,这是由于茶多酚氧化成了红褐色的茶色素。研究表明,茶多酚和茶色素均有很强的抗癌、抗氧化作用,虽然说隔
夜茶中维生素C的含量大大减少,但依然具有抗病作用。

止血:隔夜茶中含有丰富的酸素,可阻止毛细血管出血。如患口腔炎、舌痈、湿疹、牙龈出血等,均可用隔夜茶漱口治疗。疮口脓疡、皮肤出血也可用其洗浴。

明目:隔夜茶中的茶多酚有抗菌消炎作用,如果眼睛出现红丝,可以每天用隔夜茶洗几次。

止痒:用温热的隔夜茶洗头或擦身,茶中的氟能迅速止痒,还能防治湿疹。

生发:用隔夜茶洗头,还有生发和消除头屑的功效。如嫌眉毛稀落,每天可用刷子蘸隔夜茶刷眉,日子久了,眉毛自然变得浓密光亮。

固齿洁齿:茶水中的氟与牙齿的珐琅质钙化以后,会增强对酸性物质的抵抗力,减少蛀牙的发生;氟还能消灭牙菌斑,最好饭后两三分钟用茶水漱口。

除口臭:茶中含有精油类成分,气味芳香,清晨刷牙前后或饭后,含漱几口隔夜茶,可使口气清新,经常用茶漱口可消除口臭。

防晒:皮肤被太阳晒伤,可用毛巾蘸隔夜茶轻轻擦拭。因为鞣酸对皮肤有收敛作用,茶中的类黄酮化合物也有抗辐射作用。

去腥除油腻:隔夜茶还有特强的除腥气和除油腻的功效,吃虾蟹后用来洗手倍感清爽。

使用隔夜茶,应以不变馊(变质)为度。夏季温度高,茶水易酸败变味,如果搁置了24小时以上,最好不喝,否则会引起腹泻。

饮茶误区之一:隔夜茶不能喝?
喝隔夜茶其实并没有坏处,但是茶叶易氧化,所以隔夜茶的茶杯上往往会留有茶斑。另外,夏季温度偏高,茶叶容易被细菌污染,发霉、发馊,导致腹泻,所以此
时还是不喝隔夜茶为好。

如果你不舍得倒掉,还可以用于以下用途:

●隔夜茶中含有丰富的酸类,氟类,不但可以防止毛细血管出血,还能起到杀菌消炎作用,如口腔出血,皮肤出血等都可以用它浴洗含漱。

●眼睛出现红丝或原因不明流泪,每天用隔夜茶洗多次会有很好的效果。

●用隔夜茶洗头,可治头皮痒。

●口臭使许多人苦恼,如果用隔夜茶每天漱口三次,就可消除你的烦恼。

●用隔夜茶擦洗油铅、面盆、盘、碗、油漆家具等效果明显,洗完如新品一样,鸡蛋的丹青或蛋黄污染衣服不易洗净,用茶叶水浸泡一会就可洗净。
据研究发现,一片茶叶中含有300多种多种营养物质,包括蛋白质、胺基酸、茶多酚和维生素C等,而隔夜茶会导致上述营养物质被细菌污染,您想被细菌污染
的食物还能吃吗?

其实不止是隔夜茶不能喝,在夏天早晨泡的茶到了下午后最好也是不要喝了,有些人喜欢泡一壶茶喝一整天,这样不好,不单茶叶容易感染细菌,而且茶叶冲泡是
有一定的次数的,冲泡次数过多会把茶中含有的一些不良物质也给冲泡出来的,(一般合理的冲泡次数是不会泡出有害物质的)本来喝茶是为了健康,不要因为喝
茶不当而变成有害了。

但未变质的隔夜茶在医疗上自有妙用,隔夜茶中含在丰富的酸素,可阻止毛细管出血,如患口腔炎,舌痛,温疹,牙龈出血,疮口脓疡等,可用隔夜茶治疗。眼睛
常流泪或有血丝,也可每天几次用隔夜茶洗眼。清晨刷牙前后或饭后,含漱几口隔夜茶,更可使口气清新,并有固齿作用。

Tuesday, 29 May 2007

shorcut for windows power management

shutdown :%SystemRoot%/System32/shutdown.exe /s

log off :%SystemRoot%/System32/shutdown.exe /l

restart :%SystemRoot%/System32/shutdown.exe /r

hibernate:%SystemRoot%/System32/shutdown.exe /h

Friday, 4 May 2007

Lastest Flash on FIrefox

The latest Flash 9.0.45.0 version got installed automatically in C:\WINDOWS\system32\Macromed\Flash instead of the C:\Program Files\Mozilla Firefox\plugins

Wednesday, 2 May 2007

type of man like

CLEVER, HUMOUR, NOT MANY WORDS BUT YOUR WORDS ARE GOOD, KNOWING WHAT TO DO AND WHAT TO SAY IN ANY CIRCUMSTANCES, GOOD AT SPORTS.

Saturday, 21 April 2007

Zemax mannul tutorial version 9

(第一版,1999年7月29日)
前言
  整个中华卫星二号“红色精灵”科学酬载计画,其量测仪器基本上是个光学仪器。所以光学系统的分析乃至于设计与测试是整个酬载发展重要一环。
  这份初学手册提供初学者使用软体作光学系统设计练习,整个需要Zemax光学系统设计软体。它基本上是Zemax使用手册中tutorial的中文翻译,由蔡长青同学完成,并在Zemax E. E. 7.0上测试过。由于蔡长青同学不在参与“红色精灵”计画,所以改由黄晓龙同学接手进行校稿与独立检验,整个内容已在Zemax E. E. 8.0版上测试过。我们希望藉此初学手册(共有七个习作)与后续更多的习作与文件,使团队成员对光学系统设计有进一步的掌握。(陈志隆注)
习作一:单镜片(Singlet)
 
  你将学到:启用Zemax,如何键入wavelength,lens data,产生ray fan,OPD,spot diagrams,定义thickness solve以及variables,执行简单光学设计最佳化。
  设想你要设计一个F/4单镜片在光轴上使用,其focal length 为100mm,在可见光谱下,用BK7镜片来作。
  首先叫出ZEMAX的lens data editor(LDE),什么是LDE呢?它是你要的工作场所,譬如你决定要用何种镜片,几个镜片,镜片的radius,thickness,大小,位置……等。
  然后选取你要的光,在主选单system下,圈出wavelengths,依喜好键入你要的波长,同时可选用不同的波长等。现在在第一列键入 0.486,以microns为单位,此为氢原子的F-line光谱。在第二、三列键入0.587及0.656,然后在primary wavelength上点在0.486的位置,primary wavelength主要是用来计算光学系统在近轴光学近似(paraxial optics,即first-order optics)下的几个主要参数,如focal length,magnification,pupil sizes等。
  再来我们要决定透镜的孔径有多大。既然指定要F/4的透镜,所谓的F/#是什么呢?F/#就是光由无限远入射所形成的 effective focal length F跟paraxial entrance pupil的直径的比值。所以现在我们需要的aperture就是100/4=25(mm)。于是从system menu上选general data,在aper value上键入25,而aperture type被default为Entrance Pupil diameter。也就是说,entrance pupil的大小就是aperture的大小。
  回到LDE,可以看到3个不同的 surface,依序为OBJ,STO及IMA。OBJ就是发光物,即光源,STO即aperture stop的意思,STO不一定就是光照过来所遇到的第一个透镜,你在设计一组光学系统时,STO可选在任一透镜上,通常第一面镜就是STO,若不是如此,则可在STO这一栏上按滑鼠,可前后加入你要的镜片,于是STO就不是落在第一个透镜上了。而IMA就是imagine plane,即成像平面。回到我们的singlet,我们需要4个面 (surface),于是在STO栏上,选取insert cifter,就在STO后面再插入一个镜片,编号为2,通常OBJ为0,STO为1,而IMA为3。
  再来如何输入镜片的材质为BK7。在 STO列中的glass栏上,直接打上BK7即可。又孔径的大小为25mm,则第一面镜合理的thickness为4,也是直接键入。再来决定第1及第2 面镜的曲率半径,在此分别选为100及-100,凡是圆心在镜面之右边为正值,反之为负值。而再令第2面镜的thickness为100。
  现在你的输入资料已大致完毕。你怎么检验你的设计是否达到要求呢?选analysis中的fans,其中的Ray Aberration,将会把transverse的ray aberration对pupil coordinate作图。其中ray aberration是以chief ray为参考点计算的。纵轴为EY的,即是在Y方个的aberration,称作tangential或者YZ plane。同理X方向的aberration称为XZ plane或sagittal。
  Zemax主要的目的,就是帮我们矫正 defocus,用solves就可以解决这些问题。solves是一些函数,它的输入变数为curvatures,thickness, glasses,semi-diameters,conics,以及相关的parameters等。parameters是用来描述或补足输入变数 solves的型式。如curvature的型式有chief ray angle,pick up,Marginal ray normal,chief ray normal,Aplanatic,Element power,concentric with surface等。而描述chief ray angle solves的parameter即为angle,而补足pick up solves的parameters为surface,scale factor两项,所以parameters本身不是solves,要调整的变数才是solves的对象。
  在surface 2栏中的thickness项上点两下,把solve type从fixed变成Marginal Ray height,然后OK。这项调整会把在透镜边缘的光在光轴上的height为0,即paraxial focus。再次update ray fan,你可发现defocus已经不见了。但这是最佳化设计吗?再次调整surface 1的radius项从fixed变成variable,依次把surface 2的radius,及放弃原先的surface 2中thickness的Marginal Ray height也变成variable。再来我们定义一个Merit function,什么是Merit function呢?Merit function就是把你理想的光学要求规格定为一个标准(如此例中focal length为100mm),然后Zemax会连续调整你输入solves中的各种variable, 把计算得的值与你订的标准相减就是Merit function值,所以Merit function值愈小愈好,挑出最小值时即完成variable设定,理想的Merit function值为0。
  现在谈谈如何设Merit function,Zemax 已经default 一个内建的merit function,它的功能是把RMS wavefront error 减至最低,所以先在editors中选Merit function,进入其中的Tools,再按Default Merit Function 键,再按ok,即我们选用default Merit function ,这还不够,我们还要规定给merit function 一个focal length 为100的限制,因为若不给此限制则Zemax会发现focal length为 ∞时,wavefront aberration的效果会最好,当然就违反我们的设计要求。所以在Merit function editor第1列中往后插入一列,即显示出第2列,代表surface 2,在此列中的type项上键入EFFL(effective focal length),同列中的target项键入100,weight项中定为1。跳出Merit function editor,在Tools中选optimization项,按Automatic键,完毕后跳出来,此时你已完成设计最佳化。重新检验ray fan,这时maximum aberration已降至200 microns。
  其他检验optical performance还可以用Spot Diagrams及OPD等。从Analysis中选spot diagram中的standard,则该spot大约为400 microns上下左右交错,与Airy diffraction disk比较而言,后者大约为6 microns交错。
  而OPD为optical path difference(跟chief ray作比较),亦从Analysis中挑选,从Fans中的Optical Path,发现其中的aberration大约为20 waves,大都focus,并且spherical,spherochromatism及axial color。 Zemax 另外提供一个决定first order chromatic abberation 的工具,即 the chromatic focal shift plot,这是把各种光波的back focal length跟在paraxial上用primary wavelength 计算出first order的focal length之间的差异对输出光波的wavelength 作图,图中可指出各光波在paraxial focus上的variation。从Analysis中Miscellaneous项的Chromatic Focal Shift即可叫出。
●习作二:双镜片
 
  你将学到:画出layouts和field curvature plots,定义edge thickness solves, field angles等。
 
  一个双镜片是由两片玻璃组成,通常黏在一起,所以他们有相同的curvature。藉著不同玻璃的dispersion性质,the chromatic aberration可以矫正到first order所以剩下的chromatic aberration主要的贡献为second order,于是我们可以期待在看chromatic focal shift plot图时,应该呈现出parabolic curve的曲线而非一条直线,此乃second order effect的结果(当然其中variation的scale跟first order比起来必然小很多,应该下降一个order)。
 
  跟习作一一样,我们仍然要设计一个在光轴上成像,focal length为100mm的光学系统,只不过这次我们用两块玻璃来设计。
  选用BK7和SF1两种镜片,wavelength和aperture如同习作一所设,既然是doublet,你只要在习作一的LDE上再加入一面镜片即可。所以叫出习作一的LDE,在STO后再插入一个镜片,标示为2,或者你也可以在STO前在插入一面镜片标示为1,然后在该镜片上的surface type上用滑鼠按一下,然后选择Make Surface Stop,则此地一面镜就变成STO的位置。在第一、第二面镜片上的Glass项目键入BK7即SF1,因为在BK7和SF1之间并没有空隙,所以此 doublet为相黏的二镜片,如果有空隙则需5面镜因为在BK7和SF1间需插入另一镜片,其glass type为air。现在把STO旱地二面镜的thickness都fixed为3,仅第3面镜的thickness为100且设为variable,既然要最佳化,还是要设 merit function,注意此时EFFL需设在第三面镜上,因为第3面镜是光线在成像前穿过的最后一面镜,又EFFL是以光学系统上的最后一块镜片上的 principle plane的位置起算。其他的merit function设定就一切照旧。
 
  既然我们只是依习作一上的设计规范,只不过再加一面SF1镜片而已,所以其他的merit function设定就一切照旧。现在执行optimization,程序如同习作一,在optimization结束后,你再叫出Chromatic Focal Shift来看看,是否发现first order的chromatic aberration已经被reduced,剩下的是second order chromatic aberration在主宰,所以图形呈现出来的是一个parabolic curve,而且现在shift的大小为74 microns,先前习作一为1540 microns。
 
  再看其他的performance效果,叫出Ray aberration,此时maximum transverse ray aberration已由习作一的200 microns降至20 microns。而且3个不同波长通过原点的斜率大约一致,这告诉我们对每个wavelength的relative defocus为很小。再者,此斜率不为0(比较习作一Fig E1-2),这告诉我们什么讯息呢?如果斜率为0,则在pupil coordinate原点附近作一些变动则并不产生aberration代表defocus并不严重,而aberration产生的主要因素为 spherical aberration。故相对于习作一(比较他们座标的scale及通过原点的斜率),现在spherical aberration已较不严重(因为aberration scale已降很多),而允许一点点的defocus出现,而出现在rayfan curve的S形状,是典型的spherical balanced by defocus的情况。现在我们已确定得到较好的performance,但实际上的光学系统长的什么样子呢?选择Analysis,Layout,2D Layout,除了光学系统的摆设外,你还会看到3条分别通过entrance pupil的top,center,bottom在空间被trace出来,他们的波长是一样的,就是你定的primary wavelength(在此为surface 1)。这是Zemax default的结果。
 
  但是现在还有一个问题,我们凭直觉定出STO的thickness为3,但是真正在作镜片的时候,STO和surface 2镜面会不会互相交错穿出,即在edge的thickness值为正数或负数,还有是不是应该改一下设计使lens的aperature比 diameter小,如此我们可预留些边缘空间来磨光或架镜。
 
  于是我们可能更改的是diameter,STO的thickness 来解决上述问题。先在STO的diameter上键入14来盖过12.5,此时会有一个”U”字出现代表user define,现在设想我们要edge thickness固定为3mm,可是你或许会问这样系统岂不是弄乱了吗?defocus又会出现,关键是再一次执行optimization即可。在 STO的thickness上按一下,选择Edge Thickness项目,则会出现”Thickness”及”Radial Height”两项,设thickness为3及radial height为0(若radial height为0,则Zemax就使定user define的semi-thickness)按OK跳出,你会发现STO的thickness已改变,且会出现一个”E”字代表an active thickness solve在该项的parameter上。
 
  既然edge thickness已改变,所以focal length也一定有些许变动,为了维持原有的EFFL,现在再执行optimization一次即可。现在我们想看看off-axis的 performance,从system的Fields中的Field Data,选用3个field来作比较,怎么选呢?在第2及第3个列中的”Use”项中各按一下,在第2列的y field行中键入7(即7 degree),在第3列中键入10,第一列则让它为0即持续on-axis。而设所有的x field皆为0,对一个rotational对称的系统而言,他们的值很小,按OK键跳出。现在Update rayfan,你可看到如Figure E2-4之图。图中T代表tangential,S为sagittal,结果显示off-axis的performance很差,这是因为一开始我们就设计系统在on-axis上来作optimization,这些aberration可以用field curvature plot来估计,选Analysis中,Miscellaneous的Field Curv/Dist。则出现如Figure E2-5的图,左图表示shift in paraxial focus为field angle的函数,而右图为real ray的distortion,以paraxial ray为参考ray。在field curvature plot的讯息也可从rayfans中得知,为field curvature plot是正比于在rayfan plot中通过原点的斜率。
●习作三:牛顿望远镜
 
  你将学到:使用mirrors,conic constants,coordinate breaks,three dimensional layouts,obscurations。
 
  牛顿望远镜是最简单的矫正所有on-axis aberrations的望眼镜。牛顿望远镜是利用一个简单的parabolic mirror完美地矫正所有order的spherical aberration,因为我们只在optical axis上使用,除spherical aberration外并没有其他的aberration。
 
  假想要设计一个1000mm F/5的望远镜,我们需要一个具有2000mm的curvature及200mm的aperture。在surface 1即STO上的curvature项中键入-2000 mm,负号表示对object而言,其曲面为concave,即曲面对发光源而言是内弯的。在thickness项中键入-1000,负路表示光线没有透过mirror而是反射回来,在Glass项中键入MIRROR,最后在System的General项中的aperture中键入200。
 
  Wavelength选用0.550,field angel则为0。现在看看spot diagram,你会看到一个77.6 microns RMS的spot diagram,而一个很方便估算image quality的方法就是在spot diagram的顶端上再superimpose一个Airy diffraction ring。从spot diagram的menu bar选择Setting,在Show Scale上选”Airy Disk”,结果如图Figure E3-1所示,你会发现和选”scale bar”的结果是一样的。图中所列的RMS spot size选”Airy Disk”为77.6 microns。光线并没有diffraction-limited的原因是因为我们还没有设定conic constant。先前我们设定的curvature的值为-2000只是定义一个球面,若要定义一个抛物面镜,则在STO的Conic项中尚需键入- 1,接下来Update spot diagram,你会看到”Airy ring”为一个黑圈,而光线则聚集在圈内中心上,RMS值为0。
 
  可惜的是,成像的位置很不好,所谓的不好是它位于在入射光的路径上,若你要看这个像的话,你的观看位置刚好挡住入射光。改善的方法是在反射镜的后面再放一个折镜,fold mirror(后面是相对于成像点而言)。这个fold mirror相对于光轴的倾斜角度为45,把像往上提离光轴。因为进来的光束为200mm宽,因此成像平面至少在离光轴100mm的上方,如此”看”像的时候才不会挡住入射光。我们决定用200mm,而fold mirror离先前的反射镜面为800mm,因为200+800=1000等于原先在STO上的thickness,即成像”距离”不变。操作如下,先把 STO的thickness改为-800,然后在imagine plane前插入一个dummy surface,为何要插入dummy surface呢?又dummy surface是什么呢?dummy surface的目的只是在帮助我们把fold mirror的位置标示出来,本身并不具真实的光学镜片意义,也不参予光学系统的任何”反应”,所以称为dummy surface。怎么插入dummy surface呢?先在image plane前面插入一个surface,这个surface很快地就会被转变成fold mirror,但是你不要自己在surface type处去改变它成为fold mirror,而是选Tools中的Add Fold Mirror,并在其”fold surface”处选”2”代表定义surface 2为fold mirror,完成后你将看到如Zemax P.31页中LED的表。或许你会问,表中surface type处在surface 2及4中皆为Coord Break,这又是什么?coordinate break surface是在目前的系统内定义一个新座标系统,它总是用dummy surface的观念用来作ray tracing的目的。而在描述此新座标系统中,通常选用6个不同参数,即x-decenter,y-dencenter,tiltx,tilty, tiltz及一个flag来指示tilting或decentration的order。
 
  要注意的是,coordinate break总是相对于“current”而“global”的coordinate system,即只是在一个系统内部,若要改变某样物件的位置或方向,我们即利用coordinate break来作此物件的区域调整,而不用重新改变所有的系统各部份。Coordinate break就像是一个平面指向调整后的局部系统的方位。然而coordinate break surface绝不会显示出来。而它的glass项中显示为”-“代表不能键入,而它的surface type型式一定跟它前一面镜的glass type一致。现在我们来看看layout,不能选2D(2D只能看rotational symmetric systems),要用3D看,叫出layout后,按↑↓ 或page down or up可以看立体效果,这个设计尚可再作改善,首先入射光打到fold mirror背后的部份可以vignetted,这在实际的系统中是一个很重要的思量。在STO的前面插入一个surface,令这个surface的 thickness为900,在surface type中的Aperture Type还为“Circular Obscuration”,在Max Radius键入40,因为fold mirror的semi-diameter为31,如此才能遮蔽。Update 3D layout,如看不到像Figure E3-3的图,则在3D layout的setting项中改变the first surface和the last surface分别为1及6即可。
●习作四:Schmidt-Cassegrain和aspheric corrector
 
  你将学到:使用polynomial aspheric surface, obscurations, apertures, solves, optimization, layouts, MTF plots.
 
  本习作是完成Schmidt-Cassegrain及polynomial aspheric corrector plate。这个设计是要在可见光谱中使用。我们要一个10inches的aperture和10inches的back focus。开始设计之初,先把primary corrector System, General, 在aperture value中键入10,同在一个screen把unit”Millimeters”改为”Inches”。再来把Wavelength设为3个,分别为 0.486,0.587,0.656,0.587定为primary wavelength。你可以在wavelength的screen中按底部的”select”键,即可完成所有动作。目前我们将使用default的 field angle value,其值为0。依序键入如Zemax P.33页的starting prescription for schmidt cassegrain的LDE表,此时the primary corrector为MIRROR球镜片。你可以叫出2D layout,呈现出如Figure E4-1之图。现在我们在加入第二个corrector,并且决定imagine plane的位置。键入如Zemax P.33 Intermediate prescription for schmide cassegram的LDE,注意到primary corrector的thickness变为-18,比原先的-30小,这是因为要放second corrector并考虑到其size大小的因素。在surface4的radius设定为variable,透过optimization, Zemax可以定下他的值。先看看他的layout,应如Figure E4-2所示。叫出merit function, reset后,改变”Rings” option到5。The rings option决定光线的sampling density, default value为3,在此设计,我们要求他为5。执行optimization, 用Automatic即可,你会发现merit function的值为1.3,不是很理想。这是residual RMS wave error所致。跳出merit function,从system中选Update All,则secondary corrector的radius已变成41.83。从Analysis, fans,中选Optical Path, OPD plot如Figure E4-3所示,发现其为defocus且为spherical,大概约有4个wave aberration需要矫正。
 
  现在切入另一个主题,利用指定polynomial aspheric cofficients来作aspheric correction。改变surface 1的surface type从standard改为”Even Asphere”,按OK后跳出,回到surface 1 列中,往右移直到4th Order Term, 把此项设为变数,依法炮制,6th, 8th,后再次执行optimization。把OPD plot update,其图应如Figure E4-4所示,你会发现spherical aberration已被大大地减少。小心一点的观察,不同的三个波长其相对的aberration有不同的spherical amount, 这就是spherichromatism,是下一个要矫正的目标。依据经验所得,我们要用axial color来矫正spherochromatism,何谓axial color balance呢?而实际上spherochromatism是在first order axial color中被忽略的higher order效应。而现在first order axial color并不存在,如果first order存在的话,代表其效应(首先axial color既是指轴而言,他即表示paraxial-optics,即不同color在轴上的效应,也就是first order optics)要远大于higher order, 即higher order的aberration会被balance掉,即first order会抢higher order的aberration, 用first order axial color来消除higher order的spherochromatism这是在光学设计上常用的手法。
 
  要怎么引进axial color呢?我们改变surface1的curvature来达到axial color的效果。把曲面1的radius设为variable,执行optimization,再看看update后OPD plot图,如图E4-5所示,这就是我们所要设计的,残余的像差,residual aberration小于1/20波长,这个良好结果,可以让我们些微改变field angle,从system, field中,把field angle的值设为3个,分别是0.0, 0.3, 0.5。现在field angle已改变,等于boundary condition已改变,所以你需要重定你的merit function。把merit function的”Rings”改变为”4”后跳出执行optimization, 则新的OPD plot应如图E4-6所示,虽有不同的field angle,但是所有的aberrations却可以接受。说明此设计还不错。
 
  假想我们要用此望远镜来照相,则这组望远镜的鉴别转换功效为何?什么是鉴别转换功效(Modulation Transfer Function)呢?这就是说,若是发光物Object的鉴别率为M0,而经过此望远镜后所得到的鉴别率是Mi,则MTF=Mi/ M0即MTF愈大,代表此望远镜较不会降低原有的鉴别率,也就比较不会失真。而MTF的横轴为spatial frequency in cycles per millimeter, spatial为鉴别尺(bar target)明暗条纹中其分隔空间宽度之意,通常以millimeter为单位,而frequency in cycles即每millimeter有几组明暗条纹,所以可鉴别最小刻度,即反应该光波的频率。Modulation Transfer Function,即呈现如图E4-7所示之图,而tangential & sagittal对各种入射光field angle的response也一并显示。
 
  对一个有经验的设计者而言,此设计所呈现的MTF为circular pupil autocorrelation的结果。这是我们尚未考虑the secondary corrector所带来遮蔽效应。既然secondary corrector放在primary的前面中心位置上,则入射光一定有部分被挡住,并且在primary上有个洞把成像的光放出去,此洞也需纳入考量,所以我们高估了我们的performance。改良如下,回到LDE,在曲面3的第一项中点两下,从Aperture types中选Circular Aperture,在Min Radius中键入1.7,即入射光离光轴的半径需大于1.7才可进入,此动作再处理primary上的洞,同时把Max Radius改为6。再来处理secondary corrector的obscuration,在surface 3的前面,插入一个surface这个new surface就变成了surface 3,把其thickness改为20,且surface 2的thickness改为40,如此20+40=60并不改变光从BK7后到primary的长度。调整surface 3的Aperture type,设定为Circular Obscuration。把Max Radius订为2.5,按OK后跳出,同时设定surface 3的semi-diameter也是2.5,update后的MTF,你会发现performance已降低,特别是在medial spatial frequencies部分。
(回内容纲目)
●习作五:multi-configuration laser beam expander
 
  你将学到:使用multi-configuration capability。
 
  假设你需要设计一个在波长λ=1.053μ下操作的laser beam expander,Input diameter为100mm,而output diameter为20mm,且Input 和output皆为collimated。在此设计之前,我们必须遵守下列设计条件,
 
1. 只能使用2个镜片
2. 本设计在形式上必须是Galilean(没有internal focus)
3. 只有一个aspheric surface可以使用
4. 此光学系统必须在λ328μ下完成测试。
 
  本设计任务不只是要矫正aberration而已,而是在两个不同wavelengths的情况下都要做到。先谈谈条件2中什么是Galilean呢? Galilean就是光线从入射到离开光学系统,在光学系统内部不能有focus现象,在本例中即beams在两个镜片之间不能有focus。好在本系统不是同时在2个wavelengths下操作,所以在操作时我们可以变动某些conjugates。现在开始设计,依据Zemax P.4-18页的LDE表中键入各surface的相关值。其中surface 5的surface type从Standard改为Paraxial,这时在镜片后面的focal length项才会出现。注意到使用paraxial lens的目的是把collimated light(平行光)给focus。同时把surface 5的thickness及focal length皆设为25,entrance pupil的diameter定为100,wavelength只选一个1.053 microns即可,记住不要在设第二个wavelength。叫出merit function,在第1列中把operand type改为REAY这表示real ray Y将用来作为一种constraint,在本设计中,我们被要求Input diameter为100而output diameter为20,其比值为100:20=5:1,即入射beam被压缩了5倍,在srf#中键入5,表示在surface中我们要控制他的ray height,而Py上则键入1.00。把target value定为10,这个动作将会给我们一个diameter collimated为20mm的output beam。为什么呢?因为Py是normalized的pupil coordinate,即入射光的semi-diameter为50。,Py=1即现在的入射光is aimed to the top of the entrance pupil,把target value定为10,就是输出光的semi-diameter为10,所以50:10=5:1,光被压缩了5倍,达到我们的要求。semi- diameter的值定为10,现在选Tools,Update,你会看到在value column上出现50的值,这就是entrance pupil radius即表示coordinates是座落在一个单位圆(unit circle)上,而其半径为50,当Px=0,Py=1即表示在y轴的pupil大小为50,而在x轴的则为0。
 
  从edit menu bar选Tools,Default Merit Function,按Reset后把”Start At” field的值改为2,这表示以后的operands会从第二列开始,而不会影响已建立的REAY operand。执行optimization后,把OPD plot叫出来,如图E5-1所示,你会发现performance很差,大约为7个waves。
 
  这个aberration主要来自spherical aberration,所以我们要把surface 1改为a spheric,把surface 1列中的conic设为variable,再次执行optimization,你会看到较好的OPD plot。现在把所有的variable都去掉,然后将此field存档,因为你已完成wavelength在1.053μ下的beam expander设计。但是wavelength在0.6328μ的情况怎么办呢?我们进入此习作的另一个主题,也就是multi- configuration可以在同一系统中同时设定不同的configuration,以适应不同的工作环境或要求,先前我们已完成了 wavelength为1.053μ的configuration,把他看做configuration 1,而wavelength 0.6328为configuration 2。
 
  把wavelength从1.053改为0.6328后看看OPD plot,出现非常差的performance,这是因为glass dispersion的缘故。我们调整lens spacing来消除此defocus把surface 2的thickness设为variable,执行optimization后,update OPD plot,此时的aberration大约为一个wave,接下来消掉surface 2 thickness的variable。现在我们来使用Zemax的multi-configuration capability功能,从main menu上选Editors,后Multi-configuration,再选其中的Edit,Insert Config,如此我们就可以加入一个新的configuration,在第一列的第一项中按两下,选”wave”,同时在”Wavelength#”中选为1,这表示在不同的configuration,我们使用不同的wavelengths。在Config 1下键入1.053,Config 2下键入0.6328,在插入一个新的列于此列的第一项中按两下,选THIC为一个operand type,这会让我们在各别的configuration中定义不同的thickness,从”surface” list中选2后按OK。在Config 1下键入250,Config 2也键入250,不过在surface中选2即表示在LDE中surface 2的thickness是当作mult-configuration的一项oprand value,把Config 2下surface 2的thickness设为variable。回到merit function editor,选Tools,Default Merit Function,把”StartAt”的值改为1,使default merit function会从第一列开始考虑。现在先前设定的REAY constraint条件必须加到此新的multi-config merit function,在merit function的第一列中,有一个CONFoperand且在”Cfg#”项中定为1,表示现在configuration 1是avtive。在此列之下尚有三个OPDXoperands,于CONF和第一个OPDX之间插入一个新列,把其operand type改为”REAY”,”Srf#”键入5。表示我们要控制的ray height是对surface 5而言,Py键入1.00target value设为10。如同先前的file让输出beam的diameter为20mm。在CONF 1的要求接设定完毕,在CONF 2则不设任何operand,因为我们不可能在两种wavelengths操作下要求exact 5:1的beam。回到LED,把surface 1,2,4的curvatures及surface 1的conic皆设为variable,执行optimization(现在有5个variable为active,3个curvatures,1个 conic,1个multi-config thickness)。叫出update的OPD plot,你可以在mulit-configuration editor上在“Config 1”或“Config 2”上按两下,则OPD plot会显示其对应的configuration,或者你可用Ctrl-A的hot key,在不同的configuration间作变换,你会发现两者的performance都很好,表示我们所设计的系统在wavelength 1.053或0.6328μ的laser之下皆可以工作。
●习作六:fold mirrors和coordinate breaks
 
  你将学到:瞭解coordinate breaks, sign conventions在调整倾斜度,或改变系统中心的作用和如何装置fold mirrors等,本习作的大部分技巧在“Add Fold Mirror”工具中可自动执行,然而瞭解实际的操作内容和细节,才是本习作的目的。
 
  在习作3时或许你已学会如何设计Newtonian望远镜,其中已经有coordinate breaks的操作,以及光在经过mirror反射后thickness虚设定为负值,和coordinate breaks需伴随著一对使用,而把要的fold mirror如三明治般地夹在其中。本习作将教你如何在一个简单的converging beam中manually加入fold mirrors,而不使用Tools中的“Add Fold Mirror”功能。
 
  叫出 LDE,把STO的surface type改为paraxial,thickness定为100,这时对paraxial lens的default focal length值,然后从System, General,中把aperture设为20,即产生一个F/5的lens。完毕后看看3D layout,一个简单的paraxial lens所造成converging beam的光学系统已完成。假设我们要把输出的convergingbeam导向上,怎么作呢?那就是加入一个fold mirror,先假定此fold mirror为45°oriented且具paraxial lens为30mm。总共需要3个镜片。一个为coordinate break把coordinate system转45°,然后一个mirror来反射光线,最后再一个coordinate break把反射后的beam给转45°这是很重要的一点,共要3个surface来装置一个fold mirror。coordinate breaks本身没什么作用,只是把入射光和输出光作同样的倾斜或改变中心座标的动作而已。在imaging surface前面出入3个lens,把surface 1的thickness定为30,在surface 3的glass fold mirror尚未titled,所以系统会在paraxial lens的左边40mm处focus。更改surface 2及4的surface type为Coordinate Brek,回到LDE往右一,在surface 4的第3个parameter column中期heading上头标示为”Title About X”。在此项中按两下,选”Pick Up”,且设定”From Surface”为2,”Scale Factor”为1.0,这代表surface 4的coordinate break动作会跟surface 2的一样。移由标到surface 2的”title about x”项中,键入45,Update layout你会看到如Figure E6-1的图。注意到coordinate break的thickness为0,表示mirror和coordinate break surface是重合的。应该注意的是,mirror本身并没有转,转的是入射前合入射后的座标系统,在反射后除了转45°外,并且移了-70units 去focus,所有的tilt或decenter动作总是在光线跑,即thickness之前完成。现在再装第二个fold mirror,同样在imagine surface前面插入3个surface,把surface 4的thickness从-70改为-30,在surface 5的tilt about x项键入-45,目的是在把光的进行方向还原到平行于原始入射方向,而surface 7的tilt about x项一样选择pick up from surface 5且scale factor定为1。
 
  Update 3D layout,则呈现如Figure E6-2的图,如我们期待的,+45和-45互相抵消,输出光平行于入射光,又要改变两组的coordinate breaks的参数,只要改变surface 2及5即可。因为surface 4及7会各别依随他们变动而变动。
●习作七:使用Extra Date Editor, Optimization with Binary Surfaces
 
  或许你不会相信,会有”achromatic singlet”这样的东西。当然,mirror是一个achromatic singlet,姑且不论之,去设计一个矫正到first-order chromatic aberration混合refractive/diffractive成分是可能的。其中的技巧就是使用一个传统refrative singlet,然后将其中的一面蚀刻成一个diffractive surface。此singlet造成很大的focusing power,而the weak diffractive component则提供足够的dispersion来补偿glass的dispersion。让我们来回顾一些概念,一个focal length f的singlet其optical power为φ=f-1,在λF-λC的波长范围下,power的变异部分可由singlet其glass的Abbe number V来描述,其中λF及λC为hydrogen的F及C line的wavelength依序为0.4861μm和0.6563μm。故
    Δφ=φ/V
在大部分的glasses种类中,他们的dispersion都很小,如BK7来说,其V值为64.2。而Δφ大约为整体的2%。
 
  而Diffractive optics则直接使用phase of wavefront操作来增加光数的optical power。对一个具有quadratic phase profile的diffractive surface,其phase为
    ψ=Ar2
A为每平方单位长度的弧度量,而r为radial coordinate。如此的diffrective surface,他的power为
    φ=λA/π
和他所承受的波长呈线性相关。在同样的波长范围下,refractive singlet的power变异为2%,而diffractive optic power则几乎为40%,此外,dispersion的正负号可由A的正负号来决定。这有什么好处呢?如果我们在refractive部分增加一些 positive power,同时可由在diffractive部分增加一些negative power来达到补偿的效果。所增的power量可以从”Standard”改为”Binary 2”。然后在IMA前面加入一个新的surface,即插入surface 2,其thickness设为100。STO的thickness设为10,glass选为BK7,从System, General中Aperture Value定为20。Wavelengths选0.486,0.587及0.656,选0.587定为primary。首先我们看一个convex- plano singlet的performance,把surface 1的radius设为variable,且从Merit Function Editor的tools中使用Default Merit Function。子行Optimization,叫出OPD plot,你会发现其aberration约为8个waves。除了axial color主宰此设计外,spherical aberrotion和default也相当可观。
 
  现在改良此设计,从Editors,Extra Data中在”Max Term”项上键入1和”Norm Aper”上键入10,而”Coeff on PΛ2”此项则设为变数。然后执行Optimization,其中有两项变数,分别是surface 1的radius及diffractive power。Update OPD plot则maximum aberration已经降至约一个wave,造成aberration的主要原因只剩下secondary spectrum及spherical aberration。我们利用higher order term的技巧来矫正他,回到Extra Date Editor,把”MaxTerm #”改为2,且社fourth order term项为variable,再次执行optimization。叫出updated后的OPD plot,你会发现wavefront aberration已大大降至1个wave以下。

Pasted from <http://33tt.com/article/2006-02/867.htm>

Java Envoroiment Setting within ultraedit

Java环境变量设置

如果是Win2000/NT/XP系统,则设置环境变量为:
系统变量->新建->变量名:“JAVA_HOME”,变量值“C:\Java\jdk1.5.0_06”;
系统变量->新建->变量名:“CLASSPATH”,变量值“.;%JAVA_HOME%\lib”;
系统变量->编辑->变量名:“Path”,变量值“%JAVA_HOME%\bin”。
注:CLASSPATH中有一英文句号“.”后跟一个分号,表示当前路径的意思。


UltraEdit中设置Java环境
在“高级”菜单下,选择“工具配置”,然后添加:
命令行:C:\Java\jdk1.5.0_06\bin\javac.exe %f或C:\Java\jdk1.5.0_06\bin\javac.exe %n%e
%f、%n、%e分别表示完整文件名、不含扩展名的文件名、扩展名;
工作目录:%p,%p表示当前目录;
菜单项目名称:编译Java程序
最后,分别选中“保存活动文件”、“输出到列表方块”、“捕捉输出”。
在“高级”菜单下,选择“工具配置”,再次添加:
命令行:C:\Java\jdk1.5.0_06\bin\java.exe %n
%f、%n、%e分别表示完整文件名、不含扩展名的文件名、扩展名;
工作目录:%p,%p表示当前目录;
菜单项目名称:运行Java程序
最后,分别选中“保存活动文件”、“输出到列表方块”、“捕捉输出”


源文档 <http://www.cublog.cn/u/11335/showart.php?id=71772>

Friday, 20 April 2007

C with input argue

main(int argc,char *argv[])
{
char b[10];int c,d;

strcpy(b,argv[1]);/*get the first parameter*/

c=atoi(b);/*convert string to numbers*/
d=c+1;

printf("argv[1] is %s\n\n",b);
printf("convert argv[1] is %d\n",c);
printf("d=c+1 is %d\n",d);
}

feed之我见

1. 微软的space,rss format;
调google的blogger的feed,会下载一个xml文件或者是直接以xml方式打开;调用space的feed完美;调用其它格式的feed效果也不错(除了直接调用blogger的feed,但是经格式转换后,没有问题,不管是什么格式)。

2. google的blogger,atom fromat;
调用微软的space的feed,会同不行很差或者时间排序混乱,尤其是当space中的post经过编辑,删除后。
其实blogger对feed的调用本身存在问题:同一个feed,在space中显示是正确的,blogger中就经常与之不同,延时大很明显,而且显示顺序混乱,可能是blogger系统自己有备份feed的功能?而且就连调用blogger的feed也是很多问题。详见本夜footer.

3. feedburner.com 类似接口的第三方平台。
可以导入一个feed,然后让这个feed转换成你需要的feed format(rss,atom,或者自动smart识别转换)。它的存在说明了当今feed方面的技术的不统一。

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

summy:space调用feed--删除的post,顺序,同步速度都没问题。唯一是atom的feed list的链接问题。
blogger调用feed--google reader包括在内,删除的post显示在list里,顺序混乱,同步速度很差。

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

a). space和其他微软产品一样:广告多;扩展性差,给你什么你就用什么,别想发挥自己的想象力,一般用微软产品的人不想在这方面浪费时间和精力,也不具备这方面的能力,其不支持javascript,实在让我鄙视。
傻瓜相机,会按快门就行,你可以什么都不懂,也可以使用;系统稳定性较好。

b). blogger就像opensource社区的产品:无广告,免费;自由度极高,扩展性非常好,和其他技术融合度很好,可以调用其它平台的产品(space只能调用微软给你的badget)。
单反相机,手动功能丰富,需要一定的了解才能运用自如;其也具备opensource产品的特点,bug很多。

solidworks画螺纹

其实在零件中也可以显示螺纹线,只不过SW的默认选项不显示螺纹装饰线罢了。具体方法如下:
在"工具--选项--文件属性--注解显示"选中"上色的装饰螺纹线"和"显示注解"选项,按回车键保存设置。然后,用异型导向孔命令,在"孔规格" 属性管理中,"孔规格"选"螺纹孔"图标;"标准"选"ISO"项,同时在下面的"选项"中选中"装饰螺纹线"就可以了。

Tuesday, 17 April 2007

Virginia Tech School Shooting Video

Virginia,上个星期重温海上钢琴师,那富有传奇色彩的virginia号在我头脑中徘徊多日,周日晚就传来了virginia的这个惨案。。。。。



coord break旋转对称性问题总结

surfac: coord break如果和光源或者IMA surface的距离为0,会产生,正负方向旋转不对称的现象,不知道是不是个bug。
此问题发现在otter optics probe的设计之中。

解决方法:
a) coord break和光源或者IMA surface的距离设置为较小的剧烈,即可解决,比如0.0001,这样比较make sense。如果距离太小,0.000000000001,zemax也会出现对称性问题,可能是zemax对数字精度有一定的limit,如此小的数字当成0处理,所以又出现了之前提到的tilt不对陈问题。
但是此时各部件间距为相互垂直距离,而不是中心距离。
此种设计适合对光源和成像面的旋转;比如光源旋转后,其中心不因旋转而改变,所以各部件间距仍有意义。
b) 精确定位各光学器件的距离,如果要旋转,必须被旋转部件被两coord break前后包住;每部件间距离为0,此部件与其它部件的距离由之前的部件的thickness和最后的coord break确定(add fold mirror的默认设置)。如此也可以实现对称性。
但是,(虽然各部件距离是两部件中心距离),旋转角度很受限制,因为部件的旋转,导致其前后各部件无法在同一条线上。

Saturday, 14 April 2007

conic of surface

Standard


The most commonly used optical surface is a spherical surface. The sphere is centered on the current optical
axis, with the vertex located at the current axis position. ZEMAX treats planes as a special case of the sphere (a
sphere with infinite radius of curvature) and conics as a special case as well. The "sag" or z-coordinate of the
standard surface is given by


where is the curvature (the reciprocal of the radius), is the radial coordinate in lens units and is the conic
constant. The conic constant is less than -1 for hyperbolas, -1 for parabolas, between -1 and 0 for ellipses, 0 for
spheres, and greater than 0 for oblate ellipsoids. For more information on conic constants, see “REFERENCES
ON LENS DESIGN” on page 15. The standard surface does not use any of the parameter values.

Friday, 13 April 2007

zemax - Ray Aiming

I.光线定位 ( Ray Aiming )

Fig.1 在System/General中选择Ray Aiming卷标

 

II.光线定位的类型(Ray Aiming Type)

Fig.2 选择任一种光线定位的类型

(1)无 ( None ) 使用近轴入瞳尺寸和位置来决定光线追迹,忽略入瞳像差。对于中等视场的小孔径系统选用,表示不需使用光线定位。

(2)近轴光线参考 ( Aim to unaberrated [paraxial] stop height )使用近轴光线计算光阑面半径,考虑入瞳像差。对于F number小或大视场角的系统时选用。通常优先使用近轴光线参考。

(3)实际光线参考 ( Aim to aberrated [real] stop height )使用实际光线计算光阑面半径,考虑入瞳像差。对于F number小或大视场角的系统时选用。实际光线追迹影响近轴光阑尺寸时使用。

 虽然光线定位比近轴入瞳定位更精确,但在做运算的时候,大多数的追迹光线将花费2到8倍的时间。

III.设定结果

Fig.3 未使用光定位前


Fig.4 使用光线定位后的结果

天道酬勤,厚积勃发

Sunday, 1 April 2007

31.3.07

原来powerpoint显示效果不佳原因在于dpi这个东西,疏忽了,只是扫描的时候常常记起这个词.
photoshop并非全矢量作图,还是那句老话,修图它行,作图还得illustrator,coreldraw这些纯矢量作图软件.

My photo
London, United Kingdom
twitter.com/zhengxin

Facebook & Twitter