IEEE754

IEEE754 IEEE754代码 标准表示法 为便于软件的移植,浮点数的表示格式应该有统一标准 (定义) 。1985年IEEE (Institute of Electrical and Electronics Engineers) 提出了IEEE754标准。该标准规定基数为2,阶码E用移码表示,尾数M用原码表示,根据原码的规格化方法,最高数字位总是1,该标准将这个1缺省存储,使得尾数表示范围比实际存储的多一位。 类型 存储位数 偏移值 数符(s) 阶码(E) 尾数(M) 总位数 十六进制 十进制 短实数(Single,Float) 1位 8位 23位 32位 0x7FH +127 长实数(Double) 1位 11 位 52位 64位 0x3FFH +1023 临时实数(延伸双精确度,不常用) 1位 15位 64位 80位 0x3FFFH +16383

2011-07-02 · 1 min · 44 words · -

原码 反码 补码

原码 反码 补码 机器数和真值 在学习原码, 反码和补码之前, 需要先了解机器数和真值的概念. 机器数 一个数在计算机中的二进制表示形式, 叫做这个数的机器数。机器数是带符号的,在计算机用一个数的最高位存放符号, 正数为0, 负数为1. 比如,十进制中的数 +3 ,计算机字长为8位,转换成二进制就是00000011。如果是 -3 ,就是 10000011 。 那么,这里的 00000011 和 10000011 就是机器数。 真值 因为第一位是符号位,所以机器数的形式值就不等于真正的数值。例如上面的有符号数 10000011,其最高位1代表负,其真正数值是 -3 而不是形式值131 (10000011转换成十进制等于131) 。所以,为区别起见,将带符号位的机器数对应的真正数值称为机器数的真值。 例: 0000 0001的真值 = +000 0001 = +1,1000 0001的真值 = –000 0001 = –1 在计算机内,定点数有3种表示法: 原码、反码和补码。 原码: 原码就是符号位加上真值的绝对值, 即用第一位表示符号, 其余位表示值. 比如如果是8位二进制: [+1]原 = 0000 0001 [-1]原 = 1000 0001 第一位是符号位. 因为第一位是符号位, 所以8位二进制数的取值范围就是: [1111 1111 , 0111 1111] 即 [-127 , 127] ...

2011-06-26 · 2 min · 316 words · -

apache basic

apache basic apache path /etc/apache2/apache2.conf /etc/apache2/httpd.conf /var/log/apache2 linux apache 版本 linux 自动安装的 apache: sudo apachectl -v 启动/重启/停止apache服务器 Task: Start Apache 2 Server /启动apache服务 # /etc/init.d/apache2 start or $ sudo /etc/init.d/apache2 start Task: Restart Apache 2 Server /重启apache服务 # /etc/init.d/apache2 restart or $ sudo /etc/init.d/apache2 restart Task: Stop Apache 2 Server /停止apache服务 # /etc/init.d/apache2 stop or $ sudo /etc/init.d/apache2 stop

2011-05-29 · 1 min · 59 words · -

px pt em

px pt em px: pixel,像素,屏幕上显示的最小单位,用于网页设计; pt: point,是一个标准的长度单位,1pt=1/72英寸,用于印刷业; em: 即%,在CSS中,1em=100%,是一个比率,结合CSS继承关系使用。 http://www.douban.com/note/155032221/ http://blog.csdn.net/shizhu_1010/article/details/8089510 http://orgcent.com/android-textview-linespacingextra/

2011-05-28 · 1 min · 12 words · -

html textarea

html textarea TextArea <textarea rows="3" cols="30"> 这里是文本域中的文本 ... ... ... ... </textarea> Code: `` Setting TextArea Size The text area size is determined using the attributes “rows” and “cols”. You can change the size of text area by changing the values of rows and cols. Example Code: text area in status 2sdfsdfsdf

2011-05-28 · 1 min · 52 words · -

开机自动运行

开机自动运行 用户登录时, bash会在用户目录下按顺序查找以下三个文件,执行最先找到的一个. ~/.bash_profile ~/.bash_login ~/.profile 在上述文件中加入相应命令可以启动某些程序. 如: sh /***/tomcat/bin/startup.sh

2011-05-08 · 1 min · 10 words · -

gitosis install

