Java Jdk Proxy

分析环境: jdk8 dynamic proxy 是啥? A dynamic proxy class is a class that implements a list of interfaces1 specified at runtime such that a method invocation through one of the interfaces on an instance of the class will be encoded and dispatched to another object through a uniform interface2. 动态代理类生成调用方法如下: Proxy.newProxyInstance(handler.getClass().getClassLoader(),

Algorithm Snowflake

分布式 ID snowflake 算法使用一个 64bits 的正整数作为 ID。64bits 正整数 layout 如下: package stardustman.github.io; public class SnowFlake { // 起始的时间戳 private final static long START_STAMP = 1480166465631L; // sequence number private final static long SEQUENCE_BIT = 12; // machine id bits private final

Master Pki

certificate 目标:绑定 public key 和 name。一切围绕着这个目标来展开。 图解 References 强烈推荐-everything-pki 翻译版-everything-pki ubuntu-trust-store-location decode-an-ssl-certificate c

Java Thread Pool Params

基本策略 关注点分离,任务提交和执行分离。 延迟策略,延迟初始化。 图解 References 你管这破玩意叫线程池

Virtual Memory Address Explore

virtual memory address space layout 代码测试 cargo new vas-explore main.rs use std::{thread,time}; fn main() { println!("Hello, world!"); let sl = time::Duration::from_millis(10000000); thread::sleep(sl); println!("Goodbye, world!"); } cargo build ./target/debug/vas-explore pidof vas-explore /proc/pid/maps stardust@os:x86_64-linux-gnu$ pidof vas-explore 75599 stardust@os:x86_64-linux-gnu$ cat /proc/75599/maps 556a8a831000-556a8a837000 r--p 00000000 08:12 815699 /home/stardust/Desktop/rust/vas-explore/target/debug/vas-explore 556a8a837000-556a8a86e000 r-xp 00006000 08:12 815699 /home/stardust/Desktop/rust/ vas-explore/target/debug/vas-explore # text(code segment) segment 556a8a86e000-556a8a87c000 r--p 0003d000 08:12 815699 /home/stardust/Desktop/rust/vas-explore/target/debug/vas-explore 556a8a87d000-556a8a880000 r--p 0004b000 08:12 815699 /home/stardust/Desktop/rust/vas-explore/target/debug/vas-explore