Monthly Archives: May 2006

听得我喷饭的笑话

前天半夜的时候,我一边吃着香喷喷的泡面,一边看文艺频道重播的三人麻辣烫,正好看到林栋埔讲笑话,听完笑话,我发觉地上全是我喷出来的面条。
笑话是这样子的:
Bill12岁的时候喜欢上了班里的一个女孩子。他写了封情书,又不好意思当面交给她,于是他找到了女孩的妹妹,把情书交给了她,并且嘱咐她转交给她的姐姐。
好几天过去了,没有一丝动静。
Bill又找到了女孩的妹妹,问她:“你有没有把信交给你姐姐?”
妹妹回答:“我去姐姐家的时候,她正巧不在家,于是。。。我就把信交给了她的爸爸。”
Bill问:“然后呢?”
妹妹说:“她爸爸看了信后很生气,叫我告诉你好好读书,不要搞这种事情,还说这是第一次,也是最后一次。下次再来的话他就不客气了。他还叫我把信还给你。”
Bill问:“那信呢?”
妹妹说:“我刚才去你家,准备把信还给你,正巧你不在家,我就把信交给你妈妈了。”
Bill:“$#@$#@%^$&”

赶论文丫赶论文

忙啊!真忙!
不停的赶论文。。。
这两天看到JAVA就有种想吐的感觉。。。
幸好明天还有F1看,否则真的要崩溃了。。。
幸好过两天网上买的Nokia收音耳机就要到活了,否则生活真的没有盼头了。。。
本来想在这几天把google的autosave效果做出来的,结果却以失败告终。
说是失败,其实功能方面大致上已经能够实现了,只是有些细节方面的问题,比如category count的加加减减,还有tag的更新问题,还没有细细的考虑进去。。。
不管它了,论文是命根子。把它搞定了再慢慢搞这里的事情。
ps. 很多朋友都以为这个blog是我的毕业设计。。。花了那么多心思进去。
哎,两个字——后悔!早知道当初报志愿的时候选网络应用网页制作方向了。。。现在早就在逍逍遥遥的找乐子了。。。:'(

明天TAXI涨价 全文如下

经上海市市政府批准,从明天开始,申城将正式启动出租汽车运价油价联动机制。调价后,出租汽车运价总体将上涨6.7%。管理部门透露,为了保持出租汽车运价相对稳定,联动机制启动后,原则上一年为一个周期,调整一次价格。
  
  从明天开始,市区的出租车起步价由目前的三公里10元调整为11元;超过三公里后,每公里运价由现在的2元调整为2元1角。新的计价器每满1元跳一次,因此总价中并不会有”角”出现。此外,夜间与等待时间计费方式不变。上海市区出租车价格调整:调整前调整后起步价10元/3公里11元/3公里(前3公里)超起租里程2元/公里2.10元/公里(3公里之后)郊区出租汽车的运价也同步调整,起步价由现行3公里8元调整为9元;超3公里后,每公里由2元调整为2.10元。
  上海市郊区出租车价格调整:调整前调整后起步价8元/3公里9元/3公里(前3公里)超起租里程2元/公里2.10元/公里(3公里之后)经测算,这次运价上涨幅度为6.7%;按乘客平均每车次6.3公里计算,每次要多支出1.4元。从明天开始,上海的4万3千多辆出租汽车将分批改装计价器。由于调整数量较多,这项工作要到本月底前才能全部完成。在此期间,上海出租汽车运价将会出现新、老两种价格并存的情况。

一个检验密码强度的js

[html]


  • Weak
  • Medium
  • Strong

[/html]

HTMLControl vs WebControl

突然想到一个问题,既然asp.net提供了WebControl,功能又那么强大,接口又那么统一,为什么还要用HTMLControl呢?
Google上找了一下,中文结果几乎完全统一:http://www.google.com/search?hl=zh-CN&inlang=zh-CN&newwindow=1&q=htmlcontrol+webcontrol&lr=lang_zh-CN%7Clang_zh-TW
[quote]Web控件和Html控件虽然好多功能相同并且长得很像
但是它们的内部实现机制是完全不一样的
Web控件要比Html控件执行效率要好
1. 使用起来也相当方便,举个简单的例子,例如Button的生成:
Html控件是将庞大控件集合全部弄到页面中,用到哪个功能,就设置一下属性,如下:

这样会占用相当大的控件资源
Web控件是将集成式的拆解成单功能的:

