cnblogs.com

May 2007 - Posts

iReaperPlus一个开源的工具项目,旨在获得MSDN学习资料,希望你能加入进来
     摘要:   阅读全文

A.Z 2007-06-01 13:50 发表评论
悼念童年
     摘要: 今天是二零零七年六月一日,是我一生中度过的第十三个,也是最后一个儿童节。我的童年,也行将就木,一只脚已踏进棺材里了。我现在所能做的,只有提前悼念一下,我逝去的童年。此文仅于儿童节时置于首页。  阅读全文

随风流月 2007-06-01 13:49 发表评论
开发自定义的Provider
     摘要: asp.net 2.0在很多地方都用到Provider Pattern,比如Personalization、MemberShip等都用到了该模式,其可插拔的特性给开发人员极大的便利,开发人员可以更据自己的需求来开发自己的需要 .Net 2.0中给我们已经定义了一个ProviderBase的抽象类,继承自它我们可以方便的开发自定义的Provider 首先我们写一个抽象类,用来定义好我们需要的抽象...  阅读全文

无心之柳.NET 2007-06-01 12:02 发表评论
突破单位封杀QQ、MSN端口的方法(转载)
不少公司的防火墙作了较为严格的限制,以至于很多网络服务如QQ、MSN都无法运行,如果你还能够打开网页,那么,使用Http通道软件可以让你突破限制,可以在现有的网络条件中使用任何网络服务。

  使用Http通道软件可以突破防火墙的限制,利用唯一Http访问的权限获得其他Internet应用。那么什么是通道呢?这里所谓的通道,是指一种绕过防火墙端口屏蔽的通讯方式。防火墙两端的数据包封装在防火墙所允许通过的数据包类型或是端口上,然后穿过防火墙与对方通讯,当封装的数据包到达目的地时,再将数据包还原,并将还原后的数据包转交到相应的服务器上。

  Http-tunnel是一个专业提供Http通道服务的公司,通过他们的在线Tunnel Server,局域网内的用户可以使用被防火墙所屏蔽的ICQ、E-mail、PC Anywhere、MSN、 QQ、Napster等软件。

  使用Http-tunnel的Tunnel Server必须使用Http-tunnel的客户端程序Http-Tunnel Client,Http-Tunnel Client的免费版本允许40Kb/秒的数据转发服务。

  一、程序安装和设置

  1.运行下载的安装程序,安装过程比较简单一路Next即可完成。

  2.安装完成后,会弹出"Configuration(配置)"窗口,设置本机的Internet连接,有三个选项:

  a) Auto detected(自动检测):你果你不知道你的机器连接,可以选择这个。

  b) No Proxy,only a firewall(直接上网,有防火墙):使用局域网和直接上网的用户选这个。

  c) Specify Proxy(指定代理服务器):如果你使用代理服务器上网,选这个,同时你还必须输入代理服务器的地址和端口,如果需要用户名和密码还需要一并输入。

  3.设置好连接,可以单击"Test(测试)"按钮,测试一下,如果看到"Test successful(测试成功)"的提示,就代表你设置的已经完成。

  4.程序正常运行后,可以将它最小化,它会在任务栏的提示区内生成一个下图标,单击可还原。

  二、设置QQ访问

  由于QQ对外访问使用的端口是4000,所以网络管理员通常通过限制端口的使用来限制QQ的访问,下面介绍一下如何设置QQ通过http-tunnel访问Internet。

  1.打开QQ,单击"QQ菜单"按钮,选择"系统参数"。

  2.在弹出的QQ参数设置窗口中,选择"网络设置"。

  3.勾上"使用代理服务器"。

  4.输入代理服务器地址:127.0.0.1,端口号:1080。

     5.确定,关闭所有窗口,重新登录即可使用QQ了。

     三、设置msn访问

     MSN的访问设置可QQ差不多,不过http-tunnel支持MSN要比QQ好得多,设置步骤如下:

     1.选择"工具"菜单的"选项"。

     2.选择"连接"标签。

     3.勾上"我使用代理服务器"。

     4.类型选择"SOCKS4",服务器中输入"127.0.0.1",端口号"1080"。

     5.确定,关闭所有窗口,重新登录即可使用MSN了。

  四、设置Cuteftp的访问

     有时候网络管理员为控制网络带宽的使用和保障信息安全,需要限制FTP服务,这给文件的上传和下载带来了不便。通过设置一样可以确保Cuteftp实现Internet的访问,设置步骤如下:

     1.选择"编辑"菜单,选择"设置",弹出设置窗口。

     2.展开"连接",选择"SOCKS",选择"SOCKs4",主机:127.0.0.1 端口:1080。(tu5.bmp)

     3.选择"防火墙",勾上"启用防火墙访问"和"PASV模式"

     4.确定,关闭所有窗口,即可选择站点登录下载文件。

     五、设置Windows XP的远程桌面连接使用Http-Tunnel

     由于远程桌面连接并没有提供代理服务器设置的界面,所以无法像QQ、msn和Cuteftp一样直接设置,这时候我们可以使用SocksCap协助我们完成,具体步骤是:

     1.安装SocksCap。

     2.运行SocksCap,选择"文件"菜单中的"设置",弹出"SocksCap 设置"对话框。

     3.在"服务器/SOCKS 服务器"并填上127.0.0.1,"Port(端口)"填1080。

     4.在"Protocol"里选择"SOCKS 版本 4",在"域名解析"里选择"Resolve all names remote(远程解析)"。

     5.单击"新建"按钮,在"标识项名称"中输入mstsc。

     6.单击"浏览"按钮,找到MStsc.exe文件所在的位置即可。

     7.单击"确定"按钮即可。

     使用时,双击SocksCap列表中的mstsc图标,即可启动mstsc,mstsc访问网络都将通过代理跳板进行。需注意的是,一定要从SocksCap中启动mstsc,否则将不会使用代理跳板。其实很多不能设置的防火墙的Internet应用程序,都可以通过这种方式,实现Http通道的功能。



