自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(42)
  • 收藏
  • 关注

原创 明日十一回家休整几天,7号再来京都

明日十一回家休整几天,7号再来京都,没买什么东西,给爸妈在华联买了两条不错的围巾,给老爸买了两双手套,当然给自己嘛。。。之前在网上买了双鞋和外套。今天又在书摊买了2本人文的书,够消磨时间了。

2013-09-28 20:56:00 1762

原创 linux grep 匹配某行不以800开头

cat  file  | grep '^[^800]'

2013-09-25 10:33:52 3262

转载 Example of how to wait for enqueued tasks to be completed:

Example of how to wait for enqueued tasks to be completed:def worker(): while True: item = q.get() do_work(item) q.task_done()q = Queue()for i in range(num_worker_

2013-09-25 08:37:16 471

转载 data mining http://guidetodatamining.com/

http://guidetodatamining.com/

2013-09-21 22:11:21 536

转载 seductive preface

If you continue this simple practice every day, you will obtain some wonderful power. Before you attain it, it is something wonderful, but after you attain it, it is nothing special.

2013-09-21 19:49:51 461

转载 Python yield 使用浅析

https://www.ibm.com/developerworks/cn/opensource/os-cn-python-yield/def fab(max): n, a, b = 0, 0, 1 while n < max: yield b # print b a, b = b, a + b n

2013-09-21 11:48:41 514

转载 一个应用的什么最重要

http://dbanotes.net/在这些垃圾产品中,能够让人记住你,首先并不是产品做的多酷,多智能,体验做得如何牛(当然不是说这个不重要),也不是说能抢占用户手机,而是要有正确的产品价值观 – 对用户真正有价值。有些垃圾产品的确能吸引眼球,通过刷榜或是各种方式能搞到不少安装量,但是小毛驴拉车 – 没长劲儿。用户慢慢会发现那些有价值的东西。

2013-09-20 20:55:47 586

转载 centos rar安装

wget http://www.rarsoft.com/rar/rarlinux-3.9.3.tar.gztar -xvf rarlinux-3.9.3.tar.gzcd rarmake看见下面这些信息就是安装成功了mkdir -p /usr/local/binmkdir -p /usr/local/libcp rar unrar /usr/local/binc

2013-09-20 18:04:01 1562

转载 这爷爷奶奶是亲的吗?

家有宝宝快一岁了,爸妈特别爱玩他,没错,是玩。。。  妈妈刚才给宝宝尝了芥末,孩子一把鼻涕一把泪啊。。。  再也不愿吃我们喂来的东西了,我爸呢,  一边痛斥我妈一边喂宝宝白酒啊。。。  等我来的时候他们说孩子已经睡着了!

2013-09-20 10:36:23 605

转载 js closure timer

22(function(){var wait = document.getElementById('wait'),href = document.getElementById('href').href;var interval = setInterval(function(){var time = --wait.innerHTML;if(time locat

2013-09-20 09:57:43 497

转载 java zip files

/** *  */package com.geili.hanqw;/** * @author hanqw * @since 2013-9-17 上午9:50:22 */import java.io.BufferedInputStream;import java.io.BufferedOutputStream;import java.io.File;

2013-09-17 11:00:27 471

转载 清理/var/account/pacct

【转】清理/var/account/pacct转自:laoyao512http://blog.sina.com.cn/s/blog_9a4d43d80100zqxa.html如果你进入了这个页面,说明你的Linux磁盘多半已经因为空间不足报警了,而且是/var/account/pacct这个文件导致的var挂载点空间不足。 这个文件的意思:Linux

2013-09-16 13:49:41 4279

转载 python User-defined Exceptions

Programs may name their own exceptions by creating a new exception class (see Classes for more about Python classes). Exceptions should typically be derived from theException class, either direc

2013-09-16 08:56:16 1088

转载 安装lrzsz(zmodem)

安装lrzsz(zmodem)对于CentOS系统:1[root@www ~]# yum install lrzsz对于debian系统:1[root@www ~]#apt-get install lrzsz安装完成后就可以使用Se

2013-09-15 22:24:30 2289

转载 python set

Python also includes a data type for sets. A set is an unordered collection with no duplicate elements. Basic uses include membership testing and eliminating duplicate entries. Set objects also suppor

2013-09-13 08:32:19 682

原创 set ,list 推导

list>>> [x**2 for x in range(10)][0, 1, 4, 9, 16, 25, 36, 49, 64, 81]set>>> a = {x for x in 'abracadabra' if x not in 'abc'}>>> aset(['r', 'd'])

2013-09-13 08:31:13 525

原创 python function default values

The default values are evaluated at the point of function definition in the defining scope看了函数调用时参数一定要传对,下面的输出5i = 5def func(arg = i):    print arg    i = 6func()

2013-09-12 22:53:00 1751

原创 python judge prime number

import sysdef isPrime(n):    if n        return False        for m in range(2, (n+1)/2):        if n % m == 0:            return False            return True    while

2013-09-12 22:29:26 1413

转载 mysql char varchar

CHAR和VARCHAR类型声明的长度表示你想要保存的最大字符数。例如,CHAR(30)可以占用30个字符。CHAR列的长度固定为创建表时声明的长度。长度可以为从0到255的任何值。当保存CHAR值时,在它们的右边填充空格以达到指定的长度。当检索到CHAR值时,尾部的空格被删除掉。在存储或检索过程中不进行大小写转换。VARCHAR列中的值为可变长字符串。长度可以指定为0到65,535之间的

2013-09-12 16:27:51 505

原创 hadoop 进阶实例

三个文件one.txt  格式如下号码 标签   数量two.txt 格式如下号码  标签   数量number.txt133658207 需求是找出第三个文件中的号码,出现在前两个文件中的 号码  标签   数量输出格式号码  标签   数量mapper.php#!/usr/bin/phperror_report

2013-09-11 18:18:40 421

转载 php memory_limit

如何设置memory_limit 方法1: php.ini 最简单或常用的方法是修改php.ini 1.首先找到对你的网站生效的php.ini文件 由于有多个地方都可以设置php的参数,找到正确的配置文件,并进行更改是首先要做的一步。如果你上面的方法建立了php文件来查看其配置参数,则你可以找到“Loaded Configuration File”这一项,以下是个例子: 

2013-09-11 09:58:02 1099

原创 python read write file

write.pydef write_file(filename):    fh = open(filename, "w")        fh.write("line 1\n")    fh.write("line 2\n")    fh.write("line 3\n")    fh.write("line 4\n")    fh.close()

2013-09-08 21:40:29 1461

转载 DIV+CSS初始化模板

DIVCSS5-HTML模板 UTF-8 - www.divcss5.com DIVCSS5欢迎您使用初始化的HTML+CSS模板!学习网址: www.divcss5.comDIVCSS5提示这里可以放置网站统计代码style.css@charset "utf-8";/* DIVCSS5 - www.divcss5.com *

2013-09-08 18:25:19 1112

转载 css div自适应高度height

http://www.divcss5.com/jiqiao/j499.shtml_height:200px; /* css 注解: 仅IE6设别此属性,假定最低高度是200px ,设置高度200px,内容超出后IE6会自动撑高设定高度 */ min-height:200px; /* css注释: css最小高度为200px支持所有浏览器,IE6浏览器除外 */

2013-09-08 18:06:14 557

转载 手机网页制作

http://www.ruanyifeng.com/blog/2012/05/responsive_web_design.html

2013-09-08 16:31:27 1040

原创 div css布局总结

参考了 http://www.aa25.cn/layout/ 上的固定布局和自适应布局,固定用px 单位,自适应用百分比单位,做手机网页当然要用百分比,加上 css media queries 对不同的手机屏幕加载不同的样式。

2013-09-08 16:28:51 598

转载 css 浏览器兼容方案

http://www.aa25.cn/layout/3像素问题及解决办法当使用float浮动容器后,在IE6下会产生3px的空隙,有意思的是右侧容器没设置高度时3px在右侧容器内部,当设定高度后又跑到容器的左侧了,所以对布局精度要求高的话,请参考例29、31的解决方法上边容器浮动后,下边的容器跟着浮动,造成页面错乱如以上例子中的footer必须要单独占一行,但当sideba

2013-09-08 16:22:37 469

转载 浏览器兼容性经典问题(二) IE6 3像素bug问题

http://blog.csdn.net/speed_feng/article/details/8190048 当相邻的两个元素,一个是浮动的,另一个非浮动,那么在IE6 下面将会产生3像素bug。

2013-09-08 16:03:51 608

原创 python global

number = 0;def main():    global number    number = int(input('enter a number'))    show_number()    def show_number():    print 'the number you entered is', number   show_number

2013-09-08 15:42:30 646

原创 hadoop 命令总结

1. 查看文件hadoop fs -lsr2. 创建文件夹    hadoop fs -mkdir /user/data3. 删除文件夹   hadoop fs -rmr /user/data5. 拷贝本地文件到远程机器  hdfs -copyFromLocal data /user/data 6.  steaming cli/usr/bin/had

2013-09-06 18:56:28 596

原创 hadoop php streming word count

alias hdfs ="hadoop fs "1. 本地环境[@ hadoop]# tree.|-- php|   |-- data|   |   |-- a.txt|   |   |-- b.txt|   |   |-- c.txt|   |   |-- d.txt|   |   `-- e.txt|   |-- mapper.php|   `-

2013-09-06 18:23:49 650

转载 hadoop 视频教程

http://www.douban.com/group/topic/36364785/

2013-09-06 10:19:21 793

转载 JavaScript的性能优化:加载和执行

http://blog.jobbole.com/47304/

2013-09-05 16:43:40 548

原创 python array 阵列

'''、@author: Administrator'''import arraya = array.array("B",range(16))print aprint repr(a.tostring())b = array.array("h", range(16))print bprint repr(b.tostring())

2013-09-04 08:54:00 2091

原创 python low level thread

'''@author: Administrator'''import threadimport time,randomdef worker():    for i in range(5):        time.sleep(random.randint(10,100)/1000.0)        print thread.get_ident(

2013-09-04 08:19:39 602

转载 Python 魔术方法指南

https://pycoders-weekly-chinese.readthedocs.org/en/latest/issue6/a-guide-to-pythons-magic-methods.html#id13

2013-09-04 08:13:26 566

原创 python stack

'''@author: Administrator'''import QueueEmpty = Queue.Emptyclass Stack(Queue.Queue):    "thread-safe stack"        def __put__(self, item):        self.queue.insert(0,

2013-09-04 08:12:36 1472

原创 python Queue module

'''@author: Administrator'''import threadingimport Queueimport time,randomWORKERS = 2print "start"class Worker(threading.Thread):        def __init__(self, queue):     

2013-09-03 22:50:14 622

原创 python lock

import  threading import time,randomclass Counter:    def __init__(self):        self.lock = threading.Lock()        self.value = 0            def increment(self):        self.lock

2013-09-03 22:22:46 959

原创 python StringIO

import StringIOmessage = "that man is reading"file = StringIO.StringIO(message)print file.read()

2013-09-03 08:54:22 557

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除