2017年2月2日

lua breakpoint

摘要: http://blog.codingnow.com/2016/11/lua_debugger.html It aims to separate debug code from host code. All you need to do is require 'remotedebug'. Remote 阅读全文

posted @ 2017-02-02 11:07 明天有风吹 阅读(286) 评论(0) 推荐(0) 编辑

2017年1月19日

skynet 源码阅读笔记 bootstrap.lua

摘要: 最近几周粗略看了 skynet 代码的 C 部分。遇到很多知识点以前只是知道,但并不十分了解,所以这是一个学习的过程。 从 main 函数开始,闷头一阵看下来,着实蛋疼。 当看了 skynet_mq.c 和 skynet_module.c 之后才终于有了头绪。 C 代码通篇下来并没有什么特别的难点。 阅读全文

posted @ 2017-01-19 00:00 明天有风吹 阅读(1704) 评论(0) 推荐(0) 编辑

2017年1月8日

tcp server

摘要: 写 tcp server 要注意的几个设置参数 SO_REUSEADDR Ignore SIGPIPE 客户端意外挂掉时, 服务器继续往 socket 写数据, 可能会生成 SIGPIPE 信号, 默认导致进程终止 O_NONBLOCK 设置非阻塞 IO TCP_KEEPALIVE TCP_NODE 阅读全文

posted @ 2017-01-08 23:51 明天有风吹 阅读(226) 评论(0) 推荐(0) 编辑

SO_REUSEADDR SO_REUSEPORT

摘要: http://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and-so-reuseport-how-do-they-differ-do-they-mean-t SO_REUSEADDR socketA socket 阅读全文

posted @ 2017-01-08 22:58 明天有风吹 阅读(179) 评论(0) 推荐(0) 编辑

safe close tcp connection

摘要: https://blog.netherlabs.nl/articles/2009/01/18/the-ultimate-so_linger-page-or-why-is-my-tcp-not-reliable http://stackoverflow.com/questions/8874021/cl 阅读全文

posted @ 2017-01-08 22:44 明天有风吹 阅读(360) 评论(0) 推荐(0) 编辑

2016年12月30日

关于 IPv6

摘要: http://test-ipv6.com/ http://bbs.chinaunix.net/thread-1799798-1-1.html 阅读全文

posted @ 2016-12-30 01:03 明天有风吹 阅读(234) 评论(0) 推荐(0) 编辑

2016年12月28日

IPv6 Can't assign requested address

摘要: 今天试了下 bind IPv6 的地址,报错 Can't assign requested address http://stackoverflow.com/questions/24780404/python-tcp-socket-with-ipv6-address-failed http://bl 阅读全文

posted @ 2016-12-28 17:33 明天有风吹 阅读(2017) 评论(0) 推荐(0) 编辑

Mac 下查看端口是否被占用

摘要: 1. Mac lsof -i :8080 2. Linux netstat -anp tcp | grep 8080 3. nc -w 10 -n -z 127.0.0.1 8070-8090 阅读全文

posted @ 2016-12-28 12:50 明天有风吹 阅读(7574) 评论(0) 推荐(0) 编辑

python 启动一个 http server

摘要: 启动一个简单的 web 服务器 python2 python -m SimpleHTTPServer 8080 python3 python3 -m http.server 8080 --bind 127.0.0.1 3.8 以上可以 bind IPv6 python3 -m http.server 阅读全文

posted @ 2016-12-28 12:40 明天有风吹 阅读(3252) 评论(0) 推荐(0) 编辑

2016年12月22日

svn 设置 excel 比对工具为 SPREADSHEETCOMPARE.EXE

摘要: http://blog.csdn.net/ccpat/article/details/50725774 阅读全文

posted @ 2016-12-22 20:28 明天有风吹 阅读(1772) 评论(0) 推荐(0) 编辑

2016年12月20日

share your beautiful code

摘要: http://climbi.com/create 阅读全文

posted @ 2016-12-20 16:13 明天有风吹 阅读(123) 评论(0) 推荐(0) 编辑

2016年12月16日

nsurlsessiond - taking up all bandwidth!! Help ?

摘要: https://discussions.apple.com/thread/6605949?start=0&tstart=0 #!/bin/sh launchctl unload /System/Library/LaunchDaemons/com.apple.nsurlstoraged.plist l 阅读全文

posted @ 2016-12-16 20:39 明天有风吹 阅读(371) 评论(0) 推荐(0) 编辑

2016年12月14日

Unity LuaFramework LuaBundleMode

摘要: 设置 AppConst.cs 中的 LuaBundleMode 为 true,开启 Lua 代码 AssetBundle 模式。 启动程序报错,Moudle XXX not found. 我在 Assets/LuaFramework/Lua/ 下新建了一个 excel 目录,这个目录中的文件都无法加 阅读全文

posted @ 2016-12-14 14:17 明天有风吹 阅读(782) 评论(0) 推荐(0) 编辑

2016年7月15日

sublime text 文件打开时回调一些函数