surfer 2007-06-01 09:43 发表评论
看” 关于技术人员创业的讨论”有感
     摘要: dudu的“关于技术人员创业的讨论”的帖子已经有些时日了,早就有一些想法,直到今天才写下此文。也不知大家的热潮过去了没有。不是故作文章,只是这些年来,自己也处在这样的尴尬局面,很是不舒服,所以写下此文,以舒心情。
技术人员的局限性已经提了很多,就不提了,这与他们(也指我自己)的思维方式有关。但还是有许多人创业成功了。有人说机遇也罢,有人说能力也罢,我感觉要想成就一帆事业,天时、地利、人和、自身的努力对于技术人员来讲缺一不可。
设想一下,我们即要有商业的头脑,又要有技术天分。这样的人不多?有人说了,我就是,我不反对,确实有这样的人,但他们如果进行了创业,我想还是转型的多:)。那么这里引申出一个问题?现在想创业的技术人员在创业后是否还会坚持做技术?坚持多长时间?如果答案是否定的,那么就是以技术为跳板进行创业。这样这个讨论“技术人员创业”的意义也就不大了,因为他具有商业经营的素质!
……
总之,对于创业来讲,关键的问题是在环境允许的情况下自己是否具有了创业的素质,技术或许有些局限,或许是一个有利的跳板,在我看来是后者。就说这些吧  阅读全文

李学斌 2007-06-01 08:35 发表评论
【翻译】【选择一个离线应用程序结构】Choosing an Offline Application Architecture
声明:本人英语特别烂,今天比较无聊就翻译这个文章,意思应该勉强到了,一些细节可能没有翻译到位,有的地方翻译地自己都读了别扭,请大家不要耻笑,谢谢合作!
PS:由于本人英语水平比较烂,为了尊重大家的阅读习惯,我采用了对照翻译的方式来翻译,有什么翻译不好的地方,请大家指出,但请不要嘲笑我,因为我为我的英语水平已经够自卑了。再次感谢。


【作者】:Google
【原文】:http://code.google.com/apis/gears/architecture.html





Google Gears API Developer's Guide (Beta)

【翻译】:谷歌Gears应用程序接口开发者指南(Beta)

Choosing an Offline Application Architecture

【翻译】: 择一个离线应用程序结构
 

During development of Gears, we experimented with many different architectures for offline-enabled web applications. In this document we briefly look at some of them and explore their advantages and disadvantages.
 
【翻译】: 随着Gears的发展,我们为支持离线的WEB应用程序试验着不同的结构。在这篇文档中我们简要地探究一下一些关于它们的优势劣势。
 
As we experimented, we found some common themes. All the offline-enabled applications we created had the following design issues that needed to be addressed:
  • isolating the data layer
  • deciding which features to implement offline (connection strategy)
  • deciding on the app's modality
  • implementing data synchronization
【翻译】: 就像我们试验的一样,我们发现了一些公共的主题。所有我们制造的可以离线的应用程序有以下一些设计问题需要我们加以注意:
  • 分离的数据层
  • 决定是什么特征实现离线(连接策略)
  • 对应用程序的形式做出决定
  • 实现数据同步

Isolating the Data Layer
【翻译】: 分离的数据层
 
In most web applications today there is no real data layer.
【翻译】: 在今天大多数的WEB应用程序中并没有真正的数据层


Figure: No data layer

 

AJAX calls originate throughout the code, without any single clean communication layer. This is usually fine for AJAX applications because there is only one data source: the server. In effect, the API that the server exposes to AJAX acts as a data layer.
【翻译】: AJAX直接调用代码,而没有任何公共的层。这通常对AJAX应用程序是非常好的,因为只有一个层:服务器。事实上,服务器的API被AJAX当作一个数据层。

Architecture with a data layer

【翻译】: 数据层结构

In general, isolating the data layer is a good first step.

【翻译】: 通常,分离的数据层是好的第一步。

