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
In file included from /Users/mac/lab/guo/hh-suite/src/hhblits.h:37, | |
from /Users/mac/lab/guo/hh-suite/src/hhblits.cpp:8: | |
/usr/local/include/cs.h:637:12: error: 'namespace cs_di { }' redeclared as different kind of entity | |
637 | #define cs cs_di | |
| ^~~~~ | |
/Users/mac/lab/guo/hh-suite/src/cs/profile.h:24:11: note: in expansion of macro 'cs' | |
24 | namespace cs { | |
| ^~ | |
/usr/local/include/cs.h:72:3: note: previous declaration 'typedef struct cs_di_sparse cs_di' | |
72 | } cs_di ; |
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
#Unix | |
wget https://install.direct/go.sh | |
#Mac | |
brew tap v2ray/v2ray | |
brew install v2ray-core | |
#/usr/bin/v2ray/v2ray:V2Ray 程序; | |
#/usr/bin/v2ray/v2ctl:V2Ray 工具; | |
#/etc/v2ray/config.json:配置文件; |
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
//create a dataframe | |
val df = sc.parallelize(Seq( | |
(1441637160, 10.0,"hello"), | |
(1441637170, 20.0,"world"), | |
(1441637180, 30.0,"test"), | |
(1441637210, 40.0,"word"), | |
(1441637220, 10.0,"test2"), | |
(1441637230, 0.0,"test3"))).toDF("timestamp", "value","words") | |
// make multiple rows to one row |
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 | |
(1 to 1000).filter(x => x%3==0 || x%5==0).sum | |
//2 | |
def fib: Stream[Long] = { | |
def tail(h: Long, n: Long): Stream[Long] = h #:: tail(n, h + n) | |
tail(0, 1) | |
} | |
//3 Largest prime factor |
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
if __name__=="__main__": | |
from gensim import corpora, models, similarities | |
import codecs | |
from collections import defaultdict | |
# 原始语料 | |
documents = [] | |
f1 = codecs.open("../input", "r") | |
for (num, value) in enumerate(f1): | |
content=value.strip().split("__SOB__") |
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 org.apache.lucene.analysis.TokenStream; | |
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; | |
import org.wltea.analyzer.lucene.IKAnalyzer; | |
import java.io.*; | |
public class IkAnalyserUsageTest { | |
public static void main (String[] args) { | |
BufferedReader br =null; | |
BufferedWriter bw = null; |
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
# TestPlugin: | |
import os | |
def getPlugin(): | |
path = os.path.split(os.path.realpath(__file__))[0] | |
plugins = os.listdir(path + '/plugin/') | |
fil = lambda str: (True, False)[str[-3:] == 'pyc' or str.find('__init__.py') != -1] | |
return filter(fil, plugins) | |
if __name__ == "__main__": |
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
# -*- coding: utf-8 -*- | |
import struct | |
import sys | |
import binascii | |
import pdb | |
#搜狗的scel词库就是保存的文本的unicode编码,每两个字节一个字符(中文汉字或者英文字母) | |
#找出其每部分的偏移位置即可 | |
#主要两部分 |
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
class CombinationTest{ | |
public static void main(String[] args) { | |
listCombination(new char[]{'a','b','c'}); | |
} | |
public static void listCombination(char chs[]){ | |
if(chs.length == 0) return ; | |
Stack<Character> stack = new Stack<Character>(); | |
for(int i = 1; i <= chs.length; i++){ | |
combine(chs, 0, i, stack); |