docbook5的配置和一个例子

3月 5th, 2010 by Scott

终于下决心把docbook从4.2升级为5,果然docbook5的配置相比4.2简单了很多,下面来看配置方法,参考了老十的配置方法,只是文件都换成了最新的版本(截止2010-03-05)

[ Windows下Docbook编译环境的搭建 ]

  1. 下载Docbook XSL样式表 首先下载Docbook XSL转换样式表 。我们只需要下载docbook-xsl-ns即可,目前的最新版本是1.75.2。下载后,把它解压到一个目录中,我这里假设解压到C:\docbook目录,也就是说,Docbook XSL所在的目录是: C:\docbook\docbook-xsl-ns-1.75.2\ 。在Docbook介绍 一文中我讲过Docbook是”内容与格式分离”的,我们写Docbook文档时只关注文档的内容,而Docbook如何转换成其它文档类型,则由Docbook XSL转换样式表来定义。我们最常用的是转换到HTML格式的样式表,以及转换到FO格式的样式表。
  2. 下载xsltproc转换程序 接下来,需要下载XML语言转换工具。我喜欢用的转换工具是xsltproc ,这是一个由C语言写成的XML转换工具,它的特点是转换速度很快,并且同时支持Windows和Linux。除了这个转换工具外,还有很多Java写的转换工具,例如Saxon , Xalan 。我们到这里下载Windows版本的xsltproc ,需要下载下面几个包:
    • iconv-1.9.2.win32.zip - 编码转换工具
    • zlib-1.2.3.win32.zip - 压缩工具
    • libxslt-1.1.26.win32.zip - XSL和EXSL转换工具,xsltproc程序就在此包中
    • libxml2-2.7.6.win32.zip - XML解析工具和处理工具,同时提供了验证工具xmllint和xmlcatalog

    下载后,把这些包解压到同一个目录里,假设解压到C:\docbook\xsltproc 目录,解压后,你可以看到在C:\docbook\xsltproc\下多了三个目录:bin,include和lib。现在需要在环境变量PATH中增加C:\docbook\xsltproc\bin ,设置后,再打开一个DOS窗口,可以直接输入xsltproc命令,不需要输入使用全路径了。

  3. 安装FOP 安装了上面的两个工具,你就可以把Docbook文档转换成HTML格式了。如果你需要把Docbook文档转换成PDF格式,还需要安装把XSL-FO格式转换为PDF格式的转换工具,Apache FOP 是一个不错的选择。不过我现在没有这方面的需求,暂时没有安装。据说配置Apache FOP支持中文比较繁琐,改天我试过再把经过写出来。(2009/04/11更新,关于Apache FOP的配置,参见文章使用Apache FOP将Docbook文档转换成PDF (一)

现在,Docbook的编译环境就建好了。相比Docbook 4.2,编译环境的搭建容易了很多,你不必再去配置catalog这些东西,因为Docbook 5.0已经不再需要文档类型定义了。

下面同样是一个例子,不过我换成了book,老十用的是article例子。

 [ 一个 docbook5 的例子 ]

这里文档的分割问题暂时还没解决,其他语法和4.2的基本类似,直接复制过来就可以用了。

下载例子 docbook5.rar

好了写了个自动发布成html的批处理,一切搞定。

Posted in 未分类 | No Comments »

随笔

1月 19th, 2010 by Scott

从头到脚是世界上最长的距离!理解一件事情是很容易的,但行动是困难的,坚持行动尤其困难。

Posted in 未分类 | No Comments »

日租房

1月 15th, 2010 by Scott

中午,东大正门内公告栏,杯具~

imag0042.jpg

Posted in 未分类 | 1 Comment »

android的SwiFTP Server FTP

1月 15th, 2010 by Scott

中午要从手机拷文件,没带数据线,于是用wifi下载安装了个SwiFTP,设置密码,启动……

在电脑上运行cuteftp,设置,登录成功,可是却怎么也显示不了文件列表……

换浏览器ftp://192.168.1.4:2121,设置,登录成功,显示的确是“12:28 文件名”这样的目录名,再点击就要手动修改路径,无语……

换linux测试机:

[root@localhost ~]#ftp
ftp> open 192.168.1.4 2121
Connected to 192.168.1.4.
220 SwiFTP 1.21 ready
502 Command not recognized
502 Command not recognized
KERBEROS_V4 rejected as an authentication type
Name (192.168.1.4:root): scott
331 Send password
Password:
230 Access granted
Remote system type is UNIX.
Using binary mode to transfer files.
……

接着ls,get,搞定~

Posted in 技术 | No Comments »

随笔

12月 29th, 2009 by Scott

游戏和电影的最大区别就是电影是体验性的,而游戏是主观性的。换句话说电影是距离的艺术(观众和剧中人物的距离),而游戏是互动的艺术(玩家和游戏中的人物是零距离)。

商业上,做点小生意是要符合别人的规则,但如果想做大生意,是要让别人追随你的规则。

所谓创新,其实就商业而言,是规则的创新,而不是技术的创新。如果技术不能带来规则的改变,那只是增量的改良。

Posted in 随笔 | No Comments »

AxWebBrowser新应用:Facebook Mailer

12月 1st, 2009 by Scott

logo.gif

看名字就知道是facebook群发器了(站内信)

Posted in 技术 | No Comments »

10个效果最佳的编程字体

11月 30th, 2009 by Scott

Top 10 Programming Fonts

I’m a typeface geek, and when it comes to selecting a font I’ll stare at all day, I tend to be pretty picky. Recently, when I discovered that a friend was using a sub par typeface (too horrible to name here) for his Terminal and coding windows, my jaw dropped, my heart sank a little, and I knew it was due time for me to compose this article.

What follows is a round-up of the top 10 readily-available monospace fonts. Many of these fonts are bundled along with modern operating systems, but most are free for download on the web. A few, notably Consolas, are part of commercial software.

A note about anti-aliasing

In the past, we’ve had to decide between tiny monospace fonts or jagged edges. But today, modern operating systems do a great job of anti-aliasing, making monospace fonts look great at any size. It’s not 1990 anymore. Give your tired eyes a break and bump up that font size.

If you have any doubt that anti-aliased fonts are apropos for code, note that even the venerable BBEdit — which for years has shipped with un-aliased Monaco 9 set as the default — has made the jump. The app now ships with a specially licensed version of the Consolas font from Ascender, bumped up in size, and with anti-aliasing on by default. Panic includes a special anti-aliased font (Panic Sans, which is actually just a version of Deja Vu Sans Mono) with its popular Coda application.

Unless otherwise noted, I’ve used a larger size font, 15-point in fact, for the examples here to illustrate their legibility at larger sizes and with anti-aliasing turned on.

10. Courier

All systems ship with a version of Courier (sometimes Courier New), and unfortunately, many have it set as the default font for terminal and editor windows. It does the job, but it’s a bit dull and boring, lacking style and class. I don’t recommend this font if you have any other choice — and fortunately, you do. If you use this font, please bump the size and turn on anti-aliasing.

Courier New Figure 1 Courier New

9. Andale Mono

A bit better than the Courier family, Andale Mono is still relegated to the “default font” category as it ships with some systems, and you wouldn’t want to download or use it if it wasn’t already there. The character-spacing is a bit too clumsy and the letters are a bit too wide for my tastes.

Andale Mono Figure 2 Andale Mono

8. Monaco

Monaco is the default monospace font on the Mac and has been since its inclusion in System 6. It’s a solid, workhorse font that really shines at smaller font sizes with anti-aliasing turned off. I loved this typeface back when my eyes could tolerate staring at a 9-point font for hours, but those days are behind me. This font looks great at 9 or 10-points (Figure 4), and doesn’t look too shabby anti-aliased at higher sizes (Figure 3).

As far as I know, you can only get Monaco as a part of Mac OS, but there are alternatives, so keep reading.

Monaco Figure 3 Monaco

Monaco 9 Figure 4 Monaco 9-point, without anti-aliasing

7. Profont

Profont is a Monaco-like bitmap font available for Mac, Windows, and Linux (there’s also a modified version for Mac OS X called ProFontX by a different author). They’re best at smaller sizes, and make a great alternative to Monaco if you’re on a non-Mac platform and want really tiny fonts and the eyestrain that goes along with them.

Profont (and ProFontX) is intended for use at 9-points with anti-aliasing turned off.

Profont Figure 5 Profont 9-point, without anti-aliasing

6. Monofur

Monofur is a unique monospace font that looks great anti-aliased at all sizes. It’s a fun font with a distinct look that is vaguely reminiscent of Sun’s OPEN LOOK window manager, which ran Solaris (aka SunOS) systems back in the late 80’s. If you’re looking for something a bit different, try this font, but make sure you have anti-aliasing turned on, even at small sizes.

Monofur Figure 6 Monofur

5. Proggy

Proggy is a clean monospace font that seems to be favored by Windows users, although it works fine on a Mac. It’s a clean font intended to be used only at smaller points, and without anti-aliasing.

Proggy Clean Figure 7 Proggy Clean at 15-point (yes, 15-point), without anti-aliasing

4. Droid Sans Mono

The Droid font family (available for download here) is a nice font family designed for use on the small screens of mobile handsets, like Android, and licensed under the Apache license.

Droid Sans Mono makes for a great programming font. It’s got a bit of flair, and stands out among the other monospace fonts I’ve listed, and its only real flaw is the lack of a slashed zero.

Droid Sans= Figure 8 Droid Sans Mono

3. Deja Vu Sans Mono

The Deja Vu family of fonts are one of my favorite free font families, based on the excellent Vera Font family. The Deja Vu fonts have been updated with a wider range of characters while maintaining a similar look and feel to that of Vera.

This was my go-to font family for many years. It looks great at any size with anti-aliasing turned on.

Panic ships a font with it’s Coda application called “Panic Sans” which is based on this font. Gruber says via email that when he compared Panic Sans against Vera, he noted that “Panic had noticeably crisper punctuation chars” and that it seemed like they had improved the hinting on some characters as well.

Deja Vu= Figure 9 Deja Vu Sans Mono

2. Consolas

Consolas suddenly appeared on my Mac after I installed Microsoft Office, along with a handful of other new fonts from Microsoft.

This font was designed by Luc(as) de Groot for Microsoft’s ClearType font family (there’s a nice write-up with samples of each of the new Microsoft fonts here). Consolas is a commercial font, but is bundled with many Microsoft products, so there’s a good chance you might already have it on your system.

You’ll absolutely want to have anti-aliasing turned on if you’re using Consolas, because it’ll look terrible without it.

Too bad it’s not free … if it was, it would be #1 on this list.

Consolas Figure 10 Consolas

1. Inconsolata

Inconsolata is my favorite monospaced font, and it’s free. Shortly after discovering it, it quickly supplanted Deja Vu Sans Mono as my go-to programming font. I use it everywhere, from Terminal windows to code editors. It has a certain sublime style that’s unique without being over the top, and it looks fantastic at both large and small sizes. I use this font when I show code samples in a presentation, and it’s the font we use in Terminal and TextMate windows when filming PeepCode screencasts.

Inconsolata is designed to be used with anti-aliasing enabled, but it’s surprisingly legible even at very small sizes. A big thanks to Raph Levien for creating this font, and for making it free.

Inconsolata Figure 11 Inconsolata

Thoughts?

Did I miss your favorite coding typeface? Think the list is out of order? Let me know. If there’s a typeface you think should be in this list, please let me know in the comments section below. If it meets my ridiculous standards, I’ll review it and include it in a follow-up article.

Posted in 未分类 | No Comments »

S60 SDK的版本选择

10月 9th, 2009 by Scott

很多同学在选择SDK和时候无从选择,也不知道要下载哪个版本才是适合自己的IDE的,解释下SDK中的缩写都代表的什么。

先看个例子:S60 2nd Edition, FP1,WINS

1、Edition

目前有1st  Edition、2nd Edition、3nd Edition、5th Edition,是S60的版本,Series 60从诞生至今已经有了三个版本,并且有多个PARK。每个机型都对应不同的S60版本。

S60第一版包括: 诺基亚:3650、36607610、7650、N-Gage、N-Gage、QD S60

S60第二版包括: 诺基亚:N70、N72、N90、3230、6260、6600、6620、6630、6670、6680、6681、7610 其他:Siemens:SX1,三星:D700/720/730,松下:X700/X800

S60第三版包括:诺基亚:6120c、N71、N73、N75、N76、N77、N78、N79、N80、N81、N82、N85、N91、N92、N93、N95、N96、3250、E50、E60、E61、E62、E70、5500、5700。

2、FP

即Feature Pack,特征包。类似于Windows的SP(Service Pack),是后期推出的一种补丁程序,同时加入了某些新特性。当然FP2机型要比FP1机型更新,而且理论上更易用。

3、CW WINS

这个只有2nd Edition FP2之前的才有区分,WINS代表支持微软的VS6.0,比较高的版本nokia不再专门支持微软的开发环境了,改为支持自己的CodeWarrior,所以叫WINSCW,在VS2003、VS2005里面可用,相当于以前的WIN。同样CW代表支持CodeWarrior。

Posted in 技术 | 1 Comment »

家长和宝宝一起做的认知游戏

10月 8th, 2009 by Scott

一、名称:树和叶找对子
目的:通过本游戏,认知各种树和各种树叶的区别。
做法:
1.带宝宝去附近公园,逐渐认知一些树(如树的外形特征和叶形),有意识地收集每种树的叶片,制作成标本,以待做游戏时使用。
2.让宝宝说明“哪种树叶是在哪种树上。”

1.jpg

也可以由家长说出树名,由宝宝找出相应的树叶标本。
3.秋天带宝宝去观赏哪些树变化了,让孩子手提小包或小篮子,边观赏边检落叶,帮公园清洁工公益劳动。如能博得清洁工的赞扬“谢谢你,好孩子!”宝宝会更有兴致。
4.利用落叶自制叶贴画,如图:

2.jpg

益处:从认知树木逐渐能主动观赏区别树木,产生感情而爱护树木,同时获得各种知识能区别常绿树和落叶树,知道树与人们的关系(空气新鲜,可作为木材等)。
注意:不能让孩子一下子认很多种树,还应反复地教孩子辨认。

二、名称:昆虫
目的:认知昆虫的特征都有三对足,发展幼儿观察力,并略能区别益虫与害虫。
做法:
1.指认以下昆虫,问宝宝“你认识吗?它叫什么?”“名字?”(如图示)

3.jpg

①知了②蜻蜒③天牛④萤火虫⑤蚱蜢⑥苍蝇⑦蚊子⑧瓢虫
告诉宝宝这些昆虫的名称,进一步引导宝宝观察这些昆虫,指出:虽然它们外形各异,但都有三对足(请讲解:相对应的两只脚就是一对足)。
2.然后问宝宝:“除了这些虫,你还知道什么虫?”
3.通过以下图示,指出哪个是害虫?哪个是益虫?使宝宝获得有关知识。

害虫给打个“×”,益虫给画个五角星。
益处:夏、秋季节是昆虫最活跃的时候,在此阶段,可教宝宝认知观察一些昆虫,以吸引孩子对大自然的兴趣。
注意: 要让孩子记住昆虫规范的名称,不要用双叠语“虫虫”等说法。更不要用虫来吓唬孩子。

三、名称:岛和湖
目的:通过游戏让宝宝理解岛和湖的区别。
做法:
1.寻找一块石块,搁置于盘中央,如图:让宝宝用器皿盛水,慢慢地把水灌入盘内。石块上可用小玩具或橡皮泥布置小屋,崎岖弯道等情景。水上漂浮着船只,在游戏过程中孩子会领悟:四面被水围着的陆地叫岛。
让宝宝玩石子、沙,堆堆、灌灌,观察如图那样凹凸的“陆地”当水灌得较多,就会发现,原本是相连的“陆地”,部分被“海水”湮没而分隔成岛。比如,可以告诉孩子,台湾岛、海南岛本来是和大陆连成一片的。
2.在另一盘内,铺一层沙,中间挖一个坑(如图),让宝宝用器皿盛水,慢慢地往盘内灌水,宝宝将发现凹处会积满水,从而领悟:陆地上大面积聚积的水就叫湖。可以问问宝宝还知道哪些湖?
益处:引导宝宝注意自然界千变万化的事物,帮助他们逐步认识自然界,去探索大自然的奥秘。
注意:别把孩子老关在家里灌输知识,若有机会应多带宝宝出外旅游,引导宝宝去观察大自然,开扩眼界。

四、名称:画地图
目的:让宝宝初步知道什么是“地图”,并通过画地图游戏初步建立前、后、左、右等空间概念。
做法:
1.带宝宝去动物园,买一张导游图,找个地方坐下,看着图:让宝宝说出动物园里都有哪些动物?正确说出各动物的名称,诱发宝宝按图寻找动物。
向宝宝启发提问:怎么才能不重复、又不遗漏地看到每个动物呢?并说明“导游图”,就是一种“地图”。
带宝宝去每一个游览区时,都不妨购置一张游览图,以加深孩子对地图的认识。
继而让宝宝接触所在地的“市区地图”,向宝宝指出那些熟悉的地方的位置。
2.玩“游戏棋”(如图)(从1~15站到幼儿园)

5.jpg

3.让宝宝画“地图”
从自己的家到幼儿园将经过什么地方?路旁有哪些建筑物和哪些商店?前面是什么?左边、右边是什么?让宝宝试着画一画简易地图。
益处:
通过本游戏,有助于宝宝及早懂得道路的方向,左右拐弯等方位、空间概念,继而对交通规则、人行横道线、人行道等加深认识。
注意:方位认知教育可让宝宝从自身的前后、左右的方位开始。
如图:

6.jpg

面前有什么?身后是什么?右边是什么?左边有什么?

Posted in 工作 | No Comments »

遭遇裸聊

9月 30th, 2009 by Scott

Clara 说:
hi

Scott Tan 说:
morning,

Clara 说:
hi how are you today?

Scott Tan 说:
fine,tks!

Clara 说:
my name is  paris I’m doing great today I’m 21 yrs old how old are you?
listen hun, I am just about to start my webcam show with jen, come chat me there in my chat room? We can cyber, I will get naked if u do..lol!

Scott Tan 说:
go ahead

Clara 说:
I can show u how to watch free if u promise not to tell anyone else how to do it???PLEASE

Scott Tan 说:
¥%&*&……%

Clara 说:
well since its free the law that u gotta be 18 (nudity involved), u have to sign up with a credit card for age verification! BUT .. Once you are inside, just clikc on “Webcams” let me know what name you use to sign in with so I know it is you babe! http://www.delraypartying.com/alina2    fill out the bottom of the page then fill out the next page as well and u can see me live for free!

Posted in 未分类 | No Comments »

« 前一页