When you add a local datastore to your application, you will have a single place through which all data storage and retrieval requests pass.
【翻译】: 当你为你的应用程序增加一个本地数据存储时,你将有一个单独的位置用来处理你所有的数据存储以及取回经过的请求。

 
Figure: Data Layer

 

For example, if your AJAX application issues a JSON request directly to the server to get all the accounts for a user, you might change this to instead ask an intermediate object for all the accounts for the user. This object could then decide whether to retrieve the data from the server, the local store, or some combination of both. Similarly, when the application wants to update the user's accounts, the app does so by calling the intermediate object. The intermediate object can then decide whether to write the data locally, whether to send the data to the server, and it can schedule synchronization.
【翻译】: 例如,如果你的AJAX应用程序传出一个JSON给服务器获取一个用户的所有帐务,你可能改为请求一个中间对象来取代从服务器读取这个用户的所有帐务。这个对象来决定从服务器,本地存储,还是二者结合的方式重新找回数据。同样的,当应用程序想要更新用户帐户信息的时候,这个应用程序也是去调用这个中间对象。这个中间对象可以决定是否在本地写数据,还是将它们发送到服务器上,这些通过中间对象来决定。
You can think of this intermediate object as a data switch layer that implements the same interface as the data layer. As a first step, you can make the data switch forward all your calls to the data layer that interacts with the server. This step is useful since it is the code path that is followed when Google Gears is not installed or if the user doesn't want to enable the application to work offline. Note that a data switch is not strictly necessary (for example GearPad does not have a data switch layer).
【翻译】: 你可以将这个中间对象考虑成一个数据开关层,它负责实现和数据层相同的接口。第一步,你可以让使你所有的数据开关调用所有你的数据层以与你的服务器相结合。如果Google Gears没有被安装或者用户不想让应用程序离线工作,则这个步骤是非常有用的。注意这个数据开关并不是确实必要的(例如GearPad就没有数据开关层)


Figure: Data Switch Layer

 

The next step, as shown in the figure below, is to create a new local data layer that uses a Google Gears database instead of going to the web server for data. It's simpler if this data layer has the same interface as the existing data layer used to communicate with the server. If the interface is different then some translation needs to be done and you might as well do that inside this data layer.
【翻译】: 下一步,也是关键的一步,就是创建一个本地的数据层来使用Google Gears数据库代替访问WEB服务器上的数据。如果这个数据层拥有和已经存在的数据层相同的接口则与服务器通信将变得容易。如果这些接口不同,你则需要在这个数据层内做一些数据翻译的工作。
To test this step, you can set the data switch layer to talk to this new (local) data layer. You might want to pre-populate the database to make things easier to test.
【翻译】:测试这些步骤,你可以设置你的数据开关曾与新的(本地)数据层之间进行对话。你可能想要预先组装你的数据库让测试变得容易些。
 
 

Figure: Local Data Layer

 

Architecture without a data layer

【翻译】:没有数据层的结构

If the application is not structured with a data layer and adding a data layer is not an option, it is still possible to isolate the data layer by intercepting all the calls to the web server just before they are sent. For example, you could intercept a form submit (listen to the submit event) and decide if the application should use the local data store or the data on the server.
【翻译】: 如果这个应用程序没有一个数据层结构,并且添加一个数据层是无法选择的,这个数据层仍然可能通过中途阻止所有的发向WEB服务器的请求来分离数据层。例如,你可以截断一个窗体的提交(监听提交事件)并且决定应用程序究竟该使用本地数据存储还是服务器上的数据存储。
Implementing this approach involves finding all functions and methods that send requests to the server, and rerouting them. The challenge is that this method requires a lot of extra work, like parsing URLs, iterating over forms as well as generating the same result as the server would. In practice you end up reimplementing large parts of the web server on the client side. Regardless, this can be a viable option for existing AJAX applications that can't be otherwise rearchitected.
【翻译】: 实现这个步骤包括寻找所有发送请求给服务器的函数和方法,对它们重新路由。这个方法的挑战性在于他要求很多额外的工作量,就像分解URL,迭代表,以及生成和服务器可以生成的相同的结果. 事实上你重新实现WEB服务器客户端部分中很大的一部分。不管怎样,这个是对一个已经存在的AJAX应用程序可行的一个选择,不能被其他方式重构。

Feature Availability Offline

【翻译】: 可用的离线特征
For practical reasons, every feature of an application may not become a feature that's available offline. You need to choose which features you want to support locally and implement the logic that decides when to use the local store and when to connect to the server. We call this the "connection strategy."
【翻译】: 因为实践的原因,每一个应用程序的特征可能不会成为可用的离线的特征。你需要选择哪个特征是你想要支持的本地地并且实现这个逻辑来决定什么时候使用本地存储,什么时候使用服务器连接。我们称这个为“连接策略”。

