Thursday, 10 March 2011

Deploying Enterprise Java Beans file

There are actually 3 ways to deploy the Java source files into the server. The 3 ways are:
  1. Deploy using the Web Console
  2. Deploy Using the Hot Deploy Folder
  3. Deploy Using the Command Line
Deploy Using the Web Console Geronimo
Start the server and navigate to this address: http://localhost:8080/console
Enter the username and password
On the left handed menu, under Applications, click on Deploy New


At this page, select the appropriate file to be deploy into the server as shown below:

Click install after selecting the folder and it will displays its status whether if it is deploy successfully or vice versa.

Deploy Using the Hot Deploy Folder Geronimo
  1. Navigate to the geronimo home directory
  2. Navigate to the deploy directory
  3. Copy the EJB file into the deployment folder
  4. Open the browser and type the localhost and context root address

Deploy Using the Command Line Geronimo
For my commands as show above, I copy my .ear file into geronimo home folder. cd into the geronimo home folder and execute this command:


This should concludes the 3 different ways of deploying Java .war or .ear files into the Geronimo. 

Integrating Geronimo with Eclipse

Installing Eclipse
Installing Eclipse require these softwares:
  • JDK 5.0 (J2SE 5.0)
  • Eclipse 3.3.1.1 (Eclipse Classic package of Europa distribution), which is platform specific
  • Web Tools Platform (WTP) 2.0.1
  • Data Tools Platform (DTP) 1.5.1 file:///media/thumbDrive/Entertainment/Music/09-ost-cursed-clock-tower.mp3
  • Eclipse Modeling Framework (EMF) 2.3.1
  • Graphical Editing Framework (GEF) 3.3.1
Step 1:
Download the eclipse software.
http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.3.2-200802211800/eclipse-SDK-3.3.2-linux-gtk.tar.gz

Step 2:
Download the Web Tools Platform
http://download.eclipse.org/webtools/downloads/drops/R2.0/R-2.0.1-20070926042742/

Step 3:
Install the Web tools Platform, Data tools platform, Eclipse Modeling Framework and Graphical Editing Framework into the Eclipse home.

Step 4:
Start the eclipse command:
# cd <eclipse_home>
# ./eclipse


Launching Eclipse with Geronimo
1) Define a new server





2) Click on the 'Download additional server adapters

3) Select the appropriate server driver to connect eclipse to Geronimo server. Currently the server adaptor for geronimo 2.1 is still not available for download.

4) Select the server adapter after complete downloading the adapter into eclipse




5) Click on next to set the Username and Password for Geronimo and click finish






6) Back to the eclipse, select the Server tab and click on the button to start the server

After attempting the necessary steps, i should be able to see the Geronimo page on the browser.
My next post show how to deploy web applications into Geronimo.

Apache Geronimo - The open source app server for every developers

There are a number of application servers in the market and a few which i can named are weblogic, websphere, tomcat, jboss, etc.
Weblogic, Websphere, TomCat, Jboss 是一些在市场上软件开发人员使用的 Application Servers。

I noticed that not many developers are using Geronimo, therefore i decided to check the performance of Geronimo.
我注意到,许多软件开发人员都没有使用Geronimo,所以我决定检查Geronimo的表现和用途。

Geronimo is a server runtime framework that pulls together the best Open Source alternatives to create runtimes that meet the needs of developers and system administrators. So how to use Geronimo and how is it compare to jboss?
Geronimo是一个 App Server 运行时框架, 组在一起最好的开源替代品,以满足运行时创建软件开发人员和系统管理员的需求。因此,如何使用 Geronimo 以及与 JBoss 相比?

The version of Geronimo which i have tested is V2.1 on Linux OS. Let me start with installing Geronimo in Linux.
Geronimo的V2.1版本,我已经测试在 Linux 操作系统(SUSE Linux OS).以下是在Linux上安装Geronimo 的步骤。


Untar the Geronimo folder and place in any directory path.
# tar -zxvf <Geronimo-Compress-Folder>

cd into the Geronimo directory
# cd <Geronimo-Folder>

To start the Geronimo in background, enter these commands:
# cd <Geronimo-Folder>/bin
# ./startup.sh

To start the Geronimo in foreground, enter these commands:
# cd <Geronimo-Folder>
# ./bin/geronimo.sh run

To check if the server is running, type:

Changing Port Number
  1. Open up file in <geronimo_folder>/var/config/config-substitutions.properties
  2. At the line HTTP Port=1982 change to the appropriate port number
Create New User and Password
  1. User Names can be created in groups.properties file
  2. Password are set in users.properties file
  3. Both files can be found in <geronimo_folder>/var/security

After following the steps above, Geromino should be running in your system.
执行上述步骤后,Geromino可以使用在您的系统。

In my next post, i will document how to use eclipse to start Geronimo. 
在我的下一个岗位,我将记录如何使用Eclipse来启动 Geronimo。

Install Wine to use common Windows Programs

