上一页 1 2 3 4 5 6 ··· 10 下一页
摘要: 今天。。好多不会的,慢慢补充1、python的二维数组初始化s = [[0 for i in range(3)]for i in range(3)]这样就初始了一个3*3的二维数组 = [[0 for in range(col_numbers)] for i in range(rows_number... 阅读全文
posted @ 2015-09-20 19:11 _Doraemon 阅读(327) 评论(0) 推荐(0) 编辑
摘要: GITHUB链接:github source回顾与记录:1、多线程。python多线程是后面在添加socket服务器的时候才用到的。使用的是threading.Thread类继承的办法实现。使用了生产者和消费者模式。 在这里是使用sys_status作为 产品。 当sys_status为false时... 阅读全文
posted @ 2015-09-18 10:31 _Doraemon 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 原文链接:http://www.jianshu.com/p/e6ff4a28ab5a需要说的是首先要搞清楚python的版本因为Centos用的是2.6的python版本,导致了各种问题。但是yum又要用2.6所以先装个2.7版本的python。然后是nginx,我是通过编译安装的在/usr/loc... 阅读全文
posted @ 2015-09-15 17:54 _Doraemon 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 今天在写一个脚本时需要定义一个全局的时间变量,但是在函数中修改后一直不能更新,发现是因为函数是有自己的namespacelast_send_time = 0def test(): last_send_time = 2print last_send_time#will print 0#to ch... 阅读全文
posted @ 2015-09-15 11:14 _Doraemon 阅读(720) 评论(0) 推荐(0) 编辑
摘要: 今天在看别人写 的代码时,中间的sql语句有个order by 1查了下。 贴出来:order by 1means "order by the first field I selected" 阅读全文
posted @ 2015-09-14 15:48 _Doraemon 阅读(206) 评论(0) 推荐(0) 编辑
摘要: Immutable objects have many advantages, including:Safe for use by untrusted libraries.Thread-safe: can be used by many threads with no risk of race co... 阅读全文
posted @ 2015-09-14 11:25 _Doraemon 阅读(362) 评论(0) 推荐(0) 编辑
摘要: Ordering我看了好多遍中文文档,加一些实例终于算是搞清楚怎么回事了。他是干什么的? 就像他名字一样,用来ordering 排序的。、主要有两种方法。1 用它的静态方法排序。 比如 Ordering.natural(); 对可排序类型做自然排序,如数字按大小,日期按先后。 natual()的官... 阅读全文
posted @ 2015-09-14 11:03 _Doraemon 阅读(243) 评论(0) 推荐(0) 编辑
摘要: We often encounter these two parameters.First *argsThis a list of parameters that without name. Baiclly, it is a tuple.It accepts more than one parame... 阅读全文
posted @ 2015-09-02 14:36 _Doraemon 阅读(383) 评论(0) 推荐(0) 编辑
摘要: Actully, we're going to talk aboutApache Hadoop ecosystem.Most from Apache Offical Docs1/apache kafka It is a message quenue. Other message quenues: ... 阅读全文
posted @ 2015-08-31 10:59 _Doraemon 阅读(240) 评论(0) 推荐(0) 编辑
摘要: 制作RPM包,可以方便日后的维护。统一了标准yum install rpmdevtools安装后,使用rpmdev-setuptree命令创建rpm包的目录结构。默认是在$HOME下rmpbuild下,也可以通过~/.rpmmacros配置。SPEC文档是制作rpm包的核心。下面是从fedora中c... 阅读全文
posted @ 2015-08-29 18:33 _Doraemon 阅读(1034) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 10 下一页