触碰心灵34句

 ? 1. 敌人或知已,越少越安全。
 ? 2. 沉默,退缩,拒绝—吸引男人的三种最佳途径。
 ? 3. 自由意味着可以选择—或者活得有意义,或者死得有尊严。
 ? 4. 人生哪有死结,想通了,不过就是—饥来餐饭倦来眠。
 ? 5. 一个民族的历史越简单,则她的人民就越幸福,这道理,类似于—国家之不幸,诗家之大幸。
 ? 6. 书中自有颜如玉,是否也可以这样理解—一个女人若想花容永驻,与其化妆整容,不如多读好书。
 ? 7. 人生的舞台没有假装这一说—每个人迟早都会真的变成他日常扮演的那个角色。
 ? 8. 面具戴太久,就会长到脸上,再想揭下来,除非伤筋动骨扒皮。
 ? 9. 工作时不为钱分心,钱反而会来得更快。
 ?10. 肯以本色示人者,必有禅心和定力,所以,伪名儒不如真名妓。
 ?11. 婚姻中最折磨人的,并非冲突,而是厌倦。
 ?12. 知识不是力量,智慧才是。
 ?13. 聪明人应当是快乐的—自以为聪明的人才常常感到烦恼。
 ?14. 真君子是:以入世之态度做事,以出世之态度做人。
 ?15. 女人总想改变她喜欢的男人,等他真的改变了,她又不喜欢他了。
 ?16. 漂亮女人走到哪里都沾光—沾的是小光,吃亏可是吃大亏。
 ?17. 单相思就像谋杀案—一不小心,就露马脚。
 ?18. 安全须知:第一,提防好脾气的人发火。第二,别和没什么东西可失去的人竞争。
 ?19. 社交之所以累,是因为每个人都试图表现出自己其实并不具备的品质。
 ?20. 安慰是有用的—可以让痛楚更清晰而且加倍。
 ?21. 世界上唯一会随着时光的流逝而越变越美好的东西就是回忆。
 ?22. 动物只相信它看到的东西,人却能看到他相信的东西—幸福和烦恼皆由此而来。
 ?23. 世界上根本没有专属这回事—那只是你为你想得到的东西付出的代价。
 ?24. 真正的痛苦,没有人能与你分担—你只能把它从一个肩,换到你的另一个肩。
 ?25. 令人精疲力尽的并不是要做的事本身—而是事前事后患得患失的心态。
 ?26. 令人沮丧的往往并非事实,而是比较。
 ?27. 知识和财富的不同点之一就是—前者无论在哪里得到,都没有什么可耻的。
 ?28. 点燃艺术火花的,与其说是灵感,不如说是邪念。
 ?29. 要是经常往上看,你会长高,如果老是低着头捡便宜,你就会驼背。
 ?30. 许多人不断犯错误的原因就是—觉得事后表示歉意,比事前抵御诱惑,容易些。
 ?31. 心想事成就是—你有什么样的恐惧,就会撞见什么样的鬼。
 ?32. 人生没有如果—但有许多但是。
 ?33. 美满的婚姻诚为人间异数,所以结婚应与仇人结—即完成终身大事,又完成复仇大业,一举两得。
 ?34. 怀旧……不是因为那个时代多么好,而是那个时候,你年轻。

WLAN柳暗花明

哈哈!前两天WLAN连接蓝屏的问题解决了!

