摘要: 1)Gzip压缩 优点:压缩率比较高,压缩/解压速度也比较快,hadoop本身支持。 缺点:不支持分片。 应用场景:当每个文件压缩之后在1个block块大小内,可以考虑用gzip压缩格式。 2)lzo压缩 优点:压缩/解压速度也比较快,合理的压缩率,支持分片,是Hadoop中最流行的压缩格式,支持H 阅读全文
posted @ 2019-03-08 17:03 LV_VL 阅读(91) 评论(0) 推荐(0) 编辑
摘要: python常用的一些东西——sys、os等(转) 2012-09-19 14:51:4 1.常用内置函数:(不用import就可以直接使用) help(obj) 在线帮助, obj可是任何类型 callable(obj) 查看一个obj是不是可以像函数一样调用 repr(obj) 得到obj的表示 阅读全文
posted @ 2019-03-04 15:39 LV_VL 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 编码:json.dumps() 把python对象编码转换成json字符串 解码:json.loads()把json格式字符串解码转换成python对象 {"a": 1, "3": "c", "b": 2, "4": ["k", "k1"]} ############################ 阅读全文
posted @ 2019-03-04 15:37 LV_VL 阅读(283) 评论(0) 推荐(0) 编辑
摘要: //登录和退出数据库1:mysql -u root -p//输入密码2: exit3: mysql -u root -p //数据库创建,删除,进入数据库4:CREATE DATABASE `testdatabase`;5: CREATE DATABASE `testdatabase`;6:DROP 阅读全文
posted @ 2019-03-01 13:43 LV_VL 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 队列特性:先进先出 stack 栈先进后出 push() 输入 pop()输出 set接口 collectonjiek list接口:可重复集(可以用下标取值) set接口:不可重复集(没下标) HashSet() map接口 阅读全文
posted @ 2019-02-27 05:05 LV_VL 阅读(219) 评论(0) 推荐(0) 编辑
摘要: #####indexof() package day07Test;/** * 统计字符在句子中出现的次数 * @author gengyantao * */public class Demo1 { public static void main(String[] args) { int fromin 阅读全文
posted @ 2019-02-12 10:59 LV_VL 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 补充:常量 一,接口 1> 接口可以多继承; A implements B,C,D(继承) 2>接口是公共的模板,一种规范 3>extends A implements C(必须先继承后接口) 4>内置常量,抽象方法 int A = 4; void buy() // public void buy( 阅读全文
posted @ 2019-01-31 17:41 LV_VL 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 1.ctrl +n 创建类(首字母大写) 2.alt +s 选倒数第二个 创建方法(Superclass) 3.alt +s 选倒数第三个 创建带参数的方法(using fileds) 4.创建的void方法中有属性名称与当前名称相同的 引用上面的加this方法 ****************** 阅读全文
posted @ 2019-01-21 11:48 LV_VL 阅读(227) 评论(0) 推荐(0) 编辑
摘要: import java.util.Scanner; public class Demo1 { public static void main(String[] args) { System.out.println("请输入一个值"); Scanner sc = new Scanner(System. 阅读全文
posted @ 2019-01-08 17:31 LV_VL 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 1,Arrays.sort 排序 public class demo1 { public static void main(String[] args) { String [] ary = {"a","b","c","d"}; Arrays.sort(ary);#数组升序 for (String s 阅读全文
posted @ 2019-01-04 10:26 LV_VL 阅读(91) 评论(1) 推荐(0) 编辑
摘要: Window 上pycharm数据上传到github 1),安装git(百度) 进入git , bin目录执行 git-bash.exe 1) gengyantao@DESKTOP-OAM9PEP MINGW64 ~/.ssh 2) $ git config --global user.name " 阅读全文
posted @ 2018-04-27 13:50 LV_VL 阅读(135) 评论(0) 推荐(0) 编辑
摘要: class man(): classify = "people"# 全局属性 def __init__(self,name,age,value,):#类方法 self.name = name self.age = age self.value = value def talk(self,attch) 阅读全文
posted @ 2018-03-02 14:26 LV_VL 阅读(363) 评论(0) 推荐(0) 编辑
摘要: Python比较运算符 Python赋值运算符 以下假设变量a为10,变量b为20: 阅读全文
posted @ 2018-03-02 11:02 LV_VL 阅读(155) 评论(0) 推荐(0) 编辑
摘要: def timer(func): def wrapper(): return func() return wrapper @timer #index=timer(index) def index() print('in the index') index() #################### 阅读全文
posted @ 2018-03-01 18:43 LV_VL 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Python中的str与unicode处理方法 Python中的str与unicode处理方法 2015/03/25 · 基础知识 · 3 评论 · Python 分享到:42 2015/03/25 · 基础知识 · 3 评论 · Python 分享到:42 原文出处: liuaiqi627 的博客 阅读全文
posted @ 2017-11-09 11:54 LV_VL 阅读(3081) 评论(0) 推荐(0) 编辑
摘要: import stringprint (random.random()) # 0-1之间选浮点数print (random.randint(0,99,))#0-99之间选任意整数print (random.randrange(10,99,3))#10-99间以步长为3 随意选一个print (ran 阅读全文
posted @ 2017-02-21 10:14 LV_VL 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 模块的导入 form spam import read1 注意 read1可以直接调用 read1这样容易给其它相同的模块名的冲突 批量导入模块,两种方法 form spam import read1,read2,read3 form spam import (read, read2, read3, 阅读全文
posted @ 2017-02-21 09:35 LV_VL 阅读(92) 评论(0) 推荐(0) 编辑
摘要: time >>> print time.strftime("%Y-%m-%d")2017-02-20>>> print time.strftime("%Y-%m-%d %H:%M:%S")2017-02-20 17:23:45 print time.strftime("%Y-%m-%d %H:%M: 阅读全文
posted @ 2017-02-20 17:43 LV_VL 阅读(130) 评论(0) 推荐(0) 编辑
摘要: import logging logger=logging.logging.getLogger('test-log')#全局定义日志输出的名字 logger.setLevel(logging.DEBUG)#全局定义屏幕输出.文件输出的日志最低级别 ch = logging.StreamHandler 阅读全文
posted @ 2017-02-20 14:45 LV_VL 阅读(125) 评论(0) 推荐(0) 编辑
摘要: r:读 w:写(最好不用,清空文件写) a: 追加 r+ 读写 w+ 写读(最好不用,清空文件写) a+ 追加 读 read():全部读 readline():读一行 readlines():全部读并且以列表的形式展现 f.seek(10) 从光标的位置开始移动到第十位(按照字符的方式移动光标) f 阅读全文
posted @ 2017-02-20 12:57 LV_VL 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 三元运算公式: c = a+b if a>b eles a-b c 阅读全文
posted @ 2017-02-18 09:33 LV_VL 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 1,列表中添加一个元素 >>> name= ["jim","tom","luch","jon","jia"] >>> name.append("key") >>> name['jim', 'tom', 'luch', 'jon', 'jia', 'key'] 2,列表中查找元素的索引 >>> nam 阅读全文
posted @ 2017-01-11 17:20 LV_VL 阅读(149) 评论(0) 推荐(0) 编辑