You might think that you would always want to use the local store since it is faster. However, there are many practical reasons why you may want or need to access the data on server instead. For instance:

  • Data may be so transient in nature that it makes no sense to cache it.
    For example, an application providing real-time stock quotes would not benefit from serving old stock quotes.
  • Some application's data makes sense only while online.
    As an extreme example, an Instant Messaging application makes sense only while connected.
  • The app may choose to store only the most frequently accessed data.
    For example, if the user can set a preference that changes the language of the application, this preference change might not be supported offline because the cost of implementing this offline feature is not worth the benefit for a preference that is seldom changed.
  • Computational and/or disk space requirements make it unfeasible to recreate the feature offline.
    For example, if the feature requires huge amounts of data to be useful, beyond a reasonable amount for a personal computer.
【翻译】: 你可能认为你可能总是使用本地存储,因为他比较快。然而,有很多实际的原因来解释为什么你想或者必须使用服务器数据访问来作为一种替代。例如:
  • 数据可能是瞬时的,缓存它们将没有意义。例如,一个应用程序提供一个实时股票报价,那么旧的数据将没有意义。
  • 一些应用程序的数据只有在线的时候有意义。一个极端的例子,一个即时消息应用程序只有处于连接的状态才有意义。
  • 应用程序可能选择频繁访问数据存储。例如,如果一个用户设置它们的语言偏好,这个偏好的改变可能不需要支持离线,因为这样的偏好几乎很少改变,实现它们的离线则不值得。
  • 计算和/或磁盘空间是否可以实现离线特征。例如:如果这个特征请求大量的有用空间,超出一个合理的个人电脑的空间总量。
Typically, the optimal solution is to use the local store as much as possible, since it's usually faster than a remote connection. However, the more work an application does locally, the more code you need to write to implement the feature locally and to synchronize the corresponding data. There is a cost/benefit tradeoff to consider, and some features may not be worthwhile to support locally.
 【翻译】: 典型的,最理想的方案是尽可能地使用本地存储,因为它通常比远程连接要来的快速。然而,应用程序更多的工作处于本地,更多的代码必须实现本地并且同步通讯数据。这里就得考虑花费和好处之间的权衡,并且一些支持本地的特征并不总是值得去做的。
 
Modality
 【翻译】: 形式

One fundamental question that all offline-enabled applications must answer early is that of "modality".

  • Modal applications have distinct offline versus online modes, usually indicated through some change in the user interface. The user is made aware of the state and participates in switching states in some manner.
  • Modeless applications attempt to transition seamlessly between online and offline states, without significant UI changes. The user does not need to participate in switching states, which the application does automatically.
 【翻译】: 一个基础的问题是所有可以离线的应用程序必须提前回答它的"“形式".
  • 模态应用程序离线和在线模式有明显的区别,通常需要一些用户界面的改变。用户需要知道状态并且在一些风格中参与交换状态
  • 非模态应用程序尝试着让在线和离线之间无缝集成,没有重要的界面改变。用户不需要参与交换状态,这样的应用程序变得自动。”

 

Modal

【翻译】:模态的

In a modal application, when the application is online it communicates with the server. When it's offline, it uses the local store. Data must be synchronized when the app switches between modes.
【翻译】:在一个模态应用程序中,当应用程序是在线的,它与服务器进行通信。当它是离线的,它使用本地存储,数据必须在应用程序转变模式的时候进行数据同步。
The advantage of making a modal application is that it's relatively simple to implement and therefore a reasonable way to bootstrap the application to function offline.
【翻译】:优势:使用一个模态应用程序的优势在于它的实现相对简单,所以它提供了一个解决应用程序离线的合理的方法

The disadvantages are:

  • The user must remember to switch modes. If they forget, they will either not have the data they need when offline, or will work online in an unintentionally disconnected mode.
  • If the network connection is intermittent, the user will either need to choose one of the settings or will have to constantly switch between modes as the connection comes and goes.
  • Since the local store is not always up-to-date, it can't be used to improve the application's responsiveness when connected to the server.

 

【翻译】:劣势:
  • 用户必须记住交换模式。如果它们忘记了,它们将在离线的时候无法得到它们所需要的数据,或者当它们在线的时候它们无意识地在离线模式下工作。
  • 如果网络链接是断断续续的,用户将需要不断地随着网络状态的改变切换程序的模式。
  • 因为本地数据库并不总是最新的,它不能在连接至服务器的时候被用于改进应用程序的响应

Modeless

【翻译】:非模态的

In a modeless application, the application works with an assumption that it is offline, or that it can lose the network connection at any time. The app uses the local store as much as possible, and does continuous, small data syncs in the background when the server is available. Data synchronization is also done when coming back online.
【翻译】:在非模态的应用程序中,应用程序在一种看上去像是离线的状态下工作,或者可能在任何时候失去网络连接。应用程序尽可能使用本地存储,并且持续这么做,当服务器可用的时候在后台进行小的数据同步。数据同步同样存在于从在线转为离线的情况。

The advantages of modeless applications are:

  • A better user experience. The user does not have to be aware of network connectivity or switching states.
  • The application works smoothly even with intermittent network connections.
  • Since the local store is kept up-to-date, it can be used to optimize the server connection.