Install wine either from the linux flavour repository or download from wine
After installing, insert the software installation disk.
To start installing"
# wine /<name_of_directory_to_the_executable>/*.exe

After installing, navigate to where the installed file is.
For my case, i installing DreamWeaver. Therefore is will be
# cd /home/chongming/.wine/drive.c/Program Files/Macromedia/Dreamweaver8

Execute the program:
# wine Dreamweaver.exe

To remove the wine contents. simply:
rm -rf ~/wine

Using Price to Sales ratio to value a security

I decided to take CFA mainly because i believe that it can help me to improve my fundamental analysis. Therefore i have been introduce to many mathematical formulas such as P/E ratio, P/S ratio, etc.

P/E ratio is useful if the company is earning profits. If a company P/E is negative, investor can use the P/S ratio (Price to sales ratio) to guage the security value. I have read that sales revenue is not easy to manipulate or distort as EPS and book value, which are significantly affected by accounting conventions.

However i have accidentally found that P/S ratio does not show to be a very good metrics even when the financial statements are not manipulate. It depends on the way how the business is conducted. This is one of my personal experience.

I started an online selling business by creating and program a online shopping cart a few years ago. After a few years, i decided to wind up the online selling business, therefore i decided to sell off all my inventory to get back some of the capital i invested.

So i decided to sell my inventory in discounts。 In the end, my revenue for the past 2 months surge to high volumes. At this point of time, i recorded my revenue once i received the cash in my bank account. I don't keep receivables!!!(this shows i keep an extremely conservative accounting. heehee...)

So lets apply this scenario to a listed company. If the company use this method to increase revenue, buying items at cost price of $10 but sell at $9, is the company growing?
Does this surging of revenue which will lower the P/S ratio alert investors that this is a good buy? I don;t think so.
Anyway ratios are use to gauge and compare. Using it as a buying decision is a wrong move.

我决定采取注册CFA课程,主要是因为我相信它可以帮助我提高我的投资基本分析。因此,我已介绍,如 P/E 比率,P/S 比率等许多数学公式。
 
P/E 比值是有用的比率要是公司赚取利润。如果一家公司的 P/E 为负,投资者可以使用 P/S 比率 (Price to Sales ratio) 来衡量安全值。我已阅读过,销售收入不容易操纵或歪曲为 EPS 和账面价值,这是显着的会计惯例的影响。

这是我个人的经验之一, 我偶然发现,P/S 比值不显示是一个很好的指标,即使在不能操纵财务报表。这取决于企业是如何进行的方式。


几年前, 我开始通过创建和程序一个在线购物车网上销售业务。经过几年的投入,决定结束我的网上销售业务,因此我决定卖掉我所有的库存,以取回一些我的资本。

所以我决定打折出售库存。结果,收入在2个月上升到高容量。在这个时候,我一旦收到了现金,我立即记录收入进入帐户。 应收账款在我的帐户里是不存在的。

因此,让我申请此方案的上市公司。如果公司使用此方法来增加收入,买10元的按成本,价出售的物品在9美元,公司
是在成长吗?公司有在真正的赚钱吗? 这是否会是个好投资?我觉得那不是个好投资。

总之比率来衡量和比较,用
P/S ratio 作为购买决定是一个错误的举动。

Wednesday, 9 March 2011

Setup Java classpath in Linux

For windows, i simply setup the classpath using environment variables.

In linux, i need to manually write in the filepath in ./bashrc(SUSE) or ./bash(slackware)
Use the vi editor to add in the lines

These are some of the classpath i need to set in my linux machine:
export PATH = /home/chongming/jdk1.5/bin:/home/chongming/maven/bin:$PATH
export J2EE_HOME = "/home/chongming/jdk1.5"
export M2_HOME = "/home/chongming/maven"
export CLASSPATH = .:/home/chongming/jdk1.5

After saving the file, open up a terminal and type javac for javato see if the classpath is setup correctly

Video support for slackware linux: Radeon Xpress 1100

I'm using slackware 12.1 and its original configuration could not support the video card. I need to manually install the driver in this case.

Use this to list all hardware in the machine
# lspci

From the results after submitting the above command, use the displayed hardware model number to find the driver online.
The driver can be found at http://ati.amd.com/support/drivers/linux/linux-radeon.html or http://ati.amd/com/support/driver.html
On the website, select Linux ---> Radeon---> Xpress 1300 and d/l the driver.
If the software is not with the website anymore, send me a message and i can send the file to you.

Login as root to install

Type this commanf to list all packages for different distros.
# sh ./ati-driver-installer-8-10-x86.x86-64.run --list pkg

I'm using Slackware so i shall use this command:
# sh ./ati-driverXXX.run --buildpkg Slackware/All
# installpkg <the_file_name_generate _from_buildpkg>
# aticonfig --initial
Restart the X server to see the changes

Cash flow Forecasting

Why cash forecasting? A cash forecasting model is an essential tool for treasuer to manage working capital. Forecasting preempt treasurer ...