2005年08月31日

  经过两天的努力,网站的框架已经建立起来了.剩下的工作就是代码的实现了.

  以下是网站中用到的类:

  Actin类:

  Action类都位于包com.osc.actions中.

  MDocument:网站文档的显示.

  MDownload:网站软件的显示.

  MIssue:新闻提交

  MLogOn:用户

  MLogOut:用户注消

  MNews:新闻列表

  MNewsDetail:新闻显示

  MProject:工程显示

  MRegist:用户注册

  MUpload:软件上传

  Bean类:

  MRole:用户简单信息

  MRoleDetail:用户详细信息

  MResource:总资源类的父类

  MText:文章类

  Monitor类:

  BeanMonitor:对Bean类进行监督

  这几天也把网站的美工做完了,虽然不怎么好看,不过总算说的过去,要是有谁愿意帮我再美化一下那就更好了.我的美工真是谁看谁想哭啊.唉....

  继续努力...把其它的部分都做完.

2005年08月30日

Full Gentoo Linux Download Mirrors

The following organizations provide a full source mirror of all files related to Gentoo Linux, including installation CDs, LiveCDs and GRP package sets.

Note: These mirrors are download mirrors. The rsync-mirrors listed here are not for individual use (i.e. emerge –sync) as that would download the full mirror instead of just the Portage tree.

North America:
OSU Open Source Lab (USA/http)
Adelie Linux (Canada)
Bishops University Computer Science Department (Canada/ftp)
Quebec Scientific Information Network (Canada/ftp)
ibiblio.org (USA/ftp)
ibiblio.org (USA/http)
rsync (USA/rsync)
gatech.edu (USA/ftp)
purdue.edu (USA/rsync)
Sandia National Labs (USA/ftp)
Indiana University (USA/ftp)
Seren Innovations (USA/http)
Seren Innovations (USA/rsync)
University of Wisconsin at Madison Chemistry Department (USA/http)
University of Wisconsin at Madison Chemistry Department (USA/ftp)
University of Colorado at Denver Linux Users Group (USA)
University of Colorado at Denver Linux Users Group (USA/ftp)
University of Colorado at Denver Linux Users Group (USA/rsync)
CCC Communications (USA)
CCC Communications (USA/ftp)
TDS Internet Services (USA)
TDS Internet Services (USA/ftp)
TDS Internet Services (USA/rsync)
NetNITCO Internet Services (USA)
NetNITCO Internet Services (USA/ftp)
Earth Surface Process Research Insti, Univ of Airzona (USA/http)
Rensselaer Polytechnic Institute (USA/http)
University of Notre Dame LUG (USA/ftp)
Arctic Network Mirrors (Canada/ftp)
Arctic Network Mirrors (Canada/http)
Open Systems at University of Florida (USA/ftp)
Llarian Networks (USA/http)
Llarian Networks (USA/ftp)
Binarycompass.org (USA/http)
Datapipe Managed Hosting (USA/http)
Datapipe Managed Hosting (USA/ftp)
CS Department at Lewis University (USA/http)
CS Department at Lewis University (USA/ftp)
CS Department at Lewis University (USA/rsync)
CS Department at Western Michigan University (USA/http)
Geographical Information Network of Alaska (USA/http)
Geographical Information Network of Alaska (USA/rsync)
Utah State University (USA/http)
Utah State University (USA/ftp)
Utah State University (USA/rsync)
LUG at Michigan Tech University (USA/ftp)
University of Mississippi (USA/http)
Argonne National Laboratory (USA/http)
Argonne National Laboratory (USA/ftp)
Argonne National Laboratory (USA/rsync)
Easynews NNTP Hosting (USA/http)
Easynews NNTP Hosting (USA/rsync)
University of Illinois-Urbana Champaign (USA/http)
University of Illinois-Urbana Champaign (USA/ftp)

South America:
Labroatory of System Administration (Brazil/http)
Labroatory of System Administration (Brazil/ftp)

