自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(150)
  • 收藏
  • 关注

转载 Java 网络IO编程总结(BIO、NIO、AIO均含完整实例代码)

转载请注明出处:http://blog.csdn.net/anxpp/article/details/51512200,谢谢!    本文会从传统的BIO到NIO再到AIO自浅至深介绍,并附上完整的代码讲解。    下面代码中会使用这样一个例子:客户端发送一段算式的字符串到服务器,服务器计算后返回结果到客户端。    代码的所有说明,都直接作为注释,嵌入到代码中,看代码时就

2017-08-02 18:25:34 377

原创 H2database源码编译及运行

H2database源码编译及运行标签: H2database在工作中需要做大数据缓存方案,浏览到内存数据库想对数据库实现进行了解,故选择H2做为样本进行源码阅读,环境如下: 操作系统:win7 64位系 H2database源码版本:1.4.196-SNAPSHOT Eclipse版本:Neon.3 Release (4.6.3) JDK版本:1.8 H2databas

2017-07-07 17:49:12 1619

原创 ES-TCPTransport 3 - ES通信协议解析

1.wireshark提取数据elasticsearch协议包设置抓取本机通信包:a.以管理员身份打开命令提示符b.输入 route add [本机ip] mask 255.255.255.255 [网关ip]c.将我们程序里面的localhost或者127.0.0.1替换成本机ip提取数据包信息:使用程序发送es协议进行通信 - a.打开抓取整个系统包: - b.过滤获取ela

2017-07-07 10:56:35 4517

原创 ES-TCPTransport 2 - 自定义ES协议解析

目标&材料: 通过API应用完成信息通信交互; 代码地址:http://git.oschina.net/walleipt/es-cluster/blob/master/src/main/java/com/waleipt/api/es/tcptransport/Custom_protocol_test.java?dir=0&filepath=src/main/java/com/waleipt/ap

2017-07-07 10:56:03 763

原创 ES-TCPTransport 1 - 交互以及API

本节目标:主要为了掌握TCPTransport交互过程已经熟悉其中相关的API;为之后自定义ES交互协议做储备。TCPTransport与Netty4Transport简介TCPTransport是Netty4Transport抽象,它主要以节点为粒度定义了通信的过程,包括:ping任务、连接建立,发送信息和协议结构的基本封装等。TCPTransport的交互过

2017-07-07 10:53:49 543

原创 搭建elasticSearch源码调试环境

eclipse运行原理简单了解下ES运行时的目录,如下图:ES启动过程如下图:eclipse 启动方案,使用eclipse直接启动Elasticsearch的main方,并配置path.home目录,即可使用eclipse完成启动工具/原料JDK — 【jdk1.8.0_121】安装参考:http://ji

2017-07-07 10:53:01 4088

转载 bochs实用教程

bochs是可以虚拟一台计算机的虚拟机,和VMware和虚拟pc是一样的东东,不过开源。它比vmware小巧,占用系统资源少,但系统安装后速度较 之有点慢。有几种原因让你选择它,比如你不想用盗版,你想试试写操作系统(bochs的调试功能很好,写操作系统的人会用它),你只想试一个很小巧的操作 系统,不需要vmware。     bochs不像vmware有友好的界面,鼠标点点就可以用了,它需要配

2012-11-06 14:53:04 2785

转载 Eclipse更改默认字符集 设置UTF-8

eclipse中UTF-8设置1.windows->Preferences   打开"首选项"对话框;2.然后,general->Workspace,右侧Text file encoding,选择Other,改变为UTF-8。3.Web->打开,把CSS、HTML、JSP、JavaScript、 XML等设置为UTF-8。或在这里更改,general->Content Types,

2012-10-11 10:21:40 5187

转载 vim tab设置为4个空格

.vimrc中添加以下代码后,重启vim即可实现按TAB产生4个空格:set ts=4  (注:ts是tabstop的缩写,设TAB宽4个空格)set expandtab对于已保存的文件,可以使用下面的方法进行空格和TAB的替换:TAB替换为空格::set ts=4:set expandtab:%retab!空格替换为TAB::set ts=4:

2012-08-23 18:46:50 571

转载 jetty:请求的操作无法在使用用户映射区域打开的文件上执行

使用jetty-maven-plugin 在eclipse中进行运行调试,碰到无法编辑保存webapp下的文件 提示:请求的操作无法在使用用户映射区域打开的文件上执行 解决方法: 从 jetty 7 开始,jar存放在maven仓库中的路径为org/eclise/jetty/jetty-webapp打开对应的版本的jar包修改ja

2012-08-20 16:00:36 4326

原创 jetty的启动

