题目:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given su....
分类:
编程语言 时间:
2014-07-31 05:21:25
阅读次数:
214
最近发生了一次因为hdfs的坏块导致的hive计算问题,因此写了个监控脚本用来监控hdfs的坏块,脚本如下:#!/usr/bin/python
#-*-coding:utf8-*-
#editbyericni
#20140724
#monitorhdfscorrupt
importsys
importproperty
importsendmail
importre,os
reload(sys)
sys.setdefaulten..
分类:
其他好文 时间:
2014-07-31 03:11:06
阅读次数:
350
#!/bin/envpython
#-*-coding:utf-8-*-
fromConfigParserimportConfigParser
importjson
defgetConfigObject(filename):
"""获得配置文件对象
"""
_config_=ConfigParser()
_config_.read(filename)
return_config_
defgetConfigJson(filename,sections):
"""返回对应sections..
分类:
其他好文 时间:
2014-07-31 03:07:56
阅读次数:
267
python版身份证末位校验码计算。
函数使用了由map,zip到引入itertools后的imap,izip, 追求pythonic是信仰!...
分类:
编程语言 时间:
2014-07-31 03:04:25
阅读次数:
277
1. apt-get 源更新$ sudo apt-get update$ sudo apt-get upgrade2. git & Github$ sudo apt-get install git-all xclip$ git config --global user.name "Jackon Ya...
分类:
其他好文 时间:
2014-07-31 02:59:15
阅读次数:
174
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'fromPyQt4.QtGuiimport*fromPyQt4.Qtimport*fromPyQt4.QtCoreimport*frompwimportUi_Form#正则表达式检测密码格...
分类:
其他好文 时间:
2014-07-31 02:24:35
阅读次数:
237
1.java/c++/ruby/python集中语言的对比java和c++java和rubyjava和python
分类:
编程语言 时间:
2014-07-31 02:20:05
阅读次数:
220
Python 类型转换 str(),repr()|format() : 将非字符类型转成子串 int() : 转为整形 float() : 转为浮点型 list(s) : 将字串s转成列表 tuple(s) : 将字串s转成元组 ...
分类:
编程语言 时间:
2014-07-31 02:17:35
阅读次数:
425
问题描述:
Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
For example,
If n = 4 and k = 2, a solution is:
[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]
解题思路...
分类:
其他好文 时间:
2014-07-31 00:04:35
阅读次数:
204
这是前段时间在看spark的python支持的时候,简单过了一下pyspark里的python代码,整理了一个大致流程。虽然几乎不会python,但基本上能看懂pyspark是怎么让不同虚拟机之间传输数据的、如何在python环境调用java类的、pyspark SDK的丰富程度取决于什么、需要做些什么流程和封装等。
我看了下,应该只有Pyspark Internals这篇wiki里介绍了pyspark的实现机制,大体是下面这张图就可以表示...
分类:
其他好文 时间:
2014-07-31 00:01:36
阅读次数:
515