Europe:
Inode (Austria)
Inode (Austria/ftp)
Vienna Univ. of Technology (Austria/http)
Vienna Univ. of Technology (Austria/ftp)
Vienna Univ. of Technology (Austria/rsync)
BELNET (Belgium)
BELNET (Belgium/ftp)
BELNET (Belgium/rsync)
ITD Network ISP (Bulgaria/ftp)
ITD Network ISP (Bulgaria/http)
Silicon Hill Mirror Site (Czech Republic/ftp)
Masaryk University Brno (Czech Republic/rsync)
Masaryk University Brno (Czech Republic/rsync)*
ftp.linux.ee (Estonia)
ftp.linux.ee (Estonia/ftp)
tut.fi (Finland)*
tut.fi (Finland/ftp)*
tut.fi (Finland/rsync)*
mir.zyrianes.net (France/http)
tu-clausthal.de (Germany/ftp)
rwth-aachen.de (Germany/ftp)
Ruhr-Universität Bochum (Germany)
Ruhr-Universität Bochum (Germany/ftp)
Ruhr-Universität Bochum (Germany/rsync)
Uni Erlangen-Nürnberg (Germany)
Uni Erlangen-Nürnberg (Germany/ftp)
Uni Erlangen-Nürnberg (Germany/ipv6 only)
Uni Erlangen-Nürnberg (Germany/ftp/ipv6 only)
Uni Muenster/JOIN (Germany/ftp)
Uni Muenster/JOIN (Germany/rsync)
Dresden University of Technology/AG DSN (Germany/ftp)
Westfaelische Wilhelms-Universitaet (Germany/ftp IPV4 & IPV6)*
Westfaelische Wilhelms-Universitaet (Germany/ftp IPV4)
Westfaelische Wilhelms-Universitaet (Germany/ftp IPV6)*
Technical University of Darmstadt (Germany/http)
Technical University of Darmstadt (Germany/rsync)
University of Applied Sciences, Esslingen (Germany/http)
University of Applied Sciences, Esslingen (Germany/ftp)
University of Applied Sciences, Esslingen (Germany/rsync)
Mesh Solutions Internet Service Provider (Germany/ftp)
Tiscali Internet Service Provider (Germany/http)
Tiscali Internet Service Provider (Germany/ftp)
Technical University Carolo-Wilhelmina (Germany/ftp)
files.gentoo.gr (Greece/ftp)
National Technical University of Athens (Greece/ftp)
National Technical University of Athens (Greece/http)
University of Ioannina (Greece/ftp)
Budapest University of Technology (Hungary/http)
ICD 2000 Ltd (Hungary/http)
Eotvos Lorand University (Hungary/http)
Eotvos Lorand University (Hungary/ftp)
RHnet (Iceland)
RHnet (Iceland/ftp)
RHnet (Iceland/rsync)
Ireland National Education and Research Network (Ireland/http)*
Ireland National Education and Research Network (Ireland/ftp)*
Hamakor FOSS Society (Israel/http)
Hamakor FOSS Society (Israel/rsync)
University of Padova (Italy)
University of Padova (Italy/rsync)
University Federico II of Naples (Italy)
Duomenu tiltas (Lithuania/ftp)
Universiteit Twente (Netherlands)
Universiteit Twente (Netherlands/ftp)
Universiteit Twente (Netherlands/rsync)
Universiteit Twente (Netherlands)*
Universiteit Twente (Netherlands/ftp)*
Universiteit Twente (Netherlands/rsync)*
Scarlet Internet (Netherlands/ftp)
Nutsbedrijven Maastricht n.v (Netherlands/ftp)
Gentoo.no / Gentoo.se (Norway/http)
Instituto Superior Técnico (Portugal)
Instituto Superior Técnico (Portugal/ftp)
Instituto Superior Técnico (Portugal/ftp)
Polish Gentoo (Poland/http)
Rzeszow University of Technology (Poland/rsync)
Rzeszow University of Technology (Poland/http)
Gdansk University of Technology (Poland/http)
Romanian Linux Users Group (Romania/ftp)
Romanian Linux Users Group (Romania/http)
Romanian Linux Users Group (Romania/rsync)
Romanian Education Network (Romania/http)
Romanian Education Network (Romania/ftp)
Gentoo.sk (Slovakia/http)
Aiya Mirror (Russia/http)
Aiya Mirror (Russia/ftp)
Aiya Mirror (Russia/rsync)
Citkit.ru (Russia/http)
Citkit.ru (Russia/ftp)
Catalan GNU/Linux User Group (Spain/http)
Catalan GNU/Linux User Group (Spain/ftp)
LinUV at Valencia University (Spain/http)
Hogskolan Dalarna, Dalarna (Sweden/ftp)
Hogskolan Dalarna, Dalarna (Sweden/http)
högskolan Trollhättan (Sweden/http)
Pudas mirror project (Sweden/http)
Pudas mirror project (Sweden/ftp)
SWITCHmirror (Switzerland/http)*
SWITCHmirror (Switzerland/ftp)*
SolNet (Switzerland/ftp)
SolNet (Switzerland/http)
Ankara University (Turkey/http)
Ankara University (Turkey/ftp)
Ankara University (Turkey/rsync)
Blueyonder ISP (UK/http)
Blueyonder ISP (UK/ftp)
The UK Mirror Service (UK/http)
The UK Mirror Service (UK/ftp)
The UK Mirror Service (UK/rsync)
University of Belgrade (Yugoslavia/http)
University of Belgrade (Yugoslavia/ftp)
University of Belgrade (Yugoslavia/rsync)

Australia:
PlanetMirror
PlanetMirror (ftp)
Pacific Internet
Pacific Internet (ftp)
Independent Services Providers (http)
Independent Services Providers (ftp)
Independent Services Providers (rsync)

Asia:
mirror.gentoo.gr.jp (Japan)
gg3.net (Japan)
gg3.net (Japan/ftp)
University of Tokyo (Japan/ftp)
ChannelX.biz (Japan/http)
gentoo.or.kr (South Korea)
KEMS-Zajil (Kuwait)
KEMS-Zajil (Kuwait/ftp)
linux.ntcu.net (Taiwan/rsync)
Tainan Educational Network Center (Taiwan/http)
SiamCellPhone Mirror (Thailand/http)
SiamCellPhone Mirror (Thailand/ftp)
I-Shou University (Taiwan/http)
I-Shou University (Taiwan/ftp)
Asian Open Source Centre (Malaysia/http)

