烦恼岁月

付出总是有回报的 take action follow your heart , or follow your head
posts - 40, comments - 5, trackbacks - 0, articles - 4

2009年8月10日

自动地可视化表示数据库也可以让您受益匪浅。实体关系图(ERD)是实现数据库可视化的最流行的图示类型。大多数创建 ERD 的工具(例如,ERWinfor)都需要手动生成 ERD。虽然我将要示范的工具 SchemaSpy 无法与现存的一些更复杂的工具媲美,但是它能够提供数据库的高级 ERD 视图 — 以及约束、关系等。而且,通过自动构建来运行它,您就可以轻松地从您的版本控制库中检查数据定义语言(Data Definition Language,DDL)的最新显示。

Ant 脚本使用 SchemaSpy 工具来创建 Javadoc 格式的文件:

结合使用 SchemaSpy、Ant 和 Javadoc

<property name="reports.dir" value="${basedir}"/>
<java jar="schemaSpy_3.1.1.jar"
  output="${reports.dir}/output.log"
  error="${reports.dir}/error.log"
  fork="true">
  <arg line="-t mysql"/>
  <arg line="-host localhost"/>
  <arg line="-port 3306"/>
  <arg line="-db brewery"/>
  <arg line="-u root"/>
  <arg line="-p sa"/>
  <arg line="-cp mysql-connector-java-5.0.5-bin.jar"/>
  <arg line="-o ${reports.dir}"/>
</java>

 

使用 java Ant 任务调用 SchemaSpy,传递了很多属性:

  • -t 为数据库类型(有效值为 mysqloradb2,等等。)
  • -host 为托管数据库的计算机名。
  • -port 为数据库 URL 的端口数。
  • -u 为数据库用户名。
  • -p 为数据库密码。
  • -cp 为类路径(用于指示数据库驱动程序 JAR 文件的位置)。
  • -o 为输出目录的位置。

这些 SchemaSpy 的命令行属性用于生成显示 ERD 的 HTML 文件

通过结合使用多种工具、作为构建的一部分针对数据库执行 ERD 生成脚本,并调度 ERD 生成,您就可以在开发过程中轻松、快速地做出很多数据库决策。

另外,对于喜欢maven的同学,SchemaSpy  也提供了plugin

http://maven.wakaleo.com/mojo/maven-schemaspy-plugin/faq.html

posted @ 2010-05-16 16:16 不需要解释 阅读(512) | 评论 (0)编辑 收藏

     参加工作也已经5年多了,一直想回头回想一下自己,然后动笔写下来,一来是自己目前还可以记忆起一些事情,等自己将来老了,可以看看这些东西回忆回忆。二来也是想做一个总结。本来这个题目也可以叫做我的bmi5年,不过大家知道bmi的实在是少,而且现在这个公司已经名义上不存在了。

     我是在2001年去沈阳读书的,一直也是很喜欢沈阳的气候和东北人的豪爽,东北爷们是真正可以拿心和你交朋友的,不过我实在不喜欢东北的饮食,觉得不细腻,另外南方还有我的女人在等我回去,要女人来东北,难度不是一般的大,所以在找工作的时候,我就下定决心一定要找南方的公司,最好广州,深圳的,或者老家南昌的也是可以的。但是南方公司去东北招生的实在是少,除了华为,中兴之外真的是少的可怜,尽管我们学校在沈阳也是数一数二的学校。

     在04年在10月份,我面试的第一家公司是东软,没有办法,谁让我们学校是东软的最大股东尼(不知道现在是不是),面试的过程也还不错,考试题也做的很顺,东软还提出我们下学期直接找一些外教来教我们日文,不过当时东软给出的薪水实在是低的可怜,只有1800元,而且还要自己负责住宿,自己当时也老大不小了,还有女人在读书,是不是也是需要买些礼物的,而且沈阳和大连都不是我想去的地方,结果就直接没有去报道。

     接下来的日子也就整天在校内的招聘网站(白山黑水)上看帖子,看到了上海bmi的招聘广告,一看是上海的公司,而且做的是辽宁网通的项目,感觉项目很大,可以学到不少东西,关键是上海的公司,项目做完了就可以去上海发展呢,而且当时女朋友也还在读研究生,仔细的想想觉得这个公司还是比较适合自己,于是也开始做准备,接下来的事情都很顺利,笔试,面试,当时有资格参加面试的,整个我们学校也就2个人,一个本科生,一个研究生,不过最后那个研究生也没有过去。

     在辽宁项目的前期这段时间,估计也会我成长最快,也是最艰苦的时间,我后续的会详细介绍到。我第一天上班就是去做release,也就是做发布和部署,在当时的项目中,我们并没有像一些公司还有项目配置员这个角色,就是直接拉一个开发人员来负责做release,这个角色当时是在项目中最辛苦的一个,经常是下午6点开始,然后编译3-4个小时,到10点才可以编译完成(比较顺利的情况下),如果遇到编译不过去的时候,还需要联系开发人员进行修改,编译之后在对照check list进行增量部署。

    在第一天上班,我就从上午10点过去,第2天凌晨3点半才下班,到4点才到学校宿舍睡觉,后续的1个月都是如此,现在回想起来,感觉当时真的是很辛苦,不过那段时间也开始熟习了不少东西,知道了基于模块开发,对ant,weblogic,oracle,plsql,linux,aix等的使用也开始非常熟习了。在这段时间里也开始熟习了公司的项目情况,开发人员,测试人员。

