2006年1月25日

现在,人人都会用MVC的模式,都知道分3个层次来处理系统。分了3个层次,而代码的分界确又是堆砌的,爱堆哪就堆哪,这样和没分层又有什么区别呢?表现上看起来好点罢了。

我看到很多的代码,在aspx.cs页面处理了很多的业务逻辑。在简单的网站,也许你认为没有业务逻辑,所以都可以写在aspx.cs。事实上并非如此。页面的显示视图不一样,也是逻辑。对于输出View的控制所有东西都是逻辑。在业务逻辑层上,很多人喜欢重复调用下数据层的东西,那种重复劳动太值了,多了一层多处理,又没有起到应有的作用。在业务逻辑层还出现GetXXXByUserID之类,就说明你出现了吃力不讨好的事情了。

分层的心态是好的,可没做到份上。事实上,原则应该如下:

表现层,用以处理所有用户输入和数据显示问题;
业务逻辑层,存放所有“业务逻辑”,所有处理,算法等应该放的地方;
数据访问或资源层,存放用于检索、修改或存储数据的所有代码。


简单的说表现层只处理输入和数据显示,当然还包括JS之类的处理。其他一律可以放到逻辑层处理。而数据访问层,说简单就是增删改查四个动作,其他的一律提到逻辑层处理。这样逻辑层的东西就可以具体的根据相同职责来分分合合。这样代码就清晰多了。

哎~,可这个世界就有如字不可教的大量人存在。
posted @ 2008-04-11 10:17 Chatterley 阅读(49) | 评论 (2)编辑
 

大家都知道验证码的作用。验证码是为了防止机器遍历密码而获取帐户的操作权。但如果在客户端来生成验证码,那不等于花瓶吗?这个道理大家都懂,但还是有很多大网站还是这样做。。。。
Sina的Blog生成验证码的代码的Js如下:
function load_chk_img(s) {
  var stamp = new Date().getTime();
  $(s).src = 'http://my.blog.sina.com.cn/myblog/checkwd_image.php?' + stamp;
}

当stamp的值一定时,生成的验证码是相同的。例如:
http://my.blog.sina.com.cn/myblog/checkwd_image.php?10000 对应的7040,只不过显示的7040的形状不同而已。
客户端完全可以修改stamp。从而获取一个Code,根据这个Code来验证。
再用机器去遍历password就OK了,如果密码简单的话,就可以到大流量的vip博客玩一把了,那些vip肯定会大吃一惊。


posted @ 2007-11-06 15:22 Chatterley 阅读(56) | 评论 (1)编辑
 

这两天在公司里玩了会Sea@35,虽然有很多不足,但还是值得自己的人玩一把。特别是几百号人一起上阵的情景。呵呵,满地都是人的感觉就是cool。

有兴趣的人还是值的一玩,毕竟改了些新东西。

posted @ 2007-10-18 23:51 Chatterley 阅读(177) | 评论 (1)编辑
 

今天修改wordpressmu遇到一个关于使用Jquery的bug,在IE下,老显示js有错误。bug显示信息为:Error:expected identifier, string or number。
我于是找到了dashboardswitcher.php里的一段js:
jQuery( function($) {
var switchTime;
var w = false;
var h = $( '#blog-title' )
 .css({
  background: 'transparent url( ../wp-content/mu-plugins/bullet_arrow_down.gif ) no-repeat scroll 100% .2em;',
  padding: '0 25px 2px 5px',
  cursor: 'pointer',
  border: '1px solid #14568a',//这里多了一个","
 })
 .parent().css( { position: 'relative' }).end()
 .append( $('#switchermenu') )
 .hover( function() {
  $(this).css({ border: '1px solid #1a70b4'});
  switchTime = window.setTimeout( function() {
   $('#switchermenu').fadeIn('fast').css( 'top', h ).find('a').width( w = w ? w : $('#switchermenu').width() );
  }, 300 );
 }, function() {
  window.clearTimeout( switchTime );
  $(this).css({ border: '1px solid #14568a' }) ;
  $('#switchermenu').hide();
 })
 .height() - 3;
});

jQuery还真是强大,既然一句话就实现了,包括样式变化,以及switchermenu的显示和隐藏等功能。正为jquery震撼,难怪说jquery改变了js的编码风格。
我在这段代码中找了半天,没有看出什么问题。可能是由于太相信wpmu了,一直只在自己添加的代码里找。外加,没有太在意wpmu中的小细节。而且,它在fireFox下一切都正常。正在无奈的情况下发现了多了一个“,”,呵呵,得意……又找到一个wpmu的bug。原来FF应该可以智能补差,例如<br >它会补充</br>,而对空的变量则会忽略。而IE则没有那么智能,原本期望“,”后有个变量,则自然出现错误。
一个小小的“,”,就可以看出两个browser的智能差距,没用过IE7,不知道它是不是也变智能了。

 

posted @ 2007-10-11 16:59 Chatterley 阅读(64) | 评论 (0)编辑
 

