博客首页
注册
建议与交流
排行榜
加入友情链接
推荐
投诉
搜索:
帮助
剑胆琴心
知我者谓我心忧 不知我者谓我何求
zsc.cublog.cn
管理博客
发表文章
留言
收藏夹
博客圈
音乐
· music
相册
· graduate
· snapshot
· skating
· room
· office
文章
· 心情随笔
· 技术人生
· 记忆碎片
· 寻章摘句
· 开源项目
}
· video conference
· Google summer code 2007
· 个人略传
· Perl学习
· 人生哲理
· 酒中真意
首页
关于作者
姓名:freebsd13 职业:IT 年龄:23 位置:北京-中关村 个性介绍:尘世间一迷途小书童 主页:http://www.cipsc.org.cn/~zsc
||
<<
>>
||
我的分类
文章列表 - 技术人生
[题目]去除字符串中多余空格
<DIV>题目:将字符串中所有多于2个的空格变为1个空格</DIV> <DIV>解答:C语言版本,我自己写的,多用了些内存,但是不用考虑那么多状态。:)</DIV> <DIV> </DIV> <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#999999 cellSpacing=0 cellPadding=0 width="95%" bgColor=#f1f1f1 border=1> <TBODY> <TR> <TD> <P style="MARGIN: 5px; LINE-HEIGHT: 150%"><CODE><SPAN style="COLOR: #000000"><SPAN style="COLOR: #0000cc">#</SPAN><SPAN style="COLOR: #ff0000">include</SPAN> <SPAN style="COLOR: #0000cc"><……
查看全文
发表于:2008-08-23 ┆
阅读(53)
┆
评论(1)
How to rollback to the previous version in svn
In the Subversion, if you want to rollback your current workspace to the previous version, first you can type:<br><br> <table style="border-collapse: collapse;" bgcolor="#f1f1f1" border="1" bordercolor="#999999" cellpadding="0" cellspacing="0" width="95%"><tbody><tr><td><p style="margin: 5px; line-height: 150%;"><code><span style="color: rgb(0, 0, 0);">svn cat <span style="color: rgb(0, 0, 204);">-</span>r PREV filename <span style="color: rgb(0, 0, 204);">></span> filename</sp……
查看全文
发表于:2008-06-20 ┆
阅读(148)
┆
评论(0)
gpg文档[zt]
<div class="content"> <p>1. 生成和查看密钥</p> <p>gpg --gen-key</p> <p>查看生成的公钥</p> <p>gpg --list-keys</p> <p>查看、建立的私钥</p> <p>gpg --list-secret-keys </p> <p>2 加密解密文件 </p> <p>用公钥加密<br>gpg -ea -r xli@redhat.com /directory/filename</p> <p>用私钥解密</p> <p>gpg -d /directory/filename.asc > /directory/filename</p> <p>3. 导出和导入公钥</p> <p>gpg --export "xli@redhat.com" -o leonli_publickey.asc (-a 输出ascii格式)</p> <p>gpg --import leonli_publickey.asc<……
查看全文
发表于:2008-06-01 ┆
阅读(213)
┆
评论(0)
The automaton of keyboard
Theses days, i am doing some research about the pinyin to hanzi converter. And the decoder is completed, using trigram and Good-Turing smoothing. I want to compare to another pinyin input method based on SLM in my OpenSuSE. So i should simulate the key stroke so as to do a test.<br>After a search in Google, i found some eligible method. At last, i choose the XTestFakeKeyEvent() in Xlib. The following is my automaton keyboard:<br><br><table style="border-collapse: collapse;" bgcolor="#f1f1f1" bor……
查看全文
发表于:2008-05-21 ┆
阅读(210)
┆
评论(0)
Something of these days
These days, i have completed a convertor from pinyin to hanzi, using trigram and Viterbi decoding algorithm. It is written in C and Perl, which(Perl) is used to parse the raw corpus from the WWW. It is diffcult to compress the Langusge Model(LM), i just cut off the trigrams which count is less than 3.<br>The next step is do some test of this system and do some back-off based Entropy so as to compress the LM. There are a lot of hard work to be done.<br><br>
查看全文
发表于:2008-05-13 ┆
阅读(174)
┆
评论(1)
Character encoding is a hard problem!
The most common for our Chinese encoding is GB2312, GBK, GB18030, Big5(taiwan), Unicode. So i confronted many many problems when i was processing the Sogou Internet corpus. The first problem is word segmentation, thanks to my laboratory's guy, this problem is solved. However, his tool is for GBK only, so it is fit for Sogou corpus. While i often do my work with zh_CN.UTF-8 locale in my OpenSuSE. Besides, i found the computing station's locale is UTF-8 too, so i have to convert it fro……
查看全文
发表于:2008-04-24 ┆
阅读(220)
┆
评论(0)
[Perl]How to select a random line from a file?
how to select a random line from a file? These days, i am doing some research about corpus linguistics and preparing for a experiment. <br><br> <table style="border-collapse: collapse;" bgcolor="#f1f1f1" border="1" bordercolor="#999999" cellpadding="0" cellspacing="0" width="95%"><tbody><tr><td><p style="margin: 5px; line-height: 150%;"><code><span style="color: rgb(0, 0, 0);"><span style="color: rgb(255, 153, 0);">#!/usr/bin/perl -w<br> </span><br> <span style="color: rgb(255, 153,……
查看全文
发表于:2008-04-19 ┆
阅读(194)
┆
评论(0)
The new message notification for Pidgin with Pytho
These days, i am studying the Python and DBus interface of Pidgin. After a few hours , a notification tool was done. The following is the code in Python.<br> <table style="border-collapse: collapse;" bgcolor="#f1f1f1" border="1" bordercolor="#999999" cellpadding="0" cellspacing="0" width="95%"><tbody><tr><td><p style="margin: 5px; line-height: 150%;"><code><span style="color: rgb(0, 0, 0);">#<span style="color: rgb(0, 0, 204);">!</span><span style="color: rgb(0, 0, 204);">……
查看全文
发表于:2008-03-29 ┆
阅读(706)
┆
评论(4)
宽字符函数普通C函数描述
iswalnum() isalnum() 测试字符是否为数字或字母 <br>iswalpha() isalpha() 测试字符是否是字母 <br>iswcntrl() iscntrl() 测试字符是否是控制符 <br>iswdigit() isdigit() 测试字符是否为数字 <br>iswgraph() isgraph() 测试字符是否是可见字符 <br>iswlower() islower() 测试字符是否是小写字符 <br>iswprint() isprint() 测试字符是否是可打印字符 <br>iswpunct() ispunct() 测试字符是否是标点符号 <br>iswspace() isspace() 测试字符是否是空白符号 <br>iswupper() isupper() 测试字符是否是大写字符 <br>iswxdigit() isx……
查看全文
发表于:2007-12-28 ┆
阅读(482)
┆
评论(0)
C++代码片段
写了一个滤掉C/C++风格的注释的片段,其实是书后的练习题,先放在这里吧<br><br> <table style="border-collapse: collapse;" bgcolor="#f1f1f1" border="1" bordercolor="#999999" cellpadding="0" cellspacing="0" width="95%"><tbody><tr><td><p style="margin: 5px; line-height: 150%;"><code><span style="color: rgb(0, 0, 0);"><span style="color: rgb(255, 153, 0);">/*<br> * A simple code to filter the C/C++ source code.<br> * Copyright (c) 2007 freebsd13 <freebsd13@163.com><br> */</span><br> ……
查看全文
发表于:2007-12-15 ┆
阅读(488)
┆
评论(1)
How to build a rpm package for Pidgin.
很多人知道rpm包是redhat的一种包,也知道如何安装rpm包。但怎么制作rpm包呢?我就以制作Pidgin的rpm包为例,说一下rpm包的build过程。<br>Pidgin(http://pidgin.im)是一个IM软件,支持多种协议,如MSN,jabber,AIM,Yahoo等。<br>我们用pidgin-2.1.0为例,现在最新版本是2.3.0了。<br>第一步:准备源码包,这里就是指pidgin-2.1.0.tar.bz2了。<br>第二步:编译源码包,这个大家都很熟悉了。./configure; make 到make就行了,说明能够成功编译即可。<br>第三步:找SOURCES,RPMS,SPECS位置。简单方法:locate RPMS(一般这几个目录都在同一个目……
查看全文
发表于:2007-11-29 ┆
阅读(457)
┆
评论(0)
winxp自动切换ip的脚本
我的本子的系统是Win XP,因为宿舍是dhcp的,实验室是固定ip的,这样经常在宿舍和实验室之间切换,就比较麻烦。今天Google了一下,写了一个小的脚本。以后只要在”开始--运行“打入脚本名字即可。我的脚本名字就是ip.bat.<br>1.首先,将以下这个东西放到C:\WINDOWS\system32 下<br> ftp://ftp.microsoft.com/Services/TechNet/samples/PS/Win98/Reskit/SCRPTING/CHOICE.EXE<br>2.写脚本<br><br>3.设置好PATH,或者把这个脚本放在path目录下,最常见的是C:\windows\sysytem32。<br><table style="border-collapse: collapse;" bgcolor……
查看全文
发表于:2007-11-17 ┆
阅读(701)
┆
评论(0)
Makefile书写规则[ZT]
<p><font face="Courier New" size="4"><strong>概述<br>——</strong></font></p> <p><font face="Courier New">什 么是makefile?或许很多Winodws的程序员都不知道这个东西,因为那些Windows的IDE都为你做了这个工作,但我觉得要作一个好的和 professional的程序员,makefile还是要懂。这就好像现在有这么多的HTML的编辑器,但如果你想成为一个专业人士,你还是要了解 HTML的标识的含义。特别在Unix下的软件编译,你就不能不自己写makefile了,会不会写makefile,从一个侧面说明了一个人是否具备完 成大型工程的能力。</……
查看全文
发表于:2007-10-30 ┆
阅读(368)
┆
评论(0)
A cool Latex photo editor -- sitmo equation editor
Link: http://www.sitmo.com/latex/<br>you can type you LaTex's markup scripts and then download the equation photo from the plugin.That's very interesting. For example, i typed:<br><p style="margin: 5px; line-height: 150%;">P(W)=&P(w_1)*P(w_2|w_1)\\&P(w_3|w_1,w_2)*P(w_4|w_1,w_2,w_3)\\&P(w_5|w_1,w_2,w_3,w_4)*......</p><br><br>Then i can get:<br><img src="http://blog.chinaunix.net/photo/20754_071029152317.png"><br><br><br> Besides, you can add it to your iGoogle. It would b……
查看全文
发表于:2007-10-29 ┆
阅读(395)
┆
评论(0)
Some good links for Xlib programming
1.一个很好的教程,可以从里面的连接挖掘出很多东西。<br>http://tronche.com/gui/x/xlib-tutorial/<br>2.volume one: Xlib programming manual online<br>http://wwweic.eri.u-tokyo.ac.jp/computer/manual/lx/SGI_Developer/books/XLib_PG/sgi_html/index.html<br><br>Cheers!<br><br>
查看全文
发表于:2007-10-16 ┆
阅读(542)
┆
评论(0)
[转]Linux之父炮轰C++:糟糕程序员的垃圾语言
“这是一种信仰问题。因此,任何讲道理和争论都会无穷无尽,而且也毫无意义……”<br> ---Dmitry Kakurin<br><br>这是CSDN上的刘江的作品,今天看得很过瘾。<br>不敢独享,特转来与好友共享。<br>http://blog.csdn.net/turingbook/archive/2007/09/07/177……
查看全文
发表于:2007-10-12 ┆
阅读(517)
┆
评论(0)
最近在做一些X方面的事
hi,我的朋友们,很久没有更新blog了。<br><br>最近白天在实验室作些X编程方面的研究,晚上作一些自己研究方向和一些开源的东西,深夜研究摄影技术,忙得不亦乐乎。<br><br>下面是我搜集的关于X 方面的一些资料,欢迎有着方面经验的提供,大家一起研究研究...<br><span style="font-weight: bold;">Xlib编程:</span><br>《Definitive Guides to the X Window System》丛书<br> 一共9卷<br> 《Volume 0:X Protocol Reference Manual》<br> 《Volume 1:Xlib Programming Manual》<br> 《Volume 2:Xlib Reference Manual》<br> 《Volum……
查看全文
发表于:2007-10-10 ┆
阅读(653)
┆
评论(2)
GTK 2.0 教程
http://www.gtk.org/tutorial/<br>最近在接触红旗的一个项目,需要GTK+,正好我也要学习GTK。一起学吧。<br>
查看全文
发表于:2007-10-08 ┆
阅读(513)
┆
评论(1)
Perl 中的正则表达式
<ul style="color: rgb(0, 1, 2);"><li> <p>正则表达式的三种形式 </p></li><li> <p>正则表达式中的常用模式 </p></li><li> <p>正则表达式的 8 大原则 </p></li></ul> <p style="color: rgb(0, 1, 2);" align="left"> </p><p style="color: rgb(0, 1, 2);"> 正则表达式是 Perl 语言的一大特色,也是 Perl 程序中的一点难点,不过如果大家能够很好的掌握他,就可以轻易地用正则表达式来完成字符串处理的任务,当然在 CGI 程序设计中就更能得心应手了。下面……
查看全文
发表于:2007-09-28 ┆
阅读(492)
┆
评论(0)
对windows恨之入骨了!
我已经出离愤怒了。这几天一直在改师兄留下的一个程序,用Win API写的。也许是我习惯了UNIX的风格或者根本对WIndows就不熟悉,代码改的要吐血了。本来文档就不多,我再去猜测每个函数的用法,结果耗费了很多时间和精力。彻底对Windows失去信心了。<br><br>我还有论文要读,最近老板还安排我去参与一个项目。<br><br>只好继续迎接挑战了,让暴风雨来的更猛烈些吧!<br><br><br><br>
查看全文
发表于:2007-09-21 ┆
阅读(570)
┆
评论(2)