Monday, September 29, 2008

SQL Server Profiler fonts error

运行SQL Server Profiler,生成,连接数据库,正常,当点下run开始跟踪的时候,报错:"only TrueType fonts are supported. There id not a TrueType font"。倒,微软还真进步,看来要淘汰windows中的非TrueType字体了。

避免该错误,需要修改Profiler的指定字体,方法如下:

点击 Tools菜单->Options...

然后在选项对话框开头的Display Options部分,"Choose Font..."换一种TrueType的字体即可,我比较喜欢Vendana 。

Monday, September 8, 2008

windows form c# -- User Interface tips to show system status

When a time consuming task is performed, we can either perform it using backgroundworker, or using a little tips like this:
Cursor.Current = Cursors.WaitCursor;
// Perform your task here
Cursor.Current = Cursors.Default;
From the UI perspective, User understand that the system is busy and will be more than happy to wait rather than disappointed.

Saturday, September 6, 2008

General Linux Common Command

Generic Linux

COMMAND NAME		DESCRIPTION
df -h shows disk usage in human readable form
man <commandname> shows more info about a command
uname -a kernel release version
/usr/sbin/smbd -V samba version
/usr/sbin/httpd -v apache version
mysql -v mysql version
php -v php version
mv moves or renames a file
cp copies or backsup a file
rm removes or deletes a file
ps -ax|grep <process> outputs processes running <process>
ps -AH report process status
top shows processes
top -i shows only active processes
iptraf shows network info
mc -d show midnight commander to navigate through system easily
cat /proc/mdstat shows software raid
host -t mx aol.com shows the mx records for aol.com
net groupmap list shows samba mappings to nt groups
telinit 1 changes to single user mode
ifconfig shows detailed info on ethernet ports
grep -r "casesensitivesearch" * finds all documents containing the criteria in a dir
tail -f /var/log/<LOGFILE> realtime viewing of your log file
hdparm -t /dev/mdx (where x is 0,1,2,etc) shows software raid performance
mdadm --detail /dev/mdx (where x is 0,1,2,etc) gives raid info
tar -czvf foo.tar.gz foo creates a tar/zip file of a directory
tar -xvzf foo.tar.gz untar/unzip a tar/zip file
scp -P <ssh_portnumber> foo.tar.gz <other_server_ipaddress>:/opt transfers file to another server
rsync --progress -te "ssh -p <ssh_portnumber>" foo <other_server_ipaddress>:/opt transfers file to another server
sed -i s/foo/fee/g <FILENAMEORPATHTODIR> replaces foo with fee

Tuesday, September 2, 2008

vc++ compiler support Ecma c++ standards

Visual C++ complies with these standards:

  • ISO C 95

  • ISO C++ 98

  • Ecma C++/CLI 05

-----------------------------------------------------------------------------

The GNU C library is compatible with the C standard adopted by the American National Standards Institute (ANSI): American National Standard X3.159-1989---"ANSI C".
The header files and library facilities that make up the GNU library are a superset of those specified by the ANSI C standard.

Monday, September 1, 2008

segmentation fault in linux/unix

A wired error happened today when I am trying to run a gcc complied application.
"Segmentation fault" happened in the least expected place (at least according to cout, it paused), so I tried very hard to
modify this bit of code in many ways. I couldn't solve the problem until I tried gdb.
After reading wikipedia for the simplest way of using gdb, and few other articles on the web, I start to debug the code.
I find that the application had a bug in one line, which is way below the code that I was messing around. 
How stupid I am... I should know that the application is still running and cout just haven't finish printing.....
I should have turn to debugging straight away because this is c++, not c#.

Conclusion: Never trust manual debug using cout.