??xml version="1.0" encoding="utf-8" standalone="yes"?>久久AⅤ人妻少妇嫩草影院,四虎国产精品免费久久5151 ,欧美牲交A欧牲交aⅴ久久http://www.shnenglu.com/ngaut/category/1628.htmlasm/c/c++/......zh-cnTue, 30 Oct 2012 20:41:28 GMTTue, 30 Oct 2012 20:41:28 GMT60[转]openFramework, Tokyo Workshophttp://www.shnenglu.com/ngaut/archive/2011/05/23/146970.htmlngautngautMon, 23 May 2011 05:48:00 GMThttp://www.shnenglu.com/ngaut/archive/2011/05/23/146970.htmlhttp://www.shnenglu.com/ngaut/comments/146970.htmlhttp://www.shnenglu.com/ngaut/archive/2011/05/23/146970.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/146970.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/146970.html

openFramework, Tokyo Workshop

SDIM0747

10 时的R轮战

昨天上下午两场工作坊天壤之别Q上?Zachary Lieberman 解说他的“艺术是对未来?R&D, 是通力的合? Do it with others”Q加上每ơ都能见到的 Eyebeam 中心跟早已经v来的 openFrameworks Lab, 老生长谈Q但每次看到 ofLab q会(x)l箋慕Q有一个场所可以l艺术家Q黑客,工程师和U学家把因搭档而来的脑力碰撞{化ؓ(f)以艺术表达ؓ(f)诉求的实c?/p>

下午?Advance section 变了个样Q开始最q基?openFrameworks 的实际项目介l和q作讲解Q一个是为澳大利亚某?x)议制作的视觉系l,全部q序控制的Z Data Visualization 概念?VI pȝQ概念不新鲜但因术家n又有 Parsons The New School for Design 的背景支持,视觉呈现做的极其好;另一个与 NIKE 的合作项?Paint With Your Feet Q添加了?GPS 数据的支持,l箋数据可视化的概念但效果出众。联惛_最q?MIT 的新 LOGOQ事兌觉系l呈现又对自我突破有要求的设计师Q学?fn)用程序来创作已经是必要考虑的事了,q不是说Ҏ(gu)技能的掌握Q而是接受一个新的现实和试H破q去l验和系l留下的限制?/p>

Zachary Lieberman 公开了他?Parsons 的两个授课课E网站,新的 http://algo.thesystemis.com/ 和稍旧的http://www.makingthingsmove.org/blog/Q有很多的例子可以参考,Parsons 学生很幸?/p>

Kinect 做ؓ(f)一个已l渡q热潮的话题Q现在积累出来极多的案例QKyle McDonald ?Zach Lieberman ?NY ITP 春季期的评用它在尝试制作廉L(fng) 3D Scanner q用数据做 3D PrintingQ这里有评 blog 可以?a style="text-decoration: none; color: #3f3f3f; ">http://3dsav.blogspot.com/Q新技术带来的试能够带来最直观的感官刺ȀQ而附着其后的,对亲w发赯最重要的,是带来新的去探烦Q尝试和产出的机?x),无论艺术创作Q设计实践还是学术的研究Q从而出新的乐?/p>

艺术家和设计师都在考虑着的东?/strong>

比如之于设计师,其是愿意扑w于q个C会(x)Qh去做最形而下试的设计师cdQ这些早出C正式成ؓ(f)设计与创作材料不久的东西Q给了我们去试更深入探索的Z(x)Q无论是形而下的实施,q是之后可能?x)随之而来的Ş而上的思考?/p>

EyeWriter 是一个预CZ新Ş态设计的典型例子Q批量化生?PS3 Camera 和可以提供从最低端自制化Y件的 openFrameworks l合在一P为实现最廉h(hun)同时也是因ؓ(f)设计师与工程师共同走完流E而把概念Q原型与使用者体验的畅l合提供了可能。现在它成ؓ(f)了一个典范,Z最初兴的但却在最大程度上Z设计,开源的但完成了一个机构的建立?/p>

OF 007

让h期待已久q迟没有发布的新版本 OF 007 也做了介l,?OPENGL 的支持新d?ofxShader 库,让动画,3D 生成渲染?OPENCV 有了更大的效能{变。配?Kinect ?OPENNI ?bug q很多,Ҏ(gu)崩溃 。有了更好的 web server 的支持,pȝ文g控制功能也做了补充,但跟 Processing 比v来,那条能够融会(x)贯通整个程序原型制作的U还不够明显Q对于非E序背景的h而言Q目?OF 依然是偏创作型的Q更适合让艺术家走向的h完成作品原型Q而不是像 Processing 一样可以够完成一个设计品原型的程?/p>



ngaut 2011-05-23 13:48 发表评论
]]>
winaoe W记http://www.shnenglu.com/ngaut/archive/2011/01/20/138960.htmlngautngautThu, 20 Jan 2011 04:37:00 GMThttp://www.shnenglu.com/ngaut/archive/2011/01/20/138960.htmlhttp://www.shnenglu.com/ngaut/comments/138960.htmlhttp://www.shnenglu.com/ngaut/archive/2011/01/20/138960.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/138960.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/138960.html

ngaut 2011-01-20 12:37 发表评论
]]>
windows应用patch的笔?/title><link>http://www.shnenglu.com/ngaut/archive/2010/08/26/124891.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Thu, 26 Aug 2010 14:24:00 GMT</pubDate><guid>http://www.shnenglu.com/ngaut/archive/2010/08/26/124891.html</guid><wfw:comment>http://www.shnenglu.com/ngaut/comments/124891.html</wfw:comment><comments>http://www.shnenglu.com/ngaut/archive/2010/08/26/124891.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ngaut/comments/commentRss/124891.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ngaut/services/trackbacks/124891.html</trackback:ping><description><![CDATA[如果遇到q个问题Q?div><span style="color: rgb(51, 51, 51); font-family: Verdana, Tahoma, Arial, Calibri, Geneva, sans-serif; font-size: 13px; ">/patch.exe -p1 < xx.patch</span><br><div><span style="color: rgb(51, 51, 51); font-family: Verdana, Tahoma, Arial, Calibri, Geneva, sans-serif; font-size: 13px; ">Assertion failed: hunk, file ../patch-2.5.9-src/patch.c line 354</span></div><div><span style="color: rgb(51, 51, 51); font-family: Verdana, Tahoma, Arial, Calibri, Geneva, sans-serif; font-size: 13px; ">可以用这个命令来patch</span></div><div><span style="color: rgb(51, 51, 51); font-family: Verdana, Tahoma, Arial, Calibri, Geneva, sans-serif; font-size: 13px; "><span style="color: rgb(0, 49, 80); font-family: 'Bitstream Vera Sans', Verdana, Helvetica; line-height: 17px; ">patch -i xx.patch --verbose --binary</span></span></div></div><img src ="http://www.shnenglu.com/ngaut/aggbug/124891.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ngaut/" target="_blank">ngaut</a> 2010-08-26 22:24 <a href="http://www.shnenglu.com/ngaut/archive/2010/08/26/124891.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>一些经典的学习(fn)资源http://www.shnenglu.com/ngaut/archive/2010/01/19/105992.htmlngautngautTue, 19 Jan 2010 02:12:00 GMThttp://www.shnenglu.com/ngaut/archive/2010/01/19/105992.htmlhttp://www.shnenglu.com/ngaut/comments/105992.htmlhttp://www.shnenglu.com/ngaut/archive/2010/01/19/105992.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/105992.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/105992.htmlhttps://www.wiki-os.org/  开源siverlight webos



36个引人注目的D菜单
http://news.cnblogs.com/n/47133/


让图??h
http://www.cnblogs.com/gudao119/archive/2010/01/18/1650935.html


|站D设计势案例集合
http://news.cnblogs.com/n/55187/


ngaut 2010-01-19 10:12 发表评论
]]>
[转]交友C֌|站架构_Z么要用非关系数据库?http://www.shnenglu.com/ngaut/archive/2009/12/29/104390.htmlngautngautTue, 29 Dec 2009 10:14:00 GMThttp://www.shnenglu.com/ngaut/archive/2009/12/29/104390.htmlhttp://www.shnenglu.com/ngaut/comments/104390.htmlhttp://www.shnenglu.com/ngaut/archive/2009/12/29/104390.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/104390.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/104390.html随着互联|web2.0|站的兴P非关pd的数据库现在成了一个极其热门的新领域,非关pL据库产品的发展非常迅速。而传l的关系数据库在应付web2.0|站Q特别是大规模和高q发的SNScd的web2.0U动态网站已l显得力不从心,暴露了很多难以克服的问题Q例如:(x) 

1、High performance - Ҏ(gu)据库高ƈ发读写的需?/span> 
web2.0 |站要根据用户个性化信息来实时生成动态页面和提供动态信息,所以基本上无法使用动态页面静态化技术,因此数据库ƈ发负载非帔RQ往往要达到每U上万次?写请求。关pL据库应付上万ơSQL查询q勉强顶得住Q但是应付上万次SQL写数据请求,盘I(y)O已l无法承受了。其实对于普通的BBS|站Q往往也存 在对高ƈ发写h的需求,例如像JavaEye|站的实时统计在U用L(fng)态,记录热门帖子的点?yn)L敎ͼ投票计数{,因此q是一个相当普遍的需求?nbsp;

2、Huge Storage - Ҏ(gu)v量数据的高效率存储和讉K的需?/span> 
c?似FacebookQtwitterQFriendfeedq样的SNS|站Q每天用户生v量的用户动态,以FriendfeedZQ一个月pC 2.5亿条用户动态,对于关系数据库来_(d)在一?.5亿条记录的表里面q行SQL查询Q效率是极其低下乃至不可忍受的。再例如大型web|站的用L(fng)?pȝQ例如腾讯,盛大Q动辄数以亿计的帐号Q关pL据库也很隑ֺ付?nbsp;

3、High Scalability && High Availability- Ҏ(gu)据库的高可扩展性和高可用性的需?/span> 
?Zweb的架构当中,数据库是最难进行横向扩展的Q当一个应用系l的用户量和讉K量与日俱增的时候,你的数据库却没有办法像web server和app server那样单的通过d更多的硬件和服务节点来扩展性能和负载能力。对于很多需要提?4时不间断服务的|站来说Q对数据库系l进行升U和扩展 是非常痛苦的事情Q往往需要停机维护和数据q移Qؓ(f)什么数据库不能通过不断的添加服务器节点来实现扩展呢Q?nbsp;

在上面提到的“三高”需求面前,关系数据库遇C难以克服的障,而对于web2.0|站来说Q关pL据库的很多主要特性却往往无用武之圎ͼ例如Q?nbsp;

1、数据库事务一致性需?/span> 
很多web实时pȝq不要求严格的数据库事务Q对M致性的要求很低Q有些场合对写一致性要求也不高。因此数据库事务理成了数据库高负蝲下一个沉重的负担?nbsp;

2、数据库的写实时性和d时性需?/span> 
对关pL据库来说Q插入一条数据后立刻查询Q是肯定可以d来这条数据的Q但是对于很多web应用来说Qƈ不要求这么高的实时性,比方说我QJavaEye的robbinQ发一条消息之后,q几U乃臛_几秒之后Q我的订阅者才看到q条动态是完全可以接受的?nbsp;

3、对复杂的SQL查询Q特别是多表兌查询的需?/span> 
?何大数据量的webpȝQ都非常忌讳多个大表的关联查询,以及复杂的数据分析类型的复杂SQL报表查询Q特别是SNScd的网站,从需求以及品设计角 度,避免了q种情况的生。往往更多的只是单表的主键查询Q以及单表的单条件分|询,SQL的功能被极大的弱化了?nbsp;

因此Q关pL据库在这些越来越多的应用场景下显得不那么合适了Qؓ(f)了解册c问题的非关pL据库应运而生Q现在这两年Q各U各样非关系数据库,特别是键值数据库(Key-Value Store DB)风v云涌Q多得让人眼q݋乱。前不久国外刚刚丑֊?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); ">NoSQL ConferenceQ各路NoSQL数据库纷U亮相,加上未亮怽是名声在外的Qv码有过10个开源的NoSQLDBQ例如:(x) 

RedisQTokyo CabinetQCassandraQVoldemortQMongoDBQDynomiteQHBaseQCouchDBQHypertableQ?RiakQTinQ?FlareQ?LightcloudQ?KiokuDBQScalarisQ?KaiQ?ThruDBQ?nbsp; ...... 

q些NoSQL数据库,有的是用C/C++~写的,有的是用Java~写的,q有的是用Erlang~写的,每个都有自己的独C处,看都看不q来了,也只能从中挑选一些比较有特色Q看h更有前景的品学?fn)和了解一下。这些NoSQL数据库大致可以分Z下的三类Q?nbsp;

一、满x高读写性能需求的Kye-Value数据库:(x)RedisQTokyo CabinetQ?Flare 