还要感谢Jacky同志不经意间问我我用的杀毒软件是什么,才将我的注意力渐渐引向杀毒软件与驱动程序冲突这个方向。
回家以后迅速打开电脑,卸载Kaspersky,为了保险起见,又删除了Wireless MiniPCI Card的驱动,重新安上干净的Windows自带驱动,重启,进入Rooter管理界面,打开Wireless功能,提心吊胆地
看着右下角connecting的icon,过了许久也没有恐怖的蓝屏。我这才意识到问题解决了!靠!原来是该死的Kaspersky从中作祟!
Kaspersky不能用了,只能重操旧业,用起了McAfee,下载,安装完毕,重启。
什么?!!又是蓝屏!??靠!难道说T30八字天生和杀毒软件不合?再仔细一看,屏幕提示说是一个SKNFW.SYS的文件出问题。于是进安全模式,禁用无线网卡,重启,google,一查原来是天网防火墙的一个文件。我这才想起来,虽然我已经把天网从启动项中删除,但是没有卸载掉,难道是他的问题?
于是我进入控制面板,卸载了天网,重启,启用无线网卡,一切又恢复正常。
为了确定问题原有,我又重新安装了McAfee,重启,也再没出现过蓝屏问题。
问题终于搞清楚了!元凶就是天网防火墙!Kaspersky也沉冤得雪,可怜我的T30,在过去的两周内,无故蓝屏重启了了50多趟。。。

千万级数据分页存储过程