posted @ 2010-05-04 00:06 不需要解释 阅读(287) | 评论 (0)编辑 收藏

    最近在看一些项目的代码,总是发现很少项目提供出uml图,或者就是提供uml图的也有可能并没有和代码对应上,如果有正确的uml图,可以非常方便的为大家更好的理解代码层次逻辑。其实我们可以使用使用UMLGraph来生成uml图,直接使用java代码来生成UMLGraph。对于大部分项目来说,我们一般使用maven和ant(还在使用ant,你out了)来作为项目的编译工具。

    在maven中,我们可以在pom.xml增加:

    <reporting>
        <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.6.1</version>
        <configuration>
          <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
          <!-- <docletPath>/path/to/UmlGraph.jar</docletPath> -->
          <docletArtifact>
            <groupId>org.umlgraph</groupId>
            <artifactId>doclet</artifactId>
            <version>5.1</version>
          </docletArtifact>
          <additionalparam>-views</additionalparam>
          <useStandardDocletOptions>true</useStandardDocletOptions>
        </configuration>
        </plugin>
        </plugins>
    </reporting>

使用javadoc:aggregate 就可以生成出整个项目按照package的uml图了。

如果是使用ant,在build.xml中增加target

   <target name="genuml">
        <property name="uml.dir" value="${basedir}/uml"/>
        <property name="src.uml.dir" value="${src.dir}/uml"/>
        <mkdir dir="${uml.dir}"/>
        <path id="uml.source.path">
           <pathelement path="${src.uml.dir}/"/>
           <pathelement path="${src.java.dir}"/>
        </path>
        <javadoc sourcepathref="uml.source.path" packagenames="*" package="true">
           <doclet name="org.umlgraph.doclet.UmlGraph" path="${basedir}/lib/UmlGraph.jar">
               <param name="-d" value="${uml.dir}"/>
           </doclet>
        </javadoc>
        <apply executable="dot" dest="${uml.dir}" parallel="false">
            <arg value="-Tpng"/>
            <arg value="-o"/>
            <targetfile/>
            <srcfile/>
            <fileset dir="${uml.dir}" includes="*.dot"/>
            <mapper type="glob" from="*.dot" to="*.png"/>
        </apply>
    </target>

注意:要正常使用 UMLGraph,您必须先安装 Graphviz 工具,请自己google相关信息。

posted @ 2010-04-19 23:59 不需要解释 阅读(1858) | 评论 (0)编辑 收藏

       尽管工作了5年多了,现在能想起来的培训真的是少之又少,但是我想以后,我一定不会这样说了,因为我参加了百支了!

       百支对于我来说是一次清洗,洗掉以前的恶习,洗掉以前的老思维,重新培养我丢掉已久的价值观,重新找回往日的激情。来阿里之后,也一直在想一个问题,阿里和我以前公司有什么不同?或者说有什么特别的之处?其实这个问题有很简单,就是阿里是一家有梦想的公司,一家有价值观的公司,一家有亲情,友情的公司,一家工作生活一体的公司,从中国来看,阿里是唯一一家大的公司,而且价值体系贯彻的这么好的公司,only one in china。

      百支培训了很多业务知识,传统线,虚拟线,兄弟线,安全线,资金线,…学到了很多东西。

      百支的培训,让我开始结识了新的同学,新的家人,新的伙伴,让我们happly every day! 认真工作,快乐生活!