今年国庆可以说是在空虚无聊中度过。原因当然很多,首先是国庆没有回家,如果回家肯定不会这么无聊。不回家的理由也很简单,一个字“懒”。因为家里没有人(父母在外),回去一切都得自理,包括洗衣服、做饭。其次,身边的朋友大都跑其他地方工作了,不是去龙岩,就是回去当公务员,还有的跑三明,福州等等。再次,可能是现在的我没有以前那种激情了,以前一有时间就到处跑,到处玩。而现在,感觉世界不过就那样,没啥意思。最后,女朋友天天上班。
无聊归无聊,无聊总得忙些事情。于是,这几天再次拿起《PofEAA》,看的速度大不如前了,一天就只看那么几页,还好,每次看都有点收获。感觉大师的书些的比较严谨,啥主意和想法都凭证据,啥都是都讲究优劣对比、权衡。从这些就可以看出一个人的水平和书的质量,挑书,自然也要挑选这类的书。个人感觉,这类书对我影响最深。在细看《PofEAA》的同时,还顺便浏览了张询的《软件架构:组织原则与模式》的前面几十页的内容。
张询,给我印象最深的是评《UML三大硬伤》,分析问题有深度,是我比较崇拜的人。因为自己对英文比较感冒,自然而然要看这些人翻译的书,心里比较塌实。看了架构和组织的关系,自然想到自己所在的公司。自己感觉这个方面是公司的重病。个人感觉公司的产品很零散,所有产品可以说是堆积起来,而不是架构起来。一个已有11年的企业,既然每次开发都要从头做起,不得不说是一个悲哀。重复开发,人员流动太大等等许多问题都早早暴露出来。我们作为最底层的员工,只能用眼睛看待一切。
最后,以前一直想学ROR,结果一直没有时间。乘这次大放假的时间,把ROR塔起来。基于MVC架构的Rails,动态语言,内置的Server等,对于开发速度大大提高了。

今天也4号了,希望这次可以把ROR大致轮廓搞清楚,Ruby语法过一遍,有机会虚拟个项目玩一把。。。

posted @ 2007-10-04 20:50 Chatterley 阅读(129) | 评论 (0)编辑
 
今天不小心看到google.cn上有两个地方分别出现,©2007 Google©2006 Google

这应该就是修改了一个地方,而没有应用到所有地方。这种设计缺陷无论是大公司还是小公司,如果设计不好,很容易出现这种问题,给维护带来太多的麻烦了。

有时候设计时,或者Coding时候,为图方便,也会遗留很多这种细节错误。所以一个人的认真态度才是软件开发重要之处
posted @ 2007-09-30 08:59 Chatterley 阅读(133) | 评论 (1)编辑
 
可以参考源代码的哦
地址:
http://www.microsoft.com/resources/sharedsource/Licensing/WindowsAcademic.mspx
posted @ 2007-09-27 10:01 Chatterley 阅读(162) | 评论 (0)编辑
 

OpenID注册地址http://openid.35.com

OpenID优势:
1、有了OpenID,你可以拿OpenID登陆所有支持OpenID登录的网站。这些支持OpenID登陆的网站对你的密码一无所知,保证了你的密码安全。你再也不用记多了username和password。
2、OpenID可以设置委托,可以把自己的域名作为OpenID。例如我把http://www.xmpoint.com注册openid委托,则可以利用http://www.xmpoint.com来登陆所有支持OpenID登录的网站。
3、OpenID可以注册N份个人资料,用于你登录的各个网站的personal profile。

OpenID劣势:
1、你登录的时候,你必须跳转到OpenIDServer去验证你的身份。这是必须的,要不支持OpenID的网站怎么知道你是不是冒牌的。


以后在网络上,域名就是你身份的表示,就象你现在的身份证一样。不同的是自己的身份证不能由自己来定,而OpenID的帐号你可以爱取啥就取啥(前提是你能注册到)。到那个时候,好的域名就更值钱了。

posted @ 2007-09-20 19:44 Chatterley 阅读(154) | 评论 (0)编辑
 
 1、理解缓存  http://blog.joycode.com/ghj/archive/2007/09/01/107863.aspx
 2、也说缓存 http://blog.joycode.com/peon/archive/2007/09/05/108033.aspx
 3、使用memcached进行内存存储 http://www.example.net.cn/archives/2006/01/eoamemcachedoea.html
 4、从LiveJournal后台发展看大规模网站性能优化方法http://www.example.net.cn/2006/03/livejournal_optimize_step_by_step.html
posted @ 2007-09-06 09:36 Chatterley 阅读(50) | 评论 (0)编辑
 






Other Products@35
posted @ 2007-08-03 16:42 Chatterley 阅读(132) | 评论 (0)编辑
 

问题前提:mysql版本>=4.1

1、修改mysql目录下的my.ini
#default-character-set=latin1
default-character-set=utf8
2、修改wp-includes/wp-db.php
在对象wpdb中添加函数set_charset($charset):
class wpdb{

 function set_charset($charset)
 {
  // check mysql version first.
  $serverVersion = mysql_get_server_info($this->dbh);
  $version = explode('.', $serverVersion);
  if ($version[0] < 4) return;
  // check if utf8 support was compiled in
  $result = mysql_query("SHOW CHARACTER SET like 'utf8'", $this->dbh);
  if (mysql_num_rows($result) <= 0)
   return;
  if ($charset == 'utf-8' || $charset == 'UTF-8')
   $charset = 'utf8';
  @mysql_query("SET NAMES '$charset'", $this->dbh);
 }
}