高性能Key-Value数据库的主要特点是h极高的ƈ发读写性能QRedisQTokyo CabinetQ?FlareQ这3个Key-Value DB都是用C~写的,他们的性能都相当出Ԍ但出了出色的性能Q他们还有自q特的功能Q?nbsp;

1?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); ">Redis 
Redis 是一个很新的目Q刚刚发布了1.0版本。Redis本质上是一个Key-Valuecd的内存数据库Q很像memcachedQ整个数据库l统加蝲在内 存当中进行操作,定期通过异步操作把数据库数据flush到硬盘上q行保存。因为是U内存操作,Redis的性能非常Q每U可以处理超q?0万次d 操作Q是我知道的性能最快的Key-Value DB?nbsp;

Redis的出色之处不仅仅是性能QRedis最大的力是支持保存List 链表和Set集合的数据结构,而且q支持对Listq行各种操作Q例如从List两端push和pop数据Q取List区间Q排序等{,对Set支持各种 集合的ƈ集交集操作,此外单个value的最大限制是1GBQ不像memcached只能保存1MB的数据,因此Redis可以用来实现很多有用的功能, 比方说用他的List来做FIFO双向链表Q实C个轻量的高性能消息队列服务Q用他的Set可以做高性能的tagpȝ{等。另外Redis也可以对?入的Key-Value讄expire旉Q因此也可以被当作一个功能加强版的memcached来用?nbsp;

Redis的主要缺Ҏ(gu)?据库定w受到物理内存的限Ӟ不能用作量数据的高性能dQƈ且它没有原生的可扩展机制Q不hscaleQ可扩展Q能力,要依赖客L(fng)来实现分布式?写,因此Redis适合的场景主要局限在较小数据量的高性能操作和运上。目前用Redis的网站有githubQEngine Yard?nbsp;

2?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); ">Tokyo Cabinet和Tokoy Tyrant 
TC 和TT的开发者是日本人Mikio HirabayashiQ主要被用在日本最大的SNS|站mixi.jp上,TC发展的时间最早,现在已经是一个非常成熟的目Q也是Kye-Value 数据库领域最大的热点Q现在被q泛的应用在很多很多|站上。TC是一个高性能的存储引擎,而TT提供了多U程高ƈ发服务器Q性能也非常出Ԍ每秒可以处理 4-5万次d操作?nbsp;

TC除了支持Key-Value存储之外Q还支持保存Hashtable数据cdQ因此很像一个简单的数据?表,q且q支持基于column的条件查询,分页查询和排序功能,基本上相当于支持单表的基查询功能了,所以可以简单的替代关系数据库的很多操作Q这?是TC受到大家Ƣ迎的主要原因之一Q有一个Ruby的项?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); ">miyazakiresistanceTT的hashtable的操作封装成和ActiveRecord一L(fng)操作Q用h非常爽?nbsp;

TC/TT 在mixi的实际应用当中,存储?000万条以上的数据,同时支撑了上万个q发q接Q是一个久l考验的项目。TC在保证了极高的ƈ发读写性能的同Ӟ?有可靠的数据持久化机Ӟ同时q支持类似关pL据库表结构的hashtable以及单的条gQ分和排序操作Q是一个很的NoSQL数据库?nbsp;

TC 主要的缺Ҏ(gu)没有scale的能力,如果单机无法满要求Q只能通过M复制的方式扩展,另外有h提到TC的性能?x)随着数据量的增加而下降,当数据量上亿 条以后,性能?x)有比较明显的下降。我QrobbinQ没有做q这样大数据量的试Q姑且存疑吧Q我QrobbinQ准备有I的时候自己测试一下?nbsp;

q个是Tim Yang做的一?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); ">MemcachedQRedis和Tokyo Tyrant的简单的性能评测Q仅供参?/a> 

3?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); ">Flare 
TC 是日本第一大SNS|站mixi开发的Q而Flare是日本第二大SNS|站green.jp开发的Q有意思吧。Flare单的说就是给TCd?scale功能。他替换掉了TT部分Q自己另外给TC写了|络服务器,Flare的主要特点就是支持scale能力Q他在网l服务端之前d了一?node serverQ来理后端的多个服务器节点Q因此可以动态添加数据库服务节点Q删除服务器节点Q也支持failover。如果你的用场景必要让TC?以scaleQ那么可以考虑flare?nbsp;

flare唯一的缺点就是他只支持memcached协议Q因此当你用flare的时候,׃能用TC的table数据l构了,只能使用TC的key-value数据l构存储?nbsp;

二、满xv量存储需求和讉K的面向文档的数据库:(x)MongoDBQCouchDB 

面向文档的非关系数据库主要解决的问题不是高性能的ƈ发读写,而是保证量数据存储的同Ӟh良好的查询性能。MongoDB是用C++开发的Q而CouchDB则是Erlang开发的Q?nbsp;

1?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); ">MongoDB 
MongoDB 是一个介于关pL据库和非关系数据库之间的产品Q是非关pL据库当中功能最丰富Q最像关pL据库的。他支持的数据结构非常松散,是类似json?bjson格式Q因此可以存储比较复杂的数据cd。Mongo最大的特点是他支持的查询语a非常强大Q其语法有点cM于面向对象的查询语言Q几乎可以实?cM关系数据库单表查询的l大部分功能Q而且q支持对数据建立索引?nbsp;

Mongo主要解决的是量数据的访问效率问题,Ҏ(gu)官方的文 档,当数据量辑ֈ50GB以上的时候,Mongo的数据库讉K速度是MySQL?0倍以上。Mongo的ƈ发读写效率不是特别出ԌҎ(gu)官方提供的性能 试表明Q大U每U可以处?.5万-1.5ơ读写请求。对于Mongo的ƈ发读写性能Q我QrobbinQ也打算有空的时候好好测试一下?nbsp;

因ؓ(f)Mongo主要是支持v量数据存储的Q所以Mongoq自带了一个出色的分布式文件系lGridFSQ可以支持v量的数据存储Q但我也看到有些评论认ؓ(f)GridFS性能不佳Q这一点还是有待亲自做Ҏ(gu)试来验证了?nbsp;

最后由于Mongo可以支持复杂的数据结构,而且带有强大的数据查询功能,因此非常受到Ƣ迎Q很多项目都考虑用MongoDB来替代MySQL来实C是特别复杂的Web应用Q比方说why we migrated from MySQL to MongoDB是一个真实的从MySQLq移到MongoDB的案例,׃数据量实在太大,所以迁Ud了Mongo上面Q数据查询的速度得到了非常显著的提升?nbsp;

MongoDB也有一个ruby的项?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); ">MongoMapperQ是模仿Merb的DataMapper~写的MongoDB的接口,使用h非常单,几乎和DataMapper一模一P功能非常强大易用?nbsp;

2、CouchDB 
CouchDB 现在是一个非常有名气的项目,g不用多介l了。但是我却对CouchDB没有什么兴,主要是因为CouchDB仅仅提供了基于HTTP REST的接口,因此CouchDB单纯从ƈ发读写性能来说Q是非常p糕的,q让我立L弃了对CouchDB的兴?nbsp;

三、满高可扩展性和可用性的面向分布式计的数据库:(x)CassandraQVoldemort 

?向scale能力的数据库其实主要解决的问题领域和上述两类数据库还不太一P它首先必L一个分布式的数据库pȝQ由分布在不同节点上面的数据库共同构 成一个数据库服务pȝQƈ且根据这U分布式架构来提供online的,hҎ(gu)的可扩展能力,例如可以不停机的d更多数据节点Q删除数据节点等{。因?像Cassandra常常被看成是一个开源版本的Google BigTable的替代品。Cassandra和Voldemort都是用Java开发的Q?nbsp;

1?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); ">Cassandra 
Cassandra 目是Facebook?008q开源出来的Q随后Facebook自己使用Cassandra的另外一个不开源的分支Q而开源出来的 Cassandra主要被Amazon的Dynamite团队来维护,q且Cassandra被认为是Dynamite2.0版本。目前除?Facebook之外Qtwitter和digg.com都在使用Cassandra?nbsp;

Cassandra的主要特点就是它不是一?数据库,而是׃堆数据库节点共同构成的一个分布式|络服务Q对Cassandra的一个写操作Q会(x)被复制到其他节点上去Q对Cassandra的读?作,也会(x)被\由到某个节点上面去读取。对于一个Cassandra集来说Q扩展性能是比较简单的事情Q只在集里面d节点可以了。我看到有文章说 Facebook的Cassandra集有超q?00台服务器构成的数据库集?nbsp;

Cassandra也支持比较丰富的数据l构和功能强大的查询语言Q和MongoDB比较cMQ查询功能比MongoDBE弱一些,twitter的^台架构部门领导Evan Weaver写了一文章介lCassandraQ?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); ">http://blog.evanweaver.com/articles/2009/07/06/up-and-running-with-cassandra/Q有非常详细的介l?nbsp;

Cassandra 以单个节Ҏ(gu)衡量Q其节点的ƈ发读写性能不是特别好,有文章说评测下来Cassandra每秒大约不到1万次dhQ我也看C些对q个问题q行质疑?评论Q但是评价Cassandra单个节点的性能是没有意义的Q真实的分布式数据库讉Kpȝ必然是n多个节点构成的系l,其ƈ发性能取决于整个系l的节点 数量Q\由效率,而不仅仅是单节点的ƈ发负载能力?nbsp;