作者:铁拳
来源:hiDotNet.com
相关:http://blog.csdn.net/Sun_Jianhua/archive/2004/07/04/33574.aspx
[url=http://bbs.hidotnet.com/PostAttachment.aspx?PostID=14250&AttachmentID=452]C# 示例源代码[/url]
[code=sql]/*
经测试,在 14483461 条记录中查询第 100000 页,每页 10 条记录按升序和降序第一次时间均为 0.47 秒,第二次时间均为 0.43 秒,测试语法如下:
exec GetRecordFromPage news,newsid,10,100000
news 为 表名, newsid 为关键字段, 使用时请先对 newsid 建立索引。
*/
/*
函数名称: GetRecordFromPage
函数功能: 获取指定页的数据
参数说明: @tblName 包含数据的表名
@fldName 关键字段名
@PageSize 每页记录数
@PageIndex 要获取的页码
@OrderType 排序类型, 0 – 升序, 1 – 降序
@strWhere 查询条件 (注意: 不要加 where)
作  者: 铁拳
邮  箱: sunjianhua_kki@sina.com
创建时间: 2004-07-04
修改时间: 2004-07-04
*/
CREATE PROCEDURE GetRecordFromPage
@tblName varchar(255), — 表名
@fldName varchar(255), — 字段名
@PageSize int = 10, — 页尺寸
@PageIndex int = 1, — 页码
@OrderType bit = 0, — 设置排序类型, 非 0 值则降序
@strWhere varchar(2000) = ” — 查询条件 (注意: 不要加 where)
AS
declare @strSQL varchar(6000) — 主语句
declare @strTmp varchar(1000) — 临时变量
declare @strOrder varchar(500) — 排序类型
if @OrderType != 0
begin
set @strTmp = ‘<(select min' set @strOrder = ' order by [' + @fldName + '] desc' end else begin set @strTmp = '>(select max’
set @strOrder = ‘ order by [‘ + @fldName +’] asc’
end
set @strSQL = ‘select top ‘ + str(@PageSize) + ‘ * from [‘
+ @tblName + ‘] where [‘ + @fldName + ‘]’ + @strTmp + ‘([‘
+ @fldName + ‘]) from (select top ‘ + str((@PageIndex-1)*@PageSize) + ‘ [‘
+ @fldName + ‘] from [‘ + @tblName + ‘]’ + @strOrder + ‘) as tblTmp)’
+ @strOrder
if @strWhere != ”
set @strSQL = ‘select top ‘ + str(@PageSize) + ‘ * from [‘
+ @tblName + ‘] where [‘ + @fldName + ‘]’ + @strTmp + ‘([‘
+ @fldName + ‘]) from (select top ‘ + str((@PageIndex-1)*@PageSize) + ‘ [‘
+ @fldName + ‘] from [‘ + @tblName + ‘] where ‘ + @strWhere + ‘ ‘
+ @strOrder + ‘) as tblTmp) and ‘ + @strWhere + ‘ ‘ + @strOrder
if @PageIndex = 1
begin
set @strTmp = ”
if @strWhere != ”
set @strTmp = ‘ where (‘ + @strWhere + ‘)’
set @strSQL = ‘select top ‘ + str(@PageSize) + ‘ * from [‘
+ @tblName + ‘]’ + @strTmp + ‘ ‘ + @strOrder
end
exec (@strSQL)
GO[/code]
示例截图

IBM笔记本安装无线网卡

在IBM笔记本上安装无线网卡是需要破解的。适合机型:T30以后的IBM笔记本电脑。怎么破解?叫1802破解。下载一个破解文件,需要在DOS下破解。1802并非单只针对硬件上的,如无线网卡。开机BIOS报错1802和这个软件上的1802有所区别。网络上流传的4张盘的恢复盘一般只是一个型号,例如从T40 G1C抽出来的。虽然应用在大部分的T40/T41机器都通用,但是如果硬件改动太大,会出现无法安装的问题。又或者安装到了,windows也可能要重新激活。 破解1802,具体过程是这样的 下载http://www.everdigi.com/upfiles/1802.rar,解压后是个ISO,那个ISO用虚拟光驱或WINRAR打开可以看到里面有一个文件夹和一个文件, 都与蓝牙有关, 可以不去理睬,真正的破解文件是看不到的. 那个ISO本身就是一个自启动光盘镜象,所以不需要再重新做启动光盘. 操作步骤: 1.下载ISO文件到硬盘 2.我用NERO BURNING 里的\”刻录镜象文件到光盘…..\”(选项名不记得了, 差不多就这个吧)选择那个ISO文件, 把一张新刻录碟放入刻录机, 直接点\”确认\”. 3.刻完后, 请检查一下光盘中是否有那2个跟蓝牙有关的文件,(这是怕你的刻录机有问题,我就碰到个有问题的刻录机,刻出来的都是空盘,放到机器里一点反映都没) 4.调整你的本本到光盘启动, 放入光盘,启动机器一次, 然后会出现以下DOS画面(大致上) ***************************************** CTRL+ALT+DEL重启动 ***************************************** A:>光标闪烁 这时已经破解成功了, 拿出光盘, CTRL+ALT+DEL重启动电脑,就OK了.

Bar Graph column in a sorted datagrid

[align=center][/align]
[b][color=Orange]Introduction[/color][/b]
Hi, this is my first attempt at an article for CodeProject. I’ve used enough of other peoples so thought I better give something back. I’ve been developing websites for the last 6 years or so doing everything from PHP to C#.NET. For other examples please visit the development section on http://www.chemlock.co.uk/. The project below is ASP.NET in C#. There was a need to display a simple bar per row in the datagrid to quickly illustrate an amount. This is very simple so I’ve set it to beginner level. Any questions please mail me.
[b]Graph display in datagrids[/b]
This morning I had the pleasure of re-writing a consultants code into something which worked and was open to development. For some strange reason this guy wrote all his code in classic ASP hard coding the database connection strings into a file and creating all the SQL on the fly. This was slow. Not only because it was Classic ASP and the SQL strings were constantly changing so the server couldn’t cache the query but because it was badly written. One page got passed two variables in the http request stream and then used those variables to pull the same two values back from the database. Pointless and time consuming. Anyway the results where thrown into tables and one column on all the tables was a graph to show the amount of time booked to a project per week. This was out of a maximum of 60 hours (Don’t know which fool is doing those hours). My friend the highly paid consultant had done this by making a table within a table cell with a width equal to the amount of hours. This meant that if you have booked 34 hours to a project the graph would be 34 pixels long.
I was asked to fix some of the SQL as the results where not very relevant for one of the reports but thought it would be a fairly quick and simple job to simply move the lot to .Net and Stored Procs. So here is my quick and dirty guide to creating a graph column in a datagrid. It’s all nice and basic(C# actually), certainly not rocket science.
First of all Create a nice clean WebForm Here is the code behind.
[code=c#]private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
if(Request[”EmployeeNo”] != null)
{
Db db = new Db();
ArrayList parameters = new ArrayList();
parameters.Add(new DbParameter(”@EmployeeNo”,DbType.String,10,”EmployeeNo”,Request[”EmployeeNo”].ToString()));
Session[”dataset”] = db.GetDataSet(”GetEmployeeBookings”,parameters);
Session[”SortOn”] = “EndDate”;
Session[”SortDirection”] = ” DESC”;
}
}
BindGrid();
} [/code]
Ok so here notice that I’m using a class called DB to get at my database and create a dataset. Use what you like here the main point is to end up with a dataset of your results. I also set up initial Sort Parameters for my datagrid and the initial direction they will be sorted in. Every post back gets the grid bound with data but only the initial pass gets the data from the Database. Obviously if this data was likely to be changed as a result of any page action I would move this database call to a seperate methods but as it’s a static report and I’m in a hurry I’ve left it as I initially did it.
[code=c#]private void BindGrid()
{
if (Session[”dataset”] != null)
{
DataTable dt = ((DataSet)Session[”dataset”]).Tables[0];
DataView dv = dt.DefaultView;
dv.Sort = Session[”SortOn”].ToString() + Session[”SortDirection”].ToString();
this.DataGrid1.DataSource = dv;
this.DataGrid1.DataBind();
} [/code]
Here is the BindGrid method. It first checks that something exists in the Session variable. If it does it extracts it creates a dataview sorted correctly and then binds that to our DataGrid control. Notice how very lazy I’ve been with my DataGrid naming. Remeber this was quick and dirty.
[code=c#]private void DataGrid1_SortCommand(object source, System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
{
Session[”SortOn”] = e.SortExpression.ToString();
if (Session[”SortDirection”] == null || Session[”SortDirection”].ToString() == ” ASC”)
{
Session[”SortDirection”] = ” DESC”;
}
else
{
Session[”SortDirection”] = ” ASC”;
}
this.DataGrid1.CurrentPageIndex = 0;
BindGrid();
} [/code]
Here is a nice and standard Sort Event Method. Basically if you select a column heading that has already been selected it will change the direction of that column. Any other column and the grid gets sorted on the new column heading.
[code=c#]private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
decimal hours = decimal.Parse(e.Item.Cells[3].Text);
decimal percentage = (100m / 60m) * hours;
e.Item.Cells[4].Text = “

“;}
} [/code]
This is where the graph is built. In my on-going quest to get shot of tables where tables shouldn’t be I’ve gone for a “DIV” approach. Firstly I create a div that fills the entire cell. Then inside this I create a div that takes up a percentage of the parent div. Please note that without the height command the graph will not show in Firefox. So I’ve got my 60 hours and then work out a percentage of this for the width of the child div. The code is set to apply this when each line of the datagrid gets databound. Each time the hours is worked out from another column in the database (In this instance column 3) and Parsed to a decimal. The resultant html code is injected into the cell 4. All this is set to only occur when the datagrid item (or row) is an Item or Alternating item type, after all we don’t want to create a graph for the header or pager section.
So there we have it very quick and very dirty but it does the trick.
As I said at the start fairly simple, if my description has complicated things then please let me know. Other examples on www.chemlock.co.uk

论文once more??

在论文答辩结束近一周后,收到一封邮件
[quote]格式还要按此修改,我明天集中时间会说的
> >
> > 信息学院本次本科毕业论文的格式以此为准,这是最后的版本,带来的不便请大家谅解![/quote]
我只想说两个字:
[b]我日[/b] !8o|

Wireless LAN 一期失败

今天去垃圾街把Buffalo WBR-G54 Wireless Router请回了家,踌躇满志的要组自己的无线局域网。
当一切设置完毕,本本也发现了无线讯号,连接的时候却蓝屏了!!
天哪!!真的是好几年没看到的蓝屏!!连续重启了好几次,都是蓝屏。
绝望!
只能关掉Router 的wireless,改用网线连接。
哎。好端端的一个无线路由,现在只能当普通路由来用了。。。
过两天把小黑的MINIPCI网卡给换掉,到时候再试试了。
SIGH…