摘要: 需求:公司服务端脚本以 .s 结尾的文件,也按 js 语法识别,方便查看函数定义。 每次都 ss:js 比较麻烦,所以写个插件。 1 import sublime, sublime_plugin 2 3 class DotSAwarenessCommand(sublime_plugin.EventL 阅读全文

posted @ 2016-07-15 17:59 明天有风吹 阅读(316) 评论(0) 推荐(0) 编辑

2016年5月26日

lua 源码阅读顺序

摘要: https://www.reddit.com/comments/63hth/ask_reddit_which_oss_codebases_out_there_are_so/c02pxbp Online Lua 5.3 source code browser Recommended reading o 阅读全文

posted @ 2016-05-26 20:53 明天有风吹 阅读(1548) 评论(0) 推荐(0) 编辑

2016年5月24日

raspberry pi wifi

摘要: vim /etc/network/interfaces 修改 wpa-ssid 和 wpa-psk 参考:http://fanzhenyu.cn/2016/05/22/%E6%A0%91%E8%8E%93%E6%B4%BE%E9%85%8D%E7%BD%AE%E6%97%A0%E7%BA%BF%E7 阅读全文

posted @ 2016-05-24 23:56 明天有风吹 阅读(157) 评论(0) 推荐(0) 编辑

2016年4月15日

转 必看:手游PVP同步体验总结及实际方案剖析

摘要: 必看:手游PVP同步体验总结及实际方案剖析 帧同步在竞技类网络游戏中的应用 阅读全文

posted @ 2016-04-15 21:28 明天有风吹 阅读(258) 评论(0) 推荐(0) 编辑

flex

摘要: flex 词法分析 fb.l $ flex fb.l $ cc lex.yy.c $ cat fb.l | ./a.out %option noyywrap http://stackoverflow.com/questions/1811125/undefined-reference-to-yywra 阅读全文

posted @ 2016-04-15 00:27 明天有风吹 阅读(173) 评论(0) 推荐(0) 编辑

2016年3月4日

当前不会命中断点 源代码与原始版本不一致

摘要: http://www.cnblogs.com/yuetianhewu/articles/2862845.html 阅读全文

posted @ 2016-03-04 10:49 明天有风吹 阅读(241) 评论(0) 推荐(0) 编辑

2016年3月3日

c setjmp longjmp

摘要: http://coolshell.cn/?s=setjmp http://www.cnblogs.com/hazir/p/c_setjmp_longjmp.html 1 double divide(double to, double by, jmp_buf env) 2 { 3 if(by == 0 阅读全文

posted @ 2016-03-03 01:46 明天有风吹 阅读(157) 评论(0) 推荐(0) 编辑

2016年2月26日

VS 快捷键设置

摘要: 工具 --> 选项 --> 环境 --> 键盘 阅读全文

posted @ 2016-02-26 10:20 明天有风吹 阅读(176) 评论(0) 推荐(0) 编辑

2016年2月16日

Lua C API 遍历 table

摘要: http://timothyqiu.com/archives/lua-note-table-traversal-using-c-api/ C API 遍历 Table 1 lua_getglobal(L, t); 2 int index = lua_gettop(L); 3 lua_pushnil( 阅读全文

posted @ 2016-02-16 14:12 明天有风吹 阅读(1378) 评论(0) 推荐(0) 编辑

2016年2月2日

lua class

摘要: 1 _class = {} 2 3 function BaseClass(super) 4 local class_type = {} 5 local vtbl = {} 6 _class[class_type] = vtbl 7 8 setmetatable(class_type, { 9 __n 阅读全文

posted @ 2016-02-02 01:17 明天有风吹 阅读(568) 评论(0) 推荐(0) 编辑

2016年1月16日

复习 C++ 中类的函数指针

摘要: 函数指针这种东西,平时工作中基本上不会用到。 那函数指针会用在哪里? 下面是一些基本的用法,根据消息号调到对应的函数: 1 #include <iostream> 2 #include <map> 3 4 enum MsgCode 5 { 6 MSGCODE1 = 1, 7 MSGCODE2 = 2 阅读全文

posted @ 2016-01-16 00:52 明天有风吹 阅读(365) 评论(0) 推荐(0) 编辑

2015年12月29日

apache ab

摘要: ab -p postfile.json -T 'application/json' -n 100 -c 10 -v 2 http://192.168.1.103:3002/checkStashSlotCount 阅读全文

posted @ 2015-12-29 11:39 明天有风吹 阅读(162) 评论(0) 推荐(0) 编辑

2015年12月21日

rabbitmq

摘要: http://www.rabbitmq.com/getstarted.html 阅读全文

posted @ 2015-12-21 02:36 明天有风吹 阅读(103) 评论(0) 推荐(0) 编辑

2015年12月17日

协程 coroutine

摘要: 参考链接:http://manual.luaer.cn/2.11.htmlhttp://www.cnblogs.com/riceball/archive/2008/01/03/1025158.htmlhttp://blog.codingnow.com/2012/07/c_coroutine.html... 阅读全文

posted @ 2015-12-17 11:49 明天有风吹 阅读(185) 评论(0) 推荐(0) 编辑

2015年12月15日

tcpdump

摘要: 打印数据包,方便调试 sudo tcpdump -i en1 port $PORT -X ip header tcp header man tcpdump To print all IPv4 HTTP packets to and from port 80, i.e. print only pack 阅读全文

posted @ 2015-12-15 14:47 明天有风吹 阅读(350) 评论(0) 推荐(0) 编辑

2015年12月4日

PARSER_JS_PRECISION_RANGE_EXCEEDED 错误

摘要: { [Error: parseLengthCodedNumber: JS precision range exceeded, number is >= 53 bit: "30376208567171257"] offset: 3, code: 'PARSER_JS_PRECISION_RANGE_E... 阅读全文

posted @ 2015-12-04 16:29 明天有风吹 阅读(964) 评论(0) 推荐(0) 编辑

2015年11月28日

nodejs 像 C 语言那样输出当前代码的行数

摘要: http://stackoverflow.com/questions/11386492/accessing-line-number-in-v8-javascript-chrome-node-js 1 Object.defineProperty(global, '__stack', { 2 get... 阅读全文

posted @ 2015-11-28 13:18 明天有风吹 阅读(2616) 评论(0) 推荐(0) 编辑

2015年11月27日

Linux core 文件 gdb

摘要: http://blog.csdn.net/mr_chenping/article/details/13767609 在程序不寻常退出时,内核会在当前工作目录下生成一个core文件(是一个内存映像,同时加上调试信息)。使用gdb来查看core文件,可以指示出导致程序出错的代码所在文件和行数。 1.co 阅读全文

posted @ 2015-11-27 16:28 明天有风吹 阅读(344) 评论(0) 推荐(0) 编辑

2015年11月24日

netstat 查看本机开放端口

摘要: root@kali:~# netstat -luntp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 阅读全文

posted @ 2015-11-24 22:31 明天有风吹 阅读(1813) 评论(0) 推荐(0) 编辑

python stdout 重定向

摘要: 1 import sys 2 3 class Buffer(object): 4 def __init__(self): 5 self.buffer = [] 6 7 def write(self, *args, **kwargs): 8 self.buffer.append(args) 9 10 阅读全文

posted @ 2015-11-24 10:30 明天有风吹 阅读(709) 评论(0) 推荐(0) 编辑

2015年11月23日

hot code loading in nodejs

摘要: Hot Code Loading in Node.jsNode.js Web应用代码热更新的另类思路Reading throughFevertoday,this postby Jack Moffitt caught my eye. In it, he discusses a hack to allo... 阅读全文

posted @ 2015-11-23 20:39 明天有风吹 阅读(608) 评论(0) 推荐(0) 编辑

mysql 数据备份 crontab

摘要: 每天凌晨 2 点备份数据crontab -e0 2 * * * mysqldump${mysqldir}/bin/mysqldump -h$host -P$port -uadmin -p"$passwd" --events --flush-logs --master-data=2 --all-dat... 阅读全文

posted @ 2015-11-23 12:30 明天有风吹 阅读(273) 评论(0) 推荐(0) 编辑

iptables

摘要: http://www.ithome.com/html/it/46123.htm 阅读全文

posted @ 2015-11-23 02:05 明天有风吹 阅读(124) 评论(0) 推荐(0) 编辑

2015年11月22日

python 爬爬爬 基本函数~

摘要: https://docs.python.org/2/howto/urllib2.html#data http://zhuoqiang.me/python-urllib2-usage.html 阅读全文

posted @ 2015-11-22 23:56 明天有风吹 阅读(296) 评论(0) 推荐(0) 编辑

python decorator 修饰器

摘要: decorator 就是给函数加一层皮,好用! 1 from time import ctime 2 3 def deco(func): 4 def wrappedFunc(*args, **kwargs): 5 print '[%s] %s called' % (ctime(), func.__n 阅读全文

posted @ 2015-11-22 22:32 明天有风吹 阅读(202) 评论(0) 推荐(0) 编辑

2015年11月18日

sublime 把 tab 转成 4 个空格

摘要: Preferences -> Settings-User { "tab_size":4, "translate_tabs_to_spaces": true, "draw_white_space": "all", // 显示出空白符 "trim_trailing_white_space_on_save 阅读全文

posted @ 2015-11-18 14:59 明天有风吹 阅读(994) 评论(0) 推荐(0) 编辑

2015年11月17日

bhp 阅读笔记 OSX 下 setuptools pip 安装

摘要: 安装 python-setuptools python-pip尝试 brew install python-setuptools 失败brew update 失败$ cd `brew --prefix`$ git remote add origin https://github.com/Homeb... 阅读全文

posted @ 2015-11-17 21:52 明天有风吹 阅读(345) 评论(0) 推荐(0) 编辑

导航

+V atob('d2h5X251bGw=')

请备注:from博客园