煩惱歲月

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

          2010年5月16日

          自動地可視化表示數據庫也可以讓您受益匪淺。實體關系圖(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 不需要解釋 閱讀(543) | 評論 (0)編輯 收藏

          2010年5月4日

               參加工作也已經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 不需要解釋 閱讀(308) | 評論 (0)編輯 收藏

          2010年4月19日

              最近在看一些項目的代碼,總是發現很少項目提供出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 不需要解釋 閱讀(1890) | 評論 (0)編輯 收藏

          2010年4月16日

                 盡管工作了5年多了,現在能想起來的培訓真的是少之又少,但是我想以后,我一定不會這樣說了,因為我參加了百支了!

                 百支對于我來說是一次清洗,洗掉以前的惡習,洗掉以前的老思維,重新培養我丟掉已久的價值觀,重新找回往日的激情。來阿里之后,也一直在想一個問題,阿里和我以前公司有什么不同?或者說有什么特別的之處?其實這個問題有很簡單,就是阿里是一家有夢想的公司,一家有價值觀的公司,一家有親情,友情的公司,一家工作生活一體的公司,從中國來看,阿里是唯一一家大的公司,而且價值體系貫徹的這么好的公司,only one in china。

                百支培訓了很多業務知識,傳統線,虛擬線,兄弟線,安全線,資金線,…學到了很多東西。

                百支的培訓,讓我開始結識了新的同學,新的家人,新的伙伴,讓我們happly every day! 認真工作,快樂生活!

          posted @ 2010-04-16 21:48 不需要解釋 閱讀(422) | 評論 (0)編輯 收藏

          2009年11月10日

             隨著網絡技術的發展,很多惡意程序往往按照常規方法無法徹底刪除。有沒有什么方法能夠在不安裝任何第三方工具的情況下,刪除它們呢?筆者經過多年實踐,告訴大家一個秘密武器--關閉Explorer進程法。

            在服務器系統出現問題時,例如某個文件無法刪除,某個程序假死或者是系統沒有響應都可以按CTRL+SHIFT+ESC,調出Windows任務管理器。接下來找到“進程”標簽,將“explorer.exe”進程關閉。接下來整個桌面就會消失,只剩下桌布了。然后通過Windows任務管理器的“文件”菜單下的“新建任務(運行)”打開“創建新任務”窗口,通過“瀏覽”按鈕找到要刪除文件所在目錄,在瀏覽窗口里直接刪除即可。99%都可以將這個頑固的文件刪除,刪除后繼續選擇“文件”菜單下的“新建任務(運行)”打開“創建新任務”窗口,在打開處輸入命令--explorer后回車,我們將返回到正常的桌面界面下。顯然,對付頑固文件,這個方法尤為簡單。

          posted @ 2009-11-10 16:19 不需要解釋 閱讀(237) | 評論 (0)編輯 收藏

          2009年11月8日

              1、專注于構建一個強有力的團隊,這一團隊能夠解決困難的問題,并為客戶創造真正的價值。
            2、領導者鼓舞;管理者授權。要同時成為優秀的領導者和管理者,你需要就愿景進行溝通并理解其細節。
            3、對可能出現的障礙有所準備,防微杜漸,在這些障礙尚未壯大時就清除它們。
            4、花時間來仔細傾聽別人的意見,但不要過于擔心其他人的想法。
            5、專注于事實。
            6、充當一個衰減器,而不是放大器,為團隊提供穩定性。
            7、永遠不要將不能解釋的事情歸咎為蓄意破壞。
            8、培養幽默意識來作為嚴肅認真的一種平衡:對工作一絲不茍,對自己輕松自如。
            9、除了工作,還應該懂得享受生活,而且每年要讀25本書。
            10、相信你的直覺:如果你感覺不妙,那么很可能預感就會成真。

          posted @ 2009-11-08 03:10 不需要解釋 閱讀(235) | 評論 (0)編輯 收藏

          2009年11月2日

          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 不需要解釋 閱讀(312) | 評論 (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 不需要解釋 閱讀(2014) | 評論 (0)編輯 收藏

          2009年10月19日

          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 不需要解釋 閱讀(778) | 評論 (0)編輯 收藏

          2009年10月17日

          有個大師說過一句話,有人的地方就有江湖,有江湖的地方就有斗爭。今天在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 不需要解釋 閱讀(353) | 評論 (0)編輯 收藏

          我實話告訴你們,我可是身經百戰了.bbs我見的多了,哪個版我沒灌過?你們要知道, 一塌糊 涂的triangle,PIC,SEX版,那比你們不知道厲害到哪里去了,我在那談笑風聲.你 們有一好就是無論在哪個版,什么話題都灌,但是灌來灌去的問題,都too simple, sometimes naive!你 們懂不懂呀?啊?所以說灌水啊,關鍵是要提高自己的知識水平.你 們啊,不要總想著弄個大坑,然后灌上十大,再把我羞辱一番……你們啊,naive!你們這 樣灌是不行地!~那你問我支持 不支持灌水,我說支持,我常來這裡灌,你說支持不支持?
          主站蜘蛛池模板: 通化县| 三门县| 资讯 | 兴义市| 新巴尔虎左旗| 大港区| 贺兰县| 榆树市| 东兴市| 呼玛县| 石屏县| 呼伦贝尔市| 青川县| 行唐县| 慈溪市| 鄢陵县| 新兴县| 荣昌县| 皮山县| 称多县| 和田县| 澄江县| 潮州市| 资溪县| 松溪县| 社会| 普宁市| 蚌埠市| 兴安盟| 天峻县| 永新县| 涿州市| 盐津县| 萍乡市| 安多县| 克东县| 湘潭市| 永宁县| 临猗县| 新乡县| 都江堰市|