Skip to content

Instantly share code, notes, and snippets.

View jackeylu's full-sized avatar

Lin Lyu jackeylu

  • Tianfeng Security Ltd.
  • Wuhan
View GitHub Profile
@jackeylu
jackeylu / tmux-cheatsheet.markdown
Created April 12, 2018 06:14 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

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

词的分类

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

ICTPOS3.0词性标记集

n 名词

nr 人名

@jackeylu
jackeylu / CQListenerClient.java
Created August 3, 2016 07:25
If p2p is enabled, CQ failed when 3rd node join the cluster.
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 July 18, 2016 09:26
benchmark on serialization, Ignite Binary Marshaller vs. Protostuff
package example.perf.protostuff;
/**
* Created by jackeylv on 2016/7/13.
*/
public class Foo {
private Object object;
public Foo(){
object = null;
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 July 1, 2016 12:16
Benchmark on simple put and put with event listener.
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 / IgniteClientSimplePut.java
Last active July 1, 2016 11:44
An Ignite client to do simple put operations.
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 / IgniteClientCacheEventPut.java
Last active July 1, 2016 11:44
An Ignite client doing cache put with event listener.
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 / CacheOperations.java
Created July 1, 2016 11:43
Cache Operations, currently only with putting.
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 / daemon.py
Created February 1, 2016 02:42 — forked from jamiesun/daemon.py
一个python守护进程的例子
#! /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