<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">博客园_Icebird</title><subtitle type="text">Delphi/C# - My favorite programming language</subtitle><id>http://feed.cnblogs.com/blog/u/856/rss</id><updated>2012-03-20T04:22:03Z</updated><author><name>Icebird</name><uri>http://www.cnblogs.com/Icebird/</uri></author><generator>feed.cnblogs.com</generator><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Icebird/"/><link rel="self" type="application/atom+xml" href="http://feed.cnblogs.com/blog/u/856/rss"/><entry><id>http://www.cnblogs.com/Icebird/archive/2012/03/20/FireFoxBug.html</id><title type="text">FireFox的一个Bug?</title><summary type="text">function test(){ return /yy/g.test("yyyy-MM-DD");}for (var i = 0; i &lt; 100; i++){ if (!test()) console.log(i);}在一个函数里调用test，当使用了g选项则在执行了42次后就开始返回不正确了。不使用g选项好像就没问题。在FireFox 10和11下都是这样。换成IE8或Chrome运行同样的代码则没有问题。</summary><published>2012-03-20T04:22:00Z</published><updated>2012-03-20T04:22:00Z</updated><author><name>Icebird</name><uri>http://www.cnblogs.com/Icebird/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Icebird/archive/2012/03/20/FireFoxBug.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Icebird/archive/2012/03/20/FireFoxBug.html"/><content type="html">&lt;div style="background-color: #F5F5F5;border: 1px solid #CCCCCC;padding:10px;"&gt;function test()&lt;br/&gt;{&lt;br/&gt;    return /yy/g.test("yyyy-MM-DD");&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;for (var i = 0; i &amp;lt; 100; i++)&lt;br/&gt;{&lt;br/&gt;    if (!test())&lt;br/&gt;        console.log(i);&lt;br/&gt;}&lt;br/&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;在一个函数里调用test，当使用了g选项则在执行了42次后就开始返回不正确了。不使用g选项好像就没问题。在FireFox 10和11下都是这样。&lt;/p&gt;&lt;p&gt;换成IE8或Chrome运行同样的代码则没有问题。&lt;/p&gt;&lt;img src="http://www.cnblogs.com/Icebird/aggbug/2407716.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/Icebird/archive/2012/03/20/FireFoxBug.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/Icebird/archive/2011/04/11/PhysFS.html</id><title type="text">在.NET中使用PhysFS来挂载压缩包(zip)</title><summary type="text">PhysicsFS is a library to provide abstract access to various archives. It is intended for use in video games, and the design was somewhat inspired by Quake 3's file subsystem. The programmer defines a "write directory" on the physical filesystem. No file writing done through the Physic</summary><published>2011-04-11T05:45:00Z</published><updated>2011-04-11T05:45:00Z</updated><author><name>Icebird</name><uri>http://www.cnblogs.com/Icebird/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Icebird/archive/2011/04/11/PhysFS.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Icebird/archive/2011/04/11/PhysFS.html"/><content type="html">&lt;p&gt;PhysicsFS is a library to provide abstract access to various archives. It is intended for use in video games, and the design was somewhat inspired by Quake 3's file subsystem. The programmer defines a "write directory" on the physical filesystem. No file writing done through the PhysicsFS API can leave that write directory, for security. For example, an embedded scripting language cannot write outside of this path if it uses PhysFS for all of its I/O, which means that untrusted scripts can run more safely. Symbolic links can be disabled as well, for added safety. For file reading, the programmer lists directories and archives that form a "search path". Once the search path is defined, it becomes a single, transparent hierarchical filesystem. This makes for easy access to ZIP files in the same way as you access a file directly on the disk, and it makes it easy to ship a new archive that will override a previous archive on a per-file basis. Finally, PhysicsFS gives you platform-abstracted means to determine if CD-ROMs are available, the user's home directory, where in the real filesystem your program is running, etc.&lt;/p&gt;&lt;p&gt;我是从改版的DOSBox里看到有这样一个技术可以实现挂载zip/7z压缩包，就想在.NET中是否能够使用呢。&lt;/p&gt;&lt;p&gt;让我找到一个封装好的库 - BooGame，另外还有一个TAO (文件太大，有30多M)。&lt;/p&gt;&lt;p&gt;首先下载BooGame: &lt;a href="http://sourceforge.net/projects/boogame/files/BooGame/"&gt;http://sourceforge.net/projects/boogame/files/BooGame/&lt;/a&gt;&lt;/p&gt;&lt;p&gt;从下载的包里找到physfs.dll与Tao.PhysFs.dll，新建项目，引用Tao.PhysFs.dll，将physfs.dll放入bin与执行文件在一起。&lt;/p&gt;&lt;p&gt;然后using Tao.PhysFs，BooGame里有一个FileSystem.cs，可以做参考，不过其封装得不够完善。&lt;/p&gt;&lt;p&gt;首先 Fs.PHYSFS_init("init"); //这里的"init"没啥特别意义，总之传入一个字符串就可以&lt;/p&gt;&lt;p&gt;然后是添加搜索路径，Fs.PHYSFS_addToSearchPath("D:\\Temp", 1); //如果有写入要求的话，写入的临时目录要先添加，否则修改过的数据无法被找到，后面的参数1是一个定值&lt;/p&gt;&lt;p&gt;下面来mount一个压缩包，Fs.PHYSFS_addToSearchPath("D:\\Test.zip", 1);&lt;/p&gt;&lt;p&gt;接着设置写入的临时目录：Fs.PHYSFS_setWriteDir("D:\\"); //对压缩包的文件所作的任何修改都会被存入此处指定的临时目录。&lt;/p&gt;&lt;p&gt;如果临时目录与压缩包里的同一路径下都有相同的文件，则搜索路径在前的那个文件会优先被使用。&lt;/p&gt;&lt;p&gt;接下来就是文件目录的通常操作了，除了是使用 Fs.PHYSFS_XXX 这样的语句外，与通常的文件操作没有太大区别。更详细的使用帮助，请参考&lt;a href="http://192.121.234.229/manualer/programering/Tao-doc/Tao.PhysFs/Tao.PhysFs.FsMembers.html"&gt;http://192.121.234.229/manualer/programering/Tao-doc/Tao.PhysFs/Tao.PhysFs.FsMembers.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;有心的话，可以考虑继承Steam重写一个类来简化使用。&lt;/p&gt;&lt;p&gt;提示，里面的openWrite, openAppend实在不好用(需要Marshal.AllocHGlobal来分配内存)，不如直接在临时目录下直接读写之。&lt;/p&gt;&lt;p&gt;最后，要关闭资源：Fs.PHYSFS_deinit();&lt;/p&gt;&lt;p&gt;PS: 这个版本有点老了，好像是1.0.1，现在最新的是2.0.2，从1.1开始就支持了7z格式。&lt;/p&gt;&lt;p&gt;都快写完了，突思奇想，把DOSBox里带的libphysfs.dll复制过来，改名成physfs.dll，然后一试，哈哈，果然可以使用，并且支持了7z格式。&lt;/p&gt;&lt;p&gt;相关文件下载：&lt;a href="http://files.cnblogs.com/Icebird/PhysFS.net.rar"&gt;http://files.cnblogs.com/Icebird/PhysFS.net.rar&lt;/a&gt;&lt;/p&gt;&lt;img src="http://www.cnblogs.com/Icebird/aggbug/2012444.html?type=1" width="1" height="1" alt=""/&gt;&lt;p&gt;&lt;a href="http://www.cnblogs.com/Icebird/archive/2011/04/11/PhysFS.html" target="_blank"&gt;本文链接&lt;/a&gt;&lt;/p&gt;</content></entry><entry><id>http://www.cnblogs.com/Icebird/archive/2010/07/14/Prototype_Reference.html</id><title type="text">Prototype速查</title><summary type="text">Prototype 可获取浏览器的一些属性 Version Prototype.Version Browser Gecko [bool] Prototype.Browser.Gecko IE [bool] Prototype.Browser.IE MobileSafari [bool] Prototype.Browser.MobileSafari Opera [bool] Prototype.Br...</summary><published>2010-07-14T02:30:00Z</published><updated>2010-07-14T02:30:00Z</updated><author><name>Icebird</name><uri>http://www.cnblogs.com/Icebird/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Icebird/archive/2010/07/14/Prototype_Reference.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Icebird/archive/2010/07/14/Prototype_Reference.html"/><content type="html">该文只有注册用户登录后才能阅读。&lt;a href='http://www.cnblogs.com/Icebird/archive/2010/07/14/Prototype_Reference.html' target='_blank'&gt;阅读全文&lt;/a&gt;。</content></entry><entry><id>http://www.cnblogs.com/Icebird/archive/2008/06/07/VCLResource.html</id><title type="text">Delphi VCL Related Resource</title><summary type="text">URL: http://www.board4all.cz/showthread.php?t=105345TMS.Component.Pack.v4.7.0.0.for.Delphi.BCB.Full.Sourcehttp://rapidshare.com/files/120500964/v4.7.0.0.rarMydac 5.20.1.15 only for Delphi2007rapidshar...</summary><published>2008-06-07T04:21:00Z</published><updated>2008-06-07T04:21:00Z</updated><author><name>Icebird</name><uri>http://www.cnblogs.com/Icebird/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Icebird/archive/2008/06/07/VCLResource.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Icebird/archive/2008/06/07/VCLResource.html"/><content type="text">URL: http://www.board4all.cz/showthread.php?t=105345TMS.Component.Pack.v4.7.0.0.for.Delphi.BCB.Full.Sourcehttp://rapidshare.com/files/120500964/v4.7.0.0.rarMydac 5.20.1.15 only for Delphi2007rapidshar...</content></entry><entry><id>http://www.cnblogs.com/Icebird/archive/2008/06/05/1214228.html</id><title type="text">Password for ReportBuilder Enterprise v10.08 Retail For Delphi 7-Lz0</title><summary type="text">0526的ReportBuilder Enterprise v10.08 Retail For Delphi 7-Lz0里的nfo里没有安装密码，只能自己动手用我的Wun来看密码：piNar3l0f413</summary><published>2008-06-05T03:47:00Z</published><updated>2008-06-05T03:47:00Z</updated><author><name>Icebird</name><uri>http://www.cnblogs.com/Icebird/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Icebird/archive/2008/06/05/1214228.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Icebird/archive/2008/06/05/1214228.html"/><content type="text">0526的ReportBuilder Enterprise v10.08 Retail For Delphi 7-Lz0里的nfo里没有安装密码，只能自己动手用我的Wun来看密码：piNar3l0f413</content></entry><entry><id>http://www.cnblogs.com/Icebird/archive/2008/05/03/DUnitID.html</id><title type="text">[Delphi] DUnitID 0.17.4725</title><summary type="text">想知道别人用Delphi开发的程序用了哪些第三方控件吗，用这个工具就对了。工具支持文件拖放，很方便的。对于破解者来说，可以很容易看到该软件作者是否使用了常见的加密相关算法：比如md5,rsa,des,blowfish,sha下载：DUnitIDFlashFXP:FTPRush:History:2011-05-16 DUnitID 0.17.4725 released to public.2010-07-25 DUnitID 0.17.4690 released to public.2009-08-19 DUnitID 0.17.4619 released to public.2008-11-2</summary><published>2008-05-03T02:56:00Z</published><updated>2008-05-03T02:56:00Z</updated><author><name>Icebird</name><uri>http://www.cnblogs.com/Icebird/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Icebird/archive/2008/05/03/DUnitID.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Icebird/archive/2008/05/03/DUnitID.html"/><content type="text">想知道别人用Delphi开发的程序用了哪些第三方控件吗，用这个工具就对了。工具支持文件拖放，很方便的。对于破解者来说，可以很容易看到该软件作者是否使用了常见的加密相关算法：比如md5,rsa,des,blowfish,sha下载：DUnitIDFlashFXP:FTPRush:History:2011-05-16 DUnitID 0.17.4725 released to public.2010-07-25 DUnitID 0.17.4690 released to public.2009-08-19 DUnitID 0.17.4619 released to public.2008-11-2</content></entry><entry><id>http://www.cnblogs.com/Icebird/archive/2008/04/28/RSSReader.html</id><title type="text">RSSReader JavaScript Edition</title><summary type="text">利用JS实现的RSS订阅演示，支持IE以及FireFox，但是由于浏览器的安全性限制，只能在线订阅cnblogs上的RSS</summary><published>2008-04-28T07:00:00Z</published><updated>2008-04-28T07:00:00Z</updated><author><name>Icebird</name><uri>http://www.cnblogs.com/Icebird/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Icebird/archive/2008/04/28/RSSReader.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Icebird/archive/2008/04/28/RSSReader.html"/><content type="text">利用JS实现的RSS订阅演示，支持IE以及FireFox，但是由于浏览器的安全性限制，只能在线订阅cnblogs上的RSS</content></entry><entry><id>http://www.cnblogs.com/Icebird/archive/2008/04/16/GCAndRC.html</id><title type="text">[Delphi] GetClass与RegisterClass的应用一例</title><summary type="text">利用GetClass与RegisterClass可以实现根据字符串来实例化具体的子类，这对于某些需要动态配置程序的场合是很有用的。其他的应用如子窗体切换，算法替换等都能得到应用。unitExample1;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls;t...</summary><published>2008-04-16T09:19:00Z</published><updated>2008-04-16T09:19:00Z</updated><author><name>Icebird</name><uri>http://www.cnblogs.com/Icebird/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Icebird/archive/2008/04/16/GCAndRC.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Icebird/archive/2008/04/16/GCAndRC.html"/><content type="text">利用GetClass与RegisterClass可以实现根据字符串来实例化具体的子类，这对于某些需要动态配置程序的场合是很有用的。其他的应用如子窗体切换，算法替换等都能得到应用。unitExample1;interfaceusesWindows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs,StdCtrls;t...</content></entry><entry><id>http://www.cnblogs.com/Icebird/archive/2008/03/25/DelForExD11.html</id><title type="text">DelForEx v2.5 for Delphi 2007</title><summary type="text">Program: DelforExp, Delphi FormatterVersion: 2.5 for Delphi2007Description: DelforExp 是一个集成在Delphi IDE中对源代码进行格式化的工具。我手上的官方发布的版本无法支持Delphi 2007，强行使用Delphi 2006的也不能使用。因此只有自己动手根据源代码重新编译并做了必要的修改（DelForEx1...</summary><published>2008-03-25T04:20:00Z</published><updated>2008-03-25T04:20:00Z</updated><author><name>Icebird</name><uri>http://www.cnblogs.com/Icebird/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Icebird/archive/2008/03/25/DelForExD11.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Icebird/archive/2008/03/25/DelForExD11.html"/><content type="text">Program: DelforExp, Delphi FormatterVersion: 2.5 for Delphi2007Description: DelforExp 是一个集成在Delphi IDE中对源代码进行格式化的工具。我手上的官方发布的版本无法支持Delphi 2007，强行使用Delphi 2006的也不能使用。因此只有自己动手根据源代码重新编译并做了必要的修改（DelForEx1...</content></entry><entry><id>http://www.cnblogs.com/Icebird/archive/2008/03/23/Develop.html</id><title type="text">我的Delphi开发经验谈</title><summary type="text">--------开发环境--------  Delphi 7是一个很经典的版本，在Win2000/XP下推荐安装Delphi 7来开发软件，在Vista下推荐使用Delphi 2007开发软件。安装好Delphi 7后，应立即安装Delphi 7 Update Pack 1，Delphi 2007则建议尽量安装最新的版本。工欲善其事，必先利其器，为了提升开发效率，为了能更加得心应手的处理接下来的开发工作，我们有必要安装一些有用的开发辅助工具（Delphi将此类插件以Expert命名）。首先推荐的是DelForExp这个源代码格式化工具，集成在IDE里，使用相当方便。即使我所写代码的风格非常好，但是还是免不了阅读某些人写的乱七八糟的代码，这时DelForExp就能派上用场了，1秒钟就能让代码能看上去顺眼多了。GExperts曾经是一个非常出名的工具，可现在都不怎么更新了，里面有几个功能还是值得一用，比如Grep Search, Replace Components, Code Proofreader等。强烈推荐安装CnPack IDE 专家包，</summary><published>2008-03-23T14:17:00Z</published><updated>2008-03-23T14:17:00Z</updated><author><name>Icebird</name><uri>http://www.cnblogs.com/Icebird/</uri></author><link rel="alternate" href="http://www.cnblogs.com/Icebird/archive/2008/03/23/Develop.html"/><link rel="alternate" type="text/html" href="http://www.cnblogs.com/Icebird/archive/2008/03/23/Develop.html"/><content type="text">--------开发环境--------  Delphi 7是一个很经典的版本，在Win2000/XP下推荐安装Delphi 7来开发软件，在Vista下推荐使用Delphi 2007开发软件。安装好Delphi 7后，应立即安装Delphi 7 Update Pack 1，Delphi 2007则建议尽量安装最新的版本。工欲善其事，必先利其器，为了提升开发效率，为了能更加得心应手的处理接下来的开发工作，我们有必要安装一些有用的开发辅助工具（Delphi将此类插件以Expert命名）。首先推荐的是DelForExp这个源代码格式化工具，集成在IDE里，使用相当方便。即使我所写代码的风格非常好，但是还是免不了阅读某些人写的乱七八糟的代码，这时DelForExp就能派上用场了，1秒钟就能让代码能看上去顺眼多了。GExperts曾经是一个非常出名的工具，可现在都不怎么更新了，里面有几个功能还是值得一用，比如Grep Search, Replace Components, Code Proofreader等。强烈推荐安装CnPack IDE 专家包，</content></entry></feed>
