Wednesday, 19 September 2007

Brief intro of life in Welcome Week

今天6点多就醒来了, 因为昨晚睡了太长的时间, 从下午5点起, 一直睡到今天的早上6点, 期间因为忍不住饿, 起来忍心泡了一包面, 现在想想为什么当初不多带些, 可以解决welcome week的中饭问题, 因为昨天在逛jubilee campus时, 在学校超市看到泡面的均价在8块人民币, 心碎到昨天中饭都没吃, 只为了一个目的那就是省钱。 在welcome week虽然可以免费住, 免费早饭和晚饭, 但是中饭还是要自己解决的, 昨天下午, 有几个同学实在忍不住了, 跑去要了一个鸡腿和薯条, 花去了3英镑, 回来直和我叫苦。 这几天实在太吃力了, 下午5点在床上一靠,就靠到了现在, 不光错过了难得的晚饭, 还靠出来了鼻血。 其实在飞机上的12个小时, 我就感觉到鼻子不对劲, 有一点点的鼻血, 因为空调的原因, 飞机上的空气太干, 吃的东西也不则样。 这让我特别怀恋家里的味道。 走之前也就是15号, 家里特地摆了一桌菜, 因为家里不能送我去机场, 只叫了些亲戚朋友, 那天爸爸特别高兴, 也特别的郁闷, 有很多话说, 可是都忍住了。亲爱的奶奶烧的菜, 是我小时候, 现在都很喜欢, 将来也会特别的怀念的。 可是现在她重病在身, 已经不能把话说清楚了, 我最担心的就是她了。次日, 便是我在家的最后一顿, 按照当地习俗,妈妈煮了长寿面, 妹妹和姑姑还有叔叔, 当然包括爷爷和奶奶, 这些人很难得聚在一起的。 7:25从千岛湖长途汽车站出发去上海。幸亏车子不拥挤, 我挑了个好位置来摆放我的行李和我自己。期间, 有两个日本人妞搭乘我们的大巴, 可是在车上一句话也没说, 挺佩服的, 两个人都挺瘦弱, 手里拿着一本旅行指南, 身上背着个包,就这样去做自己喜欢的事情。12:30到达上海, 司机念在我要出国读书, 当汽车到达上海南站的时候, 帮我把那个巨重的行李搬到了车下。出了南站, 对我来说就完全是陌生了, 幸亏我还能厚着脸皮, 到处问路。 为了省钱, 硬是拒绝了一个搬运工的生意, 自己拖着所有行李, 过隧道, 上楼梯, 过街, 然后上公交。 南站到飞机场有专门的公交专线, 机场7线, 票价20, 行程一个小时。当公交即将到达机场的时候, 心里蒙的一跳, 一辆磁悬浮从身边飞驰而过, 机舱更是雄伟。下了车, 终于可以不用在拖拉行李, 随手找到手推车, 放上行李, 顿时感觉如是副总。可是机场的staff并不怎么热情, 但有一些非常热情, 带我去商务中心打印, 还帮我问这问那, 但最后冒出一句话,非常让我吃惊, 他问我要不要住酒店, 这在中国看来是常见的现象了。 机场还不错, 都是中国人, 我在里面逗留了一个下午, 把所有东西都问清楚了。 在行李方面, 感觉有一点上当受骗的感觉。 电话问询航空公司, 他们说行李不能超过30kg等等, 其实在安检的时候根本就没有来查, 大致过了就可以了,手提行李里面只要没有违禁物品,就没有问题, 对大小和重量都没有问题。 这个消息对我来说很有用, 所以当晚我就准备了赛了更多的东西到我的包中去, 到了英国, 看了物价, 就在责问自己为什么没有赛更多。 不过站在他门的角度来想想, 的确也是的, 中国人就是喜欢转空子, 如果他们不把关好的话, 那很多人就会多带,飞机的承重能力有限, 最后损失的还是我们自己。机场给我的还有一个感觉就是贵, 我把护照复印了一份, 开价15rmb, 一份很小包的薯条30rmb。可是当你到了候机区, 那情况就完全不一样了, 那里有保税区, 我同学比较有从商经验, 看到万宝路才99RMB一条, 这个价格比国内的利群还要便宜一般, 就毫不犹豫的买了两条(每人购买的最高限), 准备带到英国高价卖出, 因为英国是不鼓励吸烟, 所以烟税很高。我当时就错过了这个机会, 都在到处拍照片。晚上在机场旁边,其实也比较远的地方找了个宾馆, 120RMB一晚, 已经相当便宜, 充实了一下我的行李, 吃了顿辣的, 睡了个好觉。第二天7点出发, 8点到达机场, 人已经排满了。 我在e区等待领取登机牌, 维珍的在L区。 慢慢的同学都来了, 大部分都有家长陪行, 个别几个像我这样的抱着不同目的单独一个人, 其中还有两个女生, 比较强悍,一个人, 两个大行李箱, 一个登山包。就这样准备浩浩荡荡的前往英国。 我发现了家长陪同的一个比较隐讳的目的, 在机场, 同学相见谈天, 家长也见面, 也聊天, 但同时还交换联系方式。11点正式航空公司检票和行李托运,在精心准备的情况下, 托运行李超重2公斤, 手提行李超重5公斤, 还有笔记本电脑包和腰包里面乱赛的东西, 肯定也是可以通过检查的, 可以说一路上畅通无阻。所有手续办完, 在候机厅候机的时候, 发现身上的1000元现金没及时存掉,问了几家银行, 他们居然说候机厅只能办理外国居民的对外换汇业务, 不受理人民币的存取业务, 看俩我只能是讲这些人民币带到英国,然后看着他在物价飞速上涨的情况下贬值。飞机上的经历是比较痛苦的, 需要坐12多个小时, 没有什么娱乐设施, 还不能开手机玩游戏, 我又没做在靠窗的位置, 最主要的是, 我睡不着, 12个小时里, 我的睡觉时间不过2小时, 其余的时间都不知道怎么过的。饭食一般, 且量很少, 少的可怜, 中饭就吃了一个包子,所以导致了我下飞机就很累, 没有即使调整好自己的时差。下了飞机, 出关检查, 有一点值得高兴的就是, 在宁波两年, 英语没有白读, 英国口音非常顺口, 所以出关没有遇到大问题, 由于我的行李箱硕大, 所以也是第一个找到行李。还有一个感触就是, 在英国, 只要你的态度好, 别人就会对你很热心, 按照这点, 我发现我来对了地方,对于一个做好吃苦耐劳的准备的人来说, 这里真的可以发展的很好, 因为没有人会干涉,反而会伸出援助之手。学校的coach开了3个多小时,一下飞机, 我们就感觉到了莫名了冷, 因为在中国,现在正短袖, 在英国, 早晚现在需要穿个厚衣, 才能不被冻死。coach的温度在8度左右, 就这样一直开, 我们也一直睡。 事后我和同学聊天, 大家都觉得在coach上睡的特别爽, 别飞机上那是好多了, 因为英国的马路很宽, 很平, 很干净, 而且英国的司机开车开的很快。回到学校, 大家都兴奋不以, 虽然当时是当地时间12点, 可是窗外的景色透过轮廓就可以感觉到他们的灵性。学校特地提供了披萨, 领我们去住处, 感觉很温馨, 住的地方不错, 一个人一间, 两人共用一个卫生间, 窗户很大, 而且我的窗可以看到日出, 看到学校的美景。寝室内和寝室外的温度那是相差大多了。 大家洗完澡, 聚在一起聊天, 然后睡觉, 这一觉真的很舒服, 但大部分人当地时间6点多就起床了, 因为睡不着, 这个时间对中国来说刚好是午睡时间, 这也直接导致了我到现在都还保持着的晚上10点左右就睡觉, 早上7到8点钟就醒的良好作息习惯。早上, 大家在寝室门口集合, 然后有人带我们去吃英式早饭, 需要排队, 有点像自助餐, 因为每个人的口味不一样, 所以餐厅索性就把所有东西都放好,然后喜欢吃冷的就直接拿, 喜欢吃热的,旁边就有加热设备。 我挑了培根(一开始我以为是猪肉), 香肠和烤土豆, 然后就是加热过的面包, 橙汁, 牛奶, 巧克力。 吃饭的地方据说是有点历史的,因为吃饭的时候旁边就刚好做了一个穿黄色衬衣的volunter, 交谈中才知道, 这里有很多19世纪中后期的痕迹, 后来几经装修依然保留了一下,现在这里变成了一个学术晚会据点。 它的名字也很有意思叫做Lincoln hall。 吃饭的时候, 每个人的行为和态度是不一样的,因为大家都是国际生, 来自不同地域, 拥有不同文化, 至少现在还没有被同化不少, 但有一点我发现是相同的, 那就是人都会不好意思。在这里,大家的态度都很好,都很讲礼貌, 很多事情我们觉得不好意思, 他们也会觉得不好意思。比如说, 第二天我去吃饭的时候,那个黄衬衣告诉我说,昨天准备了很多东西,后来都倒掉了,大家好像都没吃多少, 怕难为情, 都不敢去拿, 其实学校事先就告诉我们了, 中饭学校不提供午饭(因为中午大家时间不统一的), 所以就特意早上多准备些,希望大家多吃一些, 可是很多人都考虑太多了。还有一点就是出了国,这个民族感特别强, 什么事情都喜欢提高国家的程度, 那天早上, 我的一个同学一次性拿了两碗牛奶, 结果必定是溅出许多, 他以为没事情, staff马上就去拿了一个牌子上面写着:wet floor, take care。 然后很多同学看了不爽就纷纷指责说真他妈的丢中国人的脸,那个同学连忙去拿拖把把地板插干。吃完早饭, 感觉环境真好, 在中国也能看到如此美丽的景色, 但大部分都是自然景色, 没有人工的修饰, 在这里感觉会不一样, 这里的房屋似乎初看似乎比较人性化, 比较喜欢融入环境, 而不是带有强烈的战友欲望, 不知道这样的感觉还能保持多久, 当我在这里住久, 也许这种感觉就会相对来说减淡。 一架飞机非常安静的云间飞过, 留下一个清晰的白色丝带飘动在蔚蓝的天空, 我不知道为什么这里的天空是如此的明亮和干净。后来几天我发现每次早饭后我都能看到这条白色丝带。白天的活动还是比较多的,学校发的资料中, 有地图,有今天的形成表, 什么时候有什么活动都罗列在上, 你不需要每个都参加, 活动戳过了也没关系,过几天还有类似的活动, 所以什么都是自己安排,这个在宁波已经习惯了这样自己合理安排的生活了。 拿着地图, 用着还凑或的英语, 赶这个场赶那个场。 在宁波我学会一点,或者说改变了以前的一个思维习惯, 那就是要学会取舍, 学校一天有很多多动,不可能个个都参加, 也不是个个都适合自己, 抓关键点才是最重要的。走了一天很累, 为了节约, 没吃午饭,下午回到寝室, 倒头就睡, 任凭同学敲门, 呼唤, 都没醒过来, 最后还是在晚上9点钟, 被恶醒了, 花去了8快人民币一包的方便面。后面几天其实过得差不多, 只不过多了一些有意义的活动,比如说参观市区, 去beeston购物, 去新房子考察等等。 有点忙, 有点累, 但这都是我们必须要经历和尽力的

Sunday, 9 September 2007

Birthday

 
I am luck to remember one's birthday, send this as gift, best wishes
Posted by Picasa

Tuesday, 24 July 2007

月亮之上

月亮之上——凤凰传奇


我在仰望 月亮之上
有多少梦想在自由的飞翔
昨天遗忘啊 风干了忧伤
我要和你重逢在那苍茫的路上
生命已被牵引 潮落潮涨
有你的远方 就是天堂

谁在呼唤 情深意长
让我的渴望象白云在飘荡
东边牧马 西边放羊
热辣辣的情歌就唱到了天亮
在日月沧桑后 你在谁身旁
用温柔眼光 让黑夜绚烂

我等待我想象 我的灵魂早已脱僵
马蹄声起马蹄声落 看见的看不见的
瞬间的永恒的 青草长啊大雪飘扬

节奏响起 煽动了想象
让摇曳的身体开始开始思想
马头琴悠扬 马奶酒穿肠
我的爱情奔跑在呼伦贝尔草原上

你的善良 我不能不能抵抗
你的纯洁 将我的心紧紧捆绑
OH 你的笑容 让我找到了最后信仰
美丽的月亮 你让霓虹黯淡无光


Saturday, 21 July 2007

普适计算

主机计算(mainframe):多人共享一台计算机
桌面计算(personal computer):一人一台计算机
普适计算(ubiquitous computing):一人可使用多太计算机资源。

计算模式
主机计算模式--分时操作系统
桌面计算模式--个人操作系统, 图形用户界面

人的注意力得发展到目前为止并没有按照摩尔定理发展。
普适计算就是解放人的注意力。 所以它不是高端计算。

定义:
无论何时何地, 只要用户需要, 就可以某些设备访问到所需要的信息
移动设备+嵌入设备+固定设备+互联网
个性化, 自适应, 多摸态得人机的人机交互
无缝移动:在多个具有不同性能的设备上或提供多种不同服务的环境中自由移动, 但不影响或者很少影响用户的使用和操作
协同工作和计算资源的智能分配
普适计算的本质不在于开发新的设备, 在于一种计算模式的创新。

桌面计算模式的局限性:
以计算机为中心而不是以人为中心。
计算资源是私有的, 而不是共享的
计算是固定的, 而不是随时移动的

关键技术
开发针对普适计算的软件平台和中间件
建立新型的人与计算服务的交互通讯
建立面向普适计算模式的新型应用模型:感知上下文计算(context-awareness), 无缝移动(seamless mobility)
提供适合普适计算时代需求的新型服务:移动会议(mobile meeting), 灵感捕捉(notion capture)

思想最早有前xerox parc首席科学家mark weiser在1991年提出
以中间件为核心的企业计算, 让计算能力公用化的网格计算, 倡导平等共享的对等计算,和计算无处不在的普适计算。

mit的oxygen研究计划
未来世界将是一个到处充迟着嵌入式计算机的环境, 他们已经融入了人们的日常生活中。 oxygen希望充分利用这些计算资源, 达到做的更少, 完成更多的目的。人做的少一些,计算机做的多一些。

uc berkeley的endeavour计划
关键就是流体软件的开发, 他可以自适应的选择在何处执行, 在何处存储, 它通过协议获得可用资源并向其他实体的提供服务。

washington的portolano研究计划
根据用户的位置变化而自适应的改变软件的位置等。

cmu的aura研究计划
研究在普及计算时代, 在用户和计算环境之间增加一层软件层aura, 由aura代理用户区管理, 维护分布式计算环境中平凡变化,松散耦合的多个计算设备, 以完成用户的目标任务。人的精力是最宝贵的资源。应该让它集中在用户完成的事情上。

task-driven computing
energy-aware adapatation
multu-fidelity computation
intelligent networking
resource opportunism

task-driven computing
problem:
humans interact at two low a level with computer
result: consume moble user's attention
solution:
support user intentions
support mobility
support proactivity

some research challenges:
design of task definition language with rich expressive power
multi-modal interface for creating and modifying tasks
mechanisms for tracking , suspending and restoring task state
design of platform-independent task apl
platform-specfic implementations of task apl
triggering mechanism for pro-activity

percasive healthcare systems
普适计算是医院在电子化信息化发展中的必然结果
随时随地方便的获得和记录各种诊断信息是该项目的基本目标
项目可以分为移动计算和基于环境的计算两个部分
项目已经投入实际运行
从该项目从理论和实践对普适计算提出了许多新的问题。

操作系统:rtos
ipp for ia and intel sa
网络接口: can 总线
usb接口

计算机软件与网络的五年发展

由于微电子技术的发展, 所以计算机硬件每10年更换一代

50年软件业发展全景图
早期专业服务公司
早期软件产品公司
强大企业解决提供公司
客户大纵市场软件。
软件服务

