This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(lib_misc). | |
-compile(export_all). | |
string2value(Str) -> | |
{ok, Tokens, _} = erl_scan:string(Str ++ "."), | |
{ok, Exprs} = erl_parse:parse_exprs(Tokens), | |
Bindings = erl_eval:new_bindings(), | |
{value, Value, _} = erl_eval:exprs(Exprs,Bindings), | |
Value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.chinaxing.java.erlang; | |
import com.ericsson.otp.erlang.*; | |
/** | |
* lambda-dog : | |
* erl -name 'lambda-dog'@127.0.0.1 | |
* > c(a). | |
* > Pid = spawn(a,start,[]). | |
* > register(consumer, Pid). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.chinaxing.test.netty; | |
import io.netty.bootstrap.Bootstrap; | |
import io.netty.bootstrap.ServerBootstrap; | |
import io.netty.buffer.ByteBuf; | |
import io.netty.channel.*; | |
import io.netty.channel.nio.NioEventLoopGroup; | |
import io.netty.channel.socket.nio.NioServerSocketChannel; | |
import io.netty.channel.socket.nio.NioSocketChannel; | |
import io.netty.handler.codec.ByteToMessageDecoder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Stumbling towards Y | |
; | |
; The applicative-order Y combinator is a function that allows one | |
; to create a recursive function without using define. | |
; This may seem strange. Usually a recursive function has to call | |
; itself, and thus relies on itself having been defined. | |
; | |
; Regardless, here we will stumble towards the implementation of the | |
; Y combinator (in Scheme). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
import java.io.FilenameFilter; | |
import java.lang.reflect.Modifier; | |
import java.net.JarURLConnection; | |
import java.net.URL; | |
import java.util.*; | |
import java.util.jar.JarEntry; | |
import java.util.jar.JarFile; | |
public class ClassScanner{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#+TITLE: 探针与探针消息服务器通信协议文档(初稿) | |
#+LATEX_HEADER: \usepackage{xltxtra} | |
#+LATEX_HEADER: \setmainfont{文鼎PL简中楷} | |
** 通信模式 | |
通信模式为探针设备将数据报文发送给探针服务器: | |
#+BEGIN_SRC dot :exports results :file images/probe.png | |
digraph protocol { | |
node [ color = grey style = dashed fontsize = 12 ] | |
edge [ color = blue fontsize = 8 ] | |
rankdir = LR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Rpc : dubbo, RMI, Tesla | |
2. IOC : Guice ( source code ) | |
3. OSGI : osgi | |
4. Disrutpor : ringbuffer, sequence | |
5. Akka : actor | |
6. Erlang : concurrent | |
7. Cloujor : design-pattern | |
8. JNI | |
9. NIO | |
10. Netty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mogujie.nicolay.node; | |
import ch.qos.logback.classic.spi.ILoggingEvent; | |
import ch.qos.logback.core.Appender; | |
import ch.qos.logback.core.Context; | |
import ch.qos.logback.core.FileAppender; | |
import ch.qos.logback.core.encoder.Encoder; | |
import ch.qos.logback.core.joran.spi.JoranException; | |
import ch.qos.logback.core.rolling.RollingFileAppender; | |
import ch.qos.logback.core.rolling.RollingPolicy; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grant codeBase "file:${java.home}/../lib/tools.jar" { | |
permission java.util.PropertyPermission "java.rmi.server.ignoreSubClasses", "write"; | |
permission "java.lang.RuntimePermission" "accessClassInPackage.sun.tools.jstatd"; | |
permission "java.lang.RuntimePermission" "accessClassInPackage.sun.jvmstat.monitor"; | |
permission "java.util.PropertyPermission" "sun.jvmstat.monitor.package","read"; | |
permission "java.util.PropertyPermission" "sun.jvmstat.monitor.local","read"; | |
permission "java.util.PropertyPermission" "sun.jvmstat.monitor.remote","read"; | |
permission "java.util.PropertyPermission" "sun.jvmstat.monitor.MonitoredHost","read"; | |
permission "java.lang.RuntimePermission" "accessClassInPackage.sun.jvmstat.perfdata.monitor.protocol.local"; | |
permission "java.lang.RuntimePermission" "accessClassInPackage.sun.jvmstat.perfdata.monitor"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.mogujie.nicolay</groupId> | |
<artifactId>mini-demo</artifactId> | |
<version>1.0-SNAPSHOT</version> |