2?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51); ">Voldemort 
Voldemort 是个和CassandracM的面向解决scale问题的分布式数据库系l,Cassandra来自于Facebookq个SNS|站Q?Voldemort则来自于Linkedinq个SNS|站。说hSNS|站为我们A(ch)献了n多的NoSQL数据库,例如 CassandarQVoldemortQTokyo CabinetQFlare{等。Voldemort的资料不是很多,因此我没有特别仔l去ȝQVoldemort官方l出Voldemort的ƈ发读 写性能也很不错Q每U超q了1.5万次d?nbsp;

从Facebook开发CassandraQLinkedin开发VoldemortQ?我们也可以大致看出国外大型SNS|站对于分布式数据库Q特别是Ҏ(gu)据库的scale能力斚w的需求是多么D切。前面我QrobbinQ提刎ͼweb应用 的架构当中,web层和app层相Ҏ(gu)说都很容易横向扩展,唯有数据库是单点的,极难scaleQ现在Facebook和Linkedin在非关系型数?库的分布式方面探索了一条很好的方向Q这也是Z么现在Cassandraq么热门的主要原因?nbsp;

如今QNoSQL数据库是个o(h)人很?奋的领域QL不断有新的技术新的品冒出来Q改变我们已lŞ成的固有的技术观念,我自己(robbinQ稍微了解了一些,感觉自己深q沉迷q去了, 可以说NoSQL数据库领域也是博大精qQ我QrobbinQ也只能尝辄止Q我QrobbinQ写q篇文章既是自己一点点ȝ心得Q也是抛砖引玉,?望吸引对q个领域有经验的朋友来讨论和交流?nbsp;

从我QrobbinQ个人的兴趣来说Q分布式数据库系l不是我能实际用到的技术,因此?打算花时间深入,而其他两个数据领域(高性能NoSQLDB和v量存储NoSQLDBQ都是我很感兴趣的,特别是RedisQTT/TC和MongoDB q?个NoSQL数据库,因此我接下来写三篇文章分别详细介绍q?个数据库?/p>

转蝲自http://robbin.javaeye.com/blog/524977 



ngaut 2009-12-29 18:14 发表评论
]]>
bitvisor用法http://www.shnenglu.com/ngaut/archive/2009/12/07/102727.htmlngautngautMon, 07 Dec 2009 08:34:00 GMThttp://www.shnenglu.com/ngaut/archive/2009/12/07/102727.htmlhttp://www.shnenglu.com/ngaut/comments/102727.htmlhttp://www.shnenglu.com/ngaut/archive/2009/12/07/102727.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/102727.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/102727.htmlbitvisor用法

# tar xvfj bitvisor-0.2.tar.bz
# cd bitvisor-0.2
# make

# cp bitvisor.elf /boot/

title BitVisor
root (hd0,0)
kernel /boot/bitvisor.elf

重启选择BitVisor启动?/div>

ngaut 2009-12-07 16:34 发表评论
]]>sql server msde 的安装说?/title><link>http://www.shnenglu.com/ngaut/archive/2009/11/01/99924.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Sat, 31 Oct 2009 16:50:00 GMT</pubDate><guid>http://www.shnenglu.com/ngaut/archive/2009/11/01/99924.html</guid><wfw:comment>http://www.shnenglu.com/ngaut/comments/99924.html</wfw:comment><comments>http://www.shnenglu.com/ngaut/archive/2009/11/01/99924.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ngaut/comments/commentRss/99924.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ngaut/services/trackbacks/99924.html</trackback:ping><description><![CDATA[<div>MS SQL 中的MSDE的SETUP.INI檔說?/div><div>SETUP.INI中的內容如下Q?/div><div><br></div><div>[Options]</div><div>SAPWD="q12we34r" SA的密?/div><div>DISABLENETWORKPROTOCOLS=0 是束關閉E絡聯接Q否</div><div>SECURITYMODE=SQL SQL模式</div><div>;UPGRADE=1 是否是升?/div><div><br></div><div><br></div><div>1、MSDE的默认安装未加蝲TCPIPQ要的话需要写一下setup.iniQ加上下?nbsp;</div><div>[Options] </div><div>DISABLENETWORKPROTOCOLS=0 </div><div><br></div><div>2、默认实例名(同机器名)不可用,可能与上ơ安装后卸蝲不完整有兟뀂比较简单的处理Ҏ(gu)是在setup.ini中另指定一个实例名Q只要和机器名不一样就?nbsp;</div><div>[Options] </div><div>INSTANCENAME=server123 </div><div><br></div><div>如果(zhn)的机器上没有安装MS SQLServer数据库,(zhn)可以选择下蝲微YMSDElgq行安装Q该安装包是微Y发布的YӞ|上随处可以扑ֈQ下载后默认q行安装卛_Q注意:(x)MSDE安装后,必须重启机器Q才能l下面的安装。下面提供一个参考下载地址Qhttp://download.microsoft.com/download/4/5/1/451d5d5c-69d4-40d5-b85d-f1d756cf46db/CHS_MSDE2000A.exeQ如果安装MSDE出现“Z安全赯Q要求用强SA密码。请使用SAPWD开x供同一密码?#8221;的提C,h到msde安装目录下的setup.iniQ打开修改成下面这个样?/div><div>[Options]</div><div>SECURITYMODE=SQL</div><div>SAPWD=123456</div><div><br></div><div>其中SAPWD后的"123456"是你的sa的密码。(你也可以Ҏ(gu)你自qQ?/div><div><br></div><div>q几天在忙着l一个程序打?需要将MSDE打包,遇到一些问?现ȝ如下,我比较懒,大概写一些吧.</div><div>1.MSDE的安?</div><div>MSDE如果默认安装的话,实例名和机器名是一致的,同时pȝ的SA密码?x)被讄为?如果要对其做一些修?可以通过修改目录下的SETUP.INI文g来实?其中主要涉及以下几项:</div><div>[Options]</div><div>SECURITYMODE=SQL      //登陆方式,SQL表示SQL登陆</div><div>INSTANCENAME=singlewks      //实例?/div><div>DISABLENETWORKPROTOCOLS=1    //|络可访问?0表示|络用户可访?1表示不可?/div><div>DATADIR="c:\singlewks\Data"     //数据文g存放位置</div><div>SAPWD=your_pwd     //SA密码</div><div><br></div><div>2.对MSDE的管?</div><div>׃MSDE没有SQL SERVER 2000 那样的管理界?所以对于它的管理也比较麻?不过我们可以通过OSQL工具对其q行理.具体的操?大家可以参考网上的一文?转自msdn  hl13571 ?Blog :http://hl13571.cnblogs.com/archive/2006/02/07/326362.html</div><div>例如:</div><div>osql -U sa -S enjoyai\lotto -Q "sp_password NULL,123,sa"</div><div><br></div><div>表示用sad, d到实例enjoyai\lotto,执行命o(h) sp_password NULL,123,sa</div> <img src ="http://www.shnenglu.com/ngaut/aggbug/99924.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ngaut/" target="_blank">ngaut</a> 2009-11-01 00:50 <a href="http://www.shnenglu.com/ngaut/archive/2009/11/01/99924.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]How to configure SQL Server 2005 to allow remote connectionshttp://www.shnenglu.com/ngaut/archive/2009/10/30/99852.htmlngautngautFri, 30 Oct 2009 11:17:00 GMThttp://www.shnenglu.com/ngaut/archive/2009/10/30/99852.htmlhttp://www.shnenglu.com/ngaut/comments/99852.htmlhttp://www.shnenglu.com/ngaut/archive/2009/10/30/99852.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/99852.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/99852.htmlhttp://support.microsoft.com/default.aspx?scid=kb;EN-US;914277

When you try to connect to an instance of Microsoft SQL Server 2005 from a remote computer, you may receive an error message. This problem may occur when you use any program to connect to SQL Server. For example, you receive the following error message when you use the SQLCMD utility to connect to SQL Server:
Sqlcmd: Error: Microsoft SQL Native Client: An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
This problem may occur when SQL Server 2005 is not configured to accept remote connections. By default, SQL Server 2005 Express Edition and SQL Server 2005 Developer Edition do not allow remote connections. To configure SQL Server 2005 to allow remote connections, complete all the following steps:
  • Enable remote connections on the instance of SQL Server that you want to connect to from a remote computer.
  • Turn on the SQL Server Browser service.
  • Configure the firewall to allow network traffic that is related to SQL Server and to the SQL Server Browser service.
This article describes how to complete each of these steps.

MORE INFORMATION

To enable remote connections on the instance of SQL Server 2005 and to turn on the SQL Server Browser service, use the SQL Server 2005 Surface Area Configuration tool. The Surface Area Configuration tool is installed when you install SQL Server 2005.

Enable remote connections for SQL Server 2005 Express or SQL Server 2005 Developer Edition

You must enable remote connections for each instance of SQL Server 2005 that you want to connect to from a remote computer. To do this, follow these steps:
  1. Click Start, point to Programs, point to Microsoft SQL Server 2005, point toConfiguration Tools, and then click SQL Server Surface Area Configuration.
  2. On the SQL Server 2005 Surface Area Configuration page, click Surface Area Configuration for Services and Connections.
  3. On the Surface Area Configuration for Services and Connections page, expandDatabase Engine, click Remote Connections, click Local and remote connections, click the appropriate protocol to enable for your environment, and then click Apply

    Note Click OK when you receive the following message:
    Changes to Connection Settings will not take effect until you restart the Database Engine service.
  4. On the Surface Area Configuration for Services and Connections page, expandDatabase Engine, click Service, click Stop, wait until the MSSQLSERVER service stops, and then click Start to restart the MSSQLSERVER service.

Enable the SQL Server Browser service

If you are running SQL Server 2005 by using an instance name and you are not using a specific TCP/IP port number in your connection string, you must enable the SQL Server Browser service to allow for remote connections. For example, SQL Server 2005 Express is installed with a default instance name of Computer Name\SQLEXPRESS. You are only required to enable the SQL Server Browser service one time, regardless of how many instances of SQL Server 2005 you are running. To enable the SQL Server Browser service, follow these steps.

Important These steps may increase your security risk. These steps may also make your computer or your network more vulnerable to attack by malicious users or by malicious software such as viruses. We recommend the process that this article describes to enable programs to operate as they are designed to, or to implement specific program capabilities. Before you make these changes, we recommend that you evaluate the risks that are associated with implementing this process in your particular environment. If you choose to implement this process, take any appropriate additional steps to help protect your system. We recommend that you use this process only if you really require this process.
  1. Click Start, point to Programs, point to Microsoft SQL Server 2005, point toConfiguration Tools, and then click SQL Server Surface Area Configuration.
  2. On the SQL Server 2005 Surface Area Configuration page, click Surface Area Configuration for Services and Connections.
  3. On the Surface Area Configuration for Services and Connections page, click SQL Server Browser, click Automatic for Startup type, and then click Apply

    Note When you click the Automatic option, the SQL Server Browser service starts automatically every time that you start Microsoft Windows.
  4. Click Start, and then click OK.
Note When you run the SQL Server Browser service on a computer, the computer displays the instance names and the connection information for each instance of SQL Server that is running on the computer. This risk can be reduced by not enabling the SQL Server Browser service and by connecting to the instance of SQL Server directly through an assigned TCP port. Connecting directly to an instance of SQL Server through a TCP port is beyond the scope of this article. For more information about the SQL Server Browser server and connecting to an instance of SQL Server, see the following topics in SQL Server Books Online:
  • SQL Server Browser Service
  • Connecting to the SQL Server Database Engine
  • Client Network Configuration

Create exceptions in Windows Firewall

These steps apply to the version of Windows Firewall that is included in Windows XP Service Pack 2 (SP2) and in Windows Server 2003. If you are using a different firewall system, see your firewall documentation for more information. 

If you are running a firewall on the computer that is running SQL Server 2005, external connections to SQL Server 2005 will be blocked unless SQL Server 2005 and the SQL Server Browser service can communicate through the firewall. You must create an exception for each instance of SQL Server 2005 that you want to accept remote connections and an exception for the SQL Server Browser service.

SQL Server 2005 uses an instance ID as part of the path when you install its program files. To create an exception for each instance of SQL Server, you must identify the correct instance ID. To obtain an instance ID, follow these steps:
  1. Click Start, point to Programs, point to Microsoft SQL Server 2005, point toConfiguration Tools, and then click SQL Server Configuration Manager.
  2. In SQL Server Configuration Manager, click the SQL Server Browser service in the right pane, right-click the instance name in the main window, and then click Properties.
  3. On the SQL Server Browser Properties page, click the Advanced tab, locate the instance ID in the property list, and then click OK.
To open Windows Firewall, click Start, click Run, type firewall.cpl, and then click OK.

Create an exception for SQL Server 2005 in Windows Firewall

To create an exception for SQL Server 2005 in Windows Firewall, follow these steps:
  1. In Windows Firewall, click the Exceptions tab, and then click Add Program.
  2. In the Add a Program window, click Browse.
  3. Click the C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe executable program, click Open, and then click OK

    Note The path may be different depending on where SQL Server 2005 is installed.MSSQL.1 is a placeholder for the instance ID that you obtained in step 3 of the previous procedure.
  4. Repeat steps 1 through 3 for each instance of SQL Server 2005 that needs an exception.

Create an exception for the SQL Server Browser service in Windows Firewall

To create an exception for the SQL Server Browser service in Windows Firewall, follow these steps:
  1. In Windows Firewall, click the Exceptions tab, and then click Add Program.
  2. In the Add a Program window, click Browse.
  3. Click the C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe executable program, click Open, and then click OK

    Note The path may be different depending on where SQL Server 2005 is installed.


ngaut 2009-10-30 19:17 发表评论
]]>
[转]化学n的计机达hhttp://www.shnenglu.com/ngaut/archive/2009/09/10/95859.htmlngautngautThu, 10 Sep 2009 14:29:00 GMThttp://www.shnenglu.com/ngaut/archive/2009/09/10/95859.htmlhttp://www.shnenglu.com/ngaut/comments/95859.htmlhttp://www.shnenglu.com/ngaut/archive/2009/09/10/95859.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/95859.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/95859.html来自: http://blog.linjian.org/articles/chemistry-computer/

 昨天?nbsp;Beijing Open Party 上,我听?a style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, Helvetica, sans-serif; color: rgb(0, 84, 179); text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; ">D늂同学介绍 GWT 的主题。上个月认识他时Q我q误以ؓ(f)他是北理工新M心专职摄qD늂老师Q但他的真实w䆾却是华东理工大学制药工程专业的学生,计算机只是其“业余爱好”。段炼的 ID“chemhack”不禁让我猜想他是不是有像刘未?/a>?#8220;mindhacks”那样的风范。听了他的演讌Ӏ看了他?blogQ发C实是一个有 hack _的h?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, Helvetica, sans-serif; ">  q是我认识的又一位从事化学相关领域的计算机高手。本U玩计算机博?/a>Ӟ我认识了复旦大学化学pL业的黄晨Q他?a style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, Helvetica, sans-serif; color: rgb(0, 84, 179); text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; ">象棋癄全书|站和象巫师Y?/a>的作者,UCCI 协议的制定者。后来参?a style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, Helvetica, sans-serif; color: rgb(0, 84, 179); text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; ">中国机器博弈锦标?/a>Ӟ我又有幸见到了中国电(sh)脑围的先行者、中山大学化学系退休的陈志行教?/a>Q陈老先生已?2008 q不q病故)。他研制的《手谈》Y件曾多次在国际赛事中夺冠Q商业版本也畅销于日本等国。在我决定读研之前,曾想了解一下科研生z,师兄推荐l我的是名曰“学术U研W一?#8221;Q实为化学相关专业主导的木虫论?/a>Q这个论坛也让我收益不少。在中科院研I生院集中教学期_(d)我又在计机专业的课堂上认识了多位外专业的同学,他们有冶金化学的、化工自动化的、过E工E的Q选择计算机类评或出于实验室工作的需要,或出于个人兴?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, Helvetica, sans-serif; ">  Z么会(x)有这么多化学相关专业的朋友涉了计算机领域呢Q个人兴之外,或许最主要的因素是化学的很多研I要以计算Z为v量数据采集、存储、分析、处理的工具。化学领域作为数据库、数据挖掘、网D等技术的重要应用Q受益于计算机技术的发展Q同时也寚w过其复杂的需求引导着计算基础设施及算法的改进与发展。如?a style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, Helvetica, sans-serif; color: rgb(0, 84, 179); text-decoration: none; outline-style: none; outline-width: initial; outline-color: initial; ">化学信息?/a>的引入就是要用计机来解军_学信息存储与索的子问题。但除了q些技术上的因素,计算机和化学有没有本质上的相通呢Q计机是公认的人造科学、技术科学,而化学一般被认ؓ(f)是自然科学,管它也包含了一些技术科学和工程技术领域的分支。但我的初中、高中化学老师都给我灌输过q种思想Q化学只是一pd模型Q方便描q自然现象的Q有些概念ƈ不反映真实的存在Q还说中学化学讲的都是早期的l典模型Qؓ(f)了解释新的现象,模型d不断修补。我的大学同学,爱好?sh)子、物理与计算机的 m100 则直接认?#8220;化学是骗人的”。但我想Q无论化学家们的U学信Ԓ和主观意愿如何,化学和计机U学在客观呈C有两Ҏ(gu)共通的Q一是抽象徏模,二是实用M。计机中只有线性的指o(h)和数据,Z用结构化~程语言和文件系l的抽象它们变得易于理解和使用Q同样化学元素也不是什么微观物质,但化学家可以用这一抽象来表C特定原子组成,构徏宏观世界到微观世界的桥梁Q便于统一研究物质的性质。这U方法论上的怼或许是化学专业的朋友们乐于钻研计机的原因之一?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: Arial, Helvetica, sans-serif; ">  学术的火花往往都是在交叉领域中q发的,黄晨的《电(sh)脑象和量子化学——计量子化学的新思\》(黄晨|站原文无法扑ֈQ请?nbsp;google 到的转蝲l果Q就是一例有益的探烦。做计算机的人,不要ȝ个别外专业h员写的蹩脚的代码Q也不要不屑于們֐外行对计机技术看似幼E的见解。内行最Ҏ(gu)犯的毛病是被既有知识的“框框”限制住,多看看外行在本领域的工作Q听听他们大胆的思\Q也许就能ؓ(f)自己的科研创新另辟蹊径?/p>




