`
文章列表
//String转inputStream 1. String --> InputStream InputStream String2InputStream(String str){ ByteArrayInputStream stream = new ByteArrayInputStream(str.getBytes()); return stream; } 2. InputStream --> String String inputStream2String(InputStream is){ BufferedReader in = ...
<?xml version="1.0" encoding="UTF-8"?> <!--修改的注释内容--> <!--d2226829/20090505--> <templates><template id="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name="gettercomment" description="Comment for getter method" ...
/** * 业务线程实现类 */ public class OperationThread extends WorkThread { public final static String threadName = "OperationThread"; private final long MAX_RUN_CYCLE = 200L; /*** * * @param group * @param name */ public OperationThread(ThreadGroup group) { super ...
/** * 类描述:工作线程 * @author * @version */ public abstract class WorkThread extends Thread { /** 最大运行周期*/ protected static final long MAX_RUN_CYCLE = 50L; /** 最小运行周期*/ protected static final long MIN_RUN_CYCLE = 20L; /** 线程的名称*/ protected final String threadName; ...

libevent

    博客分类:
  • c++
The libevent API provides a mechanism to execute a callback function when a specific event occurs on a file descriptor or after a timeout has been reached. Furthermore, libevent also support callbacks due to signals or regular timeouts. 1 Download http://monkey.org/~provos/libevent/ 2 Insta ...
DATE DATE型的处理:DATE型一般声明为CHAR(20)。 往表中插入DATE型数据时,一般用TO_DATE()函数进行类型转换,取出值时一般用TO_CHAR()函数进行类型转换. EXEC SQL select to_char(hiredate,'yyyy/mm/dd hh24:mi:ss') into :ac_hire_date from EMP where empno=1234; EXEC SQL insert into EMP(EMPNO,HIREDATE) values(123,to_date(:ac_hiredate,'yyyy/mm/dd hh24:mi:ss');

localtime 转换时间

    博客分类:
  • c++
struct tm * stm = NULL; long ltime = atol("1290140656"); stm = localtime(&ltime); printf("Local hour is: %d-%d-%d %d:%d:%d\n",stm->tm_year+1900,stm->tm_mon+1,stm->tm_mday, stm->tm_hour,stm->tm_min,stm->tm_sec);    Local hour is: ...
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <libxml2/libxml/xmlmemory.h> #include <libxml2/libxml/parser.h> static char nodesXml[30][30] = {0}; int initXml() { int i = 0; char line[200] = {0}; FILE *fp;//打开配置文件句柄 if((fp = fop ...
xml数据结构: xmlChar:对char的基本代替,是一个UTF-8编码字符串中的一个字节 xmlDoc 和 xmlDocPtr:  树的结构 xmlNode 和 xmlNodePtr:单个节点的结构 生成xmldoc、获得根节点,获得子节点 //4. 解析xml字符串 xmlDocPtr doc = xmlParseMemory(pXml, length); //根据xmldoc获得xml的根节点 xmlNodePtr cur = xmlDocGetRootElement(doc); //获得子节点:->children获得不是第一个子节点,必须用n ...
libxml2 xmlReadMemory xmlParseMemory   都是处理xml文件的,就没直接处理xml字符串的函数   1.     xmlParseMemory,字符串转为XML文档 2.     xmlDocGetRootElement,获取XML文档根节点 3.     

漂亮的信号捕捉

    博客分类:
  • c++
#include <unistd.h>; #include <signal.h>; #include <stdlib.h>; #include <setjmp.h>; #include <sys/signal.h>; static jmp_buf jmpbuf; void int_proc(int sig) { siglongjmp(jmpbuf, 1); } int main() { int c, i; int m; ...
#include <signal.h>#include <pthread.h>  #include <stdio.h>  void intr(int sig,siginfo_t *info,void *context)  {          printf("caught by %d\n",pthread_self());  }          void * thread(void * arg)    {    //安装一个SIGINT信号处理             struct sigaction st;            sig ...
create or replace procedure p_test_add /** * purpose  :  增加测试数据 * revisions:    version     date        author                description    --------    ----------  ------------------   ---------------------------------      1.0       2010-10-22    sblig              1. 创建存储过程 */ as   TYPE user_ar ...
Global site tag (gtag.js) - Google Analytics