2018年7月4日

What does git fsck stand for?

摘要: fsck File System ChecK https://stackoverflow.com/questions/21151945/what does git fsck stand for 阅读全文

posted @ 2018-07-04 10:20 明天有风吹 阅读(123) 评论(0) 推荐(0) 编辑

2018年7月3日

what does GIT PUSH do exactly?

摘要: 有效理解 git 的对象模型 https://stackoverflow.com/questions/26005031/what does git push do exactly 所谓分支, 就是一个指针, 指向某个 commit 链 阅读全文

posted @ 2018-07-03 22:34 明天有风吹 阅读(164) 评论(0) 推荐(0) 编辑

2018年7月2日

git checkout tags with the same name as a branch

摘要: 显式指定某个 tag git checkout refs/tags/ 显式指定某个 branch git checkout refs/heads/ 阅读全文

posted @ 2018-07-02 16:55 明天有风吹 阅读(391) 评论(0) 推荐(0) 编辑

2018年6月29日

githug rename_commit 修改已经commit但还没push的一条message

摘要: githug 第 45 关, 一开始对 git rebase i 这个东西有误解, 记录一下正确的用法 查找有拼写错误的那一条 commit First coommit // commit 写错了 git rebase i parent_of_flawed_commit 然后跳到 编辑它, 然后 : 阅读全文

posted @ 2018-06-29 12:03 明天有风吹 阅读(485) 评论(0) 推荐(0) 编辑

2018年3月6日

boost::bind 实现原理, 手动实现一个

摘要: 原理如此,其它形式的 bind 都类似 阅读全文

posted @ 2018-03-06 16:43 明天有风吹 阅读(585) 评论(0) 推荐(0) 编辑

2018年2月6日

迅雷 应版权方要求 文件无法下载

摘要: 解决方案: 下载老版本迅雷 http://mac.xunlei.com/history_version.html 阅读全文

posted @ 2018-02-06 20:40 明天有风吹 阅读(5677) 评论(0) 推荐(0) 编辑

2018年1月31日

iOS 抓包

摘要: "通过tcpdump对iOS进行流量分析(无需越狱" "iOS Packet Tracing" 1. 将 iOS 设备通过 USB 连接到 Mac 2. 打开 terminal rvictl s $UDID 3. 运行 tcpdump sudo tcpdump i rvi0 w dump.pcap 阅读全文

posted @ 2018-01-31 00:12 明天有风吹 阅读(145) 评论(0) 推荐(0) 编辑

2018年1月28日

sudo rm -rf iTunes.app Operation not permitted

摘要: https://www.howtogeek.com/230424/how to disable system integrity protection on a mac and why you shouldnt/ 重启,按住 Commond + R 进入 recovery 模式 打开 Termina 阅读全文

posted @ 2018-01-28 00:36 明天有风吹 阅读(694) 评论(0) 推荐(0) 编辑

2018年1月27日

旅行青蛙

