摘要: 最近工作需要,对docker稍微了解了一下,大部分内容网上都有各种各样的教程。有两个稍微特殊的命令这里记录一下:1. rename image的命令从各种私有镜像下载后用docker images看的时候名字里都带着ip,如下所示:daocloud.io/library/ubuntu lates... 阅读全文
posted @ 2015-11-16 06:36 db2zos 阅读(613) 评论(0) 推荐(0)
摘要: 最近需要对一个自己开发的socket server的性能进行分析,刚开始还想了好长时间怎么来分析。后来才意识到其实使用strace就足够了。观察到的现象是server单进程CPU使用率97,但磁盘i/o只有400MB/s,但这块磁盘可以达到>1GB/s的速度,于是在server开始跑之后直接用str... 阅读全文
posted @ 2015-07-24 22:53 db2zos 阅读(287) 评论(0) 推荐(0)
摘要: Print sorted list:colors=['red','green','blue','yellow']for color in sorted(colors): print colorfor color in sorted(colors,reverse=True): print ... 阅读全文
posted @ 2015-07-24 22:35 db2zos 阅读(258) 评论(0) 推荐(0)
摘要: Looping over a range of numbersBad:for i in [0,1,2,3,4,5]: print i**2Good:for i in range(6): print i**2Looping over a collection:Bad:colors = [ ... 阅读全文
posted @ 2015-07-19 22:28 db2zos 阅读(229) 评论(0) 推荐(0)
摘要: Given an integer, write a function to determine if it is a power of two.My initial code: 1 class Solution: 2 # @param {integer} n 3 # @return ... 阅读全文
posted @ 2015-07-19 15:28 db2zos 阅读(207) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2015-07-18 19:43 db2zos 阅读(301) 评论(0) 推荐(0)
摘要: 今天有个需求时需要为某个类设置缺省值最开始的代码如下:Class myClass def __init__(self,datalen=None,times=None): if datalen == None : self.datalen = 1024 ... 阅读全文
posted @ 2015-07-12 22:14 db2zos 阅读(461) 评论(0) 推荐(0)
摘要: 说来惭愧,入手Mac已经快大半年了,但使用上一直是菜鸟。 下面是最近学习和用到的技巧,纪录如下,以后会不定期更新。开启多个Terminal,这个简直是调程序必备。 Command+N 打开新的Terminal Command + T 打开新的Tab Command + W 关闭当前Tab, ... 阅读全文
posted @ 2015-07-12 22:03 db2zos 阅读(219) 评论(0) 推荐(0)
摘要: 乘着今天有时间,把leecode,github和博客密码都找回来,争取能够多刷,多更新。 阅读全文
posted @ 2015-07-08 21:46 db2zos 阅读(162) 评论(0) 推荐(0)
摘要: 同事问了一个非常简单的问题,怎么取出每个partition里面另外一个列的最小值? create table t1 (int c1, int c2); 假如按照c2分区,0-10,10-20,20-30,30-40,40-50 insert into t1 values(101, 1); insert into t1 values(102, 2); insert into t1 ... 阅读全文
posted @ 2014-10-09 16:28 db2zos 阅读(318) 评论(0) 推荐(0)