- 博客(307)
- 资源 (8)
- 收藏
- 关注
java di/ioc
public class Test { @org.junit.Test public void test1() { HK2 hk2 = HK2.get(); Services services = hk2.create(null, new Module[0]); DynamicBinderFactory dynamicB...
2018-09-30 17:35:53
309
scala break
import org.junit.{Before, BeforeClass, Test}import org.scalatest.junit.JUnitSuiteimport scala.util.control.{Breaks, ControlThrowable}private class BreakControl extends ControlThrowable...
2018-09-27 13:37:55
321
py
# >python Sample1.py# hello, worldclass Feature: 'feature' def __init__(self, att, value): self._att = att self._value = value def att(self): "att" return self._att ...
2018-09-27 12:29:23
210
scala JUnitSuite for unit test
import org.junit.{Before, BeforeClass, Test}import org.scalatest.junit.JUnitSuiteimport scala.util.control.{Breaks, ControlThrowable}import scala.util.control.Breaks._private class BreakCo...
2018-09-27 12:26:45
316
tomcat jmx
{ sun.management.RuntimeImpl[java.lang:type=Runtime], sun.management.GarbageCollectorImpl[java.lang:type=GarbageCollector,name=PS Scavenge], org.apache.tomcat.util.modeler.BaseModelMBean[Tomc...
2018-06-22 13:50:08
378
ftp://ftp.ics.uci.edu/pub/machine-learning-databases
ftp://ftp.ics.uci.edu/pub/machine-learning-databaseshttps://www.ece.rice.edu/~wakin/images/https://blog.youkuaiyun.com/duan19920101/article/details/50679061
2018-06-06 14:29:37
860
scala (λx.M)
> val fx1 = (x: Int) => x + 1fx1: Int => Int = $$Lambda$1059/1521946103@6764201e> fx1(1)res7: Int = 2> def fx2 = (x: Int) => x + 1fx2: Int => Int> fx2(2)res8: Int = 3> def fx3(x: I...
2018-06-06 14:27:42
138
UUID
UUID-> ->most significant long-> ->time_low->time_mid->version->|||time_hi->UUID中的时间戳表示1582年10月15号午夜即晚上12点(UTC时...
2018-05-29 16:12:37
171
RLP
RLPRecursive Length PrefixRLP元素:item,list长度编码数据编码数据编码和长度编码采用的是相同的编码规则。编码规则: -> | | | ()+ -> -128, 1-127 ...
2018-04-05 14:14:46
328
随便记录点东西
头部body压缩不压缩BytesTransportRequest请求非BytesTransportRequest请求压缩算法action如:indices:data/read/search请求头请求内容如:org.elasticsearch.action.search.SearchRequest...
2017-12-28 20:30:45
155
dubbo 协议
encodeone to oneorg.jboss.netty.handler.codec.oneone.OneToOneEncodercom.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter.InternalEncoderorg.jboss.netty.handler.codec.base64.Base64E...
2017-12-06 16:32:01
235
随便一点代码
/* * $ gcc -c selecttest.c -o selecttest.o * $ gcc selecttest.o -o selecttest */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <errno.h>...
2017-11-11 22:56:18
246
随便一点代码
#include <stdio.h>#include <stdlib.h>#include <string.h>#include <errno.h>#include <assert.h>#include <sys/types.h>#include <sys/socket.h>
2017-11-04 04:34:10
217
随便一点代码
#include <stdio.h>#include <string.h>#include <errno.h>#include <assert.h>#include <netdb.h>#define __DEBUG__ void printf_protoent(struct protoent* ...
2017-10-29 23:56:29
292
随便一点代码
public class NioEventLoop_ServerTest { private Selector selector(NioEventLoop eventLoop) throws NoSuchFieldException { Class<?> clazz = eventLoop.getClass(); Field field = null; ...
2017-10-29 04:01:48
149
Thrift序列化
参考structField上面的Field Id对应下面例子中”:”前面的数字:struct Order { 1: required i64 orderId; 2: required i64 userId; 3: required string status;}Fieldstop ->...
2017-10-28 03:50:32
225
Hessian远程调用(基于Netty)
public class HessianMethodInvocation implements InvocationHandler, Serializable { private static final long serialVersionUID = 7304512179586775133L; private TestServiceImpl testService;...
2017-10-15 15:17:20
462
RoundRobin
public int index() { return Math.abs(idx.getAndIncrement() % executors.length);} public int index1() { return idx1.getAndIncrement() & executors1.length - 1;} public int index...
2017-10-15 03:58:47
255
Java interrupting a thread that is not alive need not have any effect
@Testpublic void interrupt4b() { Thread t = new Thread() { public void run() { for (int i = 0; i < 10; i++) { if (isInterrupted()) { System.out.println("interrupted");...
2017-10-10 23:40:02
152
Spring Thrift, Hessian like over Http
public class ThriftExporter extends RemoteExporter implements InitializingBean { private static final Logger LOGGER = LoggerFactory.getLogger(ThriftExporter.class); public static final St...
2017-09-25 00:24:18
149
Serialize: Hadoop Record IO, Jute and Thrift
Hadoop Record IO, Jute and Thrift
2017-09-23 23:53:32
123
纯内存(In-Memory)数据库的可能性, 无需写盘, 使得内存同样具备硬盘的可靠持久化...
纯内存(In-Memory)数据库的可能性, 无需写盘, 使得内存同样具备硬盘的可靠持久化
2017-09-11 22:14:29
554
Java开发类似memcached缓存系统的可能性
Java开发类似memcached缓存系统的可能性 个人觉得Java不太适合开发类似memcached的缓存系统, 虽然, 如果使用Java开发的话, 也未必不行, Java开发类似memcached缓存系统也是可行的。 如果使用Java开发类似memcached的缓存系统, 大概的思路可以: 1、使用Soft引用, 还是用Java的堆内存管理2、使用Direct m...
2017-09-09 00:33:58
101
Java native memory
public class Block { private static Unsafe unsafe; { try { unsafe = getUnsafe(); } catch (Throwable e) { throw new Error("fatal: " + e.getMessage(), e); } } private ...
2017-09-08 23:42:08
472
1
Java Heap memory, Direct memory and Native memory
Java Heap memory, Direct memory and Native memory
2017-09-08 23:40:14
600
Java Reachability
Automatically-cleared referencesSoft and weak references are automatically cleared by the collector before being added to the queues with which they are registered, if any. Therefore soft and weak ...
2017-09-07 11:12:26
129
一段测试代码
package com.java;import java.lang.reflect.Field;import sun.misc.Unsafe;class SynTestClass { protected Thread mainThread; public SynTestClass(Thread mainThread) { this.mainThr...
2017-09-06 14:38:38
170
X/Open DTP模型-组件接口
TX接口Application Program向Transaction Manager发起事务起始和结束的接口XATMI和TxRPC接口Application Program到CRM的通信接口XA接口Transaction Manager和Resource Manager之间的双向接口。用于同步记录Transaction Manager和Resource Manag...
2017-08-29 14:56:01
249
事务(transaction)
事务由一组操作组成的完整的可被取消的工作单元. 这里试图解释的事务不只是数据库事务,也包括数据库事务,通常在一个不稳定的操作环境中,需要保证这个工作单元(暂时在这里称之为事务)中所有操作的结果一致。 Composite Transactions for SOA 写道A transaction is defined as a task that is composed o...
2017-08-29 01:23:05
137
有没有哪种消息队列(不限开源的)实现是“真正的”的不会出现”重复消费”?...
有没有哪种消息队列(不限开源的)实现是“真正的”的不会出现”重复消费”?
2017-07-18 03:23:44
121
JVM中一种random实现
long _rand_seed = 1; void init_random(long initval) { _rand_seed = initval;} long random() { /* standard, well-known linear congruential random gene...
2017-07-13 00:05:45
355
MD5中的几个变换函数
private static int A = 0x67452301;private static int B = 0xefcdab89;private static int C = 0x98badcfe;private static int D = 0x10325476;// F(X,Y,Z) = XY v not(X) Z// #define F(x, y, z) ...
2017-06-28 22:25:51
233
RSA 公钥长度读写
读取长度:this.length = DerInputStream.getLength(i & 0xFF, paramInputStream); static int getLength(int paramInt, InputStream paramInputStream) throws IOException{ int j = paramInt...
2017-06-06 02:55:24
756
Java打印程序设计全攻略-5.doc
2007-10-06
Java打印程序设计全攻略-4.doc
2007-10-06
Java打印程序设计全攻略-2.doc
2007-10-06
Java打印程序设计全攻略-2.doc
2007-10-06
Java打印程序设计全攻略-1.doc
2007-10-06
mysql-connector-java-3.0.17-ga-bin.jar
2007-10-06
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人