forked from USTC-Resource/USTC-Course
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9981783
Showing
314 changed files
with
341,469 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
do.sh | ||
# use two star ** to repr any internal dir | ||
.git/** | ||
.self/** | ||
.bigFile/** | ||
/*.zip | ||
!.gitignore | ||
~$* | ||
*.o | ||
*.toc | ||
*.synctex.* | ||
*.log | ||
*.aux | ||
*.pyc | ||
a.out | ||
__pycache__/** |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
|
||
# 中国科学技术大学课程资源 | ||
[](https://github.com/USTC-Resource/USTC-Course/stargazers) | ||
[](https://github.com/USTC-Resource/USTC-Course/network/members) | ||
[]() | ||
[](http://creativecommons.org/licenses/by-nc-sa/4.0/) | ||
|
||
>>本仓库收录中国科学技术大学众多课程资源的笔记,总结,经验等**学生原创内容** | ||
# 目录索引 | ||
* [版权说明](#版权说明) | ||
* [反馈方式](#反馈方式) | ||
* [资料下载](#资料下载) | ||
* [课程结构](#课程结构) | ||
* [课程关系](#课程关系) | ||
* [课程目录](#课程目录) | ||
* [贡献投稿](#贡献投稿) | ||
|
||
# 版权说明 | ||
本仓库分享资料遵守其创作者之规定, 由同学生自愿投稿。 | ||
|
||
对无特别声明的资料,谨以[知识共享署名 - 非商业性使用 - 相同方式共享 4.0 国际许可协议](http://creativecommons.org/licenses/by-nc-sa/4.0/) 授权。 | ||
|
||
# 反馈方式 | ||
- [issue](https://github.com/USTC-Resource/USTC-Course/issues/new) | ||
- <a href="mailto:z[email protected]?subject=%E5%8F%8D%E9%A6%88%E4%B8%8E%E5%BB%BA%E8%AE%AE">email</a> | ||
- [QQ](http://wpa.qq.com/msgrd?v=3&uin=414313516&site=qq&menu=yes) | ||
|
||
# 资料下载 | ||
<!-- | ||
## FTP | ||
1. FTP/FTPS: | ||
- 地址:ftp.ustclug.org; | ||
- 路径:/ebook/USTC-CS-Courses-Resource; | ||
- 用户名:ftp; | ||
- 密码:ftp; | ||
2. SFTP (Secure File Transfer Protocol): | ||
- 地址:ftp.ustclug.org; | ||
- 路径:/ebook/USTC-CS-Courses-Resource; | ||
- 用户名:ftp; | ||
- 密码:ftp; | ||
3. AFP (Apple Filing Protocol) | ||
- 地址:afp://ftp.ustclug.org/; | ||
- 路径:/ebook/USTC-CS-Courses-Resource; | ||
- Connect As Guest | ||
感谢 @USTC-LUG, @[zzh1996](https://github.com/zzh1996), @[volltin](https://github.com/volltin) | ||
## HTTPS | ||
--> | ||
|
||
- [github 网页](#课程目录) | ||
- [脚本生成的网页](https://mbinary.xyz/ustc-cs/) | ||
- [DownGit](http://downgit.zhoudaxiaa.com/#/home) | ||
- [gitzip-chrome-extension](https://chrome.google.com/webstore/detail/gitzip-for-github/ffabmkklhbepgcgfonabamgnfafbdlkn) | ||
|
||
注意,建议不要直接用 GitHub 仓库的 `Download Zip`。因为网速慢,而且仓库很大,很可能下载到中途就切断连接了。 | ||
推荐用 DownGit 工具,方法很简单,在 GitHub 这里浏览网页到某个文件夹,然后将这个网页地址粘贴到 gitzip 下载即可。 | ||
|
||
# 课程结构 | ||
每门课程大致结构如下,有些栏目可能没有,也可以自己添加认为合理的栏目 | ||
``` | ||
course | ||
├ codes | ||
│ ├ mbinary0 | ||
│ ├ mbinary1 | ||
│ └ mbinary2 | ||
├ labs | ||
├ exams | ||
├ notes | ||
├ experience | ||
└ README.md | ||
``` | ||
# 课程关系 | ||
 | ||
|
||
更多信息可以下载[官网的培养方案](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) | ||
|
||
# 课程目录 | ||
**根据拼音字母排序**, 可以通过在此页面搜索课程名快速定位。 | ||
|
||
* [.](.) | ||
* [编译原理和技术](./编译原理和技术) | ||
* [操作系统原理与设计](./操作系统原理与设计) | ||
* [c程序设计](./c程序设计) | ||
* [大学物理实验](./大学物理实验) | ||
* [计算机网络](./计算机网络) | ||
* [计算机系统详解(csapp)](./计算机系统详解(csapp)) | ||
* [计算机与信息类](./计算机与信息类) | ||
* [计算机组成原理](./计算机组成原理) | ||
* [模拟与数字电路](./模拟与数字电路) | ||
* [数据结构](./数据结构) | ||
* [数理逻辑](./数理逻辑) | ||
* [算法基础](./算法基础) | ||
* [随机过程](./随机过程) | ||
* [utils](./utils) | ||
* [Web-信息处理与应用](./Web-信息处理与应用) | ||
* [微机原理与系统](./微机原理与系统) | ||
|
||
# 贡献投稿 | ||
欢迎大家的参与与贡献^_^ , 欢迎联系 org 管理员, 申请加入 USTC-Resource org。 | ||
* github 上不能直接上传大于 100mb 的文件。对于超过 100 mb 的文件,可以存在网盘,然后在 README 文件中贴上链接 | ||
* 文件内容的改动会使 git 重新上传, 在没有必要的情况下, 不要对二进制文件做任何更改. | ||
|
||
<!-- | ||
可以通过如下方式贡献 | ||
- 帮忙上传: 可以发给仓库维护者帮忙上传,或者提 issue | ||
- 用网页操作或者[桌面版](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) | ||
- 用命令行: 注意仓库较大,直接 clone 很慢. 可以使用 sparse-checkout, 只下载指定的目录 | ||
执行 | ||
```shell | ||
mkdir ustc-courses #文件夹名可以自己取 | ||
cd ustc-courses | ||
git init | ||
git remote add -f origin [email protected]:mbinary/USTC-CS-Courses-Resource.git | ||
git config core.sparsecheckout true | ||
echo "计算机与信息类/软件工程" >> .git/info/sparse-checkout #这里工作目录就是在那个 repo 主页下 | ||
#如果还有其他目录,都像上面一样加入即可,如 `echo "计算机与信息类/图论/slides" >> .git/info/sparse-checkout` | ||
#只需记住的是 加入的目录应该在远程仓库存在,否则报错“error: Sparse checkout leaves no entry on the working directory” | ||
git pull origin master | ||
git remote add upstream [email protected]:mbinary/USTC-CS-Courses-Resource.git | ||
``` | ||
更新内容后 | ||
```shell | ||
git fetch upstream/master | ||
git merge upstream/master | ||
``` | ||
--> | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
17 changes: 17 additions & 0 deletions
17
Web-信息处理与应用/labs/lab1-搜索引擎/src/ICTCLAS_Analyzer/CNLPIRLibrary.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package ICTCLAS_Analyzer; | ||
|
||
import com.sun.jna.Library; | ||
import com.sun.jna.Native; | ||
|
||
public interface CNLPIRLibrary extends Library { | ||
|
||
CNLPIRLibrary Instance = (CNLPIRLibrary) Native.loadLibrary("NLPIR", CNLPIRLibrary.class); | ||
|
||
public boolean NLPIR_Init(String sDataPath, int encoding, String sLicenceCode); | ||
|
||
public String NLPIR_ParagraphProcess(String sParagraph, int bPOSTagged); | ||
|
||
public int NLPIR_ImportUserDict(String dictFileName, boolean bOverwrite); | ||
|
||
public String NLPIR_GetLastErrorMsg(); | ||
} |
10 changes: 10 additions & 0 deletions
10
Web-信息处理与应用/labs/lab1-搜索引擎/src/ICTCLAS_Analyzer/NLPIRException.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package ICTCLAS_Analyzer; | ||
|
||
public class NLPIRException extends Exception{ | ||
|
||
private static final long serialVersionUID = 6897134322647598254L; | ||
|
||
public NLPIRException(String erromsg) { | ||
super(erromsg); | ||
} | ||
} |
95 changes: 95 additions & 0 deletions
95
Web-信息处理与应用/labs/lab1-搜索引擎/src/ICTCLAS_Analyzer/NLPIRTokenizer.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
package ICTCLAS_Analyzer; | ||
|
||
import java.io.IOException; | ||
|
||
import org.apache.lucene.analysis.Tokenizer; | ||
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute; | ||
import org.apache.lucene.analysis.tokenattributes.OffsetAttribute; | ||
import org.apache.lucene.analysis.tokenattributes.TypeAttribute; | ||
import org.apache.lucene.util.AttributeFactory; | ||
|
||
public class NLPIRTokenizer extends Tokenizer { | ||
|
||
private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class); | ||
private final OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class); | ||
private final TypeAttribute typeAtt = addAttribute(TypeAttribute.class); | ||
|
||
private String[] buffer = null; | ||
private StringBuffer cbuffer = null; | ||
int start = 0; | ||
int end = 0; | ||
int current = 0; | ||
|
||
String data=null; | ||
int encoding=1; | ||
String sLicenceCode=null; | ||
String userDict=null; | ||
boolean bOverwrite=false; | ||
|
||
public void defaultInit() { | ||
} | ||
|
||
public NLPIRTokenizer(AttributeFactory factory) { | ||
super(factory); | ||
this.defaultInit(); | ||
this.init(data, encoding, sLicenceCode, userDict, bOverwrite); | ||
} | ||
|
||
public NLPIRTokenizer(String data, int encoding, String sLicenceCode, String userDict, boolean bOverwrite) { | ||
this.init(data, encoding, sLicenceCode, userDict, bOverwrite); | ||
} | ||
|
||
public NLPIRTokenizer(AttributeFactory factory, String data, int encoding, String sLicenceCode, String userDict, boolean bOverwrite) { | ||
super(factory); | ||
this.init(data, encoding, sLicenceCode, userDict, bOverwrite); | ||
} | ||
|
||
private void init(String data, int encoding, String sLicenceCode, String userDict, boolean bOverwrite) { | ||
boolean flag = CNLPIRLibrary.Instance.NLPIR_Init(data, encoding, sLicenceCode); | ||
if (!flag) { | ||
try { | ||
throw new NLPIRException(CNLPIRLibrary.Instance.NLPIR_GetLastErrorMsg()); | ||
} catch (NLPIRException e) { | ||
e.printStackTrace(); | ||
} | ||
} else if (userDict != null && !userDict.isEmpty()&&!userDict.equals("\"\"")) { | ||
int state = CNLPIRLibrary.Instance.NLPIR_ImportUserDict(userDict, bOverwrite); | ||
if (state == 0) | ||
try { | ||
throw new NLPIRException(CNLPIRLibrary.Instance.NLPIR_GetLastErrorMsg()); | ||
} catch (NLPIRException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public boolean incrementToken() throws IOException { | ||
if (buffer != null && buffer.length < current + 1) { | ||
cbuffer = null; | ||
buffer = null; | ||
start = 0; | ||
end = 0; | ||
current = 0; | ||
return false; | ||
} | ||
if (cbuffer == null) { | ||
cbuffer = new StringBuffer(); | ||
int c = 0; | ||
while ((c = input.read()) != -1) { | ||
cbuffer.append((char) c); | ||
} | ||
buffer = CNLPIRLibrary.Instance.NLPIR_ParagraphProcess(cbuffer.toString(), 0).split("\\s"); | ||
} | ||
clearAttributes(); | ||
int length = buffer[current].length(); | ||
end = start + length; | ||
termAtt.copyBuffer(buffer[current].toCharArray(), 0, length); | ||
offsetAtt.setOffset(correctOffset(start), correctOffset(end)); | ||
typeAtt.setType("word"); | ||
start = end; | ||
current += 1; | ||
return true; | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
Web-信息处理与应用/labs/lab1-搜索引擎/src/ICTCLAS_Analyzer/NLPIRTokenizerAnalyzer.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package ICTCLAS_Analyzer; | ||
|
||
import org.apache.lucene.analysis.Analyzer; | ||
import org.apache.lucene.analysis.Tokenizer; | ||
|
||
public class NLPIRTokenizerAnalyzer extends Analyzer{ | ||
|
||
String data=null; | ||
int encoding=1; | ||
String sLicenceCode=null; | ||
String userDict=null; | ||
boolean bOverwrite=false; | ||
|
||
public NLPIRTokenizerAnalyzer(String data,int encoding,String sLicenceCode,String userDict,boolean bOverwrite) { | ||
this.data=data; | ||
this.encoding=encoding; | ||
this.sLicenceCode=sLicenceCode; | ||
this.userDict=userDict; | ||
this.bOverwrite=bOverwrite; | ||
} | ||
|
||
@Override | ||
protected TokenStreamComponents createComponents(String fieldName) { | ||
final Tokenizer tokenizer = new NLPIRTokenizer(this.data,this.encoding,this.sLicenceCode,this.userDict,this.bOverwrite); | ||
return new TokenStreamComponents(tokenizer); | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
Web-信息处理与应用/labs/lab1-搜索引擎/src/ICTCLAS_Analyzer/NLPIRTokenizerFactory.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package ICTCLAS_Analyzer; | ||
|
||
|
||
import java.util.Map; | ||
|
||
import org.apache.lucene.analysis.Tokenizer; | ||
import org.apache.lucene.analysis.util.TokenizerFactory; | ||
import org.apache.lucene.util.AttributeFactory; | ||
|
||
public class NLPIRTokenizerFactory extends TokenizerFactory { | ||
|
||
public NLPIRTokenizerFactory(Map<String, String> args) { | ||
super(args); | ||
if (!args.isEmpty()) { | ||
throw new IllegalArgumentException("Unknown parameters: " + args); | ||
} | ||
} | ||
|
||
public Tokenizer create(AttributeFactory factory, String data, int encoding, String sLicenceCode, String userDict, | ||
boolean bOverwrite) { | ||
return new NLPIRTokenizer(factory, data, encoding, sLicenceCode, userDict, bOverwrite); | ||
} | ||
|
||
@Override | ||
public Tokenizer create(AttributeFactory factory) { | ||
return new NLPIRTokenizer(factory); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Web-信息处理与应用/labs/lab1-搜索引擎/src/WebContent/META-INF/MANIFEST.MF
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Class-Path: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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"> | ||
<display-name>searchEngine</display-name> | ||
<welcome-file-list> | ||
<welcome-file>index.html</welcome-file> | ||
<welcome-file>index.htm</welcome-file> | ||
<welcome-file>index.jsp</welcome-file> | ||
<welcome-file>default.html</welcome-file> | ||
<welcome-file>default.htm</welcome-file> | ||
<welcome-file>default.jsp</welcome-file> | ||
</welcome-file-list> | ||
</web-app> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8"%> | ||
<html> | ||
<head> | ||
<title>泽文的搜索引擎</title> | ||
</head> | ||
<body> | ||
<br><br> | ||
<form method = "POST" action = "result.jsp"> | ||
<p align = "center"><font size = "12" face="Microsoft YaHei" color = "#f4a460">泽文的搜索引擎</font></p><br><br> | ||
<p align = "center"> | ||
<font size = "12"> | ||
<input type = "text" name = "query" style = "width:400px;height:40px" id="kw"><input type = "submit" value = "搜索" style = "width:80px;height:40px" id="su"> | ||
</font> | ||
</p> | ||
</form> | ||
|
||
<style> | ||
body | ||
{ | ||
background:url(./green.png); | ||
background-size:100% 100%; | ||
background-repeat:no-repeat; | ||
padding-top:80px; | ||
} | ||
</style> | ||
</body> | ||
</html> | ||
|
Oops, something went wrong.