摘要: 今天才知道旅行青蛙的时间是取的客户端时间,没有做服务器校验。 也就是说,如果我把手机时间调到 3 个小时以后,再打开旅行青蛙,那么就可以领取满满的三叶草了! 然后我就手动操作 删掉游戏 再从 AppStore 下载下来 (这一步之前先不要改时间,否则下载不下来) 把手机时间调到很久以前(如 2016 阅读全文

posted @ 2018-01-27 02:19 明天有风吹 阅读(168) 评论(0) 推荐(0) 编辑

2018年1月10日

发现一个好玩的东西 Web Scraper

摘要: 是一个 Chrome 的扩展程序,机智的小爬虫 "Scraping a site" 阅读全文

posted @ 2018-01-10 15:07 明天有风吹 阅读(133) 评论(0) 推荐(0) 编辑

2018年1月8日

分布式系统中 Unique ID 的生成方法

摘要: http://darktea.github.io/notes/2013/12/08/Unique ID Snowflake 生成的 unique ID 的组成 (由高位到低位): 41 bits: Timestamp (毫秒级) 10 bits: 节点 ID (datacenter ID 5 bit 阅读全文

posted @ 2018-01-08 13:53 明天有风吹 阅读(468) 评论(0) 推荐(0) 编辑

2018年1月5日

终于把微信小游戏 跳一跳 的外挂弄好了

摘要: https://github.com/wangshub/wechat_jump_game/wiki/Android-%E5%92%8C-iOS-%E6%93%8D%E4%BD%9C%E6%AD%A5%E9%AA%A4 注意要安装 python3 依赖的 python 的那些库也要用 pip3 来安装 阅读全文

posted @ 2018-01-05 02:18 明天有风吹 阅读(190) 评论(0) 推荐(0) 编辑

2017年12月26日

utf-8 decode

摘要: 摘自 Lua 5.3 源文件 lutf8lib.c 关于 utf-8 的基础知识,参考 http://www.ruanyifeng.com/blog/2007/10/ascii_unicode_and_utf-8.html UTF-8 的编码规则很简单,只有二条: 1)对于单字节的符号,字节的第一位 阅读全文

posted @ 2017-12-26 00:16 明天有风吹 阅读(726) 评论(0) 推荐(0) 编辑

2017年12月25日

CentOS No manual entry for man 没有 xx 的手册页条目

摘要: yum install -y man man-pages man-pages-overrides https://unix.stackexchange.com/questions/182500/no-manual-entry-for-man 阅读全文

posted @ 2017-12-25 10:42 明天有风吹 阅读(1165) 评论(0) 推荐(1) 编辑

2017年12月9日

redis 分布式读写锁

摘要: http://zhangtielei.com/posts/blog-redlock-reasoning.html 链接里这篇 blog 讨论了 redis 分布式锁的实现以及安全性 我要参考 基于单Redis节点的分布式锁,实现一个 基于单Redis节点的分布式读写锁 先是想到一个不是很好的方案 r 阅读全文

posted @ 2017-12-09 23:55 明天有风吹 阅读(8470) 评论(0) 推荐(0) 编辑

2017年11月29日

html canvas 的宽高以及像素限制

摘要: canvas 宽高设置不合适的话,是画不出东西出来的 https://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element 阅读全文

posted @ 2017-11-29 11:42 明天有风吹 阅读(1541) 评论(0) 推荐(0) 编辑

2017年11月12日

文件描述符的申请与回收

摘要: 最近弄定时器,需要一个类似 Linux 中文件描述符的概念。每启动一个定时器都返回一个定时器的 handle (fd). handle 从 0 开始,生成时永远取其取值范围内最小的数字。于是有: 1 #include <set> 2 3 class FDManager 4 { 5 public: 6 阅读全文

posted @ 2017-11-12 23:28 明天有风吹 阅读(660) 评论(0) 推荐(0) 编辑

hotmail 收不到邮件的问题

摘要: 之前用 hotmail 注册过一个 aws 账号,起了一个 ec2 的免费一年的 VPS,然后没怎么用,不久就把这事忘了。 直到有一天手机收到信用卡扣款消息,我就马上去登账号,却怎么也想不起密码来了,邮箱还怎么也收不到邮件,真是奇哉怪也! 各种尝试无果。 最后随手设置了下自动转发邮件到我 gmail 阅读全文

posted @ 2017-11-12 23:03 明天有风吹 阅读(4147) 评论(0) 推荐(0) 编辑

2017年11月2日

getaddrinfo 报错 Invalid value for ai_flags

摘要: 最近改了游戏的网络层代码,运行 Android 版的时候 getaddrinfo 报错 Invalid value for ai_flags. ai_flags 设置如下: struct addrinfo hint = {0}; hint.ai_flags = AI_DEFAULT; 几经搜索,发现 阅读全文

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

2017年10月21日

Avoiding Common Networking Mistakes

摘要: https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/CommonPitfalls/CommonPitfalls.html#//app 阅读全文

posted @ 2017-10-21 00:37 明天有风吹 阅读(192) 评论(0) 推荐(0) 编辑

2017年10月18日

关掉标准输出

摘要: 服务器 console 上打了一堆 log,又耗时又难看 fclose(stdout); stdout 的类型是 FILE*,所以要用 fclose 来关闭 或者 close(1) close(fileno(stdout)) 阅读全文

posted @ 2017-10-18 22:01 明天有风吹 阅读(268) 评论(0) 推荐(0) 编辑

2017年9月29日

不需要 root 权限的 ping

摘要: https://blog.lilydjwg.me/2013/10/29/non-privileged-icmp-ping.41390.html https://stackoverflow.com/questions/8290046/icmp-sockets-linux/20105379#201053 阅读全文

posted @ 2017-09-29 17:28 明天有风吹 阅读(596) 评论(0) 推荐(0) 编辑

2017年9月8日

select 的问题

摘要: select 一个 "connection refused" 的 socket, socket 居然状态可写。。 原代码用 select 检查 socket 的可写状态来判断连接是否成功,IOS 版本的代码中没有对 connect 返回值做检查,才发现这个现象。。 阅读全文

posted @ 2017-09-08 11:43 明天有风吹 阅读(126) 评论(0) 推荐(0) 编辑

2017年6月23日

Behavior Tree 用 Lua 实现一个最简行为树

摘要: 有没有比 C++ 代码简单一万倍,有没有? https://github.com/hangj/BehaviorTree 阅读全文

posted @ 2017-06-23 00:33 明天有风吹 阅读(1441) 评论(0) 推荐(0) 编辑

2017年5月26日

对 UDP 的一些思考

摘要: 先放两个链接 快速可靠协议-KCP 可靠 UDP 传输 最近在玩王者荣耀,发觉两件事: 1. 可以 4G 和 wifi 无痛切换 2. 当网络不好的时候,发出去的消息并不保证到达服务器。比如你在很卡的时候做了某些操作,等网络恢复之后你会发现,你还是在某个没有做那些操作之前的状态 结合这两周阅读的 K 阅读全文

posted @ 2017-05-26 08:30 明天有风吹 阅读(2204) 评论(0) 推荐(0) 编辑

2017年5月24日

Windows UDP sockets: recvfrom() fails with error 10054

摘要: https://stackoverflow.com/questions/34242622/windows-udp-sockets-recvfrom-fails-with-error-10054 阅读全文

posted @ 2017-05-24 19:51 明天有风吹 阅读(411) 评论(0) 推荐(0) 编辑

2017年4月20日

和等于某个数的所有组合

摘要: 最近在做组队匹配的功能,需要根据队伍的总人数找到可以组成一个队伍的所有排列组合,然后组合去寻找合适的房间 于是有了这个递归算法 阅读全文

posted @ 2017-04-20 14:40 明天有风吹 阅读(396) 评论(0) 推荐(0) 编辑

2017年3月17日

一个可遇不可求的 bug 全局变量初始化顺序问题 哈哈

摘要: 这是今天下午帮同事查的一个客户端 C++ 的 bug,前人留下的谜之代码。。 具体情况是,客户端实现了有一个简单的内存池,每次申请内存的时候会把新申请到的内存信息存到一个 map 里,据说是为了检查内存泄漏。 大致是像下面这段代码 同事把第 7 行注释掉了,结果客户端就开始崩溃。神奇哟~ 报错信息中 阅读全文

posted @ 2017-03-17 18:05 明天有风吹 阅读(656) 评论(0) 推荐(0) 编辑

skynet inject address file.lua

摘要: inject d test/inject_fuck.lua -- d 是服务的 handle 拿 simpledb.lua 举例,修改如下 添加了 fuck 函数,并设置 info_func。 设置 info_func 主要用来在 debug console 中方便用 info d 来查看 inje 阅读全文

posted @ 2017-03-17 14:20 明天有风吹 阅读(1559) 评论(0) 推荐(0) 编辑

2017年3月13日

杀掉所有 skynet 进程

摘要: ps aux | grep skynet | grep -v grep | awk '/config/{print $2}' | xargs kill 阅读全文

posted @ 2017-03-13 14:30 明天有风吹 阅读(650) 评论(0) 推荐(0) 编辑

2017年3月4日

win7 docker 挂载共享目录

摘要: 在 win7 下用 docker 不像 win10 那样方便,安装包都不一样。 在 win7 下共享一个目录的方法如下: 1. 先设置 win7 到 VirtualBox 中 docker 用的那个虚拟机的共享文件夹 填写好共享文件夹路径和名称。如:共享文件夹路径:E:\ 共享文件夹名称: e 然后 阅读全文

posted @ 2017-03-04 20:37 明天有风吹 阅读(8974) 评论(0) 推荐(0) 编辑

docker 常用命令

摘要: docker images docker build --tag tagname . docker ps docker ps -a docker rm tagname docker rmi image docker run -i -t -p 80:80 --name hello centos doc 阅读全文

posted @ 2017-03-04 02:48 明天有风吹 阅读(257) 评论(0) 推荐(0) 编辑

2017年2月23日

C# byte array 跟 string 互转

摘要: 用 System.Text.Encoding.Default.GetString() 转换时,byte array 中大于 127 的数据转 string 时会出问题。 把这里的 Default 换成 ASCII,UTF8,Unicode 都会有问题(转成的 string 再转回 byte arra 阅读全文

posted @ 2017-02-23 22:37 明天有风吹 阅读(1447) 评论(0) 推荐(0) 编辑

2017年2月20日

C# MemoryStream BinaryReader

摘要: 不清楚这类东西内部搞什么鬼,直接看代码才舒爽 https://referencesource.microsoft.com/#mscorlib 然后可以在线测试 https://www.tutorialspoint.com/compile_csharp_online.php 阅读全文

posted @ 2017-02-20 22:36 明天有风吹 阅读(832) 评论(0) 推荐(0) 编辑

2017年2月14日

sublime text syntaxdef

摘要: http://sublimetext.info/docs/en/extensibility/syntaxdefs.html 阅读全文

posted @ 2017-02-14 22:46 明天有风吹 阅读(226) 评论(0) 推荐(0) 编辑

2017年2月11日

time clock getrusage clock_gettime gettimeofday timespec_get 对比

摘要: http://stackoverflow.com/questions/12392278/measure-time-in-linux-time-vs-clock-vs-getrusage-vs-clock-gettime-vs-gettimeof 阅读全文

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

atomic write pipe

摘要: 阅读 skynet 代码 socket_server 部分,发现对 socket 的写操作流程是这样的: 1. 各个服务(各线程)将数据写到 sendctrl_fd,这是一个 pipe 的 写端 2. ctrl_cmd 函数从 recvctrl_fd 读出数据,然后写到真正的 socketfd 在第 阅读全文

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

2017年2月7日

Free Online IDE and Terminal

摘要: Free Online IDE and Terminal 阅读全文

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

2017年2月6日

nginx

摘要: http://tengine.taobao.org/book/chapter_02.html http://tengine.taobao.org/book/module_development.html 阅读全文

posted @ 2017-02-06 00:22 明天有风吹 阅读(102) 评论(0) 推荐(0) 编辑

cpu 亲和性 affinity

摘要: http://www.ibm.com/developerworks/cn/linux/l-affinity.html 阅读全文

posted @ 2017-02-06 00:05 明天有风吹 阅读(152) 评论(0) 推荐(0) 编辑

导航

+V atob('d2h5X251bGw=')

请备注:from博客园