Skip to content

Instantly share code, notes, and snippets.

Avatar

Lin Lyu jackeylu

  • Tianfeng Security Ltd.
  • Wuhan
View GitHub Profile
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jackeylu
jackeylu / 词性标记.md
Created Dec 9, 2016 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性
View 词性标记.md

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词
	nr 人名
@jackeylu
jackeylu / CQListenerClient.java
Created Aug 3, 2016
If p2p is enabled, CQ failed when 3rd node join the cluster.
View CQListenerClient.java
package example.ignite;
import com.tencent.perf.ignite.AlwaysTrueRemoteFilter;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.IgniteLogger;
import org.apache.ignite.Ignition;
import org.apache.ignite.binary.BinaryBasicIdMapper;
import org.apache.ignite.binary.BinaryBasicNameMapper;
import org.apache.ignite.cache.query.ContinuousQuery;
@jackeylu
jackeylu / Foo.java
Created Jul 18, 2016
benchmark on serialization, Ignite Binary Marshaller vs. Protostuff
View Foo.java
package example.perf.protostuff;
/**
* Created by jackeylv on 2016/7/13.
*/
public class Foo {
private Object object;
public Foo(){
object = null;
View ClassWrapper.java
package example.protostuff;
/**
* wrapper is needed for interface and abstract modifier
* Created by jackeylv on 2016/7/14.
*/
public class ClassWrapper {
private Object wrappedValue;
public ClassWrapper(){
@jackeylu
jackeylu / CacheOperations.java
Last active Jul 1, 2016
Benchmark on simple put and put with event listener.
View CacheOperations.java
public class CacheOperations {
public void putOperations(Ignite ignite, String cache_name, int thread_num) {
TimeRecord tr = new TimeRecord();
tr.reset();
int step = 20000;
PutTask[] tasks = new PutTask[thread_num];
for (int i = 0; i < thread_num; i++) {
tasks[i] = new PutTask(ignite, cache_name, step*(i-1), step*i);
tasks[i].start();
}
@jackeylu
jackeylu / CacheOperations.java
Created Jul 1, 2016
Cache Operations, currently only with putting.
View CacheOperations.java
public class CacheOperations {
public void putOperations(Ignite ignite, String cache_name, int thread_num) {
TimeRecord tr = new TimeRecord();
tr.reset();
int step = 20000;
PutTask[] tasks = new PutTask[thread_num];
for (int i = 0; i < thread_num; i++) {
tasks[i] = new PutTask(ignite, cache_name, step*(i-1), step*i);
tasks[i].start();
}
@jackeylu
jackeylu / IgniteClientCacheEventPut.java
Last active Jul 1, 2016
An Ignite client doing cache put with event listener.
View IgniteClientCacheEventPut.java
public class IgniteClientCacheEventPut {
public static void main(String[] args) {
Ignition.setClientMode(true);
try (Ignite ignite = Ignition.start(args[0])){
String cache_name = "ignite-cache";
IgniteCache cache = ignite.getOrCreateCache(cache_name);
UUID uuid = addEventListener(ignite, cache_name);
new CacheOperations().putOperations(ignite, cache_name, Integer.valueOf(args[1]));
removeEventListener(ignite, uuid);
@jackeylu
jackeylu / IgniteClientSimplePut.java
Last active Jul 1, 2016
An Ignite client to do simple put operations.
View IgniteClientSimplePut.java
public class IgniteClientSimplePut {
public static void main(String[] args) {
Ignition.setClientMode(true);
try (Ignite ignite = Ignition.start(args[0])){
String cache_name = "ignite-cache";
IgniteCache cache = ignite.getOrCreateCache(cache_name);
new CacheOperations().putOperations(ignite, cache_name, Integer.valueOf(args[1]));
System.out.println("Cache size: "+cache.size());
@jackeylu
jackeylu / daemon.py
Created Feb 1, 2016 — forked from jamiesun/daemon.py
一个python守护进程的例子
View daemon.py
#! /usr/bin/env python2.7
#encoding:utf-8
#@description:一个python守护进程的例子
#@tags:python,daemon
import sys
import os
import time
import atexit
from signal import SIGTERM