ngaut 2009-09-10 22:29 发表评论
]]>
DBEntry.net使用sqlite的配|?/title><link>http://www.shnenglu.com/ngaut/archive/2009/08/19/93793.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Wed, 19 Aug 2009 02:53:00 GMT</pubDate><guid>http://www.shnenglu.com/ngaut/archive/2009/08/19/93793.html</guid><wfw:comment>http://www.shnenglu.com/ngaut/comments/93793.html</wfw:comment><comments>http://www.shnenglu.com/ngaut/archive/2009/08/19/93793.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ngaut/comments/commentRss/93793.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ngaut/services/trackbacks/93793.html</trackback:ping><description><![CDATA[<div style="background-color: rgb(238, 238, 238); font-size: 13px; border-left-color: rgb(204, 204, 204); padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; "><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #000000; ">  </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">Lephone</span><span style="color: #FF0000; ">.Settings</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br>        </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">add </span><span style="color: #FF0000; ">key</span><span style="color: #0000FF; ">="AutoCreateTable"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="true"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><span style="color: #000000; "><br>      </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">add </span><span style="color: #FF0000; ">key</span><span style="color: #0000FF; ">="DataBase"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="@SQLite : @~Test.db"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><span style="color: #000000; "><br>      </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">add </span><span style="color: #FF0000; ">key</span><span style="color: #0000FF; ">="DbProviderFactory"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.65.0"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><span style="color: #000000; "><br>  </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">Lephone.Settings</span><span style="color: #0000FF; ">></span></div> <img src ="http://www.shnenglu.com/ngaut/aggbug/93793.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ngaut/" target="_blank">ngaut</a> 2009-08-19 10:53 <a href="http://www.shnenglu.com/ngaut/archive/2009/08/19/93793.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>DbEntry.net 对事务的处理http://www.shnenglu.com/ngaut/archive/2009/04/05/78990.htmlngautngautSun, 05 Apr 2009 01:37:00 GMThttp://www.shnenglu.com/ngaut/archive/2009/04/05/78990.htmlhttp://www.shnenglu.com/ngaut/comments/78990.htmlhttp://www.shnenglu.com/ngaut/archive/2009/04/05/78990.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/78990.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/78990.html        {
            if (Scope<ConnectionContext>.Current != null)
            {
                ConnectionContext et = Scope<ConnectionContext>.Current;
                if (et.IsolationLevel == il)
                {
                    callback();
                    return;
                }
            }
            NewTransaction(callback);
        }

        public void NewTransaction(CallbackVoidHandler callback)
        {
            NewTransaction(IsolationLevel.ReadCommitted, callback);
        }

        public void NewTransaction(IsolationLevel il, CallbackVoidHandler callback)
        {
            NewConnection(delegate
            {
                ConnectionContext cc = ConProvider;
                cc.BeginTransaction(il);
                try
                {
                    OnBeginTransaction();
                    callback();
                    cc.Commit();
                    OnCommittedTransaction();
                }
                catch
                {
                    try
                    {
                        cc.Rollback();
                    }
                    finally
                    {
                        OnTransactionError();
                    }
                    throw;
                }
            });
        }


ngaut 2009-04-05 09:37 发表评论
]]>
etherboot ~译 来自 http://markmail.org/message/h4eyrkv5bfd5yila#query:Etherboot%20gcc%204.3+page:1+mid:h4eyrkv5bfd5yila+state:resultshttp://www.shnenglu.com/ngaut/archive/2009/02/04/73027.htmlngautngautWed, 04 Feb 2009 15:42:00 GMThttp://www.shnenglu.com/ngaut/archive/2009/02/04/73027.htmlhttp://www.shnenglu.com/ngaut/comments/73027.htmlhttp://www.shnenglu.com/ngaut/archive/2009/02/04/73027.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/73027.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/73027.html Subject: [Etherboot-developers] [PATCH] move RM_FRAGMENT to the beginning of undi.c Actions... From: Glauber Costa (glom@redhat.com) Date: Oct 14, 2008 9:17:11 am List: net.sourceforge.lists.etherboot-developers

I'm currently facing a compile problem with gcc 4.3.0 at undi.c Looking at the generated code, it seems gcc is inlining _undi_call into _undi_call_silent, thus making rm_undi_call be defined twice.

Using gcc option -fno-inline also fixes this, but then the compiler won't do any kind of inlining, even "good" ones, so this fix seem to do the right
thing.

Signed-off-by: Glauber Costa <glom@redhat.com>

--- src/arch/i386/drivers/net/undi.c | 27 ++++++++++++++------------- 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/src/arch/i386/drivers/net/undi.c b/src/arch/i386/drivers/net/undi.c index 084fc18..1ffea43 100644 --- a/src/arch/i386/drivers/net/undi.c +++ b/src/arch/i386/drivers/net/undi.c @@ -33,6 +33,19 @@ $Id$ /* E820 map mangler */ #include "hidemem.h"

