不能忍了,D80+18-200VR 到了这个地步!!

| 0 评论

exchange 

D80 18-200

18-200gn

D80gn

 

简单数学计算得到。瑞典比国内便宜个800块钱不成问题。。。

恩?怎么还便宜几百?真的不能忍了!!!同志们。。怎么办?

[+/-] Read More...

微软发飙,开始大力打击盗版,WGA,OGA其上。如何应对?

| 0 评论

微软中国公司相关负责人告诉新浪科技,微软在正版化方面一直坚持3E策略,即Education(教育)、Engineering(技术)、Enforcement(执法)。

看看微软是不是要动真格的了。

网友的反应包括:

  • 支持的

    • 肯定被砍死了,别理他们。
  • 中立的(觉得事不关己)

    • 自己用vista,或者Linux。。。WPS。。。也不理他们。
    • 用OEM正版的。Home版的。
    • 有钱人。。。
  • 反对的(当然是最多的人)

    1. 人群
      • 广大穷苦人民,学生
      • 虽然白领,但是还要买车买房,没钱买系统啊
      • 就算有钱也不买,微软太欺负人了
      • 。。。
    2. 预计对策
      • 躲避策略
        1. 关闭自动更新,反正微软也不对XP进行支持了。即使要更新,用360等其他软件选择性的更新即可。
        2. 改用Linux或其他操作系统,很多人视此为linux的机会啊。Ubuntu加油,Centos加油!
        3. 用该死的Vista。虽然不好用,有些更是因为跑不动。所以说该死。。。
      • 强硬派
        1. 妈的,微软在欧洲被反垄断罚了那么多钱,中国为什么不行?1999元的正版有价格歧视。我们应该那其法律武器,整死微软。 为什么美国金融危机的损失要拿中国人民开刀。。。强烈反对,血战到底。。。
        2. 有人用一个月工资打赌,不出一个月,破解必出!!相信中国破解软件工程师的能力!!
        3. 等“瘟到死”降价到百元,我们就用正版。。。!!!
        4. 每小时黑屏一次挺好,保护视力,预防近视。一黑屏就远眺,多爽,省的自己去找软件了。
    3. 相关链接:

本文不代表个人观点,材料搜集自网上。希望微软不要找我麻烦。

[+/-] Read More...

Principles of Software Testing[ZZ]

| 0 评论

original article: http://www.the-software-experts.de/e_dta-sw-test-principles.htm

 

What is not Software Testing?

  • Test is not debugging. Debugging has the goal to remove errors. The existence and the approximate location of the error are known. Debugging is not documented. There is no specification and there will be no record (log) or report. Debugging is the result of testing but never a substitution for it.
  • Test can never find 100% of the included errors. There will be always a rest of remaining errors which can not be found. Each kind of test will find a different kind of errors.
  • Test has the goal to find errors and not their reasons. Therefore the activity of testing will not include any bug fixing or implementation of functionality. The result of testing is a test report. A tester must not modify the code he is testing, by no means! This has to be done by the developer based on the test report he receives from the tester.

What is Software Testing?

  • Test is a formal activity. It involves a strategy and a systematic approach. The different stages of tests supplement each other. Tests are always specified and recorded.
  • Test is a planned activity. The workflow and the expected results are specified. Therefore the duration of the activities can be estimated. The point in time where tests are executed is defined.
  • Test is the formal proof of software quality.

Overview of Test Methods

Static tests
The software is not executed but analyzed offline. In this category would be code inspections (e.g. Fagan inspections), Lint checks, cross reference checks, etc.
Dynamic tests
This requires the execution of the software or parts of the software (using stubs). It can be executed in the target system, an emulator or simulator. Within the dynamic tests the state of the art distinguishes between structural and functional tests.
Structural tests
These are so called "white-box tests" because they are performed with the knowledge of the source code details. Input interfaces are stimulated with the aim to run through certain predefined branches or paths in the software. The software is stressed with critical values at the boundaries of the input values or even with illegal input values. The behavior of the output interface is recorded and compared with the expected (predefined) values.
Functional tests
These are the so called "black-box" tests. The software is regarded as a unit with unknown content. Inputs are stimulated and the values at the output results are recorded and compared to the expected and specified values.

 

