2010年10月30日 星期六

Top 25 Best Linux Commands

Top 25 Best Linux Commands

Since, I switch to linux for a year and more, to process those tasks come to me using commands is already become a normal thing to me.
The page gives a very nice introduction top 25 linux commands for user.

2010年10月18日 星期一

Reading Excel file from python in Linux

Excel is the most widely used application in MS-Office suite. It all most ubiquitous in every platform. Today a colleague of mine want me dealing with a excel file to retrieve some content in the Excel file. So, the first thing come to my mind is can this be done by python, and under my ubuntu box? Then, I found this xlrd project. Basically, xlrd provides the reading Excel file capabilities for programmer. Hence, we can extract the data from Excel file very easily. Xlrd also support Excel 2007.

參考來源: Lingfo - xlrd extension (在「Google 網頁註解」中檢視)

2010年10月4日 星期一

What if the hql query is a row return ?

Sometimes we want to select several tables using join in hql, however, the result of the selection maybe is not defined in your data model. When encounter this kinds of situation, we will need the following code to solve it.
The selection data will stay in a record set using a for loop to retrive the fields and row.

Query query = session.createQuery(SQL_QUERY);
for(Iterator it=query.iterate();it.hasNext();){
Object[] row = (Object[]) it.next();
System.out.println("ID: " + row[0]);
System.out.println("Name: " + row[1]);
System.out.println("Amount: " + row[2]);
}

參考來源:

"Query query = session.createQuery(SQL_QUERY);  for(Iterator it=query.iterate();it.hasNext();){        Object[] row = (Object[]) it.next();        System.out.println("ID: " + row[0]);        System.out.println("Name: " + row[1]);        System.out.println("Amount: " + row[2]);      }"
- Hibernate Select Clause (在「Google 網頁註解」中檢視)

2010年10月2日 星期六

JUNit 4 Skill

I had written a post about how to use JUnit 4 with Spring almost 2 years ago, that time I didn't have much insight on that. Then 2 years latter, I read http://www.wakaleo.com/resources/presentations/287-junit-kung-fu-getting-more-out-of-your-unit-tests, it really impress me. It tells me JUnit 4 has a lot of features to assist us to make a good coverage on the code.

參考來源: JUnit Kung Fu: Getting More Out of Your Unit Tests (在「Google 網頁註解」中檢視)

2010年9月30日 星期四

How to test a WPF user interface?

We are discussion about how to enable some automatic testing by using tools. So, I try to google some existing solutions, the first free/open source solution I pick is python based framework such as dogtail and watsup. However, the UBox SOD application is written using WPF, none of tool in python can make this happen. Then I found this post and one of the people suggest a tool called TestAutomationFX, so I download and spent some time on the tool. I found it really easy to use. That reason I blog this here.

參考來源:

"TestAutomationFX"
- How to test a WPF user interface? - Stack Overflow (在「Google 網頁註解」中檢視)

2010年9月28日 星期二

Promoted as a Manager is killing my technical profession career

This post is not a complain, instead I encourage myself, even now I am promoted as a manager of a department, I still need to absorption the new things in IT field. After all, who know how long I will be in this position.
Anyway, I am very serious consider to switch the spring framework used in Engineering Data Bank. Now 2.5.6SEC0 was adopt as the basic infrastructure of the system, however, Spring makes a lot of improvement on easy to use and other integration. I think this will be a important job and need a lot of effort on this action. So, I may leave this to the one who is take over my coding task. Well, I think this is the first symptom been promote, right ? ahn ...

參考來源: Spring 3 Makes Use of Embedded Databases Easy | Javalobby (在「Google 網頁註解」中檢視)

Some notes on pyactivemq on ubuntu

Today, my colleague wants to install pyactivemq, I gave him this link, however, this link doesn't specify very clear about the version of APR and I also forgot which version I pick that time. So, it really depress my colleague. Finally, The version of APR issue come to my mind. After I told him to uninstall the APR 1.4.2 to 1.3.12, then he pass the make all process of the ActiveMQ-CPP. Well, I think I should blog thing I do more often.

參考來源: night tale » pyactivemq on Ubuntu (在「Google 網頁註解」中檢視)