【翻译】:非模态应用程序的好处:
  • 更好的用户体验。用户不需要知道网络的连接情况和交换状态。
  • 应用程序甚至可以在是断断续续的网络条件下平稳地工作。
  • 因为本地存储保持最新,它可以使用最优化的网络连接。

The disadvantages of modeless applications are:

  • It is more difficult to implement.
  • Care must be taken to avoid letting the synchronization background process consume too many resources and make the overall application feel sluggish.
  • Testing the app can be more challenging, since synchronization logic occurs in the background and not in reaction to specific user actions.
 【翻译】:非模态的应用程序的劣势:
  • 实现比较困难.
  • 必须要注意保持同步的后台进程不会消耗过多的资源而导致应用程序变得缓慢。
  • 应用程序的测试也是一个挑战,因为同步逻辑发生在后台,并且没有明显的用户举动。
The sample application Gearpad is an example of a modeless offline application. It always writes to the local database, and then independently synchronizes the changes with the server.
【翻译】:实例程序Gearpad就是一个非模态的离线应用程序的例子。它总是被写在本地数据库,并且独立和数据库实现同步不同数据。
 
Google Reader is currently an example of a modal application. It has a distinct offline mode that a user must explicitly enable. In Reader's case, implementing a modal state was a pragmatic choice, as it was faster to implement and made it possible to release an early version of Google Reader with Gears.
【翻译】:Google Reader则是一个模态应用程序的例子。它有一个明显的离线模式,用户必须使他可用。根据读者的场合,实现一个实际的选择来决定状态,就像它们快速来实现并且使一个早期版本的Google Reader通过Gears变成可能
 

Data Synchronization

【翻译】:数据同步

No matter which connection and modality strategy you use, the data in the local database will get out of sync with the server data. For example, local data and server data get out of sync when:

  • The user makes changes while offline
  • Data is shared and can be changed by external parties
  • Data comes from an external source, such as a feed
【翻译】:你使用哪种链接和形态策略没有关系,本地数据库中的数据将与服务器的数据进行同步。例如,本地数据和服务器在以下情况进行同步:
  • 当离线的时候用户改变数据
  • 数据被共享并且可以被外部改变
  • 数据来自一个外部源,就像一个feed
 

Resolving these differences so that the two stores are the same is called "synchronization". There are many approaches to synchronization and none are perfect for all situations. The solution you ultimately choose will likely be highly customized to your particular application.

Below are some general synchronization strategies.
【翻译】:将这些不同进行分解,以致两个存储被相同地“同步”调用。这里有许多途径来进行同步,但是没有一个方案是完美的。解决方案最终选择将对你的特殊应用程序高度用户化地

Manual Sync

【翻译】:手动同步

The simplest solution to synchronization is what we call "manual sync". It's manual because the user decides when to synchronize. It can be implemented simply by uploading all the old local data to the server, and then downloading a fresh copy from the server before going offline.
【翻译】:最简单的解决方案就是手动同步。之所以称之为手动是因为让用户决定什么时候进行同步。它可以被简单地实现为上传所有旧的本地数据给服务器,并且在变成离线状态前从服务器下载最新的拷贝。

Manual sync requires that:

  • The amount of data is small enough to download in a reasonable amount of time.
  • The user explicitly indicates when he or she is going offline, typically via a button in the user interface.
【翻译】:手动同步要求:
  • 总的数据是足够小的以保证在一个合理的时间内进行下载。
  • 用户明确指示什么时候他或者她将要离线,典型的通过一个设置一个按钮来实现这个功能。

The problems with this method and with the offline mode it creates, are:

  • Users don't always know the state of their network connections. Internet connections may die unexpectedly or be intermittent, for example, on a bus.
  • Users may forget to synchronize before going offline.
【翻译】:这个方法以及离线模式创建的问题是:
 
  • 用户并不总是知道他们网络连接的状态。互联网连接可能出乎意料地中断了或者断断续续,例如,在一个公交车上。
  • 用户可能忘记在它们将要离线的时候进行数据同步。
Manual sync can be a good way to get started as it is relatively easy to implement. However, it requires the user to have awareness and involvement in the synching process.
【翻译】:手动同步可是以一个好方法的开始因为它相对容易实现。然而,它要求用户知道并且包含进同步的过程中。
 

Background Sync

【翻译】:后台同步

In a "background sync", the application continuously synchronizes the data between the local data store and the server. This can be implemented by pinging the server every once in a while or better yet, letting the server push or stream data to the client (this is called Comet in the Ajax lingo).
【翻译】:在后台同步中,应用程序持续在本地数据存储和服务器之间进行同步数据。这个可以通过在每一次要连接的时候PING一下服务器,让服务器推或者流数据给客户端(这个用Ajax的行话叫做Comet)

The benefits of background synching are:

  • Data is ready at all times, whenever the user chooses to go offline, or is accidentally disconnected.
  • The performance is enhanced when using a slow Internet connection.
