timothyqiu.com
SwipeRefreshLayout 及 Otto 的多线程使用 - TimothyQiu's Blog
http://timothyqiu.com/archives/swiperefreshlayout-and-use-otto-from-another-thread
Keep it simple stupid. SwipeRefreshLayout 及 Otto 的多线程使用. March 22, 2015. 主要是为了熟悉下 Android Studio 和 更 Android 的网络通信方式。 Android.support.v4.widget.SwipeRefreshLayout. 而且理论上根据系统的不同会有不同的表现形式,比如早期的就是 ActionBar 下边缘的横线动画,Material Design 后则是下拉的小圆形动画。 首先在 Gradle 中需要加入对 Support Library v4 的引用. Compile 'com.android.support:support-v4:21.0.0'. 当然如果你的工程中已经间接引用了的话也可以不写,比如 v7 就依赖于 v4。 是一种 Layout,可以直接在 XML 文件里用,比如. 当然写完你就会发现这个刷新图标默认是纯黑色箭头,和我们在 Google 以及最近更新的 Chrome 里看到的画风不一样啊。 是 Square 公司开源的一个事件总线库 Event Bus。 Public clas...
timothyqiu.com
TimothyQiu's Blog
http://timothyqiu.com/page/3
Keep it simple stupid. November 24, 2013. 在介绍 Git 的时候,大多数文章都会提到它在 Working Copy 和 Repository 之间新增的 Staging Area,它使得你可以只提交 Working Copy 中的一小部分。 作为一个半路出家的 Git 山寨用户,我之前知道的也就只是这三个地方了,不过这两天发现了第四个区域 Stashing Area。 Stashing Area 直接翻译过来是储藏间,是 Git 中用来暂存已作出的修改的地方,可以避免这种手动做法的繁琐。 将当前 Working Copy 中的修改保存为 Stash 中的一条新的记录,Working Copy 则变成了修改前的样子。 将 Stash 中最新的记录取出,并应用到 Working Copy 上。 November 15, 2013. 首先需要吐槽的就是好好的 Windows via C/C 这么高端大气上档次的名字怎么就被翻译成了这么个蛋疼样,而且中文版的封面也是扑面而来的一股浓郁的上个世纪气息,以至于在正文里看到 Vista 的字样都感觉各种穿越. 我这么做也算是牺...
timothyqiu.com
那么 C 语言也可能有类了哟 - TimothyQiu's Blog
http://timothyqiu.com/archives/proposal-to-make-c-c-with-classes
Keep it simple stupid. October 2, 2014. 今天看到 C 语言委员会的提案 N1875. 顿时有种 卧槽 的感觉,因为它的标题是 Adding classes to C。 这要是通过了,那可真就变成名副其实的 C with Classes 了呀. 纵观提案全文,主要从 C 中吸收 类 的概念和用法,但是没有虚函数之类的东西。 如果算上单独的 访问限制符 、 单一继承 提案,一个 C 语言的类,很可能类似于. Car car; / 相当于 initCar() Car tank.initCar(80, 16); tank.deleteCar(); / 析构函数需要显式调用 car.deleteCar();. 已有 4 条评论 ». October 4th, 2014 at 07:17 am. October 10th, 2014 at 12:27 am. October 26th, 2014 at 02:57 pm. October 26th, 2014 at 09:34 pm. Is powered by Typecho) ).
timothyqiu.com
用 STL 寻找前 K 个最大的数 - TimothyQiu's Blog
http://timothyqiu.com/archives/finding-the-first-K-largest-numbers-with-STL
Keep it simple stupid. 用 STL 寻找前 K 个最大的数. May 3, 2014. 于是立马想起了 GoingNative 2013 上的演讲 C Seasoning. 以及前不久看到的这篇 From goto to std: transform. 于是不禁想, 寻找前 K 大数 这样的任务,能不能直接用 C 标准库来完成 如果能的话,性能又如何呢 于是我重新登录了那个以前做了两道题就尘封多年的 OJ 帐号. 不出所料,这样的做法跑了 562 ms,要排到 700 名开外的样子。 后,时间顿时缩短到了 296 ms,可以排到 180 的样子。 Std: vector int wealth; wealth.reserve(100000);. 其作用是确保调用后第 N 个元素是范围内第 N 大的元素。 调用后,[begin, N) 内的任意元素都小于 (N, end) 内的任意元素。 尝试修改成以上的略显罗嗦的代码后,程序运行时间缩短到了 171 ms,可以排到 70 的样子。 此时的程序执行时间 156 ms,排名第 25 位。 May 4th, 2014 at 09:20 am.
timothyqiu.com
CoolShell 解题记 - TimothyQiu's Blog
http://timothyqiu.com/archives/solving-the-coolshell-puzzle-game
Keep it simple stupid. August 3, 2014. 吃完饭在微博上看到 CoolShell 上发了一个 解谜游戏. 咱自然是要试试的啦 由于中午在父母家吃饭,电脑上没有任何 IDE 之类的,于是只能用在线 IDE 了。 What is the meaning of life, the universe and everything? 尽管后者我知道是 银河系漫游指南 的梗,但是前者我盯着看了半天没看出来,尝试了各种方法也没有线索正在濒临崩溃之际,小 Q 童鞋跑过来扫了一眼屏幕,然后立马告诉我 2 3=6、3 6=18。 第三关是关于 Dvorak 键盘布局的题目,可以直接通过 在线工具. 转出来的是一份 C 语言代码,其中涉及的原理在很久以前的这篇 String as Array Index. 正在一筹莫展之际,又是小 Q 同学叼着根棒冰过来,看了眼题目后很快就高屋建瓴地指出 前两个字符必须是一个大写字母、一个数字,中间的字符必须是小写。 第六关的提示是 勇往直前 ,点击图片后可以得到一个莫名其妙的数字,数字所在页面的 URL 里也有个莫名其妙的数字。
timothyqiu.com
mosh - TimothyQiu's Blog
http://timothyqiu.com/archives/mosh
Keep it simple stupid. September 30, 2014. SSH 用起来有一个不方便的地方,就是断线就要重连,不用个 screen / tmux 啥的浑身不舒服。 Mosh 的全称是 mobile shell,顾名思义,正是专为解决这些 移动 客户端的烦恼而设计的 (b (I) )b. Pacman -S mosh # Arch Linux brew install mosh # Mac OS X. 官网上列有一大堆其它平台的安装方法和源码编译指南 https:/ mosh.mit.edu/#getting. Mosh 会先通过 SSH 连接到服务器,然后启动服务器上的. 用 UDP 在 60000-61000 端口通信了。 指定 SSH 端口 # mosh 自己的 -p 参数用来是指定 mosh-server 和 mosh-client 通信的 UDP 端口的 mosh - ssh="ssh -p 1024" user@host. 使用过程中,如果网络延迟比较大,你会发现 mosh 不像 SSH 一样需要 盲打 ,而是直接打出带下划线的字符。
timothyqiu.com
归档 - TimothyQiu's Blog
http://timothyqiu.com/archives.htm
Keep it simple stupid. Python 3 的 surrogateescape. SQLAlchemy 的 Identity Map 和 Cache 造成的 add 失败. C 并发编程实战 读书笔记 管理线程. SwipeRefreshLayout 及 Otto 的多线程使用. 用 STL 寻找前 K 个最大的数. Bad Apple in Windows Task Manager. Vim 中使用 clang complete 为 C/C 自动补全. C 11 Variadic Template. AT&T 和 Intel 汇编语法的主要区别. Google Talk Bot in Python. C 中 protected 成员的坑爹来历. Lua 学习笔记 C API 遍历 Table. Vim 中使用 OmniComplete 为 C/C 自动补全. String as Array Index. PDO (SQLite) For WordPress 插件的 Bug 们. Visual C 调试模式 F12 中断. Is powered by Typecho) ).
timothyqiu.com
TimothyQiu's Blog
http://timothyqiu.com/page/4
Keep it simple stupid. August 20, 2013. August 9, 2013. Std: string a = "Hello"; std: string b = "世界"; / UTF-8 或者 GBK 皆可. 没错,无论是 GBK 还是 UTF-8 存储,答案都应该是. 在我的 Windows 7 32-bit 和 Arch Linux 64-bit 上,都是. Shall be defined identically to the built-in operators = and for type. July 25, 2013. 上一次看 cocos2d-x 是去年的事情了,下了个 SDK 而后按照官方的那个 pew-pew-pew 教程接二连三捣鼓了几下,之后几乎就没怎么去碰了。 下载稳定版打包,或者去 官方 GitHub 仓库. 个人这回是下载了最新稳定版本,目前是 2.1.4。 Bad Apple in Windows Task Manager. July 10, 2013. 这几天 Bad Apple 又逆袭了,比如 这个. May 23, 2013.
timothyqiu.com
TimothyQiu's Blog
http://timothyqiu.com/page/1
Keep it simple stupid. Python 3 的 surrogateescape. July 14, 2016. 系统中有一个邮件发送模块,直接在命令行中手动跑 Worker 的话邮件可以成功发送,而一旦用 supervisor 运行则无法发送邮件。 UnicodeEncodeError: 'utf-8' codec can't encode character ' udce6' in position 0: surrogates not allowed. Surrogate 是 Unicode 中位于. 外的一组不会有对应字符的码位,Python 3 中使用这些码位来 代表 无法编码的字节。 Udce6'.encode('ascii', 'surrogateescape') b' xe6' b' xe6'.decode('ascii', 'surrogateescape') ' udce6'. 环境变量中包含非 ASCII 字符就会得到上面的 Surrogate。 解决方法便是在 supervisor 配置中修改 environment,加入. April 23, 2016.
timothyqiu.com
TimothyQiu's Blog
http://timothyqiu.com/page/13
Keep it simple stupid. String as Array Index. March 27, 2011. 话说前几天人人网 C 语言公共主页发了篇 日志. Int a = 3, b = 5; printf(&a["Hi! Hello"],&b["fun/super"]); printf("%c%c%c%c",1["wst"],2["www"],0["ddd"],5["ewewrew"]);. March 17, 2011. 不少城市超市里的盐还真都被抢购一空,更有甚者一买就是几十包 够吃个十几年了吧 ,淘宝上不少掌柜也纷纷打出 买XX送食盐 的广告,这架势真是让核辐射前线的日本人情何以堪啊 下班地铁上一个大叔给老婆打电话说, 嗯,买了,一包人那么多盐都快被买光了。 March 12, 2011. End of world = "death" print(end of world) end of world = 2012 print(end of world). PDO (SQLite) For WordPress 插件的 Bug 们. March 11, 2011.