posted @ 2010-04-16 21:48 不需要解释 阅读(399) | 评论 (0)编辑 收藏

   随着网络技术的发展,很多恶意程序往往按照常规方法无法彻底删除。有没有什么方法能够在不安装任何第三方工具的情况下,删除它们呢?笔者经过多年实践,告诉大家一个秘密武器--关闭Explorer进程法。

  在服务器系统出现问题时,例如某个文件无法删除,某个程序假死或者是系统没有响应都可以按CTRL+SHIFT+ESC,调出Windows任务管理器。接下来找到“进程”标签,将“explorer.exe”进程关闭。接下来整个桌面就会消失,只剩下桌布了。然后通过Windows任务管理器的“文件”菜单下的“新建任务(运行)”打开“创建新任务”窗口,通过“浏览”按钮找到要删除文件所在目录,在浏览窗口里直接删除即可。99%都可以将这个顽固的文件删除,删除后继续选择“文件”菜单下的“新建任务(运行)”打开“创建新任务”窗口,在打开处输入命令--explorer后回车,我们将返回到正常的桌面界面下。显然,对付顽固文件,这个方法尤为简单。

posted @ 2009-11-10 16:19 不需要解释 阅读(217) | 评论 (0)编辑 收藏

    1、专注于构建一个强有力的团队,这一团队能够解决困难的问题,并为客户创造真正的价值。
  2、领导者鼓舞;管理者授权。要同时成为优秀的领导者和管理者,你需要就愿景进行沟通并理解其细节。
  3、对可能出现的障碍有所准备,防微杜渐,在这些障碍尚未壮大时就清除它们。
  4、花时间来仔细倾听别人的意见,但不要过于担心其他人的想法。
  5、专注于事实。
  6、充当一个衰减器,而不是放大器,为团队提供稳定性。
  7、永远不要将不能解释的事情归咎为蓄意破坏。
  8、培养幽默意识来作为严肃认真的一种平衡:对工作一丝不苟,对自己轻松自如。
  9、除了工作,还应该懂得享受生活,而且每年要读25本书。
  10、相信你的直觉:如果你感觉不妙,那么很可能预感就会成真。

posted @ 2009-11-08 03:10 不需要解释 阅读(213) | 评论 (0)编辑 收藏

Productize software

When talking about the productized software, people often think of Microsoft Office and Microsoft XP. Of course the Microsoft product series is very successful. They can provide excellent GUI, and good user experience.

In China, there is a different picture for software products. Let me take Chinese software development companies for example. Most of the companies in China work on some projects, instead of specific products, When a company starts a new project, they need to invest lots of developers and money into the project. Sometimes, they also need to send a number of technicians to the customer site to do the development. In my opinion, there are two reasons.

(1) The software is not very satisfactory enough to be a perfect product.

(2) Chinese customers have lots of special requirements.

Customer is GOD. We can not change the ideas of customer most of time. So, we need to improve our product. Then how to evaluate a software product's success? Because of various concerns, different users hold different opinions and will arrive at different conclusions.

As for redevelopment and customization, the following should be more concerned:

(1) Software scaffolding

If the product provides scaffolding, the redevelopment people will quickly generate code (from database, UML, etc….). As we know, the Spring, Hibernate also provide some scaffolding.

(2) Easy installation package

Most of time, the installation gives the first impression to the customer. So it is very important.

A simple installation must ensure everyone, even someone not very familiar with the application, can install the software.

The installation log file also plays significant role. Sometimes, it’s possible for the customer’s environment to have some problem so that the installation runs unsuccessfully. In this situation, the customer can send the log file to the technicians for analysis.

People who do not know about your product also can install easily according to wizard.

(3) Lots of Examples

The examples are the best teacher. Why most of java developer favor apache ant? The reason is that apache ant can provide lots of examples; you can find any task example in apache ant web site.

Example not only provides assistance to the development but also the product redevelopment If your product provides lost of examples, the questions from customers will be reduced substantially.

(4) Online documentation

If the developer can find some on-line document, he will not worry about that the document in his hands is an old version. And of course, the product developer also can work more effectively. For example, if the document has some error, or need to be modified, he can fix it quickly.

(5) Very good support

If the customer has some problem when he use or customize, he can get easily the support.

As for end-users, the following is very important.

(1) Friendly GUI, operator easily

(2) Collection client information online active, when some error happen.

(3) Auto-update to new version.

For customer, he does not need install some patch.

(4) In a conspicuous place clearly marked version of the software, and contact method

As for a kernel developer, he might think we need to provide:

(1) OSGI framework or plug-in framework to facilitate the expansion

(2) Standard software delivery process

(3) Software quality control

(4) A very good suite of documents.

posted @ 2009-11-02 11:26 不需要解释 阅读(288) | 评论 (0)编辑 收藏

Repositories are remote collections of projects from which Maven uses to populate the local repository of the build system. It is from this local repository that Maven calls it plugins and dependencies. Different remote repositories may contain different projects, and under the active profile they may be searched for a matching release or snapshot artifact.

