会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
qnilevel
博客园
首页
新随笔
联系
管理
订阅
2014年8月28日
搜索引擎项目
摘要: 对从网络上抓取到的网页进行处理:建立网络库,分词,去重,if-tdf计算权重,归一化,然后根据查询词将文本相似度从高到低的依次返回给客户第一阶段:python网络爬虫抓取网页,并存盘第二阶段:对磁盘上的网页文件建立网页库,将全部网页写入网页库,并建立相应网页的偏移量索引文件(1 23 100)-->...
阅读全文
posted @ 2014-08-28 14:32 rail
阅读(436)
评论(0)
推荐(0)
2014年8月18日
编辑距离-英文,中文-utf8
摘要: 编辑距离: 一个单词变换成另一个单词所需的步数,基本步骤:增加一个字符,减少一个字符,修改一个字符。应用:搜索的时候使用ipone-->iphone,编辑距离为1,在类似文本纠错的项目中,找出编辑距离最小的值(可以用priority_queue),实现模糊匹配!1.英文int Edit_Disten...
阅读全文
posted @ 2014-08-18 15:10 rail
阅读(746)
评论(0)
推荐(0)
2014年8月14日
c++ LRUCache
摘要: #include #include #include #include using namespace std;templatestruct LRUCacheEntry{ K key; T data; LRUCacheEntry* prev; LRUCacheEntry* n...
阅读全文
posted @ 2014-08-14 17:14 rail
阅读(542)
评论(0)
推荐(0)
2014年8月13日
字典树
摘要: [syswj@host 0813]$ cat dic_tree.cpp #include #include #define MAX 26using namespace std;typedef struct TrieNode{ int ncount; struct TrieNode *ne...
阅读全文
posted @ 2014-08-13 15:27 rail
阅读(142)
评论(0)
推荐(0)
2014年7月31日
几种并发服务器模型的实现:多线程,多进程,select,poll,epoll
摘要: 客户端使用select模型: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 1...
阅读全文
posted @ 2014-07-31 00:18 rail
阅读(4243)
评论(0)
推荐(1)
2014年7月29日
I/O复用的 select poll和epoll的简单实现
摘要: 一个tcp的客户端服务器程序服务器端不变,客户端通过I/O复用轮询键盘输入与socket输入(接收客户端的信息)服务器端: 1 /*服务器: 2 1.客户端关闭后,服务器再向客户端发送信息,第一次会收到一个RST复位报文,第二次会收到SIGPIPE信号,导致服务器关闭,必须对这个信号进行处理: 3 ...
阅读全文
posted @ 2014-07-29 23:50 rail
阅读(253)
评论(0)
推荐(0)
readn,writen,readline
摘要: unix的RIO提供的readn,writen,readline两类不同的函数:1.无缓冲区的输入输出函数rio_readn 1 ssize_t rio_readn(int fp, void *usrbuf, size_t n) 2 { 3 size_t nleft = n; 4 ...
阅读全文
posted @ 2014-07-29 21:07 rail
阅读(477)
评论(0)
推荐(0)
公告