-
2007-10-02 - []2007-10-02
测试pre
int main(void)
{
printf("Hello, World!\n");
return 0;
}#include <stdio.h> int main(void) { printf("Hello, World!\n"); return 0; }Tags:
-
文档格式选择 - []2007-09-14
文档格式选择 对于写一本易维护的需要自由转换为多种格式的书籍,以哪一种源格式为最好呢?
可选的:
DocBook LaTeX ReST 以ReStructedText来写则源文件很简单,但是还缺少足够的工具集。
Tags:
-
2007-09-14 - []2007-09-14
$ cat ip-geo.py #!/usr/bin/python import sys import urllib import HTMLParser class CustomParser(HTMLParser.HTMLParser): selected = ('table',Tags:
-
淮河卫士 霍岱珊 - []2007-09-14
淮河卫士 霍岱珊 公司的写字楼需要检修,我们的工作日被调整到星期六,于是周五的白天在家里。
下午是凤凰卫视每周的的<社会能见度>重播。
节目中写的是淮河二十年来的污染状况,从八五年以前河水还是清的,水质变臭是九零年之后的事情了,九七年淮河水通过了国家检验标准,我以为淮河治理已经结束,可事情远远没有这么简单;
污水中含有大量氮和硫,在水面产生硫化氢气体,化学式就是H2S,学过中学化学的人都知道,这是一种有着恶臭气味并且有毒的气体;在九七年惨剧中,一批村民先来到水沟边在H2S中晕倒,又来一批营救人员,同样晕倒,这次事故是六死一伤。
淮河流域面积27万平方千米上住着1.7亿人口,据保守统计有50%的人受到污水的影响,无数的人在直...Tags:
-
UML已死了吗? - [Linux Kernel UserModeLinux ]2007-09-08
UML(UserModeLinux)已死了吗? 在短暂的未来中,没有人可以预测,UML/Xen/KVM,究竟哪一种技术会最终胜出。
http://www.linux.com/articles/59616 http://virtminiconf.linux.hp.com/copy_of_program/uml-kvm-and-hardware-virtualizationTags: Linux Kernel UserModeLinux
-
请看中文的内核开发邮件归档 - [Linux Kernel ]2007-09-06
请看中文的内核开发邮件归档 没有故事能比这更为有趣的报道了。
> > 今天四大distribution 的技术领导到场,跟大牛们诉苦,他们主要的问题是:bug > > 太多,还有就是驱动程序问题。很多驱动程序进不了mainline kernel,他们不得 > > 以才收进自己的distribution. Linus当场拍板说他收驱动程序,只要distro打算要。 http://zh-kernel.org/pipermail/linux-kernel/ http://zh-kernel.org/pipermail/linux-kernel/2007-September/000662.html ... -
大事记 - [Kernel Linux ]2007-08-25
-
2007-08-09 - [Linux ]2007-08-09
Don't Panic在八月五日悄悄地发布,我来给它记上一笔。
Tags: Linux
-
杭州、绍兴、宁波、舟山 - []2007-07-27
-
Dickinson - []2007-07-17
I'm nobody,
who are you?
Are you nobody, too?
So we are couples.Tags:
-
LVS - [Linux ]2007-07-10
从IBM developWorks学到了很多:
http://www.ibm.com/developerworks/cn/linux/cluster/lvs/part1/index.html
http://www.ibm.com/developerworks/cn/linux/cluster/lvs/part2/index.html
http://www.ibm.com/developerworks/cn/linux/cluster/lvs/part3/index.html
http://www.ibm.com/developerworks/cn/linux/cluster/lvs/part4/index.htmlTags: Linux
-
下载文件技巧 - [Linux ]2007-07-09
下载时选择一个链接,直接把它拖放到某个目标目录中,文件管理器(nautilus)就会出现正在复制的对话框。
这一项特性非常酷,也就是说剪贴板里面有一个目标URL地址时,在文件管理器中粘贴,就会把它下载过来。
Tags: Linux
-
nopaste代码测试 - [Python twisted ]2007-06-18
Nopaste测试
# from twisted.web.client import getPage from twisted.internet import reactor def errorHandler(error): print "An error occurred: <%s>" % str(error) reactor.stop() def lowercaseContents(contens): return contens.lower() def printContents(contents): ''' This is a callback. ''' print "Defered Called" print contents reactor.stop() deferred = getPage("http://twistedmatrix.com/dont-exist") deferred.addCallback(lowercaseContents) deferred.addCallback(printContents) deferred.addErrback(errorHandler) reactor.run()
-
字符设备的mmap接口 - [Kernel Linux ]2007-06-17
-
amd64平台字长演示 - [Linux C ]2007-06-12
一个简单的C程序如下,用来测试64位平台的基本程序参数:
$ cat offsetof.c #include <stdio.h> #define PRINT_SIZE(type) \ printf("sizeof " #type " = %lu\n", sizeof(type)) #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) #define PRINT_OFFSET(type, member) \ printf("offsetof " #member " in " #type " = %lu\n", offsetof(type, member)) struct ub { int a; char c; unsigned long b; }; struct ub_packed { int a; char c; unsigned long b; } __attribute__ ((packed)); int main(void) { PRINT_SIZE(struct ub); PRINT_OFFSET(struct ub, b); PRINT_SIZE(struct ub_packed); PRINT_OFFSET(struct ub_packed, b); return 0; }编译和运行效果:
$ gcc -Wall offsetof.c $ ./a.out sizeof struct ub = 16 offsetof b in struct ub = 8 sizeof struct ub_packed = 13 offsetof b in struct ub_packed = 5
-
beryl 项目从 svn => git - []2007-06-08
-
发现LDD3书中的一个错误,发了质疑的邮件过去,回复果然是一个错误! - [Kernel ]2007-06-06
原文如下:
booktech@oreilly.com <booktech@oreilly.com> Wed, Jun 6, 2007 at 5:53 AM Reply-To: booktech@oreilly.comTo: crquan@gmail.comHi,
One of the authors responded already with the answer.
----
Yes, it's an error, the reader is correct, it should say the usb
controller instead.
thanks,
greg k-h
----[Quoted text hidden]LDD3在第十章281页(指英文pdf原文上的)在解释中断控制器的时候写道:
IRQ5用在serialATA和IEEE1394控制器上,但是对应项是ehci_hcd,应该是USB2.0的控制器,
于是给OReilly出版社发了询问邮件,联系到了作者之一greg k-h回复,终于验证了我的想法是对的。
注:LDD3是三位共同作者从第二版(LDD2)开始就明确声明为要使用一个更为开放的许可协议下发布的,它使用的是创作共用协议(CC-by-sa),因此可以自由地使用原文,原英文的高质量pdf文件在这里:
Tags: Kernel
-
以LDD3来说,有一些内核接口已经发生了变化 - [Kernel ]2007-06-02
现在2.6.21上编译LDD3中的examples代码时,有一些模块已不能通过了,因为有一些接口已经变了,
http://lwn.net/Kernel/LDD3/
在lwn上有一个专门的页面来收集内核提供的编程接口变化情况:
http://lwn.net/Articles/2.6-kernel-api/
对于LDD3来说,最大的变化就是workqueue的部分了,这个发生在2.6.20版,这里有一份详细说明:
http://lwn.net/Articles/211279/
work_func_t函数类型变了,不再接收一个任意的data指针,而是变为struct work_struct *work
typedef void (*work_func_t)(struct work_struct *work);
这个变化的主要原因是有人发现在2.6.20以前的struct work_struct这个结构体太大了,在64位系统上可能达到96字节;于是作出对workqueue机制的改进。
Tags: Kernel
-
syscall调用接口从2.6.19开始移到应用层, - [Kernel Linux ]2007-06-02
syscall调用接口从2.6.19开始移到应用层,原来内核中使用_syscallN宏的方式来声明函数原型的方法不再有效:
如声明:
_syscall1(int, sysinfo, struct sysinfo *, info);
不再需要,而是在程序中需要的时候直接调用:
int syscall(int number, ...);
- 第一个number是后面要接的参数个数,不是该系统调用的参数个数;
- number后面顺序接上该系统调用的所有参数即可
相应头文件包含也改变为
于是调用sysinfo就变为:
struct sysinfo s_info;
syscall(2, __NR_sysinfo, &s_info);可见新的调用方式变得更为简洁了。
References:- http://lxr.linux.no/source/include/asm-i386/unistd.h
- http://lxr.linux.no/source/include/asm-i386/unistd.h?v=2.6.18
- http://www.kernel.org/pub/linux/kernel/v2.6/snapshots/patch-2.6.19-git13.log
- commit f5738ceed46782aea7663d62cb6398eb05fc4ce0 of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
-
安装beryl之前需要restricted-driver: - [ubuntu linux feisty ]2007-06-01



最新评论