3、并修改wordpressmu根目录下的wp-settings.php:
require (ABSPATH . WPINC . '/vars.php');

$wpdb->set_charset(get_bloginfo('charset')); // add at this

4、重新创建wordpressmu的数据库(重新安装wordpressmu)。

posted @ 2007-07-27 12:43 Chatterley 阅读(122) | 评论 (0)编辑
 

下载地址:ZendFramework-1.0.0.zip
              ZendFramework-1.0.0.tar.gz
posted @ 2007-07-13 16:33 Chatterley 阅读(78) | 评论 (0)编辑
 
一篇很好介绍如何如何利用VC来扩展php。

地址:http://www.phpe.net/articles/410.shtml
posted @ 2007-07-13 16:11 Chatterley 阅读(55) | 评论 (0)编辑
 

 microformats原来还有此等威力,当然还是Xml,XPath的好用之处。
什么是microformats,在microformats.org上这样描述:Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards.

microformats网站:http://microformats.org
一篇很好的文章:使用 microformats 分离数据与格式

posted @ 2007-07-09 10:14 Chatterley 阅读(55) | 评论 (0)编辑
 
1 Deploying Windows SharePoint Services and Custom Components
Configure a target computer for Windows SharePoint Services development.
Create Windows SharePoint Services service accounts.
Configure database rights for Windows SharePoint Services service accounts.
DbCreator
SecurityAdministrator
Configure machine rights.
IIS_WPG
STS_WPG
Enable forms authentication on the IIS virtual server.
Deploy a Web Part to the Windows SharePoint Services server.
Register an assembly as a safe control in the Web.config file.
Configure Web Part permissions.
Enable a Web Part to access resources by creating a custom security policy.
Create and deploy a Windows SharePoint Services solution package.
Deploy a site definition to a Windows SharePoint Services front-end Web server.
2 Deploy a site definition manually by copying appropriate files and folders to the server and resetting IIS.
Deploy a feature to a Windows SharePoint Services front-end Web server
Deploy a feature manually by copying appropriate files and folders to the server and resetting IIS
Install and activate a feature by using STSADM.
Deploy a Web service to a Windows SharePoint Services front-end Web server.
Deploy a Web service so that it is available within the context of any Windows SharePoint Services site.
Deploy a Web service external to the Windows SharePoint Services context.
Deploy user controls to a Windows SharePoint Services front-end Web server.
Deploy a user control so that it can be used by any Windows SharePoint Services component. 2 Creating Site and Feature Provisioning Components
Create a feature definition
Specify a feature that depends on another feature to activate
Specify an Event Receiver to handle events for a feature
Localize a feature using a resource file
Create an action to add an option to the site settings menu
Add a new master page when a feature is activated
Cache the master page in a document library
Create a site definition
Define the top and side navigation areas for a site
Specify a list definition to use in a site
Hide a list definition from the Create Page
Specify a Document Template in a site definition
Specify a file for use in a Document Template
Create a site definition module
Specify a file to be cached in memory on the front-end server
Add a UI element to the beginning of the top navigation area in a module
Force a Feature to install when a site is created by using the site definition
Specify the configurations of lists and modules in a site definition
Create multiple configurations for a single site definition
Specify that the site created will only exist as the root Web site in a collection
Create pages and layouts for a site
Create a custom Page Layout that has multiple Web part zones
Customize the fields that are displayed on the mobile view of a Windows SharePoint Services page
Modify the page layout for a site using master pages
3 Creating Metadata and Workflow Provisioning Components
Create a site column
Specify a site column in a site definition in a Feature
Add a column to a Provisioned Site by using the API
Create a list definition
Prevent a list from being created on a site by hiding it on the list Create Page
Add a new view to a list definition
Specify a view that shows all files and all subfolders of all folders
Create a Custom Field Type
Define the Custom Field Type to be displayed for inclusion in lists and document libraries
Display the Custom Field Type differently for a new item form and an edit form
Create a Workflow definition
Attach a workflow to a list on creation
Collect default values for a workflow
Package a workflow in a feature
Create a Content Type
Add multiple Content Types to a single list
Apply a Content Type to multiple file types
Inherit properties from one Content Type to another
Update an existing content type
4 Developing Windows SharePoint Services Components by Using the .NET Framework
Implement a business process by using a workflow.
Create a basic workflow by using the SharePoint Designer.
Call custom services from workflow by using Visual Studio 2005
Handle Windows SharePoint Services events by developing an event receiver.
Handle a list event.
Cancel an operation.
Handle a feature event.
Develop a Web Part.
Upgrade a Web Part from Windows SharePoint Services-version 2 to version 3.
Handle postback data by using the control life cycle.
Troubleshoot a Web Part failure.
Handle exceptions within a Web Part.
Convert a user control into a Web Part.
Implement caching by using the Windows SharePoint Services cache.
Create a personalized Web Part property.
Create a shared Web Part property.
Create a Web Part that uses Windows SharePoint Services cascading style sheet (CSS) styles.
Enhance the Web Part configuration UI by using a custom tool part.
Share data between Web Parts.
Create a Web Part that is a data provider.
Create a Web Part that is a data consumer.
Filter information from one Web Part to another.
Elevate application permissions by using impersonation.
Enable a custom Windows SharePoint Services administration page to access the Windows SharePoint Services object model.
Schedule tasks by using the SharePoint Timer service.
Create a job by using the SPJobDefinition class.
Submit a job to the SharePoint Timer service.
5 Manipulating Site Content by using the API
Manage an alert.
Create an alert for a user.
Remove an alert from a user.
Change the frequency of alerts.
Enhance the Windows SharePoint Services search service.
Create a custom SPQuery object.
Perform a cross-site search.
Customize user access and permissions.
Add a user to a site group.
Remove a user from a site group.
Change a user's permissions to edit a list.
Manipulate items in lists.
Create a list item.
Update a list item.
Delete a list item.
Enumerate list items.
Add a photo to a picture library.
Add a recurring event to a calendar.
Delete a thread in a discussion board.
Manipulate documents in lists.
Upload a document.
Copy a document between document libraries.
Attach a document to a list item.
Move a document across sites.
Manage records by using the records repository.
Enable the records repository for the Send to menu.
Submit a file to the records repository.
Manipulate source data by using record properties.
Retrieve a series on a file from the records repository.
Manage document versions.
Check out a document.
Check in a document.
Rollback a document version.
Display all versions of a document.
 6 Manipulating Site Configuration by Using the API
