博客首页
注册
建议与交流
排行榜
加入友情链接
推荐
投诉
搜索:
帮助
剑胆琴心
知我者谓我心忧 不知我者谓我何求
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 ┆
阅读(54)
┆
评论(1)
这次损失惨重
上周末真是一场噩梦,先是实验室的机器坏掉,换了个CPU,结果OpenSUSE 10.3不能开机,只好重新安装系统,顺便把系统升级到openSUSE 11.0,噩梦才刚刚开始。。。<br>装完之后用yast装了一个Nvidia的显卡驱动,结果又进不去系统,google了半天,改了/etc/X11/xorg.conf,运行sax2-vesa好不容易折腾进去了。然后发现数据丢了大半,包括我的gpg私钥(以后记得一定要备份,最好放到一个安全的地方!);自己整理的关于语言模型方面的文章,准备发到cublog上的,尤其可惜的是还有那些公式,都是我用latex生成的图片阿,费了好长时间……
查看全文
发表于:2008-07-28 ┆
阅读(73)
┆
评论(0)
Google Summer Code 2008 Beijing Meetup
<DIV>2008年7月14日,我难忘的一天。早上去Google参加GSoC 2008 Beijing meetup.遇到了scim的作者苏哲大侠</DIV> <DIV>,还有很多为开源贡献力量的同学。先是介绍了一下自己的项目,然后吃了午餐,然后参观了Google 的</DIV> <DIV>office,真是帅啊!很多运动和游戏设施,但是奇怪的是竟然很少人在玩,也许是工作太忙了吧。<BR>真是难得的一次聚会!</DIV>
查看全文
发表于:2008-07-15 ┆
阅读(181)
┆
评论(2)
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 ┆
阅读(151)
┆
评论(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)
Google summer code 2008 is ON!
<i>Google Summer of Code</i> 2008 is on! Over the past three years, the program has brought together over 1500 students and 2000 mentors from 90 countries worldwide, all for the love of code. We look forward to welcoming more new contributors and projects this year. We'll begin accepting applications from mentoring organizations on Monday, March 3, 2008, and student applications on Monday, March 24th.<br><br>More infomation, plz visit <a href="http://code.google.com/soc/2008/" target……
查看全文
发表于:2008-02-26 ┆
阅读(351)
┆
评论(0)
宽字符函数普通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 ┆
阅读(703)
┆
评论(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 ┆
阅读(654)
┆
评论(2)