Stay Hungry,Stay Foolish!

摘要: 背景 经常区分不了 界 和 级 的区别, 不清楚入学和毕业应该使用哪个词语, 这里记录下我的研究,并谈谈我的理解,以帮助正确使用这两个词。 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 阅读(6562) 评论(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 阅读(4958) 评论(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 阅读(384) 评论(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 阅读(2664) 评论(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 阅读(1958) 评论(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 阅读(818) 评论(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 阅读(275) 评论(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 阅读(1520) 评论(1) 推荐(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 阅读(3022) 评论(0) 推荐(0) 编辑
摘要: 背景描述 编程或者文档处理过程, 经常遇到需要将一个单词修改为另外一个单词的情况, 例如 命名为 shall 修改 为 should。 使用工具实现, 则比较方便,不容易出错, 解放双手。 需求规格 对于某个文件夹中的所有文本文件(txt), 将某个单词替换为目标单词。 实现思路 对于替换的单词映射, 在配置文件config.lua进行设置, 存储一个表,表中每一行 对应 src voc... 阅读全文
posted @ 2016-06-11 21:33 lightsong 阅读(2988) 评论(0) 推荐(0) 编辑
摘要: 什么是Markdown http://note.youdao.com/iyoudao/?p=1895 Markdown是一种轻量级的「标记语言」。是为那些经常需要码字或者进行文字排版的、对码字手速和排版顺畅度有要求的人群设计的,他们希望用键盘把文字内容打出来的同时搞定排版,最好从头到尾都不要使用鼠标。这些人最常见的是经常需要写文档的码农,另外包括博客写手、网站小编、出版业人士等等。 如果你是程... 阅读全文
posted @ 2016-05-31 22:00 lightsong 阅读(639) 评论(0) 推荐(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 阅读(438) 评论(0) 推荐(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 阅读(1882) 评论(0) 推荐(0) 编辑
摘要: 问题 使用原生的setTimeout和setInterval仅仅能够实现, 定时执行事件处理函数, 在网页开发中, 往往会出现一种情况,定时器用于定时更新某个页面区域的数据, 往往在页面加载之后, 就启动这个定时器, 往后则间隔执行此定时器。 页面上定时刷新的区域可能会动态消失, 特别是在ajax被广泛使用的今天, 如果定时刷新的区域被删除了, 则定时器材也需要自动清除掉。 此二个接口... 阅读全文
posted @ 2016-05-06 22:28 lightsong 阅读(1383) 评论(0) 推荐(0) 编辑
摘要: 需求介绍 在编码或者调试过程中经常需要进行 字节码转换为 十六进制的字符串, 或者将 十六进制字符串 转换为 字节码的需求。 即: 字节码 (内存中存储的 01 串): 11111111 FF Code linux上调试通过。 #include #include #include // Stringify binary data. Output buffer must be ... 阅读全文
posted @ 2016-05-02 00:04 lightsong 阅读(1798) 评论(0) 推荐(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 阅读(1192) 评论(0) 推荐(0) 编辑
摘要: lua原生不支持OOP特性 确实如此, 同时可以采用其它lua代码的方式实现OOP的特性。 OOP四大特性 抽象 封装 继承 多态 http://www.cnblogs.com/xiaosongluffy/p/5072501.html 四大基本特性: 抽象:提取现实世界中某事物的关键特性,为该事物构建模型的过程。对同一事物在不同的需求下,需要提取的特性可能不一样。得到的抽象模型中一般包含:属... 阅读全文
posted @ 2016-04-30 23:56 lightsong 阅读(837) 评论(0) 推荐(0) 编辑
摘要: 分离构造和使用 构造含义是功能的实现, 此功能是一个定义明确的处理过程, 开放出明确的接口给调用者使用。 则使用者可以直接调用接口进行使用, 但是使用者需要搞清楚, 那些是构造, 那些是使用。 不要再使用的地方, 将构造的代码也实现。 否则, 构造的代码会淹没掉 使用地方的 业务逻辑。 LUA需求 在一个lua表中, 查询指定参数名称的参数值, 并将此参数值转换为 html encode编码... 阅读全文
posted @ 2016-04-30 23:34 lightsong 阅读(329) 评论(0) 推荐(0) 编辑
摘要: 相同name的submit 类型的input提交行为 描述 这种情况, 其能够作为提交内容, 发送到服务器段的参数的按钮, 对应被点击激活的按钮。 这表示多个 同名的name, 一次提交只能激活一个。 例如点击了 apply, ACTION=Apply会被传送到服务器端。 这样服务器端就可以判断对于同样提交的一份数据, 需要执行什么样的操作, 是修改... 阅读全文
posted @ 2016-04-30 22:45 lightsong 阅读(769) 评论(0) 推荐(0) 编辑
摘要: 困扰 设计师给出静态的高保真图片, 需要前端工程师按照高保真图,进行html编码。 前端工程师, 一般工作方法为: 打开图片,一边看下图片, 一边编写相应的html代码。 这样有两个问题: 1、 前端工程师比较累, 不停切换 图片和 编辑器, 操作频繁。手累! 2、 编写出来的html页面,不一定跟 阅读全文
posted @ 2016-04-30 22:19 lightsong 阅读(14344) 评论(0) 推荐(0) 编辑
摘要: 问题背景 实验中, 在jquery1.7版本, attr("value") 和 val() 接口获取 input 控件的值, 都是一致的, 都是当前控件值。 但是 jquery1.11版本,已经将 这两个接口的返回值分离, attr("value") 获取的是 控件的初始值(default valu 阅读全文
posted @ 2016-04-28 00:17 lightsong 阅读(598) 评论(0) 推荐(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 阅读(875) 评论(0) 推荐(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 阅读(769) 评论(0) 推荐(0) 编辑
摘要: tapping of data 在数据交互的过程 数据被 窃听到。 例如, 网站的账户被泄露, 在用户登陆过程中, 其账号被第三方偷到。 tapping 含义 看看 youdao 词典解释: n. [冶] 出钢;开孔;出渣;轻敲声 v. 轻敲(tap的ing形式);轻拍 n. (Tapping)人名;(英)塔平 貌似, 开孔、放液体 和 分支 比较接近。 Telepho... 阅读全文
posted @ 2016-03-01 00:12 lightsong 阅读(1248) 评论(0) 推荐(0) 编辑
摘要: 强制门户 http://www.whatis.com.cn/word_5182.htm 强制网络门户(captive portal)是一个Web页面,它是使用公共访问网络的用户在被授予访问权限前必须访问和交互的页面。强制网络门户通常在为因特网用户提供免费的Wi-Fi热点服务的商业中心、机场、宾馆大厅、咖啡厅和其他公共场所中使用。 在一个带有强制网络门户的网络中,一个用户第一次登录的时候,在... 阅读全文
posted @ 2016-02-29 23:49 lightsong 阅读(4901) 评论(0) 推荐(0) 编辑
摘要: HTTP协议上传文件-协议 上传文件需要将form标签 的 ENCTYPE 属性设置为 multipart/form-data属性, 与 application/x-www-form-urlencoded类型不同, 此类型专门设计用来上传文件, 而前者用来传输数据, 可以允许若干 控件域 同时上传其 阅读全文
posted @ 2016-02-21 23:34 lightsong 阅读(4413) 评论(0) 推荐(0) 编辑
摘要: 参考资料 https://en.wikipedia.org/wiki/Self-signed_certificate http://mt.sohu.com/20150602/n414267586.shtml http://www.1111wo----sign.++++com/FAQ/CRL_OSCP 阅读全文
posted @ 2016-02-13 23:46 lightsong 阅读(4683) 评论(0) 推荐(0) 编辑
摘要: 参考文档 http://www.cnblogs.com/richardlee/articles/2511321.html https://en.wikipedia.org/wiki/Salt_%28cryptography%29 https://www.91ri.org/7593.html 密码存储 阅读全文
posted @ 2016-02-10 22:59 lightsong 阅读(936) 评论(0) 推荐(0) 编辑
摘要: lua5.1 模块理解 http://www.lua.org/manual/5.1/manual.html#pdf-module 模块 5.3 – Modules The package library provides basic facilities for loading and buildi 阅读全文
posted @ 2016-02-06 23:25 lightsong 阅读(687) 评论(0) 推荐(0) 编辑
摘要: 目的 为能够透彻理解HTTPS报文交互过程,做此笔记。 本文大部分内容来自 : http://albertx.mx/blog/https-handshake/ http://www.cnblogs.com/svan/p/5090201.html TLS Handshake Protocol The 阅读全文
posted @ 2016-01-31 23:21 lightsong 阅读(1122) 评论(0) 推荐(0) 编辑
摘要: 什么是堆?http://www.cnblogs.com/mengdd/archive/2012/11/30/2796845.html n个元素的序列{k1,k2,…,kn}当且仅当满足下列关系之一时,称之为堆。 情形1:ki = k2i 且ki >= k2i+1 (最大化堆或大顶堆) 若将和此... 阅读全文
posted @ 2016-01-10 23:20 lightsong 阅读(285) 评论(0) 推荐(0) 编辑
摘要: https://developer.mozilla.org/en-US/docs/Web/Security/HTTP_strict_transport_security【阅读理解式翻译,非严格遵循原始文档,以更生动表现出文章本义】HTTP Strict Transport SecurityHTTPS... 阅读全文
posted @ 2016-01-03 22:59 lightsong 阅读(1757) 评论(0) 推荐(0) 编辑
摘要: 动态数组在C语言等静态编码语言中, 数组必须有容量, 不能够像脚本中一样, 容量根据使用语句动态扩充。C语言数组:int arr[23]; // arr support 23 个元素. arr[100] not support.JS数组:var arr = new Array()arr[1000] ... 阅读全文
posted @ 2015-12-23 23:45 lightsong 阅读(528) 评论(0) 推荐(0) 编辑
摘要: lua表克隆将lua一个表, 克隆出一份为一个独立的另外一个表。对于一个module, 如果在require之后,获得的表对象, 不能直接修改, 例如lua缓存此表, 但是多次逻辑执行, 都使用的是原始module,这种情况就需要使用clone。clone实例, 例如将 {1} 克隆出一份 {1},... 阅读全文
posted @ 2015-11-22 22:56 lightsong 阅读(3506) 评论(0) 推荐(0) 编辑
摘要: 统计元素个数接口--只计算以整数为下标的 第一段连续元素的数目#tab 和 table.getn()http://ju.outofmemory.cn/entry/29450我们修改table:tab = {1, 4, 5, 8}print(#tab) --===... 阅读全文
posted @ 2015-11-08 23:24 lightsong 阅读(760) 评论(0) 推荐(0) 编辑
摘要: 字符串匹配http://www.cnblogs.com/jingmoxukong/p/4343770.html模式匹配是数据结构中字符串的一种基本运算,给定一个子串,要求在某个字符串中找出与该子串相同的所有子串,这就是模式匹配。假设P是给定的子串,T是待查找的字符串,要求从T中找出与P相同的所有子串... 阅读全文
posted @ 2015-11-08 22:46 lightsong 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 字符串匹配http://www.cnblogs.com/jingmoxukong/p/4343770.html模式匹配是数据结构中字符串的一种基本运算,给定一个子串,要求在某个字符串中找出与该子串相同的所有子串,这就是模式匹配。假设P是给定的子串,T是待查找的字符串,要求从T中找出与P相同的所有子串... 阅读全文
posted @ 2015-11-04 22:49 lightsong 阅读(1978) 评论(0) 推荐(0) 编辑
摘要: 正则表达式http://www.regexlab.com/zh/regref.htm 正则表达式(regular expression)就是用一个“字符串”来描述一个特征,然后去验证另一个“字符串”是否符合这个特征。比如 表达式“ab+” 描述的特征是“一个 'a' 和 任意个 'b' ”,那么 '... 阅读全文
posted @ 2015-10-24 23:35 lightsong 阅读(797) 评论(0) 推荐(0) 编辑
摘要: lua weak table经常看到lua表中有 weak table的用法, 例如:weak_table = setmetatable({}, {__mode="v"})官网上的解释:http://www.lua.org/pil/17.htmlWeak tables are the mechani... 阅读全文
posted @ 2015-10-21 23:20 lightsong 阅读(803) 评论(0) 推荐(1) 编辑
摘要: 归并排序http://blog.csdn.net/morewindows/article/details/6678165归并排序是建立在归并操作上的一种有效的排序算法。该算法是采用分治法(Divide and Conquer)的一个非常典型的应用。归并操作:http://www.tuicool.co... 阅读全文
posted @ 2015-10-11 23:09 lightsong 阅读(1728) 评论(0) 推荐(0) 编辑
Life Is Short, We Need Ship To Travel