这样就可以节省不必要的控件所占用的资源了
2.Web控件具有回送功能,能够用ViewState维持控件的状态.
Html控件则不能,当点击页面的操作,其状态就会丢失.
可以做这样的一个实验:
I. 分别建立两个文件: a.html b.aspx
II.在a.html页面中加Html控件的RadioButton和一个button,在b.aspx中加Web控件的adioButton和一个button
III.a.html直接双击浏览器运行,b.aspx通过IIS运行
IV.在a.html运行界面中,选中RadioButton,再单击Button按钮,会发现RadioButton会取消选中(丢失其状态),但在b.aspx页面执行同样的操作,RadioButton不会丢失,因为ViewState给它保存了状态. 您可以在运行界面点击浏览器菜单”查看”->“源文件”,打开Html代码文件,找到加密后的ViewState,类似于下面:

其实ViewState实现原理也是将一些信息放到隐藏的一个控件中,并且asp.net生成的ViewState信息
是存储在客户端的
这里要注意的一点是:
只有当格式为*.aspx文件,并且控件具有属性:”runat=server”时,回送功能才能打开
3. Html控件与Web控件最大的区别是它们对事件处理的方法不同。对于Html窗体控件,当引发一个事件时,浏览器会处理它。但对于Web控件,事件仅由浏览器生成,但浏览器不会处理它,客户端要给服务器发个信息,告诉服务器处理事件。 不过有些事件,比如:
按下键/移动/鼠标等事件,Asp.net中没有这些事件(因为这些事件即时性强,服务器处理得不够及时),这时候Html控件就发挥其作用了,结合Html事件
协助完成.
[/quote]
往后翻了n页,才找到一条比较详细的英文资料 http://www.codecomments.com/archive289-2005-9-607043.html
[quote]
This can be confusing to new ASP.Net developers. In fact, it is important to distinguish between several different types of ASP.Net Controls. Let me elaborate, if I may:
To begin with, let’s start with the parent NameSpace/Class for all ASP.Net Controls: System.Web.UI.Control. All ASP.Net Controls inherit this class.
Under this, there are about a dozen different classes and NameSpaces. I will only mention the most important ones here:
System.Web.UI.HtmlControls.HtmlControl
This is the base class from which all HtmlControls are derived. An HtmlControl is, at the very least, a simple, client-side HTML element, such as (Label),

(HtmlForm), or

(HtmlTable). There is no server-side aspect to any HtmlControl, unless you add a runat=”server” attribute to it. Adding this attribute gives you server-side control over the client-side HTML. You can create an HtmlControl from any client-side
HTML element. There are several ready-made HtmlControls, and an HtmlGenericControl which you can use for any other HTML element.
System.Web.UI.TemplateControl
This is the base Class for any ASP.Net Control that uses an HTML Template. There are 2 ready-made classes in the CLR that inherit this class.
System.Web.UI.Page, and System.Web.UI.UserControl. Generally, when people talk about “Web Controls,” they are talking about HtmlControls, WebControls, or the UserControl class, and not the Page class, although the Page class is, in fact a “Web Control” (Note the space in the term, which distinguishes “Web Control” from the class WebControl).
A UserControl is a Templated Control that is a container for pure HTML and other Web Controls. Of all the “Web Controls” that are used frequently in ASP.Net, the UserControl is the only one that has an HTML Template. It allows a block of HTML and server-side Controls to be treated as a single unit, or Control.
System.Web.UI.WebControls
This is a NameSpace, not a class. It has 6 different top-level classes:
System.Web.UI.WebControls.Literal
This class is used to encapsulate pure HTML in a container. It does nothing else. As ASP.Net is fully object-oriented, any HTML in a template that is not a server-side control is encapsulated in a Literal Control at run-time. It can also be used to pop any block of HTML into a Page or Control at run-time.
System.Web.UI.WebControls.PlaceHolder
This class is used, quite literally, as a “place holder.” It renders no HTML, but as a “Web Control,” (System.Web.UI.Conrol) it has a Controls Collection to which any other Control can be added. As it exists in a certain location in a Page or other Control, any Control can be popped into it at run-time. A UserControl could be used for this, by not having anything in it. But what would the purpose of the Template be? This class is not Templated, so it is easier to work with for this purpose.
System.Web.UI.WebControls.Repeater
System.Web.UI.WebControls.RepeaterItem
These 2 WebControls comprise a Repeater Control. The Repeater is a container for RepeaterItems. In addition, it has properties that allow for the addition of a number of System.Web.UI.ITemplate classes for fomatting the data contained in it. A Repeater is a sort of hybrid. While it is not a Templated Control, it is hosted in a Templated Control, and the Templates in it are placed in the Template of the hosting Templated Control. It is used for binding aggregate data (arrays, Collections, etc) to a block of repeating HTML in any format desired.
System.Web.UI.WebControls.WebControl
This is the base class for most of the Controls that are often confused with HtmlControls. A WebControl is a Control that ALWAYS has a server-side component, and WebControls all share the same fields, properties and methods of System.Web.UI.WebControl. In addition, each WebControl has fields, properties, and methods that correspond uniquely to the type of HTML element that the WebControl renders and interacts with at run-time.
HtmlControls are, therefore, by nature, leaner (consume less resources) than WebControls, but have less functionality as well.
System.Web.UI.WebControls.Xml
This class displays XML without any formatting or using XSLT. It is genreally used to display embedded XML in a web page.
In summary, the term “Web Control” is a fairly common, and confusing term that is generally used to encompass HtmlControls, WebControls, and the UserControl ASP.Net System.Web.UI.Control classes. It is important to distinguish between what type of “Web Control” is being discussed. The main differences between these 3 types of Controls are:
HtmlControls are lightweight Controls that can represent pure HTML, or add server-side functionality to client-side HTML.
WebControls are Controls that always have a server-side class associated with them, and provide a common server-side functionality for working with various HTML elements, and specific functionality for specific HTML elements.
A UserControl is a Templated Control which has a Template file, a container for both pure HTML and server-side class references in it, and allows for server-side manipulation of the server-side Controls in it. It allows a block of HTML and server-side Controls to be treated as a single unit, or Control.[/quote]
不知道谁说得更正确呢?