启动命令:jetty:run -Djetty.port=8081 -Dmaven.test.skip=true -Pdev指定端口:8081跳过测试使用profile为devpom:org.mortbay.jettymaven-jetty-plugin3/media

2012-08-17 14:56:40 417

转载 vim 查找替换

vi/vim 中可以使用 :s 命令来替换字符串:s/vivian/sky/ 替换当前行第一个 vivian 为 sky:s/vivian/sky/g 替换当前行所有 vivian 为 sky:n,$s/vivian/sky/ 替换第 n 行开始到最后一行中每一行的第一个 vivian 为 sky:n,$s/vivian/sky/g 替换第 n 行开始到最后一行中每

2012-08-09 15:32:05 253

转载 Apache CXF实战之九 发布使用SSL的Web Service .

在使用Web Service的时候,在很多情况下会要求我们发布ssl的web service,此时如果web service是作为一个war包部署在tomcat之类的web容器中的时候,我们可以通过修改tomcat的配置来比较容易的部署发布成ssl的web service的,当对于独立运行的程序来书,此时发布web service是需要一些操作的,下面看看在CXF中怎样发布并调用SSL的Web S

2012-07-24 14:27:18 466

转载 plsql乱码问题

思路: 注册表跟系统环境变量里的字符集统一。1.在运行中输入regedit,打开注册表编辑器2.HKEY_LOCAL_MACHINE->SOFTWARE->ORACLE->KEY_OraClient11g_home1看见 NLS_LANG 将:SIMPLIFIED CHINESE_CHINA.ZHS16GBK3.cmd --> set发现nls_lang=AME

2012-07-17 10:58:44 615

转载 Maven_对不同的部署环境打包

Spring STS默认集成了对Maven的支持,采用Maven管理依赖非常方便。 采用STS新建一个Spring MVC的项目,默认的目录结构如图:然后可以通过项目名称上点击右键,run来执行Maven相关的命令:比如,执行package,maven就自动把项目编译,跑一下单元测试,然后文件打包成war包。这是因为项目的结构都是采用的约定的方式进行的。直接查看pom.xm

2012-06-11 09:53:11 3112

转载 趣味数据结构 – BitMap

1、什么是Bit-MapBit-Map被译为位图,和人讨论的时候,常常会与.BMP搞混,这个Map我觉得翻译成映射更为合适,Bit-Map也算是Hash的一直极致运用吧。Bit-Map会用Bit来标记某个元素对应的value,如何标记的呢,见下例:我们现在有(1,2,5,8,10)数组,常规来说是这样声明的:int[] array = {1, 2, 5, 8, 10}上面这样声

2012-05-24 16:56:49 4208

转载 位图bitmap算法

简单的说就是用数组存放若有数据就标志为1或true,若不存在标志为0或false。比如1,2,2,5,这里最大值为5,0至5中不存0,3,4,所以:Array[0]=0,Array[1]=1,Array[2]=2,Array[3]=0,Array[4]=0,Array[5]=1上面数中由于2有两个,所以用int存数组的值,不用boolean型,这样如果有多个同样的数字可以用值表示个数。如上

2012-05-24 15:45:39 562

原创 Python_API_ZipFile_close_待填充

ZipFile.close()Close the archive file. You must call close() before exiting your program or essential records will not be written.

2012-05-23 16:12:32 419

原创 Python_API_ZipFile_write_待填充