Manipulate a list structure.
Dynamically add a custom action to a list.
Create a list object and add a column to the list object.
Create a custom view for a list.
Create a dynamic column type on a list.
Create a document template and assign it to a document library.
Customize Web Part behavior based on feature availability.
Dynamically handle events.
Dynamically register an event receiver for a site event.
Dynamically register an event receiver for a list event.
Dynamically register an event receiver for a feature event.
Manage site hierarchy.
List the IIS virtual servers on a Windows SharePoint Services server farm.
List the sites available to the current user.
Create a site.
Customize navigation in a Windows SharePoint Services site.
Add an item to the QuickLaunch menu.
Modify an item on the top navigation menu.
Manage groups and groups membership.
Create a custom site group and set permissions for the group.
Add a cross-site group to a site group on different site.
posted @ 2007-06-26 14:07 Chatterley 阅读(485) | 评论 (0)编辑
 
下面是获奖名单:

Books (General):Agile Software Development: The Cooperative Game, Alistair Cockburn

Books (Technical):Head First Object-Oriented Analysis and Design, B.McLaughlin, G.Pollice and D.West

Change and Configuration Management(变更及配置管理):AccuRev 4.5

Collaboration Tools(协作工具):Confuluence

Database Engines and Data Tools(数据库引擎及数据工具):Visual Studio 2005 Team Edition for Database Professionals

Design and Modeling(设计及建模):stpBA Storyboarding for Microsoft Visual Studio 2005 Team System

Development Environments(开发环境):NetBeans IDE

Enterprise Tools(企业工具):Cape Clear ESB Platform

Libraries, Frameworks and Components(库、框架及组件):NetAdvantage for .NET

Mobile Development(移动开发):Carbide .c++ Professional Edition

Project Management Tools(项目管理工具):Rally Enterprise

Security(安全):AppScan

Automated Testing Tools(自动测试工具):AgitarOne

Bug and Defect Tracking Tools(缺陷跟踪工具):TestTrack Studio

Utilities(杂类应用):VMWare Lab Manager

Web Development(Web开发):Adobe Flex 2

Websites/Developer Networks(网站/开发者网络):SUN Developer Network

原文地址:http://www.matrix.org.cn/resource/news/Jolt_92f5060e-d8d0-11db-9bed-29012b8c745e.html
posted @ 2007-05-21 23:56 Chatterley 阅读(79) | 评论 (0)编辑
 

我经历了开发商业系统和产品两种开发形式,在我个人里,发现了些自己感觉极其不舒服的东西。
商业系统开发,简单一句话,就是客户和开发人员的需求的一个平衡。客户希望得到的系统是功能越强大,各个方面都达到自己的200%的满意,而开发人员则站在自己的角度尽量舍去不必要的功能,为了是自己能有更大的利润。往往花大量的时间去取的平衡,而忽略了系统的一些东西,最后开发出来的系统往往都不尽人意。在中国国情里,我只要能交出东西,就万事OK了。有时候即使能在很短时间内完成的功能,非得磨上几天。在开发上,尽量减少“不必要”的东西,例如文档和注释等等。这些就导致了一些IT的特有现状。一个词“悲哀”来形容。
产品开发,则是要实现一个真正的商品。公司自己要拿这些产品来卖钱。因为是公司自己的角度,不存在和客户之间的矛盾,自然而然会去避免上面的一些问题,然而另一方面的问题就暴露出来了。在开发产品时,产品经理自然要把产品描述的很清楚,需求,设计都要做的很全面(过度),从而导致了文案化。公司花费在这些东西的成本过于庞大。如果产品好买的好,也就OK了,否则,就只能面临资金紧张,倒闭等问题。然而,开发人员毕竟是拿工资的,自然就会去消极怠工,希望这个产品能开发久些。原本可以在半年开发完成的,在开发人员手上非得磨个8-9个月。如果外加管理不好,往往产品组(程序管理组)和开发部协调不好,又会导致产品畸形。