Example A.8. Repository Configuration in settings.xml

<settings xmlns="http://maven.apache.org/POM/4.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">
  ...
  <profiles>
    <profile>
      ...
      <repositories>
        <repository>
          <id>codehausSnapshots</id>
          <name>Codehaus Snapshots</name>
          <releases>
            <enabled>false</enabled>
            <updatePolicy>always</updatePolicy>
            <checksumPolicy>warn</checksumPolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>never</updatePolicy>
            <checksumPolicy>fail</checksumPolicy>
          </snapshots>
          <url>http://snapshots.maven.codehaus.org/maven2</url>
          <layout>default</layout>
        </repository>
      </repositories>
      <pluginRepositories>
        ...
      </pluginRepositories>
      ...
    </profile>
  </profiles>
  ...
</settings>
releases, snapshots

These are the policies for each type of artifact, Release or snapshot. With these two sets, a POM has the power to alter the policies for each type independent of the other within a single repository. For example, one may decide to enable only snapshot downloads, possibly for development purposes.

enabled

true or false for whether this repository is enabled for the respective type (releases or snapshots).

updatePolicy

This element specifies how often updates should attempt to occur. Maven will compare the local POMs timestamp to the remote. The choices are: always, daily (default), interval:X (where X is an integer in minutes) or never.

checksumPolicy

When Maven deploys files to the repository, it also deploys corresponding checksum files. Your options are to ignore, fail, or warn on missing or incorrect checksums.

layout

In the above description of repositories, it was mentioned that they all follow a common layout. This is mostly correct. Maven 2 has a default layout for its repositories; however, Maven 1.x had a different layout. Use this element to specify which if it is default or legacy. If you are upgrading from Maven 1 to Maven 2, and you want to use the same repository which was used in your Maven 1 build, list the layout as legacy

posted @ 2009-11-02 11:25 不需要解释 阅读(1978) | 评论 (0)编辑 收藏

there are lots tools about the java obfuscate. I know two.

(1)proguard

(2)yguard

the proguard support ant, maven. I use maven as the project and build tools. so I want use the maven proguard plugin, but It is not easy to use. so I use yguard.

in your pom.xml, you can  add:

    <plugin>
            <groupId>net.sf.mgp</groupId>
            <artifactId>maven-unclasses-plugin</artifactId>
            <version>0.0.2</version>
        </plugin>
        <plugin>
  <artifactId>maven-antrun-plugin</artifactId>
  <dependencies>
    <dependency>
      <groupId>yguard</groupId>
      <artifactId>yguard</artifactId>
      <version>2.3.0</version>
      <scope>system</scope>
      <systemPath>lib/yguard.jar</systemPath>
    </dependency>
  </dependencies>
  <executions>
    <execution>
      <phase>package</phase>
      <configuration>
        <tasks>
          <property refid="maven.compile.classpath"
            name="mvn.classpath"></property>
          <!-- <echo message="Using Maven Classpath: ${mvn.classpath}" /> -->
          <taskdef name="yguard"
            classname="com.yworks.yguard.YGuardTask"/>
          <yguard>
            <!-- Input file and output file is the same. -->
            <inoutpair
              in="${project.build.directory}/${project.build.finalName}.${project.packaging}"
              out="${project.build.directory}/${project.build.finalName}.jar"/>
            <!-- Obfuscate classes plus string references. -->
            <rename
              logfile="${project.build.directory}/yguard.log.xml"
              replaceClassNameStrings="true">
              <!-- Keep the only class to be used for easy running and its public method main(). -->
              <keep>
                  <class classes="public" methods="public">
                  <patternset>
                    <include name=”xx.xxx.xxx.util.ConnectionUtil"/>
                  </patternset>
                </class>
              </keep>
            </rename>
            <!-- There are some external libraries used - Maven knows details. -->
            <externalclasses>
              <pathelement path="${mvn.classpath}"/>
            </externalclasses>
          </yguard>
        </tasks>
      </configuration>
      <goals>
        <goal>run</goal>
      </goals>
    </execution>
  </executions>
</plugin>


It is very cool!!!.

posted @ 2009-10-19 00:50 不需要解释 阅读(757) | 评论 (0)编辑 收藏

有个大师说过一句话,有人的地方就有江湖,有江湖的地方就有斗争。今天在java eys就看到了一场Resourcebundle引起的口角,集体见:

http://www.javaeye.com/topic/6417?page=1.

这个问题在jdk1.6已经不存在

