2007年12月19日星期三

Fortran常见问题

  1. I/O默认的UNIT编号:2、6是默认的output(即,screen),1、5是默认的input(即,keybord)。
  2. 将浮点数赋值给整数时,直接抛弃小数部分,绝不四舍五入。a=63.49 b=63.51 n1=a+.5=63 n2=b+.5=64
  3. 函数调用时默认使用的是“传址调用”方式,和C/C++不同,这点一定要小心。
  4. include "omp_lib.h" 一定要用双引号。

2007年12月16日星期日

mac使用的一些技巧

摘自:http://xb9he.blogchina.com/xb9he/6361166.html
一、更好地使用MAC的小技巧
1、锁定屏幕
打开系统预置->帐户->点按锁按钮以进行更改->登陆选项->启用快速用户切换,之后在屏幕右上角,就会有你的登陆帐号,点击该帐号->登陆窗口,屏幕就会切换回登陆界面。
2、善用expose
打开系统预置->Dashboard与Expose,设置左上角为全部窗口,右上角为应用程序窗口,左下角为Dashboard,右下角为桌面。这样设置之后,切换窗口可以不用Command+Tab,而是直接将鼠标移到屏幕的左上角……的确很方便。
3、让终端支持中文显示与输入
打开终端(Terminal.App)
编辑个人目录下的.profile,添加

alias ls='ls -a -w -G'
LANG="zh_CN.UTF-8"
export LANG
编辑个人目录下的.inputrc(默认不存在)

set convert-meta off
set input-meta on
set output-meta on
打开终端菜单上的终端->窗口设置->仿真,去掉忽略非ASCII字符
终端->窗口设置->显示,选上宽字形,设置UTF-8为默认字符集,并将设置用作预设即可。

4、X11Forwarding
修改/private/etc/sshd_config文件中的X11Forwarding项为yes。

二、快捷键
在Finder里点击Command + K:可以方便地打开SMB连接,服务器地址填入smb://server/
Command + Option + H:隐藏其它应用程序,突出显示当前程序
Command + A:全选
Command + C:拷贝
Command + O:打开(类似鼠标双击)
Command + V:粘贴
Command + N:建立新文件夹
Command + X:拷贝并删除
Command + W:关闭窗口
Command + P:打印
Command + Option + W:关闭所有窗口
Command + S:文件存盘
Command + Q:退出软件
Command + M:建立替身
Command + Y:弹出所选磁盘
Command + Z:恢复上一步状态
Command + I:查看所选对象信息
Command + Delete:把所选对象移进垃圾桶
Command + R:显示原身

三、我安装的免费应用软件
快捷启动:Quicksilver
输入法:FunInputToy
网页浏览:Firefox,可以作为safari的替代,safari对部份网页的支持还不够完善。
FTP:cyberduck
文字处理:CotEdit,中文支持相当好,也支持语法高亮,普通应用足够了。
即时通讯:Skype,Microsoft Messenger,LumaQQ
视频播放:MovieTime,RealPlayer,MPlayer OSX,Flip4Mac
解压缩:Stufflt Expander
看图:Xee
察看电池状态:coconutBattery
地图:Google Earth
思维导图:FreeMind
局域网通讯:IPMessenger
无线网络挖掘:iStumbler
终端服务连接:Remote Desktop Connection
网络音乐:Last.fm
四、商业软件
流程图绘制:OmniGraffle Professional,MAC下面的流程图,画出来果然更漂亮
项目管理:OmniPlan,类似于微软的Project
虚拟机:Parallels Desktop
软件下载:Speed Download
思维导图:Mindjet MindManager,还是有不少人喜欢用它,虽然freemind能打开MM,但MM不能打开FREEMIND,还是装上
办公套件:Office 2004、iWork06
程序编辑:TextMate
五、Widget
系统状态:iStat Pro
字典:WikiPedia
日历:ChinaCalendar

mac下终端和vi中的彩色显示

摘自:http://nksmiles.nkstar.cn/archives/22
1、终端设置:
(1)修改/etc/bashrc文件,使ls默认有彩色显示:
$ sudo vi /etc/bashrc
添加一行:
alias ls=’ls -G’
下次开启终端ls就是彩色显示了。

2、vi设置:
首先,进入vi:
$ vi
:e $VIMRUNTIME/vimrc_example.vim
:saveas ~/.vimrc
:e $VIMRUNTIME/gvimrc_example.vim
:saveas ~/.gvimrc
退出来,重进vi,应该已经可以高亮显示了。

2007年12月15日星期六

Debian常用包命令

摘自:linuxidc.com

dpkg – Debian 包安装工具

apt-get – APT 的命令行前端

aptitude – APT 的高级的字符和命令行前端

synaptic – 图形界面的 APT 前端

dselect – 使用菜单界面的包管理工具

tasksel – Task 安装工具

dpkg-reconfigure - 重新配置已安装的软件包(如果它是使用 debconf 进行配置的)

dpkg-source - 管理源码包

dpkg-buildpackage - 自动生成包文件

apt-cache - 在本地缓冲区检查包文件

apt-get check # 更新缓冲区并检查损坏的软件包

apt-cache search pattern # 按文本描述搜索软件包,看有哪些包可供选择

apt-cache policy package # 软件包的 priority/dists 信息

apt-cache show -a package # 显示所有 dists 中软件包描述信息

apt-cache showsrc package # 显示相应源码包的信息

apt-cache showpkg package # 软件包调试信息

dpkg --audit|-C # 搜索未完成安装的软件包

dpkg {-s|--status} package ... # 已安装软件包描述

dpkg -l package ... # 已安装软件包的状态(每个占一行)

dpkg -L package ... # 列出软件包安装的文件的名称

2007年12月2日星期日

SCP program

The SCP program is a client implementing the SCP protocol, i.e. it is a program to perform secure copying.

The most widely used SCP client is the command line scp program, that is provided in most SSH implementations. The scp program is the secure analog of the rcp command. The scp program must be part of all SSH servers that want to provide SCP service, as scp functions as SCP server too.

Some SSH implementations provide the scp2 program, which uses the SFTP protocol instead of SCP, but provides the very same command line interface as scp. scp is then typically a symbolic link to scp2.

Typically, a syntax of scp program is like the syntax of cp:

scp   SourceFile   user@host:directory/TargetFile
scp user@host:folder/SourceFile TargetFile

As the SCP protocol implements file transfers only, GUI SCP clients are rare, as implementing it requires additional functionality (directory listing at least). For example, WinSCP defaults to the SFTP protocol. Even when operating in SCP mode, clients like WinSCP are typically not pure SCP clients, as they must use other means to implement the additional functionality (like the ls command). This in turn brings platform-dependency problems. Thus it may not be possible to work with a particular SCP server using a GUI SCP client, even if you are able to work with the same server using a traditional command line client.

More comprehensive tools for managing files over SSH are SFTP clients.