Test by progressive Stages

The various tests are able to find different kinds of errors. Therefore it is not enough to rely on one kind of test and completely neglect the other. E.g. white-box tests will be able to find coding errors. To detect the same coding error in the system test is very difficult. The system malfunction which may result from the coding error will not necessarily allow conclusions about the location of the coding error. Test therefore should be progressive and supplement each other in stages in order to find each kind of error with the appropriate method.
Module test
A module is the smallest compilable unit of source code. Often it is too small to allow functional tests (black-box tests). However it is the ideal candidate for white-box tests. These have to be first of all static tests (e.g. Lint and inspections) followed by dynamic tests to check boundaries, branches and paths. This will usually require the employment of stubs and special test tools.
Component test
This is the black-box test of modules or groups of modules which represent certain functionality. There are no rules about what can be called a component. It is just what the tester defined to be a component, however it should make sense and be a testable unit. Components can be step by step integrated to bigger components and tested as such.
Integration test
The software is step by step completed and tested by tests covering a collaboration of modules or classes. The integration depends on the kind of system. E.g. the steps could be to run the operating system first and gradually add one component after the other and check if the black-box tests still run (the test cases of course will increase with every added component). The integration is still done in the laboratory. It may be done using simulators or emulators. Input signals may be stimulated.
System test
This is a black-box test of the complete software in the target system. The environmental conditions have to be realistic (complete original hardware in the destination environment).

Which Test finds which Error?

Possible error

Can be best found by

Example

Syntax errors

Compiler, Lint

Missing semicolons, Values defined but not initalized or used, order of evaluation disregarded.

Data errors

Software inspection, module tests

Overflow of variables at calculation, usage of inappropriate data types, values not initialized, values loaded with wrong data or loaded at a wrong point in time, lifetime of pointers.

Algorithm and logical errors

Software inspection, module tests

Wrong program flow, use of wrong formulas and calculations.

Interface errors

Software inspection, module tests, component tests.

Overlapping ranges, range violation (min. and max. values not observed or limited), unexpected inputs, wrong sequence of input parameters.

Operating system errors, architecture and design errors

Design inspection, integration tests

Disturbances by OS interruptions or hardware interrupts, timing problems, lifetime and duration problems.

Integration errors

Integration tests, system tests

Resource problems (runtime, stack, registers, memory, etc.)

System errors

System tests

Wrong system behaviour, specification errors

[+/-] Read More...

学习使用LaTeX【ZZ】

| 0 评论

zz from http://bbs.ctex.org/forums/index.php?showtopic=15314
[整理的关于使用LaTeX的资料,内容来源:aloft编[ctex-faq]]

1 安装CTEX中文套件

1.1 初始安装
下载ctex中文套件(www.ctex.org).
安装ctex中文套件,自定义安装到D盘.
升级ghostscript.
升级gsview,在options->easy configure下选择升级的ghostscript.
升级winedt,直接覆盖安装.
MiKTEX使用升级向导升级.

1.2 升级添加宏包
已编译的,有.sty或.cls文件的,只需把文件放在localtexmf\tex\LaTeX\下的某个目录下,然后再刷新系统的文件名数据库就可以使用了.teTeX和fpTeX使用texhash命令.
或者把这些宏包和TEX源文件放在同一目录下,不用刷新文件名数据库,但只有同一个目录下的文件可以使用这些宏包.
如果使用的是宏包的源文件.先读readme文件,对.ins文件运行LaTeX命令生成.sty文件,对.dtx文件运行LaTeX命令生成帮助文档.

2 软件配置

2.1 winedt