从上面的问题,这些问题都或多或少的存在。对于开发商业系统,如果能有具有开发技能的客户参与到商业系统的开发,那么可以缓解一些问题。而开发产品,如果能把产品流水线化,那么我想也可以或多或少地解决一些问题。当然也可以把产品利益相关话,产品开发买钱如果关系到产品开发里的每个人,产品开发就不会象现在这样了。

一句话,感觉开发那么久,开发还是没有采用敏捷思想来解决一些问题。国内的开发还是处于国外十几年前的状况,或者更远。。。。在这种开发体制下,无论哪个人开发,无论是管理和开发人员,都不会感到舒服。。

posted @ 2007-04-04 21:17 Chatterley 阅读(79) | 评论 (1)编辑
 
一切都来晚了,想哭,但已经没有眼泪。
posted @ 2007-04-03 23:04 Chatterley 阅读(76) | 评论 (0)编辑
 
Show一下利用Asp.net Ajax做的项目


posted @ 2007-04-03 14:58 Chatterley 阅读(199) | 评论 (0)编辑
 
http://www.cnblogs.com/xiaoshatian/archive/2007/03/21/680507.html
posted @ 2007-04-02 09:58 Chatterley 阅读(201) | 评论 (0)编辑
 
好久没有来这里写点东西了,怪想念这里的。

现在还有很多人来加我的QQ,想问我SP的问题。可人在江湖,身不由己。我不在过多关注SP,不过有空还是会看看SDK(english version)。为了生存,我换了份工作。而现在的这份工作,由于保密性比较高些,几乎都与外界失去了联系,所以很多人都以为我消失了。现在的我不上MSN了,QQ也很少上了。上QQ的唯一目的,是看谁给我留言了。看完留言,我就下QQ了。望兄弟姐妹们见谅。

现在来说说,我这三个月来都在干什么吧。我最近在做一个关于Asp.net Ajax的项目。项目可以订阅RSS,可以对自己喜欢的东西进行整合到自己的Space里面。其界面效果很象winform。我从不会Javascript,到现在几乎掌握了JS,能完成JS能实现的一些东西,当然前提是离不开资料。感觉在把弄JS的唯一难度是如何去跨平台,我们的程序必须在IE和fireFox下运行。我也深深的理解了IE的“笨”,也因为这个项目喜欢上了fireFox。现在,项目的第一迭代开发几乎完成了,可以歇一口气了。我也终于知道了原来webform也可以达到winform的效果。我参与开发的Hannover2.0项目,界面看起来还是挺绚的哦。(有机会让大家也瞧瞧,但这个机会几乎很渺茫)

以后有机会,我还会重新回到网络世界,好久没有看资料了。Microsoft的技术不知道又发展到什么地步了。goooo了一下,感觉现在大家都在研究Vista了,看来以后也要多去学学Vista了。(kunnnn了,sleep去)
posted @ 2007-03-22 00:25 Chatterley 阅读(76) | 评论 (1)编辑
 
日期 比赛 地点
2007年3月18日 F1澳大利亚大奖赛  澳大利亚
2007年4月8日 F1马来西亚大奖赛  马来西亚
2007年4月15日 F1巴林大奖赛  巴林
2007年5月13日  F1西班牙大奖赛 西班牙
2007年5月27日 F1摩纳哥大奖赛 摩纳哥
2007年6月10日  F1加拿大大奖赛 加拿大
2007年6月17日 F1美国大奖赛 美国
2007年7月1日 F1法国大奖赛  法国
2007年7月8日 F1英国大奖赛  英国
2007年7月22日 F1德国大奖赛  德国
2007年8月5日 F1匈牙利大奖赛 匈牙利
2007年8月26日 F1土耳其大奖赛 土耳其
2007年9月9日 F1意大利大奖赛  意大利
2007年9月16日  F1比利时大奖赛  比利时
2007年9月30日 F1中国大奖赛  中国
2007年10月7日 F1日本大奖赛  日本
2007年10月21日 F1巴西大奖赛 巴西
posted @ 2007-03-11 00:58 Chatterley 阅读(375) | 评论 (0)编辑
 
出处:http://msmvps.com/blogs/omar/archive/2006/11/09/How-to-become-a-really-experienced-developer-overnight.aspx
作者:Omar AL Zabir
How to become a really experienced developer overnight


I get a lot of request from a lot of people who see my works and get inspired and ask me how can they do the same? The questions I generally get are following:

  • How can I become a developer like you?
  • How can I develop projects like you did?
  • What do I need to learn in C# to become like you?
  • Does Microsoft Certifications help? Should I go for the exams?
  • What did you do to become MVP? I want to become MVP too.
  • I am 23 (or 24) and I want to become like you. What do I need to do?