Other Mirrors:
(worldwide ibiblio mirrors)

Mirroring Resources:
How to set up a Gentoo Linux rsync mirror
How to set up a Gentoo Linux source mirror

Note: * Supports IPv6

Partial Gentoo Linux Mirrors

The following organizations provide partial mirrors of Gentoo Linux, including source tarballs and snapshots of the Portage tree. These mirrors do not have copies of our installation CDs, LiveCDs or GRP package sets. Please see the above mirrors if you are looking for one of those items. Linux Kullanicilari Dernegi (Turkey/ftp)
Averse Mirror Service (Singapore/ftp)
Averse Mirror Service (Singapore/http)

2005年08月29日

前几天看了一些关于AJAX的一些资料,算是明白一点,所以写了一个关于AJAX的类,这样以后就可以不用再写那些重复的东西了,虽然网上有些写好的类库,不过我还是写了一个,这样可以学习一下javascrip。下面就来说说我写的这个类和用到的知识吧。

AJAXAsynchronous JavaScript Technology and XML应用这个技术就可以不刷新页面的情况下访问网络资源。这一切都是围绕XMLHttpRequest类来进行的,这个类由IE5.0以后的版本支持。这项技术最好的例子就是Google Map,有空的话可以去看看。

下面说明我写的类吧。

/************************************

 * MRequest is used to ajax.

 * CopyRight(R) Joshua.M.D

 * 2005/8/9 09:17 AM

 ************************************/

/* Mrequest类的构造函数。 */

function MRequest(){

       this._request=null; //XMLHttpRequest对象的引用

       this._url=null;  //要访问的网络资源

       this._callback=null; //回调函数

      

       this.setCallBack=_setCallBack;

       this.setURL=_setURL;

       this.translate=_translate;

       this.toString=_toString;

      

       _init(); 

}

/* 初始化_request,引用一个XMLHttpRequest对象 */

function _init(){

       if (window.XMLHttpRequest) {

        this._request = new XMLHttpRequest();

    } else if (window.ActiveXObject) {

        this._request = new ActiveXObject("Microsoft.XMLHTTP");

    } else{

           alert("Can’t init request!");

    }

}

 

function _setURL(url){

       this._url=url;

}

 

function _setCallBack(cb){

       this._callback=cb;

}

/* 开始数据传输 */

function _translate(){

       this._request.open("GET", this._url, true);

    this._request.onreadystatechange=_onTranslateComplete;

    this._request.send(null);

}

/* 数据传输完成后对数据进行解析 */

function _onTranslateComplete(){

       if(this._request.readyState==4){

              if(this._request.status==200){

                     this._callback();

              }else{

                     alert("Occur Error: the errno is:"+this._request.status);

              }

       }

}

 

function _toString(){

       return  "The request is: "+this._request+"\n"+

                     "The URL is: "+this._url+"\n"+

                     "The CallBack is:\n"+this._callback;

}

Mrequest的应用:在网站中只要引入Mrequest类后就可以应用了。

我们只用声明一个回调函数和一个网络资源(URL)就可以用了。

<script src="MRequest.js"></script>

<script type="text/javascript">