计算机技术发展定律:
Driver law: 政府支持和市场驱动是计算机技术发展的永恒动力
Moore` law:硅芯片的功能和价格
10 year law: 计算机技术发展经过10年发展有革命性飞跃性发展。
computational force law:计算机资源和环境的不断增强和持续变迁, 软件处理能力极大提高, 渗透性应用能力极大提高,成为科学与技术发展的模仿仿真手段。

网络计算的技术发展趋势:
client/service->clienct/cluster->
client.networking->
smart client/virtual server environment
基于网络的虚拟服务环境是未来趋势

普适计算是21世纪的计算模式
internet计算环境的特征:
开放性
动态性
多态性
无统一控制的真分布性
节电的高度自治性和不可预测性
节电链接的开放性和动态性
人, 设备和软件的多重异构性
使用方式的个性化和灵活性
网络连接环境的多样性。

计算机应用:在计算能力和环境不断增强和持续变迁下, 不断拓展和升入
软件和网络已经作为国家战略的重要部分。
国家计划建以和实施项目预示软件发展的趋势

每年pitmc报告
美国1994年正式提出了高性能计算机系统-hpcc
1995年强调hpcc得好用性和建设国家信息基础设施-nii
1996年把通信置于计算前面, 建设分布协同信息处理环境-dcee
1997年重点转向网格, 提出了information -wide- area- year
1998年提出高端计算high end computing and computation-hecc
1999年提出了基于网格grid计算
2000年重视大规模和海量信息处理
2001年提出了高生产率的计算系统
2002年满足21世纪对高校,安全, 可裁减的网格计算的需求,
2003年开发高性能计算和网络环境和技术, 一切为了国土安全

软件体系概述
软件产品:独立的软件产品形态
嵌入式软件:
软件服务

软件体系:
完整的软件体系对竞争十分重要
开元软件已经形成一个初步完整的软件体系
开元软件已成为软件世界中的重要力量。

开放组织如W3C, OMG, IEFT等国际性中介机构都成为围绕着INTERNET得应用。

90年代, 操作系统似乎没有非常有影响的新的思想产生

近10年来, 嵌入式操作系统是热点。

操作系统未来趋势:
网络化趋势:浏览器应用
微型化趋势:嵌入式系统
构建化趋势:即插即用
专业化趋势:支持QOS服务
可信化趋势:

数据库乡小型化发展和网络应用发展

中间件和操作系统和数据库系成为基础软件体系的三大支柱

嵌入式系统是实现后PC时代数字化智能化产品。

网格计算:支持第三代INTERNET应用

网格:简单概念
在大型科学研究和工程领域, 高性能的网络应用, 如科学仿真, 药物开发等, 需要由各个合作机构的共同参与, 需要使用个机构的拥有的资源, 通过高速的网络共享合作伙伴所拥有的计算, 存储和显示资源来解决复杂的计算问题。 这些地理上分布的资源形成了资源网格, 利用资源网格上的资源进行的分布式计算被称为网格计算。
计算:
在硬件方面, GRID需要讲地理上分布在不同的地方的硬件资源,如网络,计算机,数据仓库以及可是华虚拟现实显示等有机的连接起来。
在软件方面, GRID的作用就像一个中间件, 它将需要的各种硬件和软件资源有机的集成起来以便这些不同的部件能够协同原作。

工业设计学科总述--设计, 创新,文化

工业设计不是工业产品的设计, 也不是工业领域的设计, 而是指形成于工业社会的一种不同于手工业设计与艺术设计的设计思想与设计方法。
它是一个新型的交叉学科, 结合了自然科学, 社会科学与人文科学三大人类知识领域各科学科, 对以工业产品为主的人造物进行系统的, 最优化的设计。 所以工业设计既不是工程设计, 也不是艺术设计,是产品的系统设计。

技术设计:
解决“物-物”关系
工程师
自然科学与工程技术知识
创造物的使用价值
本质是手段的设计(体力的解放)
共性

艺术设计:
解决“人-人”关系
人文知识与社会科学知识
创造审美价值
本质上是情感传递的介质设计(精神解放)
个性

工业设计:
解决“人-物”关系
设计师
自然科学知识, 工程技术知识,人文知识和社会科学知识
创物得文化价值
本质是人的生存方式的设计(目的设计)(体力与精神的追求)
共性与个性的结合

任何一个物得设计,都是在某一个系统中寻求一个使系统保持和谐与协调的过程和结果
工业设计是以设计物为对象, 载人-对象-环境系统中寻求和谐与协调的思想与方法

本质:创造更加合理的生存方式

物应该是人的镜子, 是人的生物特征与文化特征的投射
生存方式的设计, 有提升人的生村质量, 也有可能降低人的生存质量。
一个民族的生存方式就是一个民族的文化, 设计了生存方式也就是设计了文化。

智能信息技术

应用:
符号计算技术
模糊技术
人工神经网络技术
演化计算技术
广义计算技术

模糊技术
模糊性是人类思维和客观事物的普遍具有的属性之一:
世界模糊性
思维模糊性

模糊的普遍性
在客观事物质之间存在着中间过渡,促在着亦此亦彼现象及模糊现象
尽管事务的表现和内在属性尤其确定性, 但是由于观测有段和科研水平所限, 在科学发展的一定阶段上,人们对这些属性的认识带有模糊性
人类通常运用模糊的词语来交流思想,互通信息, 然后进行推理分析, 综合评判, 最后作出分类决策。

人脑的认知过程
获取模糊轮廓印象-〉联想与回忆-〉模糊推理和判断
人脑的重要特点之一就是能对模糊事务进行识别和判断, 人们的行为活动通常是从客观事物获取模糊的印象, 表象以及模糊概念的情况下展开和做出反应的。 人脑对于客观事物的认识,往往只要通过一些模糊的信息的综合便可获得足够精确的结论。

模糊集合的诞生:
正是针对自然环境和人类认识过程中存在的模糊性现象,美国控制论专拣,加利弗里亚大学教授L.A.Zadeh在1965年在Information and Control发表了开创论文Fuzzy sets, 第一次提出了模糊集合的概念, 这标志着数学的应用范围从精确现象扩大到模糊现象的领域, 从而建立了模糊信息处理的新课题。

模糊技术发展
1984年国际模糊系统联合会IFSA成立
1985年, ifsa年会在西班牙召开
1987年, ISFA第二届联辉在日本东京召开, 会上推出了10余套模糊控制软件与硬件
日本和一些发达国家先后掀起了异国模糊技术的热潮, 模糊控制思想广泛接受,特别是采用了魔术技术的新一代家电。

杂志:
中国的《模糊系统和数学》

模糊结合及其表示方法
普通集合式模糊集合的特列
模糊集合是普通集合的扩展

普通集合:
全集U, u是U中的元素, U上的普通集合A`可以用特征函数来表示
XA`(u)=1 UXA`(u)=1 U!
模糊集合
全集U中的元素可以部分的属于模糊集合A, 则模糊集合A可以隶属函数来表示:0<=UA(u)<=1. UA(u)就成为元素对模糊集合A的隶属度, 又称为A得隶属函数

集合元算和我们一般的集合运算相差不多,
模糊集合的运算满足补余律外的所有普通集合运算定律。

模糊检索的特点:
处理对象多样化
信息处理智能化
人机借口自然化

模糊查询
模糊词是表示模糊概念的单词。 模糊词可以用模糊集合来表示, 而模糊词可以用隶属函数来表示
模糊词通过并交补运算就成了模糊词组
语气算子ht是自然语言中这样一些词, 他们放在一个单词前面一加强或减弱与其。这里的t是一个正实数, 当t>1时就称为集中化算子, 当t<1时, 就称为散漫化算子。 可以适当起些名字。
模糊化算子f是自然语言中这样一些词, 他们点缀在一个单词前面, 使其语义模糊化。

有了上述基于模糊集合的定义, FIS得模糊查询q就是由语气算子ht, 模糊化算子f, 模糊词FW(包括清晰词)及其并,交, 补算子所组成。 表达式:q:[ht/f]FW{O[ht/f]FW} . 其中, {U, N, -}; []中的内容可缺省; {}中的内容可重复0次回多次。

模糊检索系统结构:
用户接口:允许用户使用自然语言
程序接口:系统维护
总控模块:接受用户接口以及程序借口送来的操作命令, 进行一系列的分析和处理, 将有关的参数信息转发给相应的处理模块, 并控制转到相应的处理模块执行。
模糊知识管理模块。
模糊检索模块:核心, 同时访问知识库和系统数据库
帮组模块:

其他应用
模糊决策
模糊模式识别: 手写输入识别, 癌细胞诊断。
。。。


人工神经网络技术
1943年, 心理学家McCulloch和数学家Pitts合作提出了形似神经元的数学模型--MP模型, 开创网络研究的时代。
1957年感知机
70年代后期, 已经认识到von neuman 体系结构的局限性,特别是与人脑的智力活动存在较大差异:
计算机布局别学习能力
对于不能用数学模型表达的问题无能为力。
日本第五代计算机计划失败。
许多学者开始转向神经网络计算。
Hopfield(加州工学院)1982年提出了HNN模型
Rumelhart提出了PDP(并行分布)理论, 致力于认知结构微观的探索, 并与1986年提出了多层网络的BP算法;
1987年, 国际神经网络学会诞生.


生物神经元模型:
神经元就是神经细胞, 使脑组织的基本单元。
神经信息处理结构:
信息输入(树突)-〉信息处理(细胞体)-〉(信息传输)轴突-〉信息输出(突触)
细胞体:细胞核, 细胞质, 细胞膜。
轴突:神经纤维, 相当于细胞的输出电缆, 其端部的神经末梢为信号输出端子, 用于传出神经冲动
树突:相当于输入端, 接受来自四面八方的传入神经冲动
突触:细胞与细胞之间通过轴突和树突相互连接, 接口就成为突触,每个细胞有1000-10000个突触, 突触有两种类型, 兴奋性和抑制性。
膜电位:细胞膜内外之间的电位差, 约20-100mv, 膜外为正, 膜内为负
结构可塑性:由于突触地信息传递性是可变的, 随着神经冲动的传递方式的变化, 其传递作用可以增强, 也可以减弱, 即细胞之间的连接是柔性的。
兴奋--当传入冲动的时空整合结果,使膜电位升高, 超过动作电位的域值(40mv)时, 细胞进入兴奋状态, 产生神经冲动, 由轴突输出
抑制--当传入冲动的时空整合结果,使膜电位低于动作电位的域值, 细胞进入抑制状态, 无神经冲动输出。
脉冲和电位转换:突触界面有脉冲/电位信号转换功能,由轴突传递的电脉冲为等幅,横宽, 编码的离散脉冲信号, 而细胞膜电位变化为连续的电位信号, 在突触接口处进行数/模转换是通过神经介质以量子化学方式实现的变幻过程。:电脉冲-〉神经化学物质-〉膜电位
由于突触地结构可塑性, 突触地传递作用有增强, 减弱, 饱和, 所以细胞有学习,遗忘和疲劳效应。

人工神经元是多输入单输出的非线性器件

典型的人工神经网络模型
感知机:分类器
BP网络:多层前向网络
自组织特征映射网络:用于最优映射
Hopfield网络:全廉洁网络, 用于解决组合优化问题, 给n各城市, 寻找一条不重复通过所有城市的最短路线。
双向联想存储器:模式识别。
人工神经网络模型的信息处理能力:
大规模并行分布信息处理(现在计算计只能串行离散符号处理)
分布信息处:信息存储体现在神经元互联的分布, 并以并行分布式处理(现在计算和存储是相互独立的)
高度的努棒性和容错性, 善于联想, 概括, 类比和推广, 任何局部损坏不会影响到整体结果
很强的自学习能力, 系统可以在学习过程中不断完善, 具有创新特点。
具有集体运算能力。

人脑学习学说:
化学学说:认为神经系统把学习后的结果记录在某些生物分子(蛋白质, 核酸, 神经递质)上, 就像遗传信息纪律在DNA上。
突触修正学说:认为学习过程中神经元之间的突触联系发生了变化, 人工神经网络按照突出修正学说来模拟人脑的学习过程。

学习规则:
误差修正学习:根据系统的期望输出与实际输出之间的误差作为连接全调整的参考, 最后减少这种误。
随机性学习:结合随即过程, 概率和能量的概念来调整网络的连接权, 从而使网络的能量大到最小。
毫不性学习:两个神经元同时学习,他们的联系需要加强。

应用:
模式识别
最优化问题
数据库知识获取
数学逼近映射
概率密度函数评估
自动控制
信息处理
风险识别

广义学习的理论基础:
大脑自适应原理:采用自顶向下的方法分析系统水平以及系统水平和回路之间的联系, 用自顶向上的方法分析细胞水平和回路水平及其他们之间的联系, 从而归纳出大脑的自适应原理。

广义学习系统的特点:
高度并行
有机融合
择优进化

广义计算与决策分析
数据库
知识库
。。。

广义计算与企业知识流
信息收集和处理
知识孵化:发现隐性知识
知识产品开发
企业知识控制:
知识管理技:员工知识素质管理与知识学习+ 知识创造+建立企业的知识体系
信息技术:数据仓库技术+知识工程技术+数据挖掘技术

电信行业的数据挖掘系统
分离大客户和普通客户, 进行专业的营销和服务。
TDMS的任务:
流失客户预测
欺诈客户识别
时间序列分析

信息技术和电子商务

概念:
电子商务并不是一个单纯的技术概念, , 也不是一个单纯的商业概念, 而是涉及到整个商务运作的全过程
电子商务的产生和发展与信息技术的发展和应用紧密相关。
从信息技术的角度:
web communications(tcp/ip)+web user interger(html)+web programming(java)+web data(xml)=e-business
电子商务发展背景
第一阶段:单项业务电子化--单机环境(50-60年代)
第二阶段:部门业务电子化--局域网环境(70-80年代)
大中型计算机+终端机+网络+数据库为框架的电子商务环境
第三阶段:综合业务电子化--互联网环境(90年代)
综合:点-〉线-〉面
电子商务发展过程
第一阶段:电子商务启动期(90年代中后期)
一大批以.com为代表的兴网络企业
开始建立自己的网站的传统企业
只有少数的新兴网络企业坚持下来, 很多传统企业怀疑电子商务的能力, 涌现出了一批成功的电子商务企业

浙江省块状经济区域网络化制造系统开发与应用。

工业革命到信息革命的三个世纪
19世纪:火车+铁路
20世纪: 汽车+ 高速公路
21世纪:电脑+ 网络
网络世界=第8大洲

信息商品交易的特殊性:
信息商品交易中的价格不确定性
信息商品在多次流通中的价格迅速递减规律
信息商品交易中的风险性

产品结构的特点:
知识-〉技术-〉产品的时间越来越短, 结构越来越复杂
现在市场上的电子产品周期0。5年

普及标准:30%的家庭才作为一项技术普及应用的标志。

制造业的标志性进展:
全数字化的定义--无直生产
数字化预装配--无金属样机的生产
广域网上的异地设计, 异地制造
基于step得数据交互
协同工作小组

自动化孤岛:信息集成
将自动化孤岛集成在一起
最有效率的方法就是创建一个集成平台--cims

中心的变化:产品-〉市场-〉客户

信息时代造成了跨国公司的垄断性
跨国公司的工业研制费占世界总值的80%

美国产业演变历程

电子商务的内容:
信息网:
金融网
运输网

信息技术的走势:
infinite bandwidth(无限带宽)[超摩尔定律]
service on demand(服务点播)[基于b/s结构的数据/过程/应用继承]
plug&play[即插即用][web服务, net, xml]
shared ontology(共享的领域概念框架)
pervasive(无处不在)[与移动/无线/即使的通讯结合]
ondemand(按需服务)

人工智能

turing test:为了回答人工智能能否真正实现的喜,怒, 哀, 乐得问题?
将人和计算机放在两个不同的房间,在另一个房间里通过网络与他们交谈。 当第三个房间里的人不能区别这两个房间里的回答问题得对象是否是人的时候, 就具备了人工智能。

目前的人工智能两个代表性的观点:
the emperor's new mind
Roger Penrose[uk]
Oxford university press.
观点:
电脑要超过人脑是不可能的
原因:人类不可能在物理层次上理解大脑, 要像人的大脑是不可能的。
电脑的设计的思维是算法的, 只相当于人的逻辑推理的思维方式, 这个方法高效并非一定有效, 而所有根本的, 决定性的判断则必须是创造性地或者是直观的, 如艺术,数学的研究。

K.Warwick[UK]
century-random houe, 1997
电脑--单面的人, 虽然愚蠢, 但能力很强, 且具有一定学习能力, 网络使得电脑成为超级电脑。
智能是否为人类存在的最大奥秘? 智能的主要体现于逻辑, 而逻辑未给错误留有余地, 回顾人类历史的错误, 或者错误才能使人类的最大的奥秘。
Kurt Godel:incompleteness theorem:
within a formal system questions exist that are neither provable on the basis of the axioms that define the system.
所以在人工智能中将思维形式化机器化是有极限的, 在理论上给出了有些事情是做不到的。

Douglas R.Hofstadter
Pulitzer Prize Winner, 1980.

计算机视觉中的困惑
计算机视觉相对于人工智能的其他领域中取得的巨大成功:
六条腿的机器人在月球上漫步
爱国者导弹准确拦截飞毛腿导弹
就同监控系统可以识别飞驰汽车上的号码
计算机可识别人的指纹
这些与人类的视觉活动相比, 显然微不足道, 人类视觉中的视觉含义的包我以及主观经验在视觉中的作用,是及其所不肯能拥有的。
计算机视觉过程:
feature detection and extraction -> texture -> pattern classification -> image interpretation
C.Bloomer 《视觉原理》:人类视觉系统有意义的视觉信息而忽略无意义的视觉信息。
人的头脑从外来的刺激中毫无节制的产生含义。
视觉理解发生的机制还知之不多,但可以肯定这含有非线性突变因素, 而且导致某种结果的因素是不确定的(蝴蝶效应)
这其中摸不去的主观因素不可能通过确定的算法给出。
所以天气预报中有很多不可预测的东西。

