genier200
genier200 · 共 9 篇文章
Executors.newSingleThreadScheduledExecutor【持续更新】
工作中遇到的问题: 【问题现象】: 使用 ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); scheduler.scheduleWithFixedDelay(new Runnable() { public void run() { //...CODE } }, 1, 10, TimeUnit.SECONDS); 多数的task使用此方法能够正常执行,本人编写的代码中使用此方法,却不能正常执行,系统自动将此连接池对象thread置为无限等待状态:WAITING,无法周期执行,导致…
2011-12-25 00:04 · 评论(1)
chrome编译-初稿
CHROME相关 下载 帮助页面:http://dev.chromium.org/developers/how-tos/get-the-code 下载chrome专用源码管理工具depot_tools: http://dev.chromium.org/developers/how-tos/install-depot-tools 解压depot_tools.zip到任意位置后,进入文件夹,运行gclient.bat,然后等待下载、安装svn、python等完成; 将gclient放入到windows的path中,也可以不放入,在运行的时候,找到正确的路径即可; 切换到保存源码的目录,使用gcl…
2011-08-11 22:32 · 评论(0)
windows c thread
/* cpp_demo.cpp MSDN帮助手册:http://msdn.microsoft.com/zh-cn/library/ms235302(v=VS.80).aspx 只是针对CRT(C RunTime)的 _beginthread 和 _beginthreadex 函数创建多线程 MFC和WIN32 Api创建的线程,请参考其他: 运行时需要使用管理员身份运行此实例。 @author:lx */ #include "stdafx.h" #include <stdlib.h> #include <stdio.h> #include <process.h> #include <..\c…
2011-08-10 22:40 · 评论(0)
linux c thread
#include <stdio.h> #include <pthread.h> #include <stdlib.h> #include <sys/time.h> #include <limits.h> //编译命令:g++ -g -o multithread multithread-2.c -lpthread const char *FILE_PATH="/root/test"; const int file_size[]={512,1024,46900}; struct args { int max; int min; }; void* work( void*); int main() …
2011-08-07 22:42 · 评论(1)
linux shell 随机大小文件,指定个数
#!/bin/sh #单线程操作,速度比较蛮 file_path=/root/test file_size=(512 1024 3456) file_radio=(30 40 30) function random() { min=$1 max=$2 num=`date +%s%N` ((value=$num%($max-$min)+min+1|bc)) echo $value } file_size_count=${#file_size[*]} file_radio_count=${#file_radio[*]} if [ $file_size_count=$file_radio_coun…
2011-08-07 17:48 · 评论(0)
电子书收藏
我的电子书收藏。。。 java类关系继承图 http://www.falkhausen.de/en/diagram/download.html
2011-08-07 14:41 · 评论(0)
linux mysql api c/c++
/* vim /etc/vimrc--始具体情况而定 vim 显示行号、c语言高亮、自动缩进等 set nu set cindent set autoindent syntax on 编译前提: 环境:os RH5_x86_64,mysql5 使用rpm包安装好了mysql,如果其他环境请自行设置编译命令; 编译命令: g++ $(mysql_config --cflags) $(mysql_config --libs) mysql.c mysql官方帮助文档: http://dev.mysql.com/doc/refman/5.1/en/c-api-functions.html */ #i…
2011-08-04 23:52 · 评论(0)
python的文件操作
import os import sys class LineCount: def getTime(): return sys.version def listAllFiles(name): if name=="": return "file name can not be empty" else: count=0; dirs=os.listdir(name) for dir in dirs: fullPath=name+'\\'+dir if os.path.isdir(fullPath): LineCount.listAllFiles(fullPath) else: count=coun…
2011-07-30 22:59 · 评论(0)
python的sqlite操作
#a demo for coding python with sqlite3 import sqlite3 #如果在某些版本中,需要添加以下代码,才能操作成功; #from _sqlite3 import * conn=sqlite3.connect("e:\python.db") print(type(conn)) #conn.text_factory=str #query cur=conn.execute("select * from python_config_2") rs=cur.fetchall() print(type(rs)) for _li in rs: print(_li)…
2011-07-30 22:58 · 评论(0)