摘要:
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
阅读(371)
推荐(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
阅读(1101)
推荐(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
阅读(5574)
推荐(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
阅读(487)
推荐(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
阅读(1102)
推荐(0)
摘要:
背景 最近解决lua的一则协程问题, 需要将一个patch添加到我们自己的lua库代码中, 由于我们整合的lua库代码目录,与原始的lua库代码不一致,导致不能直接使用path应用到我们自己的lua代码中, 所以需要将path做成 old&new文件夹, 使用merge工具, 手动同步到我们的lua
阅读全文
posted @ 2016-08-17 21:53
lightsong
阅读(765)
推荐(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
阅读(1084)
推荐(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
阅读(3918)
推荐(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
阅读(408)
推荐(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
阅读(1128)
推荐(0)
摘要:
什么是函数式编程 http://www.zhihu.com/topic/19585411/hot 函数式编程的本质函数式编程中的函数这个术语不是指计算机中的函数(实际上是Subroutine),而是指数学中的函数,即自变量的映射。也就是说一个函数的值仅决定于函数参数的值,不依赖其他状态。比如sqrt(x)函数计算x的平方根,只要x不变,不论什么时候调用,调用几次,值都是不变的。在函数式语言中,函...
阅读全文
posted @ 2016-07-24 23:41
lightsong
阅读(1563)
推荐(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
阅读(3457)
推荐(0)
摘要:
模板引擎 模板引擎 起到 数据和视图分离的作用, 模板对应视图, 关注如何展示数据, 在模板外头准备的数据, 关注那些数据可以被展示。 后端模板引擎 freemarker 如下介绍, java后台的模板引擎, freemark介绍,其图能很好标明这种关系。 http://freemarker.org
阅读全文
posted @ 2016-07-20 23:32
lightsong
阅读(10018)
推荐(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
阅读(1021)
推荐(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
阅读(6997)
推荐(0)
摘要:
原理 http://www.cnblogs.com/skynet/p/4173450.html 快速通用网关接口(Fast Common Gateway Interface/FastCGI)是通用网关接口(CGI)的改进,描述了客户端和服务器程序之间传输数据的一种标准。FastCGI致力于减少Web
阅读全文
posted @ 2016-07-03 23:47
lightsong
阅读(5479)
推荐(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
阅读(444)
推荐(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
阅读(2747)
推荐(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
阅读(2050)
推荐(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
阅读(847)
推荐(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
阅读(294)
推荐(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
阅读(1687)
推荐(0)
摘要:
什么是luaprofiler? http://luaprofiler.luaforge.net/manual.html LuaProfiler is a time profiler designed to help finding bottlenecks on your Lua program. If you use LuaProfiler into your program, it will ...
阅读全文
posted @ 2016-06-11 22:28
lightsong
阅读(3091)
推荐(0)
摘要:
背景描述 编程或者文档处理过程, 经常遇到需要将一个单词修改为另外一个单词的情况, 例如 命名为 shall 修改 为 should。 使用工具实现, 则比较方便,不容易出错, 解放双手。 需求规格 对于某个文件夹中的所有文本文件(txt), 将某个单词替换为目标单词。 实现思路 对于替换的单词映射, 在配置文件config.lua进行设置, 存储一个表,表中每一行 对应 src voc...
阅读全文
posted @ 2016-06-11 21:33
lightsong
阅读(3042)
推荐(0)
摘要:
什么是Markdown http://note.youdao.com/iyoudao/?p=1895 Markdown是一种轻量级的「标记语言」。是为那些经常需要码字或者进行文字排版的、对码字手速和排版顺畅度有要求的人群设计的,他们希望用键盘把文字内容打出来的同时搞定排版,最好从头到尾都不要使用鼠标。这些人最常见的是经常需要写文档的码农,另外包括博客写手、网站小编、出版业人士等等。 如果你是程...
阅读全文
posted @ 2016-05-31 22:00
lightsong
阅读(678)
推荐(0)
摘要:
什么是 keep-alive 连接 https://en.wikipedia.org/wiki/HTTP_persistent_connection HTTP persistent connection, also called HTTP keep-alive, or HTTP connection reuse, is the idea of using a single TCP connect...
阅读全文
posted @ 2016-05-29 22:44
lightsong
阅读(458)
推荐(0)
摘要:
emoji是什么? http://www.baike.com/wiki/emoji emoji表情符号,是20世纪90年代由NTT Docomo栗田穣崇(Shigetaka Kurit)创建的,词义来自日语(えもじ,e-moji,moji在日语中的含义是字符)。 emoji可以使数字通信做到让人如同面对面交流,避免错误传达信息。 自苹果公司发布的iOS 5输入法中加入了emoji后,这种表情符号开...
阅读全文
posted @ 2016-05-18 23:38
lightsong
阅读(1948)
推荐(0)
摘要:
问题 使用原生的setTimeout和setInterval仅仅能够实现, 定时执行事件处理函数, 在网页开发中, 往往会出现一种情况,定时器用于定时更新某个页面区域的数据, 往往在页面加载之后, 就启动这个定时器, 往后则间隔执行此定时器。 页面上定时刷新的区域可能会动态消失, 特别是在ajax被广泛使用的今天, 如果定时刷新的区域被删除了, 则定时器材也需要自动清除掉。 此二个接口...
阅读全文
posted @ 2016-05-06 22:28
lightsong
阅读(1416)
推荐(0)
摘要:
需求介绍 在编码或者调试过程中经常需要进行 字节码转换为 十六进制的字符串, 或者将 十六进制字符串 转换为 字节码的需求。 即: 字节码 (内存中存储的 01 串): 11111111 FF Code linux上调试通过。 #include #include #include // Stringify binary data. Output buffer must be ...
阅读全文
posted @ 2016-05-02 00:04
lightsong
阅读(1864)
推荐(0)
摘要:
单例 存在这么一类class, 无论class怎么初始化, 产生的instance都是同一个对象。 Code string.toHTMLCode = function(self) return encodeHTML(self) end -- Instantiates a class local fu
阅读全文
posted @ 2016-05-01 00:03
lightsong
阅读(1261)
推荐(0)
摘要:
lua原生不支持OOP特性 确实如此, 同时可以采用其它lua代码的方式实现OOP的特性。 OOP四大特性 抽象 封装 继承 多态 http://www.cnblogs.com/xiaosongluffy/p/5072501.html 四大基本特性: 抽象:提取现实世界中某事物的关键特性,为该事物构建模型的过程。对同一事物在不同的需求下,需要提取的特性可能不一样。得到的抽象模型中一般包含:属...
阅读全文
posted @ 2016-04-30 23:56
lightsong
阅读(858)
推荐(0)
摘要:
分离构造和使用 构造含义是功能的实现, 此功能是一个定义明确的处理过程, 开放出明确的接口给调用者使用。 则使用者可以直接调用接口进行使用, 但是使用者需要搞清楚, 那些是构造, 那些是使用。 不要再使用的地方, 将构造的代码也实现。 否则, 构造的代码会淹没掉 使用地方的 业务逻辑。 LUA需求 在一个lua表中, 查询指定参数名称的参数值, 并将此参数值转换为 html encode编码...
阅读全文
posted @ 2016-04-30 23:34
lightsong
阅读(341)
推荐(0)
摘要:
相同name的submit 类型的input提交行为 描述 这种情况, 其能够作为提交内容, 发送到服务器段的参数的按钮, 对应被点击激活的按钮。 这表示多个 同名的name, 一次提交只能激活一个。 例如点击了 apply, ACTION=Apply会被传送到服务器端。 这样服务器端就可以判断对于同样提交的一份数据, 需要执行什么样的操作, 是修改...
阅读全文
posted @ 2016-04-30 22:45
lightsong
阅读(808)
推荐(0)
摘要:
困扰 设计师给出静态的高保真图片, 需要前端工程师按照高保真图,进行html编码。 前端工程师, 一般工作方法为: 打开图片,一边看下图片, 一边编写相应的html代码。 这样有两个问题: 1、 前端工程师比较累, 不停切换 图片和 编辑器, 操作频繁。手累! 2、 编写出来的html页面,不一定跟
阅读全文
posted @ 2016-04-30 22:19
lightsong
阅读(14389)
推荐(0)
摘要:
问题背景 实验中, 在jquery1.7版本, attr("value") 和 val() 接口获取 input 控件的值, 都是一致的, 都是当前控件值。 但是 jquery1.11版本,已经将 这两个接口的返回值分离, attr("value") 获取的是 控件的初始值(default valu
阅读全文
posted @ 2016-04-28 00:17
lightsong
阅读(625)
推荐(0)
摘要:
luagd 官网: http://ittner.github.io/lua-gd/ 下载 http://files.luaforge.net/releases/lua-gd/lua-gd/lua-gd-2.0.33r2forLua5.1 Lua-GD is a set of Lua bindings
阅读全文
posted @ 2016-04-04 22:32
lightsong
阅读(947)
推荐(1)
摘要:
lua2c is a Lua module and utility to convert Lua 5.1 source code to C API code. http://lua-users.org/wiki/LuaToCee This utility converts a given Lua s
阅读全文
posted @ 2016-03-20 21:29
lightsong
阅读(822)
推荐(0)
摘要:
tapping of data 在数据交互的过程 数据被 窃听到。 例如, 网站的账户被泄露, 在用户登陆过程中, 其账号被第三方偷到。 tapping 含义 看看 youdao 词典解释: n. [冶] 出钢;开孔;出渣;轻敲声 v. 轻敲(tap的ing形式);轻拍 n. (Tapping)人名;(英)塔平 貌似, 开孔、放液体 和 分支 比较接近。 Telepho...
阅读全文
posted @ 2016-03-01 00:12
lightsong
阅读(1284)
推荐(0)
摘要:
强制门户 http://www.whatis.com.cn/word_5182.htm 强制网络门户(captive portal)是一个Web页面,它是使用公共访问网络的用户在被授予访问权限前必须访问和交互的页面。强制网络门户通常在为因特网用户提供免费的Wi-Fi热点服务的商业中心、机场、宾馆大厅、咖啡厅和其他公共场所中使用。 在一个带有强制网络门户的网络中,一个用户第一次登录的时候,在...
阅读全文
posted @ 2016-02-29 23:49
lightsong
阅读(5253)
推荐(0)
摘要:
HTTP协议上传文件-协议 上传文件需要将form标签 的 ENCTYPE 属性设置为 multipart/form-data属性, 与 application/x-www-form-urlencoded类型不同, 此类型专门设计用来上传文件, 而前者用来传输数据, 可以允许若干 控件域 同时上传其
阅读全文
posted @ 2016-02-21 23:34
lightsong
阅读(4620)
推荐(0)