2.1.1 缺省定义gsview工具按钮有可能无法使用.需要在注册表更改psfile下面的shell->open->command键值.
2.1.2 运行WinEdt目录下的宏可以添加metapost工具.
2.1.3 右键点击WinEdt状态栏,确认show custom info a已选取.点击对应的状态栏可以激活--src选项,这个是使用dvi search的必要条件.

3 新手入门

3.1 参考资料
[lshort中文版],[ctex-faq],薛定宇著[LaTeX科学文件处理软件入门].
清泉编制文档模板.

3.2 测试LaTeX

3.2.1 英文例子
\documentclass{article}
\begin{document}
This is a test file.
\end{document}
这个例子需要保存为.tex后缀的文件,然后用LaTeX编译,生成的DVI文件可以用DVI浏览器进行查看.
或者用dvips转换成PostScript文件.假设文件名是test.ctx.生成PostScript 文件的完整编译过程是:
LaTeX test
dvips test

3.3 编写TEX文档的编辑器
windows下使用winedt,或者是UltraEdit,Editplus.
linux下使用vi,Emacs.

4 中文处理

4.1 CJK还是CCT
推荐使用CJK处理中文.
CJK比CCT的优越之处有以下几点:
1. 字体定义采用LaTeX NFSS标准,生成的DVI文件不必像CCT那样需要用patchdvi处理后才能预览和打印.而且一般GB编码的文件也不必进行预处理就可直接用LaTeX命令进行编译.
2. 可使用多种TrueType字体和Type1字体,生成的PDF文件更清楚,漂亮.
3. 能同时在文章中使用多种编码的文字,如中文简体繁体日文韩文等.
当然,CCT在一些细节上,如字体可用中文字号,字距,段首缩进等更符合中文的习惯.而CJK就没有针对中文习惯指定特殊的排版标准.

4.2 CJK的例子
\documentclass{article}
\usepackage{CJK}
\begin{document}
\begin{CJK*}{GBK}{kai}
这是中文楷体字。
\end{CJK*}
\end{document}

4.3 CJK和CJK*
不建议使用CJK模式.
CJK*模式自动忽略中文字符间的所有空格.加空格的方法是在空格前面加上\ 字符.实际上CJK*模式忽略中文字符后面的空格,因此中文后面如果接着英文,必须加上保护的空格\ 或者~ 符号,否则可能造成断行错误.

4.4 中英文混排时正确分行
首先,英文标点符号后要留空格,这是英文的习惯,否则TEX无法断句.
其次,要用空格隔开中英文字符,TEX才能正确分行.
CJK宏包重新定义了符号~的意义.~的原始定义是不可断行的空格,CJK将其重定义成一个比较合适的弹性距离,大约相当于四分之一个汉字宽度,用于分隔中英文字符.我们通过使用命令
\CJKtilde
来实现~的重定义.如果要恢复原始定义,可以用命令
\standardtilde
注意:在CJK*模式下中文字符后面的空格会被忽略,因此中文字符后面必须加上保护的空格\ 或者~符号来隔开英文字符.

4.5 生成支持中文拷贝粘贴的PDF文件
生成可以拷贝粘贴中文的PDF文件目前只有dvipdfmx(原名dvipdfm-cjk)可以做到,它必须配置成直接使用中文TrueType字库.

4.6 CJK中使用的字库
可以使用矢量字库如Type1或是TrueType字库,也可以使用点阵字库如pk字库.
在CJK中可以使用Type1字库和TrueType字库,都能产生很好效果的输出,但有许多细微的差别,输出结果取决于所用的工具.
1. 使用dvips生成PostScript 文件
dvips可以直接使用Type1字库,生成的PostScript文件中包含了字符的矢量描述,具有很好的缩放效果.
dvips不能直接使用TrueType字库,因此必须通过ttf2pk生成中间的pk字库,这是一种点阵字库,所以生成的PostScript文件在效果较差.
2. 使用dvipdfm生成PDF文件和dvips类似,可以直接使用Type1字库或者通过ttf2pk间接使用TrueType字库.
3. 使用pdfLaTeX生成PDF文件可以直接使用两种字库,因此都可以产生效果很好的输出.
4. 使用dvipdfmx生成PDF文件可以直接使用两种字库,因此都可以产生效果很好的输出.而且直接使用TrueType字库时生成的PDF文件是唯一能支持对中文内容进行正常拷贝粘贴的.(推荐使用)