gitosis install 用apt-get update 和 apt-get upgrade 更新当前系统. 安装OpenSSH Server: sudo apt-get install openssh-server 修改ssh服务端配置文件/etc/ssh/sshd_config Port 22 # 修改成你想要的登陆端口,如2222 PermitRootLogin no # 禁止root用户登陆 检查密钥的用户和权限是否正确,默认打开的 设置ssh在接收登录请求之前是否检查用户家目录和rhosts文件的权限和所有 权。这通常是必要的,因为新手经常会把自己的目录和文件设成任何人都有写权限。 StrictModes yes RSAAuthentication yes # 启用 RSA 认证 PubkeyAuthentication yes # 启用公钥认证 ServerKeyBits 1024 #将ServerKey强度改为1024比特 PermitEmptyPasswords no # 禁止空密码进行登录 #修改完成后,重启ssh服务: sudo /etc/init.d/ssh restart 4.安装git: sudo apt-get install git-core 5.安装gitosis (1)建一个临时文件夹,用来存放下载的gitosis文件,如 mkdir ~/tmp (2)安装gitosis cd ~/tmp git clone git://eagain.net/gitosis git://eagain.net/gitosis.git cd gitosis sudo python setup.py install ...

2011-05-04 · 1 min · 106 words · -

git diff

git diff git diff 查看尚未暂存的文件更新了哪些部分 git diff filename 查看尚未暂存的某个文件更新了哪些 git diff –cached 查看已经暂存起来的文件和上次提交的版本之间的差异 git diff –cached filename 查看已经暂存起来的某个文件和上次提交的版本之间的差异 git diff ffd98b291e0caa6c33575c1ef465eae661ce40c9 b8e7b00c02b95b320f14b625663fdecf2d63e74c 查看某两个版本之间的差异 git diff ffd98b291e0caa6c33575c1ef465eae661ce40c9:filename b8e7b00c02b95b320f14b625663fdecf2d63e74c:filename 查看某两个版本的某个文件之间的差异 显示颜色 ~/.gitconfig 中加三行 [color] status = auto branch = auto ui = auto

2011-05-02 · 1 min · 41 words · -

touch

touch touch fileA 更改 fileA 的日期时间, 默认修改 access, modify, change 三个时间, 如果文件fileA不存在touch命令会在当前目录下创建一个空白文件 fileA.

2011-05-01 · 1 min · 13 words · -

shell 判断文件存在

shell 判断文件存在 myPath="/var/log/httpd/" myFile="/var /log/httpd/access.log" -d 参数判断$myPath是否存在 if [ ! -d “$myPath”]; then mkdir “$myPath” fi -f 参数判断$myFile是否存在 if [ ! -f “$myFile” ]; then touch “$myFile” fi “[” 后面要有空格 “]“前面要有空格 另外使用变量时,如: mv $myFile $… myFile 路径中不能有”~” @_@

2011-05-01 · 1 min · 38 words · -

Emacs 快捷键, keys

Emacs 快捷键, keys C = Control M = Meta = Alt|Esc Del = Backspace 基本快捷键(Basic) C-v 向下翻一页 M-v 向上翻一页 C-x C-f 在缓冲区打开/新建一个文件 C-x C-s 保存文件 C-x C-w 使用其他文件名另存为文件 C-x C-v 关闭当前缓冲区文件并打开新文件 C-x i 在当前光标处插入文件 C-x b 新建/切换缓冲区 C-x C-b 显示缓冲区列表 C-x k 关闭当前缓冲区 C-z 挂起emacs C-X C-c 关闭emacs 光标移动基本快捷键(Basic Movement) C-f 后一个字符 C-b 前一个字符 C-p 上一行 C-n 下一行 M-f 后一个单词 M-b 前一个单词 C-a 光标移到行首 C-e 光标移到行尾 M-< 到文件开头 M-> 到文件末尾 ...

2011-05-01 · 4 min · 648 words · -

linux shell sleep,wait

linux shell sleep,wait sleep 5 等待 秒 一、启动后台子任务 在执行命令后加&操作符,表示将命令放在子shell中异步执行。可以达到多线程效果。如下, sleep 10 #等待10秒,再继续下一操作 sleep 10 & #当前shell不等待,后台子shell等待 二、wait命令介绍 wait [作业指示或进程号] 1.等待作业号或者进程号制定的进程退出,返回最后一个作业或进程的退出状态状态。如果没有制定参数,则等待所有子进程的退出,其退出状态为0. 2.如果是shell中等待使用wait,则不会等待调用函数中子任务。在函数中使用wait,则只等待函数中启动的后台子任务。 3.在shell中使用wait命令,相当于高级语言里的多线程同步。 三、例子 1.使用wait等待所有子任务结束。 #!/bin/bash sleep 10 & sleep 5& wait #等待10秒后,退出 #!/bin/bash sleep 10 & sleep 5& wait $! #$!表示上个子进程的进程号,wait等待一个子进程,等待5秒后,退出 2.在函数中使用wait #!/bin/bash source ~/.bashrc fun(){ echo “fun is begin.timeNum:$timeNum” local timeNum=$1 sleep $timeNum & wait #这个只等待wait前面sleep echo "fun is end.timeNum:$timeNum" } fun 10 & fun 20 & ...

