Skip to content

Commit 9981783

Browse files
committed
Fist commit
0 parents  commit 9981783

File tree

314 files changed

+341469
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

314 files changed

+341469
-0
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
do.sh
2+
# use two star ** to repr any internal dir
3+
.git/**
4+
.self/**
5+
.bigFile/**
6+
/*.zip
7+
!.gitignore
8+
~$*
9+
*.o
10+
*.toc
11+
*.synctex.*
12+
*.log
13+
*.aux
14+
*.pyc
15+
a.out
16+
__pycache__/**

README.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
2+
# 中国科学技术大学课程资源
3+
[![Stars](https://img.shields.io/github/stars/USTC-Resource/USTC-Course.svg?label=Stars&style=social)](https://github.com/USTC-Resource/USTC-Course/stargazers)
4+
[![Forks](https://img.shields.io/github/forks/USTC-Resource/USTC-Course.svg?label=Forks&style=social)](https://github.com/USTC-Resource/USTC-Course/network/members)
5+
[![repo-size](https://img.shields.io/github/repo-size/USTC-Resource/USTC-Course.svg)]()
6+
[![License](https://i.creativecommons.org/l/by-nc-sa/4.0/80x15.png)](http://creativecommons.org/licenses/by-nc-sa/4.0/)
7+
8+
>>本仓库收录中国科学技术大学众多课程资源的笔记,总结,经验等**学生原创内容**
9+
10+
# 目录索引
11+
* [版权说明](#版权说明)
12+
* [反馈方式](#反馈方式)
13+
* [资料下载](#资料下载)
14+
* [课程结构](#课程结构)
15+
* [课程关系](#课程关系)
16+
* [课程目录](#课程目录)
17+
* [贡献投稿](#贡献投稿)
18+
19+
# 版权说明
20+
本仓库分享资料遵守其创作者之规定, 由同学生自愿投稿。
21+
22+
对无特别声明的资料,谨以[知识共享署名 - 非商业性使用 - 相同方式共享 4.0 国际许可协议](http://creativecommons.org/licenses/by-nc-sa/4.0/) 授权。![](https://i.creativecommons.org/l/by-nc-sa/4.0/80x15.png)
23+
24+
# 反馈方式
25+
- [issue](https://github.com/USTC-Resource/USTC-Course/issues/new)
26+
- <a href="mailto:&#122;huheqin1@gmail.com?subject=%E5%8F%8D%E9%A6%88%E4%B8%8E%E5%BB%BA%E8%AE%AE">email</a>
27+
- [QQ](http://wpa.qq.com/msgrd?v=3&uin=414313516&site=qq&menu=yes)
28+
29+
# 资料下载
30+
<!--
31+
## FTP
32+
1. FTP/FTPS:
33+
- 地址:ftp.ustclug.org;
34+
- 路径:/ebook/USTC-CS-Courses-Resource;
35+
- 用户名:ftp;
36+
- 密码:ftp;
37+
2. SFTP (Secure File Transfer Protocol):
38+
- 地址:ftp.ustclug.org;
39+
- 路径:/ebook/USTC-CS-Courses-Resource;
40+
- 用户名:ftp;
41+
- 密码:ftp;
42+
3. AFP (Apple Filing Protocol)
43+
- 地址:afp://ftp.ustclug.org/;
44+
- 路径:/ebook/USTC-CS-Courses-Resource;
45+
- Connect As Guest
46+
47+
感谢 @USTC-LUG, @[zzh1996](https://github.com/zzh1996), @[volltin](https://github.com/volltin)
48+
49+
50+
## HTTPS
51+
-->
52+
53+
- [github 网页](#课程目录)
54+
- [脚本生成的网页](https://mbinary.xyz/ustc-cs/)
55+
- [DownGit](http://downgit.zhoudaxiaa.com/#/home)
56+
- [gitzip-chrome-extension](https://chrome.google.com/webstore/detail/gitzip-for-github/ffabmkklhbepgcgfonabamgnfafbdlkn)
57+
58+
注意,建议不要直接用 GitHub 仓库的 `Download Zip`。因为网速慢,而且仓库很大,很可能下载到中途就切断连接了。
59+
推荐用 DownGit 工具,方法很简单,在 GitHub 这里浏览网页到某个文件夹,然后将这个网页地址粘贴到 gitzip 下载即可。
60+
61+
# 课程结构
62+
每门课程大致结构如下,有些栏目可能没有,也可以自己添加认为合理的栏目
63+
```
64+
course
65+
├ codes
66+
│   ├ mbinary0
67+
│   ├ mbinary1
68+
│   └ mbinary2
69+
├ labs
70+
├ exams
71+
├ notes
72+
├ experience
73+
└ README.md
74+
```
75+
# 课程关系
76+
![](https://user-images.githubusercontent.com/29198767/53245024-851b1280-36e7-11e9-9d22-7ee65446c68a.png)
77+
78+
更多信息可以下载[官网的培养方案](https://www.teach.ustc.edu.cn/education/241.html/attachment/14-215%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%AD%A6%E9%99%A2-2013)
79+
80+
# 课程目录
81+
**根据拼音字母排序**, 可以通过在此页面搜索课程名快速定位。
82+
83+
* [.](.)
84+
* [编译原理和技术](./编译原理和技术)
85+
* [操作系统原理与设计](./操作系统原理与设计)
86+
* [c程序设计](./c程序设计)
87+
* [大学物理实验](./大学物理实验)
88+
* [计算机网络](./计算机网络)
89+
* [计算机系统详解(csapp)](./计算机系统详解(csapp))
90+
* [计算机与信息类](./计算机与信息类)
91+
* [计算机组成原理](./计算机组成原理)
92+
* [模拟与数字电路](./模拟与数字电路)
93+
* [数据结构](./数据结构)
94+
* [数理逻辑](./数理逻辑)
95+
* [算法基础](./算法基础)
96+
* [随机过程](./随机过程)
97+
* [utils](./utils)
98+
* [Web-信息处理与应用](./Web-信息处理与应用)
99+
* [微机原理与系统](./微机原理与系统)
100+
101+
# 贡献投稿
102+
欢迎大家的参与与贡献^_^ , 欢迎联系 org 管理员, 申请加入 USTC-Resource org。
103+
* github 上不能直接上传大于 100mb 的文件。对于超过 100 mb 的文件,可以存在网盘,然后在 README 文件中贴上链接
104+
* 文件内容的改动会使 git 重新上传, 在没有必要的情况下, 不要对二进制文件做任何更改.
105+
106+
<!--
107+
可以通过如下方式贡献
108+
- 帮忙上传: 可以发给仓库维护者帮忙上传,或者提 issue
109+
- 用网页操作或者[桌面版](https://desktop.github.com/) fork and pull request. 操作方式可以参考 [这里](https://blog.csdn.net/qq_29277155/article/details/51048990) 和[这里](https://blog.csdn.net/zhangw0_0/article/details/50667891),[PR](https://blog.csdn.net/huutu/article/details/51018317)
110+
111+
- 用命令行: 注意仓库较大,直接 clone 很慢. 可以使用 sparse-checkout, 只下载指定的目录
112+
执行
113+
```shell
114+
mkdir ustc-courses #文件夹名可以自己取
115+
cd ustc-courses
116+
git init
117+
git remote add -f origin git@github.com:mbinary/USTC-CS-Courses-Resource.git
118+
git config core.sparsecheckout true
119+
echo "计算机与信息类/软件工程" >> .git/info/sparse-checkout #这里工作目录就是在那个 repo 主页下
120+
121+
#如果还有其他目录,都像上面一样加入即可,如 `echo "计算机与信息类/图论/slides" >> .git/info/sparse-checkout`
122+
#只需记住的是 加入的目录应该在远程仓库存在,否则报错“error: Sparse checkout leaves no entry on the working directory”
123+
124+
git pull origin master
125+
git remote add upstream git@github.com:mbinary/USTC-CS-Courses-Resource.git
126+
```
127+
更新内容后
128+
```shell
129+
git fetch upstream/master
130+
git merge upstream/master
131+
```
132+
-->
133+
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package ICTCLAS_Analyzer;
2+
3+
import com.sun.jna.Library;
4+
import com.sun.jna.Native;
5+
6+
public interface CNLPIRLibrary extends Library {
7+
8+
CNLPIRLibrary Instance = (CNLPIRLibrary) Native.loadLibrary("NLPIR", CNLPIRLibrary.class);
9+
10+
public boolean NLPIR_Init(String sDataPath, int encoding, String sLicenceCode);
11+
12+
public String NLPIR_ParagraphProcess(String sParagraph, int bPOSTagged);
13+
14+
public int NLPIR_ImportUserDict(String dictFileName, boolean bOverwrite);
15+
16+
public String NLPIR_GetLastErrorMsg();
17+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package ICTCLAS_Analyzer;
2+
3+
public class NLPIRException extends Exception{
4+
5+
private static final long serialVersionUID = 6897134322647598254L;
6+
7+
public NLPIRException(String erromsg) {
8+
super(erromsg);
9+
}
10+
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
package ICTCLAS_Analyzer;
2+
3+
import java.io.IOException;
4+
5+
import org.apache.lucene.analysis.Tokenizer;
6+
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
7+
import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
8+
import org.apache.lucene.analysis.tokenattributes.TypeAttribute;
9+
import org.apache.lucene.util.AttributeFactory;
10+
11+
public class NLPIRTokenizer extends Tokenizer {
12+
13+
private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
14+
private final OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
15+
private final TypeAttribute typeAtt = addAttribute(TypeAttribute.class);
16+
17+
private String[] buffer = null;
18+
private StringBuffer cbuffer = null;
19+
int start = 0;
20+
int end = 0;
21+
int current = 0;
22+
23+
String data=null;
24+
int encoding=1;
25+
String sLicenceCode=null;
26+
String userDict=null;
27+
boolean bOverwrite=false;
28+
29+
public void defaultInit() {
30+
}
31+
32+
public NLPIRTokenizer(AttributeFactory factory) {
33+
super(factory);
34+
this.defaultInit();
35+
this.init(data, encoding, sLicenceCode, userDict, bOverwrite);
36+
}
37+
38+
public NLPIRTokenizer(String data, int encoding, String sLicenceCode, String userDict, boolean bOverwrite) {
39+
this.init(data, encoding, sLicenceCode, userDict, bOverwrite);
40+
}
41+
42+
public NLPIRTokenizer(AttributeFactory factory, String data, int encoding, String sLicenceCode, String userDict, boolean bOverwrite) {
43+
super(factory);
44+
this.init(data, encoding, sLicenceCode, userDict, bOverwrite);
45+
}
46+
47+
private void init(String data, int encoding, String sLicenceCode, String userDict, boolean bOverwrite) {
48+
boolean flag = CNLPIRLibrary.Instance.NLPIR_Init(data, encoding, sLicenceCode);
49+
if (!flag) {
50+
try {
51+
throw new NLPIRException(CNLPIRLibrary.Instance.NLPIR_GetLastErrorMsg());
52+
} catch (NLPIRException e) {
53+
e.printStackTrace();
54+
}
55+
} else if (userDict != null && !userDict.isEmpty()&&!userDict.equals("\"\"")) {
56+
int state = CNLPIRLibrary.Instance.NLPIR_ImportUserDict(userDict, bOverwrite);
57+
if (state == 0)
58+
try {
59+
throw new NLPIRException(CNLPIRLibrary.Instance.NLPIR_GetLastErrorMsg());
60+
} catch (NLPIRException e) {
61+
e.printStackTrace();
62+
}
63+
}
64+
}
65+
66+
@Override
67+
public boolean incrementToken() throws IOException {
68+
if (buffer != null && buffer.length < current + 1) {
69+
cbuffer = null;
70+
buffer = null;
71+
start = 0;
72+
end = 0;
73+
current = 0;
74+
return false;
75+
}
76+
if (cbuffer == null) {
77+
cbuffer = new StringBuffer();
78+
int c = 0;
79+
while ((c = input.read()) != -1) {
80+
cbuffer.append((char) c);
81+
}
82+
buffer = CNLPIRLibrary.Instance.NLPIR_ParagraphProcess(cbuffer.toString(), 0).split("\\s");
83+
}
84+
clearAttributes();
85+
int length = buffer[current].length();
86+
end = start + length;
87+
termAtt.copyBuffer(buffer[current].toCharArray(), 0, length);
88+
offsetAtt.setOffset(correctOffset(start), correctOffset(end));
89+
typeAtt.setType("word");
90+
start = end;
91+
current += 1;
92+
return true;
93+
}
94+
95+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package ICTCLAS_Analyzer;
2+
3+
import org.apache.lucene.analysis.Analyzer;
4+
import org.apache.lucene.analysis.Tokenizer;
5+
6+
public class NLPIRTokenizerAnalyzer extends Analyzer{
7+
8+
String data=null;
9+
int encoding=1;
10+
String sLicenceCode=null;
11+
String userDict=null;
12+
boolean bOverwrite=false;
13+
14+
public NLPIRTokenizerAnalyzer(String data,int encoding,String sLicenceCode,String userDict,boolean bOverwrite) {
15+
this.data=data;
16+
this.encoding=encoding;
17+
this.sLicenceCode=sLicenceCode;
18+
this.userDict=userDict;
19+
this.bOverwrite=bOverwrite;
20+
}
21+
22+
@Override
23+
protected TokenStreamComponents createComponents(String fieldName) {
24+
final Tokenizer tokenizer = new NLPIRTokenizer(this.data,this.encoding,this.sLicenceCode,this.userDict,this.bOverwrite);
25+
return new TokenStreamComponents(tokenizer);
26+
}
27+
28+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package ICTCLAS_Analyzer;
2+
3+
4+
import java.util.Map;
5+
6+
import org.apache.lucene.analysis.Tokenizer;
7+
import org.apache.lucene.analysis.util.TokenizerFactory;
8+
import org.apache.lucene.util.AttributeFactory;
9+
10+
public class NLPIRTokenizerFactory extends TokenizerFactory {
11+
12+
public NLPIRTokenizerFactory(Map<String, String> args) {
13+
super(args);
14+
if (!args.isEmpty()) {
15+
throw new IllegalArgumentException("Unknown parameters: " + args);
16+
}
17+
}
18+
19+
public Tokenizer create(AttributeFactory factory, String data, int encoding, String sLicenceCode, String userDict,
20+
boolean bOverwrite) {
21+
return new NLPIRTokenizer(factory, data, encoding, sLicenceCode, userDict, bOverwrite);
22+
}
23+
24+
@Override
25+
public Tokenizer create(AttributeFactory factory) {
26+
return new NLPIRTokenizer(factory);
27+
}
28+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Class-Path:
3+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
3+
<display-name>searchEngine</display-name>
4+
<welcome-file-list>
5+
<welcome-file>index.html</welcome-file>
6+
<welcome-file>index.htm</welcome-file>
7+
<welcome-file>index.jsp</welcome-file>
8+
<welcome-file>default.html</welcome-file>
9+
<welcome-file>default.htm</welcome-file>
10+
<welcome-file>default.jsp</welcome-file>
11+
</welcome-file-list>
12+
</web-app>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8"%>
3+
<html>
4+
<head>
5+
<title>泽文的搜索引擎</title>
6+
</head>
7+
<body>
8+
<br><br>
9+
<form method = "POST" action = "result.jsp">
10+
<p align = "center"><font size = "12" face="Microsoft YaHei" color = "#f4a460">泽文的搜索引擎</font></p><br><br>
11+
<p align = "center">
12+
<font size = "12">
13+
<input type = "text" name = "query" style = "width:400px;height:40px" id="kw"><input type = "submit" value = "搜索" style = "width:80px;height:40px" id="su">
14+
</font>
15+
</p>
16+
</form>
17+
18+
<style>
19+
body
20+
{
21+
background:url(./green.png);
22+
background-size:100% 100%;
23+
background-repeat:no-repeat;
24+
padding-top:80px;
25+
}
26+
</style>
27+
</body>
28+
</html>
29+

0 commit comments

Comments
 (0)