2009年9月30日星期三
xcode下開發1
這裡使用的是xcode3.0版本,參考
為了閱讀方便,作者把所有的代碼寫到一起了
---------------main.c------------------------
#import
@class UIImageView;
@interface HelloController : UIViewController
{
UIImageView *contentView;
}
@end
@implementation HelloController
- (id)init
{
if (self = [super init])
{
self.title = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
// place any further initialization here
}
return self;
}
/**
*建立起主要的應用程序VIEW
**/
- (void)loadView
{
// Load an application image and set it as the primary view
contentView = [[UIImageView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]];
[contentView setImage:[UIImage imageNamed: @"helloworld.png" ]];
// Provide support for auto-rotation and resizing
contentView.autoresizesSubviews = YES;
contentView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
// Assign the view to the view controller
self.view = contentView;
[contentView release]; // reduce retain count by one
}
// Allow the view to respond to iPhone Orientation changes
/**
* 為自動旋轉功能准備幾個標志
**/
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
-(void) dealloc
{
// add any further clean-up here
[contentView release];
[super dealloc];
}
@end
/**
* UIApplicationMain()呼叫跑到這裡了
**/
@interface SampleAppDelegate : NSObject
}
@end
@implementation SampleAppDelegate
// On launch, create a basic window
/**
* applicationDidFinishLaunching: 方法
*標准的mainScreen繪制一個新視窗, 它會建立一個導覽控制程序,並知道給一個新的HelloController(UIViewControler子類別)來當作他自己的根源試圖控制程序(Root View Controller)
**/
- (void)applicationDidFinishLaunching:(UIApplication *)application {
UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:[[HelloController alloc] init]];
[window addSubview:nav.view];
[window makeKeyAndVisible];
}
- (void)applicationWillTerminate:(UIApplication *)application {
// handle any final state matters here
}
- (void)dealloc {
[super dealloc];
}
@end
/**
main函數是xcode自動產生的,而且還保持未經過人變動的原貌
他呼叫 UIApplicationMain(),並將主要的應用程序的委派方法名稱,這裡是 @"SampleAppDelegate"傳給他!
*/
int main(int argc, char *argv[])
{
/**
*這裡應該是內存分配
**/
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
printf("hellowrold\n");
int retVal = UIApplicationMain(argc, argv, nil, @"SampleAppDelegate");
[pool release];
return retVal;
}
---------------------------------------------
我創建了一個新的PROJECT,然後把上面的代碼copy過去,運行是報錯.屢試不爽.
後來按照書中的要求一步步來,就沒有出錯了,環境不熟悉阿:
記錄一下:
1 刪除classes 文件夾
2 刪除.xib文件
3 在info.list,我的版本上是helloworld-info.list文件中的"NSMainNibFile"的KEY-VALUE 這一行
4 加入image文件夾,這裡是用ADD NEW GROUP
5 拖文件到這個文件夾中(xcode環境中)
6 用上面的main.m覆蓋原來的內容
7 COMMONAD + ENTER 運行模擬器
如果沒有問題的話就OK了
這裡有幾個小技巧:
COMMAND + <
COMMAND + > 模仿IPHONE橫位
COMMAND + SHIHF + R 可以看到後台運行的情況, 我原來一直不知道printf打LOG信息從那裡看,這下子就知道了:)
INSTRUMENTS的執行方式: instruments是APPLE基於SUN的DTRACE搞的,一直很向往之,終於見識了,設定方法:
XCODE環境 -->RUN --> START WITH PERFORMANCE TOOL ,有幾個方式, 我猜OBJECT ALLOCATION 和 CPU SAMPLER應該是比較常用的. 估計以後查內存洩露的時候可以用到.
2009年9月29日星期二
中醫中講的"陰,陽,虛,實"是怎麼一回事
陰,一般來說就是物質不足
陽,一般來說物質有,但是能量不足
虛, 該有的東西沒有
實, 有了不該有的東西
創建一個github
將一些命令記錄一下,備忘:
http://github.com/bangnew/iPhoneDev
bangnew / iPhoneDev
Description: iPhoneDev edit
Homepage: Click to edit edit
Public Clone URL: git://github.com/bangnew/iPhoneDev.git
Your Clone URL:
git@github.com:bangnew/iPhoneDev.git
Global setup:
Download and install Git
git config --global user.name "Your Name"
git config --global user.email bangbangnew@gmail.com
Next steps:
mkdir iPhoneDev
cd iPhoneDev
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@github.com:bangnew/iPhoneDev.git
git push origin master
Existing Git Repo?
cd existing_git_repo
git remote add origin git@github.com:bangnew/iPhoneDev.git
git push origin master
Importing a Subversion Repo?
Click here
When you're done:
Continue
-------------------
參考:
Git for OS X
http://code.google.com/p/git-osx-installer/
不錯的文章
http://www.dotblogs.com.tw/billy3321/archive/2009/02/06/7064.aspx
http://zh-tw.whygitisbetterthanx.com/#github
subversion
http://twpug.net/docs/Subversion/
2009年9月18日星期五
使用webbench進行壓力測試
對剛搭建好的ngnix+php+mysql環境進行測試
發現http://blog.s135.com/post/288/ 介紹的方法不錯,如法炮製:
[root@CRRACTEST webbench-1.5]# ./webbench -c 500 -t 30 http://172.16.1.70/phpinfo.php
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.
Benchmarking: GET http://172.16.1.70/phpinfo.php
500 clients, running 30 sec.
Speed=26146 pages/min, 17900220 bytes/sec.
Requests: 13073 susceed, 0 failed.
top - 00:08:20 up 4:32, 4 users, load average: 11.29, 3.68, 2.21
Tasks: 253 total, 17 running, 235 sleeping, 0 stopped, 1 zombie
Cpu(s): 27.1%us, 24.6%sy, 0.0%ni, 0.0%id, 0.0%wa, 3.2%hi, 45.1%si, 0.0%st
Mem: 1027068k total, 999464k used, 27604k free, 2924k buffers
Swap: 2064376k total, 537392k used, 1526984k free, 83156k cached
phpinfo.php,是通用的
<?php phpinfo() ?>
這是在虛擬機上進行的測試,效果還可以,記錄一下備查
2009年9月17日星期四
隆重推薦Mysql隨機安裝文檔
慚愧啊,本來想做一個實驗,省事,使用tar.gz版本的mysql, 竟然話了我2個小時,一直啟動不起來,查log,google,都沒有解決.
從新解壓,發現mysql包中有一個安裝文檔
mysql-5.1.38-linux-x86_64-glibc23.tar.gz
INSTALL-BINARY
The basic commands that you must execute to install and use a
MySQL binary distribution are:
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &
居然過去了,隆重推薦,
看來什麽東西都是要常摸一下,多日不搞Mysql了,手生了!
生词本
。 不充分的
。 不适当的,不够格的
“I felt inadequate in my new job, so I left of my own accord."
participation n 分享,参与
Deterrent n. 制止物;威慑物 adj. 阻碍的;制止的
Detective n. 侦探
Intrusive adj. 入侵,闯入
Preventive adj. 预防的;阻止的
Permit n 许可证;执照 vt. , vi
. 许可,允许;准许
She won't permit dogs in the house.
Do you permit you children to smoke?
. 容许,有可能
if my health permits
(of) 允许有
The situation does not permit of any delay.
intuitive adj. 直觉的,本能的; 天生的
recipient n. 接受者
aggregate adj. 总的,合计的
what were your aggregate wages last year? 去年你的工资一共是多少?
facilitate vt . 使容易;使便利
it would facilitate matters if you were more co-operative
the broken lock facilitate my entrance into the empty house
the new underground railway will facilitate the journey to all parts of the city.
Tractors and other agricultural machines greatly facilitate farming.
polymorphic adj 多态的, 多形态的
involved adj (常与in连用)(与...)关系密切的,(与...)有牵连的
。复杂的
compartmental adj. 分成隔间的
coordinating vt, 使协调;使调和 adj, 同等的,并列的 n(数)坐标
counterfeit n.伪造;假冒 vt 伪造;假冒 adj 伪造的;假冒的;模仿的
--a counterfeit coin
repudiate vt., vi 拒绝;断绝关系
to repudiate offers of friendship 拒绝友谊
否定;驳倒
to repudiate a charge of murder 否认谋杀的指控
barbed wire 带刺的铁丝网
qualitative adj 性质的;定性的
a qualitative analysis 定性分析
revence n. 国家的收入;税收
diverse --adj. 不同的;相异的 diverse interests 不同的兴趣
contingency planning -- 应变计划
impose --vt, vi 强迫, 强加
Don't impose yourself on people who don't want you.
restrict to 把...限制(控制,保持)在...
to restrict oneself to two cigarettes a day
occupant n. 1占有者,占领者;2居住者
viability --生存能力,发育能力
discretionary -- ADJ, 任意的,自由决定的
combustion --n. 燃烧
remanence --n. 剩磁
autonomy -- n. 自治,自治權
promiscuous -- 不加區分的, 混雜的
---linux有一個網卡模式是 promiscuous mode
arbitrary --adj. 專橫的;武斷的
an arbitrary interpretation 武斷的解釋
an arbitrary decision 武斷的決定
--任性的;隨心所欲的
my choice was quite arbitrary 我的選擇相當隨意
sprinkler system --自動噴水滅火系統 pre-action sprinkler system
deliberately --adv 故意地
deliberate --vt, vi 商討;研討
adj 周密計劃的;深思熟慮的 taking deliberate action
故意的;別有用心的;存心的 He told us a deliberate lie
從容而謹慎的
反義詞: hasty
hasty -- adj 急速的;匆匆的 ate a hasty meal
倉促的;草率的;急躁的
a hasty old man
they shouldn't have made such a hasty decision
His hasty decision was a mistake
repudiate --- vt, vi 拒絕;斷絕關系 to repudiate offers of friendship
否定;駁倒 to repudiate a charge of murder
badges -- n 徽章;證章 We wear the school badge on our coats
burden--vt, 使負重擔;使麻煩
n, 負荷;負擔;重載
He could not carry the burden alone.
重任
要點;主題;主旨
The burden of the story
instigate --vt.
發起;促成
He instigated the ending of a free working lunch in the company. 他煽動取消公司的免費工作午餐
hierarchy (ies) n 等級制度;階層
A hierarchy of moral values //道德價值的層次
The government is a hierarchy // 政府是官階分明的統治集團
OSI session layer and presentation layer 到底是干啥的?
the primary technology within layer is a gateway.
--這個層次主要的作為類似應用網關
the following protocols operate within the Session layer:
Secure Socket Layer(SSL)
Network File System(NFS)
Structured Query Language(SQL)
Remote Procedure Call(RPC)
The presentation layer is responsible for transforming data received from the application layer into a format that any system following the OSI model can understand. it imposes common or standardized structure and formatting rules onto the data.
--這個層次主要是標准化,格式化數據
the Presentation layer is also responsible for encryption and compression
出自
python寫的改變圖片大小的腳本
用python寫了一個處理圖片的腳本,當然用到了另一個opensource的軟件ImageMagick-6.5.5-5.tar.gz,
安裝是三板斧 configure, make , make install
這裡用到的是python的一個系統調用subprocess.call
#! /usr/bin/env python
import sys, os, subprocess
fileSrc = open('./testClass2.txt','r')
aDict = dict() #創建一個dictionary
for line in fileSrc:
head, tail = line.split(',')
aDict[head]= tail #生成一個dictionary
fileSrc.close()
for atom in aDict:
if int(aDict[atom]) == 1:
srcStr=str('/home/demotest/source/yes/p9_%08d.jpg' % int(atom))
destStr=str('/home/demotest/source/yes/1/1_p9_%08d.jpg' % int(atom))
subprocess.call(['convert', srcStr, '-resize', '180x180', '-bordercolor', 'yellow', '-border', '10x10', destStr])
print '1----True'
elif int(aDict[atom]) == 9:
srcStr=str('/home/demotest/source/yes/p9_%08d.jpg' % int(atom))
destStr=str('/home/demotest/source/yes/9/9_p9_%08d.jpg' % int(atom))
subprocess.call(['convert', srcStr, '-resize', '580x580', '-bordercolor', 'yellow', '-border', '10x10', destStr])
print '9----True'
elif int(aDict[atom]) == 4:
srcStr=str('/home/demotest/source/yes/p9_%08d.jpg' % int(atom))
destStr=str('/home/demotest/source/yes/4/4_p9_%08d.jpg' % int(atom))
subprocess.call(['convert', srcStr, '-resize', '380x380', '-bordercolor', 'yellow', '-border', '10x10', destStr])
print '4----True'
else:
print 'no----True'
我這裡本來嘗試使用cmd.split()方式來,但是測試了半天沒有通過,放棄了,所以就用比較笨的辦法拼出來.
記錄一下! 繼續研究python
2009年9月16日星期三
MAC OS 上删除QIM/IMKQIM
QIM FOR搜狗,下載之安裝上了,心存疑慮,我下的是不是最新版呢,繼續GOOGLE,發現最新的是IMKQIM1.7了,下載之,怎麼用呢?
有用了幾分鍾在本子上照阿找,找到了,就是"多國語言"那裡,勾上即可.
再有疑問?是不是免費的,繼續GOOGLE發現確實要收費,唉,卸載之!!怎麼卸載是一個問題!!!
繼續GOOGLE,發現有免費的FIT
http://fit.coollittlethings.com/
下載之,安裝上了,現在這個用起來還是不錯的,呵呵!
以後再MAC上干活就用他了
如何卸載PIM呢?GOOGLE之
http://terrywang.net/archives/595 寫的不錯,摘錄之:
1.4.5的dmg中的文档带了如何删除的方法
请按照下面步骤删除QIM:
1. 首先在输入法菜单里取消QIM
2. 然后关闭所有当前使用过QIM的程序
3. 进入/Library/Components目录
4. 删除QIM.component
5. 重新登录即可完全删除QIM,QIM在~/Library/QIM目录里保存有用户的一些自定义信息和词库,如果用户不想保留,可以删除这个目录。
删除IMKQIM 1.6的具体步骤:
1. 首先在输入法菜单里取消QIM
2. 然后关闭所有当前使用过QIM的程序
3. 进入/Library/Input Methods目录
4. 删除IMKQIM.app
5. 重新登录即可完全删除QIM,QIM在~/Library/QIM目录里保存有用户的一些自定义信息和词库,如果用户不想保留,可以删除这个目录。
依法操作,果然刪除干淨了!
此文就是用FIT寫得,還支持繁體!!!
記錄一下,備查!
2009年9月12日星期六
安全方面常使用到的one-way algorithm
SHA
MD2
MD4
MD5
DSA , Digital Signature Algorithm, is a approved standard for Digital Signatures that utilizes SHA-1 hashing function
Operational assurance requirements and life cycle assurance requiements
The operational assurance requirements specified in the Orange Book are as follows":
操作保险要求:
System Architecture //系统架构
System integrity //系统完整
Covert channel analysis //转换隧道分析
Trusted facility management //可信设备管理
Trusted recovery //可信恢复
the life cycle assurance requirements specified in the orange Book are as follows:
生命周期保险要求:
Security testing //安全测试
Design specification and testing //设计要求和测试
Configuration management //配制管理
trusted Distribution //可信发布
2009年9月10日星期四
嘗鮮Oracle11gR2 (vmwareserver+OEL5.3+Oracle11gR2)
oracle11gR2出來一段時間了,一直手懶,今天終於提起精神安裝了一下,嘗鮮一下:)
1.在vmware上面安裝OEL5.3版本的linux
安裝方法參考:http://www.oracle.com/technology/obe/11gr1_db/install/oel5gainst/oel5gainst.htm 儘管是oracle 11gR1的
2.解壓oracle下載下來的zip包,開始安裝,這裡遇到一個問題,就是直接在vmware oracle上面運行 runInstall,屏幕狂閃,根本就沒有辦法操作,沒有辦法使用Xmanager,遠程安裝.
3 配置xmanager安裝:
a. /etc/inittab中設置:
id:5:initdefault:
b. Enable XDMCP因為我這裡就是用了gnome所以配置就配置一個:
/etc/gdm/custom.conf
[xdmcp]
Enable=1c. 重啟linux
d. 工作機使用xmanager Broadcast mode
4 開始安裝:
少裝幾個rpm的包
[root@ora11gR2 Server]# rpm -Uvh libaio*
warning: libaio-0.3.106-3.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package libaio-0.3.106-3.2.x86_64 is already installed
package libaio-0.3.106-3.2.i386 is already installed
[root@ora11gR2 Server]# rpm -Uvh libaio-0.3.106-3.2.x86_64.rpm
warning: libaio-0.3.106-3.2.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
package libaio-0.3.106-3.2.x86_64 is already installed
[root@ora11gR2 Server]# rpm -Uvh libaio-devel-0.3.106-3.2.*
warning: libaio-devel-0.3.106-3.2.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:libaio-devel ########################################### [ 50%]
2:libaio-devel ########################################### [100%]
[root@ora11gR2 Server]# rpm -Uvh sysstat*
warning: sysstat-7.0.2-3.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:sysstat ########################################### [100%]
[root@ora11gR2 Server]# rpm -Uvh unixODBC-*
warning: unixODBC-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
error: Failed dependencies:
libqt-mt.so.3 is needed by unixODBC-kde-2.2.11-7.1.i386
qt >= 2.1 is needed by unixODBC-kde-2.2.11-7.1.i386
libqt-mt.so.3()(64bit) is needed by unixODBC-kde-2.2.11-7.1.x86_64
qt >= 2.1 is needed by unixODBC-kde-2.2.11-7.1.x86_64
[root@ora11gR2 Server]# rpm -Uvh unixODBC-2.2.11-7.1.*
warning: unixODBC-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:unixODBC ########################################### [ 50%]
2:unixODBC ########################################### [100%]
[root@ora11gR2 Server]#
[root@ora11gR2 Server]# rpm -Uvh unixODBC-devel-2.2.11-7.1.*
warning: unixODBC-devel-2.2.11-7.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing... ########################################### [100%]
1:unixODBC-devel ########################################### [ 50%]
2:unixODBC-devel ########################################### [100%]
[root@ora11gR2 Server]#
[root@ora11gR2 Server]# cd /u01/app/oraInventory/
[root@ora11gR2 oraInventory]# ls
ContentsXML logs oraInst.loc oui
install.platform oraInstaller.properties orainstRoot.sh
[root@ora11gR2 oraInventory]# ./orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[root@ora11gR2 oraInventory]# pwd
/u01/app/oraInventory
[root@ora11gR2 oraInventory]# cd ../oracle/product/11.2.0/db_1/
[root@ora11gR2 db_1]# ./root.sh
Running Oracle 11g root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/11.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
[root@ora11gR2 db_1]#
完成!
2009年9月6日星期日
linux cmd方式 下製作iso,并burn iso
1. 製作 iso文件 dd if=/dev/dvd of=dvd.iso # for dvd
2.檢查那個刻錄設備
[root@CRRACTEST2 ~]# cdrecord -scanbus
Cdrecord-Clone 2.01 (cpu-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling
Note: This version is an unofficial (modified) version with DVD support
Note: and therefore may have bugs that are not present in the original.
Note: Please send bug reports or support requests to http://bugzilla.redhat.com/bugzilla
Note: The author of cdrecord should not be bothered with problems in this version.
Linux sg driver version: 3.5.27
Using libscg version 'schily-0.8'.
cdrecord: Warning: using inofficial libscg transport code version (schily - Red Hat-scsi-linux-sg.c-1.83-RH '@(#)scsi-linux-sg.c 1.83 04/05/20 Copyright 1997 J. Schilling').
scsibus5:
5,0,0 500) 'TSSTcorp' 'DVD+-RW TS-H653B' 'D300' Removable CD-ROM
5,1,0 501) *
5,2,0 502) *
5,3,0 503) *
5,4,0 504) *
5,5,0 505) *
5,6,0 506) *
5,7,0 507) *
[root@CRRACTEST2 ~]#
3.刻錄
[root@CRRACTEST2 ~]# cdrecord -v -dao dev=5,0,0 dvd.iso
Cdrecord-Clone 2.01 (cpu-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling
Note: This version is an unofficial (modified) version with DVD support
Note: and therefore may have bugs that are not present in the original.
Note: Please send bug reports or support requests to http://bugzilla.redhat.com/bugzilla
Note: The author of cdrecord should not be bothered with problems in this version.
TOC Type: 1 = CD-ROM
scsidev: '5,0,0'
scsibus: 5 target: 0 lun: 0
Linux sg driver version: 3.5.27
Using libscg version 'schily-0.8'.
cdrecord: Warning: using inofficial libscg transport code version (schily - Red Hat-scsi-linux-sg.c-1.83-RH '@(#)scsi-linux-sg.c 1.83 04/05/20 Copyright 1997 J. Schilling').
SCSI buffer size: 64512
atapi: 1
Device type : Removable CD-ROM
Version : 5
Response Format: 2
Capabilities :
Vendor_info : 'TSSTcorp'
Identifikation : 'DVD+-RW TS-H653B'
Revision : 'D300'
Device seems to be: Generic mmc2 DVD-R/DVD-RW.
Current: 0x0011
Profile: 0x0015
Profile: 0x002B
Profile: 0x001B
Profile: 0x001A
Profile: 0x0014
Profile: 0x0013
Profile: 0x0011 (current)
Profile: 0x0010
Profile: 0x000A
Profile: 0x0009
Profile: 0x0008
cdrecord: Found DVD media: using cdr_mdvd.
Using generic SCSI-3/mmc DVD-R(W) driver (mmc_mdvd).
Driver flags : SWABAUDIO BURNFREE
Supported modes: PACKET SAO
Drive buf size : 1376256 = 1344 KB
FIFO size : 4194304 = 4096 KB
Track 01: data 2269 MB
Total size: 2606 MB (258:11.06) = 1161830 sectors
Lout start: 2606 MB (258:13/05) = 1161830 sectors
Current Secsize: 2048
ATIP start of lead in: -150 (00:00/00)
Disk type: unknown dye (reserved id code)
Manuf. index: -1
Manufacturer: unknown (not in table)
Blocks total: 2298496 Blocks current: 2298496 Blocks remaining: 1136666
scsi_set_streaming
Starting to write CD/DVD at speed 17 in real SAO mode for single session.
Last chance to quit, starting real write 0 seconds. Operation starts.
Waiting for reader process to fill input buffer ... input buffer ready.
trackno=0
BURN-Free is OFF.
BURN-Free is OFF.
Performing OPC...
Sending CUE sheet...
cdrecord: WARNING: Drive returns wrong startsec (0) using -150
Starting new track at sector: 0
Track 01: 0 of 2269 MB written.
Track 01: 237 of 2269 MB written (fifo 98%) [buf 99%] 68.4x.
Track 01: 2269 of 2269 MB written (fifo 100%) [buf 99%] 114.5x.
Track 01: Total bytes read/written: 2379427840/2379427840 (1161830 sectors).
Writing time: 218.057s
Average write speed 76.8x.
Min drive buffer fill was 8%
Fixating...
Fixating time: 10.764s
cdrecord: fifo had 37479 puts and 37479 gets.
cdrecord: fifo was 4 times empty and 7479 times full, min fill was 0%.
ref: http://www.cyberciti.biz/faq/linux-burn-iso-images-to-cds-and-cd-rws-howto/
2009年9月2日星期三
如何kill一個 zombie process?
發現production環境上有一個zombie,如何殺掉呢?
top - 13:13:38 up 23 days, 19:49, 1 user, load average: 2.58, 3.43, 3.75
Tasks: 1527 total, 3 running, 1523 sleeping, 0 stopped, 1 zombie
[oracle@oracle02 ~]$ ps aux |awk '{print $8 " " $2}' |grep -w Z
Z 10460
什麽東西呢?
[oracle@oracle02 ~]$ ps -ef |grep 10460
oracle 10460 10431 0 Aug10 ? 00:00:00 [Xsession] <defunct>
oracle 22374 26077 0 13:11 pts/1 00:00:00 grep 10460
[oracle@oracle02 ~]$ kill -9 10460
top發現並沒有去掉,查看一下他的父進程是個啥?
[oracle@oracle02 ~]$ ps -ef |grep 10431
oracle 10431 8971 0 Aug10 ? 00:00:00 /usr/bin/gnome-session
oracle 10460 10431 0 Aug10 ? 00:00:00 [Xsession] <defunct>
oracle 10493 10431 0 Aug10 ? 00:00:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session /etc/X11/xinit/Xclients
oracle 30789 26077 0 13:15 pts/1 00:00:00 grep 10431
[oracle@oracle02 ~]$ kill -9 10431
乾淨了,這個gnome-session是幹嘛的呢?再查一下
參考:http://www.cyberciti.biz/tips/killing-zombie-process.html
2009年9月1日星期二
Guidelines for browsing design
聽一個講座關於wireless Mobile device 開發的,講到User Interface 設計時應該注意的技巧,覺得很有用,記錄一下:
- Use hyperlinks to replace other GUI components
#尽量写hyperlink,不要用gui components ,我的理解是平臺獨立性
- Avoid horizontal Scrolling, use vertical scrolling as possible
#尽量避免横向的scroll bar
- Organize the content hierarchically
- Arrange the hyperlink from top to bottom by importance
#根据重要性来组织内容
- Number the hyperlinks( for one-handed interaction)
#控制hyperlink的密度
- Use link navigation for information searching.
Web technology Layers
學習一個講座,覺得梳理的不錯記錄一下,備查:
Client Layer:
Ajax, HTML/CSS , Flash/RIA
javaScript, Widgets, DOM
protocol Layer:
Soap, XML-RPC, REST
HTTP/HTTPS
Structure Layer
JSON ,XML, RSS/ATOM
Text, JS-Object, Custom
Server Layer
SOA/WOA , SaaS, Traditional
Web Services, Open APIs ,Custom APIs