1、文件包下载http://pan.baidu.com/s/1qW9DHYc2、安装gcc -fPIC
-Wall -I/usr/local/mysql/include -I. -shared udf_redis.c cJSON.c -o
udf_redis.socp udf_redis.so /u...
分类:
数据库 时间:
2014-06-12 16:36:09
阅读次数:
362
最近在写一个检查一台服务器上所有游戏区服配置文件中redis某个key值大小的脚本,本打算使用shell+awk+sed的方式去解决这个问题,但是由于redis的配置信息是php数组形式.shell脚本一时没有写出来,就请教他人帮忙写了个python脚本,但是自己python不是很精通,于是按照脚本中涉及到..
分类:
数据库 时间:
2014-06-10 22:50:12
阅读次数:
360
Given two sorted integer arrays A and B, merge
B into A as one sorted array.Note:You may assume that A has enough space (size
that is greater or equal...
分类:
其他好文 时间:
2014-06-10 20:44:02
阅读次数:
298
Question: Mergeksorted linked lists and return
it as one sorted list. Analyze and describe its complexity.Solution: Find the
smallest list-head first....
分类:
其他好文 时间:
2014-06-10 19:51:30
阅读次数:
278
移除数组中重复次数超过2次以上出现的数,但是可以允许重复2次。
这个题类似Remove Duplicates from Sorted Array,第一个想法很直接就是计数,超过2次的就忽略,依据这个思路的代码见代码一;
上面的思路可行,但是代码看着比较冗余,判断比较多。再来想想原来的数组,该数组是排好序的,如果一个数出现3次以上,那么必有A[i] == A[i-2]。所以根据这个关系可以写出比较精简的代码二。详见代码。...
分类:
其他好文 时间:
2014-06-10 19:18:39
阅读次数:
250
最近需要用到redis ,但是在编码这个问题上,纠结了很久。
需求 :
每天一个进程将中文文件入库到redis中(不定时更新) ,另外几个进程读取redis中的信息 ,并处理数据结果。
使用的redis模块 :
redis-py
问题 :
入库正常,读取数据成功,以GBK编码写入文件出现异常。
通过以下参数连...
分类:
其他好文 时间:
2014-06-10 19:10:21
阅读次数:
212
题目
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first
two lists.
方法
有序链表,合并成一个有序链表。
public ListNod...
分类:
其他好文 时间:
2014-06-10 18:13:11
阅读次数:
241
int removeDuplicates(int A[], int n) {
if(n <= 1)
return n;
int newIndex = 0;
for(int i = 1; i < n; ++i){
if(A[i] != A[newIndex])
A[++newIndex] ...
分类:
其他好文 时间:
2014-06-10 10:57:49
阅读次数:
131
问题:
给定一个有序链表,生成对应的平衡二叉搜索树。
分析
见Convert
Sorted Array to Binary Search Tree
实现:
TreeNode *buildTree(ListNode* head, ListNode *end){
if(head == NULL || head == end)
return NULL;
...
分类:
其他好文 时间:
2014-06-10 07:17:29
阅读次数:
264