ZipFile.write(filename[,arcname[,compress_type]])Write the file named filename to the archive, giving it the archive namearcname (by default, this will be the same asfilename, but without a driv

2012-05-23 16:11:52 887

原创 Python_API_os.path_relpath_待填充

os.path.relpath(path[,start])Return a relative filepath to path either from the current directory or from an optionalstart point.start defaults to os.curdir.Availability: Windows, Unix.New

2012-05-23 16:10:28 1414

原创 Python_API_zipfile.ZipFile_待填充

class zipfile.ZipFile The class for reading and writing ZIP files. See sectionZipFile Objects for constructor details.

2012-05-23 16:08:24 380

原创 Python_API_os_remove_待填充

os.remove(path)Remove (delete) the file path. If path is a directory,OSError is raised; seermdir() below to remove a directory. This is identical to theunlink() function documented below. On Win

2012-05-23 16:06:25 387

原创 Python_API_os.path_isfile_待填充

os.path.isfile(path)Return True ifpath is an existing regular file. This follows symbolic links, so both islink() and isfile() can be true for the same path.

2012-05-23 16:05:25 299

原创 Python_API_shutil_copy_待填充

shutil.copy(src,dst)Copy the file src to the file or directorydst. Ifdst is a directory, a file with the same basename as src is created (or overwritten) in the directory specified. Permission bit

2012-05-23 16:03:25 311

原创 Python_API_os_mkdir_待填充

os.mkdir(path[,mode])Create a directory named path with numeric modemode. The defaultmode is 0777 (octal). On some systems,mode is ignored. Where it is used, the current umask value is first mas

2012-05-23 16:01:47 345

原创 Python_API_os.path_exists_待填充

os.path.exists(path)Return True ifpath refers to an existing path. Returns False for broken symbolic links. On some platforms, this function may returnFalse if permission is not granted to exe

2012-05-23 16:00:25 874

原创 Python_API_os.path_splitdrive_待填充

os.path.splitdrive(path)Split the pathname path into a pair (drive, tail) where drive is either a drive specification or the empty string. On systems which do not use drive specifications,drive wi

2012-05-23 15:58:42 834

原创 Python_API_os.path_walk_待填充

os.path.walk(path,visit, arg) Calls the function visit with arguments (arg, dirname, names) for each directory in the directory tree rooted at path (includingpath itself, if it is a director

2012-05-23 15:57:29 315

转载 python压缩和解压zip

例如,在py脚本所在目录中,有如下文件:readability/readability.jsreadability/readability.txtreadability/readability-print.cssreadability/sprite-readability.pngreadability/readability.css将 readability 目录中

2012-05-23 15:48:28 315

转载 python_API_getopt

getopt在PYTHON中的使用        在运行程序时,可能需要根据不同的条件,输入不同的命令行选项来实现不同的功能。目前有短选项和长选项两种格式。短选项格式为"-"加上单个字母选项;长选项为"--"加上一个单词。长格式是在Linux下引入的。许多Linux程序都支持这两种格式。在Python中提供了getopt模块很好的实现了对这两种用法的支持,而且使用简单。一、取得命令

2012-05-17 12:37:21 287

转载 Oracle_游标使用详解

-- 声明游标;CURSOR cursor_name IS select_statement--For 循环游标--(1)定义游标--(2)定义游标变量--(3)使用for循环来使用这个游标declare --类型定义 cursor c_job is select empno,ename,job,sal from e

2012-04-30 12:59:11 318

转载 Python_格式化字符串

将python字符串格式化方法以例子的形式表述如下:* 定义宽度Python代码>>> '%*s' %(5,'some')' some'- 左对齐Python代码>>> '%-*s' %(5,'some')'some '最小宽度为6的2位精度的浮点小数,位数不够时前补空格Python代码>>> '%6.2f'

2012-04-26 14:39:52 373

转载 python urllib使用

简介:urllib2是python的一个获取url(Uniform Resource Locators,统一资源定址器)的模块。它用urlopen函数的形式提供了一个非常简洁的接口。这使得用各种各样的协议获取url成为可能。它同时 也提供了一个稍微复杂的接口来处理常见的状况-如基本的认证,cookies,代理,等等。这些都是由叫做opener和handler的对象来处理的。以下是获取u

2012-04-07 18:32:00 353

原创 Python_API_Built-in Functions_globals

API文档:globals()Return a dictionary representing the current global symbol table. This is always the dictionary of the current module (inside a function or method, this is the module where it is

2012-04-07 17:30:15 361

原创 Python_API_Built-in Functions_locals

API文档:locals()      Update and return a dictionary representing the current local symbol table. Free variables are returned bylocals() when it is called in function blocks, but not in class

2012-04-07 17:17:05 308

原创 Python_API_Structured Markup Processing Tools_sgmllib.SGMLParser.reset

API文档:SGMLParser.reset()     Reset the instance. Loses all unprocessed data. This is called implicitly at instantiation time.翻译文档:    reset有SGMLParser的__init__调用,在reset进行初始化的工作。例子:#! /

2012-04-07 16:47:36 590

原创 Python_API_Structured Markup Processing Tools_sgmllib.SGMLParser.feed

API文档:   SGMLParser.feed(data) Feed some text to the parser. It is processed insofar as it consists of complete elements; incomplete data is buffered until more data is fed or close() is called.

2012-04-07 16:39:22 554

原创 Python_API_Structured Markup Processing Tools_sgmllib.SGMLParser

API文档:    This module defines a class SGMLParser which serves as the basis for parsing text files formatted in SGML (Standard Generalized Mark-up Language). In fact, it does not provide a full SGML

2012-04-07 15:59:13 395

原创 Python_Built-in Types_list.extend

API文档:array.extend(iterable) Append items from iterable to the end of the array. If iterable is another array, it must have exactly the same type code; if not, TypeError will be raised. If iterabl

2012-04-07 15:23:57 420

原创 Python_API_String Services_re.compile

API文档:re.compile(pattern[, flags]) Compile a regular expression pattern into a regular expression object, which can be used for matching using its match() and search() methods, described below.

2012-04-05 18:11:45 270

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除