+RM_FRAGMENT(rm_undi_call, + "popw %di\n\t" /* %es:di = routine */ + "popw %es\n\t" + "pushw %cs\n\t" /* set up return address */ + "call 1f\n\t1:popw %bx\n\t" + "leaw (2f-1b)(%bx), %ax\n\t" + "pushw %ax\n\t" + "pushw %es\n\t" /* routine address to stack */ + "pushw %di\n\t" + "lret\n\t" /* calculated lcall */ + "\n2:\n\t" /* continuation point */ +); + /* NIC specific static variables go here */ static undi_t undi = { .pnp_bios = NULL, @@ -403,21 +416,9 @@ static PXENV_EXIT_t _undi_call ( uint16_t routine_seg, { routine_off, routine_seg }, st0, st1, st2 };

- RM_FRAGMENT(rm_undi_call, - "popw %di\n\t" /* %es:di = routine */ - "popw %es\n\t" - "pushw %cs\n\t" /* set up return address */ - "call 1f\n\t1:popw %bx\n\t" - "leaw (2f-1b)(%bx), %ax\n\t" - "pushw %ax\n\t" - "pushw %es\n\t" /* routine address to stack */ - "pushw %di\n\t" - "lret\n\t" /* calculated lcall */ - "\n2:\n\t" /* continuation point */ - );

/* Parameters are left on stack: set out_stack = in_stack */ - ret = real_call ( rm_undi_call, &in_stack, &in_stack ); + ret = real_call ( rm_undi_call, &in_stack, &in_stack );

/* UNDI API calls may rudely change the status of A20 and not * bother to restore it afterwards. Intel is known to be



ngaut 2009-02-04 23:42 发表评论
]]>
[转]udpcasthttp://www.shnenglu.com/ngaut/archive/2008/10/27/65265.htmlngautngautMon, 27 Oct 2008 15:39:00 GMThttp://www.shnenglu.com/ngaut/archive/2008/10/27/65265.htmlhttp://www.shnenglu.com/ngaut/comments/65265.htmlhttp://www.shnenglu.com/ngaut/archive/2008/10/27/65265.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/65265.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/65265.htmlGuofu,
Following is what I got from Alain long time ago. Hope this helps.

Thanks,
Sai

*****************************************************************
There are no format documents yet about the protocol. The protocol is
not based on an RFC, but is homegrown specifically for udpcast.

Updcast uses two UDP port numbers, 9000 and 9001.

The receiver listens on 9000 (portbase), the sender on 9001
(portbase+1)

The protocol runs as follows:

1. When the sender starts up, it broadcast a CMD_HELLO message to the
local network broadcast address

2. When the receiver starts up, or whenever it receives a CMD_HELLO
message, it sends a CMD_CONNECT_REQ address. If the CMD_CONNECT_REQ is
sent at startup, it is broadcast; else it is sent to the server's
address (as deducted from the CMD_HELLO message).

This allows the rendez-vous to be established no matter whether the
client or the server first starts up. Additionnally, the server can be
set up to periodically send its CMD_HELLO message (interesting for
asynchronous mode, see below).


3. The server replies to each CMD_CONNECT_REQ with a CMD_CONNECT_REPLY
(unicasted to the client who sent the CMD_CONNECT_REQ). The connect
reply contains the client number that the server assigned to that
client (clNr), the block size (size of packed), a bitmask of
capabilities, and the multicast address to be used for the actual data
transfer transfer.

At this stage, server and client know about each other, and are ready
to start the transfer. For convenience, the transfer may either be
started at the server, or at any participating client.

4. If transfer start is initiated by a client, it sends the server a
CMD_GO message.

5. If the transfer start is initiated by the server (or, after
reception of the CMD_GO message from a client), the server starts
transfering data by sending CMD_DATA packets. The reception of the
first CMD_DATA packet is a signal to all clients that now the
rendez-vous phase is over, and that the transfer has started.

The data is subdivided into slices, which are themselves subdivided
into stripes (only in FEC mode), which are subdivided in network
packets, which are made up of bytes.

A CMD_DATA packet contains the slice number (sliceNo), the block
number within that slice (blockNo), and the total number of bytes in
the slice, and then the data itself.

After each slice has been transmitted, lost packets are handled.

In FEC mode, lost packets are recovered by the client by using the
error correction packets included in each slice.

A CMD_FEC packet contains the number of stripes in the slice, the
slice number, the block number, and the number of bytes.


In non-FEC mode, the server asks each client to acknowledge at the end
of the slice (CMD_REQACK). The CMD_REQACK contains the identifier of
the slice to be acknowleged (sliceNo), the number of bytes in that
slice (bytes), and a retransmission counter. The clients reply to the
CMD_REQACK either with a CMD_OK (if they received everything) or with
a CMD_RETRANSMIT (if packets were missed). Both the CMD_OK and
CMD_RETRANSMIT message contain the sliceNo. The CMD_RETRANSMIT message
contains also a bitmap of the missed packets, and the retransmit id.

In response the CMD_RETRANSMIT messages, the server will retransmit
packets that have been missed by at least one client, increments the
rxmit counter and then send another CMD_REQACK. The rxmit counter is
used to discard late CMD_RETRANSMIT messages: indeed, after a round of
retransmission, CMD_RETRANSMIT messages from the previous round should
be ignored, or else the server may resend packets that have been
received in this round.

Clients may leave a transmission by sending a CMD_DISCONNECT. Sending
the CMD_DISCONNECT is important, or else the server will needlessly
wait for the acknowledgments of these clients. However, if a client
crashes without sending a CMD_DISCONNECT, the server has a timeout to
detect this situation, and continue with the other clients ("The
client #n has been dropped by the server").

When all clients have received all packets (i.e. all clients have send
a CMD_OK for that slice), the sender moves on to the next slice, until
end of file is reached. The server signals end of transfer by sending
a slice of zero bytes.

Including slice size in every packet, and number of stripes in every
FEC packet may seem redundant. However, this is needed in order to
make the protocol robust in cases of packet loss: if the number of
bytes was only in the first or in the last packet, then the loss of
that packet would make it hard to recover, because not only the data
was lost, but also the meta-data needed to reconstruct that
slice. This is especially relevant in FEC mode.

FEC mode is intended for unidirectional (asynchronous mode). In this
mode, there are no acknowledgments, and no retransmissions. This is
intended for situations where no receiver-to-sender communication is
possible, or where the latency of such a communication would be
prohibitively high, such as multicast over satellite.

The server sends (one or several) CMD_HELLO which includes the
multicast address it intends to use, and then starts with the
data. Each slice not only contains the data, but also a configurable
number of redundant "error correction" packets.

FEC mode uses an algorithm based on Vandermonde matrices to
recalculate the contents of any lost packets. The algorithm is chosen
such that all k data packets may be restored as long as the receiver
has gotten at least k packets (be it data or FEC). For example, with
k-3 data packets, and 3 FEC packets, all k data packets may be
reconstructed. K is a parameter of the algorithm, and the higher the
value for k, the more computation intensive the algorithm
is. Moreover, values of k greater than 128 are not supported. For that
reason, each slice (which may be up to 1024 packets) is subdivided in
several stripes (of at most 128 packets), which are interleaved
(i.e. first comes 1st packet of 1st stripe, than 1st packet of 2nd
stripe, ..., then 1st packet of last stripe, than 2nd packet of 1st
stripe, etc.) That way a burst loss of packets (for instance, 6
packets in a row) won't overly impact one stripe but will rather be
spread out among several. Indeed, if udp-sender has been set up to
include l redundant packets per stripe, it must be avoided at all cost
that more than l packets are lost per stripe, or otherwise the loss in
uncrecoverable.

Additional complications in the protocol arise from the fact that a
first version of the protocol used the native byte ordering from Intel
processors, rather than use the network byte order. This made udpcast
unportable to non-PC architectures. This was changed two years ago;
however in order to stay compatible with older versions, the receiver
and sender are able to detect that packets with the "wrong" byte order
have been received, and are able to correct for that: if the message
code (CMD_*) doesn't make sense in network byte order, udpcast tries
to interpret it in Intel byte order, and if that matches a known code,
the packet is byte-swapped.


Regards,

Alain


ngaut 2008-10-27 23:39 发表评论
]]>
心vmware6.0和vs2008的冲H?/title><link>http://www.shnenglu.com/ngaut/archive/2008/10/22/64683.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Wed, 22 Oct 2008 02:35:00 GMT</pubDate><guid>http://www.shnenglu.com/ngaut/archive/2008/10/22/64683.html</guid><wfw:comment>http://www.shnenglu.com/ngaut/comments/64683.html</wfw:comment><comments>http://www.shnenglu.com/ngaut/archive/2008/10/22/64683.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/ngaut/comments/commentRss/64683.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ngaut/services/trackbacks/64683.html</trackback:ping><description><![CDATA[如果安装vmware6.0后,vs2008打开工程后自动关闭,卸蝲vmware试试Q偶被这个问题小郁闷了一? <img src ="http://www.shnenglu.com/ngaut/aggbug/64683.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ngaut/" target="_blank">ngaut</a> 2008-10-22 10:35 <a href="http://www.shnenglu.com/ngaut/archive/2008/10/22/64683.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>发一个招聘脓(chung)http://www.shnenglu.com/ngaut/archive/2008/09/19/62309.htmlngautngautFri, 19 Sep 2008 14:06:00 GMThttp://www.shnenglu.com/ngaut/archive/2008/09/19/62309.htmlhttp://www.shnenglu.com/ngaut/comments/62309.htmlhttp://www.shnenglu.com/ngaut/archive/2008/09/19/62309.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/62309.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/62309.html1. 熟?zhn)汇编语言Qc/c++Q熟(zhn)?0x86体系架构Q实模式Q保护模?br>2. 良好的数据结构与法基础
3. 熟?zhn)MFC或者STL
4. 工作地点在武?br>5. 学历不限Q英语不限,人品良好Q有团队_
6. 特别优秀者,只需具备Qh品良好,有团队精?br>
有以下经验优先:(x)
1. os引导E序开发, os开?br>2. bios开发经?br>3. 熟?zhn)Linux裁剪QLinux内核
4. 有编译器开发经?br>
tel:13554674976  刘先?br>


ngaut 2008-09-19 22:06 发表评论
]]>
[转]Bug理的经验和实践[转蝲]http://www.shnenglu.com/ngaut/archive/2008/09/09/61354.htmlngautngautTue, 09 Sep 2008 00:07:00 GMThttp://www.shnenglu.com/ngaut/archive/2008/09/09/61354.htmlhttp://www.shnenglu.com/ngaut/comments/61354.htmlhttp://www.shnenglu.com/ngaut/archive/2008/09/09/61354.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/61354.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/61354.html阅读全文

ngaut 2008-09-09 08:07 发表评论
]]>
Driver Development Part 1: Introduction to Drivers [codeproject]http://www.shnenglu.com/ngaut/archive/2008/04/14/47077.htmlngautngautMon, 14 Apr 2008 13:38:00 GMThttp://www.shnenglu.com/ngaut/archive/2008/04/14/47077.htmlhttp://www.shnenglu.com/ngaut/comments/47077.htmlhttp://www.shnenglu.com/ngaut/archive/2008/04/14/47077.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/47077.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/47077.html阅读全文

ngaut 2008-04-14 21:38 发表评论
]]>
[转蝲]打造最快的Hash?和Blizzard的对?http://www.shnenglu.com/ngaut/archive/2008/02/27/43329.htmlngautngautWed, 27 Feb 2008 03:39:00 GMThttp://www.shnenglu.com/ngaut/archive/2008/02/27/43329.htmlhttp://www.shnenglu.com/ngaut/comments/43329.htmlhttp://www.shnenglu.com/ngaut/archive/2008/02/27/43329.html#Feedback2http://www.shnenglu.com/ngaut/comments/commentRss/43329.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/43329.html開元最q学?fn)了一下Blizzard的MPQ文g格式Q颇有一些心得,其中一条就是对HastTable的理解,很想写出来给大家׃nQ感谢Justin Olbrantz的文章《Inside MoPaQ》,大多认识来源于此?


先提一个简单的问题Q如果有一个庞大的字符串数l,然后l你一个单独的字符Ԍ让你从这个数l中查找是否有这个字W串q找到它Q你?x)怎么做?

有一个方法最单,老老实实从头查到尾Q一个一个比较,直到扑ֈ为止Q我惛_要学q程序设计的人都能把q样一个程序作出来Q但要是有程序员把这L(fng)E序交给用户Q我只能用无语来评h(hun)Q或许它真的能工作,?..也只能如此了?br>
最合适的法自然是用HashTableQ哈希表Q,先介l介l其中的基本知识Q所谓HashQ一般是一个整敎ͼ通过某种法Q可以把一个字W串"压羃" 成一个整敎ͼq个数称为HashQ当Ӟ无论如何Q一?2位整数是无法对应回一个字W串的,但在E序中,两个字符串计出的Hash值相{的可能非常,下面看看在MPQ中的Hash法

unsigned long HashString(char *lpszFileName, unsigned long dwHashType)
{
unsigned char *key = (unsigned char *)lpszFileName;
unsigned long seed1 = 0x7FED7FED, seed2 = 0xEEEEEEEE;
int ch;

while(*key != 0)
{
  ch = toupper(*key++);

seed1 = cryptTable[(dwHashType << 8) + ch] ^ (seed1 + seed2);
seed2 = ch + seed1 + seed2 + (seed2 << 5) + 3;
}
return seed1;
}

Blizzard的这个算法是非常高效的,被称?One-Way Hash"QD个例子,字符?unitneutralacritter.grp"通过q个法得到的结果是0xA26067F3?br>是不是把W一个算法改q一下,Ҏ(gu)逐个比较字符串的Hash值就可以了呢Q答案是Q远q不够,要想得到最快的法Q就不能q行逐个的比较,通常是构造一个哈希表(Hash Table)来解决问题,哈希表是一个大数组Q这个数l的定wҎ(gu)E序的要求来定义Q例?024Q每一个Hash值通过取模q算 (mod)对应到数l中的一个位|,q样Q只要比较这个字W串的哈希值对应的位置又没有被占用Q就可以得到最后的l果了,xq是什么速度Q是的,是最快的O(1)Q现在仔l看看这个算法吧
int GetHashTablePos(char *lpszString, SOMESTRUCTURE *lpTable, int nTableSize)
{
int nHash = HashString(lpszString), nHashPos = nHash % nTableSize;

if (lpTable[nHashPos].bExists && !strcmp(lpTable[nHashPos].pString, lpszString))
  return nHashPos;
else
  return -1; //Error value
}

看到此,我想大家都在想一个很严重的问题:(x)"如果两个字符串在哈希表中对应的位|相同怎么办?",毕竟一个数l容量是有限的,q种可能性很大。解册问题的方法很多,我首先想到的是?链表",感谢大学里学的数据结构教?x)了q个百试癄的法宝,我遇到的很多法都可以{化成链表来解冻I只要在哈希表的每个入口挂一个链表,保存所有对应的字符串就O(jin)K了?br>
事情到此g有了完美的结局Q如果是把问题独自交l我解决Q此时我可能p开始定义数据结构然后写代码了。然而Blizzard的程序员使用的方法则是更_֦的方法。基本原理就是:(x)他们在哈希表中不是用一个哈希D是用三个哈希值来校验字符丌Ӏ?br>
中国有句古话"再一再二不能再三再四"Q看来Blizzard也深得此话的_NQ如果说两个不同的字W串l过一个哈希算法得到的入口点一致有可能Q但用三个不同的哈希法出的入口点都一_(d)那几乎可以肯定是不可能的事了Q这个几率是1:18889465931478580854784Q大概是10?22.3ơ方分之一Q对一个游戏程序来说够安全了?br>
现在再回到数据结构上QBlizzard使用的哈希表没有使用链表Q而采?g"的方式来解决问题Q看看这个算法:(x)
int GetHashTablePos(char *lpszString, MPQHASHTABLE *lpTable, int nTableSize)
{
const int HASH_OFFSET = 0, HASH_A = 1, HASH_B = 2;
int nHash = HashString(lpszString, HASH_OFFSET);
int nHashA = HashString(lpszString, HASH_A);
int nHashB = HashString(lpszString, HASH_B);
int nHashStart = nHash % nTableSize, nHashPos = nHashStart;

while (lpTable[nHashPos].bExists)
{
  if (lpTable[nHashPos].nHashA == nHashA && lpTable[nHashPos].nHashB == nHashB)
   return nHashPos;
  else
   nHashPos = (nHashPos + 1) % nTableSize;
  
  if (nHashPos == nHashStart)
   break;
}

return -1; //Error value
}

1. 计算出字W串的三个哈希|一个用来确定位|,另外两个用来校验)
2. 察看哈希表中的这个位|?br>3. 哈希表中q个位置为空吗?如果为空Q则肯定该字W串不存在,q回
4. 如果存在Q则查其他两个哈希值是否也匚wQ如果匹配,则表C找C该字W串Q返?br>5. Ud下一个位|,如果已经界Q则表示没有扑ֈQ返?br>6. 看看是不是又回到了原来的位置Q如果是Q则q回没找?br>7. 回到3

怎么P很简单的法吧,但确实是天才的idea, 其实最优秀的算法往往是简单有效的法Q?br>Blizzard被称为最卓越的游戏制作公司,不愧于此?/p>

ngaut 2008-02-27 11:39 发表评论
]]>
[转]Delphi多线E下的ADO~程http://www.shnenglu.com/ngaut/archive/2008/02/26/43253.htmlngautngautTue, 26 Feb 2008 05:49:00 GMThttp://www.shnenglu.com/ngaut/archive/2008/02/26/43253.htmlhttp://www.shnenglu.com/ngaut/comments/43253.htmlhttp://www.shnenglu.com/ngaut/archive/2008/02/26/43253.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/43253.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/43253.htmlDelphi多线E下?/span>ADO~程

 

 

前言Q?/span>

几个月前接到一个Q务:(x)一后台E序讉K数据库的方式?/span>BDE改ؓ(f)ADOQ原因是׃业务量的增加Q通过BDE不论是向数据库写入数据还是从数据库中d数据的速度都变得无法忍受,大家都知?/span>ADO在数据库讉K速度斚w?/span>BDE要快的多了(我写了一个测试程序?/span>ADO比?/span>BDE快了q?/span>100?/span>!Q。这个Q务还不简单嘛Q只要将BDE的控件更换成ADO的再修改一些代码不搞定了Q我当时实是这么想的,而且用了不到一个小时就搞定Q测试运行一D|问题Q大功告成了Q我惟뀂谁知道一个恶梦就此开始,我的愚昧无知使我在程序中埋下了一个超U炸弹,它的威力不次?/span>9.11撞击世N大厦的两架客机,整个pȝ被它无情的催跨。程序在q行很长一D|间候捕获到一pd的异常:(x)

OLE error 800A0E7F

Access violation at address 00135770. Write of address 005D8B78

Access violation at address 00178EC6. Read of address FFFFFFFF

Access violation at address 1F499BDD in module 'msado15.dll'. Read of address 0000000C

…….

接下来我们的pȝ像世N大厦一下?zhn)壮的倒下了?/span>

 

Z么?

       Z么?E序在ؓ(f)改动之前使用BDEq行得好好的Q我q没有更改程序的l构啊?我十分的qhQ当然要惌决问题一切都得从错误代码开始?/span>

   OLE error 800A0E7FQ什么咚咚来的?它什么意思?什么原因引L(fng)Q我找了半天也没有在我的pȝ里找到它的说明,好在现在|络发达Q也许有人遇到跟我一L(fng)问题吧,于是我用OLE error 800A0E7F作ؓ(f)关键字搜了一下,嘿嘿Q果真被我找CQ?/span>

>0x800A0E7F Operation cannot be performed while executing
> asynchronously.

异步执行时操作不能被执行Q完成)Q还是不太清楚错误的原因Q于是我在一个网站发布了帖子求助Q一些h告诉?/span>ADOU程不安全,需要线E同步,事实上我的程序做了同步,而且针对不同的应用用了多个ADOConnectionQ我x应该自己动手来好好研I一下这个问题了Q它很意思。接下来我该好好分析我的E序q做一pd的测试来扑ֈ那个炸弹?/span>

 

扑և炸弹

 

    在我的程序里所有访问数据库都是通过一?/span>DataModule单元TDataModule1cL供的接口来完成,共有三个U程使用CTDataModule1的对?/span>DataModule1Q?/span>DataModule1是一全局变量Q下面是数据库的讉K模式的结构模型图。(实际l构要复杂很多)

 

 

数据库:(x)

ADOConnection1

ADOConnection2

Table1

Table2

?/span>ADOQuery1

?/span>ADOQuery3

?/span>ADOProcedure1

?/span>ADOProcedure2

?/span>UpdateQuery

?/span>ADOQuery2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


?/span>1

说明Q?/span>

?/span>UpdateQuery

 


                   ADOQuery控g用来修改table2记录Q?/span>①代表ؓ(f)U程1所有,

白色代表使用频率很低Q颜色越p明用频率越高)

 

?/span>ADOQuery2

 


                   查询table2Q?/span>③代表ؓ(f)U程3所有,使用频率较高

 

?/span>ADOQuery3

 


                   查询table2Q?/span>③代表ؓ(f)U程2所有,使用频率很高

 

?/span>ADOProcedure1

           

                      ADO存储q程控g向表table2插入数据Q属于线E?/span>1频繁使用

 

?/span>ADOProcedure2

 


修改ADOProcedure1插入的记录,属于U程1频繁使用

 

其中U程3和线E?/span>2使用ADO控g时没有加锁,而线E?/span>1的所有访问都加锁了(q样做毫无作用)

 

E序的结构出来了Q问题在哪里呢?接下来我写了一个小的试E序Q该E序的结构与上面相同Q它拥有三个U程和一?/span>DataMoule单元Q线E一通过ADOQuery1查询数据?/span>DBTest?/span>table1的记录,U程二通过ADOQuery2?/span>table1中插入记录,U程三通过ADOQuery3修改table1中最后一条记录的某个字段?/span>ADOQuery1?/span>ADOQuery2?/span>ADOQuery3都通过ADOConnection1与数据库DBTest1建立q接Q一开始,所有的U程都不做同步,q行Q?/span>OK!错误出来了其中两个错误正是我所惌的,q就是我的程序报的错啊?/span>

 

 

图二

 

接下来我三?/span>ADOQuery都加上锁Q再q行没问题,我又?/span>ADOQuery分别通过三个不同?/span>ADOConnection来连接数据库且不加锁也没有问题。看来我是找到那个可恶的炸弹了,怎么拆了它?

 

排除炸弹

 

炸弹扑ֈ了,我该怎么拆它Q是单的做线E同步还是每个线E都是用一?/span>ADOConnectionQ这下我再也不敢蛮干了,我得好好看看q方面的资料Q在Delphi帮助文档Q?/span>Using the main VCL thread》我扑ֈ了下面一D话Q?/span>

……

Data access components are thread-safe as long as each thread has its own database session component. The one exception to this is when you are using Access drivers. Access drivers are built using the Microsoft ADO library, which is not thread-safe.

…..

同样?/span>Delphi的帮助文档?/span>Managing multiple sessions》中l我明确的徏议:(x)

……

If you create a single application that uses multiple threads to perform database operations, you must create one additional session for each thread.

…..

喔找CQ?/span>ADO控g是线E不安全的,所以如果你的程序是使用多线E访问数据库的话你应该确保每个线E都有自q?x)话?/span>

事实上在另外一本书?/span>Delphi 4~程技术内q》一书在谈到U程安全数据库访?/em>也有相同的徏议,不过台湾李维先生在他?/span>?/span>Delphi 5.X ADO/MTS/COM+高E序设计》却_(d)如果你的E序不是q接多个数据库的话,最好同一数据库用一个连接,不要使用多个q接。怎么办?谁对谁错Qؓ(f)什么要使用一个连接呢Q这主要是从服务器来考虑Q因为数据库服务器需要ؓ(f)每个q接分配一定的资源q对其进行维护,q接数越多服务器Ҏ(gu)耗的资源p多,服务器的性能也就差Q所以要可能的减少客户端的q接数。好在我的程序是作ؓ(f)服务器程序增加一些连接对数据库服务器的媄响不?x)很大,现在我可以重新设|我的数据库讉Kl构模型?/span>

 

数据库:(x)

ADOConnection1

ADOConnection2

Table1

Table2

?/span>ADOQuery1

?/span>ADOQuery3

?/span>ADOProcedure1

?/span>ADOProcedure2

?/span>UpdateQuery

?/span>ADOQuery2

ADOConnection2

 

 

 

 

 

 


                                                                              

 

 

 

 

 

 

 

 

 

 

 

 

图三

 

我增加了一?/span>ADOConnection以保证每个线E都有一个自p?/span>(?x)?/span>)Q从而避免出现资源冲H,我的问题是不是解决了呢?是的Q这个问题已l解决了Q将我的E序与数据库攑֜同一台机器上q行没有问题Q但是当E序与数据库服务器不在同一台机器上q行时会(x)出现一个新的问题?/span>

 

[DBNMPNTW]ConnectionWrite(writeFile())错误

     q个错误不是多线E引L(fng)Q而是Micrsoft自己的一个问题,产生该问题的原因可能是因为网l异常而引L(fng)Q可以通过SQLServer客户端的默认的网l协?/span>named pipes network propocol 改ؓ(f) TCP/IP SocketsQ?/span>具体做法请参?/span>Micrsoft技术支持网站的?/span>Microsoft Knowledge Base Article - Q178040?/span>

 

ȝ

   ׃ADO控g的线E不安全性(事实上这U不安全性是来自Micrsoft ADO LibraryQ所以在其它开发工具中也存在同L(fng)问题Q因此在使用多线E?/span>ADO~程时应该注意一下问题:(x)

 

W一Q要保证每个U程都拥有自q?x)话?/span>

W二Q作为客L(fng)E序应该可能的减少与数据库库服务器的连接数?/span>

W三Q在退出线E之前确保释放所有的资源?/span>

 

参考文献:(x)

1?/span>李维?/span>Delphi 5.X ADO/MTS/COM+高E序设计?/span> 机械工业出版C?/span> 2000?/span>

2?/span>Charlie Calvert?/span>Delphi 4~程技术内q》潇湘工作室 ?/span> 机械工业出版C?/span> 1999



ngaut 2008-02-26 13:49 发表评论
]]>
boost asio 0.39发布?/title><link>http://www.shnenglu.com/ngaut/archive/2007/12/16/38634.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Sun, 16 Dec 2007 14:04:00 GMT</pubDate><guid>http://www.shnenglu.com/ngaut/archive/2007/12/16/38634.html</guid><wfw:comment>http://www.shnenglu.com/ngaut/comments/38634.html</wfw:comment><comments>http://www.shnenglu.com/ngaut/archive/2007/12/16/38634.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/ngaut/comments/commentRss/38634.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ngaut/services/trackbacks/38634.html</trackback:ping><description><![CDATA[boost asio 0.39发布了,看来卛_q入boost 1.35? <img src ="http://www.shnenglu.com/ngaut/aggbug/38634.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ngaut/" target="_blank">ngaut</a> 2007-12-16 22:04 <a href="http://www.shnenglu.com/ngaut/archive/2007/12/16/38634.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]今年的十个佳句出炉啦http://www.shnenglu.com/ngaut/archive/2007/10/23/34936.htmlngautngautTue, 23 Oct 2007 11:14:00 GMThttp://www.shnenglu.com/ngaut/archive/2007/10/23/34936.htmlhttp://www.shnenglu.com/ngaut/comments/34936.htmlhttp://www.shnenglu.com/ngaut/archive/2007/10/23/34936.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/34936.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/34936.html1、钱不是问题Q问题是没钱?br>2、钻x久远Q一颗就破?br>3、水能蝲舟,亦能煮粥?br>4、一׃能容二虎Q除非一公和一母?br>5、火可以试金Q金可以试女人,女h可以试男人?br>6、烧香的不一定是和尚Q还可能是熊猫?br>7、喝醉了我谁也不服,我就扶墙?br>8、我像一只趴在玻璃上的苍蝇,前途光明,\没有?br>9、避孕的效果Q不成功Q便成h?br>10、问世间情ؓ(f)何物Q一物降一?nbsp;

ngaut 2007-10-23 19:14 发表评论
]]>
当asio::async_read与socket的async_read_some的区?/title><link>http://www.shnenglu.com/ngaut/archive/2007/06/29/27221.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Fri, 29 Jun 2007 07:37:00 GMT</pubDate><guid>http://www.shnenglu.com/ngaut/archive/2007/06/29/27221.html</guid><wfw:comment>http://www.shnenglu.com/ngaut/comments/27221.html</wfw:comment><comments>http://www.shnenglu.com/ngaut/archive/2007/06/29/27221.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ngaut/comments/commentRss/27221.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ngaut/services/trackbacks/27221.html</trackback:ping><description><![CDATA[今天用asio写一个简单的serverӞ<br>当连接成功时做如下工?br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="COLOR: #008080">1</span> <span style="COLOR: #000000">       asio::async_read(socket_, asio::buffer(</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">m_packet, </span><span style="COLOR: #0000ff">sizeof</span><span style="COLOR: #000000">(m_packet)),<br></span><span style="COLOR: #008080">2</span> <span style="COLOR: #000000">         boost::bind(</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">tcp_connection::HandleReadCardKey, shared_from_this(),<br></span><span style="COLOR: #008080">3</span> <span style="COLOR: #000000">           asio::placeholders::error));</span></div> 但HandleReadCardKey始终没有被回调,除非remote point断开q接<br><br>最后用下面的代码搞定:(x)<br> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="COLOR: #008080">1</span> <span style="COLOR: #000000">socket_.async_read_some(asio::buffer(</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">m_packet, </span><span style="COLOR: #0000ff">sizeof</span><span style="COLOR: #000000">(m_packet)),<br></span><span style="COLOR: #008080">2</span> <span style="COLOR: #000000">          boost::bind(</span><span style="COLOR: #000000">&</span><span style="COLOR: #000000">tcp_connection::HandleReadCardKey, shared_from_this(),<br></span><span style="COLOR: #008080">3</span> <span style="COLOR: #000000">          asio::placeholders::error));</span></div> CQ免得以后忘C<br><br>ȝ一下:(x)<br>      asio::async_read通常用户d指定长度的数据,d或出错才q回?br>      而socket的async_read_somed到数据或出错p回,不一定读完了整个包?nbsp;  <br><br> <img src ="http://www.shnenglu.com/ngaut/aggbug/27221.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ngaut/" target="_blank">ngaut</a> 2007-06-29 15:37 <a href="http://www.shnenglu.com/ngaut/archive/2007/06/29/27221.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转]嵌入式Linux研究Q对几种典型的系l的内核配置Ҏ(gu)http://www.shnenglu.com/ngaut/archive/2007/06/20/26713.htmlngautngautWed, 20 Jun 2007 12:32:00 GMThttp://www.shnenglu.com/ngaut/archive/2007/06/20/26713.htmlhttp://www.shnenglu.com/ngaut/comments/26713.htmlhttp://www.shnenglu.com/ngaut/archive/2007/06/20/26713.html#Feedback0http://www.shnenglu.com/ngaut/comments/commentRss/26713.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/26713.html

1.对于一?/span>PC的普通内栔R|?/span>

对于一般的用户而言Q对?/span>Linux内核的效率和大小的要求都不高。因此一般不对内栔R新配|,因ؓ(f)Linux安装E序?x)在安装时对大部分设|按照安装的需求和实际的硬件做~省讄。这L(fng)内核?x)比实际需要的J冗Q有很多模块加蝲后根本就没有用到Q但是因为现在的PC的内存一般都是上?/span>MBQ而一?/span>Linux内核再大也就是几?/span>KQ因此对于一般用戯言Q无需再重新编译内怺?/span>

在一?/span>P3-566?/span>Dell机器安装Red-Hat?.2,内核版本?/span>2.4.6


以下是一些该机的配置Q?/span>

Loadablemodulesupport?Y

Networkingsupport:Y

PCIsupport:Y

SystemVIPC?/font>
Q?/span>Y因ؓ(f)可以做一些基?/span>SystemV的程?/span>

Kernelsupportfora.outbinaries:Y

KernelsupportforELFbinaries:Y

Blockdevices?/font>
Q对此根据该机的g做了相应的配|,去除一些本机没有的g讑֤的支持模块。如:Loopbackdevicesupport

Networkingoptions:

Packetsocket:Y

TCP/IPnetworking:Y

Networkfirewalls:Y

TheIPXprotocol:Y

Networkdevicesupport:

Networkdevicesupport:Y

Ethernet(10or?00Mb/s):Y

Characterdevice

Virtualterminal:Y


Supportforconsoleonvirtualterminal:Y

Filesystems

Secondextendedfssupport:Y

VFATfssupport?m?/font>
W者有时会(x)用到该机上的VFAT分区?br>
?procfilesystemsupportY

ISO9660cdromfilesystemsupport:m

NetworkFileSystems

NFSfilesystemsuppor
t:Y

SMBfilesystemsupport:m

Consoledrivers

VGAtextconsole?Y

Videomodeselectionsupport:Y

VESAVGAgraphicsconsole?Y

Kernelhacking

MagicSysRqkey:Y


q有一些缺省的讄W者没有改。这L(fng)译出来的版本?/span>700K.l过W者调试过没有出现什么问题?/span>

2.PDA
的内核设|?/span>

PDA(PersonalDigitalAssist)如:(x)手机Q快译通,文曲星等{。这cȝl要求系l稳定,内核而且效率高,常常需要一些特D的g支持。对q程调度、文件系l要求单一Q有些就是单q程pȝ。对|络的支持由Ҏ(gu)需要确定?/span>RedHat的内核无法直接用来设计一些特D要求的PDA,一般还要加入对g的特定模块?/span>

可作如下讄Q?/span>

Networkingsupport:Y?一?/span>PDA都支持上|更新功?/span>

KernelsupportforELFbinaries?Y

Compileas?/span>ELF?#8211;ifyourGCCisELF-GCC?Y
q两个设|ɾpȝ的执行文仉?/span>ELF

AdvancedPowerManagerBiossupport:Y?br>
Blockdevices?
应该加入对硬件特D的支持模块

Networkingoptions

Packetsocket?br>
FileSystem?br>
Secondextendedfssupport:Y


另外的一些功能ؓ(f)N,当然一些功能必选择用来支持上述的模块。编译后?/span>100KB---400KB

3.
型嵌入式系l的内核配置

一个小型的嵌入?/span>Linuxpȝ只需要下面三个基本元素:(x)


引导工具
Linux
微内核,由内存管理、进E管理和事务处理构成
初始化进E?/span>

如果要让它能q点什么且l箋保持型化,q得加上Q?/span>


g驱动E序
提供所需功能的一个或更多应用E序?/span>

再增加功能,或许需要这些:(x)?/font>一个文件系l(也许?/span>ROM?/span>RAMQ中TCP/IP|络堆栈对该U系l?/span>,做了不同的设|?/span>:


不要floppyQ不?/span>SMP?/span>MTRRQ不?/span>Networking?/span>SCSIQ把所有的blockdevice?/font>U除Q只留下IDEdeviceQ把所有的characterdevice?/font>U除Q把所有的filesystem?/font>U除Q只留下minixQ不?/span>sound?/font>支援。这样己l把所有的选项都移除了。这样做之后Q得C一?/span>?88K?/font>的核?/span>.


把下列两个档案中?/span>?O3,-O2?/font>?/span>?Os?/font>取代?/span>

?/Makefile
?/arch/i386/kernel/
Makefile


q样一来,整个核心变小?/span>?KQ成?/span>?79K?/span>

不过q个核心恐怕很隑֏?/span>Linux?/font>的功能,因此把网l加回去。把Generalsetup中的networksupport?/font>加回去,重新~译Q核心变?/span>?89K?/span>10K加上个TCP/IPstack?/span>?/font>?/span>stack没有driver也是枉然Q把embeddedboard常用?/span>RTL8139?/span>driver加回去,195K.


如果你需?/span>DOS?/font>档案pȝQ那大小成ؓ(f)?13K。如?/span>minix?/font>?/span>ext2?/font>换代Q则大小成长?/span>?22K?/span>

Linux所需的内存大U在600K?/span>800K之间?/span>1MB内存可能可以开ZQ但不太有用Q因载入CE序库都有困难?/span>2MB内存应该可以做点事了,但要?/span>?MB以上才可以执行一个比较完整的pȝ?/span>

因ؓ(f)Linux?/span>filesystem?/span>相当大,大约?/span>?30K?/font>左右Q占?/span>?/3?/font>的体U。内存管理占?/span>80KQ和核心其它部分的d差不多?/span>TCP/IPstack?/span>占了65KQ驱动程序占?/span>120K?/span>SysVIPC占了?1KQ必要的话可以拿掉,核心档应该可以再个10K左右?/span>

如果要裁剪核心大,应该动那里呢??/span>{案很明显,当然是文件系l?/span>Linux?/span>?/span>VFS化了档案pȝ的设计,buffercache,directorycache增加了系l的效率。但q些embeddedpȝҎ(gu)q处不大。如果可以把它们拿掉Q核心可以马上羃?yu)?/span>?0K?/font>左右。如果蟩q整?/span>VFSQ直接将文gpȝ写成一?/span>driver?/font>的型式,应该可以?/span>?30K~减?/span>50K左右。整个核心羃?/span>100K左右?/span>

4.
工控机的内核配置

对于工控机内?/span>,对于内核的大要求ƈ不严?/span>,关键的是正确?/span>,健壮性和实时?/span>(某些机子要求实时性较?/span>).Ҏ(gu)件系l要求单一,但保证正?/span>.|络按需讄?/span>

可作如下配置:

Symmetricmulti-processingsupport:Y

Loadablemodulesupport:N?/font>
工控Z般将可能用到的模块都全部装入内存.

Networkingsupport:Y

SystemVIPC?Y

KernelsupplyforELFbinaries:Y

Blockdevices:
Ҏ(gu)具体g配置

Networkingoptions

packetsock
et:Y

?/span>
Ҏ(gu)具体需?/span>,一般工控机是通过LANq接,与外界隔L?/span>IPX协议,另外Tcp/ip一般也需?/span>.

QoSand/orfairqueueing:Y

QoS(QualityOfService?andfairqueueling?/font>
是一U排定某U封包先送的|络U程?/span>,可同旉对多个网l封包处理ƈ依优先处理顺序来排序,UC?/span>packetschedulers.此功能特别是针对实时pȝ时格外重?/span>,当多个封包同旉到|络讑֤?/span>,Kernel可以适当的决定出哪一个封包必M先处?/span>.因此Kernel提供数种packetschedulingalgorithm.

Filesystems

SecondExtendedfssupport:Y


其余配置和小型嵌入式pȝ差别不大.同一台机器上~译出来的内核大ؓ(f)800?/span>KB?/span>

5.
服务器的内核配置:



服务器的内核对网l设|和q程调度都非常关?/span>.做如下配|?/span>:

Symmetricmulti-processingsupport:Y

Loadablemodulesupport:Y


Networkingsupport:Y

Networkingoption

Packetsocket:Y
?/span>

TCP/IPnetworkeing:Y

Networkfirewalls:
是否采用|络防火墙。如果计机惛_firewallsserver?/span>或者是处于TCP/IP?/span>通信协议的网l的|\l构下,q一要?/span>[Y]

Networkaliasing[Y/m/n/?]:
一台网l上的计机可以拥有多组IP地址。如果计机x有多?/span>IP地址Q就选择[Y].

IP:forwarding/gatewaying[Y/m/n/?]:
假如用户惛_路由器的话,选择[Y],但先x件是?/span>两张|卡Q一张对外部|络、一张对内部|络Qƈ且用的ISP那一端也必须讑֮routingQ允许用戯台\由器才行?/span>

IP:multicasting:可以一ơ就完成传送一?/span>packet到好几台计算机的操作?/span>

IP:syn_cookies:一U保护措施,各U?/span>TCP/IP的通信协议加密Q防?/span>Attackerd用户的计机Qƈ且可以纪录企图攻ȝL(fng)计算机的IP地址?/span>

IP:firewalling:该台计算机是否是防火墙服务器?/span>

IP:firewallpacketlogging:是否?/span>klogd记录防火墙服务器到底接收了哪?/span>Packet?/span>

IP:masquerading:可以内部网l的计算机送出ȝ包Q通过防火墙服务器直接传递给q端的计机Q而远端的计算机看到的是接收到的防火墙服务器送过来的包Q而不是从内部的计机送过来的。这样如果内部只有一台计机可以上网Q其余的机器可以通过q台机子的防火墙服务器向外连Uѝ选择q个选项必需先确定先前的NetworkFirewallsIP:forwarding/gatewayingIPQ?/span>firewalling?/span>q三个选项?/span>[Y]。以及下一个选项IPQ?/span>alwaysdeframent?/span>也要?/span>[Y].

IP:ICMPmasquerading:?/span>
一?/span>masquerading?/span>只提供处?/span>TCP,UDPpackets,若要?/span>masqurerading?/span>也能处理ICMPpackets,q个选项要?/span>[Y].

IP:alwaysdefragment:
可将接收到的packetfragments重新l合回原来那个封包?/span>

IP:accounting:l计IPpacket的流量,也就是网l的通情c?/span>

IP:optimizeasrouternothost:可以关闭copy&checksum技术,防止量大的服务器的IPpackets丢失?/span>

IP:tunneling:可在不同|域中?/span>linux,且都不用?/span>IP可以直接上|了。适合于笔记本型计机用户?/span>

IP:ReverseARP?主要是提?/span>bootp的功能,让计机从可以从|卡?/span>BootRam启动?/span>

IP:DisablePathMTUDiscovery:是否取消PathMTUDiscovery.MTU?/span>有助于处理拥挤的|络?/span>

TheIPXprotocol:IPX?/span>Netware?/span>|络使用的通讯协议?/span>

其余Ҏ(gu)需要设|。编译出的内ؓ(f)800K?/span>



ngaut 2007-06-20 20:32 发表评论
]]>
《自己动手写嵌入式操作系l》源代码http://www.shnenglu.com/ngaut/archive/2007/06/19/26628.htmlngautngautTue, 19 Jun 2007 07:32:00 GMThttp://www.shnenglu.com/ngaut/archive/2007/06/19/26628.htmlhttp://www.shnenglu.com/ngaut/comments/26628.htmlhttp://www.shnenglu.com/ngaut/archive/2007/06/19/26628.html#Feedback14http://www.shnenglu.com/ngaut/comments/commentRss/26628.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/26628.html

ngaut 2007-06-19 15:32 发表评论
]]>
解决error C2011: 'fd_set' : 'struct' type redefinition问题http://www.shnenglu.com/ngaut/archive/2007/04/23/22658.htmlngautngautMon, 23 Apr 2007 09:15:00 GMThttp://www.shnenglu.com/ngaut/archive/2007/04/23/22658.htmlhttp://www.shnenglu.com/ngaut/comments/22658.htmlhttp://www.shnenglu.com/ngaut/archive/2007/04/23/22658.html#Feedback8http://www.shnenglu.com/ngaut/comments/commentRss/22658.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/22658.html在所有的#include <windows.h>前?define WIN32_LEAN_AND_MEANQ如Q?/p>
#define WIN32_LEAN_AND_MEAN
#include 
<windows.h>


ngaut 2007-04-23 17:15 发表评论
]]>
与妻?--林觉?/title><link>http://www.shnenglu.com/ngaut/archive/2007/02/24/18944.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Sat, 24 Feb 2007 07:01:00 GMT</pubDate><guid>http://www.shnenglu.com/ngaut/archive/2007/02/24/18944.html</guid><wfw:comment>http://www.shnenglu.com/ngaut/comments/18944.html</wfw:comment><comments>http://www.shnenglu.com/ngaut/archive/2007/02/24/18944.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ngaut/comments/commentRss/18944.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ngaut/services/trackbacks/18944.html</trackback:ping><description><![CDATA[                                                                               与妻?nbsp; <br>  <br>                                                                                                林觉?nbsp; <br>  <br> 意映卿卿如晤Q吾今以此书与汝永别矣!吾作此书Ӟؓ(f)世中一人;汝看?nbsp; <br>书时Q吾已成为阴间一鬹{吾作此书,泪珠和笔墨齐下,不能书竟Q而欲搁笔。又  <br>恐汝不察吾衷Q谓向ֿ舍汝而死Q谓吾不知汝之不Ʋ吾MQ故遂忍(zhn)ؓ(f)汝言之?nbsp; <br>  <br> 吾至爱汝Q即此爱汝一念,使吾勇于死也!吾自遇汝以来Q常愿天下有情h  <br>都成眷属Q然遍地腥云Q满街狼犬,U心快意Q几家能够?叔R青衫Q吾不能学太  <br>上之忘情也。语云,仁?#8220;老吾老以及h之老,q吾qg及h之幼”。吾充吾爱汝  <br>之心Q助天下人爱其所爱,所以敢先汝而死Q不汝也。汝体吾此心Q于(zhn)啼之余Q?nbsp; <br>亦以天下Zؓ(f)念,当亦乐牺牲吾w与汝n之福利,为天下h谋永也。汝其勿(zhn)Ӏ?nbsp; <br> 汝忆否四五年前某夕,向ְ语曰Q?#8220;与向օMQ无宁汝先吾而死?#8221;汝初  <br>闻言而怒,后经向֩解,虽不谓吾a为是Q而亦无辞相答。吾之意盖谓以汝之弱Q?nbsp; <br>必不能禁失吾之?zhn)Q吾先死留苦与汝Q吾心不忍,故宁h先死Q吾担?zhn)也。嗟夫,  <br>谁知向֍先汝而死乎!  <br>  <br> 各不能忘汝也!回忆后街之屋Q入门穿廊,q前后厅Q又三四折有厅Q厅  <br>旁一室ؓ(f)吾与汝双栖之所。初婚三四个月,适冬之望日前后,H外疏梅{月影,?nbsp; <br>E掩映Q吾与汝q肩携手Q低低切切,何事不语Q何情不诉!及今思之Q空余泪痕!  <br>又回忆六七年前,吾之逃家复归也,汝泣告我Q?#8220;望今后有q行Q必以告妾,妾愿  <br>随君行?#8221;吾亦既许汝矣。前十余日回Ӟx乘便以此行之事语汝,及与汝相对,  <br>又不能启口;且以汝之有n也,更恐不胜(zhn)Ԍ故惟日日呼酒买醉。嗟夫!当时余心  <br>之?zhn)Q盖不能以寸Ş容之?nbsp; <br>  <br> 吾诚愿与汝相守以歅R第以今日事势观之,天灾可以死,盗贼可以死,瓜分?nbsp; <br>日可以死Q奸官污吏虐民可以死Q吾辈处今日之中国,国中无地无时不可以死Q到  <br>那时使吾眼睁睁看汝死Q或使汝眼睁睁看我死Q吾能之乎!抑汝能之乎!卛_不死Q?nbsp; <br>而离散不相见Q徒使两地眼成穿而骨化石Q试问古来几曾见破镜能重圆,则较Mؓ(f)  <br>苦也。将奈之何?今日吾与汝幸双健Q天下hZ当死而死Q与不愿而离者,?nbsp; <br>可数计;钟情如我辈者,能忍之乎Q此吾所以敢率性就M汝也!吾今L余憾Q?nbsp; <br>国事成不成,自有同志者在。依新已五岁Q{眼成人,汝其善抚之,使之肖我。汝  <br>腹中之物Q吾疑其女也Q女必像汝,向ֿ甚慰Q或又是P则亦教其以父志ؓ(f)志,  <br>则我dQ尚有二意洞在也Q甚q甚q!  <br>  <br> 向֮后日当甚贫,贫无所苦,清静q日而已?nbsp; <br>  <br> 吾今与汝无言矣!向ֱ?ji)泉之下Q遥L哭声Q当哭相和也。吾qx不信有鬼Q?nbsp; <br>今则又望其真有。今人又a心电(sh)感应有道Q吾亦望其言是实Q则吾之死,各依  <br>依旁汝也Q汝不必以无侣?zhn)Q?nbsp; <br>  <br> 各qx以吾所志语汝,是吾不是处。然语之Q又恐汝日日为吾担忧。吾?nbsp; <br>牲百死而不辞,而汝担忧,的的非吾所忍。吾爱汝臻I所以ؓ(f)汝谋者惟恐未?nbsp; <br>汝幸而偶我,又何不幸而生今日之中国!向ֹ而得汝,又何不幸而生今日之中国,  <br>卒不忍独善其w!嗟夫Q巾短情长,所未尽者尚有万千,汝可Ҏ(gu)得之。吾今不?nbsp; <br>见汝矣!汝不能舍吾,其时时于梦中L乎!一恸!  <br>  <br> 辛亥三月念六夜四鼓,意洞手书?nbsp; <br>  <br> 家中诸母皆通文Q有不解处,望请其指教。当吾意ؓ(f)q?nbsp; <br><img src ="http://www.shnenglu.com/ngaut/aggbug/18944.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ngaut/" target="_blank">ngaut</a> 2007-02-24 15:01 <a href="http://www.shnenglu.com/ngaut/archive/2007/02/24/18944.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>解决unresolved external symbol "public: int __thiscall CWnd::KillTimer(unsigned int)" (?KillTimer@CWnd@@QAEHI@Z)问题http://www.shnenglu.com/ngaut/archive/2007/02/23/18933.htmlngautngautFri, 23 Feb 2007 15:48:00 GMThttp://www.shnenglu.com/ngaut/archive/2007/02/23/18933.htmlhttp://www.shnenglu.com/ngaut/comments/18933.htmlhttp://www.shnenglu.com/ngaut/archive/2007/02/23/18933.html#Feedback6http://www.shnenglu.com/ngaut/comments/commentRss/18933.htmlhttp://www.shnenglu.com/ngaut/services/trackbacks/18933.html阅读全文

ngaut 2007-02-23 23:48 发表评论
]]>
老老实实从头做?/title><link>http://www.shnenglu.com/ngaut/archive/2006/12/24/16798.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Sun, 24 Dec 2006 10:40:00 GMT</pubDate><guid>http://www.shnenglu.com/ngaut/archive/2006/12/24/16798.html</guid><wfw:comment>http://www.shnenglu.com/ngaut/comments/16798.html</wfw:comment><comments>http://www.shnenglu.com/ngaut/archive/2006/12/24/16798.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ngaut/comments/commentRss/16798.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ngaut/services/trackbacks/16798.html</trackback:ping><description><![CDATA[ C圣诞前夕2006.12.24?img src ="http://www.shnenglu.com/ngaut/aggbug/16798.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ngaut/" target="_blank">ngaut</a> 2006-12-24 18:40 <a href="http://www.shnenglu.com/ngaut/archive/2006/12/24/16798.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>偶尔的思A和收?/title><link>http://www.shnenglu.com/ngaut/archive/2006/12/18/16577.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Mon, 18 Dec 2006 05:22:00 GMT</pubDate><guid>http://www.shnenglu.com/ngaut/archive/2006/12/18/16577.html</guid><wfw:comment>http://www.shnenglu.com/ngaut/comments/16577.html</wfw:comment><comments>http://www.shnenglu.com/ngaut/archive/2006/12/18/16577.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ngaut/comments/commentRss/16577.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ngaut/services/trackbacks/16577.html</trackback:ping><description><![CDATA[ <p>成功法则Q?br />付出l有收获Q一点小的付Z(x)带来更多的收?</p> <p> </p> <p>我们的学生到底ؓ(f)什么不行,~Z好的老师Q还是努力不够?br />应该~Z的是信心和思考,而不是被动的接受?br /><br /><br />陈安之:(x)<br />当你成ؓ(f)行业W一的时候,金钱和荣誉挡都挡不住?br /><br /><br /><br /><a >思想有多q,我们p走多q,其实是要个前提的Q尽力不停的?/a></p> <img src ="http://www.shnenglu.com/ngaut/aggbug/16577.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ngaut/" target="_blank">ngaut</a> 2006-12-18 13:22 <a href="http://www.shnenglu.com/ngaut/archive/2006/12/18/16577.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>一Ҏ(gu)(zhn):(x)在一个项目尚未完成时不宜调走目l成?/title><link>http://www.shnenglu.com/ngaut/archive/2006/11/16/15204.html</link><dc:creator>ngaut</dc:creator><author>ngaut</author><pubDate>Thu, 16 Nov 2006 02:28:00 GMT</pubDate><guid>http://www.shnenglu.com/ngaut/archive/2006/11/16/15204.html</guid><wfw:comment>http://www.shnenglu.com/ngaut/comments/15204.html</wfw:comment><comments>http://www.shnenglu.com/ngaut/archive/2006/11/16/15204.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/ngaut/comments/commentRss/15204.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/ngaut/services/trackbacks/15204.html</trackback:ping><description><![CDATA[当其它成员接受被调走l员的工作的时候,往往有大量的疑问需要请教已l调走的l员Q通常因ؓ(f)问得太多D被调走的l员有较多意见,而接手的l员也因为疑问太多有较多已经Q特别是当负责模块差别较大的时候?img src ="http://www.shnenglu.com/ngaut/aggbug/15204.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/ngaut/" target="_blank">ngaut</a> 2006-11-16 10:28 <a href="http://www.shnenglu.com/ngaut/archive/2006/11/16/15204.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.wooblog.cn" target="_blank">97þþþ޾Ʒר</a>| <a href="http://www.pw823.cn" target="_blank">뾫Ʒþþþ</a>| <a href="http://www.chaigan.cn" target="_blank">þ99Ʒþþ</a>| <a href="http://www.qkl888.cn" target="_blank">պݺݾþ͵͵ɫۺ </a>| <a href="http://www.37000.com.cn" target="_blank">þþþþAVר</a>| <a href="http://www.hdv1p7.cn" target="_blank">Ʒ˾þþþþþ</a>| <a href="http://www.sfwan.cn" target="_blank">þþƷav鶹С˵</a>| <a href="http://www.wbcyn.cn" target="_blank">þӰԺþ㽶߿ۿ</a>| <a href="http://www.qdaigo.com.cn" target="_blank">þþƷAV͵</a>| <a href="http://www.rdyly1688.cn" target="_blank">þþþþþƵ</a>| <a href="http://www.tv81.cn" target="_blank">þþƷһ</a>| <a href="http://www.90xueyuan.cn" target="_blank">ҰĻþ</a>| <a href="http://www.kuaiyanapp.com.cn" target="_blank">þĻavŮ</a>| <a href="http://www.6159vs.cn" target="_blank">þWWW˳ɡƬ</a>| <a href="http://www.1104f.cn" target="_blank">þ99Ʒ99þ</a>| <a href="http://www.jh942.cn" target="_blank">þһ</a>| <a href="http://www.by6463.cn" target="_blank">ŷƷһþĻ</a>| <a href="http://www.0577114.cn" target="_blank">ŷ㽶þۺվ</a>| <a href="http://www.ilrf.cn" target="_blank">99þþùƷ޿</a>| <a href="http://www.cu76.cn" target="_blank">ݺɫþۺ</a>| <a href="http://www.odostudio.cn" target="_blank">ҹƷþþþ9999</a>| <a href="http://www.udyq.cn" target="_blank">Ʒݾþþþø99 </a>| <a href="http://www.lyfulinmen.com.cn" target="_blank">þþþþþۺ </a>| <a href="http://www.haowang888.cn" target="_blank">þùƵ</a>| <a href="http://www.cdge.cn" target="_blank">ŷaƬѿþ</a>| <a href="http://www.pz25555.cn" target="_blank">þø߳һëƬ</a>| <a href="http://www.168zw.cn" target="_blank">ŮƷþþ</a>| <a href="http://www.globalimports.cn" target="_blank">þùһ</a>| <a href="http://www.crs24.cn" target="_blank">þþƷư</a>| <a href="http://www.palmback.cn" target="_blank">þ99þ99СݾƷӿ</a>| <a href="http://www.bestlevering.cn" target="_blank">ƷѾþþþþþ</a>| <a href="http://www.zhangqiu114.cn" target="_blank">þۺ㽶AV</a>| <a href="http://www.qj37c.cn" target="_blank">ձþþþĻ</a>| <a href="http://www.e-ben.cn" target="_blank">þþþavרˮ </a>| <a href="http://www.pu1166.cn" target="_blank">þþƷ۲ӰԺ</a>| <a href="http://www.mdz8.cn" target="_blank">þþþƷҹѲ</a>| <a href="http://www.ljvs.cn" target="_blank">ĻƷѾþþ</a>| <a href="http://www.gh688.cn" target="_blank">þþþӰԺ</a>| <a href="http://www.gsatyfhg.cn" target="_blank">Ʒþþþһ</a>| <a href="http://www.axrf.cn" target="_blank">þúݺһƷۺ</a>| <a href="http://www.mb71.cn" target="_blank">޹徫Ʒ߾þ</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>