clearCache
public static final void clearCache()
Removes all resource bundles from the cache that have been loaded using the caller's class loader.
Since:
1.6
See Also:
ResourceBundle.Control.getTimeToLive(String,Locale)

clearCache
public static final void clearCache(ClassLoader loader)
Removes all resource bundles from the cache that have been loaded using the given class loader.
Parameters:
loader - the class loader
Throws:
NullPointerException - if loader is null
Since:
1.6
See Also:
ResourceBundle.Control.getTimeToLive(String,Locale)

 

在1.5,1.4怎么办呢:

   Class klass = ResourceBundle.getBundle("your.Bundle").getClass().getSuperclass();
   Field field = klass.getDeclaredField("cacheList");
   field.setAccessible(true);
   sun.misc.SoftCache cache = (sun.misc.SoftCache)field.get(null);
   cache.clear();
   field.setAccessible(false);

这样就可以清楚cache.

posted @ 2009-10-17 17:23 不需要解释 阅读(324) | 评论 (0)编辑 收藏

Build in properties
  • ${basedir} represents the directory containing pom.xml
  • ${version} equivalent to ${project.version} or ${pom.version}
Pom/Project properties

All elements in the pom.xml, can be referenced with the project. prefix or using pom. as prefix. This list is just an example of some commonly used elements.

  • ${project.build.directory} results in the path to your "target" dir, this is the same as ${pom.project.build.directory}
  • ${project.build.outputDirectory} results in the path to your "target/classes" dir
  • ${project.name} or ${pom.name} refers to the name of the project.
  • ${project.version} or ${pom.version} refers to the version of the project.
  • ${project.build.finalName} refers to the final name of the file created when the built project is packaged
Local user settings

Similarly, values in the user's settings.xml can be referenced using property names with settings. prefix.

  • ${settings.localRepository} refers to the path of the user's local repository.
  • ${maven.repo.local} also works for backward compatibility with maven1 ??
Environment variables

Environment variables can be referenced using the env prefix

  • ${env.M2_HOME} returns the Maven2 installation path.
  • ${java.home} specifies the path to the current JRE_HOME environment use with relative paths to get for example:
    <jvm>${java.home}../bin/java.exe</jvm>
    Java system properties

All Java System Properties defined by the JVM.

Custom properties in the POM

User defined properties in the pom.xml.

<project>
...
  <properties>
     <my.filter.value>hello</my.filter.value>
  </properties>
...
</project>
  • ${my.filter.value} will result in hello if you inserted the above XML fragment in your pom.xml
Parent Project variables

How can parent project variables be accessed?

You can use the prefix: ${parent.project}.

For example, use ${parent.project.version} to retrieve parent version.

A good way to determine possible variables is to have a look directly at the API. The above example was not working for me, maybe it was working that way with older releases of maven. I'm currently using Maven 2.2.1, and to access the Parent you can use ${project.parent}. This will return an org.apache.maven.project.MavenProject instance.

Reflection Properties

The pattern ${someX.someY.someZ} can simply sometimes mean getSomeX().getSomeY().getSomeZ(). Thus, properties such as ${project.build.directory} is translated to getProject().getBuild().getDirectory().

posted @ 2009-10-11 23:01 不需要解释 阅读(1421) | 评论 (0)编辑 收藏

今天是伟大的甘地的生日,刚好在印度出差也就享受了一天假期,不过如果我在国内的话今天也是不上班了,因为今天是伟大祖国生日的第2天。

今天继续在搞weblogic和jetty的调试,发现一个问题,weblogic会对response中的内容trim,jetty不会。估计是ebos中有一段代码在response的out里面写了一些空白进去,导致这个内容到client端的时候就会解析不对。obj.responseXML会是空。

另外,Fiddler是监控网络连接的,一般的话它会监控有线的那个,我在酒店是使用无线上网,所以一开始找不到原因还以为是fiddler不支持无线方式的监控,查看了一下配置才发现问题。

最后实在没有办法直接写死,好在我做的只是一个开发辅助工具,不需要考虑性能影响:

var xmlData = obj.responseText.trim();
//alert(xmlData);
obj.responseXML.loadXML(xmlData);

明天继续完善程序,争取在这个假期完成之前能完成大体,后续文档补充。也算是功德一件了。