【翻译】:后台同步的好处:
  • 数据在任何时候都是准备完毕的,无论用户选择离线还是意外断线。
  • 当使用一个缓慢的互联网连接的时候这个表现就有所提高了。
The downside is that the sync engine might consume resources or slow down the online experience with its background processing (if it's not using the WorkerPool). Using WorkerPool the cost of synching is minimized and no longer affects the user's experience.
【翻译】:不好的趋势是同步引擎通过后台进程将消耗资源或者减慢你的在线体验(如果他不是使用线程池的话)使用线程池这个同步的代价将减到最小,并且不再影响用户的体验。


Figure: Background sync architecture

 

Conclusion

【翻译】:结论

There are many design choices to be made along the way to enabling an application to work offline. This document reviewed a few of the possible choices for the common design issues that arise. The decisions made for an application will need to reflect the user experience you want to achieve as well as the application's limitations and goals.
 
【翻译】:有许多可以让应用程序离线工作的设计选择。这篇文档回顾一些可用的选择。这个将决定你将需要达到什么样的用户体验,并且有什么样的应用程序限制以及所能达到的目标。


volnet(可以叫我大V) 2007-06-01 00:49 发表评论
Enterprise Library Database Authorization Provider
     摘要: 大家都知道,微软企业库中的Security Application Block是把权限规则写在配置文件中的(app.config,web.config),并没有提供存在数据库的实现形式。我去年就向企业库项目组的人建议在SAB中加入这一实现形式,遗憾的是,直到现在的3.1版本,还是没有实现这一功能。
还好GotDotNet上有人提供了这一功能的扩展:Database Rules Provider ,不过这个扩展没有权限操作的功能(添加,删除,修改权限。。。),不方便大家的日常使用,所以我就对其作了一些修改,加入了权限操作功能。现在放出来与大家共享:)  阅读全文

levinknight 2007-05-31 21:55 发表评论
The Integrating Forum Is Here
     摘要: 自从5月26日发布《The AspNetForum Reloaded》后,颖创论坛也加紧了开发脚步,也希望能有更多更贴心的Feature来回馈广大支持和关心她的朋友!可以说颖创论坛才刚刚开始走进广大朋友的视野,为了进一步让各位朋友了解她,我粗粗整理出一个简单的开发日志,不过由于记忆力减退,也许有所遗漏,期待你去发现,,体验与下载地址http://forum.ycweb.net  阅读全文

恩电 2007-05-31 19:11 发表评论
在Module中使用自定义过滤器,来统一对站内所有请求响应的输出内容进行采集或更改。
     摘要: 因项目需要,对每一个访问网站的请求要做原始数据记录,其中要包括几个要素:1.客户端的IP2.客户端请求的页面路径3.客户端发出的请求头4.服务器返回的正文内容。在代码设计前分析了一下,前三个都很好解决,对于截获服务器返回的正文,准备用HttpResponse 对象中的Output 和 OutputStream 属性输出信息来解决。可是在正式编码的过程中,发现Output和OutputStream ...  阅读全文

李佩亮 2007-05-31 16:20 发表评论
也说创业:产品,有创新的产品
     摘要: 对于你我来讲,所需要的仅仅是一点点时间,利用手中的技术,脑子里面的火花稍微释放一点,然后的结果呢?  阅读全文

WaitU 2007-05-31 15:32 发表评论
软件设计(1)--避免的问题
     摘要: 要想让软件不发生腐化,使以后的维护工作更加容易,那么设计软件的应该尽量是你开发出来的软件避免以下几个问题:  阅读全文

lizhiwen 2007-05-31 14:36 发表评论
使用Forms身份验证
     摘要: 一般的管理系统使用的是Session或Cookies来对进行对用户的身份验证的,而Asp.Net本身就提供了一种验证机制:FormsAuthenticationTicket,本人觉得这种机制是基于Cookies的。定义一个用户信息类: using System;using System.Web;using System.Web.UI;using Syste...  阅读全文

faib 2007-05-31 11:35 发表评论
《理解专业程序员》tips

