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
function [L C] = gmeans(datafile, clusters) | |
if ~ischar(datafile), | |
save('~gmeans.prep', 'datafile', '-ascii'); | |
datafile='~gmeans.prep'; | |
end; | |
tool_bin = '..\..\tools\bin\'; | |
system([tool_bin 'LDAInputConverter.exe lsa2gmeans "' datafile '" "~gmeans.txt" > nul']); | |
system([tool_bin 'gmeans.exe -F t -c ' num2str(clusters) ' "~gmeans.txt" > nul']); | |
data=importdata(['~gmeans.txt_doctoclus.' num2str(clusters)]); | |
n=data(1); |
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
// 这是一个 CsSC 脚本文件,要使用标准 C#,请去掉 #function 和 #endfunction 这两个指令,并将其余代码放在 Main 函数中,接受 string[] args 为其参数。 | |
// 要直接运行,请移步 https://github.com/zhuth/Tools/ ,下载后解压 bin\CsSC.exe 和相关文件。 | |
#reference System.Core.dll | |
#function | |
public class WordDetector { | |
public Action ProcessOver = 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
// written in CsSC | |
#reference System.Core.dll; | |
#using System.Linq; | |
var names = Directory.GetFiles("D:\\temp\\fq\\", "*.fq"); | |
var words = new Dictionary<string, double>(); | |
var ps = new Dictionary<string, double>(); | |
var total_words = new Dictionary<string, int>(); |
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
// This is a CsSC script. | |
int STEPS = 33; | |
string[] lines = File.ReadAllLines("gj.csv", Encoding.GetEncoding("GBK")); | |
Dictionary<string, List<string>> dc = new Dictionary<string, List<string>>(); | |
Dictionary<string, List<string>> dx = new Dictionary<string, List<string>>(); | |
foreach(string line in lines) { | |
string[] cols = line.Split('\t', ','); | |
string name = cols[0]; |
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
// ==UserScript== | |
// @name douban book estimator | |
// @description douban book reading | |
// @namespace http://tianhua.me/ | |
// @auth break | |
// @version 0.122 | |
// @license Public Domain | |
// @include http://www.douban.com/* | |
// @include http://book.douban.com/* | |
// ==/UserScript== |
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
东坡 19 | |
元亨 683 | |
利贞 1391 | |
初九 1585 | |
潜龙 253 | |
潜龙勿用 142 | |
勿用 703 | |
非天下之至 74 | |
天下 8634 | |
其孰能 96 |
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-手工 0-均有 | |
计划生育 1 | |
深夜 1 | |
家家 1 | |
区分 1 | |
一线 1 | |
东北部 1 | |
物价局 1 | |
后来 1 | |
青岛市 1 |
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
var pdflatex = @"D:\Programs\CTEX\MiKTeX\miktex\bin\pdflatex.exe"; | |
var bibtex = @"D:\Programs\CTEX\MiKTeX\miktex\bin\bibtex.exe"; | |
string[] argpdf = new string[args.Length - 1]; | |
for (int i = 0; i < args.Length - 1; ++i) argpdf[i] = args[i]; | |
start(pdflatex, argpdf); | |
start(bibtex, new string[]{args[args.Length - 1]}); | |
start(pdflatex, argpdf); | |
start(pdflatex, argpdf); |
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
// ==UserScript== | |
// @name douban book bibtex generator | |
// @description douban book bibtex generator | |
// @namespace http://tianhua.me/ | |
// @auth zhuth | |
// @version 0.1 | |
// @license Public Domain | |
// @include http://book.douban.com/subject/* | |
// ==/UserScript== |
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, 参数2) := [@临时变元] 其他谓词 | |
# 注意:谓词 R(x, y) 读作“x是y的R”。 | |
# 临时变元列表以,分割,中间不能有空格。 | |
#原子谓词定义 | |
elder(x, y) := atom | |
child(x, y) := atom | |
marry(x, y) := atom |
OlderNewer