posted @ 2009-10-03 03:31 不需要解释 阅读(251) | 评论 (0)编辑 收藏

     出国有很多好处也有很多坏处,这里就说一处好处,就是可以为自己的历史课好好的补一补了。历史以成败论英雄,当权者一般都会去篡改历史的,不过在长久看来,大家都不过是历史的一粒沙尘,是无法改变历史的,人只能创造历史,无法修改历史。在中国内地的当代史就是一部篡改的历史,所以这次出国就好好的补了补,在国外很多网站都可以访问,使用google可以查任何你想要查的东西,不会过滤掉一些关键的信息。

      下面我就来说说我对近代一些人物的再认识吧:

     先说蒋先生,其实这个人的功劳应该是很大的,我个人觉得比先祖的功劳要大,毕竟统一了中国,而且在台湾也实现了一定程度的民主。尤其的是在8年抗战的历史上更是不能抹去的功绩,历史应该给蒋先生一个公道。

     张学良,这个人的爱国程度超出我原来的影响,以前的历史书上也是说张学良是千古功臣,但是说的很含糊,尤其是在D的丰功伟绩下显得不是伟大,张学良这个人不仅仅是爱国,而且这个人的心胸非常的大,他让蒋先生关了后半辈子,看采访他的是很,他也只是一笑而过,当然这个或者是他后来是基督教有关。

     蒋夫人,不愧是中国的第一夫人,如果有人问我中国的第一夫人是谁?很茫然,是胡夫人吗?她做了一些啥?看看人家蒋夫人在抗战时候做的事情,抗战后方支援,美国国会演讲,国际场合的外交,真的不愧是第一夫人,不过对这个,我了当代历史说的就更加的少了。

    毛太祖,看他在建国后的人大会议上,俨然就是一个皇帝,虽然他本人非常的亲民,而且一直也是爱民如子,不过他错过了历史给他的机会,如果他能学一下华盛顿,为中国留下一个比较完善的制度,我看今天的中国应该会更加富强了。非常可惜,强人政治的时候没有推进民主,在后强人政治就只是剩下了利益斗争了。

    周公,周公年轻的时候非常有才华,非常懂得协调各方的关系,不过可能是太陶醉在协调者的角色上面,导致后期严重的边缘化,他参加革命不必太祖晚,而且有很长一段时间地位还比毛祖高。后来的边缘化导致不得不为了自保,手举红皮书,高喊毛主席万岁来自保,甚至自己的养女,自己的第一任女朋友都眼睁睁的看着他们迫害致死,其下场可想而知。

    今天看一段网上录像,说小平同志还跟过冯玉祥。历史课本上貌似没有这个。

posted @ 2009-09-27 02:08 不需要解释 阅读(443) | 评论 (0)编辑 收藏

     大概在4年前,我还在沈阳做辽宁网通的boss项目,那个时候系统刚刚上线,问题成堆,尤其是一些单子由于程序或者是数据问题,出现异常,出现异常就必须去更正数据,让单子继续走下去。那个时候公司有个强人,使用Python来做这个事情,说白了也是比较简单,就是使用Python调用server端得ejb,修改数据然后提交到server上去。不过在那个时候懂一门动态语言在我看来非常的不简单。

      goon,最近闲的无事,把同事的一个程序拿过来修改了一下,大概也是实现了这样的一个逻辑,不过没有使用Python,or Jython,使用的是java 程序员都很熟悉的Beanshell 语言来写,并添加上了SWT,作为ui。这样对公司大部分人就没有什么难度了,直接可以写java代码,而且没有Jython那样格式的严格要求(很烦人)。

    先上一下图:

image

结果后台配置,就可以直接修改,查看server上的数据,如果有问题的单子还可以通过这个来修改,非常cool。

怎么做到这点呢:

(1)通过java调用beanshell的方法,init 一个init.bsh, 在这个bsh里面写上你自己的逻辑,比如lookup ejb,写好一些方法,这样使用者就直接可以调用了。

(2)把一些服务器的配置写到配置文件里面去。

如果修扩展,也很简单,直接修改一下配置文件,添加一些jar 并在init.bsh里面添加自己的逻辑就可以了。