理解专业程序员,给您带来大师的tips
*"什么东西是绿的,有轮子,而且长在房子的周围"?*
*"猜不出来,答案呢"?*
*“是草,轮子是我瞎说的”!*
*--狎弄规则*

     1. 要点并不在于有那么多看似专业的程序员的人在到处丢人现眼,而是在于没有几个管理者知道,正在和自己打交道的到底是“他们”中的一员,还是我们中的一员。
   2. 如果你离开一个地方,那么这个地方会因为你的离开而更加恶化(因为一个很积极的批评者走了)。如果你留下,抱怨、叫喊、批评、建议、劝告,那么你最终会有收获,你会让别人也意识到这里存在问题,而且有可能(当然也只是有可能而已)你能给环境带来些许改观。
   3. 第一惯性定律:环境变化迫使人们改变。唯有此时人们才会改变。
   4. 第二惯性定律:如果被迫变化时,人们总要挣扎着保住他们最重要的东西,牺牲不那么重要的东西。
   5. 我们总是把效率最高的人从编程岗位上挪走或轰走。
   6. 程序员的岗位大大膨胀,于是即使尚有一些高水平的人才留在这一岗位上,他们带来的生产力提升也被大批涌入的新人中和了。
   7. 有一次,一个程序员对我说:为什么我的生产力每年提高5%,可我的经理还不满意呢?他(她)自己的生产力10年都没有任何提高。
   8. 一个经理的生产力是靠另一种方式衡量的--按照她管理的那些人的生产力衡量。
   9. 那么程序员的生产力为什么不能通过他(她)写的程序的生产力来衡量呢?
   10. 下面两个人哪个更好:Dorothy,她从前用来写100行代码的时间现在可以用来写110行,不过她的程序质量和以前一模一样;Herbert,他还是用同样的时间写100行代码,但是他的程序现在能帮助1000个使用它的职员,让他们提高1%的生产力。
   11. 不但要让程序员多产出,而且要让程序员决定这个产出的“多”是指什么。
   12. 在今天发达的社会里,空气食物和水都算不上能鼓动人心的动力,计算机能力的巨大提升,并没有真的威胁任何程序员的饭碗,而且法律也不允许经理们作出这样的威胁:你要不快点编码的话,我就憋死你。
   13. 获得了一种相对安稳、相对舒适的生活之后,普通的程序员会去寻求更高的需求,心理学家把需求列出如下:归属感-成为某个团队的成员;尊重,被他人高度评价;自我实现,被自身高度评价。
   14. 金钱作为衡量的一种尺度:Manuel编程已有五年了,现在他感到自己的编程能力确有提高。当一个学员来问他问题的时候,他发现要是他来编写那个程序,只要该学员所花时间的1/3。所以他对归属感很满意,学员也很尊敬他的技术。他也知道自己擅长这个。有一天他碰巧得知,那个学员挣30000美元,他自己的薪水是40000美元,这40000美元满足他的物质需要已经足够,而且他的职位也足够安全,但他觉得不太自在,“为什么,”他想,“我的生产力是别人的3倍,确只多挣了1/3?也许我的经理对我的技术不够赏识。”他的尊重受到了威胁,所以他有动力来对此做点什么了。他看了看报纸,他得知没有人会因为仅仅产出是别人的3倍就拿3倍的报酬,这个信息补偿了他的尊严。他明白了,工资的差异与其说时直接反映人的价值,不如说是一种象征。但是他也看到了人才中介广告说,招聘一个有他这样有经验的人,薪水远远超过40000美元,所以他的焦虑没有完全打消。他倒是不想辞职,因为他所有的朋友都在这儿工作,但他决定年终考评的时候提出工资问题,但是公司为了提高生产力控制人力成本,只计划给Manuell略微提一次薪。Manuel为了自己的工作状况,他会选择以下出路中的一个:离职,找一个新工作;尽可能避开他的经理的眼镜;为了弥补自己的低报酬,减少工作量。    而且如果Manuel真的感到需要更多的金钱时,他也不大可能通过提升生产力来赚取,相反,可能尝试以下途径:力争一个管理层的职位;晚上干点私活,给本地的某个会计师事务所的计算机写点程序。  这两种方式都会降低公司的生产力,第一种会损失一个有经验的人手,第二种则会损失这个人的时间和投入精力。
   15. 如果让程序员玩一个游戏,却不让他们知道全部规则,他们总会非常困惑,如果告诉他们这里的确有规则,但其中一些未经言明,很多程序员就会去努力,努力去发现那些潜在的规则,但是一旦他们感到这里根本没有规则,或者规则能够任意改变,程序员们就会对此产生敌意,并退出这个游戏。
   16. 让一心求产量的人去理解一心求质量的人近乎不可能,反之亦然。
   17. 把思考留给必须思考的东西!
   18. 头脑好,身体好.
   19. 要提高程序员的打字水平。
   20. 知道什么时候让事情水到渠成,这是最高的智慧。
   21.专业人士最终的安置应该是体面的退休。



MasterCai 2007-05-31 11:24 发表评论
Infragistics控件样式修改

研究了几天,终于对这套控件样式有所了解.... 先将用法写出来,供使用的人参考...(要使用到AppStylist)

WinForm

有几处无法直接设计的,必须在isl文件里里修改
1、UltraTabbedMdiManager
在isl文件里搜索 在TabItemAreaHorizontalTop 处。

2、groupby
在isl文件里搜索 在GridGroupByBox处。


WebSite

一、AppStylist For ASP.NET的使用

打开AppStylist For ASP.NET之后,点file选择新建或者打开已经存在的样式文件. 新建有三种方式:

1、打开已经存在的几种经典样式,然后加以修改。
2、打开自己以前建立的样式,进行修改。
3、打开系统默认的控件样式,进行全新设计。

打开之后,在你想要设计的控件位置点右键,会弹出两个选项,一是控件该位置的名称,二是control,选择改位置名称,然后在下面的属性面板进行设计了。
下面的属性面板有两种方式设计,一是Designer,进行直观设计,取色,设置边框之类,另一是Text Editor,是进行css文件的编写, 两个是互通的,Designer设计的样式
会在Text Editor里自动生成css代码,在Css里写的代码在Designer里也会自动生成相应的样式。

