虚拟机,编译原理,应用框架

2012年5月3日

用nodejs实现支持pac脚本的代理

摘要: 公司内的网络有点搞笑,需要配置pac脚本才能访问外网,但是除了浏览器之外的软件,大部分都不支持pac脚本的代理,也就一部分软件支持使用IE的代理,幸免遇难。平时也就忍了,前段时间想装个archlinux的虚拟机,发现连pacman都用不了,google了很久也没有找到一个代理软件支持pac脚本的,于是乎想到用nodejs写一个,因为pac脚本本身是js的,所以实现起来应该比较方便。首先认识一下pac脚本吧:http://en.wikipedia.org/wiki/Proxy_auto-config看来真正的代理服务器我们不用去实现了,我们仅需要实现一个能够根据用户请求的网址交给pac脚本去计算 阅读全文

posted @ 2012-05-03 21:55 文宇祥 阅读(5041) 评论(7) 推荐(3) 编辑

2008年10月31日

准备写一个世界第一快的js的css3 selector engine

摘要: 我在看sizzle和peppy的源代码,发现他们的速度还有提升的空间, 我准备使用jit技术实现一个世界最快的javascript css3 selector engine. css3选择器也有一些不方便 比如说伪类选择器,只运行"且"选择,不运行"或"选择,要"或"的话,把前面的抄下来吧,效率低多了. 经过jit编译过后的selector成为一个函数,接受一个参数ct,表示容器.选择器将从这... 阅读全文

posted @ 2008-10-31 00:18 文宇祥 阅读(1032) 评论(1) 推荐(0) 编辑

2008年8月30日

javascript OOP:实现继承、多态与封装

摘要: 代码是随手写的,只提供思路。 这个原理很简单,看代码就懂,不多说了。 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->(function (){ var h = 0; handle = function (){return h++};... 阅读全文

posted @ 2008-08-30 23:55 文宇祥 阅读(595) 评论(1) 推荐(0) 编辑

2008年8月15日

利用xslt扩展html

摘要: test.xml Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> test.xsl Code highlighting produced by Actipro CodeHighlighter ... 阅读全文

posted @ 2008-08-15 17:27 文宇祥 阅读(481) 评论(0) 推荐(0) 编辑

2008年8月7日

private constructor的模拟

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->(function (Package){ var _key = {}; var ClassA = function (key_){ if (_key !== ke... 阅读全文

posted @ 2008-08-07 09:56 文宇祥 阅读(241) 评论(0) 推荐(0) 编辑

2008年8月4日

利用apply来进行参数传递和转换

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->function t(){ var fns = Array.prototype.concat.apply([], arguments); for (var i = 0; i < ... 阅读全文

posted @ 2008-08-04 10:46 文宇祥 阅读(461) 评论(0) 推荐(0) 编辑

2008年8月1日

代理constructor,prototype且不让instanceof失效

摘要: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->function NewClasse(superclass){ return function classe(){ if (classe.prototype != sup... 阅读全文

posted @ 2008-08-01 01:34 文宇祥 阅读(285) 评论(0) 推荐(0) 编辑

2008年7月31日

javascript实现StrExp

摘要: 主要实现了类似jsp里的el表达式的功能,甚至于比el表达式更加强大。 思路很简单,就是利用eval绑定可见域。利用这个思路可以作出很多强大的东西。 当前其中也用到了String.prototype.replace的强大功能。 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.Cod... 阅读全文

posted @ 2008-07-31 15:44 文宇祥 阅读(674) 评论(0) 推荐(0) 编辑

2008年7月28日

javascript: LoadModule, LoadModules

摘要: 注意这里使用Function来避免eval的可见域问题。 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> function loadModule(/*Module*/mod/*location*/, /*Function*/cb/*ca... 阅读全文

posted @ 2008-07-28 22:43 文宇祥 阅读(1041) 评论(0) 推荐(0) 编辑

2008年7月27日

javascript实现yield

摘要: 没想到代码一次测试成功.~~只不过是FF下面,修改一下支持IE了。由于IE不认function表达式. Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->var Iterator = function (fn) { var corou... 阅读全文

posted @ 2008-07-27 16:12 文宇祥 阅读(2892) 评论(7) 推荐(0) 编辑

导航