计算机下棋:
组成部分:
评估函数(evaluation function)
树状搜索算法(tree searching algorithm)
1940年荷兰心理学家葛鲁特发现:
大师: 组块; 5秒钟摆出一个实际的对局; 若出错,则涉及到一组局势但不影响全局, 并不搜索错祺。
新手:每个棋子的确切位置; 曼的多; 认为是完全不同的棋, 对所有可能进行遍历。
计算机的象棋水平大致相当于新手水平。

在计算机上要实现人的心智能, 充满困境, 要冲破这一困境, 必须有理论性的突破--大自然的机理+算法
目前出现了一些新的尝试:
生物计算
量子计算
光子计算

Wednesday, 18 July 2007

java assert

相信学过c,c++的朋友一定不会对断言感到陌生。下面介绍一下断言在JAVA中的使用,JAVA是从JDK1.4才开始支持断言的(添加了关键字assert),请注意老版的JRE不支持。

断言概述

编写代码时,我们总是会做出一些假设,断言就是用于在代码中捕捉这些假设
可以将断言看作是异常处理的一种高级形式
断言表示为一些布尔表达式,程序员相信在程序中的某个特定点该表达式值为真
可以在任何时候启用和禁用断言验证,因此可以在测试时启用断言而在部署时禁用断言。同样,程序投入运行后,最终用户在遇到问题时可以重新起用断言。
使用断言可以创建更稳定,品质更好且易于除错的代码
当需要在一个值为FALSE时中断当前操作的话,可以使用断言
单元测试必须使用断言(Junit/JunitX)
除了类型检查和单元测试外,断言还提供了一种确定个种特性是否在程序中得到维护的极好的方法
使用断言使我们向按契约式设计更近了一部

常见的断言特性

前置条件断言:代码执行之前必须具备的特性
后置条件断言:代码执行之后必须具备的特性
前后不变断言:代码执行前后不能变化的特性

断言使用方式

断言可以有两种形式
1.assert Expression1
2.assert Expression1:Expression2
其中Expression1应该总是一个布尔值,Expression2是断言失败时输出的失败消息的字符串。如果Expression1为假,则抛出一个 AssertionError,这是一个错误,而不是一个异常,也就是说是一个不可控制异常(unchecked Exception), AssertionError由于是错误,所以可以不捕获,但不推荐这样做,因为那样会使你的系统进入不稳定状态。

起用断言

断言在默认情况下是关闭的,要在编译时启用断言,需要使用source1.4标记 既javac source1.4 Test.java ,在运行时启用断言需要使用 -ea参数 。要在系统类中启用和禁用断言可以使用 -esa 和 -dsa参数。

例如:
public class AssertExampleOne{
public AssertExampleOne(){}
public static void main(String args[]){
int x=10;
System.out.println("Testing Assertion that x==100");
assert x==100:"Out assertion failed!";
System.out.println("Test passed!");
}
}

如果编译时未加 -source1.4,则编译通不过
在执行时未加 -ea 时输出为
Testing Assertion that x==100
Test passed
jre忽略了断言的就代码,而使用了该参数就会输出为
Testing Assertion that x==100
Exception in thread "main" java.lang.AssertionError: Out assertion failed!
at AssertExampleOne.main(AssertExampleOne.java:6)

断言的副作用

由于程序员的问题,断言的使用可能会带来副作用 ,例如:
boolean isEnable=false;
//...
assert isEnable=true;
这个断言的副作用是因为它修改了程序中变量的值并且未抛出错误,这样的错误如果不细心的检查是很难发现的。但是同时我们可以根据以上的副作用得到一个有用的特性,根据它来测试断言是否打开。

public class AssertExampleTwo{

public static void main(String args[]){
boolean isEnable=false;
//...
assert isEnable=true;
if(isEnable==false){
throw new RuntimeException("Assertion shoule be enable!");
}
}
}

何时需要使用断言

1.可以在预计正常情况下程序不会到达的地方放置断言 :assert false
2.断言可以用于检查传递给私有方法的参数。(对于公有方法,因为是提供给外部的接口,所以必须在方法中有相应的参数检验才能保证代码的健壮性)
3.使用断言测试方法执行的前置条件和后置条件
4.使用断言检查类的不变状态,确保任何情况下,某个变量的状态必须满足。(如age属性应大于0小于某个合适值)

什么地方不要使用断言

断言语句不是永远会执行,可以屏蔽也可以启用
因此:
1.不要使用断言作为公共方法的参数检查,公共方法的参数永远都要执行
2.断言语句不可以有任何边界效应,不要使用断言语句去修改变量和改变方法的返回值

参考:
http://jcp.org/en/jsr/detail?id=41
http://java.sun.com/j2se/1.4.2/docs/guide/lang/assert.html
http://www-128.ibm.com/developworkers/cn/java/jdiag0723/
http://www-128.ibm.com/developworkers/cn/java/jmerlin/part9/

java native

The goal for this chapter is to introduce you to Java's native methods. If you are new to Java, you may not know what native methods are, and even if you are an experienced Java developer, you may not have had a reason to learn more about native methods. At the conclusion of this chapter you should have a better understanding of what native methods are, when and why you may want to use them, and the consequences of using them. You should also have a basic understanding of how native methods work. You will then be more than ready to tackle the next three chapters, which dive into the nitty-gritty details of Java's Native Methods.
What Is a Native Method?

Simply put, a native method is the Java interface to non-Java code. It is Java's link to the "outside world." More specifically, a native method is a Java method whose implementation is provided by non-Java code, most likely C (see Figure 30.1). This feature is not special to Java. Most languages provide some mechanism to call routines written in another language. In C++, you must use the extern "C" stmt to signal that the C++ compiler is making a call to C functions. It is common to see the qualifier pascal in many C compilers to signal that the calling convention should be done in a Pascal convention, rather than a C convention. FORTRAN and Pascal have similar facilities, as do most other languages.

Figure 30.1 : A native method is a Java method whose implementation is provided by non-java code.

In Java, this is done via native methods. In your Java class, you mark the methods you wish to implement outside of Java with the native method modifier-much like you would use the public or static modifiers. Then, rather than supplying the method's body, you simply place a semicolon in its place. As an example, the following class defines a variety of native methods:

public class IHaveNatives
{
native public void Native1( int x ) ;
native static public long Native2() ;
native synchronized private float Native3( Object o ) ;
native void Native4( int[] ary ) throws Exception ;
}

This sample class shows a number of possible native methods. As you may have noticed, native methods look much like any other Java method, except a single semicolon is in the place of the method body. Naturally, the body of the method is implemented outside of Java. What you basically define is the interface into this external method. This method declaration describes the Java view of some foreign code.

The only thing special about this declaration is that the keyword native is used as a modifier. Every other Java method modifier can be used along with native, except abstract. This is logical, because the native modifier implies that an implementation exists, and the abstract modifier insists that there is no implementation. Your native methods can be static methods, thus not requiring the creation of an object (or instance of a class). This is often convenient when using native methods to access an existing C-based library. Naturally, native methods can limit their visibility with the public, private, private protected, protected, or unspecified default access. Native methods can also be synchronized (see Chapter 7, "Concurrency and Synchronization"). In the case of a synchronized native method, the Java VM will perform the monitor locking prior to entering the native method implementation code. So, as in Java, the developer is not burdened with doing the actual monitor locking and unlocking.

The example uses a variety (although not all) of types. This is because a native method can be passed any Java type. There is no special procedure within the Java code to pass data to the native method. However, the developer of native methods must be careful that his native methods behave properly when manipulating Java datatypes. Native methods do not undergo the same kinds of checking as a Java method, and they can easily corrupt a Java datatype if care is not taken (see Chapter 31, "The Native Method Interface").

A native method can accept and return any of the Java types-including class types. Of course, the power of exception handling is also available to native methods. The implementation of the native method can create and throw exceptions similar to a Java method. When a native method receives complex types, such as class types (such as Object in the example) or array types (such as the int[] in the example), it has access to the contents of those types. However, the method used to access the contents may vary depending on the Java implementation being used. The major point to remember is that you can access all the Java features from your native implementation code, but it may be implementation-dependent and will surely not be as convenient or easy as it can be done from Java.

The presence of native methods does not affect how other classes call those methods. The caller does not even realize it is calling a native method, so no special code is generated, and the calling convention is the same as for any other method-the calling depends on the method being virtual or static. The Java virtual machine will handle all the details to make the call in the native method implementation. One minor exception may be with the methods marked with the final modifier. The Java implementation may take advantage of a final method and choose to inline its code. It would be doubtful that this could be achieved with a native final method, but this is an optimization issue, not one of functionality. When a class containing native methods is subclassed, the subclass will inherit the native method and also will have the capability of overriding the native method-even with a Java method (that is, the overridden method can be implemented in Java). If a native method is also marked with the final modifier, a subclass is still prevented from overriding it.

Native methods are very powerful, because they effectively extend the Java virtual machine. In fact, your Java code already uses native methods. In the current implementation from Sun, native methods are used in many places to interface to the underlying operating system. This enables a Java program to go beyond the confines of the Java Runtime. With native methods, a Java program can virtually do any application level task.
Uses for Native Methods

Java is a wonderful language to use. However, there are times when you either must interface with existing code, can't express the task in Java, or need the absolute best performance.
Accessing Outside the Java Environment

There are times where a Java application (or applet) must communicate with the environment outside of Java. This is, perhaps, the main reason for the existence of native methods. For starters, the Java implementation will need to communicate with the underlying system. That underlying system may be an operating system such as Solaris or Win32, or it may be a Web browser, or it may be custom hardware, such as a PDA, Set-top-device, and so forth. Regardless of what is under Java, there must be a mechanism to communicate with that system. At some point in a Java program, there will be that point where Java meets the outside world, an interface between Java and non-Java worlds. Native methods provide a simple clean approach to providing this interface without burdening the rest of the Java application with special knowledge.
Accessing the Operating System

The Java virtual machine describes a system that the Java program can rely on to be there. This virtual machine supports the Java Language and its runtime library. It may be composed of an interpreter or can be libraries linked to native code. Regardless of its form, it is not a complete system and often relies on an existing system underneath to provide a lot of support. More than likely, a full-fledged operating system, such as Solaris or Win32, resides beneath it. The use of native methods enables the Java Runtime to be written in Java yet have access to the underlying operating system, or even the parts of the Java virtual machine that may be written in a language such as C. Further, if a Java feature does not encapsulate an operating system feature needed by an application, native methods can be used to access this feature.
Embedded Java

It is conceivable to see a Java virtual machine embedded inside another program. Several WWW browsers come to mind. Perhaps this enclosing program is not implemented in Java. The Java Runtime may need to access the enclosing program for services to support the Java environment. Once again, native methods provide a clean interface for this access to the surrounding program. Furthermore, the vendor of the program may wish to expose some features of the program to a Java applet. The vendor would simply need to create a set of Java classes containing native methods, which provide the interface for the Java application into the program. The native method implementation would then be the "glue" between the Java applet and the internals of the enclosing program.
Custom Hardware

Another important possible application of native methods being used to access a non-Java world is providing Java programs access to custom hardware. Perhaps a Java virtual machine is running within a PDA or Set-Top-Device. A lot of what would normally be in an operating system may exist in hardware or software embedded in ROM, or other custom chip sets. Another possibility is that a computer may be equipped with a dedicated graphics card. It would be ideal to have Java make use of the graphics hardware. A set of Java classes with native methods defined would provide the Java program access to these features.
Sun's Java

In the current implementation from Sun, the Java interpreter is written in C and can thus talk to the outside environment as any normal C program can. A majority of the Java Runtime is written in Java and may make calls into the interpreter or directly to the outside environment, all via native methods. The application deals mostly with the Java Runtime, but it may also talk to the outside environment via native methods. For example in the class java.lang.Thread the setPriority() method is implemented in Java but calls the method setPriority0(), which is a native method in the Thread class. This native method is implemented in C and resides within the Java virtual machine itself. On the Windows 95 platform this native method will then call (eventually) the Win32 SetPriority() API. This is an example where the native method implementation was provided by the Java virtual machine directly. In most cases the native method implementation resides in an external dynamic link library (discussed in a following section), but the call still goes through the Java virtual machine.
Performance

Another major reason for native methods is performance. The Java language trades some performance for features like its dynamic nature, garbage collecting, and safety. Some Java implementations, like the current crop, may be interpreters, which also add extra overhead. The lost performance can be small as the implementation technology for Java systems improve, but until then and even after there may always be a small performance overhead for certain functionality a Java program may need. This functionality can be pushed down into a native method. That native method can then be implemented efficiently at the native lower level of the system on which the Java virtual machine is running. Once at the native implementation level, the developer can use the best-suited language, such as C or even assembler. In this way, maximum performance can be achieved in those specific areas while the bulk of the application is done within the safe and robust Java virtual machine. One area where you may choose to implement some parts of an application in native methods is time-intensive computations, such as graphics rendering, simulation models, and so forth.
Accessing Existing Libraries

The fact that Java is targeted at the production of platform-neutral code means that the current implementations may not access system features that you may need. An example is a database engine. If you need to, you can use the native method facility to provide your own interface to such libraries. Further, you may want to use Java to write applications that use existing in-house libraries. Again, the use of native methods enables you to make such an interface. This enables you to leverage off your existing code base as well as gradually introduce Java-based applications among your other applications coded in an older language.
Benefits and Trade-Offs

The presense of native methods offers many benefits, the biggest being the extension of Java power. However, there is always a downside to all good things, and native methods definitely have their downsides. Depending on what the goals of your application are, the downsides may not be that terrible. Foremost is the fact that, by definition, the use of native methods defeats several of Java's main goals: platform neutrality, system safety, and security.

Some of Java's attractive features help minimize the downsides, however. The best feature of all is that Java is such a nice language to develop in you won't want to use native methods unless you have to.
Platform Neutrality

Because a native method is implemented in a foreign language, the platform neutrality is limited to the language being used. Most likely, native methods are implemented in C or C++. Although those languages have standards, these standards leave a lot of room for implementation-defined attributes (even compilers on the same system may differ), so your mileage may vary. If the native method accesses the underlying system, you are tying your implementation to that system. For example, the file systems of UNIX and Win32 have some differences. There may even be differences between flavors of UNIX and Win32 (Win95 and WinNT are not identical). Once again, you may sacrifice your platform neutrality with your native method. This may cause you to have to support a limited number of platforms (rather than all Java platforms). Further, for each platform you choose to support, you may (probably will) have to implement several flavors of the native method.

The Java language and runtime provide a number of features that make applications more robust and safe. Java's memory management, synchronization features, and lack of address manipulation help prevent common programming mistakes from slipping through the development and testing phases of your product. However, once you drop out of Java into a native method, you are, once again, at the mercy of the language and system in which you are implementing the native method. If your native method implemented in C chooses to manipulate an address directly, you risk corrupting some part of memory, perhaps even the Java virtual machine itself.
Security Concerns

Additionally, the Java Language provides features to aid in the writing of secure applications. A Java virtual machine is much more capable of detecting an "evil" Java program than an application in other languages. Once you drop into a native method, the Java virtual machine can no longer verify, catch, or prevent the program from violating the security of the environment in which the Java virtual machine is running. This is the reason a Java-enabled Web browser typically does not allow a nontrusted native method to be called. In today's browsers, a trusted native method must be present on the local system in a certain location to be executed from an arriving applet (in other words, one loaded from a remote site). For more information on security, in general, see Part 6, "Security." For more information on how security applies to native methods, see Chapter 33, "Securing Your Native Method Libraries."
System Safety

Another potential hazard is the fact that a native method is not isolated. When a native method is entered, it not only accesses the environment outside the Java virtual machine, it also freely accesses the Java virtual machine directly. This is a necessary evil. It gives the native method quite a bit of power and flexibility, because it may need access to information kept within the virtual machine to do its job. This flexibility, however, exposes the internals of the Java virtual machine to the native method.
Dependence on the Java Implementation

It should be obvious that the implementation of native methods is also dependent on the Java implementation itself. This means that the native methods you write today for use with the Sun implementation of Java may not work with a Java implementation from another vendor.

The interface used for the Java virtual machine to call out to native methods and the interface that native methods use to access the internal functions and data structures of the Java virtual machine are not, currently, defined by either the Java Language Specification or the Java Virtual Machine Specification. A lot of native methods call back into the Java virtual machine for instantiating new objects, calling Java methods, throwing Java Exceptions, and so forth. Further, the method used to lay out Java types is also not defined. So, although your native method of today knows how to access the fields of an object, this could be different on the Java virtual machine of tomorrow. This oversight can be greatly helped if a standard API is defined for both how a Java program interacts with a native method and how a native method accesses data within the Java virtual machine. Even after such an API, implementation-defined behavior will likely still be present.
Java to the Rescue!

Recall that Java helps to minimize the damage of native methods. When you find yourself in the position that you must use native methods, you can take advantage of Java's features to help isolate the usage and perhaps maintain a fair amount of Java's advantages.
The Java Class System

Because Java narrows the use of native facilities to within the confines of a method, it does not affect the design of the program. A program is still a collection of classes and all classes still communicate with each other via their defined interface-that is, the classes' methods. Thus the callers of native methods do not know they are calling native methods. Because methods are discrete operations on the data of a specific object, they tend to be small chunks of code. This implies that native methods tend to be conceptually small, easily managed, pieces of code.
Java Still Works for You

