Skip to content

Instantly share code, notes, and snippets.

@luw2007
luw2007 / 词性标记.md
Last active March 18, 2024 06:36
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

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

ICTPOS3.0词性标记集

n 名词

nr 人名

@luw2007
luw2007 / ikandou_books_orderby_download.txt
Created February 27, 2013 02:00
ikandou 目前下载次数排名
60261 PHP经典实例
28526 史蒂夫·乔布斯传
27804 拖延心理学
26647 明朝那些事儿(1-9)
22816 Steve Jobs
22395 百年孤独
21999 金庸全集三联版
21238 中国历代政治得失
20224 不二
19241 三体
@luw2007
luw2007 / docker-shadowsocks-go.md
Last active March 15, 2022 17:40
如何使用docker科学上网

##问: 我怎么用docker 部署ss server

##答:

  1. 购买vps: 这个途径比较多。 网上一搜一大把。
  2. vps上安装docker: 方法很多, 比如ubuntu上可以使用sudo apt-get install docker.io 我采用的vps服务提供商提供的docker镜像。
  3. 使用docker 安装ss-server:
@luw2007
luw2007 / bit.go
Last active September 20, 2021 08:25
业务中经常需要对redis执行一组连续的 gitbit ,即 gitbits 。以下通过 getrange 方法来优化 getbits 的速度。redis 的 bit 并非按照自然顺序排序,所以需要计算。
package redis
import (
r "github.com/garyburd/redigo/redis"
)
type Pool struct {
r.Pool
}
@luw2007
luw2007 / time.go
Last active November 28, 2019 08:37
AddMonths 增加月份,有许多神奇的case需要处理,例如 1月31日 - 2月28日, 3月31日 - 4月30日。 总的逻辑为,到达下一个月的同一天,若无效前推至有效
package main
import (
"fmt"
"testing"
"time"
)
// WHY:
//
@luw2007
luw2007 / trimspace.go
Created May 19, 2019 13:17
TrimSpace remove space, also in sentence. like: " a \t\r\n b " -> "a b"
package main
import (
"fmt"
"github.com/google/go-cmp/cmp"
)
func isSpace(b byte) bool {
switch b {
@luw2007
luw2007 / four.go 
Last active March 14, 2019 15:50
google 面试题:输出连续的1、2、3、4到4个文件
package main
import (
"bytes"
"fmt"
"strconv"
)
const STEP, NUM = 4, 40
@luw2007
luw2007 / logger.go
Created November 17, 2018 06:04
Go logging for human
package log
import (
"bytes"
"path"
"time"
"github.com/gin-gonic/gin"
"github.com/lestrrat/go-file-rotatelogs"
"github.com/pkg/errors"
@luw2007
luw2007 / ae.c
Last active August 21, 2018 08:58
redis 事件处理和网络协议
#ifndef __AE_H__
#define __AE_H__
#include <time.h>
#define AE_OK 0
#define AE_ERR -1
#define AE_NONE 0 /* No events registered. */
#define AE_READABLE 1 /* Fire when descriptor is readable. */
"""
redis proxy
用来展示redis协议
"""
import asyncio
redis_addr = ('127.0.0.1', 6379)
proxy_addr = ('127.0.0.1', 6380)