5 帮助文档

5.1 宏包文档
TEX系统安装时候带的LaTeX宏包,都可以在TEX 的安装目录下的
texmf\doc\LaTeX
找到

5.2 参考书
LaTeX: A Document Preparation System
LaTeX for Word Processor Users
lshort (The Not So Short Introduction to LaTeX2e)
A Gentle Introduction to TEX
LaTeX2插图指南
LaTeX2e for class and package writers
The TeX Book
LaTeX Manual

5.3 查询LaTeX命令和参数的缺省定义
首先你可以直接搜索相应的LaTeX宏包以及同一目录下的其他文件.如果你有宏包的源文件(.dtx) 的话,搜索源文件会更方便些.而且源文件中会有详细的说明.对于这些源文件,可以直接用LaTeX 编译,产生说明文档.LaTeX宏包的源文件一般放在texmf\source\LaTeX\目录下.
例如LaTeX标准文档类的源文件就是texmf\source\LaTeX\base\classes.dtx
如果这些文件里都找不到定义,则有可能在LaTeX内核中定义.你可以搜索texmf\source\LaTeX\base\目录下的其他.dtx文件,所有的LaTeX内核定义都在那里了.
如果还没有的话,那就可能是TEX 的基本命令或者定义了,查询Donald E. Knuth的The TEXbook,CTEX FTP上可以下载该书的源文件.

5.4 在ctex论坛http://bbs.ctex.org查找资料

6 排版
查阅参考资料.

7 LaTeX辅助工具
使用辅助工具可以方便LaTeX的编写工作.

公式编辑器:
TeXaide
这个是MathType的TeX专用版本.它的使用方法和Word中的公式编辑器一样.
http://www.dessci.com/en/products/texaide/

图形工具:
metagraf
可以生成MetaPost格式图型的制图工具.
http://w3.mecanica.upm.es/metapost/metagraf.php
ImageMagick
多功能图形工具,可以转换图片格式把其他格式转存成eps格式.
http://www.imagemagick.org/

制表工具:
tablas
用图形界面制表,再把表格转换成LaTeX编码.
http://www.informatica.us.es/~calvo/latex.html

[+/-] Read More...

See the series photo of Blue grotto and Get your own Slide show

| 0 评论

 

Picasa Web AlbumsFullscreen

 

想要这个效果? follow me

  1. Open the album you want to display in Picasa Web Album.
  2. Right-click on the button and "Copy shortcut" (?).
    or just open Slideshow, and copy the address of the page.
    e.g. http://picasaweb.google.com/zcambridge/MaltaBlueGrotto#slideshow
  3. Replace http://picasaweb.google.com/zcambridge/MaltaBlueGrotto#slideshow by your copied address in the code below:

  4. Now you can embedded your code in your blog anywhere you want.

There is a more convinent website doing this , but I don't want the advertisment on it. Thus my version is posted here. haha .

enjoy!!

[+/-] Read More...

linux下vnc终于设置好了,总结

| 0 评论

搜集网上资料,整理适合自己情况,主要是为了远程等服务器跑cadence。

 

1. 检查vnc客户端和服务器是否已经安装在你的系统中:
[user@centos ~]$ rpm -q vnc vnc-server
package vnc is not installed
vnc-server-4.0-11

 

2、设置登陆到Gnome/KDE桌面
a.
[root@ics-pc ~]# cat /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that. 
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/vnc/sshvnc.html>.
VNCSERVERS="1:username"
VNCSERVERARGS[1]="-geometry 800x600 -alwaysshared -depth 24"
 
