2006年11月16日
不管是什么样的网站想必 SiteMap 都是重要的内容之一,从头设计一个 SiteMap 难度并不大但肯定会花费不少时间和精力,基于“尽量减少重复建设”的目的,使用(重用)SiteMapPath 都是上佳的选择。SiteMapPath 扩展性良好,因为层次结构的设计,即使在网站上线运营之后也可以非常方便的增、删、修改其中的任何部分,对于 ASP.NET 站点来说,SiteMapPath 的确能为程序员节省不少的时间。
以论坛程序举例来说,假如某论坛有如果层次结构。
论坛首页
计算机技术
编程语言
网络语言要在论坛中使用 SiteMapPath(下面简称为 SMP)需要以某种方式模拟出上面的层次结构,而 XML 绝对是描述树状层次结构的绝佳工具。首先创建一个 .sitemap 的 XML 文件。
<?xml version="1.0" encoding="utf-8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="~/default.aspx" title="首页" description="论坛首页">
<siteMapNode url="~/pc.aspx" title="计算机技术" description="计算机技术板块">
<siteMapNode url="~/pl.aspx" title="编程语言" description="计算机编程语言子板块" />
<siteMapNode url="~/nt.aspx" title="网络技术" description="计算机网络技术子板块" />
</siteMapNode>
</siteMapNode>
</siteMap>
并在 default.aspx/pc.aspx/nt.aspx 中插入 <asp:SiteMapPath> 控件,之后访问 pl.aspx 的话,在插入 SMP 的位置就会显示“首页 > 计算机技术 > 编程语言”这样的 SiteMap。
节点 siteMapNode 的 url 属性描述了文件位置和文件名,title 属性则是在网页上显示的文本,description 属性是 onMouseOver 时的提示信息。
posted @
2006-11-16 15:13 aa 阅读(2417) |
评论 (2) |
编辑 收藏
2006年11月14日
继
韩国信息通信部“
韩国要建 Linux 城市”之后,
中国开源软件推进联盟、
广东省软件行业协会、
广东省 Linux 中心和广东省中山市 Linux 中心也有了“建设 Linux 城市的动议”。不过我还是怀疑各方推进这项动议的目的和决心。
posted @
2006-11-14 11:25 aa 阅读(256) |
评论 (0) |
编辑 收藏
原文:
- Every good work of software starts by scratching a developer's personal itch.
- Good programmers know what to write. Great ones know what to rewrite (and reuse).
- "Plan to throw one away; you will, anyhow."
- If you have the right attitude, interesting problems will find you.
- When you lose interest in a program, your last duty to it is to hand it off to a competent successor.
- Treating your users as co-developers is your least-hassle route to rapid code improvement and effective debugging.
- Release early. Release often. And listen to your customers.
- Given a large enough beta-tester and co-developer base, almost every
problem will be characterized quickly and the fix obvious to someone.
- Smart data structures and dumb code works a lot better than the other way around.
- If you treat your beta-testers as if they're your most valuable
resource, they will respond by becoming your most valuable resource.
- The next best thing to having good ideas is recognizing good ideas from your users. Sometimes the latter is better.
- Often, the most striking and innovative solutions come from realizing that your concept of the problem was wrong.
- "Perfection (in design) is achieved not when there is nothing more to add, but rather when there is nothing more to take away."
- Any tool should be useful in the expected way, but a truly great tool lends itself to uses you never expected.
- When writing gateway software of any kind, take pains to disturb the
data stream as little as possible—and never throw away information
unless the recipient forces you to!
- When your language is nowhere near Turing-complete, syntactic sugar can be your friend.
- A security system is only as secure as its secret. Beware of pseudo-secrets.
- To solve an interesting problem, start by finding a problem that is interesting to you.
- Provided the development coordinator has a communications medium at
least as good as the Internet, and knows how to lead without coercion,
many heads are inevitably better than one.
译文(translator: habpi?HansB?):
- 每个好的软件工作都开始于搔到了开发者本人的痒处。
- 好的程序员知道该写什么,伟大的程序员知道该写写(重用)什么。
- 计划好抛弃,无论如何,你会的。
- 如果你有正确的态度,有趣的问题就会找上你。
- 当你对一个程序失去兴趣时,你最后的责任就是把它传给一个能干的后继者。
- 把用户当做协作开发者是快速改进代码和高效调试的无可争辩的方式。
- 早发布,常发布,听取客户的建议。
- 如果有一个足够大的 BETA 测试人员和协作开发人员的基础,几乎所有问题都可以被快速找出并被一些人纠正。
- 聪明的数据结构和笨拙的代码要比相反的搭配工作的更好。
- 如果你像对待最富贵的资源一样对待你的 BETA 测试员,他们就会成为你最富贵的资源。
- 想出好主意是好事,从你的用户那里发现好主意也是好事,有时候后者更好。
- 最重要和最有创新的解决方案常常来自于你认识到你对问题的概念是错误的。
- 最好的设计不是再也没有什么东西可以添加了,而是再也没有什么东西可以去掉。
- 任何工具都应该能以预期的方式使用,但是伟大的工具提供你没料到的功能。
- 当写任何种类的网关程序时,多费点力,尽量少干扰数据流,永远不要抛弃信息,除非接收方强迫这么做。
- 如果你的语言一点也不像图灵完备的,严格的语法会有好处。
- 一个安全的系统只能和它的秘密一样安全,当心伪安全。
- 要解决一个有趣的问题,请从发现让你感兴趣的问题开始。
- 如果开发协调人员有至少和 Internet 一样好的媒介,而且知道怎样不通过强迫来领导,许多头脑不可避免地比一个好。
posted @
2006-11-14 10:30 aa 阅读(203) |
评论 (0) |
编辑 收藏
2006年11月12日
以前在
my.donews 安家,可是那的 blog 系统总出一些无伤大雅但让我心烦的问题。自动替换某些 html 标记甚至丢失手工输入的 css/html 等等。抱着 bsp 可能修正这些错误的想法而等待了数月之久,现在我的耐心彻底消失不见了,而
博客园则多了一个注册用户。
我不是 PHP 爱好者更不是 PHP 程序员,不过我不保证未来不会对 PHP 产生兴趣。目前我关注的是开源和 Python,而我的职业是 .NET 程序员,虽然同 PHP 一样我对 .NET 没有任何兴趣,但这并不妨碍 .NET 成为我的谋生手段之一。
posted @
2006-11-12 16:39 aa 阅读(191) |
评论 (0) |
编辑 收藏