- 博客(65)
- 资源 (12)
- 收藏
- 关注
原创 ashx学习
.net 里的ashx跟java里的servlet类似,可以不用管html之类的东西。新建一个空的asp.net项目,不是空的也可以。添加一个web handler codebehide:wtf.ashxwtf.ashx.cs//-------------------------------------------------------------------------
2015-09-12 22:27:55
1176
原创 android caculator
mail.xml<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="fill
2015-07-10 11:33:47
741
原创 python 统计pvuv 二
test.py#!/usr/bin/pythonimport osimport sysimport stringimport json#awk -F ',' 'substr($0,21,2)=='14'{print $0}' * > 14.logdef run(): logfile = '14.log' res = dict() if not os.path.exists(
2015-05-07 18:04:54
1335
原创 python 统计pvuv 一
数据格式:2015-04-10 15:32:54udid:user1 setKey:flag1 2015-04-10 15:33:00udid:user2 setKey:flag2...#!/usr/bin/pythonimport osimport sysdef run(num=1):#file param filePrefix
2015-04-13 10:46:52
2301
转载 Flume配置-Failover(转载)
1台game服务器,上面部署agent,这是整个数据源。其他game服务器上的配置类似。2台collector服务器,主要是为了演示如何做failover1台logserver服务器,主要是为了演示接收数据主要配置文件如下(在一台服务器上模拟):# flume/conf/game.confa1.channels = c1a1.sources = r1#配置两
2015-02-28 17:37:08
648
转载 Kafka+Storm+HDFS整合实践
http://shiyanjun.cn/archives/934.html一个简单WordCount示例程序,从Kafka读取订阅的消息行,通过空格拆分出单个单词,然后再做词频统计计算,实现的Topology的代码,如下所示:001package org.shirdrn.storm.examples;
2015-02-13 22:02:04
551
原创 mahout ArtifactTransferException: Failure to transfer
ArtifactTransferException: Failure to transfer org.apache.solr:solr-commons-csv:jar:3.5.0 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempte
2015-01-26 10:37:50
622
原创 python try except else finally
#!/usr/bin/pythontry: try: f=open('test.sh', 'r') print f.read() except: print 'except' else: print 'else'finally: print 'finally'在phtyon 2.4 下这样可以执
2014-12-25 17:46:32
676
转载 crc16 直接计算的实现
最近在做modbus的时候要用到crc 16,不研究了,直接网上找一个static ushort crc_16(byte[] data) { uint IX, IY; ushort crc = 0xFFFF;//set all 1 int len = data.Length;
2014-11-02 13:38:21
881
原创 nginx send back content post by client
试了下用post 内容到nginx,然后在nginx把该内容原样返回xwgk
2014-10-03 19:13:39
724
原创 nginx handler ngx_http_core_module
Nginx 按location配置的加载做法。ngx_http_test_module.c
2014-10-01 23:26:05
999
原创 awk favorite
#!/bin/awkawk -F '|' '$3=="ECOP_SERVICE_0009" {printf("phone:%s retype:%d retcode:%d msg:%s lineno:%d\n",$4,$6,$7,$8,FNR)}' log.log.2014-09-28 | awk -F ' ' 'BEGIN {total=0} $2=="retype:0" {print $1
2014-09-29 19:25:32
682
原创 Using libxml2 to get value of specific key
这里的版本是libxml2-2.9.1,官网的API MENU
2014-09-26 16:28:03
1309
原创 libxml2 ./.libs/libxml2.so: undefined reference to `gzopen64'
安装的是libxml2-2.9.1版本,直接./confi
2014-09-25 11:04:56
3347
原创 使用curl取url内容
#include #include #include #include #include #include #include #include "logger.h"#include #define INIT_BODY_SIZE 1024*8struct userdata{ char *url; int header_size; int header_size_use
2014-09-23 21:49:48
1122
原创 redis hiredis brpop
用hiredis client 测试了下brpop,这是hadoop提取数据后通过消息队列传输数据。demo
2014-09-19 20:45:07
1928
原创 mysql procedure
drop PROCEDURE if EXISTS GetTotal;#str_num,numbers of string array#str_arr,array of stringsCREATE PROCEDURE GetTotal(IN str_num int,IN str_arr VARCHAR(10000))BEGINdeclare idx int default 1;decla
2014-08-27 19:08:37
571
原创 shell iterate the directory in recursive way
#!/bin/bash#set -Pfunction execdir(){ echo Enterring $1 cd $1 #echo `pwd` for s in $(ls -R `pwd`) do if [ -d $s ] then
2014-08-18 15:35:20
588
原创 mysqldump 导部分数据到sql文件
mysqldump -h192.168.0.247 -uxxxxxxx -pxxxxxxxx DataBasesName Tabl --where=' 1=1 limit 1,3 ' > ./news.sql
2014-08-10 21:44:15
733
原创 freebsd using kqueue to monitor modifying of file
#include #include #include #include #include #include #include #include int main(int argc,char *argv[]){ int fd,kq,nev; struct kevent ev; static const struct timespec tout={1,0}; if((fd=op
2014-07-31 20:15:42
813
原创 air-line ticket selling system
global.h#ifndef _GLOBAL #define _GLOBAL//for client#define QUERY_SINGLE 1#define QUERY_MULT 2#define BUY 3//for server#define BUY_SUCCEED 128#define BUY_FAILED 129//need more details for t
2014-07-31 20:08:57
660
原创 linux c mysql demo
#include #include "/usr/local/mysql/include/mysql.h"int main(int argc,char *argv[]){ int res; MYSQL *connection;//MYSQL * MYSQL_RES *res_ptr;//result * MYSQL_ROW sqlrow;//row if((connection=mys
2014-07-31 20:06:10
560
原创 linux c dynamic library programming
.h#ifndef __TESTDL#define __TESTDL#ifdef __cplusplusextern "C"{#endifint (*add)(int,int,int*);//int addint(int,int,int*);#ifdef __cplusplus}#endif#endif
2014-07-31 18:58:41
501
原创 logger
logger.h#ifndef _LOGGER#define _LOGGER//#include #define log sys_logvoid init_log();void release_log();void sys_log(int,const char*,...);struct sys_logger{ char* file_name; cha
2014-07-17 22:12:28
676
转载 protobuf 使用
先安装好protobuf编译器:https://code.google.com/p/protobuf/downloads/list
2014-06-26 21:00:30
752
转载 Using libmemcached with C and C++
15.6.3.3 Using libmemcached with C and C++Prev 15.6.3 Developing a memcached Application Next15.6.3.3 Using libmemcached with C and C++15.6.3.3.1 libmemcached Bas
2014-06-24 15:36:05
658
原创 GetIntFromHex
GetIntFromHex.c#include#includeint main(int argc,char **argv){ if(argc <2) { printf("Need more parameters.\n"); return 0; } int result = 0; sscanf(argv[1],"%x\r\n",&result); printf("%d",
2014-05-20 21:11:24
537
转载 ALIGN MACRO understanding
/* Detect n-bytes alignment. Old 8 bytes alignment macro: #define _CI_ALIGN(val) ((val+7)&~7)*/struct _ci_align_test {char n[1]; double d;};#define _CI_NBYTES_ALIGNMENT ((size_t) &(((struct _
2014-03-31 20:47:02
689
petshop项目源码+说明文档
2011-03-23
Reflector反编译工具
2011-02-25
jquery chm
2011-01-25
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人