<!–//

      function cb(){

             alert("ok");

      }

      function t(){

             var req=new MRequest();

             req.setCallBack(cb);

             req.setURL(‘http://localhost:8080/’);

             req.translate();

      }

//–>

</script>

<input type="button" value="Click Me!" onClick="t()">

在本次编写过程中,只是将一些工作封装了一下,这样我们就可以只关心数据的处理而不用关心这些繁琐的代码。但是真正用的话还是应该用一些比较成型的系统,这只是一个例子而已。

一、概念

Martin Fowler的文章:Continuous Integration  中文翻译:持续集成

二、工具

传统工具:JBuilder,VisualSourceSafe,Rational ClearCase

自动编译工具:Ant

回归测试工具:JUnit

代码检查工具:CheckStyle

持续集成工具:CruiseControl

三、步骤

  • CruiseControl监控远程版本控制系统的变化

  • 变化发生时CruiseControl调用编译工具进行编译(Ant等)

  • 编译成功后调用JUnit进行回归测试

  • 编译成功后调用CheckStyle进行代码检查

  • 打包,部署,更新版本控制系统

  • 完毕后将编译结果、测试结果、代码检查结果发送至开发人员、主管经理,并发布至网站,甚至报警器

    所有这一切都是按照编制好的脚本自动进行的

四、实施示例

目前我们使用的是ClearCase,主控软件为CruiseControl,其脚本文件为cccc.xml

  • 配置远程版本控制系统

<modificationset quietperiod="60">

  <clearcase branch="main" viewpath="D:\cc_view\chelseafc\Nucleus2.0\Port" recursive="true" />

</modificationset>

  • 配置编译工具

<schedule interval="60">

  <ant antscript="C:\Java\JBuilder2005\thirdparty\ant\bin\ant.bat" buildfile="D:\cc_view\chelseafc\Nucleus2.0\Port\clearcase-build.xml" target="cleanbuild" multiple="1" />

</schedule>

  • 配置测试用例(在ant的配置文件中)

<target name="test" depends="init" description="Run unit tests">

  <delete dir="${junit.results}" />

  <mkdir dir="${junit.results}" />

  <junit fork="yes" haltonfailure="yes">

  <classpath refid="project.class.path" />

  <formatter type="plain" usefile="false" />

  <formatter type="xml" />

  <batchtest todir="${junit.results}">

  <fileset dir="${build.dir}" includes="**/*TestCase.class" />

  <fileset dir="${build.dir}" includes="**/*TestSuite.class" />

  </batchtest>

  </junit>

</target>

  • 配置报告形式

<publishers>

  <currentbuildstatuspublisher file="currentbuild.txt" />

  <htmlemail mailhost="mail.chelseafc.com.cn" returnaddress="workflow_engine@chelseafc.com.cn" subjectprefix="ContinuousIntegration:" buildresultsurl="http://chelsea:8044/cruisecontrol/buildresults" spamwhilebroken="true" xsldir="F:\software\Agile.Net\cruisecontrol-2.2\reporting\jsp\xsl" css="F:\software\Agile.Net\cruisecontrol-2.2\reporting\jsp\css\cruisecontrol.css" logdir="D:\Tomcat 4.1\webapps\cruisecontrol\samplelogs">

  <always address="chelsea@chelseafc.com.cn" />

  <always address="ajax@chelseafc.com.cn" />

  <map alias="chelsea" address="chelsea@chelseafc.com.cn" />

  </htmlemail>

  </publishers>

  • 其中CruiseControl暂时没有提供代码检查工具的支持,建议使用Ant来调用CheckStyle,示例如下(没有真正运行过):

<target name="web.checkstyle">

  <mkdir dir="${target.temp}/checkstyle" />

  <mkdir dir="${target.web}/checkstyle" />

  <taskdef resource="checkstyletask.properties">

  <classpath>

  <fileset dir="${support.tools}/checkstyle31" includes="**/*.jar"/>

  </classpath>

  </taskdef>

  <copy file="${support.tools}/checkstyle31/custom.xml" overwrite="true" tofile="${target.temp}/checkstyle/custom.xml">

  <filterset>

  <filter token="source.java" value="${basedir}/${source.java}" />

  <filter token="target.checkstyle" value="${basedir}/${target.temp}/checkstyle" />

  </filterset>

  </copy>

  <checkstyle config="${target.temp}/checkstyle/custom.xml" failOnViolation="false">

  <fileset dir="${source.java}/main" includes="**/*.java" />

  <formatter type="plain" />

  <formatter type="xml" toFile="${target.temp}/checkstyle/checkstyle_errors.xml" />

  </checkstyle>

  <style basedir="${target.temp}/checkstyle" destdir="${target.web}/checkstyle" includes="checkstyle_errors.xml" style="${support.tools}/checkstyle31/checkstyle-noframes.xsl" />

  </target>

  • 打包、部署(在ant的配置文件中)

<target name="jar">

<jar jarfile="${dist.dir}\nucleus_engine.jar">

  <fileset dir="${build.dir}" />

</jar>

<jar jarfile="../../M1/Web/lib/service_gateway.jar">

  <fileset dir="${build.dir}" />

</jar>

</target>

<target name="war">

  <ant antfile="build-war.xml" />

</target>

  • check out 版本控制工具中的配置项(在ant的配置文件中)

<target name="checkoutzipfile">

  <cccheckout viewpath="../Release/nucleus2.0.zip" reserved="true" branch="main" />

</target>

  • 压缩zip文件(在ant的配置文件中)

<target name="zip">

  <zip destfile="../Release/nucleus2.0.zip" basedir="../Release/nucleus2.0" />

</target>

  • check in 版本控制工具中的配置项(在ant的配置文件中)

<target name="checkinzipfile">

  <cccheckin viewpath="../Release/nucleus2.0.zip" identical="true" />

</target>

五、几点提示

  • CruiseControl会自动根据本地ClearCase的View监控远程VOB

  • 其实除了监控远程版本控制系统外其它的任务都可以由Ant来完成,CC只负责监控变化并调用Ant即可

  • CruiseControl2.2的<htmlemail>好像无法在jdk5.0下运行,如果需要集成jdk5.0的项目,则需要为Ant的<javac>指定source和target,而CruiseControl2.2依然用jdk1.4启动

  • 可以为cruisecontrol.bat加入启动参数“-port 8055”,这样可以用JMX(http://localhost:8055)来控制cc

  • 最好避免中文路径,否则就需要手工为几个Xml格式的文件,如cc的report Servlet的Web.xml等加入编码方式“<?xml version="1.0" encoding="UTF-8" ?>,或者将中文路径映射为虚拟硬盘:“subst Y: "D:\cc_view\chelsea\Platform\开发\Nucleus2.0\Source"”

  • 中文log无法正常显示时,需要设置CruiseControl配置文件中<log>元素的“encoding”属性,如:

    <log dir="D:\Tomcat 4.1\webapps\cruisecontrol\samplelogs" encoding="utf-8">

      <merge dir="D:\cc_view\chelseafc\Nucleus2.0\Port\test-results" />

    </log>

  • 编译失败后,在下次checkin之前,一般不需要重新编译,这时可设置<project >的“buildafterfailed”属性为false来避免重新编译

  • <htmlemail>的几个属性好像没有缺省设置,虽然文档里说从2.1.7开始有缺省设置,包括xsldir,css,logdir

  • 可使用JBuilder辅助生成ant文件

  • 各种工具的安装、使用,在各自的文档里都非常详细,网上亦有无数资源

六、参考资料

2005年08月26日
Asynchronous JavaScript Technology and XML (AJAX)
With Java 2 Platform, Enterprise Edition

By Greg Murray, June 9, 2005  


 

by Jesse James Garrett

February 18, 2005

If anything about current interaction design can be called “glamorous,” it’s creating Web applications. After all, when was the last time you heard someone rave about the interaction design of a product that wasn’t on the Web? (Okay, besides the iPod.) All the cool, innovative new projects are online.

Despite this, Web interaction designers can’t help but feel a little envious of our colleagues who create desktop software. Desktop applications have a richness and responsiveness that has seemed out of reach on the Web. The same simplicity that enabled the Web’s rapid proliferation also creates a gap between the experiences we can provide and the experiences users can get from a desktop application.

That gap is closing. Take a look at Google Suggest. Watch the way the suggested terms update as you type, almost instantly. Now look at Google Maps. Zoom in. Use your cursor to grab the map and scroll around a bit. Again, everything happens almost instantly, with no waiting for pages to reload.

Google Suggest and Google Maps are two examples of a new approach to web applications that we at Adaptive Path have been calling Ajax. The name is shorthand for Asynchronous JavaScript + XML, and it represents a fundamental shift in what’s possible on the Web.

Defining Ajax

Ajax isn’t a technology. It’s really several technologies, each flourishing in its own right, coming together in powerful new ways. Ajax incorporates:

The classic web application model works like this: Most user actions in the interface trigger an HTTP request back to a web server. The server does some processing — retrieving data, crunching numbers, talking to various legacy systems — and then returns an HTML page to the client. It’s a model adapted from the Web’s original use as a hypertext medium, but as fans of The Elements of User Experience know, what makes the Web good for hypertext doesn’t necessarily make it good for software applications.

Ajax Overview 1

Figure 1: The traditional model for web applications (left) compared to the Ajax model (right).

This approach makes a lot of technical sense, but it doesn’t make for a great user experience. While the server is doing its thing, what’s the user doing? That’s right, waiting. And at every step in a task, the user waits some more.

Obviously, if we were designing the Web from scratch for applications, we wouldn’t make users wait around. Once an interface is loaded, why should the user interaction come to a halt every time the application needs something from the server? In fact, why should the user see the application go to the server at all?

How Ajax is Different

An Ajax application eliminates the start-stop-start-stop nature of interaction on the Web by introducing an intermediary — an Ajax engine — between the user and the server. It seems like adding a layer to the application would make it less responsive, but the opposite is true.

Instead of loading a webpage, at the start of the session, the browser loads an Ajax engine — written in JavaScript and usually tucked away in a hidden frame. This engine is responsible for both rendering the interface the user sees and communicating with the server on the user’s behalf. The Ajax engine allows the user’s interaction with the application to happen asynchronously — independent of communication with the server. So the user is never staring at a blank browser window and an hourglass icon, waiting around for the server to do something.

Ajax Overview 2

Figure 2: The synchronous interaction pattern of a traditional web application (top) compared with the asynchronous pattern of an Ajax application (bottom).

Every user action that normally would generate an HTTP request takes the form of a JavaScript call to the Ajax engine instead. Any response to a user action that doesn’t require a trip back to the server — such as simple data validation, editing data in memory, and even some navigation — the engine handles on its own. If the engine needs something from the server in order to respond — if it’s submitting data for processing, loading additional interface code, or retrieving new data — the engine makes those requests asynchronously, usually using XML, without stalling a user’s interaction with the application.

Who’s Using Ajax

Google is making a huge investment in developing the Ajax approach. All of the major products Google has introduced over the last year — Orkut, Gmail, the latest beta version of Google Groups, Google Suggest, and Google Maps — are Ajax applications. (For more on the technical nuts and bolts of these Ajax implementations, check out these excellent analyses of Gmail, Google Suggest, and Google Maps.) Others are following suit: many of the features that people love in Flickr depend on Ajax, and Amazon’s A9.com search engine applies similar techniques.

These projects demonstrate that Ajax is not only technically sound, but also practical for real-world applications. This isn’t another technology that only works in a laboratory. And Ajax applications can be any size, from the very simple, single-function Google Suggest to the very complex and sophisticated Google Maps.

At Adaptive Path, we’ve been doing our own work with Ajax over the last several months, and we’re realizing we’ve only scratched the surface of the rich interaction and responsiveness that Ajax applications can provide. Ajax is an important development for Web applications, and its importance is only going to grow. And because there are so many developers out there who already know how to use these technologies, we expect to see many more organizations following Google’s lead in reaping the competitive advantage Ajax provides.

Moving Forward

The biggest challenges in creating Ajax applications are not technical. The core Ajax technologies are mature, stable, and well understood. Instead, the challenges are for the designers of these applications: to forget what we think we know about the limitations of the Web, and begin to imagine a wider, richer range of possibilities.

It’s going to be fun.

2005年08月24日

Gentoo Linux x86 Quick Install Guide

Sven Vermeulen  Author
Steven Wagner Author

Updated August 20, 2005

1. Quick Install Guide

Installation Media

Download a CD from one of our mirrors. You can find the ISOs in releases/<architecture>/<release>/installcd. The minimal installation CD is only useful for Internet-based installations; with the universal installation CD you can perform a network less installation as well.

Burn the CD and boot it. Press F2 at the boot screen to find out what boot options exist. Once booted, you need to start the pcmcia init script if you need PCMCIA support.

The installation CDs allow you to start an sshd server, add additional users, run irssi (a command-line chat client) and surf the web using lynx or links2.

Network Configuration

If your network does not work already, you can use net-setup to configure your network. You might need to load support for your network card using modprobe prior to the configuration. If you have ADSL, use adsl-setup and adsl-start. For PPTP support, first edit /etc/ppp/chap-secrets and /etc/ppp/options.pptp and then use pptp <server ip>.

For wireless access, use iwconfig to set the wireless parameters and then use either net-setup again or run ifconfig, dhcpcd and/or route manually.

If you are behind a proxy, do not forget to initialize your system using export http_proxy, ftp_proxy and RSYNC_PROXY.

Preparing the Disks

Use fdisk or cfdisk to create your partition layout. You need at least a swap partition (type 82) and one Linux partition (type 83).

Use mke2fs, mke2fs -j, mkreiserfs, mkfs.xfs and mkfs.jfs to create file systems on your Linux partitions. Initialize your swap partition using mkswap and swapon.

Mount the freshly created file systems on /mnt/gentoo. Create directories for the other mount points (like /mnt/gentoo/boot) if you need them.

Setting Up The Stage

First make sure your date is set correctly using date MMDDhhmmYYYY. Next, download a stage from one of our mirrors or use the one available on the installation CD (/mnt/cdrom/stages). Go to /mnt/gentoo and unpack the stage using tar -xvjpf <stage tarball>.

Install a Portage snapshot if you are performing a network less installation: go to /mnt/gentoo/usr and run tar -xvjf /mnt/cdrom/snapshots/<snapshot>. Other users can download a portage snapshot and install it likewise.

For a network less installation, copy over the source code files from /mnt/cdrom/distfiles/ to /mnt/gentoo/usr/portage/distfiles/.

Edit /mnt/gentoo/etc/make.conf to suit your needs (USE flag, CFLAGS and CXXFLAGS). You can use the nano editor for this.

Installing the Gentoo Base System

Mount the /proc file system first, copy over the /etc/resolv.conf file and then chroot into your Gentoo environment.


Code Listing 1.1: Preparing and chrooting

# mount -t proc none /mnt/gentoo/proc
# cp /etc/resolv.conf /mnt/gentoo/etc/
# chroot /mnt/gentoo /bin/bash
# env-update && source /etc/profile

If you are not running a network less installation, issue emerge –sync to update your Portage tree.

Next, make sure /etc/make.profile points to the right profile. The default one should suffice for most users; sub profiles are available for different kernels (like 2.4/ for 2.4-kernel based profiles). Change the profile using ln -sf.

  • Bootstrapping (not available for network less installations) happens using scripts/bootstrap.sh in the /usr/portage directory.
  • System installation (not available for network less installations) happens using emerge -e system (or -N if you haven’t altered the default CFLAGS/CXXFLAGS).

Kernel Configuration

Set your time zone information by changing the /etc/localtime symbolic link to the correct location in /usr/share/zoneinfo using ln -sf.

Install a kernel source (gentoo-sources and vanilla-sources are available for network less installations) and configure it using make menuconfig followed by make &&make modules_install inside /usr/src/linux. Copy the arch/i386/boot/bzImage file over to /boot. You can also emerge genkernel and use genkernel all.

Genkernel users will need to emerge coldplug and rc-update add coldplug default.

Configuring the System

Edit your /etc/fstab; an example follows:


Code Listing 1.2: Example fstab

/dev/hda1   /boot     ext2    defaults,noatime     1 2
/dev/hda2   none      swap    sw                   0 0
/dev/hda3   /         ext3    noatime              0 1
none        /proc     proc    defaults             0 0
none        /dev/shm  tmpfs   nodev,nosuid,noexec  0 0
/dev/cdroms/cdrom0    /mnt/cdrom    auto      noauto,user    0 0

Edit /etc/conf.d/hostname and /etc/conf.d/domainname, run rc-update add domainname default and edit /etc/conf.d/net to configure your network. Add the net.eth0 init script to the default run level. If you have multiple NICs, symlink them to the net.eth0 init script and add them to the default run level as well.

Edit /etc/hosts; examples are given below:


Code Listing 1.3: Example /etc/hosts

(For static IPs)
127.0.0.1     localhost
192.168.0.5   jenny.homenetwork jenny
192.168.0.6   benny.homenetwork benny
192.168.0.7   tux.homenetwork tux

(For a dynamic IP)
127.0.0.1     localhost.homenetwork tux localhost

Emerge pcmcia-cs and add it to the default run level if you need it.

Set the root password using passwd.

Set the necessary system configuration in /etc/rc.conf, /etc/conf.d/rc, /etc/conf.d/keymaps, /etc/conf.d/clock.

Installing System Tools

2.4 kernel users need to emerge –unmerge udev and emerge devfsd.

Install a system logger like syslog-ng and add it to the default run level. Do the same for a cron daemon like vixie-cron (optional).

Install the necessary file system tools (xfsprogs, reiserfsprogs or jfsutils) and networking tools (dhcpcd or rp-pppoe).

Configuring the Bootloader

Emerge grub or lilo. Edit /boot/grub/grub.conf or /etc/lilo.conf to your likings. Below you will find an example for each.


Code Listing 1.4: Example grub.conf

default 0
timeout 30
splashimage=(hd0,0)/grub/splash.xpm.gz

# genkernel users
title=Gentoo Linux 2.6.11-r3
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.11-gentoo-r3 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev
initrd /initramfs-genkernel-x86-2.6.11-gentoo-r3

# non-genkernel users (no initrd)
title=Gentoo Linux 2.6.11 r3
root (hd0,0)
kernel /kernel-2.6.11-gentoo-r3 root=/dev/hda3

# Only in case you want to dual-boot
title=Windows XP
root (hd0,5)
makeactive
chainloader +1


Code Listing 1.5: Example lilo.conf

boot=/dev/hda
prompt
timeout=50
default=gentoo

# For non-genkernel users
image=/boot/kernel-2.6.11-gentoo-r3
  label=gentoo
  read-only
  root=/dev/hda3

# For genkernel users
image=/boot/kernel-genkernel-x86-2.6.11-gentoo-r3
  label=gentoo
  read-only
  root=/dev/ram0
  append="init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev"
  initrd=/boot/initramfs-genkernel-x86-2.6.11-gentoo-r3

# For dual-booting
other=/dev/hda6
  label=windows

GRUB users need to install GRUB in the MBR using grub-install /dev/hda after copying /proc/mounts to /etc/mtab. LILO users need to run /sbin/lilo.

Exit the chrooted environment, unmount all file systems and reboot.

Finalizing the Installation

Log in as root, then add one or more users for day-to-day use using useradd -m -G <groups> <username>.

If you performed a network less installation, mount the packages CD at /mnt/cdrom and export PKGDIR="/mnt/cdrom" after which you can emerge -k <package> to install additional software like kde.

Thanks for installing Gentoo!


2005年08月23日
天蝎座2005年运程

事业运势:得心应手,颇有成就感天蝎座最佳的职业:警察,律师,补习班老师。

天蝎座的人对工作有权力欲望和野心,不爱说废话,也不爱交际应酬,是实干派,对人有一点冷漠,对工作上有厉害关系的人会保持距离,对于自己定下的目标会不择手段地去完成。

2005年对于天蝎们来说将会是一个充满机遇,有望发展的年份。天王星会一直以其正面的力量给予天蝎们非凡的灵感与创意。配合上半年土星的良好位置,天蝎们行事会相当稳重谨慎,在判断力上也颇为犀利独到,为其成功奠定了良好的基础。不过,下半年的时候,土星与海王星的负面因素将开始慢慢显现,天蝎们将逐渐感受到他们所带来的压力与困惑。

2005年对天蝎的上班一族来说可是颇有成就感的一年呢。在今年,天蝎们对于本职工作可谓得心应手。除了6、7月份需要特别注意一下,年内大部分的时间里,天蝎们都是可以较为轻松的胜任各项工作,并取得不错的业绩。

在2005年,天蝎的求职一族们有不错的求职运气,会较容易得到他人的支持,如自家长辈或是有一些较有能力的年长的朋友帮忙。尤其下半年更是得偿所愿。

感情运势:机会良多,要及时解决感情问题。

天蝎座对既定的目标视为生命的一部分,专情而誓死保护,不容别人批评,也强悍绝不妥协地坚持己爱,没有解释和商量的余地,爱恨分明。

卸下想耍小手段的心机,会让对方觉得更想依附你,未婚者被宴请的机会多,也在不知不觉中燃起爱的火花。如有暗恋的对象在2004年可因为你适度的表达,进而恋情明朗化。但是要特别注意你的热度一定要持续加温,不然恐怕会半途杀出程咬金,夺走所爱。所以在爱情方面最重要的工作是要筑起一个坚固且温馨的城堡,把对方层层包围,但千万别将对方视为禁□,否则只会增加反效果。已婚者需要注意你的伴侣会因你的难以沟通而大搞外遇,应即时的解决问题。属兔、猪、羊、狗者运气较好,爱情方面问题不大;属马、鼠、鸡、龙的朋友运气较差,需小心应战;其他生肖次之。

幸运花:芙蓉 幸运宝石:欧泊石

风水感情增运法:天蝎座的你要在西南方放置一面大型的镜子,并在镜子上方挂一个小香包,可以增加你的异性缘,让你把他电得麻麻的!而将一小袋盐包放在衣橱中,可除去恋爱时的种种阻碍。

爱的咒语:Ohm-skoh-ree-pay-ohs-ohm 当遇上困难,轻声诵读五次,并配合以下的愿望:“我愿意控制自己的情绪和坏脾气,让守护神以他的灵光启发我,带领我进入更深层的感情世界,了解爱情的奥妙。多谢法老。”

  【牡羊座(ARIES)03/21-04/19】

  ●张飞-牡羊座

  长阪坡上张飞据水断桥一声大喝,惊得曹军人仰马翻而退。展现牡羊座豪侠爽快、一马当先的精神。

【金牛座(TAURUS)04/20-05/20】

  ●董卓-金牛座

  董卓大权在握後到处收刮百姓,并在长安成外,别筑郿坞,藏尽天下金银财宝,俊男少女,与美人貂蝉共享荣华富贵,可说是个会享受的金牛座。

【双子座(GEMINI)05/21-06/21】

  ●杨修-双子座

  杨修,博学能文,才思过人,後因多言贾祸,被曹操以扰乱军心的罪名斩首。双子座善於言语也困於言语。

【巨蟹座(CANCER)06/22-07/22】

  ●曹植-巨蟹座

  曹植十岁时即能写出很漂亮的文章,才思敏捷,下笔成章。曹丕即帝後,忌其才华,欲杀曹植,但曹植七步成诗感动曹丕,展现了巨蟹座之亲情感人。

【狮子座(LEO)07/23-08/22】

  ●关公-狮子座

  过五关斩六将的关公说:「吾极知曹公待我厚,然吾受刘将军厚恩,誓以共死,不可背之。吾终不留,吾要当立效以报曹公乃去。显示狮子座光明磊落之作风。

【处女座(VIRGO)08/23-09/22】

  ●处女座-周瑜

  出身官宦之家,仪表英俊,聪颖过人,多谋略,为人器量狭小,阴狠刻毒,见诸葛亮比自己高明,便处处加以暗算。处女座多才多艺只是心胸不宽。

【天秤座(LIBRA)09/23-10/22】

  ●吕布-天平座

  吕布号称:"飞将军",三国时代最优秀的武将。一生有勇无谋,反覆无常,英雄气短,儿女情长。是天秤之优点也是缺点。

【天蝎座(SCORPIO)10/23-11/21】

  ●诸葛亮-天蝎座

  自比管仲乐毅,一生忠心辅佐刘备,精通阴阳五行,善能步罡踏斗,料敌如神,善於用计,是个标准的神秘兮兮天蝎座。

【射手座(SAGITTARIUS)11/22-12/21】

  ●华陀-人马座

  精通内科、儿科、妇科、针灸,用"麻沸散"使病人麻醉,施行剖腹手术,外号"神医"。後为曹操治病因尊重专业太过直言而被杀。人马座向来以医术和直爽见称於世。

【魔羯座(CAPRICORN)12/22-01/19】

  ●曹操-魔羯座

  从小聪明机警,有侠气。被人评为「治世之能臣,乱世之奸雄」,一生用人重才不重德,只求达到目的不择手段,是标准的魔羯座。

【水瓶座(AQUARIUS)01/22-02/18】

  ●庞统-宝瓶座

  号称凤雏,与诸葛亮齐名。其貌不扬,向曹操献连环计,成为赤壁之战的胜负关键。为一天才型之宝瓶座代表人物。

【双鱼座(PISCES)02/19-03/20】

  ●刘备-双鱼座

  这是对(三)中问题的一些思考。

  对于一个Bean来说,如果它含有对自己属于检验的函数,我就把它叫做可以自检的Bean,反之就称做非自检函数,非自检的函数就需要其它人(主要是Action)的监督。

  以一个Person类为例。

  public class Person{

            …

             private int age;

             public void setAge(int age){this.age=age;}

             public int getAge(){return this.age;}

             …

        }

  这个Bean中并没有任何检测,这样的Bean在应用中会出现很多问题,比如说一个人的年龄为负数,这显然是不合理的。但这个检测应该由谁来做呢?由Bean自己来做,还是由Action来做?

  这就是一个自检和监督的问题,我们应该更侧重哪一方面?

  我个人而言,我更侧重于监督,自检为了适应更广泛的应用,只能对Bean较少的,最基本的检测,而其它大部分的事情都应该由其它人来做。

对于每一个Action来说,都应在Monitor中对Action的监督条件进行说明,由Monitor来进行监督,Action将所有监督的职责交给Monitor

监督的好处:

1.    Bean来说,他只存储信息,对Action来说,他只处理业务逻辑,而其中的所有检测工作都交给了Monitor

2.    检测条件有时候会发生改变,对于不同的Action改变会有所不同,但是他们可能应用同一个Bean。在条件发生改变时,针对Action只改变Monitor中的检测即可。

3.    BeanAction都从数据检测中脱离出来,加强数据的整洁度。

个人想法,希望会对大家有用。