这年头,谁比谁更狠?[看完请深思]

老妈平时买菜总爱拎着个弹簧秤。然而昨天我在菜市场里看到的一幕,可比老妈的弹簧秤高明多了。
一老大爷走到卖西红柿的摊前问:“多少钱一斤?”摊主回答:“两块五。”大爷挑了三个西红柿放到秤盘里。摊主说:“一斤半,三块七。”大爷说: “我就做个汤,不用那么多。”说着就去掉了个儿最大的那个西红柿。摊主迅速地又瞧一眼说:“一斤二两,三块钱。”
我在一旁看着,心想,怎么这西红柿越大越不压秤,难道那个大西红柿是空心的。实在看不过去了,就提醒大爷:“他称得不对。”没想到大爷对我摆了摆手,毫不在意,伸手就往外掏钱。
摊主见大爷如此爽快,索性拿眼睛瞥着我,一副得意洋洋的样子。不料大爷并没有拿摊主已经装在塑料袋里的两个西红柿,而是拿起刚才去掉的那个大的,放下七毛钱,扭头就走……

床上有灵感

昨天在同学家玩了一整天(感觉冯蕴喆同学真的改变了n多,她进来的时候我完全都不认得了,嘴巴长得大大的——哇!美女!!:-0:$……以下省略300字……),言归正传,回到家已经10点多钟了,坐在沙发上看电视(最令我热血沸腾的节目——改装车),看着看着就睡着了。醒来的时候已经是早上1点多了,本来想好了要在昨天把tags的update给搞定的,看来不行了,干脆洗好澡爬到床上看巴萨的比赛算了。
看着看着,突然一下子来了灵感,连忙抽出纸和笔,一气呵成把代码写了下来。
今早起来,一字不差的输入电脑,粗一测试,竟然完全通过。哈哈!真是得来全不费功夫阿!!
看来以后有什么解决不了的问题,可以躺到床上去酝酿酝酿,没准就来了灵感。hoho(lol)
ps,这个blog的最初设计,也是在床上完成的,改天把最初的sketch的涂鸦贴上来看看。。。hoho
pps,误会标题的进来自首(lol)。。。

仿淘宝导航标签效果

[html]




无标题文档


仿淘宝网站的导航效果。此方法有几个优点:

1、根据字数自适应项目长度

2、不同的项目使用不同的颜色来区分
3、这回需要使用到js了,呵呵
4、背景图片只需要两个图片文件就足够,减少服务器负担
5、这是使用到的两个图片:

This entry was posted in CSS & Designing on by .