2011-05-01 · 1 min · 100 words · -

emacs copy current line

emacs copy current line ;;copy current line (global-set-key (kbd “C-c C-w”) ‘copy-lines) (defun copy-lines(&optional arg) (interactive “p”) (save-excursion (beginning-of-line) (set-mark (point)) (next-line arg) (kill-ring-save (mark) (point)) ) )

2011-04-30 · 1 min · 28 words · -

find command

find command find 命令默认会递归遍历子目录 # find pathname -options find / -name '*task*.log' # find by file size # >100MB find . -type f -size +102400k -name 按文件名查找文件 # -name 按文件名查找文件 find . -name t.sql # 使用通配符时要加引号(单引号/双引号) find . -name 'bookmark*' # . 当前目录 # / 根目录 # 查 3 分钟前修改的文件 find . -mmin +3 -a, and -o, or -type f 表示查找文件而不是目录 -type d 目录类型 -prune prune 的功能就是当遇到某个文件夹的时候,跳过这个文件夹,不进去继续查找。 ...

2011-04-30 · 4 min · 685 words · -

MySQL 备份 还原 导入 导出 export import

MySQL 备份 还原 导入 导出 export import # Export MySQLdump -uwiloon -pPASSWORD --default-character-set=utf8 enlab >enlab.sql # -u 与 username 之前可以有空格, -p 与 password 之间可以有空格, -p 后也可以不跟密码, 命令执行后会提示输入密码. #Import: #1. MySQL>source /path/to/sql/abc.sql; #2. #MySQL -u用户名 -p密码 数据库名 < 数据库名.sql MySQL -uusername -ppassword db_name < db_name.sql http://blog.csdn.net/myron_sqh/article/details/13016945

2011-04-30 · 1 min · 45 words · -

chmod

chmod chmod a+x 1.sh chmod og+rwx 1.sh 格式: [ugoa…][+-=][rwxX…][,…] u 拥有者 g 与拥有者同组的 o 其它用户 a 三者都是 chmod -R a+rw folderName -R 对目录下和所有文件和子目录进行相同的权限变更

2011-04-24 · 1 min · 23 words · -

emacs 自动补全括号

emacs 自动补全括号 ;;; use groovy-mode when file ends in .groovy/.gradle or has #!/bin/groovy at start (autoload ‘groovy-mode “groovy-mode” “Groovy editing mode.” t) (add-to-list ‘auto-mode-alist ‘(".groovy$" . groovy-mode)) (add-to-list ‘interpreter-mode-alist ‘(“groovy” . groovy-mode)) (add-to-list ‘auto-mode-alist ‘(".gradle$" . groovy-mode)) ;;auto pair (defun code-mode-auto-pair () “autoPair” (interactive) (make-local-variable ‘skeleton-pair-alist) (setq skeleton-pair-alist ‘( (?` ?` _ “”") (?( ? _ " )") (?[ ? _ " ]") (?{ n > _ n ?} >) ...

2011-04-23 · 1 min · 99 words · -

emacs auto backup

emacs auto backup (setq backup-directory-alist ‘(("" . “~/backup/emacs/backup”))) (setq-default make-backup-file t) (setq make-backup-file t) (setq make-backup-files t) (setq version-control t) (setq kept-old-versions 2) (setq kept-new-versions 10) (setq delete-old-versions t)

2011-04-23 · 1 min · 29 words · -

shell command basic

shell command basic ascii to binary $ echo -n "A" | xxd -b 0000000: 01000001 A $ echo -n "A" | xxd -b | awk '{print $2}' 01000001 https://unix.stackexchange.com/questions/98948/ascii-to-binary-and-binary-to-ascii-conversion-tools base64 > hex echo "YWJj" |base64 -d|xxd Display the last users who have logged onto the system last Display the user and group ids of your current user id Display who is online w Show who is logged into the system who Show this month’s calendar cal printf export LC_NUMERIC="en_US.UTF-8" printf "%'f\n" 1234567.777 1,234,567.777000 ...

2011-04-23 · 3 min · 585 words · -

emacs 插件安装

emacs 插件安装 #edis .emacs (add-to-list 'load-path "/home/wiloon/.emacs.d/lisp") ;;; use groovy-mode when file ends in .groovy or has #!/bin/groovy at start (autoload 'groovy-mode "groovy-mode" "Groovy editing mode." t) ;;files end with .groovy , open as groovy mode (add-to-list 'auto-mode-alist '(".groovy$" . groovy-mode)) (add-to-list 'interpreter-mode-alist '("groovy" . groovy-mode))

2011-04-23 · 1 min · 46 words · -