05 2016 档案

修改jsonb的属性
摘要:CREATE FUNCTION jsonb_merge(JSONB, JSONB) RETURNS JSONB AS $$ WITH json_union AS ( SELECT * FROM JSONB_EACH($1) UNION ALL SELECT * FROM JSONB_EACH($2) 阅读全文

posted @ 2016-05-27 19:10 与非朋仔 阅读(938) 评论(0) 推荐(0) 编辑

Python中exec的使用
摘要:>>>globals = {'x':7, .....: 'y':10, .....: 'names':['aa','bb','cc'] .....: } >>>locals = {} >>>a = eval("3*x+4*y",globals,locals) >>>print a 61 >>>exe 阅读全文

posted @ 2016-05-24 19:45 与非朋仔 阅读(1538) 评论(0) 推荐(0) 编辑

SQL语句
摘要:"select * from (select json_data.value as a from '%s' as t, jsonb_each(t.value) AS json_data where ne_id = %d and attached = %d) \ as foo where concat 阅读全文

posted @ 2016-05-23 13:59 与非朋仔 阅读(224) 评论(0) 推荐(0) 编辑

partial 函数
摘要:函数的partial应用 函数在执行时,要带上所有必要的参数进行调用。但是,有时参数可以在函数被调用之前提前获知。这种情况下,一个函数有一个或多个参数预先就能用上,以便函数能用更少的参数进行调用。 例如: In [9]: from functools import partial In [10]: 阅读全文

posted @ 2016-05-22 15:26 与非朋仔 阅读(268) 评论(0) 推荐(0) 编辑

map函数
摘要:list是一个函数,将参数强制转换成列表list((1,4,7)) 对元组(1,4,7)使用list函数就返回列表[1,4,7]map(list,zip(*a))表示对zip(*a)的每一个单位都执行list函数而且这在python 2.6.6中执行正常,执行效果如下>>> a=[[1,2,3],[ 阅读全文

posted @ 2016-05-21 21:57 与非朋仔 阅读(167) 评论(0) 推荐(0) 编辑

python命令行上下 退格,左右键不能用
摘要:easy_install readline 阅读全文

posted @ 2016-05-21 20:57 与非朋仔 阅读(991) 评论(0) 推荐(0) 编辑

postgresql 在linux上的源码安装
摘要:http://my.oschina.net/hippora/blog/375292 下载源码并解压 开始编译安装 按照错误提示依次安装依赖包 继续 添加用户 建立好database cluster目标文件夹 环境变量设置 创建database cluster 启动数据库实例 设置好PGDATA环境变 阅读全文

posted @ 2016-05-21 14:40 与非朋仔 阅读(222) 评论(0) 推荐(0) 编辑

python字典操作
摘要:输出结果: {"sub_dic": {"sub_str": "this is sub str", "sub_list": [1, 2, 3]}, "end": "end", "list": [1, 2, "a", "b"], "str": "this is a string"} 将两列list组成一 阅读全文

posted @ 2016-05-19 17:09 与非朋仔 阅读(123) 评论(0) 推荐(0) 编辑

根据key存不存在查询json
摘要:select * from table where value->'key' != 'null'; 阅读全文

posted @ 2016-05-17 16:20 与非朋仔 阅读(223) 评论(0) 推荐(0) 编辑

list_for_each_entry浅析
摘要:list_for_each原型: #define list_for_each(pos, head) \ #define list_for_each(pos, head) \ for (pos = (head)->next, prefetch(pos->next); pos != (head); \ 阅读全文

posted @ 2016-05-12 23:13 与非朋仔 编辑

精典博文
摘要:http://osdir.com/ml/linux.drivers.e1000.devel/2007-01/msg00082.htmlhttp://blog.chinaunix.net/uid-21505072-id-3078625.html朋 18:42:12http://blog.csdn.ne 阅读全文

posted @ 2016-05-11 18:44 与非朋仔 阅读(127) 评论(0) 推荐(0) 编辑

python解析XML之ElementTree
摘要:#coding=utf-8 from xml.etree import ElementTree as ET tree=ET.parse('test.xml') root = tree.getroot() #p=per.findall('caption') #for oneper in p: # for child in oneper.getchildren(): # print... 阅读全文

posted @ 2016-05-11 00:09 与非朋仔 阅读(1737) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示