注:
1. 红色部分就是被修改或增加的部分
2. -alwaysshared代表允许多用户同时登录 -depth代为色深,参数有8,16,24,32。
3. 我试验了,要想跑cadence用24没问题。 因为cadence只支持8或24.
b.
[root@ics-pc ~]# vi /root/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
 unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session & #set starting GNOME desktop
#startkde & #kde desktop
#twm & #Text interface
注:
1. 红色部分就是被修改或增加的部分
2. 普通用户的xstartup在~/.vnc/xstartup.
3. 想用什么样的桌面就怎么配,最后3行里选一个就行。

c.

重启VNC即可。

3、VNC的启动/停止/重启
$ service vncserver start/stop/restart
关闭具体的vncserver命令:
$ vncserver -kill :1
$ vncserver -kill :2
4、设置密码
# vncpasswd
$ vncpasswd
 

5、客户端登陆

  • 用vnc客户端(viewer)登陆:
服务器地址可以是:IP或域名
端口通过以下两种办法查:
# netstat -tlnp |grep vnc
启动服务的时候也会出现如下红色

[centospub@localhost ~]$ vncserver

New 'localhost.localdomain:7 (centospub)' desktop is localhost.localdomain:7

Starting applications specified in /home/centospub/.vnc/xstartup
Log file is /home/centospub/.vnc/localhost.localdomain:7.log

 
这个例子里是7,则用: IP或域名:7  登陆。
 
  • 用浏览器登陆:
服务器地址: 一样
端口:要加个5800到原来的端口上
同样的例子: 用: IP或域名:5807  登陆。
 
6. 其他技巧:

设置vncserver启动变量:
为了使vncserver在每次启动时保持不变的端口号(5801或1)
在/etc/rc.d/rc.local文件中添加命令:
rm -f /tmp/.X11-unix/X*
rm -f /.vnc/*.pid
rm -f /.vnc/*.log
这样,每次启机,系统会先把上次非正常关机时留下的临时文件删除。

附注:

[原创]vnc远程连接linux服务器显示问题

2007-10-12 15:40

今天在服务器上装了 ic5141,配置好环境变量后运行提示:
*ERROR* Failed to find either 24-bit TrueColor or 8-bit PseudoColor Visual .
*WARNING* Failed to find eiher 24-bit TrueColor or 8-bit PseudoColor Visual.


在vnc上设置显示模式示果
之后更改vnc设置文件(/usr/bin/vncserver)中depth参数,

由$depth = 16;改为$depth=24;
运行后正常。

我自己用的并未成功。直到用了文章中2-a的设置才可以跑cadence。

 

Useful Links:

庖丁解牛lagvin 写得心得

这个里边有很多技巧问答。

[+/-] Read More...

Using screen for remote interaction (ZZ)

| 0 评论

Using screen for remote interaction

By Phil Hollenback on August 22, 2006 (8:00:00 AM)

Recently I needed to do some distance education; one of my coworkers wanted me to show him how to do software builds on Linux. The only problem was that I'm on the East Coast and he is on the West. How could I show him the build and install process? After considering some alternatives, we found our solution in GNU Screen.



I considered using the standard Unix utility script to save a log of my typing. script has several problems, not the least of which is the horrible resulting output (script saves everything, including carriage returns and corrections). In addition, this would be completely non-interactive. If my coworker had a question or needed a clarification, we would have to correspond via email afterward. That would be a frustrating experience for both of us.

Another possible solution would be to use VNC. My coworker could connect to my display, and we could alternate control of the mouse and keyboard. That approach seemed like overkill, since what I wanted to demonstrate was purely command-line work. It would also be difficult to generate a log of a VNC session. Finally, technical limitations dictated that the only way he could connect to my machine for the demonstration was over a simple SSH connection, so this dictated a purely command-line solution.

Screen is one of those tools that is hard to explain but pure genius once you see it in operation. The description from its official Web site doesn't help much:

Screen is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells.

Basically, screen allows you to create virtual terminals which are not connected to your actual xterms or console screens. You can then disconnect from a screen session and reconnect from somewhere else while preserving your shell or other running processes. For an introduction to screen, check out this Linux.com article.

This is just the beginning of screen's power and flexibility. You can connect to a session more than once using the -x argument to screen. That means you can for example leave your mail program running in a terminal (under screen) at work and then connect from home to read your mail in the same process. There's no need to disconnect at work, and when you come back in the next morning your mailer will be exactly as you left it, with all your state perfectly preserved.

Screen takes this feature, which is called multi-display mode, to the next level with multi-user mode. In multi-user mode more than one user can access and control a screen session. The problem with this mode is that it's not obvious how to set it up. Here's what I ultimately figured out with the help of some Google searching:

  1. Set the screen binary (/usr/bin/screen) setuid root. By default, screen is installed with the setuid bit turned off, as this is a potential security hole.

  2. The teacher starts screen in a local xterm, for example via screen -S SessionName. The -S switch gives the session a name, which makes multiple screen sessions easier to manage.

  3. The student uses SSH to connect to the teacher's computer.

  4. The teacher then has to allow multiuser access in the screen session via the command Ctrl-a :multiuser on (all screen commands start with the screen escape sequence, Ctrl-a).

  5. Next the teacher grants permission to the student user to access the screen session with Ctrl-a :acladd student where student is the student login ID.

  6. The student can now connect to the teacher's screen session. The syntax to connect to another user's screen session is screen -x username/session.

At this point the teacher and student both have control of the session. Note that there are security implications to this -- the student is operating the session as the teacher and could potentially do something to damage the system. If you don't trust your students then you should probably use a special teacher account and not your normal login account. The teacher can also make the student's session read-only. To do this, use the aclchg screen command to remove write access for the student: Ctrl-a :aclchg student -w "#". The student can then only observe the teacher's actions. Otherwise, the teacher will have to let the student work on the honor system.

While my example centers on one teacher and one student, many users could attach to one session. There could even be multiple teachers and students.

What about communication between teacher and student? Well, we used a telephone, but you could use instant messaging, IRC, or VoIP for asking questions. There is also an message feature in multiuser screen: Ctrl-a :wall message will write a message to all users connected to a screen session. One problem with this is that it uses the terminal status line. In an xterm this is the window titlebar area, which, depending on your window manager, may not be very obvious.

The final ingredient for using screen as a teaching tool is logging. With a log of all the terminal output, my coworker and I would have an exact transcript of what we did in case there were any questions later. As I mentioned earlier, the standard Unix tool script is the obvious answer, but it is a very limited tool and does not produce very readable output. You also can't turn it on and off inside a session if for example you want to run a full-screen tool such as a text editor.

Fortunately screen comes with a comprehensive logging facility that is much more sophisticated than what script can do. Screen's logging can be turned on or off at any time with Ctrl-a H, or you can use the -L switch when starting screen to enable it by default. The log file is written to the current directory under the name screenlog.n, where n is incremented by one for each new log.

The logfile will contain the output of your session with corrections and cursor movements already evaluated and applied. One caveat is that programs that send control sequences to the screen will still confuse the output. One example of this is GNU ls, which by default colorizes output. You should turn this off in your session by using something like the following bash alias:

 alias ls='ls --color=none'  

With that, all the pieces are in place: multiple users can share a screen session for any sort of command-line-based instruction. The teacher can at any time take control of the session by switching all other users to read-only access. Finally, you can turn on the logging facilities in screen to get an accurate and usable log of the entire session (or just portions of the session if you desire).

I found screen to work extremely well for this purpose, and my coworker was also pleased with the results. Some of the options and controls in screen can be hard to figure out because screen is so powerful and flexible. But I plan to use this tool in the future, and I encourage anyone in a similar situation to try it.

[+/-] Read More...