linux 下 对文件内容的查找
从文件内容查找匹配指定字符串的行:$ grep "被查找的字符串" 文件名从文件内容查找与正则表达式匹配的行:$ grep –e “正则表达式” 文件名查找时不区分大小写:$ grep –i "被查找的字符串" 文件名查找匹配的行数:$ grep -c "被查找的字符串" 文件名从文件内容查找不匹配指定字符串的行:$ grep –v "被查找的字符串" 文件名从根目录开始查找所有扩展名为.log的文本文件,并找出包含”ERROR”的行find / -type f -name "*.log" | xargs grep "ERROR"[@more@]
介绍两个Linux下 硬件性能测试小工具(open)
bogomipshttp://www.clifton.nl/index.html?bogomips.html用来测试CPU 速度的lmbench http://www.bitmover.com/lmbench/whatis_lmbench.htmlTools for performance analysis说明中建议最好不要在X下面测试[@more@]
meamo
桌面icon的config/usr/share/applications/hildon/*.desktopX 的启动/etc/X11/midinuxdm[@more@]
fedora 下 install rpm by internet
以前都是在Debian下面apt-get 就OK了。今天在fedora下面,找个半天才发现有个命令yum[@more@]
Shell.BrowseForFolder 权限不够
In javascriptvar Shell = new ActiveXObject("Shell.Application");var RetI = Shell.BrowseForFolder(0, 'フォルダ選択ダイアログ', 1);you can open local folder explore dialog to select a folder.But if you encounter error with "書き込みできません"please comfirm whether スクリプトを実行しても安全だとマークされていないActiveXコントロールの初期化とスクリプトの実行 is set to "有効にする" in IE explore[@more@]
how to click "close" button on vb.net form without firing Textbox's Lostfoucs() event
[Problem Description] Once click "close" button on vb.net form Textbox's Lostfoucs() event is fired.[Resolve] ...Handles Textbox.Validating ...cmdClose.CausesValidation=False [@more@]
complie dillo
因为要尝试 dillo 支持 https,所以要recomplie dillo,过程中遇到如下问题(多谢http://www.91linux.com/html/linux_pub/ubuntu/20080523/11386.html)错误一: ”checking for GLIB - version >= 1.2.2... no *** The glib-config script installed by GLIB could not be found *** If GLIB was installed in PREFIX, make sure PREFIX/bin is in *** your path, or set the GLIB_CONFIG environment variable to the *** full path to glib-config. configure: error: *** GLIB >= 1.2.2 not installed - please install first **
change user passwd
alter USER username WITH PASSWORD 'newpasswd';[@more@]
eclipes MS932
需要在 jre/lib/ 下面有charsets.jarrestart Eclipes OK[@more@]
Install scim-pinying from src in Fedora
背景:原有的Fedora上已经缺省安装了scim-pinyin 等IM,为了练练手决定通过src来安装。首先是通过[rpm -e ] uninstall all package about scim问题描述1. Download source of SCIM and SCIM-pinying from sourceforge2. ./configurate --prefix=/usr -> make -> install (SCIM -> SCIM-pinying)(notice: defaultly installl in /usr/local, if so, environment variable PKG_CONFIG_PATH need to be specified (/usr/local/lib/pkgconfig) before installing SCIM-pinying3. restart X windowsresult 1.scim is not runing2. Ct
Install PostgreSQL8.3 in MS Vista
If you install PostgreSQL8.3.0 in MS Vista,you will encounter the Error. 8.3.1 Fixed this problem[@more@]
DataGridView with multiple table
Display columns from two tables in one DataGridViewThere're two ways.One way is to use SQL( join ) one DataTable, one DataAdapter. set "DataGridView.dataSource = DataTable". It's OK It's very easy,but disadvantage is that you can not use "dataAdapter.update"The other way is to use JoinView http://support.microsoft.com/Default.aspx?scid=kb;en-us;325682 two DataTables, two DataAdapters, one JoinView The only drawback is that if you change the data of DataTable, the J
Postgre 中列出Column情报的命令
类似于SQL Server中的 sp_columnsd [tableName] [@more@]
DB ConnectString
System.Data.SqlClient.SqlConnection SQL Server 7.0 以上专用System.Data.OleDb.OleDbConnection 可连接 Access, SQL Server,OracleSystem.Data.Odbc.OdbcConnection 通过ODBC连接(效率低)System.Data.OracleClient.OracleConnection Oracle专用一个有用的提供ConnectString的Sitehttp://www.connectionstrings.com/[@more@]
strName = rs.Fields()
以前在VB6中strName = rs.Fields()但在VB.NET中是运行不过的strName = rs.Fields().value[@more@]
inline 声明
inline only 是对complier一种请求,complier 并不一定执行。适合声明为inline的函数的特点:体积小,经常被调用inline函数的定义(并非声明)需要放在头文件中[@more@]
函数参数的 Default value
与 ANSI C 不同,C++的函数参数可以有Default Value。但在by ref的情况下,应该声明为pointer 而非一个referance ,因为pointer可以设定default value 为0两个规则最右规则函数声明处定义default value[@more@]
build-in 变量的初始化
如果是 file scope的build-in 变量会被初始化为0如果是local scope的build-in 变量,除非程序员指定,否则不会被初始化[@more@]
pointer 使用时注意事项
使用pointer前一定要先确认其值是否为0if (!p)特例: delete 的时候不需要[@more@]
Pass by reference
C++ 中 函数的参数传递时,如果数据量比较大,即使是没有打算修改参数的值,出于性能(速度)方面的考虑,也应该采用 采用 Pass by reference 的方式。另外,建议在函数的参数声明时,前面加上“const” 明示。[@more@]