状态机实例

来源:互联网 发布:centos 挂载iso 编辑:程序博客网 时间:2024/05/16 10:14
def main():    html = '''<html><head>open source list</head><body><table border="1">'''        status = 0    fp = open('source_list.txt', 'r')    for line in fp:   #将每一行的状态对应起来        if status == 0:            if line.strip() == '':                continue            else:                html += '<tr><td>%s</td><td>'%line                status = 1        elif status == 1:            if line.startswith('http'):                html += '%s<br/>'%line            else:                html += '</td><td>%s<br/>'%line                status = 2        elif status == 2:            if line.strip() == '':                html += '</td></tr>'                status = 0            else:                html += '%s<br/>'%line    html += '</table></body></html>'    fp.close()    fout = open('index.htm', 'w')    fout.write(html)    fout.close()            if __name__ == '__main__':    main()

用状态来驱动行为,  事件驱动系统的模型

找到文本的规律,然后用状态的改变,来决定走到哪一步



001.SmartFrog
http://smartfrog.org/display/sf/SmartFrog+Home
SmartFrog是用于配置,部署和管理分布式软件系统的强大而灵活的基于Java的软件框架。
SmartFrog帮助你来封装和管理系统,使他们很容易配置和重新配置,并让他们可以自动安装,启动和关闭。它提供了业务流程的能力,使子系统可以启动(和停止)以正确的顺序。它还可以帮助您检测并从故障中恢复。

002.Ant
http://ant.apache.org/
Apache Ant是一个将软件编译、测试、部署等步骤联系在一起加以自动化的一个工具,大多用于Java环境中的软件开发。

003.axis
http://axis.apache.org/
ApacheAxis是一个开源、建基于XML的Web服务架构。它包含了Java和C++语言实现的SOAP服务器,以及各种公用服务及API以生成和部署Web服务应用。

004.dom4j
http://www.dom4j.org/
DOM4J是一个易于使用的,用于XML,XPath和XSLT使用Java集合框架在Java平台上,并与DOM,SAX和JAXP全面支持工作的开源库。

005.maven
http://maven.apache.org/
Apache Maven是一个软件项目管理工具。基于项目对象模型(POM)的概念,Maven的可以管理项目的构建、报告和文档。

006.OpenMeetings
http://openmeetings.apache.org/
Openmeetings提供视频会议,即时通讯,白板,协同文档编辑和使用的Red5流媒体服务器的远程处理和流媒体API函数等群件工具。

007.tomcat
http://tomcat.apache.org/
Apache Tomcat是一个实现了Java Servlet和JavaServer Pages技术的开源软件。

008.fastjson
Fastjson是一个json处理工具包,包括“序列化”和“反序列化”两部分,它具备如下特征:
1.速度最快,测试表明,fastjson具有极快的性能,超越任其他的java json parser。包括自称最快的jackson。
2.功能强大,完全支持java bean、集合、Map、日期、Enum,支持范型,支持自省。
3.无依赖,能够直接运行在Java SE 5.0以上版本
4.支持Android。
5.开源 (Apache 2.0)

009.jexcel
http://jexcelapi.sourceforge.net/
Java Excel API(JXL)是一个成熟,开源的用来操作Excel电子表格的Java类库,支持读取,修改,写入等操作。这个项目基于GPL发布,而且对中文有很好的支持。

010.commons
http://commons.apache.org/
The Commons is an Apache project focused on all aspects of reusable Java components.
Apache的工具库

011.easymock
http://easymock.org/
Easy mocking. Better testing.

012.poi
http://poi.apache.org/
Apache POI - the Java API for Microsoft Documents

013.jython
http://www.jython.org/
Python for the Java Platform

014.tomcat
http://tomcat.apache.org/
Apache *****************************8

015.struts2
http://struts.apache.org/development/2.x/
Apache Struts 2 is*************************8

016.spring
http://projects.**************
The Spring Framework provides a comprehensive programming and configuration model for modern Java-based enterprise applications - on any kind of deployment platform. A key element of Spring is infrastructural support at the application level: Spring focuses on the "plumbing" of enterprise applications so that teams can focus on application-level business logic, without unnecessary ties to specific deployment environments.



017.maven
http://maven.apache.org/
Apache *****************************8.

读取的文件信息



0 0
原创粉丝点击