自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 Linux Shell将逗号分隔的字符串转成换行

OLD_IFS="$IFS"IFS=","arr=(`cat a.txt`)IFS="$OLD_IFS"for s in ${arr[@]}do echo $s | tr -d '"'done 将逗号分隔的字符串放到 a.txt文件,中格式:ss,21,ss,输出格式:ss21xx...

2016-08-19 15:23:07 5576

原创 C++实现Java中System.arrayCopy()的方法

//src[5~15]的数据复制到dest[20~29]的位置unsignedchar*src=(unsignedchar*)malloc(20*sizeof(unsignedchar));memset(src,10,20);unsignedchar*dest=(unsignedchar*)malloc(40*sizeof(unsignedchar));memse...

2015-01-13 11:36:08 909

原创 git clone断点续传

例如:(1): git fetch git://repo.or.cz/tomato.git如果中途掉线,继续执行上面(1)命令(2): git checkout FETCH_HEAD 或者git fetch git://repo.or.cz/tomato.git HEAD 参考文章:http://blog.csdn.net/cupidove/article/deta...

2015-01-13 11:27:41 1696

原创 生成Idea12-13版本的注册码

package com.unique.web;import java.math.BigInteger;import java.util.Date;import java.util.Random;import java.util.zip.CRC32;public class HH { /** * @param s * @param i * @par...

2014-12-26 12:32:05 226 1

原创 何氏命名规则(Ho's Case)

button btchannel chltemplate tplbackground bkgd delete dlt color clr 我总结下这类单词的简写 既有符合美学原理 又简单明了归纳如下:如果单词中包含上凸或下凹的字母(b,g,l,h,p等),那么就可以直接将单词中的这些字...

2014-10-31 17:42:27 132

原创 线性同余随机算法实现

package com.wistone.server.core;public class MyRand { private int seed; public MyRand(int seed) { this.seed = seed; } public int next() { int next = (seed * 29 + 37) % 1000;...

2014-09-24 15:02:51 299

原创 fuser -v -n tcp 9999

fuser -v -n tcp 9999

2014-09-18 10:24:04 302

原创 如何避免git每次提交都输入密码

vim /home/chinaestone/.git-credentials输入内容https://{username}:{password}@github.com保存退出后执行下面命令git config --global credential.helper store执行完后/home/chinaestone/.gitconfig 会新增一项 help...

2014-08-07 13:12:39 99

原创 测试udp端口是否打开

nc -vuz 192.168.2.152 9386 显示Connection to 192.168.2.152 9386 port [udp/*] succeeded! 端口开启

2014-07-09 13:51:33 547

原创 crontab任务显示问题

crontab -l显示出来的内容和/etc/crontab中配置的内容是不一样的虽然两个编辑的任务都可以在crontab中执行。

2014-06-27 15:27:52 764

原创 Java Pass By Value Example

package author.estone.java;import java.util.Date;public class PassByValue { public static void main(String[] args) { Date d1 = new Date("1 Apr 98"); nextDateUpdate(d1); System....

2014-05-03 09:32:47 105

原创 golang first network program example code (for archvie)

package mainimport "fmt"import "net"import "net/http"import "net/url"//import "bufio"import "io/ioutil"import "bytes"import "encoding/binary"//im

2014-04-25 11:08:29 101

原创 How to use git in eclipse ?

when we use git in eclipse, when we commit the project ,sometimes will ignore the .project,.classpath and etc othe files . but when we import the project from the git repo ,the project will not impo...

2014-04-20 11:03:36 119

原创 Generic marshalling with Google Protocol Buffers

Protobuf解析时 不能使用通用解析方法 无法使用消息的多态性问题的临时解决办法http://planet.jboss.org/post/generic_marshalling_with_google_protocol_buffers Protobuf的继承使用的java实现http://blog.wolfman.com/articles/2011/11/23/how-to...

2013-11-23 21:51:48 142

原创 java nio netty资料

http://gee.cs.oswego.edu/dl/cpjslides/nio.pdfhttp://www.kafka0102.com/2010/06/167.html iochttp://www.martinfowler.com/articles/injection.html

2013-09-28 14:55:53 88

原创 这段代码执行任务时启动了几个线程?

import java.util.Timer;import java.util.TimerTask;public class Show { public static void main(String[] args) { Timer timer = new Timer(); timer.schedule(new AnyTimerTask("1"),1000);...

2013-08-07 10:16:59 80

原创 LookupError: unknown encoding 'ms936'

Jython调用print方法,报错如下LookupError: unknown encoding 'ms936'修改方法:chcp 437 直接修改registry配置文件也可以python.console.encoding = cp850

2013-08-05 12:42:22 210

原创 send email via linux shell

echo "hello,this is the content of mail.welcome to hello.world" | mail -s "Hello from hello.world by pipe" [email protected] 

2013-06-24 17:27:48 300

原创 Nginx反向代理不跳转(nginx/java/tomcat/jsp)

<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%> <head> <base href="&a

2013-03-19 17:48:32 2010

原创 Centos 6.1安装dsniff

wget http://mirror.centos.org/centos/5/os/x86_64/CentOS/libpcap-0.9.4-15.el5.x86_64.rpmrpm --force -ivh libpcap-0.9.4-15.el5.x86_64.rpmwget -c http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/...

2013-03-14 11:04:52 805

原创 无法找到脚本引擎Jscript

CScript 错误: 无法找到脚本“...InstallWizardForVS2010.js”的脚本引擎“JScript”。------解决方案--------------------------------------------------------可能是你的脚本库被反注册了,试试: cmd cd /d c:\windows\system32 regsvr32 j...

2013-03-04 13:41:39 192

原创 可继承单例的实现

可继承单例的实现,在java中只能使用登记式单例模式,但是这样子类就必须公开构造方法。又违背了单例的原则。nnd。贴个cpp和c#的可继承单例类吧。java。。。。。。。。。。。。。。。template <class T>class Singleton {public: ~Singleton(void) {}; static T& GetS...

2013-01-09 18:51:24 238

原创 Eclipse Indigo Maven SCM SVN

Following these steps: 1) Install Eclipse Indigo JEE 2) Install m2eclipse via update site http://download.eclipse.org/technology/m2e/releases3) Start "Check out Maven Projects from SCM" wizards ...

2012-12-20 23:06:44 214

原创 JCodeModel定义生成代码中的泛型变量

JClass temp = new JCodeModel().ref(Class.class).narrow(cm.ref(Serializable.class).wildcard());生成内容:Class<? extends Serializable>JClass str = cm.ref("org.isunday.tools.cg.codemode...

2012-12-10 17:30:58 150

原创 驼峰格式和下划线格式字符串相互转换

/** * @param strs * 待转化字符串 * @return * @author estone * @description 下划线格式字符串转换成驼峰格式字符串 * eg: player_id -> playerId;<br> * player_name -...

2012-11-21 11:57:05 598

原创 Send Http Request For Asp with json

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <% Response.CodePage=65001%> <% Response.Charset="UTF-8" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN&qu

2012-09-18 11:28:44 148

原创 使用Consturct创建带有构造参数的对象实例

// 这个是一般对象创建方法Class.forName("author.estone.java.SomeClass").newInstance();这种创建方式的前提是author.estone.java.SomeClass的构造方法必须要有一个SomeClass()的构造方法。如果带有参数的构造方法使用上面的方法即会报错。假设SomeClass的构造方法如下:pu...

2012-08-20 13:33:56 155

原创 延迟5s的另外一种写法

 int seconds = 5; long t = System.currentTimeMillis() + seconds * 1000;while (System.currentTimeMillis() < t); 特点:耗性能,不精确,适合在测试中用。拿着玩可以,别当真。主要是受cpu的处理速度的影响。...

2012-08-07 14:24:49 212

原创 突发奇想

加入文字说明。

2012-07-13 17:37:58 80

原创 无心之过--Java List的set和add用法

啥也不说看代码  List<String> tt = new ArrayList<String>(); tt.add(0,"-1"); tt.add(1,"-1"); tt.add(2,"-1"); tt.add(3,"-1"); tt.add(4,"-

2012-07-03 11:24:33 140

原创 Emacs配置文件(erlang开发)

;; This is needed for Erlang mode setup(setq erlang-root-dir "F:/erlang-dev/erlang-home/erl5.9.1")(setq load-path (cons "F:/erlang-dev/erlang-home/erl5.9.1/lib/tools-2.6.7/emacs" load-path))(s...

2012-06-15 12:25:59 123

原创 在windows中安装Erlang

在windows中安装Erlang11-2-24 上午9:111.下载erlang  http://www.erlang.org/download.html(如果下载R14B版本可直接点下面的链接:http://www.erlang.org/download/otp_win32_R14B01.exe)。2.安装下载的exe文件,注意安装的目录中不要存在空格。3.配置...

2012-06-14 22:35:18 125

原创 Use CodeMoel Generate Java Source Code

package samples;// Example: CodeFactory.javaimport java.io.File;import org.apache.log4j.Logger;import com.sun.codemodel.JBlock;import com.sun.codemodel.JClass;import com.sun.codemode...

2012-06-06 20:21:33 145

原创 关于服务器架构设计的文章

难得的好文章,留个连接,有时间好好翻译一下:) High-Performance Server Architecturehttp://pl.atyp.us/content/tech/servers.html Thread-Caching Model Mallochttp://goog-perftools.sourceforge.net/doc/tcmalloc.html...

2012-05-29 19:52:58 78

原创 找jar的两个网站

finjar.comdocjar.com

2012-05-26 02:00:32 70

原创 eclipse中安装maven

安装 Maven 的插件。插件地址如下:m2eclipse Core Update Sites http://m2eclipse.sonatype.org/sites/m2e 选择Maven Integration for Eclipse (Required)m2eclipse Extras Update Sites http://m2eclipse.sonatype.org/sites/...

2012-05-26 01:10:11 70

原创 Linux 网络状态

  netstat -na|grep ESTABLISHED|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -r | morenetstat -na|grep SYN|awk '{print $5}'|awk -F: '{print $1}'|sort|uniq -c|sort -r | morenetstat ...

2012-01-10 21:55:03 94

原创 Tomcat开启JMX功能

使用Jconsole或者VisualVM监控Tomcat的JVM运行情况时需要开启JMX功能,默认情况下Tomcat是没有开启的,在Tomcat安装目录找到bin/catlina.bat(sh)在dorun和dostart两行后分别添加:set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote -Dcom.sun.manageme...

2011-11-15 00:20:48 228

原创 Protobuf学习笔记

1.下载protobuf源码和编译后的windows文件:protobuf-2.4.1.ziphttp://code.google.com/p/protobuf/downloads/detail?name=protobuf-2.4.1.zip&can=2&q=protoc-2.4.1-win32.ziphttp://code.google.com/p/protobu...

2011-11-11 00:01:50 93

原创 Ubuntu中Java程序乱码问题解决

cd /opt/jdk1.6.0_16/jre/lib/fonts/sudo mkdir fallbackcd fallbacksudo cp /usr/share/fonts/truetype/wqy/* /opt/jdk1.6.0_16/jre/lib/fonts/fallbacksudo mkfontdirsudo mkfontscale 

2011-09-03 14:53:48 227

空空如也

空空如也

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

TA关注的人

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