设计完之后保存,会自动生成相应的css样式表,当然,有些样式仅仅代码和css控制还不够,很多地方需要图片,就需要把制作好的图片放入生成的images文件夹下就可以了。

       二、常见的几种控件样式控制代码

在页面的<head>标记里首先要加入        <link href="aaa.css " rel="Stylesheet" type="text/css" />, aa.css代表在AppStylist For ASP.NET里设计所生成的样式文件。
1、UltrWebGrid
GroupByBox       控件最上面的一条,把控件拉入窗体,会默认显示' Drag a column header here to group by that column '的地方,改部位控制代码在:
<GroupByBox>
<Style CssClass="xxxx"></Style>
</GroupByBox>
在GroupByBox标记之间的Style标记里,上面的xxxx代表该位置样式的控制ID(以下均默认),该ID可以在相应的css文件里找到,里面有它的样式控制代码。

header        控件显示表格标题的地方,紧接着GroupByBox的下面,该部位的控制代码在:
<HeaderStyleDefault CssClass="xxxx" Height="23px"></HeaderStyleDefault>

Alt         显示列表的各行数据交替所显示的样式,该部位的控制代码在:
<RowAlternateStyleDefault CssClass="xxxx"></RowAlternateStyleDefault>

Selected      选择某行数据所显示的样式,该部位的控制代码在:
<SelectedRowStyleDefault CssClass="xxxx"></SelectedRowStyleDefault>

Item      数据显示的样式,即数据一行一行的显示所表现的样式,该部位控制代码在:
<RowStyleDefault CssClass="xxxx">
</RowStyleDefault>

Edit       编辑数据时显示的样式,该部位的控制代码在:
<EditCellStyleDefault CssClass="xxxx"></EditCellStyleDefault>

Pager      分页显示时 显示上一页或下一页等等 所显示的样式, 该部位的控制代码在:
<Pager>
<Style CssClass="xxxx"></Style>
</Pager>

Footer      控件底部,该部位的控制代码在:
<FooterStyleDefault CssClass="xxxx"></FooterStyleDefault>

2、UltraWebListbar
Group_Exp      组栏目的样式,即组名称所在的位置的样式,该部位的控制代码在:
<DefaultGroupStyle CssClass="xxxx" ></DefaultGroupStyle>  

HeaderExpanded 子栏目展开时 组位置所显示的样式,(比如说展开时就显示一个朝下的箭头,收起的时候就显示一个朝上的箭头) 该位置的控制代码在:
<ExpandedAppearance ExpansionIndicatorImage="up.gif">
<Style CssClass="xxxx"></Style>
</ExpandedAppearance>

HeaderCollapsed 子栏目收起时 组位置所显示的样式, 该位置的控制代码在:
<CollapsedAppearance ExpansionIndicatorImage="down.gif">
<Style CssClass="xxxx"></Style>
</CollapsedAppearance>

HeaderHover      组位置在鼠标划过时的样式,该位置的控制代码在:
<HoverAppearance>
<Style CssClass="xxxx"></Style>
</HoverAppearance>

ItemSelected      子栏目里数据被选中时的样式,该位置的控制代码在:
<DefaultItemSelectedStyle      CssClass="xxxx"></DefaultItemSelectedStyle>

3、WebPanel
HeaderHover      标题在鼠标划过时的样式,控制代码在:
                    <HoverAppearance>
                        <Styles CssClass="xxxx">
                        </Styles>
                    </HoverAppearance>

HeaderCollapsed      显示内容收叠起来时显示的样式,控制代码在:
                    <CollapsedAppearance>
                        <Styles CssClass="xxxx">
                        </Styles>
                    </CollapsedAppearance>

HeaderExpanded      展开时显示的样式,控制代码在:
                    <ExpandedAppearance>
                        <Styles CssClass="xxxx">
                        </Styles>
                    </ExpandedAppearance>

Panel 下面显示内容的样式,控制代码在:
                <PanelStyle CssClass="xxxx">
                </PanelStyle>

4、UltraWebTab
HoverTab      鼠标划到tab上的样式,控制代码在:
                <HoverTabStyle CssClass="xxxx">
                </HoverTabStyle

DefaultTab      默认的tab的样式,控制代码在
                <DefaultTabStyle CssClass="xxxx">
                </DefaultTabStyle>



浪花朵朵 2007-05-31 10:38 发表评论
用JAVA实现一个支持多语言的年月日标签-献礼六一儿童节
     摘要:     在现在的项目中用到了一个自己写的日历标签,趁儿童节到来之际,在这里与大家共享,本人水平有限,希望大家提出宝贵意见.   首先是MyCalendar.tld文件的定义如下: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighl...  阅读全文

John-zhaohui 2007-05-31 08:30 发表评论
More Posts Next page »