Generally the questions are like this. Everyone asks me for a "shortcut" way to becoming a really good developer. So, here's the magical secret for becoming a really good developer and achieve everything I have achieved:

Work 18 hours per day, 7 days a week, 360 days a year for 13 years.

Yes! That's the secret. It's pretty easy. The only thing you need to do is "work" and do nothing else and you will achieve everything that I have achieved. Pretty easy. I did that, so you can do it too! Piece of cake.

If you want to go for the "long" way then here're the things you can try:

  • Take part in open source projects or make several yourselve. This is the best way to learn really useful things.
  • If you can, try setting up your own company. I have setup 3 companies so far. 2 were not that succesful, 1 is very successful. It helped me learn so many things that I would have never learnt by working in other's companies as an employee.
  • Read articles everyday. There are thousands of articles to read from www.codeproject.com and msdn.microsoft.com. I still read almost all the articles that get published in codeproject every week. If you read 10 articles per week and do it for a year weeks, you have the knowledge of 480 articles! Who can beat you then?
  • Not only read articles, but try out the attached source codes. Make similar projects yourselves and use the ideas presented in the articles in your own project. I spend everyday at least 1 hour in trying out new technologies. This not only increases my knowledge but also makes me more experienced in doing things better and helps me do my office work better and faster.
  • Get into companies which gives you exciting projects to work on and you get to do something in everything. For example, join a company which gives you the freedom to design your modules, develop it, test it, document it etc. The idea is to gain experience from all stages of development. Make sure the company has enough bright stars to learn from. If you just become another cow in a big dairy farm, no benefit.
  • Don't leave a company if you are underpaid but you do a lot for the company. Have patience. Build yourself up and you will one day get what you deserve. I used to get $250 per month in my first company which used to do outsourced projects for a really big company in US. I worked day and night in that company and worked in 8 projects in 7 years. I did not leave the company only because of the technologies I could learn and apply and the variety of things I could do there. Best of all, I could work on many outsourced projects myself from various countries which exposed me to a wide variety of technologies. So, when I left the company and joined another one, with the vast experience I had gathered from my previous underpaid company, my salary became $200/day in the new company. See the difference. If I had left earlier seeking higher salary instead of technologies, I would not have learned all the cool things and I would not become so expensive as I am now. 
  • This is very important for those who cost $200/day now. Don't change yourself once you start earning this much. Be the same person as you were when you used to get $200/month. Remember, it was the attitude and the burning desire to learn and grow that made you become what you are now. If the burning sun inside you becomes a dying candle, you lose.
  • Don't start your career in a company where you are given nice specs to read on, you have lead developers to decide all input/output/pseudocodes, you have a solid QA team to test your work, you have managers and administrators to take care of every management and administrative issues etc. In such a company, the only thing you become is a "smart typist". You basically translate English to C#. The right side of your brain does not develop at all. Start your career with small companies which deal with lots of challenges and you get the chance to burn your brain and fingers out. The sweet smell of your roasted brain is far better than the sweet scent of your polished cubicle inside a decorated corporate office.
  • I have seen the following evolutionary cycle of developers and see where you fit in:
    • Beginner: Does not wear shoes, comes to office on sandles. Looks very sober. Shirt is outside pant.  When you ask them, do you know .NET events and delegates? They say, "uh, ummm, no I don't think so. Is it birthday events?"
    • Beginner+: Gives you "I know it all" look whenever you talk about programming. Wears shiny shoes, full sleve shirt is nicely put inside dockers pants. Back brushed hair wtih "Set Wet" gel and always on $300 sunglasses. When you ask them, "do you know .NET events and delegates?" They say, "Events and delegates are coooool man! You can do anything with them and mark my word man, "anything". I haved used them in sooooo many projects. Did you just learn about .NET events and delegates?"
    • Intermediate: Clothing turns a bit pale. Sunglass is old-school. No hair gel. Anytime you speak about some terms like EJB, Spring, Design Patterns, their eyes sparkle like the brightest star in the November sky. They start doing a lot of off-the-record work inside office. They start going to online groups, start working with friends on open source projects, start reading MSDN Magazines etc. If you ask them, "Can you make it?" They always reply, "Sure, you will get it tomorrow." But usually you get it after a month.
    • Intermediate+: Generally you get it within 1 or 2 weeks overdue schedule.
    • Advanced: They wear the same "I am a Geek" or "Microsoft Windows XP" logo T-shirts everyday (until it stinks and you can smell it as soon as they enter the office) and shiny sports shoes. They start talking about software development processes, RUP, Extreme Programming, Agile Development etc. If you ask them to do something, they reply "Give me a functional specification, a technical specification, test plans, milestones, release plans, mockups and N number of developers and I will get it done."
    • Very advanced: Does not wear shoes, comes to office on sandles. Looks very sober. Shirt is outside pant.  When you ask them, do you know .NET events and delegates? They say, "They seem to suffer from bi-directional strong reference problem which prevents garbage collectors from collecting the listener properly and the only way to release the reference is to bring down the app domain"
  • Do take Microsoft Certifications without cheating. You will learn a lot.
  • Write articles & blogs. Share everything you learn. Someone out there will benefit from it someday. Don't hesitate thinking that you don't know much to write about.
