Stay Hungry,Stay Foolish!

摘要: 函数重载 https://en.wikipedia.org/wiki/Function_overloading In some programming languages, function overloading or method overloading is the ability to cr 阅读全文
posted @ 2016-11-14 22:43 lightsong 阅读(1122) 评论(0) 推荐(0)
摘要: 二维码 http://www.baike.com/wiki/%E4%BA%8C%E7%BB%B4%E7%A0%81 二维条码/二维码(2-dimensional bar code)是用某种特定的几何图形按一定规律在平面(二维方向上)分布的黑白相间的图形记录数据符号信息的;在代码编制上巧妙地利用构成计 阅读全文
posted @ 2016-11-14 22:09 lightsong 阅读(18620) 评论(0) 推荐(0)
摘要: 功能背景 大部网站都有菜单功能, 每个页面都有ajax更新页数据请求, 如何将页面上的所有菜单的页面都保存下来本地PC? 后续可以在本地PC上浏览页面。 前面一个文章 利用phantomjs可以抓取单个页面的并保存到PC, 可以本地浏览。 http://www.cnblogs.com/lightso 阅读全文
posted @ 2016-11-06 21:29 lightsong 阅读(773) 评论(0) 推荐(0)
摘要: 什么是? http://www.w3school.com.cn/xsl/xsl_intro.asp XSLT 是一种用于将 XML 文档转换为 XHTML 文档或其他 XML 文档的语言。 XPath 是一种用于在 XML 文档中进行导航的语言。 什么是 XSLT? XSLT 指 XSL 转换(XS 阅读全文
posted @ 2016-11-04 23:56 lightsong 阅读(630) 评论(0) 推荐(0)
摘要: lua no class It is a prototype based language。 在此语言中没有class关键字来创建类。 现代ES6, 已经添加class类。 prototype based 语言没啥优势。 lua 如何构建class机制? https://github.com/fan 阅读全文
posted @ 2016-11-04 22:59 lightsong 阅读(2281) 评论(0) 推荐(0)
摘要: 背景 现代页面上越来越多的内容是通过ajax更新, 因为页面可以显示的更加快速, 局部更新, 同时可以实现页面内容的动态性, 增加页面的内容的丰富性。 但是如果将页面内容保存下来, 以备离线浏览器查看, 则由于ajax存在的原因, 直接使用保存的方法不能实现, 因为会有ajax访问禁用的报错。 对于 阅读全文
posted @ 2016-10-17 23:26 lightsong 阅读(788) 评论(0) 推荐(0)
摘要: Cyassl库 https://wolfssl.com/wolfSSL/Docs-wolfssl-manual-17-8-wolfssl-api-connection-session-io.html int CyaSSL_read(CYASSL* ssl, void* data, int sz); 阅读全文
posted @ 2016-10-04 20:20 lightsong 阅读(8317) 评论(0) 推荐(0)
摘要: Prototype-based programming https://en.wikipedia.org/wiki/Prototype-based_programming Prototype-based programming is a style of object-oriented progra 阅读全文
posted @ 2016-09-26 23:06 lightsong 阅读(423) 评论(0) 推荐(0)
摘要: 背景 lua是类是借助表的来实现的, 类被定义后, 在使用场景下, 不希望被修改。如果被修改, 则影响的类的原始定义, 影响所有使用类的地方。 例如: 故提出新的要求: 1、 对于类在应用场景下,不能修改属性。 2、 对于类在应用场景下, 不能添加新的属性。 类的实现代码: 他山之石 http:// 阅读全文
posted @ 2016-09-25 19:06 lightsong 阅读(2626) 评论(0) 推荐(0)
摘要: HTML5 video https://github.com/remy/html5demos/blob/master/demos/video.html HTML5支持video和audio之前, 网页播放流媒体文件, 都是通过其它方法, 例如 activex插件 或者 flash。 支持后,页面可以 阅读全文
posted @ 2016-09-20 23:23 lightsong 阅读(31457) 评论(1) 推荐(0)
摘要: commonjs http://www.commonjs.org/ CommonJS JavaScript is a powerful object oriented language with some of the fastest dynamic language interpreters ar 阅读全文
posted @ 2016-09-19 00:11 lightsong 阅读(542) 评论(0) 推荐(0)
摘要: websocket 2011年技术文档 http://www.ibm.com/developerworks/cn/web/1112_huangxa_websocket/index.html 浏览器端接口: https://developer.mozilla.org/en-US/docs/Web/AP 阅读全文
posted @ 2016-09-17 23:36 lightsong 阅读(2390) 评论(0) 推荐(0)
摘要: 背景 对于OO思想实现的类, 对于某些场景需要屏蔽某些方法, 不让调用。过了这段场景, 就恢复这些类的方法, 可以调用。 例如: 工厂具有开工方法, 但是在晚上不允许开工, 所有在晚上这段时间, 见开工方法屏蔽掉, 到第二天早上八点将此方法恢复。 实现 LOG: >lua -e "io.stdout 阅读全文
posted @ 2016-09-17 19:39 lightsong 阅读(1324) 评论(0) 推荐(0)
摘要: http://wenku.baidu.com/view/0f4acf88cc22bcd126ff0ca2.html?re=view 1 标准和目标 1.1前言目前开源的网管软件众多,时间关系只能通过网络上的资料介绍和其他用户的体验进行评估。对于重点调查的开源软件通过运行环境搭建、开发环境搭建的方法进 阅读全文
posted @ 2016-09-15 22:41 lightsong 阅读(2305) 评论(0) 推荐(0)
摘要: Unit Test Unit testing is about testing your code during development, not in production. Typically you start by preparing the testing environment, wri 阅读全文
posted @ 2016-09-15 21:09 lightsong 阅读(2416) 评论(0) 推荐(0)
摘要: 背景 前面的文章演示了使用闭包函数实现 状态的迭代器。 本文演示使用 coroutine来产生迭代器的例子。 coroutine迭代器例子 -- 遍历二叉树 LOG: >lua -e "io.stdout:setvbuf 'no'" "luatest.lua" 13455.577.4911>Exit 阅读全文
posted @ 2016-09-15 00:29 lightsong 阅读(563) 评论(0) 推荐(0)
摘要: table.maxn (table) Returns the largest positive numerical index of the given table, or zero if the table has no positive numerical indices. (To do its 阅读全文
posted @ 2016-09-15 00:19 lightsong 阅读(631) 评论(0) 推荐(0)
摘要: 迭代器 http://www.tutorialspoint.com/lua/lua_iterators.htm 迭代器能够让你遍历某个集合或者容器中的每一个元素。 对于lua来说, 集合通常指代 table, 用于创建变化的数据结构, 类似数组。 Iterator is a construct th 阅读全文
posted @ 2016-09-04 21:33 lightsong 阅读(1118) 评论(0) 推荐(0)
摘要: https://www.owasp.org/images/0/04/Roberto_Suggi_Liverani_OWASPNZDAY2010-Defending_against_application_DoS.pdf slowloris http://www.huffingtonpost.co.u 阅读全文
posted @ 2016-08-21 23:00 lightsong 阅读(368) 评论(0) 推荐(0)
摘要: 是什么? https://www.promisejs.org/ What is a promise? The core idea behind promises is that a promise represents the result of an asynchronous operation. 阅读全文
posted @ 2016-08-21 16:36 lightsong 阅读(1099) 评论(0) 推荐(0)
摘要: 问题 attempt to yield across metamethod/C-call boundary 需求跟如下帖子中描述一致: http://bbs.chinaunix.net/forum.php?mod=viewthread&action=printable&tid=4065715 模拟一 阅读全文
posted @ 2016-08-18 22:30 lightsong 阅读(5557) 评论(0) 推荐(0)
摘要: 问题 web framework是否包括webserver? 是否可以包括? webserver 和 framework的关系是? https://www.quora.com/What-is-the-difference-between-a-web-server-and-a-web-framewor 阅读全文
posted @ 2016-08-18 00:11 lightsong 阅读(485) 评论(0) 推荐(0)
摘要: throttle http://www.iciba.com/throttle N-COUNT (汽车、飞机的)节流阀,油门杆,油门踏板 The throttle of a motor vehicle or aircraft is the device, lever, or pedal that co 阅读全文
posted @ 2016-08-17 23:38 lightsong 阅读(1095) 评论(0) 推荐(0)
摘要: 背景 最近解决lua的一则协程问题, 需要将一个patch添加到我们自己的lua库代码中, 由于我们整合的lua库代码目录,与原始的lua库代码不一致,导致不能直接使用path应用到我们自己的lua代码中, 所以需要将path做成 old&new文件夹, 使用merge工具, 手动同步到我们的lua 阅读全文
posted @ 2016-08-17 21:53 lightsong 阅读(760) 评论(0) 推荐(0)
摘要: 什么是环境? http://www.lua.org/manual/5.1/manual.html#2.9 Besides metatables, objects of types thread, function, and userdata have another table associated 阅读全文
posted @ 2016-08-07 22:23 lightsong 阅读(1078) 评论(0) 推荐(0)
摘要: module 与 package.seeall http://blog.codingnow.com/2006/02/lua_51_module.html 使用 module("test") 后,下面不再看的见前面的全局环境。如果在这个模块里想调用 print 输出调试信息怎么办呢?一个简单的方法是 local print=printmodule("test") 这样 print 是一个 loc... 阅读全文
posted @ 2016-08-06 01:30 lightsong 阅读(3907) 评论(0) 推荐(0)
摘要: module 作用 module (name [, ···]) Creates a module. If there is a table in package.loaded[name], this table is the module. Otherwise, if there is a global table t with the given name, this table is the... 阅读全文
posted @ 2016-08-06 00:25 lightsong 阅读(406) 评论(0) 推荐(0)
摘要: 数学中的链式法则 http://sx.zxxk.com/ArticleInfo.aspx?InfoID=164649 链式微分法则:实数运算的链式法则:对数运算的链式法则:平行公理的链式法则:向量运算的链式法则: JS对象链式调用方法http://stackoverflow.com/questions/15029309/how-to-write-jquery-chainable-functi... 阅读全文
posted @ 2016-08-04 22:33 lightsong 阅读(1126) 评论(0) 推荐(0)
摘要: 什么是函数式编程 http://www.zhihu.com/topic/19585411/hot 函数式编程的本质函数式编程中的函数这个术语不是指计算机中的函数(实际上是Subroutine),而是指数学中的函数,即自变量的映射。也就是说一个函数的值仅决定于函数参数的值,不依赖其他状态。比如sqrt(x)函数计算x的平方根,只要x不变,不论什么时候调用,调用几次,值都是不变的。在函数式语言中,函... 阅读全文
posted @ 2016-07-24 23:41 lightsong 阅读(1559) 评论(0) 推荐(0)
摘要: 介绍 http://keplerproject.github.io/orbit/ Orbit是lua语言版本的MVC框架。 此框架完全抛弃CGILUA的脚本模型, 支持的应用, 每个应用可以卸载一个单独的文件中,当然你也可以将它拆为一个文件, 当你需要时候。 此框架运行在WSAPI协议的服务器上,所以可以工作在 Xavante和一些CGI和fastcgi程序上。 Orbit is an MVC ... 阅读全文
posted @ 2016-07-23 00:21 lightsong 阅读(3450) 评论(0) 推荐(0)
摘要: 模板引擎 模板引擎 起到 数据和视图分离的作用, 模板对应视图, 关注如何展示数据, 在模板外头准备的数据, 关注那些数据可以被展示。 后端模板引擎 freemarker 如下介绍, java后台的模板引擎, freemark介绍,其图能很好标明这种关系。 http://freemarker.org 阅读全文
posted @ 2016-07-20 23:32 lightsong 阅读(10012) 评论(0) 推荐(0)
摘要: autocomplete方法 https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion#The_autocomplete_attribute_and_login_fields 对于普通的表单区域 此属性设置为 off,具有阻止浏览器记忆的功能 S... 阅读全文
posted @ 2016-07-14 00:27 lightsong 阅读(1011) 评论(0) 推荐(0)
摘要: 背景 经常区分不了 界 和 级 的区别, 不清楚入学和毕业应该使用哪个词语, 这里记录下我的研究,并谈谈我的理解,以帮助正确使用这两个词。 http://home.51.com/founderyao/diary/item/10042245.html 说文解字 界 http://www.zdic.net/z/18/js/5C4A.htm 基本字义 ● 届 jiè ㄐㄧㄝˋ 1. 到:~... 阅读全文
posted @ 2016-07-10 19:43 lightsong 阅读(6957) 评论(0) 推荐(0)
摘要: 原理 http://www.cnblogs.com/skynet/p/4173450.html 快速通用网关接口(Fast Common Gateway Interface/FastCGI)是通用网关接口(CGI)的改进,描述了客户端和服务器程序之间传输数据的一种标准。FastCGI致力于减少Web 阅读全文
posted @ 2016-07-03 23:47 lightsong 阅读(5456) 评论(0) 推荐(0)
摘要: pack和unpack 对于一个函数, 要将其入参转换为一个表, 则pack函数合适。 对于一个表要将其转换为 一个函数的入参, 则 lua原生提供的 unpack函数可以实现。 do arrayData = {"a", "b", "c", "d", "e"}; function pack(...) return {...}; end print( pack("aa", "bb"... 阅读全文
posted @ 2016-06-30 00:14 lightsong 阅读(438) 评论(0) 推荐(0)
摘要: 什么是兼容性? compatible http://www.webopedia.com/TERM/C/compatible.html (n) Indicates that a product can work with or is equivalent to another, better-know 阅读全文
posted @ 2016-06-30 00:00 lightsong 阅读(2740) 评论(3) 推荐(0)
摘要: 安装 参考如下博文安装thttpd软件 http://blog.csdn.net/21aspnet/article/details/7045845 http://blog.csdn.net/dragoncheng/article/details/5614559 thttpd配置文件: root@fqs:/usr/local/bin# cat /usr/local/thttpd/conf/ e... 阅读全文
posted @ 2016-06-26 23:06 lightsong 阅读(2044) 评论(0) 推荐(0)
摘要: 安装软件 需要安装三个lua 库: xavante wsapi cgilua luarocks install xavante http://keplerproject.github.io/xavante/manual.html#install Xavante is a Lua HTTP 1.1 Web server that uses a modular architecture base... 阅读全文
posted @ 2016-06-22 23:16 lightsong 阅读(844) 评论(0) 推荐(0)
摘要: seajs http://seajs.org/docs/en.html#intro https://github.com/seajs/seajs/releases Extremely simple experience of modular development Why use Sea.js ? Sea.js's pursuit of a simple, natural coding a... 阅读全文
posted @ 2016-06-13 22:49 lightsong 阅读(289) 评论(0) 推荐(0)
摘要: 是什么? http://brackets.io/ A modern, open source text editor that understands web design. 现代, 开源的文本编辑器, 最懂得web设计。 With focused visual tools and preprocessor support, Brackets is a modern text editor t... 阅读全文
posted @ 2016-06-12 22:10 lightsong 阅读(1682) 评论(1) 推荐(0)
千山鸟飞绝,万径人踪灭