Java will still perform a variety of duties-such as parameter checking, stack checking, synchronization, and so forth-before entering the actual native code. It greatly aids the developer in writing correct native methods. A native method is capable of creating new objects and calling Java methods, and it can even cause exceptions to be thrown. In the current implementation from Sun, an exception can be created by a native method and registered for throwing. When Java virtual machine gains control back from the native method, usually because of that method returning, the exception will then be thrown.

It's a good idea to make your native methods as small as possible and have them do a specific task. Do the work that needs to be done and pass the information back into the Java method. It's also wise to have your Java classes make the native methods private, then provide a public Java method that will call the private native method. This enables the Java method to perform error checks and other data manipulations, freeing your actual native method implementation to focus on its simple task.
How Does This Magic Work?

Much of the magic of making native methods work is provided in the next three chapters. This section provides an introduction, which neglects many of the details but should give you a good frame of reference for understanding the following chapters. If you don't really want to use native methods, but just want a basic understanding this discussion should satisfy your needs.
Sun's Implementation

Due to the lack of a well-defined interface between a Java implementation and its surrounding environment, the details of writing native methods will most likely be specific to the implementation of the Java system you are using. The next sections are based on the implementation provided by Sun on the Solaris-Sparc and Win32-Intel platforms.
Using Dynamic Linking