posted @ 2009-09-23 23:42 不需要解释 阅读(351) | 评论 (0)编辑 收藏

    昨天晚上就抵达了india的hyderabad,一个发展中的城市,在这个城市你可以看到90年代在珠三角的样子,所以至少来讲,india还是落后中国20年,当然我们中国也是和谐的比较厉害,这个我们还是需要承认的。

   到酒店一看,才知道原来这样的地方也敢叫hotel,真是人有多大胆地就有多大产!不服不行啊。从公路上来看india的话,小车和bus比较多,当然更多的是那个三轮摩托他们叫auto,想多的多,而且有一些还是2个人开,非常好奇的是难道一个车还要2个人合伙?更奇怪的是india的bus的门貌似都不关,不管是school bus还是company bus,都一样不关门,开的飞快。也不知道他们的车做门做啥。可惜的是,这次出来没有带照相机,要不照照给大家看看。

   吉隆坡还是一个非常漂亮的city,如果坐飞机去这个城市的话,晚上到,飞机回经过kul的上空,你可以看这个city的全景,可以看双子塔,当然和上海市没有的比。

   早上睡不着觉,就很早起来了,通过老板娘专线和老板娘通了电话叫车,就下楼等车去了,经过一下楼就发现一个出租车往外面跑,叫也叫不住。(这个hotel没有前台,我也搞不清楚老板娘在那个地方,只能通过电话call she)。没有办法就在外面等,经过等了1 hours才等到一个车,可怜吧,呵呵。在等的过程中我就在研究india的马路上的车,大部分小车都比较低端,貌似那款铃木(仿mini的)那款在这个城市还比较多。高端车就没有看到,唯一比较高端的是在那个hotel一楼停车场的丰田的私欲。 说起hotel的一楼,india人的思维也比较奇诡,我们那边的1楼都用来做商品(靠近马路),这边直接就做车库,估计是不愿意搞地下车库。

    office还是不错,非常的大,而且有tea room,非常的不错。中午去了一趟office的食堂,中午食堂:2个咖喱搞的汤(a little),一个鸡蛋,还有一些油炸食品。吃不下,同事介绍说附近有一个shanghai chef,打个auto跑过去(taxi就打不到)才发现,全是假冒的,一点也不是Chinese food。

    出差india,苦啊!

