2007年7月21日星期六
2007年7月20日星期五
Alexa发布了最新的firefox插件了!
Alexa以前只有ie的插件,想随时看网站的排名及最近4个月的走势
都必须用ie才可以,现在好了,可以在firefox里也可以随时看网站
排名了!
2007年7月19日星期四
VC高级调试技巧
1.利用_ASSERT设置断点!! ( 需要加入头文件
有时候希望程序在某个特殊条件下产生断点,
而相比之下,行断点和数据断点就都不能得到满意的结果。
如:
__ASSERT( line_no != 2359 ); /* 当变量line_no = 2359时产生断点 */
注:assert函数无法完成_ASSERT宏的这个功能,因为它产生断点,接着退出程序。
2.数据断点:当所设断点的数据被改变,则产生中断,并跳到相应源代码行
Edit/Breakpoints (Alt+F9)
Data栏下,可以设置数据断点,非常适合分析大型程序!
注:有时数组设断点时,必须指定是具体某个元素,如global_trees[29]
3.异常中断:在产生异常的地方,跳到源代码行,而不是直接退出。
当调试时. Debug/Exceptions 下进行设置
如 Stack Overflow异常,将Stop if not handled -> Stop always
则会产生中断.
BlogBackupOnline备份功能的不足
因为blogger最近总是被封,所以
今天打算把blogger的数据搬到WordPress上面。
使用WordPress的Import功能,很顺利的就把blogger上的数据
搬到了WordPress上了,并且连标签也没放过。基本上不需要再
做额外的工作了!
一时兴起,想起来BlogBackupOnline也可以备份并且恢复博客。
就把以前BlogBackupOnline备份blogger的内容恢复到WordPress上面
结果文章全都放在了Uncategorized标签下面。
所以以后如果要搬移博客,最好用博客自带的Import功能。而用
BlogBackupOnline搬移的博客标签信息会丢失。
2007年7月18日星期三
VC和DevC++对比
VC优点:可以使用和Soft-Ice同样的”数据断点”功能.当某个数据(变量或表达式)被修改 后,产生中 断.以前在Sfot-Ice中可以用来跟踪游戏人物属性数值,然后用16进制编辑器修改指令为NOP或为无条件转移.
这个功能在分析大型源代码时很好用.引用以及指针都会产生中断.以前使用Find in Files…静态的分析,每一个地方都设一个断点,然后跟踪,效率很低.(引用以及指针的使用可能还需要继续跟踪其他变量)
DevC++优点: Dev-C++可以导入VC工程. Dev-C++可以轻松设置其他扩展名文件如(.y)高亮显示.
2007年7月17日星期二
QuickTest Professional
正在学着用测试工具QuickTest Professional,大部分功能都掌握了
还差2个小问题:首先是如何降低速度--虽然在Tools->Options->Run->RunMode
里设置的是Normal速度,但感觉还是快~~~; 其次是如何CheckPoint以检验数据
有效性
Translate 《How Debuggers Work:algorithm data structure architecture》
原来打算用google translate先翻译第一遍,然后自己改一遍,再找人
再校对一遍。
但它原始文件是pdf格式的,本以为可以直接从pdf文件转换为word
文件,solid convert pdf转换后发现都是扫描的图片。这样的话,
就必须自己把书籍上的英文都敲到电脑里去,这个工作量太大,
所以暂时先放一放了~~
lcc源代码应该是一个突破口
lcc源代码应该是一个突破口。尽管里边的词法分析和语法分析都是hand-written,而且用的是
recursive decline,但是通过它了解C语言的一些具体实现细节还是很有帮助的。
(通过参考《C语言参考手册》)。
Adobe to Open Source Flex
Gives Developers Ability to Enhance Flex Framework for Delivering Rich Internet Applications
SAN JOSE, Calif. — April 26, 2007 — Adobe Systems Incorporated (Nasdaq: ADBE) today announced plans to release source code for Adobe® Flex™ as open source. This initiative will let developers worldwide participate in the growth of the industry's most advanced framework for building cross-operating system rich Internet applications (RIAs) for the Web and enabling new Apollo applications for the desktop. The open source Flex SDK and documentation will be available under the Mozilla Public License (MPL).
Available since June 2006, the free Adobe Flex SDK includes the technologies developers need to build effective Flex applications, including the MXML™ compiler and the ActionScript™ 3.0 libraries that make up the popular Flex framework. Together, these elements provide the modern, standards-based language and programming model used by leading businesses such as BMC Software, eBay, salesforce.com, Scrapblog, and Samsung to create RIAs deployed on the ubiquitous Adobe Flash® Player.
“Open source has been pivotal to the rapid growth of Alfresco, and it's great to see Adobe take a similar approach to Flex technology,” said John Newton, CTO of Alfresco. “We've been very interested in using the Flex SDK to put a more usable and engaging face on enterprise content management, and this move by Adobe makes that all the more attractive.”
This announcement expands on Adobe's commitment to open technology initiatives, including the contribution of source code for the ActionScript Virtual Machine to the Mozilla Foundation under the Tamarin project, the use of the open source WebKit engine in the “Apollo” project, and the release of the full PDF 1.7 specification for ISO standardization. By committing to releasing Flex source code to developers as open source, Adobe is embracing collaboration with the worldwide developer community and enabling other open source projects to take full advantage of the powerful capabilities of the Flex framework.
“Open source co-creation is a powerful way to build a strong development community,” said James Governor, Founder of RedMonk. “Adobe's decision to open source the Flex SDK is a radical move which should attract a new class of developer to the platform.”
Using the MPL for open sourcing Flex will allow full and free access to source code. Developers will be able to freely download, extend, and contribute to the source code for the Flex compiler, components and application framework. Adobe also will continue to make the Flex SDK and other Flex products available under their existing commercial licenses, allowing both new and existing partners and customers to choose the license terms that best suit their requirements.
“The definition and evolution of Flex has been influenced by our incredibly talented developer community from day one,” said David Mendels, senior vice president, Enterprise and Developer Business Unit at Adobe. “The decision to open source Flex was a completely natural next step. I am incredibly excited to deeply collaborate with the developer community on Flex, and further fuel its momentum and innovation.”
The open source licensing of Flex is part of an initiative to engage the community in the creation of Flex technology. Starting this summer with the pre-release versions of the next release of the Flex product line, code named “Moxie,” Adobe will post daily software builds of the Flex SDK on a public download site with a public bug database. The release of open source Flex under the MPL will occur in conjunction with the final release of Moxie, currently scheduled for the second half of 2007.
For more information on the terms of the MPL and how to contribute to the open source Flex initiative, please visit www.adobe.com/go/opensourceflex .
About Adobe Systems Incorporated
Adobe revolutionizes how the world engages with ideas and information - anytime, anywhere and through any medium. For more information, visit www.adobe.com .
Metasploit Framework 3.0 RELEASED
Metasploit is pleased to announce the immediate free availability of the Metasploit Framework version 3.0 from http://framework.metasploit.com/.
The Metasploit Framework ("Metasploit") is a development platform for creating security tools and exploits. Version 3.0 contains 177 exploits 104 payloads 17 encoders and 3 nop modules. Additionally 30 auxiliary modules are included that perform a wide range of tasks including host discovery protocol fuzzing and denial of service testing.
Metasploit is used by network security professionals to perform penetration tests system administrators to verify patch installations product vendors to perform regression testing and security researchers world-wide. The framework is written in the Ruby programming language and includes components written in C and assembler.
Metasploit runs on all modern operating systems including Linux Windows Mac OS X and most flavors of BSD. Metasploit has been used on a wide range of hardware platforms from massive Unix mainframes to the tiny Nokia n800 handheld. Users can access Metasploit using the tab-completing console interface the command line scripting interface or the AJAX-enabled web interface. The Windows version of Metasploit includes all software dependencies and a selection of useful networking tools.
The latest version of the Metasploit Framework as well as screen shots video demonstrations documentation and installation instructions for many platforms can be found online at http://framework.metasploit.com/
Metasploit 3 is a from-scratch rewrite of Metasploit 2 using the Ruby scripting language. The development process took nearly two years to complete and resulted in over 100 000 lines of Ruby code. As such there are some notable differences between version 2.7 and 3.0:
* The Fs Sys Net and Process extensions in the Metasploit 2.7 Meterpreter have been combined into a single extension that is automatically loaded in Metasploit 3. The "stdapi" extension can be used to manipulate files list and manage processes migrate the payload into a new process edit a file on the server forward a port execute a command and many other tasks. The "priv" extension (accessible by the "use priv" command) provides the hashdump command for dumping password hashes and the timestomp command for erasing file system timestamps.
* The Meterpreter shell provides an "irb" command thats allows interactive scripting of a compromised system. One of the features of the Metasploit client API is the the ability to read and write the memory of any accessible process on the exploited system all from inside a Ruby shell. When combined with a Meterpreter script (started with the "run" command from inside Meterpreter) this feature can be used to backdoor running applications or steal in-memory credentials.
* The Metasploit console provides an "irb" command (on Unix systems only) thats allows direct access to the Ruby internals at runtime. This can be used to modify the behavior of the framework interact with existing connections and as a development environment for plugins.
* The Metasploit console interface has a new "route" command that allows all network connections to a given subnet to be routed through an existing session. This can be used in conjunction with the Meterpreter payload to relay attacks through exploited systems.
* Database support is provided via a set of plugins and a standard command interface. The database can be used to track host information during a penetration test and launch automated attacks against a network (db_autopwn). The current release can import both Nessus NBE files and Nmap XML output files. Data provided by these tools can be used to cross-reference open ports and vulnerabilities with Metasploit modules.
* User options have been separated into three types: standard advanced and evasion. Evasion options allow the user to bypass IDS and IPS systems by specifying how exploit data is generated and delivered. Evasion options are available for most exploits with particular attention paid to the SMB DCERPC and HTTP protocols.
* A plugin system allows developers to add their own commands to the console interface hook framework events and extend the framework at runtime without having to modify the base code. Examples plugins have been included in the "plugins" subdirectory of the framework. Example plugins include an "auto-tagger" a socket filter a telnet service and a number of database and debugging plugins.
* An event subscription system allows modules and plugins to wait for specific events and automatically perform different actions. This feature can be used to hook socket operations filter data flows and automated post-exploitation tasks.
* Metasploit modules can import methods and behaviors from a huge library of Ruby Mixins. This release includes support for protocols such as SMB DCERPC FTP IMAP NDMP SMTP and SUNRPC. Mixins are also provided for developing brute force exploits creating egghunters injecting user-land payloads from the Windows kernel exploiting SEH overwrites sniffing network traffic and injecting raw WiFi frames.
* Metasploit modules are now organized in a directory structure instead of a single flat directory. A caching system provides faster loading times. The result is a scalable system that can manage hundreds of different modules at a time (over 300 alone in this release).
* The web interface (msfweb) is a Ruby on Rails application that uses the Prototype JavaScript Framework to provide in-browser windowing support. Asynchronous JavaScript is used to provide as-you-type search results for any module type and provide tab completion for the web console interface.
* Thanks to Ruby's in-process threading support it is possible to share a single Metasploit instance with other users exploit multiple hosts at the same time and run persistent background services while only consuming the system resources of a single process. The msfd plugin adds a telnet interface to an existing Metasploit instance.
* The new Auxiliary module type allows the development of almost any form of security or attack tool. Auxiliary modules have complete access to the Metasploit attack and protocol libraries and can be used to quickly develop research tools and proof-of-concepts.
* Subversion is now used for online updates and version control. This allows users to easily switch between the development and stable version of the framework and obtain online updates using any transport supported by Subversion.
* This release includes three exploit modules that exploit WiFi driver vulnerabilities in the Windows kernel. Combined with the kernel user-land payload stager this allows any Metasploit payload to be used with ring-0 exploits on the Windows platform. A handful of auxiliary modules are included that trigger denial of service conditions in WiFi drivers across a variety of platforms.
* Metasploit is now released under the Metasploit Framework License. This license allows anyone to use the framework for almost anything but prevents commercial abuse and outright code theft. The Metasploit Framework License helps keep the platform stable and still allows module developers to choose their own licensing terms for their code (commercial or open source). For more information please see the license document included in the distribution.
* The Rex library which provides most of the utility methods and protocol support for the framework has been released under the 3-clause BSD license. Ruby developers can use this code to build open source or commercial applications that are not subject to the restrictions of the Metasploit Framework License.
Enjoy!
也许该让这只小企鹅消失了-续
看了那么多贴子,没有想到会是这样的结果。看到北南南北兄在linuxsir上写的东西,前两天又和他在电话里聊了一会,让人想到几年前的情况。所以,我想还是在这儿写点东西,算是北南南北兄那段文字的前传,即当时我为什么要写gWuBi。
具体的时间我已经记不清楚,大概是2000年左右吧,已经忘记什么原因了,我有幸成为linuxforum中文化版的版主,其实那个时候我linux的水平也不怎么样(现在还是不怎么样),可能是我比较喜欢瞎折腾吧,琢磨出了一些非正常的方法来解决中文化的问题。任这个版主大约一年左右吧,还光荣地成为当年度最佳版主,得到几本书的奖励(其实这都是得益于几个真正的高手,比如Rigel,他都是在私下里指导我,然后我试好后再回答大家的问题,一直都很敬佩他们)。这个是题外话。
做版主的这一年,我想那个时候应该算是linux在我们国家推广最快的时候吧,大家的问题都是集中在如何显示输入中文上。但当时在X上能用的输入法主要有三个,一个是chinput,一个蓝点的输入法,一个是红旗的rfinput。chinput占据绝大部分的市场,但当时似乎它已经处于停止维护的状态(后来变成了miniChinput)。
我本人是用五笔的,自然也是一直在寻找易用的五笔输入法。虽然chinput可以调出来五笔,但那个五笔大概只能用仅可以打字来形容。蓝点里面的还不错,但蓝点后来就消失了。后来又发现了rfinput,那个时候的rfinput是开源的,但它里面没有五笔,只有个郑码,郑码与五笔的编码规则很相像,于是我就修改了郑码模块,改成比较适合五笔用户,并用richwin的五笔词库替换了郑码码表(似乎有侵权的嫌疑:p),制作了一个rfinput的五笔版,并放在了linuxforum论坛上。我想老一点的linux用户们大概还有这个印象吧,现在也许还能下载到这个版本的rfinput。但是,这个 rfinput很不稳定,由于它的拼音是闭源,只提供二进制的目标文件,也没有办法搞清楚不稳定的原因是什么。
那个时候,在我负责的版块里,经常发生有关中文化的讨论,一些高手们总是轻视中文化的工作,认为“真正的高手”都应该去搞类似内核的开发,而把中文化说成没有技术含量、浪费时间的工作。我不是高手,我不会内核的开发,但我也经常与他们辩论,我的出发点一直很简单,就是以为我们中国人当然应该能在这个系统上便利地使用我们的母语。自己很喜欢linux系统,不愿意再回到windows下,但没有好的五笔输入法怎么办呢?幸好,大学时选修了C语言,还稍稍会一点,而又发现rfinput源码中的IMdKit包含了一个简单的示例程序,觉得写出一个能用的五笔输入法也不是那么难,呵呵,怪不得某些高手们都不屑于做这样的事,可以理解。
由于有这样一个示例程序和rfinput的源码,进展好像很顺利,不记得用了多久,第一个可以运行的五笔输入法就出来了。起初,只是想给自己用的,根本没有那个意识要想把它放出来。只是有一天,大家都在展示自己的桌面,我也展示了自己的,小凡看到了我桌面上gWuBi的图标……于是,这才有了现在的 fcitx。
五年多了,曾经为实现某个功能高兴,也曾经为寻找某个问题而调试程序到凌晨五六点。看到fcitx能为大家带来便利,真的是很高兴,自私地说,自己从它里面为自己找到另外一种生活的乐趣——这是我一个主要的追求,它与我的本职工作完全不同,不过这种追求在某些人眼里也是一种罪过,甚至当看到有人因为从 fcitx得到便利而顺便称赞Yuking几句时,我都有罪恶感了。而且,经常有人鄙视我程序写的烂,的确,我也承认这个,但这并不是我的本意,我也希望它能变得好一些。如果这种指责限于技术上还好,但问题是,越来越多的指责把这种“烂”提升到人身攻击的层次。于是我为自己的这种付出感到迷惑,往往突然陷入不知道自己在干什么的境地。甚至,有时候想,fcitx的确是个比较有名的东西了,但它的代码写的那么烂,那么我是不是在给我们国家那些编程高手们抹黑,在某种意义上算不算是一件让软件界蒙羞的事呢?
但有一点,我绝不接受对使用中文GB编码作为配置文件的指责!指责的人可以不用中文,不用GB,但我为什么不可以用我们自己的母语?
去年九月份吧,我也曾经发过一个贴子说自己有些累了,网上也因此有些评论,还有一些猜测,因为我很少说自己的情况,那些猜测虽然并不准确,但都是善意的,也没有啥。现在,既然已经成为这样,我也不想让大家再猜测我的情况了,我本人的简单情况如下:
-姓名:Yuking
-性别:男
-年龄:还是没必要说了吧
-专业:核物理
-工作单位:中国工程物理研究院
-职业:情报研究
-目前工作状况:还不错,很受领导重视,课题组组长
-收入情况:相对来说,还不错
"铸国防基石 做民族脊梁"是我们单位的精神,我离这个要求还是有点远啊,因此我觉得自己还是多放点功夫在这个上更好一些,反正我只能写出很烂的代码,也没有心思去学习如何让程序写得更好一些,那不如就离开吧……
也许该让这只小企鹅消失了(Fcitx──小企鹅输入法)
昨晚云帆论坛上某个编程高手说小企鹅这儿不好那儿不好,比如,代码写的很差,用中文配置文件就说明我本人很“幼稚”等等。也许某些能人的确能从程序代码上看出作者的本性来吧。
但,也许现在我就是在做一个“幼稚”的决定,即决定终止这个程序的开发。
从最初的“G五笔”到现在的fcitx,已经经历6年左右的时间了,感情还是有那么一些的。不过,作为一个业余的编程爱好者,以GPL的方式发布这样一个软件,那些编程高手们自然有很多理由来BS我,比如坚持使用中文配置文件,代码写的一塌糊涂等。我也可以选择找个高手重新构建整个程序,但实在不想了,至少是现在不想了,让它就这样终止吧──反正主要也只是我一个人的东西。
这种想法其实由来已久,这次这事只不过是个导火索而已,终于决定让自己彻底离开这个圈子──我本来就不该属于这个圈子的。
如果您真的喜欢这个小程序,那真的不好意思啊,请使用其它的输入法吧…… :D
2007年7月16日星期一
可敬的老人:何祚庥
最近看到,何祚庥老先生又走到了媒体的闪光灯下:他公开声源方舟子对我
国中医科学性的质疑,认为阴阳五行学说是伪科学,并将陈晓旭之早逝也缘于中
医对现代医疗设备检测的漠视。此言一出,不仅媒体部门的声讨之声不绝于耳,
卫生部副部长王国强也因此公开批评何老先生。
何祚庥,我国50年代核研究的功勋人物,科学院院士。80载岁月的洗涮,并
没有冲淡他对社会公正的豪情和对社会发展走向的关注,迟暮时分,他反而一次
次的站在了社会的风口浪尖上。几年前他第一个站出来公开反对法/轮/功;他提
倡农村城市化和农民进城务工,反对限制人口流动;现在他再次出击将中医科学
与否的争论推向了高潮。
很庆幸大二时,曾近距离与老先生接触过。那是一场讲座,由于一场的火爆,
整个教室被挤得水泄不通,而我则晕晕乎乎的被拥到了第一排,跟老先生仅有2
米的距离!那天很热,教室里也很闷,但何老依然精神矍铄的为我们讲解了两个
多小时。讲到他的家,他汹涌澎湃的大学时代,他艰苦异常的核研究道路还有他
现在的生活,所有这些构成了一幅壮丽的画卷,因为我总能从其中感受到强烈的
悲天悯人的精神和时刻心系祖国的情感,老先生活的很精彩,从不说假话蒙蔽自
己的心,所以,即便两鬓斑白,他也不减年轻的风采。
转基因的妙用和延误
2005年少年儿童出版社出版了我的一本科普小册子《餐桌上的基因》,里面
有一章介绍了一些巧妙利用转基因技术的实际例子,例如用转基因技术培育能抗
除草剂、抗虫害、提高食物的营养成分的作物,能生产霍乱、乙肝疫苗的水果,
去除过敏蛋白的大豆,能够探测地雷的转基因草,生长迅速的转基因鲑鱼,能发
荧光的转基因斑马鱼,等等。最近出版社要再版这本书,责任编辑问我是否有什
么新进展需要补充进去,特别是这些新产品这两年有没有获得了推广,效果
如何?
目前只有抗除草剂的转基因大豆和油菜、抗虫害的转基因棉花和玉米等少数
几种转基因作物的推广最为成功,被大量的种植。在美国,至2006年,89%的大
豆,83%的棉花,61%的玉米是转基因作物。这是因为它们研发得比较早,并且
在公众对转基因技术产生恐慌之前就已获得了推广,势不可挡。其他的转基因产
品就没有那么幸运了。它们有的是因为才刚刚在实验室培育成功,还需要经过几
年的田间试验才能推广;有的则是技术上已成熟,早该推广了,却由于人为的阻
挠,而未能造福人类。
后者一个典型的例子是瑞士联邦理工学院的科学家波特里科斯等人在1999年
就已培育出来的转基因水稻“金大米”。“金大米”是为了补充人体的维生素A和
铁元素而培育出来的。如果人体缺乏维生素A,会导致夜盲症,到了晚上眼睛就
看不清,还会得皮肤病,有时甚至导致死亡。严重缺乏维生素A的儿童死亡率高
达50%以上。世界卫生组织估计,每年有25万至50万名儿童因为缺乏维生素A而
失明,这些儿童中一半以上在一年内死亡。全世界大约有4亿人患有维生素A缺乏
症,这些患者大多数在亚洲。半岁到5岁的中国儿童中,有12%缺乏维生素A。
大米是亚洲人天天要吃的主食,如果通过吃大米能够补充维生素A,就有助
于消灭在亚洲人当中广泛存在的维生素A缺乏症了。水稻的叶子能够合成维生素
A的前体,但是在米粒中没有,因此大米的营养成份中缺少维生素A。我们可以
通过转基因技术来改变这种状况。科学家们为此向水稻中转入了四种酶的基因,
这四种酶能够被水稻细胞用来制造β胡萝卜素,它进入人体后能被转变成维生
素A。其中两个基因来自喇叭水仙,另两个基因来自欧文氏菌。这种转基因水稻
生产出来的大米是金黄色的,所以被称为金大米。
一般人不知道,我们天天吃的大米实际上不是“健康食品”。大米中含有一
种叫做肌醇六磷酸的小分子,它能与铁紧紧地结合,使得小肠难以吸收食物中的
铁。因此那些以大米为主食的人,容易患上铁缺乏症而导致贫血。儿童缺铁还会
导致智力发育不良,而至少有5千万名中国儿童缺铁,40-60%两岁以下中国儿童
有因缺铁而造成智力发育不良的危险。为了解决缺铁问题,科学家们还往金大米
中再转入三种基因:一种是来自无花果曲霉的酶基因,这种酶能够把肌醇六磷酸
降解掉;一种是来自菜豆的铁蛋白基因,铁蛋白能够储存铁;还有一种是来自印
度香米的基因,它生产的蛋白质有助于人的肠道吸收铁。这样,金大米总共被转
入了7种基因,来自5种物种!吃这种转基因大米,要比吃普通大米更有益身体健
康。
这几年来科学家们一直在改进金大米的品质。1999年最早的金大米其β胡萝
卜素含量为每克大米含1.6微克。后来这个含量被提高到了每克大米含4~8微克β
胡萝卜素。2005年,先正达公司的科学家对金大米做了进一步改进,用一个来自
玉米的基因取代喇叭水仙的基因,让金大米中β胡萝卜素的含量一下子达到每克
大米含37微克。以这种大米为主食,足以满足对维生素A的需求量。
一些反对转基因技术的人说,没有必要吃金大米,可以通过吃其他食物和维
生素制剂来防止维生素缺乏症。说这种话的人完全是饱汉不知饿汉饥。在许多贫
困地区,一般人每天能够吃上白米饭就已经很满足了,哪里还能奢望让饮食多样
化和吃维生素片?美国国际开发署等机构曾经尝试过在一些亚洲国家给学龄前儿
童免费发放维生素A制剂预防维生素A缺乏症的做法,但效果并不理想,因为这涉
及到人力、财力、生活习惯和发放渠道等诸多问题,只局限于某个时期某个地区,
很难长时间全面地推广。而推广金大米,却可以在不增加费用、不改变生活习惯
的条件下,几乎是一劳永逸地解决了维生素A缺乏症问题。
一些反对转基因技术的人还把推广转基因作物说成了生物技术公司谋取商业
利益的阴谋。这个指责对金大米也完全不适用。参与开发金大米的科学家、生物
技术公司是把这当成人道主义援助项目来做的,组成了“金大米人道主义委员会”,
不谋求任何商业利益。金大米技术涉及到12项专利,其专利拥有者都宣布放弃了
该专利,先正达公司则捐出了金大米种子。金大米种子将免费发给发展中国家的
农民(年收入少于1万美元)。
但是这种可以说对人类完全有益无害、能挽救无数人的生命的新产品,却只
在2004年在美国开始田间试种,而最需要这种产品的亚洲国家,在“绿色和平”
组织等所谓“环保组织”的压力下和自以为是的当地媒体的反对声中,却迟迟不
批准其种植。
“绿色和平”组织共同创建者和前领导人帕特里克·穆尔(生态学博士)后
来因为不满“环保组织”不讲科学而脱离“绿色和平”,很看不惯“绿色和平”
现在的所作所为,曾经如此激烈地批评说:“环保主义者反对生物技术、特别是
反对基因工程的运动,很显然已使他们的智能和道德破产。由于对一项能给人类
和环境带来如此多的益处的技术采取丝毫不能容忍的政策,他们实现了斯瓦兹的
预言(按:美国作者彼得·斯瓦兹曾指出环保运动将走向反科学、反技术、反人
类)。”在金大米的问题上,这个批评完全正确。
不知不觉中沦为了google的fans
从最常用的浏览器(带google工具条的firefox,汗),到email(gmail),到IM软件(gtalk),到桌面搜索(google desktop),再到照片管理(picasa).
有了自己的主页以后,google的产品更始占据了更高的份额,
从站点工具(google webmaster tools),到流量分析(google analytics),再到google广告(google adsense).
最近我把rss阅读器也换成了google reader,写文档也开始倾向于google docs.
偶真的成为google的铁杆fans了,万一哪天google翻船了,我还会上网么? :p
我经常使用的Google Services
一、要是以为Google只是用来Search website的,那么你错了……当然,google首页就是用来Search的,哈哈!第一项服务是Google Search
Http://www.google.com
二、接下来Google Analytice----网站访问统计(顾名思义吧)http://www.google.com/analytics/
三、Google Blogger----Google 的blog服务,已经过完了7岁生日。
虽然功能还有待完善,但还是愿意把一些东西写在blogger!
Http://www.blogger.com
四、Google Calendar----有名的Google日历
这是一个相当好的帮手。我觉得最炫的是可以和别人共享你的Calendar,并且可以有RSS订阅日程内容。
http://www.google.com/calendar
五、Docs&Spreadsheets----传说中G Office的先行者(我喜欢这样叫)
前身分别是Writely在线文档协同编辑和Spreadsheets在线电子表格编辑。
当然,只有简单的功能,远比不上MS Office功能强大,但可以线上协同编辑,所以很喜欢,因为会相当的高效!
http://docs.google.com
六、Gmail----Google的邮箱。第一个G级的邮箱!!!
在我发表这入篇文章的时候,它的容量是2775MB,并且在不断地增长中!
其实它的好处已经多到我不敢去说,它的好处已经多到我不敢去说!当然,目前需要受邀请注册。(要邀请的可以找我)
http://mail.google.com/mail
七、Google Group----Google讨论组
从最初的比较难看、不好用的版本,一直到现在的Beta版,Google group渐趋成熟,功能越来越多!有人批评Gtalk没有群组功能。个人认为Google group可以做到这一点。并且所有的记录将被保存。
beta版里可以添加新的webpage,每个group有100M上传空间……详细内容,懒懒的小天正在CN博客写作中……
http://groups.google.com
八、Google Notebook----为浏览器装上小笔记本
这是06年的新产品,目前还在lab里!
个人感觉很好用,尤其对我这种马大哈来说。现在不用Opera浏览器的Notebook了,在用IE的时候就用Google Notebook。
九、Page Creator----Google个人主页服务
非常傻瓜型、人性化的个人主页编辑,http://username.googlepages.com域名,并且可以自己添加下一级域名。每个帐号有100M上传空间,可以上传图片、文档等(音乐文件我还没试过)。可以试着去炫一下自己 :-P
http://pages.google.com
十、Personalized Homepage----个性化主页服务
我觉得这个最主要的是可以添加自己喜欢的Gadget、小页面进来。
详细文章请参见本站这篇文章
十一、Personalized Search----个性化搜索
有兴趣的朋友可以试着去找一下自己最近一段时间来的搜索兴趣,呵~相当有意思。
十二、Google Picasa----Picasa相片管理
因为和Google Account结合比较紧密(现在有了专门的Picasa account),所以就开始试用,感觉不错。同时,picasa有推出picasaweb服务。中国用户,每人可以有250M免费上传空间(目前不支持 续费),可以直接从picasa客户端上传至空间。美国的用户可以缴费后增加至6G的空间,并且可以上传Video,并直接调用Google Video Player播放。
每位用户的picasaweb将拥有相当炫的域名,有如http://picasaweb.google.com/qienkuen
遗憾的是,目前漳州校区的免费教育网似乎把picasaweb的IP禁了 : (
http://picasa.google.com
http://picasaweb.google.com
十三、Google Reader----RSS阅读工具
旧版的比较不好用,功能缺少很多,一直没怎么用。9月份推出的新版本已经相当炫,并且可以添加JS到网页中 : ) 和朋友共享你关注的RSS内容
http://www.google.com/reader
十四、Google Talk----Chats客户端
其实本来可以在Gmail直接用chats的,但Google和Chinese Government的关系问题,gmail偶尔会无法访问,会造成chats的断线,所以还是用gtalk客户端吧。
聊天记录自动保存在Gmail里,可以利用Mail search去查找!
以前只有google account才能登陆gtalk,10月的某一天(忘记了),另外的mail帐号只要注册了也可以登陆gtalk(还没试过,我基本不用其他mail)。
这样的注册,和google group的注册很像。记得我没有Gmail的时候,就是用别的邮箱注册的Google group。
十五、Google Toolbar for firefox----Google工具条
Google的工具条,我从来不认为是“流氓软件”,因为它的安装是明显的,而不是不可见的,是可选的!它的卸载也是方便的!功能嘛,当然是集成了google的特色内容,相当快捷。
十六、Google Desktop----桌面搜索工具
当然,它不光可以搜索PC中的东西,还集成了Gmail、Gtalk等一系列google服务,自己定制!
十七、移动Google----用手机登陆Google
这个应该比较easy吧!我那部最烂的手机都可以登陆,大家的应该没问题啦~去移动搞个GPRS包月吧,随手查起来还是蛮方便的!(没有给中国移动做广告的意思哦!)
经常用的也就这些吧!
有些服务可能需要google帐号才能使用,需要google帐号邀请的可以我。
Memory leak in flex-2.5.4a
Author:Don Richardson, Acquire Media Corporation
I have found and fixed a huge memory leak in flex-2.5.4a.
It is big enough, and obvious enough that I suspect someone else
has already found and fixed it. However, I could find no reference
to it when I searched this site, nor on the web in general.
The bug is in skel.c, generated from flex.skl. I have attached
both files.
The changed code starts on line 1091 in flex.skl, and on line 1096 in skel.c.
Here is an excerpt showing the lines I have added (underlined)
**********************************************************************************************************
void yyFlexLexer::yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
%*
{
if ( yy_current_buffer == new_buffer )
return;
if ( yy_current_buffer )
{
/* Flush out information for old buffer. */
*yy_c_buf_p = yy_hold_char;
yy_current_buffer->yy_buf_pos = yy_c_buf_p;
yy_current_buffer->yy_n_chars = yy_n_chars;
}
/* Here we fix a huge memory leak - Before this fix
* yy_current_buffer was never freed. 7-11-2001
*/
YY_BUFFER_STATE Temp = yy_current_buffer;
yy_current_buffer = new_buffer;
if (NULL != Temp)
{
yy_delete_buffer (Temp);
}
yy_load_buffer_state();
/* We don't actually know whether we did this switch during
* EOF (yywrap()) processing, but the only time this flag
* is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yy_did_buffer_switch_on_eof = 1;
}
*****************************************************************************************************
预编译开关#line的解释
- 预定义的宏名
为了有助于得到一些程序员需要的信息,在ANSI标准C编译程序中,提供了5个宏名,它们是:
__LINE__ :含有当前编译行的行号。例如,下例最后编译的是第三行,所
以宏名 __LINE__的值是3。
__FILE__ :含有当前编译的源文件的文件名。例如,下例编译的是源文
件"macro.c"所以宏名__FILE__指出的是字符串"macro.c"。
__DATE__ :含有源文件被编译成目标文件时的日期(月 日 年)。
例如,下例源文件"macro.c" 被编译成目标
文件"macro.obj"的日期是"Jun 15 2002"。
__TIME__ :含有源文件被编译成目标文件的时间(时:分:秒)。例如,
下例源文件"macro.c" 被编译成目标文件"macro.obj"的时间
是"16:42:11"。
__STDC__ :如果其值为1,表示使用的是标准版本。否则,表示使用的是
非标准版本。
例如,有C程序macro.c如下:
#includemain(){
printf("%s *** %d line *** %s
***%s\n",__FILE__,__LINE__,__DATE__,__TIME__);
}
运行结果是:
macro.c *** 3 line *** Jun 15 2002 *** 16:42:11
- line命令
#line预编译语句用于更改宏名__FILE__和__LINE__所指的字符串内容。其一般形式是:
#line number ["filename"]
其中:
number是任意正整数,它指出源文件中#line预编译语句所在位置之后的第一个C语句的行号是number。其实,#line number构成了一个行计数器,number指出了行号从几开始计数。例如:
#include
#line 100
main()
{ printf("%d\n", __LINE__); }
由于行计数器从100开始计数,所以printf("%d\n", __LINE__)语句的行号是102。
"filename" 这是一个可省缺的项。使用时给出源文件名,它将作为宏名__FILE__所指的字符串。
2007年7月15日星期日
genflags分析
因为GCC利用gen*程序将md文件转换为insn*程序(gen*->insn*)
所以先对gen*进行分析。
第一个程序genflags
genflags-->insn-flags.h ( genflags avr.md > insn-flags.h )
功能: 将md文件中define_insn,define_expand中name不为空,且name[0]!='*'
的name及C test expression输出
如:
(define_insn "addqi3" /*define_expand也是处理第3个参数*/
[...]
"" /*第3个参数为空*/
"..."
[...])
==> #define HAVE_addqi3 1 /*宏定义为1*/
如:
(define_insn "mulqihi3"
[...]
"AVR_ENHANCED" /*第3个参数不为空*/
"..."
[...])
==> #define HAVE_mulqihi3 (AVR_ENHANCED) /*宏定义为C test expression*/
将前面处理过的define_insn和define_expand的rtx的指针保存在obstack堆栈中,
再遍历一遍。
如:
(define_insn "addqi3"
[ (set(match_operand:QI 0 ...) /*打印刚才省略的内容*/
(plus:QI(match_operand:QI 1...)
(match_operand:QI 2...)))]
""
"..."
[...])
==> extern rtx gen_addqi3( rtx, rtx, rtx ) /*有3个match_operand,所以有3个参数,如果没有,则为void*/
/*只统计match_operand、match_operator、match_parallel*/
当遇到"call"、"call_pop"、"sibcall"、"sibcall_pop"时,
产生类似"call"的如下宏定义:
#define GEN_CALL( A, B, C, D ) gen_call( ( A ), ( B ) ) /*"call"有2个match_operand,所以这里也是2个*/
当遇到"call_value"、"call_value_pop"、"sibcall_value"、"sibcall_value_pop"时,
产生类似"call_value"的如下宏定义:
#define GEN_CALL_VALUE( A, B, C, D, E ) gen_call_value( ( A ), ( B ), ( C ) ) /*"call_value"有3个match_operand,所以这里也是3个*/
genpreds分析
genpreds-->tm-preds.h ( 无参数 )
功能: 将Target Machine Macro(如i386.h)文件中宏定义PREDICATE_CODES得到的extern函数
声明如下:/*之所以没用avr.h作为例子,是因为avr.h中没有定义此宏*/
如:
{"x86_64_immediate_operand",{...}},...
==> extern int x86_64_immediate_operand( rtx, enum machine_mode );