posted @ 2006-12-05 23:08 Chatterley 阅读(302) | 评论 (0)编辑
 

好久没来这里了,自从Microlink出来。
现在的公司不能上网,刚搬了次家。网线要下个月才能接上。。。。。
希望博客朋友见谅。

由于公司的技术需要,最近在学AJAX,所以以后可能暂时不把精力放在SP上了。
所以比较新的一些东西,我并没有去研究,去发掘。所以你遇到的问题我未必能解决。



posted @ 2006-11-29 21:55 Chatterley 阅读(54) | 评论 (2)编辑
 
今天,选择离开了Microlink。
从去年的十月份走过来,公司经历了2次转型。
总结在这一年里的收获:
在技术上
1、学会了SharePoint
2、更了解了Asp.net(无论是1.0,还是2.0)。
3、真正体会了软件过程体系。
4、知道了CM如何工作。
5、体会了敏捷开发。
6、知道了如何进行团队协作。
在商业上
1、看到了一个公司是如何成长的
2、知道了影响公司的一些重要的因素的微妙关系,包括业务,资金,资源,管理。

路才真正开始……

posted @ 2006-11-08 18:01 Chatterley 阅读(38) | 评论 (0)编辑
 

原本打算把SPSiteManager用于MOSS2007,结果好象不行。于是把SPSiteManager修改了一下。
主要修改两处:
1、Analys.cs中的查询语句,SPS2003的ContentDatabase中的sites表有Fullurl字段,而现在变为了PortalURL。
2、它原本的程序把spsitemanager_syntax.xml嵌入到程序集中,现在单独取出,只要相同目录就可以工作。这样,还可以通过它来查询命令参数。

其分析功能强大,从Virtual Server开始到SiteCollections、Site、Web、DocLib、Folder、List等。
它有点类似stsadm工具。
具体操作例如:spsitemanager -o analyze -url http://vsts01:8000/ -targeturl http://vsts01:8000/ -sdd vsts01_allvs_level_0_sdd.xml
具体的命令参数可以参考附件中的spsitemanager_syntax.xml文件。

SPSiteManager.rar

详细功能及源码请参考其官方blog:krichie

运行要求:机器必须安装了MOSS2007。

posted @ 2006-10-26 18:18 Chatterley 阅读(212) | 评论 (0)编辑
 
     摘要: 一个网站定义定义了一个种类型的SharePoint网站。安装了MOSS2007后,会在本地的目录C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates中放置各种网站定义模板。STS定义了Team Site(工作组站点),Blank Site(空站点), 以及 Doc... 阅读全文
posted @ 2006-10-26 10:43 Chatterley 阅读(1531) | 评论 (2)编辑
 

条款一
原话:当你需要考虑 不指向任何对象 的可能性时,或是考虑 在不同时间指向不同对象 的能力时,你就应该采用pointer。前一种情况你可以将 pointer设置为null,后一种情况你可以改变pointer所指对象。而当你确定 总是会代表某个对象,而且 一旦代表了该对象就不再能够改变,那么你应该选择reference。

考虑四种情况:
1、pointer:声明object*
2、const_pointer:声明const objcect*
3、reference:声明object&
4、const_reference:声明const objcet&

pointer,可以指向object对象,也可以指向从object继承的对象,只要是前面的对象都可以指向。
const_point,可以指向固定对象,一但指向了某个对象,它就不能够指向其他对象了,当然对象里面的变化,它不关心。reference和const_reference也是同样的道理。

很多人会问,那么pointer和reference有什么区别呢?
或许看起来没有什么区别,你就这么想吧,pointer到对象,是指向对象。而reference就是对象。这时候又有人问那么reference和直接声明的对象又有什么区别呢?看看下面的用法:
C#的程序员可能有以下幻想
object&  ro = new objcet ;//VC7.1下声明int& iValue=5;静态编译出现Error。
object  o = new object;
但事实上用法应该是这样的,因为在C++里的只能把new的对象给指针,例如object* po=new object。
object  o;
object&  ro = o;//
这个时候,他们没有什么区别,只不过是名字不同而已,一个为o,另一个为ro,这时候那个对象有两个名字。

这时候可能又会想那么const_refencence又是怎么回事啊,那就是它所指代的对象不能变化(和const_pointer的区别),即对象状态为const。
其实原本想划几个图来表示,那就可以更加直观了。可这个机子没工具,以后再补拉。





posted @ 2006-10-21 13:10 Chatterley 阅读(82) | 评论 (1)编辑
 

Google Web APIs service:Google提供给外界定制自己的服务。
首先,你必须得先到http://www.google.com/apis/去注册一个Account,并获取一个License Key。
其次,创建各种类型项目,进行web引用,其地址:http://api.google.com/GoogleSearch.wsdl
再次,编写你要定制的代码。
最后,显示的结果:

唯一可惜的是,一个帐户一天只能访问1000次。
源码:GoogleSearch.rar

posted @ 2006-10-20 16:15 Chatterley 阅读(118) | 评论 (0)编辑
 