posted @ 2009-08-31 20:11 不需要解释 阅读(238) | 评论 (0)编辑 收藏

      真没想到,户籍制度和计划生育制度协同发力,已经到如此荒谬的地步了!超过了所有的政治讽刺剧和黑色幽默剧。某些公民在自己的国家,已经无法结婚了!(见2009年8月6日南方周末)他们的子女,则无权在自己上学的地方参加高考,必须得返回一个可能从来没有去过的地方参加考试。

  听上去这些人怎么都不像是公民,而更像是俄国农奴或者美国黑奴。

  外地大学生,在北京毕业以后,被单位录用,如果不能得到正式的户口,可以得到一个集体户口。这已经被认为是幸运的了。没想到,集体户口在结婚时遇到麻烦。如果结婚,就要把户口迁出去,变成家庭户口,迁出去就要买房。现在上百万的房价,当然不是人人都买得起,刚毕业没几年的学生,更是难以负担。没有自己的住房,就没有正式的户口卡,没有户口卡,民政局就不给你发结婚证。

  那么,就在集体户口那里登记结婚不行吗?不行,如果在那里结婚,集体户口的管理者就要确保你不超生,不多生孩子。万一不能确保,一票否决,人家的前程就完了。那么,放弃集体户口,回到老家呢?也不行,别以为农业户口就那么容易得到。户籍制度的限制是双向的。小城镇也一样,许出不许进。

  即使你想办法结了婚,你生下来的孩子也相当于印度的低级种姓。虽然不是不可接触者,但时候一到,就让你尝尝厉害。你的孩子在北京学校里高高兴兴地上学,和其他孩子没什么区别。天天在力争上游,或许成绩还很优秀。但到了高考的时候,就傻了。你的孩子必须回到你原来的户口所在地去参加考试。课程不一样,活该!环境不适应,活该!那里早已没有亲人,没人照顾孩子,活该!

  最让人憋闷的是,并不是哪个具体的人在和你过不去,你想发泄都不知道去找谁。大家都是善良人,都为了这个国家好,都没想坑你,但你就是被玩儿了。玩儿得你一点辙都没有。

  为什么要有这么多糟糕的规定?一个政府为什么要这么处心积虑地难为自己的公民?原因就在于,总是有人,包括那些被玩儿的很惨的人,都相信,如果没有限制,人们就会蜂拥进入北京这样的大城市,那么,北京户籍人口就会遭到不公平,就会面对更激烈的竞争,就有可能败下阵来。必须保护他们,必须保护北京户籍人口。

  呸!

  首先声明,我就是北京户籍人口的一员。这样声明,是免得那些脏心烂肺、理解力低下的人以为我仅仅是在泄私愤。前两年我写文章大骂难为小产权房的人,许多人就认为,我是因为买了小产权房才这么愤怒,但我其实没买。我还没那种领先的经济意识。

  不过,我这样说当然也和我的私利有关。我的实际收入和经济利益,当然受到身边人水平、干劲和创造力的直接影响。我不想生活在一个如此荒唐、狭隘的社会里。我想有机会和尽可能大范围的优秀人士共同居住在一个城市中,而不想身边的人都是那些不思进取、离开政府保护就不能生存的家伙。

  重要的是,这个世界上,没有任何正当的法律、道德、伦理、传统规定:一个人偶然出生在哪里,他就有权利、有资格一直在那里生活。如果他负担不起生活费用,政府就必须禁止别人和他竞争,或者从别人那里抢来钱给他,保证他能在出生地继续生活。这种规定太荒唐可笑了。人是人,不是保护区的动物。

  如果你出生在北京,如果你是北京户籍人口之一,那仅仅证明你偶然出生在这里,或者政府曾经批准你居住在这里,仅此而已。如果你自己无能或者不努力,无法竞争过那些并非出生在这里的人,那你只好卷铺盖走人,别再继续在北京生活了。你可以去那些你可以负担起生活费的地方生活。

  很多人来到北京打拼,要在北京买房。房价于是上涨。你买不起了。那你只好租房。如果租也租不起,你倒说说看,除了离开北京之外,还有什么办法?

  大家一起参加高考,你的分数不如人家,人家就更应该上大学。难道仅仅因为你出生在这里,这里的大学就应该优先对你开放吗?你以为自己是婆罗门或者刹帝利吗?

  北京不是你的城市。属于你的,仅仅是你花钱购买、或者别人送给你的房子。除此之外的城市的广大范围,在权利的意义上和你无关。你不要动不动就以城市的主人自居,那是无耻的僭越。

  在精神上,你可以认为自己是城市的主人,但这种精神上的主人,仅仅表现为你应该用自己的努力发扬光大这个城市的精神和原则。城市为所有人提供一个和他人自由合作的场所。城市的精神和原则天生就是自由。人们在城市中,可以更大限度地互相激发,创造力有更大发挥的空间。在这种精神中,丝毫也找不到自闭、限制、停滞、寄生之类的概念

  而且,作为北京户籍人口之一,我从来没有委托过任何官员,请他们帮助我排除外来竞争,禁止其他人在这个城市里比我表现得更加优秀。我也不认为,任何人有权利这样去做,不管他出生在哪里。

  我认为,相关官员这样想,这样做,是对包括我在内的北京户籍人口的侮辱,是在把我们看作毫无竞争力的废物,是对我们人格和尊严的蔑视。我不需要他们的这种保护,我自信可以参与竞争并在这个城市中争取到自己的位置。如果成功,我将享受自己的努力结果,如果不成功,我也不需要别人替我负责。我不是他们的奴隶,他们也不是我的主子。

  实际上,北京户籍人口这个词,引起我极大的嫌恶。如果说,集体户口让我联想到农奴,户籍人口则让我联想到圈养牲口。实际上,饲养者是在以貌似慈祥,实则傲慢的态度看待这些被饲养者。可憎的是,许多被饲养者还因此萌生出优越感,自以为高人一等。真是TMD天生的奴才!

  当然,除了奴才以外,更多的人是糊涂。他们多年受到片面性的宣传。不知不觉中,他们已经习惯从被饲养者的角度看世界,把所有其他人都看作和他抢食的被饲养者。他们已经不能想象还有无需饲养、可以自己创造世界的大写的人的存在。他们真心恐惧城市的开放,恐惧自由竞争,恐惧失去政府的保护。众多被饲养者的存在,是貌似慈祥、实则傲慢的官员的坚定靠山。就是凭借着这巨大的靠山,官员们才弄出让公民甚至无法结婚的黑色闹剧。

  我个人当然无力改变这种闹剧,但我乐于看到所有想在北京凭借诚实劳动谋生存、谋发展的人积极地主张自己的权利。我建议他们的主张要和平和非暴力,要持之以恒和坚持到底。历史上无数的成功先例可以供他们借鉴。权利的获得从来都不是轻松的,但许多时候,权利是最后的赢家。

posted @ 2009-08-10 12:17 不需要解释 阅读(177) | 评论 (0)编辑 收藏

我实话告诉你们,我可是身经百战了.bbs我见的多了,哪个版我没灌过?你们要知道, 一塌糊 涂的triangle,PIC,SEX版,那比你们不知道厉害到哪里去了,我在那谈笑风声.你 们有一好就是无论在哪个版,什么话题都灌,但是灌来灌去的问题,都too simple, sometimes naive!你 们懂不懂呀?啊?所以说灌水啊,关键是要提高自己的知识水平.你 们啊,不要总想着弄个大坑,然后灌上十大,再把我羞辱一番……你们啊,naive!你们这 样灌是不行地!~那你問我支持 不支持灌水,我說支持,我常來這裡灌,你說支持不支持?