Sun's Java implementation interfaces to native methods by using the dynamic linking capabilities of the underlying operation system. The Java virtual machine is a complete program, which is already compiled for its respective platform. The nature of Java enables it easily to absorb a Java class and execute its behavior. However, for a compiled native method, things are not so simple. Somehow, the Java virtual machine must be taught how to call this native method. This is done by relying on the implementation of native methods to reside in a dynamic link library, which the operating system magically loads and links into the process that is running the Java virtual machine. On the Solaris platform, such a library is often called shared objects, or shared libraries, or simply dot-so's (.so's). On Win32 platforms, they are called dynamic link libraries (DLLs). This chapter uses DLL to refer to both.

Both Solaris and Win32 provide the necessary capabilities to achieve this dynamic linking. The dynamic linking facilities of both Solaris and Win32 are similar in concept, but differ in their details. This chapter does not attempt to describe the two in detail; however, if you wish to do native method programming, you should understand the mechanism used by your platform. On Solaris, you can begin by viewing the manual page on the dlopen() system call, and its relatives. On Win32, start with the help file on LoadLibrary() and its relatives. Further, you should understand the calling conventions and linking convention used by your compiler.

Sometime before a native method is invoked, the Java virtual machine must be told to find, load, and link the necessary DLLs, which contain the native method implementations. This is conveniently achieved by using the static method java.lang.System.loadLibrary( "mystuff" ). It is worth noting here that the name passed is not the actual filename of the DLL. Java maps the passed name into an expected filename, appropriate for the underlying system, of the DLL. In the call described previously, the string "mystuff" is mapped to a DLL named libmystuff.so on Solaris and mystuff.dll on Win32. If you run the Java program under a debugger, Java conveniently maps the same name "mystuff" to libmystuff_g.so and mystuff_g.dll. This enables you to supply two versions of the DLL-one with debug symbols, one without. Java magically finds the right one, dependent on whether you run under a debugger or not.
Defining the Calling Convention

In, essence, Sun defines the method its Java virtual machine will use to call external functions. In order to dynamically link and call the implementation of a native method successfully, the Java virtual machine must know several details. It must know the name of the function within the DLL (the implementation of the native method) to locate the symbol and its entry point. It also must know how to call that function (its return type, number of parameters, and types of parameters). The Java virtual machine expects the functions to be coded in C using the calling conventions appropriate for the underlying architecture (and compiler).

In simple terms, this means the actual function calls Java makes into the DLL must be known names; if you are trying to get Java to call into your existing library, unless your functions magically match the names Java expects (unlikely), you will usually have glue code, which sits between Java and your real functions. Java will call the glue functions, which in turn call in your functions. Alternatively, you can modify your functions to use the names and parameters Java expects, thus eliminating this extra call; however, in practice this is not always feasible, especially when calling existing libraries. Figure 30.2 shows the most likely scenarios of how your code will be segmented.

Figure 30.2 : Java's use of Dynamic Link Libraries.

The Sun JDK provides a tool, named javah, to help you create your native method implementation functions. The developer of native methods runs javah, passing it the name of a class. javah emits both a header file (.h) and a code file (.c) containing information about each native method and relevant type declarations. The .h file will contain the prototypes of the functions Java will call, and thus expect to find in the DLL. The .c file will contain stubs for each function. Thus, the developer needs to fill in only the details of the functions in the c file and build the DLL appropriately.
How the Virtual Machine Makes It Work

When a class is first used by Java, its class descriptor is loaded into memory. The class descriptor can be thought of as a directory for all services provided by the class-there is only one class descriptor loaded, regardless of how many instances of that class exist. Among its entries is a list of method descriptors, which contain information specific to methods, including where the code is, what parameters they take, and method modifiers.

If a method descriptor has its native modifier set, the block will include a pointer to the function that implements that native method. This function resides in some DLL but will be loaded into the Java processes address space by the operating system. At the time the class descriptor with native methods is loaded, the associated DLL does not have to be loaded, and thus the function pointer will not be set. Sometime prior to a native method being called, the associated DLL should be loaded. This is done via a call to java.system.loadLibrary(). When this call is made, Java will find and load the DLL but will still not resolve symbols; the resolution phase is delayed until the point of use. At the time of a call to a native method, Java will first check to see whether the native method implementation function has already been resolved-that is, its pointer is not null. If it has been previously resolved, the call is performed; otherwise, the resolution of the symbols is attempted. The resolution is performed by making an operating system call to see whether the symbol exists in the caller's address space. This includes the Java process and any DLLs loaded on its behalf. On Win32, this is done via a GetProcAddress() and on Solaris via a dlsym() call.

If the symbols are correctly resolved, the call is performed as if the Java virtual machine was making a standard C call to its own internal functions. If the resolution fails, the exception java.lang.UnsatisfiedLinkError will be thrown at the point of the native method call.
Summary

You should now have a basic understanding of how native methods enable a Java program to access the outside environment. Whether that consists of an operating system, a browser, or your own existing libraries, your Java code can reach them. It should now be clear that native methods do not come without some cost. You lose a lot of the benefits of the Java language. When there is no choice, however, native methods are there to be used. With the basic understanding of how native methods work you should be ready to tackle the next chapters, which provide more in-depth examples of native methods in action, as well as more tips and tricks to help you.

Tuesday, 17 July 2007

多媒体计算机网络

媒体:信息传播的中介, 信息的载体
计算机-信息处理机
用户-〉计算机-〉用户:键盘符号和终端图文都是媒体
计算机媒体:机器码, 符号码, 文字, 图形, 图像, 声音, 语言(符号解释器, 文字编辑器, 图象处理器, 语音识别器)

多媒体系统:同时抓取, 处理, 存储和显示两种两种以上不同的计算机媒体的系统
特点:计算机控制系统, 集成, 一体化系统, 数字化系统, 可交互系统。

音频, 视频的特点:
是当前多媒体系统的主角
数据量极大:
数字化普通话音:采样率8khz, 精度8bit, 每分钟产生3.84mbit。
数字化高保真话音:采样率44.1khz, 精度16bit, 每分钟产生42mbit。
数字化视频图像:640x480x24bitx30桢,每秒钟221mbit
要求连续,实时, 媒体间同步
数字化的媒体在计算机, 网络中存储, 传输需要较高的时间,空间上的消耗, 代价极大

多媒体对网络的要求
吞吐量:单位时间内通过网络的二进制的位(bit)数; 又称比特率--bps
传输延迟:延迟的变化--网络延迟不稳定引起。 一般用变化的方差表示
等时性:指延迟抖动较小的网络特性
误码率:传输过程中端到端数据变化的度量。

计算机网络的发展史:以太网-〉局域网-〉广域网-〉互联网
因特网:全球范围内各种广域网互联:特点:全球一统, 信息互通, 采用统一通讯协议-TCP/IP 统一的IP地址。
TCP/IP: 基于数据包结构:IP地址

互联网存在的问题
高通量:高速, 宽带:互联网:拥挤, 慢速, 等待
自良保证:连续,实时:互联网:断续, 迟缓
传播效率:广播, 组播

多媒体网络的关键技术
多媒体音频, 视频数据的压缩编码
网络得子良保证(QOS)
组播技术(MULTICASTING)

多媒体数据的压缩编码
目的:在保持信息不变的情况下, 减少总的BIT量;:
减少总的数据量, 缩短每个数据长度
寻找一种可逆得数字编码方法
编码后格式由较少BIT总量-又较少的数据或较小的数值
编码,解码必须是可逆的操作, 可以恢复

多媒体网络压缩技术
音频信号:MP3
视频信号:MPEG系列
MPEG1:VCD家用录像带质量
MPEG2: 广播电视DVD-HDVD
MPEG3: HDVD-取消
MPEG4:低频视频电话会议--互联网
MPEG7:基于内容结构--视频检索
MPEG21:多媒体框架,网络多媒体集成

网络多媒体的应用
IPTV:网络电视
电视频道采样器-〉压缩编码-〉视频服务器-〉调试计算机+遥控/信息计算机
VIDEO ON DEMAND
视频库-〉流媒体发送器-〉VOD点播服务器-〉调试计算机
VIDEO CONFERECING

新一代因特网的提出
世纪之交, 美国:
高性能因特网骨干网系统VBNS的投入运行
160所大学组成的INTERNET 2联盟-UCAID
克林顿宣布的下一代的因特网计划NGI
总称为新一代因特网

因特网的突起
WWW(一种软件)的出现和普及(94-95〕, 使INTERNET能传播图形, 语音等超级数据库; INTERNET开始进入千家万户, 成为各种阶层的喜闻乐见的信息交流形式。
GIGABIT, ATM, SDH高速传播手段, 使得INTERNET传播高质量的声音, 图像成为可能。

新一代的传输基础:DWDM--密集波分复用:以广波为载体传输
DWDM+线速路由+交换HUB组成了GIGABIT为特征的因特网传输基础网络, 称为GBIT网

关键技术:
IPV6
数据包结构:
version(4), prior(4), flow label(24), payload length(16), next head(8), hop limit(8), source address(128), destination address(128), content

ipv6特点之一:可选的扩展头部(next head)
分离放置, 路由器不必每次都检查,
长度可变, 但不超过40bite
增加可选内容:路由选择, 安全认证(authentication), 封装保密(encapsulation), 路由控制, 目标选择(附加终点信息)
ipv6特点之二:128bit的空间地址

关键技术3:mutilcasting
目的:按登记用户分组, 传播信息数据
要求:
同一小组用户只由同一类地址方式host address
用户小组可以使动态变化的(加入或退出)
小组用户分布无地理约束

Monday, 16 July 2007

web搜索

web搜索引擎:通过为数目巨大的web文档建立索引, 使得在www上找寻信息成为可能。
google:强调利用文档包含的信息来改善检索结果
摆渡:国内搜索引擎服务提供商(为sohu, sina, 263等), 中文检索。
搜索引擎的设计:关键建立索引库, 处理用户查询
文档采集:文档库
索引建立:文档表示/向量表示
数据结构设计:数据库
排序函数, 查询处理:排序后的查询结果

文档的采集:
用户主动向系统报告自己的资源
由系统的搜索工具去找寻用户的信息
web robot, 也叫crawler, spider, wanderer, worm等是一个能够沿着超连接web文档集合的程序
给定一些url, web robot能够利用象http这样的标准协议读取相应的文档, 然后沿着文档中的超级链接访问新的文档, 如此继续下去
基于robot的信息搜索系统的缺陷:
给网络和被访问的web服务器带来了较大的负担
不加区分的索取所有可达得文档, 并为之建立索引

索引信息的选区和组织
有的搜索引擎:简单的汇聚用户按一定的格式提供的关于web文档的信息, 它并不去访问文档本身
绝大多数系统:读取web文档, 分析其结构, 提取索引信息
索引对象:字, 词, 短语:全文索引
可根据html文本本身的结构title, 地址url和超级链接区分各个部分的重要性
为了方便用户进行查找, 索引信息必须有一定的组织方式:
yahoo把收集到的索引信息按照主题分类组成一个层次性的目录系统, 每条索引都属于某些子目录, 也就是类别
infoseek, 号称web最大的目录系统, 其索引项也都被归入多层目录结构
索引信息系统若能识别, 归纳出特定领域的深层次结构模式, 并将它与目录系统的自动构造结合起来, 一定可以大大改善信息查询的准确性。

查询处理:
查询:给出文档的某些信息(关键字), 由web查询工具相应的索引数据库, 确定文档的位置。
查询的两个目标:
尽可能的把所有满足查询条件的资源都找出来, 不要有所遗漏, 即较高的查全率(recall)
尽可能的保证查询结果的准确性, 不要把许多关系不大的东西返回给用户, 即较高的查准率
(precision)
第一个目标主要依赖索引数据库的建设
第二个目标主要依赖查询语言的设计
常用的查询技术主要有以下几种:
词组表示和布尔运算
范围查询:把检索限定在满足某些条件的web文档的集合内
结构查询:查询时充分利用html文档的结构, 以提高查询的准确性
通配和词形变化
概念查询;也找出所有包含于查询表达式概念相同的词语的文档
模糊查询:该技术能够让用户对所查询的内容渐渐明朗起来。
自然语言查询

元搜索引擎:同时对多个搜索引擎进行检索的工具
搜索引擎的选择:检索条件的转换, 搜索引擎的评价
结果的融合:删除重复, 合并结果

搜索引擎智能化:
与一般搜索引擎的区别:
对用户提交关键字的要求不同
搜索引起的网络负荷不同
搜索范围局限性不同
实用限制不同
学习能力

信息检索服务系统的种类:
搜索-索引系统
信息过滤系统
浏览助理系统
社会的或合作的系统

搜索-检索系统
目前常用的搜索引擎基本上属于这一类
通常即不采用基本知识的方法也不采用基于交互行为的学习方法
采用一种常规的问题-问答界面形势

信息过滤系统
通常被用来提供所需的email以及新闻组信息
通常相关性反馈来建立用户的profile
具有一种与生据来得危险性, 如果不小心删除了一个重要的邮件信息
利用搜索-检索系统中的许多技术, 但在信息过滤系统中使用的用户profile往往表达了用户的一个相对长期的兴趣, 而在搜索-检索系统中则通常表达为一个短期目标。 过滤是从信息流中去除不相关的信息的动作, 而搜索则在信息库中寻找相关的信息。

浏览助理系统
通过帮助浏览的形似提供服务
webwatcher系统:能够交互的提供关于跟总哪一个链接的建议。 系统通过跟踪其建议是否被采用以及在浏览完成时向用户发出成功与失败的信息询问进行学习
letiza:跟踪用户的浏览行为并试图通过并发的, 自治的探索用户当前位置可达的链接以预测用户的兴趣主体页。 通过用户的浏览行为启发式的推测用户的兴趣, 从而扩展了以best-first搜索的浏览策略

社会的或合作的系统
利用了共享的用户兴趣
其关键思想在于如何匹配相似的用户, 如何利用别的用户的评价或解释。
例子有时用合作过滤技术处理web页得webhound系统, 以及let's browse等

有关信息过滤与推荐的基本技术
信息过滤与推荐是信息处理的一泓方式, 为了使计算机能很好的处理internert上这些办结构化的信息, 往往要:为信息源建立结构化的表示方法。 为用户建立能反映其关注点的用户个性化模型

content-based:
通过分析所检索得internet资源内容(如关键字出现的频度)建立相应文档的结构化模型, 同时用户模型也采用同样的表示模型(称为profile, 帮组用户搜索信息, 推荐链接, 并接受用户的好评)
用户对文档的感兴趣程度变成了同结构模型间相似的比较。
文档表示:向量空间模型vsm
将文档看作是由相互独立的词条组(T1, T2, ...Tn)构成, 对于每一词条Ti都根据其在文档中的重要程度附议一定的权值Wi, 并将T1, T2, ..Tn看成是一个N唯坐标系中的坐标轴, W1, W2, ...Wn为相应的坐标值。
关键词权重的计算:tfidf:词频(关键字在一篇文章中出现的次数)(term frequency,tf)和逆文档频率(inverse document frequency, 即idf)(关键词在所有文档中出现的频率)的成绩来区定
相似形计算:余弦/内积系数表示:

social-based or collaborative-based:
利用共享的用户模型表示各用户对各种对象的关注程度
通过分析该共享模型中用户间的相似性, 将某一用户关注的文档推荐给其他具有共同想法的用户。
并不计算内容的相似形, 而是计算用户之间的相似性。
这个方法是建立在用户对所看到的内容有一定的反馈的基础上的。

event-based:
通过跟踪用户浏览网页的习性, 捕抓相应信息作为信息推荐的依据
典型的单用户及与实践的技术是leatiz

web mining:内容挖掘, 结构挖掘, 使用挖掘
xml:一种元标及语言,提供描述结构化资料的格式。

Friday, 13 July 2007

Sources of funding for international students 2006–07

What about undergraduate scholarships?
Most scholarships for study in the UK are for postgraduate courses. In special circumstances, applications for undergraduate study may be considered under
the following schemes
Commonwealth Scholarship and Fellowship Plan (CSFP)
Funded by the Department for International Development and the Foreign and Commonwealth Office
Commonwealth Scholarships and Fellowships are offered by the Commonwealth
Scholarship Commission in the United Kingdom, as part of Britain’s contribution to
the international Commonwealth Scholarship and Fellowship Plan.
The awards are aimed at Commonwealth citizens of high academic ability, who
are expected to make a significant contribution to their home countries upon
return from study in the UK.
In the case of awards to developing countries,
emphasis is placed on candidates whose work is likely to contribute directly
to development objectives. In the case of the developed Commonwealth,
particular attention is placed on the involvement of those likely to become
leaders in their chosen profession.
Awards are generally available to citizens of any Commonwealth country.
Some short-term Fellowships (three to six months) are available for mid-careeracademic staff or professional people. If there are no undergraduate courses in a particular subject in your own country or regional university, it may sometimes be possible for you to apply to do a first-degree course under this scheme. The awards are for one to three years and cover the cost of travel to and from the UK, tuition fees and living expenses. In some cases an allowance may be paid to help with the cost of maintaining a spouse and family.
Applications should be made in the first instance to the Commonwealth
Scholarship Agency in your own country. These are listed on the CSFP website
at www.csfp-online.org, which also gives information about other funding
opportunities within the CSFP.
The Commission Secretariat is based at: The Association of Commonwealth
Universities, 36 Gordon Square, London WC1H 0PF.

Commonwealth Shared Scholarship Scheme
Funded jointly by the Department for International Development and
participating universities in the UK

This scheme assists academically able students from developing Commonwealth
countries who would benefit from higher education in the UK, to the
developmental advantage of their home countries, but who for financial reasons
are unable to study in the UK and are outside the scope of other British
government support schemes.
You should be of high academic calibre and should be intending to study
subjects of developmental relevance. You must normally be under 35-years-old
at the time your course is due to start and you must be able to speak English
fluently at the time you apply.
You must not be employed by your government or by an international organisation
and you must be resident in a developing Commonwealth country. Successful
candidates must return to their home country on completion of their awards.
Awards are for taught courses at postgraduate level. Very exceptionally, awards
for undergraduate study may be made available where the course of training
satisfies the conditions of the scheme but is not available in your home country
or at a nearby regional institution.
Contact the participating British institution. These vary from year to year.
An up-to-date list of institutions will be available form February onwards from
www.csfp-online.org, the Department for International Development, the British
High Commission and British Council offices in the countries concerned.

浙大计算机前沿讲座_GIS信息安全

信息疆域--信息侵略
WIN95--澳大利亚海军发现, 该软件内有一个神秘的黑匣子, 只要入英特网, 它会悄悄的向微软总部发送机器信息。
WIN98--用户通过英特网拨号注册时, 系统自动收集机器内的信息, 甚至身份鉴别资料连接到他的一个数据库中。
INTEL奔腾3--处理器可以通过内置的序列码, 将用户与截取的信息一一对应起来, 破译用户身份和密码, 或在内留下嵌入式病毒, 安装产品隐性通道和可恢复密钥的密码
P-415部队--法国解密80年起美国组织世界性监听和截取民用, 军用通信的庞大体系。 每天能窃听全球30亿个电话, 传真和EMAIL。 美国特工微软合作, 并协助微软在其软件中安装秘密程序, 以供美情报部门截取电子信息
特种部队--欧洲议会2000年2月揭露美国和英国, 加拿大, 澳大利亚和新西兰合作, 通过地面和卫星电子设备建立的信息截取网络系统
美国把有病毒的AF/91微机芯片装入伊拉克从法国购买的用欲防空系统的新型打印机中, 造成亚拉克军事指挥中心主机失灵。

GIS: Geographic information systems: 一种为了获取, 存储, 检索, 分析和显示空间定位数据而建立的计算机化的数据库管理系统。

空间数据分类
矢量数据--用点,线, 面来描述现实世界, 表现地表信息, 通过坐标值来定义, 是数学的表达方式。
珊格数据--用一定的空间分解力来解析地表信息, 通过灰度和色调来定义, 是光学的表达方式
4D:
digital raster graphic
digital orthophoto map
digital elevation model
digital line graphic

图形和属性数据的管理都用现有的关系数据库管理系统
图形数据模式:一种是基于关系模型的方式。 一种是将图形数据的变长部分处理成二进制

应用:
空间查询:几何参数查询, 空间定位查询, 空间关系查询, sql查询


web gis
实现方法1 动态dynamic web gis: 在原有的gis原件基础上,采用cgi技术,网络用户发出请求后服务器将用户需要的部分图像数据转换成gif(jpeg)文件, 传递给用户。 优点:开发快, 成本低。 缺点:数据量大, 数度慢, 效率低
实现方法2:主动active web gis: 采用java工具或空间技术, 网络用户发出请求后,服务器将用户需要的矢量数据传递给用户, 由客户端处理。 优点:主动,速度快, 效率高。 缺点:开发周期长,首次调用花时间大。

必须发挥原数据的作用 matadata:xml 最适合元数据的编程。
GML是基于XML的空间信息编码标准。

数字城市
城市规划建设管理系统
城市管线网管理系统
城市安全管理指挥系统
城市资源信息管理系统
城市社会综合信息管理系统

卧虎藏龙 剧本

"CROUCHING TIGER, HIDDEN DRAGON"

by

Wang Hui Ling and James Schamus and Tsai Kuo Jung

Based on the novel

by

Wang Du Lu



FADE IN:


EXT. YUAN COMPOUND - DAY

Security men and porters are loading wagons for a convoy. As they work, we see across the lake a lone horseman entering the village. One of the men recognizes him.

WORKER
Master Li is here!

ANGLE ON LI MU BAI, thirties, powerful and handsome.

In the background, old AUNT WU, at the sight of Li Mu Bai, drops her parcels and runs excitedly into the building.


INT. YUAN HALLWAY - DAY

Aunt Wu runs hurriedly through the halls.

AUNT WU
Shu Lien!


INT. YU'S ROOM - DAY

YU, a beautiful woman in her early 30s, is finishing packing for the convoy, wrapping a few small items in a linen wrapper as Aunt Wu bursts in.

AUNT WU
Li Mu Bai is here!


INT. YUAN PRACTICE HALL - DAY

LI
How's everything?

AUNT WU
Fine. Please come in.

Yu sits, composed, as Aunt Wu ushers Li in. Li carries a large object, wrapped in silk.

Yu smiles.

YU
Mu Bai... It's been too long.

LI
It has.
(he glances around the room)
How's business?

YU
Good. And how are you?

LI
Fine.

An awkward pause.

YU
Monk Zheng said you were at Wudan
Mountain. He said you were practicing
deep meditation.

LI
Yes.

YU
The mountain must be so peaceful... I
envy you. My work keeps me so busy, I
hardly get any rest.

LI
I left the training early.

YU
Why? You're a Wudan fighter. Training
is everything.

LI
During my meditation training... I came
to a place of deep silence... I was
surrounded by light... Time and space
disappeared. I had come to a place my
master had never told me about.

YU
You were enlightened?

LI
No. I didn't feel the bliss of
enlightenment. Instead... I was
surrounded by an endless sorrow. I
couldn't bear it. I broke off my
meditation. I couldn't go on. There
was something... pulling me back.

YU
What was it?

LI
Something I can't let go of. You are
leaving soon?

YU
We're preparing a convoy for a delivery
to Peking.

LI
Perhaps I could ask you to deliver
something to Sir Te for me.

Li unwraps the object. It is an ancient, astonishingly beautiful sword.

YU
The Green Destiny Sword? You're giving
it to Sir Te?

LI
I am. He has always been our greatest
protector.

YU
I don't understand. How can you part with
it? It has always been with you.

LI
Too many men have died at its edge. It only
looks pure because blood washes so easily
from its blade.

YU
You use it justly. You're worthy of it.

LI
It's time for me to leave it behind.

YU
So what will you do now?

Li doesn't reply.

YU
Come with me to Peking. You can give the
sword to Sir Te yourself. It'll be just
like old times.

LI
First I must visit my master's grave. It's
been many years since Jade Fox murdered him.
I have yet to avenge his death. And yet I'm
thinking of quitting. I must pray for his
forgiveness.

YU
Join me once you have finished. I can wait
for you in Peking.

LI
Perhaps.


EXT. THE GATE TO PEKING - DAY

Customs officials have just finished checking the contents in a row of carriages bearing the Sun Security insignia. The caravan slowly passes through the checkpoint into the boundaries of Peking. Yu, riding a handsome horse and clearly the leader, watches as her crew clears inspection.

GUARDS
Ok. Pass.

YU
Thanks. Let's go into the city.


EXT. OUTSIDE A DEPOT - DAY

Workers are busy unloading the contents from the carriage. BOSS GIAO is checking off the merchandise - a cargo of medicinal herbs.

GIAO
Everything got here safely. I'm
much obliged.

YU
Just doing my job.

GIAO
Sun Security has been the best since
your father started it. You're a credit
to his memory.

YU
Thank you.

GIAO
I mean it.


EXT. PEKING - DAY

From a gray tiled roof, we can see Peking's magnificent grid of houses extending miles and miles out, freshly painted by the morning sun.


EXT. PEKING STREET - DAY

Dusty and congested as always, people, horses, and carriages are fighting to get through the boulevards.

A group of jugglers perform at a corner.

Yu surveys the busy street from on top of her horse.


INT. TE'S GREAT HALL - DAY

Yu presents the sword to SIR TE.

SIR TE
This is Li's personal sword, a great
hero's weapon! He is the only one in
the world worthy of carrying it. It's
too fine a gift. I cannot accept it.

YU
Sir Te! It has brought him as much
trouble as glory. Help him to leave
these troubles behind. Otherwise,
he'll never be able to start anew.

SIR TE
All right. I'll act as the sword's
custodian.

DE LU, the head servant, enters.

DE LU
Governor Yu has arrived.

SIR TE
I must change.

YU
(getting up)
You've always been so good to Li Mu Bai
and me. Please accept our thanks.

SIR TE
Please do not be such a stranger. You'll
stay the night as my guest. Now, Shu Lien...
tell me something. Your father was a great
friend to me, and I think of you as my own
daughter.

YU
Please, Sir Te, what is it?

SIR TE
Li Mu Bai giving up his sword and his
warrior days... maybe he's trying to tell
you something?

YU
I don't know...

SIR TE
Don't be coy. I've always known about your
feelings for each other. All these years,
it's a shame... neither of you is brave
enough to admit the truth to the other.
You're both wasting precious time.

YU
I beg your pardon. Li Mu Bai and I aren't
cowards.

SIR TE
When it comes to emotions, even great
heroes can be idiots. Tell me if Li Mu Bai
is not more open the next time you see him.
I'll give him an earful!


INT. TE'S STUDY - DAY

Yu and De Lu approach the study.

DE LU
Sir Te said to leave the sword in here.

De Lu opens the door and is startled to find a young woman inside. The woman is studying the sheets of calligraphy hanging on the walls.

DE LU
Who are you?

JEN
I'm your guest today. I am Governor
Yu's daughter.

DE LU
This is Sir Te's study. You are here
to...

JEN
I was looking for a quiet corner.

DE LU
I am Sir Te's head servant. And this is
another of our guests.


INT. TE'S STUDY - DAY

Yu gently lays the sword, still in its sheath, in Jen's hands.

JEN
It's heavy for such a thin piece of
metal!

YU
The handle is heavy. And the blade is no
ordinary metal. Still, the sword is the
lightest of weapons. You're just not used
to handling it.

JEN
But I have had much practice. As a child
in the West, a platoon lived with us.
They'd let me play with their weapons. The
scabbard is so beautiful.

YU
Beautiful but dangerous. Once you see it
tainted with blood, its beauty is hard to
admire. It's 400 years old.

JEN
Exquisite! You said it belongs to...

YU
My friend Li Mu Bai. He's given it to Sir
Te as a gift.

JEN
Li Mu Bai! The famous warrior? Why would
he give his sword to Sir Te?

YU
You're too young to understand.

JEN
You're a sword fighter too?

Yu yanks the sword out of the sheath. An eerie sound resonates within the study. Jen is even more impressed.

YU
Yes, I am. But I prefer the machete.
Certain moves, however, call for a sword.

JEN
Really?

Yu puts the sword back in the case.

JEN
(longingly)
It must be exciting to be a fighter, to
be totally free!

YU
Fighters have rules too: friendship,
trust, integrity... Without rules, we
wouldn't survive for long.

JEN
I've read all about people like you.
Roaming wild, beating up anyone who gets
in your way!

YU
Writers wouldn't sell many books if they
told how it really is.

JEN
But you're just like the characters in
the stories.

YU
Sure. No place to bathe for days, sleeping
in flea-infested beds... They tell you all
about that in those books?

JEN
You know what I mean. I'm getting married
soon, but I haven't lived the life I want.

YU
So I heard. Congratulations. It's the most
important step in a woman's life, isn't it?

JEN
You're not married, are you?

YU
What do you think?

JEN
No! You couldn't roam around freely if
you were.

YU
You're probably right.

Yu studies Jen. The room falls silent for a moment.


EXT. SIDE COURT YARD - DAY

It's dusk and the sky is a beautiful orange and purple. Jen is leaving the study escorted by her maid. She turns to Yu for a final good-bye. Yu seems intrigued by the encounter.


EXT. SIR TE'S COMPOUND - NIGHT

Two lighted lanterns are raised up.


INT. TE'S STUDY - NIGHT

Sir Te hands the sword to Governor Yu.

SIR TE
Go ahead, Governor Yu.

Governor Yu is impressed by the opulance and elegance of the sword. He closes his eyes to guess the weight of the sword. Te snubs out the flame from a candle, then slides the sword out from its sheath. The sword gives off a luminous blue glow in the dark.

SIR TE
Two feet 9 inches long. 1 inch wide. The
handle is 1 inch deep, 2.6 inches wide.
Seven-tenths of an inch thick. With seven
rubies missing from the hilt. You can tell
the design dates back to before the Chin
era. Engraved with a technique lost by the
time of the Han Dynasty.

GOVERNOR YU
Your knowledge is remarkable, Sir Te.

SIR TE
A sword by itself rules nothing. It comes
alive only through skillful manipulation.

GOVERNOR YU
I see your point. Please continue.

SIR TE
The Imperial Court isn't the problem. With
royalty and officials everywhere, the Royal
Guard keeps security tight. But Peking is
not like the West. Here, you'll find all
sorts of characters. Proceed with caution in
your quest for law and order. Don't depend
only on the court. Contacts in the Giang Hu
underworld can ensure your position. Be
strong, yet supple. This is the way to rule.


INT. JEN'S ROOM - NIGHT

A maid warms her hands in a basin of hot water for Jen, then walks over to Jen and helps remove her earrings. Someone knocks and the maid goes to answer the door.

MAID
Governess...

GOVERNESS
Let me do it.

The maid leaves as the governess enters the room.

JEN
Please sit.

GOVERNESS
I've made you silk pajamas. Do you want
to change into them?

JEN
Put them down.

GOVERNESS
I heard you met Shu Lien today.

JEN
Do you know her?

GOVERNESS
She's one of those. Your mother would not
want you consorting with her kind.

Jen shoots her an angry look.

JEN
I'll socialize with whomever I please.

GOVERNESS
Don't invite danger into your father's
house.

She's about to say something, then thinks better of it.

JEN
I'm tired now.

GOVERNESS
Go to bed then. Miss has grown up, and is
getting married soon. God knows what the
future will bring.

JEN
It will be just the same. Enough! I'm
tired.

GOVERNESS
Autumn is coming. I'll shut the windows
for you.

The governess leaves. Jen sits on the side of her bed, thinking.


EXT. TE'S COMPOUND - NIGHT

A wide shot of the compound. A patrol man greets MASTER BO, Sir Te's head of security. The place is serene.

MASTER BO
Chilly, eh?

NIGHTMAN
Yes, Master Bo.

As Bo walks on, shadows rustle in a treetop in the background.


EXT./INT. INSIDE AND OUTSIDE OF TE'S STUDY - NIGHT

A masked FIGURE silently opens the window and enters the room. It moves swiftly to the sword case, opens it, and wraps the sword.

Bo enters, sees the thief, who leaps up to the ceiling. The thief steps over Bo and out into the courtyard. Bo tries to stop the thief, who easily outwits him, jumping onto the roof as Bo yells out:

BO
Someone help! Stop him! He's on the roof!
The sword's been stolen! Stop thief! Stop
him!

The thief skips a few times and jumps off to a side street.

Bo grabs a pole and runs as GONGS begin to SOUND, alerting people to the theft. People rush outside, Yu Shu Lien among them.


EXT. PEKING STREET - NIGHT

Bo runs through the streets. The thief is nowhere in sight. Suddenly, there are SOUNDS of WEAPONS CLASHING. Bo hurries towards the source.


EXT. AN ALLEY OUTSIDE GOVERNOR YU'S COMPOUND - NIGHT

Bo is surprised to see the hooded Figure battling with two other fighters - TSAI (male, 40s) and MAY, his daughter.

TSAI
It's Jade Fox!

MAY
We must avenge mother!

The hooded Figure does a gravity-defying flip and soars over a wall just as Bo arrives.

BO
Do something! He's getting away!


EXT. PEKING ROOFTOP - NIGHT

The thief runs atop a roof - right into Yu. Yu and the hooded Figure face off.

YU
Return the sword and I'll let you go.

The Figure just regards her, slightly shifting weight.

Yu attacks, but the Figure repels her.

YU
You've been trained at Wudan?

The Figure answers by leaping to another rooftop. Yu catches up and resumes her attack with a relentless series of lightning-quick blows.


EXT. ALLEY OUTSIDE GOVERNOR YU'S COMPOUND - NIGHT

Bo follows Tsai and May, who are quickly walking away.

TSAI
You're mistaken. We're just street
performers. We were rehearsing.

MAY
Father!

BO
You were rehearsing? Who are you
trying to fool?

May wants to respond but is again cut off by Tsai. They run off.

BO
Where did that thief go?

Bo looks around and discovers that he has chased the thief into Governor Yu's compound.

BO
Governor Yu's house?


EXT. ROOFTOP

Yu and the Black Figure continue to fight.

YU
Get down here! Give back the sword!


EXT. GOVERNOR YU'S - NIGHT

Yu slowly gets the upper hand in her fight with the thief. A small arrow cuts across the night and flies toward Yu. She catches it, but the masked Figure takes the opportunity to get away.

Yu pauses to feel the arrow in her hand, standing in the empty courtyard.


EXT. TE'S SIDE ENTRANCE - DAY

De Lu escorts Yu into Te's.

DE LU
Sir Te awaits you.


INT. TE'S GREAT HALL - DAY

Men are standing at attention. Bo is giving his account of what happened as Yu enters.

BO
I'm sure the thief is in the Yu
household.

SIR TE
How dare you imply?

BO
But I saw-

SIR TE
-Enough.

The men hustle out. Bo can barely contain his frustration.

YU
Has Governor Yu ever seen the sword?

SIR TE
Yes, though I doubt he's involved
in this.

YU
But the sword could be in his
compound.

SIR TE
Then someone's trying to set him up.
We should inform Li Mu Bai.


EXT. OUTSIDE GOVERNOR YU'S COMPOUND - NIGHT

Madam Yu is returning from temple. The Governess is helping her out of the carriage. Servants are peeling bills off a wall across the street.

MADAM YU
What is it?

MAID
Madam Yu, someone's put up posters.

A partially torn flier with the words "Jade Fox will not escape justice!" is seen on the ground.

MADAM YU
Let me see.

GOVERNESS
Someone is after Jade Fox.
Preposterous, looking for her here!

Madam Yu nods and walks inside, as the Governess tosses the flier away and follows her. A hand scoops up the filer - it is Yu. She studies it, then puts it in her pocket, and moves on.


EXT. BRIDGE - DAY

Bo is searching for the Tsais. The bridge is full of jugglers. But the two are nowhere to be found.


EXT. PEKING STREET - DAY

Bo quizzes a HOMELESS MAN.

BO
Where are they?

HOMELESS MAN
I don't know. I haven't seen them in
two days.

Bo is about to give up when he looks up and sees May walking quickly into an alley. Bo follows her.


EXT. IN FRONT OF TSAI'S HOUSE

May walks into a dilapidated house surrounded by a broken-down bamboo fence. Bo inches closer and sees May and Tsai oiling their weapons.


INT. BO'S ROOM - DAY

Jen practices calligraphy. The Governess is by her side embroidering and throwing occasional glances at Jen. The Maid enters.

MAID
There is a Miss Shu Lien here to
see you.

Jen stops and looks up at them.

GOVERNESS
Miss is busy right now.

MAID
I'll tell her.

JEN
Show her in.

The Governess shoots her a look.

GOVERNESS
This spells trouble.

JEN
I have a guest.

The Governess gets up to leave just as the Maid shows Yu in.

MAID
This way please.

The Governess and Yu exchange quick glances. The Governess bows slightly and departs.

JEN
I've missed you.

YU
How so?

JEN
I'm bored.

Yu sees the calligraphy.

YU
You're doing calligraphy?

JEN
I'll write your name. Just for fun.

Jen writes Yu's name with great confidence and swiftness.

YU
I never realized my name looks
like "sword."

Jen freezes slightly.

YU
You write gracefully. Calligraphy is
so similar to fencing.

JEN
Maybe it is. I wouldn't know.

The Maid enters with tea.

JEN
Please.

YU
Thank you for seeing me. I hear your
wedding day is near. You must be
overwhelmed by the preparations.

JEN
I'm hardly doing a thing. The less I
think of it the better. My parents
are arranging everything. The Gous
are a very powerful family. My
marrying one will be good for my
father's career.

YU
You are fortunate to marry into such
a noble family.

JEN
Am I? I wish I were like the heroes
in the books I read. Like you and
Li Mu Bai. I guess I'm happy to be
marrying. But to be free to live my
own life, to choose whom I love...
That is true happiness.

YU
Do you think so? Let me tell you a
story.

JEN
About you and Li Mu Bai?

YU
Yes. Did you know I was once
engaged to be married?

JEN
No, really?

YU
His name was Meng Si Zhao. He was
a brother to Li Mu Bai by oath. One
day, while in battle, he was killed
by the sword of Li Mu Bai's enemy.
After, Li Mu Bai and I went through
a lot together. Our feelings for
each other grew stronger. But how
could we dishonor Meng's memory? So
the freedom you talk about, I too
desire it. But I have never tasted it.

JEN
Too bad for Meng, but it's not your
fault, or Li Mu Bai's.

YU
I am not an aristocrat, as you are...
but I must still respect a woman's
duties.

JEN
Don't distance us. From now on, let's
be like sisters.

YU
Then as a sister, let me wish you
happiness in your marriage.


EXT. YU'S GARDEN - DAY

The Maid escorts Yu out. Yu pauses, looks around, and sees the profile of the Governess peering at her from around a corner.


INT. JEN'S ROOM - NIGHT

Moonlight spills into the room as Jen rises sleeplessly from bed and looks out the window. A light breeze stirs her hair. The sound of the wind rises, and slowly her face DISSOLVES INTO...


INT./EXT. CARRIAGE/MONGOLIAN DESERT - DAY

...the face of a younger, less sophisticated Jen, as she lets the dry desert air flow through her hair. She sits in a carriage, part of a caravan, with guards on horseback, that is traveling through the spectacular desert. Across from her sits her mother, of whom she is barely cognizant.

MADAM YU
What a godforsaken place! Can't your
father be appointed closer to
civilization? Jen... are you listening
to me?

Jen is still looking out the side of the carriage, at a beautiful mountainside.


INT. JEN'S ROOM - NIGHT

Jen sighs and turns back toward her bed.


EXT. STREET OUTSIDE GOVERNOR YU'S COMPOUND - NIGHT

Tsai and May have been sitting, hidden in the branches of a tree, watching Jen.

TSAI
Let's go!

They drop down silently and walk away. From another rooftop, LO looks silently on.


EXT. TSAI'S HOUSE - NIGHT

Tsai and May enter the house.


INT. TSAI'S HOUSE - NIGHT

Inside the tiny house, they discover a hooded Figure going through their belongings.

Immediately, Tsai throws a knife, which rips off the Figure's mask- revealing Bo. Tsai has another long knife at his throat.

TSAI
Who are you?

BO
Wait! I'm a friend!

Tsai pauses.


INT. TSAI'S HOUSE - NIGHT (LATER)

May fans a small coal-fired grill that is boiling a sizzling pot of vegetable and meatball soup. Her father and Bo are now friendly dinner companions, much to May's delight.

TSAI
I don't care about your sword.

BO
Why were you spying on the Yus?

TSAI
I'm looking for someone. Jade Fox.
I'm a police inspector from Shaan Xi,
Gen Su district. Jade Fox is a master
criminal. I hear she infiltrated the
Yus. She must have come with them when
they transferred here. But with Yu's
reputation, I can't just go in and
accuse her.

BO
This Jade Fox is a woman?

TSAI
Yes.

BO
Then leave her to me.

TSAI
Pardon me, but I doubt you can handle
her. My wife was quite a martial arts
expert. Jade Fox killed her. So you
see, this is personal. Leave her to me.

MAY
It's ready! (re: the soup)

BO
I'm ready for anything!

Bo fishes into the pot with his chopsticks. May intercepts him with her own chopsticks.

MAY
Father gets first dip.

Tsai stiffens and snaps his chopsticks, not to pick up a meatball but to catch an incoming dart. A dart wrapped with a note. Bo jumps up.

TSAI
They're gone.

MAY
What does it say?

TSAI
"We'll settle this at midnight on
Yellow Hill." Good, the fox is out of
her hole.


INT. TE'S STUDY - NIGHT

Yu is ushered into the room, to discover Sir Te talking to another man, whose back is to her.

SIR TE
Shu Lien, look who's here.

The man turns around- it's Li Mu Bai.


EXT. TE'S HALL - NIGHT

Yu and Li Mu Bai sit together.

LI
Sir Te believes it's a ploy to
cast suspicion on Governor Yu.

YU
But something is going on at the
Yu household.

LI
What have you discovered?

From her sleeve, Yu removes the flier. Li takes it, his face darkening.

LI
Jade Fox? Impossible.

YU
You always suspected she's fled to
the West.

LI
I didn't think she'd dare come back
to Peking!

YU
Is there any place safer than under
the nose of Governor Yu?

LI
So I shall avenge my master's death
after all.

YU
Be careful. Sir Te requires discretion.
Official business is difficult enough.
Don't let personal feelings make it
worse. And I don't know... even this
poster... could be some sort of trap.

LI
Did you see who posted it?

Yu pauses.

YU
No.

LI
It says Jade Fox is hiding at Yu's.
On the night of the theft there was a
brawl near Yu's. Were you involved?

YU
It was Bo, Sir Te's man. I hear he
followed the thief to the Yus'.

LI
Have you questioned him yet?

YU
No, not yet...

LI
But your men are watching over Yu's
compound?

YU
No, I'd already sent them home. You
can blame me for losing the sword, but
please trust that I'll get it back soon
using my own methods.

LI
That's not what I meant. I don't care
about the sword.

YU
What do you mean? Didn't you come back
here for it?

LI
I didn't know it was stolen until I
got here.

YU
Then why did you come?

LI
Well, we had talked...

De Lu enters.

DE LU
Pardon my intrusion, Master Li, your
room is ready.

LI
Thank you. Please lead the way.


EXT. YELLOW HILL - NIGHT

Tsai, Bo, and May wait under an ancient tree. Bo stifles a yawn.

BO
The fox doesn't care much for
punctuality. Still no sign of her.

An old lady struggles up the hill, wearing a floppy hat over her face, holding a cane. The three exchange glances.

TSAI
Enough! Show yourself!

The old woman shrinks in fear, but then throws off her disguise and unveils herself- the Governess.

FOX
Tsai... you dog! You will pay for
your stubbornness.

BO
That's what you think, old witch!

TSAI
If you surrender now, you'll suffer
less. But if you resist, I won't stop
until you're dead.

MAY
Father! Let me avenge my mother's death!

FOX
You'll soon end up like her, you little
whore!

BO
You'll pay for that!

A fierce battle begins, the main fighting between Tsai and Fox, with May and Bo getting a stab in occasionally, when the opportunity presents itself.

TSAI (to Bo)
She's going to paralyze you!

Using accupressure, Fox disables Bo. May shoots an arrow at her, but she catches it and flings it back, hitting May.

TSAI
May!

Fox then disables Tsai, but just as she goes for the kill, Li Mu Bai flies down from the treetops and steps between them.

FOX
Tsai, you filthy mongrel! An ambush!

MAY
Father, are you all right?

Li addresses Fox.

LI
Wudan should have gotten rid of you
long ago. It's been a long time, Jade
Fox! You don't remember me... But you
should remember my master. You
infiltrated Wudan while I was away.
You stole our secret manual and
poisoned our master! Now it's time for
you to pay!

FOX
Your master underestimated us women.
Sure, he'd sleep with me, but he
would never teach me. He deserved to
die by a woman's hand!

LI
You stole the secrets of Wudan's highest
martial arts. But after ten years of
training, your moves are still
undisciplined. And today, under a Wudan
sword... you will die!

Li easily brings Fox to the ground.

Li raises his sword to the prostrate Fox. A Figure masked in black appears next to Fox, sword extended, saving her.

FOX
Disciple, we'll kill them all!

FIGURE IN BLACK
Let's go!

BO
Another one!

FOX
I must get rid of Tsai!

Fox fights Tsai, Bo, and May, as Li addresses the masked Figure.

LI
Who are you? Why is the Green Destiny
in your possession?

FIGURE IN BLACK
What's it to you?

LI
My name is Li Mu Bai. The Green Destiny
is mine. Jade Fox can't be your master.
Where did you learn that "Xuan Piu" move?

FIGURE IN BLACK
I'm just playing around.

LI
Tell me, who is your master?

FIGURE IN BLACK
Let's go!

FOX
We must kill them!

Tsai throws his blade at Fox, who catches it and throws it back, hitting him in the head. Fox and the masked Figure leap away.

May drops to the ground, cradling her dead father's head. Bo kneels beside her.

MAY
Father!


EXT. TE'S - DAY

Te and a group of his men look down as a cloth is removed from the body of Tsai. Bo and May stand before them.

TE
This is Tsai?

MAY
My father. Police Inspector from Shaan.

TE
This should be reported to Governor Yu.
The victim is an officer. You believe
the killer is hiding out in his
compound?

YU
I'd bet my life on it!

TE (to Li and Yu)
Come with me.

He exits the room.


INT. TE'S STUDY - DAY

Te, Li, and Yu are seated.

SIR TE
This needs to be resolved, and
quickly.

LI
I'll get into the Yu household and
get her. I'll ferret out Fox and her
gang.

YU
We must be careful. Governor Yu is a
court official, and in charge of
security. Any disturbance will cast
suspicion on him. It might get Sir Te
in trouble.

SIR TE
This is a delicate matter.

YU
Sir Te, can you find some excuse to
invite Madam Yu and her daughter?

SIR TE
What do you have in mind?

YU
The best way to trap a fox is through
her cubs.

Sir Te and Li look puzzled.


EXT. SIR TE'S GARDEN - DAY

Yu sits with Madam Yu and Jen. They busy themselves with various items for her trousseau.

MADAM YU
Madam Te is certainly spoling us with
these wedding gifts. She's being so
considerate.

YU
I'm sorry she's not feeling well enough
to receive you today.

MADAM YU
I heard Sir Te lost something. And now
Madam Te's not feeling well...

Jen sits silently reading.

YU
We know who stole the missing item. If
the thief returns it, I'm sure Sir Te
will pursue the matter no further.

MADAM YU
That's good. Sometimes the help can't
keep their hands to themselves. It's
very embarrassing.

YU
Sir Te knows that even well-meaning
people can make mistakes... that can
bring ruin to themselves and their
families.

MADAM YU
But don't be too lenient.

YU
No mercy will be shown toward the
murderer who turned up in Peking.

MADAM YU
A murderer?

YU
Yes. The very killer of Li Mu Bai's
own master. Last night, she killed a
policeman who had tracked her down.

MADAM YU
A female criminal? Now that's news!

Jen becomes visibly upset.

JEN
You say she killed a policeman?

YU
Yes, from the West. He went
undercover and followed her here.

MADAM YU
Maybe the murderer and the thief are
one and the same.

YU
I doubt it. This thief... is very
unusual...

As Yu speaks, she lifts the teapot to pour Jen some tea. As she finishes speaking, she looks into Jen's face and the pot slips from her hand. Without even looking down, Jen instinctively catches the pot with a lightning-fast move.

YU
...And most likely smarter than a
mere killer.

Sir Te and Li Mu Bai walk by.

JEN
(formal)
Greetings, Sir Te.

SIR TE
Hello, Madam Yu. This is Li Mu Bai,
the renowned swordsman.

LI
Delighted to meet you.

Li sizes Jen up.

TE
Miss Yu is soon to be married.

LI
Congratulations.


EXT. TSAI'S HOUSE - NIGHT

May opens her door, only to find Bo standing guard.

MAY
Why don't you come in?

BO
I'm standing guard.

MAY
Come in. It's cold.

She turns back inside, hesitates, then turns back to him.

MAY
Come in. We don't have to fear Jade
Fox if we're together.


EXT. TE COMPOUND - NIGHT

A still, dark night.


EXT. TE'S STUDY - NIGHT

Something moves in the moonlight. A hooded Figure jumps down.

Li Mu Bai, who had been hiding in the shadows, comes forward.

LI
Isn't a bit too late to be out?
You've brought me the sword?

FIGURE
I do as I please.

The masked Figure lunges away, but Li Mu Bai leaps with incredible speed and grabs the sword from her.

LI
Where's your master?

FIGURE
What's it to you?

The Figure floats away. Li chases after her.


EXT. PEKING STREET - NIGHT

The two fly over houses and bounce off of rooftops, displaying amazing floating skills.


INT. ABANDONED MONASTERY - NIGHT

The Figure bounces into an old monastery. Li is already there.

LI
Had enough flying? You've got
potential. You've studied the Wudan
Manual but you don't understand it.
You need a real master.

The Figure doesn't respond, but we sense the pride in her eyes.

FIGURE
Do you think you are a real master?

LI
Like most things, I am nothing. It's
the same for this sword. All of it is
simply a state of mind.

FIGURE
Stop talking like a monk! Just fight!

LI
Then tell me where Jade Fox is.

FIGURE
On guard!

LI
Real sharpness comes without effort.


EXT. MONASTERY - NIGHT

The Figure leaps into the garden, but again, Li is ahead of her.

The Figure attacks Li, who uses his agility to evade her. Frustrated, the Figure intensifies her attack.

The Figure, losing composure, attacks wildly. Li gets even more elusive, using a branch to repel her.

LI
No growth without assistance. No
action without reaction. No desire
without restraint. Now give yourself
up and find yourself again. There is
a lesson for you.

Li now holds the stick to her mask, gently raising it slightly.

FIGURE
Go ahead.

LI
Why should I? You need practice. I
can teach you to fight with the Green
Destiny, but first you must learn to
hold it in stillness.

FIGURE
Why do you want to teach me?

LI
I've always wanted a disciple worthy
of Wudan's secrets.

FIGURE
And if I use them to kill you?

LI
That's a risk I'm willing to take.
Deep down, you're good. Even Jade Fox
couldn't corrupt you.

The Figure's eyes cloud with tears.

FIGURE
Wudan is a whorehouse! Keep your lessons!

The Figure swirls and takes off, leaving a rueful Li standing alone in the monastery.


INT. JEN'S ROOM - NIGHT

Jen slips in through the window. She pulls off her mask as she spots the Governess/Fox sitting and sewing.

FOX
You're home late... or should I say
early?

JEN
Why are you still here? You killed a
policeman. You should leave! You'll
bring ruin on my whole family.

FOX
They wouldn't have found me if you
hadn't stolen the sword. Like a little
girl, you thought stealing would be
fun? You, too, are responsible for that
death. Come with me. You don't want to
waste your life as the wife of some
bureaucrat. Denied your talent... As a
master and disciple we will rule.

JEN
I'll never live as a thief!

FOX
You're already a thief.

JEN
That was just for fun. How can I leave?
Where would I go?

FOX
Wherever we want. We'll get rid of
anyone in our way. Even your father.

JEN
Shut up!

FOX
It's the Giang Hu fighter lifestyle...
kill or be killed. Exciting, isn't it?

JEN
I owe you nothing.

FOX
Yes, you do! You are still my disciple!

Jen lunges at the Governess, and the two exchange a few blows. Jen presses her finger against one of the Governess' pressure points, disabling her. Jen pushes her across the room.

JEN
You think you've been teaching me all
these years from the manual? You
couldn't even decipher the symbols!

FOX
I studied the diagrams. But you hid
the details!

JEN
You wouldn't have understood, even if
I had tried to explain. You know...
you've gone as far as you can go. I hid
my skills so as not to hurt you.

FOX
If I hadn't seen you fight with Li Mu
Bai, I'd still be ignorant of all
you've hidden from me.

JEN
Master... I started learning from you
in secret when I was 10. You enchanted
me with the world of Giang Hu. But once
I realized I could surpass you, I
became so frightened! Everything fell
apart. I had no one to guide me, no one
to learn from.

FOX
Believe me, I've a lesson or two left
to teach you!

Fox exits.


EXT. GOVERNOR YU'S GATE - DAY

The Governess leaves, a small sack over her back.


EXT. TE'S COURTYARD - DAY

Li practices fluently with Green Destiny in hand, beautifully at ease with the weapon. He spins around to find Yu standing in the doorway.

YU
The sword is back... are you happy?

Li smiles.

LI
I admit, getting it back makes me
realize how much I'd missed it.

YU
But it's not your sword anymore. You
gave it to Sir Te.

LI
True. But I must borrow it for one last
mission. Jade Fox must die at its edge.
Did you know what you were hiding when
you covered for that girl?

YU
My job was to get the sword back without
embarrassing anyone. I wasn't about to
ruin her life, or her father's.

LI
You did your job well. But, this girl...
I saw her last night.

YU
I knew she would intrigue you.

LI
She needs direction... and training.

YU
She's an aristocrat's daughter. She's
not one of us. In any case, it will all
be over soon. You'll kill Fox, and
she'll marry.

LI
That's not for her. She could come to
Wudan and become a disciple.

YU
But Wudan does not accept women.

LI
For her, they might make an exception.
If not, I'm afraid she'll become a
poisoned dragon.

YU
It's not our affair. Even if Wudan
accepts her, her husband might object.

LI
I thought by giving away the sword, I
could escape the Giang Hu world. But
the cycle of bloodshed continues.

YU
I wish there were something more I
could do to help you.

LI
Just be patient with me, Shu Lien.


INT. JEN'S ROOM - NIGHT

Jen is asleep. A noise awakens her.

Lo opens the window and sneaks in- right into the point of Jen's waiting sword.

Jen's sword drops to the ground.

JEN
Lo?

LO
Jen!

Lo grabs her by the waist.

JEN
You shouldn't have come.

LO
With all the traffic on your rooftop
these days... it took me a while to
get in here. I can't wait any longer.
I was wrong to let you go. Come back
with me. You'll be happy in the desert.
You'll be free there.

Jen turns back to him and rests herself briefly in his arms again.

JEN
You've been looking for me all this
time?


FLASHBACK: FOUR YEARS EARLIER


INT./EXT. CARRIAGE/MONGOLIAN DESERT - DAY

Jen holds up a comb, with daylight shining through it. Jen admires the piece, her most prized possession.

Madam Yu sits opposite her.

MADAM YU
Jen... stop playing with it.

Jen looks out over the desert, as the wind picks up and the sky darkens.

JEN
I won't break it.


EXT. CARRIAGE/MONGOLIAN DESERT - DAY

Lo and a group of armed bandits descend on the caravan.

GUARD A
It's Dark Cloud! Dark Cloud is coming!

His warning is useless. From Jen's POV, we see the guards slaughtered in a hail of arrows and swords.

MADAM YU
Lower the shade, don't let them see
you!

DARK CLOUD (LO)
Don't touch the women!

Though unharmed, Madam Yu immediately faints. Lo approaches the carriage and grabs the comb from Jen's hand.

She bolts from the carriage, and, once outside, bends down and grabs a lance from the body of a dead guard, whose horse flails beside him.

She looks up to see the gang of bandits already making their escape on horseback.

LO
Let's go!


EXT. DESERT - DAY

Jen and Lo ride across the desert floor at breakneck speed.

LO
Come get your comb.

She tries to jab him with the lance, but he grabs it and flings her off her horse.

LO
Hurry back to your mother.

Lo rides on as she charges after her horse.


EXT. DESERT BLUFF - DAY

A group of bandits is dividing up the loot as Jen rides up, keeping a respectable distance. They notice her and rise as she dismounts.

One of them saunters over to her and stands, grinning, a few feet away.

In a second, she's slammed his balls into his stomach and his nose into his face. He crumples to the sand.

The other bandits stop laughing, quickly exchange glances, and charge her at once.

In a matter of seconds, they're either on the ground or dragging their fallen comrades back.

Lo calls out and stops the fight.

LO
She's mine.


EXT. DESERT - DAY

Lo and Jen ride, if not side-by-side, then parallel, about 20 feet apart. Their pace has slowed considerably. In fact, they're dead tired.

LO
Let's stop a moment.

JEN
Give it back!

LO
(shouting a bit)
You're tired. You need rest. Your
horse needs water. There's a creek up
here.

He dismounts, looks down at the dry creek bed.

LO
Well, there used to be! What's your
name? I'm Lo. The Hans call me Dark
Cloud. I'm not that tall or big, but
I'm quick as lightning.

JEN
My comb!

She kicks him. They fight ferociously until Lo, exhausted, collapses. She kicks him a few times, then collapses too.


INT. CAVE - DAY

Jen comes to and finds herself wrapped in a blanket of animal fur. She sits up with a start and checks her clothes. Looking around, she realizes she's in a cave. Next to her are a lamp, some hunting equipment, and a neat row of sharp arrows. She quickly grabs one of the arrows.

LO
If you like that arrow, I can make
you a bow. Great for hunting wild
chicken. They're delicious.
Jen raises one of the arrows, going on the attack again, but her legs betray her and she falls.

LO
You need to eat, understand? Then
you'll have the strength to fight.
Understand?

He helps her up, then pours her some horse milk from a sac. He hands her a small chunk of food, which she first accepts grudgingly, then, her hunger getting the better of her, she starts to wolf it down.

LO
You're eating too fast. Slowly.


EXT. CAVE - DAY

Lo walks out into a barren mountain landscape. A chicken roasts over a fire. Lo whistles.

Jen appears suddenly with a rock and knocks it over his head. Lo passes out as Jen scurries away.


EXT. MOUNTAINSIDE AND DESERT - DAY

Jen tries to find her way among the treacherous stony terrain, her lips chapped and fingers bloody and blistered. But soon she passes out.


INT. CAVE - NIGHT

Jen again awakes inside the cave. Lo tries to feed her some water, but she chokes and tries to push him away, only to find that her legs and hands are tied up.

LO
You've got quite a temper. It's
better this way.

JEN
You coward!

LO
Still in a bad mood? At least you're
speaking. What's your name?

Jen spits at Lo.

LO
I didn't think the Hans had names
like that.

LATER: She weaves in and out of consciousness. In the flickering lights, she sees Lo sharpening his arrows.

LATER: Lo pulls back an opaque curtain to reveal a makeshift bathroom- a water-filled cavity serves as a tub.

He rises as Jen sobs at the sight of her imprisoned and dishevelled body. He comes over and unties her.

LO
Relax. If I had wanted to, I would
have already done it. You must be
dying for a bath. Fresh water's hard
to get here. But I managed to bring
some up. You can wear my clothes when
you're done. They're clean. Don't
worry. I'll sing so you'll know where
I am. After the bath, you'll be calmer.

Jen nods and the bandit releases her. He starts to sing as he walks out. Jen waits until the sound recedes before closing the curtain behind her and dipping into the pit. While she bathes, she listens to his singing, a loud rendition of a tribal song. Lo apparently doesn't remember all the lyrics, and la-las his way through more than a few passages. Jen smiles.


INT. CAVE - NIGHT

Jen grimaces as Lo pulls the last of some cactus needles from the soles of her feet.

LO
No more hitting on the head! All this
trouble for a comb?

JEN
It's mine. It means a lot to me. A
barbarian like you wouldn't understand.

LO
Not true. I can use it to pick fleas
from my horse.

JEN
By the way, I'm a real Manchurian.

LO
I'm sorry... I guessed wrong. I thought
you were a Han.

JEN
Give me back my comb.

LO
I don't take orders from anyone.

JEN
Give it back.

Jen impulsively grabs an arrow and stabs Lo, drawing a little blood from his chest. Furious, Lo lunges at her and they tussle briefly. Fianlly, Lo gets on top of Jen, and the scuffling becomes more like foreplay. Violence turns into unleashed passion.


EXT. DESERT OASIS - DAY

Lo and Jen ride across the desert. Jen holds tightly to him.


EXT. CAVE - NIGHT

Lo and Jen lie in the bath together.

LO
When I was a boy, one night, I saw
a thousand shooting stars. I thought,
where did they all go? I'm an orphan.
I used to look for stars alone. I
thought if I rode to the other end of
the desert, I'd find them. I've been
riding in the desert ever since.

JEN
And so, the little boy became a
fearsome bandit. He couldn't find the
stars, so he stole my comb.

Lo pauses.

LO
Out here, you always fight for survival.
You have to be part of a gang to stand a
chance. Slowly, your gang becomes your
family. All that Dark Cloud stuff is just
to scare people and make my life easier.

JEN
So you're still that little boy looking
for shooting stars.

LO
I am a man. And now I've found the
brightest star of all.

EXT. DESERT - DAY

Lo sees uniformed men through his binoculars.

LO
Your father's men are looking for you.

Jen doesn't respond.


EXT. DESERT - DAY

Lo and Jen ride through a mountain pass.


EXT. CLIFF - DAY

Lo and Jen stand at the crest of a cliff. Lo looks over, viewing the desert valley below as Jen joins him. They see a troop of uniformed men riding by in the distance.

LO
Your father's men are still looking
for you. They're still out there,
circling closer.

JEN
Let them look.

LO
It is trouble for me.

Jen bites her lip.

JEN
Don't send me back!

LO
You must decide. You might get tired of
this life. You might begin to miss your
family. If it were our daughter, we'd
look for her too. She would miss us.
Jen... I want you to be mine forever. I
will make my mark on the world. I will
earn your parents' respect. We have a
legend. Anyone who dares to jump from
the mountain, God will grant his wish.
Long ago, a young man's parents were ill,
so he jumped. He didn't die. He wasn't
even hurt. He floated away, far away,
never to return. He knew his wish had
come true. If you believe, it will
happen. The elders say, "A faithful heart
makes wishes come true."


INT. TENT - DAY

Jen and Lo kiss. Jen takes the jade comb out of her hair and presses it into his palm. Jen starts to cry. They embrace.

JEN
Keep it safe. Return it to me when we are
together again.

LO
I will.

JEN
(smiling painfully)
If you don't, I'll come after you. And
I won't let you off so easy.


EXT. TENT - DAY

Jen quietly walks out and stands sadly in the early morning light.


END OF FLASHBACK.


INT. JEN'S ROOM - NIGHT

LO
Wherever I went, someone always
recognized me. I really tried. Later,
I heard you came to Peking. I was
afraid I'd never see you again. So I
came. I can't let you marry.

Jen is about to respond when a servant's voice is heard from outside the door.

JEN
(whispering)
Go.

LO
Jen...

JEN
(through her tears)
Don't ever come back.

Lo hovers at the window frame.

LO
So it's over?

Jen pauses.

JEN
Yes.

Lo thrusts a small object in her hand.

He lifts his legs through the window and drops out of sight, just as Jen's door is opened from the hall.

MAID
We heard noises.

JEN
It was just a cat.

The Maid pauses, then dutifully exits, closing the door.

Jen opens up her palm; gasping, she sees the comb that Lo has given her.


EXT. WEDDING PROCESSION - DAY

The noise and color of a wedding procession. A marching band heralds the occasion, as throngs of onlookers fight to get a glimpse of the groom, GOU JUN PEI, who trots by on a handsome white horse.


INT. WEDDING CARRIAGE - DAY

Jen's head is completely covered in red cloth as she rides silently in the bride's carriage.


EXT. BALCONY OVERLOOKING WEDDING PROCESSION - DAY

Li and Yu watch the festivities from a balcony of the city gate.

YU
You think Jade Fox will show up?

LI
She's out there, but I doubt she'll
show herself. We'll keep our eyes
open. Sooner or later, she'll come
for the girl.


INT. WEDDING CARRIAGE - DAY

A small arrow flies into the carriage. Jen calmly lifts the red cloth from her face and pulls the arrow out of the panelling inside the carriage.

We hear Lo's voice from outside the carriage, but Jen doesn't seem to notice.

LO (v-o)
Jen! Come with me! You're mine!

Lo runs wildly into the crowd.

LO
Come with me to the desert! Jen!
Come with me to Xin Jiang!

The guards surround Lo, but he escapes.


EXT. PEKING STREET - DAY

Lo leaps and lands right in front of Li Mu Bai, his fingers pressed against Lo's neck. Yu comes running around the corner and sees them.

LI
Where is Jade Fox?

Yu jumps in and pushes Li away.

YU
(to Lo)
Come with me! Hurry!


EXT. CITY OUTSKIRTS - DAY
Lo sits dejectedly, having told his story to Yu and Li, who look him over.

YU
(to Lo)
You thought she'd give it all up
and go back West with you?

LO
She's mine.

LI
Either way, you are no good to her
dead. With the Gou and Yu clans
hunting you, you'll soon be in their
hands.

LO
I don't care anymore.

LI
If you truly loved her, you wouldn't
say that.

YU
Don't you want to see her again?

LI
All right. I'll write you an
introduction. Take it to Wudan. Wait
there for news from me.

LO
All right.


EXT. TE COMPOUND - NIGHT

Yu and Li enter as other men and women race through the compound, a sense of panic in the air. Yu gives Li a look. Li shrugs.


INT. TE'S HALL - NIGHT

A crowd, including Li and Yu, stand by as Te opens the empty sword case, his voice rising.

SIR TE
When will this end? They take it,
they put it back, they take it again.
My home is turning into a warehouse.

Bo bursts into the hall, bows to Te.

SIR TE
Speak!

BO
Jen has run away! Gou found the
wedding chamber empty. Governor Yu
requests your assistance. You know
the Giang Hu underworld. He wants
to find her and keep her from harm.

LI
Sir Te, leave this to us. Don't worry.


INT. TEA STALL - DAY

Jen arrives at the tea stall. She places her sword on the table, which catches the attention of a couple of Giang Hu martial arts characters sitting nearby.

WAITRESS
What can I serve you?

As the Waitress turns to leave, Jen grabs her by the arm.

JEN
The cup is dirty.

The flustered Waitress apologizes and takes the cup away. The men approach Jen.

GANGSTER A
Hello. What is your name?

JEN
(without lifting her eyes)
Long.

GANGSTER B
It's young Master Long, my apologies.
I'm Iron Eagle Sung and this is my
brother in arms, Flying Cougar Li Yun.
What brings you to Huai An, and where
are you headed, Master Long?

JEN
Anywhere there's action.

The two men exchange glances.

GANGSTER A
In that case, perhaps we could be of
assistance.

JEN
Don't bother.

GANGSTER A
You don't seem to understand.

JEN
So what if I don't?

GANGSTER B
We have ways of helping you understand.

The two pull out their weapons which are immediately chopped into scraps by Jen.

GANGSTER A
(stunned)
Are you related to Li Mu Bai?

JEN
He is my defeated foe!


EXT. WOODS - DAY

Li and Yu pass a cup back and forth as Bo tends to the horses in the background.

YU
Have some tea.

As Yu passes the cup to Li, their fingers touch. Embarrassed, Li pulls back.

LI
Shu Lien... The things we touch have
no permanence. My master would say...
there is nothing we can hold on to in
this world. Only by letting go can we
truly possess what is real.

YU
Not everything is an illusion. My
hand... wasn't that real?

LI
Your hand, rough and callused from
machete practice... All this time,
I've never had the courage to touch it.

Li takes Yu's hand and presses it to his face.

LI
Giang Hu is a world of tigers and
dragons, full of corruption... I
tried sincerely to give it up but I
have brought us only trouble.

YU
To repress one's feelings only makes
them stronger.

LI
You're right, but I don't know what
to do. I want to be with you... just
like this. It gives me a sense of peace.

Li Mu Bai smiles.


INT. STAR RESTAURANT - DAY

Jen walks upstairs. A WAITER greets her.

WAITER
Please follow me.

JEN
I want a clean room.

WAITER
We have plenty. Your order?

Jen again sets her sword on the table as she sits down.

JEN
Steamed whole cod, bite-sized
meatballs, a little starchy, but
keep the sauce light, shark fin soup,
mixed vegetables, and some warm wine.

WAITER
(dazed)
I have to order from a bigger
restaurant.

JEN
Hurry then.

The Waiter gauges Jen for an instant before bouncing off to place the orders. Jen checks her pouch and sees there's not much money left.

A large group of Giang Hu characters enters. They survey the restaurant and quickly find Jen upstairs.

GIANG HU A
That's him.

MI BIAO
I am Iron Arm Mi. I heard a true
master has arrived. I have come to
seek a lesson.

Jen ignores him.

MI BIAO
(bristles)
You asked for it!

Mi charges and attacks Jen, who is still sitting sipping tea. Jen barely lifts a finger and disposes of Mi with a poke at a sensitive pressure point. This provokes a reaction from the other men.

JEN
What kind of Iron Arm are you?

FLYING MACHETE CHANG
You have amazing technique! I am
Flying Machete. Are you related to
Southern Crane?

JEN
Southern Duck? I don't eat anything
with two feet. Who could remember
such long-winded names?

GOU JUN SIHUNG
Li Mu Bai is your defeated foe, and
you don't know his master, Southern
Crane?

JEN
Who are you?

GOU JUN SIHUNG
I'm Shining Phoenix Mountain Gou.

JEN
(furious)
Gou? I hate that name. It makes me
puke! Too bad you're named Gou. You'll
be the first to feel my sword today.

Jen leaps up and dives into battle. The men all use different kinds of weapons, but they all succumb to the powerful Green Destiny.

MONK JING
Hold it! Don't you know Monk Jing?

JEN
A monk, in a place like this? You
need a lesson!

MONK JING
Who are you?

She smiles, and leaps again into action after unsheathing the Green Destiny.

JEN
Who am I? I am... I am the Invincible
Sword Goddess. Armed with the
incredible... Green Destiny. Be you Li
or Southern Crane... lower your head...
and ask for mercy. I am the desert
dragon. I leave no trace. Today I fly
over Eu-Mei. Tomorrow... I'll kick
over Wudan Mountain!

Jen is in a frenzy, slashing and maiming as she speaks.


INT. STAR RESTAURANT - DAY

Yu and Li are surrounded by the variously bandaged men who battled with Jen.

FLYING MACHETE CHANG
We politely asked for a friendly
match, but she showed no respect, and
attacked us. Everyone came by to teach
her a lesson.

MI BIAO
Her sword was just too powerful.

MONK JING
I've traveled everywhere, but never
met anyone so uncivilized.

SHINING PHOENIX MOUNTAIN GOU
(heavily bandaged)
She kept accusing me of being Gou Jun
Pei's brother. Who is this Gou, anyway?

YU
Her husband.

The men all nod their heads.


EXT. OUTSIDE HWAI AN - DAY

Li and Yu ride together.

LI
(to Yu)
We're close to your headquarters. Go
home and check in.

YU
What about you?

LI
I'll look around and catch up later.

YU
Not a bad idea. Tonight we'll get a
good night's sleep at headquarters.

Yu takes a fork off the road. Thunder can be heard in the darkening sky.


EXT. SUN COMPOUND - DAY

A group of security men are practicing Kung Fu in the front yard of Sun Security. They stop when Yu enters.

SECURITY MAN A
Mistress, you're back.

YU
It's you! How's everything here?

CAPTAIN
Fine. You've been gone a while.

YU
Yes, and I leave again tomorrow. Your
wife was due?

AH WAI
Yeah, a baby girl.

YU
Good!

AH WAI
I'll be happy if she's half as strong
as you.

YU
Mrs. Wu...

AUNT WU
You're back!

YU
How's the arm? Still sore?

AUNT WU
Much better. You've been gone so long.

YU
Li Mu Bai is coming to stay the night.

AUNT WU
(excited)
I'll go and make up his room!

Aunt Wu hustles out. Yu goes into her own room.


INT. HALL OF ANCESTRAL WORSHIP

Yu lights incense for her former fiance Meng. Hearing something, she turns to see a dishevelled Jen standing outside downstairs.

JEN
Sister Shu Lien...


INT. YU'S ROOM - DAY

Yu eases her guard, then opens a drawer and takes out some clothes. Jen, wearing just white underclothing, sets herself on the edge of Yu's bed. Yu brings over the clothes.

YU
Here you must be in proper attire.

JEN
I'm just borrowing some clean clothes.
I'm not staying.

YU
I'll give them to you.

JEN
I was just passing by and wondered
how you were.

Jen tries to hide her anxiety but finally breaks down on Yu's shoulder in tears.

JEN
You, sister...

YU
Look at the trouble you've caused.
Now you know what Giang Hu life is
really like. If you think of me as
your sister, let me give you some
sisterly advice. You can run from
marriage, but not your parents.

JEN
They forced me to marry!

YU
Go back to them first. Then you can
decide about Lo.

JEN
You know about Lo?

YU
He really loves you. Come back to
Peking with me. We'll find a solution.

JEN
Where is he now?

YU
Li Mu Bai has made arrangements. He
sent him to Wudan Mountain.

JEN
You're working together to set me up!
I'm leaving!

YU
How dare you accuse us? I always knew
you had stolen the sword! I've done
nothing but protect you and your family.
And you've repaid me with nothing but
contempt. Li Mu Bai himself spared you,
and all you do is insult him. We wanted
some peace and you've ruined it all!
You're no sister of mine!

JEN
What do I care? You were never a real
friend anyway. But I wonder, how long
could you last as my enemy?

Jen gets up to leave. Yu intercepts her.

YU
Put the sword down!

Jen jumps out.


INT. YUAN COMPOUND - DAY

Jen soars out to the front courtyard where the guards are still practicing. They raise their weapons at the sight of the intruder.

YU
(calling out)
Jen!

Jen greets Yu with the Green Destiny.

YU
Everyone out. Shut the doors.

The men leave.

YU
Fine... the friendship is over.

Yu scoops a weapon from one of many lying around and begins her battle with Jen.

Yu uses every weapon that's available against Jen but none are any match for the Green Destiny.

After slicing through another set of Yu's weapons, Jen looks admiringly at the Green Destiny in her hands.

YU
Don't touch it! That's Li Mu Bai's
sword.

JEN
Come and get it if you can.

YU
Without the Green Destiny, you are
nothing.

JEN
Don't be a sore loser. Go ahead. Take
your pick. I'll wait. Go ahead.

Yu picks up a huge broadsword and attacks. Just as the Green Destiny slices it in half, Yu holds the broken blade at Jen's neck. She pauses before hurting Jen, then pulls back.

YU
Give me the sword.

Jen, taking advantage of Yu's trust, slices her arm.

JEN
Take it!

Yu, her shoulder bleeding, falls back as Li Mu Bai jumps in.

LI
(enraged)
Stop it! You don't deserve the Green
Destiny.

JEN
Not another lecture! On guard!

LI
Let's end this here.

JEN
Only the sword will settle this.

Jen soars up to the rooftop, with Li right on her tail.


EXT. LAKE - DAY

Jen floats over the lake, Li close behind.


EXT. BAMBOO FOREST - DAY

Jen runs into a sea of bamboo. She appears to have lost Li but is not slowing down. Her white clothes are now stained with blood and mud. The wind has picked up and every breeze sounds like an air attack by Li.

The two leap onto the tips of the bamboo trees and begin their dances and dodges. They glance off bamboos and each other while staying afloat. Finally Jen lands on the same stick of bamboo as Li. The two hold their positions for a while as the bamboo bends.

LI
I only let you go because I wanted
to see the real you.

Jen tries to shake Li off the bamboo but Li recovers nicely.

JEN
What do you know about a true heart?

Li suddenly leaps off the bamboo tree. The bamboo straightens up and throws Jen toward the ground. Jen quickly pulls herself up and charges at Li.

Jen chases after Li, into a clearing, out of the bamboo forest.


EXT. RIVER - DAY

Jen finally catches up to Li, who is standing on a rock about a few feet wide amid the rapids. Jen vaults onto the rock and scuffles with Li. Jen loses her balance.

JEN
What do you want?

LI
What I've always wanted, to teach you.

JEN
All right. If you can take the sword
back in three moves, I'll go with you.

Li takes the sword back.

JEN
Give it back!

LI
Kneel!

JEN
Never!

LI
Then you have no use for the sword.

Li throws the sword into the rapids.

Jen dives in to retrieve it. Li follows Jen downstream by hopping from one rock to another. Jen recovers the sword but is herself drowning. Suddenly Jade Fox swings into the rapids and fishes Jen out. Jade Fox carries the unconscious Jen away. Li gives chase, but loses them.


INT. ABANDONED FACTORY - DAY

It's raining. Inside an old factory, Fox heats some medicine paste and then dips a needle in the paste. She burns the needle point, causing a blue smoke. She lights some incense and puts it in a burner near Jen, who is barely conscious.

FOX
Sooner or later, they'd drag you back
to Peking. Your parents will never
accept you again. But why go home?
We've gone this far, we won't stop now.
You'll always be my lady. At last,
we'll be our own masters. We'll be
happy. That's the most important thing.
All we have left is each other, right?
Lie down and rest.

Jen is too weak to respond.

Fox leaves Jen clutching the Green Destiny.


EXT. ABANDONED FACTORY - DAY

Fox scurries ahead in the rain. Her eyes catch something, but she keeps moving.


INT. YUAN COMPOUND - DAY

Aunt Wu finishes bandaging Yu.

AUNT WU
She's crazy. You should have killed her.

YU
I didn't have the heart.

AUNT WU
Well, Li Mu Bai can do it.

Yu senses movement at the window. Looking out, she sees Jade Fox in the distance.


INT. ABANDONED FACTORY - DAY

Jen wakes up, flushed from fever. She takes a sip from a cup of water- it's empty. She tosses the cup, gets up, and walks into the rain.


EXT. ABANDONED FACTORY - DAY

Jen walks out, raises her face into the rain, and drinks the raindrops. Thirst quenched, she turns around and finds Li standing there. Jen limps toward him while mumbling.

JEN
Is it me or the sword you want?

Jen falls into Li, who checks her pulse and looks at her eyes.

LI
You've been drugged!

Li carries her inside, kicking away the incense burner.


INT. ABANDONED FACTORY - DAY

Li lays his hands on Jen's back; she slowly comes to.

LI
Where is Jade Fox?

Jen gestures that she doesn't know. Yu and Bo enter. Yu looks at Jen.

YU
What happened?

LI
Jade Fox drugged her. How did you
get here?

YU
We followed Jade Fox.

Instantaneously, a flurry of darts flies directly in Jen's direction. Li and Yu swipe miraculously at them all, sending them flinging hither and thither.

Fox shows herself. Li attacks her. She falls back, bleeding to death.

LI
And so you die.

Li touches his neck.

FOX
And so shall you!

Li pulls a single needle from his neck.

YU
A poisoned needle!

FOX
You deserve to die, but the life I
was hoping to take... was Jen's. Ten
years I devoted to you. But you
deceived me! You hid the manual's true
meaning. I never improved... but your
progress was limitless! You know what
poison is? An eight-year-old girl, full
of deceit. That's poison! Jen! My only
family... my only enemy...

Jade Fox dies.

YU
You can't die! Tell us what poison
you used! You can't die! Tell us the
antidote! You can't let Li Mu Bai die!

JEN
She used Purple Yin... Purple Yin
poison. It goes straight to the heart.

LI
My blood will soon reverse its flow.
It's the same poison she used to kill
my master. There is no antidote.

YU
That can't be! Everything has an
antethesis! Why not this?

JEN
The antidote exists. She taught it to
me. The formula is simple, but it takes
time to prepare. Trust me. As you have
helped me, let me help him.

LI
All right. Hurry. I will hold on as
long as I can.

YU
(takes the comb from her hair)
Take my horse and go to the compound.
Give this to Mrs. Wu. She'll help you.
Hurry!

JEN
Spare your energy. I'll be back!


EXT. ABANDONED FACTORY - NIGHT

Bo is burying Fox in the rain.


EXT. YUAN COMPOUND - NIGHT

The guards surround Jen. She pushes past them.

JEN
Where is Mrs. Wu?

Aunt Wu comes running out.

AUNT WU
Stop it!

Jen pulls out Yu's comb.

JEN
Shu Lien told me to show you this.

AUNT WU
Let her in.


INT. ABANDONED FACTORY - NIGHT

Yu sits across from Li, whose pose is almost meditational, eerily calm.

YU
Mu Bai, hold on. Give me some hope...

LI
Shu Lien...

YU
Save your strength.

LI
My life is departing. I've only one
breath left.

YU
Use it to meditate. Free yourself from
this world as you have been taught. Let
your soul rise to eternity with your
last breath. Do not waste it... for me.

LI
I've already wasted my whole life. I
want to tell you with my last breath...
I have always loved you. I would rather
be a ghost, drifting by your side... as
a condemned soul... than enter Heaven
without you. Because of your love... I
will never be a lonely spirit.

Yu cries.

She kisses him lightly. He closes his eyes.


EXT. PATH - DAY

As the sun rises, Jen rides speedily, clutching the medicine in her hands.


INT. ABANDONED FACTORY - DAY

Li is in Yu's arms. They're holding hands. The sun shines in. Yu slowly releases Li's stiff fingers- he is dead.

Jen is at the door.

JEN
He's gone?

Bo peeks over Jen's shoulder.

Yu rises and picks up Green Destiny. Jen kneels. Yu raises the sword, but doesn't kill her.

YU
Bo... please take this sword back to
Sir Te.

He takes the sword from her.

YU
(to Jen)
Now you must go to Wudan Mountain. Lo
awaits you there. Promise me one thing,
whatever path you take in this life...
be true to yourself.


EXT. WUDAN TEMPLE - DAY

Jen climbs up toward the temple, finally reaching the temple gate, and sees Lo standing there.

He runs to her. She greets him.


INT. WUDAN TEMPLE - MAGIC

Jen and Lo make love.


INT. WUDAN TEMPLE - DAY

Lo wakes up to find the jade comb on the pillow beside him, Jen gone.


EXT. WUDAN MOUNTAIN - DAY

Lo catches up to Jen, who stands on a bridge. The gorges below are shrouded in clouds. She looks back at him.

JEN
Do you remember the legend of the
young man?

LO
"A faithful heart makes wishes come
true."

JEN
Make a wish, Lo.

Lo pauses.

LO
(closing his eyes)
To be back in the desert, together
again.

Jen smiles, turns, and leaps into the clouds. They seem to catch her gently before she disappears into them.

Lo remains standing, a smile on his face, tears rolling down his cheeks.


THE END