摘要: ```js // 旧版, 由于有递归, 时间空间复杂度太大 function fib1(n) { if (n === 1 || n === 2) { return 1; } else { return fib1(n 1) + fib1(n 2); } } // 新版, 不要递归, 只遍历一次 fun 阅读全文
posted @ 2017-11-14 16:06 shrekuu 阅读(107) 评论(0) 推荐(0) 编辑
摘要: jsonp 的本质就是在页面创建一个 script 标签引入一段 js 执行而已. 把 通过 url 传给后台, 后台返回一段 js 代码, 这段代码在这个 js 文件加载完后自动执行, 而正是在这段 js 代码里, 我们执行了 . 好, 我们来举个完整的例子. 我们要从域名 某页面发送请求到 . 阅读全文
posted @ 2016-12-19 14:20 shrekuu 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 这是这篇文字的源码, 将你的代码实时 POST 到 jsfiddle 来实现在 jsfiddle 运行的效果. 当你看到这些文字的时候, 你已经会会用 jsfiddle 给 MDN 开放使用的 API 了. 由于这些代码是 POST 到 jsfiddle 的, 你也不用新建 j... 阅读全文
posted @ 2016-01-08 18:47 shrekuu 阅读(445) 评论(0) 推荐(0) 编辑
摘要: 删掉原来的样式, 使用 bootstrap 3 框架重写。样式里有注释说明。 下载地址: http://git.oschina.net/shrekuu/typecho bootstrap theme https://github.com/shrekuu/typecho bootstrap the... 阅读全文
posted @ 2015-09-07 00:37 shrekuu 阅读(888) 评论(0) 推荐(0) 编辑
摘要: 转自:http://weblog.west-wind.com/posts/2007/Jul/04/JSONP-for-crosssite-CallbacksJSONP is an unofficial protocol that allows making cross domain calls by... 阅读全文
posted @ 2015-04-29 15:20 shrekuu 阅读(214) 评论(0) 推荐(0) 编辑
摘要: sudo sysctl -w net.inet.tcp.always_keepalive=9999// update file using this toolhttps://rsync.samba.org/ 阅读全文
posted @ 2015-02-11 16:28 shrekuu 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 出处:http://blog.chinaunix.net/uid-26642180-id-3378119.htmlSet uid, gid,sticky bit的三个权限的详细说明一个文件都有一个所有者, 表示该文件是谁创建的. 同时, 该文件还有一个组编号, 表示该文件所属的组, 一般为文件所有者... 阅读全文
posted @ 2014-10-10 13:41 shrekuu 阅读(631) 评论(0) 推荐(0) 编辑
摘要: fibonacci 阅读全文
posted @ 2014-08-04 10:39 shrekuu 阅读(4076) 评论(0) 推荐(0) 编辑
摘要: var obj = (function() { var privateFn = function() { alert(this.id); } return { id: 123, publicFn: function() { ... 阅读全文
posted @ 2014-05-29 13:00 shrekuu 阅读(188) 评论(0) 推荐(0) 编辑
摘要: pear 升级了,不支持命令行安装 phpunit,这明显是作死的的节奏。看到大家都在用 composer 管理 php 依赖。windows 用户:从官网【http://getcomposer.com】下载 exe 文件运行一下就装好了。(查看一下加到系统变量里没)然后就可以参考 phpunit ... 阅读全文
posted @ 2014-05-03 19:02 shrekuu 阅读(225) 评论(0) 推荐(0) 编辑