博文
【开发周报】Spider(一)(2006-09-27 14:05:00)
摘要:文字
做出了"网络蜘蛛"的初步模型,追溯超链功能.
采用BFS算法,仍是单线程,即便如此CPU占用率仍为 90%左右,不知 "肉鸡" 可否承受!
在"URL正确性","相对链接转换","父路径"等判断性上尚需改进,以及"资源容错率",关键字处理,蜘蛛性能都将成为考虑范围.
......
D版MP3搜索引擎及其代码(2006-09-22 22:37:00)
摘要:
using System;using System.Text.RegularExpressions;using System.Net;using System.IO;using System.Text;//using System.ArgumentOutOfRangeException;
using System.Data;using System.Data.SqlClient;
public static class RegexTest{ public static string req; public static string infor; public static string keys; public static string reg2; public static string reg3; public static string reg4; public static string reg1; public static string reg5; public static string nums; public static string mainurl; public static string mainstyle; public static string mainsinger; public static string mainsong; public static string mainspecial; public static string mai......
基于C#.NET的网络蜘蛛设计计划(2006-09-22 17:08:00)
摘要:C#.NET网络蜘蛛设计模式
【KEYS】C#.NET, 线程, 网络蜘蛛, Vector ,数组 ,XML, 排序算法,Meta Search.
【详细计划】
列表:
1. 搜集蜘蛛引擎开发信息。
2. 建立UrlTreeNode(URL索引树),HashTable(哈希表)保存相关键值,XML数据交换BUFF。
3. 算法选择: 单线程选用DFS(深度优先),多线程选用BFS(广度优先),视情况而定。
4. 相关数据处理:
(1) 读取URL:读取当前URL,分析链接(1/0),进入UnVisited.xml/Visited.xml。
(2) 处理URL:读取UnVisited.xml,返回(1)。
(3) 直到UnVisited.xml为空,否则(2)。
(4) 索引树的建立:与(2)同时进行(仅针对BFS算法)。
5. 算法实现:
BFS:
Begin Visit index:
ClientPage:=index
Push ClientPage into the end of UnVisited table
While UnVisited 非空 then
ClientPage:=UnVisited.top
Visit ClientPage
UnVisited.pop
&......
[asp.net]ADO.NET笔记(续)(续)(2006-09-15 18:09:00)
摘要:1. DataSet对象
封装在”System.Data”中.
DataSet中可以包含任意数量的DataTable(数据表),且每个数据表对应一个数据库中的数据表和视图.
通过DataAdapter的Fill方法,将表内容填充倒DataSet对象中,而且可以填充多个表.利用别名来区分.比如da.Fill(ds,”table1”);的功能是将da对象中的数据填充到ds对象对,并起别名”table1”.
实例一. 生成DataSet详细过程.
<%@ Page Language="C#" %>
<%@ Import namespace="System.Data" %>
<script language="C#" runat="server">
void Page_Load(Object sender, EventArgs e){
DataSet myds = new DataSet();
DataTable mydt = new DataTable("Squares");
DataRow mydr;
mydt.Columns.Add(new DataColumn("数字",typeof(Int32)));
mydt.Columns.Add(new DataColumn("平方",typeof(Int32)));
for (int i = 0; i < 10; i++) {
mydr = mydt.NewRow();
mydr[0] = i;
mydr[1] = i * i;
mydt.Rows.Add(mydr);
}
myds.Tables.Add(mydt);
dg.DataSource = myds.Tables["Squares"].DefaultVie......
[asp.net]ADO.NET笔记(续)(2006-09-15 18:08:00)
摘要:实例一:ExecuteNonQuery用法--执行Command.
SqlCommand Comm.=new SqlCommand(“select * from mp3 where id>260000”,conn);
Comm. ExecuteNonQuery().
实例二. 使用ExecuteReader方法.
<% @ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server">
void Page_Load(Object sender, EventArgs e) {
OleDbConnection Conn=new OleDbConnection();
Conn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;"+
"Data Source="+Server.MapPath("person.mdb");
Conn.Open();
OleDbCommand Comm=new OleDbCommand("select * from grade",Conn);
OleDbDataReader dr=Comm.ExecuteReader();
dg.DataSource=dr;
dg.DataBind();
Conn.Close();
}
</script>
<asp:DataGrid id="dg" runa......
[asp.net]ADO.NET笔记(2006-09-15 18:06:00)
摘要:ADO.NET
一. 关键字:
对象:Connection, Command, DataReader, DataAdapter
数据库: SQL, 聚合函数, 分组查询, 交叉查询.
数据控件: Repeater, DataList, DataGrid
二. ADO.NET的结构.
.
核心对象
1. Connection : 建立与特定数据源的连接.
2. Command : 对数据源执行命令.
3. Datareader: 从数据源中读取只进且只读的数据流.
4. DataAdaper :用于将数据填充倒DataSet.
注:SQL Server .NET 数据提供程序.
SqlConnection, SqlCommand, SqlDataReader, SqlDataAdapter.
以上四个对象都包含在System.Data.SqlClient命名控件中,
同理,OLE DB .NET的四个核心对象包含在 System.Data.OleDb命名控件中.
ODBC .NET略.
核心组件.
DataSet: 内部用XML描述数据, 具有与平台无关性.
常用对象: 1. DataTable和DataRow等.
DataAdapter被命名为:”数据适配器”.
SQL语句分类.(略)
SQL语句. (略)
聚合函数. (略)
交叉查询
以下实例很容易看懂
Select b.name from table1 a, table2 b, table3 c where a.course=c.course and a......
[asp.net]框架类笔记(2006-09-06 15:34:00)
摘要:.NET框架类
[关键字]System.IO, System.Drawing , System.Web.Security., System.Web.Mail, System.Net
一.System.IO命名空间
该空间提供很多对文件,以及数据操作的类.
类
说明
Directory
提供的方法为静态方法,用于创建、移动和读取目录。
DirectoryInfo
提供的方法必须创建该类的实例,才能使用。用于创建、移动和读取目录。
File
提供创建、复制、删除、移动和打开文件的静态方法。
FileInfo
提供创建、复制、删除、移动和打开文件的实例方法。
FileStream
以文件为主的 Stream,既支持同步读写操作,也支持异步读写操作。
StreamReader
实现一个TextReader,以一种特定的编码从字节流中读取字符。
StreamWriter
实现一个 TextWriter,以一种特定的编码向流中写入字符。
TextReader
可读取连续字符的对象。
TextWriter
可写入连续字符的对象。该类为抽象类。
实例1.创建一个有文本信息的文件.
<% @ Page Language="C#" %>
<% @ Import Namespace="System.IO" %>
<Script Runat="Server">
public void Page_Load(Object src,EventArgs e){
//建立StreamWrite
StreamWriter rw = File.CreateText(Server.MapPath(".")+"\\myText.txt");
rw.WriteLine("热爱祖国"); &nbs......
[asp.net]对象及配置笔记(2006-09-04 10:32:00)
摘要:ASP.NET内置对象和页面配置
[关键字]response, request ,session ,cookies, Application, Trace, global.asa, web.config
对象名
说明
ASP.NET 类
Response
提供向浏览器写入信息或者发送指令等功能
HttpResponse
Request
提供从浏览器读取信息或者取客户端信息等功能。
HttpRequest
Application
为所有用户提供共享信息
HttpApplicationState
Server
提供服务器端一些的属性和方法
HttpServerUtility
Session
为某个用户提供共享信息
HttpSessionState
Context
页面上下文对象,使用此类共享页之间的信息
HttpContext
Trace
提供在 HTTP 页输出自定义跟踪诊断消息
TraceContext
1. response对象.
主要任务是向浏览器输出内容
Response.Write():输出数据
Response.End():输出停止
Response.redirect():转向
Response.WriteFile();输出文件.
注:Response对象的函数的用法和 ASP几乎相同.在此不赘述.
注:输出文件Server.MapPath(".")或Server.MapPath("/")获取文件目录.
2. Request对象.
主要功能是从客户端获取数据.
Request.form (POST方法), Request.querystring(GET方法), Request(前两种的缩写)
Request.ContentEncoding.EncodingName 获取编码方式
注:解决中文问题:
“<global......
Born To Do It(2006-09-02 15:25:00)
摘要:Born To Do ItBy Craig David
以前听说过,但没什么好感,源于他的长相:俨然一副HIP HOP的街头”坯子”的”熊样”!月前,在那个陌生的靠近HONGKONG的城市,紧张,不适应,没有亲戚和朋友,只是单调的捞钱, ,MUSIC.和在KFC看书,淘碟…感触更多的是孤单,或许这就是社会和校园的区别吧.刚开始喜欢DAVID的歌的理由很简单:时间过的很快.渐渐的有一种莫名其妙的”清爽”和”愉悦”的感觉.也许暗合了当时的生活节奏:充实而不匆忙!这正是我所期待的.真想跑过去”FU CK”一下.保持一颗平静的心态.微笑面对眼前.仅仅留作回忆.One two buckle my shoethree four step inside the venue and isee in the corner of my eyethis beautiful girlthat's standing by the bar looking flyshe was like a beauty queen out of a magazinelooked about 19<Born To Do It>专辑曲目:1.fill me in2.can't be messing'round3.rendezvous4.7 days(推荐)5.walking away6.time to party7.booty man(推荐)8.once in a lifetime9.you know what10.fill me in (artful dodger remix)11.fill me in (sunship remix)......