好久没有看C++,最近又拿起买了几年的B.S的那本TCPL。我又提起了对C++的兴趣。然而,学习Boost库是学习C++领域里是不可缺少的步骤,至少我是这么认为的。所以我就Download了其1.33.1版本,发现安装有各种方法,但是对与VS2003,用下面的方法是比较便捷的,特别是对于要设置环境变量的那些方法。
下面是我安装Boost1.33.1库的过程:
首先安装VS2003和下载Boost1.33.1库我在这里就不多说了。那就开始按下面步骤执行:
1、打开控制台窗口,请使用vs2003在开始菜单中的“Visual Studio.net工具->Visual Studio.net  2003 命令提示”打开控制台,这样VC.net的的编译环境就设置好了。

2、假设boost安装包的解压的目录为{BOOSTDIR}中。
我的路径{BOOSTDIR}为C:\C++\Library\Boost_1_33_1
先编译出bjam.exe,它被用于安装boost库
cd {BOOSTDIR}\tools\build\jam_src
即:cd  C:\C++\Library\Boost_1_33_1\tools\build\jam_src
输入build.bat

3、利用编译出的bjam.exe程序编译并安装boost库
cd {BOOSTDIR}
即:cd  C:\C++\Library\Boost_1_33_1
用FileExplorer浏览到{BOOST_SRC}\tools\build\jam_src\bin.ntx86\bjam.exe(即:C:\......\bjam.exe)
用Ctrl+C 把路径Copy下来,也就是把C:\C++\Library\Boost_1_33_1\tools\build\jam_src\bin.ntx86\bjam.exe

4、输入C:\C++\Library\Boost_1_33_1\tools\build\jam_src\bin.ntx86\bjam "-sVC71_ROOT=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7" "-sTOOLS=vc-7_1"  "-sPYTHON_ROOT=D:\Program Files\Python24" "--prefix=C:\C++\librarys\boost" install

下面的命令的各选项的说明:
prefix    将boost安装到的路径(生成的头文件和库文件都会放到该路径中)。
重定义以下变量(利用-s设置,即Set):
VC71_ROOT  vc2003的安装路径,如果未将vc2003安装到默认位置,你必须指定该项。
TOOLS         使用的编译工具,vc2003对应的是vc-7_1(可以查看{BOOSTDIR}tools\build\v1下看是否有其对应文件,也就是在vc-7_1后多一个-tools.jam的文件(例如vc-7_1-tools.jam)。
PYTHON_ROOT        python的安装目录,如果未将BOOST安装到默认位置,你必须指定该项。
BUILD         编译结果选项,默认会生成尽可能多的版本,如调试版/发行版,静态库/动态库,单线程/多线程。
posted @ 2006-10-18 15:14 Chatterley 阅读(758) | 评论 (1)编辑
 

今天在用Microsoft.Web.UI.WebControls.TreeView中发现了这个bug。
递归过程是加载目录树,用递归的方法一层层加载目录。
我创建一个DataTable来递归:

using System;
using Microsoft.Web.UI.WebControls;
using System.Data;

namespace TestWeb
{
    
/// <summary>
    
/// Chapters 的摘要说明。
    
/// </summary>

    public class Chapters
    
{
        
private DataTable m_chapters;
        
        
public Chapters()
        
{
            
//
            
// TODO: 在此处添加构造函数逻辑
            
//
            m_chapters = LoadData();
        }


        
public DataTable LoadData()
        
{
            DataTable dt 
= new DataTable();
            dt.Columns.Add(
new DataColumn("ChapterID",typeof(System.Int32)));
            dt.Columns.Add(
new DataColumn("ChapterName",typeof(System.String)));
            dt.Columns.Add(
new DataColumn("ParentChapter",typeof(System.Int32)));

            DataRow dr 
= dt.NewRow();
            dr[
"ChapterID"= "1";
            dr[
"ChapterName"= "root";
            dr[
"ParentChapter"= "0";
            dt.Rows.Add(dr);

            dr 
= dt.NewRow();
            dr[
"ChapterID"= "2";
            dr[
"ChapterName"= "chapter1";
            dr[
"ParentChapter"= "1";
            dt.Rows.Add(dr);

            dr 
= dt.NewRow();
            dr[
"ChapterID"= "3";
            dr[
"ChapterName"= "chapter2";
            dr[
"ParentChapter"= "1";
            dt.Rows.Add(dr);
            
            
return dt;
        }


        
/// <summary>
        
/// 获取目录结构
        
/// </summary>
        
/// <param name="nodes">TreeView的节点集</param>

        public void InitTree(TreeNodeCollection nodes)
        
{
            
//获取根结点ID            
            int rootChapterID = 1;            
            
//获取根接点数据            
            TreeNode rootNode = new TreeNode();
            rootNode.Text 
= "Root";
            rootNode.ID 
= "1";
            nodes.Add(rootNode);

            InitTree(nodes[
0].Nodes,rootChapterID);
        }

        
/// <summary>
        
/// 获取目录结构
        
/// </summary>        
        
/// <param name="nodes">TreeView的节点集</param>